diff --git a/assets/Basic-BA5ubWIJ.js b/assets/Basic-BA5ubWIJ.js new file mode 100644 index 0000000000000000000000000000000000000000..016f4f050e9cc22cb32514922b9d0f6d699b61de --- /dev/null +++ b/assets/Basic-BA5ubWIJ.js @@ -0,0 +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-BtAisBe9.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/Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js b/assets/Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js deleted file mode 100644 index 5c24f84ed05cd88b1c9697b4e10d6507517f9612..0000000000000000000000000000000000000000 --- a/assets/Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js +++ /dev/null @@ -1 +0,0 @@ -import{d as c,cg as d,ch as f,e as s,w as p,bh as v,ca as h,o as x,c as y,a3 as _}from"./index-D7HCX4VR.js";const w=c({__name:"Basic",props:{modelValue:{default:""},modelModifiers:{}},emits:d(["submit"],["update:modelValue"]),setup(n,{emit:u}){const r=u,e=f(n,"modelValue"),a=s(),o=s("auto");function i(t){t.code==="Enter"&&!t.shiftKey&&(t.preventDefault(),r("submit",e.value))}return p(e,()=>{o.value="auto",requestAnimationFrame(()=>{a.value&&(o.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(t,l)=>v((x(),y("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":l[0]||(l[0]=m=>e.value=m),style:_({height:o.value}),onKeydown:i},null,36)),[[h,e.value]])}});export{w as _}; diff --git a/assets/Button-BUWHo0FI.js b/assets/Button-BUWHo0FI.js new file mode 100644 index 0000000000000000000000000000000000000000..69f178028656e524384bcd51f1bead894183d12b --- /dev/null +++ b/assets/Button-BUWHo0FI.js @@ -0,0 +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-BtAisBe9.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/Button-D6PjaMaR.css b/assets/Button-D6PjaMaR.css new file mode 100644 index 0000000000000000000000000000000000000000..256bdd3af122da28d88b335c363f378b1f3d0f28 --- /dev/null +++ b/assets/Button-D6PjaMaR.css @@ -0,0 +1 @@ +.skeleton[data-v-f404da2a]{transition:all .2s ease-in-out;position:relative}.skeleton-pulse[data-v-f404da2a]{animation:1.5s ease-in-out .5s infinite skeleton-pulse-f404da2a}@keyframes skeleton-pulse-f404da2a{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.skeleton-wave[data-v-f404da2a]:after{content:"";border-radius:inherit;background:linear-gradient(90deg,#0000,#fff3,#0000);animation:1.5s infinite skeleton-wave-f404da2a;position:absolute;top:0;bottom:0;left:0;right:0;transform:translate(-100%)}.dark .skeleton-wave[data-v-f404da2a]:after{background:linear-gradient(90deg,#0000,#ffffff1a,#0000)}@keyframes skeleton-wave-f404da2a{0%{transform:translate(-100%)}60%{transform:translate(100%)}to{transform:translate(100%)}} diff --git a/assets/Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js b/assets/Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js deleted file mode 100644 index 7df47526c799ffe0e955228665c23af83ca7514b..0000000000000000000000000000000000000000 --- a/assets/Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js +++ /dev/null @@ -1 +0,0 @@ -import{d as i,bf as v,o as s,cm as b,bg as c,bA as d,f as r,c as t,X as o,a as y,b as h,u as k,W as n,Y as C}from"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */const x=i({__name:"BidirectionalTransition",props:{fromClass:null,activeClass:null,toClass:null},setup(e){return(a,l)=>(s(),v(b,{"enter-from-class":e.fromClass,"enter-active-class":e.activeClass,"enter-to-class":e.toClass,"leave-from-class":e.toClass,"leave-active-class":e.activeClass,"leave-to-class":e.fromClass},{default:c(()=>[d(a.$slots,"default")]),_:3},8,["enter-from-class","enter-active-class","enter-to-class","leave-from-class","leave-active-class","leave-to-class"]))}}),p=["disabled"],w={class:"flex flex-row items-center justify-center"},B={key:0,class:"mr-2 w-4"},z={key:0,class:"i-svg-spinners:ring-resize h-4 w-4"},N={key:0},T=i({__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){const a=e,l=r(()=>a.disabled||a.loading),u={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"},f={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},m=r(()=>["rounded-lg font-medium outline-none transition-all duration-200 ease-in-out","disabled:cursor-not-allowed disabled:opacity-50",a.block?"w-full":"",f[a.size],u[a.variant],{"opacity-50 cursor-not-allowed":l.value},"focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900"]);return(g,V)=>(s(),t("button",{disabled:l.value,class:o(m.value)},[y("div",w,[h(k(x),{"from-class":"opacity-0 mr-0! w-0!","active-class":"transition-[width,margin] ease-in-out overflow-hidden"},{default:c(()=>[e.loading||e.icon?(s(),t("div",B,[e.loading?(s(),t("div",z)):e.icon?(s(),t("div",{key:1,class:o(["h-4 w-4",e.icon])},null,2)):n("",!0)])):n("",!0)]),_:1}),e.label?(s(),t("span",N,C(e.label),1)):d(g.$slots,"default",{key:1})])],10,p))}});export{T as _}; diff --git a/assets/CardCreate-BjhXcczV.js b/assets/CardCreate-BjhXcczV.js deleted file mode 100644 index 2be4ff17ccdf3e5f3d117a9148f873eb229f6772..0000000000000000000000000000000000000000 --- a/assets/CardCreate-BjhXcczV.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as m}from"./CardCreate.vue_vue_type_script_setup_true_lang-cT8qsPWn.js";import"./index-D7HCX4VR.js";export{m as default}; diff --git a/assets/CardCreate-qkn1QwRd.js b/assets/CardCreate-qkn1QwRd.js new file mode 100644 index 0000000000000000000000000000000000000000..ee229ab1445af78a8ed3f25e95fa2af0bb0699b2 --- /dev/null +++ b/assets/CardCreate-qkn1QwRd.js @@ -0,0 +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-BtAisBe9.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-s77DpRUP.js b/assets/CardCreate-s77DpRUP.js new file mode 100644 index 0000000000000000000000000000000000000000..d06d45c2f1cd232f554e032ebf152bd09c7c7041 --- /dev/null +++ b/assets/CardCreate-s77DpRUP.js @@ -0,0 +1 @@ +import{CardCreate_default as e}from"./CardCreate-qkn1QwRd.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreate.vue_vue_type_script_setup_true_lang-cT8qsPWn.js b/assets/CardCreate.vue_vue_type_script_setup_true_lang-cT8qsPWn.js deleted file mode 100644 index aecb0d3487b193c5ee36c2d9ab98ad8d94e5b54f..0000000000000000000000000000000000000000 --- a/assets/CardCreate.vue_vue_type_script_setup_true_lang-cT8qsPWn.js +++ /dev/null @@ -1 +0,0 @@ -import{d as a,$ as o,c as n,o as s,a as r,Y as d,u as i}from"./index-D7HCX4VR.js";const l={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"},b=a({__name:"CardCreate",setup(u){const{t}=o();return(p,e)=>(s(),n("div",l,[e[0]||(e[0]=r("div",{"i-solar:add-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),r("p",c,d(i(t)("settings.pages.card.create_card")),1)]))}});export{b as _}; diff --git a/assets/CardCreationDialog-BD9l8__M.js b/assets/CardCreationDialog-BD9l8__M.js deleted file mode 100644 index 5044ac78b7e86b8a1d7595e67f9075729fa827a9..0000000000000000000000000000000000000000 --- a/assets/CardCreationDialog-BD9l8__M.js +++ /dev/null @@ -1,195 +0,0 @@ -import{_ as ee}from"./Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js";import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as fe,cg as R,ch as ve,c2 as ye,c as f,o as m,a as n,bh as Ve,ci as J,W as K,Y as w,c3 as ge,c4 as be,b as u,a5 as he,$ as we,e as q,f as N,bf as $e,bg as C,u as t,X as te,bE as b,bd as ke,b_ as qe}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as Ce}from"./airi-card-xdAfH1PV.js";import{_}from"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{_ as Re}from"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";/* empty css */import{I as Ie,$ as Ee,P as Me,B as Pe,n as Ue}from"./index-Cynu-bMx.js";import"./consciousness-CZ80YtY5.js";import"./providers-DepZj6_J.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./speech-D8cCufg2.js";const Le={class:"max-w-full"},Be={class:"flex flex-col gap-2"},Se={class:"flex items-center gap-1 text-sm font-medium"},He={key:0,class:"text-red-500"},Ne={class:"text-nowrap text-xs text-neutral-500 dark:text-neutral-400"},je={class:"~ col gap-2"},De=["onClick"],ze=fe({__name:"FieldValues",props:R({label:null,description:null,name:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:R(["remove","add"],["update:modelValue"]),setup(s,{emit:i}){const l=s,d=i,e=ve(s,"modelValue");function $(){e.value.push(""),d("add")}function y(o){e.value.splice(o,1),d("remove",o)}return(o,V)=>{const p=ye("auto-animate");return m(),f("div",Le,[n("label",Be,[n("div",null,[n("div",Se,[J(w(l.label)+" ",1),l.required!==!1?(m(),f("span",He,"*")):K("",!0)]),n("div",Ne,w(l.description),1)]),Ve((m(),f("div",je,[(m(!0),f(ge,null,be(e.value,(v,h)=>(m(),f("div",{key:h,class:"w-full flex items-center gap-2"},[u(Re,{modelValue:e.value[h],"onUpdate:modelValue":x=>e.value[h]=x,placeholder:l.valuePlaceholder,class:"w-90%"},null,8,["modelValue","onUpdate:modelValue","placeholder"]),n("button",{"i-solar:minus-circle-line-duotone":"",size:"6",class:"min-w-20px w-10% flex text-red-500",onClick:x=>y(h)},null,8,De)]))),128)),n("div",{"i-solar:add-circle-line-duotone":"",size:"6",class:"mt-2 w-4/5 text-blue-500",onClick:$})])),[[p]])])])}}});/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var j,ae;function Ae(){if(ae)return j;ae=1;function s(i){return i.toLowerCase()}return j=s,j}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var D,re;function Te(){if(re)return D;re=1;var s=Ae();return D=s,D}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var z,se;function Fe(){if(se)return z;se=1;function s(i,l,d){return i.replace(l,d)}return z=s,z}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var A,ie;function _e(){if(ie)return A;ie=1;var s=Fe();return A=s,A}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var T,le;function We(){if(le)return T;le=1;var s=typeof String.prototype.trim<"u";return T=s,T}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var F,ne;function xe(){if(ne)return F;ne=1;var s=String.prototype.trim;return F=s,F}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var W,oe;function Ge(){if(oe)return W;oe=1;var s=xe(),i=` - \r -\f\v            \u2028\u2029   \uFEFF`,l="᠎";function d(){return s.call(i)===""&&s.call(l)===l}return W=d,W}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var G,ue;function Oe(){if(ue)return G;ue=1;var s=_e(),i=/^[\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 l(d){return s(d,i,"$1")}return G=l,G}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var O,de;function Xe(){if(de)return O;de=1;var s=xe();function i(l){return s.call(l)}return O=i,O}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var X,ce;function Ye(){if(ce)return X;ce=1;var s=We(),i=Ge(),l=Oe(),d=Xe(),e;return s&&i()?e=d:e=l,X=e,X}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var Y,pe;function Ze(){if(pe)return Y;pe=1;var s=Te(),i=_e(),l=Ye(),d=/\s+/g,e=/[!"'(),–.:;<>?`{}|~\/\\\[\]_#$*&^@%]+/g,$=/([a-z0-9])([A-Z])/g;function y(o){return o=i(o,e," "),o=i(o,$,"$1 $2"),o=l(o),o=i(o,d,"-"),s(o)}return Y=y,Y}/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/var Z,me;function Je(){if(me)return Z;me=1;var s=Ze();return Z=s,Z}var Ke=Je();const Qe=he(Ke),et={class:"w-full flex flex-col gap-5"},tt={class:"mt-4"},at={class:"border-b border-neutral-200 dark:border-neutral-700"},rt={class:"flex justify-center -mb-px sm:justify-start space-x-1"},st=["onClick"],it={class:"flex items-center gap-1"},lt={key:0,class:"w-full rounded-xl bg-red900"},nt={class:"w-full p-4"},ot={key:1,class:"tab-content ml-auto mr-auto w-95%"},ut={class:"mb-3"},dt={class:"input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8"},ct={key:2,class:"tab-content ml-auto mr-auto w-95%"},pt={class:"input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8"},mt={key:3,class:"tab-content ml-auto mr-auto w-95%"},ft={class:"input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8"},vt={class:"ml-auto mr-1 flex flex-row gap-2"},gt=fe({__name:"CardCreationDialog",props:R({modelValue:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:R(["update:modelValue"],["update:modelValue"]),setup(s,{emit:i}){const l=i,d=ve(s,"modelValue"),{t:e}=we(),$=Ce(),y=q(""),o=[{id:"identity",label:e("settings.pages.card.creation.identity"),icon:"i-solar:emoji-funny-square-bold-duotone"},{id:"behavior",label:e("settings.pages.card.creation.behavior"),icon:"i-solar:chat-round-line-bold-duotone"},{id:"settings",label:e("settings.pages.card.creation.settings"),icon:"i-solar:settings-bold-duotone"}],V=N({get:()=>{var c;return o.find(a=>a.id===y.value)?y.value:((c=o[0])==null?void 0:c.id)||""},set:c=>{y.value=c}}),p=q(!1),v=q("");function h(c){const a=ke(c);if(a.name.length>0)if(/^(?:\d+\.)+\d+$/.test(a.version))if(a.description.length>0)if(a.personality.length>0)if(a.scenario.length>0)if(a.systemPrompt.length>0){if(!(a.postHistoryInstructions.length>0))return p.value=!0,v.value=e("settings.pages.card.creation.errors.posthistoryinstructions"),!1}else return p.value=!0,v.value=e("settings.pages.card.creation.errors.systemprompt"),!1;else return p.value=!0,v.value=e("settings.pages.card.creation.errors.scenario"),!1;else return p.value=!0,v.value=e("settings.pages.card.creation.errors.personality"),!1;else return p.value=!0,v.value=e("settings.pages.card.creation.errors.description"),!1;else return p.value=!0,v.value=e("settings.pages.card.creation.errors.version"),!1;else return p.value=!0,v.value=e("settings.pages.card.creation.errors.name"),!1;return p.value=!1,$.addCard(a),d.value=!1,!0}const x=q({name:e("settings.pages.card.creation.defaults.name"),nickname:void 0,version:"1.0",description:"",notes:void 0,personality:e("settings.pages.card.creation.defaults.personality"),scenario:e("settings.pages.card.creation.defaults.scenario"),systemPrompt:e("settings.pages.card.creation.defaults.systemprompt"),postHistoryInstructions:e("settings.pages.card.creation.defaults.posthistoryinstructions"),greetings:[],messageExample:[]});function g(c,a){return N({get:()=>x.value[c]??"",set:r=>{const k=r.trim();x.value[c]=k.length>0?a?a(k):k:""}})}const I=g("name",c=>Qe(c)),E=g("nickname"),M=g("description"),P=g("notes"),U=g("personality"),L=g("scenario"),Q=N({get:()=>x.value.greetings??[],set:c=>{x.value.greetings=c||[]}}),B=g("version"),S=g("systemPrompt"),H=g("postHistoryInstructions");return(c,a)=>(m(),$e(t(Ue),{open:d.value,"onUpdate:open":a[12]||(a[12]=r=>l("update:modelValue",r))},{default:C(()=>[u(t(Ie),null,{default:C(()=>[u(t(Ee),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm"}),u(t(Me),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6"},{default:C(()=>[n("div",et,[u(t(Pe),{"text-2xl":"","font-bold":"",class:"from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent"},{default:C(()=>[J(w(t(e)("settings.pages.card.create_card")),1)]),_:1}),n("div",tt,[n("div",at,[n("div",rt,[(m(),f(ge,null,be(o,r=>n("button",{key:r.id,class:te(["px-4 py-2 text-sm font-medium",[V.value===r.id?"text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400":"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300"]]),onClick:k=>V.value=r.id},[n("div",it,[n("div",{class:te(r.icon)},null,2),J(" "+w(r.label),1)])],10,st)),64))])])]),p.value?(m(),f("div",lt,[n("p",nt,w(v.value),1)])):K("",!0),V.value==="identity"?(m(),f("div",ot,[n("p",ut,w(t(e)("settings.pages.card.creation.fields_info.subtitle")),1),n("div",dt,[u(t(_),{modelValue:t(I),"onUpdate:modelValue":a[0]||(a[0]=r=>b(I)?I.value=r:null),label:t(e)("settings.pages.card.creation.name"),description:t(e)("settings.pages.card.creation.fields_info.name"),required:!0},null,8,["modelValue","label","description"]),u(t(_),{modelValue:t(E),"onUpdate:modelValue":a[1]||(a[1]=r=>b(E)?E.value=r:null),label:t(e)("settings.pages.card.creation.nickname"),description:t(e)("settings.pages.card.creation.fields_info.nickname")},null,8,["modelValue","label","description"]),u(t(_),{modelValue:t(M),"onUpdate:modelValue":a[2]||(a[2]=r=>b(M)?M.value=r:null),label:t(e)("settings.pages.card.creation.description"),"single-line":!1,required:!0,description:t(e)("settings.pages.card.creation.fields_info.description")},null,8,["modelValue","label","description"]),u(t(_),{modelValue:t(P),"onUpdate:modelValue":a[3]||(a[3]=r=>b(P)?P.value=r:null),label:t(e)("settings.pages.card.creator_notes"),"single-line":!1,description:t(e)("settings.pages.card.creation.fields_info.notes")},null,8,["modelValue","label","description"])])])):V.value==="behavior"?(m(),f("div",ct,[n("div",pt,[u(t(_),{modelValue:t(U),"onUpdate:modelValue":a[4]||(a[4]=r=>b(U)?U.value=r:null),label:t(e)("settings.pages.card.personality"),"single-line":!1,required:!0,description:t(e)("settings.pages.card.creation.fields_info.personality")},null,8,["modelValue","label","description"]),u(t(_),{modelValue:t(L),"onUpdate:modelValue":a[5]||(a[5]=r=>b(L)?L.value=r:null),label:t(e)("settings.pages.card.scenario"),"single-line":!1,required:!0,description:t(e)("settings.pages.card.creation.fields_info.scenario")},null,8,["modelValue","label","description"]),u(t(ze),{modelValue:Q.value,"onUpdate:modelValue":a[6]||(a[6]=r=>Q.value=r),label:t(e)("settings.pages.card.creation.greetings"),description:t(e)("settings.pages.card.creation.fields_info.greetings")},null,8,["modelValue","label","description"])])])):V.value==="settings"?(m(),f("div",mt,[n("div",ft,[u(t(_),{modelValue:t(S),"onUpdate:modelValue":a[7]||(a[7]=r=>b(S)?S.value=r:null),label:t(e)("settings.pages.card.systemprompt"),"single-line":!1,required:!0,description:t(e)("settings.pages.card.creation.fields_info.systemprompt")},null,8,["modelValue","label","description"]),u(t(_),{modelValue:t(H),"onUpdate:modelValue":a[8]||(a[8]=r=>b(H)?H.value=r:null),label:t(e)("settings.pages.card.posthistoryinstructions"),"single-line":!1,required:!0,description:t(e)("settings.pages.card.creation.fields_info.posthistoryinstructions")},null,8,["modelValue","label","description"]),u(t(_),{modelValue:t(B),"onUpdate:modelValue":a[9]||(a[9]=r=>b(B)?B.value=r:null),label:t(e)("settings.pages.card.creation.version"),required:!0,description:t(e)("settings.pages.card.creation.fields_info.version")},null,8,["modelValue","label","description"])])])):K("",!0),n("div",vt,[u(t(ee),{variant:"secondary",icon:"i-solar:undo-left-bold-duotone",label:t(e)("settings.pages.card.cancel"),disabled:!1,onClick:a[10]||(a[10]=r=>d.value=!1)},null,8,["label"]),u(t(ee),{variant:"primary",icon:"i-solar:check-circle-bold-duotone",label:t(e)("settings.pages.card.creation.create"),disabled:!1,onClick:a[11]||(a[11]=r=>h(x.value))},null,8,["label"])])])]),_:1})]),_:1})]),_:1},8,["open"]))}}),Lt=qe(gt,[["__scopeId","data-v-367e133d"]]);export{Lt as default}; diff --git a/assets/CardCreationDialog-BauWAkww.css b/assets/CardCreationDialog-BauWAkww.css deleted file mode 100644 index 19f560e7f82fd5f86d8c848be35f22e5c8025270..0000000000000000000000000000000000000000 --- a/assets/CardCreationDialog-BauWAkww.css +++ /dev/null @@ -1 +0,0 @@ -.input-list[data-v-367e133d]>*{min-width:45%}@media (max-width: 641px){.input-list[data-v-367e133d] *{min-width:unset;width:100%}} diff --git a/assets/CardCreationDialog-C00zclL1.js b/assets/CardCreationDialog-C00zclL1.js new file mode 100644 index 0000000000000000000000000000000000000000..efcf4dbc55b3dfeb6185f19b5e759d31c7464976 --- /dev/null +++ b/assets/CardCreationDialog-C00zclL1.js @@ -0,0 +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-BtAisBe9.js";import{useAiriCardStore as ne}from"./stores-mOXXrrXB.js";import{Button_default as S}from"./Button-BUWHo0FI.js";import{FieldInput_default as C,FieldValues_default as re}from"./src-bHDRqBSs.js";import{$u as w,Bu as T,Iv as ie,Pu as ae,nu as oe}from"./dist-DzeHt4xm.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-DbUZj3zx.js b/assets/CardCreationDialog-DbUZj3zx.js new file mode 100644 index 0000000000000000000000000000000000000000..3b5d38f3b3ed4acc1506fc5715b37a2d43690db1 --- /dev/null +++ b/assets/CardCreationDialog-DbUZj3zx.js @@ -0,0 +1 @@ +import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import"./dist-DzeHt4xm.js";import"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{CardCreationDialog_default as e}from"./CardCreationDialog-C00zclL1.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-Ic9YpxxK.css b/assets/CardCreationDialog-Ic9YpxxK.css new file mode 100644 index 0000000000000000000000000000000000000000..1a9721900382fa4eaf19cca11c28cf09382a776d --- /dev/null +++ b/assets/CardCreationDialog-Ic9YpxxK.css @@ -0,0 +1 @@ +.input-list[data-v-367e133d]>*{min-width:45%}@media (max-width:641px){.input-list[data-v-367e133d] *{min-width:unset;width:100%}} diff --git a/assets/CardDetailDialog-BUqu9VuB.js b/assets/CardDetailDialog-BUqu9VuB.js new file mode 100644 index 0000000000000000000000000000000000000000..8e51f30551c1d121b45611e78db82da03b83177a --- /dev/null +++ b/assets/CardDetailDialog-BUqu9VuB.js @@ -0,0 +1 @@ +import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import"./dist-DzeHt4xm.js";import"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import"./DeleteCardDialog-DA24n-jV.js";import{CardDetailDialog_default as e}from"./CardDetailDialog-CJ7VvCcd.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-CJ7VvCcd.js b/assets/CardDetailDialog-CJ7VvCcd.js new file mode 100644 index 0000000000000000000000000000000000000000..d50d81e37ffa2152f39caa052e50da2401bf5d15 --- /dev/null +++ b/assets/CardDetailDialog-CJ7VvCcd.js @@ -0,0 +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-BtAisBe9.js";import{useAiriCardStore as te}from"./stores-mOXXrrXB.js";import{Button_default as ne}from"./Button-BUWHo0FI.js";import{$u as g,Bu as _,Iv as re,Pu as ie,nu as ae}from"./dist-DzeHt4xm.js";import{DeleteCardDialog_default as oe}from"./DeleteCardDialog-DA24n-jV.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-DmXwuvrn.js b/assets/CardDetailDialog-DmXwuvrn.js deleted file mode 100644 index 8fb58da1db4a7916b99a0ff50903f471d20d34cb..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-DmXwuvrn.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-C37wIVyz.js";import"./Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js";import"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import"./airi-card-xdAfH1PV.js";import"./consciousness-CZ80YtY5.js";import"./providers-DepZj6_J.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./speech-D8cCufg2.js";import"./index-Cynu-bMx.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C4u0-iKE.js";export{o as default}; diff --git a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-C37wIVyz.js b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-C37wIVyz.js deleted file mode 100644 index 66f5b931b52e9c7d0f603bf8731e292bc2596617..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-C37wIVyz.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as O}from"./Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js";import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as E,$ as U,a0 as q,f as x,e as $,c as l,o as n,c3 as b,b as m,u as o,bg as k,a as e,W as v,ci as u,Y as i,X as L,c4 as D}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as F}from"./airi-card-xdAfH1PV.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import{n as R,I as W,$ as X,P as Y,B as G}from"./index-Cynu-bMx.js";import{_ as J}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C4u0-iKE.js";const K={key:0,class:"w-full flex flex-col gap-5"},Q={flex:"~ col","gap-3":""},Z={flex:"~ row","items-center":"","justify-between":""},ee={flex:"~ row","items-center":"","gap-2":""},te={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"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},oe={class:"mt-4"},le={class:"border-b border-neutral-200 dark:border-neutral-700"},ne={class:"flex justify-center -mb-px sm:justify-start space-x-1"},ie=["onClick"],de={class:"flex items-center gap-1"},ue={key:0},ce=["innerHTML"],me={key:1},ve=["innerHTML"],pe={key:2},ge={flex:"~ col","max-h-60":"","gap-4":"","overflow-auto":"","pr-1":"","sm:max-h-80":""},xe={key:0,flex:"~ col","gap-2":""},fe={"text-lg":"","text-neutral-500":"","font-medium":"","dark:text-neutral-400":""},be=["innerHTML"],he={key:3},_e={grid:"~ cols-1 sm:cols-3","gap-4":""},ke={flex:"~ col",bg:"white/60 dark:black/30","gap-1":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},we={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ye={truncate:"","font-medium":""},Ce={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},Ie={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Te={truncate:"","font-medium":""},Ve={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},He={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},$e={truncate:"","font-medium":""},Le={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"},Ue=E({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(B,{emit:A}){const f=B,M=A,{t:d}=U(),w=F(),{removeCard:N}=w,{activeCardId:S}=q(w),a=x(()=>{if(f.cardId)return w.getCard(f.cardId)}),y=x(()=>{var t,c,r,g,j;if(!a.value||!((c=(t=a.value.extensions)==null?void 0:t.airi)!=null&&c.modules))return{consciousness:"",speech:"",voice:""};const s=a.value.extensions.airi.modules;return{consciousness:((r=s.consciousness)==null?void 0:r.model)||"",speech:((g=s.speech)==null?void 0:g.model)||"",voice:((j=s.speech)==null?void 0:j.voice_id)||""}}),C=x(()=>a.value?{personality:a.value.personality,scenario:a.value.scenario,systemPrompt:a.value.systemPrompt,postHistoryInstructions:a.value.postHistoryInstructions}:{}),h=x(()=>f.cardId===S.value),I=$(!1);function P(){I.value=!0,setTimeout(()=>{S.value=f.cardId,I.value=!1},300)}function T(s){return s==null?void 0:s.replace(/\{\{(.*?)\}\}/g,'{{ $1 }}').trim()}const _=$(!1);function z(){a.value&&(N(f.cardId),M("update:modelValue",!1)),_.value=!1}const V=$(""),H=x(()=>{var t,c;const s=[];return(t=a.value)!=null&&t.description&&s.push({id:"description",label:d("settings.pages.card.description_label"),icon:"i-solar:document-text-linear"}),(c=a.value)!=null&&c.notes&&s.push({id:"notes",label:d("settings.pages.card.creator_notes"),icon:"i-solar:notes-linear"}),Object.values(C.value).some(r=>!!r)&&s.push({id:"character",label:d("settings.pages.card.character"),icon:"i-solar:user-rounded-linear"}),s.push({id:"modules",label:d("settings.pages.card.modules"),icon:"i-solar:tuning-square-linear"}),s}),p=x({get:()=>{var s;return H.value.find(t=>t.id===V.value)?V.value:((s=H.value[0])==null?void 0:s.id)||""},set:s=>{V.value=s}});return(s,t)=>{var c;return n(),l(b,null,[m(o(R),{open:B.modelValue,"onUpdate:open":t[0]||(t[0]=r=>M("update:modelValue",r))},{default:k(()=>[m(o(W),null,{default:k(()=>[m(o(X),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm"}),m(o(Y),{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:k(()=>[a.value?(n(),l("div",K,[e("div",Q,[e("div",Z,[e("div",null,[e("div",ee,[m(o(G),{"text-2xl":"","font-bold":"",class:"from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent"},{default:k(()=>[u(i(a.value.name),1)]),_:1}),h.value?(n(),l("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(o(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(n(),l(b,{key:0},[u(" · "+i(o(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(o(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?o(d)("settings.pages.card.active"):o(d)("settings.pages.card.activate"),disabled:h.value,class:L({"animate-pulse":I.value}),onClick:P},null,8,["icon","label","disabled","class"])])]),e("div",oe,[e("div",le,[e("div",ne,[(n(!0),l(b,null,D(H.value,r=>(n(),l("button",{key:r.id,class:L(["px-4 py-2 text-sm font-medium",[p.value===r.id?"text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400":"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300"]]),onClick:g=>p.value=r.id},[e("div",de,[e("div",{class:L(r.icon)},null,2),u(" "+i(r.label),1)])],10,ie))),128))])])]),p.value==="notes"&&a.value.notes?(n(),l("div",ue,[e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","text-neutral-700":"","sm:max-h-80":"","dark:text-neutral-300":"",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40",innerHTML:T(a.value.notes)},null,8,ce)])):v("",!0),p.value==="description"&&a.value.description?(n(),l("div",me,[e("div",{bg:"white/60 dark:black/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","sm:max-h-80":"",text:"neutral-600 dark:neutral-300",border:"~ neutral-200/50 dark:neutral-700/30",innerHTML:T(a.value.description)},null,8,ve)])):v("",!0),p.value==="character"&&Object.values(C.value).some(r=>!!r)?(n(),l("div",pe,[e("div",ge,[(n(!0),l(b,null,D(C.value,(r,g)=>(n(),l(b,{key:g},[r?(n(),l("div",xe,[e("h2",fe,i(o(d)(`settings.pages.card.${g.toLowerCase()}`)),1),e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40","max-h-none":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-3":"","text-neutral-700":"","dark:text-neutral-300":"",innerHTML:T(r)},null,8,be)])):v("",!0)],64))),128))])])):v("",!0),p.value==="modules"?(n(),l("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(o(d)("settings.pages.card.consciousness.model")),1)]),e("div",ye,i(y.value.consciousness??"default"),1)]),e("div",Ce,[e("span",Ie,[t[5]||(t[5]=e("div",{"i-lucide:mic":""},null,-1)),u(" "+i(o(d)("settings.pages.card.speech.model")),1)]),e("div",Te,i(y.value.speech??"default"),1)]),e("div",Ve,[e("span",He,[t[6]||(t[6]=e("div",{"i-lucide:music":""},null,-1)),u(" "+i(o(d)("settings.pages.card.speech.voice")),1)]),e("div",$e,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(n(),l("div",Le,[t[7]||(t[7]=e("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),u(" "+i(o(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(J,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:z,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{Ue as _}; diff --git a/assets/CardListItem-Cwi08F8K.js b/assets/CardListItem-Cwi08F8K.js new file mode 100644 index 0000000000000000000000000000000000000000..7fa40e16a73de96791646ad0bf9a46f0bc7ed027 --- /dev/null +++ b/assets/CardListItem-Cwi08F8K.js @@ -0,0 +1 @@ +import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{CardListItem_default as e}from"./CardListItem-gxbvoHYe.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-MKbZr0FQ.js b/assets/CardListItem-MKbZr0FQ.js deleted file mode 100644 index e2c1b08659820612c7501c74c7ed3c6018f46c73..0000000000000000000000000000000000000000 --- a/assets/CardListItem-MKbZr0FQ.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardListItem.vue_vue_type_script_setup_true_lang-B7Q5Wxio.js";import"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";export{o as default}; diff --git a/assets/CardListItem-gxbvoHYe.js b/assets/CardListItem-gxbvoHYe.js new file mode 100644 index 0000000000000000000000000000000000000000..be464bad88a94ade839e9b43dc4b3d4eec701ca0 --- /dev/null +++ b/assets/CardListItem-gxbvoHYe.js @@ -0,0 +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-BtAisBe9.js";import{CursorFloating_default as d}from"./components-B-QNW1cA.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.vue_vue_type_script_setup_true_lang-B7Q5Wxio.js b/assets/CardListItem.vue_vue_type_script_setup_true_lang-B7Q5Wxio.js deleted file mode 100644 index cb779369611c04abceecbd8d18262cebdff4fbf1..0000000000000000000000000000000000000000 --- a/assets/CardListItem.vue_vue_type_script_setup_true_lang-B7Q5Wxio.js +++ /dev/null @@ -1 +0,0 @@ -import{d as M,e as s,T as R,c as p,o as d,bA as W,a3 as F,b_ as H,bf as I,bg as N,a as t,W as v,Y as l,cl as k,X as h,u as V}from"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";const D=M({__name:"CursorFloating",props:{intensity:{default:1.5}},setup(r){const n=r,o=s(null),a=s(""),e=s("50% 50%"),i=s("50% 50%"),y=s(.5);function _(c){if(!o.value)return;const u=o.value,b=u.getBoundingClientRect(),w=c.clientX-b.left,C=c.clientY-b.top,z=u.offsetWidth,B=u.offsetHeight,f=Math.abs(Math.floor(100/z*w)-100),m=Math.abs(Math.floor(100/B*C)-100),g=50+(f-50)/1.5,x=50+(m-50)/1.5,X=50+(f-50)/7,Y=50+(m-50)/7,A=(g-50)/1.5*.2*n.intensity,P=(x-50)/2*-1*.2*n.intensity,S=50-f+(50-m),j=.5+Math.abs(S)*.008*n.intensity;a.value=`perspective(1200px) rotateX(${P}deg) rotateY(${A}deg) scale3d(${1+.015*n.intensity}, ${1+.015*n.intensity}, ${1+.015*n.intensity})`,e.value=`${g}% ${x}%`,i.value=`${X}% ${Y}%`,y.value=j}function $(){a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",e.value="50% 50%",i.value="50% 50%",y.value=.5}return R(()=>{a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"}),(c,u)=>(d(),p("div",{ref_key:"cardRef",ref:o,class:"card-hover-effect",style:F({transform:a.value,"--effect-intensity":r.intensity}),onMousemove:_,onMouseleave:$},[W(c.$slots,"default",{},void 0,!0)],36))}}),E=H(D,[["__scopeId","data-v-895421da"]]),L={relative:"",flex:"~ col 1","justify-between":"","gap-3":"","overflow-hidden":"","rounded-lg":"",bg:"white dark:neutral-900","p-5":"",transition:"all ease-in-out duration-400",after:"content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out",hover:"after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80"},O={"z-1":"",flex:"","items-start":"","justify-between":"","gap-2":""},T={"flex-1":"",truncate:"","text-lg":"","font-thin":""},q={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"},J={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},K={flex:"","items-center":"","gap-1.5":""},Q={flex:"","items-center":"","gap-0.5":""},U={flex:"","items-center":"","gap-0.5":""},Z={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},ee=["disabled"],le=M({__name:"CardListItem",props:{id:null,name:null,description:null,isActive:{type:Boolean},isSelected:{type:Boolean},version:null,consciousnessModel:null,voiceModel:null},emits:["select","activate","delete"],setup(r,{emit:n}){const o=n;return(a,e)=>(d(),I(V(E),{relative:"","min-h-120px":"",flex:"~ col","cursor-pointer":"","overflow-hidden":"","rounded-xl":"",class:h([r.isSelected?"border-2 border-primary-400 dark:border-primary-600":"border-2 border-neutral-100 dark:border-neutral-800/25"]),bg:"neutral-200/50 dark:neutral-800/50","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",transition:"all ease-in-out duration-400",before:"content-empty absolute inset-0 z-0 w-25% h-full transition-all duration-400 ease-in-out bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0 mask-image-[linear-gradient(120deg,white_100%)] opacity-0",hover:"before:opacity-100 before:bg-gradient-to-r before:from-primary-500/20 before:via-primary-500/10 before:to-transparent before:dark:from-primary-400/20 before:dark:via-primary-400/10 before:dark:to-transparent",onClick:e[2]||(e[2]=i=>o("select"))},{default:N(()=>[t("div",L,[t("div",O,[t("h3",T,l(r.name),1),r.isActive?(d(),p("div",q,e[3]||(e[3]=[t("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):v("",!0)]),r.description?(d(),p("p",G,l(r.description),1)):v("",!0),t("div",J,[t("div",null,"v"+l(r.version),1),t("div",K,[t("div",Q,[e[4]||(e[4]=t("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),t("span",null,l(r.consciousnessModel),1)]),t("div",U,[e[5]||(e[5]=t("div",{"i-lucide:mic":"","text-xs":""},null,-1)),t("span",null,l(r.voiceModel),1)])])])]),t("div",Z,[t("button",{"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",disabled:r.isActive,onClick:e[0]||(e[0]=k(i=>o("activate"),["stop"]))},[t("div",{class:h([r.isActive?"i-solar:check-circle-bold-duotone text-primary-500 dark:text-primary-400":"i-solar:play-circle-broken text-neutral-500 dark:text-neutral-400"])},null,2)],8,ee),r.id!=="default"?(d(),p("button",{key:0,"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",onClick:e[1]||(e[1]=k(i=>o("delete"),["stop"]))},e[6]||(e[6]=[t("div",{"i-solar:trash-bin-trash-linear":"",text:"neutral-500 dark:neutral-400"},null,-1)]))):v("",!0)])]),_:1},8,["class"]))}});export{le as _}; diff --git a/assets/CheckBar-B-SKUaUP.js b/assets/CheckBar-B-SKUaUP.js new file mode 100644 index 0000000000000000000000000000000000000000..2da57cf3cc826d5cde1d6d417dcb5e566ad21a4d --- /dev/null +++ b/assets/CheckBar-B-SKUaUP.js @@ -0,0 +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-BtAisBe9.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/CheckBar.vue_vue_type_script_setup_true_lang-By8B4nPO.js b/assets/CheckBar.vue_vue_type_script_setup_true_lang-By8B4nPO.js deleted file mode 100644 index 64493f2385ac8553811a97a081c7d19c81e564fa..0000000000000000000000000000000000000000 --- a/assets/CheckBar.vue_vue_type_script_setup_true_lang-By8B4nPO.js +++ /dev/null @@ -1 +0,0 @@ -import{d as r,cg as c,ch as m,c as a,o as n,bh as h,a as i,b as f,bi as k,ci as b,W as v,Y as s,cm as x,bg as p,X as d}from"./index-D7HCX4VR.js";const y={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"],V={key:0,text:"sm neutral-500"},w=r({__name:"CheckBar",props:c({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=m(e,"modelValue");return(l,o)=>(n(),a("label",y,[h(i("input",{"onUpdate:modelValue":o[0]||(o[0]=u=>t.value=u),"aria-checked":t.value,type:"checkbox",hidden:""},null,8,g),[[k,t.value]]),i("div",null,[b(s(l.$t(e.text))+" ",1),e.description?(n(),a("div",V,s(l.$t(e.description)),1)):v("",!0)]),f(x,{name:"slide-away",mode:"out-in"},{default:p(()=>[t.value?(n(),a("div",{key:0,class:d(e.iconOn),transition:"all ease-in-out duration-250"},null,2)):(n(),a("div",{key:1,class:d(e.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}});export{w as _}; diff --git a/assets/Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js b/assets/Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js deleted file mode 100644 index 58926c830ee9345a65c721f7943a938b70d05699..0000000000000000000000000000000000000000 --- a/assets/Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{d as p,cg as m,ch as c,bG as f,c as b,o as v,bA as r,b as g,a as s,ci as V,Y as u,cu as i,cv as y,u as k,bg as x,W as C,cj as B}from"./index-D7HCX4VR.js";const _={op50:""},P=p({__name:"Collapsable",props:m({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,e=c(o,"modelValue");f(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),b("div",null,[r(l.$slots,"trigger",i(y({visible:e.value,setVisible:n})),()=>[s("button",{sticky:"","top-0":"","z-10":"",flex:"","items-center":"","justify-between":"",px2:"",py1:"","text-sm":"","backdrop-blur-xl":"",onClick:a[0]||(a[0]=N=>e.value=!e.value)},[s("span",null,u(t.label??"Collapsable"),1),a[1]||(a[1]=V()),s("span",_,u(e.value?"▲":"▼"),1)])]),g(k(d),null,{default:x(()=>[e.value?r(l.$slots,"default",i(B({key:0},{visible:e.value,setVisible:n}))):C("",!0)]),_:3})]))}});export{P as _}; diff --git a/assets/ColorPalette-DaCdckPj.js b/assets/ColorPalette-DaCdckPj.js new file mode 100644 index 0000000000000000000000000000000000000000..c35b3a52bffdfc036f2f9a255a0c7c33ee6139ef --- /dev/null +++ b/assets/ColorPalette-DaCdckPj.js @@ -0,0 +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-BtAisBe9.js";import{Gg as g,Hg as _,Ug as v,Wg as y,jg as b,qg as x}from"./dist-DzeHt4xm.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/ColorPalette.vue_vue_type_script_setup_true_lang-Dcu1mOYZ.js b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-Dcu1mOYZ.js deleted file mode 100644 index ac0045b77a26e2f80f5ea405e4323118b7a741bc..0000000000000000000000000000000000000000 --- a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-Dcu1mOYZ.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as b}from"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import{d,bf as m,o as i,bg as l,a as n,X as u,bA as k,ci as f,Y as g,be as y,c,W as C,c3 as v,c4 as h,b as s,u as e,a3 as x,cs as w}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{W as S,j as $,q as B,U as E,G as V,H as z}from"./index-Cynu-bMx.js";const F=["onClick"],H={flex:"","gap-1.5":""},D=d({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(r,p)=>(i(),m(b,{default:t.expand},{trigger:l(o=>[n("button",{class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",onClick:a=>o.setVisible(!o.visible)},[n("div",H,[n("div",{class:u(t.icon),"size-6":""},null,2),f(" "+g(t.title),1)]),n("div",{"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-250",class:u({"rotate-180":o.visible})},null,2)],8,F)]),default:l(()=>[n("div",{grid:"","gap-2":"","p-4":"",class:u(t.innerClass)},[k(r.$slots,"default")],2)]),_:3},8,["default"]))}}),N={key:0,flex:"","gap-2":""},G=d({__name:"ColorPalette",props:{colors:null},setup(t){const r=y();return(p,o)=>t.colors.length?(i(),c("div",N,[(i(!0),c(v,null,h(t.colors,({hex:a,name:_})=>(i(),m(e(z),{key:a||"default"},{default:l(()=>[s(e(S),null,{default:l(()=>[s(e($),{transition:"all ease-in-out duration-250","size-6":"","cursor-pointer":"","rounded-full":"","bg-primary-500":"",style:x(a?{background:a}:{"--chromatic-hue":e(w)}),class:u(e(r).isColorSelectedForPrimary(a)?"scale-150 mx-1":"hover:scale-110"),onClick:U=>e(r).applyPrimaryColorFrom(a)},null,8,["style","class","onClick"]),s(e(B),null,{default:l(()=>[s(e(E),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(_)+" ",1),s(e(V),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):C("",!0)}});export{D as _,G as a}; diff --git a/assets/DeleteCardDialog-DA24n-jV.js b/assets/DeleteCardDialog-DA24n-jV.js new file mode 100644 index 0000000000000000000000000000000000000000..0f0dba614e5abbfd67f3287c23715253ee8d9498 --- /dev/null +++ b/assets/DeleteCardDialog-DA24n-jV.js @@ -0,0 +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-BtAisBe9.js";import{Button_default as u}from"./Button-BUWHo0FI.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-DzeHt4xm.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/DeleteCardDialog-WqtMeAWd.js b/assets/DeleteCardDialog-WqtMeAWd.js new file mode 100644 index 0000000000000000000000000000000000000000..1123ff72c719da6b03b46b94deb524218bd43656 --- /dev/null +++ b/assets/DeleteCardDialog-WqtMeAWd.js @@ -0,0 +1 @@ +import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import"./dist-DzeHt4xm.js";import{DeleteCardDialog_default as e}from"./DeleteCardDialog-DA24n-jV.js";export{e as default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-Z5bX7ffQ.js b/assets/DeleteCardDialog-Z5bX7ffQ.js deleted file mode 100644 index 99922eb795a4a08f08c95fe394673fbfff71c81d..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-Z5bX7ffQ.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C4u0-iKE.js";import"./Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js";import"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./index-Cynu-bMx.js";export{o as default}; diff --git a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C4u0-iKE.js b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C4u0-iKE.js deleted file mode 100644 index c89b71c4ee489f6faa9185a616b953bf503e85b4..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C4u0-iKE.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as r}from"./Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js";import{A as b,k as _,O as g,V as x,F as v,M as V,N as k,T as h}from"./index-Cynu-bMx.js";import{d as w,$ as C,bf as N,o as y,bg as t,b as a,u as e,a as c,ci as i,Y as s}from"./index-D7HCX4VR.js";const B={class:"flex flex-row justify-end gap-3"},A=w({__name:"DeleteCardDialog",props:{modelValue:{type:Boolean},cardName:null},emits:["update:modelValue","confirm","cancel"],setup(d,{emit:u}){const l=u,{t:n}=C();function f(){l("update:modelValue",!1),l("cancel")}function m(){l("update:modelValue",!1),l("confirm")}return(D,o)=>(y(),N(e(h),{open:d.modelValue,"onUpdate:open":o[0]||(o[0]=p=>l("update:modelValue",p))},{default:t(()=>[a(e(b),null,{default:t(()=>[a(e(_),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50"}),a(e(g),{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:t(()=>[a(e(x),{class:"mb-4 text-xl font-bold"},{default:t(()=>[i(s(e(n)("settings.pages.card.delete_card")),1)]),_:1}),a(e(v),{class:"mb-6"},{default:t(()=>[i(s(e(n)("settings.pages.card.delete_confirmation"))+" ",1),c("b",null,'"'+s(d.cardName||"")+'"',1)]),_:1}),c("div",B,[a(e(V),{"as-child":""},{default:t(()=>[a(e(r),{variant:"secondary",label:e(n)("settings.pages.card.cancel"),onClick:f},null,8,["label"])]),_:1}),a(e(k),{"as-child":""},{default:t(()=>[a(e(r),{variant:"danger",label:e(n)("settings.pages.card.delete"),onClick:m},null,8,["label"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["open"]))}});export{A as _}; diff --git a/assets/FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js b/assets/FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js deleted file mode 100644 index a6978c494c7ca6261d11d90a53819ef6f3840cb5..0000000000000000000000000000000000000000 --- a/assets/FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js +++ /dev/null @@ -1 +0,0 @@ -import{d as i,cg as c,ch as p,c as n,o as t,a as s,bf as m,bh as f,ci as x,W as y,Y as d,X as u,ca as h}from"./index-D7HCX4VR.js";import{_}from"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const k={"max-w-full":""},V={flex:"~ col gap-4"},b={class:"flex items-center gap-1 text-sm font-medium"},v={key:0,class:"text-red-500"},g={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},w=["type","placeholder"],q=i({__name:"FieldInput",props:c({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(o){const e=o,l=p(o,"modelValue");return(B,a)=>(t(),n("div",k,[s("label",V,[s("div",null,[s("div",b,[x(d(e.label)+" ",1),e.required!==!1?(t(),n("span",v,"*")):y("",!0)]),s("div",g,d(e.description),1)]),o.singleLine?(t(),m(_,{key:0,modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=r=>l.value=r),type:e.type,placeholder:e.placeholder,class:u(e.inputClass)},null,8,["modelValue","type","placeholder","class"])):f((t(),n("textarea",{key:1,"onUpdate:modelValue":a[1]||(a[1]=r=>l.value=r),type:e.type,placeholder:e.placeholder,class:u(e.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,w)),[[h,l.value]])])]))}});export{q as _}; diff --git a/assets/HeaderLink-BKV8TZb8.js b/assets/HeaderLink-BKV8TZb8.js deleted file mode 100644 index ac8ed6229f837ba595edc5a634401cc5b407aa8e..0000000000000000000000000000000000000000 --- a/assets/HeaderLink-BKV8TZb8.js +++ /dev/null @@ -1 +0,0 @@ -import{d as c,c7 as r,bf as l,u as e,b$ as _,o as s,bg as d,c as t,a,b_ as i}from"./index-D7HCX4VR.js";const p="/assets/logo-dark-B0bvNYTh.svg",u="/assets/logo-B2aCU-bH.svg",k=["src"],m=["src"],g=c({__name:"HeaderLink",setup(f){const n=r();return(x,o)=>(s(),l(e(_),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:d(()=>[e(n)?(s(),t("img",{key:0,src:e(p),"h-8":"","w-8":"",class:"theme-colored"},null,8,k)):(s(),t("img",{key:1,src:e(u),"h-8":"","w-8":"",class:"theme-colored"},null,8,m)),o[0]||(o[0]=a("div",{"font-cute":""},[a("span",null,"アイリ")],-1))]),_:1,__:[0]}))}}),h=i(g,[["__scopeId","data-v-98dc4b88"]]);export{h as H}; diff --git a/assets/HeaderLink-CUc90b_v.css b/assets/HeaderLink-CI1dOuDM.css similarity index 71% rename from assets/HeaderLink-CUc90b_v.css rename to assets/HeaderLink-CI1dOuDM.css index a007b15a1146902125469060eeac4652e90c103d..e3913831339853e28660c0684163f4648e8af83d 100644 --- a/assets/HeaderLink-CUc90b_v.css +++ b/assets/HeaderLink-CI1dOuDM.css @@ -1 +1 @@ -.theme-colored[data-v-98dc4b88]{filter:hue-rotate(calc(var(--chromatic-hue, 0) * 1deg))} +.theme-colored[data-v-98dc4b88]{filter:hue-rotate(calc(var(--chromatic-hue,0)*1deg))} diff --git a/assets/HeaderLink-zGlOe2Jb.js b/assets/HeaderLink-zGlOe2Jb.js new file mode 100644 index 0000000000000000000000000000000000000000..29cc8b2eed5b20a107d1959d9244f58db18bf1d4 --- /dev/null +++ b/assets/HeaderLink-zGlOe2Jb.js @@ -0,0 +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-BtAisBe9.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`,{"font-cute":``},[n(`span`,null,`アイリ`)],-1)]),_:1,__:[0]}))}}),h=t(m,[[`__scopeId`,`data-v-98dc4b88`]]);export{h as HeaderLink_default}; \ No newline at end of file diff --git a/assets/IconAnimation-B5sfLFsA.js b/assets/IconAnimation-B5sfLFsA.js new file mode 100644 index 0000000000000000000000000000000000000000..95c136b8dfb859cb989e8faea8dd9f11846e6ec4 --- /dev/null +++ b/assets/IconAnimation-B5sfLFsA.js @@ -0,0 +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-BtAisBe9.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/IconAnimation.vue_vue_type_script_setup_true_lang-z-t1ytxo.js b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-z-t1ytxo.js deleted file mode 100644 index 13198d19f9f09da795c1981bda752b6ec479a956..0000000000000000000000000000000000000000 --- a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-z-t1ytxo.js +++ /dev/null @@ -1 +0,0 @@ -import{d as m,e as s,w as p,f,c as h,o as x,a3 as l,a as u,X as y}from"./index-D7HCX4VR.js";const C=m({__name:"IconAnimation",props:{icon:null,iconSize:null,position:null,duration:null,started:{type:Boolean},textColor:null,isReverse:{type:Boolean},zIndex:null},emits:["animationEnded"],setup(a,{emit:d}){const e=a,c=d,n=s(!1);p(()=>e.started,o=>{o&&requestAnimationFrame(()=>{n.value=!0})});const t=f(()=>({opacity:n.value!==e.isReverse?1:0,size:n.value!==e.isReverse?25:e.iconSize,position:n.value!==e.isReverse?"calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)":e.position,textColor:n.value!==e.isReverse?"text-white":e.textColor})),i=s([]),r=s(!1);function v(o){i.value.push(o.propertyName),i.value.includes("color")&&i.value.includes("width")&&i.value.includes("height")&&i.value.includes("transform")&&(r.value=!0,c("animationEnded"))}return(o,z)=>(x(),h("div",{"pointer-events-none":"",fixed:"",w:"100dvw",h:"100dvh",style:l({zIndex:r.value?a.zIndex:void 0})},[u("div",{fixed:"","inset-0":"","bg-primary-500":"","transition-opacity":"","ease-linear":"",style:l({opacity:t.value.opacity,transitionDuration:`${a.duration}ms`})},null,4),u("div",{fixed:"","inset-0":"","ease-in-out":"",style:l({width:`${t.value.size}rem`,height:`${t.value.size}rem`,transform:`translate(${t.value.position})`,transitionDuration:`${a.duration}ms`}),class:y([t.value.textColor,e.icon,{"transition-all":n.value}]),onTransitionend:v},null,38)],4))}});export{C as _}; diff --git a/assets/IconItem-DcwOFLGv.js b/assets/IconItem-DcwOFLGv.js deleted file mode 100644 index bbcec21be3f94687c2366a7142173203f336b5f7..0000000000000000000000000000000000000000 --- a/assets/IconItem-DcwOFLGv.js +++ /dev/null @@ -1 +0,0 @@ -import{d as l,a2 as s,bf as c,o as n,bg as d,a as t,c as u,W as o,bA as m,Y as a,X as p,b_ as x}from"./index-D7HCX4VR.js";import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";const _={"z-1":"","flex-1":""},v={"text-lg":"","font-thin":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},f={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},h=l({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(e){return(i,k)=>{const r=s("RouterLink");return n(),c(r,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-900",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",class:"menu-icon-item",transition:"all ease-in-out duration-400",relative:"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",cursor:"pointer",to:e.to},{default:d(()=>[t("div",_,[t("div",v,a(e.title),1),t("div",f,[t("span",null,a(e.description),1)])]),typeof e.icon=="string"?(n(),u("div",{key:0,class:p(["menu-icon-item-icon",[e.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-24":"","translate-y-4":"",text:"neutral-400/50 dark:neutral-600/50"},null,2)):o("",!0),e.iconTemplate?m(i.$slots,"icon",{key:1},void 0,!0):o("",!0)]),_:3},8,["to"])}}}),y=x(h,[["__scopeId","data-v-b1037d36"]]);export{y as I}; diff --git a/assets/IconStatusItem-Df4oVjQ8.js b/assets/IconStatusItem-Df4oVjQ8.js deleted file mode 100644 index bcda9fdc8cd5c9802437e4098328e9ca28869667..0000000000000000000000000000000000000000 --- a/assets/IconStatusItem-Df4oVjQ8.js +++ /dev/null @@ -1 +0,0 @@ -import{d as u,a2 as c,c as e,o as n,b as d,a as o,bg as m,W as a,Y as i,X as s,b_ as _}from"./index-D7HCX4VR.js";import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";const p={flex:"~ col",bg:"neutral-50 dark:neutral-800",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",class:"menu-icon-status-item",transition:"all ease-in-out duration-400","w-full":"","cursor-pointer":"","of-hidden":"","rounded-xl":""},g={"z-1":"","flex-1":""},h={"text-lg":"","font-thin":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},f={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},k=["src"],x={"p-2":""},v={key:0,"size-3":"",bg:"green-500 dark:green-600","rounded-full":""},b={key:1,"size-3":"",bg:"neutral-400 dark:neutral-500","rounded-full":""},y=u({__name:"IconStatusItem",props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(r){const t=r;return(I,C)=>{const l=c("RouterLink");return n(),e("div",p,[d(l,{flex:"~ row",class:"menu-icon-status-item-link",bg:"white dark:neutral-900",transition:"all ease-in-out duration-400",relative:"","h-full":"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",to:t.to},{default:m(()=>[o("div",g,[o("div",h,i(t.title),1),o("div",f,[o("span",null,i(t.description||""),1)])]),t.icon?(n(),e("div",{key:0,class:s(["menu-icon-status-item-icon",[t.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconColor?(n(),e("div",{key:1,class:s(["menu-icon-status-item-icon-color",[t.iconColor]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconImage?(n(),e("img",{key:2,src:t.iconImage,class:"menu-icon-status-item-icon-image",transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"","grayscale-100":""},null,8,k)):a("",!0)]),_:1},8,["to"]),o("div",x,[t.configured?(n(),e("div",v)):(n(),e("div",b))])])}}}),B=_(y,[["__scopeId","data-v-b53bc3f0"]]);export{B as I}; diff --git a/assets/Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js b/assets/Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js deleted file mode 100644 index 397f9ca375bb22036ad7449923daa5a96958e651..0000000000000000000000000000000000000000 --- a/assets/Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js +++ /dev/null @@ -1 +0,0 @@ -import{d as r,cg as n,ch as u,bh as d,d1 as s,o as i,c as p}from"./index-D7HCX4VR.js";const m=["type"],y=r({__name:"Input",props:n({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=u(e,"modelValue");return(c,a)=>d((i(),p("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),type:l.type||"text",border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,m)),[[s,t.value]])}});export{y as _}; diff --git a/assets/InputFile-B1bjga7G.js b/assets/InputFile-B1bjga7G.js new file mode 100644 index 0000000000000000000000000000000000000000..40e2a368f4a6144056d2f9638d5f8b39640cc57d --- /dev/null +++ b/assets/InputFile-B1bjga7G.js @@ -0,0 +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-BtAisBe9.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/InputFile.vue_vue_type_script_setup_true_lang-M88MYfAL.js b/assets/InputFile.vue_vue_type_script_setup_true_lang-M88MYfAL.js deleted file mode 100644 index 5c370ad787525995117bdf199fd7bab4c4b48f22..0000000000000000000000000000000000000000 --- a/assets/InputFile.vue_vue_type_script_setup_true_lang-M88MYfAL.js +++ /dev/null @@ -1 +0,0 @@ -import{d as g,cg as b,ch as v,e as p,ck as y,c as i,o as n,X as m,u as t,a as l,bA as k}from"./index-D7HCX4VR.js";const x=["accept","multiple"],h={key:0,text:"center","text-sm":""},D={key:1,text:"center","text-sm":""},C=g({__name:"InputFile",props:b({accept:null,multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const d=v(o,"modelValue"),u=p(),a=p(!1),r=y(a,150);function c(s){const e=s.target;e.files&&e.files.length>0&&(u.value=e.files[0]),d.value=Array.from(e.files||[]),a.value=!1}return(s,e)=>(n(),i("label",{relative:"",class:m(["min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6",[t(r)?"border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700":"border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700",t(r)?"bg-primary-50/5 dark:bg-primary-900/5":"bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40"]]),border:"dashed 2",transition:"all duration-300","cursor-pointer":"","opacity-95":"",hover:"scale-100 opacity-100 shadow-md dark:shadow-lg",onDragover:e[0]||(e[0]=f=>a.value=!0),onDragleave:e[1]||(e[1]=f=>a.value=!1)},[l("input",{type:"file",accept:o.accept,multiple:o.multiple,"cursor-pointer":"",class:"absolute inset-0 h-full w-full opacity-0",onChange:c},null,40,x),k(s.$slots,"default",{isDragging:t(r),firstFile:u.value,files:d.value},()=>[l("div",{class:m(["flex flex-col items-center",[t(r)?"text-primary-500 dark:text-primary-400":"text-neutral-400 dark:text-neutral-500"]])},[e[2]||(e[2]=l("div",{"i-solar:upload-square-line-duotone":"","mb-2":"","text-5xl":""},null,-1)),e[3]||(e[3]=l("p",{"font-medium":"",text:"center lg"}," Upload ",-1)),t(r)?(n(),i("p",h," Release to upload ")):(n(),i("p",D," Click or drag and drop a file here "))],2)])],34))}});export{C as _}; diff --git a/assets/Model.vue_vue_type_script_setup_true_lang-CrmnRvJ7.js b/assets/Model.vue_vue_type_script_setup_true_lang-CrmnRvJ7.js deleted file mode 100644 index 18f38a03e3a874772949c99a43b26b31d20d2968..0000000000000000000000000000000000000000 --- a/assets/Model.vue_vue_type_script_setup_true_lang-CrmnRvJ7.js +++ /dev/null @@ -1 +0,0 @@ -import{e as I,T as N,A as ve,L as P,a as X,D as fe,I as pe,l as H,M as me,b as Y}from"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{cp as he,d as j,e as p,w as v,T as U,U as W,c as J,o as K,bA as Q,a8 as C,f as $,c7 as ge,cd as Me,bn as ye,a0 as we,be,cq as xe,cr as Fe,c3 as Se,a as Be,cf as Ce}from"./index-D7HCX4VR.js";import{r as Ae}from"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";const Ie=l=>Math.max(0,Math.min(1,l||0)),A=l=>Math.round(Ie(l)*255),Pe=he("rgb"),De=l=>{if(l===void 0)return;let r=A(l.r),n=A(l.g),o=A(l.b);return"#"+(1<<24|r<<16|n<<8|o).toString(16).slice(1)},ke=l=>De(Pe(l)),Oe=j({__name:"Canvas",props:{width:null,height:null,resolution:{default:2}},setup(l,{expose:r}){const n=l,o=p(),i=p(),t=p();async function m(u){P.registerTicker(X),I.add(N),i.value=new ve({width:n.width*n.resolution,height:n.height*n.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),t.value=i.value.view,t.value.style.width="100%",t.value.style.height="100%",t.value.style.objectFit="cover",t.value.style.display="block",u.appendChild(i.value.view)}function b(){i.value&&i.value.renderer.resize(n.width,n.height)}v([()=>n.width,()=>n.height],()=>b()),v(()=>n.resolution,u=>{i.value&&u&&(i.value.renderer.resolution=u,b())}),U(async()=>o.value&&await m(o.value)),W(()=>{var u;return(u=i.value)==null?void 0:u.destroy()});async function e(){return new Promise(h=>{if(!t.value||!i.value)return h(null);i.value.render(),t.value.toBlob(h)})}function x(){return t.value}return r({captureFrame:e,canvasElement:x}),(u,h)=>(K(),J("div",{ref_key:"containerRef",ref:o,"h-full":"","w-full":""},[Q(u.$slots,"default",{app:i.value})],512))}});function q(l,r,n){return(1-n)*l+n*r}function G(l,r){return l+Math.random()*(r-l)}function _e(){let l=-1,r,n=-1;function o(i,t){(t>=l||t({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1}},emits:["modelLoaded"],setup(l,{expose:r,emit:n}){const o=l,i=n,t=C(()=>o.app),m=C(()=>o.paused),b=C(()=>o.focusAt),e=p(),x=p(0),u=p(0),h=$(()=>Math.max(0,Math.min(100,o.mouthOpenSize))),Z=ge(),D=Me(Ce),ee=$(()=>D.between("sm","md").value||D.smaller("sm").value),ae=_e(),k=ye(new fe({alpha:.2,blur:0,distance:20,rotation:45}));function te(){return e.value.internalModel.coreModel}function _(a){if(!a.value)return;let s=2.2;ee.value&&(s=2.2);const g=o.height*.95/u.value*s,c=o.width*.95/x.value*s,M=Math.min(g,c);a.value.scale.set(M,M)}const{live2dModelFile:F,loadingLive2dModel:y,live2dCurrentMotion:le,availableLive2dMotions:L,live2dLoadSource:S,live2dModelUrl:E,themeColorsHue:oe,themeColorsHueDynamic:T}=we(be()),ne=p({group:"Idle",index:0});async function ie(){var V;if(!t.value)return;e.value&&(t.value.stage.removeChild(e.value),e.value.destroy(),e.value=void 0);const a=new P;S.value==="file"?await Y.setupLive2DModel(a,[F.value],{autoInteract:!1}):S.value==="url"&&await Y.setupLive2DModel(a,E.value,{autoInteract:!1}),e.value=a,t.value.stage.addChild(e.value),x.value=e.value.width,u.value=e.value.height,e.value.x=o.width/2,e.value.y=o.height,e.value.anchor.set(.5,.5),_(e),e.value.on("hit",f=>{e.value&&f.includes("body")&&e.value.motion("tap_body")});const s=e.value.internalModel,g=s.coreModel,c=s.motionManager;g.setParameterValueById("ParamMouthOpenY",h.value),L.value=Object.entries(c.definitions).flatMap(([f,d])=>d?d.map((de,ce)=>({motionName:f,motionIndex:ce,fileName:de.File})):[]).filter(Boolean),c.groups.idle&&((V=c.motionGroups[c.groups.idle])==null||V.forEach(f=>{f._motionData.curves.forEach(d=>{(d.id==="ParamEyeBallX"||d.id==="ParamEyeBallY")&&(d.id=`_${d.id}`)})}));const M=c.update;c.update=function(f,d){return M==null||M.call(this,f,d),c.state.currentGroup===c.groups.idle&&ae.update(s,d),!0},c.on("motionStart",(f,d)=>{ne.value={group:f,index:d}}),F.value&&await H.setItem("live2dModel",F.value),i("modelLoaded"),y.value=!1}async function re(){if(!t.value)return;P.registerTicker(X),I.add(N),I.add(pe);const a=await H.getItem("live2dModel");if(a){F.value=a,S.value="file",y.value=!0;return}if(E.value){S.value="url",y.value=!0;return}y.value=!1}async function R(a,s){await e.value.motion(a,s,me.FORCE)}const ue=xe(()=>{e.value&&(e.value.x=o.width/2,e.value.y=o.height,_(e))},100),z=p(),w=p(0);function B(){if(e.value){const a=getComputedStyle(z.value).backgroundColor;k.value.color=Number(ke(a).replace("#","0x")),e.value.filters=[k.value]}}v([()=>o.width,()=>o.height],()=>ue()),v(Z,B,{immediate:!0}),v([e,oe],B);function O(){B(),w.value=requestAnimationFrame(O)}v(T,()=>{T.value?w.value=requestAnimationFrame(O):(cancelAnimationFrame(w.value),w.value=0)},{immediate:!0}),v(h,a=>te().setParameterValueById("ParamMouthOpenY",a)),v(t,re),v(le,a=>R(a.group,a.index)),v(m,a=>{var s,g;return a?(s=t.value)==null?void 0:s.stop():(g=t.value)==null?void 0:g.start()}),v(b,a=>{e.value&&(o.disableFocusAt||e.value.focus(a.x,a.y))}),Fe(y,a=>{a&&ie()},{debounce:1e3}),U(B),W(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))});function se(){return L.value}return r({setMotion:R,listMotionGroups:se}),(a,s)=>(K(),J(Se,null,[Be("div",{ref_key:"dropShadowColorComputer",ref:z,hidden:"",bg:"primary-400 dark:primary-500"},null,512),Q(a.$slots,"default")],64))}});export{Ve as _,Oe as a,G as r}; diff --git a/assets/ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js b/assets/ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js deleted file mode 100644 index fbfc28d7dc1749544ef065d55f645e25942474e6..0000000000000000000000000000000000000000 --- a/assets/ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as r}from"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import{d,e as c,bf as u,o as f,bg as n,a as e,bA as m,Y as p,X as v}from"./index-D7HCX4VR.js";const _=["onClick"],b={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},g={"mt-4":""},w=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(i){const a=c(i.initialVisible||!1);function o(){a.value=!a.value}return(l,s)=>(f(),u(r,{"w-full":""},{trigger:n(t=>[e("button",{transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:()=>t.setVisible(!t.visible)&&o()},[e("h2",b,[e("span",null,p(i.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":t.visible})},s[0]||(s[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,_)]),default:n(()=>[e("div",g,[m(l.$slots,"default")])]),_:3}))}});export{w as _}; diff --git a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js deleted file mode 100644 index 8083d30f2e57684acce8f7001cefd01b88bee219..0000000000000000000000000000000000000000 --- a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t}from"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{d as u,cg as n,$ as p,ch as m,f as c,bf as f,o as v,u as a}from"./index-D7HCX4VR.js";const g=u({__name:"ProviderApiKeyInput",props:n({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,{t:d}=p(),o=m(e,"modelValue"),i=c(()=>l.description||`API Key for ${l.providerName}`);return(V,r)=>(v(),f(a(t),{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||a(d)("settings.pages.providers.common.fields.field.api-key.label"),description:i.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{g as _}; diff --git a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js deleted file mode 100644 index 2b93804340e5993096c909919a6af2f7a8149e43..0000000000000000000000000000000000000000 --- a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as d}from"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{d as t,cg as u,ch as s,bf as n,o as i,u as p}from"./index-D7HCX4VR.js";const b=t({__name:"ProviderBaseUrlInput",props:u({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,o=s(l,"modelValue");return(m,r)=>(i(),n(p(d),{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=a=>o.value=a),label:e.label||"Base URL",description:e.description||"Custom base URL (optional)",placeholder:e.placeholder,required:e.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}});export{b as _}; diff --git a/assets/ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js b/assets/ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js deleted file mode 100644 index faead0ce47bb277eafd36a3a06d47d9d0475007e..0000000000000000000000000000000000000000 --- a/assets/ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js +++ /dev/null @@ -1 +0,0 @@ -import{d as i,c as s,o as a,a as t,bA as d,W as u,Y as r}from"./index-D7HCX4VR.js";const c={flex:"~ col gap-6"},x={flex:"~ row","items-center":"","justify-between":""},f={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},m={text:"neutral-400 dark:neutral-500"},v=i({__name:"ProviderBasicSettings",props:{title:null,description:null,onReset:{type:Function}},setup(e){return(l,n)=>(a(),s("div",c,[t("div",x,[t("div",null,[t("h2",f,r(e.title||"Basic"),1),t("div",m,[t("span",null,r(e.description||"Essential settings"),1)])]),e.onReset?(a(),s("button",{key:0,title:"Reset settings",flex:"","items-center":"","justify-center":"","rounded-full":"","p-2":"",transition:"all duration-250 ease-in-out",text:"neutral-500 dark:neutral-400",bg:"transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700",onClick:n[0]||(n[0]=(...o)=>e.onReset&&e.onReset(...o))},n[1]||(n[1]=[t("div",{"i-solar:refresh-bold-duotone":"","text-xl":""},null,-1)]))):u("",!0)]),d(l.$slots,"default")]))}});export{v as _}; diff --git a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js deleted file mode 100644 index d62a3122c470f231c60930a68f3795015f38c56a..0000000000000000000000000000000000000000 --- a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js +++ /dev/null @@ -1 +0,0 @@ -import{d as o,c as r,o as t,bA as n}from"./index-D7HCX4VR.js";const a={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-6"},l=o({__name:"ProviderSettingsContainer",setup(s){return(e,c)=>(t(),r("div",a,[n(e.$slots,"default")]))}});export{l as _}; diff --git a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js deleted file mode 100644 index d6412dde5f1f913a1e715bf9f7e1c867db531ae9..0000000000000000000000000000000000000000 --- a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js +++ /dev/null @@ -1 +0,0 @@ -import{d as a,c2 as i,c as o,o as t,bA as s,bh as c,a as l,X as d,c3 as p}from"./index-D7HCX4VR.js";const u={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":""},_=a({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(n,v)=>{const r=i("motion");return t(),o(p,null,[s(n.$slots,"default"),c((t(),o("div",u,[l("div",{text:"60",class:d(e.providerIcon||e.providerIconColor)},null,2)])),[[r]])],64)}}});export{_}; diff --git a/assets/RadioCardSimple-B9zVtorf.js b/assets/RadioCardSimple-B9zVtorf.js deleted file mode 100644 index 093ee9af2e09f770a890cec2e26436f101dc4f86..0000000000000000000000000000000000000000 --- a/assets/RadioCardSimple-B9zVtorf.js +++ /dev/null @@ -1 +0,0 @@ -import{d as g,cg as f,ch as w,e as b,c as n,o as d,X as o,bh as V,a as t,c6 as I,W as v,Y as c,b as $,bg as S,cl as k,u as B,b_ as C,f as T,ca as z,c3 as E,c4 as N,bf as D}from"./index-D7HCX4VR.js";import{_ as P}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import{_ as U}from"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";const q=["checked","name","value"],L={class:"relative mr-3 mt-0.5 flex-shrink-0"},j={class:"w-full flex flex-col gap-2"},F={class:"flex items-center"},Q={key:0,class:"relative"},W=["title"],X={key:1,class:"mt-2"},Y=g({__name:"RadioCardDetail",props:f({id:null,name:null,value:null,title:null,description:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:""},customInputPlaceholder:{default:""},showCustomInput:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue"),m=b(!1);function s(){m.value=!m.value}return(x,r)=>(d(),n("label",{key:e.id,class:o(["form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-detail-active":"",e.deprecated?"opacity-60":""]]),transition:"all duration-200 ease-in-out",border:"2 solid"},[V(t("input",{"onUpdate:modelValue":r[0]||(r[0]=i=>a.value=i),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0"},null,8,q),[[I,a.value]]),t("div",L,[t("div",{class:o(["size-5 border-2 rounded-full transition-colors duration-200",[a.value===e.value?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[t("div",{class:o(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[a.value===e.value?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),t("div",j,[t("div",F,[t("span",{class:o(["line-clamp-1 font-thin",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},c(e.title),3)]),e.description?(d(),n("div",Q,[$(B(P),null,{default:S(()=>[!m.value||!e.showExpandCollapse?(d(),n("div",{key:0,class:o(["line-clamp-2 cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),title:e.description,onClick:k(s,["prevent"])},c(e.description),11,W)):(d(),n("div",{key:1,class:o(["cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),onClick:k(s,["prevent"])},c(e.description),3))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(d(),n("button",{key:0,class:"mt-0.5 inline-flex items-center text-xs text-primary-500 dark:text-primary-600",onClick:k(s,["prevent"])},[t("span",null,c(m.value?"Show less":"Show more"),1),t("div",{class:o([{"rotate-180":m.value},"transition-transform duration-200"])},r[2]||(r[2]=[t("div",{"i-solar:alt-arrow-down-bold-duotone":"","ml-0.5":"","text-xs":""},null,-1)]),2)])):v("",!0)])):v("",!0),e.showCustomInput&&a.value===e.value?(d(),n("div",X,[$(B(U),{modelValue:a.value,"onUpdate:modelValue":r[1]||(r[1]=i=>a.value=i),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:e.customInputPlaceholder},null,8,["modelValue","placeholder"])])):v("",!0)])],2))}}),A=C(Y,[["__scopeId","data-v-01e1298e"]]),G={class:"radio-card-detail-many-select"},H={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},J=["placeholder"],K={class:"mt-4 space-y-2"},O={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},Z={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},_={class:"flex flex-col"},ee={class:"font-medium"},te={class:"text-sm text-amber-600 dark:text-amber-400"},ae={class:"relative"},le=g({__name:"RadioCardManySelect",props:f({items:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search..."},searchNoResultsTitle:{default:"No results found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} results"},customInputPlaceholder:{default:"Enter custom value"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},showMore:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:f(["update:customValue"],["update:modelValue"]),setup(e,{emit:a}){const m=e,s=a,x=w(e,"modelValue"),r=b(""),i=b(!1),R=b(""),h=T(()=>{if(!r.value)return m.items;const p=r.value.toLowerCase();return m.items.filter(l=>l.name.toLowerCase().includes(p)||l.description&&l.description.toLowerCase().includes(p))});function M(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",G,[e.searchable?(d(),n("div",H,[l[4]||(l[4]=t("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[t("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),V(t("input",{"onUpdate:modelValue":l[0]||(l[0]=u=>r.value=u),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:e.searchPlaceholder},null,8,J),[[z,r.value]])])):v("",!0),t("div",K,[r.value?(d(),n("div",O,c(e.searchResultsText.replace("{count}",h.value.length.toString()).replace("{total}",e.items.length.toString())),1)):v("",!0),r.value&&h.value.length===0?(d(),n("div",Z,[l[5]||(l[5]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",_,[t("span",ee,c(e.searchNoResultsTitle),1),t("span",te,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",ae,[t("div",{class:o(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4 scrollbar-none",[i.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(d(!0),n(E,null,N(h.value,u=>(d(),D(A,{id:u.id,key:u.id,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=y=>x.value=y),value:u.id,title:u.name,description:u.description,deprecated:u.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":u.customizable,"custom-input-value":R.value,"custom-input-placeholder":e.customInputPlaceholder,name:"radio-card-detail-many-select",class:"scroll-snap-align-start","onUpdate:customInputValue":l[2]||(l[2]=y=>M(y))},null,8,["id","modelValue","value","title","description","deprecated","show-expand-collapse","show-custom-input","custom-input-value","custom-input-placeholder"]))),128))],2),t("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:o([i.value?"w-full":"mt-4 w-full rounded-lg"])},[t("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:o([i.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:l[3]||(l[3]=u=>i.value=!i.value)},[t("span",null,c(i.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:o([i.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),me=C(le,[["__scopeId","data-v-7ad6d626"]]),re=["checked","name","value"],oe={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},de=g({__name:"RadioCardSimple",props:f({id:null,name:null,value:null,title:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue");return(m,s)=>(d(),n("label",{key:e.id,border:"2px solid",class:o(["form_radio-card-simple relative",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-simple-active":""]]),transition:"all duration-200 ease-in-out",flex:"~ col",block:"","min-w-50":"","w-fit":"","cursor-pointer":"","items-start":"","rounded-xl":"","p-4":"","text-left":""},[V(t("input",{"onUpdate:modelValue":s[0]||(s[0]=x=>a.value=x),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0 [&:checked+div]:border-primary-500 [&:checked+div_.radio-dot]:opacity-100 dark:[&:checked+div]:border-primary-400"},null,8,re),[[I,a.value]]),s[1]||(s[1]=t("div",{class:"radio-circle absolute left-2 top-2 size-5 rounded-full",border:"2 solid neutral-300 dark:neutral-600",transition:"all duration-200 ease-in-out"},[t("div",{class:"radio-dot absolute left-1/2 top-1/2 size-3 rounded-full opacity-0 -translate-x-1/2 -translate-y-1/2",transition:"all duration-200 ease-in-out",bg:"primary-500 dark:primary-400"})],-1)),t("div",oe,[t("span",{class:o(["radio-item-name font-thin",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-500 dark:text-neutral-500"]]),text:"md",transition:"all duration-200 ease-in-out"},c(e.title),3),e.description?(d(),n("span",{key:0,class:o(["radio-item-description",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-400 dark:text-neutral-600"]]),transition:"all duration-200 ease-in-out"},c(e.description),3)):v("",!0)]),s[2]||(s[2]=t("div",{class:"bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50 [input:checked~&]:bg-dotted-primary-300/50 dark:[input:checked~&]:bg-dotted-primary-200/20",absolute:"","inset-0":"","z--1":"",style:{"background-size":"10px 10px","mask-image":"linear-gradient(165deg, white 30%, transparent 50%)"}},null,-1))],2))}}),ve=C(de,[["__scopeId","data-v-50bfb5e4"]]);export{me as R,ve as a}; diff --git a/assets/Screen.vue_vue_type_script_setup_true_lang-CQ37H7oV.js b/assets/Screen.vue_vue_type_script_setup_true_lang-CQ37H7oV.js deleted file mode 100644 index 9682baede2d02acf4037476b5c41d46bc5de7754..0000000000000000000000000000000000000000 --- a/assets/Screen.vue_vue_type_script_setup_true_lang-CQ37H7oV.js +++ /dev/null @@ -1 +0,0 @@ -import{d as p,e as h,cd as w,ce as g,c0 as _,f as u,w as f,T as k,c as B,o as E,bA as R,cf as S}from"./index-D7HCX4VR.js";const y=p({__name:"Screen",setup(T){const l=h(),s=w(S),{width:i,height:d}=g(),t=_(l,{immediate:!0,windowResize:!0,reset:!0}),n=u(()=>s.between("sm","md").value||s.smaller("sm").value),r=u(()=>s.between("md","lg").value),v=u(()=>s.greaterOrEqual("lg").value),m=u(()=>v.value?t.width.value:n.value||r.value?i.value-16:t.width.value),a=h(0);return f([i,d,l],()=>{var o,c;const e=(c=(o=l.value)==null?void 0:o.parentElement)==null?void 0:c.getBoundingClientRect();v.value||n.value||r.value?a.value=(e==null?void 0:e.height)||0:a.value=600}),f([t.width,t.height],()=>{v.value||n.value||r.value?a.value=t.height.value:a.value=600}),k(async()=>{l.value&&t.update()}),(e,o)=>(E(),B("div",{ref_key:"containerRef",ref:l,"h-full":"","w-full":""},[R(e.$slots,"default",{width:m.value,height:a.value})],512))}});export{y as _}; diff --git a/assets/Select-DG6Ttq5U.css b/assets/Select-DG6Ttq5U.css deleted file mode 100644 index 7e928929a3cec80de92777b98af262f202af5799..0000000000000000000000000000000000000000 --- a/assets/Select-DG6Ttq5U.css +++ /dev/null @@ -1 +0,0 @@ -.form_input-range[data-v-c59a94f0]{--height: 2em;min-height:var(--height);-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border-radius:4px;transition:background-color .2s ease;--thumb-width: 4px;--thumb-height: var(--height);--thumb-box-shadow: 0 0 0px #e6e6e6;--thumb-border: none;--thumb-border-radius: 999px;--thumb-background: oklch(80% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0));--thumb-background-hover: oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0));--thumb-background-active: oklch(70% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0));--track-height: calc(var(--height) - var(--track-value-padding) * 2);--track-box-shadow: none;--track-border: solid 2px rgb(238, 238, 238);--track-border-radius: 6px;--track-background: rgb(238, 238, 238);--track-background-hover: rgb(238, 238, 238);--track-background-active: rgb(238, 238, 238);--track-value-background: rgb(255, 255, 255);--track-value-background-hover: rgb(255, 255, 255);--track-value-background-active: rgb(255, 255, 255);--track-value-padding: 2px}.dark .form_input-range[data-v-c59a94f0]{--thumb-background: oklch(70% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0));--thumb-background-hover: oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0));--thumb-background-active: oklch(80% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0));--track-border: solid 2px rgb(44, 44, 44);--track-background: rgb(44, 44, 44);--track-background-hover: rgb(44, 44, 44);--track-background-active: rgb(44, 44, 44);--track-value-background: rgb(164, 164, 164);--track-value-background-hover: rgb(164, 164, 164);--track-value-background-active: rgb(164, 164, 164)}.form_input-range.slider-progress[data-v-c59a94f0]{--range: calc(var(--max) - var(--min));--ratio: calc((var(--value) - var(--min)) / var(--range));--sx: calc(.5 * 0em + var(--ratio) * (100% - 0em))}.form_input-range[data-v-c59a94f0]:focus{outline:none}.form_input-range[data-v-c59a94f0]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:calc(var(--track-height) * .5 - var(--thumb-height) * .5 - 2px);margin-left:calc(0 - var(--track-value-padding));cursor:col-resize;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s ease-in-out}.form_input-range[data-v-c59a94f0]::-webkit-slider-runnable-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);box-shadow:var(--track-box-shadow);position:relative;cursor:col-resize;transition:box-shadow .2s ease-in-out,border-color .2s ease-in-out}.form_input-range[data-v-c59a94f0]::-webkit-slider-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-c59a94f0]:hover::-webkit-slider-runnable-track{background:var(--track-background-hover)}.form_input-range[data-v-c59a94f0]::-webkit-slider-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-c59a94f0]:active::-webkit-slider-runnable-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-c59a94f0]::-webkit-slider-runnable-track{margin-right:calc(0 - var(--track-value-padding));background:linear-gradient(var(--track-value-background),var(--track-value-background)) 0 / var(--sx) 100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-c59a94f0]:hover::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover)) 0 / var(--sx) 100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-c59a94f0]:active::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active)) 0 / var(--sx) 100% no-repeat,var(--track-background-active)}.form_input-range[data-v-c59a94f0]::-moz-range-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:none;box-shadow:var(--thumb-box-shadow);cursor:col-resize;margin-left:calc(0 - var(--track-value-padding))}.form_input-range[data-v-c59a94f0]::-moz-range-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);box-shadow:var(--track-box-shadow);cursor:col-resize;width:calc(100% - var(--track-value-padding) * 2)}.form_input-range[data-v-c59a94f0]::-moz-range-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-c59a94f0]:hover::-moz-range-track{background:var(--track-background-hover)}.form_input-range[data-v-c59a94f0]::-moz-range-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-c59a94f0]:active::-moz-range-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-c59a94f0]::-moz-range-track{background:linear-gradient(var(--track-value-background),var(--track-value-background)) 0 / var(--sx) 100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-c59a94f0]:hover::-moz-range-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover)) 0 / var(--sx) 100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-c59a94f0]:active::-moz-range-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active)) 0 / var(--sx) 100% no-repeat,var(--track-background-active)}.form_input-range[data-v-c59a94f0]::-ms-fill-upper{background:transparent;border-color:transparent}.form_input-range[data-v-c59a94f0]::-ms-fill-lower{background:transparent;border-color:transparent}.form_input-range[data-v-c59a94f0]::-ms-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:0;margin-left:calc(0 - var(--track-value-padding));box-sizing:border-box;cursor:col-resize}.form_input-range[data-v-c59a94f0]::-ms-track{height:var(--track-height);border-radius:var(--track-border-radius);background:var(--track-background);border:var(--track-border);box-shadow:var(--track-box-shadow);box-sizing:border-box;cursor:col-resize}.form_input-range[data-v-c59a94f0]::-ms-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-c59a94f0]:hover::-ms-track{background:var(--track-background-hover)}.form_input-range[data-v-c59a94f0]::-ms-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-c59a94f0]:active::-ms-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-c59a94f0]::-ms-fill-lower{height:var(--track-height);border-radius:var(--track-border-radius) 0 0 var(--track-border-radius);margin:0;background:var(--track-value-background);border:none;border-right-width:0;margin-left:calc(var(--track-value-padding));margin-right:calc(0 - var(--track-value-padding))}.form_input-range.slider-progress[data-v-c59a94f0]:hover::-ms-fill-lower{background:var(--track-value-background-hover)}.form_input-range.slider-progress[data-v-c59a94f0]:active::-ms-fill-lower{background:var(--track-value-background-active)}.color-hue-range[data-v-ae80cb9d]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.5rem;background:linear-gradient(to right,#ffb6cb,#ffbaae 8.33%,#ffbc9d 12.5%,#ffbd94 14.58%,#ffbe8f 15.62%,#ffbe8c,#ffbe89 16.67%,#fac704,#bedf0d 33.33%,#bae025,#b6e133 34.38%,#aee347 35.42%,#9be764 37.5%,#6ded8f 41.67%,#4aefa1 43.75%,#2ef1aa 44.79%,#13f1ae 45.31%,#00f1b0,#00f1b3 45.83%,#00f0bc,#01efc4 47.92%,#00eed2 50%,#36e6ff 58.33%,#84dbff,#9cd6ff 66.67%,#9dd5ff,#9ed5ff 67.19%,#a0d4ff 67.71%,#a4d3ff 68.75%,#acd1ff 70.83%,#bcf 75%,#d6c1ff,#ffadf7,#ffb6cb);background:linear-gradient(to right,color(xyz 0.829 0.56 0.613),color(xyz 0.771 0.573 0.303) 8.33%,color(xyz 0.747 0.579 0.179) 12.5%,color(xyz 0.736 0.581 0.124) 14.58%,color(xyz 0.731 0.582 0.098) 15.62%,color(xyz 0.729 0.583 0.085),color(xyz 0.726 0.583 0.073) 16.67%,#fac704,#bedf0d 33.33%,#bae025,#b6e133 34.38%,#aee347 35.42%,#9be764 37.5%,#6ded8f 41.67%,#4aefa1 43.75%,#2ef1aa 44.79%,#13f1ae,color(xyz 0.392 0.664 0.531) 45.83%,color(xyz 0.388 0.665 0.577),color(xyz 0.384 0.667 0.624) 47.92%,color(xyz 0.377 0.67 0.724) 50%,color(xyz 0.456 0.651 1.158) 58.33%,color(xyz 0.503 0.639 1.415),color(xyz 0.554 0.627 1.699) 66.67%,color(xyz 0.56 0.625 1.697),color(xyz 0.566 0.623 1.694) 67.71%,color(xyz 0.578 0.62 1.688) 68.75%,color(xyz 0.601 0.613 1.677) 70.83%,color(xyz 0.651 0.6 1.654) 75%,color(xyz 0.756 0.573 1.609),color(xyz 0.777 0.569 1.05),color(xyz 0.829 0.56 0.613))}.color-hue-range[data-v-ae80cb9d]::-webkit-slider-thumb{width:.25rem;height:3rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-width:2px;--un-border-opacity:1;border-color:rgb(115 115 115 / var(--un-border-opacity));border-radius:.375rem;background-color:rgb(82 82 82 / var(--un-bg-opacity));--un-bg-opacity:1;background-color:rgb(38 38 38 / var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.2s}.dark .color-hue-range[data-v-ae80cb9d]::-webkit-slider-thumb{width:.25rem;height:3rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-width:2px;--un-border-opacity:1;border-color:rgb(255 255 255 / var(--un-border-opacity));border-radius:.375rem;background-color:rgb(245 245 245 / var(--un-bg-opacity));--un-bg-opacity:1;background-color:rgb(212 212 212 / var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.2s}.color-hue-range[data-v-ae80cb9d]::-moz-range-thumb{width:.25rem;height:3rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-width:2px;--un-border-opacity:1;border-color:rgb(115 115 115 / var(--un-border-opacity));border-radius:.375rem;background-color:rgb(82 82 82 / var(--un-bg-opacity));--un-bg-opacity:1;background-color:rgb(38 38 38 / var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.2s}.dark .color-hue-range[data-v-ae80cb9d]::-moz-range-thumb{width:.25rem;height:3rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-width:2px;--un-border-opacity:1;border-color:rgb(255 255 255 / var(--un-border-opacity));border-radius:.375rem;background-color:rgb(245 245 245 / var(--un-bg-opacity));--un-bg-opacity:1;background-color:rgb(212 212 212 / var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.2s}.resize-observer[data-v-b329ee4c]{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;border:none;background-color:transparent;pointer-events:none;display:block;overflow:hidden;opacity:0}.resize-observer[data-v-b329ee4c] object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}.v-popper__popper{z-index:10000;top:0;left:0;outline:none}.v-popper__arrow-container{display:none}.v-popper__inner{border:none!important} diff --git a/assets/Select.vue_vue_type_style_index_0_lang-csKR1SR-.js b/assets/Select.vue_vue_type_style_index_0_lang-csKR1SR-.js deleted file mode 100644 index e8c178460382890d8c5caae1cfae8990e52707b3..0000000000000000000000000000000000000000 --- a/assets/Select.vue_vue_type_style_index_0_lang-csKR1SR-.js +++ /dev/null @@ -1 +0,0 @@ -import{d as ve,cO as At,cP as Pt,a2 as Ae,c as Pe,o as ee,a as Q,W as Ie,c3 as Ct,bf as Re,bA as fe,a3 as be,cQ as Ot,X as lt,_ as zt,cR as Nt,bg as We,b as kt,cj as Ht,cu as Rt,cv as Bt}from"./index-D7HCX4VR.js";const dt=["top","right","bottom","left"],je=["start","end"],Ve=dt.reduce((e,t)=>e.concat(t,t+"-"+je[0],t+"-"+je[1]),[]),ae=Math.min,K=Math.max,Si=Math.round,Ti=Math.floor,Ai=e=>({x:e,y:e}),Mt={left:"right",right:"left",bottom:"top",top:"bottom"},Dt={start:"end",end:"start"};function Ce(e,t,i){return K(e,ae(t,i))}function E(e,t){return typeof e=="function"?e(t):e}function H(e){return e.split("-")[0]}function k(e){return e.split("-")[1]}function Be(e){return e==="x"?"y":"x"}function Me(e){return e==="y"?"height":"width"}function Y(e){return["top","bottom"].includes(H(e))?"y":"x"}function De(e){return Be(Y(e))}function ct(e,t,i){i===void 0&&(i=!1);const o=k(e),n=De(e),s=Me(n);let r=n==="x"?o===(i?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=ge(r)),[r,ge(r)]}function Lt(e){const t=ge(e);return[me(e),t,me(t)]}function me(e){return e.replace(/start|end/g,t=>Dt[t])}function Et(e,t,i){const o=["left","right"],n=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?n:o:t?o:n;case"left":case"right":return t?s:r;default:return[]}}function Ft(e,t,i,o){const n=k(e);let s=Et(H(e),i==="start",o);return n&&(s=s.map(r=>r+"-"+n),t&&(s=s.concat(s.map(me)))),s}function ge(e){return e.replace(/left|right|bottom|top/g,t=>Mt[t])}function It(e){return{top:0,right:0,bottom:0,left:0,...e}}function pt(e){return typeof e!="number"?It(e):{top:e,right:e,bottom:e,left:e}}function oe(e){const{x:t,y:i,width:o,height:n}=e;return{width:o,height:n,top:i,left:t,right:t+o,bottom:i+n,x:t,y:i}}function qe(e,t,i){let{reference:o,floating:n}=e;const s=Y(t),r=De(t),a=Me(r),l=H(t),d=s==="y",h=o.x+o.width/2-n.width/2,c=o.y+o.height/2-n.height/2,u=o[a]/2-n[a]/2;let p;switch(l){case"top":p={x:h,y:o.y-n.height};break;case"bottom":p={x:h,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:c};break;case"left":p={x:o.x-n.width,y:c};break;default:p={x:o.x,y:o.y}}switch(k(t)){case"start":p[r]-=u*(i&&d?-1:1);break;case"end":p[r]+=u*(i&&d?-1:1);break}return p}const Wt=async(e,t,i)=>{const{placement:o="bottom",strategy:n="absolute",middleware:s=[],platform:r}=i,a=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let d=await r.getElementRects({reference:e,floating:t,strategy:n}),{x:h,y:c}=qe(d,o,l),u=o,p={},f=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:i,y:o,placement:n,rects:s,platform:r,elements:a,middlewareData:l}=t,{element:d,padding:h=0}=E(e,t)||{};if(d==null)return{};const c=pt(h),u={x:i,y:o},p=De(n),f=Me(p),m=await r.getDimensions(d),w=p==="y",g=w?"top":"left",y=w?"bottom":"right",x=w?"clientHeight":"clientWidth",_=s.reference[f]+s.reference[p]-u[p]-s.floating[f],$=u[p]-s.reference[p],T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(d));let A=T?T[x]:0;(!A||!await(r.isElement==null?void 0:r.isElement(T)))&&(A=a.floating[x]||s.floating[f]);const R=_/2-$/2,C=A/2-m[f]/2-1,b=ae(c[g],C),P=ae(c[y],C),O=b,B=A-m[f]-P,S=A/2-m[f]/2+R,J=Ce(O,S,B),F=!l.arrow&&k(n)!=null&&S!==J&&s.reference[f]/2-(Sk(n)===e),...i.filter(n=>k(n)!==e)]:i.filter(n=>H(n)===n)).filter(n=>e?k(n)===e||(t?me(n)!==n:!1):!0)}const qt=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var i,o,n;const{rects:s,middlewareData:r,placement:a,platform:l,elements:d}=t,{crossAxis:h=!1,alignment:c,allowedPlacements:u=Ve,autoAlignment:p=!0,...f}=E(e,t),m=c!==void 0||u===Ve?Vt(c||null,p,u):u,w=await ie(t,f),g=((i=r.autoPlacement)==null?void 0:i.index)||0,y=m[g];if(y==null)return{};const x=ct(y,s,await(l.isRTL==null?void 0:l.isRTL(d.floating)));if(a!==y)return{reset:{placement:m[0]}};const _=[w[H(y)],w[x[0]],w[x[1]]],$=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:_}],T=m[g+1];if(T)return{data:{index:g+1,overflows:$},reset:{placement:T}};const A=$.map(b=>{const P=k(b.placement);return[b.placement,P&&h?b.overflows.slice(0,2).reduce((O,B)=>O+B,0):b.overflows[0],b.overflows]}).sort((b,P)=>b[1]-P[1]),C=((n=A.filter(b=>b[2].slice(0,k(b[0])?2:3).every(P=>P<=0))[0])==null?void 0:n[0])||A[0][0];return C!==a?{data:{index:g+1,overflows:$},reset:{placement:C}}:{}}}},Gt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,o;const{placement:n,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:d}=t,{mainAxis:h=!0,crossAxis:c=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...w}=E(e,t);if((i=s.arrow)!=null&&i.alignmentOffset)return{};const g=H(n),y=Y(a),x=H(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(d.floating)),$=u||(x||!m?[ge(a)]:Lt(a)),T=f!=="none";!u&&T&&$.push(...Ft(a,m,f,_));const A=[a,...$],R=await ie(t,w),C=[];let b=((o=s.flip)==null?void 0:o.overflows)||[];if(h&&C.push(R[g]),c){const S=ct(n,r,_);C.push(R[S[0]],R[S[1]])}if(b=[...b,{placement:n,overflows:C}],!C.every(S=>S<=0)){var P,O;const S=(((P=s.flip)==null?void 0:P.index)||0)+1,J=A[S];if(J)return{data:{index:S,overflows:b},reset:{placement:J}};let F=(O=b.filter(M=>M.overflows[0]<=0).sort((M,I)=>M.overflows[1]-I.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(p){case"bestFit":{var B;const M=(B=b.filter(I=>{if(T){const W=Y(I.placement);return W===y||W==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(W=>W>0).reduce((W,Tt)=>W+Tt,0)]).sort((I,W)=>I[1]-W[1])[0])==null?void 0:B[0];M&&(F=M);break}case"initialPlacement":F=a;break}if(n!==F)return{reset:{placement:F}}}return{}}}};function Ge(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ye(e){return dt.some(t=>e[t]>=0)}const Pi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i}=t,{strategy:o="referenceHidden",...n}=E(e,t);switch(o){case"referenceHidden":{const s=await ie(t,{...n,elementContext:"reference"}),r=Ge(s,i.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Ye(r)}}}case"escaped":{const s=await ie(t,{...n,altBoundary:!0}),r=Ge(s,i.floating);return{data:{escapedOffsets:r,escaped:Ye(r)}}}default:return{}}}}};async function Yt(e,t){const{placement:i,platform:o,elements:n}=e,s=await(o.isRTL==null?void 0:o.isRTL(n.floating)),r=H(i),a=k(i),l=Y(i)==="y",d=["left","top"].includes(r)?-1:1,h=s&&l?-1:1,c=E(t,e);let{mainAxis:u,crossAxis:p,alignmentAxis:f}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof f=="number"&&(p=a==="end"?f*-1:f),l?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const Xt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,o;const{x:n,y:s,placement:r,middlewareData:a}=t,l=await Yt(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:n+l.x,y:s+l.y,data:{...l,placement:r}}}}},Ut=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:o,placement:n}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:w=>{let{x:g,y}=w;return{x:g,y}}},...l}=E(e,t),d={x:i,y:o},h=await ie(t,l),c=Y(H(n)),u=Be(c);let p=d[u],f=d[c];if(s){const w=u==="y"?"top":"left",g=u==="y"?"bottom":"right",y=p+h[w],x=p-h[g];p=Ce(y,p,x)}if(r){const w=c==="y"?"top":"left",g=c==="y"?"bottom":"right",y=f+h[w],x=f-h[g];f=Ce(y,f,x)}const m=a.fn({...t,[u]:p,[c]:f});return{...m,data:{x:m.x-i,y:m.y-o,enabled:{[u]:s,[c]:r}}}}}},Ci=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:i,y:o,placement:n,rects:s,middlewareData:r}=t,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=E(e,t),h={x:i,y:o},c=Y(n),u=Be(c);let p=h[u],f=h[c];const m=E(a,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=u==="y"?"height":"width",_=s.reference[u]-s.floating[x]+w.mainAxis,$=s.reference[u]+s.reference[x]-w.mainAxis;p<_?p=_:p>$&&(p=$)}if(d){var g,y;const x=u==="y"?"width":"height",_=["top","left"].includes(H(n)),$=s.reference[c]-s.floating[x]+(_&&((g=r.offset)==null?void 0:g[c])||0)+(_?0:w.crossAxis),T=s.reference[c]+s.reference[x]+(_?0:((y=r.offset)==null?void 0:y[c])||0)-(_?w.crossAxis:0);f<$?f=$:f>T&&(f=T)}return{[u]:p,[c]:f}}}},Kt=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var i,o;const{placement:n,rects:s,platform:r,elements:a}=t,{apply:l=()=>{},...d}=E(e,t),h=await ie(t,d),c=H(n),u=k(n),p=Y(n)==="y",{width:f,height:m}=s.floating;let w,g;c==="top"||c==="bottom"?(w=c,g=u===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(g=c,w=u==="end"?"top":"bottom");const y=m-h.top-h.bottom,x=f-h.left-h.right,_=ae(m-h[w],y),$=ae(f-h[g],x),T=!t.middlewareData.shift;let A=_,R=$;if((i=t.middlewareData.shift)!=null&&i.enabled.x&&(R=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(A=y),T&&!u){const b=K(h.left,0),P=K(h.right,0),O=K(h.top,0),B=K(h.bottom,0);p?R=f-2*(b!==0||P!==0?b+P:K(h.left,h.right)):A=m-2*(O!==0||B!==0?O+B:K(h.top,h.bottom))}await l({...t,availableWidth:R,availableHeight:A});const C=await r.getDimensions(a.floating);return f!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}};function z(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function D(e){return z(e).getComputedStyle(e)}const Xe=Math.min,ne=Math.max,we=Math.round;function ht(e){const t=D(e);let i=parseFloat(t.width),o=parseFloat(t.height);const n=e.offsetWidth,s=e.offsetHeight,r=we(i)!==n||we(o)!==s;return r&&(i=n,o=s),{width:i,height:o,fallback:r}}function X(e){return ft(e)?(e.nodeName||"").toLowerCase():""}let pe;function ut(){if(pe)return pe;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(pe=e.brands.map(t=>t.brand+"/"+t.version).join(" "),pe):navigator.userAgent}function L(e){return e instanceof z(e).HTMLElement}function q(e){return e instanceof z(e).Element}function ft(e){return e instanceof z(e).Node}function Ue(e){return typeof ShadowRoot>"u"?!1:e instanceof z(e).ShadowRoot||e instanceof ShadowRoot}function xe(e){const{overflow:t,overflowX:i,overflowY:o,display:n}=D(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+i)&&!["inline","contents"].includes(n)}function Qt(e){return["table","td","th"].includes(X(e))}function Oe(e){const t=/firefox/i.test(ut()),i=D(e),o=i.backdropFilter||i.WebkitBackdropFilter;return i.transform!=="none"||i.perspective!=="none"||!!o&&o!=="none"||t&&i.willChange==="filter"||t&&!!i.filter&&i.filter!=="none"||["transform","perspective"].some(n=>i.willChange.includes(n))||["paint","layout","strict","content"].some(n=>{const s=i.contain;return s!=null&&s.includes(n)})}function mt(){return!/^((?!chrome|android).)*safari/i.test(ut())}function Le(e){return["html","body","#document"].includes(X(e))}function gt(e){return q(e)?e:e.contextElement}const wt={x:1,y:1};function te(e){const t=gt(e);if(!L(t))return wt;const i=t.getBoundingClientRect(),{width:o,height:n,fallback:s}=ht(t);let r=(s?we(i.width):i.width)/o,a=(s?we(i.height):i.height)/n;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function le(e,t,i,o){var n,s;t===void 0&&(t=!1),i===void 0&&(i=!1);const r=e.getBoundingClientRect(),a=gt(e);let l=wt;t&&(o?q(o)&&(l=te(o)):l=te(e));const d=a?z(a):window,h=!mt()&&i;let c=(r.left+(h&&((n=d.visualViewport)==null?void 0:n.offsetLeft)||0))/l.x,u=(r.top+(h&&((s=d.visualViewport)==null?void 0:s.offsetTop)||0))/l.y,p=r.width/l.x,f=r.height/l.y;if(a){const m=z(a),w=o&&q(o)?z(o):o;let g=m.frameElement;for(;g&&o&&w!==m;){const y=te(g),x=g.getBoundingClientRect(),_=getComputedStyle(g);x.x+=(g.clientLeft+parseFloat(_.paddingLeft))*y.x,x.y+=(g.clientTop+parseFloat(_.paddingTop))*y.y,c*=y.x,u*=y.y,p*=y.x,f*=y.y,c+=x.x,u+=x.y,g=z(g).frameElement}}return{width:p,height:f,top:u,right:c+p,bottom:u+f,left:c,x:c,y:u}}function G(e){return((ft(e)?e.ownerDocument:e.document)||window.document).documentElement}function $e(e){return q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function yt(e){return le(G(e)).left+$e(e).scrollLeft}function de(e){if(X(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ue(e)&&e.host||G(e);return Ue(t)?t.host:t}function vt(e){const t=de(e);return Le(t)?t.ownerDocument.body:L(t)&&xe(t)?t:vt(t)}function ye(e,t){var i;t===void 0&&(t=[]);const o=vt(e),n=o===((i=e.ownerDocument)==null?void 0:i.body),s=z(o);return n?t.concat(s,s.visualViewport||[],xe(o)?o:[]):t.concat(o,ye(o))}function Ke(e,t,i){return t==="viewport"?oe(function(o,n){const s=z(o),r=G(o),a=s.visualViewport;let l=r.clientWidth,d=r.clientHeight,h=0,c=0;if(a){l=a.width,d=a.height;const u=mt();(u||!u&&n==="fixed")&&(h=a.offsetLeft,c=a.offsetTop)}return{width:l,height:d,x:h,y:c}}(e,i)):q(t)?oe(function(o,n){const s=le(o,!0,n==="fixed"),r=s.top+o.clientTop,a=s.left+o.clientLeft,l=L(o)?te(o):{x:1,y:1};return{width:o.clientWidth*l.x,height:o.clientHeight*l.y,x:a*l.x,y:r*l.y}}(t,i)):oe(function(o){const n=G(o),s=$e(o),r=o.ownerDocument.body,a=ne(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),l=ne(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let d=-s.scrollLeft+yt(o);const h=-s.scrollTop;return D(r).direction==="rtl"&&(d+=ne(n.clientWidth,r.clientWidth)-a),{width:a,height:l,x:d,y:h}}(G(e)))}function Qe(e){return L(e)&&D(e).position!=="fixed"?e.offsetParent:null}function Ze(e){const t=z(e);let i=Qe(e);for(;i&&Qt(i)&&D(i).position==="static";)i=Qe(i);return i&&(X(i)==="html"||X(i)==="body"&&D(i).position==="static"&&!Oe(i))?t:i||function(o){let n=de(o);for(;L(n)&&!Le(n);){if(Oe(n))return n;n=de(n)}return null}(e)||t}function Zt(e,t,i){const o=L(t),n=G(t),s=le(e,!0,i==="fixed",t);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&i!=="fixed")if((X(t)!=="body"||xe(n))&&(r=$e(t)),L(t)){const l=le(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else n&&(a.x=yt(n));return{x:s.left+r.scrollLeft-a.x,y:s.top+r.scrollTop-a.y,width:s.width,height:s.height}}const Jt={getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:o,strategy:n}=e;const s=i==="clippingAncestors"?function(d,h){const c=h.get(d);if(c)return c;let u=ye(d).filter(w=>q(w)&&X(w)!=="body"),p=null;const f=D(d).position==="fixed";let m=f?de(d):d;for(;q(m)&&!Le(m);){const w=D(m),g=Oe(m);(f?g||p:g||w.position!=="static"||!p||!["absolute","fixed"].includes(p.position))?p=w:u=u.filter(y=>y!==m),m=de(m)}return h.set(d,u),u}(t,this._c):[].concat(i),r=[...s,o],a=r[0],l=r.reduce((d,h)=>{const c=Ke(t,h,n);return d.top=ne(c.top,d.top),d.right=Xe(c.right,d.right),d.bottom=Xe(c.bottom,d.bottom),d.left=ne(c.left,d.left),d},Ke(t,a,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:i,strategy:o}=e;const n=L(i),s=G(i);if(i===s)return t;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((n||!n&&o!=="fixed")&&((X(i)!=="body"||xe(s))&&(r=$e(i)),L(i))){const d=le(i);a=te(i),l.x=d.x+i.clientLeft,l.y=d.y+i.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+l.x,y:t.y*a.y-r.scrollTop*a.y+l.y}},isElement:q,getDimensions:function(e){return L(e)?ht(e):e.getBoundingClientRect()},getOffsetParent:Ze,getDocumentElement:G,getScale:te,async getElementRects(e){let{reference:t,floating:i,strategy:o}=e;const n=this.getOffsetParent||Ze,s=this.getDimensions;return{reference:Zt(t,await n(i),o),floating:{x:0,y:0,...await s(i)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>D(e).direction==="rtl"},ei=(e,t,i)=>{const o=new Map,n={platform:Jt,...i},s={...n.platform,_c:o};return Wt(e,t,{...n,platform:s})},Z={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 ze(e,t){let i=Z.themes[e]||{},o;do o=i[t],typeof o>"u"?i.$extend?i=Z.themes[i.$extend]||{}:(i=null,o=Z[t]):i=null;while(i);return o}function ti(e){const t=[e];let i=Z.themes[e]||{};do i.$extend&&!i.$resetCss?(t.push(i.$extend),i=Z.themes[i.$extend]||{}):i=null;while(i);return t.map(o=>`v-popper--theme-${o}`)}function Je(e){const t=[e];let i=Z.themes[e]||{};do i.$extend?(t.push(i.$extend),i=Z.themes[i.$extend]||{}):i=null;while(i);return t}let ce=!1;if(typeof window<"u"){ce=!1;try{const e=Object.defineProperty({},"passive",{get(){ce=!0}});window.addEventListener("test",null,e)}catch{}}let xt=!1;typeof window<"u"&&typeof navigator<"u"&&(xt=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const ii=["auto","top","bottom","left","right"].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),et={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},tt={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"};function it(e,t){const i=e.indexOf(t);i!==-1&&e.splice(i,1)}function Se(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const N=[];let U=null;const ot={};function nt(e){let t=ot[e];return t||(t=ot[e]=[]),t}let Ne=function(){};typeof window<"u"&&(Ne=window.Element);function v(e){return function(t){return ze(t.theme,e)}}const Te="__floating-vue__popper",$t=()=>ve({name:"VPopper",provide(){return{[Te]:{parentPopper:this}}},inject:{[Te]:{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:v("disabled")},positioningDisabled:{type:Boolean,default:v("positioningDisabled")},placement:{type:String,default:v("placement"),validator:e=>ii.includes(e)},delay:{type:[String,Number,Object],default:v("delay")},distance:{type:[Number,String],default:v("distance")},skidding:{type:[Number,String],default:v("skidding")},triggers:{type:Array,default:v("triggers")},showTriggers:{type:[Array,Function],default:v("showTriggers")},hideTriggers:{type:[Array,Function],default:v("hideTriggers")},popperTriggers:{type:Array,default:v("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:v("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:v("popperHideTriggers")},container:{type:[String,Object,Ne,Boolean],default:v("container")},boundary:{type:[String,Ne],default:v("boundary")},strategy:{type:String,validator:e=>["absolute","fixed"].includes(e),default:v("strategy")},autoHide:{type:[Boolean,Function],default:v("autoHide")},handleResize:{type:Boolean,default:v("handleResize")},instantMove:{type:Boolean,default:v("instantMove")},eagerMount:{type:Boolean,default:v("eagerMount")},popperClass:{type:[String,Array,Object],default:v("popperClass")},computeTransformOrigin:{type:Boolean,default:v("computeTransformOrigin")},autoMinSize:{type:Boolean,default:v("autoMinSize")},autoSize:{type:[Boolean,String],default:v("autoSize")},autoMaxSize:{type:Boolean,default:v("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:v("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:v("preventOverflow")},overflowPadding:{type:[Number,String],default:v("overflowPadding")},arrowPadding:{type:[Number,String],default:v("arrowPadding")},arrowOverflow:{type:Boolean,default:v("arrowOverflow")},flip:{type:Boolean,default:v("flip")},shift:{type:Boolean,default:v("shift")},shiftCrossAxis:{type:Boolean,default:v("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:v("noAutoFocus")},disposeTimeout:{type:Number,default:v("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.ariaId:this.randomId},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[Te])==null?void 0:e.parentPopper},hasPopperShowTriggerHover(){var e,t;return((e=this.popperTriggers)==null?void 0:e.includes("hover"))||((t=this.popperShowTriggers)==null?void 0:t.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:i=!1}={}){var o,n;(o=this.parentPopper)!=null&&o.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(i||!this.disabled)&&(((n=this.parentPopper)==null?void 0:n.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 i;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}((i=this.parentPopper)==null?void 0:i.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)==null?void 0:e.call(this))??this.$el,this.$_targetNodes=this.targetNodes().filter(t=>t.nodeType===t.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;const e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(Xt({mainAxis:this.distance,crossAxis:this.skidding}));const t=this.placement.startsWith("auto");if(t?e.middleware.push(qt({alignment:this.placement.split("-")[1]??""})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(Ut({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(Gt({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(jt({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:"arrowOverflow",fn:({placement:o,rects:n,middlewareData:s})=>{let r;const{centerOffset:a}=s.arrow;return o.startsWith("top")||o.startsWith("bottom")?r=Math.abs(a)>n.reference.width/2:r=Math.abs(a)>n.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){const o=this.autoSize?this.autoSize:this.autoMinSize?"min":null;e.middleware.push({name:"autoSize",fn:({rects:n,placement:s,middlewareData:r})=>{var a;if((a=r.autoSize)!=null&&a.skip)return{};let l,d;return s.startsWith("top")||s.startsWith("bottom")?l=n.reference.width:d=n.reference.height,this.$_innerNode.style[o==="min"?"minWidth":o==="max"?"maxWidth":"width"]=l!=null?`${l}px`:null,this.$_innerNode.style[o==="min"?"minHeight":o==="max"?"maxHeight":"height"]=d!=null?`${d}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(Kt({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:o,availableHeight:n})=>{this.$_innerNode.style.maxWidth=o!=null?`${o}px`:null,this.$_innerNode.style.maxHeight=n!=null?`${n}px`:null}})));const i=await ei(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:i.x,y:i.y,placement:i.placement,strategy:i.strategy,arrow:{...i.middlewareData.arrow,...i.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),U&&this.instantMove&&U.instantMove&&U!==this.parentPopper){U.$_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&&(U=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(e){const 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 Se(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...ye(this.$_referenceNode),...ye(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const t=this.$_referenceNode.getBoundingClientRect(),i=this.$_popperNode.querySelector(".v-popper__wrapper"),o=i.parentNode.getBoundingClientRect(),n=t.x+t.width/2-(o.left+i.offsetLeft),s=t.y+t.height/2-(o.top+i.offsetTop);this.result.transformOrigin=`${n}px ${s}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const e=this.showGroup;if(e){let t;for(let i=0;i0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,it(N,this),N.length===0&&document.body.classList.remove("v-popper--some-open");for(const i of Je(this.theme)){const o=nt(i);it(o,this),o.length===0&&document.body.classList.remove(`v-popper--some-open--${i}`)}U===this&&(U=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const 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 Se(),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 new Error("No container for popover: "+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const e=i=>{this.isShown&&!this.$_hideInProgress||(i.usedByTooltip=!0,!this.$_preventShow&&this.show({event:i}))};this.$_registerTriggerListeners(this.$_targetNodes,et,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],et,this.popperTriggers,this.popperShowTriggers,e);const t=i=>{i.usedByTooltip||this.hide({event:i})};this.$_registerTriggerListeners(this.$_targetNodes,tt,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],tt,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,i){this.$_events.push({targetNodes:e,eventType:t,handler:i}),e.forEach(o=>o.addEventListener(t,i,ce?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,i,o,n){let s=i;o!=null&&(s=typeof o=="function"?o(s):o),s.forEach(r=>{const a=t[r];a&&this.$_registerEventListeners(e,a,n)})},$_removeEventListeners(e){const t=[];this.$_events.forEach(i=>{const{targetNodes:o,eventType:n,handler:s}=i;!e||e===n?o.forEach(r=>r.removeEventListener(n,s)):t.push(i)}),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(const i of this.$_targetNodes){const o=i.getAttribute(e);o&&(i.removeAttribute(e),i.setAttribute(t,o))}},$_applyAttrsToTarget(e){for(const t of this.$_targetNodes)for(const i in e){const o=e[i];o==null?t.removeAttribute(i):t.setAttribute(i,o)}},$_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(){const e=this.$_referenceNode.getBoundingClientRect();if(se>=e.left&&se<=e.right&&re>=e.top&&re<=e.bottom){const t=this.$_popperNode.getBoundingClientRect(),i=se-j,o=re-V,n=t.left+t.width/2-j+(t.top+t.height/2)-V+t.width+t.height,s=j+i*n,r=V+o*n;return he(j,V,s,r,t.left,t.top,t.left,t.bottom)||he(j,V,s,r,t.left,t.top,t.right,t.top)||he(j,V,s,r,t.right,t.top,t.right,t.bottom)||he(j,V,s,r,t.left,t.bottom,t.right,t.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<"u"&&typeof window<"u"){if(xt){const e=ce?{passive:!0,capture:!0}:!0;document.addEventListener("touchstart",t=>st(t),e),document.addEventListener("touchend",t=>rt(t,!0),e)}else window.addEventListener("mousedown",e=>st(e),!0),window.addEventListener("click",e=>rt(e,!1),!0);window.addEventListener("resize",si)}function st(e,t){for(let i=0;i=0;o--){const n=N[o];try{const s=n.containsGlobalTarget=n.mouseDownContains||n.popperNode().contains(e.target);n.pendingHide=!1,requestAnimationFrame(()=>{if(n.pendingHide=!1,!i[n.randomId]&&at(n,s,e)){if(n.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&s){let a=n.parentPopper;for(;a;)i[a.randomId]=!0,a=a.parentPopper;return}let r=n.parentPopper;for(;r&&at(r,r.containsGlobalTarget,e);)r.$_handleGlobalClose(e,t),r=r.parentPopper}})}catch{}}}function at(e,t,i){return i.closeAllPopover||i.closePopover&&t||ni(e,i)&&!t}function ni(e,t){if(typeof e.autoHide=="function"){const i=e.autoHide(t);return e.lastAutoHide=i,i}return e.autoHide}function si(){for(let e=0;e{j=se,V=re,se=e.clientX,re=e.clientY},ce?{passive:!0}:void 0);function he(e,t,i,o,n,s,r,a){const l=((r-n)*(t-s)-(a-s)*(e-n))/((a-s)*(i-e)-(r-n)*(o-t)),d=((i-e)*(t-s)-(o-t)*(e-n))/((a-s)*(i-e)-(r-n)*(o-t));return l>=0&&l<=1&&d>=0&&d<=1}const ri={extends:$t()},Ee=(e,t)=>{const i=e.__vccOpts||e;for(const[o,n]of t)i[o]=n;return i};function ai(e,t,i,o,n,s){return ee(),Pe("div",{ref:"reference",class:lt(["v-popper",{"v-popper--shown":e.slotData.isShown}])},[fe(e.$slots,"default",Rt(Bt(e.slotData)))],2)}const li=Ee(ri,[["render",ai]]);function di(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}var n=e.indexOf("Edge/");return n>0?parseInt(e.substring(n+5,e.indexOf(".",n)),10):-1}let ue;function ke(){ke.init||(ke.init=!0,ue=di()!==-1)}var _e={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){ke(),zt(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",ue&&this.$el.appendChild(e),e.data="about:blank",ue||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&&(!ue&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const ci=Nt();At("data-v-b329ee4c");const pi={class:"resize-observer",tabindex:"-1"};Pt();const hi=ci((e,t,i,o,n,s)=>(ee(),Re("div",pi)));_e.render=hi;_e.__scopeId="data-v-b329ee4c";_e.__file="src/components/ResizeObserver.vue";const _t=(e="theme")=>({computed:{themeClass(){return ti(this[e])}}}),ui=ve({name:"VPopperContent",components:{ResizeObserver:_e},mixins:[_t()],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}}}),fi=["id","aria-hidden","tabindex","data-popper-placement"],mi={ref:"inner",class:"v-popper__inner"},gi=Q("div",{class:"v-popper__arrow-outer"},null,-1),wi=Q("div",{class:"v-popper__arrow-inner"},null,-1),yi=[gi,wi];function vi(e,t,i,o,n,s){const r=Ae("ResizeObserver");return ee(),Pe("div",{id:e.popperId,ref:"popover",class:lt(["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:be(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:t[2]||(t[2]=Ot(a=>e.autoHide&&e.$emit("hide"),["esc"]))},[Q("div",{class:"v-popper__backdrop",onClick:t[0]||(t[0]=a=>e.autoHide&&e.$emit("hide"))}),Q("div",{class:"v-popper__wrapper",style:be(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[Q("div",mi,[e.mounted?(ee(),Pe(Ct,{key:0},[Q("div",null,[fe(e.$slots,"default")]),e.handleResize?(ee(),Re(r,{key:0,onNotify:t[1]||(t[1]=a=>e.$emit("resize",a))})):Ie("",!0)],64)):Ie("",!0)],512),Q("div",{ref:"arrow",class:"v-popper__arrow-container",style:be(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},yi,4)],4)],46,fi)}const bt=Ee(ui,[["render",vi]]),St={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 He=function(){};typeof window<"u"&&(He=window.Element);const xi=ve({name:"VPopperWrapper",components:{Popper:li,PopperContent:bt},mixins:[St,_t("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,He,Boolean],default:void 0},boundary:{type:[String,He],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 $i(e,t,i,o,n,s){const r=Ae("PopperContent"),a=Ae("Popper");return ee(),Re(a,Ht({ref:"popper"},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||(t[0]=()=>e.$emit("show")),onHide:t[1]||(t[1]=()=>e.$emit("hide")),"onUpdate:shown":t[2]||(t[2]=l=>e.$emit("update:shown",l)),onApplyShow:t[3]||(t[3]=()=>e.$emit("apply-show")),onApplyHide:t[4]||(t[4]=()=>e.$emit("apply-hide")),onCloseGroup:t[5]||(t[5]=()=>e.$emit("close-group")),onCloseDirective:t[6]||(t[6]=()=>e.$emit("close-directive")),onAutoHide:t[7]||(t[7]=()=>e.$emit("auto-hide")),onResize:t[8]||(t[8]=()=>e.$emit("resize"))}),{default:We(({popperId:l,isShown:d,shouldMountContent:h,skipTransition:c,autoHide:u,show:p,hide:f,handleResize:m,onResize:w,classes:g,result:y})=>[fe(e.$slots,"default",{shown:d,show:p,hide:f}),kt(r,{ref:"popperContent","popper-id":l,theme:e.finalTheme,shown:d,mounted:h,"skip-transition":c,"auto-hide":u,"handle-resize":m,classes:g,result:y,onHide:f,onResize:w},{default:We(()=>[fe(e.$slots,"popper",{shown:d,hide:f})]),_: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 Fe=Ee(xi,[["render",$i]]),_i={...Fe,name:"VDropdown",vPopperTheme:"dropdown"};({...Fe});({...Fe});ve({name:"VTooltipDirective",components:{Popper:$t(),PopperContent:bt},mixins:[St],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:e=>ze(e.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>ze(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;const t=++this.$_fetchId,i=this.content(this);i.then?i.then(o=>this.onResult(t,o)):this.onResult(t,i)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}});const Oi=_i;export{Kt as a,Ai as b,Wt as c,jt as d,Si as e,Gt as f,ae as g,Pi as h,Ti as i,Oi as k,Ci as l,K as m,Xt as o,oe as r,Ut as s}; diff --git a/assets/Skeleton-CcheZNZG.css b/assets/Skeleton-CcheZNZG.css deleted file mode 100644 index 3706982f3c4770cdbffebad0221aea0a624249f4..0000000000000000000000000000000000000000 --- a/assets/Skeleton-CcheZNZG.css +++ /dev/null @@ -1 +0,0 @@ -.skeleton[data-v-f404da2a]{position:relative;transition:all .2s ease-in-out}.skeleton-pulse[data-v-f404da2a]{animation:skeleton-pulse-f404da2a 1.5s ease-in-out .5s infinite}@keyframes skeleton-pulse-f404da2a{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.skeleton-wave[data-v-f404da2a]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);animation:skeleton-wave-f404da2a 1.5s infinite;border-radius:inherit}.dark .skeleton-wave[data-v-f404da2a]:after{background:linear-gradient(90deg,transparent,rgba(255,255,255,.1),transparent)}@keyframes skeleton-wave-f404da2a{0%{transform:translate(-100%)}60%{transform:translate(100%)}to{transform:translate(100%)}} diff --git a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-Cn-PwtFl.js b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-Cn-PwtFl.js deleted file mode 100644 index d7256dec801bcddad509c3297eac31795fa5b3e1..0000000000000000000000000000000000000000 --- a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-Cn-PwtFl.js +++ /dev/null @@ -1 +0,0 @@ -import{d as B,c2 as ee,c as _,o as g,bA as L,bh as O,a as l,X as G,c3 as q,$ as H,e as u,w as K,U as W,b as $,u as s,Y as k,W as R,ca as A,cc as te,c4 as oe,V as ae,a0 as le,f as M,T as se,bf as re,bg as C,cu as D,cv as E,cq as ie}from"./index-D7HCX4VR.js";import{b as ne,a as ue}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as de,g as ce}from"./speech-D8cCufg2.js";import{u as ve}from"./providers-DepZj6_J.js";import{_ as pe}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as me}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as fe}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as ge}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as be}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";const _e={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":""},he=B({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(y){return(a,S)=>{const d=ee("motion");return g(),_(q,null,[L(a.$slots,"default"),O((g(),_("div",_e,[l("div",{text:"60",class:G(y.providerIcon||y.providerIconColor)},null,2)])),[[d]])],64)}}}),xe={"w-full":"","rounded-xl":""},ye={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},ke={class:"inline-flex items-center gap-4"},Se={flex:"~ col gap-4"},Ue=["placeholder"],we=["placeholder"],Ie={flex:"~ col gap-6"},Ve={grid:"~ cols-2 gap-4"},Te={class:"flex items-center gap-1 text-sm font-medium"},$e={class:"text-xs text-neutral-500 dark:text-neutral-400"},Le=["value"],Re={flex:"~ row","gap-4":""},Pe=["disabled"],Me={flex:"~ row","items-center":"","gap-2":""},Ce={flex:"~ row","items-center":"","gap-2":""},Oe={key:2,class:"mt-2 text-sm text-red-500"},ze={key:3,class:"mt-2 text-sm text-red-500"},Ke={key:4,class:"mt-2 text-sm text-red-500"},Be=["src"],rt=B({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(y,{expose:a}){const S=y,{t:d}=H(),m=u(S.defaultText||"Hello! This is a test of the voice synthesis."),U=u(!1),t=u(""),v=u(""),f=u(null),i=u(!1),h=u(""),p=u("");K(()=>S.availableVoices,n=>{var r;n.length>0&&!p.value&&(p.value=((r=n[0])==null?void 0:r.id)||"")},{immediate:!0});async function x(){if(!(!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value)){U.value=!0,v.value="";try{t.value&&I();const n=i.value?h.value:m.value,r=await S.generateSpeech(n,p.value,i.value);t.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{f.value&&f.value.play()},100)}catch(n){console.error("Error generating speech:",n),v.value=n instanceof Error?n.message:"An unknown error occurred"}finally{U.value=!1}}}function I(){f.value&&(f.value.pause(),f.value.currentTime=0),t.value&&(URL.revokeObjectURL(t.value),t.value="")}return W(()=>{t.value&&URL.revokeObjectURL(t.value)}),a({testText:m,ssmlText:h,useSSML:i,selectedVoice:p,isGenerating:U,audioUrl:t,errorMessage:v,audioPlayer:f,generateTestSpeech:x,stopTestAudio:I}),(n,r)=>(g(),_("div",xe,[l("h2",ye,[l("div",ke,[$(s(ne)),l("div",null,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),l("div",Se,[$(s(ue),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=c=>i.value=c),label:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),i.value?O((g(),_("textarea",{key:1,"onUpdate:modelValue":r[2]||(r[2]=c=>h.value=c),placeholder:s(d)("settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-48":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","font-mono":"","outline-none":""},null,8,we)),[[A,h.value]]):O((g(),_("textarea",{key:0,"onUpdate:modelValue":r[1]||(r[1]=c=>m.value=c),placeholder:s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,Ue)),[[A,m.value]]),l("div",Ie,[l("label",Ve,[l("div",null,[l("div",Te,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),l("div",$e,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),O(l("select",{"onUpdate:modelValue":r[3]||(r[3]=c=>p.value=c),border:"neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":""},[(g(!0),_(q,null,oe(y.availableVoices,c=>(g(),_("option",{key:c.id,value:c.id},k(c.name),9,Le))),128))],512),[[te,p.value]])])]),l("div",Re,[l("button",{border:"neutral-800 dark:neutral-200 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"",text:"neutral-100 dark:neutral-900","py-2":"","text-sm":"",disabled:U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!y.apiKeyConfigured,class:G({"opacity-50 cursor-not-allowed":U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!y.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:x},[l("div",Me,[r[4]||(r[4]=l("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),l("span",null,k(U.value?s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Pe),t.value?(g(),_("button",{key:0,border:"primary-300 dark:primary-800 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"","py-2":"","text-sm":"",onClick:I},[l("div",Ce,[r[5]||(r[5]=l("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),l("span",null,k(s(d)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):R("",!0)]),y.apiKeyConfigured?R("",!0):(g(),_("div",Oe,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),p.value?R("",!0):(g(),_("div",ze,k(s(d)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),v.value?(g(),_("div",Ke,k(v.value),1)):R("",!0),t.value?(g(),_("audio",{key:5,ref_key:"audioPlayer",ref:f,src:t.value,controls:"",class:"mt-2 w-full"},null,8,Be)):R("",!0)]),L(n.$slots,"default")]))}}),Ne={flex:"~ col md:row gap-6"},je={flex:"~ col gap-6"},Fe={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},Ae={flex:"~ col gap-4"},De={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ee={"w-full":"","rounded-xl":""},it=B({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(y){const a=y,{t:S}=H(),d=ae(),m=ve(),U=de(),{providers:t}=le(m),v=M(()=>m.getProviderMetadata(a.providerId)),f=M({get:()=>{var e;return((e=t.value[a.providerId])==null?void 0:e.apiKey)||""},set:e=>{t.value[a.providerId]||(t.value[a.providerId]={}),t.value[a.providerId].apiKey=e}}),i=M({get:()=>{var e,o,b;return((e=t.value[a.providerId])==null?void 0:e.baseUrl)||((b=(o=v.value)==null?void 0:o.defaultOptions)==null?void 0:b.call(o).baseUrl)||""},set:e=>{t.value[a.providerId]||(t.value[a.providerId]={}),t.value[a.providerId].baseUrl=e}}),h=u("Hello! This is a test of voice synthesis."),p=u(!1),x=u(""),I=u(""),n=u(null),r=u(!1),c=u(""),N=u(""),w=u({});function X(){var e;(e=t.value[a.providerId])!=null&&e.voiceSettings?w.value={...t.value[a.providerId].voiceSettings}:w.value={pitch:0,speed:1,volume:0,...a.additionalSettings}}se(()=>{var e,o,b,V;m.initializeProvider(a.providerId),f.value=((e=t.value[a.providerId])==null?void 0:e.apiKey)||"",i.value=((o=t.value[a.providerId])==null?void 0:o.baseUrl)||((V=(b=v.value)==null?void 0:b.defaultOptions)==null?void 0:V.call(b).baseUrl)||"",X(),m.configuredProviders[a.providerId]&&U.loadVoicesForProvider(a.providerId)});const z=ie(()=>{var e,o;t.value[a.providerId]={...t.value[a.providerId],apiKey:f.value,baseUrl:i.value||((o=(e=v.value)==null?void 0:e.defaultOptions)==null?void 0:o.call(e).baseUrl)||"",voiceSettings:{...w.value}}},1e3);K([f,i],z),K(w,z,{deep:!0});async function Y(){if(!h.value.trim()&&!r.value||r.value&&!c.value.trim())return;const e=m.getProviderInstance(a.providerId);if(!e){console.error("Failed to initialize speech provider");return}if(!N.value){console.error("No active speech voice selected");return}p.value=!0,I.value="";try{x.value&&j();const o=a.defaultModel||"default",b=r.value?c.value:h.value,V=await ce({...e.speech(o,{voiceSettings:w.value}),input:b,voice:N.value});x.value=URL.createObjectURL(new Blob([V])),setTimeout(()=>{n.value&&n.value.play()},100)}catch(o){console.error("Error generating speech:",o),I.value=o instanceof Error?o.message:"An unknown error occurred"}finally{p.value=!1}}function j(){n.value&&(n.value.pause(),n.value.currentTime=0),x.value&&(URL.revokeObjectURL(x.value),x.value="")}W(()=>{x.value&&URL.revokeObjectURL(x.value)});function J(){var e,o;w.value={...((o=(e=v.value)==null?void 0:e.defaultOptions)==null?void 0:o.call(e).voiceSettings)||{}},z()}function Q(e,o){w.value[e]=o}const F=M(()=>({voiceSettings:w.value,updateVoiceSettings:Q,isGenerating:p.value,testText:h.value,useSSML:r.value,ssmlText:c.value,generateTestSpeech:Y,stopTestAudio:j,audioUrl:x.value,audioPlayer:n.value,errorMessage:I.value}));return(e,o)=>{var b,V;return g(),re(he,{"provider-name":(b=v.value)==null?void 0:b.localizedName,"provider-icon":(V=v.value)==null?void 0:V.icon,"on-back":()=>s(d).back()},{default:C(()=>[l("div",Ne,[$(s(be),{class:"w-full md:w-[40%]"},{default:C(()=>[$(s(ge),{title:s(S)("settings.pages.providers.common.section.basic.title"),description:s(S)("settings.pages.providers.common.section.basic.description"),"on-reset":J},{default:C(()=>{var T;return[$(s(me),{modelValue:f.value,"onUpdate:modelValue":o[0]||(o[0]=P=>f.value=P),"provider-name":(T=v.value)==null?void 0:T.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),L(e.$slots,"basic-settings")]}),_:3},8,["title","description"]),l("div",je,[l("h2",Fe,k(s(S)("settings.pages.providers.common.section.voice.title")),1),l("div",Ae,[L(e.$slots,"voice-settings",D(E(F.value)))])]),$(s(pe),{title:s(S)("settings.pages.providers.common.section.advanced.title")},{default:C(()=>{var T,P;return[$(s(fe),{modelValue:i.value,"onUpdate:modelValue":o[1]||(o[1]=Z=>i.value=Z),placeholder:((P=(T=v.value)==null?void 0:T.defaultOptions)==null?void 0:P.call(T).baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),L(e.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),l("div",De,[l("div",Ee,[L(e.$slots,"playground",D(E(F.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}});export{rt as _,it as a}; diff --git a/assets/Stage-BgJLNEtF.css b/assets/Stage-BgJLNEtF.css deleted file mode 100644 index c21a2fa288e0efeb840d899e33e1d0d7724e6032..0000000000000000000000000000000000000000 --- a/assets/Stage-BgJLNEtF.css +++ /dev/null @@ -1 +0,0 @@ -.volumed[data-v-568551bc]{transform-style:preserve-3d;width:fit-content;height:fit-content}.test-dummy-flat[data-v-b4ef37ac]{display:inline-block;position:relative}.test-dummy-flat .marker[data-v-b4ef37ac]{position:absolute;top:0;right:0;bottom:0;left:0;background:conic-gradient(#ffeb3b,#ffeb3b 90deg,#000 90deg,#000 180deg,#ffeb3b 180deg,#ffeb3b 270deg,#000 270deg,#000 360deg);border-radius:50%;box-shadow:0 4px 12px #b9b9b933}.dark .test-dummy-flat .marker[data-v-b4ef37ac]{box-shadow:0 4px 12px #0003}.menu-icon-item[data-v-b1037d36]{position:relative;overflow:hidden}.menu-icon-item[data-v-b1037d36]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;width:25%;height:100%;-webkit-mask-image:linear-gradient(120deg,white 30%,transparent 50%);mask-image:linear-gradient(120deg,white 30%,transparent 50%);opacity:0;transition:all .4s ease-in-out}.dark .menu-icon-item[data-v-b1037d36]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}.menu-icon-item[data-v-b1037d36]:hover:before,.menu-icon-item._hover[data-v-b1037d36]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .menu-icon-item[data-v-b1037d36]:hover:before,.dark .menu-icon-item._hover[data-v-b1037d36]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.menu-icon-item[data-v-b1037d36]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.6;position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;width:100%;height:100%;background-size:10px 10px;content:"";-webkit-mask-image:linear-gradient(165deg,white 30%,transparent 50%);mask-image:linear-gradient(165deg,white 30%,transparent 50%);transition:all .4s ease-in-out}.menu-icon-item[data-v-b1037d36]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}.dark .menu-icon-item[data-v-b1037d36]:after{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.25}.dark .menu-icon-item[data-v-b1037d36]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}.menu-icon-item-icon[data-v-b1037d36]{opacity:.5}.menu-icon-item:hover .menu-icon-item-title[data-v-b1037d36],.menu-icon-item._hover .menu-icon-item-title[data-v-b1037d36]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.menu-icon-item:hover .menu-icon-item-description[data-v-b1037d36],.menu-icon-item._hover .menu-icon-item-description[data-v-b1037d36]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity));opacity:.8}.menu-icon-item:hover .menu-icon-item-icon[data-v-b1037d36],.menu-icon-item._hover .menu-icon-item-icon[data-v-b1037d36]{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity));scale:1.2}.dark .menu-icon-item:hover .menu-icon-item-title[data-v-b1037d36],.dark .menu-icon-item._hover .menu-icon-item-title[data-v-b1037d36]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.dark .menu-icon-item:hover .menu-icon-item-description[data-v-b1037d36],.dark .menu-icon-item._hover .menu-icon-item-description[data-v-b1037d36]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity));opacity:.8}.dark .menu-icon-item:hover .menu-icon-item-icon[data-v-b1037d36],.dark .menu-icon-item._hover .menu-icon-item-icon[data-v-b1037d36]{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.menu-icon-status-item[data-v-b53bc3f0]{position:relative;overflow:hidden}.menu-icon-status-item[data-v-b53bc3f0]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .4s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .menu-icon-status-item[data-v-b53bc3f0]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}.menu-icon-status-item[data-v-b53bc3f0]:hover:before,.menu-icon-status-item._hover[data-v-b53bc3f0]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:50%;opacity:1}.dark .menu-icon-status-item[data-v-b53bc3f0]:hover:before,.dark .menu-icon-status-item._hover[data-v-b53bc3f0]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.menu-icon-status-item-link[data-v-b53bc3f0]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.8;position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;width:100%;height:100%;background-size:10px 10px;content:"";-webkit-mask-image:linear-gradient(165deg,white 30%,transparent 50%);mask-image:linear-gradient(165deg,white 30%,transparent 50%);transition:all .4s ease-in-out}.menu-icon-status-item-link[data-v-b53bc3f0]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}.dark .menu-icon-status-item-link[data-v-b53bc3f0]:after{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.4}.dark .menu-icon-status-item-link[data-v-b53bc3f0]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}.menu-icon-status-item-icon-color[data-v-b53bc3f0]{opacity:.5}.menu-icon-status-item:hover .menu-icon-status-item-title[data-v-b53bc3f0],.menu-icon-status-item._hover .menu-icon-status-item-title[data-v-b53bc3f0]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.menu-icon-status-item:hover .menu-icon-status-item-description[data-v-b53bc3f0],.menu-icon-status-item._hover .menu-icon-status-item-description[data-v-b53bc3f0]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity));opacity:.8}.menu-icon-status-item:hover .menu-icon-status-item-icon[data-v-b53bc3f0],.menu-icon-status-item._hover .menu-icon-status-item-icon[data-v-b53bc3f0],.menu-icon-status-item:hover .menu-icon-status-item-icon-color[data-v-b53bc3f0],.menu-icon-status-item._hover .menu-icon-status-item-icon-color[data-v-b53bc3f0]{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity));scale:1.2}.dark .menu-icon-status-item:hover .menu-icon-status-item-title[data-v-b53bc3f0],.dark .menu-icon-status-item._hover .menu-icon-status-item-title[data-v-b53bc3f0]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.dark .menu-icon-status-item:hover .menu-icon-status-item-description[data-v-b53bc3f0],.dark .menu-icon-status-item._hover .menu-icon-status-item-description[data-v-b53bc3f0]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity));opacity:.8}.dark .menu-icon-status-item:hover .menu-icon-status-item-icon[data-v-b53bc3f0],.dark .menu-icon-status-item._hover .menu-icon-status-item-icon[data-v-b53bc3f0],.dark .menu-icon-status-item:hover .menu-icon-status-item-icon-color[data-v-b53bc3f0],.dark .menu-icon-status-item._hover .menu-icon-status-item-icon-color[data-v-b53bc3f0]{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.form_radio-card-detail[data-v-01e1298e]{position:relative;overflow:hidden}.form_radio-card-detail[data-v-01e1298e]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .form_radio-card-detail[data-v-01e1298e]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}.form_radio-card-detail[data-v-01e1298e]:hover:before,.form_radio-card-detail._hover[data-v-01e1298e]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .form_radio-card-detail[data-v-01e1298e]:hover:before,.dark .form_radio-card-detail._hover[data-v-01e1298e]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.form_radio-card-detail-active[data-v-01e1298e]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:.5}.dark .form_radio-card-detail-active[data-v-01e1298e]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}input[type=search][data-v-7ad6d626]::-webkit-search-cancel-button{display:none}.form_radio-card-simple[data-v-50bfb5e4]{position:relative;overflow:hidden}.form_radio-card-simple[data-v-50bfb5e4]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .form_radio-card-simple[data-v-50bfb5e4]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}.form_radio-card-simple[data-v-50bfb5e4]:hover:before,.form_radio-card-simple._hover[data-v-50bfb5e4]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .form_radio-card-simple[data-v-50bfb5e4]:hover:before,.dark .form_radio-card-simple._hover[data-v-50bfb5e4]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.form_radio-card-simple-active[data-v-50bfb5e4]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:.5}.dark .form_radio-card-simple-active[data-v-50bfb5e4]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.form_voice-card[data-v-a5ae8da9]{position:relative;overflow:hidden;display:flex;flex-direction:column}.form_voice-card[data-v-a5ae8da9]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .form_voice-card[data-v-a5ae8da9]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}.form_voice-card[data-v-a5ae8da9]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .form_voice-card[data-v-a5ae8da9]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}input[type=search][data-v-4dd3b9e2]::-webkit-search-cancel-button{display:none}.voice-card[data-v-4dd3b9e2]{position:relative;overflow:hidden;display:flex;flex-direction:column}.voice-card[data-v-4dd3b9e2]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .voice-card[data-v-4dd3b9e2]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}.voice-card[data-v-4dd3b9e2]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .voice-card[data-v-4dd3b9e2]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.card-hover-effect[data-v-895421da]{transform-style:preserve-3d;transform-origin:center;will-change:transform;transition:transform .3s cubic-bezier(.23,1,.32,1)}.card-hover-effect[data-v-895421da]:before,.card-hover-effect[data-v-895421da]:after{content:"";position:absolute;left:0;right:0;bottom:0;top:0;background-repeat:no-repeat;transition:all .33s ease;pointer-events:none}.card-hover-effect[data-v-895421da]:before{background-position:var(--card-position-x) var(--card-position-y);background-size:300% 300%;background-image:linear-gradient(115deg,transparent 0%,rgba(var(--color-primary-500),calc(.3 * var(--effect-intensity))) 25%,transparent 47%,transparent 53%,rgba(var(--color-primary-600),calc(.3 * var(--effect-intensity))) 75%,transparent 100%);opacity:calc(.5 * var(--effect-intensity));filter:brightness(.5) contrast(1);z-index:1;mix-blend-mode:color-dodge}.card-hover-effect[data-v-895421da]:after{background-position:var(--sparkle-position-x) var(--sparkle-position-y);background-size:160%;background-image:linear-gradient(125deg,rgba(var(--color-primary-500),calc(.3 * var(--effect-intensity))) 15%,rgba(var(--color-primary-400),calc(.25 * var(--effect-intensity))) 30%,rgba(var(--color-primary-300),calc(.2 * var(--effect-intensity))) 40%,rgba(var(--color-primary-200),calc(.1 * var(--effect-intensity))) 60%,rgba(var(--color-primary-400),calc(.25 * var(--effect-intensity))) 70%,rgba(var(--color-primary-500),calc(.3 * var(--effect-intensity))) 85%);background-blend-mode:overlay;opacity:calc(var(--sparkle-opacity) * var(--effect-intensity));filter:brightness(1) contrast(1);z-index:2;mix-blend-mode:color-dodge}.card-hover-effect[data-v-895421da]:hover:before{opacity:calc(.88 * var(--effect-intensity));filter:brightness(.66) contrast(1.33)}.card-hover-effect[data-v-895421da]:hover:after{opacity:var(--effect-intensity);filter:brightness(1.1) contrast(1.2)}.animate-stripe[data-v-af8294f5]{background-image:repeating-linear-gradient(-45deg,#f472b6,#f472b6 25px,#f9a8d4 25px,#f9a8d4 50px);animation:progress-af8294f5 2s linear infinite;background-size:150% 100%}@-webkit-keyframes progress-af8294f5{0%{background-position:0 0}to{background-position:-75px 0px}}@-moz-keyframes progress-af8294f5{0%{background-position:0 0}to{background-position:-75px 0px}}@-ms-keyframes progress-af8294f5{0%{background-position:0 0}to{background-position:-75px 0px}}@keyframes progress-af8294f5{0%{background-position:0 0}to{background-position:-70px 0px}} diff --git a/assets/Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js b/assets/Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js deleted file mode 100644 index 5cc88ddac32dbde2bab4a47dd9496d61c7f39e09..0000000000000000000000000000000000000000 --- a/assets/Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js +++ /dev/null @@ -1,3105 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-CNYmsmAm.js","assets/index-D7HCX4VR.js","assets/index-F7nexZWB.css","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/import-url-node-BfNoxhRr.js"])))=>i.map(i=>d[i]); -var Nx=Object.defineProperty;var Lx=(r,t,e)=>t in r?Nx(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var $=(r,t,e)=>Lx(r,typeof t!="symbol"?t+"":t,e);import{a5 as kh,cS as vi,a6 as Bx,cT as cn}from"./index-D7HCX4VR.js";/*! - * @pixi/constants - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/constants is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var Gi;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(Gi||(Gi={}));var Vo;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(Vo||(Vo={}));var Ja;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(Ja||(Ja={}));var qt;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(qt||(qt={}));var Go;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(Go||(Go={}));var wt;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(wt||(wt={}));var Jn;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(Jn||(Jn={}));var ce;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})(ce||(ce={}));var tl;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(tl||(tl={}));var Ir;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Ir||(Ir={}));var el;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(el||(el={}));var xi;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(xi||(xi={}));var dn;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(dn||(dn={}));var ti;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(ti||(ti={}));var rl;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(rl||(rl={}));var Er;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(Er||(Er={}));var $e;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})($e||($e={}));var ed;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(ed||(ed={}));var Be;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(Be||(Be={}));var bi;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(bi||(bi={}));/*! - * @pixi/settings - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/settings is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var kx={createCanvas:function(r,t){var e=document.createElement("canvas");return e.width=r,e.height=t,e},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,t){return fetch(r,t)}},_u=/iPhone/i,rd=/iPod/i,id=/iPad/i,nd=/\biOS-universal(?:.+)Mac\b/i,bu=/\bAndroid(?:.+)Mobile\b/i,sd=/Android/i,ys=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,wa=/Silk/i,Pi=/Windows Phone/i,od=/\bWindows(?:.+)ARM\b/i,ad=/BlackBerry/i,ld=/BB10/i,ud=/Opera Mini/i,cd=/\b(CriOS|Chrome)(?:.+)Mobile/i,hd=/Mobile(?:.+)Firefox\b/i,fd=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function Ux(r){return function(t){return t.test(r)}}function zx(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var n=Ux(e),s={apple:{phone:n(_u)&&!n(Pi),ipod:n(rd),tablet:!n(_u)&&(n(id)||fd(t))&&!n(Pi),universal:n(nd),device:(n(_u)||n(rd)||n(id)||n(nd)||fd(t))&&!n(Pi)},amazon:{phone:n(ys),tablet:!n(ys)&&n(wa),device:n(ys)||n(wa)},android:{phone:!n(Pi)&&n(ys)||!n(Pi)&&n(bu),tablet:!n(Pi)&&!n(ys)&&!n(bu)&&(n(wa)||n(sd)),device:!n(Pi)&&(n(ys)||n(wa)||n(bu)||n(sd))||n(/\bokhttp\b/i)},windows:{phone:n(Pi),tablet:n(od),device:n(Pi)||n(od)},other:{blackberry:n(ad),blackberry10:n(ld),opera:n(ud),firefox:n(hd),chrome:n(cd),device:n(ad)||n(ld)||n(ud)||n(hd)||n(cd)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}var qn=zx(globalThis.navigator);function jx(){return!qn.apple.device}function $x(r){var t=!0;if(qn.tablet||qn.phone){if(qn.apple.device){var e=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(e){var i=parseInt(e[1],10);i<11&&(t=!1)}}if(qn.android.device){var e=navigator.userAgent.match(/Android\s([0-9.]*)/);if(e){var i=parseInt(e[1],10);i<7&&(t=!1)}}}return t?r:4}var It={ADAPTER:kx,MIPMAP_TEXTURES:xi.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:Be.NONE,SPRITE_MAX_TEXTURES:$x(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:rl.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:el.CLAMP,SCALE_MODE:Ir.LINEAR,PRECISION_VERTEX:Er.HIGH,PRECISION_FRAGMENT:qn.apple.device?Er.HIGH:Er.MEDIUM,CAN_UPLOAD_SAME_BUFFER:jx(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},wu={exports:{}},dd;function Vx(){return dd||(dd=1,function(r){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function n(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function s(l,u,c,h,p){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new n(c,h||l,p),y=e?e+u:u;return l._events[y]?l._events[y].fn?l._events[y]=[l._events[y],f]:l._events[y].push(f):(l._events[y]=f,l._eventsCount++),l}function o(l,u){--l._eventsCount===0?l._events=new i:delete l._events[u]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,h;if(this._eventsCount===0)return u;for(h in c=this._events)t.call(c,h)&&u.push(e?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=e?e+u:u,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,f=h.length,y=new Array(f);p80*D){V=J=M[0],et=yt=M[1];for(var gt=D;gtJ&&(J=vt),dt>yt&&(yt=dt);_t=Math.max(J-V,yt-et),_t=_t!==0?32767/_t:0}return i(C,A,D,V,et,_t,0),A}function t(M,O,D,U,k){var C,A;if(k===it(M,O,D,U)>0)for(C=O;C=O;C-=U)A=I(C,M[C],M[C+1],A);return A&&E(A,A.next)&&(Z(A),A=A.next),A}function e(M,O){if(!M)return M;O||(O=M);var D=M,U;do if(U=!1,!D.steiner&&(E(D,D.next)||S(D.prev,D,D.next)===0)){if(Z(D),D=O=D.prev,D===D.next)break;U=!0}else D=D.next;while(U||D!==O);return O}function i(M,O,D,U,k,C,A){if(M){!A&&C&&f(M,U,k,C);for(var V=M,et,J;M.prev!==M.next;){if(et=M.prev,J=M.next,C?s(M,U,k,C):n(M)){O.push(et.i/D|0),O.push(M.i/D|0),O.push(J.i/D|0),Z(M),M=J.next,V=J.next;continue}if(M=J,M===V){A?A===1?(M=o(e(M),O,D),i(M,O,D,U,k,C,2)):A===2&&a(M,O,D,U,k,C):i(e(M),O,D,U,k,C,1);break}}}}function n(M){var O=M.prev,D=M,U=M.next;if(S(O,D,U)>=0)return!1;for(var k=O.x,C=D.x,A=U.x,V=O.y,et=D.y,J=U.y,yt=kC?k>A?k:A:C>A?C:A,_t=V>et?V>J?V:J:et>J?et:J,gt=U.next;gt!==O;){if(gt.x>=yt&>.x<=dt&>.y>=vt&>.y<=_t&&m(k,V,C,et,A,J,gt.x,gt.y)&&S(gt.prev,gt,gt.next)>=0)return!1;gt=gt.next}return!0}function s(M,O,D,U){var k=M.prev,C=M,A=M.next;if(S(k,C,A)>=0)return!1;for(var V=k.x,et=C.x,J=A.x,yt=k.y,vt=C.y,dt=A.y,_t=Vet?V>J?V:J:et>J?et:J,ee=yt>vt?yt>dt?yt:dt:vt>dt?vt:dt,he=g(_t,gt,O,D,U),v=g(Ct,ee,O,D,U),K=M.prevZ,q=M.nextZ;K&&K.z>=he&&q&&q.z<=v;){if(K.x>=_t&&K.x<=Ct&&K.y>=gt&&K.y<=ee&&K!==k&&K!==A&&m(V,yt,et,vt,J,dt,K.x,K.y)&&S(K.prev,K,K.next)>=0||(K=K.prevZ,q.x>=_t&&q.x<=Ct&&q.y>=gt&&q.y<=ee&&q!==k&&q!==A&&m(V,yt,et,vt,J,dt,q.x,q.y)&&S(q.prev,q,q.next)>=0))return!1;q=q.nextZ}for(;K&&K.z>=he;){if(K.x>=_t&&K.x<=Ct&&K.y>=gt&&K.y<=ee&&K!==k&&K!==A&&m(V,yt,et,vt,J,dt,K.x,K.y)&&S(K.prev,K,K.next)>=0)return!1;K=K.prevZ}for(;q&&q.z<=v;){if(q.x>=_t&&q.x<=Ct&&q.y>=gt&&q.y<=ee&&q!==k&&q!==A&&m(V,yt,et,vt,J,dt,q.x,q.y)&&S(q.prev,q,q.next)>=0)return!1;q=q.nextZ}return!0}function o(M,O,D){var U=M;do{var k=U.prev,C=U.next.next;!E(k,C)&&b(k,U,U.next,C)&&B(k,C)&&B(C,k)&&(O.push(k.i/D|0),O.push(U.i/D|0),O.push(C.i/D|0),Z(U),Z(U.next),U=M=C),U=U.next}while(U!==M);return e(U)}function a(M,O,D,U,k,C){var A=M;do{for(var V=A.next.next;V!==A.prev;){if(A.i!==V.i&&_(A,V)){var et=st(A,V);A=e(A,A.next),et=e(et,et.next),i(A,O,D,U,k,C,0),i(et,O,D,U,k,C,0);return}V=V.next}A=A.next}while(A!==M)}function l(M,O,D,U){var k=[],C,A,V,et,J;for(C=0,A=O.length;C=D.next.y&&D.next.y!==D.y){var V=D.x+(k-D.y)*(D.next.x-D.x)/(D.next.y-D.y);if(V<=U&&V>C&&(C=V,A=D.x=D.x&&D.x>=J&&U!==D.x&&m(kA.x||D.x===A.x&&p(A,D)))&&(A=D,vt=dt)),D=D.next;while(D!==et);return A}function p(M,O){return S(M.prev,M,O.prev)<0&&S(O.next,M,M.next)<0}function f(M,O,D,U){var k=M;do k.z===0&&(k.z=g(k.x,k.y,O,D,U)),k.prevZ=k.prev,k.nextZ=k.next,k=k.next;while(k!==M);k.prevZ.nextZ=null,k.prevZ=null,y(k)}function y(M){var O,D,U,k,C,A,V,et,J=1;do{for(D=M,M=null,C=null,A=0;D;){for(A++,U=D,V=0,O=0;O0||et>0&&U;)V!==0&&(et===0||!U||D.z<=U.z)?(k=D,D=D.nextZ,V--):(k=U,U=U.nextZ,et--),C?C.nextZ=k:M=k,k.prevZ=C,C=k;D=U}C.nextZ=null,J*=2}while(A>1);return M}function g(M,O,D,U,k){return M=(M-D)*k|0,O=(O-U)*k|0,M=(M|M<<8)&16711935,M=(M|M<<4)&252645135,M=(M|M<<2)&858993459,M=(M|M<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,M|O<<1}function d(M){var O=M,D=M;do(O.x=(M-A)*(C-V)&&(M-A)*(U-V)>=(D-A)*(O-V)&&(D-A)*(C-V)>=(k-A)*(U-V)}function _(M,O){return M.next.i!==O.i&&M.prev.i!==O.i&&!z(M,O)&&(B(M,O)&&B(O,M)&&tt(M,O)&&(S(M.prev,M,O.prev)||S(M,O.prev,O))||E(M,O)&&S(M.prev,M,M.next)>0&&S(O.prev,O,O.next)>0)}function S(M,O,D){return(O.y-M.y)*(D.x-O.x)-(O.x-M.x)*(D.y-O.y)}function E(M,O){return M.x===O.x&&M.y===O.y}function b(M,O,D,U){var k=x(S(M,O,D)),C=x(S(M,O,U)),A=x(S(D,U,M)),V=x(S(D,U,O));return!!(k!==C&&A!==V||k===0&&F(M,D,O)||C===0&&F(M,U,O)||A===0&&F(D,M,U)||V===0&&F(D,O,U))}function F(M,O,D){return O.x<=Math.max(M.x,D.x)&&O.x>=Math.min(M.x,D.x)&&O.y<=Math.max(M.y,D.y)&&O.y>=Math.min(M.y,D.y)}function x(M){return M>0?1:M<0?-1:0}function z(M,O){var D=M;do{if(D.i!==M.i&&D.next.i!==M.i&&D.i!==O.i&&D.next.i!==O.i&&b(D,D.next,M,O))return!0;D=D.next}while(D!==M);return!1}function B(M,O){return S(M.prev,M,M.next)<0?S(M,O,M.next)>=0&&S(M,M.prev,O)>=0:S(M,O,M.prev)<0||S(M,M.next,O)<0}function tt(M,O){var D=M,U=!1,k=(M.x+O.x)/2,C=(M.y+O.y)/2;do D.y>C!=D.next.y>C&&D.next.y!==D.y&&k<(D.next.x-D.x)*(C-D.y)/(D.next.y-D.y)+D.x&&(U=!U),D=D.next;while(D!==M);return U}function st(M,O){var D=new w(M.i,M.x,M.y),U=new w(O.i,O.x,O.y),k=M.next,C=O.prev;return M.next=O,O.prev=M,D.next=k,k.prev=D,U.next=D,D.prev=U,C.next=U,U.prev=C,U}function I(M,O,D,U){var k=new w(M,O,D);return U?(k.next=U.next,k.prev=U,U.next.prev=k,U.next=k):(k.prev=k,k.next=k),k}function Z(M){M.next.prev=M.prev,M.prev.next=M.next,M.prevZ&&(M.prevZ.nextZ=M.nextZ),M.nextZ&&(M.nextZ.prevZ=M.prevZ)}function w(M,O,D){this.i=M,this.x=O,this.y=D,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}r.deviation=function(M,O,D,U){var k=O&&O.length,C=k?O[0]*D:M.length,A=Math.abs(it(M,0,C,D));if(k)for(var V=0,et=O.length;V0&&(U+=M[k-1].length,D.holes.push(U))}return D},xa.exports}Wx();var On={},xo={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Hx=xo.exports,md;function Yx(){return md||(md=1,function(r,t){(function(e){var i=t&&!t.nodeType&&t,n=r&&!r.nodeType&&r,s=typeof vi=="object"&&vi;(s.global===s||s.window===s||s.self===s)&&(e=s);var o,a=2147483647,l=36,u=1,c=26,h=38,p=700,f=72,y=128,g="-",d=/^xn--/,m=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=l-u,b=Math.floor,F=String.fromCharCode,x;function z(k){throw new RangeError(S[k])}function B(k,C){for(var A=k.length,V=[];A--;)V[A]=C(k[A]);return V}function tt(k,C){var A=k.split("@"),V="";A.length>1&&(V=A[0]+"@",k=A[1]),k=k.replace(_,".");var et=k.split("."),J=B(et,C).join(".");return V+J}function st(k){for(var C=[],A=0,V=k.length,et,J;A=55296&&et<=56319&&A65535&&(C-=65536,A+=F(C>>>10&1023|55296),C=56320|C&1023),A+=F(C),A}).join("")}function Z(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:l}function w(k,C){return k+22+75*(k<26)-((C!=0)<<5)}function it(k,C,A){var V=0;for(k=A?b(k/p):k>>1,k+=b(k/C);k>E*c>>1;V+=l)k=b(k/E);return b(V+(E+1)*k/(k+h))}function M(k){var C=[],A=k.length,V,et=0,J=y,yt=f,vt,dt,_t,gt,Ct,ee,he,v,K;for(vt=k.lastIndexOf(g),vt<0&&(vt=0),dt=0;dt=128&&z("not-basic"),C.push(k.charCodeAt(dt));for(_t=vt>0?vt+1:0;_t=A&&z("invalid-input"),he=Z(k.charCodeAt(_t++)),(he>=l||he>b((a-et)/Ct))&&z("overflow"),et+=he*Ct,v=ee<=yt?u:ee>=yt+c?c:ee-yt,!(heb(a/K)&&z("overflow"),Ct*=K;V=C.length+1,yt=it(et-gt,V,gt==0),b(et/V)>a-J&&z("overflow"),J+=b(et/V),et%=V,C.splice(et++,0,J)}return I(C)}function O(k){var C,A,V,et,J,yt,vt,dt,_t,gt,Ct,ee=[],he,v,K,q;for(k=st(k),he=k.length,C=y,A=0,J=f,yt=0;yt=C&&Ctb((a-A)/v)&&z("overflow"),A+=(vt-C)*v,C=vt,yt=0;yta&&z("overflow"),Ct==C){for(dt=A,_t=l;gt=_t<=J?u:_t>=J+c?c:_t-J,!(dt{if(u&&(typeof u=="object"||typeof u=="function")){if(i)return i.get(u)}else if(n)return n.get(u)},o=(u,c)=>{u&&(typeof u=="object"||typeof u=="function")?(i||(i=new WeakMap),i.set(u,c)):(n||(n=new Map),n.set(u,c))},a=u=>{if(u&&(typeof u=="object"||typeof u=="function")){if(i)return i.has(u)}else if(n)return n.has(u);return!1};return{get:s,set:o,has:a,assert:u=>{if(!a(u))throw new TypeError("Side channel does not contain the given key")}}}t.default=e,(typeof t.default=="object"&&t.default!==null||typeof t.default=="function")&&(Object.assign(t.default,t),r.exports=t.default)}(Sa,Sa.exports)),Sa.exports}var xu,gd;function Uh(){if(gd)return xu;gd=1;var r=String.prototype.replace,t=/%20/g,e={RFC1738:"RFC1738",RFC3986:"RFC3986"};return xu={default:e.RFC3986,formatters:{RFC1738:function(i){return r.call(i,t,"+")},RFC3986:function(i){return String(i)}},RFC1738:e.RFC1738,RFC3986:e.RFC3986},xu}var Su,vd;function zg(){if(vd)return Su;vd=1;var r=Uh(),t=Object.prototype.hasOwnProperty,e=Array.isArray,i=function(){for(var d=[],m=0;m<256;++m)d.push("%"+((m<16?"0":"")+m.toString(16)).toUpperCase());return d}(),n=function(m){for(;m.length>1;){var _=m.pop(),S=_.obj[_.prop];if(e(S)){for(var E=[],b=0;b=u?F.slice(z,z+u):F,tt=[],st=0;st=48&&I<=57||I>=65&&I<=90||I>=97&&I<=122||b===r.RFC1738&&(I===40||I===41)){tt[tt.length]=B.charAt(st);continue}if(I<128){tt[tt.length]=i[I];continue}if(I<2048){tt[tt.length]=i[192|I>>6]+i[128|I&63];continue}if(I<55296||I>=57344){tt[tt.length]=i[224|I>>12]+i[128|I>>6&63]+i[128|I&63];continue}st+=1,I=65536+((I&1023)<<10|B.charCodeAt(st)&1023),tt[tt.length]=i[240|I>>18]+i[128|I>>12&63]+i[128|I>>6&63]+i[128|I&63]}x+=tt.join("")}return x},h=function(m){for(var _=[{obj:{o:m},prop:"o"}],S=[],E=0;E<_.length;++E)for(var b=_[E],F=b.obj[b.prop],x=Object.keys(F),z=0;z"u"&&(k=0)}if(typeof B=="function"?D=B(m,D):D instanceof Date?D=I(D):_==="comma"&&s(D)&&(D=t.maybeMap(D,function(K){return K instanceof Date?I(K):K})),D===null){if(b)return z&&!it?z(m,c.encoder,M,"key",Z):m;D=""}if(h(D)||t.isBuffer(D)){if(z){var V=it?m:z(m,c.encoder,M,"key",Z);return[w(V)+"="+w(z(D,c.encoder,M,"value",Z))]}return[w(m)+"="+w(String(D))]}var et=[];if(typeof D>"u")return et;var J;if(_==="comma"&&s(D))it&&z&&(D=t.maybeMap(D,z)),J=[{value:D.length>0?D.join(",")||null:void 0}];else if(s(B))J=B;else{var yt=Object.keys(D);J=tt?yt.sort(tt):yt}var vt=x?String(m).replace(/\./g,"%2E"):String(m),dt=S&&s(D)&&D.length===1?vt+"[]":vt;if(E&&s(D)&&D.length===0)return dt+"[]";for(var _t=0;_t"u"?d.encodeDotInKeys===!0?!0:c.allowDots:!!d.allowDots;return{addQueryPrefix:typeof d.addQueryPrefix=="boolean"?d.addQueryPrefix:c.addQueryPrefix,allowDots:F,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:b,charset:m,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!d.commaRoundTrip,delimiter:typeof d.delimiter>"u"?c.delimiter:d.delimiter,encode:typeof d.encode=="boolean"?d.encode:c.encode,encodeDotInKeys:typeof d.encodeDotInKeys=="boolean"?d.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof d.encoder=="function"?d.encoder:c.encoder,encodeValuesOnly:typeof d.encodeValuesOnly=="boolean"?d.encodeValuesOnly:c.encodeValuesOnly,filter:E,format:_,formatter:S,serializeDate:typeof d.serializeDate=="function"?d.serializeDate:c.serializeDate,skipNulls:typeof d.skipNulls=="boolean"?d.skipNulls:c.skipNulls,sort:typeof d.sort=="function"?d.sort:null,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:c.strictNullHandling}};return Tu=function(g,d){var m=g,_=y(d),S,E;typeof _.filter=="function"?(E=_.filter,m=E("",m)):s(_.filter)&&(E=_.filter,S=E);var b=[];if(typeof m!="object"||m===null)return"";var F=n[_.arrayFormat],x=F==="comma"&&_.commaRoundTrip;S||(S=Object.keys(m)),_.sort&&S.sort(_.sort);for(var z=r(),B=0;B0?Z+I:""},Tu}var Iu,bd;function Qx(){if(bd)return Iu;bd=1;var r=zg(),t=Object.prototype.hasOwnProperty,e=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},n=function(p){return p.replace(/&#(\d+);/g,function(f,y){return String.fromCharCode(parseInt(y,10))})},s=function(p,f,y){if(p&&typeof p=="string"&&f.comma&&p.indexOf(",")>-1)return p.split(",");if(f.throwOnLimitExceeded&&y>=f.arrayLimit)throw new RangeError("Array limit exceeded. Only "+f.arrayLimit+" element"+(f.arrayLimit===1?"":"s")+" allowed in an array.");return p},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",l=function(f,y){var g={__proto__:null},d=y.ignoreQueryPrefix?f.replace(/^\?/,""):f;d=d.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=y.parameterLimit===1/0?void 0:y.parameterLimit,_=d.split(y.delimiter,y.throwOnLimitExceeded?m+1:m);if(y.throwOnLimitExceeded&&_.length>m)throw new RangeError("Parameter limit exceeded. Only "+m+" parameter"+(m===1?"":"s")+" allowed.");var S=-1,E,b=y.charset;if(y.charsetSentinel)for(E=0;E<_.length;++E)_[E].indexOf("utf8=")===0&&(_[E]===a?b="utf-8":_[E]===o&&(b="iso-8859-1"),S=E,E=_.length);for(E=0;E<_.length;++E)if(E!==S){var F=_[E],x=F.indexOf("]="),z=x===-1?F.indexOf("="):x+1,B,tt;z===-1?(B=y.decoder(F,i.decoder,b,"key"),tt=y.strictNullHandling?null:""):(B=y.decoder(F.slice(0,z),i.decoder,b,"key"),tt=r.maybeMap(s(F.slice(z+1),y,e(g[B])?g[B].length:0),function(I){return y.decoder(I,i.decoder,b,"value")})),tt&&y.interpretNumericEntities&&b==="iso-8859-1"&&(tt=n(String(tt))),F.indexOf("[]=")>-1&&(tt=e(tt)?[tt]:tt);var st=t.call(g,B);st&&y.duplicates==="combine"?g[B]=r.combine(g[B],tt):(!st||y.duplicates==="last")&&(g[B]=tt)}return g},u=function(p,f,y,g){var d=0;if(p.length>0&&p[p.length-1]==="[]"){var m=p.slice(0,-1).join("");d=Array.isArray(f)&&f[m]?f[m].length:0}for(var _=g?f:s(f,y,d),S=p.length-1;S>=0;--S){var E,b=p[S];if(b==="[]"&&y.parseArrays)E=y.allowEmptyArrays&&(_===""||y.strictNullHandling&&_===null)?[]:r.combine([],_);else{E=y.plainObjects?{__proto__:null}:{};var F=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,x=y.decodeDotInKeys?F.replace(/%2E/g,"."):F,z=parseInt(x,10);!y.parseArrays&&x===""?E={0:_}:!isNaN(z)&&b!==x&&String(z)===x&&z>=0&&y.parseArrays&&z<=y.arrayLimit?(E=[],E[z]=_):x!=="__proto__"&&(E[x]=_)}_=E}return _},c=function(f,y,g,d){if(f){var m=g.allowDots?f.replace(/\.([^.[]+)/g,"[$1]"):f,_=/(\[[^[\]]*])/,S=/(\[[^[\]]*])/g,E=g.depth>0&&_.exec(m),b=E?m.slice(0,E.index):m,F=[];if(b){if(!g.plainObjects&&t.call(Object.prototype,b)&&!g.allowPrototypes)return;F.push(b)}for(var x=0;g.depth>0&&(E=S.exec(m))!==null&&x"u"?i.charset:f.charset,g=typeof f.duplicates>"u"?i.duplicates:f.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var d=typeof f.allowDots>"u"?f.decodeDotInKeys===!0?!0:i.allowDots:!!f.allowDots;return{allowDots:d,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:i.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:i.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:i.arrayLimit,charset:y,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:i.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:i.comma,decodeDotInKeys:typeof f.decodeDotInKeys=="boolean"?f.decodeDotInKeys:i.decodeDotInKeys,decoder:typeof f.decoder=="function"?f.decoder:i.decoder,delimiter:typeof f.delimiter=="string"||r.isRegExp(f.delimiter)?f.delimiter:i.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:i.depth,duplicates:g,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:i.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:i.plainObjects,strictDepth:typeof f.strictDepth=="boolean"?!!f.strictDepth:i.strictDepth,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:typeof f.throwOnLimitExceeded=="boolean"?f.throwOnLimitExceeded:!1}};return Iu=function(p,f){var y=h(f);if(p===""||p===null||typeof p>"u")return y.plainObjects?{__proto__:null}:{};for(var g=typeof p=="string"?l(p,y):p,d=y.plainObjects?{__proto__:null}:{},m=Object.keys(g),_=0;_",'"',"`"," ","\r",` -`," "],o=["{","}","|","\\","^","`"].concat(s),a=["'"].concat(o),l=["%","/","?",";","#"].concat(a),u=["/","?","#"],c=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},y={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},d=Kx();function m(b,F,x){if(b&&typeof b=="object"&&b instanceof t)return b;var z=new t;return z.parse(b,F,x),z}t.prototype.parse=function(b,F,x){if(typeof b!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof b);var z=b.indexOf("?"),B=z!==-1&&z127?yt+="x":yt+=J[vt];if(!yt.match(h)){var _t=V.slice(0,D),gt=V.slice(D+1),Ct=J.match(p);Ct&&(_t.push(Ct[1]),gt.unshift(Ct[2])),gt.length&&(I="/"+gt.join(".")+I),this.hostname=_t.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=r.toASCII(this.hostname));var ee=this.port?":"+this.port:"",he=this.hostname||"";this.host=he+ee,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),I[0]!=="/"&&(I="/"+I))}if(!f[it])for(var D=0,et=a.length;D0?x.host.split("@"):!1;yt&&(x.auth=yt.shift(),x.hostname=yt.shift(),x.host=x.hostname)}return x.search=b.search,x.query=b.query,(x.pathname!==null||x.search!==null)&&(x.path=(x.pathname?x.pathname:"")+(x.search?x.search:"")),x.href=x.format(),x}if(!V.length)return x.pathname=null,x.search?x.path="/"+x.search:x.path=null,x.href=x.format(),x;for(var vt=V.slice(-1)[0],dt=(x.host||b.host||V.length>1)&&(vt==="."||vt==="..")||vt==="",_t=0,gt=V.length;gt>=0;gt--)vt=V[gt],vt==="."?V.splice(gt,1):vt===".."?(V.splice(gt,1),_t++):_t&&(V.splice(gt,1),_t--);if(!C&&!A)for(;_t--;_t)V.unshift("..");C&&V[0]!==""&&(!V[0]||V[0].charAt(0)!=="/")&&V.unshift(""),dt&&V.join("/").substr(-1)!=="/"&&V.push("");var Ct=V[0]===""||V[0]&&V[0].charAt(0)==="/";if(J){x.hostname=Ct?"":V.length?V.shift():"",x.host=x.hostname;var yt=x.host&&x.host.indexOf("@")>0?x.host.split("@"):!1;yt&&(x.auth=yt.shift(),x.hostname=yt.shift(),x.host=x.hostname)}return C=C||x.host&&V.length,C&&!Ct&&V.unshift(""),V.length>0?x.pathname=V.join("/"):(x.pathname=null,x.path=null),(x.pathname!==null||x.search!==null)&&(x.path=(x.pathname?x.pathname:"")+(x.search?x.search:"")),x.auth=b.auth||x.auth,x.slashes=x.slashes||b.slashes,x.href=x.format(),x},t.prototype.parseHost=function(){var b=this.host,F=i.exec(b);F&&(F=F[0],F!==":"&&(this.port=F.substr(1)),b=b.substr(0,b.length-F.length)),b&&(this.hostname=b)},On.parse=m,On.resolve=S,On.resolveObject=E,On.format=_,On.Url=t,On}var Cu=Zx();/*! - * @pixi/utils - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/utils is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var Zl={parse:Cu.parse,format:Cu.format,resolve:Cu.resolve};It.RETINA_PREFIX=/@([0-9\.]+)x/;It.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Sd=!1,Td="6.5.10";function Jx(r){var t;if(!Sd){if(It.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var e=[` - %c %c %c PixiJS `+Td+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ - -`,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,e)}else globalThis.console&&globalThis.console.log("PixiJS "+Td+" - "+r+" - http://www.pixijs.com/");Sd=!0}}var Au;function tS(){return typeof Au>"u"&&(Au=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:It.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!It.ADAPTER.getWebGLRenderingContext())return!1;var e=It.ADAPTER.createCanvas(),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!!(i&&i.getContextAttributes().stencil);if(i){var s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,n}catch{return!1}}()),Au}function Wr(r,t){return t===void 0&&(t=[]),t[0]=(r>>16&255)/255,t[1]=(r>>8&255)/255,t[2]=(r&255)/255,t}function eS(r){var t=r.toString(16);return t="000000".substring(0,6-t.length)+t,"#"+t}function ri(r){return(r[0]*255<<16)+(r[1]*255<<8)+(r[2]*255|0)}function rS(){for(var r=[],t=[],e=0;e<32;e++)r[e]=e,t[e]=e;r[qt.NORMAL_NPM]=qt.NORMAL,r[qt.ADD_NPM]=qt.ADD,r[qt.SCREEN_NPM]=qt.SCREEN,t[qt.NORMAL]=qt.NORMAL_NPM,t[qt.ADD]=qt.ADD_NPM,t[qt.SCREEN]=qt.SCREEN_NPM;var i=[];return i.push(t),i.push(r),i}var iS=rS();function nS(r,t){if(t===1)return(t*255<<24)+r;if(t===0)return 0;var e=r>>16&255,i=r>>8&255,n=r&255;return e=e*t+.5|0,i=i*t+.5|0,n=n*t+.5|0,(t*255<<24)+(e<<16)+(i<<8)+n}function jg(r){if(r.BYTES_PER_ELEMENT===4)return r instanceof Float32Array?"Float32Array":r instanceof Uint32Array?"Uint32Array":"Int32Array";if(r.BYTES_PER_ELEMENT===2){if(r instanceof Uint16Array)return"Uint16Array"}else if(r.BYTES_PER_ELEMENT===1&&r instanceof Uint8Array)return"Uint8Array";return null}function il(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Id(r){return!(r&r-1)&&!!r}function Ed(r){var t=(r>65535?1:0)<<4;r>>>=t;var e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}function za(r,t,e){var i=r.length,n;if(!(t>=i||e===0)){e=t+e>i?i-t:e;var s=i-e;for(n=t;n"u"?console.warn("PixiJS Deprecation Warning: ",t+` -Deprecated since v`+r):(i=i.split(` -`).splice(e).join(` -`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t+` -Deprecated since v`+r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",t+` -Deprecated since v`+r),console.warn(i))),Cd[t]=!0}}var Ad={},Mi=Object.create(null),Fn=Object.create(null);(function(){function r(t,e,i){this.canvas=It.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=i||It.RESOLUTION,this.resize(t,e)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0}),r})();var Ta;function oS(r,t){if(t===void 0&&(t=globalThis.location),r.indexOf("data:")===0)return"";t=t||globalThis.location,Ta||(Ta=document.createElement("a")),Ta.href=r;var e=Zl.parse(Ta.href),i=!e.port&&t.port===""||e.port===t.port;return e.hostname!==t.hostname||!i||e.protocol!==t.protocol?"anonymous":""}function Od(r,t){var e=It.RETINA_PREFIX.exec(r);return e?parseFloat(e[1]):t!==void 0?t:1}/*! - * @pixi/extensions - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/extensions is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Lo=function(){return Lo=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n8)throw new Error("max arguments reached");var u=this,c=u.name,h=u.items;this._aliasCount++;for(var p=0,f=h.length;p0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},r.prototype.remove=function(t){var e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},r.prototype.contains=function(t){return this.items.indexOf(t)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r}();Object.defineProperties(qe.prototype,{dispatch:{value:qe.prototype.emit},run:{value:qe.prototype.emit}});/*! - * @pixi/ticker - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/ticker is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */It.TARGET_FPMS=.06;var Zs;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})(Zs||(Zs={}));var Ou=function(){function r(t,e,i,n){e===void 0&&(e=null),i===void 0&&(i=0),n===void 0&&(n=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=n}return r.prototype.match=function(t,e){return e===void 0&&(e=null),this.fn===t&&this.context===e},r.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},r.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},r.prototype.destroy=function(t){t===void 0&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},r}(),di=function(){function r(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Ou(null,null,1/0),this.deltaMS=1/It.TARGET_FPMS,this.elapsedMS=1/It.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&t._requestId===null&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(t,e,i){return i===void 0&&(i=Zs.NORMAL),this._addListener(new Ou(t,e,i))},r.prototype.addOnce=function(t,e,i){return i===void 0&&(i=Zs.NORMAL),this._addListener(new Ou(t,e,i,!0))},r.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this},r.prototype.remove=function(t,e){for(var i=this._head.next;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(t){t===void 0&&(t=performance.now());var e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i=this.x&&t=this.y&&et.right?t.right:this.right;if(n<=i)return!1;var s=this.yt.bottom?t.bottom:this.bottom;return o>s}var a=this.left,l=this.right,u=this.top,c=this.bottom;if(l<=a||c<=u)return!1;var h=Ia[0].set(t.left,t.top),p=Ia[1].set(t.left,t.bottom),f=Ia[2].set(t.right,t.top),y=Ia[3].set(t.right,t.bottom);if(f.x<=h.x||p.y<=h.y)return!1;var g=Math.sign(e.a*e.d-e.b*e.c);if(g===0||(e.apply(h,h),e.apply(p,p),e.apply(f,f),e.apply(y,y),Math.max(h.x,p.x,f.x,y.x)<=a||Math.min(h.x,p.x,f.x,y.x)>=l||Math.max(h.y,p.y,f.y,y.y)<=u||Math.min(h.y,p.y,f.y,y.y)>=c))return!1;var d=g*(p.y-h.y),m=g*(h.x-p.x),_=d*a+m*u,S=d*l+m*u,E=d*a+m*c,b=d*l+m*c;if(Math.max(_,S,E,b)<=d*h.x+m*h.y||Math.min(_,S,E,b)>=d*y.x+m*y.y)return!1;var F=g*(h.y-f.y),x=g*(f.x-h.x),z=F*a+x*u,B=F*l+x*u,tt=F*a+x*c,st=F*l+x*c;return!(Math.max(z,B,tt,st)<=F*h.x+x*h.y||Math.min(z,B,tt,st)>=F*y.x+x*y.y)},r.prototype.pad=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this},r.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=n,this.height=Math.max(s-n,0),this},r.prototype.ceil=function(t,e){t===void 0&&(t=1),e===void 0&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=n-this.y,this},r.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=n,this.height=s-n,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Ls=function(){function r(t,e,i,n){i===void 0&&(i=0),n===void 0&&(n=0),this._x=i,this._y=n,this.cb=t,this.scope=e}return r.prototype.clone=function(t,e){return t===void 0&&(t=this.cb),e===void 0&&(e=this.scope),new r(t,e,this._x,this._y)},r.prototype.set=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(t){return t.set(this._x,this._y),t},r.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r}(),Ze=function(){function r(t,e,i,n,s,o){t===void 0&&(t=1),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=0),o===void 0&&(o=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o}return r.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},r.prototype.set=function(t,e,i,n,s,o){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o,this},r.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},r.prototype.apply=function(t,e){e=e||new Ee;var i=t.x,n=t.y;return e.x=this.a*i+this.c*n+this.tx,e.y=this.b*i+this.d*n+this.ty,e},r.prototype.applyInverse=function(t,e){e=e||new Ee;var i=1/(this.a*this.d+this.c*-this.b),n=t.x,s=t.y;return e.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e},r.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},r.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},r.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a,s=this.c,o=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=s*e-this.d*i,this.d=s*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this},r.prototype.append=function(t){var e=this.a,i=this.b,n=this.c,s=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*s,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*s,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*s+this.ty,this},r.prototype.setTransform=function(t,e,i,n,s,o,a,l,u){return this.a=Math.cos(a+u)*s,this.b=Math.sin(a+u)*s,this.c=-Math.sin(a-l)*o,this.d=Math.cos(a-l)*o,this.tx=t-(i*this.a+n*this.c),this.ty=e-(i*this.b+n*this.d),this},r.prototype.prepend=function(t){var e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){var i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},r.prototype.decompose=function(t){var e=this.a,i=this.b,n=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-n,s),l=Math.atan2(i,e),u=Math.abs(a+l);return u<1e-5||Math.abs(aS-u)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=l),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(n*n+s*s),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*i+o.y*s),t},r.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,s=this.tx,o=t*n-e*i;return this.a=n/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-n*s)/o,this.ty=-(t*this.ty-e*s)/o,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var t=new r;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},r.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r}(),Nn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ln=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Bn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],kn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],fc=[],$g=[],Ea=Math.sign;function uS(){for(var r=0;r<16;r++){var t=[];fc.push(t);for(var e=0;e<16;e++)for(var i=Ea(Nn[r]*Nn[e]+Bn[r]*Ln[e]),n=Ea(Ln[r]*Nn[e]+kn[r]*Ln[e]),s=Ea(Nn[r]*Bn[e]+Bn[r]*kn[e]),o=Ea(Ln[r]*Bn[e]+kn[r]*kn[e]),a=0;a<16;a++)if(Nn[a]===i&&Ln[a]===n&&Bn[a]===s&&kn[a]===o){t.push(a);break}}for(var r=0;r<16;r++){var l=new Ze;l.set(Nn[r],Ln[r],Bn[r],kn[r],0,0),$g.push(l)}}uS();var Oe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(r){return Nn[r]},uY:function(r){return Ln[r]},vX:function(r){return Bn[r]},vY:function(r){return kn[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,t){return fc[r][t]},sub:function(r,t){return fc[r][Oe.inv(t)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,t){return Math.abs(r)*2<=Math.abs(t)?t>=0?Oe.S:Oe.N:Math.abs(t)*2<=Math.abs(r)?r>0?Oe.E:Oe.W:t>0?r>0?Oe.SE:Oe.SW:r>0?Oe.NE:Oe.NW},matrixAppendRotationInv:function(r,t,e,i){e===void 0&&(e=0),i===void 0&&(i=0);var n=$g[Oe.inv(t)];n.tx=e,n.ty=i,r.append(n)}},Vg=function(){function r(){this.worldTransform=new Ze,this.localTransform=new Ze,this.position=new Ls(this.onChange,this,0,0),this.scale=new Ls(this.onChange,this,1,1),this.pivot=new Ls(this.onChange,this,0,0),this.skew=new Ls(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return r.prototype.onChange=function(){this._localID++},r.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},r.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},r.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,n=this.worldTransform;n.a=e.a*i.a+e.b*i.c,n.b=e.a*i.b+e.b*i.d,n.c=e.c*i.a+e.d*i.c,n.d=e.c*i.b+e.d*i.d,n.tx=e.tx*i.a+e.ty*i.c+i.tx,n.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},r.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r}();/*! - * @pixi/core - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/core is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */It.PREFER_ENV=qn.any?Gi.WEBGL:Gi.WEBGL2;It.STRICT_TEXTURE_CACHE=!1;var dc=[];function Gg(r,t){if(!r)return null;var e="";if(typeof r=="string"){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(r);i&&(e=i[1].toLowerCase())}for(var n=dc.length-1;n>=0;--n){var s=dc[n];if(s.test&&s.test(r,e))return new s(r,t)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var pc=function(r,t){return pc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},pc(r,t)};function Ie(r,t){pc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var mc=function(){return mc=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n0&&c>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(e),n}return Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,i){var n;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),i!==void 0&&i!==this.mipmap&&(this.mipmap=i,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,i,n){return n=n||this.resolution,this.setRealSize(e*n,i*n,n)},t.prototype.setRealSize=function(e,i,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(i)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=Id(this.realWidth)&&Id(this.realHeight)},t.prototype.setResolution=function(e){var i=this.resolution;return i===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*i)/e,this.height=Math.round(this.height*i)/e,this.emit("update",this)),this._refreshPOT(),this)},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Fn[this.cacheId],delete Mi[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,i,n){n===void 0&&(n=It.STRICT_TEXTURE_CACHE);var s=typeof e=="string",o=null;if(s)o=e;else{if(!e._pixiId){var a=i&&i.pixiIdPrefix||"pixiid";e._pixiId=a+"_"+Wo()}o=e._pixiId}var l=Fn[o];if(s&&n&&!l)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return l||(l=new t(e,i),l.cacheId=o,t.addToCache(l,o)),l},t.fromBuffer=function(e,i,n,s){e=e||new Float32Array(i*n*4);var o=new zh(e,{width:i,height:n}),a=e instanceof Float32Array?ce.FLOAT:ce.UNSIGNED_BYTE;return new t(o,Object.assign({},hS,s||{width:i,height:n,type:a}))},t.addToCache=function(e,i){i&&(e.textureCacheIds.indexOf(i)===-1&&e.textureCacheIds.push(i),Fn[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),Fn[i]=e)},t.removeFromCache=function(e){if(typeof e=="string"){var i=Fn[e];if(i){var n=i.textureCacheIds.indexOf(e);return n>-1&&i.textureCacheIds.splice(n,1),delete Fn[e],i}}else if(e&&e.textureCacheIds){for(var s=0;s0)if(e.resource)this.addResourceAt(e.resource,i);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Jn.TEXTURE_CUBE_MAP_POSITIVE_X+i,e.parentTextureArray=this.baseTexture,this.items[i]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[i]=e,this},t.prototype.upload=function(e,i,n){for(var s=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(pn),yS=function(r){Ie(t,r);function t(e,i){var n=this;if(i=i||{},!(e instanceof HTMLVideoElement)){var s=document.createElement("video");s.setAttribute("preload","auto"),s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);var o=e[0].src||e[0];pn.crossOrigin(s,o,i.crossorigin);for(var a=0;a2},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(di.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(di.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var i=this.valid;this.resize(e.videoWidth,e.videoHeight),!i&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(di.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),r.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(di.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(di.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,i){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(i)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(pn),gS=function(r){Ie(t,r);function t(e){return r.call(this,e)||this}return t.test=function(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap},t}(pn);dc.push(Hg,gS,dS,yS,mS,zh,pS,fS);var vS=function(r){Ie(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.upload=function(e,i,n){var s=e.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===dn.UNPACK);var o=i.realWidth,a=i.realHeight;return n.width===o&&n.height===a?s.texSubImage2D(i.target,0,0,0,o,a,i.format,n.type,this.data):(n.width=o,n.height=a,s.texImage2D(i.target,0,n.internalFormat,o,a,0,i.format,n.type,this.data)),!0},t}(zh),yc=function(){function r(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new qe("disposeFramebuffer"),this.multisample=Be.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(t,e){return t===void 0&&(t=0),this.colorTextures[t]=e||new Ve(null,{scaleMode:Ir.NEAREST,resolution:1,mipmap:xi.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(t){return this.depthTexture=t||new Ve(new vS(null,{width:this.width,height:this.height}),{scaleMode:Ir.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:xi.OFF,format:wt.DEPTH_COMPONENT,type:ce.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&i.textureCacheIds.splice(n,1),delete Mi[e],i}}else if(e&&e.textureCacheIds){for(var s=0;sthis.baseTexture.width,l=n+o>this.baseTexture.height;if(a||l){var u=a&&l?"and":"or",c="X: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.width,h="Y: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(c+" "+u+" "+h))}this.valid=s&&o&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new Ve),Ca(t._EMPTY),Ca(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=It.ADAPTER.createCanvas(16,16),i=e.getContext("2d");e.width=16,e.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),t._WHITE=new t(Ve.from(e)),Ca(t._WHITE),Ca(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(xn),jh=function(r){Ie(t,r);function t(e,i){var n=r.call(this,e,i)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,i,n){n===void 0&&(n=!0);var s=this.baseTexture.resolution,o=Math.round(e*s)/s,a=Math.round(i*s)/s;this.valid=o>0&&a>0,this._frame.width=this.orig.width=o,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(o,a),this.updateUvs()},t.prototype.setResolution=function(e){var i=this.baseTexture;i.resolution!==e&&(i.setResolution(e),this.resize(i.width,i.height,!1))},t.create=function(e){for(var i=arguments,n=[],s=1;s>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);var o=this.texturePool[s].pop();return o||(o=this.createTexture(t,e,n)),o.filterPoolKey=s,o.setResolution(i),o},r.prototype.getFilterTexture=function(t,e,i){var n=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||Be.NONE);return n.filterFrame=t.filterFrame,n},r.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},r.prototype.returnFilterTexture=function(t){this.returnTexture(t)},r.prototype.clear=function(t){if(t=t!==!1,t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var n=0;n0&&t.height>0;for(var e in this.texturePool)if(Number(e)<0){var i=this.texturePool[e];if(i)for(var n=0;n1){for(var c=0;c1&&(h=this.getOptimalFilterTexture(c.width,c.height,e.resolution),h.filterFrame=c.filterFrame),i[p].apply(this,c,h,ti.CLEAR,e);var f=c;c=h,h=f}i[p].apply(this,c,u.renderTexture,ti.BLEND,e),p>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}e.clear(),this.statePool.push(e)},r.prototype.bindAndClear=function(t,e){e===void 0&&(e=ti.CLEAR);var i=this.renderer,n=i.renderTexture,s=i.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,n.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=s.stateId&1||this.forceClear;(e===ti.CLEAR||e===ti.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(t,e,i,n){var s=this.renderer;s.state.set(t.state),this.bindAndClear(i,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(Go.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Go.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,n=i.sourceFrame,s=i.destinationFrame,o=e._texture.orig,a=t.set(s.width,0,0,s.height,n.x,n.y),l=e.worldTransform.copyTo(Ze.TEMP_MATRIX);return l.invert(),a.prepend(l),a.scale(1/o.width,1/o.height),a.translate(e.anchor.x,e.anchor.y),a},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(t,e,i,n){return i===void 0&&(i=1),n===void 0&&(n=Be.NONE),this.texturePool.getOptimalTexture(t,e,i,n)},r.prototype.getFilterTexture=function(t,e,i){if(typeof t=="number"){var n=t;t=e,e=n}t=t||this.activeState.renderTexture;var s=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||Be.NONE);return s.filterFrame=t.filterFrame,s},r.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(t,e){var i=Aa[0],n=Aa[1],s=Aa[2],o=Aa[3];i.set(e.left,e.top),n.set(e.left,e.bottom),s.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(i,i),t.apply(n,n),t.apply(s,s),t.apply(o,o);var a=Math.min(i.x,n.x,s.x,o.x),l=Math.min(i.y,n.y,s.y,o.y),u=Math.max(i.x,n.x,s.x,o.x),c=Math.max(i.y,n.y,s.y,o.y);e.x=a,e.y=l,e.width=u-a,e.height=c-l},r.prototype.roundFrame=function(t,e,i,n,s){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(s){var o=s.a,a=s.b,l=s.c,u=s.d;if((Math.abs(a)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}s=s?Fu.copyFrom(s):Fu.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}},r}(),qg=function(){function r(t){this.renderer=t}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(t){},r}(),FS=function(){function r(t){this.renderer=t,this.emptyRenderer=new qg(t),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(t,e){for(var i=this.renderer.texture.boundTextures,n=e-1;n>=0;--n)t[n]=i[n]||null,t[n]&&(t[n]._batchLocation=n)},r.prototype.boundArray=function(t,e,i,n){for(var s=t.elements,o=t.ids,a=t.count,l=0,u=0;u=0&&h=Gi.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var t=this.gl,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(t){var e=this;t.preventDefault(),setTimeout(function(){e.gl.isContextLost()&&e.extensions.loseContext&&e.extensions.loseContext.restoreContext()},0)},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(t){var e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},r}(),MS=function(){function r(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Be.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),DS=new Ue,RS=function(){function r(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new yc(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ue,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;It.PREFER_ENV===Gi.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(n){return e.drawBuffersWEBGL(n)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},r.prototype.bind=function(t,e,i){i===void 0&&(i=0);var n=this.gl;if(t){var s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=i),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o>i,u=e.height>>i,c=l/e.width;this.setViewport(e.x*c,e.y*c,l,u)}else{var l=t.width>>i,u=t.height>>i;this.setViewport(0,0,l,u)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(t,e,i,n){var s=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=i,s.height=n,this.gl.viewport(t,e,i,n))},Object.defineProperty(r.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(t,e,i,n,s){s===void 0&&(s=Ja.COLOR|Ja.DEPTH);var o=this.gl;o.clearColor(t,e,i,n),o.clear(s)},r.prototype.initFramebuffer=function(t){var e=this.gl,i=new MS(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i},r.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,t.width,t.height)),i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var n=t.colorTextures,s=n.length;e.drawBuffers||(s=Math.min(s,1));for(var o=0;o1&&this.canMultisampleFramebuffer(t)?(n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.RGBA8,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var a=[],l=0;l1&&i.drawBuffers(a),t.depthTexture){var h=this.writeDepthTexture;if(h){var p=t.depthTexture;this.renderer.texture.bind(p,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,p._glTextures[this.CONTEXT_UID].texture,e)}}(t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)?(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)},r.prototype.canMultisampleFramebuffer=function(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture},r.prototype.detectSamples=function(t){var e=this.msaaSamples,i=Be.NONE;if(t<=1||e===null)return i;for(var n=0;n=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&i.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=Gi.WEBGL2&&(t=r.getContext("webgl2",{})),t||(t=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),po=t}return po}var Oa;function US(){if(!Oa){Oa=Er.MEDIUM;var r=kS();if(r&&r.getShaderPrecisionFormat){var t=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);Oa=t.precision?Er.HIGH:Er.MEDIUM}}return Oa}function Bd(r,t,e){if(r.substring(0,9)!=="precision"){var i=t;return t===Er.HIGH&&e!==Er.HIGH&&(i=Er.MEDIUM),"precision "+i+` float; -`+r}else if(e!==Er.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var zS={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Zg(r){return zS[r]}var Fa=null,kd={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function Jg(r,t){if(!Fa){var e=Object.keys(kd);Fa={};for(var i=0;i0&&(t+=` -else `),e"u"?.5:e,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(t,e){e===void 0&&(e=t);for(var i=this.mapCoord,n=0;n0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r}(),ev=function(){function r(t){this.renderer=t,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=t;var n=this.getStackLength();n!==i&&(n===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r}(),zd=new Ze,jd=[],n1=function(r){Ie(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=It.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,i}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},t.prototype.calcScissorRect=function(e){var i;if(!e._scissorRectLocal){var n=e._scissorRect,s=e.maskObject,o=this.renderer,a=o.renderTexture,l=s.getBounds(!0,(i=jd.pop())!==null&&i!==void 0?i:new Ue);this.roundFrameToPixels(l,a.current?a.current.resolution:o.resolution,a.sourceFrame,a.destinationFrame,o.projection.transform),n&&l.fit(n),e._scissorRectLocal=l}},t.isMatrixRotated=function(e){if(!e)return!1;var i=e.a,n=e.b,s=e.c,o=e.d;return(Math.abs(n)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(o)>1e-4)},t.prototype.testScissor=function(e){var i=e.maskObject;if(!i.isFastRect||!i.isFastRect()||t.isMatrixRotated(i.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var n=e._scissorRectLocal;return n.width>0&&n.height>0},t.prototype.roundFrameToPixels=function(e,i,n,s,o){t.isMatrixRotated(o)||(o=o?zd.copyFrom(o):zd.identity(),o.translate(-n.x,-n.y).scale(s.width/n.width,s.height/n.height).translate(s.x,s.y),this.renderer.filter.transformAABB(o,e),e.fit(s),e.x=Math.round(e.x*i),e.y=Math.round(e.y*i),e.width=Math.round(e.width*i),e.height=Math.round(e.height*i))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var i=this.renderer.gl;e._scissorRect||i.enable(i.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(e){var i=this.renderer.gl;e&&jd.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():i.disable(i.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e=this.maskStack[this.maskStack.length-1]._scissorRect,i;this.renderer.renderTexture.current?i=e.y:i=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,i,e.width,e.height)},t}(ev),s1=function(r){Ie(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=It.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,i}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var i=e.maskObject,n=this.renderer.gl,s=e._stencilCounter;s===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;var o=e._colorMask;o!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,s,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,o!==0&&(e._colorMask=o,n.colorMask((o&1)!==0,(o&2)!==0,(o&4)!==0,(o&8)!==0)),this._useCurrent()},t.prototype.pop=function(e){var i=this.renderer.gl;if(this.getStackLength()===0)i.disable(i.STENCIL_TEST);else{var n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,s=n?n._colorMask:15;s!==0&&(n._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilOp(i.KEEP,i.KEEP,i.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,s!==0&&(n._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(ev),o1=function(){function r(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ze,this.transform=null}return r.prototype.update=function(t,e,i,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);var s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(t,e,i,n){var s=this.projectionMatrix,o=n?-1:1;s.identity(),s.a=1/e.width*2,s.d=o*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-o-e.y*s.d},r.prototype.setTransform=function(t){},r.prototype.destroy=function(){this.renderer=null},r}(),Pn=new Ue,yo=new Ue,a1=function(){function r(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Ue,this.destinationFrame=new Ue,this.viewportFrame=new Ue}return r.prototype.bind=function(t,e,i){t===void 0&&(t=null);var n=this.renderer;this.current=t;var s,o,a;t?(s=t.baseTexture,a=s.resolution,e||(Pn.width=t.frame.width,Pn.height=t.frame.height,e=Pn),i||(yo.x=t.frame.x,yo.y=t.frame.y,yo.width=e.width,yo.height=e.height,i=yo),o=s.framebuffer):(a=n.resolution,e||(Pn.width=n.screen.width,Pn.height=n.screen.height,e=Pn),i||(i=Pn,i.width=e.width,i.height=e.height));var l=this.viewportFrame;l.x=i.x*a,l.y=i.y*a,l.width=i.width*a,l.height=i.height*a,t||(l.y=n.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(o,l),this.renderer.projection.update(i,e,a,!o),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)},r.prototype.clear=function(t,e){this.current?t=t||this.current.baseTexture.clearColor:t=t||this.clearColor;var i=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,s=i.width!==n.width||i.height!==n.height;if(s){var o=this.viewportFrame,a=o.x,l=o.y,u=o.width,c=o.height;a=Math.round(a),l=Math.round(l),u=Math.round(u),c=Math.round(c),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,l,u,c)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),s&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r}();function l1(r,t,e,i,n){e.buffer.update(n)}var u1={float:` - data[offset] = v; - `,vec2:` - data[offset] = v[0]; - data[offset+1] = v[1]; - `,vec3:` - data[offset] = v[0]; - data[offset+1] = v[1]; - data[offset+2] = v[2]; - - `,vec4:` - data[offset] = v[0]; - data[offset+1] = v[1]; - data[offset+2] = v[2]; - data[offset+3] = v[3]; - `,mat2:` - data[offset] = v[0]; - data[offset+1] = v[1]; - - data[offset+4] = v[2]; - data[offset+5] = v[3]; - `,mat3:` - data[offset] = v[0]; - data[offset+1] = v[1]; - data[offset+2] = v[2]; - - data[offset + 4] = v[3]; - data[offset + 5] = v[4]; - data[offset + 6] = v[5]; - - data[offset + 8] = v[6]; - data[offset + 9] = v[7]; - data[offset + 10] = v[8]; - `,mat4:` - for(var i = 0; i < 16; i++) - { - data[offset + i] = v[i]; - } - `},rv={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function c1(r){for(var t=r.map(function(l){return{data:l,offset:0,dataLen:0,dirty:0}}),e=0,i=0,n=0,s=0;s1&&(e=Math.max(e,16)*o.data.size),o.dataLen=e,i%e!==0&&i<16){var a=i%e%16;i+=a,n+=a}i+e>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=e,i=e):(o.offset=n,i+=e,n+=e)}return n=Math.ceil(n/16)*16,{uboElements:t,size:n}}function h1(r,t){var e=[];for(var i in r)t[i]&&e.push(t[i]);return e.sort(function(n,s){return n.index-s.index}),e}function f1(r,t){if(!r.autoManage)return{size:0,syncFunc:l1};for(var e=h1(r.uniforms,t),i=c1(e),n=i.uboElements,s=i.size,o=[` - var v = null; - var v2 = null; - var cv = null; - var t = 0; - var gl = renderer.gl - var index = 0; - var data = buffer.data; - `],a=0;a1){var y=Zg(l.data.type),g=Math.max(rv[l.data.type]/16,1),d=y/g,m=(4-d%4)%4;o.push(` - cv = ud.`+c+`.value; - v = uv.`+c+`; - offset = `+l.offset/4+`; - - t = 0; - - for(var i=0; i < `+l.data.size*g+`; i++) - { - for(var j = 0; j < `+d+`; j++) - { - data[offset++] = v[t++]; - } - offset += `+m+`; - } - - `)}else{var _=u1[l.data.type];o.push(` - cv = ud.`+c+`.value; - v = uv.`+c+`; - offset = `+l.offset/4+`; - `+_+`; - `)}}return o.push(` - renderer.buffer.update(buffer); - `),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join(` -`))}}var d1=function(){function r(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r}();function p1(r,t){for(var e={},i=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),n=0;nh?1:-1});for(var o=0;o>1,i++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,n=0;nthis.maxIdle&&(t.destroyTexture(s,!0),e[n]=null,i=!0)}if(i){for(var o=0,n=0;n=0;n--)this.unload(t.children[n])},r.prototype.destroy=function(){this.renderer=null},r}();function A1(r){var t,e,i,n,s,o,a,l,u,c,h,p,f,y,g,d,m,_,S,E,b,F,x;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?x=(t={},t[ce.UNSIGNED_BYTE]=(e={},e[wt.RGBA]=r.RGBA8,e[wt.RGB]=r.RGB8,e[wt.RG]=r.RG8,e[wt.RED]=r.R8,e[wt.RGBA_INTEGER]=r.RGBA8UI,e[wt.RGB_INTEGER]=r.RGB8UI,e[wt.RG_INTEGER]=r.RG8UI,e[wt.RED_INTEGER]=r.R8UI,e[wt.ALPHA]=r.ALPHA,e[wt.LUMINANCE]=r.LUMINANCE,e[wt.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,e),t[ce.BYTE]=(i={},i[wt.RGBA]=r.RGBA8_SNORM,i[wt.RGB]=r.RGB8_SNORM,i[wt.RG]=r.RG8_SNORM,i[wt.RED]=r.R8_SNORM,i[wt.RGBA_INTEGER]=r.RGBA8I,i[wt.RGB_INTEGER]=r.RGB8I,i[wt.RG_INTEGER]=r.RG8I,i[wt.RED_INTEGER]=r.R8I,i),t[ce.UNSIGNED_SHORT]=(n={},n[wt.RGBA_INTEGER]=r.RGBA16UI,n[wt.RGB_INTEGER]=r.RGB16UI,n[wt.RG_INTEGER]=r.RG16UI,n[wt.RED_INTEGER]=r.R16UI,n[wt.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),t[ce.SHORT]=(s={},s[wt.RGBA_INTEGER]=r.RGBA16I,s[wt.RGB_INTEGER]=r.RGB16I,s[wt.RG_INTEGER]=r.RG16I,s[wt.RED_INTEGER]=r.R16I,s),t[ce.UNSIGNED_INT]=(o={},o[wt.RGBA_INTEGER]=r.RGBA32UI,o[wt.RGB_INTEGER]=r.RGB32UI,o[wt.RG_INTEGER]=r.RG32UI,o[wt.RED_INTEGER]=r.R32UI,o[wt.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,o),t[ce.INT]=(a={},a[wt.RGBA_INTEGER]=r.RGBA32I,a[wt.RGB_INTEGER]=r.RGB32I,a[wt.RG_INTEGER]=r.RG32I,a[wt.RED_INTEGER]=r.R32I,a),t[ce.FLOAT]=(l={},l[wt.RGBA]=r.RGBA32F,l[wt.RGB]=r.RGB32F,l[wt.RG]=r.RG32F,l[wt.RED]=r.R32F,l[wt.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,l),t[ce.HALF_FLOAT]=(u={},u[wt.RGBA]=r.RGBA16F,u[wt.RGB]=r.RGB16F,u[wt.RG]=r.RG16F,u[wt.RED]=r.R16F,u),t[ce.UNSIGNED_SHORT_5_6_5]=(c={},c[wt.RGB]=r.RGB565,c),t[ce.UNSIGNED_SHORT_4_4_4_4]=(h={},h[wt.RGBA]=r.RGBA4,h),t[ce.UNSIGNED_SHORT_5_5_5_1]=(p={},p[wt.RGBA]=r.RGB5_A1,p),t[ce.UNSIGNED_INT_2_10_10_10_REV]=(f={},f[wt.RGBA]=r.RGB10_A2,f[wt.RGBA_INTEGER]=r.RGB10_A2UI,f),t[ce.UNSIGNED_INT_10F_11F_11F_REV]=(y={},y[wt.RGB]=r.R11F_G11F_B10F,y),t[ce.UNSIGNED_INT_5_9_9_9_REV]=(g={},g[wt.RGB]=r.RGB9_E5,g),t[ce.UNSIGNED_INT_24_8]=(d={},d[wt.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,d),t[ce.FLOAT_32_UNSIGNED_INT_24_8_REV]=(m={},m[wt.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,m),t):x=(_={},_[ce.UNSIGNED_BYTE]=(S={},S[wt.RGBA]=r.RGBA,S[wt.RGB]=r.RGB,S[wt.ALPHA]=r.ALPHA,S[wt.LUMINANCE]=r.LUMINANCE,S[wt.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,S),_[ce.UNSIGNED_SHORT_5_6_5]=(E={},E[wt.RGB]=r.RGB,E),_[ce.UNSIGNED_SHORT_4_4_4_4]=(b={},b[wt.RGBA]=r.RGBA,b),_[ce.UNSIGNED_SHORT_5_5_5_1]=(F={},F[wt.RGBA]=r.RGBA,F),_),x}var Uu=function(){function r(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=ce.UNSIGNED_BYTE,this.internalFormat=wt.RGBA,this.samplerType=0}return r}(),O1=function(){function r(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Ve,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=A1(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=0;--o){var a=i[o];if(a){var l=a._glTextures[s];l.samplerType!==tl.FLOAT&&this.renderer.texture.unbind(a)}}},r.prototype.initTexture=function(t){var e=new Uu(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},r.prototype.initTextureType=function(t,e){var i,n;e.internalFormat=(n=(i=this.internalFormats[t.type])===null||i===void 0?void 0:i[t.format])!==null&&n!==void 0?n:t.format,this.webGLVersion===2&&t.type===ce.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},r.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e))e.samplerType!==tl.FLOAT&&(this.hasIntegerTextures=!0);else{var n=t.realWidth,s=t.realHeight,o=i.gl;(e.width!==n||e.height!==s||e.dirtyId<0)&&(e.width=n,e.height=s,o.texImage2D(t.target,0,e.internalFormat,n,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},r.prototype.destroyTexture=function(t,e){var i=this.gl;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var n=this.managedTextures.indexOf(t);n!==-1&&za(this.managedTextures,n,1)}},r.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===xi.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=el.CLAMP:e.wrapMode=t.wrapMode,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},r.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&t.mipmap!==xi.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===Ir.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===Ir.LINEAR){var s=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===Ir.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===Ir.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),zu=new Ze,F1=function(r){Ie(t,r);function t(e,i){e===void 0&&(e=Vo.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},It.RENDER_OPTIONS,i),n.options=i,n.type=e,n.screen=new Ue(0,0,i.width,i.height),n.view=i.view||It.ADAPTER.createCanvas(),n.resolution=i.resolution||It.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,i.transparent!==void 0&&(ts("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return t.prototype.initPlugins=function(e){for(var i in e)this.plugins[i]=new e[i](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,i){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(i*this.resolution);var n=this.view.width/this.resolution,s=this.view.height/this.resolution;this.screen.width=n,this.screen.height=s,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=s+"px"),this.emit("resize",n,s)},t.prototype.generateTexture=function(e,i,n,s){i===void 0&&(i={}),typeof i=="number"&&(ts("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var o=i.region,a=cS(i,["region"]);s=o||e.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var l=jh.create(mc({width:s.width,height:s.height},a));return zu.tx=-s.x,zu.ty=-s.y,this.render(e,{renderTexture:l,clear:!1,transform:zu,skipUpdateTransform:!!e.parent}),l},t.prototype.destroy=function(e){for(var i in this.plugins)this.plugins[i].destroy(),this.plugins[i]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var n=this;n.plugins=null,n.type=Vo.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=eS(e),Wr(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(xn),P1=function(){function r(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),M1=function(){function r(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(t){var e=this,i=e.gl,n=e.CONTEXT_UID,s=t._glBuffers[n]||this.createGLBuffer(t);i.bindBuffer(t.type,s.buffer)},r.prototype.bindBufferBase=function(t,e){var i=this,n=i.gl,s=i.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var o=t._glBuffers[s]||this.createGLBuffer(t);this.boundBufferBases[e]=t,n.bindBufferBase(n.UNIFORM_BUFFER,e,o.buffer)}},r.prototype.bindBufferRange=function(t,e,i){var n=this,s=n.gl,o=n.CONTEXT_UID;i=i||0;var a=t._glBuffers[o]||this.createGLBuffer(t);s.bindBufferRange(s.UNIFORM_BUFFER,e||0,a.buffer,i*256,256)},r.prototype.update=function(t){var e=this,i=e.gl,n=e.CONTEXT_UID,s=t._glBuffers[n];if(t._updateID!==s.updateID)if(s.updateID=t._updateID,i.bindBuffer(t.type,s.buffer),s.byteLength>=t.data.byteLength)i.bufferSubData(t.type,0,t.data);else{var o=t.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;s.byteLength=t.data.byteLength,i.bufferData(t.type,t.data,o)}},r.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),i&&(e||n.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),i=0;i=Be.HIGH?this.multisample=Be.HIGH:i>=Be.MEDIUM?this.multisample=Be.MEDIUM:i>=Be.LOW?this.multisample=Be.LOW:this.multisample=Be.NONE},t.prototype.addSystem=function(e,i){var n=new e(this);if(this[i])throw new Error('Whoops! The name "'+i+'" is already in use');this[i]=n;for(var s in this.runners)this.runners[s].add(n);return this},t.prototype.render=function(e,i){var n,s,o,a;if(i&&(i instanceof jh?(ts("6.0.0","Renderer#render arguments changed, use options instead."),n=i,s=arguments[2],o=arguments[3],a=arguments[4]):(n=i.renderTexture,s=i.clear,o=i.transform,a=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=o,!this.context.isLost){if(n||(this._lastObjectRendered=e),!a){var l=e.enableTempParent();e.updateTransform(),e.disableTempParent(l)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(s!==void 0?s:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(e,i,n,s){i===void 0&&(i={});var o=r.prototype.generateTexture.call(this,e,i,n,s);return this.framebuffer.blit(),o},t.prototype.resize=function(e,i){r.prototype.resize.call(this,e,i),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(e){this.runners.destroy.emit();for(var i in this.runners)this.runners[i].destroy();r.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return ts("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,i){ts("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),la.add({name:e,type:Hr.RendererPlugin,ref:i})},t.__plugins={},t}(F1);la.handleByMap(Hr.RendererPlugin,iv.__plugins);function D1(r){return iv.create(r)}var R1=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,N1=R1,L1=function(){function r(){this.texArray=null,this.blend=0,this.type=Go.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),B1=function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this,i=e._bufferedTextures,n=e.MAX_TEXTURES,s=t._textureArrayPool,o=this.renderer.batch,a=this._tempBoundTextures,l=this.renderer.textureGC.count,u=++Ve._globalBatch,c=0,h=s[0],p=0;o.copyBoundTextures(a,n);for(var f=0;f=n&&(o.boundArray(h,a,u,n),this.buildDrawCalls(h,p,f),p=f,h=s[++c],++u),y._batchEnabled=u,y.touched=l,h.elements[h.count++]=y)}h.count>0&&(o.boundArray(h,a,u,n),this.buildDrawCalls(h,p,this._bufferSize),++c,++u);for(var f=0;f0&&(e+=` -else `),ithis.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ue.EMPTY:(t=t||new Ue(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},r.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},r.prototype.addPointMatrix=function(t,e){var i=t.a,n=t.b,s=t.c,o=t.d,a=t.tx,l=t.ty,u=i*e.x+s*e.y+a,c=n*e.x+o*e.y+l;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)},r.prototype.addQuad=function(t){var e=this.minX,i=this.minY,n=this.maxX,s=this.maxY,o=t[0],a=t[1];e=on?o:n,s=a>s?a:s,o=t[2],a=t[3],e=on?o:n,s=a>s?a:s,o=t[4],a=t[5],e=on?o:n,s=a>s?a:s,o=t[6],a=t[7],e=on?o:n,s=a>s?a:s,this.minX=e,this.minY=i,this.maxX=n,this.maxY=s},r.prototype.addFrame=function(t,e,i,n,s){this.addFrameMatrix(t.worldTransform,e,i,n,s)},r.prototype.addFrameMatrix=function(t,e,i,n,s){var o=t.a,a=t.b,l=t.c,u=t.d,c=t.tx,h=t.ty,p=this.minX,f=this.minY,y=this.maxX,g=this.maxY,d=o*e+l*i+c,m=a*e+u*i+h;p=dy?d:y,g=m>g?m:g,d=o*n+l*i+c,m=a*n+u*i+h,p=dy?d:y,g=m>g?m:g,d=o*e+l*s+c,m=a*e+u*s+h,p=dy?d:y,g=m>g?m:g,d=o*n+l*s+c,m=a*n+u*s+h,p=dy?d:y,g=m>g?m:g,this.minX=p,this.minY=f,this.maxX=y,this.maxY=g},r.prototype.addVertexData=function(t,e,i){for(var n=this.minX,s=this.minY,o=this.maxX,a=this.maxY,l=e;lo?u:o,a=c>a?c:a}this.minX=n,this.minY=s,this.maxX=o,this.maxY=a},r.prototype.addVertices=function(t,e,i,n){this.addVerticesMatrix(t.worldTransform,e,i,n)},r.prototype.addVerticesMatrix=function(t,e,i,n,s,o){s===void 0&&(s=0),o===void 0&&(o=s);for(var a=t.a,l=t.b,u=t.c,c=t.d,h=t.tx,p=t.ty,f=this.minX,y=this.minY,g=this.maxX,d=this.maxY,m=i;mn?t.maxX:n,this.maxY=t.maxY>s?t.maxY:s},r.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,s=t.maxXu?s:u,this.maxY=o>c?o:c}},r.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},r.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,s=t.maxXu?s:u,this.maxY=o>c?o:c}},r.prototype.pad=function(t,e){t===void 0&&(t=0),e===void 0&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},r.prototype.addFramePad=function(t,e,i,n,s,o){t-=s,e-=o,i+=s,n+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n},r}();/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var gc=function(r,t){return gc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},gc(r,t)};function Wh(r,t){gc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Yo=function(r){Wh(t,r);function t(){var e=r.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new Vg,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new Gd,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return t.mixin=function(e){for(var i=Object.keys(e),n=0;n1)for(var s=0;sthis.children.length)throw new Error(e+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(i,0,e),this._boundsID++,this.onChildrenChange(i),e.emit("added",this),this.emit("childAdded",e,this,i),e},t.prototype.swapChildren=function(e,i){if(e!==i){var n=this.getChildIndex(e),s=this.getChildIndex(i);this.children[n]=i,this.children[s]=e,this.onChildrenChange(n=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);za(this.children,n,1),this.children.splice(i,0,e),this.onChildrenChange(i)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,i=[],n=0;n1)for(var s=0;s0&&o<=s){a=this.children.splice(n,o);for(var l=0;l1&&this.children.sort(G1),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,i=this.children.length;e0&&i.height>0){var n,s;if(this.cullArea?(n=this.cullArea,s=this.worldTransform):this._render!==t.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,s))this._render(e);else if(this.cullArea)return;for(var o=0,a=this.children.length;onew Promise((i,n)=>{var s=l=>{try{a(e.next(l))}catch(u){n(u)}},o=l=>{try{a(e.throw(l))}catch(u){n(u)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);a((e=e.apply(r,t)).next())});class Hh{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new Hh}setParameters(t){this._breathParameters=t}getParameters(){return this._breathParameters}updateParameters(t,e){this._currentTime+=e;const i=this._currentTime*2*3.14159;for(let n=0;n=1&&(i=1,this._blinkingState=Nr.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),e=1-i;break;case Nr.EyeState_Closed:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,i>=1&&(this._blinkingState=Nr.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),e=0;break;case Nr.EyeState_Opening:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,i>=1&&(i=1,this._blinkingState=Nr.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),e=i;break;case Nr.EyeState_Interval:this._nextBlinkingTime(r[r.EyeState_First=0]="EyeState_First",r[r.EyeState_Interval=1]="EyeState_Interval",r[r.EyeState_Closing=2]="EyeState_Closing",r[r.EyeState_Closed=3]="EyeState_Closed",r[r.EyeState_Opening=4]="EyeState_Opening",r))(Nr||{});const Y1=.001,Wd=.5;class Yh{static create(t){const e=new Yh;typeof t.FadeInTime=="number"&&(e._fadeTimeSeconds=t.FadeInTime,e._fadeTimeSeconds<=0&&(e._fadeTimeSeconds=Wd));const i=t.Groups,n=i.length;for(let s=0;sY1){if(s>=0)break;s=u,o=t.getPartOpacityByIndex(c),o+=e/this._fadeTimeSeconds,o>1&&(o=1)}}s<0&&(s=0,o=1);for(let u=i;ul&&(p=1-l/(1-o)),h>p&&(h=p),t.setPartOpacityByIndex(c,h)}}}constructor(){this._fadeTimeSeconds=Wd,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}}class sl{constructor(t){this.parameterIndex=0,this.partIndex=0,this.partId="",this.link=[],t!=null&&this.assignment(t)}assignment(t){return this.partId=t.partId,this.link=t.link.map(e=>e.clone()),this}initialize(t){this.parameterIndex=t.getParameterIndex(this.partId),this.partIndex=t.getPartIndex(this.partId),t.setParameterValueByIndex(this.parameterIndex,1)}clone(){const t=new sl;return t.partId=this.partId,t.parameterIndex=this.parameterIndex,t.partIndex=this.partIndex,t.link=this.link.map(e=>e.clone()),t}}class te{constructor(t,e){this.x=t||0,this.y=e||0}add(t){const e=new te(0,0);return e.x=this.x+t.x,e.y=this.y+t.y,e}substract(t){const e=new te(0,0);return e.x=this.x-t.x,e.y=this.y-t.y,e}multiply(t){const e=new te(0,0);return e.x=this.x*t.x,e.y=this.y*t.y,e}multiplyByScaler(t){return this.multiply(new te(t,t))}division(t){const e=new te(0,0);return e.x=this.x/t.x,e.y=this.y/t.y,e}divisionByScalar(t){return this.division(new te(t,t))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))}dot(t){return this.x*t.x+this.y*t.y}normalize(){const t=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/t,this.y=this.y/t}isEqual(t){return this.x==t.x&&this.y==t.y}isNotEqual(t){return!this.isEqual(t)}}const ja=class{static range(r,t,e){return re&&(r=e),r}static sin(r){return Math.sin(r)}static cos(r){return Math.cos(r)}static abs(r){return Math.abs(r)}static sqrt(r){return Math.sqrt(r)}static cbrt(r){if(r===0)return r;let t=r;const e=t<0;e&&(t=-t);let i;return t===1/0?i=1/0:(i=Math.exp(Math.log(t)/3),i=(t/(i*i)+2*i)/3),e?-i:i}static getEasingSine(r){return r<0?0:r>1?1:.5-.5*this.cos(r*Math.PI)}static max(r,t){return r>t?r:t}static min(r,t){return r>t?t:r}static degreesToRadian(r){return r/180*Math.PI}static radianToDegrees(r){return r*180/Math.PI}static directionToRadian(r,t){const e=Math.atan2(t.y,t.x),i=Math.atan2(r.y,r.x);let n=e-i;for(;n<-Math.PI;)n+=Math.PI*2;for(;n>Math.PI;)n-=Math.PI*2;return n}static directionToDegrees(r,t){const e=this.directionToRadian(r,t);let i=this.radianToDegrees(e);return t.x-r.x>0&&(i=-i),i}static radianToDirection(r){const t=new te;return t.x=this.sin(r),t.y=this.cos(r),t}static quadraticEquation(r,t,e){return this.abs(r)1&&(t=1),e<0?e=0:e>1&&(e=1),i<0?i=0:i>1&&(i=1),n<0?n=0:n>1&&(n=1),this._modelColor.R=t,this._modelColor.G=e,this._modelColor.B=i,this._modelColor.A=n}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(t){this._isPremultipliedAlpha=t}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(t){this._isCulling=t}isCulling(){return this._isCulling}setAnisotropy(t){this._anisortopy=t}getAnisotropy(){return this._anisortopy}getModel(){return this._model}constructor(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._modelColor=new So,this._mvpMatrix4x4=new $r,this._mvpMatrix4x4.loadIdentity()}}var fn=(r=>(r[r.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",r[r.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",r[r.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative",r))(fn||{});class So{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}}let ai=!1,gs=!1,vs;const ju={vertexOffset:0,vertexStep:2};class Xo{static startUp(t){if(ai)return vo("CubismFramework.startUp() is already done."),ai;if(Live2DCubismCore._isStarted)return ai=!0,!0;if(Live2DCubismCore._isStarted=!0,vs=t,vs&&Live2DCubismCore.Logging.csmSetLogFunction(vs.logFunction),ai=!0,ai){const e=Live2DCubismCore.Version.csmGetVersion(),i=(e&4278190080)>>24,n=(e&16711680)>>16,s=e&65535,o=e;vo("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+i).slice(-2),("00"+n).slice(-2),("0000"+s).slice(-4),o)}return vo("CubismFramework.startUp() is complete."),ai}static cleanUp(){ai=!1,gs=!1,vs=void 0}static initialize(){if(!ai){To("CubismFramework is not started.");return}if(gs){To("CubismFramework.initialize() skipped, already initialized.");return}gs=!0,vo("CubismFramework.initialize() is complete.")}static dispose(){if(!ai){To("CubismFramework is not started.");return}if(!gs){To("CubismFramework.dispose() skipped, not initialized.");return}Xh.staticRelease(),gs=!1,vo("CubismFramework.dispose() is complete.")}static isStarted(){return ai}static isInitialized(){return gs}static coreLogFunction(t){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(t)}static getLoggingLevel(){return vs!=null?vs.loggingLevel:cs.LogLevel_Off}constructor(){}}var cs=(r=>(r[r.LogLevel_Verbose=0]="LogLevel_Verbose",r[r.LogLevel_Debug=1]="LogLevel_Debug",r[r.LogLevel_Info=2]="LogLevel_Info",r[r.LogLevel_Warning=3]="LogLevel_Warning",r[r.LogLevel_Error=4]="LogLevel_Error",r[r.LogLevel_Off=5]="LogLevel_Off",r))(cs||{});const Da=()=>{};function Hd(r,...t){Jl.print(cs.LogLevel_Debug,"[CSM][D]"+r+` -`,t)}function vo(r,...t){Jl.print(cs.LogLevel_Info,"[CSM][I]"+r+` -`,t)}function To(r,...t){Jl.print(cs.LogLevel_Warning,"[CSM][W]"+r+` -`,t)}function xs(r,...t){Jl.print(cs.LogLevel_Error,"[CSM][E]"+r+` -`,t)}class Jl{static print(t,e,i){if(ti[a]);n(s)}static dumpBytes(t,e,i){for(let n=0;n0?this.print(t,` -`):n%8==0&&n>0&&this.print(t," "),this.print(t,"{0} ",[e[n]&255]);this.print(t,` -`)}constructor(){}}class X1{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){const t=this._model.parameters.count,e=this._savedParameters.length;for(let i=0;ie&&(e=this._model.parameters.minimumValues[t]),this._parameterValues[t]=i==1?e:this._parameterValues[t]=this._parameterValues[t]*(1-i)+e*i}setParameterValueById(t,e,i=1){const n=this.getParameterIndex(t);this.setParameterValueByIndex(n,e,i)}addParameterValueByIndex(t,e,i=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)+e*i)}addParameterValueById(t,e,i=1){const n=this.getParameterIndex(t);this.addParameterValueByIndex(n,e,i)}multiplyParameterValueById(t,e,i=1){const n=this.getParameterIndex(t);this.multiplyParameterValueByIndex(n,e,i)}multiplyParameterValueByIndex(t,e,i=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)*(1+(e-1)*i))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(t){const e=this._model.drawables.count;for(let i=0;ie&&(t=e);for(let i=0;i0&&e.getEndTime()(r[r.ExpressionBlendType_Add=0]="ExpressionBlendType_Add",r[r.ExpressionBlendType_Multiply=1]="ExpressionBlendType_Multiply",r[r.ExpressionBlendType_Overwrite=2]="ExpressionBlendType_Overwrite",r))(Un||{}),qo;(r=>{r.supportMoreMaskDivisions=!0,r.setOpacityFromMotion=!1})(qo||(qo={}));var zn=(r=>(r[r.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",r[r.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",r[r.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity",r))(zn||{}),ui=(r=>(r[r.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",r[r.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",r[r.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",r[r.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped",r))(ui||{});class sn{constructor(t=0,e=0){this.time=t,this.value=e}}class q1{constructor(){this.basePointIndex=0,this.segmentType=0}}class Q1{constructor(){this.id="",this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}}class K1{constructor(){this.fireTime=0,this.value=""}}class Z1{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=[],this.segments=[],this.points=[],this.events=[]}}class av{constructor(t){this._json=t}release(){this._json=void 0}getMotionDuration(){return this._json.Meta.Duration}isMotionLoop(){return this._json.Meta.Loop||!1}getEvaluationOptionFlag(t){return Kh.EvaluationOptionFlag_AreBeziersRistricted==t?!!this._json.Meta.AreBeziersRestricted:!1}getMotionCurveCount(){return this._json.Meta.CurveCount}getMotionFps(){return this._json.Meta.Fps}getMotionTotalSegmentCount(){return this._json.Meta.TotalSegmentCount}getMotionTotalPointCount(){return this._json.Meta.TotalPointCount}getMotionFadeInTime(){return this._json.Meta.FadeInTime}getMotionFadeOutTime(){return this._json.Meta.FadeOutTime}getMotionCurveTarget(t){return this._json.Curves[t].Target}getMotionCurveId(t){return this._json.Curves[t].Id}getMotionCurveFadeInTime(t){return this._json.Curves[t].FadeInTime}getMotionCurveFadeOutTime(t){return this._json.Curves[t].FadeOutTime}getMotionCurveSegmentCount(t){return this._json.Curves[t].Segments.length}getMotionCurveSegment(t,e){return this._json.Curves[t].Segments[e]}getEventCount(){return this._json.Meta.UserDataCount||0}getTotalEventValueSize(){return this._json.Meta.TotalUserDataSize}getEventTime(t){return this._json.UserData[t].Time}getEventValue(t){return this._json.UserData[t].Value}}var Kh=(r=>(r[r.EvaluationOptionFlag_AreBeziersRistricted=0]="EvaluationOptionFlag_AreBeziersRistricted",r))(Kh||{});const J1="EyeBlink",tT="LipSync",eT="Model",rT="Parameter",iT="PartOpacity",nT=!1;function Ur(r,t,e){const i=new sn;return i.time=r.time+(t.time-r.time)*e,i.value=r.value+(t.value-r.value)*e,i}function sT(r,t){let e=(t-r[0].time)/(r[1].time-r[0].time);return e<0&&(e=0),r[0].value+(r[1].value-r[0].value)*e}function oT(r,t){let e=(t-r[0].time)/(r[3].time-r[0].time);e<0&&(e=0);const i=Ur(r[0],r[1],e),n=Ur(r[1],r[2],e),s=Ur(r[2],r[3],e),o=Ur(i,n,e),a=Ur(n,s,e);return Ur(o,a,e).value}function aT(r,t){const e=t,i=r[0].time,n=r[3].time,s=r[1].time,o=r[2].time,a=n-3*o+3*s-i,l=3*o-6*s+3*i,u=3*s-3*i,c=i-e,h=Te.cardanoAlgorithmForBezier(a,l,u,c),p=Ur(r[0],r[1],h),f=Ur(r[1],r[2],h),y=Ur(r[2],r[3],h),g=Ur(p,f,h),d=Ur(f,y,h);return Ur(g,d,h).value}function lT(r,t){return r[0].value}function uT(r,t){return r[1].value}function $u(r,t,e){const i=r.curves[t];let n=-1;const s=i.baseSegmentIndex+i.segmentCount;let o=0;for(let l=i.baseSegmentIndex;le){n=l;break}if(n==-1)return r.points[o].value;const a=r.segments[n];return a.evaluate(r.points.slice(a.basePointIndex),e)}class Zh extends ov{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(t,e){const i=new Zh;return i.parse(t),i._sourceFrameRate=i._motionData.fps,i._loopDurationSeconds=i._motionData.duration,i._onFinishedMotion=e,i}doUpdateParameters(t,e,i,n){this._modelCurveIdEyeBlink==null&&(this._modelCurveIdEyeBlink=J1),this._modelCurveIdLipSync==null&&(this._modelCurveIdLipSync=tT);let s=e-n.getStartTime();s<0&&(s=0);let o=Number.MAX_VALUE,a=Number.MAX_VALUE;const l=64;let u=0,c=0;this._eyeBlinkParameterIds.length>l&&Hd("too many eye blink targets : {0}",this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>l&&Hd("too many lip sync targets : {0}",this._lipSyncParameterIds.length);const h=this._fadeInSeconds<=0?1:Te.getEasingSine((e-n.getFadeInStartTime())/this._fadeInSeconds),p=this._fadeOutSeconds<=0||n.getEndTime()<0?1:Te.getEasingSine((n.getEndTime()-e)/this._fadeOutSeconds);let f,y,g,d=s;if(this._isLoop)for(;d>this._motionData.duration;)d-=this._motionData.duration;const m=this._motionData.curves;for(y=0;y>_&1)continue;const E=S+(a-S)*i;t.setParameterValueById(this._eyeBlinkParameterIds[_],E)}if(o!=Number.MAX_VALUE)for(let _=0;_>_&1)continue;const E=S+(o-S)*i;t.setParameterValueById(this._lipSyncParameterIds[_],E)}}for(;y=this._motionData.duration&&(this._isLoop?(n.setStartTime(e),this._isLoopFadeIn&&n.setFadeInStartTime(e)):(this._onFinishedMotion&&this._onFinishedMotion(this),n.setIsFinished(!0))),this._lastWeight=i}setIsLoop(t){this._isLoop=t}isLoop(){return this._isLoop}setIsLoopFadeIn(t){this._isLoopFadeIn=t}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(t,e){const i=this._motionData.curves;for(let n=0;nnew Q1),this._motionData.segments=Array.from({length:e.getMotionTotalSegmentCount()}).map(()=>new q1),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new K1),this._motionData.points=[];let o=0,a=0;for(let l=0;lt&&this._motionData.events[i].fireTime<=e&&this._firedEventValues.push(this._motionData.events[i].value);return this._firedEventValues}}class cT{constructor(){this._autoDelete=!1,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&this._motion.release()}setFadeOut(t){this._fadeOutSeconds=t,this._isTriggeredFadeOut=!0}startFadeOut(t,e){const i=e+t;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||ie!=null&&e._motionQueueEntryHandle==t)}setEventCallback(t,e=null){this._eventCallBack=t,this._eventCustomData=e}doUpdateMotion(t,e){let i=!1,n=0;for(;n(r[r.CubismPhysicsTargetType_Parameter=0]="CubismPhysicsTargetType_Parameter",r))(_c||{}),jn=(r=>(r[r.CubismPhysicsSource_X=0]="CubismPhysicsSource_X",r[r.CubismPhysicsSource_Y=1]="CubismPhysicsSource_Y",r[r.CubismPhysicsSource_Angle=2]="CubismPhysicsSource_Angle",r))(jn||{});class fT{constructor(){this.initialPosition=new te(0,0),this.position=new te(0,0),this.lastPosition=new te(0,0),this.lastGravity=new te(0,0),this.force=new te(0,0),this.velocity=new te(0,0)}}class dT{constructor(){this.normalizationPosition={},this.normalizationAngle={}}}class pT{constructor(){this.source={}}}class mT{constructor(){this.destination={},this.translationScale=new te(0,0)}}class yT{constructor(){this.settings=[],this.inputs=[],this.outputs=[],this.particles=[],this.gravity=new te(0,0),this.wind=new te(0,0)}}class gT{constructor(t){this._json=t}release(){this._json=void 0}getGravity(){const t=new te(0,0);return t.x=this._json.Meta.EffectiveForces.Gravity.X,t.y=this._json.Meta.EffectiveForces.Gravity.Y,t}getWind(){const t=new te(0,0);return t.x=this._json.Meta.EffectiveForces.Wind.X,t.y=this._json.Meta.EffectiveForces.Wind.Y,t}getSubRigCount(){return this._json.Meta.PhysicsSettingCount}getTotalInputCount(){return this._json.Meta.TotalInputCount}getTotalOutputCount(){return this._json.Meta.TotalOutputCount}getVertexCount(){return this._json.Meta.VertexCount}getNormalizationPositionMinimumValue(t){return this._json.PhysicsSettings[t].Normalization.Position.Minimum}getNormalizationPositionMaximumValue(t){return this._json.PhysicsSettings[t].Normalization.Position.Maximum}getNormalizationPositionDefaultValue(t){return this._json.PhysicsSettings[t].Normalization.Position.Default}getNormalizationAngleMinimumValue(t){return this._json.PhysicsSettings[t].Normalization.Angle.Minimum}getNormalizationAngleMaximumValue(t){return this._json.PhysicsSettings[t].Normalization.Angle.Maximum}getNormalizationAngleDefaultValue(t){return this._json.PhysicsSettings[t].Normalization.Angle.Default}getInputCount(t){return this._json.PhysicsSettings[t].Input.length}getInputWeight(t,e){return this._json.PhysicsSettings[t].Input[e].Weight}getInputReflect(t,e){return this._json.PhysicsSettings[t].Input[e].Reflect}getInputType(t,e){return this._json.PhysicsSettings[t].Input[e].Type}getInputSourceId(t,e){return this._json.PhysicsSettings[t].Input[e].Source.Id}getOutputCount(t){return this._json.PhysicsSettings[t].Output.length}getOutputVertexIndex(t,e){return this._json.PhysicsSettings[t].Output[e].VertexIndex}getOutputAngleScale(t,e){return this._json.PhysicsSettings[t].Output[e].Scale}getOutputWeight(t,e){return this._json.PhysicsSettings[t].Output[e].Weight}getOutputDestinationId(t,e){return this._json.PhysicsSettings[t].Output[e].Destination.Id}getOutputType(t,e){return this._json.PhysicsSettings[t].Output[e].Type}getOutputReflect(t,e){return this._json.PhysicsSettings[t].Output[e].Reflect}getParticleCount(t){return this._json.PhysicsSettings[t].Vertices.length}getParticleMobility(t,e){return this._json.PhysicsSettings[t].Vertices[e].Mobility}getParticleDelay(t,e){return this._json.PhysicsSettings[t].Vertices[e].Delay}getParticleAcceleration(t,e){return this._json.PhysicsSettings[t].Vertices[e].Acceleration}getParticleRadius(t,e){return this._json.PhysicsSettings[t].Vertices[e].Radius}getParticlePosition(t,e){const i=new te(0,0);return i.x=this._json.PhysicsSettings[t].Vertices[e].Position.X,i.y=this._json.PhysicsSettings[t].Vertices[e].Position.Y,i}}const Xd="X",qd="Y",Qd="Angle",vT=5,uv=100,_T=.001;class Jh{static create(t){const e=new Jh;return e.parse(t),e._physicsRig.gravity.y=0,e}evaluate(t,e){let i,n,s,o;const a=new te;let l,u,c,h,p,f,y,g;p=t.getModel().parameters.values,f=t.getModel().parameters.maximumValues,y=t.getModel().parameters.minimumValues,g=t.getModel().parameters.defaultValues;for(let d=0;d=l.particleCount)break;c[m].destinationParameterIndex==-1&&(c[m].destinationParameterIndex=t.getParameterIndex(c[m].destination.id));const S=new te;S.x=h[_].position.x-h[_-1].position.x,S.y=h[_].position.y-h[_-1].position.y,o=c[m].getValue(S,h,_,c[m].reflect,this._options.gravity);const E=c[m].destinationParameterIndex,b=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(p.subarray(E))):p.slice(E);DT(b,y[E],f[E],o,c[m]);for(let F=E,x=0;F=2?n=t[e-1].position.substract(t[e-2].position):n=n.multiplyByScaler(-1),s=Te.directionToRadian(n,r),i&&(s*=-1),s}function CT(r,t){return Math.abs(Math.max(r,t)-Math.min(r,t))}function AT(r,t){return Math.min(r,t)+CT(r,t)/2}function OT(r,t){return r.x}function FT(r,t){return r.y}function PT(r,t){return t}function MT(r,t,e,i,n,s,o,a){let l,u,c,h,p=new te(0,0),f=new te(0,0),y=new te(0,0),g=new te(0,0);r[0].position=new te(e.x,e.y),l=Te.degreesToRadian(i),h=Te.radianToDirection(l),h.normalize();for(let d=1;de&&(o>n.valueExceededMaximum&&(n.valueExceededMaximum=o),o=e),a=n.weight/uv,a>=1||(o=r[0]*(1-a)+o*a),r[0]=o}function tf(r,t,e,i,n,s,o,a){let l=0;const u=Te.max(e,t);ur&&(r=c);const h=Te.min(n,s),p=Te.max(n,s),f=o,y=AT(c,u),g=r-y;switch(Math.sign(g)){case 1:{const d=p-f,m=u-y;m!=0&&(l=g*(d/m),l+=f);break}case-1:{const d=h-f,m=c-y;m!=0&&(l=g*(d/m),l+=f);break}case 0:{l=f;break}}return a?l:l*-1}class bc{constructor(t=0,e=0,i=0,n=0){this.x=t,this.y=e,this.width=i,this.height=n}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height}expand(t,e){this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2}}const Vu=4,RT=10;let Dn,Io,wc;class Gu{getChannelFlagAsColor(t){return this._channelColors[t]}getMaskRenderTexture(){let t=0;if(this._maskTexture&&this._maskTexture.texture!=0&&(this._maskTexture.frameNo=this._currentFrameNo,t=this._maskTexture.texture),t==0){const e=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),t=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,wc),this._maskTexture=new NT(this._currentFrameNo,t)}return t}setGL(t){this.gl=t}calcClippedDrawTotalBounds(t,e){let i=Number.MAX_VALUE,n=Number.MAX_VALUE,s=Number.MIN_VALUE,o=Number.MIN_VALUE;const a=e._clippedDrawableIndexList.length;for(let l=0;ly&&(y=_),Sg&&(g=S)}if(p!=Number.MAX_VALUE)if(ps&&(s=y),g>o&&(o=g),i==Number.MAX_VALUE)e._allClippedDrawRect.x=0,e._allClippedDrawRect.y=0,e._allClippedDrawRect.width=0,e._allClippedDrawRect.height=0,e._isUsing=!1;else{e._isUsing=!0;const m=s-i,_=o-n;e._allClippedDrawRect.x=i,e._allClippedDrawRect.y=n,e._allClippedDrawRect.width=m,e._allClippedDrawRect.height=_}}}constructor(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=[],this._clippingContextListForDraw=[],this._channelColors=[],this._tmpBoundsOnModel=new bc,this._tmpMatrix=new $r,this._tmpMatrixForMask=new $r,this._tmpMatrixForDraw=new $r;let t=new So;t.R=1,t.G=0,t.B=0,t.A=0,this._channelColors.push(t),t=new So,t.R=0,t.G=1,t.B=0,t.A=0,this._channelColors.push(t),t=new So,t.R=0,t.G=0,t.B=1,t.A=0,this._channelColors.push(t),t=new So,t.R=0,t.G=0,t.B=0,t.A=1,this._channelColors.push(t)}release(){var t,e,i;const n=this;for(let s=0;s0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture(),e.getMvpMatrix(),e.preDraw(),this.setupLayoutBounds(i),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let n=0;n(r[r.ShaderNames_SetupMask=0]="ShaderNames_SetupMask",r[r.ShaderNames_NormalPremultipliedAlpha=1]="ShaderNames_NormalPremultipliedAlpha",r[r.ShaderNames_NormalMaskedPremultipliedAlpha=2]="ShaderNames_NormalMaskedPremultipliedAlpha",r[r.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]="ShaderNames_NomralMaskedInvertedPremultipliedAlpha",r[r.ShaderNames_AddPremultipliedAlpha=4]="ShaderNames_AddPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlpha=5]="ShaderNames_AddMaskedPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]="ShaderNames_AddMaskedPremultipliedAlphaInverted",r[r.ShaderNames_MultPremultipliedAlpha=7]="ShaderNames_MultPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlpha=8]="ShaderNames_MultMaskedPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]="ShaderNames_MultMaskedPremultipliedAlphaInverted",r))(Eo||{});const BT="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_myPos;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_clipMatrix * a_position; v_myPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",kT="precision mediump float;varying vec2 v_texCoord;varying vec4 v_myPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;void main(){ float isInside = step(u_baseColor.x, v_myPos.x/v_myPos.w) * step(u_baseColor.y, v_myPos.y/v_myPos.w) * step(v_myPos.x/v_myPos.w, u_baseColor.z) * step(v_myPos.y/v_myPos.w, u_baseColor.w); gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;}",UT="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;uniform mat4 u_matrix;void main(){ gl_Position = u_matrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",Kd="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform mat4 u_matrix;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_matrix * a_position; v_clipPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",zT="precision mediump float;varying vec2 v_texCoord;uniform vec4 u_baseColor;uniform sampler2D s_texture0;void main(){ gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;}",jT="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;uniform sampler2D s_texture1;void main(){ vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor; vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}",$T="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;void main(){vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;col_formask = col_formask * (1.0 - maskVal);gl_FragColor = col_formask;}";class cv extends Xh{constructor(){super(),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._clippingManager=new Gu,this.firstDraw=!0,this._textures={},this._sortedDrawableIndexList=[],this._bufferData={vertex:null,uv:null,index:null}}initialize(t){t.isUsingMasking()&&(this._clippingManager=new Gu,this._clippingManager.initialize(t,t.getDrawableCount(),t.getDrawableMasks(),t.getDrawableMaskCounts()));for(let e=t.getDrawableCount()-1;e>=0;e--)this._sortedDrawableIndexList[e]=0;super.initialize(t)}bindTexture(t,e){this._textures[t]=e}getBindedTextures(){return this._textures}setClippingMaskBufferSize(t){this._clippingManager.release(),this._clippingManager=new Gu,this._clippingManager.setClippingMaskBufferSize(t),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var t,e,i;const n=this;this._clippingManager.release(),n._clippingManager=void 0,(t=this.gl)==null||t.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,(e=this.gl)==null||e.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,(i=this.gl)==null||i.deleteBuffer(this._bufferData.index),this._bufferData.index=null,n._bufferData=void 0,n._textures=void 0}doDrawModel(){this.preDraw(),this._clippingManager!=null&&this._clippingManager.setupClippingContext(this.getModel(),this);const t=this.getModel().getDrawableCount(),e=this.getModel().getDrawableRenderOrders();for(let i=0;i{cv.doStaticRelease()};class hv{constructor(t){this.groups=t.Groups,this.hitAreas=t.HitAreas,this.layout=t.Layout,this.moc=t.FileReferences.Moc,this.expressions=t.FileReferences.Expressions,this.motions=t.FileReferences.Motions,this.textures=t.FileReferences.Textures,this.physics=t.FileReferences.Physics,this.pose=t.FileReferences.Pose}getEyeBlinkParameters(){var t,e;return(e=(t=this.groups)==null?void 0:t.find(i=>i.Name==="EyeBlink"))==null?void 0:e.Ids}getLipSyncParameters(){var t,e;return(e=(t=this.groups)==null?void 0:t.find(i=>i.Name==="LipSync"))==null?void 0:e.Ids}}const VT="ParamAngleX",GT="ParamAngleY",WT="ParamAngleZ",HT="ParamEyeBallX",YT="ParamEyeBallY",XT="ParamBodyAngleX",qT="ParamBreath",Zd=2,Jd=2;var xr;(r=>{r.LOG_LEVEL_VERBOSE=0,r.LOG_LEVEL_WARNING=1,r.LOG_LEVEL_ERROR=2,r.LOG_LEVEL_NONE=999,r.logLevel=r.LOG_LEVEL_WARNING,r.sound=!0,r.motionSync=!0,r.motionFadingDuration=500,r.idleMotionFadingDuration=2e3,r.expressionFadingDuration=500,r.preserveExpressionOnMotion=!0,r.cubism4=qo})(xr||(xr={}));const be={log(r,...t){xr.logLevel<=xr.LOG_LEVEL_VERBOSE&&console.log(`[${r}]`,...t)},warn(r,...t){xr.logLevel<=xr.LOG_LEVEL_WARNING&&console.warn(`[${r}]`,...t)},error(r,...t){xr.logLevel<=xr.LOG_LEVEL_ERROR&&console.error(`[${r}]`,...t)}};function tp(r,t,e){return re?e:r}function fv(r,t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(i=>{i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i))})})}function QT(r){let t=r.lastIndexOf("/");return t!=-1&&(r=r.slice(0,t)),t=r.lastIndexOf("/"),t!==-1&&(r=r.slice(t+1)),r}function KT(r,t){const e=r.indexOf(t);e!==-1&&r.splice(e,1)}class dv extends xn{constructor(t,e){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=t,this.tag=`ExpressionManager(${t.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(t){return Fe(this,null,function*(){if(!this.definitions[t]){be.warn(this.tag,`Undefined expression at [${t}]`);return}if(this.expressions[t]===null){be.warn(this.tag,`Cannot set expression at [${t}] because it's already failed in loading.`);return}if(this.expressions[t])return this.expressions[t];const e=yield this._loadExpression(t);return this.expressions[t]=e,e})}_loadExpression(t){throw new Error("Not implemented.")}setRandomExpression(){return Fe(this,null,function*(){if(this.definitions.length){const t=[];for(let e=0;e-1&&tu&&(o*=u/l,a*=u/l),this.vx+=o,this.vy+=a;const c=Math.sqrt(Mn(this.vx,2)+Mn(this.vy,2)),h=.5*(Math.sqrt(Mn(u,2)+8*u*n)-u);c>h&&(this.vx*=h/c,this.vy*=h/c),this.x+=this.vx,this.y+=this.vy}}class ef{constructor(t){this.json=t;let e=t.url;if(typeof e!="string")throw new TypeError("The `url` field in settings JSON must be defined as a string.");this.url=e,this.name=QT(this.url)}resolveURL(t){return Zl.resolve(this.url,t)}replaceFiles(t){this.moc=t(this.moc,"moc"),this.pose!==void 0&&(this.pose=t(this.pose,"pose")),this.physics!==void 0&&(this.physics=t(this.physics,"physics"));for(let e=0;e(t.push(e),e)),t}validateFiles(t){const e=(s,o)=>{const a=this.resolveURL(s);if(!t.includes(a)){if(o)throw new Error(`File "${s}" is defined in settings, but doesn't exist in given files`);return!1}return!0};return[this.moc,...this.textures].forEach(s=>e(s,!0)),this.getDefinedFiles().filter(s=>e(s,!1))}}var xc=(r=>(r[r.NONE=0]="NONE",r[r.IDLE=1]="IDLE",r[r.NORMAL=2]="NORMAL",r[r.FORCE=3]="FORCE",r))(xc||{});class eI{constructor(){this.debug=!1,this.currentPriority=0,this.reservePriority=0}reserve(t,e,i){if(i<=0)return be.log(this.tag,"Cannot start a motion with MotionPriority.NONE."),!1;if(t===this.currentGroup&&e===this.currentIndex)return be.log(this.tag,"Motion is already playing.",this.dump(t,e)),!1;if(t===this.reservedGroup&&e===this.reservedIndex||t===this.reservedIdleGroup&&e===this.reservedIdleIndex)return be.log(this.tag,"Motion is already reserved.",this.dump(t,e)),!1;if(i===1){if(this.currentPriority!==0)return be.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(t,e)),!1;if(this.reservedIdleGroup!==void 0)return be.log(this.tag,"Cannot start idle motion because another idle motion has reserved.",this.dump(t,e)),!1;this.setReservedIdle(t,e)}else{if(i<3){if(i<=this.currentPriority)return be.log(this.tag,"Cannot start motion because another motion is playing as an equivalent or higher priority.",this.dump(t,e)),!1;if(i<=this.reservePriority)return be.log(this.tag,"Cannot start motion because another motion has reserved as an equivalent or higher priority.",this.dump(t,e)),!1}this.setReserved(t,e,i)}return!0}start(t,e,i,n){if(n===1){if(this.setReservedIdle(void 0,void 0),this.currentPriority!==0)return be.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(e,i)),!1}else{if(e!==this.reservedGroup||i!==this.reservedIndex)return be.log(this.tag,"Cannot start motion because another motion has taken the place.",this.dump(e,i)),!1;this.setReserved(void 0,void 0,0)}return t?(this.setCurrent(e,i,n),!0):!1}complete(){this.setCurrent(void 0,void 0,0)}setCurrent(t,e,i){this.currentPriority=i,this.currentGroup=t,this.currentIndex=e}setReserved(t,e,i){this.reservePriority=i,this.reservedGroup=t,this.reservedIndex=e}setReservedIdle(t,e){this.reservedIdleGroup=t,this.reservedIdleIndex=e}isActive(t,e){return t===this.currentGroup&&e===this.currentIndex||t===this.reservedGroup&&e===this.reservedIndex||t===this.reservedIdleGroup&&e===this.reservedIdleIndex}reset(){this.setCurrent(void 0,void 0,0),this.setReserved(void 0,void 0,0),this.setReservedIdle(void 0,void 0)}shouldRequestIdleMotion(){return this.currentGroup===void 0&&this.reservedIdleGroup===void 0}shouldOverrideExpression(){return!xr.preserveExpressionOnMotion&&this.currentPriority>1}dump(t,e){if(this.debug){const i=["currentPriority","reservePriority","currentGroup","currentIndex","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex"];return` - group = "${t}", index = ${e} -`+i.map(n=>"["+n+"] "+this[n]).join(` -`)}return""}}const rI="SoundManager",iI=.5;class Hn{static get volume(){return this._volume}static set volume(t){this._volume=(t>1?1:t<0?0:t)||0,this.audios.forEach(e=>e.volume=this._volume)}static add(t,e,i){const n=new Audio(t);return n.volume=this._volume,n.preload="auto",n.addEventListener("ended",()=>{this.dispose(n),e==null||e()}),n.addEventListener("error",s=>{this.dispose(n),be.warn(rI,`Error occurred on "${t}"`,s.error),i==null||i(s.error)}),this.audios.push(n),n}static play(t){return new Promise((e,i)=>{var n;(n=t.play())==null||n.catch(s=>{t.dispatchEvent(new ErrorEvent("error",{error:s})),i(s)}),t.readyState===t.HAVE_ENOUGH_DATA?e():t.addEventListener("canplaythrough",e)})}static dispose(t){t.pause(),t.removeAttribute("src"),KT(this.audios,t)}static destroy(){for(let t=this.audios.length-1;t>=0;t--)this.dispose(this.audios[t])}}Hn.audios=[];Hn._volume=iI;class rf extends xn{constructor(t,e){super(),this.motionGroups={},this.state=new eI,this.playing=!1,this.destroyed=!1,this.settings=t,this.tag=`MotionManager(${t.name})`,this.state.tag=this.tag}init(t){t!=null&&t.idleMotionGroup&&(this.groups.idle=t.idleMotionGroup),this.setupMotions(t),this.stopAllMotions()}setupMotions(t){for(const i of Object.keys(this.definitions))this.motionGroups[i]=[];let e;switch(t==null?void 0:t.motionPreload){case"NONE":return;case"ALL":e=Object.keys(this.definitions);break;case"IDLE":default:e=[this.groups.idle];break}for(const i of e)if(this.definitions[i])for(let n=0;nthis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=l}catch(h){be.warn(this.tag,"Failed to create audio",c,h)}}const u=yield this.loadMotion(i,n);if(l){const c=Hn.play(l).catch(h=>be.warn(this.tag,"Failed to play audio",l.src,h));xr.motionSync&&(yield c)}return this.state.start(u,i,n,s)?(be.log(this.tag,"Start motion:",this.getMotionName(a)),this.emit("motionStart",i,n,l),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(u),!0):(l&&(Hn.dispose(l),this.currentAudio=void 0),!1)})}startRandomMotion(t,e){return Fe(this,null,function*(){const i=this.definitions[t];if(i!=null&&i.length){const n=[];for(let s=0;se.index>=0);for(const e of t)this.hitAreas[e.name]=e}hitTest(t,e){return Object.keys(this.hitAreas).filter(i=>this.isHit(i,t,e))}isHit(t,e,i){if(!this.hitAreas[t])return!1;const n=this.hitAreas[t].index,s=this.getDrawableBounds(n,nI);return s.x<=e&&e<=s.x+s.width&&s.y<=i&&i<=s.y+s.height}getDrawableBounds(t,e){const i=this.getDrawableVertices(t);let n=i[0],s=i[0],o=i[1],a=i[1];for(let l=0;l{(s.status===200||s.status===0)&&s.response?i(s.response):s.onerror()},s.onerror=()=>{be.warn(oI,`Failed to load resource as ${s.responseType} (Status ${s.status}): ${t}`),n(new rp("Network error.",t,s.status))},s.onabort=()=>n(new rp("Aborted.",t,s.status,!0)),s.onloadend=()=>{var o;nr.allXhrSet.delete(s),r&&((o=nr.xhrMap.get(r))==null||o.delete(s))},s}static cancelXHRs(){var r;(r=nr.xhrMap.get(this))==null||r.forEach(t=>{t.abort(),nr.allXhrSet.delete(t)}),nr.xhrMap.delete(this)}static release(){nr.allXhrSet.forEach(r=>r.abort()),nr.allXhrSet.clear(),nr.xhrMap=new WeakMap}};let tu=nr;tu.xhrMap=new WeakMap;tu.allXhrSet=new Set;tu.loader=(r,t)=>new Promise((e,i)=>{nr.createXHR(r.target,r.settings?r.settings.resolveURL(r.url):r.url,r.type,s=>{r.result=s,e()},i).send()});function pv(r,t){let e=-1;return i(0);function i(n,s){if(s)return Promise.reject(s);if(n<=e)return Promise.reject(new Error("next() called multiple times"));e=n;const o=r[n];if(!o)return Promise.resolve();try{return Promise.resolve(o(t,i.bind(null,n+1)))}catch(a){return Promise.reject(a)}}}class mn{static load(t){return pv(this.middlewares,t).then(()=>t.result)}}mn.middlewares=[tu.loader];function aI(r,t={}){var e;const i={resourceOptions:{crossorigin:t.crossOrigin}};if(es.fromURL)return es.fromURL(r,i).catch(o=>{if(o instanceof Error)throw o;const a=new Error("Texture loading error");throw a.event=o,a});i.resourceOptions.autoLoad=!1;const n=es.from(r,i);if(n.baseTexture.valid)return Promise.resolve(n);const s=n.baseTexture.resource;return(e=s._live2d_load)!=null||(s._live2d_load=new Promise((o,a)=>{const l=u=>{s.source.removeEventListener("error",l);const c=new Error("Texture loading error");c.event=u,a(c)};s.source.addEventListener("error",l),s.load().then(()=>o(n)).catch(l)})),s._live2d_load}const ip="Live2DFactory",mv=(r,t)=>Fe(void 0,null,function*(){if(typeof r.source=="string"){const e=yield mn.load({url:r.source,type:"json",target:r.live2dModel});e.url=r.source,r.source=e,r.live2dModel.emit("settingsJSONLoaded",e)}return t()}),yv=(r,t)=>Fe(void 0,null,function*(){if(r.source instanceof ef)return r.settings=r.source,t();if(typeof r.source=="object"){const e=Re.findRuntime(r.source);if(e){const i=e.createModelSettings(r.source);return r.settings=i,r.live2dModel.emit("settingsLoaded",i),t()}}throw new TypeError("Unknown settings format.")}),gv=(r,t)=>{if(r.settings){const e=Re.findRuntime(r.settings);if(e)return e.ready().then(t)}return t()},vv=(r,t)=>Fe(void 0,null,function*(){yield t();const e=r.internalModel;if(e){const i=r.settings,n=Re.findRuntime(i);if(n){const s=[];i.pose&&s.push(mn.load({settings:i,url:i.pose,type:"json",target:e}).then(o=>{e.pose=n.createPose(e.coreModel,o),r.live2dModel.emit("poseLoaded",e.pose)}).catch(o=>{r.live2dModel.emit("poseLoadError",o),be.warn(ip,"Failed to load pose.",o)})),i.physics&&s.push(mn.load({settings:i,url:i.physics,type:"json",target:e}).then(o=>{e.physics=n.createPhysics(e.coreModel,o),r.live2dModel.emit("physicsLoaded",e.physics)}).catch(o=>{r.live2dModel.emit("physicsLoadError",o),be.warn(ip,"Failed to load physics.",o)})),s.length&&(yield Promise.all(s))}}}),_v=(r,t)=>Fe(void 0,null,function*(){if(r.settings){const e=r.live2dModel,i=r.settings.textures.map(n=>{const s=r.settings.resolveURL(n);return aI(s,{crossOrigin:r.options.crossOrigin})});if(yield t(),r.internalModel)e.internalModel=r.internalModel,e.emit("modelLoaded",r.internalModel);else throw new TypeError("Missing internal model.");e.textures=yield Promise.all(i),e.emit("textureLoaded",e.textures)}else throw new TypeError("Missing settings.")}),bv=(r,t)=>Fe(void 0,null,function*(){const e=r.settings;if(e instanceof ef){const i=Re.findRuntime(e);if(!i)throw new TypeError("Unknown model settings.");const n=yield mn.load({settings:e,url:e.moc,type:"arraybuffer",target:r.live2dModel});if(!i.isValidMoc(n))throw new Error("Invalid moc data");const s=i.createCoreModel(n);return r.internalModel=i.createInternalModel(s,e,r.options),t()}throw new TypeError("Missing settings.")}),Xe=class{static registerRuntime(r){Xe.runtimes.push(r),Xe.runtimes.sort((t,e)=>e.version-t.version)}static findRuntime(r){for(const t of Xe.runtimes)if(t.test(r))return t}static setupLive2DModel(r,t,e){return Fe(this,null,function*(){const i=new Promise(o=>r.once("textureLoaded",o)),n=new Promise(o=>r.once("modelLoaded",o)),s=Promise.all([i,n]).then(()=>r.emit("ready"));yield pv(Xe.live2DModelMiddlewares,{live2dModel:r,source:t,options:e||{}}),yield s,r.emit("load")})}static loadMotion(r,t,e){var i,n;const s=o=>r.emit("motionLoadError",t,e,o);try{const o=(i=r.definitions[t])==null?void 0:i[e];if(!o)return Promise.resolve(void 0);r.listeners("destroy").includes(Xe.releaseTasks)||r.once("destroy",Xe.releaseTasks);let a=Xe.motionTasksMap.get(r);a||(a={},Xe.motionTasksMap.set(r,a));let l=a[t];l||(l=[],a[t]=l);const u=r.getMotionFile(o);return(n=l[e])!=null||(l[e]=mn.load({url:u,settings:r.settings,type:r.motionDataType,target:r}).then(c=>{var h;const p=(h=Xe.motionTasksMap.get(r))==null?void 0:h[t];p&&delete p[e];const f=r.createMotion(c,t,o);return r.emit("motionLoaded",t,e,f),f}).catch(c=>{be.warn(r.tag,`Failed to load motion: ${u} -`,c),s(c)})),l[e]}catch(o){be.warn(r.tag,`Failed to load motion at "${t}"[${e}] -`,o),s(o)}return Promise.resolve(void 0)}static loadExpression(r,t){var e;const i=n=>r.emit("expressionLoadError",t,n);try{const n=r.definitions[t];if(!n)return Promise.resolve(void 0);r.listeners("destroy").includes(Xe.releaseTasks)||r.once("destroy",Xe.releaseTasks);let s=Xe.expressionTasksMap.get(r);s||(s=[],Xe.expressionTasksMap.set(r,s));const o=r.getExpressionFile(n);return(e=s[t])!=null||(s[t]=mn.load({url:o,settings:r.settings,type:"json",target:r}).then(a=>{const l=Xe.expressionTasksMap.get(r);l&&delete l[t];const u=r.createExpression(a,n);return r.emit("expressionLoaded",t,u),u}).catch(a=>{be.warn(r.tag,`Failed to load expression: ${o} -`,a),i(a)})),s[t]}catch(n){be.warn(r.tag,`Failed to load expression at [${t}] -`,n),i(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof rf?Xe.motionTasksMap.delete(this):Xe.expressionTasksMap.delete(this)}};let Re=Xe;Re.runtimes=[];Re.urlToJSON=mv;Re.jsonToSettings=yv;Re.waitUntilReady=gv;Re.setupOptionals=vv;Re.setupEssentials=_v;Re.createInternalModel=bv;Re.live2DModelMiddlewares=[mv,yv,gv,vv,_v,bv];Re.motionTasksMap=new WeakMap;Re.expressionTasksMap=new WeakMap;rf.prototype._loadMotion=function(r,t){return Re.loadMotion(this,r,t)};dv.prototype._loadExpression=function(r){return Re.loadExpression(this,r)};class lI{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(t){t!==this._autoInteract&&(t?this.on("pointertap",np,this):this.off("pointertap",np,this),this._autoInteract=t)}registerInteraction(t){t!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&t&&(this.interactionManager=t,t.on("pointermove",sp,this)))}unregisterInteraction(){var t;this.interactionManager&&((t=this.interactionManager)==null||t.off("pointermove",sp,this),this.interactionManager=void 0)}}function np(r){this.tap(r.data.global.x,r.data.global.y)}function sp(r){this.focus(r.data.global.x,r.data.global.y)}class uI extends Vg{}const Rr=new Ee,cI=new Ze;let en;class hI extends nl{constructor(t){super(),this.tag="Live2DModel(uninitialized)",this.textures=[],this.transform=new uI,this.anchor=new Ls(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once("modelLoaded",()=>this.init(t))}static from(t,e){const i=new this(e);return Re.setupLive2DModel(i,t,e).then(()=>i)}static fromSync(t,e){const i=new this(e);return Re.setupLive2DModel(i,t,e).then(e==null?void 0:e.onLoad).catch(e==null?void 0:e.onError),i}static registerTicker(t){en=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){var e;en||(en=(e=window.PIXI)==null?void 0:e.Ticker),t?this._destroyed||(en?(en.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):be.warn(this.tag,"No Ticker registered, please call Live2DModel.registerTicker(Ticker).")):(en==null||en.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(t){this.tag=`Live2DModel(${this.internalModel.settings.name})`;const e=Object.assign({autoUpdate:!0,autoInteract:!0},t);e.autoInteract&&(this.interactive=!0),this.autoInteract=e.autoInteract,this.autoUpdate=e.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(t,e,i){return e===void 0?this.internalModel.motionManager.startRandomMotion(t,i):this.internalModel.motionManager.startMotion(t,e,i)}expression(t){return this.internalModel.motionManager.expressionManager?t===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(t):Promise.resolve(!1)}focus(t,e,i=!1){Rr.x=t,Rr.y=e,this.toModelPosition(Rr,Rr,!0);let n=Rr.x/this.internalModel.originalWidth*2-1,s=Rr.y/this.internalModel.originalHeight*2-1,o=Math.atan2(s,n);this.internalModel.focusController.focus(Math.cos(o),-Math.sin(o),i)}tap(t,e){const i=this.hitTest(t,e);i.length&&(be.log(this.tag,"Hit",i),this.emit("hit",i))}hitTest(t,e){return Rr.x=t,Rr.y=e,this.toModelPosition(Rr,Rr),this.internalModel.hitTest(Rr.x,Rr.y)}toModelPosition(t,e=t.clone(),i){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(t,e),this.internalModel.localTransform.applyInverse(e,e),e}containsPoint(t){return this.getBounds(!0).contains(t.x,t.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(en.shared.deltaMS)}update(t){this.deltaTime+=t,this.elapsedTime+=t}_render(t){this.registerInteraction(t.plugins.interaction),t.batch.reset(),t.geometry.reset(),t.shader.reset(),t.state.reset();let e=!1;this.glContextID!==t.CONTEXT_UID&&(this.glContextID=t.CONTEXT_UID,this.internalModel.updateWebGLContext(t.gl,this.glContextID),e=!0);for(let s=0;se.destroy(t.baseTexture)),this.internalModel.destroy(),super.destroy(t)}}fv(hI,[lI]);const pi=class{static resolveURL(r,t){var e;const i=(e=pi.filesMap[r])==null?void 0:e[t];if(i===void 0)throw new Error("Cannot find this file from uploaded files: "+t);return i}static upload(r,t){return Fe(this,null,function*(){const e={};for(const i of t.getDefinedFiles()){const n=decodeURI(Zl.resolve(t.url,i)),s=r.find(o=>o.webkitRelativePath===n);s&&(e[i]=URL.createObjectURL(s))}pi.filesMap[t._objectURL]=e})}static createSettings(r){return Fe(this,null,function*(){const t=r.find(o=>o.name.endsWith("model.json")||o.name.endsWith("model3.json"));if(!t)throw new TypeError("Settings file not found");const e=yield pi.readText(t),i=JSON.parse(e);i.url=t.webkitRelativePath;const n=Re.findRuntime(i);if(!n)throw new Error("Unknown settings JSON");const s=n.createModelSettings(i);return s._objectURL=URL.createObjectURL(t),s})}static readText(r){return Fe(this,null,function*(){return new Promise((t,e)=>{const i=new FileReader;i.onload=()=>t(i.result),i.onerror=e,i.readAsText(r,"utf8")})})}};let nf=pi;nf.filesMap={};nf.factory=(r,t)=>Fe(void 0,null,function*(){if(Array.isArray(r.source)&&r.source[0]instanceof File){const e=r.source;let i=e.settings;if(!i)i=yield pi.createSettings(e);else if(!i._objectURL)throw new Error('"_objectURL" must be specified in ModelSettings');i.validateFiles(e.map(n=>encodeURI(n.webkitRelativePath))),yield pi.upload(e,i),i.resolveURL=function(n){return pi.resolveURL(this._objectURL,n)},r.source=i,r.live2dModel.once("modelLoaded",n=>{n.once("destroy",function(){const s=this.settings._objectURL;if(URL.revokeObjectURL(s),pi.filesMap[s])for(const o of Object.values(pi.filesMap[s]))URL.revokeObjectURL(o);delete pi.filesMap[s]})})}return t()});Re.live2DModelMiddlewares.unshift(nf.factory);const ur=class{static unzip(r,t){return Fe(this,null,function*(){const e=yield ur.getFilePaths(r),i=[];for(const s of t.getDefinedFiles()){const o=decodeURI(Zl.resolve(t.url,s));e.includes(o)&&i.push(o)}const n=yield ur.getFiles(r,i);for(let s=0;so.endsWith("model.json")||o.endsWith("model3.json"));if(!e)throw new Error("Settings file not found");const i=yield ur.readText(r,e);if(!i)throw new Error("Empty settings file: "+e);const n=JSON.parse(i);n.url=e;const s=Re.findRuntime(n);if(!s)throw new Error("Unknown settings JSON");return s.createModelSettings(n)})}static zipReader(r,t){return Fe(this,null,function*(){throw new Error("Not implemented")})}static getFilePaths(r){return Fe(this,null,function*(){throw new Error("Not implemented")})}static getFiles(r,t){return Fe(this,null,function*(){throw new Error("Not implemented")})}static readText(r,t){return Fe(this,null,function*(){throw new Error("Not implemented")})}static releaseReader(r){}};let Oi=ur;Oi.ZIP_PROTOCOL="zip://";Oi.uid=0;Oi.factory=(r,t)=>Fe(void 0,null,function*(){const e=r.source;let i,n,s;if(typeof e=="string"&&(e.endsWith(".zip")||e.startsWith(ur.ZIP_PROTOCOL))?(e.startsWith(ur.ZIP_PROTOCOL)?i=e.slice(ur.ZIP_PROTOCOL.length):i=e,n=yield mn.load({url:i,type:"blob",target:r.live2dModel})):Array.isArray(e)&&e.length===1&&e[0]instanceof File&&e[0].name.endsWith(".zip")&&(n=e[0],i=URL.createObjectURL(n),s=e.settings),n){if(!n.size)throw new Error("Empty zip file");const o=yield ur.zipReader(n,i);s||(s=yield ur.createSettings(o)),s._objectURL=ur.ZIP_PROTOCOL+ur.uid+"/"+s.url;const a=yield ur.unzip(o,s);a.settings=s,r.source=a,i.startsWith("blob:")&&r.live2dModel.once("modelLoaded",l=>{l.once("destroy",function(){URL.revokeObjectURL(i)})}),ur.releaseReader(o)}return t()});Re.live2DModelMiddlewares.unshift(Oi.factory);if(!window.Live2DCubismCore)throw new Error("Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.");class fI extends dv{constructor(t,e){var i;super(t,e),this.queueManager=new lv,this.definitions=(i=t.expressions)!=null?i:[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(t){return this.definitions.findIndex(e=>e.Name===t)}getExpressionFile(t){return t.File}createExpression(t,e){return Qh.create(t)}_setExpression(t){return this.queueManager.startMotion(t,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}}class rs extends ef{constructor(t){if(super(t),!rs.isValidJSON(t))throw new TypeError("Invalid JSON.");Object.assign(this,new hv(t))}static isValidJSON(t){var e;return!!(t!=null&&t.FileReferences)&&typeof t.FileReferences.Moc=="string"&&((e=t.FileReferences.Textures)==null?void 0:e.length)>0&&t.FileReferences.Textures.every(i=>typeof i=="string")}replaceFiles(t){if(super.replaceFiles(t),this.motions)for(const[e,i]of Object.entries(this.motions))for(let n=0;n{this.emit("motion:"+i)})}isFinished(){return this.queueManager.isFinished()}_startMotion(t,e){return t.setFinishedMotionHandler(e),this.queueManager.stopAllMotions(),this.queueManager.startMotion(t,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(t,e,i){const n=Zh.create(t),s=new av(t),o=(e===this.groups.idle?xr.idleMotionFadingDuration:xr.motionFadingDuration)/1e3;return s.getMotionFadeInTime()===void 0&&n.setFadeInTime(i.FadeInTime>0?i.FadeInTime:o),s.getMotionFadeOutTime()===void 0&&n.setFadeOutTime(i.FadeOutTime>0?i.FadeOutTime:o),n.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),n}getMotionFile(t){return t.File}getMotionName(t){return t.File}getSoundFile(t){return t.Sound}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}}const op=new $r;class pI extends sI{constructor(t,e,i){super(),this.lipSync=!0,this.breath=Hh.create(),this.renderer=new cv,this.idParamAngleX=VT,this.idParamAngleY=GT,this.idParamAngleZ=WT,this.idParamEyeBallX=HT,this.idParamEyeBallY=YT,this.idParamBodyAngleX=XT,this.idParamBreath=qT,this.pixelsPerUnit=1,this.centeringTransform=new Ze,this.coreModel=t,this.settings=e,this.motionManager=new dI(e,i),this.init()}init(){var t;super.init(),((t=this.settings.getEyeBlinkParameters())==null?void 0:t.length)>0&&(this.eyeBlink=sv.create(this.settings)),this.breath.setParameters([new go(this.idParamAngleX,0,15,6.5345,.5),new go(this.idParamAngleY,0,8,3.5345,.5),new go(this.idParamAngleZ,0,10,5.5345,.5),new go(this.idParamBodyAngleX,0,4,15.5345,.5),new go(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){const t={};if(this.settings.layout)for(const e of Object.keys(this.settings.layout)){const i=e.charAt(0).toLowerCase()+e.slice(1);t[i]=this.settings.layout[e]}return t}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(t,e){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(t),this.renderer._clippingManager._currentFrameNo=e,this.renderer._clippingManager._maskTexture=void 0,js.getInstance()._shaderSets=[]}bindTexture(t,e){this.renderer.bindTexture(t,e)}getHitAreaDefs(){var t,e;return(e=(t=this.settings.hitAreas)==null?void 0:t.map(i=>({id:i.Id,name:i.Name,index:this.coreModel.getDrawableIndex(i.Id)})))!=null?e:[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(t){return this.coreModel.getDrawableIndex(t)}getDrawableVertices(t){if(typeof t=="string"&&(t=this.coreModel.getDrawableIndex(t),t===-1))throw new TypeError("Unable to find drawable ID: "+t);const e=this.coreModel.getDrawableVertices(t).slice();for(let i=0;i{function e(){try{yI(),r()}catch(i){if(ap--,ap<0){const n=new Error("Failed to start up Cubism 4 framework.");n.cause=i,t(n);return}be.log("Cubism4","Startup failed, retrying 10ms later..."),setTimeout(e,10)}}e()})),Ra)}function yI(r){r=Object.assign({logFunction:console.log,loggingLevel:cs.LogLevel_Verbose},r),Xo.startUp(r),Xo.initialize()}Re.registerRuntime({version:4,ready:mI,test(r){return r instanceof rs||rs.isValidJSON(r)},isValidMoc(r){if(r.byteLength<4)return!1;const t=new Int8Array(r,0,4);return String.fromCharCode(...t)==="MOC3"},createModelSettings(r){return new rs(r)},createCoreModel(r){const t=qh.create(r);try{const e=t.createModel();return e.__moc=t,e}catch(e){try{t.release()}catch{}throw e}},createInternalModel(r,t,e){const i=new pI(r,t,e),n=r;return n.__moc&&(i.__moc=n.__moc,delete n.__moc,i.once("destroy",gI)),i},createPhysics(r,t){return Jh.create(t)},createPose(r,t){return Yh.create(t)}});function gI(){var r;(r=this.__moc)==null||r.release()}/*! - * @pixi/interaction - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/interaction is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var lp=function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Ee,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(r.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),r.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},r.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},r.prototype.reset=function(){this.isPrimary=!1},r}();/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Sc=function(r,t){return Sc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Sc(r,t)};function vI(r,t){Sc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var _I=function(){function r(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return r.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},r.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},r}(),Wu=function(){function r(t){this._pointerId=t,this._flags=r.FLAGS.NONE}return r.prototype._doSet=function(t,e){e?this._flags=this._flags|t:this._flags=this._flags&~t},Object.defineProperty(r.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"none",{get:function(){return this._flags===r.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"over",{get:function(){return(this._flags&r.FLAGS.OVER)!==0},set:function(t){this._doSet(r.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightDown",{get:function(){return(this._flags&r.FLAGS.RIGHT_DOWN)!==0},set:function(t){this._doSet(r.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftDown",{get:function(){return(this._flags&r.FLAGS.LEFT_DOWN)!==0},set:function(t){this._doSet(r.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),r.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),r}(),bI=function(){function r(){this._tempPoint=new Ee}return r.prototype.recursiveFindHit=function(t,e,i,n,s){var o;if(!e||!e.visible)return!1;var a=t.data.global;s=e.interactive||s;var l=!1,u=s,c=!0;if(e.hitArea)n&&(e.worldTransform.applyInverse(a,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?l=!0:(n=!1,c=!1)),u=!1;else if(e._mask&&n){var h=e._mask.isMaskData?e._mask.maskObject:e._mask;h&&!(!((o=h.containsPoint)===null||o===void 0)&&o.call(h,a))&&(n=!1)}if(c&&e.interactiveChildren&&e.children)for(var p=e.children,f=p.length-1;f>=0;f--){var y=p[f],g=this.recursiveFindHit(t,y,i,n,u);if(g){if(!y.parent)continue;u=!1,g&&(t.target&&(n=!1),l=!0)}}return s&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(a)&&(l=!0),e.interactive&&(l&&!t.target&&(t.target=e),i&&i(t,e,!!l))),l},r.prototype.findHit=function(t,e,i,n){this.recursiveFindHit(t,e,i,n,!1)},r}(),wI={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor==="pointer"},set buttonMode(r){r?this.cursor="pointer":this.cursor==="pointer"&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Yo.mixin(wI);var Na=1,La={target:null,data:{global:null}},BR=function(r){vI(t,r);function t(e,i){var n=r.call(this)||this;return i=i||{},n.renderer=e,n.autoPreventDefault=i.autoPreventDefault!==void 0?i.autoPreventDefault:!0,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new lp,n.mouse.identifier=Na,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[Na]=n.mouse,n.interactionDataPool=[],n.eventData=new _I,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in globalThis),n.supportsTouchEvents="ontouchstart"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new bI,n._tempDisplayObject=new nv,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=i.useSystemTicker!==void 0?i.useSystemTicker:!0,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return Object.defineProperty(t.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,i){return La.target=null,La.data.global=e,i||(i=this.lastObjectRendered),this.processInteractive(La,i,null,!0),La.target},t.prototype.setTargetElement=function(e,i){i===void 0&&(i=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=i,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(di.system.add(this.tickerUpdate,this,Zs.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(di.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime0&&(a=e.composedPath()[0]);for(var l=a!==this.interactionDOMElement?"outside":"",u=0;u"u"&&(o.button=e.touches.length?1:0),typeof o.buttons>"u"&&(o.buttons=e.touches.length?1:0),typeof o.isPrimary>"u"&&(o.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof o.width>"u"&&(o.width=o.radiusX||1),typeof o.height>"u"&&(o.height=o.radiusY||1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="touch"),typeof o.pointerId>"u"&&(o.pointerId=o.identifier||0),typeof o.pressure>"u"&&(o.pressure=o.force||.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),typeof o.layerX>"u"&&(o.layerX=o.offsetX=o.clientX),typeof o.layerY>"u"&&(o.layerY=o.offsetY=o.clientY),o.isNormalized=!0,i.push(o)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){var a=e;typeof a.isPrimary>"u"&&(a.isPrimary=!0),typeof a.width>"u"&&(a.width=1),typeof a.height>"u"&&(a.height=1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="mouse"),typeof a.pointerId>"u"&&(a.pointerId=Na),typeof a.pressure>"u"&&(a.pressure=.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),a.isNormalized=!0,i.push(a)}else i.push(e);return i},t.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},t.extension={name:"interaction",type:[Hr.RendererPlugin,Hr.CanvasRendererPlugin]},t}(xn);function hn(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hu={exports:{}};/*! - localForage -- Offline Storage, Improved - Version 1.10.0 - https://localforage.github.io/localForage - (c) 2013-2017 Mozilla, Apache License 2.0 -*/var up;function xI(){return up||(up=1,function(r,t){(function(e){r.exports=e()})(function(){return function e(i,n,s){function o(u,c){if(!n[u]){if(!i[u]){var h=typeof hn=="function"&&hn;if(!c&&h)return h(u,!0);if(a)return a(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var f=n[u]={exports:{}};i[u][0].call(f.exports,function(y){var g=i[u][1][y];return o(g||y)},f,f.exports,e,i,n,s)}return n[u].exports}for(var a=typeof hn=="function"&&hn,l=0;l"u"&&e(3);var h=Promise;function p(T,j){j&&T.then(function(P){j(null,P)},function(P){j(P)})}function f(T,j,P){typeof j=="function"&&T.then(j),typeof P=="function"&&T.catch(P)}function y(T){return typeof T!="string"&&(console.warn(T+" used as a key, but it is not a string."),T=String(T)),T}function g(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",m=void 0,_={},S=Object.prototype.toString,E="readonly",b="readwrite";function F(T){for(var j=T.length,P=new ArrayBuffer(j),Y=new Uint8Array(P),Q=0;Q=43)}}).catch(function(){return!1})}function z(T){return typeof m=="boolean"?h.resolve(m):x(T).then(function(j){return m=j,m})}function B(T){var j=_[T.name],P={};P.promise=new h(function(Y,Q){P.resolve=Y,P.reject=Q}),j.deferredOperations.push(P),j.dbReady?j.dbReady=j.dbReady.then(function(){return P.promise}):j.dbReady=P.promise}function tt(T){var j=_[T.name],P=j.deferredOperations.pop();if(P)return P.resolve(),P.promise}function st(T,j){var P=_[T.name],Y=P.deferredOperations.pop();if(Y)return Y.reject(j),Y.promise}function I(T,j){return new h(function(P,Y){if(_[T.name]=_[T.name]||A(),T.db)if(j)B(T),T.db.close();else return P(T.db);var Q=[T.name];j&&Q.push(T.version);var G=l.open.apply(l,Q);j&&(G.onupgradeneeded=function(nt){var ut=G.result;try{ut.createObjectStore(T.storeName),nt.oldVersion<=1&&ut.createObjectStore(d)}catch(ct){if(ct.name==="ConstraintError")console.warn('The database "'+T.name+'" has been upgraded from version '+nt.oldVersion+" to version "+nt.newVersion+', but the storage "'+T.storeName+'" already exists.');else throw ct}}),G.onerror=function(nt){nt.preventDefault(),Y(G.error)},G.onsuccess=function(){var nt=G.result;nt.onversionchange=function(ut){ut.target.close()},P(nt),tt(T)}})}function Z(T){return I(T,!1)}function w(T){return I(T,!0)}function it(T,j){if(!T.db)return!0;var P=!T.db.objectStoreNames.contains(T.storeName),Y=T.versionT.db.version;if(Y&&(T.version!==j&&console.warn('The database "'+T.name+`" can't be downgraded from version `+T.db.version+" to version "+T.version+"."),T.version=T.db.version),Q||P){if(P){var G=T.db.version+1;G>T.version&&(T.version=G)}return!0}return!1}function M(T){return new h(function(j,P){var Y=new FileReader;Y.onerror=P,Y.onloadend=function(Q){var G=btoa(Q.target.result||"");j({__local_forage_encoded_blob:!0,data:G,type:T.type})},Y.readAsBinaryString(T)})}function O(T){var j=F(atob(T.data));return c([j],{type:T.type})}function D(T){return T&&T.__local_forage_encoded_blob}function U(T){var j=this,P=j._initReady().then(function(){var Y=_[j._dbInfo.name];if(Y&&Y.dbReady)return Y.dbReady});return f(P,T,T),P}function k(T){B(T);for(var j=_[T.name],P=j.forages,Y=0;Y0&&(!T.db||G.name==="InvalidStateError"||G.name==="NotFoundError"))return h.resolve().then(function(){if(!T.db||G.name==="NotFoundError"&&!T.db.objectStoreNames.contains(T.storeName)&&T.version<=T.db.version)return T.db&&(T.version=T.db.version+1),w(T)}).then(function(){return k(T).then(function(){C(T,j,P,Y-1)})}).catch(P);P(G)}}function A(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function V(T){var j=this,P={db:null};if(T)for(var Y in T)P[Y]=T[Y];var Q=_[P.name];Q||(Q=A(),_[P.name]=Q),Q.forages.push(j),j._initReady||(j._initReady=j.ready,j.ready=U);var G=[];function nt(){return h.resolve()}for(var ut=0;ut>4,mt[Q++]=(nt&15)<<4|ut>>2,mt[Q++]=(ut&3)<<6|ct&63;return ft}function tn(T){var j=new Uint8Array(T),P="",Y;for(Y=0;Y>2],P+=K[(j[Y]&3)<<4|j[Y+1]>>4],P+=K[(j[Y+1]&15)<<2|j[Y+2]>>6],P+=K[j[Y+2]&63];return j.length%3===2?P=P.substring(0,P.length-1)+"=":j.length%3===1&&(P=P.substring(0,P.length-2)+"=="),P}function co(T,j){var P="";if(T&&(P=Ji.call(T)),T&&(P==="[object ArrayBuffer]"||T.buffer&&Ji.call(T.buffer)==="[object ArrayBuffer]")){var Y,Q=R;T instanceof ArrayBuffer?(Y=T,Q+=ot):(Y=T.buffer,P==="[object Int8Array]"?Q+=rt:P==="[object Uint8Array]"?Q+=ht:P==="[object Uint8ClampedArray]"?Q+=bt:P==="[object Int16Array]"?Q+=pt:P==="[object Uint16Array]"?Q+=ye:P==="[object Int32Array]"?Q+=Ot:P==="[object Uint32Array]"?Q+=oe:P==="[object Float32Array]"?Q+=ir:P==="[object Float64Array]"?Q+=Zi:j(new Error("Failed to get type for BinaryArray"))),j(Q+tn(Y))}else if(P==="[object Blob]"){var G=new FileReader;G.onload=function(){var nt=q+T.type+"~"+tn(this.result);j(R+lt+nt)},G.readAsArrayBuffer(T)}else try{j(JSON.stringify(T))}catch(nt){console.error("Couldn't convert value into a JSON string: ",T),j(null,nt)}}function Kr(T){if(T.substring(0,X)!==R)return JSON.parse(T);var j=T.substring(vr),P=T.substring(X,vr),Y;if(P===lt&&N.test(j)){var Q=j.match(N);Y=Q[1],j=j.substring(Q[0].length)}var G=Ae(j);switch(P){case ot:return G;case lt:return c([G],{type:Y});case rt:return new Int8Array(G);case ht:return new Uint8Array(G);case bt:return new Uint8ClampedArray(G);case pt:return new Int16Array(G);case ye:return new Uint16Array(G);case Ot:return new Int32Array(G);case oe:return new Uint32Array(G);case ir:return new Float32Array(G);case Zi:return new Float64Array(G);default:throw new Error("Unkown type: "+P)}}var ps={serialize:co,deserialize:Kr,stringToBuffer:Ae,bufferToString:tn};function va(T,j,P,Y){T.executeSql("CREATE TABLE IF NOT EXISTS "+j.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],P,Y)}function pu(T){var j=this,P={db:null};if(T)for(var Y in T)P[Y]=typeof T[Y]!="string"?T[Y].toString():T[Y];var Q=new h(function(G,nt){try{P.db=openDatabase(P.name,String(P.version),P.description,P.size)}catch(ut){return nt(ut)}P.db.transaction(function(ut){va(ut,P,function(){j._dbInfo=P,G()},function(ct,ft){nt(ft)})},nt)});return P.serializer=ps,Q}function oi(T,j,P,Y,Q,G){T.executeSql(P,Y,Q,function(nt,ut){ut.code===ut.SYNTAX_ERR?nt.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[j.storeName],function(ct,ft){ft.rows.length?G(ct,ut):va(ct,j,function(){ct.executeSql(P,Y,Q,G)},G)},G):G(nt,ut)},G)}function _a(T,j){var P=this;T=y(T);var Y=new h(function(Q,G){P.ready().then(function(){var nt=P._dbInfo;nt.db.transaction(function(ut){oi(ut,nt,"SELECT * FROM "+nt.storeName+" WHERE key = ? LIMIT 1",[T],function(ct,ft){var mt=ft.rows.length?ft.rows.item(0).value:null;mt&&(mt=nt.serializer.deserialize(mt)),Q(mt)},function(ct,ft){G(ft)})})}).catch(G)});return p(Y,j),Y}function Cn(T,j){var P=this,Y=new h(function(Q,G){P.ready().then(function(){var nt=P._dbInfo;nt.db.transaction(function(ut){oi(ut,nt,"SELECT * FROM "+nt.storeName,[],function(ct,ft){for(var mt=ft.rows,Tt=mt.length,ne=0;ne0){nt(An.apply(Q,[T,ct,P,Y-1]));return}ut(ne)}})})}).catch(ut)});return p(G,P),G}function rx(T,j,P){return An.apply(this,[T,j,P,1])}function ix(T,j){var P=this;T=y(T);var Y=new h(function(Q,G){P.ready().then(function(){var nt=P._dbInfo;nt.db.transaction(function(ut){oi(ut,nt,"DELETE FROM "+nt.storeName+" WHERE key = ?",[T],function(){Q()},function(ct,ft){G(ft)})})}).catch(G)});return p(Y,j),Y}function nx(T){var j=this,P=new h(function(Y,Q){j.ready().then(function(){var G=j._dbInfo;G.db.transaction(function(nt){oi(nt,G,"DELETE FROM "+G.storeName,[],function(){Y()},function(ut,ct){Q(ct)})})}).catch(Q)});return p(P,T),P}function sx(T){var j=this,P=new h(function(Y,Q){j.ready().then(function(){var G=j._dbInfo;G.db.transaction(function(nt){oi(nt,G,"SELECT COUNT(key) as c FROM "+G.storeName,[],function(ut,ct){var ft=ct.rows.item(0).c;Y(ft)},function(ut,ct){Q(ct)})})}).catch(Q)});return p(P,T),P}function ox(T,j){var P=this,Y=new h(function(Q,G){P.ready().then(function(){var nt=P._dbInfo;nt.db.transaction(function(ut){oi(ut,nt,"SELECT key FROM "+nt.storeName+" WHERE id = ? LIMIT 1",[T+1],function(ct,ft){var mt=ft.rows.length?ft.rows.item(0).key:null;Q(mt)},function(ct,ft){G(ft)})})}).catch(G)});return p(Y,j),Y}function ax(T){var j=this,P=new h(function(Y,Q){j.ready().then(function(){var G=j._dbInfo;G.db.transaction(function(nt){oi(nt,G,"SELECT key FROM "+G.storeName,[],function(ut,ct){for(var ft=[],mt=0;mt '__WebKitDatabaseInfoTable__'",[],function(Q,G){for(var nt=[],ut=0;ut0}function px(T){var j=this,P={};if(T)for(var Y in T)P[Y]=T[Y];return P.keyPrefix=Kf(T,j._defaultConfig),dx()?(j._dbInfo=P,P.serializer=ps,h.resolve()):h.reject()}function mx(T){var j=this,P=j.ready().then(function(){for(var Y=j._dbInfo.keyPrefix,Q=localStorage.length-1;Q>=0;Q--){var G=localStorage.key(Q);G.indexOf(Y)===0&&localStorage.removeItem(G)}});return p(P,T),P}function yx(T,j){var P=this;T=y(T);var Y=P.ready().then(function(){var Q=P._dbInfo,G=localStorage.getItem(Q.keyPrefix+T);return G&&(G=Q.serializer.deserialize(G)),G});return p(Y,j),Y}function gx(T,j){var P=this,Y=P.ready().then(function(){for(var Q=P._dbInfo,G=Q.keyPrefix,nt=G.length,ut=localStorage.length,ct=1,ft=0;ft=0;nt--){var ut=localStorage.key(nt);ut.indexOf(G)===0&&localStorage.removeItem(ut)}}):Q=h.reject("Invalid arguments"),p(Q,j),Q}var Tx={_driver:"localStorageWrapper",_initStorage:px,_support:hx(),iterate:gx,getItem:yx,setItem:xx,removeItem:wx,clear:mx,length:bx,key:vx,keys:_x,dropInstance:Sx},Ix=function(j,P){return j===P||typeof j=="number"&&typeof P=="number"&&isNaN(j)&&isNaN(P)},Ex=function(j,P){for(var Y=j.length,Q=0;Q"u"?"undefined":s(P))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var Y in P){if(Y==="storeName"&&(P[Y]=P[Y].replace(/\W/g,"_")),Y==="version"&&typeof P[Y]!="number")return new Error("Database version must be a number.");this._config[Y]=P[Y]}return"driver"in P&&P.driver?this.setDriver(this._config.driver):!0}else return typeof P=="string"?this._config[P]:this._config},T.prototype.defineDriver=function(P,Y,Q){var G=new h(function(nt,ut){try{var ct=P._driver,ft=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!P._driver){ut(ft);return}for(var mt=mu.concat("_initStorage"),Tt=0,ne=mt.length;Tt 0.0) { - c.rgb /= c.a; - - vec3 rgb = pow(c.rgb, vec3(1. / gamma)); - rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast); - rgb.r *= red; - rgb.g *= green; - rgb.b *= blue; - c.rgb = rgb * brightness; - - c.rgb *= c.a; - } - - gl_FragColor = c * alpha; -} -`;(function(r){TI(t,r);function t(e){var i=r.call(this,II,EI)||this;return i.gamma=1,i.saturation=1,i.contrast=1,i.brightness=1,i.red=1,i.green=1,i.blue=1,i.alpha=1,Object.assign(i,e),i}return t.prototype.apply=function(e,i,n,s){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,i,n,s)},t})(re);/*! - * @pixi/filter-kawase-blur - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-kawase-blur is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Ic=function(r,t){return Ic=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Ic(r,t)};function CI(r,t){Ic(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var AI=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,OI=` -varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec2 uOffset; - -void main(void) -{ - vec4 color = vec4(0.0); - - // Sample top left pixel - color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y)); - - // Sample top right pixel - color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y)); - - // Sample bottom right pixel - color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y)); - - // Sample bottom left pixel - color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y)); - - // Average - color *= 0.25; - - gl_FragColor = color; -}`,FI=` -varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec2 uOffset; -uniform vec4 filterClamp; - -void main(void) -{ - vec4 color = vec4(0.0); - - // Sample top left pixel - color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw)); - - // Sample top right pixel - color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw)); - - // Sample bottom right pixel - color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw)); - - // Sample bottom left pixel - color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw)); - - // Average - color *= 0.25; - - gl_FragColor = color; -} -`,ol=function(r){CI(t,r);function t(e,i,n){e===void 0&&(e=4),i===void 0&&(i=3),n===void 0&&(n=!1);var s=r.call(this,AI,n?FI:OI)||this;return s._kernels=[],s._blur=4,s._quality=3,s.uniforms.uOffset=new Float32Array(2),s._pixelSize=new Ee,s.pixelSize=1,s._clamp=n,Array.isArray(e)?s.kernels=e:(s._blur=e,s.quality=i),s}return t.prototype.apply=function(e,i,n,s){var o=this._pixelSize.x/i._frame.width,a=this._pixelSize.y/i._frame.height,l;if(this._quality===1||this._blur===0)l=this._kernels[0]+.5,this.uniforms.uOffset[0]=l*o,this.uniforms.uOffset[1]=l*a,e.applyFilter(this,i,n,s);else{for(var u=e.getFilterTexture(),c=i,h=u,p=void 0,f=this._quality-1,y=0;y0)for(var s=e,o=e/i,a=1;a0?(this._kernels=e,this._quality=e.length,this._blur=Math.max.apply(Math,e)):(this._kernels=[0],this._quality=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clamp",{get:function(){return this._clamp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pixelSize",{get:function(){return this._pixelSize},set:function(e){typeof e=="number"?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof Ee?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"quality",{get:function(){return this._quality},set:function(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blur",{get:function(){return this._blur},set:function(e){this._blur=e,this._generateKernels()},enumerable:!1,configurable:!0}),t}(re);/*! - * @pixi/filter-advanced-bloom - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-advanced-bloom is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Ec=function(r,t){return Ec=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Ec(r,t)};function wv(r,t){Ec(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var xv=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,PI=` -uniform sampler2D uSampler; -varying vec2 vTextureCoord; - -uniform float threshold; - -void main() { - vec4 color = texture2D(uSampler, vTextureCoord); - - // A simple & fast algorithm for getting brightness. - // It's inaccuracy , but good enought for this feature. - float _max = max(max(color.r, color.g), color.b); - float _min = min(min(color.r, color.g), color.b); - float brightness = (_max + _min) * 0.5; - - if(brightness > threshold) { - gl_FragColor = color; - } else { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); - } -} -`,MI=function(r){wv(t,r);function t(e){e===void 0&&(e=.5);var i=r.call(this,xv,PI)||this;return i.threshold=e,i}return Object.defineProperty(t.prototype,"threshold",{get:function(){return this.uniforms.threshold},set:function(e){this.uniforms.threshold=e},enumerable:!1,configurable:!0}),t}(re),DI=`uniform sampler2D uSampler; -varying vec2 vTextureCoord; - -uniform sampler2D bloomTexture; -uniform float bloomScale; -uniform float brightness; - -void main() { - vec4 color = texture2D(uSampler, vTextureCoord); - color.rgb *= brightness; - vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0); - bloomColor.rgb *= bloomScale; - gl_FragColor = color + bloomColor; -} -`;(function(r){wv(t,r);function t(e){var i=r.call(this,xv,DI)||this;i.bloomScale=1,i.brightness=1,i._resolution=It.FILTER_RESOLUTION,typeof e=="number"&&(e={threshold:e});var n=Object.assign(t.defaults,e);i.bloomScale=n.bloomScale,i.brightness=n.brightness;var s=n.kernels,o=n.blur,a=n.quality,l=n.pixelSize,u=n.resolution;return i._extractFilter=new MI(n.threshold),i._extractFilter.resolution=u,i._blurFilter=s?new ol(s):new ol(o,a),i.pixelSize=l,i.resolution=u,i}return t.prototype.apply=function(e,i,n,s,o){var a=e.getFilterTexture();this._extractFilter.apply(e,i,a,1,o);var l=e.getFilterTexture();this._blurFilter.apply(e,a,l,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=l,e.applyFilter(this,i,n,s),e.returnFilterTexture(l),e.returnFilterTexture(a)},Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"threshold",{get:function(){return this._extractFilter.threshold},set:function(e){this._extractFilter.threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"kernels",{get:function(){return this._blurFilter.kernels},set:function(e){this._blurFilter.kernels=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blur",{get:function(){return this._blurFilter.blur},set:function(e){this._blurFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"quality",{get:function(){return this._blurFilter.quality},set:function(e){this._blurFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pixelSize",{get:function(){return this._blurFilter.pixelSize},set:function(e){this._blurFilter.pixelSize=e},enumerable:!1,configurable:!0}),t.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:It.FILTER_RESOLUTION},t})(re);/*! - * @pixi/filter-ascii - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-ascii is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Cc=function(r,t){return Cc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Cc(r,t)};function RI(r,t){Cc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var NI=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,LI=`varying vec2 vTextureCoord; - -uniform vec4 filterArea; -uniform float pixelSize; -uniform sampler2D uSampler; - -vec2 mapCoord( vec2 coord ) -{ - coord *= filterArea.xy; - coord += filterArea.zw; - - return coord; -} - -vec2 unmapCoord( vec2 coord ) -{ - coord -= filterArea.zw; - coord /= filterArea.xy; - - return coord; -} - -vec2 pixelate(vec2 coord, vec2 size) -{ - return floor( coord / size ) * size; -} - -vec2 getMod(vec2 coord, vec2 size) -{ - return mod( coord , size) / size; -} - -float character(float n, vec2 p) -{ - p = floor(p*vec2(4.0, -4.0) + 2.5); - - if (clamp(p.x, 0.0, 4.0) == p.x) - { - if (clamp(p.y, 0.0, 4.0) == p.y) - { - if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0; - } - } - return 0.0; -} - -void main() -{ - vec2 coord = mapCoord(vTextureCoord); - - // get the rounded color.. - vec2 pixCoord = pixelate(coord, vec2(pixelSize)); - pixCoord = unmapCoord(pixCoord); - - vec4 color = texture2D(uSampler, pixCoord); - - // determine the character to use - float gray = (color.r + color.g + color.b) / 3.0; - - float n = 65536.0; // . - if (gray > 0.2) n = 65600.0; // : - if (gray > 0.3) n = 332772.0; // * - if (gray > 0.4) n = 15255086.0; // o - if (gray > 0.5) n = 23385164.0; // & - if (gray > 0.6) n = 15252014.0; // 8 - if (gray > 0.7) n = 13199452.0; // @ - if (gray > 0.8) n = 11512810.0; // # - - // get the mod.. - vec2 modd = getMod(coord, vec2(pixelSize)); - - gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0); - -} -`;(function(r){RI(t,r);function t(e){e===void 0&&(e=8);var i=r.call(this,NI,LI)||this;return i.size=e,i}return Object.defineProperty(t.prototype,"size",{get:function(){return this.uniforms.pixelSize},set:function(e){this.uniforms.pixelSize=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-bevel - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-bevel is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Ac=function(r,t){return Ac=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Ac(r,t)};function BI(r,t){Ac(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var kI=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,UI=`precision mediump float; - -varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec4 filterArea; - -uniform float transformX; -uniform float transformY; -uniform vec3 lightColor; -uniform float lightAlpha; -uniform vec3 shadowColor; -uniform float shadowAlpha; - -void main(void) { - vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY); - vec4 color = texture2D(uSampler, vTextureCoord); - float light = texture2D(uSampler, vTextureCoord - transform).a; - float shadow = texture2D(uSampler, vTextureCoord + transform).a; - - color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0)); - color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0)); - gl_FragColor = vec4(color.rgb * color.a, color.a); -} -`;(function(r){BI(t,r);function t(e){var i=r.call(this,kI,UI)||this;return i._thickness=2,i._angle=0,i.uniforms.lightColor=new Float32Array(3),i.uniforms.shadowColor=new Float32Array(3),Object.assign(i,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),i.padding=1,i}return t.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._angle/ns},set:function(e){this._angle=e*ns,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness=e,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightColor",{get:function(){return ri(this.uniforms.lightColor)},set:function(e){Wr(e,this.uniforms.lightColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightAlpha",{get:function(){return this.uniforms.lightAlpha},set:function(e){this.uniforms.lightAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowColor",{get:function(){return ri(this.uniforms.shadowColor)},set:function(e){Wr(e,this.uniforms.shadowColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowAlpha",{get:function(){return this.uniforms.shadowAlpha},set:function(e){this.uniforms.shadowAlpha=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-alpha - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/filter-alpha is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Oc=function(r,t){return Oc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Oc(r,t)};function zI(r,t){Oc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var jI=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform float uAlpha; - -void main(void) -{ - gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha; -} -`,$I=function(r){zI(t,r);function t(e){e===void 0&&(e=1);var i=r.call(this,N1,jI,{uAlpha:1})||this;return i.alpha=e,i}return Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}(re);/*! - * @pixi/filter-blur - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/filter-blur is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Fc=function(r,t){return Fc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Fc(r,t)};function Sv(r,t){Fc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var VI=` - attribute vec2 aVertexPosition; - - uniform mat3 projectionMatrix; - - uniform float strength; - - varying vec2 vBlurTexCoords[%size%]; - - uniform vec4 inputSize; - uniform vec4 outputFrame; - - vec4 filterVertexPosition( void ) - { - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); - } - - vec2 filterTextureCoord( void ) - { - return aVertexPosition * (outputFrame.zw * inputSize.zw); - } - - void main(void) - { - gl_Position = filterVertexPosition(); - - vec2 textureCoord = filterTextureCoord(); - %blur% - }`;function GI(r,t){var e=Math.ceil(r/2),i=VI,n="",s;t?s="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":s="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var o=0;o=e&&(o=r-a-1),l=l.replace("%value%",t[o].toString()),n+=l,n+=` -`}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}var al=function(r){Sv(t,r);function t(e,i,n,s,o){i===void 0&&(i=8),n===void 0&&(n=4),s===void 0&&(s=It.FILTER_RESOLUTION),o===void 0&&(o=5);var a=this,l=GI(o,e),u=YI(o);return a=r.call(this,l,u)||this,a.horizontal=e,a.resolution=s,a._quality=0,a.quality=n,a.blur=i,a}return t.prototype.apply=function(e,i,n,s){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/i.width):this.uniforms.strength=1/n.height*(n.height/i.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/i.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/i.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,i,n,s);else{var o=e.getFilterTexture(),a=e.renderer,l=i,u=o;this.state.blend=!1,e.applyFilter(this,l,u,ti.CLEAR);for(var c=1;c 0.0) { - coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); - } else { - coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent); - } - } - coord += center * dimensions.xy; - coord /= filterArea.xy; - vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw); - vec4 color = texture2D(uSampler, clampedCoord); - if (coord != clampedCoord) { - color *= max(0.0, 1.0 - length(coord - clampedCoord)); - } - - gl_FragColor = color; -} -`;(function(r){qI(t,r);function t(e){var i=r.call(this,QI,KI)||this;return i.uniforms.dimensions=new Float32Array(2),Object.assign(i,t.defaults,e),i}return t.prototype.apply=function(e,i,n,s){var o=i.filterFrame,a=o.width,l=o.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=l,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strength",{get:function(){return this.uniforms.strength},set:function(e){this.uniforms.strength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return this.uniforms.center},set:function(e){this.uniforms.center=e},enumerable:!1,configurable:!0}),t.defaults={center:[.5,.5],radius:100,strength:1},t})(re);/*! - * @pixi/filter-color-map - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-color-map is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Dc=function(r,t){return Dc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Dc(r,t)};function ZI(r,t){Dc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var JI=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,tE=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform sampler2D colorMap; -uniform float _mix; -uniform float _size; -uniform float _sliceSize; -uniform float _slicePixelSize; -uniform float _sliceInnerSize; -void main() { - vec4 color = texture2D(uSampler, vTextureCoord.xy); - - vec4 adjusted; - if (color.a > 0.0) { - color.rgb /= color.a; - float innerWidth = _size - 1.0; - float zSlice0 = min(floor(color.b * innerWidth), innerWidth); - float zSlice1 = min(zSlice0 + 1.0, innerWidth); - float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize; - float s0 = xOffset + (zSlice0 * _sliceSize); - float s1 = xOffset + (zSlice1 * _sliceSize); - float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize); - vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset)); - vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset)); - float zOffset = fract(color.b * innerWidth); - adjusted = mix(slice0Color, slice1Color, zOffset); - - color.rgb *= color.a; - } - gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a); - -}`;(function(r){ZI(t,r);function t(e,i,n){i===void 0&&(i=!1),n===void 0&&(n=1);var s=r.call(this,JI,tE)||this;return s.mix=1,s._size=0,s._sliceSize=0,s._slicePixelSize=0,s._sliceInnerSize=0,s._nearest=!1,s._scaleMode=null,s._colorMap=null,s._scaleMode=null,s.nearest=i,s.mix=n,s.colorMap=e,s}return t.prototype.apply=function(e,i,n,s){this.uniforms._mix=this.mix,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"colorSize",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorMap",{get:function(){return this._colorMap},set:function(e){var i;e&&(e instanceof es||(e=es.from(e)),!((i=e)===null||i===void 0)&&i.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=xi.OFF,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nearest",{get:function(){return this._nearest},set:function(e){this._nearest=e,this._scaleMode=e?Ir.NEAREST:Ir.LINEAR;var i=this._colorMap;i&&i.baseTexture&&(i.baseTexture._glTextures={},i.baseTexture.scaleMode=this._scaleMode,i.baseTexture.mipmap=xi.OFF,i._updateID++,i.baseTexture.emit("update",i.baseTexture))},enumerable:!1,configurable:!0}),t.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit("update",e.baseTexture),this.colorMap=e)},t.prototype.destroy=function(e){e===void 0&&(e=!1),this._colorMap&&this._colorMap.destroy(e),r.prototype.destroy.call(this)},t})(re);/*! - * @pixi/filter-color-overlay - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-color-overlay is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Rc=function(r,t){return Rc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Rc(r,t)};function eE(r,t){Rc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var rE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,iE=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec3 color; -uniform float alpha; - -void main(void) { - vec4 currentColor = texture2D(uSampler, vTextureCoord); - gl_FragColor = vec4(mix(currentColor.rgb, color.rgb, currentColor.a * alpha), currentColor.a); -} -`;(function(r){eE(t,r);function t(e,i){e===void 0&&(e=0),i===void 0&&(i=1);var n=r.call(this,rE,iE)||this;return n._color=0,n._alpha=1,n.uniforms.color=new Float32Array(3),n.color=e,n.alpha=i,n}return Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(e){var i=this.uniforms.color;typeof e=="number"?(Wr(e,i),this._color=e):(i[0]=e[0],i[1]=e[1],i[2]=e[2],this._color=ri(i))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this._alpha},set:function(e){this.uniforms.alpha=e,this._alpha=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-color-replace - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-color-replace is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Nc=function(r,t){return Nc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Nc(r,t)};function nE(r,t){Nc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var sE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,oE=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec3 originalColor; -uniform vec3 newColor; -uniform float epsilon; -void main(void) { - vec4 currentColor = texture2D(uSampler, vTextureCoord); - vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001)); - float colorDistance = length(colorDiff); - float doReplace = step(colorDistance, epsilon); - gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a); -} -`;(function(r){nE(t,r);function t(e,i,n){e===void 0&&(e=16711680),i===void 0&&(i=0),n===void 0&&(n=.4);var s=r.call(this,sE,oE)||this;return s._originalColor=16711680,s._newColor=0,s.uniforms.originalColor=new Float32Array(3),s.uniforms.newColor=new Float32Array(3),s.originalColor=e,s.newColor=i,s.epsilon=n,s}return Object.defineProperty(t.prototype,"originalColor",{get:function(){return this._originalColor},set:function(e){var i=this.uniforms.originalColor;typeof e=="number"?(Wr(e,i),this._originalColor=e):(i[0]=e[0],i[1]=e[1],i[2]=e[2],this._originalColor=ri(i))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"newColor",{get:function(){return this._newColor},set:function(e){var i=this.uniforms.newColor;typeof e=="number"?(Wr(e,i),this._newColor=e):(i[0]=e[0],i[1]=e[1],i[2]=e[2],this._newColor=ri(i))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"epsilon",{get:function(){return this.uniforms.epsilon},set:function(e){this.uniforms.epsilon=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-convolution - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-convolution is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Lc=function(r,t){return Lc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Lc(r,t)};function aE(r,t){Lc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var lE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,uE=`precision mediump float; - -varying mediump vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform vec2 texelSize; -uniform float matrix[9]; - -void main(void) -{ - vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left - vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center - vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right - - vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left - vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center - vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right - - vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left - vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center - vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right - - gl_FragColor = - c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] + - c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] + - c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8]; - - gl_FragColor.a = c22.a; -} -`;(function(r){aE(t,r);function t(e,i,n){i===void 0&&(i=200),n===void 0&&(n=200);var s=r.call(this,lE,uE)||this;return s.uniforms.texelSize=new Float32Array(2),s.uniforms.matrix=new Float32Array(9),e!==void 0&&(s.matrix=e),s.width=i,s.height=n,s}return Object.defineProperty(t.prototype,"matrix",{get:function(){return this.uniforms.matrix},set:function(e){var i=this;e.forEach(function(n,s){i.uniforms.matrix[s]=n})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1/this.uniforms.texelSize[0]},set:function(e){this.uniforms.texelSize[0]=1/e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return 1/this.uniforms.texelSize[1]},set:function(e){this.uniforms.texelSize[1]=1/e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-cross-hatch - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-cross-hatch is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Bc=function(r,t){return Bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Bc(r,t)};function cE(r,t){Bc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var hE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,fE=`precision mediump float; - -varying vec2 vTextureCoord; - -uniform sampler2D uSampler; - -void main(void) -{ - float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb); - - gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); - - if (lum < 1.00) - { - if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) - { - gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } - - if (lum < 0.75) - { - if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) - { - gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } - - if (lum < 0.50) - { - if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) - { - gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } - - if (lum < 0.3) - { - if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) - { - gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } -} -`;(function(r){cE(t,r);function t(){return r.call(this,hE,fE)||this}return t})(re);/*! - * @pixi/filter-crt - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-crt is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var kc=function(r,t){return kc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},kc(r,t)};function dE(r,t){kc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var pE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,mE=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec4 filterArea; -uniform vec2 dimensions; - -const float SQRT_2 = 1.414213; - -const float light = 1.0; - -uniform float curvature; -uniform float lineWidth; -uniform float lineContrast; -uniform bool verticalLine; -uniform float noise; -uniform float noiseSize; - -uniform float vignetting; -uniform float vignettingAlpha; -uniform float vignettingBlur; - -uniform float seed; -uniform float time; - -float rand(vec2 co) { - return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); -} - -void main(void) -{ - vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; - vec2 dir = vec2(vTextureCoord.xy * filterArea.xy / dimensions - vec2(0.5, 0.5)); - - gl_FragColor = texture2D(uSampler, vTextureCoord); - vec3 rgb = gl_FragColor.rgb; - - if (noise > 0.0 && noiseSize > 0.0) - { - pixelCoord.x = floor(pixelCoord.x / noiseSize); - pixelCoord.y = floor(pixelCoord.y / noiseSize); - float _noise = rand(pixelCoord * noiseSize * seed) - 0.5; - rgb += _noise * noise; - } - - if (lineWidth > 0.0) - { - float _c = curvature > 0. ? curvature : 1.; - float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.; - vec2 uv = dir * k; - - float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c; - float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast; - rgb *= j; - float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.); - rgb *= 0.99 + ceil(segment) * 0.015; - } - - if (vignetting > 0.0) - { - float outter = SQRT_2 - vignetting * SQRT_2; - float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0); - rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha); - } - - gl_FragColor.rgb = rgb; -} -`;(function(r){dE(t,r);function t(e){var i=r.call(this,pE,mE)||this;return i.time=0,i.seed=0,i.uniforms.dimensions=new Float32Array(2),Object.assign(i,t.defaults,e),i}return t.prototype.apply=function(e,i,n,s){var o=i.filterFrame,a=o.width,l=o.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=l,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"curvature",{get:function(){return this.uniforms.curvature},set:function(e){this.uniforms.curvature=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineWidth",{get:function(){return this.uniforms.lineWidth},set:function(e){this.uniforms.lineWidth=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineContrast",{get:function(){return this.uniforms.lineContrast},set:function(e){this.uniforms.lineContrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalLine",{get:function(){return this.uniforms.verticalLine},set:function(e){this.uniforms.verticalLine=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.noise},set:function(e){this.uniforms.noise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noiseSize",{get:function(){return this.uniforms.noiseSize},set:function(e){this.uniforms.noiseSize=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetting",{get:function(){return this.uniforms.vignetting},set:function(e){this.uniforms.vignetting=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignettingAlpha",{get:function(){return this.uniforms.vignettingAlpha},set:function(e){this.uniforms.vignettingAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignettingBlur",{get:function(){return this.uniforms.vignettingBlur},set:function(e){this.uniforms.vignettingBlur=e},enumerable:!1,configurable:!0}),t.defaults={curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},t})(re);/*! - * @pixi/filter-dot - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-dot is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Uc=function(r,t){return Uc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Uc(r,t)};function yE(r,t){Uc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var gE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,vE=`precision mediump float; - -varying vec2 vTextureCoord; -varying vec4 vColor; - -uniform vec4 filterArea; -uniform sampler2D uSampler; - -uniform float angle; -uniform float scale; - -float pattern() -{ - float s = sin(angle), c = cos(angle); - vec2 tex = vTextureCoord * filterArea.xy; - vec2 point = vec2( - c * tex.x - s * tex.y, - s * tex.x + c * tex.y - ) * scale; - return (sin(point.x) * sin(point.y)) * 4.0; -} - -void main() -{ - vec4 color = texture2D(uSampler, vTextureCoord); - float average = (color.r + color.g + color.b) / 3.0; - gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a); -} -`;(function(r){yE(t,r);function t(e,i){e===void 0&&(e=1),i===void 0&&(i=5);var n=r.call(this,gE,vE)||this;return n.scale=e,n.angle=i,n}return Object.defineProperty(t.prototype,"scale",{get:function(){return this.uniforms.scale},set:function(e){this.uniforms.scale=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this.uniforms.angle},set:function(e){this.uniforms.angle=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-drop-shadow - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-drop-shadow is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var zc=function(r,t){return zc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},zc(r,t)};function _E(r,t){zc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var ll=function(){return ll=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n 1.0 || coord.y > 1.0) { - return; - } - - float cx = coord.x - 0.5; - float cy = (coord.y - 0.5) * aspect; - float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5; - - // displacementMap: repeat - // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny); - - // displacementMap: mirror - ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny); - - vec4 dc = texture2D(displacementMap, vec2(0.5, ny)); - - float displacement = (dc.r - dc.g) * (offset / filterArea.x); - - coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect); - - if (fillMode == CLAMP) { - coord = clamp(coord, filterClamp.xy, filterClamp.zw); - } else { - if( coord.x > filterClamp.z ) { - if (fillMode == TRANSPARENT) { - discard; - } else if (fillMode == LOOP) { - coord.x -= filterClamp.z; - } else if (fillMode == MIRROR) { - coord.x = filterClamp.z * 2.0 - coord.x; - } - } else if( coord.x < filterClamp.x ) { - if (fillMode == TRANSPARENT) { - discard; - } else if (fillMode == LOOP) { - coord.x += filterClamp.z; - } else if (fillMode == MIRROR) { - coord.x *= -filterClamp.z; - } - } - - if( coord.y > filterClamp.w ) { - if (fillMode == TRANSPARENT) { - discard; - } else if (fillMode == LOOP) { - coord.y -= filterClamp.w; - } else if (fillMode == MIRROR) { - coord.y = filterClamp.w * 2.0 - coord.y; - } - } else if( coord.y < filterClamp.y ) { - if (fillMode == TRANSPARENT) { - discard; - } else if (fillMode == LOOP) { - coord.y += filterClamp.w; - } else if (fillMode == MIRROR) { - coord.y *= -filterClamp.w; - } - } - } - - gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r; - gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g; - gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b; - gl_FragColor.a = texture2D(uSampler, coord).a; -} -`;(function(r){IE(t,r);function t(e){var i=r.call(this,EE,CE)||this;return i.offset=100,i.fillMode=t.TRANSPARENT,i.average=!1,i.seed=0,i.minSize=8,i.sampleSize=512,i._slices=0,i._offsets=new Float32Array(1),i._sizes=new Float32Array(1),i._direction=-1,i.uniforms.dimensions=new Float32Array(2),i._canvas=document.createElement("canvas"),i._canvas.width=4,i._canvas.height=i.sampleSize,i.texture=es.from(i._canvas,{scaleMode:Ir.NEAREST}),Object.assign(i,t.defaults,e),i}return t.prototype.apply=function(e,i,n,s){var o=i.filterFrame,a=o.width,l=o.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=l,this.uniforms.aspect=l/a,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,i,n,s)},t.prototype._randomizeSizes=function(){var e=this._sizes,i=this._slices-1,n=this.sampleSize,s=Math.min(this.minSize/n,.9/this._slices);if(this.average){for(var o=this._slices,a=1,l=0;l0;n--){var s=Math.random()*n>>0,o=e[n];e[n]=e[s],e[s]=o}},t.prototype._randomizeOffsets=function(){for(var e=0;e0?s:0,c=s<0?-s:0;n.fillStyle="rgba("+u+", "+c+", 0, 1)",n.fillRect(0,o>>0,e,l+1>>0),o+=l}i.baseTexture.update(),this.uniforms.displacementMap=i},Object.defineProperty(t.prototype,"sizes",{get:function(){return this._sizes},set:function(e){for(var i=Math.min(this._slices,e.length),n=0;n>0)+1},Object.defineProperty(t.prototype,"offset",{get:function(){return this.uniforms.uOffset},set:function(e){this.uniforms.uOffset=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-multi-color-replace - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-multi-color-replace is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Hc=function(r,t){return Hc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Hc(r,t)};function kE(r,t){Hc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var UE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,zE=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform float epsilon; - -const int MAX_COLORS = %maxColors%; - -uniform vec3 originalColors[MAX_COLORS]; -uniform vec3 targetColors[MAX_COLORS]; - -void main(void) -{ - gl_FragColor = texture2D(uSampler, vTextureCoord); - - float alpha = gl_FragColor.a; - if (alpha < 0.0001) - { - return; - } - - vec3 color = gl_FragColor.rgb / alpha; - - for(int i = 0; i < MAX_COLORS; i++) - { - vec3 origColor = originalColors[i]; - if (origColor.r < 0.0) - { - break; - } - vec3 colorDiff = origColor - color; - if (length(colorDiff) < epsilon) - { - vec3 targetColor = targetColors[i]; - gl_FragColor = vec4((targetColor + colorDiff) * alpha, alpha); - return; - } - } -} -`;(function(r){kE(t,r);function t(e,i,n){i===void 0&&(i=.05),n===void 0&&(n=e.length);var s=r.call(this,UE,zE.replace(/%maxColors%/g,n.toFixed(0)))||this;return s._replacements=[],s._maxColors=0,s.epsilon=i,s._maxColors=n,s.uniforms.originalColors=new Float32Array(n*3),s.uniforms.targetColors=new Float32Array(n*3),s.replacements=e,s}return Object.defineProperty(t.prototype,"replacements",{get:function(){return this._replacements},set:function(e){var i=this.uniforms.originalColors,n=this.uniforms.targetColors,s=e.length;if(s>this._maxColors)throw new Error("Length of replacements ("+s+") exceeds the maximum colors length ("+this._maxColors+")");i[s*3]=-1;for(var o=0;o 0.5) then: 1 - 2 * (1 - dst) * (1 - src) - return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)), - (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)), - (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z))); -} - - -void main() -{ - gl_FragColor = texture2D(uSampler, vTextureCoord); - vec3 color = gl_FragColor.rgb; - - if (sepia > 0.0) - { - float gray = (color.x + color.y + color.z) / 3.0; - vec3 grayscale = vec3(gray); - - color = Overlay(SEPIA_RGB, grayscale); - - color = grayscale + sepia * (color - grayscale); - } - - vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy; - - if (vignetting > 0.0) - { - float outter = SQRT_2 - vignetting * SQRT_2; - vec2 dir = vec2(vec2(0.5, 0.5) - coord); - dir.y *= dimensions.y / dimensions.x; - float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0); - color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha); - } - - if (scratchDensity > seed && scratch != 0.0) - { - float phase = seed * 256.0; - float s = mod(floor(phase), 2.0); - float dist = 1.0 / scratchDensity; - float d = distance(coord, vec2(seed * dist, abs(s - seed * dist))); - if (d < seed * 0.6 + 0.4) - { - highp float period = scratchDensity * 10.0; - - float xx = coord.x * period + phase; - float aa = abs(mod(xx, 0.5) * 4.0); - float bb = mod(floor(xx / 0.5), 2.0); - float yy = (1.0 - bb) * aa + bb * (2.0 - aa); - - float kk = 2.0 * period; - float dw = scratchWidth / dimensions.x * (0.75 + seed); - float dh = dw * kk; - - float tine = (yy - (2.0 - dh)); - - if (tine > 0.0) { - float _sign = sign(scratch); - - tine = s * tine / period + scratch + 0.1; - tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5); - - color.rgb *= tine; - } - } - } - - if (noise > 0.0 && noiseSize > 0.0) - { - vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; - pixelCoord.x = floor(pixelCoord.x / noiseSize); - pixelCoord.y = floor(pixelCoord.y / noiseSize); - // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0); - // float _noise = snoise(d) * 0.5; - float _noise = rand(pixelCoord * noiseSize * seed) - 0.5; - color += _noise * noise; - } - - gl_FragColor.rgb = color; -} -`;(function(r){jE(t,r);function t(e,i){i===void 0&&(i=0);var n=r.call(this,$E,VE)||this;return n.seed=0,n.uniforms.dimensions=new Float32Array(2),typeof e=="number"?(n.seed=e,e=void 0):n.seed=i,Object.assign(n,t.defaults,e),n}return t.prototype.apply=function(e,i,n,s){var o,a;this.uniforms.dimensions[0]=(o=i.filterFrame)===null||o===void 0?void 0:o.width,this.uniforms.dimensions[1]=(a=i.filterFrame)===null||a===void 0?void 0:a.height,this.uniforms.seed=this.seed,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"sepia",{get:function(){return this.uniforms.sepia},set:function(e){this.uniforms.sepia=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.noise},set:function(e){this.uniforms.noise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noiseSize",{get:function(){return this.uniforms.noiseSize},set:function(e){this.uniforms.noiseSize=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scratch",{get:function(){return this.uniforms.scratch},set:function(e){this.uniforms.scratch=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scratchDensity",{get:function(){return this.uniforms.scratchDensity},set:function(e){this.uniforms.scratchDensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scratchWidth",{get:function(){return this.uniforms.scratchWidth},set:function(e){this.uniforms.scratchWidth=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetting",{get:function(){return this.uniforms.vignetting},set:function(e){this.uniforms.vignetting=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignettingAlpha",{get:function(){return this.uniforms.vignettingAlpha},set:function(e){this.uniforms.vignettingAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignettingBlur",{get:function(){return this.uniforms.vignettingBlur},set:function(e){this.uniforms.vignettingBlur=e},enumerable:!1,configurable:!0}),t.defaults={sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},t})(re);/*! - * @pixi/filter-outline - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-outline is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Xc=function(r,t){return Xc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Xc(r,t)};function GE(r,t){Xc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var WE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,HE=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec2 thickness; -uniform vec4 outlineColor; -uniform vec4 filterClamp; - -const float DOUBLE_PI = 3.14159265358979323846264 * 2.; - -void main(void) { - vec4 ownColor = texture2D(uSampler, vTextureCoord); - vec4 curColor; - float maxAlpha = 0.; - vec2 displaced; - for (float angle = 0.; angle <= DOUBLE_PI; angle += \${angleStep}) { - displaced.x = vTextureCoord.x + thickness.x * cos(angle); - displaced.y = vTextureCoord.y + thickness.y * sin(angle); - curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw)); - maxAlpha = max(maxAlpha, curColor.a); - } - float resultAlpha = max(maxAlpha, ownColor.a); - gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha); -} -`;(function(r){GE(t,r);function t(e,i,n){e===void 0&&(e=1),i===void 0&&(i=0),n===void 0&&(n=.1);var s=r.call(this,WE,HE.replace(/\$\{angleStep\}/,t.getAngleStep(n)))||this;return s._thickness=1,s.uniforms.thickness=new Float32Array([0,0]),s.uniforms.outlineColor=new Float32Array([0,0,0,1]),Object.assign(s,{thickness:e,color:i,quality:n}),s}return t.getAngleStep=function(e){var i=Math.max(e*t.MAX_SAMPLES,t.MIN_SAMPLES);return(Math.PI*2/i).toFixed(7)},t.prototype.apply=function(e,i,n,s){this.uniforms.thickness[0]=this._thickness/i._frame.width,this.uniforms.thickness[1]=this._thickness/i._frame.height,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"color",{get:function(){return ri(this.uniforms.outlineColor)},set:function(e){Wr(e,this.uniforms.outlineColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness=e,this.padding=e},enumerable:!1,configurable:!0}),t.MIN_SAMPLES=1,t.MAX_SAMPLES=100,t})(re);/*! - * @pixi/filter-pixelate - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-pixelate is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var qc=function(r,t){return qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},qc(r,t)};function YE(r,t){qc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var XE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,qE=`precision mediump float; - -varying vec2 vTextureCoord; - -uniform vec2 size; -uniform sampler2D uSampler; - -uniform vec4 filterArea; - -vec2 mapCoord( vec2 coord ) -{ - coord *= filterArea.xy; - coord += filterArea.zw; - - return coord; -} - -vec2 unmapCoord( vec2 coord ) -{ - coord -= filterArea.zw; - coord /= filterArea.xy; - - return coord; -} - -vec2 pixelate(vec2 coord, vec2 size) -{ - return floor( coord / size ) * size; -} - -void main(void) -{ - vec2 coord = mapCoord(vTextureCoord); - - coord = pixelate(coord, size); - - coord = unmapCoord(coord); - - gl_FragColor = texture2D(uSampler, coord); -} -`;(function(r){YE(t,r);function t(e){e===void 0&&(e=10);var i=r.call(this,XE,qE)||this;return i.size=e,i}return Object.defineProperty(t.prototype,"size",{get:function(){return this.uniforms.size},set:function(e){typeof e=="number"&&(e=[e,e]),this.uniforms.size=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-radial-blur - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-radial-blur is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Qc=function(r,t){return Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Qc(r,t)};function QE(r,t){Qc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var KE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,ZE=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec4 filterArea; - -uniform float uRadian; -uniform vec2 uCenter; -uniform float uRadius; -uniform int uKernelSize; - -const int MAX_KERNEL_SIZE = 2048; - -void main(void) -{ - vec4 color = texture2D(uSampler, vTextureCoord); - - if (uKernelSize == 0) - { - gl_FragColor = color; - return; - } - - float aspect = filterArea.y / filterArea.x; - vec2 center = uCenter.xy / filterArea.xy; - float gradient = uRadius / filterArea.x * 0.3; - float radius = uRadius / filterArea.x - gradient * 0.5; - int k = uKernelSize - 1; - - vec2 coord = vTextureCoord; - vec2 dir = vec2(center - coord); - float dist = length(vec2(dir.x, dir.y * aspect)); - - float radianStep = uRadian; - if (radius >= 0.0 && dist > radius) { - float delta = dist - radius; - float gap = gradient; - float scale = 1.0 - abs(delta / gap); - if (scale <= 0.0) { - gl_FragColor = color; - return; - } - radianStep *= scale; - } - radianStep /= float(k); - - float s = sin(radianStep); - float c = cos(radianStep); - mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c)); - - for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) { - if (i == k) { - break; - } - - coord -= center; - coord.y *= aspect; - coord = rotationMatrix * coord; - coord.y /= aspect; - coord += center; - - vec4 sample = texture2D(uSampler, coord); - - // switch to pre-multiplied alpha to correctly blur transparent images - // sample.rgb *= sample.a; - - color += sample; - } - - gl_FragColor = color / float(uKernelSize); -} -`;(function(r){QE(t,r);function t(e,i,n,s){e===void 0&&(e=0),i===void 0&&(i=[0,0]),n===void 0&&(n=5),s===void 0&&(s=-1);var o=r.call(this,KE,ZE)||this;return o._angle=0,o.angle=e,o.center=i,o.kernelSize=n,o.radius=s,o}return t.prototype.apply=function(e,i,n,s){this.uniforms.uKernelSize=this._angle!==0?this.kernelSize:0,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-reflection - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-reflection is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Kc=function(r,t){return Kc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Kc(r,t)};function JE(r,t){Kc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var tC=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,eC=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; - -uniform vec4 filterArea; -uniform vec4 filterClamp; -uniform vec2 dimensions; - -uniform bool mirror; -uniform float boundary; -uniform vec2 amplitude; -uniform vec2 waveLength; -uniform vec2 alpha; -uniform float time; - -float rand(vec2 co) { - return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); -} - -void main(void) -{ - vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; - vec2 coord = pixelCoord / dimensions; - - if (coord.y < boundary) { - gl_FragColor = texture2D(uSampler, vTextureCoord); - return; - } - - float k = (coord.y - boundary) / (1. - boundary + 0.0001); - float areaY = boundary * dimensions.y / filterArea.y; - float v = areaY + areaY - vTextureCoord.y; - float y = mirror ? v : vTextureCoord.y; - - float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x; - float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y; - float _alpha = (alpha.y - alpha.x) * k + alpha.x; - - float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude; - x = clamp(x, filterClamp.x, filterClamp.z); - - vec4 color = texture2D(uSampler, vec2(x, y)); - - gl_FragColor = color * _alpha; -} -`;(function(r){JE(t,r);function t(e){var i=r.call(this,tC,eC)||this;return i.time=0,i.uniforms.amplitude=new Float32Array(2),i.uniforms.waveLength=new Float32Array(2),i.uniforms.alpha=new Float32Array(2),i.uniforms.dimensions=new Float32Array(2),Object.assign(i,t.defaults,e),i}return t.prototype.apply=function(e,i,n,s){var o,a;this.uniforms.dimensions[0]=(o=i.filterFrame)===null||o===void 0?void 0:o.width,this.uniforms.dimensions[1]=(a=i.filterFrame)===null||a===void 0?void 0:a.height,this.uniforms.time=this.time,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"mirror",{get:function(){return this.uniforms.mirror},set:function(e){this.uniforms.mirror=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"boundary",{get:function(){return this.uniforms.boundary},set:function(e){this.uniforms.boundary=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"amplitude",{get:function(){return this.uniforms.amplitude},set:function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"waveLength",{get:function(){return this.uniforms.waveLength},set:function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.alpha},set:function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},enumerable:!1,configurable:!0}),t.defaults={mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},t})(re);/*! - * @pixi/filter-rgb-split - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-rgb-split is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Zc=function(r,t){return Zc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Zc(r,t)};function rC(r,t){Zc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var iC=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,nC=`precision mediump float; - -varying vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform vec4 filterArea; -uniform vec2 red; -uniform vec2 green; -uniform vec2 blue; - -void main(void) -{ - gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r; - gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g; - gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b; - gl_FragColor.a = texture2D(uSampler, vTextureCoord).a; -} -`;(function(r){rC(t,r);function t(e,i,n){e===void 0&&(e=[-10,0]),i===void 0&&(i=[0,10]),n===void 0&&(n=[0,0]);var s=r.call(this,iC,nC)||this;return s.red=e,s.green=i,s.blue=n,s}return Object.defineProperty(t.prototype,"red",{get:function(){return this.uniforms.red},set:function(e){this.uniforms.red=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"green",{get:function(){return this.uniforms.green},set:function(e){this.uniforms.green=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blue",{get:function(){return this.uniforms.blue},set:function(e){this.uniforms.blue=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-shockwave - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-shockwave is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Jc=function(r,t){return Jc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Jc(r,t)};function sC(r,t){Jc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var oC=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,aC=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform vec4 filterArea; -uniform vec4 filterClamp; - -uniform vec2 center; - -uniform float amplitude; -uniform float wavelength; -// uniform float power; -uniform float brightness; -uniform float speed; -uniform float radius; - -uniform float time; - -const float PI = 3.14159; - -void main() -{ - float halfWavelength = wavelength * 0.5 / filterArea.x; - float maxRadius = radius / filterArea.x; - float currentRadius = time * speed / filterArea.x; - - float fade = 1.0; - - if (maxRadius > 0.0) { - if (currentRadius > maxRadius) { - gl_FragColor = texture2D(uSampler, vTextureCoord); - return; - } - fade = 1.0 - pow(currentRadius / maxRadius, 2.0); - } - - vec2 dir = vec2(vTextureCoord - center / filterArea.xy); - dir.y *= filterArea.y / filterArea.x; - float dist = length(dir); - - if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) { - gl_FragColor = texture2D(uSampler, vTextureCoord); - return; - } - - vec2 diffUV = normalize(dir); - - float diff = (dist - currentRadius) / halfWavelength; - - float p = 1.0 - pow(abs(diff), 2.0); - - // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade ); - float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade ); - - vec2 offset = diffUV * powDiff / filterArea.xy; - - // Do clamp : - vec2 coord = vTextureCoord + offset; - vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw); - vec4 color = texture2D(uSampler, clampedCoord); - if (coord != clampedCoord) { - color *= max(0.0, 1.0 - length(coord - clampedCoord)); - } - - // No clamp : - // gl_FragColor = texture2D(uSampler, vTextureCoord + offset); - - color.rgb *= 1.0 + (brightness - 1.0) * p * fade; - - gl_FragColor = color; -} -`;(function(r){sC(t,r);function t(e,i,n){e===void 0&&(e=[0,0]),n===void 0&&(n=0);var s=r.call(this,oC,aC)||this;return s.center=e,Object.assign(s,t.defaults,i),s.time=n,s}return t.prototype.apply=function(e,i,n,s){this.uniforms.time=this.time,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"center",{get:function(){return this.uniforms.center},set:function(e){this.uniforms.center=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"amplitude",{get:function(){return this.uniforms.amplitude},set:function(e){this.uniforms.amplitude=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wavelength",{get:function(){return this.uniforms.wavelength},set:function(e){this.uniforms.wavelength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"brightness",{get:function(){return this.uniforms.brightness},set:function(e){this.uniforms.brightness=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this.uniforms.speed},set:function(e){this.uniforms.speed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),t.defaults={amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t})(re);/*! - * @pixi/filter-simple-lightmap - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-simple-lightmap is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var th=function(r,t){return th=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},th(r,t)};function lC(r,t){th(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var uC=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,cC=`varying vec2 vTextureCoord; -uniform sampler2D uSampler; -uniform sampler2D uLightmap; -uniform vec4 filterArea; -uniform vec2 dimensions; -uniform vec4 ambientColor; -void main() { - vec4 diffuseColor = texture2D(uSampler, vTextureCoord); - vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions; - vec4 light = texture2D(uLightmap, lightCoord); - vec3 ambient = ambientColor.rgb * ambientColor.a; - vec3 intensity = ambient + light.rgb; - vec3 finalColor = diffuseColor.rgb * intensity; - gl_FragColor = vec4(finalColor, diffuseColor.a); -} -`;(function(r){lC(t,r);function t(e,i,n){i===void 0&&(i=0),n===void 0&&(n=1);var s=r.call(this,uC,cC)||this;return s._color=0,s.uniforms.dimensions=new Float32Array(2),s.uniforms.ambientColor=new Float32Array([0,0,0,n]),s.texture=e,s.color=i,s}return t.prototype.apply=function(e,i,n,s){var o,a;this.uniforms.dimensions[0]=(o=i.filterFrame)===null||o===void 0?void 0:o.width,this.uniforms.dimensions[1]=(a=i.filterFrame)===null||a===void 0?void 0:a.height,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"texture",{get:function(){return this.uniforms.uLightmap},set:function(e){this.uniforms.uLightmap=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(e){var i=this.uniforms.ambientColor;typeof e=="number"?(Wr(e,i),this._color=e):(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],this._color=ri(i))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.ambientColor[3]},set:function(e){this.uniforms.ambientColor[3]=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-tilt-shift - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-tilt-shift is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var eh=function(r,t){return eh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},eh(r,t)};function eu(r,t){eh(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var hC=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,fC=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform float blur; -uniform float gradientBlur; -uniform vec2 start; -uniform vec2 end; -uniform vec2 delta; -uniform vec2 texSize; - -float random(vec3 scale, float seed) -{ - return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed); -} - -void main(void) -{ - vec4 color = vec4(0.0); - float total = 0.0; - - float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); - vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x)); - float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur; - - for (float t = -30.0; t <= 30.0; t++) - { - float percent = (t + offset - 0.5) / 30.0; - float weight = 1.0 - abs(percent); - vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius); - sample.rgb *= sample.a; - color += sample * weight; - total += weight; - } - - color /= total; - color.rgb /= color.a + 0.00001; - - gl_FragColor = color; -} -`,Tv=function(r){eu(t,r);function t(e,i,n,s){e===void 0&&(e=100),i===void 0&&(i=600);var o=r.call(this,hC,fC)||this;return o.uniforms.blur=e,o.uniforms.gradientBlur=i,o.uniforms.start=n||new Ee(0,window.innerHeight/2),o.uniforms.end=s||new Ee(600,window.innerHeight/2),o.uniforms.delta=new Ee(30,30),o.uniforms.texSize=new Ee(window.innerWidth,window.innerHeight),o.updateDelta(),o}return t.prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},Object.defineProperty(t.prototype,"blur",{get:function(){return this.uniforms.blur},set:function(e){this.uniforms.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gradientBlur",{get:function(){return this.uniforms.gradientBlur},set:function(e){this.uniforms.gradientBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"start",{get:function(){return this.uniforms.start},set:function(e){this.uniforms.start=e,this.updateDelta()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.uniforms.end},set:function(e){this.uniforms.end=e,this.updateDelta()},enumerable:!1,configurable:!0}),t}(re),dC=function(r){eu(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,i=this.uniforms.end.y-this.uniforms.start.y,n=Math.sqrt(e*e+i*i);this.uniforms.delta.x=e/n,this.uniforms.delta.y=i/n},t}(Tv),pC=function(r){eu(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,i=this.uniforms.end.y-this.uniforms.start.y,n=Math.sqrt(e*e+i*i);this.uniforms.delta.x=-i/n,this.uniforms.delta.y=e/n},t}(Tv);(function(r){eu(t,r);function t(e,i,n,s){e===void 0&&(e=100),i===void 0&&(i=600);var o=r.call(this)||this;return o.tiltShiftXFilter=new dC(e,i,n,s),o.tiltShiftYFilter=new pC(e,i,n,s),o}return t.prototype.apply=function(e,i,n,s){var o=e.getFilterTexture();this.tiltShiftXFilter.apply(e,i,o,1),this.tiltShiftYFilter.apply(e,o,n,s),e.returnFilterTexture(o)},Object.defineProperty(t.prototype,"blur",{get:function(){return this.tiltShiftXFilter.blur},set:function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gradientBlur",{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"start",{get:function(){return this.tiltShiftXFilter.start},set:function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.tiltShiftXFilter.end},set:function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},enumerable:!1,configurable:!0}),t})(re);/*! - * @pixi/filter-twist - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-twist is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var rh=function(r,t){return rh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},rh(r,t)};function mC(r,t){rh(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var yC=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,gC=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; -uniform float radius; -uniform float angle; -uniform vec2 offset; -uniform vec4 filterArea; - -vec2 mapCoord( vec2 coord ) -{ - coord *= filterArea.xy; - coord += filterArea.zw; - - return coord; -} - -vec2 unmapCoord( vec2 coord ) -{ - coord -= filterArea.zw; - coord /= filterArea.xy; - - return coord; -} - -vec2 twist(vec2 coord) -{ - coord -= offset; - - float dist = length(coord); - - if (dist < radius) - { - float ratioDist = (radius - dist) / radius; - float angleMod = ratioDist * ratioDist * angle; - float s = sin(angleMod); - float c = cos(angleMod); - coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c); - } - - coord += offset; - - return coord; -} - -void main(void) -{ - - vec2 coord = mapCoord(vTextureCoord); - - coord = twist(coord); - - coord = unmapCoord(coord); - - gl_FragColor = texture2D(uSampler, coord ); - -} -`;(function(r){mC(t,r);function t(e){var i=r.call(this,yC,gC)||this;return Object.assign(i,t.defaults,e),i}return Object.defineProperty(t.prototype,"offset",{get:function(){return this.uniforms.offset},set:function(e){this.uniforms.offset=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this.uniforms.angle},set:function(e){this.uniforms.angle=e},enumerable:!1,configurable:!0}),t.defaults={radius:200,angle:4,padding:20,offset:new Ee},t})(re);/*! - * @pixi/filter-zoom-blur - v4.2.0 - * Compiled Fri, 05 Aug 2022 19:53:35 UTC - * - * @pixi/filter-zoom-blur is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var ih=function(r,t){return ih=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},ih(r,t)};function vC(r,t){ih(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function _C(r,t){var e={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&t.indexOf(i)<0&&(e[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n= 0.0 && dist > radius) { // radius < 0 means it's infinity - delta = dist - radius; - gap = gradient; - } - - if (delta > 0.0) { - float normalCount = gap / filterArea.x; - delta = (normalCount - delta) / normalCount; - countLimit *= delta; - strength *= delta; - if (countLimit < 1.0) - { - gl_FragColor = texture2D(uSampler, vTextureCoord); - return; - } - } - - // randomize the lookup values to hide the fixed number of samples - float offset = rand(vTextureCoord, 0.0); - - float total = 0.0; - vec4 color = vec4(0.0); - - dir *= strength; - - for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) { - float percent = (t + offset) / MAX_KERNEL_SIZE; - float weight = 4.0 * (percent - percent * percent); - vec2 p = vTextureCoord + dir * percent; - vec4 sample = texture2D(uSampler, p); - - // switch to pre-multiplied alpha to correctly blur transparent images - // sample.rgb *= sample.a; - - color += sample * weight; - total += weight; - - if (t > countLimit){ - break; - } - } - - color /= total; - // switch back from pre-multiplied alpha - // color.rgb /= color.a + 0.00001; - - gl_FragColor = color; -} -`;(function(r){vC(t,r);function t(e){var i=this,n=Object.assign(t.defaults,e),s=n.maxKernelSize,o=_C(n,["maxKernelSize"]);return i=r.call(this,bC,wC.replace("${maxKernelSize}",s.toFixed(1)))||this,Object.assign(i,o),i}return Object.defineProperty(t.prototype,"center",{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strength",{get:function(){return this.uniforms.uStrength},set:function(e){this.uniforms.uStrength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"innerRadius",{get:function(){return this.uniforms.uInnerRadius},set:function(e){this.uniforms.uInnerRadius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),t.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32},t})(re);var Yu={exports:{}};/*! - -JSZip v3.10.1 - A JavaScript class for generating and reading zip files - - -(c) 2009-2016 Stuart Knightley -Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. - -JSZip uses the library pako released under the MIT license : -https://github.com/nodeca/pako/blob/main/LICENSE -*/var cp;function xC(){return cp||(cp=1,function(r,t){(function(e){r.exports=e()})(function(){return function e(i,n,s){function o(u,c){if(!n[u]){if(!i[u]){var h=typeof hn=="function"&&hn;if(!c&&h)return h(u,!0);if(a)return a(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var f=n[u]={exports:{}};i[u][0].call(f.exports,function(y){var g=i[u][1][y];return o(g||y)},f,f.exports,e,i,n,s)}return n[u].exports}for(var a=typeof hn=="function"&&hn,l=0;l>2,f=(3&u)<<4|c>>4,y=1>6:64,g=2>4,c=(15&p)<<4|(f=a.indexOf(l.charAt(g++)))>>2,h=(3&f)<<6|(y=a.indexOf(l.charAt(g++))),_[d++]=u,f!==64&&(_[d++]=c),y!==64&&(_[d++]=h);return _}},{"./support":30,"./utils":32}],2:[function(e,i,n){var s=e("./external"),o=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),l=e("./stream/DataLengthProbe");function u(c,h,p,f,y){this.compressedSize=c,this.uncompressedSize=h,this.crc32=p,this.compression=f,this.compressedContent=y}u.prototype={getContentWorker:function(){var c=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),h=this;return c.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),c},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(c,h,p){return c.pipe(new a).pipe(new l("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",h)},i.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,i,n){var s=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,i,n){var s=e("./utils"),o=function(){for(var a,l=[],u=0;u<256;u++){a=u;for(var c=0;c<8;c++)a=1&a?3988292384^a>>>1:a>>>1;l[u]=a}return l}();i.exports=function(a,l){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(u,c,h,p){var f=o,y=p+h;u^=-1;for(var g=p;g>>8^f[255&(u^c[g])];return-1^u}(0|l,a,a.length,0):function(u,c,h,p){var f=o,y=p+h;u^=-1;for(var g=p;g>>8^f[255&(u^c.charCodeAt(g))];return-1^u}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(e,i,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,i,n){var s=null;s=typeof Promise<"u"?Promise:e("lie"),i.exports={Promise:s}},{lie:37}],7:[function(e,i,n){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=e("pako"),a=e("./utils"),l=e("./stream/GenericWorker"),u=s?"uint8array":"array";function c(h,p){l.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}n.magic="\b\0",a.inherits(c,l),c.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,h.data),!1)},c.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},n.compressWorker=function(h){return new c("Deflate",h)},n.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,i,n){function s(f,y){var g,d="";for(g=0;g>>=8;return d}function o(f,y,g,d,m,_){var S,E,b=f.file,F=f.compression,x=_!==u.utf8encode,z=a.transformTo("string",_(b.name)),B=a.transformTo("string",u.utf8encode(b.name)),tt=b.comment,st=a.transformTo("string",_(tt)),I=a.transformTo("string",u.utf8encode(tt)),Z=B.length!==b.name.length,w=I.length!==tt.length,it="",M="",O="",D=b.dir,U=b.date,k={crc32:0,compressedSize:0,uncompressedSize:0};y&&!g||(k.crc32=f.crc32,k.compressedSize=f.compressedSize,k.uncompressedSize=f.uncompressedSize);var C=0;y&&(C|=8),x||!Z&&!w||(C|=2048);var A=0,V=0;D&&(A|=16),m==="UNIX"?(V=798,A|=function(J,yt){var vt=J;return J||(vt=yt?16893:33204),(65535&vt)<<16}(b.unixPermissions,D)):(V=20,A|=function(J){return 63&(J||0)}(b.dosPermissions)),S=U.getUTCHours(),S<<=6,S|=U.getUTCMinutes(),S<<=5,S|=U.getUTCSeconds()/2,E=U.getUTCFullYear()-1980,E<<=4,E|=U.getUTCMonth()+1,E<<=5,E|=U.getUTCDate(),Z&&(M=s(1,1)+s(c(z),4)+B,it+="up"+s(M.length,2)+M),w&&(O=s(1,1)+s(c(st),4)+I,it+="uc"+s(O.length,2)+O);var et="";return et+=` -\0`,et+=s(C,2),et+=F.magic,et+=s(S,2),et+=s(E,2),et+=s(k.crc32,4),et+=s(k.compressedSize,4),et+=s(k.uncompressedSize,4),et+=s(z.length,2),et+=s(it.length,2),{fileRecord:h.LOCAL_FILE_HEADER+et+z+it,dirRecord:h.CENTRAL_FILE_HEADER+s(V,2)+et+s(st.length,2)+"\0\0\0\0"+s(A,4)+s(d,4)+z+it+st}}var a=e("../utils"),l=e("../stream/GenericWorker"),u=e("../utf8"),c=e("../crc32"),h=e("../signature");function p(f,y,g,d){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=g,this.encodeFileName=d,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(f){var y=f.meta.percent||0,g=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(y+100*(g-d-1))/g:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var y=this.streamFiles&&!f.file.dir;if(y){var g=o(f,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(f){this.accumulate=!1;var y=this.streamFiles&&!f.file.dir,g=o(f,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),y)this.push({data:function(d){return h.DATA_DESCRIPTOR+s(d.crc32,4)+s(d.compressedSize,4)+s(d.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var f=this.bytesWritten,y=0;y=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},i.exports=o},{"../utils":32}],19:[function(e,i,n){var s=e("./Uint8ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,i,n){var s=e("./DataReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./DataReader":18}],21:[function(e,i,n){var s=e("./ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(e,i,n){var s=e("../utils"),o=e("../support"),a=e("./ArrayReader"),l=e("./StringReader"),u=e("./NodeBufferReader"),c=e("./Uint8ArrayReader");i.exports=function(h){var p=s.getTypeOf(h);return s.checkSupport(p),p!=="string"||o.uint8array?p==="nodebuffer"?new u(h):o.uint8array?new c(s.transformTo("uint8array",h)):new a(s.transformTo("array",h)):new l(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,i,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,i,n){var s=e("./GenericWorker"),o=e("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},i.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,i,n){var s=e("./GenericWorker"),o=e("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},i.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},i.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(c){u.dataIsReady=!0,u.data=c,u.max=c&&c.length||0,u.type=s.getTypeOf(c),u.isPaused||u._tickAndRepeat()},function(c){u.error(c)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,i,n){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},i.exports=s},{}],29:[function(e,i,n){var s=e("../utils"),o=e("./ConvertWorker"),a=e("./GenericWorker"),l=e("../base64"),u=e("../support"),c=e("../external"),h=null;if(u.nodestream)try{h=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(y,g){return new c.Promise(function(d,m){var _=[],S=y._internalType,E=y._outputType,b=y._mimeType;y.on("data",function(F,x){_.push(F),g&&g(x)}).on("error",function(F){_=[],m(F)}).on("end",function(){try{var F=function(x,z,B){switch(x){case"blob":return s.newBlob(s.transformTo("arraybuffer",z),B);case"base64":return l.encode(z);default:return s.transformTo(x,z)}}(E,function(x,z){var B,tt=0,st=null,I=0;for(B=0;B"u")n.blob=!1;else{var s=new ArrayBuffer(0);try{n.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),n.blob=o.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,i,n){for(var s=e("./utils"),o=e("./support"),a=e("./nodejsUtils"),l=e("./stream/GenericWorker"),u=new Array(256),c=0;c<256;c++)u[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;u[254]=u[254]=1;function h(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}n.utf8encode=function(f){return o.nodebuffer?a.newBufferFrom(f,"utf-8"):function(y){var g,d,m,_,S,E=y.length,b=0;for(_=0;_>>6:(d<65536?g[S++]=224|d>>>12:(g[S++]=240|d>>>18,g[S++]=128|d>>>12&63),g[S++]=128|d>>>6&63),g[S++]=128|63&d);return g}(f)},n.utf8decode=function(f){return o.nodebuffer?s.transformTo("nodebuffer",f).toString("utf-8"):function(y){var g,d,m,_,S=y.length,E=new Array(2*S);for(g=d=0;g>10&1023,E[d++]=56320|1023&m)}return E.length!==d&&(E.subarray?E=E.subarray(0,d):E.length=d),s.applyFromCharCode(E)}(f=s.transformTo(o.uint8array?"uint8array":"array",f))},s.inherits(h,l),h.prototype.processChunk=function(f){var y=s.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=y;(y=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),y.set(g,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var d=function(_,S){var E;for((S=S||_.length)>_.length&&(S=_.length),E=S-1;0<=E&&(192&_[E])==128;)E--;return E<0||E===0?S:E+u[_[E]]>S?E:S}(y),m=y;d!==y.length&&(o.uint8array?(m=y.subarray(0,d),this.leftOver=y.subarray(d,y.length)):(m=y.slice(0,d),this.leftOver=y.slice(d,y.length))),this.push({data:n.utf8decode(m),meta:f.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=h,s.inherits(p,l),p.prototype.processChunk=function(f){this.push({data:n.utf8encode(f.data),meta:f.meta})},n.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,i,n){var s=e("./support"),o=e("./base64"),a=e("./nodejsUtils"),l=e("./external");function u(g){return g}function c(g,d){for(var m=0;m>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var y,g,d,m=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?p[d++]=224|f>>>12:(p[d++]=240|f>>>18,p[d++]=128|f>>>12&63),p[d++]=128|f>>>6&63),p[d++]=128|63&f);return p},n.buf2binstring=function(h){return c(h,h.length)},n.binstring2buf=function(h){for(var p=new s.Buf8(h.length),f=0,y=p.length;f>10&1023,_[y++]=56320|1023&g)}return c(_,y)},n.utf8border=function(h,p){var f;for((p=p||h.length)>h.length&&(p=h.length),f=p-1;0<=f&&(192&h[f])==128;)f--;return f<0||f===0?p:f+l[h[f]]>p?f:p}},{"./common":41}],43:[function(e,i,n){i.exports=function(s,o,a,l){for(var u=65535&s|0,c=s>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3>>1:o>>>1;a[l]=o}return a}();i.exports=function(o,a,l,u){var c=s,h=u+l;o^=-1;for(var p=u;p>>8^c[255&(o^a[p])];return-1^o}},{}],46:[function(e,i,n){var s,o=e("../utils/common"),a=e("./trees"),l=e("./adler32"),u=e("./crc32"),c=e("./messages"),h=0,p=4,f=0,y=-2,g=-1,d=4,m=2,_=8,S=9,E=286,b=30,F=19,x=2*E+1,z=15,B=3,tt=258,st=tt+B+1,I=42,Z=113,w=1,it=2,M=3,O=4;function D(v,K){return v.msg=c[K],K}function U(v){return(v<<1)-(4v.avail_out&&(q=v.avail_out),q!==0&&(o.arraySet(v.output,K.pending_buf,K.pending_out,q,v.next_out),v.next_out+=q,K.pending_out+=q,v.total_out+=q,v.avail_out-=q,K.pending-=q,K.pending===0&&(K.pending_out=0))}function A(v,K){a._tr_flush_block(v,0<=v.block_start?v.block_start:-1,v.strstart-v.block_start,K),v.block_start=v.strstart,C(v.strm)}function V(v,K){v.pending_buf[v.pending++]=K}function et(v,K){v.pending_buf[v.pending++]=K>>>8&255,v.pending_buf[v.pending++]=255&K}function J(v,K){var q,N,R=v.max_chain_length,X=v.strstart,ot=v.prev_length,lt=v.nice_match,rt=v.strstart>v.w_size-st?v.strstart-(v.w_size-st):0,ht=v.window,bt=v.w_mask,pt=v.prev,Ot=v.strstart+tt,ye=ht[X+ot-1],oe=ht[X+ot];v.prev_length>=v.good_match&&(R>>=2),lt>v.lookahead&&(lt=v.lookahead);do if(ht[(q=K)+ot]===oe&&ht[q+ot-1]===ye&&ht[q]===ht[X]&&ht[++q]===ht[X+1]){X+=2,q++;do;while(ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&Xrt&&--R!=0);return ot<=v.lookahead?ot:v.lookahead}function yt(v){var K,q,N,R,X,ot,lt,rt,ht,bt,pt=v.w_size;do{if(R=v.window_size-v.lookahead-v.strstart,v.strstart>=pt+(pt-st)){for(o.arraySet(v.window,v.window,pt,pt,0),v.match_start-=pt,v.strstart-=pt,v.block_start-=pt,K=q=v.hash_size;N=v.head[--K],v.head[K]=pt<=N?N-pt:0,--q;);for(K=q=pt;N=v.prev[--K],v.prev[K]=pt<=N?N-pt:0,--q;);R+=pt}if(v.strm.avail_in===0)break;if(ot=v.strm,lt=v.window,rt=v.strstart+v.lookahead,ht=R,bt=void 0,bt=ot.avail_in,ht=B)for(X=v.strstart-v.insert,v.ins_h=v.window[X],v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B)if(N=a._tr_tally(v,v.strstart-v.match_start,v.match_length-B),v.lookahead-=v.match_length,v.match_length<=v.max_lazy_match&&v.lookahead>=B){for(v.match_length--;v.strstart++,v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B&&v.match_length<=v.prev_length){for(R=v.strstart+v.lookahead-B,N=a._tr_tally(v,v.strstart-1-v.prev_match,v.prev_length-B),v.lookahead-=v.prev_length-1,v.prev_length-=2;++v.strstart<=R&&(v.ins_h=(v.ins_h<v.pending_buf_size-5&&(q=v.pending_buf_size-5);;){if(v.lookahead<=1){if(yt(v),v.lookahead===0&&K===h)return w;if(v.lookahead===0)break}v.strstart+=v.lookahead,v.lookahead=0;var N=v.block_start+q;if((v.strstart===0||v.strstart>=N)&&(v.lookahead=v.strstart-N,v.strstart=N,A(v,!1),v.strm.avail_out===0)||v.strstart-v.block_start>=v.w_size-st&&(A(v,!1),v.strm.avail_out===0))return w}return v.insert=0,K===p?(A(v,!0),v.strm.avail_out===0?M:O):(v.strstart>v.block_start&&(A(v,!1),v.strm.avail_out),w)}),new _t(4,4,8,4,vt),new _t(4,5,16,8,vt),new _t(4,6,32,32,vt),new _t(4,4,16,16,dt),new _t(8,16,32,32,dt),new _t(8,16,128,128,dt),new _t(8,32,128,256,dt),new _t(32,128,258,1024,dt),new _t(32,258,258,4096,dt)],n.deflateInit=function(v,K){return he(v,K,_,15,8,0)},n.deflateInit2=he,n.deflateReset=ee,n.deflateResetKeep=Ct,n.deflateSetHeader=function(v,K){return v&&v.state?v.state.wrap!==2?y:(v.state.gzhead=K,f):y},n.deflate=function(v,K){var q,N,R,X;if(!v||!v.state||5>8&255),V(N,N.gzhead.time>>16&255),V(N,N.gzhead.time>>24&255),V(N,N.level===9?2:2<=N.strategy||N.level<2?4:0),V(N,255&N.gzhead.os),N.gzhead.extra&&N.gzhead.extra.length&&(V(N,255&N.gzhead.extra.length),V(N,N.gzhead.extra.length>>8&255)),N.gzhead.hcrc&&(v.adler=u(v.adler,N.pending_buf,N.pending,0)),N.gzindex=0,N.status=69):(V(N,0),V(N,0),V(N,0),V(N,0),V(N,0),V(N,N.level===9?2:2<=N.strategy||N.level<2?4:0),V(N,3),N.status=Z);else{var ot=_+(N.w_bits-8<<4)<<8;ot|=(2<=N.strategy||N.level<2?0:N.level<6?1:N.level===6?2:3)<<6,N.strstart!==0&&(ot|=32),ot+=31-ot%31,N.status=Z,et(N,ot),N.strstart!==0&&(et(N,v.adler>>>16),et(N,65535&v.adler)),v.adler=1}if(N.status===69)if(N.gzhead.extra){for(R=N.pending;N.gzindex<(65535&N.gzhead.extra.length)&&(N.pending!==N.pending_buf_size||(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending!==N.pending_buf_size));)V(N,255&N.gzhead.extra[N.gzindex]),N.gzindex++;N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),N.gzindex===N.gzhead.extra.length&&(N.gzindex=0,N.status=73)}else N.status=73;if(N.status===73)if(N.gzhead.name){R=N.pending;do{if(N.pending===N.pending_buf_size&&(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending===N.pending_buf_size)){X=1;break}X=N.gzindexR&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),X===0&&(N.gzindex=0,N.status=91)}else N.status=91;if(N.status===91)if(N.gzhead.comment){R=N.pending;do{if(N.pending===N.pending_buf_size&&(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending===N.pending_buf_size)){X=1;break}X=N.gzindexR&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),X===0&&(N.status=103)}else N.status=103;if(N.status===103&&(N.gzhead.hcrc?(N.pending+2>N.pending_buf_size&&C(v),N.pending+2<=N.pending_buf_size&&(V(N,255&v.adler),V(N,v.adler>>8&255),v.adler=0,N.status=Z)):N.status=Z),N.pending!==0){if(C(v),v.avail_out===0)return N.last_flush=-1,f}else if(v.avail_in===0&&U(K)<=U(q)&&K!==p)return D(v,-5);if(N.status===666&&v.avail_in!==0)return D(v,-5);if(v.avail_in!==0||N.lookahead!==0||K!==h&&N.status!==666){var lt=N.strategy===2?function(rt,ht){for(var bt;;){if(rt.lookahead===0&&(yt(rt),rt.lookahead===0)){if(ht===h)return w;break}if(rt.match_length=0,bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++,bt&&(A(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(A(rt,!0),rt.strm.avail_out===0?M:O):rt.last_lit&&(A(rt,!1),rt.strm.avail_out===0)?w:it}(N,K):N.strategy===3?function(rt,ht){for(var bt,pt,Ot,ye,oe=rt.window;;){if(rt.lookahead<=tt){if(yt(rt),rt.lookahead<=tt&&ht===h)return w;if(rt.lookahead===0)break}if(rt.match_length=0,rt.lookahead>=B&&0rt.lookahead&&(rt.match_length=rt.lookahead)}if(rt.match_length>=B?(bt=a._tr_tally(rt,1,rt.match_length-B),rt.lookahead-=rt.match_length,rt.strstart+=rt.match_length,rt.match_length=0):(bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++),bt&&(A(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(A(rt,!0),rt.strm.avail_out===0?M:O):rt.last_lit&&(A(rt,!1),rt.strm.avail_out===0)?w:it}(N,K):s[N.level].func(N,K);if(lt!==M&<!==O||(N.status=666),lt===w||lt===M)return v.avail_out===0&&(N.last_flush=-1),f;if(lt===it&&(K===1?a._tr_align(N):K!==5&&(a._tr_stored_block(N,0,0,!1),K===3&&(k(N.head),N.lookahead===0&&(N.strstart=0,N.block_start=0,N.insert=0))),C(v),v.avail_out===0))return N.last_flush=-1,f}return K!==p?f:N.wrap<=0?1:(N.wrap===2?(V(N,255&v.adler),V(N,v.adler>>8&255),V(N,v.adler>>16&255),V(N,v.adler>>24&255),V(N,255&v.total_in),V(N,v.total_in>>8&255),V(N,v.total_in>>16&255),V(N,v.total_in>>24&255)):(et(N,v.adler>>>16),et(N,65535&v.adler)),C(v),0=q.w_size&&(X===0&&(k(q.head),q.strstart=0,q.block_start=0,q.insert=0),ht=new o.Buf8(q.w_size),o.arraySet(ht,K,bt-q.w_size,q.w_size,0),K=ht,bt=q.w_size),ot=v.avail_in,lt=v.next_in,rt=v.input,v.avail_in=bt,v.next_in=0,v.input=K,yt(q);q.lookahead>=B;){for(N=q.strstart,R=q.lookahead-(B-1);q.ins_h=(q.ins_h<>>=B=z>>>24,S-=B,(B=z>>>16&255)===0)it[c++]=65535&z;else{if(!(16&B)){if((64&B)==0){z=E[(65535&z)+(_&(1<>>=B,S-=B),S<15&&(_+=w[l++]<>>=B=z>>>24,S-=B,!(16&(B=z>>>16&255))){if((64&B)==0){z=b[(65535&z)+(_&(1<>>=B,S-=B,(B=c-h)>3,_&=(1<<(S-=tt<<3))-1,s.next_in=l,s.next_out=c,s.avail_in=l>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function _(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(I){var Z;return I&&I.state?(Z=I.state,I.total_in=I.total_out=Z.total=0,I.msg="",Z.wrap&&(I.adler=1&Z.wrap),Z.mode=y,Z.last=0,Z.havedict=0,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new s.Buf32(g),Z.distcode=Z.distdyn=new s.Buf32(d),Z.sane=1,Z.back=-1,p):f}function E(I){var Z;return I&&I.state?((Z=I.state).wsize=0,Z.whave=0,Z.wnext=0,S(I)):f}function b(I,Z){var w,it;return I&&I.state?(it=I.state,Z<0?(w=0,Z=-Z):(w=1+(Z>>4),Z<48&&(Z&=15)),Z&&(Z<8||15=O.wsize?(s.arraySet(O.window,Z,w-O.wsize,O.wsize,0),O.wnext=0,O.whave=O.wsize):(it<(M=O.wsize-O.wnext)&&(M=it),s.arraySet(O.window,Z,w-it,M,O.wnext),(it-=M)?(s.arraySet(O.window,Z,w-it,it,0),O.wnext=it,O.whave=O.wsize):(O.wnext+=M,O.wnext===O.wsize&&(O.wnext=0),O.whave>>8&255,w.check=a(w.check,X,2,0),A=C=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&C)<<8)+(C>>8))%31){I.msg="incorrect header check",w.mode=30;break}if((15&C)!=8){I.msg="unknown compression method",w.mode=30;break}if(A-=4,v=8+(15&(C>>>=4)),w.wbits===0)w.wbits=v;else if(v>w.wbits){I.msg="invalid window size",w.mode=30;break}w.dmax=1<>8&1),512&w.flags&&(X[0]=255&C,X[1]=C>>>8&255,w.check=a(w.check,X,2,0)),A=C=0,w.mode=3;case 3:for(;A<32;){if(U===0)break t;U--,C+=it[O++]<>>8&255,X[2]=C>>>16&255,X[3]=C>>>24&255,w.check=a(w.check,X,4,0)),A=C=0,w.mode=4;case 4:for(;A<16;){if(U===0)break t;U--,C+=it[O++]<>8),512&w.flags&&(X[0]=255&C,X[1]=C>>>8&255,w.check=a(w.check,X,2,0)),A=C=0,w.mode=5;case 5:if(1024&w.flags){for(;A<16;){if(U===0)break t;U--,C+=it[O++]<>>8&255,w.check=a(w.check,X,2,0)),A=C=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(U<(J=w.length)&&(J=U),J&&(w.head&&(v=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),s.arraySet(w.head.extra,it,O,J,v)),512&w.flags&&(w.check=a(w.check,it,J,O)),U-=J,O+=J,w.length-=J),w.length))break t;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(U===0)break t;for(J=0;v=it[O+J++],w.head&&v&&w.length<65536&&(w.head.name+=String.fromCharCode(v)),v&&J>9&1,w.head.done=!0),I.adler=w.check=0,w.mode=12;break;case 10:for(;A<32;){if(U===0)break t;U--,C+=it[O++]<>>=7&A,A-=7&A,w.mode=27;break}for(;A<3;){if(U===0)break t;U--,C+=it[O++]<>>=1)){case 0:w.mode=14;break;case 1:if(tt(w),w.mode=20,Z!==6)break;C>>>=2,A-=2;break t;case 2:w.mode=17;break;case 3:I.msg="invalid block type",w.mode=30}C>>>=2,A-=2;break;case 14:for(C>>>=7&A,A-=7&A;A<32;){if(U===0)break t;U--,C+=it[O++]<>>16^65535)){I.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&C,A=C=0,w.mode=15,Z===6)break t;case 15:w.mode=16;case 16:if(J=w.length){if(U>>=5,A-=5,w.ndist=1+(31&C),C>>>=5,A-=5,w.ncode=4+(15&C),C>>>=4,A-=4,286>>=3,A-=3}for(;w.have<19;)w.lens[ot[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,q={bits:w.lenbits},K=u(0,w.lens,0,19,w.lencode,0,w.work,q),w.lenbits=q.bits,K){I.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=dt,A-=dt,w.lens[w.have++]=gt;else{if(gt===16){for(N=dt+2;A>>=dt,A-=dt,w.have===0){I.msg="invalid bit length repeat",w.mode=30;break}v=w.lens[w.have-1],J=3+(3&C),C>>>=2,A-=2}else if(gt===17){for(N=dt+3;A>>=dt)),C>>>=3,A-=3}else{for(N=dt+7;A>>=dt)),C>>>=7,A-=7}if(w.have+J>w.nlen+w.ndist){I.msg="invalid bit length repeat",w.mode=30;break}for(;J--;)w.lens[w.have++]=v}}if(w.mode===30)break;if(w.lens[256]===0){I.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,q={bits:w.lenbits},K=u(c,w.lens,0,w.nlen,w.lencode,0,w.work,q),w.lenbits=q.bits,K){I.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,q={bits:w.distbits},K=u(h,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,q),w.distbits=q.bits,K){I.msg="invalid distances set",w.mode=30;break}if(w.mode=20,Z===6)break t;case 20:w.mode=21;case 21:if(6<=U&&258<=k){I.next_out=D,I.avail_out=k,I.next_in=O,I.avail_in=U,w.hold=C,w.bits=A,l(I,et),D=I.next_out,M=I.output,k=I.avail_out,O=I.next_in,it=I.input,U=I.avail_in,C=w.hold,A=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;_t=(R=w.lencode[C&(1<>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>Ct)])>>>16&255,gt=65535&R,!(Ct+(dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=Ct,A-=Ct,w.back+=Ct}if(C>>>=dt,A-=dt,w.back+=dt,w.length=gt,_t===0){w.mode=26;break}if(32&_t){w.back=-1,w.mode=12;break}if(64&_t){I.msg="invalid literal/length code",w.mode=30;break}w.extra=15&_t,w.mode=22;case 22:if(w.extra){for(N=w.extra;A>>=w.extra,A-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;_t=(R=w.distcode[C&(1<>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>Ct)])>>>16&255,gt=65535&R,!(Ct+(dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=Ct,A-=Ct,w.back+=Ct}if(C>>>=dt,A-=dt,w.back+=dt,64&_t){I.msg="invalid distance code",w.mode=30;break}w.offset=gt,w.extra=15&_t,w.mode=24;case 24:if(w.extra){for(N=w.extra;A>>=w.extra,A-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){I.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(k===0)break t;if(J=et-k,w.offset>J){if((J=w.offset-J)>w.whave&&w.sane){I.msg="invalid distance too far back",w.mode=30;break}yt=J>w.wnext?(J-=w.wnext,w.wsize-J):w.wnext-J,J>w.length&&(J=w.length),vt=w.window}else vt=M,yt=D-w.offset,J=w.length;for(kx?(B=yt[vt+d[Z]],A[V+d[Z]]):(B=96,0),_=1<>D)+(S-=_)]=z<<24|B<<16|tt|0,S!==0;);for(_=1<>=1;if(_!==0?(C&=_-1,C+=_):C=0,Z++,--et[I]==0){if(I===it)break;I=h[p+d[Z]]}if(M>>7)]}function V(R,X){R.pending_buf[R.pending++]=255&X,R.pending_buf[R.pending++]=X>>>8&255}function et(R,X,ot){R.bi_valid>m-ot?(R.bi_buf|=X<>m-R.bi_valid,R.bi_valid+=ot-m):(R.bi_buf|=X<>>=1,ot<<=1,0<--X;);return ot>>>1}function vt(R,X,ot){var lt,rt,ht=new Array(d+1),bt=0;for(lt=1;lt<=d;lt++)ht[lt]=bt=bt+ot[lt-1]<<1;for(rt=0;rt<=X;rt++){var pt=R[2*rt+1];pt!==0&&(R[2*rt]=yt(ht[pt]++,pt))}}function dt(R){var X;for(X=0;X>1;1<=ot;ot--)Ct(R,ht,ot);for(rt=Ot;ot=R.heap[1],R.heap[1]=R.heap[R.heap_len--],Ct(R,ht,1),lt=R.heap[1],R.heap[--R.heap_max]=ot,R.heap[--R.heap_max]=lt,ht[2*rt]=ht[2*ot]+ht[2*lt],R.depth[rt]=(R.depth[ot]>=R.depth[lt]?R.depth[ot]:R.depth[lt])+1,ht[2*ot+1]=ht[2*lt+1]=rt,R.heap[1]=rt++,Ct(R,ht,1),2<=R.heap_len;);R.heap[--R.heap_max]=R.heap[1],function(oe,ir){var Zi,vr,Ji,Ae,tn,co,Kr=ir.dyn_tree,ps=ir.max_code,va=ir.stat_desc.static_tree,pu=ir.stat_desc.has_stree,oi=ir.stat_desc.extra_bits,_a=ir.stat_desc.extra_base,Cn=ir.stat_desc.max_length,An=0;for(Ae=0;Ae<=d;Ae++)oe.bl_count[Ae]=0;for(Kr[2*oe.heap[oe.heap_max]+1]=0,Zi=oe.heap_max+1;Zi>=7;rt>>=1)if(1&ye&&pt.dyn_ltree[2*Ot]!==0)return o;if(pt.dyn_ltree[18]!==0||pt.dyn_ltree[20]!==0||pt.dyn_ltree[26]!==0)return a;for(Ot=32;Ot>>3,(ht=R.static_len+3+7>>>3)<=rt&&(rt=ht)):rt=ht=ot+5,ot+4<=rt&&X!==-1?N(R,X,ot,lt):R.strategy===4||ht===rt?(et(R,2+(lt?1:0),3),ee(R,st,I)):(et(R,4+(lt?1:0),3),function(pt,Ot,ye,oe){var ir;for(et(pt,Ot-257,5),et(pt,ye-1,5),et(pt,oe-4,4),ir=0;ir>>8&255,R.pending_buf[R.d_buf+2*R.last_lit+1]=255&X,R.pending_buf[R.l_buf+R.last_lit]=255&ot,R.last_lit++,X===0?R.dyn_ltree[2*ot]++:(R.matches++,X--,R.dyn_ltree[2*(w[ot]+h+1)]++,R.dyn_dtree[2*A(X)]++),R.last_lit===R.lit_bufsize-1},n._tr_align=function(R){et(R,2,3),J(R,S,st),function(X){X.bi_valid===16?(V(X,X.bi_buf),X.bi_buf=0,X.bi_valid=0):8<=X.bi_valid&&(X.pending_buf[X.pending++]=255&X.bi_buf,X.bi_buf>>=8,X.bi_valid-=8)}(R)}},{"../utils/common":41}],53:[function(e,i,n){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,i,n){(function(s){(function(o,a){if(!o.setImmediate){var l,u,c,h,p=1,f={},y=!1,g=o.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(o);d=d&&d.setTimeout?d:o,l={}.toString.call(o.process)==="[object process]"?function(E){process.nextTick(function(){_(E)})}:function(){if(o.postMessage&&!o.importScripts){var E=!0,b=o.onmessage;return o.onmessage=function(){E=!1},o.postMessage("","*"),o.onmessage=b,E}}()?(h="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",S,!1):o.attachEvent("onmessage",S),function(E){o.postMessage(h+E,"*")}):o.MessageChannel?((c=new MessageChannel).port1.onmessage=function(E){_(E.data)},function(E){c.port2.postMessage(E)}):g&&"onreadystatechange"in g.createElement("script")?(u=g.documentElement,function(E){var b=g.createElement("script");b.onreadystatechange=function(){_(E),b.onreadystatechange=null,u.removeChild(b),b=null},u.appendChild(b)}):function(E){setTimeout(_,0,E)},d.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var b=new Array(arguments.length-1),F=0;F"u"?s===void 0?this:s:self)}).call(this,typeof vi<"u"?vi:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(Yu)),Yu.exports}var SC=xC();const TC=kh(SC);Oi.zipReader=(r,t)=>TC.loadAsync(r);const IC=Oi.createSettings;Oi.createSettings=async r=>{const t=Object.keys(r.files);return t.find(e=>EC(e))?IC(r):OC(t)};function EC(r){return r.endsWith("model3.json")}function CC(r){return r.endsWith(".moc3")}function AC(r){return r.split(/[\\/]/).pop()}function OC(r){const t=r.filter(u=>CC(u));if(t.length!==1){const u=t.length?`(${t.map(c=>`"${c}"`).join(",")})`:"";throw new Error(`Expected exactly one moc file, got ${t.length} ${u}`)}const e=t[0],i=AC(e).replace(/\.moc3?/,""),n=r.filter(u=>u.endsWith(".png"));if(!n.length)throw new Error("Textures not found");const s=r.filter(u=>u.endsWith(".mtn")||u.endsWith(".motion3.json")),o=r.find(u=>u.includes("physics")),a=r.find(u=>u.includes("pose")),l=new rs({url:`${i}.model3.json`,Version:3,FileReferences:{Moc:e,Textures:n,Physics:o,Pose:a,Motions:s.length?{"":s.map(u=>({File:u}))}:void 0}});return l.name=i,l._objectURL=`example://${l.url}`,l}Oi.readText=(r,t)=>{const e=r.file(t);if(!e)throw new Error(`Cannot find file: ${t}`);return e.async("text")};Oi.getFilePaths=r=>{const t=[];return r.forEach(e=>t.push(e)),Promise.resolve(t)};Oi.getFiles=(r,t)=>Promise.all(t.map(async e=>{const i=e.slice(e.lastIndexOf("/")+1),n=await r.file(e).async("blob");return new File([n],i)}));function Zt(r,t,e,i){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{u(i.next(c))}catch(h){o(h)}}function l(c){try{u(i.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((i=i.apply(r,t||[])).next())})}function hp(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Nt(r){return this instanceof Nt?(this.v=r,this):new Nt(r)}function fr(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(r,t||[]),n,s=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(f){return function(y){return Promise.resolve(y).then(f,h)}}function a(f,y){i[f]&&(n[f]=function(g){return new Promise(function(d,m){s.push([f,g,d,m])>1||l(f,g)})},y&&(n[f]=y(n[f])))}function l(f,y){try{u(i[f](y))}catch(g){p(s[0][3],g)}}function u(f){f.value instanceof Nt?Promise.resolve(f.value.v).then(c,h):p(s[0][2],f)}function c(f){l("next",f)}function h(f){l("throw",f)}function p(f,y){f(y),s.shift(),s.length&&l(s[0][0],s[0][1])}}function is(r){var t,e;return t={},i("next"),i("throw",function(n){throw n}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(n,s){t[n]=r[n]?function(o){return(e=!e)?{value:Nt(r[n](o)),done:!1}:s?s(o):o}:s}}function wi(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof hp=="function"?hp(r):r[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=r[s]&&function(o){return new Promise(function(a,l){o=r[s](o),n(a,l,o.done,o.value)})}}function n(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}const FC=new TextDecoder("utf-8"),nh=r=>FC.decode(r),PC=new TextEncoder,sf=r=>PC.encode(r),MC=r=>typeof r=="number",Iv=r=>typeof r=="boolean",Ge=r=>typeof r=="function",pr=r=>r!=null&&Object(r)===r,ss=r=>pr(r)&&Ge(r.then),ua=r=>pr(r)&&Ge(r[Symbol.iterator]),ao=r=>pr(r)&&Ge(r[Symbol.asyncIterator]),sh=r=>pr(r)&&pr(r.schema),Ev=r=>pr(r)&&"done"in r&&"value"in r,Cv=r=>pr(r)&&Ge(r.stat)&&MC(r.fd),Av=r=>pr(r)&&of(r.body),ru=r=>"_getDOMStream"in r&&"_getNodeStream"in r,DC=r=>pr(r)&&Ge(r.abort)&&Ge(r.getWriter)&&!ru(r),of=r=>pr(r)&&Ge(r.cancel)&&Ge(r.getReader)&&!ru(r),RC=r=>pr(r)&&Ge(r.end)&&Ge(r.write)&&Iv(r.writable)&&!ru(r),Ov=r=>pr(r)&&Ge(r.read)&&Ge(r.pipe)&&Iv(r.readable)&&!ru(r),NC=r=>pr(r)&&Ge(r.clear)&&Ge(r.bytes)&&Ge(r.position)&&Ge(r.setPosition)&&Ge(r.capacity)&&Ge(r.getBufferIdentifier)&&Ge(r.createLong),af=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function LC(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++l_e(Int32Array,r),dp=r=>_e(BigInt64Array,r),le=r=>_e(Uint8Array,r),oh=r=>(r.next(),r);function*BC(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof af?e(t):ua(t)?t:e(t);return yield*oh(function*(n){let s=null;do s=n.next(yield _e(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const kC=r=>BC(Uint8Array,r);function Fv(r,t){return fr(this,arguments,function*(){if(ss(t))return yield Nt(yield Nt(yield*is(wi(Fv(r,yield Nt(t))))));const i=function(o){return fr(this,arguments,function*(){yield yield Nt(yield Nt(o))})},n=function(o){return fr(this,arguments,function*(){yield Nt(yield*is(wi(oh(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof af?i(t):ua(t)?n(t):ao(t)?t:i(t);return yield Nt(yield*is(wi(oh(function(o){return fr(this,arguments,function*(){let a=null;do a=yield Nt(o.next(yield yield Nt(_e(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Nt(new r)})}const UC=r=>Fv(Uint8Array,r);function Pv(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++e(r.next(),r);function*jC(r){let t,e=!1,i=[],n,s,o,a=0;function l(){return s==="peek"?Si(i,o)[0]:([n,i,a]=Si(i,o),n)}({cmd:s,size:o}=(yield null)||{cmd:"read",size:0});const u=kC(r)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(o-a)?u.next():u.next(o-a),!t&&n.byteLength>0&&(i.push(n),a+=n.byteLength),t||o<=a)do({cmd:s,size:o}=yield l());while(o0&&(n.push(s),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Nt(u()));while(a0&&(n.push(le(s)),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Nt(u()));while(a{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return Zt(this,void 0,void 0,function*(){const{reader:e,source:i}=this;e&&(yield e.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return Zt(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=le(e)),e})}}const Xu=(r,t)=>{const e=n=>i([t,n]);let i;return[t,e,new Promise(n=>(i=n)&&r.once(t,e))]};function WC(r){return fr(this,arguments,function*(){const e=[];let i="error",n=!1,s=null,o,a,l=0,u=[],c;function h(){return o==="peek"?Si(u,a)[0]:([c,u,l]=Si(u,a),c)}if({cmd:o,size:a}=(yield yield Nt(null))||{cmd:"read",size:0},r.isTTY)return yield yield Nt(new Uint8Array(0)),yield Nt(null);try{e[0]=Xu(r,"end"),e[1]=Xu(r,"error");do{if(e[2]=Xu(r,"readable"),[i,s]=yield Nt(Promise.race(e.map(f=>f[2]))),i==="error")break;if((n=i==="end")||(Number.isFinite(a-l)?(c=le(r.read(a-l)),c.byteLength0&&(u.push(c),l+=c.byteLength)),n||a<=l)do({cmd:o,size:a}=yield yield Nt(h()));while(a{for(const[m,_]of f)r.off(m,_);try{const m=r.destroy;m&&m.call(r,y),y=void 0}catch(m){y=m||y}finally{y!=null?d(y):g()}})}})}var ke;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(ke||(ke={}));var er;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(er||(er={}));var tr;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(tr||(tr={}));var Yr;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Yr||(Yr={}));var Vt;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(Vt||(Vt={}));var Ti;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ti||(Ti={}));const qu=2,mi=4,$i=4,me=4,an=new Int32Array(2),pp=new Float32Array(an.buffer),mp=new Float64Array(an.buffer),ka=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var ah;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(ah||(ah={}));let Js=class Mv{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Mv(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){pp[0]=e,this.writeInt32(t,an[0])}writeFloat64(t,e){mp[0]=e,this.writeInt32(t,an[ka?0:1]),this.writeInt32(t+4,an[ka?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const n=2;this.addInt16(t-this.object_start);const s=(i+n)*qu;this.addInt16(s);let o=0;const a=this.space;t:for(e=0;e=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,mi+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(e=0;i--)t.addInt32(e[i]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,i){return cr.startUnion(t),cr.addMode(t,e),cr.addTypeIds(t,i),cr.endUnion(t)}}let xp=class Do{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new Do).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+me),(e||new Do).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return Do.startUtf8(t),Do.endUtf8(t)}};var xe;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded"})(xe||(xe={}));let Lr=class Ya{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new Ya).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+me),(e||new Ya).__init(t.readInt32(t.position())+t.position(),t)}name(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):xe.NONE}type(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){const e=this.bb.__offset(this.bb_pos,12);return e?(t||new Vi).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const i=this.bb.__offset(this.bb_pos,14);return i?(e||new Ya).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,16);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,xe.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},ci=class Di{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new Di).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+me),(e||new Di).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):to.Little}fields(t,e){const i=this.bb.__offset(this.bb_pos,6);return i?(e||new Lr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,to.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let i=e.length-1;i>=0;i--)t.addInt64(e[i]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,i,n,s){return Di.startSchema(t),Di.addEndianness(t,e),Di.addFields(t,i),Di.addCustomMetadata(t,n),Di.addFeatures(t,s),Di.endSchema(t)}};var fe;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(fe||(fe={}));var L;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond"})(L||(L={}));var Ui;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(Ui||(Ui={}));const HC=void 0;function Qo(r){if(r===null)return"null";if(r===HC)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(t=>Qo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}function we(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function Bv(r,t){return we(r/t)+we(r%t)/we(t)}const YC=Symbol.for("isArrowBigNum");function ii(r,...t){return t.length===0?Object.setPrototypeOf(_e(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ii.prototype[YC]=!0;ii.prototype.toJSON=function(){return`"${Zo(this)}"`};ii.prototype.valueOf=function(r){return kv(this,r)};ii.prototype.toString=function(){return Zo(this)};ii.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return kv(this);case"string":return Zo(this);case"default":return QC(this)}return Zo(this)};function $s(...r){return ii.apply(this,r)}function Vs(...r){return ii.apply(this,r)}function Ko(...r){return ii.apply(this,r)}Object.setPrototypeOf($s.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Vs.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ko.prototype,Object.create(Uint32Array.prototype));Object.assign($s.prototype,ii.prototype,{constructor:$s,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Vs.prototype,ii.prototype,{constructor:Vs,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Ko.prototype,ii.prototype,{constructor:Ko,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const XC=BigInt(4294967296)*BigInt(4294967296),qC=XC-BigInt(1);function kv(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return Qu(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(At.prototype);let yn=class extends At{constructor(){super(L.Null)}toString(){return"Null"}};jv=Symbol.toStringTag;yn[jv]=(r=>r[Symbol.toStringTag]="Null")(yn.prototype);let os=class extends At{constructor(t,e){super(L.Int),this.isSigned=t,this.bitWidth=e}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};$v=Symbol.toStringTag;os[$v]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(os.prototype);class Jo extends os{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Jo.prototype,"ArrayType",{value:Int32Array});let fl=class extends At{constructor(t){super(L.Float),this.precision=t}get ArrayType(){switch(this.precision){case tr.HALF:return Uint16Array;case tr.SINGLE:return Float32Array;case tr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Vv=Symbol.toStringTag;fl[Vv]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(fl.prototype);let dl=class extends At{constructor(){super(L.Binary)}toString(){return"Binary"}};Gv=Symbol.toStringTag;dl[Gv]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(dl.prototype);let pl=class extends At{constructor(){super(L.LargeBinary)}toString(){return"LargeBinary"}};Wv=Symbol.toStringTag;pl[Wv]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(pl.prototype);let ml=class extends At{constructor(){super(L.Utf8)}toString(){return"Utf8"}};Hv=Symbol.toStringTag;ml[Hv]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(ml.prototype);let yl=class extends At{constructor(){super(L.LargeUtf8)}toString(){return"LargeUtf8"}};Yv=Symbol.toStringTag;yl[Yv]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(yl.prototype);let gl=class extends At{constructor(){super(L.Bool)}toString(){return"Bool"}};Xv=Symbol.toStringTag;gl[Xv]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(gl.prototype);let vl=class extends At{constructor(t,e,i=128){super(L.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};qv=Symbol.toStringTag;vl[qv]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(vl.prototype);let _l=class extends At{constructor(t){super(L.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Yr[this.unit]}>`}get ArrayType(){return this.unit===Yr.DAY?Int32Array:BigInt64Array}};Qv=Symbol.toStringTag;_l[Qv]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(_l.prototype);let bl=class extends At{constructor(t,e){super(L.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Vt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Kv=Symbol.toStringTag;bl[Kv]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(bl.prototype);let wl=class extends At{constructor(t,e){super(L.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Vt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Zv=Symbol.toStringTag;wl[Zv]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(wl.prototype);let xl=class extends At{constructor(t){super(L.Interval),this.unit=t}toString(){return`Interval<${Ti[this.unit]}>`}};Jv=Symbol.toStringTag;xl[Jv]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(xl.prototype);let Sl=class extends At{constructor(t){super(L.Duration),this.unit=t}toString(){return`Duration<${Vt[this.unit]}>`}};t_=Symbol.toStringTag;Sl[t_]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(Sl.prototype);let Tl=class extends At{constructor(t){super(L.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};e_=Symbol.toStringTag;Tl[e_]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(Tl.prototype);let sr=class extends At{constructor(t){super(L.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};r_=Symbol.toStringTag;sr[r_]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(sr.prototype);let Il=class extends At{constructor(t,e,i){super(L.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};i_=Symbol.toStringTag;Il[i_]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Il.prototype);let El=class extends At{constructor(t){super(L.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};n_=Symbol.toStringTag;El[n_]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(El.prototype);let Cl=class extends At{constructor(t,e){super(L.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};s_=Symbol.toStringTag;Cl[s_]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Cl.prototype);let Al=class extends At{constructor(t,e=!1){var i,n,s;if(super(L.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};o_=Symbol.toStringTag;Al[o_]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Al.prototype);const ZC=(r=>()=>++r)(-1);let eo=class extends At{constructor(t,e,i,n){super(L.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?ZC():we(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};a_=Symbol.toStringTag;eo[a_]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(eo.prototype);function zi(r){const t=r;switch(r.typeId){case L.Decimal:return r.bitWidth/32;case L.Interval:return 1+t.unit;case L.FixedSizeList:return t.listSize;case L.FixedSizeBinary:return t.byteWidth;default:return 1}}let ie=class{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return JC(this,t,e)}getVisitFnByTypeId(t,e=!0){return Fs(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function JC(r,t,e=!0){return typeof t=="number"?Fs(r,t,e):typeof t=="string"&&t in L?Fs(r,L[t],e):t&&t instanceof At?Fs(r,Sp(t),e):t!=null&&t.type&&t.type instanceof At?Fs(r,Sp(t.type),e):Fs(r,L.NONE,e)}function Fs(r,t,e=!0){let i=null;switch(t){case L.Null:i=r.visitNull;break;case L.Bool:i=r.visitBool;break;case L.Int:i=r.visitInt;break;case L.Int8:i=r.visitInt8||r.visitInt;break;case L.Int16:i=r.visitInt16||r.visitInt;break;case L.Int32:i=r.visitInt32||r.visitInt;break;case L.Int64:i=r.visitInt64||r.visitInt;break;case L.Uint8:i=r.visitUint8||r.visitInt;break;case L.Uint16:i=r.visitUint16||r.visitInt;break;case L.Uint32:i=r.visitUint32||r.visitInt;break;case L.Uint64:i=r.visitUint64||r.visitInt;break;case L.Float:i=r.visitFloat;break;case L.Float16:i=r.visitFloat16||r.visitFloat;break;case L.Float32:i=r.visitFloat32||r.visitFloat;break;case L.Float64:i=r.visitFloat64||r.visitFloat;break;case L.Utf8:i=r.visitUtf8;break;case L.LargeUtf8:i=r.visitLargeUtf8;break;case L.Binary:i=r.visitBinary;break;case L.LargeBinary:i=r.visitLargeBinary;break;case L.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case L.Date:i=r.visitDate;break;case L.DateDay:i=r.visitDateDay||r.visitDate;break;case L.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case L.Timestamp:i=r.visitTimestamp;break;case L.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case L.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case L.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case L.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case L.Time:i=r.visitTime;break;case L.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case L.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case L.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case L.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case L.Decimal:i=r.visitDecimal;break;case L.List:i=r.visitList;break;case L.Struct:i=r.visitStruct;break;case L.Union:i=r.visitUnion;break;case L.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case L.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case L.Dictionary:i=r.visitDictionary;break;case L.Interval:i=r.visitInterval;break;case L.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case L.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case L.Duration:i=r.visitDuration;break;case L.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case L.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case L.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case L.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case L.FixedSizeList:i=r.visitFixedSizeList;break;case L.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${L[t]}'`)}function Sp(r){switch(r.typeId){case L.Null:return L.Null;case L.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?L.Int8:L.Uint8;case 16:return e?L.Int16:L.Uint16;case 32:return e?L.Int32:L.Uint32;case 64:return e?L.Int64:L.Uint64}return L.Int}case L.Float:switch(r.precision){case tr.HALF:return L.Float16;case tr.SINGLE:return L.Float32;case tr.DOUBLE:return L.Float64}return L.Float;case L.Binary:return L.Binary;case L.LargeBinary:return L.LargeBinary;case L.Utf8:return L.Utf8;case L.LargeUtf8:return L.LargeUtf8;case L.Bool:return L.Bool;case L.Decimal:return L.Decimal;case L.Time:switch(r.unit){case Vt.SECOND:return L.TimeSecond;case Vt.MILLISECOND:return L.TimeMillisecond;case Vt.MICROSECOND:return L.TimeMicrosecond;case Vt.NANOSECOND:return L.TimeNanosecond}return L.Time;case L.Timestamp:switch(r.unit){case Vt.SECOND:return L.TimestampSecond;case Vt.MILLISECOND:return L.TimestampMillisecond;case Vt.MICROSECOND:return L.TimestampMicrosecond;case Vt.NANOSECOND:return L.TimestampNanosecond}return L.Timestamp;case L.Date:switch(r.unit){case Yr.DAY:return L.DateDay;case Yr.MILLISECOND:return L.DateMillisecond}return L.Date;case L.Interval:switch(r.unit){case Ti.DAY_TIME:return L.IntervalDayTime;case Ti.YEAR_MONTH:return L.IntervalYearMonth}return L.Interval;case L.Duration:switch(r.unit){case Vt.SECOND:return L.DurationSecond;case Vt.MILLISECOND:return L.DurationMillisecond;case Vt.MICROSECOND:return L.DurationMicrosecond;case Vt.NANOSECOND:return L.DurationNanosecond}return L.Duration;case L.Map:return L.Map;case L.List:return L.List;case L.Struct:return L.Struct;case L.Union:switch(r.mode){case er.Dense:return L.DenseUnion;case er.Sparse:return L.SparseUnion}return L.Union;case L.FixedSizeBinary:return L.FixedSizeBinary;case L.FixedSizeList:return L.FixedSizeList;case L.Dictionary:return L.Dictionary}throw new Error(`Unrecognized type '${L[r.typeId]}'`)}ie.prototype.visitInt8=null;ie.prototype.visitInt16=null;ie.prototype.visitInt32=null;ie.prototype.visitInt64=null;ie.prototype.visitUint8=null;ie.prototype.visitUint16=null;ie.prototype.visitUint32=null;ie.prototype.visitUint64=null;ie.prototype.visitFloat16=null;ie.prototype.visitFloat32=null;ie.prototype.visitFloat64=null;ie.prototype.visitDateDay=null;ie.prototype.visitDateMillisecond=null;ie.prototype.visitTimestampSecond=null;ie.prototype.visitTimestampMillisecond=null;ie.prototype.visitTimestampMicrosecond=null;ie.prototype.visitTimestampNanosecond=null;ie.prototype.visitTimeSecond=null;ie.prototype.visitTimeMillisecond=null;ie.prototype.visitTimeMicrosecond=null;ie.prototype.visitTimeNanosecond=null;ie.prototype.visitDenseUnion=null;ie.prototype.visitSparseUnion=null;ie.prototype.visitIntervalDayTime=null;ie.prototype.visitIntervalYearMonth=null;ie.prototype.visitDuration=null;ie.prototype.visitDurationSecond=null;ie.prototype.visitDurationMillisecond=null;ie.prototype.visitDurationMicrosecond=null;ie.prototype.visitDurationNanosecond=null;const l_=new Float64Array(1),_s=new Uint32Array(l_.buffer);function u_(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function tA(r){if(r!==r)return 32256;l_[0]=r;const t=(_s[1]&2147483648)>>16&65535;let e=_s[1]&2146435072,i=0;return e>=1089470464?_s[0]>0?e=31744:(e=(e&2080374784)>>16,i=(_s[1]&1048575)>>10):e<=1056964608?(i=1048576+(_s[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(_s[1]&1048575)+512>>10),t|e|i&65535}let Gt=class extends ie{};function Xt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const eA=(r,t,e)=>{r[t]=Math.floor(e/864e5)},c_=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},lf=({values:r},t,e)=>{r[t]=e},h_=({values:r},t,e)=>{r[t]=tA(e)},iA=(r,t,e)=>{switch(r.type.precision){case tr.HALF:return h_(r,t,e);case tr.SINGLE:case tr.DOUBLE:return lf(r,t,e)}},f_=({values:r},t,e)=>{eA(r,t,e.valueOf())},d_=({values:r},t,e)=>{r[t]=BigInt(e)},nA=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},p_=({values:r,valueOffsets:t},e,i)=>c_(r,t,e,i),m_=({values:r,valueOffsets:t},e,i)=>c_(r,t,e,sf(i)),sA=(r,t,e)=>{r.type.unit===Yr.DAY?f_(r,t,e):d_(r,t,e)},y_=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},g_=({values:r},t,e)=>{r[t]=BigInt(e)},v_=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},__=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},oA=(r,t,e)=>{switch(r.type.unit){case Vt.SECOND:return y_(r,t,e);case Vt.MILLISECOND:return g_(r,t,e);case Vt.MICROSECOND:return v_(r,t,e);case Vt.NANOSECOND:return __(r,t,e)}},b_=({values:r},t,e)=>{r[t]=e},w_=({values:r},t,e)=>{r[t]=e},x_=({values:r},t,e)=>{r[t]=e},S_=({values:r},t,e)=>{r[t]=e},aA=(r,t,e)=>{switch(r.type.unit){case Vt.SECOND:return b_(r,t,e);case Vt.MILLISECOND:return w_(r,t,e);case Vt.MICROSECOND:return x_(r,t,e);case Vt.NANOSECOND:return S_(r,t,e)}},lA=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},uA=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Xr.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Xr.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},hA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),fA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),dA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),pA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),mA=(r,t,e)=>{const i=r.type.children.map(s=>Xr.getVisitFn(s.type)),n=e instanceof Map?dA(t,e):e instanceof Me?fA(t,e):Array.isArray(e)?hA(t,e):pA(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},yA=(r,t,e)=>{r.type.mode===er.Dense?T_(r,t,e):I_(r,t,e)},T_=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Xr.visit(n,r.valueOffsets[t],e)},I_=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Xr.visit(n,t,e)},gA=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},vA=(r,t,e)=>{r.type.unit===Ti.DAY_TIME?E_(r,t,e):C_(r,t,e)},E_=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},C_=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},A_=({values:r},t,e)=>{r[t]=e},O_=({values:r},t,e)=>{r[t]=e},F_=({values:r},t,e)=>{r[t]=e},P_=({values:r},t,e)=>{r[t]=e},_A=(r,t,e)=>{switch(r.type.unit){case Vt.SECOND:return A_(r,t,e);case Vt.MILLISECOND:return O_(r,t,e);case Vt.MICROSECOND:return F_(r,t,e);case Vt.NANOSECOND:return P_(r,t,e)}},bA=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Xr.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${Qo(t)}: ${Qo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new wA(this[Zr],this[Gs])}},wA=class{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[Zr].type.children.findIndex(i=>i.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Zr].type.children.findIndex(i=>i.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Zr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=mr.visit(t[Zr].children[i],t[Gs]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Zr].type.children.findIndex(s=>s.name===e);return n!==-1?(Xr.visit(t[Zr].children[n],t[Gs],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}},Lt=class extends ie{};function Wt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const SA=(r,t)=>864e5*r[t],TA=(r,t)=>null,M_=(r,t,e)=>{if(e+1>=t.length)return null;const i=we(t[e]),n=we(t[e+1]);return r.subarray(i,n)},IA=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<SA(r,t),R_=({values:r},t)=>we(r[t]),Sn=({stride:r,values:t},e)=>t[r*e],EA=({stride:r,values:t},e)=>u_(t[r*e]),N_=({values:r},t)=>r[t],CA=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),L_=({values:r,valueOffsets:t},e)=>M_(r,t,e),B_=({values:r,valueOffsets:t},e)=>{const i=M_(r,t,e);return i!==null?nh(i):null},AA=({values:r},t)=>r[t],OA=({type:r,values:t},e)=>r.precision!==tr.HALF?t[e]:u_(t[e]),FA=(r,t)=>r.type.unit===Yr.DAY?D_(r,t):R_(r,t),k_=({values:r},t)=>1e3*we(r[t]),U_=({values:r},t)=>we(r[t]),z_=({values:r},t)=>Bv(r[t],BigInt(1e3)),j_=({values:r},t)=>Bv(r[t],BigInt(1e6)),PA=(r,t)=>{switch(r.type.unit){case Vt.SECOND:return k_(r,t);case Vt.MILLISECOND:return U_(r,t);case Vt.MICROSECOND:return z_(r,t);case Vt.NANOSECOND:return j_(r,t)}},$_=({values:r},t)=>r[t],V_=({values:r},t)=>r[t],G_=({values:r},t)=>r[t],W_=({values:r},t)=>r[t],MA=(r,t)=>{switch(r.type.unit){case Vt.SECOND:return $_(r,t);case Vt.MILLISECOND:return V_(r,t);case Vt.MICROSECOND:return G_(r,t);case Vt.NANOSECOND:return W_(r,t)}},DA=({values:r,stride:t},e)=>KC.decimal(r.subarray(t*e,t*(e+1))),RA=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Me([l])},NA=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new cf(o.slice(n,s-n))},LA=(r,t)=>new uf(r,t),BA=(r,t)=>r.type.mode===er.Dense?H_(r,t):Y_(r,t),H_=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return mr.visit(i,r.valueOffsets[t])},Y_=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return mr.visit(i,t)},kA=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},UA=(r,t)=>r.type.unit===Ti.DAY_TIME?X_(r,t):q_(r,t),X_=({values:r},t)=>r.subarray(2*t,2*(t+1)),q_=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Q_=({values:r},t)=>r[t],K_=({values:r},t)=>r[t],Z_=({values:r},t)=>r[t],J_=({values:r},t)=>r[t],zA=(r,t)=>{switch(r.type.unit){case Vt.SECOND:return Q_(r,t);case Vt.MILLISECOND:return K_(r,t);case Vt.MICROSECOND:return Z_(r,t);case Vt.NANOSECOND:return J_(r,t)}},jA=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Me([s])};Lt.prototype.visitNull=Wt(TA);Lt.prototype.visitBool=Wt(IA);Lt.prototype.visitInt=Wt(AA);Lt.prototype.visitInt8=Wt(Sn);Lt.prototype.visitInt16=Wt(Sn);Lt.prototype.visitInt32=Wt(Sn);Lt.prototype.visitInt64=Wt(N_);Lt.prototype.visitUint8=Wt(Sn);Lt.prototype.visitUint16=Wt(Sn);Lt.prototype.visitUint32=Wt(Sn);Lt.prototype.visitUint64=Wt(N_);Lt.prototype.visitFloat=Wt(OA);Lt.prototype.visitFloat16=Wt(EA);Lt.prototype.visitFloat32=Wt(Sn);Lt.prototype.visitFloat64=Wt(Sn);Lt.prototype.visitUtf8=Wt(B_);Lt.prototype.visitLargeUtf8=Wt(B_);Lt.prototype.visitBinary=Wt(L_);Lt.prototype.visitLargeBinary=Wt(L_);Lt.prototype.visitFixedSizeBinary=Wt(CA);Lt.prototype.visitDate=Wt(FA);Lt.prototype.visitDateDay=Wt(D_);Lt.prototype.visitDateMillisecond=Wt(R_);Lt.prototype.visitTimestamp=Wt(PA);Lt.prototype.visitTimestampSecond=Wt(k_);Lt.prototype.visitTimestampMillisecond=Wt(U_);Lt.prototype.visitTimestampMicrosecond=Wt(z_);Lt.prototype.visitTimestampNanosecond=Wt(j_);Lt.prototype.visitTime=Wt(MA);Lt.prototype.visitTimeSecond=Wt($_);Lt.prototype.visitTimeMillisecond=Wt(V_);Lt.prototype.visitTimeMicrosecond=Wt(G_);Lt.prototype.visitTimeNanosecond=Wt(W_);Lt.prototype.visitDecimal=Wt(DA);Lt.prototype.visitList=Wt(RA);Lt.prototype.visitStruct=Wt(LA);Lt.prototype.visitUnion=Wt(BA);Lt.prototype.visitDenseUnion=Wt(H_);Lt.prototype.visitSparseUnion=Wt(Y_);Lt.prototype.visitDictionary=Wt(kA);Lt.prototype.visitInterval=Wt(UA);Lt.prototype.visitIntervalDayTime=Wt(X_);Lt.prototype.visitIntervalYearMonth=Wt(q_);Lt.prototype.visitDuration=Wt(zA);Lt.prototype.visitDurationSecond=Wt(Q_);Lt.prototype.visitDurationMillisecond=Wt(K_);Lt.prototype.visitDurationMicrosecond=Wt(Z_);Lt.prototype.visitDurationNanosecond=Wt(J_);Lt.prototype.visitFixedSizeList=Wt(jA);Lt.prototype.visitMap=Wt(NA);const mr=new Lt,Ps=Symbol.for("keys"),Ws=Symbol.for("vals"),Ms=Symbol.for("kKeysAsStrings"),hh=Symbol.for("_kKeysAsStrings");let cf=class{constructor(t){return this[Ps]=new Me([t.children[0]]).memoize(),this[Ws]=t.children[1],new Proxy(this,new VA)}get[Ms](){return this[hh]||(this[hh]=Array.from(this[Ps].toArray(),String))}[Symbol.iterator](){return new $A(this[Ps],this[Ws])}get size(){return this[Ps].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ps],e=this[Ws],i={};for(let n=-1,s=t.length;++n`${Qo(t)}: ${Qo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},$A=class{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),mr.visit(this.vals,t)]})}},VA=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ms]}has(t,e){return t[Ms].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ms].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Ms].indexOf(e);if(i!==-1){const n=mr.visit(Reflect.get(t,Ws),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Ms].indexOf(e);return n!==-1?(Xr.visit(Reflect.get(t,Ws),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}};Object.defineProperties(cf.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ps]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ws]:{writable:!0,enumerable:!1,configurable:!1,value:null},[hh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Tp;function t0(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const hf=(r,t)=>r<0?t+r:r,Ip=r=>r!==r;function lo(r){if(typeof r!=="object"||r===null)return Ip(r)?Ip:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?zC(r,e):!1:r instanceof Map?WA(r):Array.isArray(r)?GA(r):r instanceof Me?HA(r):YA(r,!0)}function GA(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return XA(r,e);case Map:return Ep(r,e,e.keys());case cf:case uf:case Object:case void 0:return Ep(r,e,t||Object.keys(e))}return e instanceof Me?qA(r,e):!1}}function XA(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function Ol(r,t,e){const i=e.byteLength+7&-8;if(r>0||e.byteLength>3):Fl(new ff(e,r,t,null,e0)).subarray(0,i)),n}return e}function Fl(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}let ff=class{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,n=t+(t%8===0?0:8-t%8);return fh(r,t,n)+fh(r,i,e)+KA(r,n>>3,i-n>>3)}function KA(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=Ku(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=Ku(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=Ku(s.getUint8(n)),n+=1;return i}function Ku(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const ZA=-1;let Se=class dh{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return At.isSparseUnion(t)?this.children.some(e=>e.nullable):At.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(At.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=ZA&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-fh(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof dh?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=zi(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(At.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===er.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Ol(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new dh(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===L.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(Ol(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[Ui.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[Ui.TYPE])&&(o[Ui.TYPE]=s.subarray(t,t+e)),(s=o[Ui.OFFSET])&&(o[Ui.OFFSET]=s.subarray(t,t+e+1))||(s=o[Ui.DATA])&&(o[Ui.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}};Se.prototype.children=Object.freeze([]);class Bo extends ie{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:i=0,["length"]:n=0}=t;return new Se(e,i,n,n)}visitBool(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitInt(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFloat(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.data),s=le(t.nullBitmap),o=_o(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitLargeUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.data),s=le(t.nullBitmap),o=dp(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.data),s=le(t.nullBitmap),o=_o(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitLargeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.data),s=le(t.nullBitmap),o=dp(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/zi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDate(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/zi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTimestamp(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/zi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTime(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/zi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDecimal(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/zi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitList(t){const{["type"]:e,["offset"]:i=0,["child"]:n}=t,s=le(t.nullBitmap),o=_o(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,void 0,s],[n])}visitStruct(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=le(t.nullBitmap),{length:o=n.reduce((l,{length:u})=>Math.max(l,u),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],n)}visitUnion(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=_e(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(At.isSparseUnion(e))return new Se(e,i,o,a,[void 0,void 0,void 0,s],n);const l=_o(t.valueOffsets);return new Se(e,i,o,a,[l,void 0,void 0,s],n)}visitDictionary(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.indices.ArrayType,t.data),{["dictionary"]:o=new Me([new Bo().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[void 0,s,n],[],o)}visitInterval(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/zi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDuration(t){const{["type"]:e,["offset"]:i=0}=t,n=le(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFixedSizeList(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Bo().visit({type:e.valueType})}=t,s=le(t.nullBitmap),{["length"]:o=n.length/zi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],[n])}visitMap(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Bo().visit({type:e.childType})}=t,s=le(t.nullBitmap),o=_o(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,void 0,s],[n])}}const JA=new Bo;function se(r){return JA.visit(r)}let Cp=class{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function r0(r){return r.reduce((t,e)=>t+e.nullCount,0)}function i0(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function n0(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function df(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function rO(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new ff(e,r.offset+(t||0),r.length,e,e0)){if(!n)return i;++i}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case L.Union:break;case L.Dictionary:break;default:return rO(r,e)}const i=mr.getVisitFn(r),n=lo(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new Cp(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new iO(o)})}let iO=class{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Se)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=u0[o.typeId],c=s[0];this.isValid=h=>pf(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,c0[o.typeId]),this._offsets=i0(s);break}this.data=s,this.type=o,this.stride=zi(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return tO(this.data)}get nullCount(){return r0(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${L[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(hf(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return mf.visit(this)}concat(...t){return new $n(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new $n(t0(this,t,e,({data:i,_offsets:n},s,o)=>n0(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case L.Int:case L.Float:case L.Decimal:case L.Time:case L.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return At.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(At.isDictionary(this.type)){const t=new Ap(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new $n(e)}return new Ap(this)}unmemoize(){if(At.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new $n(e)}return this}};l0=Symbol.toStringTag;Me[l0]=(r=>{r.type=At.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(L).map(e=>L[e]).filter(e=>typeof e=="number"&&e!==L.NONE);for(const e of t){const i=mr.getVisitFnByTypeId(e),n=Xr.getVisitFnByTypeId(e),s=Ml.getVisitFnByTypeId(e);u0[e]={get:i,set:n,indexOf:s},c0[e]=Object.create(r,{isValid:{value:Pl(pf)},get:{value:Pl(mr.getVisitFnByTypeId(e))},set:{value:s0(Xr.getVisitFnByTypeId(e))},indexOf:{value:o0(Ml.getVisitFnByTypeId(e))}})}return"Vector"})(Me.prototype);let Ap=class h0 extends Me{constructor(t){super(t.data);const e=this.get,i=this.set,n=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new h0(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Me(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};class ph{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,e,i,n){return t.prep(8,24),t.writeInt64(BigInt(n??0)),t.pad(4),t.writeInt32(i),t.writeInt64(BigInt(e??0)),t.offset()}}class _r{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new _r).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+me),(e||new _r).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ke.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new ci).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new ph).__init(this.bb.__vector(this.bb_pos+i)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){const i=this.bb.__offset(this.bb_pos,10);return i?(e||new ph).__init(this.bb.__vector(this.bb_pos+i)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,ke.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}}let Pe=class Vn{constructor(t=[],e,i,n=ke.V5){this.fields=t||[],this.metadata=e||new Map,i||(i=mh(this.fields)),this.dictionaries=i,this.metadataVersion=n}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){const e=new Set(t),i=this.fields.filter(n=>e.has(n.name));return new Vn(i,this.metadata)}selectAt(t){const e=t.map(i=>this.fields[i]).filter(Boolean);return new Vn(e,this.metadata)}assign(...t){const e=t[0]instanceof Vn?t[0]:Array.isArray(t[0])?new Vn(t[0]):new Vn(t),i=[...this.fields],n=Ua(Ua(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const l=i.findIndex(u=>u.name===a.name);return~l?(i[l]=a.clone({metadata:Ua(Ua(new Map,i[l].metadata),a.metadata)}))&&!1:!0}),o=mh(s,new Map);return new Vn([...i,...s],n,new Map([...this.dictionaries,...o]))}};Pe.prototype.fields=null;Pe.prototype.metadata=null;Pe.prototype.dictionaries=null;class Ce{static new(...t){let[e,i,n,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],i===void 0&&(i=t[0].type),n===void 0&&(n=t[0].nullable),s===void 0&&(s=t[0].metadata)),new Ce(`${e}`,i,n,s)}constructor(t,e,i=!1,n){this.name=t,this.type=e,this.nullable=i,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,i,n,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,i=this.type,n=this.nullable,s=this.metadata]=t:{name:e=this.name,type:i=this.type,nullable:n=this.nullable,metadata:s=this.metadata}=t[0],Ce.new(e,i,n,s)}}Ce.prototype.type=null;Ce.prototype.name=null;Ce.prototype.nullable=null;Ce.prototype.metadata=null;function Ua(r,t){return new Map([...r||new Map,...t||new Map])}function mh(r,t=new Map){for(let e=-1,i=r.length;++e0&&mh(s.children,t)}return t}var nO=Dv,sO=Js;class ta{static decode(t){t=new sO(le(t));const e=_r.getRootAsFooter(t),i=Pe.decode(e.schema(),new Map,e.version());return new oO(i,e)}static encode(t){const e=new nO,i=Pe.encode(e,t.schema);_r.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())gn.encode(e,o);const n=e.endVector();_r.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())gn.encode(e,o);const s=e.endVector();return _r.startFooter(e),_r.addSchema(e,i),_r.addVersion(e,ke.V5),_r.addRecordBatches(e,n),_r.addDictionaries(e,s),_r.finishFooterBuffer(e,_r.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=ke.V5,i,n){this.schema=t,this.version=e,i&&(this._recordBatches=i),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let t,e=-1,i=this.numRecordBatches;++e=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Zt(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(De);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return kr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return kr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Zt(this,void 0,void 0,function*(){return yield this.abort(t),De})}return(t){return Zt(this,void 0,void 0,function*(){return yield this.close(),De})}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,i)=>{this.resolvers.push({resolve:e,reject:i})}):Promise.resolve(De)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class Xa extends aO{write(t){if((t=le(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?nh(this.toUint8Array(!0)):this.toUint8Array(!1).then(nh)}toUint8Array(t=!1){return t?Si(this._values)[0]:Zt(this,void 0,void 0,function*(){var e,i,n,s;const o=[];let a=0;try{for(var l=!0,u=wi(this),c;c=yield u.next(),e=c.done,!e;l=!0){s=c.value,l=!1;const h=s;o.push(h),a+=h.byteLength}}catch(h){i={error:h}}finally{try{!l&&!e&&(n=u.return)&&(yield n.call(u))}finally{if(i)throw i.error}}return Si(o,a)[0]})}}class Dl{constructor(t){t&&(this.source=new lO(kr.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class ro{constructor(t){t instanceof ro?this.source=t.source:t instanceof Xa?this.source=new Rn(kr.fromAsyncIterable(t)):Ov(t)?this.source=new Rn(kr.fromNodeStream(t)):of(t)?this.source=new Rn(kr.fromDOMStream(t)):Av(t)?this.source=new Rn(kr.fromDOMStream(t.body)):ua(t)?this.source=new Rn(kr.fromIterable(t)):ss(t)?this.source=new Rn(kr.fromAsyncIterable(t)):ao(t)&&(this.source=new Rn(kr.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class lO{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||De)}return(t){return Object.create(this.source.return&&this.source.return(t)||De)}}class Rn{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return Zt(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return Zt(this,arguments,void 0,function*(e,i="read"){return yield this.source.next({cmd:i,size:e})})}throw(t){return Zt(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||De;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return Zt(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||De;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class Fp extends Dl{constructor(t,e){super(),this.position=0,this.buffer=le(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:i}=this.readAt(t,4);return new DataView(e,i).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Bs(this.buffer[3])} ${Bs(this.buffer[2])} ${Bs(this.buffer[1])} ${Bs(this.buffer[0])}`}static multiply(t,e){return new Li(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Li(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Li.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Li.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new Li(e);for(let o=i?1:0;o0&&this.readData(t,i)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class hO extends d0{constructor(t,e,i,n,s){super(new Uint8Array(0),e,i,n,s),this.sources=t}readNullBitmap(t,e,{offset:i}=this.nextBufferRange()){return e<=0?new Uint8Array(0):Fl(this.sources[i])}readOffsets(t,{offset:e}=this.nextBufferRange()){return _e(Uint8Array,_e(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return _e(Uint8Array,_e(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:i}=this;return At.isTimestamp(t)||(At.isInt(t)||At.isTime(t))&&t.bitWidth===64||At.isDuration(t)||At.isDate(t)&&t.unit===Yr.MILLISECOND?_e(Uint8Array,ko.convertArray(i[e])):At.isDecimal(t)?_e(Uint8Array,cO.convertArray(i[e])):At.isBinary(t)||At.isLargeBinary(t)||At.isFixedSizeBinary(t)?fO(i[e]):At.isBool(t)?Fl(i[e]):At.isUtf8(t)||At.isLargeUtf8(t)?sf(i[e].join("")):_e(Uint8Array,_e(t.ArrayType,i[e].map(n=>+n)))}}function fO(r){const t=r.join(""),e=new Uint8Array(t.length/2);for(let i=0;i>1]=Number.parseInt(t.slice(i,i+2),16);return e}let Ut=class extends ie{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((i,n)=>this.compareFields(i,e[n]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}};function ar(r,t){return t instanceof r.constructor}function hs(r,t){return r===t||ar(r,t)}function Xi(r,t){return r===t||ar(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function nu(r,t){return r===t||ar(r,t)&&r.precision===t.precision}function dO(r,t){return r===t||ar(r,t)&&r.byteWidth===t.byteWidth}function vf(r,t){return r===t||ar(r,t)&&r.unit===t.unit}function ca(r,t){return r===t||ar(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function ha(r,t){return r===t||ar(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function pO(r,t){return r===t||ar(r,t)&&r.children.length===t.children.length&&vn.compareManyFields(r.children,t.children)}function mO(r,t){return r===t||ar(r,t)&&r.children.length===t.children.length&&vn.compareManyFields(r.children,t.children)}function _f(r,t){return r===t||ar(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&vn.compareManyFields(r.children,t.children)}function yO(r,t){return r===t||ar(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&vn.visit(r.indices,t.indices)&&vn.visit(r.dictionary,t.dictionary)}function bf(r,t){return r===t||ar(r,t)&&r.unit===t.unit}function fa(r,t){return r===t||ar(r,t)&&r.unit===t.unit}function gO(r,t){return r===t||ar(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&vn.compareManyFields(r.children,t.children)}function vO(r,t){return r===t||ar(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&vn.compareManyFields(r.children,t.children)}Ut.prototype.visitNull=hs;Ut.prototype.visitBool=hs;Ut.prototype.visitInt=Xi;Ut.prototype.visitInt8=Xi;Ut.prototype.visitInt16=Xi;Ut.prototype.visitInt32=Xi;Ut.prototype.visitInt64=Xi;Ut.prototype.visitUint8=Xi;Ut.prototype.visitUint16=Xi;Ut.prototype.visitUint32=Xi;Ut.prototype.visitUint64=Xi;Ut.prototype.visitFloat=nu;Ut.prototype.visitFloat16=nu;Ut.prototype.visitFloat32=nu;Ut.prototype.visitFloat64=nu;Ut.prototype.visitUtf8=hs;Ut.prototype.visitLargeUtf8=hs;Ut.prototype.visitBinary=hs;Ut.prototype.visitLargeBinary=hs;Ut.prototype.visitFixedSizeBinary=dO;Ut.prototype.visitDate=vf;Ut.prototype.visitDateDay=vf;Ut.prototype.visitDateMillisecond=vf;Ut.prototype.visitTimestamp=ca;Ut.prototype.visitTimestampSecond=ca;Ut.prototype.visitTimestampMillisecond=ca;Ut.prototype.visitTimestampMicrosecond=ca;Ut.prototype.visitTimestampNanosecond=ca;Ut.prototype.visitTime=ha;Ut.prototype.visitTimeSecond=ha;Ut.prototype.visitTimeMillisecond=ha;Ut.prototype.visitTimeMicrosecond=ha;Ut.prototype.visitTimeNanosecond=ha;Ut.prototype.visitDecimal=hs;Ut.prototype.visitList=pO;Ut.prototype.visitStruct=mO;Ut.prototype.visitUnion=_f;Ut.prototype.visitDenseUnion=_f;Ut.prototype.visitSparseUnion=_f;Ut.prototype.visitDictionary=yO;Ut.prototype.visitInterval=bf;Ut.prototype.visitIntervalDayTime=bf;Ut.prototype.visitIntervalYearMonth=bf;Ut.prototype.visitDuration=fa;Ut.prototype.visitDurationSecond=fa;Ut.prototype.visitDurationMillisecond=fa;Ut.prototype.visitDurationMicrosecond=fa;Ut.prototype.visitDurationNanosecond=fa;Ut.prototype.visitFixedSizeList=gO;Ut.prototype.visitMap=vO;const vn=new Ut;function yh(r,t){return vn.compareSchemas(r,t)}function Zu(r,t){return _O(r,t.map(e=>e.data.concat()))}function _O(r,t){const e=[...r.fields],i=[],n={numBatches:t.reduce((h,p)=>Math.max(h,p.length),0)};let s=0,o=0,a=-1;const l=t.length;let u,c=[];for(;n.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(i[s++]=se({type:new sr(e),length:o,nullCount:0,children:c.slice()})))}return[r=r.assign(e),i.map(h=>new hr(r,h))]}function bO(r,t,e,i,n){var s;const o=(t+63&-64)>>3;for(let a=-1,l=i.length;++a=t)c===t?e[a]=u:(e[a]=u.slice(0,t),n.numBatches=Math.max(n.numBatches,i[a].unshift(u.slice(t,c-t))));else{const h=r[a];r[a]=h.clone({nullable:!0}),e[a]=(s=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:se({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var p0;let _n=class Gn{constructor(...t){var e,i;if(t.length===0)return this.batches=[],this.schema=new Pe([]),this._offsets=[0],this;let n,s;t[0]instanceof Pe&&(n=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=l=>{if(l){if(l instanceof hr)return[l];if(l instanceof Gn)return l.batches;if(l instanceof Se){if(l.type instanceof sr)return[new hr(new Pe(l.type.children),l)]}else{if(Array.isArray(l))return l.flatMap(u=>o(u));if(typeof l[Symbol.iterator]=="function")return[...l].flatMap(u=>o(u));if(typeof l=="object"){const u=Object.keys(l),c=u.map(f=>new Me([l[f]])),h=n??new Pe(u.map((f,y)=>new Ce(String(f),c[y].type,c[y].nullable))),[,p]=Zu(h,c);return p.length===0?[new hr(l)]:p}}}return[]},a=t.flatMap(l=>o(l));if(n=(i=n??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&i!==void 0?i:new Pe([]),!(n instanceof Pe))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const l of a){if(!(l instanceof hr))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!yh(n,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=a,this._offsets=s??i0(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=r0(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(hf(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?mf.visit(new Me(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ - ${this.toArray().join(`, - `)} -]`}concat(...t){const e=this.schema,i=this.data.concat(t.flatMap(({data:n})=>n));return new Gn(e,i.map(n=>new hr(e,n)))}slice(t,e){const i=this.schema;[t,e]=t0({length:this.numRows},t,e);const n=n0(this.data,this._offsets,t,e);return new Gn(i,n.map(s=>new hr(i,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&ti.children[t]);if(e.length===0){const{type:i}=this.schema.fields[t],n=se({type:i,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new Me(e)}return null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===t),e)}setChildAt(t,e){let i=this.schema,n=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[i,n]=Zu(i,a)}return new Gn(i,n)}select(t){const e=this.schema.fields.reduce((i,n,s)=>i.set(n.name,s),new Map);return this.selectAt(t.map(i=>e.get(i)).filter(i=>i>-1))}selectAt(t){const e=this.schema.selectAt(t),i=this.batches.map(n=>n.selectAt(t));return new Gn(e,i)}assign(t){const e=this.schema.fields,[i,n]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,p=e.findIndex(f=>f.name===l.name);return~p?h[p]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,n[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new Gn(...Zu(s,o))}};p0=Symbol.toStringTag;_n[p0]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Pl(pf),r.get=Pl(mr.getVisitFn(L.Struct)),r.set=s0(Xr.getVisitFn(L.Struct)),r.indexOf=o0(Ml.getVisitFn(L.Struct)),"Table"))(_n.prototype);var m0;let hr=class Ro{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Pe))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=se({nullCount:0,type:new sr(this.schema.fields),children:this.schema.fields.map(e=>se({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Pp(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:i,children:n,length:s}=Object.keys(e).reduce((l,u,c)=>(l.children[c]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[c]=Ce.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Pe(i),a=se({type:new sr(i),length:s,children:n,nullCount:0});[this.schema,this.data]=Pp(o,a.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=y0(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return mr.visit(this.data,t)}at(t){return this.get(hf(t,this.numRows))}set(t,e){return Xr.visit(this.data,t,e)}indexOf(t,e){return Ml.visit(this.data,t,e)}[Symbol.iterator](){return mf.visit(new Me([this.data]))}toArray(){return[...this]}concat(...t){return new _n(this.schema,[this,...t])}slice(t,e){const[i]=new Me([this.data]).slice(t,e).data;return new Ro(this.schema,i)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&tn.name===t),e)}setChildAt(t,e){let i=this.schema,n=this.data;if(t>-1&&ta.name===s);~o&&(n[o]=this.data.children[o])}return new Ro(e,se({type:i,length:this.numRows,children:n}))}selectAt(t){const e=this.schema.selectAt(t),i=t.map(s=>this.data.children[s]).filter(Boolean),n=se({type:new sr(e.fields),length:this.numRows,children:i});return new Ro(e,n)}};m0=Symbol.toStringTag;hr[m0]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(hr.prototype);function Pp(r,t,e=t.reduce((i,n)=>Math.max(i,n.length),0)){var i;const n=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of r.fields.entries()){const u=t[a];(!u||u.length!==e)&&(n[a]=l.clone({nullable:!0}),s[a]=(i=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:se({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(n),se({type:new sr(n),length:e,children:s})]}function y0(r,t,e=new Map){var i,n;if(((i=r==null?void 0:r.length)!==null&&i!==void 0?i:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sse({type:n.type})),i=se({type:new sr(t.fields),nullCount:0,children:e});super(t,i)}}let rn=class li{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new li).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+me),(e||new li).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ke.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):fe.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,ke.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,fe.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,i,n,s,o){return li.startMessage(t),li.addVersion(t,e),li.addHeaderType(t,i),li.addHeader(t,n),li.addBodyLength(t,s),li.addCustomMetadata(t,o),li.endMessage(t)}};class wO extends ie{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return wp.startNull(e),wp.endNull(e)}visitInt(t,e){return Sr.startInt(e),Sr.addBitWidth(e,t.bitWidth),Sr.addIsSigned(e,t.isSigned),Sr.endInt(e)}visitFloat(t,e){return yi.startFloatingPoint(e),yi.addPrecision(e,t.precision),yi.endFloatingPoint(e)}visitBinary(t,e){return yp.startBinary(e),yp.endBinary(e)}visitLargeBinary(t,e){return vp.startLargeBinary(e),vp.endLargeBinary(e)}visitBool(t,e){return gp.startBool(e),gp.endBool(e)}visitUtf8(t,e){return xp.startUtf8(e),xp.endUtf8(e)}visitLargeUtf8(t,e){return _p.startLargeUtf8(e),_p.endLargeUtf8(e)}visitDecimal(t,e){return Is.startDecimal(e),Is.addScale(e,t.scale),Is.addPrecision(e,t.precision),Is.addBitWidth(e,t.bitWidth),Is.endDecimal(e)}visitDate(t,e){return $a.startDate(e),$a.addUnit(e,t.unit),$a.endDate(e)}visitTime(t,e){return zr.startTime(e),zr.addUnit(e,t.unit),zr.addBitWidth(e,t.bitWidth),zr.endTime(e)}visitTimestamp(t,e){const i=t.timezone&&e.createString(t.timezone)||void 0;return jr.startTimestamp(e),jr.addUnit(e,t.unit),i!==void 0&&jr.addTimezone(e,i),jr.endTimestamp(e)}visitInterval(t,e){return gi.startInterval(e),gi.addUnit(e,t.unit),gi.endInterval(e)}visitDuration(t,e){return Va.startDuration(e),Va.addUnit(e,t.unit),Va.endDuration(e)}visitList(t,e){return bp.startList(e),bp.endList(e)}visitStruct(t,e){return Qn.startStruct_(e),Qn.endStruct_(e)}visitUnion(t,e){cr.startTypeIdsVector(e,t.typeIds.length);const i=cr.createTypeIdsVector(e,t.typeIds);return cr.startUnion(e),cr.addMode(e,t.mode),cr.addTypeIds(e,i),cr.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return Vi.startDictionaryEncoding(e),Vi.addId(e,BigInt(t.id)),Vi.addIsOrdered(e,t.isOrdered),i!==void 0&&Vi.addIndexType(e,i),Vi.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return Ga.startFixedSizeBinary(e),Ga.addByteWidth(e,t.byteWidth),Ga.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Wa.startFixedSizeList(e),Wa.addListSize(e,t.listSize),Wa.endFixedSizeList(e)}visitMap(t,e){return Ha.startMap(e),Ha.addKeysSorted(e,t.keysSorted),Ha.endMap(e)}}const Ju=new wO;function xO(r,t=new Map){return new Pe(TO(r,t),qa(r.metadata),t)}function g0(r){return new Pr(r.count,v0(r.columns),_0(r.columns))}function SO(r){return new Ii(g0(r.data),r.id,r.isDelta)}function TO(r,t){return(r.fields||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function Mp(r,t){return(r.children||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function v0(r){return(r||[]).reduce((t,e)=>[...t,new bn(e.count,IO(e.VALIDITY)),...v0(e.children)],[])}function _0(r,t=[]){for(let e=-1,i=(r||[]).length;++et+ +(e===0),0)}function EO(r,t){let e,i,n,s,o,a;return!t||!(s=r.dictionary)?(o=Rp(r,Mp(r,t)),n=new Ce(r.name,o,r.nullable,qa(r.metadata))):t.has(e=s.id)?(i=(i=s.indexType)?Dp(i):new Jo,a=new eo(t.get(e),i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,qa(r.metadata))):(i=(i=s.indexType)?Dp(i):new Jo,t.set(e,o=Rp(r,Mp(r,t))),a=new eo(o,i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,qa(r.metadata))),n||null}function qa(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function Dp(r){return new os(r.isSigned,r.bitWidth)}function Rp(r,t){const e=r.type.name;switch(e){case"NONE":return new yn;case"null":return new yn;case"binary":return new dl;case"largebinary":return new pl;case"utf8":return new ml;case"largeutf8":return new yl;case"bool":return new gl;case"list":return new Tl((t||[])[0]);case"struct":return new sr(t||[]);case"struct_":return new sr(t||[])}switch(e){case"int":{const i=r.type;return new os(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=r.type;return new fl(tr[i.precision])}case"decimal":{const i=r.type;return new vl(i.scale,i.precision,i.bitWidth)}case"date":{const i=r.type;return new _l(Yr[i.unit])}case"time":{const i=r.type;return new bl(Vt[i.unit],i.bitWidth)}case"timestamp":{const i=r.type;return new wl(Vt[i.unit],i.timezone)}case"interval":{const i=r.type;return new xl(Ti[i.unit])}case"duration":{const i=r.type;return new Sl(Vt[i.unit])}case"union":{const i=r.type,[n,...s]=(i.mode+"").toLowerCase(),o=n.toUpperCase()+s.join("");return new Il(er[o],i.typeIds||[],t||[])}case"fixedsizebinary":{const i=r.type;return new El(i.byteWidth)}case"fixedsizelist":{const i=r.type;return new Cl(i.listSize,(t||[])[0])}case"map":{const i=r.type;return new Al((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var CO=Dv,AO=Js;class or{static fromJSON(t,e){const i=new or(0,ke.V5,e);return i._createHeader=OO(t,e),i}static decode(t){t=new AO(le(t));const e=rn.getRootAsMessage(t),i=e.bodyLength(),n=e.version(),s=e.headerType(),o=new or(i,n,s);return o._createHeader=FO(e,s),o}static encode(t){const e=new CO;let i=-1;return t.isSchema()?i=Pe.encode(e,t.header()):t.isRecordBatch()?i=Pr.encode(e,t.header()):t.isDictionaryBatch()&&(i=Ii.encode(e,t.header())),rn.startMessage(e),rn.addVersion(e,ke.V5),rn.addHeader(e,i),rn.addHeaderType(e,t.headerType),rn.addBodyLength(e,BigInt(t.bodyLength)),rn.finishMessageBuffer(e,rn.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Pe)return new or(0,ke.V5,fe.Schema,t);if(t instanceof Pr)return new or(e,ke.V5,fe.RecordBatch,t);if(t instanceof Ii)return new or(e,ke.V5,fe.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===fe.Schema}isRecordBatch(){return this.headerType===fe.RecordBatch}isDictionaryBatch(){return this.headerType===fe.DictionaryBatch}constructor(t,e,i,n){this._version=e,this._headerType=i,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=we(t)}}class Pr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,i){this._nodes=e,this._buffers=i,this._length=we(t)}}class Ii{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,i=!1){this._data=t,this._isDelta=i,this._id=we(e)}}class _i{constructor(t,e){this.offset=we(t),this.length=we(e)}}class bn{constructor(t,e){this.length=we(t),this.nullCount=we(e)}}function OO(r,t){return()=>{switch(t){case fe.Schema:return Pe.fromJSON(r);case fe.RecordBatch:return Pr.fromJSON(r);case fe.DictionaryBatch:return Ii.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}function FO(r,t){return()=>{switch(t){case fe.Schema:return Pe.decode(r.header(new ci),new Map,r.version());case fe.RecordBatch:return Pr.decode(r.header(new ki),r.version());case fe.DictionaryBatch:return Ii.decode(r.header(new Ss),r.version())}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}Ce.encode=jO;Ce.decode=UO;Ce.fromJSON=EO;Pe.encode=zO;Pe.decode=PO;Pe.fromJSON=xO;Pr.encode=$O;Pr.decode=MO;Pr.fromJSON=g0;Ii.encode=VO;Ii.decode=DO;Ii.fromJSON=SO;bn.encode=GO;bn.decode=NO;_i.encode=WO;_i.decode=RO;function PO(r,t=new Map,e=ke.V5){const i=kO(r,t);return new Pe(i,Qa(r),t,e)}function MO(r,t=ke.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Pr(r.length(),LO(r),BO(r,t))}function DO(r,t=ke.V5){return new Ii(Pr.decode(r.data(),t),r.id(),r.isDelta())}function RO(r){return new _i(r.offset(),r.length())}function NO(r){return new bn(r.length(),r.nullCount())}function LO(r){const t=[];for(let e,i=-1,n=-1,s=r.nodesLength();++iCe.encode(r,s));ci.startFieldsVector(r,e.length);const i=ci.createFieldsVector(r,e),n=t.metadata&&t.metadata.size>0?ci.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return We.startKeyValue(r),We.addKey(r,a),We.addValue(r,l),We.endKeyValue(r)})):-1;return ci.startSchema(r),ci.addFields(r,i),ci.addEndianness(r,HO?to.Little:to.Big),n!==-1&&ci.addCustomMetadata(r,n),ci.endSchema(r)}function jO(r,t){let e=-1,i=-1,n=-1;const s=t.type;let o=t.typeId;At.isDictionary(s)?(o=s.dictionary.typeId,n=Ju.visit(s,r),i=Ju.visit(s.dictionary,r)):i=Ju.visit(s,r);const a=(s.children||[]).map(c=>Ce.encode(r,c)),l=Lr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Lr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const p=r.createString(`${c}`),f=r.createString(`${h}`);return We.startKeyValue(r),We.addKey(r,p),We.addValue(r,f),We.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Lr.startField(r),Lr.addType(r,i),Lr.addTypeType(r,o),Lr.addChildren(r,l),Lr.addNullable(r,!!t.nullable),e!==-1&&Lr.addName(r,e),n!==-1&&Lr.addDictionary(r,n),u!==-1&&Lr.addCustomMetadata(r,u),Lr.endField(r)}function $O(r,t){const e=t.nodes||[],i=t.buffers||[];ki.startNodesVector(r,e.length);for(const o of e.slice().reverse())bn.encode(r,o);const n=r.endVector();ki.startBuffersVector(r,i.length);for(const o of i.slice().reverse())_i.encode(r,o);const s=r.endVector();return ki.startRecordBatch(r),ki.addLength(r,BigInt(t.length)),ki.addNodes(r,n),ki.addBuffers(r,s),ki.endRecordBatch(r)}function VO(r,t){const e=Pr.encode(r,t.data);return Ss.startDictionaryBatch(r),Ss.addId(r,BigInt(t.id)),Ss.addIsDelta(r,t.isDelta),Ss.addData(r,e),Ss.endDictionaryBatch(r)}function GO(r,t){return Lv.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function WO(r,t){return Nv.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const HO=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),xf=r=>`Expected ${fe[r]} Message in stream, but was null or length 0.`,Sf=r=>`Header pointer of flatbuffer-encoded ${fe[r]} Message is null or length 0.`,b0=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,w0=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class x0{constructor(t){this.source=t instanceof Dl?t:new Dl(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?De:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(xf(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=le(this.source.read(t));if(e.byteLength[...n,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(xf(t));return e.value}readSchema(){const t=fe.Schema,e=this.readMessage(t),i=e==null?void 0:e.header();if(!e||!i)throw new Error(Sf(t));return i}}const su=4,gh="ARROW1",ea=new Uint8Array(gh.length);for(let r=0;rthis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return kr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return kr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof Vr?t:sh(t)?JO(t):Cv(t)?r2(t):ss(t)?Zt(this,void 0,void 0,function*(){return yield Vr.from(yield t)}):Av(t)||of(t)||Ov(t)||ao(t)?e2(new ro(t)):t2(new Dl(t))}static readAll(t){return t instanceof Vr?t.isSync()?kp(t):Up(t):sh(t)||ArrayBuffer.isView(t)||ua(t)||Ev(t)?kp(t):Up(t)}}class Nl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return fr(this,arguments,function*(){yield Nt(yield*is(wi(this[Symbol.iterator]())))})}}class Ll extends Vr{constructor(t){super(t),this._impl=t}readAll(){return Zt(this,void 0,void 0,function*(){var t,e,i,n;const s=new Array;try{for(var o=!0,a=wi(this),l;l=yield a.next(),t=l.done,!t;o=!0){n=l.value,o=!1;const u=n;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class T0 extends Nl{constructor(t){super(t),this._impl=t}}class QO extends Ll{constructor(t){super(t),this._impl=t}}class I0{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const i=this._loadVectors(t,e,this.schema.fields),n=se({type:new sr(this.schema.fields),length:t.length,children:i});return new hr(this.schema,n)}_loadDictionaryBatch(t,e){const{id:i,isDelta:n}=t,{dictionaries:s,schema:o}=this,a=s.get(i),l=o.dictionaries.get(i),u=this._loadVectors(t.data,e,[l]);return(a&&n?a.concat(new Me(u)):new Me(u)).memoize()}_loadVectors(t,e,i){return new d0(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}}class Bl extends I0{constructor(t,e){super(e),this._reader=sh(t)?new XO(this._handle=t):new x0(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=C0(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):De}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):De}next(){if(this.closed)return De;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new wf(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class kl extends I0{constructor(t,e){super(e),this._reader=new YO(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Zt(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return Zt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=C0(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):De})}return(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):De})}next(){return Zt(this,void 0,void 0,function*(){if(this.closed)return De;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new wf(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class E0 extends Bl{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof Fp?t:new Fp(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-S0,i=t.readInt32(e),n=t.readAt(e-i,i);return ta.decode(n)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Zt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Zt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Zt(this,void 0,void 0,function*(){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Zt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-S0,i=yield t.readInt32(e),n=yield t.readAt(e-i,i);return ta.decode(n)})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Tf(t)?new T0(new E0(r.read())):new Nl(new Bl(r)):new Nl(new Bl(function*(){}()))}function e2(r){return Zt(this,void 0,void 0,function*(){const t=yield r.peek(da+7&-8);return t&&t.byteLength>=4?Tf(t)?new T0(new E0(yield r.read())):new Ll(new kl(r)):new Ll(new kl(function(){return fr(this,arguments,function*(){})}()))})}function r2(r){return Zt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Rl(r,t);return t>=qO&&Tf(yield e.readAt(0,da+7&-8))?new QO(new KO(e)):new Ll(new kl(e))})}class Ne extends ie{static assemble(...t){const e=n=>n.flatMap(s=>Array.isArray(s)?e(s):s instanceof hr?s.data.children:s.data),i=new Ne;return i.visitMany(e(t)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Me)return this.visitMany(t.data),this;const{type:e}=t;if(!At.isDictionary(e)){const{length:i}=t;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(At.isUnion(e))this.nodes.push(new bn(i,0));else{const{nullCount:n}=t;At.isNull(e)||ei.call(this,n<=0?new Uint8Array(0):Ol(t.offset,i,t.nullBitmap)),this.nodes.push(new bn(i,n))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function ei(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new _i(this._byteLength,t)),this._byteLength+=t,this}function i2(r){var t;const{type:e,length:i,typeIds:n,valueOffsets:s}=r;if(ei.call(this,n),e.mode===er.Sparse)return vh.call(this,r);if(e.mode===er.Dense){if(r.offset<=0)return ei.call(this,s),vh.call(this,r);{const o=new Int32Array(i),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],p=a[h],f=l[h];return u.slice(p,Math.min(i,f))}))}}return this}function n2(r){let t;return r.nullCount>=r.length?ei.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?ei.call(this,Ol(r.offset,r.length,t)):ei.call(this,Fl(r.values))}function qi(r){return ei.call(this,r.values.subarray(0,r.length*r.stride))}function ou(r){const{length:t,values:e,valueOffsets:i}=r,n=we(i[0]),s=we(i[t]),o=Math.min(s-n,e.byteLength-n);return ei.call(this,Pv(-n,t+1,i)),ei.call(this,e.subarray(n,n+o)),this}function If(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:i,[t]:n}=e;return ei.call(this,Pv(-i,t+1,e)),this.visit(r.children[0].slice(i,n-i))}return this.visit(r.children[0])}function vh(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}Ne.prototype.visitBool=n2;Ne.prototype.visitInt=qi;Ne.prototype.visitFloat=qi;Ne.prototype.visitUtf8=ou;Ne.prototype.visitLargeUtf8=ou;Ne.prototype.visitBinary=ou;Ne.prototype.visitLargeBinary=ou;Ne.prototype.visitFixedSizeBinary=qi;Ne.prototype.visitDate=qi;Ne.prototype.visitTimestamp=qi;Ne.prototype.visitTime=qi;Ne.prototype.visitDecimal=qi;Ne.prototype.visitList=If;Ne.prototype.visitStruct=vh;Ne.prototype.visitUnion=i2;Ne.prototype.visitInterval=qi;Ne.prototype.visitDuration=qi;Ne.prototype.visitFixedSizeList=If;Ne.prototype.visitMap=If;class A0 extends yf{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Xa,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,pr(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return ss(t)?t.then(e=>this.writeAll(e)):ao(t)?Of(this,t):Af(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof Xa?this._sink=t:(this._sink=new Xa,t&&DC(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&RC(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!yh(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof _n&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof hr&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!yh(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof hr?t instanceof wf||this._writeRecordBatch(t):t instanceof _n?this.writeAll(t.batches):ua(t)&&this.writeAll(t)}_writeMessage(t,e=8){const i=e-1,n=or.encode(t),s=n.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+i&~i,l=a-s-o;return t.headerType===fe.RecordBatch?this._recordBatchBlocks.push(new gn(a,t.bodyLength,this._position)):t.headerType===fe.DictionaryBatch&&this._dictionaryBlocks.push(new gn(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(n),this._writePadding(l)}_write(t){if(this._started){const e=le(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(or.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ea)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:n,buffers:s}=Ne.assemble(t),o=new Pr(t.numRows,i,n),a=or.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,i=!1){const{byteLength:n,nodes:s,bufferRegions:o,buffers:a}=Ne.assemble(new Me([t])),l=new Pr(t.length,s,o),u=new Ii(l,e,i),c=or.from(u,n);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,i,n;for(let s=-1,o=t.length;++s0&&(this._write(e),(n=(i+7&-8)-i)>0&&this._writePadding(n));return this}_writeDictionaries(t){var e,i;for(const[n,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(n),l=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,n,u>0);else if(li.writeAll(n)):ao(t)?Of(i,t):Af(i,t)}}class Cf extends A0{static writeAll(t){const e=new Cf;return ss(t)?t.then(i=>e.writeAll(i)):ao(t)?Of(e,t):Af(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,i=!1){if(!i&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,i)}_writeFooter(t){const e=ta.encode(new ta(t,ke.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function Af(r,t){let e=t;t instanceof _n&&(e=t.batches,r.reset(void 0,t.schema));for(const i of e)r.write(i);return r.finish()}function Of(r,t){return Zt(this,void 0,void 0,function*(){var e,i,n,s,o,a,l;try{for(e=!0,i=wi(t);n=yield i.next(),s=n.done,!s;e=!0){l=n.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=i.return)&&(yield a.call(i))}finally{if(o)throw o.error}}return r.finish()})}function s2(r,t="stream"){return(t==="stream"?Ef:Cf).writeAll(r).toUint8Array(!0)}var o2=Object.create,O0=Object.defineProperty,a2=Object.getOwnPropertyDescriptor,l2=Object.getOwnPropertyNames,u2=Object.getPrototypeOf,c2=Object.prototype.hasOwnProperty,h2=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),f2=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of l2(t))!c2.call(r,n)&&n!==e&&O0(r,n,{get:()=>t[n],enumerable:!(i=a2(t,n))||i.enumerable});return r},d2=(r,t,e)=>(e=r!=null?o2(u2(r)):{},f2(!r||!r.__esModule?O0(e,"default",{value:r,enumerable:!0}):e,r)),p2=h2((r,t)=>{t.exports=Worker}),F0=(r=>(r[r.UNDEFINED=0]="UNDEFINED",r[r.AUTOMATIC=1]="AUTOMATIC",r[r.READ_ONLY=2]="READ_ONLY",r[r.READ_WRITE=3]="READ_WRITE",r))(F0||{}),m2=(r=>(r[r.IDENTIFIER=0]="IDENTIFIER",r[r.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",r[r.STRING_CONSTANT=2]="STRING_CONSTANT",r[r.OPERATOR=3]="OPERATOR",r[r.KEYWORD=4]="KEYWORD",r[r.COMMENT=5]="COMMENT",r))(m2||{}),y2=(r=>(r[r.NONE=0]="NONE",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARNING=3]="WARNING",r[r.ERROR=4]="ERROR",r))(y2||{}),g2=(r=>(r[r.NONE=0]="NONE",r[r.CONNECT=1]="CONNECT",r[r.DISCONNECT=2]="DISCONNECT",r[r.OPEN=3]="OPEN",r[r.QUERY=4]="QUERY",r[r.INSTANTIATE=5]="INSTANTIATE",r))(g2||{}),v2=(r=>(r[r.NONE=0]="NONE",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR",r[r.START=3]="START",r[r.RUN=4]="RUN",r[r.CAPTURE=5]="CAPTURE",r))(v2||{}),_2=(r=>(r[r.NONE=0]="NONE",r[r.WEB_WORKER=1]="WEB_WORKER",r[r.NODE_WORKER=2]="NODE_WORKER",r[r.BINDINGS=3]="BINDINGS",r[r.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",r))(_2||{}),b2=class{log(r){}},P0=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},w2=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(w2||{}),x2=class{constructor(r,t){this._bindings=r,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(r){return r(this._bindings,this._conn)}async query(r){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let t=await this._bindings.runQuery(this._conn,r),e=Vr.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new _n(e)}async send(r,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let e=await this._bindings.startPendingQuery(this._conn,r,t);for(;e==null;)e=await this._bindings.pollPendingQuery(this._conn);let i=new M0(this._bindings,this._conn,e),n=await Vr.from(i);return console.assert(n.isAsync()),console.assert(n.isStream()),n}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(r){return await this._bindings.getTableNames(this._conn,r)}async prepare(r){let t=await this._bindings.createPrepared(this._conn,r);return new S2(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=s2(r,"stream");await this.insertArrowFromIPCStream(e,t)}async insertArrowFromIPCStream(r,t){await this._bindings.insertArrowFromIPCStream(this._conn,r,t)}async insertCSVFromPath(r,t){await this._bindings.insertCSVFromPath(this._conn,r,t)}async insertJSONFromPath(r,t){await this._bindings.insertJSONFromPath(this._conn,r,t)}},M0=class{constructor(r,t,e){this.db=r,this.conn=t,this.header=e,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let r;return this._inFlight!=null?(r=await this._inFlight,this._inFlight=null):r=await this.db.fetchQueryResults(this.conn),this._depleted=r.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:r}}[Symbol.asyncIterator](){return this}},S2=class{constructor(r,t,e){this.bindings=r,this.connectionId=t,this.statementId=e}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...r){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,r),e=Vr.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new _n(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new M0(this.bindings,this.connectionId,t),i=await Vr.from(e);return console.assert(i.isAsync()),console.assert(i.isStream()),i}},T2=(r=>(r.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",r.CLOSE_PREPARED="CLOSE_PREPARED",r.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",r.REGISTER_OPFS_FILE_NAME="REGISTER_OPFS_FILE_NAME",r.CONNECT="CONNECT",r.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",r.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",r.CREATE_PREPARED="CREATE_PREPARED",r.DISCONNECT="DISCONNECT",r.DROP_FILE="DROP_FILE",r.DROP_FILES="DROP_FILES",r.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",r.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",r.FLUSH_FILES="FLUSH_FILES",r.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",r.GET_TABLE_NAMES="GET_TABLE_NAMES",r.GET_VERSION="GET_VERSION",r.GLOB_FILE_INFOS="GLOB_FILE_INFOS",r.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",r.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",r.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",r.INSTANTIATE="INSTANTIATE",r.OPEN="OPEN",r.PING="PING",r.POLL_PENDING_QUERY="POLL_PENDING_QUERY",r.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",r.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",r.REGISTER_FILE_URL="REGISTER_FILE_URL",r.RESET="RESET",r.RUN_PREPARED="RUN_PREPARED",r.RUN_QUERY="RUN_QUERY",r.SEND_PREPARED="SEND_PREPARED",r.START_PENDING_QUERY="START_PENDING_QUERY",r.TOKENIZE="TOKENIZE",r))(T2||{}),I2=(r=>(r.CONNECTION_INFO="CONNECTION_INFO",r.ERROR="ERROR",r.FEATURE_FLAGS="FEATURE_FLAGS",r.FILE_BUFFER="FILE_BUFFER",r.FILE_INFOS="FILE_INFOS",r.FILE_SIZE="FILE_SIZE",r.FILE_STATISTICS="FILE_STATISTICS",r.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",r.LOG="LOG",r.OK="OK",r.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",r.QUERY_PLAN="QUERY_PLAN",r.QUERY_RESULT="QUERY_RESULT",r.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",r.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",r.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",r.REGISTERED_FILE="REGISTERED_FILE",r.SCRIPT_TOKENS="SCRIPT_TOKENS",r.SUCCESS="SUCCESS",r.TABLE_NAMES="TABLE_NAMES",r.VERSION_STRING="VERSION_STRING",r))(I2||{}),ue=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,i)=>{this.promiseResolver=e,this.promiseRejecter=i})}};function Ka(r){switch(r.typeId){case L.Binary:return{sqlType:"binary"};case L.Bool:return{sqlType:"bool"};case L.Date:return{sqlType:"date"};case L.DateDay:return{sqlType:"date32[d]"};case L.DateMillisecond:return{sqlType:"date64[ms]"};case L.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case L.Float:return{sqlType:"float"};case L.Float16:return{sqlType:"float16"};case L.Float32:return{sqlType:"float32"};case L.Float64:return{sqlType:"float64"};case L.Int:return{sqlType:"int32"};case L.Int16:return{sqlType:"int16"};case L.Int32:return{sqlType:"int32"};case L.Int64:return{sqlType:"int64"};case L.Uint16:return{sqlType:"uint16"};case L.Uint32:return{sqlType:"uint32"};case L.Uint64:return{sqlType:"uint64"};case L.Uint8:return{sqlType:"uint8"};case L.IntervalDayTime:return{sqlType:"interval[dt]"};case L.IntervalYearMonth:return{sqlType:"interval[m]"};case L.List:return{sqlType:"list",valueType:Ka(r.valueType)};case L.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case L.Null:return{sqlType:"null"};case L.Utf8:return{sqlType:"utf8"};case L.Struct:return{sqlType:"struct",fields:r.children.map(t=>_h(t.name,t.type))};case L.Map:{let t=r;return{sqlType:"map",keyType:Ka(t.keyType),valueType:Ka(t.valueType)}}case L.Time:return{sqlType:"time[s]"};case L.TimeMicrosecond:return{sqlType:"time[us]"};case L.TimeMillisecond:return{sqlType:"time[ms]"};case L.TimeNanosecond:return{sqlType:"time[ns]"};case L.TimeSecond:return{sqlType:"time[s]"};case L.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case L.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case L.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case L.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case L.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function _h(r,t){let e=Ka(t);return e.name=r,e}var E2=new TextEncoder,C2=class{constructor(r,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=r,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(r){this._worker=r,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(r,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let e=this._nextMessageId++;return this._pendingRequests.set(e,r),this._worker.postMessage({messageId:e,type:r.type,data:r.data},t),await r.promise}onMessage(r){var t;let e=r.data;switch(e.type){case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let n of this._onInstantiationProgress)n(e.data);return}}let i=this._pendingRequests.get(e.requestId);if(!i){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let n=new Error(e.data.message);n.name=e.data.name,(t=Object.getOwnPropertyDescriptor(n,"stack"))!=null&&t.writable&&(n.stack=e.data.stack),i.promiseRejecter(n);return}switch(i.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"REGISTER_OPFS_FILE_NAME":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(e.type=="OK"){i.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){i.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){i.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){i.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){i.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){i.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){i.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){i.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){i.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){i.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){i.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){i.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){i.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){i.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){i.promiseResolver(e.data);return}break}i.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(r){console.error(r),console.error("error in duckdb worker: ".concat(r.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let r=new ue("RESET",null);return await this.postTask(r)}async ping(){let r=new ue("PING",null);await this.postTask(r)}async dropFile(r){let t=new ue("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new ue("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new ue("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=i=>{}){this._onInstantiationProgress.push(e);let i=new ue("INSTANTIATE",[r,t]);return await this.postTask(i)}async getVersion(){let r=new ue("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new ue("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new ue("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new ue("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new ue("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new x2(this,r)}async disconnect(r){let t=new ue("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new ue("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let i=new ue("START_PENDING_QUERY",[r,t,e]);return await this.postTask(i)}async pollPendingQuery(r){let t=new ue("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new ue("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new ue("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new ue("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new ue("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new ue("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let i=new ue("RUN_PREPARED",[r,t,e]);return await this.postTask(i)}async sendPrepared(r,t,e){let i=new ue("SEND_PREPARED",[r,t,e]);return await this.postTask(i)}async globFiles(r){let t=new ue("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=E2.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,i){t===void 0&&(t=r);let n=new ue("REGISTER_FILE_URL",[r,t,e,i]);await this.postTask(n)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new ue("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,i){let n=new ue("REGISTER_FILE_HANDLE",[r,t,e,i]);await this.postTask(n,[])}async registerOPFSFileName(r){let t=new ue("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new ue("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new ue("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new ue("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new ue("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let i=new ue("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(i,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(_h(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(i)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(_h(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(i)}};function A2(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}A2();var O2=(r=>(r[r.BUFFER=0]="BUFFER",r[r.NODE_FS=1]="NODE_FS",r[r.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",r[r.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",r[r.HTTP=4]="HTTP",r[r.S3=5]="S3",r))(O2||{}),F2=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])),P2=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])),M2=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])),D2=()=>(async r=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(r)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),R2={version:"1.29.1-dev68.0"},Ff=R2.version.split(".");Ff[0];Ff[1];Ff[2];var N2=()=>typeof navigator>"u",tc=null,ec=null,rc=null,ic=null,nc=null;async function L2(){return tc==null&&(tc=typeof BigInt64Array<"u"),ec==null&&(ec=await P2()),rc==null&&(rc=await D2()),ic==null&&(ic=await M2()),nc==null&&(nc=await F2()),{bigInt64Array:tc,crossOriginIsolated:N2()||globalThis.crossOriginIsolated||!1,wasmExceptions:ec,wasmSIMD:ic,wasmThreads:rc,wasmBulkMemory:nc}}async function zp(r){let t=await L2();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&r.coi)return{mainModule:r.coi.mainModule,mainWorker:r.coi.mainWorker,pthreadWorker:r.coi.pthreadWorker};if(r.eh)return{mainModule:r.eh.mainModule,mainWorker:r.eh.mainWorker,pthreadWorker:null}}return{mainModule:r.mvp.mainModule,mainWorker:r.mvp.mainWorker,pthreadWorker:null}}d2(p2());const sc={},No={};function Uo(r,t){try{const i=(sc[r]||(sc[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return i in No?No[i]:jp(i,i.split(":"))}catch{if(r in No)return No[r];const e=r==null?void 0:r.match(B2);return e?jp(r,e.slice(1)):NaN}}const B2=/([+-]\d\d):?(\d\d)?/;function jp(r,t){const e=+t[0],i=+(t[1]||0);return No[r]=e>0?e*60+i:e*60-i}class Cr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Uo(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),D0(this),bh(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Cr(...e,t):new Cr(Date.now(),t)}withTimeZone(t){return new Cr(+this,t)}getTimezoneOffset(){return-Uo(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),bh(this),+this}[Symbol.for("constructDateFrom")](t){return new Cr(+new Date(t),this.timeZone)}}const $p=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!$p.test(r))return;const t=r.replace($p,"$1UTC");Cr.prototype[t]&&(r.startsWith("get")?Cr.prototype[r]=function(){return this.internal[t]()}:(Cr.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),k2(this),+this},Cr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),bh(this),+this}))});function bh(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function k2(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),D0(r)}function D0(r){const t=Uo(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const i=-new Date(+r).getTimezoneOffset(),n=-new Date(+e).getTimezoneOffset(),s=i-n,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=i-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Uo(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,p=c-a;if(h&&p){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+p);const f=Uo(r.timeZone,r),y=l-f;y&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+y))}}const U2=new TextDecoder("utf-8"),z2=r=>U2.decode(r),j2=new TextEncoder,R0=r=>j2.encode(r),fi=r=>typeof r=="function",pa=r=>r!=null&&Object(r)===r,$2=r=>pa(r)&&fi(r.then),N0=r=>pa(r)&&fi(r[Symbol.iterator]),V2=r=>pa(r)&&fi(r[Symbol.asyncIterator]),G2=r=>pa(r)&&"done"in r&&"value"in r,W2=r=>pa(r)&&fi(r.clear)&&fi(r.bytes)&&fi(r.position)&&fi(r.setPosition)&&fi(r.capacity)&&fi(r.getBufferIdentifier)&&fi(r.createLong),Pf=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function H2(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++lrr(Int8Array,r),q2=r=>rr(Int16Array,r),Q2=r=>rr(Int32Array,r),K2=r=>rr(BigInt64Array,r),Z2=r=>rr(Uint8Array,r),J2=r=>rr(Uint16Array,r),tF=r=>rr(Uint32Array,r),eF=r=>rr(BigUint64Array,r),rF=r=>rr(Float32Array,r),iF=r=>rr(Float64Array,r),nF=r=>rr(Uint8ClampedArray,r),xh=r=>(r.next(),r);function*Fi(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Pf?e(t):N0(t)?t:e(t);return yield*xh(function*(n){let s=null;do s=n.next(yield rr(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const sF=r=>Fi(Int8Array,r),oF=r=>Fi(Int16Array,r),aF=r=>Fi(Int32Array,r),lF=r=>Fi(Uint8Array,r),uF=r=>Fi(Uint16Array,r),cF=r=>Fi(Uint32Array,r),hF=r=>Fi(Float32Array,r),fF=r=>Fi(Float64Array,r),dF=r=>Fi(Uint8ClampedArray,r);function ni(r,t){return fr(this,arguments,function*(){if($2(t))return yield Nt(yield Nt(yield*is(wi(ni(r,yield Nt(t))))));const i=function(o){return fr(this,arguments,function*(){yield yield Nt(yield Nt(o))})},n=function(o){return fr(this,arguments,function*(){yield Nt(yield*is(wi(xh(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Pf?i(t):N0(t)?n(t):V2(t)?t:i(t);return yield Nt(yield*is(wi(xh(function(o){return fr(this,arguments,function*(){let a=null;do a=yield Nt(o.next(yield yield Nt(rr(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Nt(new r)})}const pF=r=>ni(Int8Array,r),mF=r=>ni(Int16Array,r),yF=r=>ni(Int32Array,r),gF=r=>ni(Uint8Array,r),vF=r=>ni(Uint16Array,r),_F=r=>ni(Uint32Array,r),bF=r=>ni(Float32Array,r),wF=r=>ni(Float64Array,r),xF=r=>ni(Uint8ClampedArray,r);function SF(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++eno(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const EF=Object.freeze(Object.defineProperty({__proto__:null,valueToString:no},Symbol.toStringTag,{value:"Module"}));function Or(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function B0(r,t){return Or(r/t)+Or(r%t)/Or(t)}const k0=Symbol.for("isArrowBigNum");function si(r,...t){return t.length===0?Object.setPrototypeOf(rr(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}si.prototype[k0]=!0;si.prototype.toJSON=function(){return`"${so(this)}"`};si.prototype.valueOf=function(r){return Mf(this,r)};si.prototype.toString=function(){return so(this)};si.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Mf(this);case"string":return so(this);case"default":return U0(this)}return so(this)};function Hs(...r){return si.apply(this,r)}function Ys(...r){return si.apply(this,r)}function ra(...r){return si.apply(this,r)}Object.setPrototypeOf(Hs.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ys.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ra.prototype,Object.create(Uint32Array.prototype));Object.assign(Hs.prototype,si.prototype,{constructor:Hs,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ys.prototype,si.prototype,{constructor:Ys,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ra.prototype,si.prototype,{constructor:ra,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const CF=BigInt(4294967296)*BigInt(4294967296),AF=CF-BigInt(1);function Mf(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<0){const c=BigInt("1".padEnd(t+1,"0")),h=l/c,p=a?-(l%c):l%c,f=Or(h),y=`${p}`.padStart(t,"0");return+`${a&&f===0?"-":""}${f}.${y}`}return Or(l)}function so(r){if(r.byteLength===8)return`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`;if(!r.signed)return oc(r);let t=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return oc(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Et.prototype);class Vp extends Et{constructor(){super(W.Null)}toString(){return"Null"}}j0=Symbol.toStringTag;Vp[j0]=(r=>r[Symbol.toStringTag]="Null")(Vp.prototype);class Gp extends Et{constructor(t,e){super(W.Int),this.isSigned=t,this.bitWidth=e}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}$0=Symbol.toStringTag;Gp[$0]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Gp.prototype);class Wp extends Et{constructor(t){super(W.Float),this.precision=t}get ArrayType(){switch(this.precision){case Ar.HALF:return Uint16Array;case Ar.SINGLE:return Float32Array;case Ar.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}V0=Symbol.toStringTag;Wp[V0]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Wp.prototype);class Hp extends Et{constructor(){super(W.Binary)}toString(){return"Binary"}}G0=Symbol.toStringTag;Hp[G0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Hp.prototype);class Yp extends Et{constructor(){super(W.LargeBinary)}toString(){return"LargeBinary"}}W0=Symbol.toStringTag;Yp[W0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Yp.prototype);class Xp extends Et{constructor(){super(W.Utf8)}toString(){return"Utf8"}}H0=Symbol.toStringTag;Xp[H0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Xp.prototype);class qp extends Et{constructor(){super(W.LargeUtf8)}toString(){return"LargeUtf8"}}Y0=Symbol.toStringTag;qp[Y0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(qp.prototype);class Qp extends Et{constructor(){super(W.Bool)}toString(){return"Bool"}}X0=Symbol.toStringTag;Qp[X0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Qp.prototype);class Kp extends Et{constructor(t,e,i=128){super(W.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}q0=Symbol.toStringTag;Kp[q0]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Kp.prototype);class Zp extends Et{constructor(t){super(W.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${wn[this.unit]}>`}get ArrayType(){return this.unit===wn.DAY?Int32Array:BigInt64Array}}Q0=Symbol.toStringTag;Zp[Q0]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Zp.prototype);class Jp extends Et{constructor(t,e){super(W.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Jt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}K0=Symbol.toStringTag;Jp[K0]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Jp.prototype);class tm extends Et{constructor(t,e){super(W.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Jt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Z0=Symbol.toStringTag;tm[Z0]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(tm.prototype);class em extends Et{constructor(t){super(W.Interval),this.unit=t}toString(){return`Interval<${Gr[this.unit]}>`}}J0=Symbol.toStringTag;em[J0]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(em.prototype);class rm extends Et{constructor(t){super(W.Duration),this.unit=t}toString(){return`Duration<${Jt[this.unit]}>`}}tb=Symbol.toStringTag;rm[tb]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(rm.prototype);class im extends Et{constructor(t){super(W.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}eb=Symbol.toStringTag;im[eb]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(im.prototype);class Sh extends Et{constructor(t){super(W.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}rb=Symbol.toStringTag;Sh[rb]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(Sh.prototype);class nm extends Et{constructor(t,e,i){super(W.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}ib=Symbol.toStringTag;nm[ib]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(nm.prototype);class sm extends Et{constructor(t){super(W.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}nb=Symbol.toStringTag;sm[nb]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(sm.prototype);class om extends Et{constructor(t,e){super(W.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}sb=Symbol.toStringTag;om[sb]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(om.prototype);class am extends Et{constructor(t,e=!1){var i,n,s;if(super(W.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}ob=Symbol.toStringTag;am[ob]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(am.prototype);const FF=(r=>()=>++r)(-1);class lm extends Et{constructor(t,e,i,n){super(W.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?FF():Or(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}ab=Symbol.toStringTag;lm[ab]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(lm.prototype);function lb(r){const t=r;switch(r.typeId){case W.Decimal:return r.bitWidth/32;case W.Interval:return t.unit===Gr.MONTH_DAY_NANO?4:1+t.unit;case W.FixedSizeList:return t.listSize;case W.FixedSizeBinary:return t.byteWidth;default:return 1}}class ae{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return PF(this,t,e)}getVisitFnByTypeId(t,e=!0){return Ds(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function PF(r,t,e=!0){return typeof t=="number"?Ds(r,t,e):typeof t=="string"&&t in W?Ds(r,W[t],e):t&&t instanceof Et?Ds(r,um(t),e):t!=null&&t.type&&t.type instanceof Et?Ds(r,um(t.type),e):Ds(r,W.NONE,e)}function Ds(r,t,e=!0){let i=null;switch(t){case W.Null:i=r.visitNull;break;case W.Bool:i=r.visitBool;break;case W.Int:i=r.visitInt;break;case W.Int8:i=r.visitInt8||r.visitInt;break;case W.Int16:i=r.visitInt16||r.visitInt;break;case W.Int32:i=r.visitInt32||r.visitInt;break;case W.Int64:i=r.visitInt64||r.visitInt;break;case W.Uint8:i=r.visitUint8||r.visitInt;break;case W.Uint16:i=r.visitUint16||r.visitInt;break;case W.Uint32:i=r.visitUint32||r.visitInt;break;case W.Uint64:i=r.visitUint64||r.visitInt;break;case W.Float:i=r.visitFloat;break;case W.Float16:i=r.visitFloat16||r.visitFloat;break;case W.Float32:i=r.visitFloat32||r.visitFloat;break;case W.Float64:i=r.visitFloat64||r.visitFloat;break;case W.Utf8:i=r.visitUtf8;break;case W.LargeUtf8:i=r.visitLargeUtf8;break;case W.Binary:i=r.visitBinary;break;case W.LargeBinary:i=r.visitLargeBinary;break;case W.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case W.Date:i=r.visitDate;break;case W.DateDay:i=r.visitDateDay||r.visitDate;break;case W.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case W.Timestamp:i=r.visitTimestamp;break;case W.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case W.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case W.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case W.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case W.Time:i=r.visitTime;break;case W.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case W.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case W.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case W.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case W.Decimal:i=r.visitDecimal;break;case W.List:i=r.visitList;break;case W.Struct:i=r.visitStruct;break;case W.Union:i=r.visitUnion;break;case W.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case W.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case W.Dictionary:i=r.visitDictionary;break;case W.Interval:i=r.visitInterval;break;case W.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case W.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case W.IntervalMonthDayNano:i=r.visitIntervalMonthDayNano||r.visitInterval;break;case W.Duration:i=r.visitDuration;break;case W.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case W.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case W.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case W.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case W.FixedSizeList:i=r.visitFixedSizeList;break;case W.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${W[t]}'`)}function um(r){switch(r.typeId){case W.Null:return W.Null;case W.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?W.Int8:W.Uint8;case 16:return e?W.Int16:W.Uint16;case 32:return e?W.Int32:W.Uint32;case 64:return e?W.Int64:W.Uint64}return W.Int}case W.Float:switch(r.precision){case Ar.HALF:return W.Float16;case Ar.SINGLE:return W.Float32;case Ar.DOUBLE:return W.Float64}return W.Float;case W.Binary:return W.Binary;case W.LargeBinary:return W.LargeBinary;case W.Utf8:return W.Utf8;case W.LargeUtf8:return W.LargeUtf8;case W.Bool:return W.Bool;case W.Decimal:return W.Decimal;case W.Time:switch(r.unit){case Jt.SECOND:return W.TimeSecond;case Jt.MILLISECOND:return W.TimeMillisecond;case Jt.MICROSECOND:return W.TimeMicrosecond;case Jt.NANOSECOND:return W.TimeNanosecond}return W.Time;case W.Timestamp:switch(r.unit){case Jt.SECOND:return W.TimestampSecond;case Jt.MILLISECOND:return W.TimestampMillisecond;case Jt.MICROSECOND:return W.TimestampMicrosecond;case Jt.NANOSECOND:return W.TimestampNanosecond}return W.Timestamp;case W.Date:switch(r.unit){case wn.DAY:return W.DateDay;case wn.MILLISECOND:return W.DateMillisecond}return W.Date;case W.Interval:switch(r.unit){case Gr.DAY_TIME:return W.IntervalDayTime;case Gr.YEAR_MONTH:return W.IntervalYearMonth;case Gr.MONTH_DAY_NANO:return W.IntervalMonthDayNano}return W.Interval;case W.Duration:switch(r.unit){case Jt.SECOND:return W.DurationSecond;case Jt.MILLISECOND:return W.DurationMillisecond;case Jt.MICROSECOND:return W.DurationMicrosecond;case Jt.NANOSECOND:return W.DurationNanosecond}return W.Duration;case W.Map:return W.Map;case W.List:return W.List;case W.Struct:return W.Struct;case W.Union:switch(r.mode){case Ei.Dense:return W.DenseUnion;case Ei.Sparse:return W.SparseUnion}return W.Union;case W.FixedSizeBinary:return W.FixedSizeBinary;case W.FixedSizeList:return W.FixedSizeList;case W.Dictionary:return W.Dictionary}throw new Error(`Unrecognized type '${W[r.typeId]}'`)}ae.prototype.visitInt8=null;ae.prototype.visitInt16=null;ae.prototype.visitInt32=null;ae.prototype.visitInt64=null;ae.prototype.visitUint8=null;ae.prototype.visitUint16=null;ae.prototype.visitUint32=null;ae.prototype.visitUint64=null;ae.prototype.visitFloat16=null;ae.prototype.visitFloat32=null;ae.prototype.visitFloat64=null;ae.prototype.visitDateDay=null;ae.prototype.visitDateMillisecond=null;ae.prototype.visitTimestampSecond=null;ae.prototype.visitTimestampMillisecond=null;ae.prototype.visitTimestampMicrosecond=null;ae.prototype.visitTimestampNanosecond=null;ae.prototype.visitTimeSecond=null;ae.prototype.visitTimeMillisecond=null;ae.prototype.visitTimeMicrosecond=null;ae.prototype.visitTimeNanosecond=null;ae.prototype.visitDenseUnion=null;ae.prototype.visitSparseUnion=null;ae.prototype.visitIntervalDayTime=null;ae.prototype.visitIntervalYearMonth=null;ae.prototype.visitIntervalMonthDayNano=null;ae.prototype.visitDuration=null;ae.prototype.visitDurationSecond=null;ae.prototype.visitDurationMillisecond=null;ae.prototype.visitDurationMicrosecond=null;ae.prototype.visitDurationNanosecond=null;const ub=new Float64Array(1),bs=new Uint32Array(ub.buffer);function Df(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function cb(r){if(r!==r)return 32256;ub[0]=r;const t=(bs[1]&2147483648)>>16&65535;let e=bs[1]&2146435072,i=0;return e>=1089470464?bs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(bs[1]&1048575)>>10):e<=1056964608?(i=1048576+(bs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(bs[1]&1048575)+512>>10),t|e|i&65535}const MF=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:cb,uint16ToFloat64:Df},Symbol.toStringTag,{value:"Module"}));class zt extends ae{}function Yt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const DF=(r,t,e)=>{r[t]=Math.floor(e/864e5)},hb=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},Rf=({values:r},t,e)=>{r[t]=e},fb=({values:r},t,e)=>{r[t]=cb(e)},NF=(r,t,e)=>{switch(r.type.precision){case Ar.HALF:return fb(r,t,e);case Ar.SINGLE:case Ar.DOUBLE:return Rf(r,t,e)}},db=({values:r},t,e)=>{DF(r,t,e.valueOf())},pb=({values:r},t,e)=>{r[t]=BigInt(e)},LF=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},mb=({values:r,valueOffsets:t},e,i)=>hb(r,t,e,i),yb=({values:r,valueOffsets:t},e,i)=>hb(r,t,e,R0(i)),BF=(r,t,e)=>{r.type.unit===wn.DAY?db(r,t,e):pb(r,t,e)},gb=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},vb=({values:r},t,e)=>{r[t]=BigInt(e)},_b=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},bb=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},kF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return gb(r,t,e);case Jt.MILLISECOND:return vb(r,t,e);case Jt.MICROSECOND:return _b(r,t,e);case Jt.NANOSECOND:return bb(r,t,e)}},wb=({values:r},t,e)=>{r[t]=e},xb=({values:r},t,e)=>{r[t]=e},Sb=({values:r},t,e)=>{r[t]=e},Tb=({values:r},t,e)=>{r[t]=e},UF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return wb(r,t,e);case Jt.MILLISECOND:return xb(r,t,e);case Jt.MICROSECOND:return Sb(r,t,e);case Jt.NANOSECOND:return Tb(r,t,e)}},zF=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},jF=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Ci.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Ci.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},VF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),GF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),WF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),HF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),YF=(r,t,e)=>{const i=r.type.children.map(s=>Ci.getVisitFn(s.type)),n=e instanceof Map?WF(t,e):e instanceof Qe?GF(t,e):Array.isArray(e)?VF(t,e):HF(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},XF=(r,t,e)=>{r.type.mode===Ei.Dense?Ib(r,t,e):Eb(r,t,e)},Ib=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ci.visit(n,r.valueOffsets[t],e)},Eb=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ci.visit(n,t,e)},qF=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},QF=(r,t,e)=>{switch(r.type.unit){case Gr.YEAR_MONTH:return Ab(r,t,e);case Gr.DAY_TIME:return Cb(r,t,e);case Gr.MONTH_DAY_NANO:return Ob(r,t,e)}},Cb=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},Ab=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Ob=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},Fb=({values:r},t,e)=>{r[t]=e},Pb=({values:r},t,e)=>{r[t]=e},Mb=({values:r},t,e)=>{r[t]=e},Db=({values:r},t,e)=>{r[t]=e},KF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return Fb(r,t,e);case Jt.MILLISECOND:return Pb(r,t,e);case Jt.MICROSECOND:return Mb(r,t,e);case Jt.NANOSECOND:return Db(r,t,e)}},ZF=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Ci.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${no(t)}: ${no(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new JF(this[Jr],this[Xs])}}class JF{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[Jr].type.children.some(i=>i.name===e)}getOwnPropertyDescriptor(t,e){if(t[Jr].type.children.some(i=>i.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Jr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=qr.visit(t[Jr].children[i],t[Xs]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Jr].type.children.findIndex(s=>s.name===e);return n!==-1?(Ci.visit(t[Jr].children[n],t[Xs],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}const eP=new tP;class Pt extends ae{}function jt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const rP=(r,t)=>864e5*r[t],iP=(r,t)=>null,Rb=(r,t,e)=>{if(e+1>=t.length)return null;const i=Or(t[e]),n=Or(t[e+1]);return r.subarray(i,n)},nP=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<rP(r,t),Lb=({values:r},t)=>Or(r[t]),Tn=({stride:r,values:t},e)=>t[r*e],sP=({stride:r,values:t},e)=>Df(t[r*e]),Bb=({values:r},t)=>r[t],oP=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),kb=({values:r,valueOffsets:t},e)=>Rb(r,t,e),Ub=({values:r,valueOffsets:t},e)=>{const i=Rb(r,t,e);return i!==null?z2(i):null},aP=({values:r},t)=>r[t],lP=({type:r,values:t},e)=>r.precision!==Ar.HALF?t[e]:Df(t[e]),uP=(r,t)=>r.type.unit===wn.DAY?Nb(r,t):Lb(r,t),zb=({values:r},t)=>1e3*Or(r[t]),jb=({values:r},t)=>Or(r[t]),$b=({values:r},t)=>B0(r[t],BigInt(1e3)),Vb=({values:r},t)=>B0(r[t],BigInt(1e6)),cP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return zb(r,t);case Jt.MILLISECOND:return jb(r,t);case Jt.MICROSECOND:return $b(r,t);case Jt.NANOSECOND:return Vb(r,t)}},Gb=({values:r},t)=>r[t],Wb=({values:r},t)=>r[t],Hb=({values:r},t)=>r[t],Yb=({values:r},t)=>r[t],hP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Gb(r,t);case Jt.MILLISECOND:return Wb(r,t);case Jt.MICROSECOND:return Hb(r,t);case Jt.NANOSECOND:return Yb(r,t)}},fP=({values:r,stride:t},e)=>au.decimal(r.subarray(t*e,t*(e+1))),dP=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Qe([l])},pP=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new Lf(o.slice(n,s-n))},mP=(r,t)=>new Nf(r,t),yP=(r,t)=>r.type.mode===Ei.Dense?Xb(r,t):qb(r,t),Xb=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return qr.visit(i,r.valueOffsets[t])},qb=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return qr.visit(i,t)},gP=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},vP=(r,t)=>r.type.unit===Gr.MONTH_DAY_NANO?Zb(r,t):r.type.unit===Gr.DAY_TIME?Qb(r,t):Kb(r,t),Qb=({values:r},t)=>r.subarray(2*t,2*(t+1)),Kb=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Zb=({values:r},t)=>r.subarray(4*t,4*(t+1)),Jb=({values:r},t)=>r[t],tw=({values:r},t)=>r[t],ew=({values:r},t)=>r[t],rw=({values:r},t)=>r[t],_P=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Jb(r,t);case Jt.MILLISECOND:return tw(r,t);case Jt.MICROSECOND:return ew(r,t);case Jt.NANOSECOND:return rw(r,t)}},bP=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Qe([s])};Pt.prototype.visitNull=jt(iP);Pt.prototype.visitBool=jt(nP);Pt.prototype.visitInt=jt(aP);Pt.prototype.visitInt8=jt(Tn);Pt.prototype.visitInt16=jt(Tn);Pt.prototype.visitInt32=jt(Tn);Pt.prototype.visitInt64=jt(Bb);Pt.prototype.visitUint8=jt(Tn);Pt.prototype.visitUint16=jt(Tn);Pt.prototype.visitUint32=jt(Tn);Pt.prototype.visitUint64=jt(Bb);Pt.prototype.visitFloat=jt(lP);Pt.prototype.visitFloat16=jt(sP);Pt.prototype.visitFloat32=jt(Tn);Pt.prototype.visitFloat64=jt(Tn);Pt.prototype.visitUtf8=jt(Ub);Pt.prototype.visitLargeUtf8=jt(Ub);Pt.prototype.visitBinary=jt(kb);Pt.prototype.visitLargeBinary=jt(kb);Pt.prototype.visitFixedSizeBinary=jt(oP);Pt.prototype.visitDate=jt(uP);Pt.prototype.visitDateDay=jt(Nb);Pt.prototype.visitDateMillisecond=jt(Lb);Pt.prototype.visitTimestamp=jt(cP);Pt.prototype.visitTimestampSecond=jt(zb);Pt.prototype.visitTimestampMillisecond=jt(jb);Pt.prototype.visitTimestampMicrosecond=jt($b);Pt.prototype.visitTimestampNanosecond=jt(Vb);Pt.prototype.visitTime=jt(hP);Pt.prototype.visitTimeSecond=jt(Gb);Pt.prototype.visitTimeMillisecond=jt(Wb);Pt.prototype.visitTimeMicrosecond=jt(Hb);Pt.prototype.visitTimeNanosecond=jt(Yb);Pt.prototype.visitDecimal=jt(fP);Pt.prototype.visitList=jt(dP);Pt.prototype.visitStruct=jt(mP);Pt.prototype.visitUnion=jt(yP);Pt.prototype.visitDenseUnion=jt(Xb);Pt.prototype.visitSparseUnion=jt(qb);Pt.prototype.visitDictionary=jt(gP);Pt.prototype.visitInterval=jt(vP);Pt.prototype.visitIntervalDayTime=jt(Qb);Pt.prototype.visitIntervalYearMonth=jt(Kb);Pt.prototype.visitIntervalMonthDayNano=jt(Zb);Pt.prototype.visitDuration=jt(_P);Pt.prototype.visitDurationSecond=jt(Jb);Pt.prototype.visitDurationMillisecond=jt(tw);Pt.prototype.visitDurationMicrosecond=jt(ew);Pt.prototype.visitDurationNanosecond=jt(rw);Pt.prototype.visitFixedSizeList=jt(bP);Pt.prototype.visitMap=jt(pP);const qr=new Pt,Rs=Symbol.for("keys"),qs=Symbol.for("vals"),Ns=Symbol.for("kKeysAsStrings"),Th=Symbol.for("_kKeysAsStrings");class Lf{constructor(t){return this[Rs]=new Qe([t.children[0]]).memoize(),this[qs]=t.children[1],new Proxy(this,new xP)}get[Ns](){return this[Th]||(this[Th]=Array.from(this[Rs].toArray(),String))}[Symbol.iterator](){return new wP(this[Rs],this[qs])}get size(){return this[Rs].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Rs],e=this[qs],i={};for(let n=-1,s=t.length;++n`${no(t)}: ${no(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class wP{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),qr.visit(this.vals,t)]})}}class xP{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ns]}has(t,e){return t[Ns].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ns].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Ns].indexOf(e);if(i!==-1){const n=qr.visit(Reflect.get(t,qs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Ns].indexOf(e);return n!==-1?(Ci.visit(Reflect.get(t,qs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(Lf.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Rs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[qs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Th]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let cm;function iw(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const nw=(r,t)=>r<0?t+r:r,hm=r=>r!==r;function fs(r){if(typeof r!=="object"||r===null)return hm(r)?hm:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?L0(r,e):!1:r instanceof Map?TP(r):Array.isArray(r)?SP(r):r instanceof Qe?IP(r):EP(r,!0)}function SP(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return CP(r,e);case Map:return fm(r,e,e.keys());case Lf:case Nf:case Object:case void 0:return fm(r,e,t||Object.keys(e))}return e instanceof Qe?AP(r,e):!1}}function CP(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function FP(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):ow(new uu(e,r,t,null,Bf)).subarray(0,i)),n}return e}function ow(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class uu{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,n=t+(t%8===0?0:8-t%8);return Ul(r,t,n)+Ul(r,i,e)+aw(r,n>>3,i-n>>3)}function aw(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=Za(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=Za(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=Za(s.getUint8(n)),n+=1;return i}function Za(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const PP=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:uu,getBit:sw,getBool:Bf,packBools:ow,popcnt_array:aw,popcnt_bit_range:Ul,popcnt_uint32:Za,setBool:FP,truncateBitmap:Ih},Symbol.toStringTag,{value:"Module"})),MP=-1;class ia{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return Et.isSparseUnion(t)?this.children.some(e=>e.nullable):Et.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Et.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=MP&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Ul(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof ia?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=lb(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(Et.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===Ei.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Ih(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new ia(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===W.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(Ih(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[ji.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[ji.TYPE])&&(o[ji.TYPE]=s.subarray(t,t+e)),(s=o[ji.OFFSET])&&(o[ji.OFFSET]=s.subarray(t,t+e+1))||(s=o[ji.DATA])&&(o[ji.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}}ia.prototype.children=Object.freeze([]);class dm{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function RP(r){return r.reduce((t,e)=>t+e.nullCount,0)}function NP(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function LP(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function kf(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function zP(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new uu(e,r.offset+(t||0),r.length,e,Bf)){if(!n)return i;++i}return-1}function Qt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case W.Union:break;case W.Dictionary:break;default:return zP(r,e)}const i=qr.getVisitFn(r),n=fs(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new dm(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new jP(o)})}class jP{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof ia)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=hw[o.typeId],c=s[0];this.isValid=h=>lw(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,fw[o.typeId]),this._offsets=NP(s);break}this.data=s,this.type=o,this.stride=lb(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return DP(this.data)}get nullCount(){return RP(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${W[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(nw(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return $P.visit(this)}concat(...t){return new Qe(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new Qe(iw(this,t,e,({data:i,_offsets:n},s,o)=>LP(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case W.Int:case W.Float:case W.Decimal:case W.Time:case W.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Et.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Et.isDictionary(this.type)){const t=new zl(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return new zl(this)}unmemoize(){if(Et.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return this}}cw=Symbol.toStringTag;Qe[cw]=(r=>{r.type=Et.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(W).map(e=>W[e]).filter(e=>typeof e=="number"&&e!==W.NONE);for(const e of t){const i=qr.getVisitFnByTypeId(e),n=Ci.getVisitFnByTypeId(e),s=mm.getVisitFnByTypeId(e);hw[e]={get:i,set:n,indexOf:s},fw[e]=Object.create(r,{isValid:{value:pm(lw)},get:{value:pm(qr.getVisitFnByTypeId(e))},set:{value:BP(Ci.getVisitFnByTypeId(e))},indexOf:{value:kP(mm.getVisitFnByTypeId(e))}})}return"Vector"})(Qe.prototype);class zl extends Qe{constructor(t){super(t.data);const e=this.get,i=this.set,n=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new zl(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Qe(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const VP=65536;function ks(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const oo=8,Uf=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class zf{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${ks(this.buffer[3])} ${ks(this.buffer[2])} ${ks(this.buffer[1])} ${ks(this.buffer[0])}`}static multiply(t,e){return new hi(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new hi(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return hi.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return hi.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new hi(e);for(let o=i?1:0;o>BigInt(32))):o+=2}return n}function YP(r){const t=r.length,e=new Array(t/2);for(let i=0,n=0;i>>0);i[s++]={months:r[n],days:r[n+1],nanoseconds:t?`${o}`:o}}return i}const qP=Object.freeze(Object.defineProperty({__proto__:null,toIntervalDayTimeInt32Array:WP,toIntervalDayTimeObjects:YP,toIntervalMonthDayNanoInt32Array:HP,toIntervalMonthDayNanoObjects:XP},Symbol.toStringTag,{value:"Module"}));class Rt extends ae{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((i,n)=>this.compareFields(i,e[n]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function lr(r,t){return t instanceof r.constructor}function ds(r,t){return r===t||lr(r,t)}function Ki(r,t){return r===t||lr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function cu(r,t){return r===t||lr(r,t)&&r.precision===t.precision}function QP(r,t){return r===t||lr(r,t)&&r.byteWidth===t.byteWidth}function jf(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function ma(r,t){return r===t||lr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function ya(r,t){return r===t||lr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function KP(r,t){return r===t||lr(r,t)&&r.children.length===t.children.length&&Ai.compareManyFields(r.children,t.children)}function ZP(r,t){return r===t||lr(r,t)&&r.children.length===t.children.length&&Ai.compareManyFields(r.children,t.children)}function $f(r,t){return r===t||lr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&Ai.compareManyFields(r.children,t.children)}function JP(r,t){return r===t||lr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Ai.visit(r.indices,t.indices)&&Ai.visit(r.dictionary,t.dictionary)}function hu(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function ga(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function tM(r,t){return r===t||lr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Ai.compareManyFields(r.children,t.children)}function eM(r,t){return r===t||lr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Ai.compareManyFields(r.children,t.children)}Rt.prototype.visitNull=ds;Rt.prototype.visitBool=ds;Rt.prototype.visitInt=Ki;Rt.prototype.visitInt8=Ki;Rt.prototype.visitInt16=Ki;Rt.prototype.visitInt32=Ki;Rt.prototype.visitInt64=Ki;Rt.prototype.visitUint8=Ki;Rt.prototype.visitUint16=Ki;Rt.prototype.visitUint32=Ki;Rt.prototype.visitUint64=Ki;Rt.prototype.visitFloat=cu;Rt.prototype.visitFloat16=cu;Rt.prototype.visitFloat32=cu;Rt.prototype.visitFloat64=cu;Rt.prototype.visitUtf8=ds;Rt.prototype.visitLargeUtf8=ds;Rt.prototype.visitBinary=ds;Rt.prototype.visitLargeBinary=ds;Rt.prototype.visitFixedSizeBinary=QP;Rt.prototype.visitDate=jf;Rt.prototype.visitDateDay=jf;Rt.prototype.visitDateMillisecond=jf;Rt.prototype.visitTimestamp=ma;Rt.prototype.visitTimestampSecond=ma;Rt.prototype.visitTimestampMillisecond=ma;Rt.prototype.visitTimestampMicrosecond=ma;Rt.prototype.visitTimestampNanosecond=ma;Rt.prototype.visitTime=ya;Rt.prototype.visitTimeSecond=ya;Rt.prototype.visitTimeMillisecond=ya;Rt.prototype.visitTimeMicrosecond=ya;Rt.prototype.visitTimeNanosecond=ya;Rt.prototype.visitDecimal=ds;Rt.prototype.visitList=KP;Rt.prototype.visitStruct=ZP;Rt.prototype.visitUnion=$f;Rt.prototype.visitDenseUnion=$f;Rt.prototype.visitSparseUnion=$f;Rt.prototype.visitDictionary=JP;Rt.prototype.visitInterval=hu;Rt.prototype.visitIntervalDayTime=hu;Rt.prototype.visitIntervalYearMonth=hu;Rt.prototype.visitIntervalMonthDayNano=hu;Rt.prototype.visitDuration=ga;Rt.prototype.visitDurationSecond=ga;Rt.prototype.visitDurationMillisecond=ga;Rt.prototype.visitDurationMicrosecond=ga;Rt.prototype.visitDurationNanosecond=ga;Rt.prototype.visitFixedSizeList=tM;Rt.prototype.visitMap=eM;const Ai=new Rt;function rM(r,t){return Ai.compareSchemas(r,t)}function iM(r,t){return Ai.compareFields(r,t)}function nM(r,t){return Ai.visit(r,t)}const ym=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},OF),GP),PP),MF),TF),OP),EF),qP),{compareSchemas:rM,compareFields:iM,compareTypes:nM}),dw=6048e5,sM=864e5,gm=Symbol.for("constructDateFrom");function Wi(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&gm in r?r[gm](t):r instanceof Date?new r.constructor(t):new Date(t)}function Qr(r,t){return Wi(t||r,r)}let oM={};function fu(){return oM}function na(r,t){var a,l,u,c;const e=fu(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,n=Qr(r,t==null?void 0:t.in),s=n.getDay(),o=(s=s.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function vm(r){const t=Qr(r),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+r-+e}function aM(r,...t){const e=Wi.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function _m(r,t){const e=Qr(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function lM(r,t,e){const[i,n]=aM(e==null?void 0:e.in,r,t),s=_m(i),o=_m(n),a=+s-vm(s),l=+o-vm(o);return Math.round((a-l)/sM)}function uM(r,t){const e=pw(r,t),i=Wi(r,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),jl(i)}function cM(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function hM(r){return!(!cM(r)&&typeof r!="number"||isNaN(+Qr(r)))}function fM(r,t){const e=Qr(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const dM={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"}},pM=(r,t,e)=>{let i;const n=dM[r];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function ac(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const mM={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yM={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gM={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vM={date:ac({formats:mM,defaultWidth:"full"}),time:ac({formats:yM,defaultWidth:"full"}),dateTime:ac({formats:gM,defaultWidth:"full"})},_M={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},bM=(r,t,e,i)=>_M[r];function bo(r){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;n=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;n=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return n[s]}}const wM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},SM={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"]},TM={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"]},IM={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"}},EM={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"}},CM=(r,t)=>{const e=Number(r),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},AM={ordinalNumber:CM,era:bo({values:wM,defaultWidth:"wide"}),quarter:bo({values:xM,defaultWidth:"wide",argumentCallback:r=>r-1}),month:bo({values:SM,defaultWidth:"wide"}),day:bo({values:TM,defaultWidth:"wide"}),dayPeriod:bo({values:IM,defaultWidth:"wide",formattingValues:EM,defaultFormattingWidth:"wide"})};function wo(r){return(t,e={})=>{const i=e.width,n=i&&r.matchPatterns[i]||r.matchPatterns[r.defaultMatchWidth],s=t.match(n);if(!s)return null;const o=s[0],a=i&&r.parsePatterns[i]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?FM(a,h=>h.test(o)):OM(a,h=>h.test(o));let u;u=r.valueCallback?r.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function OM(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function FM(r,t){for(let e=0;e{const i=t.match(r.matchPattern);if(!i)return null;const n=i[0],s=t.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(n.length);return{value:o,rest:a}}}const MM=/^(\d+)(th|st|nd|rd)?/i,DM=/\d+/i,RM={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},NM={any:[/^b/i,/^(a|c)/i]},LM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BM={any:[/1/i,/2/i,/3/i,/4/i]},kM={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},UM={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]},zM={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},jM={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]},$M={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},VM={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}},GM={ordinalNumber:PM({matchPattern:MM,parsePattern:DM,valueCallback:r=>parseInt(r,10)}),era:wo({matchPatterns:RM,defaultMatchWidth:"wide",parsePatterns:NM,defaultParseWidth:"any"}),quarter:wo({matchPatterns:LM,defaultMatchWidth:"wide",parsePatterns:BM,defaultParseWidth:"any",valueCallback:r=>r+1}),month:wo({matchPatterns:kM,defaultMatchWidth:"wide",parsePatterns:UM,defaultParseWidth:"any"}),day:wo({matchPatterns:zM,defaultMatchWidth:"wide",parsePatterns:jM,defaultParseWidth:"any"}),dayPeriod:wo({matchPatterns:$M,defaultMatchWidth:"any",parsePatterns:VM,defaultParseWidth:"any"})},WM={code:"en-US",formatDistance:pM,formatLong:vM,formatRelative:bM,localize:AM,match:GM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function HM(r,t){const e=Qr(r,t==null?void 0:t.in);return lM(e,fM(e))+1}function YM(r,t){const e=Qr(r,t==null?void 0:t.in),i=+jl(e)-+uM(e);return Math.round(i/dw)+1}function mw(r,t){var c,h,p,f;const e=Qr(r,t==null?void 0:t.in),i=e.getFullYear(),n=fu(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(p=n.locale)==null?void 0:p.options)==null?void 0:f.firstWeekContainsDate)??1,o=Wi((t==null?void 0:t.in)||r,0);o.setFullYear(i+1,0,s),o.setHours(0,0,0,0);const a=na(o,t),l=Wi((t==null?void 0:t.in)||r,0);l.setFullYear(i,0,s),l.setHours(0,0,0,0);const u=na(l,t);return+e>=+a?i+1:+e>=+u?i:i-1}function XM(r,t){var a,l,u,c;const e=fu(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,n=mw(r,t),s=Wi((t==null?void 0:t.in)||r,0);return s.setFullYear(n,0,i),s.setHours(0,0,0,0),na(s,t)}function qM(r,t){const e=Qr(r,t==null?void 0:t.in),i=+na(e,t)-+XM(e,t);return Math.round(i/dw)+1}function ve(r,t){const e=r<0?"-":"",i=Math.abs(r).toString().padStart(t,"0");return e+i}const nn={y(r,t){const e=r.getFullYear(),i=e>0?e:1-e;return ve(t==="yy"?i%100:i,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):ve(e+1,2)},d(r,t){return ve(r.getDate(),t.length)},a(r,t){const e=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(r,t){return ve(r.getHours()%12||12,t.length)},H(r,t){return ve(r.getHours(),t.length)},m(r,t){return ve(r.getMinutes(),t.length)},s(r,t){return ve(r.getSeconds(),t.length)},S(r,t){const e=t.length,i=r.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return ve(n,t.length)}},ws={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bm={G:function(r,t,e){const i=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const i=r.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return nn.y(r,t)},Y:function(r,t,e,i){const n=mw(r,i),s=n>0?n:1-n;if(t==="YY"){const o=s%100;return ve(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):ve(s,t.length)},R:function(r,t){const e=pw(r);return ve(e,t.length)},u:function(r,t){const e=r.getFullYear();return ve(e,t.length)},Q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ve(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ve(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,e){const i=r.getMonth();switch(t){case"M":case"MM":return nn.M(r,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,e){const i=r.getMonth();switch(t){case"L":return String(i+1);case"LL":return ve(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,e,i){const n=qM(r,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):ve(n,t.length)},I:function(r,t,e){const i=YM(r);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ve(i,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):nn.d(r,t)},D:function(r,t,e){const i=HM(r);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ve(i,t.length)},E:function(r,t,e){const i=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ve(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ve(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(r,t,e){const i=r.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return ve(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,e){const n=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(r,t,e){const i=r.getHours();let n;switch(i===12?n=ws.noon:i===0?n=ws.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(r,t,e){const i=r.getHours();let n;switch(i>=17?n=ws.evening:i>=12?n=ws.afternoon:i>=4?n=ws.morning:n=ws.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let i=r.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return nn.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):nn.H(r,t)},K:function(r,t,e){const i=r.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},k:function(r,t,e){let i=r.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):nn.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):nn.s(r,t)},S:function(r,t){return nn.S(r,t)},X:function(r,t,e){const i=r.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return xm(i);case"XXXX":case"XX":return Wn(i);case"XXXXX":case"XXX":default:return Wn(i,":")}},x:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"x":return xm(i);case"xxxx":case"xx":return Wn(i);case"xxxxx":case"xxx":default:return Wn(i,":")}},O:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+wm(i,":");case"OOOO":default:return"GMT"+Wn(i,":")}},z:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+wm(i,":");case"zzzz":default:return"GMT"+Wn(i,":")}},t:function(r,t,e){const i=Math.trunc(+r/1e3);return ve(i,t.length)},T:function(r,t,e){return ve(+r,t.length)}};function wm(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=Math.trunc(i/60),s=i%60;return s===0?e+String(n):e+String(n)+t+ve(s,2)}function xm(r,t){return r%60===0?(r>0?"-":"+")+ve(Math.abs(r)/60,2):Wn(r,t)}function Wn(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=ve(Math.trunc(i/60),2),s=ve(i%60,2);return e+n+t+s}const Sm=(r,t)=>{switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},yw=(r,t)=>{switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},QM=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return Sm(r,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Sm(i,t)).replace("{{time}}",yw(n,t))},KM={p:yw,P:QM},ZM=/^D+$/,JM=/^Y+$/,tD=["D","DD","YY","YYYY"];function eD(r){return ZM.test(r)}function rD(r){return JM.test(r)}function iD(r,t,e){const i=nD(r,t,e);if(console.warn(i),tD.includes(r))throw new RangeError(i)}function nD(r,t,e){const i=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const sD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,oD=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aD=/^'([^]*?)'?$/,lD=/''/g,uD=/[a-zA-Z]/;function gw(r,t,e){var c,h,p,f;const i=fu(),n=i.locale??WM,s=i.firstWeekContainsDate??((h=(c=i.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=i.weekStartsOn??((f=(p=i.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,a=Qr(r,e==null?void 0:e.in);if(!hM(a))throw new RangeError("Invalid time value");let l=t.match(oD).map(y=>{const g=y[0];if(g==="p"||g==="P"){const d=KM[g];return d(y,n.formatLong)}return y}).join("").match(sD).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:cD(y)};if(bm[g])return{isToken:!0,value:y};if(g.match(uD))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});n.localize.preprocessor&&(l=n.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return l.map(y=>{if(!y.isToken)return y.value;const g=y.value;(rD(g)||eD(g))&&iD(g,t,String(r));const d=bm[g[0]];return d(a,g,n.localize,u)}).join("")}function cD(r){const t=r.match(aD);return t?t[1].replace(lD,"'"):r}function hD(r,t){return Qr(r*1e3,t==null?void 0:t.in)}function fD(r,t){const e=dD(t)?new t(0):Wi(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function dD(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function pD(r,t){let e=r.length;switch(typeof t){case"string":{if(t.length!==1)throw new Error("The 'chars' parameter should be a single character string.");for(;e>0&&r[e-1]===t;)e--;break}case"object":for(;e>0&&t.includes(r[e-1]);)e--}return r.substring(0,e)}function gr(r){return r==null}function mD(r){return r!=null}async function Eh(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await cn(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function yD(r){return gr(r)?!1:Et.isInt(r.type)&&!vw(r)||gD(r)}function gD(r){return gr(r)?!1:Et.isInt(r.type)&&r.type.isSigned===!1}function vD(r){return gr(r)?!1:Et.isFloat(r.type)??!1}function _D(r){return gr(r)?!1:Et.isDecimal(r.type)}function bD(r){return gr(r)?!1:Et.isBool(r.type)}function wD(r){return gr(r)?!1:Et.isDuration(r.type)}function vw(r){return gr(r)?!1:Et.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function xD(r){return gr(r)?!1:Et.isTimestamp(r.type)}function SD(r){return gr(r)?!1:Et.isDate(r.type)}function TD(r){return gr(r)?!1:Et.isTime(r.type)}function ID(r){return gr(r)?!1:Et.isList(r.type)||Et.isFixedSizeList(r.type)}function ED(r){return gr(r)?!1:Et.isStruct(r.type)||Et.isMap(r.type)}function CD(r){return gr(r)?!1:Et.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Et.isInterval(r.type)}function AD(r,t){let e;if(t===Jt.MILLISECOND)e=1e3;else if(t===Jt.MICROSECOND)e=1e3*1e3;else if(t===Jt.NANOSECOND)e=1e3*1e3*1e3;else return Number(r);return typeof r=="bigint"&&!Number.isSafeInteger(Number(r))?Number(r/BigInt(e)):Number(r)/e}function OD(r,t){var i;const e=AD(r,((i=t==null?void 0:t.type)==null?void 0:i.unit)??Jt.SECOND);return hD(e)}function FD(r,t){const e=OD(r,t);return gw(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function PD(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?gw(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function MD(r,t){var n;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const i=(n=t==null?void 0:t.type)==null?void 0:n.timezone;return typeof r=="number"?i?e=new Cr(r,i):e=new Cr(r):i?e=new Cr(r,i):e=new Cr(r),fD(e,Date)}function DD(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let i=ym.bigNumToString(new ym.BN(r)).padStart(e,"0");if(e===0)return i;let n="";i.startsWith("-")&&(n="-",i=i.slice(1));const s=i.slice(0,-e)||"0",o=pD(i.slice(-e),"0")||"";return`${n}${s}${o?`.${o}`:""}`}function RD(r){const t=r[0],e=r[1],i=[];return t!==0&&i.push(`${t} year${t>1?"s":""}`),e!==0&&i.push(`${e} month${e>1?"s":""}`),i.length?i.join(" "):"0 months"}function ND(r,t){var i,n,s,o;if(Et.isInterval(t==null?void 0:t.type))return RD(r);const e=t&&t.metadata.get("ARROW:extension:name");if(e&&e==="pandas.interval"){const a=JSON.parse(t.metadata.get("ARROW:extension:metadata")),{closed:l}=a,u=r.toJSON(),c=l==="both"||l==="left"?"[":"(",h=l==="both"||l==="right"?"]":")",p=Ch(u.left,(n=(i=t.type)==null?void 0:i.children)==null?void 0:n[0]),f=Ch(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+p}, ${f+h}`}return String(r)}function LD(r,t){return(t==null?void 0:t.type)instanceof Sh?JSON.parse(JSON.stringify(r,(e,i)=>{if(mD(i))return typeof i=="bigint"?Number(i):i})):JSON.parse(JSON.stringify(r,(e,i)=>typeof i=="bigint"?Number(i):i))}function Ch(r,t){if(gr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&SD(t))return PD(r);if(typeof r=="bigint"&&TD(t))return FD(Number(r),t);if(e&&xD(t))return MD(r,t);if(vw(t))throw new Error("Period type is not supported yet");if(CD(t))return ND(r,t);if(wD(t))throw new Error("Duration type is not supported yet");return _D(t)?DD(r,t):vD(t)&&Number.isFinite(r)||yD(t)?r:ED(t)||ID(t)?LD(r,t):bD(t)?!!r:String(r)}function Tm(r){return((r.toArray()||[]).map(i=>i.toJSON())||[]).map(i=>(r.schema.fields.forEach(n=>i[n.name]=Ch(i[n.name],n)),i))}var sa=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(sa||{});async function _w(r){const t=Bx(r,{logger:!1});let e,i;const n=await Eh();if(n==="browser"){if(typeof t.bundles>"u"){const{getBundles:u}=await cn(async()=>{const{getBundles:c}=await import("./default-browser-BrgSDbLD.js");return{getBundles:c}},[]);t.bundles=await u()}i=await zp(await t.bundles),e=new Worker(i.mainWorker)}else if(n==="node"){if(typeof t.bundles>"u"){const{getBundles:h}=await cn(async()=>{const{getBundles:p}=await import("./default-node-CNYmsmAm.js");return{getBundles:p}},__vite__mapDeps([0,1,2]));t.bundles=await h()}i=await zp(await t.bundles);let u=i.mainWorker;u.startsWith("/@fs/")&&(u=u.replace("/@fs/","file://"));const c=await cn(()=>import("./index-Cp8iQ_hy.js"),[]);e=new c.default(u,{type:"module"})}else throw new Error(`Unsupported environment: ${n}`);let s;t.logger===!0?s=new P0:t.logger===!1?s=new b2:s=t.logger;const o=new C2(s,e);if(await o.instantiate(i.mainModule,i.pthreadWorker),t.storage)switch(t.storage.type){case sa.ORIGIN_PRIVATE_FS:{try{let u=t.storage.path;u.startsWith("/")&&(u=u.slice(1)),await o.open({path:`opfs://${u}`,accessMode:t.storage.accessMode})}catch(u){throw await o.terminate(),await e.terminate(),u}break}case sa.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(u){throw await o.terminate(),await e.terminate(),u}break}}const a=await o.connect();async function l(u,c=[]){if(!c||c.length===0){const f=await a.query(u);return{_results:f,_schema:f.schema,columns:f.schema.fields,rows:Tm(f)}}const h=await a.prepare(u),p=await h.query(...c);return h.close(),{_results:p,_schema:p.schema,columns:p.schema.fields,rows:Tm(p)}}return{worker:e,db:o,conn:a,query:async(u,c=[])=>l(u,c).then(h=>h.rows),queryWithColumns:async(u,c=[])=>l(u,c),close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function BD(r,t){await(await r).conn.send("BEGIN TRANSACTION");try{const e=await t(r);return await(await r).conn.send("COMMIT"),e}catch(e){throw await(await r).conn.send("ROLLBACK"),e}}async function kD(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const i=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),i}catch(i){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),i}}const xt=Symbol.for("drizzle:entityKind");function at(r,t){if(!r||typeof r!="object")return!1;if(r instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,xt))throw new Error(`Class "${t.name??""}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let e=Object.getPrototypeOf(r).constructor;if(e)for(;e;){if(xt in e&&e[xt]===t[xt])return!0;e=Object.getPrototypeOf(e)}return!1}var Nm;Nm=xt;class Ke{constructor(t,e){$(this,"name");$(this,"keyAsName");$(this,"primary");$(this,"notNull");$(this,"default");$(this,"defaultFn");$(this,"onUpdateFn");$(this,"hasDefault");$(this,"isUnique");$(this,"uniqueName");$(this,"uniqueType");$(this,"dataType");$(this,"columnType");$(this,"enumValues");$(this,"generated");$(this,"generatedIdentity");$(this,"config");this.table=t,this.config=e,this.name=e.name,this.keyAsName=e.keyAsName,this.notNull=e.notNull,this.default=e.default,this.defaultFn=e.defaultFn,this.onUpdateFn=e.onUpdateFn,this.hasDefault=e.hasDefault,this.primary=e.primaryKey,this.isUnique=e.isUnique,this.uniqueName=e.uniqueName,this.uniqueType=e.uniqueType,this.dataType=e.dataType,this.columnType=e.columnType,this.generated=e.generated,this.generatedIdentity=e.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}$(Ke,Nm,"Column");const Qs=Symbol.for("drizzle:Name");function UD(r,t){return`${r[Qs]}_${t.join("_")}_unique`}var Lm,Bm;class Fr extends(Bm=Ke,Lm=xt,Bm){constructor(t,e){e.uniqueName||(e.uniqueName=UD(t,[e.name])),super(t,e),this.table=t}}$(Fr,Lm,"PgColumn");const Im=Symbol.for("drizzle:isPgEnum");function zD(r){return!!r&&typeof r=="function"&&Im in r&&r[Im]===!0}var km;km=xt;class dr{constructor(t,e,i,n=!1,s=[]){this._={brand:"Subquery",sql:t,selectedFields:e,alias:i,isWith:n,usedTables:s}}}$(dr,km,"Subquery");var Um,zm;class Vf extends(zm=dr,Um=xt,zm){}$(Vf,Um,"WithSubquery");const Mr={startActiveSpan(r,t){return t()}},He=Symbol.for("drizzle:ViewBaseConfig"),Ks=Symbol.for("drizzle:Schema"),Ah=Symbol.for("drizzle:Columns"),Em=Symbol.for("drizzle:ExtraConfigColumns"),lc=Symbol.for("drizzle:OriginalName"),uc=Symbol.for("drizzle:BaseName"),$l=Symbol.for("drizzle:IsAlias"),Cm=Symbol.for("drizzle:ExtraConfigBuilder"),jD=Symbol.for("drizzle:IsDrizzleTable");var jm,$m,Vm,Gm,Wm,Hm,Ym,Xm,qm,Qm;Qm=xt,qm=Qs,Xm=lc,Ym=Ks,Hm=Ah,Wm=Em,Gm=uc,Vm=$l,$m=jD,jm=Cm;class St{constructor(t,e,i){$(this,qm);$(this,Xm);$(this,Ym);$(this,Hm);$(this,Wm);$(this,Gm);$(this,Vm,!1);$(this,$m,!0);$(this,jm);this[Qs]=this[lc]=t,this[Ks]=e,this[uc]=i}}$(St,Qm,"Table"),$(St,"Symbol",{Name:Qs,Schema:Ks,OriginalName:lc,Columns:Ah,ExtraConfigColumns:Em,BaseName:uc,IsAlias:$l,ExtraConfigBuilder:Cm});function Kn(r){return r[Qs]}function oa(r){return`${r[Ks]??"public"}.${r[Qs]}`}function bw(r){return r!=null&&typeof r.getSQL=="function"}function $D(r){var e;const t={sql:"",params:[]};for(const i of r)t.sql+=i.sql,t.params.push(...i.params),(e=i.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...i.typings));return t}var Km;Km=xt;class Ye{constructor(t){$(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Ft([this])}}$(Ye,Km,"StringChunk");var Zm;Zm=xt;const Xn=class Xn{constructor(t){$(this,"decoder",ww);$(this,"shouldInlineParams",!1);$(this,"usedTables",[]);this.queryChunks=t;for(const e of t)if(at(e,St)){const i=e[St.Symbol.Schema];this.usedTables.push(i===void 0?e[St.Symbol.Name]:i+"."+e[St.Symbol.Name])}}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Mr.startActiveSpan("drizzle.buildSQL",e=>{const i=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":i.sql,"drizzle.query.params":JSON.stringify(i.params)}),i})}buildQueryFromSourceParams(t,e){const i=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:n,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=i;return $D(t.map(c=>{var h;if(at(c,Ye))return{sql:c.value.join(""),params:[]};if(at(c,Vl))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const p=[new Ye("(")];for(const[f,y]of c.entries())p.push(y),fr},xw={mapToDriverValue:r=>r};({...ww,...xw});var ty;ty=xt;class Hi{constructor(t,e=xw){$(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Ft([this])}}$(Hi,ty,"Param");function H(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Ye(r[0]));for(const[i,n]of t.entries())e.push(n,new Ye(r[i+1]));return new Ft(e)}(r=>{function t(){return new Ft([])}r.empty=t;function e(l){return new Ft(l)}r.fromList=e;function i(l){return new Ft([new Ye(l)])}r.raw=i;function n(l,u){const c=[];for(const[h,p]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(p);return new Ft(c)}r.join=n;function s(l){return new Vl(l)}r.identifier=s;function o(l){return new as(l)}r.placeholder=o;function a(l,u){return new Hi(l,u)}r.param=a})(H||(H={}));(r=>{var e;e=xt;const i=class i{constructor(s,o){$(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}};$(i,e,"SQL.Aliased");let t=i;r.Aliased=t})(Ft||(Ft={}));var ey;ey=xt;class as{constructor(t){this.name=t}getSQL(){return new Ft([this])}}$(as,ey,"Placeholder");function Am(r,t){return r.map(e=>{if(at(e,as)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(at(e,Hi)&&at(e.value,as)){if(!(e.value.name in t))throw new Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const GD=Symbol.for("drizzle:IsDrizzleView");var ry,iy,ny;ny=xt,iy=He,ry=GD;class In{constructor({name:t,schema:e,selectedFields:i,query:n}){$(this,iy);$(this,ry,!0);this[He]={name:t,originalName:t,schema:e,selectedFields:i,query:n,isExisting:!n,isAlias:!1}}getSQL(){return new Ft([this])}}$(In,ny,"View");Ke.prototype.getSQL=function(){return new Ft([this])};St.prototype.getSQL=function(){return new Ft([this])};dr.prototype.getSQL=function(){return new Ft([this])};var sy;sy=xt;class aa{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}$(aa,sy,"ColumnAliasProxyHandler");var oy;oy=xt;class du{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===St.Symbol.IsAlias)return!0;if(e===St.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===St.Symbol.OriginalName)return this.alias;if(e===He)return{...t[He],name:this.alias,isAlias:!0};if(e===St.Symbol.Columns){const n=t[St.Symbol.Columns];if(!n)return n;const s={};return Object.keys(n).map(o=>{s[o]=new Proxy(n[o],new aa(new Proxy(t,this)))}),s}const i=t[e];return at(i,Ke)?new Proxy(i,new aa(new Proxy(t,this))):i}}$(du,oy,"TableAliasProxyHandler");function cc(r,t){return new Proxy(r,new du(t,!1))}function Bi(r,t){return new Proxy(r,new aa(new Proxy(r.table,new du(t,!1))))}function Sw(r,t){return new Ft.Aliased(Gl(r.sql,t),r.fieldAlias)}function Gl(r,t){return H.join(r.queryChunks.map(e=>at(e,Ke)?Bi(e,t):at(e,Ft)?Gl(e,t):at(e,Ft.Aliased)?Sw(e,t):e))}var ay,ly;class Gf extends(ly=Error,ay=xt,ly){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}$(Gf,ay,"DrizzleError");var uy,cy;class Tw extends(cy=Gf,uy=xt,cy){constructor(){super({message:"Rollback"})}}$(Tw,uy,"TransactionRollbackError");var hy;hy=xt;class Iw{write(t){console.log(t)}}$(Iw,hy,"ConsoleLogWriter");var fy;fy=xt;class Ew{constructor(t){$(this,"writer");this.writer=(t==null?void 0:t.writer)??new Iw}logQuery(t,e){const i=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),n=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${t}${n}`)}}$(Ew,fy,"DefaultLogger");var dy;dy=xt;class Cw{logQuery(){}}$(Cw,dy,"NoopLogger");var py,my;my=xt,py=Symbol.toStringTag;class En{constructor(){$(this,py,"QueryPromise")}catch(t){return this.then(void 0,t)}finally(t){return this.then(e=>(t==null||t(),e),e=>{throw t==null||t(),e})}then(t,e){return this.execute().then(t,e)}}$(En,my,"QueryPromise");function ls(r,t){return Object.entries(r).reduce((e,[i,n])=>{if(typeof i!="string")return e;const s=t?[...t,i]:[i];return at(n,Ke)||at(n,Ft)||at(n,Ft.Aliased)?e.push({path:s,field:n}):at(n,St)?e.push(...ls(n[St.Symbol.Columns],s)):e.push(...ls(n,s)),e},[])}function Wf(r,t){const e=Object.keys(r),i=Object.keys(t);if(e.length!==i.length)return!1;for(const[n,s]of e.entries())if(s!==i[n])return!1;return!0}function Aw(r,t){const e=Object.entries(t).filter(([,i])=>i!==void 0).map(([i,n])=>at(n,Ft)||at(n,Ke)?[i,n]:[i,new Hi(n,r[St.Symbol.Columns][i])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function WD(r,t){for(const e of t)for(const i of Object.getOwnPropertyNames(e.prototype))i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)||Object.create(null))}function HD(r){return r[St.Symbol.Columns]}function Yn(r){return at(r,dr)?r._.alias:at(r,In)?r[He].name:at(r,Ft)?void 0:r[St.Symbol.IsAlias]?r[St.Symbol.Name]:r[St.Symbol.BaseName]}function YD(r){if(typeof r!="object"||r===null||r.constructor.name!=="Object")return!1;if("logger"in r){const t=typeof r.logger;return!(t!=="boolean"&&(t!=="object"||typeof r.logger.logQuery!="function")&&t!=="undefined")}if("schema"in r){const t=typeof r.schema;return!(t!=="object"&&t!=="undefined")}if("casing"in r){const t=typeof r.casing;return!(t!=="string"&&t!=="undefined")}if("mode"in r)return!(r.mode!=="default"||r.mode!=="planetscale"||r.mode!==void 0);if("connection"in r){const t=typeof r.connection;return!(t!=="string"&&t!=="object"&&t!=="undefined")}if("client"in r){const t=typeof r.client;return!(t!=="object"&&t!=="function"&&t!=="undefined")}return Object.keys(r).length===0}var yy,gy;class Ow extends(gy=Fr,yy=xt,gy){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}$(Ow,yy,"PgDate");var vy,_y;class Fw extends(_y=Fr,vy=xt,_y){getSQLType(){return"date"}}$(Fw,vy,"PgDateString");var by,wy;class Pw extends(wy=Fr,by=xt,wy){constructor(t,e){super(t,e)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}$(Pw,by,"PgJson");var xy,Sy;class Mw extends(Sy=Fr,xy=xt,Sy){constructor(t,e){super(t,e)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}$(Mw,xy,"PgJsonb");var Ty,Iy;class Dw extends(Iy=Fr,Ty=xt,Iy){constructor(e,i){super(e,i);$(this,"precision");$(this,"scale");this.precision=i.precision,this.scale=i.scale}mapFromDriverValue(e){return typeof e=="string"?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}}$(Dw,Ty,"PgNumeric");var Ey,Cy;class Rw extends(Cy=Fr,Ey=xt,Cy){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Rw,Ey,"PgTime");var Ay,Oy;class Nw extends(Oy=Fr,Ay=xt,Oy){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");$(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));$(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Nw,Ay,"PgTimestamp");var Fy,Py;class Lw extends(Py=Fr,Fy=xt,Py){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Lw,Fy,"PgTimestampString");var My,Dy;class Bw extends(Dy=Fr,My=xt,Dy){getSQLType(){return"uuid"}}$(Bw,My,"PgUUID");const Om=Symbol.for("drizzle:PgInlineForeignKeys"),Fm=Symbol.for("drizzle:EnableRLS");var Ry,Ny,Ly,By,ky,Uy;class br extends(Uy=St,ky=xt,By=Om,Ly=Fm,Ny=St.Symbol.ExtraConfigBuilder,Ry=St.Symbol.ExtraConfigColumns,Uy){constructor(){super(...arguments);$(this,By,[]);$(this,Ly,!1);$(this,Ny);$(this,Ry,{})}}$(br,ky,"PgTable"),$(br,"Symbol",Object.assign({},St.Symbol,{InlineForeignKeys:Om,EnableRLS:Fm}));var zy;zy=xt;class kw{constructor(t,e){$(this,"columns");$(this,"name");this.columns=t,this.name=e}build(t){return new Uw(t,this.columns,this.name)}}$(kw,zy,"PgPrimaryKeyBuilder");var jy;jy=xt;class Uw{constructor(t,e,i){$(this,"columns");$(this,"name");this.table=t,this.columns=e,this.name=i}getName(){return this.name??`${this.table[br.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}$(Uw,jy,"PgPrimaryKey");function yr(r,t){return VD(t)&&!bw(r)&&!at(r,Hi)&&!at(r,as)&&!at(r,Ke)&&!at(r,St)&&!at(r,In)?new Hi(r,t):r}const zw=(r,t)=>H`${r} = ${yr(t,r)}`,XD=(r,t)=>H`${r} <> ${yr(t,r)}`;function Oh(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Ye("("),H.join(t,new Ye(" and ")),new Ye(")")])}function qD(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Ye("("),H.join(t,new Ye(" or ")),new Ye(")")])}function QD(r){return H`not ${r}`}const KD=(r,t)=>H`${r} > ${yr(t,r)}`,ZD=(r,t)=>H`${r} >= ${yr(t,r)}`,JD=(r,t)=>H`${r} < ${yr(t,r)}`,tR=(r,t)=>H`${r} <= ${yr(t,r)}`;function eR(r,t){return Array.isArray(t)?t.length===0?H`false`:H`${r} in ${t.map(e=>yr(e,r))}`:H`${r} in ${yr(t,r)}`}function rR(r,t){return Array.isArray(t)?t.length===0?H`true`:H`${r} not in ${t.map(e=>yr(e,r))}`:H`${r} not in ${yr(t,r)}`}function iR(r){return H`${r} is null`}function nR(r){return H`${r} is not null`}function sR(r){return H`exists ${r}`}function oR(r){return H`not exists ${r}`}function aR(r,t,e){return H`${r} between ${yr(t,r)} and ${yr(e,r)}`}function lR(r,t,e){return H`${r} not between ${yr(t,r)} and ${yr(e,r)}`}function uR(r,t){return H`${r} like ${t}`}function cR(r,t){return H`${r} not like ${t}`}function hR(r,t){return H`${r} ilike ${t}`}function fR(r,t){return H`${r} not ilike ${t}`}function dR(r){return H`${r} asc`}function pR(r){return H`${r} desc`}var $y;$y=xt;class Hf{constructor(t,e,i){$(this,"referencedTableName");$(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=i,this.referencedTableName=e[St.Symbol.Name]}}$(Hf,$y,"Relation");var Vy;Vy=xt;class jw{constructor(t,e){this.table=t,this.config=e}}$(jw,Vy,"Relations");var Gy,Wy;const Yl=class Yl extends(Wy=Hf,Gy=xt,Wy){constructor(t,e,i,n){super(t,e,i==null?void 0:i.relationName),this.config=i,this.isNullable=n}withFieldName(t){const e=new Yl(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};$(Yl,Gy,"One");let us=Yl;var Hy,Yy;const Xl=class Xl extends(Yy=Hf,Hy=xt,Yy){constructor(t,e,i){super(t,e,i==null?void 0:i.relationName),this.config=i}withFieldName(t){const e=new Xl(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};$(Xl,Hy,"Many");let Wl=Xl;function mR(){return{and:Oh,between:aR,eq:zw,exists:sR,gt:KD,gte:ZD,ilike:hR,inArray:eR,isNull:iR,isNotNull:nR,like:uR,lt:JD,lte:tR,ne:XD,not:QD,notBetween:lR,notExists:oR,notLike:cR,notIlike:fR,notInArray:rR,or:qD,sql:H}}function yR(){return{sql:H,asc:dR,desc:pR}}function gR(r,t){var s;Object.keys(r).length===1&&"default"in r&&!at(r.default,St)&&(r=r.default);const e={},i={},n={};for(const[o,a]of Object.entries(r))if(at(a,St)){const l=oa(a),u=i[l];e[l]=o,n[o]={tsName:o,dbName:a[St.Symbol.Name],schema:a[St.Symbol.Schema],columns:a[St.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[St.Symbol.Columns]))h.primary&&n[o].primaryKey.push(h);const c=(s=a[St.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[St.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))at(h,kw)&&n[o].primaryKey.push(...h.columns)}else if(at(a,jw)){const l=oa(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[p,f]of Object.entries(c))if(u){const y=n[u];y.relations[p]=f}else l in i||(i[l]={relations:{},primaryKey:h}),i[l].relations[p]=f}return{tables:n,tableNamesMap:e}}function vR(r){return function(e,i){return new us(r,e,i,(i==null?void 0:i.fields.reduce((n,s)=>n&&s.notNull,!0))??!1)}}function _R(r){return function(e,i){return new Wl(r,e,i)}}function bR(r,t,e){if(at(e,us)&&e.config)return{fields:e.config.fields,references:e.config.references};const i=t[oa(e.referencedTable)];if(!i)throw new Error(`Table "${e.referencedTable[St.Symbol.Name]}" not found in schema`);const n=r[i];if(!n)throw new Error(`Table "${i}" not found in schema`);const s=e.sourceTable,o=t[oa(s)];if(!o)throw new Error(`Table "${s[St.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(n.relations))(e.relationName&&e!==l&&l.relationName===e.relationName||!e.relationName&&l.referencedTable===e.sourceTable)&&a.push(l);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${i}"`):new Error(`There are multiple relations between "${i}" and "${e.sourceTable[St.Symbol.Name]}". Please specify relation name`);if(a[0]&&at(a[0],us)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${o}.${e.fieldName}"`)}function wR(r){return{one:vR(r),many:_R(r)}}function Fh(r,t,e,i,n=s=>s){const s={};for(const[o,a]of i.entries())if(a.isJson){const l=t.relations[a.tsKey],u=e[o],c=typeof u=="string"?JSON.parse(u):u;s[a.tsKey]=at(l,us)?c&&Fh(r,r[a.relationTableTsKey],c,a.selection,n):c.map(h=>Fh(r,r[a.relationTableTsKey],h,a.selection,n))}else{const l=n(e[o]),u=a.field;let c;at(u,Ke)?c=u:at(u,Ft)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var Xy;Xy=xt;const ql=class ql{constructor(t){$(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===He)return{...t[He],selectedFields:new Proxy(t[He].selectedFields,this)};if(typeof e=="symbol")return t[e];const n=(at(t,dr)?t._.selectedFields:at(t,In)?t[He].selectedFields:t)[e];if(at(n,Ft.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!n.isSelectionField)return n.sql;const s=n.clone();return s.isSelectionField=!0,s}if(at(n,Ft)){if(this.config.sqlBehavior==="sql")return n;throw new Error(`You tried to reference "${e}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return at(n,Ke)?this.config.alias?new Proxy(n,new aa(new Proxy(n.table,new du(this.config.alias,this.config.replaceOriginalName??!1)))):n:typeof n!="object"||n===null?n:new Proxy(n,new ql(this.config))}};$(ql,Xy,"SelectionProxyHandler");let Je=ql;function xR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function SR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,i,n)=>{const s=n===0?i.toLowerCase():`${i[0].toUpperCase()}${i.slice(1)}`;return e+s},"")}function TR(r){return r}var qy;qy=xt;class $w{constructor(t){$(this,"cache",{});$(this,"cachedTables",{});$(this,"convert");this.convert=t==="snake_case"?xR:t==="camelCase"?SR:TR}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[St.Symbol.Schema]??"public",i=t.table[St.Symbol.OriginalName],n=`${e}.${i}.${t.name}`;return this.cache[n]||this.cacheTable(t.table),this.cache[n]}cacheTable(t){const e=t[St.Symbol.Schema]??"public",i=t[St.Symbol.OriginalName],n=`${e}.${i}`;if(!this.cachedTables[n]){for(const s of Object.values(t[St.Symbol.Columns])){const o=`${n}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[n]=!0}}clearCache(){this.cache={},this.cachedTables={}}}$($w,qy,"CasingCache");var Qy,Ky;class Yf extends(Ky=In,Qy=xt,Ky){}$(Yf,Qy,"PgViewBase");var Zy;Zy=xt;class zo{constructor(t){$(this,"casing");this.casing=new $w(t==null?void 0:t.casing)}async migrate(t,e,i){const n=typeof i=="string"?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",s=typeof i=="string"?"drizzle":i.migrationsSchema??"drizzle",o=H` - CREATE TABLE IF NOT EXISTS ${H.identifier(s)}.${H.identifier(n)} ( - id SERIAL PRIMARY KEY, - hash text NOT NULL, - created_at bigint - ) - `;await e.execute(H`CREATE SCHEMA IF NOT EXISTS ${H.identifier(s)}`),await e.execute(o);const l=(await e.all(H`select id, hash, created_at from ${H.identifier(s)}.${H.identifier(n)} order by created_at desc limit 1`))[0];await e.transaction(async u=>{for await(const c of t)if(!l||Number(l.created_at){var a;return e[o]!==void 0||((a=i[o])==null?void 0:a.onUpdateFn)!==void 0}),s=n.length;return H.join(n.flatMap((o,a)=>{const l=i[o],u=e[o]??H.param(l.onUpdateFn(),l),c=H`${H.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(at(s,Ft.Aliased)&&s.isSelectionField)a.push(H.identifier(s.fieldAlias));else if(at(s,Ft.Aliased)||at(s,Ft)){const l=at(s,Ft.Aliased)?s.sql:s;e?a.push(new Ft(l.queryChunks.map(u=>at(u,Fr)?H.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),at(s,Ft.Aliased)&&a.push(H` as ${H.identifier(s.fieldAlias)}`)}else at(s,Ke)&&(e?a.push(H.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:M})=>M===(it[St.Symbol.IsAlias]?Kn(it):it[St.Symbol.BaseName])))(w.field.table)){const it=Kn(w.field.table);throw new Error(`Your "${w.path.join("->")}" field references a column "${it}"."${w.field.name}", but the table "${it}" is not part of the query! Did you forget to join it?`)}const d=!a||a.length===0,m=this.buildWithCTE(t);let _;f&&(_=f===!0?H` distinct`:H` distinct on (${H.join(f.on,H`, `)})`);const S=this.buildSelection(g,{isSingleTable:d}),E=this.buildFromTable(o),b=this.buildJoins(a),F=n?H` where ${n}`:void 0,x=s?H` having ${s}`:void 0;let z;l&&l.length>0&&(z=H` order by ${H.join(l,H`, `)}`);let B;u&&u.length>0&&(B=H` group by ${H.join(u,H`, `)}`);const tt=typeof c=="object"||typeof c=="number"&&c>=0?H` limit ${c}`:void 0,st=h?H` offset ${h}`:void 0,I=H.empty();if(p){const w=H` for ${H.raw(p.strength)}`;p.config.of&&w.append(H` of ${H.join(Array.isArray(p.config.of)?p.config.of:[p.config.of],H`, `)}`),p.config.noWait?w.append(H` nowait`):p.config.skipLocked&&w.append(H` skip locked`),I.append(w)}const Z=H`${m}select${_} ${S} from ${E}${b}${F}${B}${x}${z}${tt}${st}${I}`;return y.length>0?this.buildSetOperations(Z,y):Z}buildSetOperations(t,e){const[i,...n]=e;if(!i)throw new Error("Cannot pass undefined values to any set operator");return n.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:i}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:i}),n)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:i,rightSelect:n,limit:s,orderBy:o,offset:a}}){const l=H`(${t.getSQL()}) `,u=H`(${n.getSQL()})`;let c;if(o&&o.length>0){const y=[];for(const g of o)if(at(g,Fr))y.push(H.identifier(g.name));else if(at(g,Ft)){for(let d=0;d=0?H` limit ${s}`:void 0,p=H.raw(`${e} ${i?"all ":""}`),f=a?H` offset ${a}`:void 0;return H`${l}${p}${u}${c}${h}${f}`}buildInsertQuery({table:t,values:e,onConflict:i,returning:n,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[St.Symbol.Columns],c=Object.entries(u).filter(([m,_])=>!_.shouldDisableInsert()),h=c.map(([,m])=>H.identifier(this.casing.getColumnCasing(m)));if(o){const m=e;at(m,Ft)?l.push(m):l.push(m.getSQL())}else{const m=e;l.push(H.raw("values "));for(const[_,S]of m.entries()){const E=[];for(const[b,F]of c){const x=S[b];if(x===void 0||at(x,Hi)&&x.value===void 0)if(F.defaultFn!==void 0){const z=F.defaultFn(),B=at(z,Ft)?z:H.param(z,F);E.push(B)}else if(!F.default&&F.onUpdateFn!==void 0){const z=F.onUpdateFn(),B=at(z,Ft)?z:H.param(z,F);E.push(B)}else E.push(H`default`);else E.push(x)}l.push(E),_({dbKey:S.name,tsKey:_,field:Bi(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const m=Object.fromEntries(Object.entries(s.columns).map(([x,z])=>[x,Bi(z,a)]));if(o.where){const x=typeof o.where=="function"?o.where(m,mR()):o.where;y=x&&Gl(x,a)}const _=[];let S=[];if(o.columns){let x=!1;for(const[z,B]of Object.entries(o.columns))B!==void 0&&z in s.columns&&(!x&&B===!0&&(x=!0),S.push(z));S.length>0&&(S=x?S.filter(z=>{var B;return((B=o.columns)==null?void 0:B[z])===!0}):Object.keys(s.columns).filter(z=>!S.includes(z)))}else S=Object.keys(s.columns);for(const x of S){const z=s.columns[x];_.push({tsKey:x,value:z})}let E=[];o.with&&(E=Object.entries(o.with).filter(x=>!!x[1]).map(([x,z])=>({tsKey:x,queryConfig:z,relation:s.relations[x]})));let b;if(o.extras){b=typeof o.extras=="function"?o.extras(m,{sql:H}):o.extras;for(const[x,z]of Object.entries(b))_.push({tsKey:x,value:Sw(z,a)})}for(const{tsKey:x,value:z}of _)c.push({dbKey:at(z,Ft.Aliased)?z.fieldAlias:s.columns[x].name,tsKey:x,field:at(z,Ke)?Bi(z,a):z,relationTableTsKey:void 0,isJson:!1,selection:[]});let F=typeof o.orderBy=="function"?o.orderBy(m,yR()):o.orderBy??[];Array.isArray(F)||(F=[F]),f=F.map(x=>at(x,Ke)?Bi(x,a):Gl(x,a)),h=o.limit,p=o.offset;for(const{tsKey:x,queryConfig:z,relation:B}of E){const tt=bR(e,i,B),st=oa(B.referencedTable),I=i[st],Z=`${a}_${x}`,w=Oh(...tt.fields.map((O,D)=>zw(Bi(tt.references[D],Z),Bi(O,a)))),it=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:i,table:t[I],tableConfig:e[I],queryConfig:at(B,us)?z===!0?{limit:1}:{...z,limit:1}:z,tableAlias:Z,joinOn:w,nestedQueryRelation:B}),M=H`${H.identifier(Z)}.${H.identifier("data")}`.as(x);g.push({on:H`true`,table:new dr(it.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:x,tsKey:x,field:M,relationTableTsKey:I,isJson:!0,selection:it.selection})}}if(c.length===0)throw new Gf({message:`No fields selected for table "${s.tsName}" ("${a}")`});let d;if(y=Oh(u,y),l){let m=H`json_build_array(${H.join(c.map(({field:E,tsKey:b,isJson:F})=>F?H`${H.identifier(`${a}_${b}`)}.${H.identifier("data")}`:at(E,Ft.Aliased)?E.sql:E),H`, `)})`;at(l,Wl)&&(m=H`coalesce(json_agg(${m}${f.length>0?H` order by ${H.join(f,H`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:m.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||p!==void 0||f.length>0?(d=this.buildSelectQuery({table:cc(n,a),fields:{},fieldsFlat:[{path:[],field:H.raw("*")}],where:y,limit:h,offset:p,orderBy:f,setOperators:[]}),y=void 0,h=void 0,p=void 0,f=[]):d=cc(n,a),d=this.buildSelectQuery({table:at(d,br)?d:new dr(d,{},a),fields:{},fieldsFlat:_.map(({field:E})=>({path:[],field:at(E,Ke)?Bi(E,a):E})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]})}else d=this.buildSelectQuery({table:cc(n,a),fields:{},fieldsFlat:c.map(({field:m})=>({path:[],field:at(m,Ke)?Bi(m,a):m})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]});return{tableTsKey:s.tsName,sql:d,selection:c}}}$(zo,Zy,"PgDialect");var Jy;Jy=xt;class Vw{getSelectedFields(){return this._.selectedFields}}$(Vw,Jy,"TypedQueryBuilder");var tg;tg=xt;class Tr{constructor(t){$(this,"fields");$(this,"session");$(this,"dialect");$(this,"withList",[]);$(this,"distinct");$(this,"authToken");this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(t){return this.authToken=t,this}from(t){const e=!!this.fields,i=t;let n;return this.fields?n=this.fields:at(i,dr)?n=Object.fromEntries(Object.keys(i._.selectedFields).map(s=>[s,i[s]])):at(i,Yf)?n=i[He].selectedFields:at(i,Ft)?n={}:n=HD(i),new Xf({table:i,fields:n,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}$(Tr,tg,"PgSelectBuilder");var eg,rg;class Gw extends(rg=Vw,eg=xt,rg){constructor({table:e,fields:i,isPartialSelect:n,session:s,dialect:o,withList:a,distinct:l}){super();$(this,"_");$(this,"config");$(this,"joinsNotNullableMap");$(this,"tableName");$(this,"isPartialSelect");$(this,"session");$(this,"dialect");$(this,"cacheConfig");$(this,"usedTables",new Set);$(this,"leftJoin",this.createJoin("left",!1));$(this,"leftJoinLateral",this.createJoin("left",!0));$(this,"rightJoin",this.createJoin("right",!1));$(this,"innerJoin",this.createJoin("inner",!1));$(this,"innerJoinLateral",this.createJoin("inner",!0));$(this,"fullJoin",this.createJoin("full",!1));$(this,"crossJoin",this.createJoin("cross",!1));$(this,"crossJoinLateral",this.createJoin("cross",!0));$(this,"union",this.createSetOperator("union",!1));$(this,"unionAll",this.createSetOperator("union",!0));$(this,"intersect",this.createSetOperator("intersect",!1));$(this,"intersectAll",this.createSetOperator("intersect",!0));$(this,"except",this.createSetOperator("except",!1));$(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...i},distinct:l,setOperators:[]},this.isPartialSelect=n,this.session=s,this.dialect=o,this._={selectedFields:i,config:this.config},this.tableName=Yn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{};for(const u of Zn(e))this.usedTables.add(u)}getUsedTables(){return[...this.usedTables]}createJoin(e,i){return(n,s)=>{var l;const o=this.tableName,a=Yn(n);for(const u of Zn(n))this.usedTables.add(u);if(typeof a=="string"&&((l=this.config.joins)!=null&&l.some(u=>u.alias===a)))throw new Error(`Alias "${a}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof o=="string"&&(this.config.fields={[o]:this.config.fields}),typeof a=="string"&&!at(n,Ft))){const u=at(n,dr)?n._.selectedFields:at(n,In)?n[He].selectedFields:n[St.Symbol.Columns];this.config.fields[a]=u}if(typeof s=="function"&&(s=s(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:s,table:n,joinType:e,alias:a,lateral:i}),typeof a=="string")switch(e){case"left":{this.joinsNotNullableMap[a]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([u])=>[u,!1])),this.joinsNotNullableMap[a]=!0;break}case"cross":case"inner":{this.joinsNotNullableMap[a]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([u])=>[u,!1])),this.joinsNotNullableMap[a]=!1;break}}return this}}createSetOperator(e,i){return n=>{const s=typeof n=="function"?n(IR()):n;if(!Wf(this.getSelectedFields(),s.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:i,rightSelect:s}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),n=Array.isArray(i)?i:[i];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{const i=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,i={}){return this.config.lockingClause={strength:e,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(e){const i=[];if(i.push(...Zn(this.config.table)),this.config.joins)for(const n of this.config.joins)i.push(...Zn(n.table));return new Proxy(new dr(this.getSQL(),this.config.fields,e,!1,[...new Set(i)]),new Je({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Je({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}$withCache(e){return this.cacheConfig=e===void 0?{config:{},enable:!0,autoInvalidate:!0}:e===!1?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}}$(Gw,eg,"PgSelectQueryBuilder");var ig,ng;class Xf extends(ng=Gw,ig=xt,ng){constructor(){super(...arguments);$(this,"authToken");$(this,"execute",e=>Mr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:i,config:n,dialect:s,joinsNotNullableMap:o,authToken:a,cacheConfig:l,usedTables:u}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");const{fields:c}=n;return Mr.startActiveSpan("drizzle.prepareQuery",()=>{const h=ls(c),p=i.prepareQuery(s.sqlToQuery(this.getSQL()),h,e,!0,void 0,{type:"select",tables:[...u]},l);return p.joinsNotNullableMap=o,p.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}$(Xf,ig,"PgSelect");WD(Xf,[En]);function uo(r,t){return(e,i,...n)=>{const s=[i,...n].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Wf(e.getSelectedFields(),o.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return e.addSetOperators(s)}}const IR=()=>({union:ER,unionAll:CR,intersect:AR,intersectAll:OR,except:FR,exceptAll:PR}),ER=uo("union",!1),CR=uo("union",!0),AR=uo("intersect",!1),OR=uo("intersect",!0),FR=uo("except",!1),PR=uo("except",!0);var sg;sg=xt;class qf{constructor(t){$(this,"dialect");$(this,"dialectConfig");$(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(i)),new Proxy(new Vf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=at(t,zo)?t:void 0,this.dialectConfig=at(t,zo)?void 0:t}with(...t){const e=this;function i(o){return new Tr({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function n(o){return new Tr({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Tr({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:i,selectDistinct:n,selectDistinctOn:s}}select(t){return new Tr({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Tr({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Tr({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new zo(this.dialectConfig)),this.dialect}}$(qf,sg,"PgQueryBuilder");function Zn(r){return at(r,br)?[r[Ks]?`${r[Ks]}.${r[St.Symbol.BaseName]}`:r[St.Symbol.BaseName]]:at(r,dr)?r._.usedTables??[]:at(r,Ft)?r.usedTables??[]:[]}var og,ag;class Ph extends(ag=En,og=xt,ag){constructor(e,i,n,s){super();$(this,"config");$(this,"cacheConfig");$(this,"authToken");$(this,"execute",e=>Mr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[St.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=ls(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Mr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:"delete",tables:Zn(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 Je({alias:Kn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(Ph,og,"PgDelete");var lg;lg=xt;class Mh{constructor(t,e,i,n,s){$(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n,this.overridingSystemValue_=s}setToken(t){return this.authToken=t,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const e=t.map(i=>{const n={},s=this.table[St.Symbol.Columns];for(const o of Object.keys(i)){const a=i[o];n[o]=at(a,Ft)?a:new Hi(a,s[o])}return n});return new Dh(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new qf):t;if(!at(e,Ft)&&!Wf(this.table[Ah],e._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new Dh(this.table,e,this.session,this.dialect,this.withList,!0)}}$(Mh,lg,"PgInsertBuilder");var ug,cg;class Dh extends(cg=En,ug=xt,cg){constructor(e,i,n,s,o,a,l){super();$(this,"config");$(this,"cacheConfig");$(this,"authToken");$(this,"execute",e=>Mr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=s,this.config={table:e,values:i,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[St.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=ls(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=H`do nothing`;else{let i="";i=Array.isArray(e.target)?e.target.map(s=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(s))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));const n=e.where?H` where ${e.where}`:void 0;this.config.onConflict=H`(${H.raw(i)})${n} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');const i=e.where?H` where ${e.where}`:void 0,n=e.targetWhere?H` where ${e.targetWhere}`:void 0,s=e.setWhere?H` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,Aw(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(l=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(l))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=H`(${H.raw(a)})${n} do update set ${o}${i}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Mr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:"insert",tables:Zn(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 Je({alias:Kn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(Dh,ug,"PgInsert");var hg,fg;class Ww extends(fg=En,hg=xt,fg){constructor(e,i,n){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Mr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={view:e}}concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Mr.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}}$(Ww,hg,"PgRefreshMaterializedView");var dg;dg=xt;class Rh{constructor(t,e,i,n){$(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n}setToken(t){return this.authToken=t,this}set(t){return new Hw(this.table,Aw(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}$(Rh,dg,"PgUpdateBuilder");var pg,mg;class Hw extends(mg=En,pg=xt,mg){constructor(e,i,n,s,o){super();$(this,"config");$(this,"tableName");$(this,"joinsNotNullableMap");$(this,"cacheConfig");$(this,"leftJoin",this.createJoin("left"));$(this,"rightJoin",this.createJoin("right"));$(this,"innerJoin",this.createJoin("inner"));$(this,"fullJoin",this.createJoin("full"));$(this,"authToken");$(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=n,this.dialect=s,this.config={set:i,table:e,withList:o,joins:[]},this.tableName=Yn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const i=e,n=Yn(i);return typeof n=="string"&&(this.joinsNotNullableMap[n]=!0),this.config.from=i,this}getTableLikeFields(e){return at(e,br)?e[St.Symbol.Columns]:at(e,dr)?e._.selectedFields:e[He].selectedFields}createJoin(e){return(i,n)=>{const s=Yn(i);if(typeof s=="string"&&this.config.joins.some(o=>o.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(typeof n=="function"){const o=this.config.from&&!at(this.config.from,Ft)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[St.Symbol.Columns],new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:n,table:i,joinType:e,alias:s}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!0;break}case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[St.Symbol.Columns]),this.config.from)){const i=Yn(this.config.from);if(typeof i=="string"&&this.config.from&&!at(this.config.from,Ft)){const n=this.getTableLikeFields(this.config.from);e[i]=n}for(const n of this.config.joins){const s=Yn(n.table);if(typeof s=="string"&&!at(n.table,Ft)){const o=this.getTableLikeFields(n.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=ls(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){const i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:"insert",tables:Zn(this.config.table)},this.cacheConfig);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:Kn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(Hw,pg,"PgUpdate");var yg,gg,vg;const $o=class $o extends(vg=Ft,gg=xt,yg=Symbol.toStringTag,vg){constructor(e){super($o.buildEmbeddedCount(e.source,e.filters).queryChunks);$(this,"sql");$(this,"token");$(this,yg,"PgCountBuilder");$(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=$o.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,i){return H`(select count(*) from ${e}${H.raw(" where ").if(i)}${i})`}static buildCount(e,i){return H`select count(*) as count from ${e}${H.raw(" where ").if(i)}${i};`}setToken(e){return this.token=e,this}then(e,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,i)}catch(e){return this.then(void 0,e)}finally(e){return this.then(i=>(e==null||e(),i),i=>{throw e==null||e(),i})}};$($o,gg,"PgCountBuilder");let Nh=$o;var _g;_g=xt;class Yw{constructor(t,e,i,n,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=i,this.table=n,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Lh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Lh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}$(Yw,_g,"PgRelationalQueryBuilder");var bg,wg;class Lh extends(wg=En,bg=xt,wg){constructor(e,i,n,s,o,a,l,u,c){super();$(this,"authToken");this.fullSchema=e,this.schema=i,this.tableNamesMap=n,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Mr.startActiveSpan("drizzle.prepareQuery",()=>{const{query:i,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(s,o)=>{const a=s.map(l=>Fh(this.schema,this.tableConfig,l,i.selection,o));return this.mode==="first"?a[0]:a})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){const e=this._getQuery(),i=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Mr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}$(Lh,bg,"PgRelationalQuery");var xg,Sg;class Xw extends(Sg=En,xg=xt,Sg){constructor(t,e,i,n){super(),this.execute=t,this.sql=e,this.query=i,this.mapBatchResult=n}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}$(Xw,xg,"PgRaw");var Tg;Tg=xt;class Qf{constructor(t,e,i){$(this,"query");$(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(new qf(i.dialect))),new Proxy(new Vf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});$(this,"$cache");$(this,"authToken");if(this.dialect=t,this.session=e,this._=i?{schema:i.schema,fullSchema:i.fullSchema,tableNamesMap:i.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[n,s]of Object.entries(this._.schema))this.query[n]=new Yw(i.fullSchema,this._.schema,this._.tableNamesMap,i.fullSchema[n],s,t,e);this.$cache={invalidate:async n=>{}}}$count(t,e){return new Nh({source:t,filters:e,session:this.session})}with(...t){const e=this;function i(u){return new Tr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function n(u){return new Tr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Tr({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new Rh(u,e.session,e.dialect,t)}function a(u){return new Mh(u,e.session,e.dialect,t)}function l(u){return new Ph(u,e.session,e.dialect,t)}return{select:i,selectDistinct:n,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Tr({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Tr({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Tr({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new Rh(t,this.session,this.dialect)}insert(t){return new Mh(t,this.session,this.dialect)}delete(t){return new Ph(t,this.session,this.dialect)}refreshMaterializedView(t){return new Ww(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?H.raw(t):t.getSQL(),i=this.dialect.sqlToQuery(e),n=this.session.prepareQuery(i,void 0,void 0,!1);return new Xw(()=>n.execute(void 0,this.authToken),e,i,s=>n.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}$(Qf,Tg,"PgDatabase");var Ig;Ig=xt;class qw{}$(qw,Ig,"Cache");var Eg,Cg;class Qw extends(Cg=qw,Eg=xt,Cg){strategy(){return"all"}async get(t){}async put(t,e,i,n){}async onMutate(t){}}$(Qw,Eg,"NoopCache");async function Pm(r,t){const e=`${r}-${JSON.stringify(t)}`,n=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",n);return[...new Uint8Array(s)].map(l=>l.toString(16).padStart(2,"0")).join("")}class un extends Error{constructor(t,e,i){super(`Failed query: ${t} -params: ${e}`),this.query=t,this.params=e,this.cause=i,Error.captureStackTrace(this,un),i&&(this.cause=i)}}var Ag;Ag=xt;class Kw{constructor(t,e,i,n){$(this,"authToken");$(this,"joinsNotNullableMap");var s;this.query=t,this.cache=e,this.queryMetadata=i,this.cacheConfig=n,e&&e.strategy()==="all"&&n===void 0&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),(s=this.cacheConfig)!=null&&s.enable||(this.cacheConfig=void 0)}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}async queryWithCache(t,e,i){if(this.cache===void 0||at(this.cache,Qw)||this.queryMetadata===void 0)try{return await i()}catch(n){throw new un(t,e,n)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await i()}catch(n){throw new un(t,e,n)}if((this.queryMetadata.type==="insert"||this.queryMetadata.type==="update"||this.queryMetadata.type==="delete")&&this.queryMetadata.tables.length>0)try{const[n]=await Promise.all([i(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return n}catch(n){throw new un(t,e,n)}if(!this.cacheConfig)try{return await i()}catch(n){throw new un(t,e,n)}if(this.queryMetadata.type==="select"){const n=await this.cache.get(this.cacheConfig.tag??await Pm(t,e),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(n===void 0){let s;try{s=await i()}catch(o){throw new un(t,e,o)}return await this.cache.put(this.cacheConfig.tag??await Pm(t,e),s,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),s}return n}try{return await i()}catch(n){throw new un(t,e,n)}}}$(Kw,Ag,"PgPreparedQuery");var Og;Og=xt;class Zw{constructor(t){this.dialect=t}execute(t,e){return Mr.startActiveSpan("drizzle.operation",()=>Mr.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1)).setToken(e).execute(void 0,e))}all(t){return this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1).all()}async count(t,e){const i=await this.execute(t,e);return Number(i[0].count)}}$(Zw,Og,"PgSession");var Fg,Pg;class Jw extends(Pg=Qf,Fg=xt,Pg){constructor(t,e,i,n=0){super(t,e,i),this.schema=i,this.nestedIndex=n}rollback(){throw new Tw}getTransactionConfigSQL(t){const e=[];return t.isolationLevel&&e.push(`isolation level ${t.isolationLevel}`),t.accessMode&&e.push(t.accessMode),typeof t.deferrable=="boolean"&&e.push(t.deferrable?"deferrable":"not deferrable"),H.raw(e.join(" "))}setTransaction(t){return this.session.execute(H`set transaction ${this.getTransactionConfigSQL(t)}`)}}$(Jw,Fg,"PgTransaction");function Mm(r){return typeof r=="string"&&/^true$/i.test(r)}function MR(r){const t={scheme:"duckdb-wasm:"},e=new URL(r);if(!e.protocol.startsWith("duckdb-wasm:"))throw new Error(`Expected scheme to be "duckdb-wasm:" but got "${e.protocol}"`);e.searchParams.get("bundles")==="import-url"&&(t.bundles="import-url");const i=e.searchParams.get("logger");i&&Mm(i)&&(t.logger=!0);const n=e.searchParams.get("storage");switch(n){case sa.ORIGIN_PRIVATE_FS:{e.host.length>0&&console.warn(`Host "${e.host}" will be ignored while using Origin Private FS`);const s=e.searchParams.get("write");t.storage={type:sa.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&Mm(s)&&{accessMode:F0.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${n}"`);break}return t}var Mg,Dg;class tx extends(Dg=Kw,Mg=xt,Dg){constructor(t,e,i,n,s,o){super({sql:e,params:i}),this.client=t,this.queryString=e,this.params=i,this.logger=n,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=Am(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:i,queryString:n,client:s,customResultMapper:o}=this,a=await s;return a.query(n,e)}async all(t={}){const e=Am(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}$(tx,Mg,"DuckDBWasmPreparedQuery");var Rg,Ng;const Ql=class Ql extends(Ng=Zw,Rg=xt,Ng){constructor(e,i,n,s={}){super(i);$(this,"logger");this.client=e,this.schema=n,this.options=s,this.logger=s.logger??new Cw}prepareQuery(e,i,n,s,o){return new tx(this.client,e.sql,e.params,this.logger,i,o)}async query(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}async queryObjects(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}transaction(e,i){return BD(this.client,async n=>{const s=new Ql(n,this.dialect,this.schema,this.options),o=new Bh(this.dialect,s,this.schema);return i&&await o.setTransaction(i),e(o)})}};$(Ql,Rg,"DuckDBWasmSession");let Hl=Ql;var Lg,Bg;const Kl=class Kl extends(Bg=Jw,Lg=xt,Bg){constructor(e,i,n,s=0){super(e,i,n,s);$(this,"dialect");$(this,"session");this.dialect=e,this.session=i}async transaction(e){return kD(this.session.client,"",async i=>{const n=new Hl(i,this.dialect,this.schema,this.session.options),s=new Kl(this.dialect,n,this.schema);return e(s)})}};$(Kl,Lg,"DuckDBWasmTransaction");let Bh=Kl;var kg,Ug;class ex extends(Ug=Qf,kg=xt,Ug){}$(ex,kg,"DuckDBWasmDatabase");function jo(r,t={}){const e=new zo({casing:t.casing});let i;t.logger===!0?i=new Ew:t.logger!==!1&&(i=t.logger);let n;if(t.schema){const a=gR(t.schema,wR);n={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new Hl(r,e,n,{logger:i}),o=new ex(e,s,n);return o.$client=r,o}function Dm(r,t){const e=MR(r);let i;return e.bundles==="import-url"?i=(async()=>{const s=await Eh();switch(s){case"browser":return(await cn(async()=>{const{getImportUrlBundles:o}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:o}},__vite__mapDeps([3,4]))).getImportUrlBundles();case"node":return await(await cn(async()=>{const{getImportUrlBundles:o}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:o}},__vite__mapDeps([5,4]))).getImportUrlBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})():i=(async()=>{const s=await Eh();switch(s){case"browser":return(await cn(async()=>{const{getBundles:o}=await import("./default-browser-BrgSDbLD.js");return{getBundles:o}},[])).getBundles();case"node":return await(await cn(async()=>{const{getBundles:o}=await import("./default-node-CNYmsmAm.js");return{getBundles:o}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})(),jo(_w({bundles:i,logger:e.logger?new P0:void 0,storage:e.storage}),t)}function Rm(...r){if(typeof r[0]=="string")return Dm(r[0],r[1]);if(YD(r[0])){const{connection:t,client:e,...i}=r[0];if(e)return jo(e,i);if(typeof t=="string")return Dm(t,i);if(typeof t>"u")throw new Error("connection option is required");return jo(_w({bundles:t.bundles,logger:t.logger,storage:t.storage}),i)}return jo(r[0],r[1])}(r=>{function t(e){return jo({options:{parsers:{},serializers:{}}},e)}r.mock=t})(Rm||(Rm={}));export{H1 as A,UR as D,BR as I,TC as J,hI as L,xc as M,LR as T,di as a,Re as b,Rm as d,la as e,kR as l}; diff --git a/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js b/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js deleted file mode 100644 index 54d7914dae64607b8fdfa908d6e7138279b0eb1c..0000000000000000000000000000000000000000 --- a/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js +++ /dev/null @@ -1 +0,0 @@ -import{c3 as P,d as c,cE as O,cj as V,cF as N,cB as E,bf as b,o as d,bg as _,bA as k,u as i,cA as D,cN as L,e as $,f as v,d2 as M,cx as U,d3 as z,w as H,c as g,c4 as K,bl as Y,d4 as G,W,cQ as X,cl as Q,ch as C,b as w,cg as B,a as f,Y as x,T as R,bh as J,ca as Z,b_ as j,a3 as A,a8 as S,U as ee}from"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";function T(t){return t?t.flatMap(e=>e.type===P?T(e.children):[e]):[]}const te=c({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:a}){return()=>{var m;if(!a.default)return null;const o=T(a.default()),l=o.findIndex(h=>h.type!==O);if(l===-1)return o;const r=o[l];(m=r.props)==null||delete m.ref;const n=r.props?V(e,r.props):e,u=N({...r,props:{}},n);return o.length===1?u:(o[l]=u,o)}}}),ae=["area","img","input"],q=c({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:a}){const o=t.asChild?"template":t.as;return typeof o=="string"&&ae.includes(o)?()=>E(o,e):o!=="template"?()=>E(t.as,e,{default:a.default}):()=>E(te,e,{default:a.default})}}),ne=c({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,a)=>(d(),b(i(q),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:_(()=>[k(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function le(t,e){const a=`${t}Context`,o=Symbol(a);return[n=>{const u=D(o,n);if(u||u===null)return u;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},n=>(L(o,n),n)]}function I(){const t=U(),e=$(),a=v(()=>{var n,u;return["#text","#comment"].includes((n=e.value)==null?void 0:n.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:M(e)}),o=Object.assign({},t.exposed),l={};for(const n in t.props)Object.defineProperty(l,n,{enumerable:!0,configurable:!0,get:()=>t.props[n]});if(Object.keys(o).length>0)for(const n in o)Object.defineProperty(l,n,{enumerable:!0,configurable:!0,get:()=>o[n]});Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=l;function r(n){e.value=n,n&&(Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),t.exposed=l)}return{forwardRef:r,currentRef:e,currentElement:a}}function oe(){const t=$(),e=v(()=>{var a,o;return["#text","#comment"].includes((a=t.value)==null?void 0:a.$el.nodeName)?(o=t.value)==null?void 0:o.$el.nextElementSibling:M(t)});return{primitiveElement:t,currentElement:e}}function re(t){return v(()=>{var e;return z(t)?!!((e=M(t))!=null&&e.closest("form")):!0})}const F=c({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,{primitiveElement:a,currentElement:o}=oe(),l=v(()=>e.checked??e.value);return H(l,(r,n)=>{if(!o.value)return;const u=o.value,m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"value").set;if(p&&r!==n){const s=new Event("input",{bubbles:!0}),y=new Event("change",{bubbles:!0});p.call(u,r),u.dispatchEvent(s),u.dispatchEvent(y)}}),(r,n)=>(d(),b(ne,V({ref_key:"primitiveElement",ref:a},{...e,...r.$attrs},{as:"input"}),null,16))}}),se=c({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,a=v(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),o=v(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((l,r)=>typeof l=="object"?Object.entries(l).map(([n,u])=>({name:`[${e.name}][${r}][${n}]`,value:u})):{name:`[${e.name}][${r}]`,value:l}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([l,r])=>({name:`[${e.name}][${l}]`,value:r})):[]);return(l,r)=>a.value?(d(),b(F,V({key:l.name},{...e,...l.$attrs},{name:l.name,value:l.value}),null,16,["name","value"])):(d(!0),g(P,{key:1},K(o.value,n=>(d(),b(F,V({key:n.name,ref_for:!0},{...e,...l.$attrs},{name:n.name,value:n.value}),null,16,["name","value"]))),128))}}),[ue,ie]=le("SwitchRoot"),de=c({__name:"SwitchRoot",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null],default:void 0},disabled:{type:Boolean},id:{},value:{default:"on"},asChild:{type:Boolean},as:{default:"button"},name:{},required:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const a=t,o=e,{disabled:l}=Y(a),r=G(a,"modelValue",o,{defaultValue:a.defaultValue,passive:a.modelValue===void 0});function n(){l.value||(r.value=!r.value)}const{forwardRef:u,currentElement:m}=I(),h=re(m),p=v(()=>{var s;return a.id&&m.value?(s=document.querySelector(`[for="${a.id}"]`))==null?void 0:s.innerText:void 0});return ie({modelValue:r,toggleCheck:n,disabled:l}),(s,y)=>(d(),b(i(q),V(s.$attrs,{id:s.id,ref:i(u),role:"switch",type:s.as==="button"?"button":void 0,value:s.value,"aria-label":s.$attrs["aria-label"]||p.value,"aria-checked":i(r),"aria-required":s.required,"data-state":i(r)?"checked":"unchecked","data-disabled":i(l)?"":void 0,"as-child":s.asChild,as:s.as,disabled:i(l),onClick:n,onKeydown:X(Q(n,["prevent"]),["enter"])}),{default:_(()=>[k(s.$slots,"default",{modelValue:i(r)}),i(h)&&s.name?(d(),b(i(se),{key:0,type:"checkbox",name:s.name,disabled:i(l),required:s.required,value:s.value,checked:!!i(r)},null,8,["name","disabled","required","value","checked"])):W("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),ce=c({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=ue();return I(),(a,o)=>{var l;return d(),b(i(q),{"data-state":(l=i(e).modelValue)!=null&&l.value?"checked":"unchecked","data-disabled":i(e).disabled.value?"":void 0,"as-child":a.asChild,as:a.as},{default:_(()=>[k(a.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),me=c({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=C(t,"modelValue");return(a,o)=>(d(),b(i(de),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=l=>e.value=l),transition:"background duration-250 ease-in-out",outline:"focus-within:none",flex:"~",border:"neutral-300 dark:neutral-700 data-[state=checked]:primary-200 data-[state=unchecked]:neutral-300 focus-within:neutral-800",bg:"data-[state=checked]:primary-400 data-[state=unchecked]:neutral-300 data-[state=checked]:dark:primary-400/80 dark:data-[state=unchecked]:neutral-800",relative:"","h-7":"",w:"12.5","rounded-full":"",shadow:"sm focus-within:shadow-neutral-800 focus-within:[0_0_0_1px] "},{default:_(()=>[w(i(ce),{"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"]))}}),pe={flex:"~ col gap-4"},fe={flex:"~ row","items-center":"","gap-2":""},ve={flex:"1"},he={class:"flex items-center gap-1 text-sm font-medium"},ye={class:"text-xs text-neutral-500 dark:text-neutral-400"},Re=c({__name:"FieldCheckbox",props:B({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,a=C(t,"modelValue");return(o,l)=>(d(),g("label",pe,[f("div",fe,[f("div",ve,[f("div",he,x(e.label),1),f("div",ye,x(e.description),1)]),w(me,{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=r=>a.value=r)},null,8,["modelValue"])])]))}}),be=["min","max","step"],_e=c({__name:"Range",props:B({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:"#9090906e"},trackColor:{default:"gray"},trackValueColor:{default:"red"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,a=C(t,"modelValue"),o=v(()=>e.min*1e4),l=v(()=>e.max*1e4),r=v(()=>e.step*1e4),n=$(),u=v({get:()=>a.value*1e4,set:p=>{a.value=p/1e4,m()}});R(()=>{m()});function m(){n.value&&(n.value.style.setProperty("--value",n.value.value),n.value.style.setProperty("--min",n.value.min?n.value.min:e.min.toString()),n.value.style.setProperty("--max",n.value.max?n.value.max:e.max.toString()))}function h(p){const s=p.target;s.style.setProperty("--value",s.value)}return(p,s)=>J((d(),g("input",{ref_key:"sliderRef",ref:n,"onUpdate:modelValue":s[0]||(s[0]=y=>u.value=y),type:"range",min:o.value,max:l.value,step:r.value,class:"slider-progress form_input-range",onInput:h},null,40,be)),[[Z,u.value,void 0,{number:!0}]])}}),ge=j(_e,[["__scopeId","data-v-c59a94f0"]]),xe={flex:"~ col gap-4"},Ve={flex:"~ row","items-center":"","gap-2":""},$e={flex:"1"},we={class:"flex items-center gap-1 text-sm font-medium"},ke={class:"text-xs text-neutral-500 dark:text-neutral-400"},Ce={"font-mono":""},Ee={flex:"~ row","items-center":"","gap-2":""},Te=c({__name:"FieldRange",props:B({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,a=C(t,"modelValue");return(o,l)=>{var r;return d(),g("label",xe,[f("div",Ve,[f("div",$e,[f("div",we,x(t.label),1),f("div",ke,x(t.description),1)]),f("span",Ce,x(((r=e.formatValue)==null?void 0:r.call(e,a.value))||a.value),1)]),f("div",Ee,[w(ge,{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=n=>a.value=n),min:t.min||0,max:t.max||1,step:t.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}}),Se=c({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,a)=>(d(),g("div",{class:"volumed",style:A({perspective:`${t.perspective}px`,transform:t.transform})},[k(e.$slots,"default",{},void 0,!0)],4))}}),Me=j(Se,[["__scopeId","data-v-568551bc"]]),Be=c({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const a=t,o=$(1),l=$(0);let r=0;const n=S(()=>a.friction),u=S(()=>a.baseSpeed),m=S(()=>a.momentumFactor);function h(s){r||(r=s);const y=s-r;r=s,o.value=u.value+(o.value-u.value)*n.value,l.value+=o.value*y,requestAnimationFrame(h)}function p(s){const y=Math.sqrt(s.movementX**2+s.movementY**2);o.value+=y*m.value}return R(()=>{window.addEventListener("mousemove",p),requestAnimationFrame(h)}),ee(()=>{window.removeEventListener("mousemove",p)}),e({momentum:o,currentValue:l}),(s,y)=>k(s.$slots,"default",{momentum:o.value,currentValue:l.value})}}),je=c({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,a)=>(d(),g("div",{class:"test-dummy-flat",style:A({width:`${t.size}px`,height:`${t.size}px`})},a[0]||(a[0]=[f("div",{class:"marker"},null,-1)]),4))}}),Ae=j(je,[["__scopeId","data-v-b4ef37ac"]]),Ie=c({__name:"TestDummyMarker",setup(t){return(e,a)=>(d(),b(Be,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:_(({currentValue:o})=>[w(Me,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:_(()=>[w(Ae,{size:24,style:A({transform:`rotate(${o}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});export{Te as _,Re as a,Ie as b}; diff --git a/assets/Textarea-C0dnrt_L.js b/assets/Textarea-C0dnrt_L.js new file mode 100644 index 0000000000000000000000000000000000000000..9b446b706fb5c9688c4d34c8be25537cc335f731 --- /dev/null +++ b/assets/Textarea-C0dnrt_L.js @@ -0,0 +1 @@ +import{createBlock as e,defineComponent as t,openBlock as n,useModel as r}from"./index-BtAisBe9.js";import{Basic_default as i}from"./Basic-BA5ubWIJ.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/Textarea.vue_vue_type_script_setup_true_lang-l_0OEYvy.js b/assets/Textarea.vue_vue_type_script_setup_true_lang-l_0OEYvy.js deleted file mode 100644 index d621204a5cf64d6ba33c920d1babc8d9f8b8eed6..0000000000000000000000000000000000000000 --- a/assets/Textarea.vue_vue_type_script_setup_true_lang-l_0OEYvy.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as r}from"./Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js";import{d as t,ch as u,bf as d,o as n}from"./index-D7HCX4VR.js";const p=t({__name:"Textarea",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(l){const e=u(l,"modelValue");return(s,a)=>(n(),d(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-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"]))}});export{p as _}; diff --git a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js deleted file mode 100644 index 75577ab8f5b226726d11c068aeba4a4ce8435893..0000000000000000000000000000000000000000 --- a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js +++ /dev/null @@ -1 +0,0 @@ -import{d as m,bf as T,o as l,cm as b,bg as B,bA as v}from"./index-D7HCX4VR.js";const n="0px",W=m({__name:"TransitionVertical",props:{duration:{default:250},easingEnter:{default:"ease-in-out"},easingLeave:{default:"ease-in-out"},opacityClosed:{default:0},opacityOpened:{default:1}},setup(c){const r=c;function p(o){return{height:o.style.height,width:o.style.width,position:o.style.position,visibility:o.style.visibility,overflow:o.style.overflow,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,borderTopWidth:o.style.borderTopWidth,borderBottomWidth:o.style.borderBottomWidth,marginTop:o.style.marginTop,marginBottom:o.style.marginBottom}}function y(o,t){const{width:i}=getComputedStyle(o);o.style.width=i,o.style.position="absolute",o.style.visibility="hidden",o.style.height="";const{height:s}=getComputedStyle(o);return o.style.width=t.width,o.style.position=t.position,o.style.visibility=t.visibility,o.style.height=n,o.style.overflow="hidden",t.height&&t.height!==n?t.height:s}function h(o,t,i,s,d){const e=o.animate(s,d);o.style.height=t.height,e.onfinish=()=>{o.style.overflow=t.overflow,i()}}function g(o,t){return[{height:n,opacity:r.opacityClosed,paddingTop:n,paddingBottom:n,borderTopWidth:n,borderBottomWidth:n,marginTop:n,marginBottom:n},{height:o,opacity:r.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function u(o,t){const i=o,s=p(i),d=y(i,s),e=g(d,s),a={duration:r.duration,easing:r.easingEnter};h(i,s,t,e,a)}function f(o,t){const i=o,s=p(i),{height:d}=getComputedStyle(i);i.style.height=d,i.style.overflow="hidden";const e=g(d,s).reverse(),a={duration:r.duration,easing:r.easingLeave};h(i,s,t,e,a)}return(o,t)=>(l(),T(b,{css:!1,onEnter:u,onLeave:f},{default:B(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; diff --git a/assets/_...all_-BUlXblH9.js b/assets/_...all_-BUlXblH9.js new file mode 100644 index 0000000000000000000000000000000000000000..136df87e0e2359c0b3e28d82fb9b69b9338e3f3b --- /dev/null +++ b/assets/_...all_-BUlXblH9.js @@ -0,0 +1 @@ +import{__plugin_vue_export_helper_default as e,createElementBlock as t,openBlock as n}from"./index-BtAisBe9.js";const r={};function i(e,r){return n(),t(`div`,null,` 404 - Page not found `)}var a=e(r,[[`render`,i]]);export{a as default}; \ No newline at end of file diff --git a/assets/_...all_-CvLU7PxS.js b/assets/_...all_-CvLU7PxS.js deleted file mode 100644 index 26f2ad5a0e01db9595ed683085b43d336f40d3ec..0000000000000000000000000000000000000000 --- a/assets/_...all_-CvLU7PxS.js +++ /dev/null @@ -1 +0,0 @@ -import{b_ as e,c as _,o as c}from"./index-D7HCX4VR.js";const n={};function o(t,r){return c(),_("div",null," 404 - Page not found ")}const s=e(n,[["render",o]]);export{s as default}; diff --git a/assets/__vite-browser-external-CIQGHXr-.js b/assets/__vite-browser-external-CIQGHXr-.js new file mode 100644 index 0000000000000000000000000000000000000000..684fcf4948e0b44cb746436e72c53844c2a7797d --- /dev/null +++ b/assets/__vite-browser-external-CIQGHXr-.js @@ -0,0 +1 @@ +import{__commonJSMin as e}from"./index-BtAisBe9.js";var t=e((exports,t)=>{t.exports={}});export default t(); \ No newline at end of file diff --git a/assets/__vite-browser-external-FmFgRqLi.js b/assets/__vite-browser-external-FmFgRqLi.js deleted file mode 100644 index 6d44a475320aae05e3701aa4684540f42a53f140..0000000000000000000000000000000000000000 --- a/assets/__vite-browser-external-FmFgRqLi.js +++ /dev/null @@ -1 +0,0 @@ -const t={};export{t as default}; diff --git a/assets/__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js b/assets/__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js deleted file mode 100644 index b480ffe6ce7040f68468da9d453d371cbc190177..0000000000000000000000000000000000000000 --- a/assets/__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js +++ /dev/null @@ -1 +0,0 @@ -const e={};export{e as default}; diff --git a/assets/__vite-optional-peer-dep_effect_xsschema-DJmQZR04.js b/assets/__vite-optional-peer-dep_effect_xsschema-DJmQZR04.js new file mode 100644 index 0000000000000000000000000000000000000000..b515614e923ea7ca25bbb750412c598834dbaee1 --- /dev/null +++ b/assets/__vite-optional-peer-dep_effect_xsschema-DJmQZR04.js @@ -0,0 +1 @@ +var e={};export{e as default}; \ No newline at end of file diff --git a/assets/__vite-optional-peer-dep_sury_xsschema-BIHI7g3E.js b/assets/__vite-optional-peer-dep_sury_xsschema-BIHI7g3E.js deleted file mode 100644 index b480ffe6ce7040f68468da9d453d371cbc190177..0000000000000000000000000000000000000000 --- a/assets/__vite-optional-peer-dep_sury_xsschema-BIHI7g3E.js +++ /dev/null @@ -1 +0,0 @@ -const e={};export{e as default}; diff --git a/assets/__vite-optional-peer-dep_sury_xsschema-B_lOmKXZ.js b/assets/__vite-optional-peer-dep_sury_xsschema-B_lOmKXZ.js new file mode 100644 index 0000000000000000000000000000000000000000..b515614e923ea7ca25bbb750412c598834dbaee1 --- /dev/null +++ b/assets/__vite-optional-peer-dep_sury_xsschema-B_lOmKXZ.js @@ -0,0 +1 @@ +var e={};export{e as default}; \ No newline at end of file diff --git a/assets/airi-card-bXvDq1QK.js b/assets/airi-card-bXvDq1QK.js new file mode 100644 index 0000000000000000000000000000000000000000..ed2c836db0bf42569a4c2d863e3567a6101e17d7 --- /dev/null +++ b/assets/airi-card-bXvDq1QK.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useAiriCardStore as ie}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import{Select_default as ae}from"./src-bHDRqBSs.js";import"./dist-DzeHt4xm.js";import{InputFile_default as _}from"./InputFile-B1bjga7G.js";import"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as v}from"./route-block-DNPbw0zT.js";import{CardCreate_default as y}from"./CardCreate-qkn1QwRd.js";import{CardCreationDialog_default as b}from"./CardCreationDialog-C00zclL1.js";import{DeleteCardDialog_default as x}from"./DeleteCardDialog-DA24n-jV.js";import{CardDetailDialog_default as S}from"./CardDetailDialog-CJ7VvCcd.js";import{CardListItem_default as oe}from"./CardListItem-gxbvoHYe.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/airi-card-xdAfH1PV.js b/assets/airi-card-xdAfH1PV.js deleted file mode 100644 index 726ac44efea14b709dbea7d7b7ca2dd6be89fbd1..0000000000000000000000000000000000000000 --- a/assets/airi-card-xdAfH1PV.js +++ /dev/null @@ -1,7 +0,0 @@ -import{a4 as W,c9 as L,f as g,a0 as O,T as D,$ as G,w as H}from"./index-D7HCX4VR.js";import{c as N}from"./emotions-DWNSb738.js";import{u as b}from"./consciousness-CZ80YtY5.js";import{u as k}from"./speech-D8cCufg2.js";function q(a,u){return{role:"system",content:[a,N.map(n=>`- ${n}`).join(` -`),u].join(` - -`)}}const Q=W("airi-card",()=>{const a=L("airi-cards",new Map),u=L("airi-card-active-id","default"),n=g(()=>a.value.get(u.value)),P=b(),R=k(),{activeModel:l}=O(P),{activeSpeechVoiceId:m,activeSpeechModel:p}=O(R),$=s=>{const e=crypto.randomUUID();return a.value.set(e,f(s)),e},B=s=>{a.value.delete(s)},V=s=>a.value.get(s);function v(s){var t,r,i,c,d,h,_,y,S,x,C,M,I,w,E,A,T,U,j;const e="data"in s?(r=(t=s.data)==null?void 0:t.extensions)==null?void 0:r.airi:(i=s.extensions)==null?void 0:i.airi,o={consciousness:{model:l.value},speech:{model:p.value,voice_id:m.value}};return e?{modules:{consciousness:{model:((d=(c=e.modules)==null?void 0:c.consciousness)==null?void 0:d.model)??o.consciousness.model},speech:{model:((_=(h=e.modules)==null?void 0:h.speech)==null?void 0:_.model)??o.speech.model,voice_id:((S=(y=e.modules)==null?void 0:y.speech)==null?void 0:S.voice_id)??o.speech.voice_id,pitch:(C=(x=e.modules)==null?void 0:x.speech)==null?void 0:C.pitch,rate:(I=(M=e.modules)==null?void 0:M.speech)==null?void 0:I.rate,ssml:(E=(w=e.modules)==null?void 0:w.speech)==null?void 0:E.ssml,language:(T=(A=e.modules)==null?void 0:A.speech)==null?void 0:T.language},vrm:(U=e.modules)==null?void 0:U.vrm,live2d:(j=e.modules)==null?void 0:j.live2d},agents:e.agents??{}}:{modules:o,agents:{}}}function f(s){if("data"in s){const e=s;return{name:e.data.name,version:e.data.character_version??"1.0.0",description:e.data.description??"",creator:e.data.creator??"",notes:e.data.creator_notes??"",notesMultilingual:e.data.creator_notes_multilingual,personality:e.data.personality??"",scenario:e.data.scenario??"",greetings:[e.data.first_mes,...e.data.alternate_greetings??[]],greetingsGroupOnly:e.data.group_only_greetings??[],systemPrompt:e.data.system_prompt??"",postHistoryInstructions:e.data.post_history_instructions??"",messageExample:e.data.mes_example?e.data.mes_example.split(` -`).filter(Boolean).map(o=>o.split(` -`).map(t=>{if(t.startsWith("{{char}}:")||t.startsWith("{{user}}:"))return t;throw new Error(`Invalid message example format: ${t}`)})):[],tags:e.data.tags??[],extensions:{airi:v(e),...e.data.extensions}}}return{...s,extensions:{airi:v(s),...s.extensions}}}return D(()=>{const{t:s}=G();a.value.set("default",f({name:"ReLU",version:"1.0.0",description:q(s("prompt.prefix"),s("prompt.suffix")).content}))}),H(n,s=>{var o,t,r,i,c,d;if(!s)return;const e=v(s);e&&(l.value=(t=(o=e==null?void 0:e.modules)==null?void 0:o.consciousness)==null?void 0:t.model,p.value=(i=(r=e==null?void 0:e.modules)==null?void 0:r.speech)==null?void 0:i.model,m.value=(d=(c=e==null?void 0:e.modules)==null?void 0:c.speech)==null?void 0:d.voice_id)}),{cards:a,activeCard:n,activeCardId:u,addCard:$,removeCard:B,getCard:V,currentModels:g(()=>({consciousness:{model:l.value},speech:{model:p.value,voice_id:m.value}})),systemPrompt:g(()=>{const s=n.value;return s?[s.systemPrompt,s.description,s.personality].filter(Boolean).join(` -`):""})}});export{Q as u}; diff --git a/assets/alibaba-cloud-model-studio-Di5kaCjv.js b/assets/alibaba-cloud-model-studio-Di5kaCjv.js new file mode 100644 index 0000000000000000000000000000000000000000..6fccf67f13b2c0c9d54fa4950f2d27440e49f040 --- /dev/null +++ b/assets/alibaba-cloud-model-studio-Di5kaCjv.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import{FieldRange_default as h}from"./src-bHDRqBSs.js";import{SpeechPlayground_default as g,SpeechProviderSettings_default as _}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as v}from"./route-block-DNPbw0zT.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/alibaba-cloud-model-studio-sMAGnqmb.js b/assets/alibaba-cloud-model-studio-sMAGnqmb.js deleted file mode 100644 index 465e9fdc332c6f6758f940d6f85f27523840a91e..0000000000000000000000000000000000000000 --- a/assets/alibaba-cloud-model-studio-sMAGnqmb.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as m}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as x,e as f,a0 as $,$ as k,f as V,T as F,w as v,bf as B,o as I,bg as y,b as c,u as i,a as T}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as U}from"./providers-DepZj6_J.js";import{u as E}from"./speech-D8cCufg2.js";import{_ as K,a as L}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-Cn-PwtFl.js";import{b as P}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";const N={flex:"~ col gap-4"},o="alibaba-cloud-model-studio",_="cosyvoice-v1",z=x({__name:"alibaba-cloud-model-studio",setup(G){const u={speed:1},d=f(0),l=f(1),n=f(0),p=E(),r=U(),{providers:g}=$(r),{t:s}=k(),h=V(()=>{var e;return!!((e=g.value[o])!=null&&e.apiKey)}),w=V(()=>p.availableVoices[o]||[]);async function M(e,t,a){const b=r.getProviderInstance(o);if(!b)throw new Error("Failed to initialize speech provider");const C=r.getProviderConfig(o),S=C.model||_;return await p.speech(b,S,e,t,{...C,...u})}return F(async()=>{const e=r.getProviderConfig(o);await r.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),v(d,async()=>{const e=r.getProviderConfig(o);e.pitch=d.value}),v(l,async()=>{const e=r.getProviderConfig(o);e.speed=l.value}),v(n,async()=>{const e=r.getProviderConfig(o);e.volume=n.value}),v(g,async()=>{const e=r.getProviderConfig(o);await r.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,t)=>(I(),B(i(L),{"provider-id":o,"default-model":_,"additional-settings":u},{"voice-settings":y(()=>[T("div",N,[c(i(m),{modelValue:d.value,"onUpdate:modelValue":t[0]||(t[0]=a=>d.value=a),label:i(s)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":a=>`${a}%`},null,8,["modelValue","label","description","format-value"]),c(i(m),{modelValue:l.value,"onUpdate:modelValue":t[1]||(t[1]=a=>l.value=a),label:i(s)("settings.pages.providers.provider.common.fields.field.speed.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),c(i(m),{modelValue:n.value,"onUpdate:modelValue":t[2]||(t[2]=a=>n.value=a),label:i(s)("settings.pages.providers.provider.common.fields.field.volume.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":a=>`${a}%`},null,8,["modelValue","label","description","format-value"])])]),playground:y(()=>[c(i(K),{"available-voices":w.value,"generate-speech":M,"api-key-configured":h.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof P=="function"&&P(z);export{z as default}; diff --git a/assets/anthropic-Cs21upu-.js b/assets/anthropic-Cs21upu-.js deleted file mode 100644 index db076041bc64ebe5c3af18bb728f2109cb694c70..0000000000000000000000000000000000000000 --- a/assets/anthropic-Cs21upu-.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as S,$ as x,V as U,a0 as V,f as v,T as w,w as C,bf as K,o as R,bg as c,a as i,b as l,ci as p,u as a}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as $}from"./providers-DepZj6_J.js";import{_ as O}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as I}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as N}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as T}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const e="anthropic",z=S({__name:"anthropic",setup(M){const{t:u}=x(),g=U(),f=$(),{providers:o}=V(f),m=v(()=>f.getProviderMetadata(e)),s=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.apiKey)||""},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].apiKey=t}}),n=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.baseUrl)||"https://api.anthropic.com/v1/"},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].baseUrl=t}});w(()=>{var t,r;o.value[e]||(o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((t=o.value[e])==null?void 0:t.apiKey)||"",n.value=((r=o.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),C([s,n],()=>{o.value[e]={...o.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function y(){o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(t,r)=>{var h,b;return R(),K(a(B),{"provider-name":((h=m.value)==null?void 0:h.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>a(g).back()},{default:c(()=>[r[2]||(r[2]=i("div",{bg:"orange-50 dark:orange-900/20","rounded-xl":"","p-4":"",flex:"~ col gap-3"},[i("h2",{"text-xl":"","font-semibold":"",text:"orange-700 dark:orange-500"}," Before you start "),i("p",null,[p(" While Anthropic recently did announce that they are having a beta support for OpenAI SDK compatibility "),i("a",{underline:"",href:"https://docs.anthropic.com/en/api/openai-sdk"},"(you can read more here)"),p(", but due to the implementation details comes with "),i("a",{underline:"",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS"},"CORS"),p(" restrictions which not aligned with the OpenAI SDK, it's currently not possible to use this provider in the browser. ")]),i("p",null,[p(" If you do need to use this provider, you will need a dedicated proxy backend like a Serverless Function running on "),i("a",{underline:"",href:"https://workers.cloudflare.com/"},"Cloudflare Workers"),p(" or some CORS bypassing services to bypass the CORS restrictions. ")])],-1)),l(a(T),null,{default:c(()=>[l(a(N),{title:a(u)("settings.pages.providers.common.section.basic.title"),description:a(u)("settings.pages.providers.common.section.basic.description"),"on-reset":y},{default:c(()=>{var d;return[l(a(A),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=k=>s.value=k),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(a(O),{title:a(u)("settings.pages.providers.common.section.advanced.title")},{default:c(()=>[l(a(I),{modelValue:n.value,"onUpdate:modelValue":r[1]||(r[1]=d=>n.value=d),placeholder:"https://api.anthropic.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1,__:[2]},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(z);export{z as default}; diff --git a/assets/anthropic-DUmlJu_t.js b/assets/anthropic-DUmlJu_t.js new file mode 100644 index 0000000000000000000000000000000000000000..58658cd6da90c66869545bf59aa34d6ab2497fd9 --- /dev/null +++ b/assets/anthropic-DUmlJu_t.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as m}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as x}from"./route-block-DNPbw0zT.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-mPITRDqf.js b/assets/appearance-mPITRDqf.js new file mode 100644 index 0000000000000000000000000000000000000000..f6fc55a9ffdcf67fc639a2759ce94ba1c85d99ce --- /dev/null +++ b/assets/appearance-mPITRDqf.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import{IconItem_default as p}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as m}from"./route-block-DNPbw0zT.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/arktype-C-GObzDh-1xlRyYUo.js b/assets/arktype-C-GObzDh-1xlRyYUo.js deleted file mode 100644 index f363de0fa1616a8784c02dbf09b0b0eeacc841d2..0000000000000000000000000000000000000000 --- a/assets/arktype-C-GObzDh-1xlRyYUo.js +++ /dev/null @@ -1 +0,0 @@ -const n=async()=>o=>o.toJsonSchema();export{n as getToJsonSchemaFn}; diff --git a/assets/arktype-C-GObzDh-Dp9wQ2EO.js b/assets/arktype-C-GObzDh-Dp9wQ2EO.js new file mode 100644 index 0000000000000000000000000000000000000000..43f98b94467d6da50a50f51ea7ca2da1ec52ff17 --- /dev/null +++ b/assets/arktype-C-GObzDh-Dp9wQ2EO.js @@ -0,0 +1 @@ +const e=async()=>e=>e.toJsonSchema();export{e as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/audio-C9GHcVn0.js b/assets/audio-C9GHcVn0.js deleted file mode 100644 index 8ee9e50d94a4bfa49ef74515fcbac8251086824d..0000000000000000000000000000000000000000 --- a/assets/audio-C9GHcVn0.js +++ /dev/null @@ -1 +0,0 @@ -import{d as s,e as f,c as d,o as p,a as t}from"./index-D7HCX4VR.js";const R=s({__name:"audio",setup(_){const a=f(),l=f();function u(o){var r,c,i;if(!o)return;const n=(c=(r=l.value)==null?void 0:r.files)==null?void 0:c[0];if(!n)return;const e=document.createElement("audio");(i=a.value)==null||i.appendChild(e),e.src=URL.createObjectURL(n),e.controls=!0,e.load(),e.play()}return(o,n)=>(p(),d("div",null,[t("div",null,[t("div",{ref_key:"containerRef",ref:a},null,512),t("input",{ref_key:"fileInputRef",ref:l,type:"file",onChange:u},null,544)])]))}});export{R as default}; diff --git a/assets/audio-DwTx1Y8I.js b/assets/audio-DwTx1Y8I.js new file mode 100644 index 0000000000000000000000000000000000000000..3cced85eac9cdd21bf5af9f83699e4ff8364f21f --- /dev/null +++ b/assets/audio-DwTx1Y8I.js @@ -0,0 +1 @@ +import{createBaseVNode as e,createElementBlock as t,defineComponent as n,openBlock as r,ref as i}from"./index-BtAisBe9.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-BaZ8ULC5.js b/assets/background-remove-BaZ8ULC5.js deleted file mode 100644 index 9d52760703facf6b3357ed1638ac5b2df1366399..0000000000000000000000000000000000000000 --- a/assets/background-remove-BaZ8ULC5.js +++ /dev/null @@ -1,2888 +0,0 @@ -var _v=Object.defineProperty;var gv=(e,r,t)=>r in e?_v(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Y=(e,r,t)=>gv(e,typeof r!="symbol"?r+"":r,t);import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{_ as wv}from"./InputFile.vue_vue_type_script_setup_true_lang-M88MYfAL.js";import{c as bv}from"./index-CIqqlMPn.js";import{d as Mv,e as zs,f as yv,T as vv,c as Tn,o as En,a as Vr,b as xv,Y as Ef,c3 as Pf,c4 as Cf,W as Sf,a3 as Tv,u as Ev}from"./index-D7HCX4VR.js";const la=new Map,kn=[],Pv=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=la.get(e);if(s===void 0)la.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){const o=kn.indexOf(e);o!==-1&&kn.splice(o,1);for(let n=0;n{const r=la.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{const t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},Sv=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?kn:t;let o;const n=[],i=new Set;for(const l of s){const u=await Cv(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);const a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]},$v="1.22.0";let $f="warning";const Ts={wasm:{},webgl:{},webgpu:{},versions:{common:$v},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);$f=e}},get logLevel(){return $f}};Object.defineProperty(Ts,"logLevel",{enumerable:!0});const kv=Ts,Iv=(e,r)=>{const t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];const s=t.getContext("2d");if(s!=null){let o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);const i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,u;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));const p=n*o;let c=0,d=p,_=p*2,f=-1;i==="RGBA"?(c=0,d=p,_=p*2,f=p*3):i==="RGB"?(c=0,d=p,_=p*2):i==="RBG"&&(c=0,_=p,d=p*2);for(let v=0;v{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));const c=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const d=4;let _=0,f=1,v=2,$=3,g=0,w=c,C=c*2,E=-1;a==="RGBA"?(g=0,w=c,C=c*2,E=c*3):a==="RGB"?(g=0,w=c,C=c*2):a==="RBG"&&(g=0,C=c,w=c*2),s=t.createImageData(o,n);for(let x=0;x{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");const{height:t,width:s}=r,o=r.norm??{mean:255,bias:0};let n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3);let c=4,d=0,_=1,f=2,v=3,$=0,g=u,w=u*2,C=-1;a==="RGB"&&(c=3,d=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,w=u,g=u*2):l==="BGR"&&(w=0,g=u,$=u*2);for(let x=0;x{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let i,a=r??{};const l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){const p=l();p.width=e.width,p.height=e.height;const c=u(p);if(c!=null){let d=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=r.resizedHeight,_=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=d,a.width=_}else a.tensorFormat="RGBA",a.height=d,a.width=_;c.drawImage(e,0,0),i=c.getImageData(0,0,_,d).data}else throw new Error("Can not access image data")}else if(s){let p,c;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,c=r.resizedWidth):(p=e.height,c=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=c,r!==void 0){const d=l();d.width=c,d.height=p;const _=u(d);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,c,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");const p=l();p.width=e.width,p.height=e.height;const c=u(p);if(c!=null){const d=e.height,_=e.width;return c.drawImage(e,0,0,_,d),i=c.getImageData(0,0,_,d).data,a.height=d,a.width=_,Al(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,c)=>{const d=l(),_=u(d);if(!e||!_)return c();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{d.width=f.width,d.height=f.height,_.drawImage(f,0,0,d.width,d.height);const v=_.getImageData(0,0,d.width,d.height);a.height=d.height,a.width=d.width,p(Al(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return Al(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Ov=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new us({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Dv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Lv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},zv=(e,r,t)=>new us({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),ro=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ua=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let kf=!1;const Bv=()=>{if(!kf){kf=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(ro.set("int64",BigInt64Array),ua.set(BigInt64Array,"int64")),r&&(ro.set("uint64",BigUint64Array),ua.set(BigUint64Array,"uint64")),s?(ro.set("float16",t),ua.set(t,"float16")):ro.set("float16",Uint16Array)}},Rv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new us(e.type,e.data,r);case"cpu-pinned":return new us({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new us({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new us({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new us({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let us=class{constructor(r,t,s){Bv();let o,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,o=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=ro.get(o);if(!a)throw new TypeError(`unsupported type "${o}" to create tensor from pinned buffer`);if(!(r.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=r.data;break}case"texture":{if(o!=="float32")throw new TypeError(`unsupported type "${o}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint64"&&o!=="int8"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from MLTensor`);this.mlTensorData=r.mlTensor,this.downloader=r.download,this.disposer=r.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,l;if(typeof r=="string")if(o=r,l=s,r==="string"){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");a=t}else{const u=ro.get(r);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&u===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${u.name} as data.`);r==="uint64"||r==="int64"?a=u.from(t,BigInt):a=u.from(t)}else if(t instanceof u)a=t;else if(t instanceof Uint8ClampedArray)if(r==="uint8")a=Uint8Array.from(t);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(r==="float16"&&t instanceof Uint16Array&&u!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${o} tensor's data must be type of ${u}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const u=typeof r[0];if(u==="string")o="string",a=r;else if(u==="boolean")o="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(r instanceof Uint8ClampedArray)o="uint8",a=Uint8Array.from(r);else{const u=ua.get(r.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);o=u,a=r}if(l===void 0)l=[a.length];else if(!Array.isArray(l))throw new TypeError("A tensor's dims must be a number array");n=l,this.cpuData=a,this.dataLocation="cpu"}const i=Rv(n);if(this.cpuData&&i!==this.cpuData.length&&!((o==="uint4"||o==="int4")&&Math.ceil(i/2)===this.cpuData.length))throw new Error(`Tensor's size(${i}) does not match data length(${this.cpuData.length}).`);this.type=o,this.dims=n,this.size=i}static async fromImage(r,t){return Fv(r,t)}static fromTexture(r,t){return Ov(r,t)}static fromGpuBuffer(r,t){return Dv(r,t)}static fromMLTensor(r,t){return Lv(r,t)}static fromPinnedBuffer(r,t,s){return zv(r,t,s)}toDataURL(r){return Iv(this,r)}toImageData(r){return Av(this,r)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(r){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;const t=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=t,r&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(r){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return jv(this,r)}};const eo=us,db=(e,r)=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||console.timeStamp(`${e}::ORT::${r}`)},pb=(e,r)=>{var o;const t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("BEGIN",e)},Fu=e=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("END",e)};let Nv=class hb{constructor(r){this.handler=r}async run(r,t,s){Au();const o={};let n={};if(typeof r!="object"||r===null||r instanceof eo||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof eo)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(const u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1;const p=Object.getOwnPropertyNames(t);for(const c of this.outputNames)if(p.indexOf(c)!==-1){const d=t[c];(d===null||d instanceof eo)&&(u=!0,i=!1,o[c]=d)}if(u){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(const u of this.outputNames)o[u]=null;const a=await this.handler.run(r,o,n),l={};for(const u in a)if(Object.hasOwnProperty.call(a,u)){const p=a[u];p instanceof eo?l[u]=p:l[u]=new eo(p.type,p.data,p.dims)}return Fu(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){Au();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const p=r;let c=0,d=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(c=t,!Number.isSafeInteger(c))throw new RangeError("'byteOffset' must be an integer.");if(c<0||c>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(d=r.byteLength-c,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||c+d>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-c}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,c,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await Sv(i),u=await a.createInferenceSessionHandler(n,l);return Fu(),new hb(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const Vv=Nv,Uv=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Vv,TRACE:db,TRACE_FUNC_BEGIN:Au,TRACE_FUNC_END:Fu,Tensor:eo,env:kv,registerBackend:Pv},Symbol.toStringTag,{value:"Module"}));/*! - * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - */var Xu=Object.defineProperty,Wv=Object.getOwnPropertyDescriptor,Gv=Object.getOwnPropertyNames,Kv=Object.prototype.hasOwnProperty,Hv=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),je=(e,r)=>()=>(e&&(r=e(e=0)),r),io=(e,r)=>{for(var t in r)Xu(e,t,{get:r[t],enumerable:!0})},qv=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Gv(r))!Kv.call(e,o)&&o!==t&&Xu(e,o,{get:()=>r[o],enumerable:!(s=Wv(r,o))||s.enumerable});return e},Zo=e=>qv(Xu({},"__esModule",{value:!0}),e),Bo,Js,Fn,If,mb,fb=je(()=>{Bo=new Map,Js=[],Fn=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){let s=Bo.get(e);if(s===void 0)Bo.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){let o=Js.indexOf(e);o!==-1&&Js.splice(o,1);for(let n=0;n{let r=Bo.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{let t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},mb=async e=>{let r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?Js:t,o,n=[],i=new Set;for(let l of s){let u=await If(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(let{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);let a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]}}),Qv=je(()=>{fb()}),_b,Xv=je(()=>{_b="1.22.0-dev.20250409-89f8206ba4"}),Fl,ls,gb=je(()=>{Xv(),Fl="warning",ls={wasm:{},webgl:{},webgpu:{},versions:{common:_b},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);Fl=e}},get logLevel(){return Fl}},Object.defineProperty(ls,"logLevel",{enumerable:!0})}),Yt,Jv=je(()=>{gb(),Yt=ls}),wb,bb,Yv=je(()=>{wb=(e,r)=>{let t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];let s=t.getContext("2d");if(s!=null){let o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);let i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm,l,u;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));let p=n*o,c=0,d=p,_=p*2,f=-1;i==="RGBA"?(c=0,d=p,_=p*2,f=p*3):i==="RGB"?(c=0,d=p,_=p*2):i==="RBG"&&(c=0,_=p,d=p*2);for(let v=0;v{let t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);let a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm,u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));let c=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let d=4,_=0,f=1,v=2,$=3,g=0,w=c,C=c*2,E=-1;a==="RGBA"?(g=0,w=c,C=c*2,E=c*3):a==="RGB"?(g=0,w=c,C=c*2):a==="RBG"&&(g=0,C=c,w=c*2),s=t.createImageData(o,n);for(let x=0;x{Ju(),qi=(e,r)=>{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:t,width:s}=r,o=r.norm??{mean:255,bias:0},n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];let a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3),c=4,d=0,_=1,f=2,v=3,$=0,g=u,w=u*2,C=-1;a==="RGB"&&(c=3,d=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,w=u,g=u*2):l==="BGR"&&(w=0,g=u,$=u*2);for(let E=0;E{let t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string",i,a=r??{},l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){let p=l();p.width=e.width,p.height=e.height;let c=u(p);if(c!=null){let d=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=r.resizedHeight,_=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=d,a.width=_}else a.tensorFormat="RGBA",a.height=d,a.width=_;c.drawImage(e,0,0),i=c.getImageData(0,0,_,d).data}else throw new Error("Can not access image data")}else if(s){let p,c;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,c=r.resizedWidth):(p=e.height,c=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=c,r!==void 0){let d=l();d.width=c,d.height=p;let _=u(d);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,c,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");let p=l();p.width=e.width,p.height=e.height;let c=u(p);if(c!=null){let d=e.height,_=e.width;return c.drawImage(e,0,0,_,d),i=c.getImageData(0,0,_,d).data,a.height=d,a.width=_,qi(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,c)=>{let d=l(),_=u(d);if(!e||!_)return c();let f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{d.width=f.width,d.height=f.height,_.drawImage(f,0,0,d.width,d.height);let v=_.getImageData(0,0,d.width,d.height);a.height=d.height,a.width=d.width,p(qi(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return qi(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},yb=(e,r)=>{let{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new Jr({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},vb=(e,r)=>{let{dataType:t,dims:s,download:o,dispose:n}=r;return new Jr({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},xb=(e,r)=>{let{dataType:t,dims:s,download:o,dispose:n}=r;return new Jr({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},Tb=(e,r,t)=>new Jr({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]})}),In,qo,Ol,Eb,ex=je(()=>{In=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),qo=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),Ol=!1,Eb=()=>{if(!Ol){Ol=!0;let e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(In.set("int64",BigInt64Array),qo.set(BigInt64Array,"int64")),r&&(In.set("uint64",BigUint64Array),qo.set(BigUint64Array,"uint64")),s?(In.set("float16",t),qo.set(t,"float16")):In.set("float16",Uint16Array)}}}),Pb,Cb,tx=je(()=>{Ju(),Pb=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Jr(e.type,e.data,r);case"cpu-pinned":return new Jr({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Jr({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Jr({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Jr({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Jr,Ju=je(()=>{Yv(),Zv(),ex(),tx(),Jr=class{constructor(e,r,t){Eb();let s,o;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,s=e.type,o=e.dims,e.location){case"cpu-pinned":{let i=In.get(s);if(!i)throw new TypeError(`unsupported type "${s}" to create tensor from pinned buffer`);if(!(e.data instanceof i))throw new TypeError(`buffer should be of type ${i.name}`);this.cpuData=e.data;break}case"texture":{if(s!=="float32")throw new TypeError(`unsupported type "${s}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint64"&&s!=="int8"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let i,a;if(typeof e=="string")if(s=e,a=t,e==="string"){if(!Array.isArray(r))throw new TypeError("A string tensor's data must be a string array.");i=r}else{let l=In.get(e);if(l===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(r)){if(e==="float16"&&l===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${l.name} as data.`);e==="uint64"||e==="int64"?i=l.from(r,BigInt):i=l.from(r)}else if(r instanceof l)i=r;else if(r instanceof Uint8ClampedArray)if(e==="uint8")i=Uint8Array.from(r);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(e==="float16"&&r instanceof Uint16Array&&l!==Uint16Array)i=new globalThis.Float16Array(r.buffer,r.byteOffset,r.length);else throw new TypeError(`A ${s} tensor's data must be type of ${l}`)}else if(a=r,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let l=typeof e[0];if(l==="string")s="string",i=e;else if(l==="boolean")s="bool",i=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${l}.`)}else if(e instanceof Uint8ClampedArray)s="uint8",i=Uint8Array.from(e);else{let l=qo.get(e.constructor);if(l===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);s=l,i=e}if(a===void 0)a=[i.length];else if(!Array.isArray(a))throw new TypeError("A tensor's dims must be a number array");o=a,this.cpuData=i,this.dataLocation="cpu"}let n=Pb(o);if(this.cpuData&&n!==this.cpuData.length&&!((s==="uint4"||s==="int4")&&Math.ceil(n/2)===this.cpuData.length))throw new Error(`Tensor's size(${n}) does not match data length(${this.cpuData.length}).`);this.type=s,this.dims=o,this.size=n}static async fromImage(e,r){return Mb(e,r)}static fromTexture(e,r){return yb(e,r)}static fromGpuBuffer(e,r){return vb(e,r)}static fromMLTensor(e,r){return xb(e,r)}static fromPinnedBuffer(e,r,t){return Tb(e,r,t)}toDataURL(e){return wb(this,e)}toImageData(e){return bb(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(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 new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let r=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=r,e&&this.disposer&&(this.disposer(),this.disposer=void 0),r}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Cb(this,e)}}}),xs,Sb=je(()=>{Ju(),xs=Jr}),ei,Dl,Es,cs,$b=je(()=>{gb(),ei=(e,r)=>{(typeof ls.trace>"u"?!ls.wasm.trace:!ls.trace)||console.timeStamp(`${e}::ORT::${r}`)},Dl=(e,r)=>{var o;let t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[],s=!1;for(let n=0;n{(typeof ls.trace>"u"?!ls.wasm.trace:!ls.trace)||Dl("BEGIN",e)},cs=e=>{(typeof ls.trace>"u"?!ls.wasm.trace:!ls.trace)||Dl("END",e)}}),kb,rx=je(()=>{fb(),Sb(),$b(),kb=class Ib{constructor(r){this.handler=r}async run(r,t,s){Es();let o={},n={};if(typeof r!="object"||r===null||r instanceof xs||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof xs)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(let u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1,p=Object.getOwnPropertyNames(t);for(let c of this.outputNames)if(p.indexOf(c)!==-1){let d=t[c];(d===null||d instanceof xs)&&(u=!0,i=!1,o[c]=d)}if(u){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(let u of this.outputNames)o[u]=null;let a=await this.handler.run(r,o,n),l={};for(let u in a)if(Object.hasOwnProperty.call(a,u)){let p=a[u];p instanceof xs?l[u]=p:l[u]=new xs(p.type,p.data,p.dims)}return cs(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){Es();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){let p=r,c=0,d=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(c=t,!Number.isSafeInteger(c))throw new RangeError("'byteOffset' must be an integer.");if(c<0||c>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(d=r.byteLength-c,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||c+d>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-c}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,c,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[a,l]=await mb(i),u=await a.createInferenceSessionHandler(n,l);return cs(),new Ib(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}}),Yu,sx=je(()=>{rx(),Yu=kb}),nx=je(()=>{}),ox=je(()=>{}),ix=je(()=>{}),ax=je(()=>{}),Ab={};io(Ab,{InferenceSession:()=>Yu,TRACE:()=>ei,TRACE_FUNC_BEGIN:()=>Es,TRACE_FUNC_END:()=>cs,Tensor:()=>xs,env:()=>Yt,registerBackend:()=>Fn});var Ps=je(()=>{Qv(),Jv(),sx(),Sb(),nx(),ox(),$b(),ix(),ax()}),Zu=je(()=>{}),Fb={};io(Fb,{default:()=>Ob});var Ll,zl,Ob,lx=je(()=>{var e;R0(),zn(),ec(),Ll="ort-wasm-proxy-worker",zl=((e=globalThis.self)==null?void 0:e.name)===Ll,zl&&(self.onmessage=r=>{let{type:t,in:s}=r.data;try{switch(t){case"init-wasm":tc(s.wasm).then(()=>{bc(s).then(()=>{postMessage({type:t})},o=>{postMessage({type:t,err:o})})},o=>{postMessage({type:t,err:o})});break;case"init-ep":{let{epName:o,env:n}=s;Mc(n,o).then(()=>{postMessage({type:t})},i=>{postMessage({type:t,err:i})});break}case"copy-from":{let{buffer:o}=s,n=wa(o);postMessage({type:t,out:n});break}case"create":{let{model:o,options:n}=s;yc(o,n).then(i=>{postMessage({type:t,out:i})},i=>{postMessage({type:t,err:i})});break}case"release":vc(s),postMessage({type:t});break;case"run":{let{sessionId:o,inputIndices:n,inputs:i,outputIndices:a,options:l}=s;xc(o,n,i,a,new Array(a.length).fill(null),l).then(u=>{u.some(p=>p[3]!=="cpu")?postMessage({type:t,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:t,out:u},Ec([...i,...u]))},u=>{postMessage({type:t,err:u})});break}case"end-profiling":Tc(s),postMessage({type:t});break;default:}}catch(o){postMessage({type:t,err:o})}}),Ob=zl?null:r=>new Worker(r??Xr,{type:"module",name:Ll})}),Db={};io(Db,{default:()=>Lb});var Bl,Rl,Lb,Af,ux=je(()=>{var e,r;Rl=(Bl=import.meta.url,async function(t={}){var Qn;var s,o,n=t,i=new Promise((h,T)=>{s=h,o=T}),a=typeof window=="object",l=typeof WorkerGlobalScope<"u",u=l&&((Qn=self.name)==null?void 0:Qn.startsWith("em-pthread"));n.mountExternalData=(h,T)=>{h.startsWith("./")&&(h=h.substring(2)),(n.Eb||(n.Eb=new Map)).set(h,T)},n.unmountExternalData=()=>{delete n.Eb};var p=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let c=h=>async(...T)=>{var I;try{if(n.Fb)throw Error("Session already started");let L=n.Fb={dc:T[0],errors:[]},N=await h(...T);if(n.Fb!==L)throw Error("Session mismatch");(I=n.Jb)==null||I.flush();let ue=L.errors;if(0Le),0{if(h==="webgpu"){[n.Jb,n.Ub,n.Yb,n.Kb,n.Xb,n.jb,n.Zb,n.ac,n.Vb,n.Wb,n.$b]=T;let I=n.Jb;n.jsepRegisterBuffer=(L,N,ue,Te)=>I.registerBuffer(L,N,ue,Te),n.jsepGetBuffer=L=>I.getBuffer(L),n.jsepCreateDownloader=(L,N,ue)=>I.createDownloader(L,N,ue),n.jsepOnCreateSession=L=>{I.onCreateSession(L)},n.jsepOnReleaseSession=L=>{I.onReleaseSession(L)},n.jsepOnRunStart=L=>I.onRunStart(L),n.bc=(L,N)=>{I.upload(L,N)}}else if(h==="webnn"){let I=T[0];[n.nc,n.Nb,n.webnnEnsureTensor,n.Ob,n.webnnDownloadTensor]=T.slice(1),n.webnnReleaseTensorId=n.Nb,n.webnnUploadTensor=n.Ob,n.webnnOnRunStart=L=>I.onRunStart(L),n.webnnOnRunEnd=I.onRunEnd.bind(I),n.webnnRegisterMLContext=(L,N)=>{I.registerMLContext(L,N)},n.webnnOnReleaseSession=L=>{I.onReleaseSession(L)},n.webnnCreateMLTensorDownloader=(L,N)=>I.createMLTensorDownloader(L,N),n.webnnRegisterMLTensor=(L,N,ue,Te)=>I.registerMLTensor(L,N,ue,Te),n.webnnCreateMLContext=L=>I.createMLContext(L),n.webnnRegisterMLConstant=(L,N,ue,Te,Le,Ke)=>I.registerMLConstant(L,N,ue,Te,Le,n.Eb,Ke),n.webnnRegisterGraphInput=I.registerGraphInput.bind(I),n.webnnIsGraphInput=I.isGraphInput.bind(I),n.webnnCreateTemporaryTensor=I.createTemporaryTensor.bind(I),n.webnnIsInt64Supported=I.isInt64Supported.bind(I)}};let d=()=>{let h=(T,I,L)=>(...N)=>{let ue=Zt,Te=I==null?void 0:I();N=T(...N);let Le=I==null?void 0:I();return Te!==Le&&(T=Le,L(Te),I=L=null),Zt!=ue?new Promise((Ke,et)=>{qr={resolve:Ke,reject:et}}):N};(()=>{for(let T of["_OrtAppendExecutionProvider","_OrtCreateSession","_OrtRun","_OrtRunWithBinding","_OrtBindInput"])n[T]=h(n[T],()=>n[T],I=>n[T]=I)})(),c!==void 0&&(n._OrtRun=c(n._OrtRun),n._OrtRunWithBinding=c(n._OrtRunWithBinding)),d=void 0};n.asyncInit=()=>{d==null||d()};var _,f,v=Object.assign({},n),$=(h,T)=>{throw T},g="";(a||l)&&(l?g=self.location.href:typeof document<"u"&&document.currentScript&&(g=document.currentScript.src),Bl&&(g=Bl),g=g.startsWith("blob:")?"":g.slice(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1),l&&(f=h=>{var T=new XMLHttpRequest;return T.open("GET",h,!1),T.responseType="arraybuffer",T.send(null),new Uint8Array(T.response)}),_=async h=>{if(V(h))return new Promise((I,L)=>{var N=new XMLHttpRequest;N.open("GET",h,!0),N.responseType="arraybuffer",N.onload=()=>{N.status==200||N.status==0&&N.response?I(N.response):L(N.status)},N.onerror=L,N.send(null)});var T=await fetch(h,{credentials:"same-origin"});if(T.ok)return T.arrayBuffer();throw Error(T.status+" : "+T.url)});var w=console.log.bind(console),C=console.error.bind(console),E=w,x=C;Object.assign(n,v),v=null;var b,y,S,F,z,K,q,R,Z,H,J,Q,se,fe=n.wasmBinary,ae=!1,V=h=>h.startsWith("file://");function A(){return b.buffer!=F.buffer&&re(),F}function U(){return b.buffer!=F.buffer&&re(),z}function ee(){return b.buffer!=F.buffer&&re(),K}function _e(){return b.buffer!=F.buffer&&re(),q}function le(){return b.buffer!=F.buffer&&re(),R}function ye(){return b.buffer!=F.buffer&&re(),Z}function ze(){return b.buffer!=F.buffer&&re(),H}function Ue(){return b.buffer!=F.buffer&&re(),se}if(u){let h=function(T){try{var I=T.data,L=I.Bb;if(L==="load"){let N=[];self.onmessage=ue=>N.push(ue),self.startWorker=()=>{postMessage({Bb:"loaded"});for(let ue of N)h(ue);self.onmessage=h};for(let ue of I.Rb)n[ue]&&!n[ue].proxy||(n[ue]=(...Te)=>{postMessage({Bb:"callHandler",Qb:ue,args:Te})},ue=="print"&&(E=n[ue]),ue=="printErr"&&(x=n[ue]));b=I.kc,re(),pe(I.lc)}else if(L==="run"){B(I.Ab),Wn(I.Ab,0,0,1,0,0),Zr(),xe(I.Ab),W||(Co(),W=!0);try{te(I.fc,I.Hb)}catch(N){if(N!="unwind")throw N}}else I.target!=="setimmediate"&&(L==="checkMailbox"?W&&Re():L&&(x(`worker: received unknown command ${L}`),x(I)))}catch(N){throw Gn(),N}};var pe,W=!1;x=function(...T){T=T.join(" "),console.error(T)},self.alert=function(...T){postMessage({Bb:"alert",text:T.join(" "),ic:mn()})},self.onunhandledrejection=T=>{throw T.reason||T},self.onmessage=h}function re(){var h=b.buffer;n.HEAP8=F=new Int8Array(h),n.HEAP16=K=new Int16Array(h),n.HEAPU8=z=new Uint8Array(h),n.HEAPU16=q=new Uint16Array(h),n.HEAP32=R=new Int32Array(h),n.HEAPU32=Z=new Uint32Array(h),n.HEAPF32=H=new Float32Array(h),n.HEAPF64=se=new Float64Array(h),n.HEAP64=J=new BigInt64Array(h),n.HEAPU64=Q=new BigUint64Array(h)}function G(){u?startWorker(n):ct.Ca()}u||(b=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),re());var be,we=0,Se=null;function Pe(){if(--we==0&&Se){var h=Se;Se=null,h()}}function $e(h){throw x(h="Aborted("+h+")"),ae=!0,h=new WebAssembly.RuntimeError(h+". Build with -sASSERTIONS for more info."),o(h),h}function Fe(){return{a:{L:qe,Aa:He,b:Oe,$:yt,A:rt,pa:Bt,X:Xt,Z:Or,qa:es,na:ds,ga:ts,ma:Cs,J:jr,Y:Ss,V:Kr,oa:ps,W:$s,va:Is,E:it,Q:rs,O:rn,D:nn,u:on,r:an,P:As,z:j,R:X,ja:ie,T:Qe,aa:Ye,M:_t,F:Ot,ia:xe,sa:At,t:mr,Ba:br,w:Mr,o:dr,l:is,c:ns,n:ri,j:Us,v:oi,p:ii,f:ai,s:li,m:ui,e:lo,k:ci,i:di,g:uo,d:pi,da:co,ea:mi,fa:ho,ba:mo,ca:pn,N:fo,xa:_i,ua:wi,h:_o,C:bi,G:go,ta:gi,x:Ls,ra:Mi,U:ba,q:fi,y:yi,K:Ma,S:vi,za:xi,ya:Ti,ka:Mo,la:yo,_:St,B:Vn,I:vo,ha:xo,H:Eo,a:b,wa:Ie}}}var Be={829644:(h,T,I,L,N)=>{if(n===void 0||!n.Eb)return 1;if((h=lt(Number(h>>>0))).startsWith("./")&&(h=h.substring(2)),!(h=n.Eb.get(h)))return 2;if(T=Number(T>>>0),I=Number(I>>>0),L=Number(L>>>0),T+I>h.byteLength)return 3;try{let ue=h.subarray(T,T+I);switch(N){case 0:U().set(ue,L>>>0);break;case 1:n.mc?n.mc(L,ue):n.bc(L,ue);break;default:return 4}return 0}catch{return 4}},830468:(h,T,I)=>{n.Ob(h,U().subarray(T>>>0,T+I>>>0))},830532:()=>n.nc(),830574:h=>{n.Nb(h)},830611:()=>{n.Vb()},830642:()=>{n.Wb()},830671:()=>{n.$b()},830696:h=>n.Ub(h),830729:h=>n.Yb(h),830761:(h,T,I)=>{n.Kb(Number(h),Number(T),Number(I),!0)},830824:(h,T,I)=>{n.Kb(Number(h),Number(T),Number(I))},830881:()=>typeof wasmOffsetConverter<"u",830938:h=>{n.jb("Abs",h,void 0)},830989:h=>{n.jb("Neg",h,void 0)},831040:h=>{n.jb("Floor",h,void 0)},831093:h=>{n.jb("Ceil",h,void 0)},831145:h=>{n.jb("Reciprocal",h,void 0)},831203:h=>{n.jb("Sqrt",h,void 0)},831255:h=>{n.jb("Exp",h,void 0)},831306:h=>{n.jb("Erf",h,void 0)},831357:h=>{n.jb("Sigmoid",h,void 0)},831412:(h,T,I)=>{n.jb("HardSigmoid",h,{alpha:T,beta:I})},831491:h=>{n.jb("Log",h,void 0)},831542:h=>{n.jb("Sin",h,void 0)},831593:h=>{n.jb("Cos",h,void 0)},831644:h=>{n.jb("Tan",h,void 0)},831695:h=>{n.jb("Asin",h,void 0)},831747:h=>{n.jb("Acos",h,void 0)},831799:h=>{n.jb("Atan",h,void 0)},831851:h=>{n.jb("Sinh",h,void 0)},831903:h=>{n.jb("Cosh",h,void 0)},831955:h=>{n.jb("Asinh",h,void 0)},832008:h=>{n.jb("Acosh",h,void 0)},832061:h=>{n.jb("Atanh",h,void 0)},832114:h=>{n.jb("Tanh",h,void 0)},832166:h=>{n.jb("Not",h,void 0)},832217:(h,T,I)=>{n.jb("Clip",h,{min:T,max:I})},832286:h=>{n.jb("Clip",h,void 0)},832338:(h,T)=>{n.jb("Elu",h,{alpha:T})},832396:h=>{n.jb("Gelu",h,void 0)},832448:h=>{n.jb("Relu",h,void 0)},832500:(h,T)=>{n.jb("LeakyRelu",h,{alpha:T})},832564:(h,T)=>{n.jb("ThresholdedRelu",h,{alpha:T})},832634:(h,T)=>{n.jb("Cast",h,{to:T})},832692:h=>{n.jb("Add",h,void 0)},832743:h=>{n.jb("Sub",h,void 0)},832794:h=>{n.jb("Mul",h,void 0)},832845:h=>{n.jb("Div",h,void 0)},832896:h=>{n.jb("Pow",h,void 0)},832947:h=>{n.jb("Equal",h,void 0)},833e3:h=>{n.jb("Greater",h,void 0)},833055:h=>{n.jb("GreaterOrEqual",h,void 0)},833117:h=>{n.jb("Less",h,void 0)},833169:h=>{n.jb("LessOrEqual",h,void 0)},833228:(h,T,I,L,N)=>{n.jb("ReduceMean",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},833403:(h,T,I,L,N)=>{n.jb("ReduceMax",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},833577:(h,T,I,L,N)=>{n.jb("ReduceMin",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},833751:(h,T,I,L,N)=>{n.jb("ReduceProd",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},833926:(h,T,I,L,N)=>{n.jb("ReduceSum",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834100:(h,T,I,L,N)=>{n.jb("ReduceL1",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834273:(h,T,I,L,N)=>{n.jb("ReduceL2",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834446:(h,T,I,L,N)=>{n.jb("ReduceLogSum",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834623:(h,T,I,L,N)=>{n.jb("ReduceSumSquare",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834803:(h,T,I,L,N)=>{n.jb("ReduceLogSumExp",h,{keepDims:!!T,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834983:h=>{n.jb("Where",h,void 0)},835036:(h,T,I)=>{n.jb("Transpose",h,{perm:T?Array.from(le().subarray(Number(T)>>>0,Number(I)>>>0)):[]})},835160:(h,T,I,L)=>{n.jb("DepthToSpace",h,{blocksize:T,mode:lt(I),format:L?"NHWC":"NCHW"})},835293:(h,T,I,L)=>{n.jb("DepthToSpace",h,{blocksize:T,mode:lt(I),format:L?"NHWC":"NCHW"})},835426:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt,kt,Wt,yr,Os)=>{n.jb("ConvTranspose",h,{format:Ke?"NHWC":"NCHW",autoPad:T,dilations:[I],group:L,kernelShape:[N],pads:[ue,Te],strides:[Le],wIsConst:()=>!!A()[et>>>0],outputPadding:Mt?Array.from(le().subarray(Number(Mt)>>>0,Number(kt)>>>0)):[],outputShape:Wt?Array.from(le().subarray(Number(Wt)>>>0,Number(yr)>>>0)):[],activation:lt(Os)})},835859:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt,kt,Wt,yr)=>{n.jb("ConvTranspose",h,{format:Le?"NHWC":"NCHW",autoPad:T,dilations:Array.from(le().subarray(Number(I)>>>0,2+(Number(I)>>>0)>>>0)),group:L,kernelShape:Array.from(le().subarray(Number(N)>>>0,2+(Number(N)>>>0)>>>0)),pads:Array.from(le().subarray(Number(ue)>>>0,4+(Number(ue)>>>0)>>>0)),strides:Array.from(le().subarray(Number(Te)>>>0,2+(Number(Te)>>>0)>>>0)),wIsConst:()=>!!A()[Ke>>>0],outputPadding:et?Array.from(le().subarray(Number(et)>>>0,Number(Mt)>>>0)):[],outputShape:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[],activation:lt(yr)})},836520:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt,kt,Wt,yr,Os)=>{n.jb("ConvTranspose",h,{format:Ke?"NHWC":"NCHW",autoPad:T,dilations:[I],group:L,kernelShape:[N],pads:[ue,Te],strides:[Le],wIsConst:()=>!!A()[et>>>0],outputPadding:Mt?Array.from(le().subarray(Number(Mt)>>>0,Number(kt)>>>0)):[],outputShape:Wt?Array.from(le().subarray(Number(Wt)>>>0,Number(yr)>>>0)):[],activation:lt(Os)})},836953:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt,kt,Wt,yr)=>{n.jb("ConvTranspose",h,{format:Le?"NHWC":"NCHW",autoPad:T,dilations:Array.from(le().subarray(Number(I)>>>0,2+(Number(I)>>>0)>>>0)),group:L,kernelShape:Array.from(le().subarray(Number(N)>>>0,2+(Number(N)>>>0)>>>0)),pads:Array.from(le().subarray(Number(ue)>>>0,4+(Number(ue)>>>0)>>>0)),strides:Array.from(le().subarray(Number(Te)>>>0,2+(Number(Te)>>>0)>>>0)),wIsConst:()=>!!A()[Ke>>>0],outputPadding:et?Array.from(le().subarray(Number(et)>>>0,Number(Mt)>>>0)):[],outputShape:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[],activation:lt(yr)})},837614:(h,T)=>{n.jb("GlobalAveragePool",h,{format:T?"NHWC":"NCHW"})},837705:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt,kt,Wt,yr)=>{n.jb("AveragePool",h,{format:yr?"NHWC":"NCHW",auto_pad:T,ceil_mode:I,count_include_pad:L,storage_order:N,dilations:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],kernel_shape:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],pads:et?Array.from(le().subarray(Number(et)>>>0,Number(Mt)>>>0)):[],strides:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[]})},838184:(h,T)=>{n.jb("GlobalAveragePool",h,{format:T?"NHWC":"NCHW"})},838275:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt,kt,Wt,yr)=>{n.jb("AveragePool",h,{format:yr?"NHWC":"NCHW",auto_pad:T,ceil_mode:I,count_include_pad:L,storage_order:N,dilations:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],kernel_shape:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],pads:et?Array.from(le().subarray(Number(et)>>>0,Number(Mt)>>>0)):[],strides:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[]})},838754:(h,T)=>{n.jb("GlobalMaxPool",h,{format:T?"NHWC":"NCHW"})},838841:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt,kt,Wt,yr)=>{n.jb("MaxPool",h,{format:yr?"NHWC":"NCHW",auto_pad:T,ceil_mode:I,count_include_pad:L,storage_order:N,dilations:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],kernel_shape:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],pads:et?Array.from(le().subarray(Number(et)>>>0,Number(Mt)>>>0)):[],strides:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[]})},839316:(h,T)=>{n.jb("GlobalMaxPool",h,{format:T?"NHWC":"NCHW"})},839403:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt,kt,Wt,yr)=>{n.jb("MaxPool",h,{format:yr?"NHWC":"NCHW",auto_pad:T,ceil_mode:I,count_include_pad:L,storage_order:N,dilations:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],kernel_shape:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],pads:et?Array.from(le().subarray(Number(et)>>>0,Number(Mt)>>>0)):[],strides:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[]})},839878:(h,T,I,L,N)=>{n.jb("Gemm",h,{alpha:T,beta:I,transA:L,transB:N})},839982:h=>{n.jb("MatMul",h,void 0)},840036:(h,T,I,L)=>{n.jb("ArgMax",h,{keepDims:!!T,selectLastIndex:!!I,axis:L})},840144:(h,T,I,L)=>{n.jb("ArgMin",h,{keepDims:!!T,selectLastIndex:!!I,axis:L})},840252:(h,T)=>{n.jb("Softmax",h,{axis:T})},840315:(h,T)=>{n.jb("Concat",h,{axis:T})},840375:(h,T,I,L,N)=>{n.jb("Split",h,{axis:T,numOutputs:I,splitSizes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},840531:h=>{n.jb("Expand",h,void 0)},840585:(h,T)=>{n.jb("Gather",h,{axis:Number(T)})},840656:(h,T)=>{n.jb("GatherElements",h,{axis:Number(T)})},840735:(h,T)=>{n.jb("GatherND",h,{batch_dims:Number(T)})},840814:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt)=>{n.jb("Resize",h,{antialias:T,axes:I?Array.from(le().subarray(Number(I)>>>0,Number(L)>>>0)):[],coordinateTransformMode:lt(N),cubicCoeffA:ue,excludeOutside:Te,extrapolationValue:Le,keepAspectRatioPolicy:lt(Ke),mode:lt(et),nearestMode:lt(Mt)})},841176:(h,T,I,L,N,ue,Te)=>{n.jb("Slice",h,{starts:T?Array.from(le().subarray(Number(T)>>>0,Number(I)>>>0)):[],ends:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[],axes:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[]})},841440:h=>{n.jb("Tile",h,void 0)},841492:(h,T,I)=>{n.jb("InstanceNormalization",h,{epsilon:T,format:I?"NHWC":"NCHW"})},841606:(h,T,I)=>{n.jb("InstanceNormalization",h,{epsilon:T,format:I?"NHWC":"NCHW"})},841720:h=>{n.jb("Range",h,void 0)},841773:(h,T)=>{n.jb("Einsum",h,{equation:lt(T)})},841854:(h,T,I,L,N)=>{n.jb("Pad",h,{mode:T,value:I,pads:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},841997:(h,T,I,L,N,ue)=>{n.jb("BatchNormalization",h,{epsilon:T,momentum:I,spatial:!!N,trainingMode:!!L,format:ue?"NHWC":"NCHW"})},842166:(h,T,I,L,N,ue)=>{n.jb("BatchNormalization",h,{epsilon:T,momentum:I,spatial:!!N,trainingMode:!!L,format:ue?"NHWC":"NCHW"})},842335:(h,T,I)=>{n.jb("CumSum",h,{exclusive:Number(T),reverse:Number(I)})},842432:(h,T,I)=>{n.jb("DequantizeLinear",h,{axis:T,blockSize:I})},842522:(h,T,I,L,N)=>{n.jb("GridSample",h,{align_corners:T,mode:lt(I),padding_mode:lt(L),format:N?"NHWC":"NCHW"})},842692:(h,T,I,L,N)=>{n.jb("GridSample",h,{align_corners:T,mode:lt(I),padding_mode:lt(L),format:N?"NHWC":"NCHW"})},842862:(h,T)=>{n.jb("ScatterND",h,{reduction:lt(T)})},842947:(h,T,I,L,N,ue,Te,Le,Ke)=>{n.jb("Attention",h,{numHeads:T,isUnidirectional:I,maskFilterValue:L,scale:N,doRotary:ue,qkvHiddenSizes:Te?Array.from(le().subarray(Number(Le)>>>0,Number(Le)+Te>>>0)):[],pastPresentShareBuffer:!!Ke})},843219:h=>{n.jb("BiasAdd",h,void 0)},843274:h=>{n.jb("BiasSplitGelu",h,void 0)},843335:h=>{n.jb("FastGelu",h,void 0)},843391:(h,T,I,L,N,ue,Te,Le,Ke,et,Mt,kt,Wt,yr,Os,Pi)=>{n.jb("Conv",h,{format:kt?"NHWC":"NCHW",auto_pad:T,dilations:I?Array.from(le().subarray(Number(I)>>>0,Number(L)>>>0)):[],group:N,kernel_shape:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],pads:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],strides:et?Array.from(le().subarray(Number(et)>>>0,Number(Mt)>>>0)):[],w_is_const:()=>!!A()[Number(Wt)>>>0],activation:lt(yr),activation_params:Os?Array.from(ze().subarray(Number(Os)>>>0,Number(Pi)>>>0)):[]})},843975:h=>{n.jb("Gelu",h,void 0)},844027:(h,T,I,L,N,ue,Te,Le,Ke)=>{n.jb("GroupQueryAttention",h,{numHeads:T,kvNumHeads:I,scale:L,softcap:N,doRotary:ue,rotaryInterleaved:Te,smoothSoftmax:Le,localWindowSize:Ke})},844244:(h,T,I,L)=>{n.jb("LayerNormalization",h,{axis:T,epsilon:I,simplified:!!L})},844355:(h,T,I,L)=>{n.jb("LayerNormalization",h,{axis:T,epsilon:I,simplified:!!L})},844466:(h,T,I,L,N,ue)=>{n.jb("MatMulNBits",h,{k:T,n:I,accuracyLevel:L,bits:N,blockSize:ue})},844593:(h,T,I,L,N,ue)=>{n.jb("MultiHeadAttention",h,{numHeads:T,isUnidirectional:I,maskFilterValue:L,scale:N,doRotary:ue})},844752:(h,T)=>{n.jb("QuickGelu",h,{alpha:T})},844816:(h,T,I,L,N)=>{n.jb("RotaryEmbedding",h,{interleaved:!!T,numHeads:I,rotaryEmbeddingDim:L,scale:N})},844955:(h,T,I)=>{n.jb("SkipLayerNormalization",h,{epsilon:T,simplified:!!I})},845057:(h,T,I)=>{n.jb("SkipLayerNormalization",h,{epsilon:T,simplified:!!I})},845159:(h,T,I,L)=>{n.jb("GatherBlockQuantized",h,{gatherAxis:T,quantizeAxis:I,blockSize:L})},845280:h=>{n.Zb(h)},845314:(h,T)=>n.ac(Number(h),Number(T),n.Fb.dc,n.Fb.errors)};function He(h,T,I){return Lr(async()=>{await n.Xb(Number(h),Number(T),Number(I))})}function qe(){return typeof wasmOffsetConverter<"u"}class ke{constructor(T){Y(this,"name","ExitStatus");this.message=`Program terminated with exit(${T})`,this.status=T}}var Ve=h=>{h.terminate(),h.onmessage=()=>{}},Ze=[],st=h=>{Vt.length==0&&(oe(),D(Vt[0]));var T=Vt.pop();if(!T)return 6;zt.push(T),or[h.Ab]=T,T.Ab=h.Ab;var I={Bb:"run",fc:h.ec,Hb:h.Hb,Ab:h.Ab};return T.postMessage(I,h.Mb),0},at=0,Ge=(h,T,...I)=>{for(var L=2*I.length,N=wn(),ue=Hn(8*L),Te=ue>>>3,Le=0;Le>>0]=Ke)}return h=So(h,0,L,ue,T),gn(N),h};function Ie(h){if(u)return Ge(0,1,h);if(S=h,!(0{if(S=h,u)throw pt(h),"unwind";Ie(h)},Vt=[],zt=[],gr=[],or={},bt=h=>{var T=h.Ab;delete or[T],Vt.push(h),zt.splice(zt.indexOf(h),1),h.Ab=0,$o(T)};function Zr(){gr.forEach(h=>h())}var D=h=>new Promise(T=>{h.onmessage=N=>{var ue=(N=N.data).Bb;if(N.Gb&&N.Gb!=mn()){var Te=or[N.Gb];Te?Te.postMessage(N,N.Mb):x(`Internal error! Worker sent a message "${ue}" to target pthread ${N.Gb}, but that thread no longer exists!`)}else ue==="checkMailbox"?Re():ue==="spawnThread"?st(N):ue==="cleanupThread"?bt(or[N.hc]):ue==="loaded"?(h.loaded=!0,T(h)):ue==="alert"?alert(`Thread ${N.ic}: ${N.text}`):N.target==="setimmediate"?h.postMessage(N):ue==="callHandler"?n[N.Qb](...N.args):ue&&x(`worker sent an unknown command ${ue}`)},h.onerror=N=>{throw x(`worker sent an error! ${N.filename}:${N.lineno}: ${N.message}`),N};var I,L=[];for(I of[])n.propertyIsEnumerable(I)&&L.push(I);h.postMessage({Bb:"load",Rb:L,kc:b,lc:y})});function oe(){var h=new Worker((()=>{let T=URL;return import.meta.url>"file:"&&import.meta.url<"file;"?new T("ort.bundle.min.mjs",import.meta.url):new URL(import.meta.url)})(),{type:"module",workerData:"em-pthread",name:"em-pthread"});Vt.push(h)}var B=h=>{re();var T=ye()[h+52>>>2>>>0];h=ye()[h+56>>>2>>>0],Kn(T,T-h),gn(T)},te=(h,T)=>{at=0,h=Ao(h,T),0>>=0);throw T>>>=0,I>>>=0,ye()[L.Ib+16>>>2>>>0]=0,ye()[L.Ib+4>>>2>>>0]=T,ye()[L.Ib+8>>>2>>>0]=I,h}function ve(h,T,I,L){return u?Ge(2,1,h,T,I,L):yt(h,T,I,L)}function yt(h,T,I,L){if(h>>>=0,I>>>=0,L>>>=0,p===void 0)return 6;var N=[];return u&&N.length===0?ve(h,T>>>=0,I,L):(h={ec:I,Ab:h,Hb:L,Mb:N},u?(h.Bb="spawnThread",postMessage(h,N),0):st(h))}var Ft=typeof TextDecoder<"u"?new TextDecoder:void 0,ht=(h,T=0,I=NaN)=>{var L=(T>>>=0)+I;for(I=T;h[I]&&!(I>=L);)++I;if(16(N=(240&N)==224?(15&N)<<12|ue<<6|Te:(7&N)<<18|ue<<12|Te<<6|63&h[T++])?L+=String.fromCharCode(N):(N-=65536,L+=String.fromCharCode(55296|N>>10,56320|1023&N))}}else L+=String.fromCharCode(N)}return L},lt=(h,T)=>(h>>>=0)?ht(U(),h,T):"";function rt(h,T,I){return u?Ge(3,1,h,T,I):0}function Bt(h,T){if(u)return Ge(4,1,h,T)}var Ht=h=>{for(var T=0,I=0;I=L?T++:2047>=L?T+=2:55296<=L&&57343>=L?(T+=4,++I):T+=3}return T},wr=(h,T,I)=>{var L=U();if(T>>>=0,0=Te&&(Te=65536+((1023&Te)<<10)|1023&h.charCodeAt(++ue)),127>=Te){if(T>=I)break;L[T++>>>0]=Te}else{if(2047>=Te){if(T+1>=I)break;L[T++>>>0]=192|Te>>6}else{if(65535>=Te){if(T+2>=I)break;L[T++>>>0]=224|Te>>12}else{if(T+3>=I)break;L[T++>>>0]=240|Te>>18,L[T++>>>0]=128|Te>>12&63}L[T++>>>0]=128|Te>>6&63}L[T++>>>0]=128|63&Te}}L[T>>>0]=0,h=T-N}else h=0;return h};function Xt(h,T){if(u)return Ge(5,1,h,T)}function Or(h,T,I){if(u)return Ge(6,1,h,T,I)}function es(h,T,I){return u?Ge(7,1,h,T,I):0}function ds(h,T){if(u)return Ge(8,1,h,T)}function ts(h,T,I){if(u)return Ge(9,1,h,T,I)}function Cs(h,T,I,L){if(u)return Ge(10,1,h,T,I,L)}function jr(h,T,I,L){if(u)return Ge(11,1,h,T,I,L)}function Ss(h,T,I,L){if(u)return Ge(12,1,h,T,I,L)}function Kr(h){if(u)return Ge(13,1,h)}function ps(h,T){if(u)return Ge(14,1,h,T)}function $s(h,T,I){if(u)return Ge(15,1,h,T,I)}var ks,ir,Is=()=>$e(""),Tr=h=>{for(var T="";U()[h>>>0];)T+=ks[U()[h++>>>0]];return T},hs={},zr={};function Ae(h,T,I={}){return function(L,N,ue={}){var Te=N.name;if(!L)throw new ir(`type "${Te}" must have a positive integer typeid pointer`);if(zr.hasOwnProperty(L)){if(ue.Sb)return;throw new ir(`Cannot register type '${Te}' twice`)}zr[L]=N,hs.hasOwnProperty(L)&&(N=hs[L],delete hs[L],N.forEach(Le=>Le()))}(h,T,I)}var Je=(h,T,I)=>{switch(T){case 1:return I?L=>A()[L>>>0]:L=>U()[L>>>0];case 2:return I?L=>ee()[L>>>1>>>0]:L=>_e()[L>>>1>>>0];case 4:return I?L=>le()[L>>>2>>>0]:L=>ye()[L>>>2>>>0];case 8:return I?L=>J[L>>>3]:L=>Q[L>>>3];default:throw new TypeError(`invalid integer width (${T}): ${h}`)}};function it(h,T,I){I>>>=0,Ae(h>>>=0,{name:T=Tr(T>>>0),fromWireType:L=>L,toWireType:function(L,N){if(typeof N!="bigint"&&typeof N!="number")throw N=N===null?"null":(L=typeof N)=="object"||L==="array"||L==="function"?N.toString():""+N,new TypeError(`Cannot convert "${N}" to ${this.name}`);return typeof N=="number"&&(N=BigInt(N)),N},Cb:Rt,readValueFromPointer:Je(T,I,T.indexOf("u")==-1),Db:null})}var Rt=8;function rs(h,T,I,L){Ae(h>>>=0,{name:T=Tr(T>>>0),fromWireType:function(N){return!!N},toWireType:function(N,ue){return ue?I:L},Cb:Rt,readValueFromPointer:function(N){return this.fromWireType(U()[N>>>0])},Db:null})}var ss=[],ur=[];function ns(h){9<(h>>>=0)&&--ur[h+1]==0&&(ur[h]=void 0,ss.push(h))}var cr=h=>{if(!h)throw new ir("Cannot use deleted val. handle = "+h);return ur[h]},hr=h=>{switch(h){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let T=ss.pop()||ur.length;return ur[T]=h,ur[T+1]=1,T}};function os(h){return this.fromWireType(ye()[h>>>2>>>0])}var ms={name:"emscripten::val",fromWireType:h=>{var T=cr(h);return ns(h),T},toWireType:(h,T)=>hr(T),Cb:Rt,readValueFromPointer:os,Db:null};function rn(h){return Ae(h>>>0,ms)}var sn=(h,T)=>{switch(T){case 4:return function(I){return this.fromWireType(ze()[I>>>2>>>0])};case 8:return function(I){return this.fromWireType(Ue()[I>>>3>>>0])};default:throw new TypeError(`invalid float width (${T}): ${h}`)}};function nn(h,T,I){I>>>=0,Ae(h>>>=0,{name:T=Tr(T>>>0),fromWireType:L=>L,toWireType:(L,N)=>N,Cb:Rt,readValueFromPointer:sn(T,I),Db:null})}function on(h,T,I,L,N){if(h>>>=0,I>>>=0,T=Tr(T>>>0),N===-1&&(N=4294967295),N=Le=>Le,L===0){var ue=32-8*I;N=Le=>Le<>>ue}var Te=T.includes("unsigned")?function(Le,Ke){return Ke>>>0}:function(Le,Ke){return Ke};Ae(h,{name:T,fromWireType:N,toWireType:Te,Cb:Rt,readValueFromPointer:Je(T,I,L!==0),Db:null})}function an(h,T,I){function L(ue){var Te=ye()[ue>>>2>>>0];return ue=ye()[ue+4>>>2>>>0],new N(A().buffer,ue,Te)}var N=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][T];Ae(h>>>=0,{name:I=Tr(I>>>0),fromWireType:L,Cb:Rt,readValueFromPointer:L},{Sb:!0})}function As(h,T){Ae(h>>>=0,{name:T=Tr(T>>>0),fromWireType:function(I){for(var L,N=ye()[I>>>2>>>0],ue=I+4,Te=ue,Le=0;Le<=N;++Le){var Ke=ue+Le;Le!=N&&U()[Ke>>>0]!=0||(Te=lt(Te,Ke-Te),L===void 0?L=Te:(L+="\0",L+=Te),Te=Ke+1)}return Wr(I),L},toWireType:function(I,L){L instanceof ArrayBuffer&&(L=new Uint8Array(L));var N=typeof L=="string";if(!(N||L instanceof Uint8Array||L instanceof Uint8ClampedArray||L instanceof Int8Array))throw new ir("Cannot pass non-string to std::string");var ue=N?Ht(L):L.length,Te=fn(4+ue+1),Le=Te+4;if(ye()[Te>>>2>>>0]=ue,N)wr(L,Le,ue+1);else if(N)for(N=0;N>>0]=Ke}else for(N=0;N>>0]=L[N];return I!==null&&I.push(Wr,Te),Te},Cb:Rt,readValueFromPointer:os,Db(I){Wr(I)}})}var Vs=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ln=(h,T)=>{for(var I=h>>1,L=I+T/2;!(I>=L)&&_e()[I>>>0];)++I;if(32<(I<<=1)-h&&Vs)return Vs.decode(U().slice(h,I));for(I="",L=0;!(L>=T/2);++L){var N=ee()[h+2*L>>>1>>>0];if(N==0)break;I+=String.fromCharCode(N)}return I},un=(h,T,I)=>{if(I??(I=2147483647),2>I)return 0;var L=T;I=(I-=2)<2*h.length?I/2:h.length;for(var N=0;N>>1>>>0]=ue,T+=2}return ee()[T>>>1>>>0]=0,T-L},cn=h=>2*h.length,Fs=(h,T)=>{for(var I=0,L="";!(I>=T/4);){var N=le()[h+4*I>>>2>>>0];if(N==0)break;++I,65536<=N?(N-=65536,L+=String.fromCharCode(55296|N>>10,56320|1023&N)):L+=String.fromCharCode(N)}return L},de=(h,T,I)=>{if(T>>>=0,I??(I=2147483647),4>I)return 0;var L=T;I=L+I-4;for(var N=0;N=ue&&(ue=65536+((1023&ue)<<10)|1023&h.charCodeAt(++N)),le()[T>>>2>>>0]=ue,(T+=4)+4>I)break}return le()[T>>>2>>>0]=0,T-L},k=h=>{for(var T=0,I=0;I=L&&++I,T+=4}return T};function j(h,T,I){if(h>>>=0,T>>>=0,I=Tr(I>>>=0),T===2)var L=ln,N=un,ue=cn,Te=Le=>_e()[Le>>>1>>>0];else T===4&&(L=Fs,N=de,ue=k,Te=Le=>ye()[Le>>>2>>>0]);Ae(h,{name:I,fromWireType:Le=>{for(var Ke,et=ye()[Le>>>2>>>0],Mt=Le+4,kt=0;kt<=et;++kt){var Wt=Le+4+kt*T;kt!=et&&Te(Wt)!=0||(Mt=L(Mt,Wt-Mt),Ke===void 0?Ke=Mt:(Ke+="\0",Ke+=Mt),Mt=Wt+T)}return Wr(Le),Ke},toWireType:(Le,Ke)=>{if(typeof Ke!="string")throw new ir(`Cannot pass non-string to C++ string type ${I}`);var et=ue(Ke),Mt=fn(4+et+T);return ye()[Mt>>>2>>>0]=et/T,N(Ke,Mt+4,et+T),Le!==null&&Le.push(Wr,Mt),Mt},Cb:Rt,readValueFromPointer:os,Db(Le){Wr(Le)}})}function X(h,T){Ae(h>>>=0,{Tb:!0,name:T=Tr(T>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function ie(h){Wn(h>>>0,!l,1,!a,131072,!1),Zr()}var ce=h=>{if(!ae)try{if(h(),!(0>>=0,typeof Atomics.jc=="function"&&(Atomics.jc(le(),h>>>2,h).value.then(Re),h+=128,Atomics.store(le(),h>>>2,1))}var Re=()=>{var h=mn();h&&(xe(h),ce(Io))};function Qe(h,T){(h>>>=0)==T>>>0?setTimeout(Re):u?postMessage({Gb:h,Bb:"checkMailbox"}):(h=or[h])&&h.postMessage({Bb:"checkMailbox"})}var We=[];function Ye(h,T,I,L,N){for(T>>>=0,L/=2,We.length=L,I=N>>>0>>>3,N=0;N>>0];return(T?Be[T]:Ei[h])(...We)}var _t=()=>{at=0};function Ot(h){h>>>=0,u?postMessage({Bb:"cleanupThread",hc:h}):bt(or[h])}function At(h){}var Jt=(h,T)=>{var I=zr[h];if(I===void 0)throw h=Un(h),I=Tr(h),Wr(h),new ir(`${T} has unknown type ${I}`);return I},Ut=(h,T,I)=>{var L=[];return h=h.toWireType(L,I),L.length&&(ye()[T>>>2>>>0]=hr(L)),h};function mr(h,T,I){return T>>>=0,I>>>=0,h=cr(h>>>0),T=Jt(T,"emval::as"),Ut(T,I,h)}function br(h,T){return T>>>=0,h=cr(h>>>0),(T=Jt(T,"emval::as")).toWireType(null,h)}var Er=h=>{try{h()}catch(T){$e(T)}},Pr=0,Zt=null,fs=0,Kt=[],fr={},Dr={},Hr=0,qr=null,kr=[];function Lr(h){return function(T){if(!ae){if(Pr===0){var I=!1,L=!1;T((N=0)=>{if(!ae&&(fs=N,I=!0,L)){Pr=2,Er(()=>Oo(Zt)),typeof MainLoop<"u"&&MainLoop.Pb&&MainLoop.resume(),N=!1;try{var ue=function(){var Ke=le()[Zt+8>>>2>>>0];return Ke=ct[Dr[Ke]],--at,Ke()}()}catch(Ke){ue=Ke,N=!0}var Te=!1;if(!Zt){var Le=qr;Le&&(qr=null,(N?Le.reject:Le.resolve)(ue),Te=!0)}if(N&&!Te)throw ue}}),L=!0,I||(Pr=1,Zt=function(){var N=fn(65548),ue=N+12;ye()[N>>>2>>>0]=ue,ye()[N+4>>>2>>>0]=ue+65536,ue=Kt[0];var Te=fr[ue];return Te===void 0&&(Te=Hr++,fr[ue]=Te,Dr[Te]=ue),ue=Te,le()[N+8>>>2>>>0]=ue,N}(),typeof MainLoop<"u"&&MainLoop.Pb&&MainLoop.pause(),Er(()=>Fo(Zt)))}else Pr===2?(Pr=0,Er(Do),Wr(Zt),Zt=null,kr.forEach(ce)):$e(`invalid state: ${Pr}`);return fs}}(T=>{h().then(T)})}function Mr(h){return h>>>=0,Lr(async()=>{var T=await cr(h);return hr(T)})}var er=[];function dr(h,T,I,L){return I>>>=0,L>>>=0,(h=er[h>>>0])(null,T=cr(T>>>0),I,L)}var pr={},Ir=h=>{var T=pr[h];return T===void 0?Tr(h):T};function is(h,T,I,L,N){return I>>>=0,L>>>=0,N>>>=0,(h=er[h>>>0])(T=cr(T>>>0),T[I=Ir(I)],L,N)}var dn=()=>typeof globalThis=="object"?globalThis:Function("return this")();function ri(h){return(h>>>=0)==0?hr(dn()):(h=Ir(h),hr(dn()[h]))}var si=h=>{var T=er.length;return er.push(h),T},ni=(h,T)=>{for(var I=Array(h),L=0;L>>2>>>0],"parameter "+L);return I},ao=(h,T)=>Object.defineProperty(T,"name",{value:h});function Us(h,T,I){var L=(T=ni(h,T>>>0)).shift();h--;var N=`return function (obj, func, destructorsRef, args) { -`,ue=0,Te=[];I===0&&Te.push("obj");for(var Le=["retType"],Ke=[L],et=0;etMt.name).join(", ")}) => ${L.name}>`,si(ao(I,h))}function oi(h){return h=Ir(h>>>0),hr(n[h])}function ii(h,T){return T>>>=0,h=cr(h>>>0),T=cr(T),hr(h[T])}function ai(h){9<(h>>>=0)&&(ur[h+1]+=1)}function li(){return hr([])}function ui(h){h=cr(h>>>0);for(var T=Array(h.length),I=0;I>>0))}function ci(){return hr({})}function di(h){for(var T=cr(h>>>=0);T.length;){var I=T.pop();T.pop()(I)}ns(h)}function uo(h,T,I){T>>>=0,I>>>=0,h=cr(h>>>0),T=cr(T),I=cr(I),h[T]=I}function pi(h,T){return T>>>=0,h=(h=Jt(h>>>0,"_emval_take_value")).readValueFromPointer(T),hr(h)}function co(h,T){h=-9007199254740992>h||9007199254740992>>=0,h=new Date(1e3*h),le()[T>>>2>>>0]=h.getUTCSeconds(),le()[T+4>>>2>>>0]=h.getUTCMinutes(),le()[T+8>>>2>>>0]=h.getUTCHours(),le()[T+12>>>2>>>0]=h.getUTCDate(),le()[T+16>>>2>>>0]=h.getUTCMonth(),le()[T+20>>>2>>>0]=h.getUTCFullYear()-1900,le()[T+24>>>2>>>0]=h.getUTCDay(),h=(h.getTime()-Date.UTC(h.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,le()[T+28>>>2>>>0]=h}var po=h=>h%4==0&&(h%100!=0||h%400==0),Rn=[0,31,60,91,121,152,182,213,244,274,305,335],hi=[0,31,59,90,120,151,181,212,243,273,304,334];function mi(h,T){h=-9007199254740992>h||9007199254740992>>=0,h=new Date(1e3*h),le()[T>>>2>>>0]=h.getSeconds(),le()[T+4>>>2>>>0]=h.getMinutes(),le()[T+8>>>2>>>0]=h.getHours(),le()[T+12>>>2>>>0]=h.getDate(),le()[T+16>>>2>>>0]=h.getMonth(),le()[T+20>>>2>>>0]=h.getFullYear()-1900,le()[T+24>>>2>>>0]=h.getDay();var I=(po(h.getFullYear())?Rn:hi)[h.getMonth()]+h.getDate()-1|0;le()[T+28>>>2>>>0]=I,le()[T+36>>>2>>>0]=-60*h.getTimezoneOffset(),I=new Date(h.getFullYear(),6,1).getTimezoneOffset();var L=new Date(h.getFullYear(),0,1).getTimezoneOffset();h=0|(I!=L&&h.getTimezoneOffset()==Math.min(L,I)),le()[T+32>>>2>>>0]=h}function ho(h){h>>>=0;var T=new Date(le()[h+20>>>2>>>0]+1900,le()[h+16>>>2>>>0],le()[h+12>>>2>>>0],le()[h+8>>>2>>>0],le()[h+4>>>2>>>0],le()[h>>>2>>>0],0),I=le()[h+32>>>2>>>0],L=T.getTimezoneOffset(),N=new Date(T.getFullYear(),6,1).getTimezoneOffset(),ue=new Date(T.getFullYear(),0,1).getTimezoneOffset(),Te=Math.min(ue,N);return 0>I?le()[h+32>>>2>>>0]=+(N!=ue&&Te==L):0>>2>>>0]=T.getDay(),I=(po(T.getFullYear())?Rn:hi)[T.getMonth()]+T.getDate()-1|0,le()[h+28>>>2>>>0]=I,le()[h>>>2>>>0]=T.getSeconds(),le()[h+4>>>2>>>0]=T.getMinutes(),le()[h+8>>>2>>>0]=T.getHours(),le()[h+12>>>2>>>0]=T.getDate(),le()[h+16>>>2>>>0]=T.getMonth(),le()[h+20>>>2>>>0]=T.getYear(),h=T.getTime(),BigInt(isNaN(h)?-1:h/1e3)}function mo(h,T,I,L,N,ue,Te){return u?Ge(16,1,h,T,I,L,N,ue,Te):-52}function pn(h,T,I,L,N,ue){if(u)return Ge(17,1,h,T,I,L,N,ue)}var Ws={},fi=()=>performance.timeOrigin+performance.now();function fo(h,T){if(u)return Ge(18,1,h,T);if(Ws[h]&&(clearTimeout(Ws[h].id),delete Ws[h]),!T)return 0;var I=setTimeout(()=>{delete Ws[h],ce(()=>ko(h,performance.timeOrigin+performance.now()))},T);return Ws[h]={id:I,qc:T},0}function _i(h,T,I,L){h>>>=0,T>>>=0,I>>>=0,L>>>=0;var N=new Date().getFullYear(),ue=new Date(N,0,1).getTimezoneOffset();N=new Date(N,6,1).getTimezoneOffset();var Te=Math.max(ue,N);ye()[h>>>2>>>0]=60*Te,le()[T>>>2>>>0]=+(ue!=N),h=(T=Le=>{var Ke=Math.abs(Le);return`UTC${0<=Le?"-":"+"}${String(Math.floor(Ke/60)).padStart(2,"0")}${String(Ke%60).padStart(2,"0")}`})(ue),T=T(N),NDate.now();function wi(h,T,I){return 0<=h&&3>=h?(h===0?h=Date.now():h=performance.timeOrigin+performance.now(),J[I>>>0>>>3]=BigInt(Math.round(1e6*h)),0):28}var jn=[],hn=(h,T)=>{jn.length=0;for(var I;I=U()[h++>>>0];){var L=I!=105;T+=(L&=I!=112)&&T%8?4:0,jn.push(I==112?ye()[T>>>2>>>0]:I==106?J[T>>>3]:I==105?le()[T>>>2>>>0]:Ue()[T>>>3>>>0]),T+=L?8:4}return jn};function _o(h,T,I){return h>>>=0,T=hn(T>>>0,I>>>0),Be[h](...T)}function bi(h,T,I){return h>>>=0,T=hn(T>>>0,I>>>0),Be[h](...T)}var go=()=>{};function Ls(h,T){return x(lt(h>>>0,T>>>0))}var Mi=()=>{throw at+=1,"unwind"};function ba(){return 4294901760}var yi=()=>navigator.hardwareConcurrency;function Ma(){return $e("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}function vi(h){h>>>=0;var T=U().length;if(h<=T||4294901760=I;I*=2){var L=T*(1+.2/I);L=Math.min(L,h+100663296);e:{L=(Math.min(4294901760,65536*Math.ceil(Math.max(h,L)/65536))-b.buffer.byteLength+65535)/65536|0;try{b.grow(L),re();var N=1;break e}catch{}N=void 0}if(N)return!0}return!1}var Gs=()=>($e("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),Ks={},wo=h=>{h.forEach(T=>{Gs()})};function xi(){var h=Error().stack.toString().split(` -`);return h[0]=="Error"&&h.shift(),wo(h),Ks.Lb=Gs(),Ks.cc=h,Ks.Lb}function Ti(h,T,I){if(h>>>=0,T>>>=0,Ks.Lb==h)var L=Ks.cc;else(L=Error().stack.toString().split(` -`))[0]=="Error"&&L.shift(),wo(L);for(var N=3;L[N]&&Gs()!=h;)++N;for(h=0;h>>2>>>0]=Gs();return h}var Nn,Hs={},bo=()=>{if(!Nn){var h,T={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:"./this.program"};for(h in Hs)Hs[h]===void 0?delete T[h]:T[h]=Hs[h];var I=[];for(h in T)I.push(`${h}=${T[h]}`);Nn=I}return Nn};function Mo(h,T){if(u)return Ge(19,1,h,T);h>>>=0,T>>>=0;var I=0;return bo().forEach((L,N)=>{var ue=T+I;for(N=ye()[h+4*N>>>2>>>0]=ue,ue=0;ue>>0]=L.charCodeAt(ue);A()[N>>>0]=0,I+=L.length+1}),0}function yo(h,T){if(u)return Ge(20,1,h,T);h>>>=0,T>>>=0;var I=bo();ye()[h>>>2>>>0]=I.length;var L=0;return I.forEach(N=>L+=N.length+1),ye()[T>>>2>>>0]=L,0}function Vn(h){return u?Ge(21,1,h):52}function vo(h,T,I,L){return u?Ge(22,1,h,T,I,L):52}function xo(h,T,I,L){return u?Ge(23,1,h,T,I,L):70}var To=[null,[],[]];function Eo(h,T,I,L){if(u)return Ge(24,1,h,T,I,L);T>>>=0,I>>>=0,L>>>=0;for(var N=0,ue=0;ue>>2>>>0],Le=ye()[T+4>>>2>>>0];T+=8;for(var Ke=0;Ke>>0],Mt=To[h];et===0||et===10?((h===1?E:x)(ht(Mt)),Mt.length=0):Mt.push(et)}N+=Le}return ye()[L>>>2>>>0]=N,0}u||function(){for(var h=n.numThreads-1;h--;)oe();Ze.unshift(()=>{we++,function(T){u?T():Promise.all(Vt.map(D)).then(T)}(()=>Pe())})}();for(var Po=Array(256),qs=0;256>qs;++qs)Po[qs]=String.fromCharCode(qs);ks=Po,ir=n.BindingError=class extends Error{constructor(h){super(h),this.name="BindingError"}},n.InternalError=class extends Error{constructor(h){super(h),this.name="InternalError"}},ur.push(0,1,void 0,1,null,1,!0,1,!1,1),n.count_emval_handles=()=>ur.length/2-5-ss.length;var ct,Ei=[Ie,pt,ve,rt,Bt,Xt,Or,es,ds,ts,Cs,jr,Ss,Kr,ps,$s,mo,pn,fo,Mo,yo,Vn,vo,xo,Eo];(async function(){function h(L,N){return ct=L.exports,ct=function(){var ue=ct,Te={};for(let[Le,Ke]of Object.entries(ue))Te[Le]=typeof Ke=="function"?(...et)=>{Kt.push(Le);try{return Ke(...et)}finally{ae||(Kt.pop(),Zt&&Pr===1&&Kt.length===0&&(Pr=0,at+=1,Er(qn),typeof Fibers<"u"&&Fibers.rc()))}}:Ke;return Te}(),ct=function(){var ue=ct,Te=Ke=>et=>Ke(et)>>>0,Le=Ke=>()=>Ke()>>>0;return(ue=Object.assign({},ue)).Da=Te(ue.Da),ue.fb=Le(ue.fb),ue.hb=Te(ue.hb),ue.tb=Te(ue.tb),ue.ub=Le(ue.ub),ue.__cxa_get_exception_ptr=Te(ue.__cxa_get_exception_ptr),ue}(),gr.push(ct.ib),y=N,Pe(),ct}we++;var T=Fe();if(n.instantiateWasm)return new Promise(L=>{n.instantiateWasm(T,(N,ue)=>{h(N,ue),L(N.exports)})});if(u)return new Promise(L=>{pe=N=>{var ue=new WebAssembly.Instance(N,Fe());L(h(ue,N))}});be??(be=n.locateFile?n.locateFile?n.locateFile("ort-wasm-simd-threaded.jsep.wasm",g):g+"ort-wasm-simd-threaded.jsep.wasm":new URL("/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",import.meta.url).href);try{var I=await async function(L){var N=be;if(!fe&&typeof WebAssembly.instantiateStreaming=="function"&&!V(N))try{var ue=fetch(N,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(ue,L)}catch(Te){x(`wasm streaming compile failed: ${Te}`),x("falling back to ArrayBuffer instantiation")}return async function(Te,Le){try{var Ke=await async function(et){if(!fe)try{var Mt=await _(et);return new Uint8Array(Mt)}catch{}if(et==be&&fe)et=new Uint8Array(fe);else{if(!f)throw"both async and sync fetching of the wasm failed";et=f(et)}return et}(Te);return await WebAssembly.instantiate(Ke,Le)}catch(et){x(`failed to asynchronously prepare wasm: ${et}`),$e(et)}}(N,L)}(T);return h(I.instance,I.module)}catch(L){return o(L),Promise.reject(L)}})();var Un=h=>(Un=ct.Da)(h),Co=()=>(Co=ct.Ea)();n._OrtInit=(h,T)=>(n._OrtInit=ct.Fa)(h,T),n._OrtGetLastError=(h,T)=>(n._OrtGetLastError=ct.Ga)(h,T),n._OrtCreateSessionOptions=(h,T,I,L,N,ue,Te,Le,Ke,et)=>(n._OrtCreateSessionOptions=ct.Ha)(h,T,I,L,N,ue,Te,Le,Ke,et),n._OrtAppendExecutionProvider=(h,T,I,L,N)=>(n._OrtAppendExecutionProvider=ct.Ia)(h,T,I,L,N),n._OrtAddFreeDimensionOverride=(h,T,I)=>(n._OrtAddFreeDimensionOverride=ct.Ja)(h,T,I),n._OrtAddSessionConfigEntry=(h,T,I)=>(n._OrtAddSessionConfigEntry=ct.Ka)(h,T,I),n._OrtReleaseSessionOptions=h=>(n._OrtReleaseSessionOptions=ct.La)(h),n._OrtCreateSession=(h,T,I)=>(n._OrtCreateSession=ct.Ma)(h,T,I),n._OrtReleaseSession=h=>(n._OrtReleaseSession=ct.Na)(h),n._OrtGetInputOutputCount=(h,T,I)=>(n._OrtGetInputOutputCount=ct.Oa)(h,T,I),n._OrtGetInputOutputMetadata=(h,T,I,L)=>(n._OrtGetInputOutputMetadata=ct.Pa)(h,T,I,L),n._OrtFree=h=>(n._OrtFree=ct.Qa)(h),n._OrtCreateTensor=(h,T,I,L,N,ue)=>(n._OrtCreateTensor=ct.Ra)(h,T,I,L,N,ue),n._OrtGetTensorData=(h,T,I,L,N)=>(n._OrtGetTensorData=ct.Sa)(h,T,I,L,N),n._OrtReleaseTensor=h=>(n._OrtReleaseTensor=ct.Ta)(h),n._OrtCreateRunOptions=(h,T,I,L)=>(n._OrtCreateRunOptions=ct.Ua)(h,T,I,L),n._OrtAddRunConfigEntry=(h,T,I)=>(n._OrtAddRunConfigEntry=ct.Va)(h,T,I),n._OrtReleaseRunOptions=h=>(n._OrtReleaseRunOptions=ct.Wa)(h),n._OrtCreateBinding=h=>(n._OrtCreateBinding=ct.Xa)(h),n._OrtBindInput=(h,T,I)=>(n._OrtBindInput=ct.Ya)(h,T,I),n._OrtBindOutput=(h,T,I,L)=>(n._OrtBindOutput=ct.Za)(h,T,I,L),n._OrtClearBoundOutputs=h=>(n._OrtClearBoundOutputs=ct._a)(h),n._OrtReleaseBinding=h=>(n._OrtReleaseBinding=ct.$a)(h),n._OrtRunWithBinding=(h,T,I,L,N)=>(n._OrtRunWithBinding=ct.ab)(h,T,I,L,N),n._OrtRun=(h,T,I,L,N,ue,Te,Le)=>(n._OrtRun=ct.bb)(h,T,I,L,N,ue,Te,Le),n._OrtEndProfiling=h=>(n._OrtEndProfiling=ct.cb)(h),n._JsepOutput=(h,T,I)=>(n._JsepOutput=ct.db)(h,T,I),n._JsepGetNodeName=h=>(n._JsepGetNodeName=ct.eb)(h);var mn=()=>(mn=ct.fb)(),Wr=n._free=h=>(Wr=n._free=ct.gb)(h),fn=n._malloc=h=>(fn=n._malloc=ct.hb)(h),Wn=(h,T,I,L,N,ue)=>(Wn=ct.kb)(h,T,I,L,N,ue),Gn=()=>(Gn=ct.lb)(),So=(h,T,I,L,N)=>(So=ct.mb)(h,T,I,L,N),$o=h=>($o=ct.nb)(h),_n=h=>(_n=ct.ob)(h),ko=(h,T)=>(ko=ct.pb)(h,T),Io=()=>(Io=ct.qb)(),Kn=(h,T)=>(Kn=ct.rb)(h,T),gn=h=>(gn=ct.sb)(h),Hn=h=>(Hn=ct.tb)(h),wn=()=>(wn=ct.ub)(),Ao=n.dynCall_ii=(h,T)=>(Ao=n.dynCall_ii=ct.vb)(h,T),Fo=h=>(Fo=ct.wb)(h),qn=()=>(qn=ct.xb)(),Oo=h=>(Oo=ct.yb)(h),Do=()=>(Do=ct.zb)();return n.stackSave=()=>wn(),n.stackRestore=h=>gn(h),n.stackAlloc=h=>Hn(h),n.setValue=function(h,T,I="i8"){switch(I.endsWith("*")&&(I="*"),I){case"i1":case"i8":A()[h>>>0]=T;break;case"i16":ee()[h>>>1>>>0]=T;break;case"i32":le()[h>>>2>>>0]=T;break;case"i64":J[h>>>3]=BigInt(T);break;case"float":ze()[h>>>2>>>0]=T;break;case"double":Ue()[h>>>3>>>0]=T;break;case"*":ye()[h>>>2>>>0]=T;break;default:$e(`invalid type for setValue: ${I}`)}},n.getValue=function(h,T="i8"){switch(T.endsWith("*")&&(T="*"),T){case"i1":case"i8":return A()[h>>>0];case"i16":return ee()[h>>>1>>>0];case"i32":return le()[h>>>2>>>0];case"i64":return J[h>>>3];case"float":return ze()[h>>>2>>>0];case"double":return Ue()[h>>>3>>>0];case"*":return ye()[h>>>2>>>0];default:$e(`invalid type for getValue: ${T}`)}},n.UTF8ToString=lt,n.stringToUTF8=wr,n.lengthBytesUTF8=Ht,function h(){if(0{Zu(),jl=typeof location>"u"?void 0:location.origin,Ou=import.meta.url>"file:"&&import.meta.url<"file;",Ff=()=>{{if(Ou){let e=URL;return new URL(new e("ort.bundle.min.mjs",import.meta.url).href,jl).href}return import.meta.url}},Xr=Ff(),zb=()=>{if(Xr&&!Xr.startsWith("blob:"))return Xr.substring(0,Xr.lastIndexOf("/")+1)},Qi=(e,r)=>{try{let t=r??Xr;return(t?new URL(e,t):new URL(e)).origin===jl}catch{return!1}},Of=(e,r)=>{let t=r??Xr;try{return(t?new URL(e,t):new URL(e)).href}catch{return}},Df=(e,r)=>`${r??"./"}${e}`,Nl=async e=>{let r=await(await fetch(e,{credentials:"same-origin"})).blob();return URL.createObjectURL(r)},Lf=async e=>(await import(e)).default,Vl=(lx(),Zo(Fb)).default,Bb=async()=>{if(!Xr)throw new Error("Failed to load proxy worker: cannot determine the script source URL.");if(Qi(Xr))return[void 0,Vl()];let e=await Nl(Xr);return[e,Vl(e)]},Ul=(ux(),Zo(Db)).default,Rb=async(e,r,t)=>{if(!e&&!r&&Ul&&Xr&&Qi(Xr))return[void 0,Ul];{let s="ort-wasm-simd-threaded.jsep.mjs",o=e??Of(s,r),n=t&&o&&!Qi(o,r),i=n?await Nl(o):o??Df(s,r);return[n?i:void 0,await Lf(i)]}}}),Wl,Xi,Ro,Gl,zf,Bf,Rf,tc,Qt,zn=je(()=>{ec(),Xi=!1,Ro=!1,Gl=!1,zf=()=>{if(typeof SharedArrayBuffer>"u")return!1;try{return 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}},Bf=()=>{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}},Rf=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},tc=async e=>{if(Xi)return Promise.resolve();if(Ro)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(Gl)throw new Error("previous call to 'initializeWebAssembly()' failed.");Ro=!0;let r=e.initTimeout,t=e.numThreads;if(e.simd!==!1){if(e.simd==="relaxed"){if(!Rf())throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.")}else if(!Bf())throw new Error("WebAssembly SIMD is not supported in the current environment.")}let s=zf();t>1&&!s&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+t+", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info."),console.warn("WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading."),e.numThreads=t=1);let o=e.wasmPaths,n=typeof o=="string"?o:void 0,i=o==null?void 0:o.mjs,a=(i==null?void 0:i.href)??i,l=o==null?void 0:o.wasm,u=(l==null?void 0:l.href)??l,p=e.wasmBinary,[c,d]=await Rb(a,n,t>1),_=!1,f=[];if(r>0&&f.push(new Promise(v=>{setTimeout(()=>{_=!0,v()},r)})),f.push(new Promise((v,$)=>{let g={numThreads:t};if(p)g.wasmBinary=p;else if(u||n)g.locateFile=w=>u??n+w;else if(a&&a.indexOf("blob:")!==0)g.locateFile=w=>new URL(w,a).href;else if(c){let w=zb();w&&(g.locateFile=C=>w+C)}d(g).then(w=>{Ro=!1,Xi=!0,Wl=w,v(),c&&URL.revokeObjectURL(c)},w=>{Ro=!1,Gl=!0,$(w)})})),await Promise.race(f),_)throw new Error(`WebAssembly backend initializing failed due to timeout: ${r}ms`)},Qt=()=>{if(Xi&&Wl)return Wl;throw new Error("WebAssembly is not initialized yet.")}}),vs,pa,Gt,rc=je(()=>{zn(),vs=(e,r)=>{let t=Qt(),s=t.lengthBytesUTF8(e)+1,o=t._malloc(s);return t.stringToUTF8(e,o,s),r.push(o),o},pa=(e,r,t,s)=>{if(typeof e=="object"&&e!==null){if(t.has(e))throw new Error("Circular reference in options");t.add(e)}Object.entries(e).forEach(([o,n])=>{let i=r?r+o:o;if(typeof n=="object")pa(n,i+".",t,s);else if(typeof n=="string"||typeof n=="number")s(i,n.toString());else if(typeof n=="boolean")s(i,n?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof n}`)})},Gt=e=>{let r=Qt(),t=r.stackSave();try{let s=r.PTR_SIZE,o=r.stackAlloc(2*s);r._OrtGetLastError(o,o+s);let n=Number(r.getValue(o,s===4?"i32":"i64")),i=r.getValue(o+s,"*"),a=i?r.UTF8ToString(i):"";throw new Error(`${e} ERROR_CODE: ${n}, ERROR_MESSAGE: ${a}`)}finally{r.stackRestore(t)}}}),jb,cx=je(()=>{zn(),rc(),jb=e=>{let r=Qt(),t=0,s=[],o=e||{};try{if((e==null?void 0:e.logSeverityLevel)===void 0)o.logSeverityLevel=2;else if(typeof e.logSeverityLevel!="number"||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if((e==null?void 0:e.logVerbosityLevel)===void 0)o.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!="number"||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);(e==null?void 0:e.terminate)===void 0&&(o.terminate=!1);let n=0;return(e==null?void 0:e.tag)!==void 0&&(n=vs(e.tag,s)),t=r._OrtCreateRunOptions(o.logSeverityLevel,o.logVerbosityLevel,!!o.terminate,n),t===0&&Gt("Can't create run options."),(e==null?void 0:e.extra)!==void 0&&pa(e.extra,"",new WeakSet,(i,a)=>{let l=vs(i,s),u=vs(a,s);r._OrtAddRunConfigEntry(t,l,u)!==0&&Gt(`Can't set a run config entry: ${i} - ${a}.`)}),[t,s]}catch(n){throw t!==0&&r._OrtReleaseRunOptions(t),s.forEach(i=>r._free(i)),n}}}),jf,Nf,Vf,jo,Uf,Nb,dx=je(()=>{zn(),rc(),jf=e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}},Nf=e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}},Vf=e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});let r=e.extra.session;r.use_ort_model_bytes_directly||(r.use_ort_model_bytes_directly="1"),e.executionProviders&&e.executionProviders.some(t=>(typeof t=="string"?t:t.name)==="webgpu")&&(e.enableMemPattern=!1)},jo=(e,r,t,s)=>{let o=vs(r,s),n=vs(t,s);Qt()._OrtAddSessionConfigEntry(e,o,n)!==0&&Gt(`Can't set a session config entry: ${r} - ${t}.`)},Uf=async(e,r,t)=>{for(let s of r){let o=typeof s=="string"?s:s.name,n=[];switch(o){case"webnn":if(o="WEBNN",typeof s!="string"){let p=s==null?void 0:s.deviceType;p&&jo(e,"deviceType",p,t)}break;case"webgpu":if(o="JS",typeof s!="string"){let p=s;if(p!=null&&p.preferredLayout){if(p.preferredLayout!=="NCHW"&&p.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${p.preferredLayout}`);jo(e,"preferredLayout",p.preferredLayout,t)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${o}`)}let i=vs(o,t),a=n.length,l=0,u=0;if(a>0){l=Qt()._malloc(a*Qt().PTR_SIZE),t.push(l),u=Qt()._malloc(a*Qt().PTR_SIZE),t.push(u);for(let p=0;p{let r=Qt(),t=0,s=[],o=e||{};Vf(o);try{let n=jf(o.graphOptimizationLevel??"all"),i=Nf(o.executionMode??"sequential"),a=typeof o.logId=="string"?vs(o.logId,s):0,l=o.logSeverityLevel??2;if(!Number.isInteger(l)||l<0||l>4)throw new Error(`log serverity level is not valid: ${l}`);let u=o.logVerbosityLevel??0;if(!Number.isInteger(u)||u<0||u>4)throw new Error(`log verbosity level is not valid: ${u}`);let p=typeof o.optimizedModelFilePath=="string"?vs(o.optimizedModelFilePath,s):0;if(t=r._OrtCreateSessionOptions(n,!!o.enableCpuMemArena,!!o.enableMemPattern,i,!!o.enableProfiling,0,a,l,u,p),t===0&&Gt("Can't create session options."),o.executionProviders&&await Uf(t,o.executionProviders,s),o.enableGraphCapture!==void 0){if(typeof o.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${o.enableGraphCapture}`);jo(t,"enableGraphCapture",o.enableGraphCapture.toString(),s)}if(o.freeDimensionOverrides)for(let[c,d]of Object.entries(o.freeDimensionOverrides)){if(typeof c!="string")throw new Error(`free dimension override name must be a string: ${c}`);if(typeof d!="number"||!Number.isInteger(d)||d<0)throw new Error(`free dimension override value must be a non-negative integer: ${d}`);let _=vs(c,s);r._OrtAddFreeDimensionOverride(t,_,d)!==0&&Gt(`Can't set a free dimension override: ${c} - ${d}.`)}return o.extra!==void 0&&pa(o.extra,"",new WeakSet,(c,d)=>{jo(t,c,d,s)}),[t,s]}catch(n){throw t!==0&&r._OrtReleaseSessionOptions(t)!==0&&Gt("Can't release session options."),s.forEach(i=>r._free(i)),n}}}),to,js,An,sc,ha,nc,oc,Du,ft=je(()=>{to=e=>{switch(e){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"float16":return 10;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;case"int4":return 22;case"uint4":return 21;default:throw new Error(`unsupported data type: ${e}`)}},js=e=>{switch(e){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 10:return"float16";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";case 22:return"int4";case 21:return"uint4";default:throw new Error(`unsupported data type: ${e}`)}},An=(e,r)=>{let t=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],s=typeof r=="number"?r:r.reduce((o,n)=>o*n,1);return t>0?Math.ceil(s*t):void 0},sc=e=>{switch(e){case"float16":return typeof Float16Array<"u"&&Float16Array.from?Float16Array:Uint16Array;case"float32":return Float32Array;case"uint8":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"bool":return Uint8Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}},ha=e=>{switch(e){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${e}`)}},nc=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",oc=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint64"||e==="int8"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",Du=e=>{switch(e){case"none":return 0;case"cpu":return 1;case"cpu-pinned":return 2;case"texture":return 3;case"gpu-buffer":return 4;case"ml-tensor":return 5;default:throw new Error(`unsupported data location: ${e}`)}}}),ic,Vb=je(()=>{Zu(),ic=async e=>{if(typeof e=="string"){let r=await fetch(e);if(!r.ok)throw new Error(`failed to load external data file: ${e}`);let t=r.headers.get("Content-Length"),s=t?parseInt(t,10):0;if(s<1073741824)return new Uint8Array(await r.arrayBuffer());{if(!r.body)throw new Error(`failed to load external data file: ${e}, no response body.`);let o=r.body.getReader(),n;try{n=new ArrayBuffer(s)}catch(a){if(a instanceof RangeError){let l=Math.ceil(s/65536);n=new WebAssembly.Memory({initial:l,maximum:l}).buffer}else throw a}let i=0;for(;;){let{done:a,value:l}=await o.read();if(a)break;let u=l.byteLength;new Uint8Array(n,i,u).set(l),i+=u}return new Uint8Array(n,0,s)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),Wf,Gf,Kf,Hf,ac,qf,It,Ns=je(()=>{ft(),Wf=["V","I","W","E","F"],Gf=(e,r)=>{console.log(`[${Wf[e]},${new Date().toISOString()}]${r}`)},ac=(e,r)=>{Kf=e,Hf=r},qf=(e,r)=>{let t=ha(e),s=ha(Kf);t>=s&&Gf(t,typeof r=="function"?r():r)},It=(...e)=>{Hf&&qf(...e)}}),Qf,no,Me,ma,Ub,Wb,Gb,xt=je(()=>{Qf=class{static calcMatMulShape(e,r){return e[1]!==r[0]?void 0:[e[0],r[1]]}},no=class{static calcShape(e,r,t=!1){let s=e.length,o=r.length;if(s===0)return r;if(o===0)return e;let n=Math.max(e.length,r.length),i=new Array(n);if(t){if(s<2||o<2)return;let a=Qf.calcMatMulShape([e[s-2],e[s-1]],[r[o-2],r[o-1]]);if(a===void 0)return;[i[n-2],i[n-1]]=a}for(let a=t?3:1;a<=n;a++){let l=s-a<0?1:e[s-a],u=o-a<0?1:r[o-a];if(l!==u&&l>1&&u>1)return;let p=Math.max(l,u);if(l&&u)i[n-a]=Math.max(l,u);else{if(p>1)return;i[n-a]=0}}return i}static isValidBroadcast(e,r){let t=e.length,s=r.length;if(t>s)return!1;for(let o=1;o<=t;o++)if(e[t-o]!==1&&e[t-o]!==r[s-o])return!1;return!0}},Me=class ca{static size(r){return ca.getSizeFromDimensionRange(r,0,r.length)}static convertShape(r,t=4){let s=r.length;if(s===0)return[];let o=new Array(s),n=s-1;for(;n>=0;){if(r[n]%t===0){o[n]=r[n]/t;break}if(t%r[n]!==0)throw new Error("cannot convert shape");o[n]=1,t/=r[n],n--}for(n--;n>=0;n--)o[n]=r[n];return o}static sizeFromDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${r.length} dimensions.`);return ca.getSizeFromDimensionRange(r,t,r.length)}static sizeToDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${r.length} dimensions.`);return ca.getSizeFromDimensionRange(r,0,t)}static getSizeFromDimensionRange(r,t,s){let o=1;for(let n=t;n=0;--o)s[o]=s[o+1]*r[o+1];return s}static normalizeAxis(r,t){if(r<-t&&r>=t)throw new Error("unsupported axis for this operation.");return r<0?r+t:r}static normalizeAxes(r,t){return r.map(s=>this.normalizeAxis(s,t??r.length))}static sortBasedOnPerm(r,t){return t?t.map(s=>r[s]):r.slice().reverse()}static padShape(r,t){let s=r.length;return r.map((o,n)=>o+t[n]+t[n+s])}static areEqual(r,t){return r.length!==t.length?!1:r.every((s,o)=>s===t[o])}},ma=class Qo{static adjustPoolAttributes(r,t,s,o,n,i){if(!r&&s.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(r)for(let a=0;a=s.length?s.push(t[a+2]):s[a]=t[a+2];for(let a=0;a=s[a]||i[a+s.length]>=s[a])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(r,t,s,o,n,i,a){if(a){if(n.length!==2*(r.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==r.length-2)throw new Error("length of strides should be the length of data dimensions");if(o.length!==r.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let l=0;l{ft(),lc=(e,r)=>new(sc(r))(e)}),Lu,Kl,Xf,Hl,Jf,ql,Ql,Xl,Yf,Hb,px=je(()=>{Ns(),Lu=(e,r=!0)=>{if(e.byteLength%8!==0)throw new Error("Invalid Uint8Array length - must be a multiple of 8 (BigInt).");let t=e.byteLength/8,s=new BigInt64Array(e.buffer,e.byteOffset,t),o=new Int32Array(t);for(let n=0;n2147483647n||i<-2147483648n)throw new Error(`Overflow occurred when converting BigInt to Int32 at index ${n}: ${i}`);o[n]=Number(i)}return r?new Uint8Array(o.buffer):o},Kl=(e,r=!0)=>{if(e.byteLength%4!==0)throw new Error("Invalid Uint8Array length - must be a multiple of 4 (Int32).");let t=e.byteLength/4,s=new Int32Array(e.buffer,e.byteOffset,t),o=BigInt64Array.from(s,BigInt);return r?new Uint8Array(o.buffer):o},Xf=1,Hl=()=>Xf++,Jf=new Map([["float32",32],["float16",16],["int32",32],["uint32",32],["int64",64],["uint64",64],["int8",8],["uint8",8],["int4",4],["uint4",4]]),ql=(e,r)=>{let t=Jf.get(e);if(!t)throw new Error("Unsupported data type.");return r.length>0?Math.ceil(r.reduce((s,o)=>s*o)*t/8):0},Ql=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:r,context:t,tensor:s,dataType:o,shape:n,shouldConvertInt64toInt32:i=!1}=e;this.sessionId=r,this.mlContext=t,this.mlTensor=s,this.dataType=o,this.tensorShape=n,this.shouldConvertInt64toInt32=i}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return ql(this.dataType,this.tensorShape)}destroy(){It("verbose",()=>"[WebNN] TensorWrapper.destroy"),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,r){if(e){let t=await this.mlContext.readTensor(this.mlTensor),s=Kl(new Uint8Array(t));if(r){(r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).set(s);return}else return s.buffer}else return r?this.mlContext.readTensor(this.mlTensor,r):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,r,t){return this.mlContext===e&&this.dataType===r&&this.tensorShape.length===t.length&&this.tensorShape.every((s,o)=>s===t[o])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},Xl=class{constructor(e,r){this.tensorManager=e,this.wrapper=r}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,r,t,s){let o=r,n=this.tensorManager.getMLContext(e),i=o==="int64"&&!n.opSupportLimits().input.dataTypes.includes("int64");if(i&&(o="int32",It("verbose",()=>"[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32")),this.wrapper){if(this.wrapper.canReuseTensor(n,o,t))return this.wrapper.tensor;if(s){if(this.wrapper.byteLength!==ql(o,t))throw new Error("Unable to copy data to tensor with different size.");this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let a=typeof MLTensorUsage>"u"?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,o,t,a,!0,!0,i),s&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let r=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(r=Lu(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),r.byteLength===this.wrapper.byteLength){this.wrapper.write(r);return}else It("verbose",()=>"Data size does not match tensor size. Releasing tensor."),this.releaseTensor();this.activeUpload?this.activeUpload.set(r):this.activeUpload=new Uint8Array(r)}async download(e){var r,t,s;if(this.activeUpload){let o=(r=this.wrapper)!=null&&r.isInt64ToInt32Converted?Kl(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(o):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(o);return}else return o.buffer}if(!this.wrapper)throw new Error("Tensor has not been created.");return e?this.wrapper.read((t=this.wrapper)==null?void 0:t.shouldConvertInt64toInt32,e):this.wrapper.read((s=this.wrapper)==null?void 0:s.shouldConvertInt64toInt32)}},Yf=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let r=this.backend.getMLContext(e);if(!r)throw new Error("MLContext not found for session.");return r}reserveTensorId(){let e=Hl();return this.tensorTrackersById.set(e,new Xl(this)),e}releaseTensorId(e){let r=this.tensorTrackersById.get(e);r&&(this.tensorTrackersById.delete(e),r.tensorWrapper&&this.releaseTensor(r.tensorWrapper))}async ensureTensor(e,r,t,s,o){It("verbose",()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${r}, dataType: ${t}, shape: ${s}, copyOld: ${o}}`);let n=this.tensorTrackersById.get(r);if(!n)throw new Error("Tensor not found.");return n.ensureTensor(e,t,s,o)}upload(e,r){let t=this.tensorTrackersById.get(e);if(!t)throw new Error("Tensor not found.");t.upload(r)}async download(e,r){It("verbose",()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${r==null?void 0:r.byteLength}}`);let t=this.tensorTrackersById.get(e);if(!t)throw new Error("Tensor not found.");return t.download(r)}releaseTensorsForSession(e){for(let r of this.freeTensors)r.sessionId===e&&r.destroy();this.freeTensors=this.freeTensors.filter(r=>r.sessionId!==e)}registerTensor(e,r,t,s){let o=this.getMLContext(e),n=Hl(),i=new Ql({sessionId:e,context:o,tensor:r,dataType:t,shape:s});return this.tensorTrackersById.set(n,new Xl(this,i)),this.externalTensors.add(i),n}async getCachedTensor(e,r,t,s,o,n,i=!1){let a=this.getMLContext(e);for(let[u,p]of this.freeTensors.entries())if(p.canReuseTensor(a,r,t)){It("verbose",()=>`[WebNN] Reusing tensor {dataType: ${r}, shape: ${t}}`);let c=this.freeTensors.splice(u,1)[0];return c.sessionId=e,c}It("verbose",()=>`[WebNN] MLContext.createTensor {dataType: ${r}, shape: ${t}}`);let l=await a.createTensor({dataType:r,shape:t,dimensions:t,usage:s,writable:o,readable:n});return new Ql({sessionId:e,context:a,tensor:l,dataType:r,shape:t,shouldConvertInt64toInt32:i})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},Hb=(...e)=>new Yf(...e)}),Ji,Zf,qb,hx=je(()=>{ft(),zn(),Kb(),px(),Ns(),Ji=new Map([[1,"float32"],[10,"float16"],[6,"int32"],[12,"uint32"],[7,"int64"],[13,"uint64"],[22,"int4"],[21,"uint4"],[3,"int8"],[2,"uint8"],[9,"uint8"]]),Zf=(e,r)=>{if(e===r)return!0;if(e===void 0||r===void 0)return!1;let t=Object.keys(e).sort(),s=Object.keys(r).sort();return t.length===s.length&&t.every((o,n)=>o===s[n]&&e[o]===r[o])},qb=class{constructor(e){this.tensorManager=Hb(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,ac(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw new Error("No active session");return this.activeSessionId}onRunStart(e){It("verbose",()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){It("verbose",()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let r=this.temporarySessionTensorIds.get(e);if(r){for(let t of r)It("verbose",()=>`[WebNN] releasing temporary tensor {tensorId: ${t}}`),this.tensorManager.releaseTensorId(t);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(s=>s.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let s=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:s}),s}}else if(e===void 0){let t=this.mlContextCache.findIndex(s=>s.options===void 0&&s.gpuDevice===void 0);if(t!==-1)return this.mlContextCache[t].mlContext;{let s=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:s}),s}}let r=this.mlContextCache.findIndex(t=>Zf(t.options,e));if(r!==-1)return this.mlContextCache[r].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,r){this.mlContextBySessionId.set(e,r);let t=this.sessionIdsByMLContext.get(r);t||(t=new Set,this.sessionIdsByMLContext.set(r,t)),t.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let r=this.mlContextBySessionId.get(e);if(!r)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let t=this.sessionIdsByMLContext.get(r);if(t.delete(e),t.size===0){this.sessionIdsByMLContext.delete(r);let s=this.mlContextCache.findIndex(o=>o.mlContext===r);s!==-1&&this.mlContextCache.splice(s,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){It("verbose",()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,r,t,s,o){let n=Ji.get(t);if(!n)throw new Error(`Unsupported ONNX data type: ${t}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,r,n,s,o)}async createTemporaryTensor(e,r,t){It("verbose",()=>`[WebNN] createTemporaryTensor {onnxDataType: ${r}, shape: ${t}}`);let s=Ji.get(r);if(!s)throw new Error(`Unsupported ONNX data type: ${r}`);let o=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,o,s,t,!1);let n=this.temporarySessionTensorIds.get(e);return n?n.push(o):this.temporarySessionTensorIds.set(e,[o]),o}uploadTensor(e,r){if(!Qt().shouldTransferToMLTensor)throw new Error("Trying to upload to a MLTensor while shouldTransferToMLTensor is false");It("verbose",()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${r.byteLength}}`),this.tensorManager.upload(e,r)}async downloadTensor(e,r){return this.tensorManager.download(e,r)}createMLTensorDownloader(e,r){return async()=>{let t=await this.tensorManager.download(e);return lc(t,r)}}registerMLTensor(e,r,t,s){let o=Ji.get(t);if(!o)throw new Error(`Unsupported ONNX data type: ${t}`);let n=this.tensorManager.registerTensor(e,r,o,s);return It("verbose",()=>`[WebNN] registerMLTensor {tensor: ${r}, dataType: ${o}, dimensions: ${s}} -> {tensorId: ${n}}`),n}registerMLConstant(e,r,t,s,o,n,i=!1){if(!n)throw new Error("External mounted files are not available.");let a=e;e.startsWith("./")&&(a=e.substring(2));let l=n.get(a);if(!l)throw new Error(`File with name ${a} not found in preloaded files.`);if(r+t>l.byteLength)throw new Error("Out of bounds: data offset and length exceed the external file data size.");let u=l.slice(r,r+t).buffer,p;switch(o.dataType){case"float32":p=new Float32Array(u);break;case"float16":p=typeof Float16Array<"u"&&Float16Array.from?new Float16Array(u):new Uint16Array(u);break;case"int32":p=new Int32Array(u);break;case"uint32":p=new Uint32Array(u);break;case"int64":i?(p=Lu(new Uint8Array(u),!1),o.dataType="int32"):p=new BigInt64Array(u);break;case"uint64":p=new BigUint64Array(u);break;case"int8":p=new Int8Array(u);break;case"int4":case"uint4":case"uint8":p=new Uint8Array(u);break;default:throw new Error(`Unsupported data type: ${o.dataType} in creating WebNN Constant from external data.`)}return It("verbose",()=>`[WebNN] registerMLConstant {dataType: ${o.dataType}, shape: ${o.shape}}} ${i?"(Note: it was int64 data type and registered to int32 as workaround)":""}`),s.constant(o,p)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,r){let t=this.sessionGraphInputs.get(e);return t?t.includes(r):!1}isInt64Supported(e){var r;return!!((r=this.mlContextBySessionId.get(e))!=null&&r.opSupportLimits().input.dataTypes.includes("int64"))}flush(){}}}),uc=je(()=>{}),Jl,Yi,Zi,e_,t_,Yl,zu,r_,Qb,mx=je(()=>{Ns(),uc(),Jl=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),Yi=[],Zi=e=>Math.ceil(Number(e)/16)*16,e_=e=>{for(let r=0;rt_++,zu=async(e,r,t,s)=>{let o=Zi(t),n=e.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let i=e.getCommandEncoder();e.endComputePass(),i.copyBufferToBuffer(r,0,n,0,o),e.flush(),await n.mapAsync(GPUMapMode.READ);let a=n.getMappedRange();if(s){let l=s();return l.set(new Uint8Array(a,0,t)),l}else return new Uint8Array(a.slice(0,t))}finally{n.destroy()}},r_=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[r]of Jl)Yi.push(r),this.freeBuffers.set(r,[]),this.freeUniformBuffers.set(r,[]);this.sessionCount=0}upload(e,r){let t=r.buffer,s=r.byteOffset,o=r.byteLength,n=Zi(o),i=this.storageCache.get(e);if(!i)throw new Error("gpu data for uploading does not exist");if(Number(i.originalSize)!==o)throw new Error(`inconsistent data size. gpu data size=${i.originalSize}, data size=${o}`);let a=this.backend.device.createBuffer({mappedAtCreation:!0,size:n,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),l=a.getMappedRange();new Uint8Array(l).set(new Uint8Array(t,s,o)),a.unmap();let u=this.backend.device.createCommandEncoder();u.copyBufferToBuffer(a,0,i.gpuData.buffer,0,n),this.backend.device.queue.submit([u.finish()]),a.destroy(),It("verbose",()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,r){let t=this.storageCache.get(e);if(!t)throw new Error("source gpu data for memcpy does not exist");let s=this.storageCache.get(r);if(!s)throw new Error("destination gpu data for memcpy does not exist");if(t.originalSize!==s.originalSize)throw new Error("inconsistent source and destination gpu data size");let o=Zi(t.originalSize),n=this.backend.getCommandEncoder();this.backend.endComputePass(),n.copyBufferToBuffer(t.gpuData.buffer,0,s.gpuData.buffer,0,o)}registerExternalBuffer(e,r,t){let s;if(t){if(s=t[0],e===t[1])return It("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${s}, buffer is the same, skip.`),s;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw new Error(`Registering a different external buffer under graph capture mode is not supported yet. - Please use the previous external buffer!`)}else s=Yl();return this.storageCache.set(s,{gpuData:{id:s,type:0,buffer:e},originalSize:r}),It("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${s}, registered.`),s}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),It("verbose",()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,r=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let t=e_(e),s,o=(r&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,n=(r&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(o||n){let a=(o?this.freeBuffers:this.freeUniformBuffers).get(t);a?a.length>0?s=a.pop():s=this.backend.device.createBuffer({size:t,usage:r}):s=this.backend.device.createBuffer({size:t,usage:r})}else s=this.backend.device.createBuffer({size:t,usage:r});let i={id:Yl(),type:0,buffer:s};return this.storageCache.set(i.id,{gpuData:i,originalSize:Number(e)}),It("verbose",()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${i.id}`),i}get(e){var r;return(r=this.storageCache.get(e))==null?void 0:r.gpuData}release(e){let r=typeof e=="bigint"?Number(e):e,t=this.storageCache.get(r);if(!t){if(this.storageCache.size===0)return 0;throw new Error("releasing data does not exist")}return It("verbose",()=>`[WebGPU] GpuDataManager.release(id=${r}), gpuDataId=${t.gpuData.id}`),this.storageCache.delete(r),this.buffersPending.push(t.gpuData.buffer),t.originalSize}async download(e,r){let t=this.storageCache.get(Number(e));if(!t)throw new Error("data does not exist");await zu(this.backend,t.gpuData.buffer,t.originalSize,r)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus==="default"){for(let e of this.buffersPending){let r=Jl.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let t=this.freeBuffers.get(e.size)||[];r===void 0||t.length>=r?e.destroy():t.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let t=this.freeUniformBuffers.get(e.size)||[];r===void 0||t.length>=r?e.destroy():t.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let r of this.buffersPending)e.push(r);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let r=this.capturedPendingBuffers.get(e);r&&(r.forEach(t=>{t.destroy()}),this.capturedPendingBuffers.delete(e)),this.sessionCount-=1,this.sessionCount===0&&(It("warning",()=>"[WebGPU] Clearing webgpu buffer cache"),this.storageCache.forEach(t=>{t.gpuData.buffer.destroy()}),this.storageCache=new Map)}},Qb=(...e)=>new r_(...e)}),s_,Nt,lr=je(()=>{s_=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||(this.key=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(";")),this.key}},Nt=e=>new s_(e)}),oo,ea,$r,Rr,ut,nr,Bu,so,en,ot,No,Ce,tt,Xb,cc,n_,Jb,Tt=je(()=>{ft(),xt(),oo=64,ea=(e,r)=>{if(r===3)throw new Error("vec3 has same alignment as vec4, use vec4 instead");switch(Number(e)){case 10:return r>1?`vec${r}`:"f16";case 1:return r>1?`vec${r}`:"f32";case 6:return r>1?`vec${r}`:"i32";case 12:return r>1?`vec${r}`:"u32";case 7:if(r>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2","i32"];case 13:if(r>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2","u32"];case 9:if(r!==4)throw new Error("bool must be vec4");return["u32","vec4"];case 22:return"i32";case 21:return"u32";default:throw new Error(`Unknown data type: ${e}`)}},$r=(e,r=1)=>{let t=ea(e,r);return typeof t=="string"?t:t[0]},Rr=(e,r=1)=>{let t=ea(e,r);return typeof t=="string"?t:t[1]},ut=(...e)=>{let r=[];return e.forEach(t=>{t.length!==0&&r.push({type:12,data:t},{type:12,data:Me.computeStrides(t)})}),r},nr=e=>e%4===0?4:e%2===0?2:1,Bu=(e="f32",r,t="0")=>!r||r===1?`${e}(${t})`:`vec${r}<${e}>(${t})`,so=(e,r,t)=>e==="f32"?t:r===1?`f32(${t})`:`vec${r}(${t})`,en=(e,r)=>r===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:r===2?`(${e}.x + ${e}.y)`:r===3?`(${e}.x + ${e}.y + ${e}.z)`:e,ot=(e,r,t,s)=>e.startsWith("uniforms.")&&t>4?typeof r=="string"?s==="f16"?`${e}[(${r}) / 8][(${r}) % 8 / 4][(${r}) % 8 % 4]`:`${e}[(${r}) / 4][(${r}) % 4]`:s==="f16"?`${e}[${Math.floor(r/8)}][${Math.floor(r%8/4)}][${r%8%4}]`:`${e}[${Math.floor(r/4)}][${r%4}]`:t>1?`${e}[${r}]`:e,No=(e,r,t,s,o)=>{let n=typeof t=="number",i=n?t:t.length,a=[...new Array(i).keys()],l=i<2?"u32":i<=4?`vec${i}`:`array`,u=ea(r,o),p=typeof u=="string"?u:u[1],c=typeof u=="string"?u:u[0],d={indices:l,value:p,storage:c,tensor:r},_=V=>typeof V=="string"?V:`${V}u`,f={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},v=n?"uniforms.":"",$=`${v}${e}_shape`,g=`${v}${e}_strides`,w="";for(let V=0;V ${d.indices} { - var indices: ${d.indices}; - var current = offset; - ${w} - return indices; - }`,E=V=>(f.offsetToIndices=!0,i<2?V:`o2i_${e}(${V})`),x=[];if(i>=2)for(let V=i-1;V>=0;V--)x.push(`${ot(g,V,i)} * (indices[${V}])`);let b=i<2?"":` - fn i2o_${e}(indices: ${d.indices}) -> u32 { - return ${x.join("+")}; - }`,y=V=>(f.indicesToOffset=!0,i<2?V:`i2o_${e}(${V})`),S=(...V)=>i===0?"0u":`${d.indices}(${V.map(_).join(",")})`,F=(V,A)=>i<2?`${V}`:`${ot(V,A,i)}`,z=(V,A,U)=>i<2?`${V}=${U};`:`${ot(V,A,i)}=${U};`,K={},q=(V,A)=>{f.broadcastedIndicesToOffset=!0;let U=`${A.name}broadcastedIndicesTo${e}Offset`;if(U in K)return`${U}(${V})`;let ee=[];for(let _e=i-1;_e>=0;_e--){let le=A.indicesGet("outputIndices",_e+A.rank-i);ee.push(`${F(g,_e)} * (${le} % ${F($,_e)})`)}return K[U]=`fn ${U}(outputIndices: ${A.type.indices}) -> u32 { - return ${ee.length>0?ee.join("+"):"0u"}; - }`,`${U}(${V})`},R=(V,A)=>(()=>{if(d.storage===d.value)return`${e}[${V}]=${A};`;if(d.storage==="vec2"&&d.value==="i32")return`${e}[${V}]=vec2(u32(${A}), select(0u, 0xFFFFFFFFu, ${A} < 0));`;if(d.storage==="vec2"&&d.value==="u32")return`${e}[${V}]=vec2(u32(${A}), 0u);`;if(d.storage==="u32"&&d.value==="vec4")return`${e}[${V}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${A}));`;throw new Error(`not supported combination of storage type ${d.storage} and value type ${d.value} yet`)})(),Z=V=>(()=>{if(d.storage===d.value)return`${e}[${V}]`;if(d.storage==="vec2"&&d.value==="i32")return`i32(${e}[${V}].x)`;if(d.storage==="vec2"&&d.value==="u32")return`u32(${e}[${V}].x)`;if(d.storage==="u32"&&d.value==="vec4")return`vec4(bool(${e}[${V}] & 0xFFu), bool(${e}[${V}] & 0xFF00u), bool(${e}[${V}] & 0xFF0000u), bool(${e}[${V}] & 0xFF000000u))`;throw new Error(`not supported combination of storage type ${d.storage} and value type ${d.value} yet`)})(),H=i<2?"":` - fn get_${e}ByIndices(indices: ${d.indices}) -> ${p} { - return ${Z(`i2o_${e}(indices)`)}; - }`,J=i<2?"":(()=>{let V=a.map(U=>`d${U}: u32`).join(", "),A=a.map(U=>`d${U}`).join(", ");return` - fn get_${e}(${V}) -> ${p} { - return get_${e}ByIndices(${S(A)}); - }`})(),Q=(...V)=>{if(V.length!==i)throw new Error(`indices length must be ${i}`);let A=V.map(_).join(",");return i===0?Z("0u"):i===1?Z(A[0]):(f.get=!0,f.getByIndices=!0,f.indicesToOffset=!0,`get_${e}(${A})`)},se=V=>i<2?Z(V):(f.getByIndices=!0,f.indicesToOffset=!0,`get_${e}ByIndices(${V})`),fe=i<2?"":` - fn set_${e}ByIndices(indices: ${d.indices}, value: ${p}) { - ${R(`i2o_${e}(indices)`,"value")} - }`,ae=i<2?"":(()=>{let V=a.map(U=>`d${U}: u32`).join(", "),A=a.map(U=>`d${U}`).join(", ");return` - fn set_${e}(${V}, value: ${p}) { - set_${e}ByIndices(${S(A)}, value); - }`})();return{impl:()=>{let V=[],A=!1;return f.offsetToIndices&&(V.push(C),A=!0),f.indicesToOffset&&(V.push(b),A=!0),f.broadcastedIndicesToOffset&&(Object.values(K).forEach(U=>V.push(U)),A=!0),f.set&&(V.push(ae),A=!0),f.setByIndices&&(V.push(fe),A=!0),f.get&&(V.push(J),A=!0),f.getByIndices&&(V.push(H),A=!0),!n&&A&&V.unshift(`const ${$} = ${d.indices}(${t.join(",")});`,`const ${g} = ${d.indices}(${Me.computeStrides(t).join(",")});`),V.join(` -`)},type:d,offsetToIndices:E,indicesToOffset:y,broadcastedIndicesToOffset:q,indices:S,indicesGet:F,indicesSet:z,set:(...V)=>{if(V.length!==i+1)throw new Error(`indices length must be ${i}`);let A=V[i];if(typeof A!="string")throw new Error("value must be string");let U=V.slice(0,i).map(_).join(",");return i===0?R("0u",A):i===1?R(U[0],A):(f.set=!0,f.setByIndices=!0,f.indicesToOffset=!0,`set_${e}(${U}, ${A})`)},setByOffset:R,setByIndices:(V,A)=>i<2?R(V,A):(f.setByIndices=!0,f.indicesToOffset=!0,`set_${e}ByIndices(${V}, ${A});`),get:Q,getByOffset:Z,getByIndices:se,usage:s,name:e,strides:g,shape:$,rank:i}},Ce=(e,r,t,s=1)=>No(e,r,t,"input",s),tt=(e,r,t,s=1)=>No(e,r,t,"output",s),Xb=(e,r,t)=>No(e,r,t,"atomicOutput",1),cc=(e,r,t,s=1)=>No(e,r,t,"internal",s),n_=class{constructor(e,r){this.normalizedDispatchGroup=e,this.limits=r,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e=="number"?`${e}u`:e}) { return; }`}mainStart(e=oo){let r=typeof e=="number"?e:e[0],t=typeof e=="number"?1:e[1],s=typeof e=="number"?1:e[2];if(r>this.limits.maxComputeWorkgroupSizeX||t>this.limits.maxComputeWorkgroupSizeY||s>this.limits.maxComputeWorkgroupSizeZ)throw new Error(`workgroup size [${r}, ${t}, ${s}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(r*t*s>this.limits.maxComputeInvocationsPerWorkgroup)throw new Error(`workgroup size [${r}, ${t}, ${s}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let o=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,n=o?`@builtin(global_invocation_id) global_id : vec3, - @builtin(workgroup_id) workgroup_id : vec3, - @builtin(local_invocation_index) local_idx : u32, - @builtin(local_invocation_id) local_id : vec3`:`@builtin(global_invocation_id) global_id : vec3, - @builtin(local_invocation_id) local_id : vec3, - @builtin(local_invocation_index) local_idx : u32, - @builtin(workgroup_id) workgroup_id : vec3, - @builtin(num_workgroups) num_workgroups : vec3`,i=o?`let global_idx = global_id.x; - let workgroup_index = workgroup_id.x;`:`let workgroup_index = workgroup_id.z * num_workgroups[0] * num_workgroups[1] + - workgroup_id.y * num_workgroups[0] + workgroup_id.x; - let global_idx = workgroup_index * ${r*t*s}u + local_idx;`;return`@compute @workgroup_size(${r}, ${t}, ${s}) - fn main(${n}) { - ${i} - `}appendVariableUniforms(e){e.rank!==0&&(e.shape.startsWith("uniforms.")&&this.uniforms.push({name:e.shape.replace("uniforms.",""),type:"u32",length:e.rank}),e.strides.startsWith("uniforms.")&&this.uniforms.push({name:e.strides.replace("uniforms.",""),type:"u32",length:e.rank}))}declareVariable(e,r){if(e.usage==="internal")throw new Error("cannot use internal variable with declareVariable(). use registerInternalVariables() instead.");this.variables.push(e),this.appendVariableUniforms(e);let t=e.usage==="input"?"read":"read_write",s=e.usage==="atomicOutput"?"atomic":e.type.storage;return`@group(0) @binding(${r}) var ${e.name}: array<${s}>;`}declareVariables(...e){return e.map(r=>this.declareVariable(r,this.variableIndex++)).join(` -`)}registerInternalVariable(e){if(e.usage!=="internal")throw new Error("cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.");this.internalVariables.push(e),this.appendVariableUniforms(e)}registerInternalVariables(...e){return e.forEach(r=>this.registerInternalVariable(r)),this}registerUniform(e,r,t=1){return this.uniforms.push({name:e,type:r,length:t}),this}registerUniforms(e){return this.uniforms=this.uniforms.concat(e),this}uniformDeclaration(){if(this.uniforms.length===0)return"";let e=[];for(let{name:r,type:t,length:s}of this.uniforms)if(s&&s>4)t==="f16"?e.push(`@align(16) ${r}:array, ${Math.ceil(s/8)}>`):e.push(`${r}:array, ${Math.ceil(s/4)}>`);else{let o=s==null||s===1?t:`vec${s}<${t}>`;e.push(`${r}:${o}`)}return` - struct Uniforms { ${e.join(", ")} }; - @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(e=>e.impl()).join(` -`)+this.internalVariables.map(e=>e.impl()).join(` -`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=r=>[12,10,1,6][["u32","f16","f32","i32"].indexOf(r)];return this.uniforms.map(r=>[e(r.type),r.length??1])}},Jb=(e,r)=>new n_(e,r)}),o_,Zl,i_,a_,l_,u_,Yr,Yb,Zb,tn=je(()=>{ft(),xt(),lr(),Tt(),o_=(e,r)=>{if(!e||e.length!==1)throw new Error("Transpose requires 1 input.");if(r.length!==0&&r.length!==e[0].dims.length)throw new Error(`perm size ${r.length} does not match input rank ${e[0].dims.length}`)},Zl=(e,r)=>r.length!==0?r:[...new Array(e).keys()].reverse(),i_=(e,r)=>Me.sortBasedOnPerm(e,Zl(e.length,r)),a_=(e,r,t,s)=>{let o=`fn perm(i: ${s.type.indices}) -> ${t.type.indices} { - var a: ${t.type.indices};`;for(let n=0;n{let t=[],s=[];for(let o=0;o{let t=0;for(let s=0;s{let t=e.dataType,s=e.dims.length,o=Zl(s,r),n=i_(e.dims,o),i=e.dims,a=n,l=s<2||u_(o,e.dims),u;if(l)return u=f=>{let v=Ce("input",t,i,4),$=tt("output",t,a,4);return` - ${f.registerUniform("output_size","u32").declareVariables(v,$)} - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - output[global_idx] = input[global_idx]; - }`},{name:"TransposeCopy",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let f=Me.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64/4)},programUniforms:[{type:12,data:Math.ceil(f/4)}]}},getShaderSource:u};let{newShape:p,newPerm:c}=l_(e.dims,o),d=Me.areEqual(c,[2,3,1]),_=Me.areEqual(c,[3,1,2]);if(p.length===2||d||_){i=d?[p[0],p[1]*p[2]]:_?[p[0]*p[1],p[2]]:p,a=[i[1],i[0]];let f=16;return u=v=>{let $=Ce("a",t,i.length),g=tt("output",t,a.length);return` - ${v.registerUniform("output_size","u32").declareVariables($,g)} - var tile : array, ${f}>; - ${v.mainStart([f,f,1])} - let stride = (uniforms.output_shape[1] - 1) / ${f} + 1; - let workgroup_id_x = workgroup_index % stride; - let workgroup_id_y = workgroup_index / stride; - let input_col = workgroup_id_y * ${f}u + local_id.x; - let input_row = workgroup_id_x * ${f}u + local_id.y; - if (input_row < uniforms.a_shape[0] && input_col < uniforms.a_shape[1]) { - tile[local_id.y][local_id.x] = ${$.getByIndices(`${$.type.indices}(input_row, input_col)`)}; - } - workgroupBarrier(); - - let output_col = workgroup_id_x * ${f}u + local_id.x; - let output_row = workgroup_id_y * ${f}u + local_id.y; - if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) { - ${g.setByIndices(`${g.type.indices}(output_row, output_col)`,"tile[local_id.x][local_id.y]")} - } - }`},{name:"TransposeShared",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let v=Me.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(a[1]/f),y:Math.ceil(a[0]/f)},programUniforms:[{type:12,data:v},...ut(i,a)]}},getShaderSource:u}}return u=f=>{let v=Ce("a",t,i.length),$=tt("output",t,a.length);return` - ${f.registerUniform("output_size","u32").declareVariables(v,$)} - - ${a_(o,s,v,$)} - - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let indices = ${$.offsetToIndices("global_idx")}; - let aIndices = perm(indices); - - ${$.setByOffset("global_idx",v.getByIndices("aIndices"))} - }`},{name:"Transpose",shaderCache:{hint:`${r}`,inputDependencies:["rank"]},getRunData:()=>{let f=Me.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},...ut(i,a)]}},getShaderSource:u}},Yb=(e,r)=>{o_(e.inputs,r.perm),e.compute(Yr(e.inputs[0],r.perm))},Zb=e=>Nt({perm:e.perm})}),c_,d_,p_,h_,m_,f_,__,g_,w_,b_,gs,eM,tM,rM,sM,nM,oM,iM,aM,lM,uM,fx=je(()=>{ft(),xt(),Tt(),dc(),tn(),c_={max:"select(bestValue, candidate, candidate > bestValue)",min:"select(bestValue, candidate, candidate < bestValue)",mean:"bestValue + candidate",sum:"bestValue + candidate",prod:"bestValue * candidate",sumSquare:"bestValue + candidate * candidate",logSumExp:"bestValue + exp(candidate)",l1:"bestValue + abs(candidate)",l2:"bestValue + candidate * candidate",logSum:"bestValue + candidate"},d_={max:"select(bestValue, candidate, candidate > bestValue)",min:"select(bestValue, candidate, candidate < bestValue)",mean:"bestValue + candidate",sum:"bestValue + candidate",prod:"bestValue * candidate",sumSquare:"bestValue + candidate",logSumExp:"bestValue + candidate",l1:"bestValue + candidate",l2:"bestValue + candidate",logSum:"bestValue + candidate"},p_={max:"_A[offset]",min:"_A[offset]",mean:"0",sum:"0",prod:"1",sumSquare:"0",logSumExp:"0",l1:"0",l2:"0",logSum:"0"},h_={max:"bestValue",min:"bestValue",sum:"bestValue",prod:"bestValue",sumSquare:"bestValue",logSumExp:"log(bestValue)",l1:"bestValue",l2:"sqrt(bestValue)",logSum:"log(bestValue)"},m_=(e,r)=>{let t=[];for(let s=r-e;s{let t=[],s=e.length;for(let n=0;ne[n]);return[t,o]},__=(e,r)=>{let t=e.length+r.length,s=[],o=0;for(let n=0;n{for(let t=0;t{let t=[];if(!g_(e,r)){for(let s=0;st.push(s))}return t},b_=(e,r,t,s,o,n,i)=>{let a=t[0].dims,l=Me.size(n),u=Me.size(i),p=Ce("_A",t[0].dataType,a),c=tt("output",o,n),d=64;l===1&&(d=256);let _=` - var aBestValues : array; - `,f=v=>` - ${v.registerUniform("reduceSize","u32").declareVariables(p,c)} - ${_} - fn DIV_CEIL(a : u32, b : u32) -> u32 { - return ((a - 1u) / b + 1u); - } - ${v.mainStart(d)} - - let outputIndex = global_idx / ${d}; - let offset = outputIndex * uniforms.reduceSize; - - var bestValue = f32(${p_[s]}); - let Length = uniforms.reduceSize; - for (var k = local_idx; k < Length; k = k + ${d}) { - let candidate = f32(${p.getByOffset("offset + k")}); - bestValue = ${c_[s]}; - } - aBestValues[local_idx] = bestValue; - workgroupBarrier(); - - var reduceSize = min(Length, ${d}u); - for (var currentSize = reduceSize / 2u; reduceSize > 1u; - currentSize = reduceSize / 2u) { - let interval = DIV_CEIL(reduceSize, 2u); - if (local_idx < currentSize) { - let candidate = aBestValues[local_idx + interval]; - bestValue = ${d_[s]}; - aBestValues[local_idx] = bestValue; - } - reduceSize = interval; - workgroupBarrier(); - } - - if (local_idx == 0u) { - ${c.setByOffset("outputIndex",`${s==="mean"?`${c.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${c.type.storage}(${h_[s]})`}`)}; - } - }`;return{name:e,shaderCache:{hint:`${r};${d}`,inputDependencies:["type"]},getShaderSource:f,getRunData:()=>({outputs:[{dims:n,dataType:o}],dispatchGroup:{x:l},programUniforms:[{type:12,data:u}]})}},gs=(e,r,t,s)=>{let o=e.inputs.length===1?t:Ru(e.inputs,t),n=o.axes;n.length===0&&!o.noopWithEmptyAxes&&(n=e.inputs[0].dims.map((_,f)=>f));let i=Me.normalizeAxes(n,e.inputs[0].dims.length),a=i,l=e.inputs[0],u=w_(a,e.inputs[0].dims.length);u.length>0&&(l=e.compute(Yr(e.inputs[0],u),{inputs:[0],outputs:[-1]})[0],a=m_(a.length,l.dims.length));let[p,c]=f_(l.dims,a),d=p;o.keepDims&&(d=__(p,i)),e.compute(b_(r,o.cacheKey,[l],s,e.inputs[0].dataType,d,c),{inputs:[l]})},eM=(e,r)=>{gs(e,"ReduceMeanShared",r,"mean")},tM=(e,r)=>{gs(e,"ReduceL1Shared",r,"l1")},rM=(e,r)=>{gs(e,"ReduceL2Shared",r,"l2")},sM=(e,r)=>{gs(e,"ReduceLogSumExpShared",r,"logSumExp")},nM=(e,r)=>{gs(e,"ReduceMaxShared",r,"max")},oM=(e,r)=>{gs(e,"ReduceMinShared",r,"min")},iM=(e,r)=>{gs(e,"ReduceProdShared",r,"prod")},aM=(e,r)=>{gs(e,"ReduceSumShared",r,"sum")},lM=(e,r)=>{gs(e,"ReduceSumSquareShared",r,"sumSquare")},uM=(e,r)=>{gs(e,"ReduceLogSumShared",r,"logSum")}}),ws,M_,fa,Ru,bs,y_,v_,x_,T_,E_,P_,C_,S_,$_,k_,Ms,cM,dM,pM,hM,mM,fM,_M,gM,wM,bM,dc=je(()=>{ft(),xt(),lr(),Tt(),fx(),ws=e=>{if(!e||e.length===0||e.length>2)throw new Error("Reduce op requires 1 or 2 inputs.");if(e.length===2&&e[1].dims.length!==1)throw new Error("Invalid axes input dims.")},M_=e=>["","",`var value = ${e.getByIndices("input_indices")};`,""],fa=(e,r,t,s,o,n,i=!1,a=!1)=>{let l=[],u=t[0].dims,p=u.length,c=Me.normalizeAxes(o,p),d=!a&&c.length===0;u.forEach((v,$)=>{d||c.indexOf($)>=0?i&&l.push(1):l.push(v)});let _=l.length,f=Me.size(l);return{name:e,shaderCache:r,getShaderSource:v=>{let $=[],g=Ce("_A",t[0].dataType,p),w=tt("output",n,_),C=s(g,w,c),E=C[2];for(let x=0,b=0;x=0?(i&&b++,E=`for(var j${x}: u32 = 0; j${x} < ${u[x]}; j${x}++) { - ${C[2].includes("last_index")?`let last_index = j${x};`:""} - ${g.indicesSet("input_indices",x,`j${x}`)} - ${E} - }`):($.push(`${g.indicesSet("input_indices",x,w.indicesGet("output_indices",b))};`),b++);return` - - ${v.registerUniform("output_size","u32").declareVariables(g,w)} - - ${v.mainStart()} - ${v.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - var input_indices: ${g.type.indices}; - let output_indices = ${w.offsetToIndices("global_idx")}; - - ${$.join(` -`)} - ${C[0]} // init ops for reduce max/min - ${C[1]} - ${E} - ${C[3]} - ${C.length===4?w.setByOffset("global_idx","value"):C.slice(4).join(` -`)} - }`},getRunData:()=>({outputs:[{dims:l,dataType:n}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},...ut(u,l)]})}},Ru=(e,r)=>{let t=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(s=>t.push(Number(s))),Nt({axes:t,keepDims:r.keepDims,noopWithEmptyAxes:r.noopWithEmptyAxes})},bs=(e,r,t,s)=>{let o=e.inputs,n=o.length===1?t:Ru(o,t);e.compute(fa(r,{hint:n.cacheKey,inputDependencies:["rank"]},[o[0]],n.noopWithEmptyAxes&&n.axes.length===0?M_:s,n.axes,o[0].dataType,n.keepDims,n.noopWithEmptyAxes),{inputs:[0]})},y_=(e,r)=>{ws(e.inputs),bs(e,"ReduceLogSum",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += ${t.getByIndices("input_indices")};`,"value = log(value);"])},v_=(e,r)=>{ws(e.inputs),bs(e,"ReduceL1",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += abs(${t.getByIndices("input_indices")});`,""])},x_=(e,r)=>{ws(e.inputs),bs(e,"ReduceL2",r,(t,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,"",`t = ${t.getByIndices("input_indices")}; value += (t * t);`,"value = sqrt(value);"])},T_=(e,r)=>{ws(e.inputs),bs(e,"ReduceLogSumExp",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += exp(${t.getByIndices("input_indices")});`,"value = log(value);"])},E_=(e,r)=>{ws(e.inputs),bs(e,"ReduceMax",r,(t,s,o)=>{let n=[];for(let i=0;i=0||o.length===0)&&n.push(t.indicesSet("input_indices",i,0));return[`${n.join(` -`)}`,`var value = ${t.getByIndices("input_indices")};`,`value = max(value, ${t.getByIndices("input_indices")});`,""]})},P_=(e,r)=>{ws(e.inputs),bs(e,"ReduceMean",r,(t,s,o)=>{let n=1;for(let i=0;i=0||o.length===0)&&(n*=e.inputs[0].dims[i]);return["var sum = f32(0);","",`sum += f32(${t.getByIndices("input_indices")});`,`let value = ${s.type.value}(sum / ${n});`]})},C_=(e,r)=>{ws(e.inputs),bs(e,"ReduceMin",r,(t,s,o)=>{let n=[];for(let i=0;i=0||o.length===0)&&n.push(`input_indices[${i}] = 0;`);return[`${n.join(` -`)}`,`var value = ${t.getByIndices("input_indices")};`,`value = min(value, ${t.getByIndices("input_indices")});`,""]})},S_=(e,r)=>{ws(e.inputs),bs(e,"ReduceProd",r,(t,s)=>[`var value = ${s.type.storage}(1);`,"",`value *= ${t.getByIndices("input_indices")};`,""])},$_=(e,r)=>{ws(e.inputs),bs(e,"ReduceSum",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += ${t.getByIndices("input_indices")};`,""])},k_=(e,r)=>{ws(e.inputs),bs(e,"ReduceSumSquare",r,(t,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,"",`t = ${t.getByIndices("input_indices")}; value += t * t;`,""])},Ms=(e,r,t)=>{if(r.length===0)return t;let s=1,o=1;for(let n=0;n1024},cM=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?P_(e,r):eM(e,r)},dM=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?v_(e,r):tM(e,r)},pM=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?x_(e,r):rM(e,r)},hM=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?T_(e,r):sM(e,r)},mM=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?E_(e,r):nM(e,r)},fM=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?C_(e,r):oM(e,r)},_M=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?S_(e,r):iM(e,r)},gM=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?$_(e,r):aM(e,r)},wM=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?k_(e,r):lM(e,r)},bM=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?y_(e,r):uM(e,r)}}),eu,MM,yM,ju,_x=je(()=>{ft(),lr(),dc(),eu=e=>{if(!e||e.length===0||e.length>2)throw new Error("ArgMinMaxOp op requires 1 or 2 inputs.");if(e[0].dataType!==1)throw new Error("Invalid input type.")},MM=(e,r)=>{eu(e.inputs);let t=(s,o,n)=>{let i=[];for(let a=0;a=0||n.length===0)&&i.push(`input_indices[${a}] = 0;`);return[`${i.join(` -`)}`,`var value = ${s.getByIndices("input_indices")}; -var best_index : i32 = 0;`,`if (${s.getByIndices("input_indices")} ${r.selectLastIndex>0?"<=":"<"} value) { - value = ${s.getByIndices("input_indices")}; - best_index = i32(last_index); - }`,"",o.setByOffset("global_idx","best_index")]};e.compute(fa("ArgMin",{hint:r.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},yM=(e,r)=>{eu(e.inputs);let t=(s,o,n)=>{let i=[];for(let a=0;a=0||n.length===0)&&i.push(`input_indices[${a}] = 0;`);return[`${i.join(` -`)}`,`var value = ${s.getByIndices("input_indices")}; -var best_index : i32 = 0;`,`if (${s.getByIndices("input_indices")} ${r.selectLastIndex>0?">=":">"} value) { - value = ${s.getByIndices("input_indices")}; - best_index = i32(last_index); - }`,"",o.setByOffset("global_idx","best_index")]};e.compute(fa("argMax",{hint:r.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},ju=e=>Nt(e)}),I_,ta,A_,F_,O_,ti,D_,vM,pc=je(()=>{ft(),xt(),uc(),Tt(),I_=(e,r)=>{let t=e[0],s=e[1],o=e[2],n=e[3],i=e[4],a=e[5];if(i&&a)throw new Error("Attention cannot have both past and attention_bias");if(t.dims.length!==3)throw new Error('Input "input" must have 3 dimensions');let l=t.dims[0],u=t.dims[1],p=t.dims[2];if(o.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimensions');if(s.dims.length!==2)throw new Error('Input "weights" is expected to have 2 dimensions');if(s.dims[0]!==p)throw new Error("Input 1 dimension 0 should have same length as dimension 2 of input 0");if(o.dims[0]!==s.dims[1])throw new Error('Input "bias" dimension 0 should have same length as dimension 1 of input "weights"');let c=o.dims[0]/3,d=c,_=d;if(r.qkvHiddenSizes.length>0){if(r.qkvHiddenSizes.length!==3)throw new Error("qkv_hidden_sizes attribute should have 3 elements");for(let C of r.qkvHiddenSizes)if(C%r.numHeads!==0)throw new Error("qkv_hidden_sizes should be divisible by num_heads");c=r.qkvHiddenSizes[0],d=r.qkvHiddenSizes[1],_=r.qkvHiddenSizes[2]}let f=u;if(c!==d)throw new Error("qkv_hidden_sizes first element should be same as the second");if(o.dims[0]!==c+d+_)throw new Error('Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes');let v=0;if(i){if(d!==_)throw new Error('Input "past" expect k_hidden_size == v_hidden_size');if(i.dims.length!==5)throw new Error('Input "past" must have 5 dimensions');if(i.dims[0]!==2)throw new Error('Input "past" first dimension must be 2');if(i.dims[1]!==l)throw new Error('Input "past" second dimension must be batch_size');if(i.dims[2]!==r.numHeads)throw new Error('Input "past" third dimension must be num_heads');if(i.dims[4]!==d/r.numHeads)throw new Error('Input "past" fifth dimension must be k_hidden_size / num_heads');r.pastPresentShareBuffer||(v=i.dims[3])}let $=f+v,g=-1,w=0;if(n)throw new Error("Mask not supported");if(i)throw new Error("past is not supported");if(a){if(a.dims.length!==4)throw new Error('Input "attention_bias" must have 4 dimensions');if(a.dims[0]!==l||a.dims[1]!==r.numHeads||a.dims[2]!==u||a.dims[3]!==$)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:l,sequenceLength:u,pastSequenceLength:v,kvSequenceLength:f,totalSequenceLength:$,maxSequenceLength:g,inputHiddenSize:p,hiddenSize:c,vHiddenSize:_,headSize:Math.floor(c/r.numHeads),vHeadSize:Math.floor(_/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:w,scale:r.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},ta=(e,r,t)=>r&&e?` - let total_sequence_length_input = u32(${r.getByOffset("0")}); - let present_sequence_length = max(total_sequence_length_input, uniforms.past_sequence_length); - let is_subsequent_prompt: bool = sequence_length > 1 && sequence_length != total_sequence_length_input; - let is_first_prompt: bool = is_subsequent_prompt == false && sequence_length == total_sequence_length_input; - total_sequence_length = u32(${e==null?void 0:e.getByOffset("batchIdx")}) + 1; - var past_sequence_length: u32 = 0; - if (is_first_prompt == false) { - past_sequence_length = total_sequence_length - sequence_length; - } - `:` - ${t?"let past_sequence_length = uniforms.past_sequence_length":""}; - let present_sequence_length = total_sequence_length; - `,A_=(e,r,t,s,o,n,i,a)=>{let l=nr(i?1:n),u=64,p=n/l;p{let w=tt("x",e.dataType,e.dims,l),C=[w],E=i?Ce("seq_lens",i.dataType,i.dims):void 0;E&&C.push(E);let x=a?Ce("total_sequence_length_input",a.dataType,a.dims):void 0;x&&C.push(x);let b=Rr(e.dataType),y=[{name:"batch_size",type:"u32"},{name:"num_heads",type:"u32"},{name:"past_sequence_length",type:"u32"},{name:"sequence_length",type:"u32"},{name:"total_sequence_length",type:"u32"},{name:"elements_per_thread",type:"u32"}];return` - var thread_max: array; - var thread_sum: array; - ${g.registerUniforms(y).declareVariables(...C)} - ${g.mainStart([u,1,1])} - let batchIdx = workgroup_id.z / uniforms.num_heads; - let headIdx = workgroup_id.z % uniforms.num_heads; - let sequence_length = uniforms.sequence_length; - var total_sequence_length = uniforms.total_sequence_length; - ${ta(E,x,!1)} - let local_offset = local_idx * uniforms.elements_per_thread; - let offset = (global_idx / ${u}) * uniforms.total_sequence_length + local_offset; - let seq_causal_length = ${i?"u32(past_sequence_length + workgroup_id.y + 1)":"total_sequence_length"}; - var thread_max_vector = ${f}(-3.402823e+38f); - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - thread_max_vector = max(${f}(x[offset + i]), thread_max_vector); - } - thread_max[local_idx] = ${(()=>{switch(l){case 1:return"thread_max_vector";case 2:return"max(thread_max_vector.x, thread_max_vector.y)";case 4:return"max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))";default:throw new Error(`Unsupported components: ${l}`)}})()}; - workgroupBarrier(); - - var max_value = f32(-3.402823e+38f); - for (var i = 0u; i < ${u}; i++) { - max_value = max(thread_max[i], max_value); - } - - var sum_vector = ${f}(0); - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - sum_vector += exp(${f}(x[offset + i]) - max_value); - } - thread_sum[local_idx] = ${(()=>{switch(l){case 1:return"sum_vector";case 2:return"sum_vector.x + sum_vector.y";case 4:return"sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w";default:throw new Error(`Unsupported components: ${l}`)}})()}; - workgroupBarrier(); - - var sum: f32 = 0; - for (var i = 0u; i < ${u}; i++) { - sum += thread_sum[i]; - } - - if (sum == 0) { - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - x[offset + i] = ${w.type.value}(${b}(1.0) / ${b}(seq_causal_length)); - } - } else { - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - var f32input = ${f}(x[offset + i]); - x[offset + i] = ${w.type.value}(exp(f32input - max_value) / sum); - } - } - ${i?` - for (var total_seq_id: u32 = seq_causal_length; total_seq_id + local_offset < uniforms.total_sequence_length; total_seq_id++) { - x[offset + total_seq_id] = ${w.type.value}(${b}(0)); - }`:""}; - }`};return{name:"AttentionProbsSoftmax",shaderCache:{hint:`${u};${_};${l}`,inputDependencies:v},getShaderSource:$,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:o,z:r*t},programUniforms:d})}},F_=(e,r,t,s,o,n,i,a,l)=>{let u=i+n.kvSequenceLength,p=[n.batchSize,n.numHeads,n.sequenceLength,u],c=e>1&&s,d=n.kvNumHeads?n.kvNumHeads:n.numHeads,_=c?[n.batchSize,d,u,n.headSize]:void 0,f=n.nReps?n.nReps:1,v=n.scale===0?1/Math.sqrt(n.headSize):n.scale,$=nr(n.headSize),g=n.headSize/$,w=12,C={x:Math.ceil(u/w),y:Math.ceil(n.sequenceLength/w),z:n.batchSize*n.numHeads},E=[{type:12,data:n.sequenceLength},{type:12,data:g},{type:12,data:u},{type:12,data:n.numHeads},{type:12,data:n.headSize},{type:1,data:v},{type:12,data:i},{type:12,data:n.kvSequenceLength},{type:12,data:f}],x=c&&s&&Me.size(s.dims)>0,b=["type","type"];x&&b.push("type"),o&&b.push("type"),a&&b.push("type"),l&&b.push("type");let y=[{dims:p,dataType:r.dataType,gpuDataType:0}];c&&y.push({dims:_,dataType:r.dataType,gpuDataType:0});let S=F=>{let z=Ce("q",r.dataType,r.dims,$),K=Ce("key",t.dataType,t.dims,$),q=[z,K];if(x){let fe=Ce("past_key",s.dataType,s.dims,$);q.push(fe)}o&&q.push(Ce("attention_bias",o.dataType,o.dims));let R=a?Ce("seq_lens",a.dataType,a.dims):void 0;R&&q.push(R);let Z=l?Ce("total_sequence_length_input",l.dataType,l.dims):void 0;Z&&q.push(Z);let H=tt("output",r.dataType,p),J=[H];c&&J.push(tt("present_key",r.dataType,_,$));let Q=Rr(1,$),se=[{name:"M",type:"u32"},{name:"K",type:"u32"},{name:"N",type:"u32"},{name:"num_heads",type:"u32"},{name:"head_size",type:"u32"},{name:"alpha",type:"f32"},{name:"past_sequence_length",type:"u32"},{name:"kv_sequence_length",type:"u32"},{name:"n_reps",type:"u32"}];return` - const TILE_SIZE = ${w}u; - - var tileQ: array<${z.type.storage}, ${w*w}>; - var tileK: array<${z.type.storage}, ${w*w}>; - ${F.registerUniforms(se).declareVariables(...q,...J)} - ${F.mainStart([w,w,1])} - // x holds the N and y holds the M - let headIdx = workgroup_id.z % uniforms.num_heads; - let kvHeadIdx = ${f===1?"headIdx":"headIdx / uniforms.n_reps"}; - let kv_num_heads = ${f===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"}; - let batchIdx = workgroup_id.z / uniforms.num_heads; - let m = workgroup_id.y * TILE_SIZE; - let n = workgroup_id.x * TILE_SIZE; - let sequence_length = uniforms.M; - var total_sequence_length = uniforms.N; - ${ta(R,Z,!0)} - let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; - let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; - ${x&&c?"let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;":""}; - let kOffset = absKvHeadIdx * uniforms.kv_sequence_length * uniforms.K; - ${c?"let presentKeyOffset = absKvHeadIdx * uniforms.N * uniforms.K;":""} - var value = ${Q}(0); - for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { - if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) { - tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x]; - } - if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) { - var idx = TILE_SIZE * local_id.y + local_id.x; - ${x&&c?` - if (n + local_id.y < past_sequence_length) { - tileK[idx] = past_key[pastKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; - } else if (n + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { - tileK[idx] = key[kOffset + (n + local_id.y - past_sequence_length) * uniforms.K + w + local_id.x]; - }`:` - if (n + local_id.y < uniforms.kv_sequence_length) { - tileK[idx] = key[kOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; - }`} - ${c?`if (n + local_id.y < present_sequence_length) { - present_key[presentKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x] = tileK[idx]; - }`:""} - } - workgroupBarrier(); - - for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) { - value += ${Q}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]); - } - - workgroupBarrier(); - } - - if (global_id.y < uniforms.M && global_id.x < total_sequence_length) { - let headOffset = workgroup_id.z * uniforms.M * uniforms.N; - let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x; - var sum: f32 = ${(()=>{switch($){case 1:return"value";case 2:return"value.x + value.y";case 4:return"value.x + value.y + value.z + value.w";default:throw new Error(`Unsupported components: ${$}`)}})()}; - output[outputIdx] = ${H.type.value} (sum * uniforms.alpha) + ${o?"attention_bias[outputIdx]":"0.0"}; - } - }`};return{name:"AttentionProbs",shaderCache:{hint:`${$};${o!==void 0};${s!==void 0};${e}`,inputDependencies:b},getRunData:()=>({outputs:y,dispatchGroup:C,programUniforms:E}),getShaderSource:S}},O_=(e,r,t,s,o,n,i=void 0,a=void 0)=>{let l=n+o.kvSequenceLength,u=o.nReps?o.nReps:1,p=o.vHiddenSize*u,c=e>1&&s,d=o.kvNumHeads?o.kvNumHeads:o.numHeads,_=c?[o.batchSize,d,l,o.headSize]:void 0,f=[o.batchSize,o.sequenceLength,p],v=12,$={x:Math.ceil(o.vHeadSize/v),y:Math.ceil(o.sequenceLength/v),z:o.batchSize*o.numHeads},g=[{type:12,data:o.sequenceLength},{type:12,data:l},{type:12,data:o.vHeadSize},{type:12,data:o.numHeads},{type:12,data:o.headSize},{type:12,data:p},{type:12,data:n},{type:12,data:o.kvSequenceLength},{type:12,data:u}],w=c&&s&&Me.size(s.dims)>0,C=["type","type"];w&&C.push("type"),i&&C.push("type"),a&&C.push("type");let E=[{dims:f,dataType:r.dataType,gpuDataType:0}];c&&E.push({dims:_,dataType:r.dataType,gpuDataType:0});let x=b=>{let y=Ce("probs",r.dataType,r.dims),S=Ce("v",t.dataType,t.dims),F=[y,S];w&&F.push(Ce("past_value",s.dataType,s.dims));let z=i?Ce("seq_lens",i.dataType,i.dims):void 0;i&&F.push(z);let K=a?Ce("total_sequence_length_input",a.dataType,a.dims):void 0;a&&F.push(K);let q=[tt("output",r.dataType,f)];c&&q.push(tt("present_value",r.dataType,_));let R=[{name:"M",type:"u32"},{name:"K",type:"u32"},{name:"N",type:"u32"},{name:"num_heads",type:"u32"},{name:"head_size",type:"u32"},{name:"v_hidden_size",type:"u32"},{name:"past_sequence_length",type:"u32"},{name:"kv_sequence_length",type:"u32"},{name:"n_reps",type:"u32"}];return` - const TILE_SIZE = ${v}u; - var tileQ: array<${y.type.value}, ${v*v}>; - var tileV: array<${y.type.value}, ${v*v}>; - ${b.registerUniforms(R).declareVariables(...F,...q)} - ${b.mainStart([v,v,1])} - let headIdx = workgroup_id.z % uniforms.num_heads; - let batchIdx = workgroup_id.z / uniforms.num_heads; - let kvHeadIdx = ${u===1?"headIdx":"headIdx / uniforms.n_reps"}; - let kv_num_heads = ${u===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"}; - let m = global_id.y; - let n = global_id.x; - let sequence_length = uniforms.M; - var total_sequence_length = uniforms.K; - ${ta(z,K,!0)} - let offsetA = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; - let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; // kvHeadIdx is relative to the batch - ${w&&c?"let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;":""}; - let vOffset = absKvHeadIdx * uniforms.N * uniforms.kv_sequence_length + n; - ${c?"let presentValueOffset = absKvHeadIdx * uniforms.N * uniforms.K + n;":""} - var value = ${y.type.storage}(0); - for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { - if (m < uniforms.M && w + local_id.x < uniforms.K) { - tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x]; - } - if (n < uniforms.N && w + local_id.y < uniforms.K) { - var idx = TILE_SIZE * local_id.y + local_id.x; - ${w&&c?` - if (w + local_id.y < past_sequence_length) { - tileV[idx] = past_value[pastValueOffset + (w + local_id.y) * uniforms.N]; - } else if (w + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { - tileV[idx] = v[vOffset + (w + local_id.y - past_sequence_length) * uniforms.N]; - } - `:` - if (w + local_id.y < uniforms.kv_sequence_length) { - tileV[idx] = v[vOffset + (w + local_id.y) * uniforms.N]; - }`} - ${c?` - if (w + local_id.y < present_sequence_length) { - present_value[presentValueOffset + (w + local_id.y) * uniforms.N] = tileV[idx]; - }`:""} - } - workgroupBarrier(); - for (var k: u32 = 0u; k < TILE_SIZE && w+k < total_sequence_length; k++) { - value += tileQ[TILE_SIZE * local_id.y + k] * tileV[TILE_SIZE * k + local_id.x]; - } - workgroupBarrier(); - } - - // we need to transpose output from BNSH_v to BSND_v - if (m < uniforms.M && n < uniforms.N) { - let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size - + headIdx * uniforms.N + n; - output[outputIdx] = value; - } - }`};return{name:"AttentionScore",shaderCache:{hint:`${s!==void 0};${e}`,inputDependencies:C},getRunData:()=>({outputs:E,dispatchGroup:$,programUniforms:g}),getShaderSource:x}},ti=(e,r,t,s,o,n,i,a,l,u,p=void 0,c=void 0)=>{let d=Math.min(e.outputCount,1+(i?1:0)+(a?1:0)),_=d>1?u.pastSequenceLength:0,f=_+u.kvSequenceLength,v=l&&Me.size(l.dims)>0?l:void 0,$=[r,t];d>1&&i&&Me.size(i.dims)>0&&$.push(i),v&&$.push(v),p&&$.push(p),c&&$.push(c);let g=e.compute(F_(d,r,t,i,v,u,_,p,c),{inputs:$,outputs:d>1?[-1,1]:[-1]})[0];e.compute(A_(g,u.batchSize,u.numHeads,_,u.sequenceLength,f,p,c),{inputs:p&&c?[g,p,c]:[g],outputs:[]});let w=[g,s];d>1&&a&&Me.size(a.dims)>0&&w.push(a),p&&w.push(p),c&&w.push(c),e.compute(O_(d,g,s,a,u,_,p,c),{inputs:w,outputs:d>1?[0,2]:[0]})},D_=(e,r)=>{let t=[r.batchSize,r.numHeads,r.sequenceLength,r.headSize],s=r.sequenceLength,o=r.inputHiddenSize,n=r.headSize,i=12,a={x:Math.ceil(r.headSize/i),y:Math.ceil(r.sequenceLength/i),z:r.batchSize*r.numHeads},l=[e.inputs[0],e.inputs[1],e.inputs[2]],u=[{type:12,data:s},{type:12,data:o},{type:12,data:n},{type:12,data:r.numHeads},{type:12,data:r.headSize},{type:12,data:r.hiddenSize},{type:12,data:r.hiddenSize+r.hiddenSize+r.vHiddenSize}],p=c=>{let d=tt("output_q",l[0].dataType,t),_=tt("output_k",l[0].dataType,t),f=tt("output_v",l[0].dataType,t),v=Ce("input",l[0].dataType,l[0].dims),$=Ce("weight",l[1].dataType,l[1].dims),g=Ce("bias",l[2].dataType,l[2].dims),w=v.type.storage,C=[{name:"M",type:"u32"},{name:"K",type:"u32"},{name:"N",type:"u32"},{name:"num_heads",type:"u32"},{name:"head_size",type:"u32"},{name:"hidden_size",type:"u32"},{name:"ldb",type:"u32"}];return` - const TILE_SIZE = ${i}u; - var tileInput: array<${w}, ${i*i}>; - var tileWeightQ: array<${w}, ${i*i}>; - var tileWeightK: array<${w}, ${i*i}>; - var tileWeightV: array<${w}, ${i*i}>; - ${c.registerUniforms(C).declareVariables(v,$,g,d,_,f)} - ${c.mainStart([i,i,1])} - let batchIndex = workgroup_id.z / uniforms.num_heads; - let headNumber = workgroup_id.z % uniforms.num_heads; - let m = global_id.y; - let n = global_id.x; - - let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K; - let biasOffsetQ = headNumber * uniforms.head_size; - let biasOffsetK = uniforms.hidden_size + biasOffsetQ; - let biasOffsetV = uniforms.hidden_size + biasOffsetK; - - var valueQ = ${w}(0); - var valueK = ${w}(0); - var valueV = ${w}(0); - for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { - if (m < uniforms.M && w + local_id.x < uniforms.K) { - tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x]; - } - if (n < uniforms.N && w + local_id.y < uniforms.K) { - let offset = n + (w + local_id.y) * uniforms.ldb; - tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset]; - tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset]; - tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset]; - } - workgroupBarrier(); - for (var k: u32 = 0u; k({outputs:[{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:a,programUniforms:u}),getShaderSource:p},{inputs:l,outputs:[-1,-1,-1]})},vM=(e,r)=>{let t=I_(e.inputs,r),[s,o,n]=D_(e,t);return ti(e,s,o,n,e.inputs[4],void 0,void 0,void 0,e.inputs[5],t)}}),L_,z_,B_,xM,gx=je(()=>{Ps(),ft(),xt(),lr(),Tt(),L_=(e,r)=>{if(!e||e.length!==5)throw new Error("BatchNormalization requires 5 inputs");let t=(s,o,n)=>{let i=o.length;if(i!==s.length)throw new Error(`${n}: num dimensions != ${i}`);o.forEach((a,l)=>{if(a!==s[l])throw new Error(`${n}: dim[${l}] do not match`)})};if(e[0].dims.length>1){let s=r.format==="NHWC"?r.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,r.spatial?2:void 0);t(e[1].dims,s,"Invalid input scale"),t(e[2].dims,s,"Invalid input B"),t(e[3].dims,s,"Invalid input mean"),t(e[4].dims,s,"Invalid input var")}else t(e[1].dims,[1],"Invalid input scale"),t(e[2].dims,[1],"Invalid input B"),t(e[3].dims,[1],"Invalid input mean"),t(e[4].dims,[1],"Invalid input var")},z_=(e,r)=>{let{epsilon:t,spatial:s,format:o}=r,n=e[0].dims,i=s?nr(n[n.length-1]):1,a=o==="NHWC"&&n.length>1?i:1,l=Me.size(n)/i,u=s,p=u?n.length:n,c=Ce("x",e[0].dataType,e[0].dims,i),d=Ce("scale",e[1].dataType,e[1].dims,a),_=Ce("bias",e[2].dataType,e[2].dims,a),f=Ce("inputMean",e[3].dataType,e[3].dims,a),v=Ce("inputVar",e[4].dataType,e[4].dims,a),$=tt("y",e[0].dataType,p,i),g=()=>{let C="";if(s)C=`let cOffset = ${n.length===1?"0u":o==="NHWC"?`outputIndices[${n.length-1}] / ${i}`:"outputIndices[1]"};`;else if(o==="NCHW")C=` - ${$.indicesSet("outputIndices","0","0")} - let cOffset = ${$.indicesToOffset("outputIndices")};`;else{C=`var cIndices = ${d.type.indices}(0); - cIndices[0] = outputIndices[${n.length-1}];`;for(let E=1;E` - const epsilon = ${t}; - ${C.registerUniform("outputSize","u32").declareVariables(c,d,_,f,v,$)} - ${C.mainStart()} - ${C.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - var outputIndices = ${$.offsetToIndices(`global_idx * ${i}`)}; - ${g()} - let scale = ${d.getByOffset("cOffset")}; - let bias = ${_.getByOffset("cOffset")}; - let inputMean = ${f.getByOffset("cOffset")}; - let inputVar = ${v.getByOffset("cOffset")}; - let x = ${c.getByOffset("global_idx")}; - let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias; - ${$.setByOffset("global_idx","value")} - }`;return{name:"BatchNormalization",shaderCache:{hint:`${r.epsilon}_${r.format}_${s}_${i}`,inputDependencies:u?["rank","type","type","type","type"]:void 0},getShaderSource:w,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u?[{type:12,data:l},...ut(n)]:[{type:12,data:l}]})}},B_=e=>Nt(e),xM=(e,r)=>{let{inputs:t,outputCount:s}=e,o=B_({...r,outputCount:s});if(Yt.webgpu.validateInputContent&&L_(t,o),r.trainingMode)throw new Error("BatchNormalization trainingMode is not supported yet.");e.compute(z_(t,o))}}),R_,j_,TM,wx=je(()=>{xt(),Tt(),R_=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![320,640,1280].includes(e[0].dims[2]))throw new Error("number of channels should be 320, 640 or 1280");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},j_=e=>{let r=e[0].dims,t=e[0].dims[2],s=Me.size(r)/4,o=e[0].dataType,n=Ce("input",o,r,4),i=Ce("bias",o,[t],4),a=Ce("residual",o,r,4),l=tt("output",o,r,4);return{name:"BiasAdd",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)}}),getShaderSource:u=>` - const channels = ${t}u / 4; - ${u.declareVariables(n,i,a,l)} - - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes(s)} - let value = ${n.getByOffset("global_idx")} - + ${i.getByOffset("global_idx % channels")} + ${a.getByOffset("global_idx")}; - ${l.setByOffset("global_idx","value")} - }`}},TM=e=>{R_(e.inputs),e.compute(j_(e.inputs))}}),N_,Lt,EM,PM,CM,SM,$M,kM,IM,AM,FM,V_,OM,DM,LM,zM,Xo,BM,da,RM,jM,NM,VM,UM,WM,GM,KM,HM,qM,QM,XM,JM,YM,ZM,ey,tu,ty,Nu,Vu,ry,sy,ny,U_,W_,oy,hc=je(()=>{ft(),xt(),lr(),Tt(),N_=(e,r,t,s,o,n,i)=>{let a=Math.ceil(r/4),l="";typeof o=="string"?l=`${o}(a)`:l=o("a");let u=Ce("inputData",t,[a],4),p=tt("outputData",s,[a],4),c=[{name:"vec_size",type:"u32"}];return i&&c.push(...i),` - ${e.registerUniforms(c).declareVariables(u,p)} - - ${n??""} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - - let a = ${u.getByOffset("global_idx")}; - ${p.setByOffset("global_idx",l)} - }`},Lt=(e,r,t,s,o,n=e.dataType,i,a)=>{let l=[{type:12,data:Math.ceil(Me.size(e.dims)/4)}];return i&&l.push(...i),{name:r,shaderCache:{hint:o,inputDependencies:["type"]},getShaderSource:u=>N_(u,Me.size(e.dims),e.dataType,n,t,s,a),getRunData:u=>({outputs:[{dims:e.dims,dataType:n}],dispatchGroup:{x:Math.ceil(Me.size(u[0].dims)/64/4)},programUniforms:l})}},EM=e=>{e.compute(Lt(e.inputs[0],"Abs","abs"))},PM=e=>{e.compute(Lt(e.inputs[0],"Acos","acos"))},CM=e=>{e.compute(Lt(e.inputs[0],"Acosh","acosh"))},SM=e=>{e.compute(Lt(e.inputs[0],"Asin","asin"))},$M=e=>{e.compute(Lt(e.inputs[0],"Asinh","asinh"))},kM=e=>{e.compute(Lt(e.inputs[0],"Atan","atan"))},IM=e=>{e.compute(Lt(e.inputs[0],"Atanh","atanh"))},AM=e=>Nt(e),FM=(e,r)=>{let t;switch(r.to){case 10:t="vec4";break;case 1:t="vec4";break;case 12:t="vec4";break;case 6:t="vec4";break;case 9:t="vec4";break;default:throw new RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${r.to}`)}e.compute(Lt(e.inputs[0],"Cast",t,void 0,r.cacheKey,r.to))},V_=e=>{let r,t,s=e.length>=2&&e[1].data!==0,o=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:r=s?e[1].getFloat32Array()[0]:-34028234663852886e22,t=o?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:r=s?e[1].getUint16Array()[0]:64511,t=o?e[2].getUint16Array()[0]:31743;break;default:throw new Error("Unsupport data type")}return Nt({min:r,max:t})},OM=(e,r)=>{let t=r||V_(e.inputs),s=Rr(e.inputs[0].dataType);e.compute(Lt(e.inputs[0],"Clip",o=>`clamp(${o}, vec4<${s}>(uniforms.min), vec4<${s}>(uniforms.max))`,void 0,t.cacheKey,void 0,[{type:e.inputs[0].dataType,data:t.min},{type:e.inputs[0].dataType,data:t.max}],[{name:"min",type:s},{name:"max",type:s}]),{inputs:[0]})},DM=e=>{e.compute(Lt(e.inputs[0],"Ceil","ceil"))},LM=e=>{e.compute(Lt(e.inputs[0],"Cos","cos"))},zM=e=>{e.compute(Lt(e.inputs[0],"Cosh","cosh"))},Xo=e=>Nt(e),BM=(e,r)=>{let t=Rr(e.inputs[0].dataType);e.compute(Lt(e.inputs[0],"Elu",s=>`elu_vf32(${s})`,` - const elu_alpha_ = ${t}(${r.alpha}); - - fn elu_f32(a: ${t}) -> ${t} { - return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0); - } - - fn elu_vf32(v: vec4<${t}>) -> vec4<${t}> { - return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w)); - }`,r.cacheKey))},da=(e="f32")=>` -const r0: ${e} = 0.3275911; -const r1: ${e} = 0.254829592; -const r2: ${e} = -0.284496736; -const r3: ${e} = 1.421413741; -const r4: ${e} = -1.453152027; -const r5: ${e} = 1.061405429; - -fn erf_vf32(v: vec4<${e}>) -> vec4<${e}> { - let absv = abs(v); - let x = 1.0 / (1.0 + r0 * absv); - return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv)); -}`,RM=e=>{let r=Rr(e.inputs[0].dataType);e.compute(Lt(e.inputs[0],"Erf",t=>`erf_vf32(${t})`,da(r)))},jM=e=>{e.compute(Lt(e.inputs[0],"Exp","exp"))},NM=e=>{e.compute(Lt(e.inputs[0],"Floor","floor"))},VM=e=>{let r=Rr(e.inputs[0].dataType);e.compute(Lt(e.inputs[0],"Gelu",t=>`0.5 * ${t} * (1.0 + erf_vf32(${t} * 0.7071067811865475))`,da(r)))},UM=(e,r)=>{let t=Rr(e.inputs[0].dataType);e.compute(Lt(e.inputs[0],"LeakyRelu",s=>`select(leaky_relu_alpha_ * ${s}, ${s}, ${s} >= vec4<${t}>(0.0))`,`const leaky_relu_alpha_ = ${t}(${r.alpha});`,r.cacheKey))},WM=e=>{e.compute(Lt(e.inputs[0],"Not",r=>`!${r}`))},GM=e=>{e.compute(Lt(e.inputs[0],"Neg",r=>`-${r}`))},KM=e=>{e.compute(Lt(e.inputs[0],"Reciprocal",r=>`1.0/${r}`))},HM=e=>{let r=Rr(e.inputs[0].dataType);e.compute(Lt(e.inputs[0],"Relu",t=>`select(vec4<${r}>(0.0), ${t}, ${t} > vec4<${r}>(0.0))`))},qM=e=>{e.compute(Lt(e.inputs[0],"Sigmoid",r=>`(1.0 / (1.0 + exp(-${r})))`))},QM=e=>Nt(e),XM=(e,r)=>{let t=Rr(e.inputs[0].dataType);e.compute(Lt(e.inputs[0],"HardSigmoid",s=>`max(vec4<${t}>(0.0), min(vec4<${t}>(1.0), ${r.alpha} * ${s} + vec4<${t}>(${r.beta})))`,void 0,r.cacheKey))},JM=e=>{e.compute(Lt(e.inputs[0],"Sin","sin"))},YM=e=>{e.compute(Lt(e.inputs[0],"Sinh","sinh"))},ZM=e=>{e.compute(Lt(e.inputs[0],"Sqrt","sqrt"))},ey=e=>{e.compute(Lt(e.inputs[0],"Tan","tan"))},tu=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,ty=e=>{e.compute(Lt(e.inputs[0],"Tanh",tu))},Nu=(e="f32")=>` -const fast_gelu_a: ${e} = 0.5; -const fast_gelu_b: ${e} = 0.7978845608028654; -const fast_gelu_c: ${e} = 0.035677408136300125; - -fn tanh_v(v: vec4<${e}>) -> vec4<${e}> { - return ${tu("v")}; -} -`,Vu=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,ry=e=>{let r=Rr(e.inputs[0].dataType);e.compute(Lt(e.inputs[0],"FastGelu",Vu,Nu(r),void 0,e.inputs[0].dataType))},sy=(e,r)=>{let t=Rr(e.inputs[0].dataType);return e.compute(Lt(e.inputs[0],"ThresholdedRelu",s=>`select(vec4<${t}>(0.0), ${s}, ${s} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${t}>(${r.alpha});`,r.cacheKey)),0},ny=e=>{e.compute(Lt(e.inputs[0],"Log","log"))},U_=(e,r)=>` -const alpha = vec4<${e}>(${r}); -const one = ${e}(1.0); -const zero = ${e}(0.0); - -fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { - let v = x *alpha; - var x1 : vec4<${e}>; - for (var i = 0; i < 4; i = i + 1) { - if (v[i] >= zero) { - x1[i] = one / (one + exp(-v[i])); - } else { - x1[i] = one - one / (one + exp(v[i])); - } - } - return x * x1; -} -`,W_=e=>`quick_gelu_impl(${e})`,oy=(e,r)=>{let t=Rr(e.inputs[0].dataType);e.compute(Lt(e.inputs[0],"QuickGelu",W_,U_(t,r.alpha),r.cacheKey,e.inputs[0].dataType))}}),G_,K_,iy,bx=je(()=>{xt(),Tt(),hc(),G_=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![2560,5120,10240].includes(e[0].dims[2]))throw new Error("hidden state should be 2560, 5120 or 10240");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},K_=e=>{let r=e[0].dims.slice();r[2]=r[2]/2;let t=Ce("input",e[0].dataType,e[0].dims,4),s=Ce("bias",e[0].dataType,[e[0].dims[2]],4),o=tt("output",e[0].dataType,r,4),n=Me.size(r)/4,i=$r(e[0].dataType);return{name:"BiasSplitGelu",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)}}),getShaderSource:a=>` - const M_SQRT2 = sqrt(2.0); - const halfChannels = ${e[0].dims[2]/4/2}u; - - ${a.declareVariables(t,s,o)} - - ${da(i)} - - ${a.mainStart()} - ${a.guardAgainstOutOfBoundsWorkgroupSizes(n)} - let biasIdx = global_idx % halfChannels; - let batchIndex = global_idx / halfChannels; - let inputOffset = biasIdx + batchIndex * halfChannels * 2; - let valueLeft = input[inputOffset] + bias[biasIdx]; - let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels]; - let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1); - - ${o.setByOffset("global_idx","valueLeft * geluRight")} - }`}},iy=e=>{G_(e.inputs),e.compute(K_(e.inputs))}}),H_,q_,ys,ay,ly,uy,cy,dy,py,hy,my,fy,_y,Mx=je(()=>{ft(),xt(),Tt(),H_=(e,r,t,s,o,n,i,a,l,u,p,c)=>{let d,_;typeof a=="string"?d=_=(w,C)=>`${a}((${w}),(${C}))`:typeof a=="function"?d=_=a:(d=a.scalar,_=a.vector);let f=tt("outputData",p,s.length,4),v=Ce("aData",l,r.length,4),$=Ce("bData",u,t.length,4),g;if(o)if(n){let w=Me.size(r)===1,C=Me.size(t)===1,E=r.length>0&&r[r.length-1]%4===0,x=t.length>0&&t[t.length-1]%4===0;w||C?g=f.setByOffset("global_idx",_(w?`${v.type.value}(${v.getByOffset("0")}.x)`:v.getByOffset("global_idx"),C?`${$.type.value}(${$.getByOffset("0")}.x)`:$.getByOffset("global_idx"))):g=` - let outputIndices = ${f.offsetToIndices("global_idx * 4u")}; - let offsetA = ${v.broadcastedIndicesToOffset("outputIndices",f)}; - let offsetB = ${$.broadcastedIndicesToOffset("outputIndices",f)}; - ${f.setByOffset("global_idx",_(i||E?v.getByOffset("offsetA / 4u"):`${v.type.value}(${v.getByOffset("offsetA / 4u")}[offsetA % 4u])`,i||x?$.getByOffset("offsetB / 4u"):`${$.type.value}(${$.getByOffset("offsetB / 4u")}[offsetB % 4u])`))} - `}else g=f.setByOffset("global_idx",_(v.getByOffset("global_idx"),$.getByOffset("global_idx")));else{if(!n)throw new Error("no necessary to use scalar implementation for element-wise binary op implementation.");let w=(C,E,x="")=>{let b=`aData[indexA${E}][componentA${E}]`,y=`bData[indexB${E}][componentB${E}]`;return` - let outputIndices${E} = ${f.offsetToIndices(`global_idx * 4u + ${E}u`)}; - let offsetA${E} = ${v.broadcastedIndicesToOffset(`outputIndices${E}`,f)}; - let offsetB${E} = ${$.broadcastedIndicesToOffset(`outputIndices${E}`,f)}; - let indexA${E} = offsetA${E} / 4u; - let indexB${E} = offsetB${E} / 4u; - let componentA${E} = offsetA${E} % 4u; - let componentB${E} = offsetB${E} % 4u; - ${C}[${E}] = ${x}(${d(b,y)}); - `};p===9?g=` - var data = vec4(0); - ${w("data",0,"u32")} - ${w("data",1,"u32")} - ${w("data",2,"u32")} - ${w("data",3,"u32")} - outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:g=` - ${w("outputData[global_idx]",0)} - ${w("outputData[global_idx]",1)} - ${w("outputData[global_idx]",2)} - ${w("outputData[global_idx]",3)} - `}return` - ${e.registerUniform("vec_size","u32").declareVariables(v,$,f)} - - ${c??""} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - ${g} - }`},q_=(e,r,t,s,o,n,i=t.dataType)=>{let a=t.dims.map(v=>Number(v)??1),l=s.dims.map(v=>Number(v)??1),u=!Me.areEqual(a,l),p=a,c=Me.size(a),d=!1,_=!1,f=[u];if(u){let v=no.calcShape(a,l,!1);if(!v)throw new Error("Can't perform binary op on the given tensors");p=v.slice(),c=Me.size(p);let $=Me.size(a)===1,g=Me.size(l)===1,w=a.length>0&&a[a.length-1]%4===0,C=l.length>0&&l[l.length-1]%4===0;f.push($),f.push(g),f.push(w),f.push(C);let E=1;for(let x=1;xv.toString()).join("_"),inputDependencies:["rank","rank"]},getShaderSource:v=>H_(v,a,l,p,d,u,_,o,t.dataType,s.dataType,i,n),getRunData:()=>({outputs:[{dims:p,dataType:i}],dispatchGroup:{x:Math.ceil(c/64/4)},programUniforms:[{type:12,data:Math.ceil(Me.size(p)/4)},...ut(a,l,p)]})}},ys=(e,r,t,s,o,n)=>{e.compute(q_(r,o??"",e.inputs[0],e.inputs[1],t,s,n))},ay=e=>{ys(e,"Add",(r,t)=>`${r}+${t}`)},ly=e=>{ys(e,"Div",(r,t)=>`${r}/${t}`)},uy=e=>{ys(e,"Equal",{scalar:(r,t)=>`u32(${r}==${t})`,vector:(r,t)=>`vec4(${r}==${t})`},void 0,void 0,9)},cy=e=>{ys(e,"Mul",(r,t)=>`${r}*${t}`)},dy=e=>{let r=Ce("input",e.inputs[0].dataType,e.inputs[0].dims).type.value;ys(e,"Pow",{scalar:(t,s)=>`pow_custom(${t},${s})`,vector:(t,s)=>`pow_vector_custom(${t},${s})`},` - fn pow_custom(a : ${r}, b : ${r}) -> ${r} { - if (b == ${r}(0.0)) { - return ${r}(1.0); - } else if (a < ${r}(0.0) && f32(b) != floor(f32(b))) { - return ${r}(pow(f32(a), f32(b))); // NaN - } - return select(sign(a), ${r}(1.0), round(f32(abs(b) % ${r}(2.0))) != 1.0) * ${r}(${r==="i32"?"round":""}(pow(f32(abs(a)), f32(b)))); - } - fn pow_vector_custom(a : vec4<${r}>, b : vec4<${r}>) -> vec4<${r}> { - // TODO: implement vectorized pow - return vec4<${r}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w)); - } - `)},py=e=>{ys(e,"Sub",(r,t)=>`${r}-${t}`)},hy=e=>{ys(e,"Greater",{scalar:(r,t)=>`u32(${r}>${t})`,vector:(r,t)=>`vec4(${r}>${t})`},void 0,void 0,9)},my=e=>{ys(e,"Less",{scalar:(r,t)=>`u32(${r}<${t})`,vector:(r,t)=>`vec4(${r}<${t})`},void 0,void 0,9)},fy=e=>{ys(e,"GreaterOrEqual",{scalar:(r,t)=>`u32(${r}>=${t})`,vector:(r,t)=>`vec4(${r}>=${t})`},void 0,void 0,9)},_y=e=>{ys(e,"LessOrEqual",{scalar:(r,t)=>`u32(${r}<=${t})`,vector:(r,t)=>`vec4(${r}<=${t})`},void 0,void 0,9)}}),Q_,X_,J_,Y_,gy,wy,yx=je(()=>{ft(),xt(),lr(),Tt(),Q_=(e,r)=>{if(!e||e.length<1)throw new Error("too few inputs");let t=0,s=e[t],o=s.dataType,n=s.dims.length;e.forEach((i,a)=>{if(a!==t){if(i.dataType!==o)throw new Error("input tensors should be one type");if(i.dims.length!==n)throw new Error("input tensors should have the same shape");i.dims.forEach((l,u)=>{if(u!==r&&l!==s.dims[u])throw new Error("non concat dimensions must match")})}})},X_=(e,r)=>` - fn calculateInputIndex(index: u32) -> u32 { - let sizeInConcatAxis = array(${r}); - for (var i: u32 = 0u; i < ${e}; i += 1u ) { - if (index < sizeInConcatAxis[i]) { - return i; - } - } - return ${e}u; - }`,J_=(e,r)=>{let t=e.length,s=[];for(let o=0;o{let o=Me.size(t),n=new Array(e.length),i=new Array(e.length),a=0,l=[],u=[],p=[{type:12,data:o}];for(let v=0;v`uniforms.sizeInConcatAxis${v}`).join(","),f=v=>` - - ${(()=>{v.registerUniform("outputSize","u32");for(let $=0;$(${_}); - ${d} -= sizeInConcatAxis[inputIndex - 1u]; - } - - ${J_(i,c)} - }`;return{name:"Concat",shaderCache:{hint:`${r}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:t,dataType:s}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:p}),getShaderSource:f}},gy=(e,r)=>{let t=e.inputs,s=t[0].dims,o=Me.normalizeAxis(r.axis,s.length);Q_(t,o);let n=s.slice();n[o]=t.reduce((a,l)=>a+(l.dims.length>o?l.dims[o]:0),0);let i=t.filter(a=>Me.size(a.dims)>0);e.compute(Y_(i,o,n,t[0].dataType),{inputs:i})},wy=e=>Nt({axis:e.axis})}),On,Dn,Ln,mc,Bn=je(()=>{ft(),xt(),On=(e,r,t="f32")=>{switch(e.activation){case"Relu":return`value = max(value, ${r}(0.0));`;case"Sigmoid":return`value = (${r}(1.0) / (${r}(1.0) + exp(-value)));`;case"Clip":return`value = clamp(value, ${r}(${t}(uniforms.clip_min)), ${r}(${t}(uniforms.clip_max)));`;case"HardSigmoid":return`value = max(${r}(0.0), min(${r}(1.0), ${t}(uniforms.alpha) * value + ${t}(uniforms.beta)));`;case"LeakyRelu":return`value = select(${t}(uniforms.alpha) * value, value, value >= ${r}(0.0));`;case"Tanh":return`let e2x = exp(-2.0 * abs(value)); - value = sign(value) * (1.0 - e2x) / (1.0 + e2x); - `;case"":return"";default:throw new Error(`Unsupported activation ${e.activation}`)}},Dn=(e,r)=>{e.activation==="Clip"?r.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation==="HardSigmoid"?r.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation==="LeakyRelu"&&r.push({type:1,data:e.alpha})},Ln=(e,r)=>{e.activation==="Clip"?r.push({name:"clip_max",type:"f32"},{name:"clip_min",type:"f32"}):e.activation==="HardSigmoid"?r.push({name:"alpha",type:"f32"},{name:"beta",type:"f32"}):e.activation==="LeakyRelu"&&r.push({name:"alpha",type:"f32"})},mc=e=>{let r=(e==null?void 0:e.activation)||"";if(r==="HardSigmoid"){let[t,s]=(e==null?void 0:e.activation_params)||[.2,.5];return{activation:r,alpha:t,beta:s}}else if(r==="Clip"){let[t,s]=(e==null?void 0:e.activation_params)||[Wb,Gb];return{activation:r,clipMax:s,clipMin:t}}else if(r==="LeakyRelu"){let[t]=(e==null?void 0:e.activation_params)||[.01];return{activation:r,alpha:t}}return{activation:r}}}),Fr,by,fc=je(()=>{Fr=(e,r)=>{switch(e){case 1:return r;case 2:return`vec2<${r}>`;case 3:return`vec3<${r}>`;case 4:return`vec4<${r}>`;default:throw new Error(`${e}-component is not supported.`)}},by=e=>` - ${e?"value = value + getBiasByOutputCoords(coords);":""} - `}),My,vx=je(()=>{My=e=>` -fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 { - return dot(coords, vec4( - shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1)); -} -fn getOutputIndexFromCoords(coords : vec4) -> i32 { - return dot(coords, vec4( - i32(${e}.x), i32(${e}.y), i32(${e}.z), 1)); -} -`}),Yo,_c,gc=je(()=>{ft(),xt(),Tt(),Bn(),Yo=(e,r,t,s,o)=>{let n=s-t;return` - ${Array.from({length:t}).map((i,a)=>` - if (${ot(r.shape,a,r.rank)} != 1) { - ${r.indicesSet(e,a,ot(o,a+n,s))} - } else { - ${r.indicesSet(e,a,0)} - }`).join("")} -`},_c=(e,r,t,s,o=!1,n)=>{let i=e[0].dims,a=e[1].dims,l=i[i.length-2],u=a[a.length-1],p=i[i.length-1],c=nr(u),d=nr(p),_=nr(l),f=Me.size(t)/c/_,v=e.length>2,$=s?s.slice(0,-2):t.slice(0,-2),g=[Me.size($),l,u],w=[{type:12,data:f},{type:12,data:l},{type:12,data:u},{type:12,data:p}];Dn(r,w),w.push(...ut($,i,a)),v&&w.push(...ut(e[2].dims)),w.push(...ut(g));let C=E=>{let x=cc("batch_dims",e[0].dataType,$.length),b=Ce("a",e[0].dataType,i.length,d),y=Ce("b",e[1].dataType,a.length,c),S=tt("output",e[0].dataType,g.length,c),F=$r(S.type.tensor),z=On(r,S.type.value,F),K=[b,y],q="";if(v){let H=o?c:1;K.push(Ce("bias",e[2].dataType,e[2].dims.length,H)),q=`${o?`value += bias[col / ${H}];`:`value += ${S.type.value}(bias[row + i]);`}`}let R=[{name:"output_size",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"}];Ln(r,R);let Z=()=>{let H=`var a_data: ${b.type.value};`;for(let J=0;J; - for (var k: u32 = 0u; k < uniforms.K; k = k + ${d}) { - ${Z()} - } - for (var i = 0u; i < ${_}u; i++) { - var value = values[i]; - ${q} - ${z} - let cur_indices = ${S.type.indices}(batch, row + i, col); - let offset = ${S.indicesToOffset("cur_indices")}; - ${S.setByOffset(`offset / ${c}`,"value")}; - } - } - `};return{name:"MatMulNaive",shaderCache:{hint:`${r.activation};${c};${d};${_};${o}`,inputDependencies:v?["rank","rank","rank"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:n?n(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:w}),getShaderSource:C}}}),Z_,eg,Uu,ru,tg,Wu,rg,_a,wc=je(()=>{ft(),xt(),Tt(),Bn(),gc(),fc(),Z_=(e,r)=>e?` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - kStart + inputRow, - globalRowStart / innerElementSize + inputCol${r?", batchIndices":""}); - `:` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - globalRow + innerRow, - kStart / innerElementSize + inputCol${r?", batchIndices":""}); - `,eg=(e,r)=>e?` - let ACached0 = mm_Asub[k * innerElementSize][localRow]; - let ACached1 = mm_Asub[k * innerElementSize + 1][localRow]; - let ACached2 = mm_Asub[k * innerElementSize + 2][localRow]; - ${r===3?"":"let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];"} - for (var i = 0; i < rowPerThread; i = i + 1) { - acc[i] = BCached0 * ACached0[i] + acc[i]; - acc[i] = BCached1 * ACached1[i] + acc[i]; - acc[i] = BCached2 * ACached2[i] + acc[i]; - ${r===3?"":"acc[i] = BCached3 * ACached3[i] + acc[i];"} - }`:` - for (var i = 0; i < rowPerThread; i = i + 1) { - let ACached = mm_Asub[tileRow + i][k]; - acc[i] = BCached0 * ACached.x + acc[i]; - acc[i] = BCached1 * ACached.y + acc[i]; - acc[i] = BCached2 * ACached.z + acc[i]; - ${r===3?"":"acc[i] = BCached3 * ACached.w + acc[i];"} - }`,Uu=(e,r,t="f32",s,o=!1,n=32,i=!1,a=32)=>{let l=r[1]*e[1],u=r[0]*e[0],p=o?l:n,c=o?n:l,d=p/r[0],_=n/r[1];if(!((o&&d===4&&e[1]===4||!o&&(d===3||d===4))&&p%r[0]===0&&n%r[1]===0&&e[0]===4))throw new Error(`If transposeA ${o} is true, innerElementSize ${d} and workPerThread[1] ${e[1]} must be 4. - Otherwise, innerElementSize ${d} must be 3 or 4. - tileAWidth ${p} must be divisible by workgroupSize[0]${r[0]}. tileInner ${n} must be divisible by workgroupSize[1] ${r[1]}. colPerThread ${e[0]} must be 4.`);return` -var mm_Asub: array, ${p/d}>, ${c}>; -var mm_Bsub: array, ${u/e[0]}>, ${n}>; - -const rowPerThread = ${e[1]}; -const colPerThread = ${e[0]}; -const innerElementSize = ${d}; -const tileInner = ${n}; - -@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]}) -fn main(@builtin(local_invocation_id) localId : vec3, - @builtin(global_invocation_id) globalId : vec3, - @builtin(workgroup_id) workgroupId : vec3) { - let localRow = i32(localId.y); - let tileRow = localRow * rowPerThread; - let tileCol = i32(localId.x); - - let globalRow =i32(globalId.y) * rowPerThread; - let globalCol = i32(globalId.x); - let batch = ${i?"0":"i32(globalId.z)"}; - ${s?`let batchIndices = ${s.offsetToIndices("u32(batch)")};`:""} - let globalRowStart = i32(workgroupId.y) * ${l}; - - let num_tiles = ${i?`${Math.ceil(a/n)}`:"(uniforms.dim_inner - 1) / tileInner + 1"}; - var kStart = ${i?`i32(globalId.z) * ${a}`:"0"}; - - var acc: array, rowPerThread>; - - // Loop over shared dimension. - let tileRowB = localRow * ${_}; - for (var t = 0; t < num_tiles; t = t + 1) { - // Load one tile of A into local memory. - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - let inputRow = tileRow + innerRow; - let inputCol = tileCol; - ${Z_(o,s)} - } - - // Load one tile of B into local memory. - for (var innerRow = 0; innerRow < ${_}; innerRow = innerRow + 1) { - let inputRow = tileRowB + innerRow; - let inputCol = tileCol; - mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${s?", batchIndices":""}); - } - kStart = kStart + tileInner; - workgroupBarrier(); - - // Compute acc values for a single thread. - for (var k = 0; k < tileInner / innerElementSize; k = k + 1) { - let BCached0 = mm_Bsub[k * innerElementSize][tileCol]; - let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol]; - let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol]; - ${d===3?"":"let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];"} - - ${eg(o,d)} - } - - workgroupBarrier(); - } - - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); - } -}`},ru=(e,r)=>e?` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - kStart + inputRow, - globalRowStart + inputCol${r?", batchIndices":""}); - `:` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - globalRowStart + inputRow, - kStart + inputCol${r?", batchIndices":""}); - `,tg=e=>e?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];",Wu=(e,r,t="f32",s,o=!1,n=32,i=!1,a=32,l=!1)=>{let u=e[1]*r[1],p=e[0]*r[0],c=o?u:n,d=o?n:u;if(!(d%r[1]===0&&c%r[0]===0&&n%r[1]===0))throw new Error(`tileAHight ${d} must be divisible by workgroupSize[1]${r[1]}, tileAWidth ${c} must be divisible by workgroupSize[0]${r[0]}, tileInner ${n} must be divisible by workgroupSize[1]${r[1]}`);let _=d/r[1],f=c/r[0],v=n/r[1],$=l?` - let localRow = i32(localId.y); - let localCol = i32(localId.x); - let globalRowStart = i32(workgroupId.y) * ${u}; - let globalColStart = i32(workgroupId.x) * ${p}; - - // Loop over shared dimension. - for (var t = 0; t < num_tiles; t = t + 1) { - // Load one tile of A into local memory. - for (var inputRow = localRow; inputRow < ${d}; inputRow = inputRow + ${r[1]}) { - for (var inputCol = localCol; inputCol < ${c}; inputCol = inputCol + ${r[0]}) { - ${ru(o,s)} - } - } - // Load one tile of B into local memory. - for (var inputRow = localRow; inputRow < ${n}; inputRow = inputRow + ${r[1]}) { - for (var inputCol = localCol; inputCol < ${p}; inputCol = inputCol + ${r[0]}) { - mm_Bsub[inputRow][inputCol] = mm_readB(batch, - kStart + inputRow, - globalColStart + inputCol${s?", batchIndices":""}); - } - } - kStart = kStart + tileInner; - workgroupBarrier(); - - // Compute acc values for a single thread. - var BCached : array<${t}, colPerThread>; - for (var k = 0; k < tileInner; k = k + 1) { - for (var inner = 0; inner < colPerThread; inner = inner + 1) { - BCached[inner] = mm_Bsub[k][localCol + inner * ${r[0]}]; - } - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - let ACached = ${o?`mm_Asub[k][localRow + innerRow * ${r[1]}];`:`mm_Asub[localRow + innerRow * ${r[1]}][k];`} - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - acc[innerRow][innerCol] = acc[innerRow][innerCol] + - ACached * BCached[innerCol]; - } - } - } - workgroupBarrier(); - } - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - let gRow = globalRowStart + localRow + innerRow * ${r[1]}; - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - let gCol = globalColStart + localCol + innerCol * ${r[0]}; - mm_write(batch, gRow, gCol, acc[innerRow][innerCol]); - } - } - `:` -let tileRow = i32(localId.y) * rowPerThread; -let tileCol = i32(localId.x) * colPerThread; - -let globalRow = i32(globalId.y) * rowPerThread; -let globalCol = i32(globalId.x) * colPerThread; -let globalRowStart = i32(workgroupId.y) * ${u}; - -let tileRowA = i32(localId.y) * ${_}; -let tileColA = i32(localId.x) * ${f}; -let tileRowB = i32(localId.y) * ${v}; -// Loop over shared dimension. -for (var t = 0; t < num_tiles; t = t + 1) { - // Load one tile of A into local memory. - for (var innerRow = 0; innerRow < ${_}; innerRow = innerRow + 1) { - for (var innerCol = 0; innerCol < ${f}; innerCol = innerCol + 1) { - let inputRow = tileRowA + innerRow; - let inputCol = tileColA + innerCol; - ${ru(o,s)} - } - } - - // Load one tile of B into local memory. - for (var innerRow = 0; innerRow < ${v}; innerRow = innerRow + 1) { - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - let inputRow = tileRowB + innerRow; - let inputCol = tileCol + innerCol; - mm_Bsub[inputRow][inputCol] = mm_readB(batch, - kStart + inputRow, - globalCol + innerCol${s?", batchIndices":""}); - } - } - kStart = kStart + tileInner; - workgroupBarrier(); - - // Compute acc values for a single thread. - var BCached : array<${t}, colPerThread>; - for (var k = 0; k < tileInner; k = k + 1) { - for (var inner = 0; inner < colPerThread; inner = inner + 1) { - BCached[inner] = mm_Bsub[k][tileCol + inner]; - } - - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - ${tg(o)} - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol]; - } - } - } - - workgroupBarrier(); -} - -for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - mm_write(batch, globalRow + innerRow, globalCol + innerCol, - acc[innerRow][innerCol]); - } -} -`;return` - var mm_Asub : array, ${d}>; - var mm_Bsub : array, ${n}>; - const rowPerThread = ${e[1]}; - const colPerThread = ${e[0]}; - const tileInner = ${n}; - -@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]}) -fn main(@builtin(local_invocation_id) localId : vec3, - @builtin(global_invocation_id) globalId : vec3, - @builtin(workgroup_id) workgroupId : vec3) { - let batch = ${i?"0":"i32(globalId.z)"}; - ${s?`let batchIndices = ${s.offsetToIndices("u32(batch)")};`:""} - let num_tiles = ${i?`${Math.ceil(a/n)}`:"(uniforms.dim_inner - 1) / tileInner + 1"}; - var kStart = ${i?`i32(globalId.z) * ${a}`:"0"}; - - var acc : array, rowPerThread>; - ${$} - } -`},rg=(e,r,t,s,o=!1)=>{let[n,i,a,l]=s,u=$r(s[0].type.tensor);return` - fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${n.type.indices}) -> ${Fr(e,u)} { - var value = ${Fr(e,u)}(0.0); - let col = colIn * ${e}; - if(row < uniforms.dim_a_outer && col < uniforms.dim_inner) - { - var aIndices: ${i.type.indices}; - ${Yo("aIndices",i,i.rank-2,n.rank,"batchIndices")} - ${i.indicesSet("aIndices",i.rank-2,"u32(row)")} - ${i.indicesSet("aIndices",i.rank-1,"u32(colIn)")} - value = ${i.getByIndices("aIndices")}; - } - return value; - } - - fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${n.type.indices}) -> ${Fr(e,u)} { - var value = ${Fr(e,u)}(0.0); - let col = colIn * ${e}; - if(row < uniforms.dim_inner && col < uniforms.dim_b_outer) - { - var bIndices: ${a.type.indices}; - ${Yo("bIndices",a,a.rank-2,n.rank,"batchIndices")} - ${a.indicesSet("bIndices",a.rank-2,"u32(row)")} - ${a.indicesSet("bIndices",a.rank-1,"u32(colIn)")} - value = ${a.getByIndices("bIndices")}; - } - return value; - } - - fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${Fr(e,u)}) { - let col = colIn * ${e}; - if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) { - var value = valueIn; - let coords = vec3(batch, row, colIn); - ${r?`value = value + ${o?"bias[colIn]":`${Fr(e,u)}(bias[row])`};`:""} - ${t} - ${l.setByIndices("vec3(coords)","value")} - } - } - `},_a=(e,r,t,s,o=!1,n)=>{let i=e[0].dims,a=e[1].dims,l=i.slice(0,-2),u=a.slice(0,-2),p=s?s.slice(0,-2):t.slice(0,-2),c=Me.size(p),d=i[i.length-2],_=i[i.length-1],f=a[a.length-1],v=_%4===0&&f%4===0,$=d<=8?[4,1,1]:[4,4,1],g=[8,8,1],w=[Math.ceil(f/g[0]/$[0]),Math.ceil(d/g[1]/$[1]),Math.ceil(c/g[2]/$[2])],C=v?4:1,E=[...l,d,_/C],x=E.length,b=[...u,_,f/C],y=b.length,S=[c,d,f/C],F=[{type:6,data:d},{type:6,data:f},{type:6,data:_}];Dn(r,F),F.push(...ut(p,E,b));let z=["rank","rank"],K=e.length>2;K&&(F.push(...ut(e[2].dims)),z.push("rank")),F.push(...ut(S));let q=R=>{let Z=p.length,H=cc("batchDims",e[0].dataType,Z,1),J=$r(e[0].dataType),Q=Ce("a",e[0].dataType,x,C),se=Ce("b",e[1].dataType,y,C),fe=tt("result",e[0].dataType,S.length,C),ae=[Q,se];if(K){let _e=o?C:1;ae.push(Ce("bias",e[2].dataType,e[2].dims.length,_e))}let V=[{name:"dim_a_outer",type:"i32"},{name:"dim_b_outer",type:"i32"},{name:"dim_inner",type:"i32"}];Ln(r,V);let A=$r(fe.type.tensor),U=On(r,fe.type.value,A),ee=rg(C,K,U,[H,Q,se,fe],o);return` - ${R.registerUniforms(V).registerInternalVariables(H).declareVariables(...ae,fe)} - ${ee} - ${v?Uu($,g,J,H):Wu($,g,J,H)} - `};return{name:"MatMul",shaderCache:{hint:`${$};${r.activation};${v};${o}`,inputDependencies:z},getRunData:()=>({outputs:[{dims:n?n(t):t,dataType:e[0].dataType}],dispatchGroup:{x:w[0],y:w[1],z:w[2]},programUniforms:F}),getShaderSource:q}}}),sg,yy,xx=je(()=>{ft(),Ns(),Tt(),Bn(),fc(),vx(),wc(),sg=(e,r,t,s,o=!1,n,i=4,a=4,l=4,u="f32")=>{let p=F=>{switch(F){case 1:return"resData = x[xIndex];";case 3:return`resData = vec3<${u}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return"resData = x[xIndex / 4];";default:throw new Error(`innerElementSize ${F} is not supported.`)}},c=F=>{switch(F){case 1:return"return w[row * i32(uniforms.w_shape[3]) + colIn];";case 4:return"return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];";default:throw new Error(`innerElementSize ${F} is not supported.`)}},d=e?` - let coord = vec4(batch, xRow, xCol, xCh); - `:` - let coord = vec4(batch, xCh, xRow, xCol); - `,_=e?` - let coords = vec4( - batch, - row / outWidth, - row % outWidth, - col); - `:` - let coords = vec4( - batch, - row, - col / outWidth, - col % outWidth); - `,f=e?"i32(uniforms.x_shape[1])":"i32(uniforms.x_shape[2])",v=e?"i32(uniforms.x_shape[2])":"i32(uniforms.x_shape[3])",$=e?"row":"col",g=e?"col":"row",w=` - let inChannels = i32(uniforms.w_shape[2]); - let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"}; - let outRow = ${$} / outWidth; - let outCol = ${$} % outWidth; - - let WRow = ${g} / (i32(uniforms.w_shape[1]) * inChannels); - let WCol = ${g} / inChannels % i32(uniforms.w_shape[1]); - let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0]; - let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1]; - let xCh = ${g} % inChannels; - var resData = ${Fr(i,u)}(0.0); - // The bounds checking is always needed since we use it to pad zero for - // the 'same' padding type. - if (xRow >= 0 && xRow < ${f} && xCol >= 0 && xCol < ${v}) { - ${d} - let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape)); - ${p(i)} - } - return resData;`,C=e?r&&s?` - let col = colIn * ${i}; - ${w}`:` - let col = colIn * ${i}; - if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) { - ${w} - } - return ${Fr(i,u)}(0.0);`:s&&t?` - let col = colIn * ${i}; - ${w}`:` - let col = colIn * ${i}; - if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { - ${w} - } - return ${Fr(i,u)}(0.0);`,E=e?s&&t?c(a):` - let col = colIn * ${a}; - if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { - ${c(a)} - } - return ${Fr(a,u)}(0.0);`:` - let col = colIn * ${a}; - if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) { - ${c(a)} - } - return ${Fr(a,u)}(0.0);`,x=Fr(l,u),b=Fr(e?i:a,u),y=Fr(e?a:i,u),S=On(n,x,u);return` - fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${b} { - ${e?C:E} - } - - fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${y} { - ${e?E:C} - } - - fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${x}) { - let col = colIn * ${l}; - if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) - { - var value = valueIn; - let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"}; - ${_} - ${by(o)} - ${S} - setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); - } - }`},yy=(e,r,t,s,o,n,i,a,l)=>{let u=r.format==="NHWC",p=u?e[0].dims[3]:e[0].dims[1],c=t[0],d=u?t[2]:t[3],_=u?t[1]:t[2],f=u?t[3]:t[1],v=u&&(p%4===0||p%3===0)&&f%4===0,$=u?f:d*_,g=u?d*_:f,w=[8,8,1],C=s<=8?[4,1,1]:[4,4,1],E=[Math.ceil($/w[0]/C[0]),Math.ceil(g/w[1]/C[1]),Math.ceil(c/w[2]/C[2])];It("verbose",()=>`[conv2d_mm_webgpu] dispatch = ${E}`);let x=v?u&&p%4!==0?3:4:1,b=w[1]*C[1],y=w[0]*C[0],S=Math.max(w[0]*x,w[1]),F=s%b===0,z=o%y===0,K=n%S===0,q=v?[x,4,4]:[1,1,1],R=[{type:6,data:s},{type:6,data:o},{type:6,data:n},{type:6,data:[r.pads[0],r.pads[1]]},{type:6,data:r.strides},{type:6,data:r.dilations}];Dn(r,R),R.push(...ut(e[0].dims,e[1].dims));let Z=["rank","rank"];i&&(R.push(...ut(e[2].dims)),Z.push("rank")),R.push(...ut(t));let H=J=>{let Q=[{name:"dim_a_outer",type:"i32"},{name:"dim_b_outer",type:"i32"},{name:"dim_inner",type:"i32"},{name:"pad",type:"i32",length:2},{name:"stride",type:"i32",length:2},{name:"dilation",type:"i32",length:2}];Ln(r,Q);let se=v?4:1,fe=$r(e[0].dataType),ae=` - fn setOutputAtIndex(flatIndex : i32, value : ${v?`vec4<${fe}>`:fe}) { - result[flatIndex] = ${v?`vec4<${fe}>`:fe}(value); - } - fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${v?`vec4<${fe}>`:fe}) { - let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3)); - setOutputAtIndex(flatIndex ${v?"/ 4":""}, value); - }`,V=Ce("x",e[0].dataType,e[0].dims.length,x===3?1:x),A=Ce("w",e[1].dataType,e[1].dims.length,se),U=[V,A],ee=tt("result",e[0].dataType,t.length,se);if(i){let _e=Ce("bias",e[2].dataType,e[2].dims.length,se);U.push(_e),ae+=` - fn getBiasByOutputCoords(coords : vec4) -> ${v?`vec4<${fe}>`:fe} { - return bias[coords.${u?"w":"y"}${v?"/ 4":""}]; - }`}return` - ${My("uniforms.result_strides")} - //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4, - // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2, - // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 }; - ${J.registerUniforms(Q).declareVariables(...U,ee)} - ${ae} - ${sg(u,F,z,K,i,r,q[0],q[1],q[2],fe)} - ${v?Uu(C,w,fe,void 0,!u,S):Wu(C,w,fe,void 0,!u,S,!1,void 0,a)}`};return{name:"Conv2DMatMul",shaderCache:{hint:`${r.cacheKey};${x};${v};${F};${z};${K};${b};${y};${S}`,inputDependencies:Z},getRunData:()=>({outputs:[{dims:l?l(t):t,dataType:e[0].dataType}],dispatchGroup:{x:E[0],y:E[1],z:E[2]},programUniforms:R}),getShaderSource:H}}}),ng,su,Vo,og,nu,ig,vy,xy,Tx=je(()=>{ft(),Ns(),xt(),Tt(),Bn(),fc(),ng=e=>{let r=1;for(let t=0;ttypeof e=="number"?[e,e,e]:e,Vo=(e,r)=>r<=1?e:e+(e-1)*(r-1),og=(e,r,t,s=1)=>{let o=Vo(r,s);return Math.floor((e[0]*(t-1)-t+o)/2)},nu=(e,r,t,s,o)=>{o==null&&(o=og(e,r[0],s[0]));let n=[0,0,0,t];for(let i=0;i<3;i++)e[i]+2*o>=r[i]&&(n[i]=Math.trunc((e[i]-r[i]+2*o)/s[i]+1));return n},ig=(e,r,t,s,o,n,i,a,l,u)=>{let p,c,d,_;if(e==="VALID"&&(e=0),typeof e=="number"){p={top:e,bottom:e,left:e,right:e,front:e,back:e};let f=nu([r,t,s,1],[a,l,u],1,[o,n,i],e);c=f[0],d=f[1],_=f[2]}else if(Array.isArray(e)){if(!e.every((v,$,g)=>v===g[0]))throw Error(`Unsupported padding parameter: ${e}`);p={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let f=nu([r,t,s,1],[a,l,u],1,[o,n,i],e[0]);c=f[0],d=f[1],_=f[2]}else if(e==="SAME_UPPER"){c=Math.ceil(r/o),d=Math.ceil(t/n),_=Math.ceil(s/i);let f=(c-1)*o+a-r,v=(d-1)*n+l-t,$=(_-1)*i+u-s,g=Math.floor(f/2),w=f-g,C=Math.floor(v/2),E=v-C,x=Math.floor($/2),b=$-x;p={top:C,bottom:E,left:x,right:b,front:g,back:w}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:p,outDepth:c,outHeight:d,outWidth:_}},vy=(e,r,t,s,o,n=!1,i="channelsLast")=>{let a,l,u,p,c;if(i==="channelsLast")[a,l,u,p,c]=e;else if(i==="channelsFirst")[a,c,l,u,p]=e;else throw new Error(`Unknown dataFormat ${i}`);let[d,,_,f,v]=r,[$,g,w]=su(t),[C,E,x]=su(s),b=Vo(_,C),y=Vo(f,E),S=Vo(v,x),{padInfo:F,outDepth:z,outHeight:K,outWidth:q}=ig(o,l,u,p,$,g,w,b,y,S),R=n?d*c:d,Z=[0,0,0,0,0];return i==="channelsFirst"?Z=[a,R,z,K,q]:i==="channelsLast"&&(Z=[a,z,K,q,R]),{batchSize:a,dataFormat:i,inDepth:l,inHeight:u,inWidth:p,inChannels:c,outDepth:z,outHeight:K,outWidth:q,outChannels:R,padInfo:F,strideDepth:$,strideHeight:g,strideWidth:w,filterDepth:_,filterHeight:f,filterWidth:v,effectiveFilterDepth:b,effectiveFilterHeight:y,effectiveFilterWidth:S,dilationDepth:C,dilationHeight:E,dilationWidth:x,inShape:e,outShape:Z,filterShape:r}},xy=(e,r,t,s,o,n)=>{let i=n==="channelsLast";i?e[0].dims[3]:e[0].dims[1];let a=[64,1,1],l={x:t.map(($,g)=>g)},u=[Math.ceil(ng(l.x.map($=>t[$]))/a[0]),1,1];It("verbose",()=>`[conv3d_naive_webgpu] dispatch = ${u}`);let p=1,c=Me.size(t),d=[{type:12,data:c},{type:12,data:s},{type:12,data:o},{type:12,data:r.strides},{type:12,data:r.dilations}];Dn(r,d),d.push(...ut(e[0].dims,e[1].dims));let _=["rank","rank"],f=e.length===3;f&&(d.push(...ut(e[2].dims)),_.push("rank")),d.push(...ut(t));let v=$=>{let g=[{name:"output_size",type:"u32"},{name:"filter_dims",type:"u32",length:s.length},{name:"pads",type:"u32",length:o.length},{name:"strides",type:"u32",length:r.strides.length},{name:"dilations",type:"u32",length:r.dilations.length}];Ln(r,g);let w=1,C=$r(e[0].dataType),E=Ce("x",e[0].dataType,e[0].dims.length,p),x=Ce("W",e[1].dataType,e[1].dims.length,w),b=[E,x],y=tt("result",e[0].dataType,t.length,w),S="";if(f){let K=Ce("bias",e[2].dataType,e[2].dims.length,w);b.push(K),S+=` - fn getBiasByOutputCoords(coords : array) -> ${C} { - return bias[${i?ot("coords",4,5):ot("coords",1,5)}]; - }`}let F=Fr(p,C),z=On(r,F,C);return` - ${S} - fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { - let aIndices = array(d0, d1, d2, d3, d4); - return ${E.getByIndices("aIndices")}; - } - fn getW(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { - let aIndices = array(d0, d1, d2, d3, d4); - return ${x.getByIndices("aIndices")}; - } - ${$.registerUniforms(g).declareVariables(...b,y)} - ${$.mainStart()} - ${$.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let coords = ${y.offsetToIndices("global_idx")}; - let batch = ${ot("coords",0,E.rank)}; - let d2 = ${i?ot("coords",E.rank-1,E.rank):ot("coords",1,E.rank)}; - let xFRCCorner = vec3(${i?ot("coords",1,E.rank):ot("coords",2,E.rank)}, - ${i?ot("coords",2,E.rank):ot("coords",3,E.rank)}, - ${i?ot("coords",3,E.rank):ot("coords",4,E.rank)}) * uniforms.strides - uniforms.pads; - let xFCorner = xFRCCorner.x; - let xRCorner = xFRCCorner.y; - let xCCorner = xFRCCorner.z; - let xShapeY = ${i?ot("uniforms.x_shape",1,E.rank):ot("uniforms.x_shape",2,E.rank)}; - let xShapeZ = ${i?ot("uniforms.x_shape",2,E.rank):ot("uniforms.x_shape",3,E.rank)}; - let xShapeW = ${i?ot("uniforms.x_shape",3,E.rank):ot("uniforms.x_shape",4,E.rank)}; - let xShapeU = ${i?ot("uniforms.x_shape",4,E.rank):ot("uniforms.x_shape",1,E.rank)}; - let inputDepthNearestVec4 = (xShapeU / 4) * 4; - let inputDepthVec4Remainder = xShapeU % 4; - - var value = 0.0; - for (var wF = 0u; wF < uniforms.filter_dims[0]; wF++) { - let xF = xFCorner + wF * uniforms.dilations[0]; - if (xF < 0 || xF >= xShapeY) { - continue; - } - - for (var wR = 0u; wR < uniforms.filter_dims[1]; wR++) { - let xR = xRCorner + wR * uniforms.dilations[1]; - if (xR < 0 || xR >= xShapeZ) { - continue; - } - - for (var wC = 0u; wC < uniforms.filter_dims[2]; wC++) { - let xC = xCCorner + wC * uniforms.dilations[2]; - if (xC < 0 || xC >= xShapeW) { - continue; - } - - for (var d1 = 0u; d1 < inputDepthNearestVec4; d1 += 4) { - ${i?`let xValues = vec4( - getX(batch, xF, xR, xC, d1), - getX(batch, xF, xR, xC, d1 + 1), - getX(batch, xF, xR, xC, d1 + 2), - getX(batch, xF, xR, xC, d1 + 3)); - `:`let xValues = vec4( - getX(batch, d1, xF, xR, xC), - getX(batch, d1 + 1, xF, xR, xC), - getX(batch, d1 + 2, xF, xR, xC), - getX(batch, d1 + 3, xF, xR, xC)); - `} - let wValues = vec4( - getW(d2, d1, wF, wR, wC), - getW(d2, d1 + 1, wF, wR, wC), - getW(d2, d1 + 2, wF, wR, wC), - getW(d2, d1 + 3, wF, wR, wC)); - value += dot(xValues, wValues); - } - if (inputDepthVec4Remainder == 1) { - ${i?`value += getX(batch, xF, xR, xC, inputDepthNearestVec4) - * getW(d2, inputDepthNearestVec4, wF, wR, wC);`:`value += getX(batch, inputDepthNearestVec4, xF, xR, xC) - * getW(d2, inputDepthNearestVec4, wF, wR, wC);`} - } else if (inputDepthVec4Remainder == 2) { - ${i?`let xValues = vec2( - getX(batch, xF, xR, xC, inputDepthNearestVec4), - getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)); - `:`let xValues = vec2( - getX(batch, inputDepthNearestVec4, xF, xR, xC), - getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC)); - `} - let wValues = vec2( - getW(d2, inputDepthNearestVec4, wF, wR, wC), - getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC)); - value += dot(xValues, wValues); - } else if (inputDepthVec4Remainder == 3) { - ${i?`let xValues = vec3( - getX(batch, xF, xR, xC, inputDepthNearestVec4), - getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1), - getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)); - `:`let xValues = vec3( - getX(batch, inputDepthNearestVec4, xF, xR, xC), - getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC), - getX(batch, inputDepthNearestVec4 + 2, xF, xR, xC)); - `} - let wValues = vec3( - getW(d2, inputDepthNearestVec4, wF, wR, wC), - getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC), - getW(d2, inputDepthNearestVec4 + 2, wF, wR, wC)); - value += dot(xValues, wValues); - } - } - } - } - ${f?"value = value + getBiasByOutputCoords(coords)":""}; - ${z} - result[global_idx] = f32(value); - }`};return{name:"Conv3DNaive",shaderCache:{hint:`${r.cacheKey};${i};${p};${f}`,inputDependencies:_},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:u[0],y:u[1],z:u[2]},programUniforms:d}),getShaderSource:v}}}),Ty,Ey,Ex=je(()=>{ft(),xt(),Tt(),Bn(),Ty=(e,r,t,s)=>{let o=e.length>2,n=o?"value += b[output_channel];":"",i=e[0].dims,a=e[1].dims,l=r.format==="NHWC",u=l?t[3]:t[1],p=u/r.group,c=l&&p>=4?nr(u):1,d=Me.size(t)/c,_=[{type:12,data:d},{type:12,data:r.dilations},{type:12,data:[r.strides[0],r.strides[1]]},{type:12,data:[r.pads[0],r.pads[1]]},{type:12,data:p}];Dn(r,_),_.push(...ut(i,[a[0],a[1],a[2],a[3]/c]));let f=o?["rank","rank","rank"]:["rank","rank"];_.push(...ut([t[0],t[1],t[2],t[3]/c]));let v=$=>{let g=tt("output",e[0].dataType,t.length,c),w=$r(g.type.tensor),C=On(r,g.type.value,w),E=Ce("x",e[0].dataType,i.length),x=Ce("w",e[1].dataType,a.length,c),b=[E,x];o&&b.push(Ce("b",e[2].dataType,e[2].dims,c));let y=[{name:"output_size",type:"u32"},{name:"dilations",type:"u32",length:r.dilations.length},{name:"strides",type:"u32",length:2},{name:"pads",type:"u32",length:2},{name:"output_channels_per_group",type:"u32"}];Ln(r,y);let S=l?` - for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) { - let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; - - if (xHeight < 0u || xHeight >= uniforms.x_shape[1]) { - continue; - } - - for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[1]; wWidth++) { - let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; - if (xWidth < 0u || xWidth >= uniforms.x_shape[2]) { - continue; - } - - for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[2]; wInChannel++) { - let input_channel = in_channel_offset + wInChannel; - let xVal = ${E.get("batch","xHeight","xWidth","input_channel")}; - let wVal = ${x.get("wHeight","wWidth","wInChannel","output_channel")}; - value += xVal * wVal; - } - } - } - `:` - for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) { - let input_channel = in_channel_offset + wInChannel; - for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) { - let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; - - if (xHeight < 0u || xHeight >= uniforms.x_shape[2]) { - continue; - } - - for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) { - let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; - if (xWidth < 0u || xWidth >= uniforms.x_shape[3]) { - continue; - } - - let xVal = ${E.get("batch","input_channel","xHeight","xWidth")}; - let wVal = ${x.get("output_channel","wInChannel","wHeight","wWidth")}; - value += xVal * wVal; - } - } - } - `;return` - ${$.registerUniforms(y).declareVariables(...b,g)} - - ${$.mainStart()} - ${$.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let outputIndices = ${g.offsetToIndices("global_idx")}; - let batch: u32 = outputIndices[0]; - let output_channel: u32 = outputIndices[${l?3:1}]; - let xRCCorner: vec2 = vec2(outputIndices[${l?1:2}], outputIndices[${l?2:3}]) * uniforms.strides - uniforms.pads; - let group_id: u32 = output_channel * ${c} / uniforms.output_channels_per_group; - var in_channel_offset = group_id * uniforms.w_shape[${l?2:1}]; - - var value: ${g.type.value} = ${g.type.value}(0); - ${S} - ${n} - ${C} - ${g.setByOffset("global_idx","value")} - }`};return{name:"GroupedConv",shaderCache:{hint:`${r.cacheKey}_${c}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:s?s(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:_}),getShaderSource:v}},Ey=(e,r,t,s)=>{let o=e.length>2,n=nr(t[3]),i=nr(t[2]),a=Me.size(t)/n/i,l=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/n],u=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/n],p=[t[0],t[1],t[2],t[3]/n],c=[{type:12,data:a},{type:6,data:[r.strides[0],r.strides[1]]},{type:6,data:[r.pads[0],r.pads[1]]}];Dn(r,c),c.push(...ut(l,u,p));let d=(i-1)*r.strides[1]+u[1],_=f=>{let v=tt("output",e[0].dataType,p.length,n),$=$r(v.type.tensor),g=On(r,v.type.value,$),w=Ce("x",e[0].dataType,l.length,n),C=Ce("w",e[1].dataType,u.length,n),E=[w,C];o&&E.push(Ce("b",e[2].dataType,e[2].dims,n));let x=o?"value += b[output_channel];":"",b=[{name:"output_size",type:"u32"},{name:"strides",type:"i32",length:2},{name:"pads",type:"i32",length:2}];return Ln(r,b),` - ${f.registerUniforms(b).declareVariables(...E,v)} - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let width0 = uniforms.output_shape[3]; - let output_channel = global_idx % width0; - var index1 = global_idx / width0; - let width1 = uniforms.output_shape[2] / ${i}u; - let col = (index1 % width1) * ${i}u; - index1 = index1 / width1; - let row = index1 % uniforms.output_shape[1]; - let batch = index1 / uniforms.output_shape[1]; - - let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads; - - var x_vals: array<${w.type.value}, ${d}>; - var values: array<${v.type.value}, ${i}>; - let input_channel = output_channel; - // Use constant instead of uniform can give better performance for w's height/width. - for (var w_height: u32 = 0u; w_height < ${u[0]}; w_height++) { - let x_height = x_corner.x + i32(w_height); - if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) { - for (var i = 0; i < ${d}; i++) { - let x_width = x_corner.y + i; - if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) { - x_vals[i] = ${w.get("batch","u32(x_height)","u32(x_width)","input_channel")}; - } else { - x_vals[i] = ${w.type.value}(0); - } - } - for (var w_width: u32 = 0u; w_width < ${u[1]}; w_width++) { - let w_val = ${C.get("w_height","w_width","0","output_channel")}; - for (var i = 0u; i < ${i}u; i++) { - values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]); - } - } - } - } - - for (var i = 0u; i < ${i}u; i++) { - var value = values[i]; - ${x} - ${g} - ${v.set("batch","row","col + i","output_channel","value")}; - } - }`};return{name:"GroupedConv-Vectorize",shaderCache:{hint:`${r.cacheKey};${n};${i};${d};${u[0]};${u[1]}`,inputDependencies:o?["rank","rank","type"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:s?s(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:c}),getShaderSource:_}}}),ag,ra,lg,sa,Gu,ou,ug,cg,Ku,Px=je(()=>{xt(),xx(),Tx(),wc(),Ex(),Bn(),gc(),tn(),ag=(e,r,t,s,o,n)=>{let i=e[0],a=e.slice(n?1:2,n?3:4),l=a.length,u=r[0],p=r.slice(2).map((d,_)=>d+(d-1)*(t[_]-1)),c=a.map((d,_)=>d+s[_]+s[_+l]).map((d,_)=>Math.floor((d-p[_]+o[_])/o[_]));return c.splice(0,0,i),c.splice(n?3:1,0,u),c},ra=[2,3,1,0],lg=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length>5)throw new Error("greater than 5D is not supported");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let t=e[0].dims[r.format==="NHWC"?e[0].dims.length-1:1],s=e[1].dims[1]*r.group;if(t!==s)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");let o=e[0].dims.length-2;if(r.dilations.length!==o)throw new Error(`dilations should be ${o}D`);if(r.strides.length!==o)throw new Error(`strides should be ${o}D`);if(r.pads.length!==o*2)throw new Error(`pads should be ${o*2}D`);if(r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape")},sa=(e,r)=>{let t=e.kernelShape.slice();t.length{let r=mc(e),t=e.format,s=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],o=e.dilations,n=e.group,i=e.kernel_shape,a=e.pads,l=e.strides,u=e.w_is_const();return{autoPad:s,format:t,dilations:o,group:n,kernelShape:i,pads:a,strides:l,wIsConst:u,...r,cacheKey:`${e.format};${r.activation};`}},ou=(e,r,t,s)=>{let o=t.format==="NHWC",n=ag(r[0].dims,r[1].dims,t.dilations,t.pads,t.strides,o);if(t.group!==1){let b=[r[0]];if(o){let y=e.kernelCustomData.wT??e.compute(Yr(r[1],ra),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=y),b.push(y)}else b.push(r[1]);r.length===3&&b.push(r[2]),!e.adapterInfo.isArchitecture("ampere")&&o&&r[1].dims[0]===t.group&&r[1].dims[1]===1&&t.dilations[0]===1&&t.dilations[1]===1?e.compute(Ey(b,t,n,s),{inputs:b}):e.compute(Ty(b,t,n,s),{inputs:b});return}let i=r.length===3,a=r[0].dims[o?1:2],l=r[0].dims[o?2:3],u=r[0].dims[o?3:1],p=r[1].dims[2],c=r[1].dims[3],d=n[o?1:2],_=n[o?2:3],f=n[o?3:1],v=o&&p===a&&c===l&&t.pads[0]===0&&t.pads[1]===0;if(v||p===1&&c===1&&t.dilations[0]===1&&t.dilations[1]===1&&t.strides[0]===1&&t.strides[1]===1&&t.pads[0]===0&&t.pads[1]===0){let b=n[0],y,S,F,z=[];if(o){let R=e.kernelCustomData.wT??e.compute(Yr(r[1],ra),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];if(t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=R),v){let Z=a*l*u;y=r[0].reshape([1,b,Z]),S=R.reshape([1,Z,f]),F=[1,b,f]}else y=r[0].reshape([b,a*l,u]),S=R.reshape([1,u,f]),F=[b,d*_,f];z.push(y),z.push(S)}else y=r[0].reshape([b,u,a*l]),S=r[1].reshape([1,f,u]),F=[b,f,d*_],z.push(S),z.push(y);i&&z.push(r[2]);let K=F[2],q=z[0].dims[z[0].dims.length-1];K<8&&q<8?e.compute(_c(z,t,n,F,o,s),{inputs:z}):e.compute(_a(z,t,n,F,o,s),{inputs:z});return}let $=!0,g=e.kernelCustomData.wT??e.compute(Yr(r[1],ra),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=g);let w=[r[0],g];i&&w.push(r[2]);let C=o?d*_:f,E=o?f:d*_,x=p*c*u;e.compute(yy(w,t,n,C,E,x,i,$,s),{inputs:w})},ug=(e,r)=>{let t=r.format==="NHWC",s=[e.inputs[0].reshape(t?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&s.push(e.inputs[2]);let o=[0,r.pads[0],0,r.pads[1]],n=[1].concat(r.strides),i=[1].concat(r.dilations),a=[1].concat(r.kernelShape),l=sa({...r,pads:o,strides:n,dilations:i,kernelShape:a},s);ou(e,s,l,u=>t?[u[0],u[2],u[3]]:[u[0],u[1],u[3]])},cg=(e,r,t)=>{let s=t.format==="NHWC"?"channelsLast":"channelsFirst",o=sa(t,r),n=t.autoPad==="NOTSET"?t.pads:t.autoPad,i=vy(r[0].dims,r[1].dims,t.strides,t.dilations,n,!1,s);e.compute(xy(r,o,i.outShape,[i.filterDepth,i.filterHeight,i.filterWidth],[i.padInfo.front,i.padInfo.top,i.padInfo.left],s))},Ku=(e,r)=>{if(lg(e.inputs,r),e.inputs[0].dims.length===3)ug(e,r);else if(e.inputs[0].dims.length===5)cg(e,e.inputs,r);else{let t=sa(r,e.inputs);ou(e,e.inputs,t)}}}),Py,Cx=je(()=>{ft(),Ns(),xt(),Tt(),Py=(e,r,t)=>{let s=e.length>2,o=r.outputShape,n=r.format==="NHWC",i=r.group,a=e[1].dims,l=a[2]/i,u=a[3],p=n?nr(l):1,c=n&&u===1&&l>=4,d=c?Math.floor(l/4)*4:Math.floor(l/p)*p,_=l-d,f=n?nr(u):1,v=n?u===1?p:f:1,$=Me.size(o)/f,g=[Math.ceil($/64),1,1];It("verbose",()=>`[conv2d_backprop_webgpu] dispatch = ${g}`);let w=["rank","rank"],C=[r.strides[0],r.strides[1]],E=[r.kernelShape[n?1:2],r.kernelShape[n?2:3]],x=[r.dilations[0],r.dilations[1]],b=[E[0]+(r.dilations[0]<=1?0:(r.kernelShape[n?1:2]-1)*(r.dilations[0]-1)),E[1]+(r.dilations[1]<=1?0:(r.kernelShape[n?2:3]-1)*(r.dilations[1]-1))],y=[b[0]-1-Math.floor((r.pads[0]+r.pads[2])/2),b[1]-1-Math.floor((r.pads[1]+r.pads[3])/2)],S=[{type:12,data:$},{type:12,data:C},{type:12,data:E},{type:12,data:x},{type:12,data:b},{type:6,data:y},{type:12,data:d},{type:12,data:l},{type:12,data:u},...ut(e[0].dims,e[1].dims)];s&&(S.push(...ut(e[2].dims)),w.push("rank")),S.push(...ut(o));let F=z=>{let K=[{name:"output_size",type:"u32"},{name:"strides",type:"u32",length:C.length},{name:"filter_dims",type:"u32",length:E.length},{name:"dilations",type:"u32",length:E.length},{name:"effective_filter_dims",type:"u32",length:b.length},{name:"pads",type:"i32",length:y.length},{name:"input_channels_per_group_int",type:"u32"},{name:"input_channels_per_group",type:"u32"},{name:"output_channels_per_group",type:"u32"}],q=$r(e[0].dataType),R=n?1:2,Z=n?2:3,H=n?3:1,J=Ce("W",e[1].dataType,e[1].dims.length,v),Q=Ce("Dy",e[0].dataType,e[0].dims.length,p),se=[Q,J];s&&se.push(Ce("bias",e[2].dataType,[o[H]].length,f));let fe=tt("result",e[0].dataType,o.length,f),ae=()=>{let U="";if(c)p===4?U+=` - let xValue = ${Q.getByOffset("x_offset")}; - let wValue = ${J.getByOffset("w_offset")}; - dotProd = dotProd + dot(xValue, wValue); - x_offset += 1u; - w_offset += 1u;`:p===2?U+=` - dotProd = dotProd + dot(vec4<${q}>(${Q.getByOffset("x_offset")}, ${Q.getByOffset("x_offset + 1u")}), vec4<${q}>(${J.getByOffset("w_offset")}, ${J.getByOffset("w_offset + 1u")})); - x_offset += 2u; - w_offset += 2u;`:p===1&&(U+=` - dotProd = dotProd + dot(vec4<${q}>(${Q.getByOffset("x_offset")}, ${Q.getByOffset("x_offset + 1u")}, ${Q.getByOffset("x_offset + 2u")}, ${Q.getByOffset("x_offset + 3u")}), vec4<${q}>(${J.getByOffset("w_offset")}, ${J.getByOffset("w_offset + 1u")}, ${J.getByOffset("w_offset + 2u")}, ${J.getByOffset("w_offset + 3u")})); - x_offset += 4u; - w_offset += 4u;`);else if(U+=` - let xValue = ${n?Q.getByOffset(`${Q.indicesToOffset(`${Q.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p}`):Q.get("batch","inputChannel","idyR","idyC")}; - `,p===1)U+=` - let w_offset = ${J.indicesToOffset(`${J.type.indices}(u32(wRPerm), u32(wCPerm), inputChannel, wOutChannel)`)}; - let wValue = ${J.getByOffset(`w_offset / ${v}`)}; - dotProd = dotProd + xValue * wValue;`;else for(let ee=0;ee{if(_===0)return"";if(!c)throw new Error(`packInputAs4 ${c} is not true.`);let U="";if(p===1){U+="dotProd = dotProd";for(let ee=0;ee<_;ee++)U+=` - + ${Q.getByOffset(`x_offset + ${ee}`)} * ${J.getByOffset(`w_offset + ${ee}`)}`;U+=";"}else if(p===2){if(_!==2)throw new Error(`Invalid inputChannelsRemainder ${_}.`);U+=` - let xValue = ${Q.getByOffset("x_offset")}; - let wValue = ${J.getByOffset("w_offset")}; - dotProd = dotProd + dot(xValue, wValue);`}return U},A=` - let outputIndices = ${fe.offsetToIndices(`global_idx * ${f}`)}; - let batch = ${fe.indicesGet("outputIndices",0)}; - let d1 = ${fe.indicesGet("outputIndices",H)}; - let r = ${fe.indicesGet("outputIndices",R)}; - let c = ${fe.indicesGet("outputIndices",Z)}; - let dyCorner = vec2(i32(r), i32(c)) - uniforms.pads; - let dyRCorner = dyCorner.x; - let dyCCorner = dyCorner.y; - let groupId = d1 / uniforms.output_channels_per_group; - let wOutChannel = d1 - groupId * uniforms.output_channels_per_group; - // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). - // ? = to be determined. : = across all values in that axis. - var dotProd = ${fe.type.value}(0.0); - var wR: u32 = 0; - if (uniforms.dilations.x == 1) { - // Minimum wR >= 0 that satisfies (dyRCorner + wR) % (uniforms.strides.x) == 0 - wR = u32(((dyRCorner + i32(uniforms.strides.x) - 1) / i32(uniforms.strides.x)) * i32(uniforms.strides.x) - dyRCorner); - } - for (; wR < uniforms.effective_filter_dims.x; wR = wR + 1) { - if (wR % uniforms.dilations.x != 0) { - continue; - } - let dyR = (${q}(dyRCorner) + ${q}(wR)) / ${q}(uniforms.strides[0]); - let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x; - if (dyR < 0.0 || dyR >= ${q}(uniforms.Dy_shape[${R}]) || fract(dyR) > 0.0 || - wRPerm < 0) { - continue; - } - let idyR: u32 = u32(dyR); - var wC: u32 = 0; - if (uniforms.dilations.y == 1) { - // Minimum wC >= 0 that satisfies (dyCCorner + wC) % (uniforms.strides.y) == 0 - wC = u32(((dyCCorner + i32(uniforms.strides.y) - 1) / i32(uniforms.strides.y)) * i32(uniforms.strides.y) - dyCCorner); - } - for (; wC < uniforms.effective_filter_dims.y; wC = wC + 1) { - if (wC % uniforms.dilations.y != 0) { - continue; - } - let dyC = (${q}(dyCCorner) + ${q}(wC)) / ${q}(uniforms.strides.y); - let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y; - if (dyC < 0.0 || dyC >= ${q}(uniforms.Dy_shape[${Z}]) || - fract(dyC) > 0.0 || wCPerm < 0) { - continue; - } - let idyC: u32 = u32(dyC); - var inputChannel = groupId * uniforms.input_channels_per_group; - ${c?` - var x_offset = ${Q.indicesToOffset(`${Q.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p}; - var w_offset = ${J.indicesToOffset(`${J.type.indices}(wRPerm, wCPerm, inputChannel, wOutChannel)`)} / ${v}; - `:""} - for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group_int; d2 = d2 + ${c?4:p}) { - ${ae()} - inputChannel = inputChannel + ${c?4:p}; - } - ${V()} - wC = wC + uniforms.strides.y - 1; - } - wR = wR + uniforms.strides[0] - 1; - } - let value = dotProd${s?` + bias[d1 / ${f}]`:""}; - ${fe.setByOffset("global_idx","value")}; - `;return` - ${z.registerUniforms(K).declareVariables(...se,fe)} - ${z.mainStart()} - ${z.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}; - ${A}}`};return{name:"ConvTranspose2D",shaderCache:{hint:`${r.cacheKey};${p}${v}${f}${c}${_}`,inputDependencies:w},getRunData:()=>({dispatchGroup:{x:g[0],y:g[1],z:g[2]},outputs:[{dims:t?t(o):o,dataType:e[0].dataType}],programUniforms:S}),getShaderSource:F}}}),dg,pg,hg,iu,Cy,mg,au,fg,Sy,Sx=je(()=>{Cx(),Bn(),tn(),dg=(e,r,t,s,o,n)=>(e-1)*r+t+(s-1)*o+1-n,pg=(e,r,t,s,o)=>{let n=Math.floor(e/2);r==="SAME_UPPER"?(t[s]=n,t[o]=e-n):r==="SAME_LOWER"&&(t[s]=e-n,t[o]=n)},hg=(e,r,t,s,o,n,i,a,l,u)=>{let p=e.length-2,c=u.length===0;l.length{let t=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((c,d)=>c*d,1)===0){t.length=0;for(let c=2;cc+d,0)===0){let c=r[0].dims.length-2;l=new Array(c).fill(1)}let u=e.strides.slice();if(u.reduce((c,d)=>c+d,0)===0){let c=r[0].dims.length-2;u=new Array(c).fill(1)}hg(a,t,l,e.autoPad,e.group,o,u,s,i,n);let p=Object.assign({},e);return Object.assign(p,{kernelShape:t,pads:o,outputPadding:i,outputShape:n,dilations:l,strides:u}),p},Cy=e=>{let r=mc(e),t=e.format,s=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][typeof e.autoPad>"u"?0:e.autoPad],o=e.dilations,n=e.group,i=e.kernelShape,a=e.pads,l=e.strides,u=e.wIsConst(),p=e.outputPadding,c=e.outputShape;return{autoPad:s,format:t,dilations:o,group:n,kernelShape:i,outputPadding:p,outputShape:c,pads:a,strides:l,wIsConst:u,...r,cacheKey:`${e.format};${r.activation};`}},mg=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error("currently only support 2-dimensional conv");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let t=e[0].dims[r.format==="NHWC"?e[0].dims.length-1:1],s=e[1].dims[0];if(t!==s)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");let o=e[1].dims[1]*r.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==o))throw new Error("invalid bias");let n=e[0].dims.length-2;if(r.dilations.reduce((i,a)=>i+a,0)>0&&r.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(r.strides.reduce((i,a)=>i+a,0)>0&&r.strides.length!==n)throw new Error(`strides should be ${n}D`);if(r.pads.reduce((i,a)=>i+a,0)>0&&r.pads.length!==n*2)throw new Error(`pads should be ${n*2}D`);if(r.outputPadding.length!==n&&r.outputPadding.length!==0)throw new Error(`output_padding should be ${n}D`);if(r.kernelShape.reduce((i,a)=>i+a,0)>0&&r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(r.outputShape.length!==0&&r.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape")},au=(e,r,t,s)=>{let o=e.kernelCustomData.wT??e.compute(Yr(r[1],[2,3,0,1]),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=o);let n=[r[0],o];r.length===3&&n.push(r[2]),e.compute(Py(n,t,s),{inputs:n})},fg=(e,r)=>{let t=r.format==="NHWC",s=[e.inputs[0].reshape(t?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&s.push(e.inputs[2]);let o=r.kernelShape;(o.length===0||o[0]===0)&&(o=[e.inputs[1].dims[2]]);let n=r.dilations;(n.length===0||n[0]===0)&&(n=[1]);let i=r.strides;(i.length===0||i[0]===0)&&(i=[1]);let a=r.pads;a.length===0&&(a=[0,0]),a=[0,a[0],0,a[1]],i=[1].concat(i),n=[1].concat(n),o=[1].concat(o);let l=r.outputPadding;l=[0].concat(l);let u=iu({...r,pads:a,strides:i,dilations:n,kernelShape:o,outputPadding:l},s);au(e,s,u,p=>t?[p[0],p[2],p[3]]:[p[0],p[1],p[3]])},Sy=(e,r)=>{if(mg(e.inputs,r),e.inputs[0].dims.length===3)fg(e,r);else{let t=iu(r,e.inputs);au(e,e.inputs,t)}}}),_g,$y,ky,$x=je(()=>{ft(),xt(),lr(),Tt(),_g=(e,r,t,s)=>{let o=Me.size(r),n=r.length,i=Ce("input",e,n),a=tt("output",e,n),l=t.dataType===6?t.getInt32Array()[0]:Number(t.getBigInt64Array()[0]),u=Me.normalizeAxis(l,n),p=c=>{let d=` i32(${i.indicesGet("inputIndices","uniforms.axis")}) `,_=ot("uniforms.input_shape","uniforms.axis",n),f=s.reverse?d+(s.exclusive?" + 1":""):"0",v=s.reverse?_:d+(s.exclusive?"":" + 1");return` - ${c.registerUniform("outputSize","u32").registerUniform("axis","u32").declareVariables(i,a)} - ${c.mainStart()} - ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - var inputIndices = ${a.offsetToIndices("global_idx")}; - var sum = ${a.type.value}(0); - let first : i32 = ${f}; - let last : i32 = ${v}; - for (var i : i32 = first; i < last; i++) { - ${i.indicesSet("inputIndices","uniforms.axis","u32(i)")}; - sum = sum + ${i.getByIndices("inputIndices")}; - } - ${a.setByOffset("global_idx","sum")}; - }`};return{name:"CumSum",shaderCache:{hint:s.cacheKey,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:r,dataType:e}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:[{type:12,data:o},{type:12,data:u},...ut(r,r)]}),getShaderSource:p}},$y=(e,r)=>{let t=e.inputs[0].dims,s=e.inputs[0].dataType,o=e.inputs[1];e.compute(_g(s,t,o,r),{inputs:[0]})},ky=e=>{let r=e.exclusive===1,t=e.reverse===1;return Nt({exclusive:r,reverse:t})}}),gg,wg,bg,Iy,Ay,kx=je(()=>{ft(),xt(),lr(),Tt(),gg=e=>{if(!e||e.length!==1)throw new Error("DepthToSpace requires 1 input.");if(e[0].dims.length!==4)throw new Error("DepthToSpace requires 4D input.")},wg=(e,r,t,s)=>{let o=[];o.push(`fn perm(i: ${s.type.indices}) -> ${t.type.indices} { - var a: ${t.type.indices};`);for(let n=0;n{let t,s,o,n,i,a,l=r.format==="NHWC",u=r.blocksize,p=r.mode==="DCR";l?([t,s,o,n]=e.dims,i=p?[t,s,o,u,u,n/u**2]:[t,s,o,n/u**2,u,u],a=p?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([t,s,o,n]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],i=p?[t,u,u,n/u**2,s,o]:[t,n/u**2,u,u,s,o],a=p?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let c=e.reshape(i),d=c.dims.length,_=e.dataType,f=Ce("a",_,d),v=tt("output",_,d),$=g=>` - ${g.registerUniform("output_size","u32").declareVariables(f,v)} - - ${wg(a,d,f,v)} - - ${g.mainStart()} - ${g.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let indices = ${v.offsetToIndices("global_idx")}; - let aIndices = perm(indices); - - ${v.setByOffset("global_idx",f.getByIndices("aIndices"))} - }`;return{name:"DepthToSpace",shaderCache:{hint:`${e.dims};${r.blocksize};${r.mode}`,inputDependencies:["rank"]},getRunData:g=>{let w=l?[t,s*u,o*u,n/u**2]:[t,n/u**2,s*u,o*u],C=Me.size(w),E=c.dims,x=Me.sortBasedOnPerm(E,a);return{outputs:[{dims:w,dataType:g[0].dataType}],dispatchGroup:{x:Math.ceil(C/64)},programUniforms:[{type:12,data:C},...ut(E,x)]}},getShaderSource:$}},Iy=(e,r)=>{gg(e.inputs),e.compute(bg(e.inputs[0],r))},Ay=e=>Nt({blocksize:e.blocksize,mode:e.mode,format:e.format})}),na,Uo,lu,Mg,yg,vg,xg,uu,Tg,Fy,Oy,Ix=je(()=>{ft(),xt(),lr(),Tt(),na="[a-zA-Z]|\\.\\.\\.",Uo="("+na+")+",lu="^"+Uo+"$",Mg="("+Uo+",)*"+Uo,yg="^"+Mg+"$",vg=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,r){let t=this.symbolToIndices.get(e);t===void 0?t=[r]:t.push(r),this.symbolToIndices.set(e,t)}},xg=class{constructor(e,r){var o;this.equation=r,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=new Array,this.outputDims=[];let[t,s]=r.includes("->")?r.split("->",2):[r,""];if(!t.match(RegExp(yg)))throw new Error("Invalid LHS term");if(t.split(",").forEach((n,i)=>{let a=e[i].dims.slice();if(!n.match(RegExp(lu)))throw new Error("Invalid LHS term");let l=this.processTerm(n,!0,a,i);this.lhs.push(l)}),s==="")s+=[...this.symbolToInfo.entries()].filter(([n,i])=>i.count===1||n==="...").map(([n])=>n).join("");else if(!s.match(RegExp(Uo)))throw new Error("Invalid RHS");(o=s.match(RegExp(na,"g")))==null||o.forEach(n=>{if(n==="...")this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let i=this.symbolToInfo.get(n);if(i===void 0)throw new Error("Invalid RHS symbol");this.outputDims.push(i.dimValue)}}),this.rhs=this.processTerm(s,!1,this.outputDims)}addSymbol(e,r,t){let s=this.symbolToInfo.get(e);if(s!==void 0){if(s.dimValue!==r&&s.count!==1)throw new Error("Dimension mismatch");s.count++,s.inputIndices.push(t)}else s={count:1,dimValue:r,inputIndices:[t]};this.symbolToInfo.set(e,s)}processTerm(e,r,t,s=-1){let o=t.length,n=!1,i=[],a=0;if(!e.match(RegExp(lu))&&!r&&e!=="")throw new Error("Invalid LHS term");let l=e.match(RegExp(na,"g")),u=new vg(s);return l==null||l.forEach((p,c)=>{if(p==="..."){if(n)throw new Error("Only one ellipsis is allowed per input term");n=!0;let d=o-l.length+1;if(d<0)throw new Error("Ellipsis out of bounds");if(i=t.slice(a,a+d),this.hasEllipsis){if(this.ellipsisDims.length!==i.length||this.ellipsisDims.toString()!==i.toString())throw new Error("Ellipsis dimensions mismatch")}else if(r)this.hasEllipsis=!0,this.ellipsisDims=i;else throw new Error("Ellipsis must be specified in the LHS");for(let _=0;_e+"_max",Tg=(e,r,t,s)=>{let o=e.map(u=>u.length).map((u,p)=>Ce(`input${p}`,r,u)),n=Me.size(s),i=tt("output",r,s.length),a=[...t.symbolToInfo.keys()].filter(u=>!t.rhs.symbolToIndices.has(u)),l=u=>{let p=[],c="var prod = 1.0;",d="var sum = 0.0;",_="sum += prod;",f=[],v=[],$=[],g=[],w=t.symbolToInfo.size===t.rhs.symbolToIndices.size;t.symbolToInfo.forEach((E,x)=>{var b;if(t.rhs.symbolToIndices.has(x)){let y=(b=t.rhs.symbolToIndices.get(x))==null?void 0:b[0];y!==void 0&&t.lhs.forEach((S,F)=>{if(E.inputIndices.includes(F)){let z=S.symbolToIndices.get(x);if(z===void 0)throw new Error("Invalid symbol error");z.forEach(K=>{p.push(`${o[F].indicesSet(`input${F}Indices`,K,i.indicesGet("outputIndices",y))}`)})}})}else t.lhs.forEach((y,S)=>{if(E.inputIndices.includes(S)){let F=y.symbolToIndices.get(x);if(F===void 0)throw new Error("Invalid symbol error");F.forEach(z=>{f.push(`${o[S].indicesSet(`input${S}Indices`,z,`${x}`)}`)}),g.push(`prod *= ${o[S].getByIndices(`input${S}Indices`)};`)}}),v.push(`for(var ${x}: u32 = 0; ${x} < uniforms.${uu(x)}; ${x}++) {`),$.push("}")});let C=w?[...p,`let sum = ${o.map((E,x)=>E.getByIndices(`input${x}Indices`)).join(" * ")};`]:[...p,d,...v,...f,c,...g,_,...$];return` - ${u.registerUniforms(a.map(E=>({name:`${uu(E)}`,type:"u32"}))).registerUniform("outputSize","u32").declareVariables(...o,i)} - - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - var outputIndices = ${i.offsetToIndices("global_idx")}; - ${o.map((E,x)=>`var input${x}Indices: ${o[x].type.indices};`).join(` -`)} - ${C.join(` -`)}; - ${i.setByOffset("global_idx","sum")}; - }`};return{name:"Einsum",shaderCache:{hint:t.equation,inputDependencies:e.map(()=>"rank")},getRunData:()=>{let u=a.filter(c=>t.symbolToInfo.has(c)).map(c=>{var d;return{type:12,data:((d=t.symbolToInfo.get(c))==null?void 0:d.dimValue)||0}});u.push({type:12,data:n});let p=e.map((c,d)=>[...ut(c)]).reduce((c,d)=>c.concat(d),u);return p.push(...ut(s)),{outputs:[{dims:s,dataType:r}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:p}},getShaderSource:l}},Fy=(e,r)=>{let t=new xg(e.inputs,r.equation),s=t.outputDims,o=e.inputs.map((n,i)=>n.dims);e.compute(Tg(o,e.inputs[0].dataType,t,s))},Oy=e=>{let r=e.equation.replace(/\s+/g,"");return Nt({equation:r})}}),Eg,cu,Pg,Cg,Dy,Ax=je(()=>{ft(),xt(),Tt(),Eg=e=>{if(!e||e.length!==2)throw new Error("Expand requires 2 input.");let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),s=t.length{let t=e.length-r.length,s=[];for(let o=0;oe.length>r.length?cu(e,r):cu(r,e),Cg=e=>{let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),s=Pg(r,t),o=e[0].dataType,n=o===9||Me.size(r)===1,i=o===9||r.length>0&&r[r.length-1]%4===0?4:1,a=n||s.length>0&&s[s.length-1]%4===0?4:1,l=Math.ceil(Me.size(s)/a),u=c=>{let d=Ce("input",o,r.length,i),_=tt("output",o,s.length,a),f;if(o===9){let v=($,g,w="")=>` - let outputIndices${g} = ${_.offsetToIndices(`outputOffset + ${g}u`)}; - let offset${g} = ${d.broadcastedIndicesToOffset(`outputIndices${g}`,_)}; - let index${g} = offset${g} / 4u; - let component${g} = offset${g} % 4u; - ${$}[${g}] = ${w}(${d.getByOffset(`index${g}`)}[component${g}]); - `;f=` - let outputOffset = global_idx * ${a}; - var data = vec4(0); - ${v("data",0,"u32")} - ${v("data",1,"u32")} - ${v("data",2,"u32")} - ${v("data",3,"u32")} - ${_.setByOffset("global_idx","data")} - }`}else f=` - let outputIndices = ${_.offsetToIndices(`global_idx * ${a}`)}; - let inputOffset = ${d.broadcastedIndicesToOffset("outputIndices",_)}; - let data = ${_.type.value}(${d.getByOffset(`inputOffset / ${i}`)}); - ${_.setByOffset("global_idx","data")} - }`;return` - ${c.registerUniform("vec_size","u32").declareVariables(d,_)} - ${c.mainStart()} - ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - ${f}`},p=[{type:12,data:l},...ut(r,s)];return{name:"Expand",shaderCache:{hint:`${s.length};${i}${a}`,inputDependencies:["rank"]},getShaderSource:u,getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:p})}},Dy=e=>{Eg(e.inputs),e.compute(Cg(e.inputs),{inputs:[0]})}}),Sg,Ly,Fx=je(()=>{ft(),xt(),Tt(),hc(),Sg=e=>{let r=e[0].dataType,t=Me.size(e[0].dims),s=Me.size(e[1].dims),o=s%4===0,n=i=>{let a=Ce("x",r,[1],4),l=Ce("bias",r,[1],4),u=tt("y",r,[1],4),p=[{name:"output_vec_size",type:"u32"},{name:"bias_size",type:"u32"}],c=_=>` - let bias${_}_offset: u32 = (global_idx * 4 + ${_}) % uniforms.bias_size; - let bias${_} = ${l.getByOffset(`bias${_}_offset / 4`)}[bias${_}_offset % 4];`,d=o?` - let bias = ${l.getByOffset("global_idx % (uniforms.bias_size / 4)")};`:`${c(0)}${c(1)}${c(2)}${c(3)} - let bias = ${a.type.value}(bias0, bias1, bias2, bias3);`;return`${i.registerUniforms(p).declareVariables(a,l,u)} - - ${Nu(Rr(r))} - - ${i.mainStart(oo)} - ${i.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_vec_size")} - - let x = ${a.getByOffset("global_idx")}; - ${d} - let x_in = x + bias; - ${u.setByOffset("global_idx",Vu("x_in"))} - }`};return{name:"FastGeluWithBias",shaderCache:{hint:`${o}`,inputDependencies:["type","type"]},getShaderSource:n,getRunData:i=>({outputs:[{dims:i[0].dims,dataType:i[0].dataType}],programUniforms:[{type:12,data:Math.ceil(t/4)},{type:12,data:s}],dispatchGroup:{x:Math.ceil(t/oo/4)}})}},Ly=e=>{e.inputs.length<2||Me.size(e.inputs[1].dims)===0?ry(e):e.compute(Sg(e.inputs))}}),$g,kg,zy,By,Ox=je(()=>{ft(),xt(),lr(),Tt(),$g=e=>{if(!e||e.length!==2)throw new Error("Gather requires 2 inputs.")},kg=(e,r)=>{let t=e[0].dims,s=e[1].dims,o=t.length,n=Me.normalizeAxis(r.axis,o),i=t.slice(0);i.splice(n,1,...s);let a=t[n],l=e[0].dataType===9?4:1,u=Math.ceil(Me.size(i)/l),p=[{type:12,data:u},{type:6,data:a},{type:12,data:n},...ut(e[0].dims,e[1].dims,i)],c=d=>{let _=Ce("data",e[0].dataType,e[0].dims.length,l),f=Ce("inputIndices",e[1].dataType,e[1].dims.length),v=tt("output",e[0].dataType,i.length,l),$=w=>{let C=s.length,E=`var indicesIndices${w} = ${f.type.indices}(0);`;for(let x=0;x1?`indicesIndices${w}[${x}]`:`indicesIndices${w}`} = ${i.length>1?`outputIndices${w}[uniforms.axis + ${x}]`:`outputIndices${w}`};`;E+=` - var idx${w} = ${f.getByIndices(`indicesIndices${w}`)}; - if (idx${w} < 0) { - idx${w} = idx${w} + uniforms.axisDimLimit; - } - var dataIndices${w} : ${_.type.indices}; - `;for(let x=0,b=0;x1?`dataIndices${w}[${x}]`:`dataIndices${w}`} = u32(idx${w});`,b+=C):(E+=`${o>1?`dataIndices${w}[${x}]`:`dataIndices${w}`} = ${i.length>1?`outputIndices${w}[${b}]`:`outputIndices${w}`};`,b++);return E},g;if(e[0].dataType===9){let w=(C,E,x="")=>` - let outputIndices${E} = ${v.offsetToIndices(`outputOffset + ${E}u`)}; - ${$(E)}; - let offset${E} = ${_.indicesToOffset(`dataIndices${E}`)}; - let index${E} = offset${E} / 4u; - let component${E} = offset${E} % 4u; - ${C}[${E}] = ${x}(${_.getByOffset(`index${E}`)}[component${E}]); - `;g=` - let outputOffset = global_idx * ${l}; - var value = vec4(0); - ${w("value",0,"u32")} - ${w("value",1,"u32")} - ${w("value",2,"u32")} - ${w("value",3,"u32")} - ${v.setByOffset("global_idx","value")} - `}else g=` - let outputIndices = ${v.offsetToIndices("global_idx")}; - ${$("")}; - let value = ${_.getByIndices("dataIndices")}; - ${v.setByOffset("global_idx","value")}; - `;return` - ${d.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(_,f,v)} - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - ${g} - }`};return{name:"Gather",shaderCache:{hint:r.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:p}),getShaderSource:c}},zy=e=>Nt({axis:e.axis}),By=(e,r)=>{let t=e.inputs;$g(t),e.compute(kg(e.inputs,r))}}),Ig,Ry,jy,Dx=je(()=>{ft(),xt(),Tt(),Ig=(e,r,t,s,o,n,i,a,l)=>{let u=[{type:12,data:n},{type:12,data:s},{type:12,data:o},{type:12,data:t},{type:12,data:i},{type:12,data:a},{type:12,data:l}],p=[n];u.push(...ut(r.dims,p));let c=d=>{let _=Ce("indices_data",r.dataType,r.dims.length),f=tt("input_slice_offsets_data",12,1,1),v=[_,f],$=[{name:"output_size",type:"u32"},{name:"batch_dims",type:"u32"},{name:"input_dims",type:"u32",length:o.length},{name:"sizes_from_slice_dims_data",type:"u32",length:t.length},{name:"num_slices_per_batch",type:"u32"},{name:"input_batch_stride",type:"u32"},{name:"num_slice_dims",type:"u32"}];return` - ${d.registerUniforms($).declareVariables(...v)} - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let batch_idx = global_idx / uniforms.num_slices_per_batch; - let base_offset = batch_idx * uniforms.input_batch_stride; - - let slice_indices_base_offset = global_idx * uniforms.num_slice_dims; - var relative_slice_offset = 0; - for (var dim_idx = 0u; dim_idx < uniforms.num_slice_dims; dim_idx ++) { - var index = i32(indices_data[dim_idx + slice_indices_base_offset].x); - let input_dim_idx = uniforms.batch_dims + dim_idx; - if (index < 0) { - ${o.length===1?"index += i32(uniforms.input_dims);":"index += i32(uniforms.input_dims[input_dim_idx]);"} - } - ${t.length===1?"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data);":"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data[dim_idx]);"} - } - - input_slice_offsets_data[global_idx] = base_offset + u32(relative_slice_offset); - }`};return e.compute({name:"computeSliceOffsets",shaderCache:{hint:`${o.length}_${t.length}`,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:p,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:u}),getShaderSource:c},{inputs:[r],outputs:[-1]})[0]},Ry=(e,r)=>{let t=e.inputs,s=t[0].dims,o=t[0].dataType,n=t[1].dims,i=n[n.length-1],a=Me.sizeToDimension(n,n.length-1),l=Me.sizeFromDimension(s,r.batchDims+i),u=Me.sizeToDimension(s,r.batchDims),p=Me.sizeFromDimension(s,r.batchDims),c=a/u,d=new Array(i),_=l;for(let E=0;Es.length)throw new Error("last dimension of indices must not be larger than rank of input tensor");let $=n.slice(0,-1).concat(s.slice(v)),g=Me.size($),w=[{type:12,data:g},{type:12,data:l},...ut(t[0].dims,f.dims,$)],C=E=>{let x=Ce("data",t[0].dataType,t[0].dims.length),b=Ce("slice_offsets",12,f.dims.length),y=tt("output",t[0].dataType,$.length);return` - ${E.registerUniform("output_size","u32").registerUniform("slice_size","u32").declareVariables(x,b,y)} - ${E.mainStart()} - ${E.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let slice_offset = slice_offsets[global_idx / uniforms.slice_size]; - output[global_idx] = data[u32(slice_offset) + global_idx % uniforms.slice_size]; - }`};e.compute({name:"GatherND",shaderCache:{hint:r.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:$,dataType:o}],dispatchGroup:{x:Math.ceil(g/64)},programUniforms:w}),getShaderSource:C},{inputs:[t[0],f]})},jy=e=>({batchDims:e.batch_dims,cacheKey:""})}),Ag,Fg,Ny,Vy,Lx=je(()=>{ft(),xt(),lr(),Tt(),Ag=(e,r)=>{if(e.length<3||e.length>4)throw new Error("GatherBlockQuantized requires 3 or 4 inputs.");let t=Me.normalizeAxis(r.quantizeAxis,e[0].dims.length),s=r.blockSize,o=e[0],n=e[2],i=e.length===4?e[3]:void 0;if(n.dims.length!==o.dims.length||!o.dims.map((a,l)=>l===t?Math.ceil(a/s)===n.dims[l]:a===n.dims[l]).reduce((a,l)=>a&&l,!0))throw new Error("Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.");if(i){if(i.dataType!==o.dataType)throw new Error("Zero point must have the same data type as the input tensor.");if(i.dims.length!==n.dims.length||!i.dims.map((a,l)=>a===n.dims[l]).reduce((a,l)=>a&&l,!0))throw new Error("Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.")}},Fg=(e,r)=>{let t=e[0].dims,s=e[1].dims,o=t.length,n=Me.normalizeAxis(r.gatherAxis,o),i=Me.normalizeAxis(r.quantizeAxis,o),a=t.slice(0);a.splice(n,1,...s);let l=Me.size(a),u=e[2].dataType,p=e[0].dataType===22,c=[{type:12,data:l},{type:12,data:i},{type:12,data:n},{type:12,data:r.blockSize},...ut(...e.map((_,f)=>_.dims),a)],d=_=>{let f=Ce("data",e[0].dataType,e[0].dims.length),v=Ce("inputIndices",e[1].dataType,e[1].dims.length),$=Ce("scales",e[2].dataType,e[2].dims.length),g=e.length>3?Ce("zeroPoint",e[3].dataType,e[3].dims.length):void 0,w=tt("output",u,a.length),C=[f,v,$];g&&C.push(g);let E=[{name:"output_size",type:"u32"},{name:"quantize_axis",type:"u32"},{name:"gather_axis",type:"u32"},{name:"block_size",type:"u32"}];return` - ${_.registerUniforms(E).declareVariables(...C,w)} - ${_.mainStart()} - let output_indices = ${w.offsetToIndices("global_idx")}; - var indices_indices = ${v.type.indices}(0); - ${s.length>1?` - for (var i: u32 = 0; i < ${s.length}; i++) { - let index = ${w.indicesGet("output_indices","uniforms.gather_axis + i")}; - ${v.indicesSet("indices_indices","i","index")}; - }`:`indices_indices = ${w.indicesGet("output_indices","uniforms.gather_axis")};`}; - var data_indices = ${f.type.indices}(0); - for (var i: u32 = 0; i < uniforms.gather_axis; i++) { - let index = ${w.indicesGet("output_indices","i")}; - ${f.indicesSet("data_indices","i","index")}; - } - var index_from_indices = ${v.getByIndices("indices_indices")}; - if (index_from_indices < 0) { - index_from_indices += ${t[n]}; - } - ${f.indicesSet("data_indices","uniforms.gather_axis","u32(index_from_indices)")}; - for (var i = uniforms.gather_axis + 1; i < ${a.length}; i++) { - let index = ${w.indicesGet("output_indices",`i + ${s.length} - 1`)}; - ${f.indicesSet("data_indices","i","index")}; - } - let data_offset = ${f.indicesToOffset("data_indices")}; - let data_index = data_offset % 8; - // Convert 4-bit packed data to 8-bit packed data. - let packed_4bit_quantized_data = ${f.getByOffset("data_offset / 8")}; - let packed_8bit_quantized_data = (packed_4bit_quantized_data >> (4 * (data_index % 2))) & 0x0f0f0f0f; - let quantized_data_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_quantized_data)); - let quantized_data = quantized_data_vec[data_index / 2]; - var scale_indices = data_indices; - let quantize_axis_index = ${$.indicesGet("data_indices","uniforms.quantize_axis")} / uniforms.block_size; - ${$.indicesSet("scale_indices","uniforms.quantize_axis","quantize_axis_index")}; - var scale = ${$.getByIndices("scale_indices")}; - ${g?` - let zero_point_indices = scale_indices; - let zero_point_offset = ${g.indicesToOffset("zero_point_indices")}; - let zero_point_index = zero_point_offset % 8; - let packed_4bit_zero_points = ${g.getByOffset("zero_point_offset / 8")}; - let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f; - let zero_point_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_zero_points)); - let zero_point = zero_point_vec[zero_point_index / 2];`:"var zero_point = 0"}; - let dequantized_data = ${Rr(u)}(quantized_data - zero_point) * scale; - ${w.setByOffset("global_idx","dequantized_data")}; - }`};return{name:"GatherBlockQuantized",shaderCache:{hint:`${r.cacheKey};${e.filter((_,f)=>f!==1).map(_=>_.dims.join("_")).join(";")}`,inputDependencies:Array.from({length:e.length},(_,f)=>"rank")},getRunData:()=>({outputs:[{dims:a,dataType:u}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:c}),getShaderSource:d}},Ny=(e,r)=>{let t=e.inputs;Ag(t,r),e.compute(Fg(e.inputs,r))},Vy=e=>Nt({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),Og,Dg,Uy,Wy,zx=je(()=>{ft(),xt(),lr(),Tt(),Og=e=>{if(!e||e.length!==2)throw new Error("GatherElements requires 2 inputs.");if(e[0].dims.length<1)throw new Error("GatherElements requires that the data input be rank >= 1.");if(e[0].dims.length!==e[1].dims.length)throw new Error(`GatherElements requires that the data input and - indices input tensors be of same rank.`)},Dg=(e,r)=>{let t=e[0].dims,s=e[0].dataType,o=t.length,n=e[1].dims,i=e[1].dataType,a=Me.normalizeAxis(r.axis,o),l=t[a],u=n.slice(0),p=Me.size(u),c=Ce("input",s,o),d=Ce("indicesInput",i,n.length),_=tt("output",s,u.length),f=[{type:12,data:p},{type:6,data:l},{type:12,data:a}];return f.push(...ut(t,n,u)),{name:"GatherElements",shaderCache:{inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:u,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:f}),getShaderSource:v=>` - ${v.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(c,d,_)} - ${v.mainStart()} - ${v.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - - let outputIndices = ${_.offsetToIndices("global_idx")}; - - var idx = ${d.getByOffset("global_idx")}; - if (idx < 0) { - idx = idx + uniforms.axisDimLimit; - } - var inputIndices = ${c.type.indices}(outputIndices); - ${c.indicesSet("inputIndices","uniforms.axis","u32(idx)")}; - let value = ${c.getByIndices("inputIndices")}; - - ${_.setByOffset("global_idx","value")}; - }`}},Uy=e=>Nt({axis:e.axis}),Wy=(e,r)=>{let t=e.inputs;Og(t),e.compute(Dg(e.inputs,r))}}),Lg,zg,Gy,Ky,Bx=je(()=>{ft(),xt(),Tt(),Lg=e=>{if(!e)throw new Error("Input is missing");if(e.length<2||e.length>3)throw new Error("Invaid input number.");if(e.length===3&&e[2].dims.length>2)throw new Error("Invalid input shape of C");if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("Input types are mismatched")},zg=(e,r)=>{let t=e[0].dims.slice(),s=e[1].dims.slice(),[o,n,i]=Ub.getShapeOfGemmResult(t,r.transA,s,r.transB,e.length===3?e[2].dims:void 0),a=[o,n];if(!a)throw new Error("Can't use gemm on the given tensors");let l=16,u=Math.ceil(n/l),p=Math.ceil(o/l),c=!0,d=Me.size(a),_=[{type:12,data:c?u:d},{type:12,data:o},{type:12,data:n},{type:12,data:i},{type:1,data:r.alpha},{type:1,data:r.beta}],f=["type","type"];e.length===3&&(_.push(...ut(e[2].dims)),f.push("rank")),_.push(...ut(a));let v=g=>{let w="";r.transA&&r.transB?w="value += a[k * uniforms.M + m] * b[n * uniforms.K + k];":r.transA&&!r.transB?w="value += a[k * uniforms.M + m] * b[k * uniforms.N + n];":!r.transA&&r.transB?w="value += a[m * uniforms.K + k] * b[n * uniforms.K + k];":!r.transA&&!r.transB&&(w="value += a[m * uniforms.K + k] * b[k * uniforms.N + n];");let C=r.alpha===1?"":"value *= uniforms.alpha;",E=Ce("a",e[0].dataType,e[0].dims),x=Ce("b",e[1].dataType,e[1].dims),b=E.type.value,y=null,S=[E,x];e.length===3&&(y=Ce("c",e[2].dataType,e[2].dims.length),S.push(y));let F=tt("output",e[0].dataType,a.length);S.push(F);let z=[{name:"output_size",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"},{name:"alpha",type:"f32"},{name:"beta",type:"f32"}];return` - ${g.registerUniforms(z).declareVariables(...S)} - - ${g.mainStart()} - ${g.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let m = global_idx / uniforms.N; - let n = global_idx % uniforms.N; - - var value = ${b}(0); - for (var k: u32 = 0u; k < uniforms.K; k++) { - ${w} - } - - ${C} - ${y!=null?`let cOffset = ${y.broadcastedIndicesToOffset("vec2(m, n)",F)}; value += ${b}(uniforms.beta) * ${y.getByOffset("cOffset")};`:""} - output[global_idx] = value; - }`},$=g=>{let w=Ce("a",e[0].dataType,e[0].dims),C=Ce("b",e[1].dataType,e[1].dims),E=null,x=[w,C];e.length===3&&(E=Ce("c",e[2].dataType,e[2].dims.length),x.push(E));let b=tt("output",e[0].dataType,a.length);x.push(b);let y=[{name:"num_tile_n",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"},{name:"alpha",type:"f32"},{name:"beta",type:"f32"}],S="",F="";r.transA&&r.transB?(F=` - var col = tile_row_start + local_id.x; - var row = k_start + local_id.y; - if (col < uniforms.M && row < uniforms.K) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; - } else { - tile_a[local_id.y][local_id.x] = ${w.type.value}(0); - } - - col = k_start + local_id.x; - row = tile_col_start + local_id.y; - if (col < uniforms.K && row < uniforms.N) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; - } else { - tile_b[local_id.y][local_id.x] = ${C.type.value}(0); - } - `,S="value += tile_a[k][local_id.y] * tile_b[local_id.x][k];"):r.transA&&!r.transB?(F=` - var col = tile_row_start + local_id.x; - var row = k_start + local_id.y; - if (col < uniforms.M && row < uniforms.K) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; - } else { - tile_a[local_id.y][local_id.x] = ${w.type.value}(0); - } - - col = tile_col_start + local_id.x; - row = k_start + local_id.y; - if (col < uniforms.N && row < uniforms.K) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; - } else { - tile_b[local_id.y][local_id.x] = ${C.type.value}(0); - } - `,S="value += tile_a[k][local_id.y] * tile_b[k][local_id.x];"):!r.transA&&r.transB?(F=` - var col = k_start + local_id.x; - var row = tile_row_start + local_id.y; - if (col < uniforms.K && row < uniforms.M) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; - } else { - tile_a[local_id.y][local_id.x] = ${w.type.value}(0); - } - - col = k_start + local_id.x; - row = tile_col_start + local_id.y; - if (col < uniforms.K && row < uniforms.N) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; - } else { - tile_b[local_id.y][local_id.x] = ${C.type.value}(0); - } - `,S="value += tile_a[local_id.y][k] * tile_b[local_id.x][k];"):!r.transA&&!r.transB&&(F=` - var col = k_start + local_id.x; - var row = tile_row_start + local_id.y; - if (col < uniforms.K && row < uniforms.M) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; - } else { - tile_a[local_id.y][local_id.x] = ${w.type.value}(0); - } - - col = tile_col_start + local_id.x; - row = k_start + local_id.y; - if (col < uniforms.N && row < uniforms.K) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; - } else { - tile_b[local_id.y][local_id.x] = ${C.type.value}(0); - } - `,S="value += tile_a[local_id.y][k] * tile_b[k][local_id.x];");let z=r.alpha===1?"":"value *= uniforms.alpha;";return` - ${g.registerUniforms(y).declareVariables(...x)} - var tile_a: array, ${l}>; - var tile_b: array, ${l}>; - ${g.mainStart([l,l,1])} - let tile_col_start = (workgroup_index % uniforms.num_tile_n) * ${l}; - let tile_row_start = (workgroup_index / uniforms.num_tile_n) * ${l}; - let num_tiles = (uniforms.K - 1) / ${l} + 1; - var k_start = 0u; - var value = ${b.type.value}(0); - for (var t: u32 = 0u; t < num_tiles; t++) { - ${F} - k_start = k_start + ${l}; - workgroupBarrier(); - - for (var k: u32 = 0u; k < ${l}; k++) { - ${S} - } - workgroupBarrier(); - } - - ${z} - let m = tile_row_start + local_id.y; - let n = tile_col_start + local_id.x; - ${E!=null?`let cOffset = ${E.broadcastedIndicesToOffset("vec2(m, n)",b)}; value += ${b.type.value}(uniforms.beta) * ${E.getByOffset("cOffset")};`:""} - if (m < uniforms.M && n < uniforms.N) { - output[m * uniforms.N + n] = value; - } - }`};return c?{name:"GemmShared",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:u*p},programUniforms:_}),getShaderSource:$}:{name:"Gemm",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:_}),getShaderSource:v}},Gy=e=>{let r=e.transA,t=e.transB,s=e.alpha,o=e.beta;return{transA:r,transB:t,alpha:s,beta:o,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},Ky=(e,r)=>{Lg(e.inputs),e.compute(zg(e.inputs,r))}}),Ds,Bs,Pn,Cn,Bg,Rg,jg,Ng,Vg,Ug,Wg,Gg,Hy,qy,Rx=je(()=>{ft(),xt(),lr(),Tt(),[Ds,Bs,Pn,Cn]=[0,1,2,3],Bg=e=>{if(e[0].dims.length!==4)throw new Error("only 4-D tensor is supported.");if(e[0].dims.length!==e[1].dims.length)throw new Error("input dimensions must be equal to grid dimensions");if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw new Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw new Error("grid batch size must match input batch size")},Rg=` - fn gs_get_cubic_coeffs(x: f32) -> vec4 { - let cubic_alpha = -0.75f; - let x_abs = abs(x); - var coeffs: vec4; - coeffs[0] = (((cubic_alpha * (x_abs + 1) - 5 * cubic_alpha) * (x_abs + 1) + 8 * cubic_alpha) * (x_abs + 1) - 4 * cubic_alpha); - coeffs[1] = (((cubic_alpha + 2) * x_abs - (cubic_alpha + 3)) * x_abs * x_abs + 1); - coeffs[2] = (((cubic_alpha + 2) * (1 - x_abs) - (cubic_alpha + 3)) * (1 - x_abs) * (1 - x_abs) + 1); - coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha); - return coeffs; - } -`,jg=e=>` - fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} { - var v: vec4; - var coeffs = gs_get_cubic_coeffs(x); - for (var i = 0; i < 4; i++) { - v[i] = coeffs[0] * p[i][0] + coeffs[1] * p[i][1] + coeffs[2] * p[i][2] + coeffs[3] * p[i][3]; - } - coeffs = gs_get_cubic_coeffs(y); - let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]); - return pixel; - } -`,Ng=e=>` - fn gs_denormalize(n: f32, length: i32) -> f32 { - ${e.alignCorners===0?` - // alignCorners: false => [-1, 1] to [-0.5, length - 0.5] - return ((n + 1.0) * f32(length) - 1.0) / 2.0; - `:` - // alignCorners: true => [-1, 1] to [0, length - 1] - return (n + 1.0) / 2.0 * (f32(length - 1)); - `} - } -`,Vg=e=>` - ${e.paddingMode==="reflection"?` - fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 { - var dx = 0.0; - var fx = f32(x); - let range = x_max - x_min; - if (fx < x_min) { - dx = x_min - fx; - let n = u32(dx / range); - let r = dx - f32(n) * range; - if (n % 2 == 0) { - fx = x_min + r; - } else { - fx = x_max - r; - } - } else if (fx > x_max) { - dx = fx - x_max; - let n = u32(dx / range); - let r = dx - f32(n) * range; - if (n % 2 == 0) { - fx = x_max - r; - } else { - fx = x_min + r; - } - } - return u32(fx); - }`:""} -`,Ug=(e,r,t)=>` - fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4) -> ${r} { - var pixel = ${r}(0); - var indices = vec4(0); - indices[${Ds}] = batch; - indices[${Bs}] = channel;`+(()=>{switch(t.paddingMode){case"zeros":return` - if (r >= 0 && r < H && c >=0 && c < W) { - indices[${Pn}] = u32(r); - indices[${Cn}] = u32(c); - } else { - return ${r}(0); - } - `;case"border":return` - indices[${Pn}] = u32(clamp(r, 0, H - 1)); - indices[${Cn}] = u32(clamp(c, 0, W - 1)); - `;case"reflection":return` - indices[${Pn}] = gs_reflect(r, border[1], border[3]); - indices[${Cn}] = gs_reflect(c, border[0], border[2]); - `;default:throw new Error(`padding mode ${t.paddingMode} is not supported`)}})()+` - return ${e.getByIndices("indices")}; - } -`,Wg=(e,r,t)=>(()=>{switch(t.mode){case"nearest":return` - let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${Ds}], indices[${Bs}], border); - `;case"bilinear":return` - let x1 = i32(floor(x)); - let y1 = i32(floor(y)); - let x2 = x1 + 1; - let y2 = y1 + 1; - - let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${Ds}], indices[${Bs}], border); - let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${Ds}], indices[${Bs}], border); - let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${Ds}], indices[${Bs}], border); - let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${Ds}], indices[${Bs}], border); - - let dx2 = ${r}(f32(x2) - x); - let dx1 = ${r}(x - f32(x1)); - let dy2 = ${r}(f32(y2) - y); - let dy1 = ${r}(y - f32(y1)); - let result = dy2 * (dx2 * p11 + dx1 * p12) + dy1 * (dx2 * p21 + dx1 * p22); - `;case"bicubic":return` - let x0 = i32(floor(x)) - 1; - let y0 = i32(floor(y)) - 1; - var p: mat4x4<${r}>; - for (var h = 0; h < 4; h++) { - for (var w = 0; w < 4; w++) { - p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${Ds}], indices[${Bs}], border); - } - } - - let dx = x - f32(x0 + 1); - let dy = y - f32(y0 + 1); - let result = gs_bicubic_interpolate(p, dx, dy); - `;default:throw new Error(`mode ${t.mode} is not supported`)}})()+`${e.setByOffset("global_idx","result")}`,Gg=(e,r)=>{let t=Ce("x",e[0].dataType,e[0].dims.length),s=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],o=Ce("grid",e[1].dataType,s.length,2),n=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];r.format==="NHWC"&&(n=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[Ds,Bs,Pn,Cn]=[0,3,1,2]);let i=tt("output",e[0].dataType,n.length),a=t.type.value,l=Me.size(n),u=[{type:12,data:l},...ut(e[0].dims,s,n)],p=c=>` - ${c.registerUniform("output_size","u32").declareVariables(t,o,i)} - ${Rg} - ${jg(a)} - ${Ng(r)} - ${Vg(r)} - ${Ug(t,a,r)} - - ${c.mainStart()} - ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let H_in = i32(uniforms.x_shape[${Pn}]); - let W_in = i32(uniforms.x_shape[${Cn}]); - - ${r.alignCorners===0?` - let x_min = -0.5; - let x_max = f32(W_in) - 0.5; - let y_min = -0.5; - let y_max = f32(H_in) - 0.5; - `:` - let x_min = 0.0; - let x_max = f32(W_in) - 1.0; - let y_min = 0.0; - let y_max = f32(H_in) - 1.0; - `}; - let border = vec4(x_min, y_min, x_max, y_max); - - let indices = ${i.offsetToIndices("global_idx")}; - var grid_indices = vec3(indices[${Ds}], indices[${Pn}], indices[${Cn}]); - let nxy = ${o.getByIndices("grid_indices")}; - var x = gs_denormalize(f32(nxy[0]), W_in); - var y = gs_denormalize(f32(nxy[1]), H_in); - - ${Wg(i,a,r)} - }`;return{name:"GridSample",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:["type","type"]},getRunData:c=>{let d=Me.size(n);return{outputs:[{dims:n,dataType:c[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:u}},getShaderSource:p}},Hy=(e,r)=>{Bg(e.inputs),e.compute(Gg(e.inputs,r))},qy=e=>Nt({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),Ur,Kg,Qy,du,Hg,Jo,Xy,Jy=je(()=>{ft(),xt(),lr(),uc(),pc(),Tt(),tn(),Ur=(e,r)=>e.length>r&&e[r].dims.length>0?e[r]:void 0,Kg=(e,r)=>{let t=e[0],s=Ur(e,1),o=Ur(e,2),n=Ur(e,3),i=Ur(e,4),a=Ur(e,5),l=Ur(e,6),u=Ur(e,7);if(t.dims.length!==3&&t.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let p=t.dims[0],c=t.dims[1],d=t.dims.length===3?t.dims[2]:r.numHeads*t.dims[4],_=c,f=0,v=0,$=Math.floor(d/r.numHeads);if(l&&u&&Me.size(l.dims)&&Me.size(u.dims)){if(l.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(l.dims[0]!==p||l.dims[1]!==r.numHeads||l.dims[3]!==$)throw new Error('Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)');if(u.dims[0]!==p||u.dims[1]!==r.numHeads||u.dims[3]!==$)throw new Error('Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)');if(l.dims[2]!==u.dims[2])throw new Error('Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)');if(u.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');f=l.dims[2],v=l.dims[2]}else if(l&&Me.size(l.dims)||u&&Me.size(u.dims))throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let g;if(s&&Me.size(s.dims)>0){if(t.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(s.dims.length<3||s.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(t.dims[0]!==s.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(s.dims.length===3){if(s.dims[2]!==t.dims[2])throw new Error('Input "query" and "key" shall have same dim 2 (hidden_size)');g=2,_=s.dims[1]}else if(s.dims.length===5){if(s.dims[2]!==r.numHeads||s.dims[3]!==2||s.dims[4]!==$)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(o)throw new Error('Expect "value" be none when "key" has packed kv format.');g=5,_=s.dims[1]}else{if(s.dims[1]!==r.numHeads||s.dims[3]!==$)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');g=0,_=s.dims[2]}}else{if(t.dims.length!==5)throw new Error('Input "query" is expected to have 5 dimensions when key is empty');if(t.dims[2]!==r.numHeads||t.dims[3]!==3)throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');g=3}if(n&&Me.size(n.dims)>0){if(n.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimension');if(s&&s.dims.length===5&&s.dims[3]===2)throw new Error("bias is not allowed for packed kv.")}let w=f+_,C=0;if(i&&Me.size(i.dims)>0){C=8;let y=i.dims;throw y.length===1?y[0]===p?C=1:y[0]===3*p+2&&(C=3):y.length===2&&y[0]===p&&y[1]===w&&(C=5),C===8?new Error('Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)'):new Error("Mask not supported")}let E=!1,x=d;if(o&&Me.size(o.dims)>0){if(o.dims.length!==3&&o.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(t.dims[0]!==o.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(o.dims.length===3){if(_!==o.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');x=o.dims[2]}else{if(_!==o.dims[2])throw new Error('Input "key" and "value" shall have the same dim 2 (kv_sequence_length)');x=o.dims[1]*o.dims[3],E=!0}}let b=!1;if(i&&Me.size(i.dims)>0)throw new Error("Key padding mask is not supported");if(a&&Me.size(a.dims)>0){if(a.dims.length!==4)throw new Error('Input "attention_bias" is expected to have 4 dimensions');if(a.dims[0]!==p||a.dims[1]!==r.numHeads||a.dims[2]!==c||a.dims[3]!==w)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:p,sequenceLength:c,pastSequenceLength:f,kvSequenceLength:_,totalSequenceLength:w,maxSequenceLength:v,inputHiddenSize:0,hiddenSize:d,vHiddenSize:x,headSize:$,vHeadSize:Math.floor(x/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:C,scale:r.scale,broadcastResPosBias:b,passPastInKv:E,qkvFormat:g}},Qy=e=>Nt({...e}),du=Nt({perm:[0,2,1,3]}),Hg=(e,r,t,s,o,n,i)=>{let a=[s,o,n],l=Me.size(a),u=[{type:12,data:l},{type:12,data:i},{type:12,data:n}],p=c=>{let d=tt("qkv_with_bias",r.dataType,a),_=Ce("qkv",r.dataType,a),f=Ce("bias",t.dataType,a),v=[{name:"output_size",type:"u32"},{name:"bias_offset",type:"u32"},{name:"hidden_size",type:"u32"}];return` - ${c.registerUniforms(v).declareVariables(_,f,d)} - ${c.mainStart()} - ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset; - - qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx]; - }`};return e.compute({name:"MultiHeadAttentionAddBias",shaderCache:{inputDependencies:["type","type"]},getRunData:()=>({outputs:[{dims:a,dataType:r.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:p},{inputs:[r,t],outputs:[-1]})[0]},Jo=(e,r,t,s,o,n,i,a)=>{let l=n;if(i&&Me.size(i.dims)>0){if(s===1)throw new Error("AddBiasReshape is not implemented. Please export your model with packed QKV or KV");return l=Hg(e,n,i,r,s,t*o,a),l=l.reshape([r,s,t,o]),t===1||s===1?l:e.compute(Yr(l,du.perm),{inputs:[l],outputs:[-1]})[0]}else return n.dims.length===3&&(l=n.reshape([r,s,t,o])),t===1||s===1?l:e.compute(Yr(l,du.perm),{inputs:[l],outputs:[-1]})[0]},Xy=(e,r)=>{let t=Kg(e.inputs,r),s=e.inputs[0],o=Ur(e.inputs,1),n=Ur(e.inputs,2),i=Ur(e.inputs,3),a=Ur(e.inputs,4),l=Ur(e.inputs,5),u=Ur(e.inputs,6),p=Ur(e.inputs,7);if(s.dims.length===5)throw new Error("Packed QKV is not implemented");if((o==null?void 0:o.dims.length)===5)throw new Error("Packed KV is not implemented");let c=o&&n&&o.dims.length===4&&n.dims.length===4,d=Jo(e,t.batchSize,t.numHeads,t.sequenceLength,t.headSize,s,i,0);if(c)return ti(e,d,o,n,a,void 0,u,p,l,t);if(!o||!n)throw new Error("key and value must be provided");let _=Jo(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.headSize,o,i,t.hiddenSize),f=Jo(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.vHeadSize,n,i,2*t.hiddenSize);ti(e,d,_,f,a,void 0,u,p,l,t)}}),qg,Qg,Xg,Jg,Hu,Yy,Zy,e0=je(()=>{ft(),xt(),lr(),Tt(),qg=e=>{if(!e||e.length<1)throw new Error("too few inputs")},Qg=(e,r)=>{let t=[],s=r.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(o=>t.push(Number(o))),s=t.length),Nt({numOutputs:s,axis:r.axis,splitSizes:t})},Xg=e=>` -fn calculateOutputIndex(index: u32) -> u32 { - for (var i: u32 = 0u; i < ${e}u; i += 1u ) { - if (index < ${ot("uniforms.size_in_split_axis","i",e)}) { - return i; - } - } - return ${e}u; -}`,Jg=e=>{let r=e.length,t=[];for(let s=0;s{let t=e[0].dims,s=Me.size(t),o=e[0].dataType,n=Me.normalizeAxis(r.axis,t.length),i=new Array(r.numOutputs),a=Ce("input",o,t.length),l=new Array(r.numOutputs),u=[],p=[],c=0,d=[{type:12,data:s}];for(let f=0;f` - ${f.registerUniform("input_size","u32").registerUniform("size_in_split_axis","u32",l.length).declareVariables(a,...i)} - ${Xg(l.length)} - ${Jg(i)} - - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.input_size")} - - var indices = ${a.offsetToIndices("global_idx")}; - var index = ${a.indicesGet("indices",n)}; - let output_number = calculateOutputIndex(index); - if (output_number != 0) { - index -= ${ot("uniforms.size_in_split_axis","output_number - 1u",l.length)}; - ${a.indicesSet("indices",n,"index")}; - } - writeBufferData(output_number, indices, global_idx); - }`;return{name:"Split",shaderCache:{hint:r.cacheKey,inputDependencies:["rank"]},getShaderSource:_,getRunData:()=>({outputs:u,dispatchGroup:{x:Math.ceil(s/64)},programUniforms:d})}},Yy=(e,r)=>{qg(e.inputs);let t=e.inputs.length===1?r:Qg(e.inputs,r);e.compute(Hu(e.inputs,t),{inputs:[0]})},Zy=e=>{let r=e.axis,t=e.splitSizes,s=e.numOutputs<0?t.length:e.numOutputs;if(s!==t.length)throw new Error("numOutputs and splitSizes lengh must be equal");return Nt({axis:r,numOutputs:s,splitSizes:t})}}),Yg,ga,t0,r0=je(()=>{ft(),xt(),lr(),Tt(),Yg=(e,r)=>{let[t,s,o,n]=e,{numHeads:i,rotaryEmbeddingDim:a}=r;if(t.dims.length!==3&&t.dims.length!==4)throw new Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${t.dims.length}`);if(!Me.areEqual(s.dims,[])&&!Me.areEqual(s.dims,[1])&&s.dims.length!==2)throw new Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${s.dims.length}`);if(o.dims.length!==2)throw new Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${o.dims.length}`);if(n.dims.length!==2)throw new Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${n.dims.length}`);if(!Me.areEqual(o.dims,n.dims))throw new Error("Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape");if(a>0&&i===0)throw new Error("num_heads must be provided if rotary_embedding_dim is specified");let l=t.dims[0],u=t.dims[t.dims.length-2],p=o.dims[0],c=Me.sizeFromDimension(t.dims,1)/u,d=a===0?o.dims[1]*2:c/i;if(a>d)throw new Error("rotary_embedding_dim must be less than or equal to head_size");if(s.dims.length===2){if(l!==s.dims[0])throw new Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${s.dims[0]}`);if(u!==s.dims[1])throw new Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${s.dims[1]}`)}if(d/2!==o.dims[1]&&a/2!==o.dims[1])throw new Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${o.dims[1]}`);if(u>p)throw new Error("Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported")},ga=(e,r)=>{let{interleaved:t,numHeads:s,rotaryEmbeddingDim:o,scale:n}=r,i=e[0].dims[0],a=Me.sizeFromDimension(e[0].dims,1),l=e[0].dims[e[0].dims.length-2],u=a/l,p=e[2].dims[1],c=o===0?p*2:u/s,d=new Array(i,l,u/c,c-p),_=Me.computeStrides(d),f=[{type:1,data:n},{type:12,data:d},{type:12,data:_},...e[0].dims.length===3?new Array({type:12,data:[a,u,c,1]}):[],...e[0].dims.length===4?new Array({type:12,data:[a,c,l*c,1]}):[],...ut(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],v=$=>{let g=Ce("input",e[0].dataType,e[0].dims.length),w=Ce("position_ids",e[1].dataType,e[1].dims.length),C=Ce("cos_cache",e[2].dataType,e[2].dims.length),E=Ce("sin_cache",e[3].dataType,e[3].dims.length),x=tt("output",e[0].dataType,e[0].dims.length);return $.registerUniforms([{name:"scale",type:"f32"},{name:"global_shape",type:"u32",length:d.length},{name:"global_strides",type:"u32",length:_.length},{name:"input_output_strides",type:"u32",length:_.length}]),` - ${$.declareVariables(g,w,C,E,x)} - - ${$.mainStart(oo)} - let half_rotary_emb_dim = uniforms.${C.name}_shape[1]; - let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape; - let size = uniforms.global_shape[0] * uniforms.global_strides[0]; - ${$.guardAgainstOutOfBoundsWorkgroupSizes("size")} - - if (bsnh[3] < half_rotary_emb_dim) { - let position_ids_idx = - ${w.broadcastedIndicesToOffset("bsnh.xy",tt("",w.type.tensor,2))}; - let position_id = - u32(${w.getByOffset("position_ids_idx")}) + select(0, bsnh[1], position_ids_idx == 0); - let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${t}); - let j = i + select(half_rotary_emb_dim, 1, ${t}); - let re = ${g.getByOffset("i")} * ${C.get("position_id","bsnh[3]")} - - ${g.getByOffset("j")} * ${E.get("position_id","bsnh[3]")}; - ${x.setByOffset("i","re")} - let im = ${g.getByOffset("i")} * ${E.get("position_id","bsnh[3]")} + - ${g.getByOffset("j")} * ${C.get("position_id","bsnh[3]")}; - ${x.setByOffset("j","im")} - } else { - let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim; - ${x.setByOffset("k",g.getByOffset("k"))} - } - }`};return{name:"RotaryEmbedding",shaderCache:{hint:Nt({interleaved:t}).cacheKey,inputDependencies:["rank","rank","rank","rank"]},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Me.size(d)/oo)},programUniforms:f})}},t0=(e,r)=>{Yg(e.inputs,r),e.compute(ga(e.inputs,r))}}),Zg,ew,pu,tw,s0,jx=je(()=>{lr(),ft(),pc(),Jy(),e0(),tn(),r0(),Tt(),Zg=(e,r)=>{if(r.doRotary&&e.length<=7)throw new Error("cos_cache and sin_cache inputs are required if do_rotary is specified");let t=e[0],s=e[1],o=e[2],n=e[3],i=e[4];if(r.doRotary!==0&&e.length<=7)throw new Error("cos_cast and sin_cache are expected if do_rotary attribute is non-zero");if(r.localWindowSize!==-1)throw new Error("Local attention is not supported");if(r.softcap!==0)throw new Error("Softcap is not supported");if(r.rotaryInterleaved!==0)throw new Error("Rotary interleaved is not supported");if(r.smoothSoftmax)throw new Error("Smooth softmax is not supported");if(t.dims.length!==3&&t.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let a=!1,l=t.dims[0],u=t.dims[1],p=t.dims.length===3?a?t.dims[2]/3:t.dims[2]:r.numHeads*t.dims[4],c=u,d=0,_=!s||s.dims.length===0,f=Math.floor(_?p/(r.numHeads+2*r.kvNumHeads):p/r.numHeads);_&&(p=f*r.numHeads);let v=n&&n.dims.length!==0,$=i&&i.dims.length!==0;if(v&&n.dims.length===4&&n.dims[0]===l&&n.dims[1]!==r.kvNumHeads&&n.dims[2]===r.kvNumHeads&&n.dims[3]===f)throw new Error("BSNH pastKey/pastValue is not supported");if(v&&$){if(n.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(i.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');d=n.dims[2]}else if(v||$)throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let g=1;if(s&&s.dims.length>0){if(t.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(s.dims.length<3||s.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(t.dims[0]!==s.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(s.dims.length===3){if(t.dims[2]%s.dims[2]!==0)throw new Error('Dimension 2 of "query" should be a multiple of "key"');c=s.dims[1]}else if(s.dims.length===5){if(s.dims[2]!==r.numHeads||s.dims[3]!==2||s.dims[4]!==f)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(o)throw new Error('Expect "value" be none when "key" has packed kv format.');c=s.dims[1]}else{if(s.dims[1]!==r.numHeads||s.dims[3]!==f)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');c=s.dims[2]}}else{if(t.dims.length!==3&&t.dims.length!==5)throw new Error('Input "query" is expected to have 3 or 5 dimensions when key is empty');if(t.dims.length===5&&(t.dims[2]!==r.numHeads||t.dims[3]!==3))throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');g=3}let w=0,C=!1,E=r.kvNumHeads?f*r.kvNumHeads:p;if(o&&o.dims.length>0){if(o.dims.length!==3&&o.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(t.dims[0]!==o.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(o.dims.length===3){if(c!==o.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');E=o.dims[2]}else{if(c!==o.dims[2])throw new Error('Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)');E=o.dims[1]*o.dims[3],C=!0}}let x=e.length>4?e[5]:void 0;if(x&&x.dims.length!==1&&x.dims[0]!==l)throw new Error('Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size');return{batchSize:l,sequenceLength:u,pastSequenceLength:d,kvSequenceLength:c,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:p,vHiddenSize:E,headSize:f,vHeadSize:Math.floor(E/r.kvNumHeads),numHeads:r.numHeads,kvNumHeads:r.kvNumHeads,nReps:r.numHeads/r.kvNumHeads,pastPresentShareBuffer:!1,maskType:w,scale:r.scale,broadcastResPosBias:!1,passPastInKv:C,qkvFormat:g}},ew=Nt({perm:[0,2,1,3]}),pu=(e,r,t)=>{let s=r,o=t.kvNumHeads;return r.dims.length===3&&t.kvSequenceLength!==0&&(s=r.reshape([t.batchSize,t.kvSequenceLength,o,t.headSize]),s=e.compute(Yr(s,ew.perm),{inputs:[s],outputs:[-1]})[0]),s},tw=(e,r,t,s)=>{let o=7,n=["type","type"],i=[e*r],a=e*r,l=[{type:12,data:a},{type:12,data:r},{type:12,data:e}],u=p=>{let c=Ce("seq_lens",t.dataType,t.dims),d=Ce("total_seq_lens",s.dataType,s.dims),_=tt("pos_ids",o,i),f=[{name:"output_size",type:"u32"},{name:"sequence_length",type:"u32"},{name:"batch_size",type:"u32"}];return` - ${p.registerUniforms(f).declareVariables(c,d,_)} - ${p.mainStart()} - ${p.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let total_sequence_length = u32(${d.getByOffset("0")}); - let is_subsequent_prompt = uniforms.sequence_length > 1 && uniforms.sequence_length != total_sequence_length; - let is_first_prompt = !is_subsequent_prompt && uniforms.sequence_length == total_sequence_length; - let batch_idx = global_idx / uniforms.sequence_length; - let sequence_idx = i32(global_idx % uniforms.sequence_length); - var pos_id: i32 = 0; - let seqlen = ${c.getByOffset("batch_idx")}; - let total_seqlen = seqlen + 1; - if (is_first_prompt) { - if (sequence_idx < total_seqlen) { - pos_id = sequence_idx; - } else { - pos_id = 1; - } - ${_.setByOffset("global_idx","pos_id")} - } else if (is_subsequent_prompt) { - let past_seqlen = total_seqlen - i32(uniforms.sequence_length); - if (past_seqlen + sequence_idx < total_seqlen) { - pos_id = past_seqlen + sequence_idx; - } else { - pos_id = 1; - } - ${_.setByOffset("global_idx","pos_id")} - } else if (global_idx < uniforms.batch_size) { - ${_.setByOffset("global_idx","seqlen")} - }; - } - `};return{name:"GeneratePositionIds",shaderCache:{hint:`${e};${r}`,inputDependencies:n},getRunData:()=>({outputs:[{dims:i,dataType:o}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:u}},s0=(e,r)=>{var E;let t=Zg(e.inputs,r);if(e.inputs[0].dims.length===5)throw new Error("Packed QKV is not implemented");if(((E=e.inputs[1])==null?void 0:E.dims.length)===5)throw new Error("Packed KV is not implemented");let s=e.inputs[0],o=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,n=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,i=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,a=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,l=e.inputs.length>4?e.inputs[5]:void 0,u=e.inputs.length>5?e.inputs[6]:void 0,p=t.kvNumHeads?t.kvNumHeads:t.numHeads,c=Nt({axis:2,numOutputs:3,splitSizes:[t.numHeads*t.headSize,p*t.headSize,p*t.headSize]}),[d,_,f]=!o&&!n?e.compute(Hu([s],c),{inputs:[s],outputs:[-1,-1,-1]}):[s,o,n],v,$;if(r.doRotary){let x=e.compute(tw(t.batchSize,t.sequenceLength,l,u),{inputs:[l,u],outputs:[-1]})[0],b=e.inputs[7],y=e.inputs[8],S=Nt({interleaved:r.rotaryInterleaved!==0,numHeads:t.numHeads,rotaryEmbeddingDim:0,scale:r.scale}),F=[d,x,b,y],z=[-1];v=e.compute(ga(F,S),{inputs:F,outputs:z})[0],F.splice(0,1,_);let K=Nt({interleaved:r.rotaryInterleaved!==0,numHeads:t.kvNumHeads,rotaryEmbeddingDim:0,scale:r.scale});$=e.compute(ga(F,K),{inputs:F,outputs:z})[0]}let g=Jo(e,t.batchSize,t.numHeads,t.sequenceLength,t.headSize,r.doRotary?v:d,void 0,0),w=pu(e,r.doRotary?$:_,t),C=pu(e,f,t);ti(e,g,w,C,void 0,void 0,i,a,void 0,t,l,u)}}),hu,rw,sw,n0,Nx=je(()=>{ft(),xt(),tn(),Tt(),hu=(e,r,t,s,o,n,i,a)=>{let l=nr(n),u=l===1?"f32":`vec${l}f`,p=l===1?"vec2f":`mat2x${l}f`,c=o*i,d=64;c===1&&(d=256);let _=[o,i,n/l],f=[o,i,2],v=["rank","type","type"],$=[];$.push(...ut(_,f));let g=w=>{let C=Ce("x",r.dataType,3,l),E=Ce("scale",t.dataType,t.dims),x=Ce("bias",s.dataType,s.dims),b=tt("output",1,3,2),y=[C,E,x,b];return` - var workgroup_shared : array<${p}, ${d}>; - const workgroup_size = ${d}u; - ${w.declareVariables(...y)} - ${w.mainStart(d)} - let batch = workgroup_index / uniforms.x_shape[1]; - let channel = workgroup_index % uniforms.x_shape[1]; - let hight = uniforms.x_shape[2]; - // initialize workgroup memory - var sum = ${u}(0); - var squared_sum = ${u}(0); - for (var h = local_idx; h < hight; h += workgroup_size) { - let value = ${u}(${C.get("batch","channel","h")}); - sum += value; - squared_sum += value * value; - } - workgroup_shared[local_idx] = ${p}(sum, squared_sum); - workgroupBarrier(); - - for (var currSize = workgroup_size >> 1; currSize > 0; currSize = currSize >> 1) { - if (local_idx < currSize) { - workgroup_shared[local_idx] = workgroup_shared[local_idx] + workgroup_shared[local_idx + currSize]; - } - workgroupBarrier(); - } - if (local_idx == 0) { - let sum_final = ${en("workgroup_shared[0][0]",l)} / f32(hight * ${l}); - let squared_sum_final = ${en("workgroup_shared[0][1]",l)} / f32(hight * ${l}); - - let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${a})); - let channel_scale = inv_std_dev * f32(scale[channel]); - let channel_shift = f32(bias[channel]) - sum_final * channel_scale; - output[workgroup_index] = vec2f(channel_scale, channel_shift); - } - }`};return e.compute({name:"InstanceNormComputeChannelScaleShift",shaderCache:{hint:`${l};${a};${d}`,inputDependencies:v},getRunData:()=>({outputs:[{dims:f,dataType:1}],dispatchGroup:{x:c},programUniforms:$}),getShaderSource:g},{inputs:[r,t,s],outputs:[-1]})[0]},rw=(e,r,t)=>{let s=r[0].dims,o=s,n=2,i=s[0],a=s[1],l=Me.sizeFromDimension(s,n),u=nr(l),p=Me.size(o)/u,c=hu(e,r[0],r[1],r[2],i,l,a,t.epsilon),d=[i,a,l/u],_=[i,a],f=["type","none"],v=$=>{let g=Ce("x",r[0].dataType,d.length,u),w=Ce("scale_shift",1,_.length,2),C=tt("output",r[0].dataType,d.length,u),E=[g,w,C];return` - ${$.registerUniform("output_size","u32").declareVariables(...E)} - ${$.mainStart()} - ${$.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let outputIndices = ${C.offsetToIndices("global_idx")}; - let batch = outputIndices[0]; - let channel = outputIndices[1]; - let scale_shift = ${w.getByIndices("vec2(batch, channel)")}; - let value = ${g.getByOffset("global_idx")} * ${C.type.value}(scale_shift.x) + ${C.type.value}(scale_shift.y); - ${C.setByOffset("global_idx","value")}; - }`};e.compute({name:"InstanceNormalization",shaderCache:{hint:`${u}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:o,dataType:r[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:[{type:12,data:p},...ut(d,_,d)]}),getShaderSource:v},{inputs:[r[0],c]})},sw=(e,r,t)=>{let s=r[0].dims,o=s,n=s[0],i=s[s.length-1],a=Me.sizeFromDimension(s,1)/i,l=nr(i),u=Me.size(o)/l,p=[{type:12,data:a},{type:12,data:Math.floor(i/l)}],c=["type","type"],d=!1,_=[0,s.length-1];for(let g=0;gs[_[w]])),v=hu(e,f,r[1],r[2],n,a,i,t.epsilon),$=g=>{let w=$r(r[0].dataType),C=l===1?"vec2f":`mat${l}x2f`,E=y=>{let S=y===0?"x":"y",F=l===1?"f32":`vec${l}f`;switch(l){case 1:return`${w}(${F}(scale.${S}))`;case 2:return`vec2<${w}>(${F}(scale[0].${S}, scale[1].${S}))`;case 4:return`vec4<${w}>(${F}(scale[0].${S}, scale[1].${S}, scale[2].${S}, scale[3].${S}))`;default:throw new Error(`Not supported compoents ${l}`)}},x=Ce("input",r[0].dataType,r[0].dims,l),b=tt("output",r[0].dataType,o,l);return` - @group(0) @binding(0) var input : array<${x.type.storage}>; - @group(0) @binding(1) var scale_input : array<${C}>; - @group(0) @binding(2) var output : array<${b.type.storage}>; - struct Uniforms {H: u32, C : u32}; - @group(0) @binding(3) var uniforms: Uniforms; - - ${g.mainStart()} - let current_image_number = global_idx / (uniforms.C * uniforms.H); - let current_channel_number = global_idx % uniforms.C; - - let scale_offset = current_image_number * uniforms.C + current_channel_number; - let scale = scale_input[scale_offset]; - output[global_idx] = fma(input[global_idx], ${E(0)}, ${E(1)}); - }`};e.compute({name:"InstanceNormalizationNHWC",shaderCache:{hint:`${l}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:o,dataType:r[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:p}),getShaderSource:$},{inputs:[r[0],v]})},n0=(e,r)=>{r.format==="NHWC"?sw(e,e.inputs,r):rw(e,e.inputs,r)}}),nw,ow,o0,Vx=je(()=>{ft(),xt(),Tt(),nw=e=>{if(!e||e.length<2)throw new Error("layerNorm requires at least 2 inputs.")},ow=(e,r,t)=>{let s=r.simplified,o=e[0].dims,n=e[1],i=!s&&e[2],a=o,l=Me.normalizeAxis(r.axis,o.length),u=Me.sizeToDimension(o,l),p=Me.sizeFromDimension(o,l),c=Me.size(n.dims),d=i?Me.size(i.dims):0;if(c!==p||i&&d!==p)throw new Error(`Size of X.shape()[axis:] == ${p}. - Size of scale and bias (if provided) must match this. - Got scale size of ${c} and bias size of ${d}`);let _=[];for(let x=0;x1,w=t>2,C=x=>{let b=$r(e[0].dataType),y=[Ce("x",e[0].dataType,e[0].dims,f),Ce("scale",n.dataType,n.dims,f)];i&&y.push(Ce("bias",i.dataType,i.dims,f)),y.push(tt("output",e[0].dataType,a,f)),g&&y.push(tt("mean_data_output",1,_)),w&&y.push(tt("inv_std_output",1,_));let S=[{name:"norm_count",type:"u32"},{name:"norm_size",type:"f32"},{name:"norm_size_vectorized",type:"u32"},{name:"epsilon",type:"f32"}];return` - ${x.registerUniforms(S).declareVariables(...y)} - ${x.mainStart()} - ${x.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.norm_count")} - let offset = global_idx * uniforms.norm_size_vectorized; - var mean_vector = ${Bu("f32",f)}; - var mean_square_vector = ${Bu("f32",f)}; - - for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) { - let value = ${so(b,f,"x[h + offset]")}; - mean_vector += value; - mean_square_vector += value * value; - } - let mean = ${en("mean_vector",f)} / uniforms.norm_size; - let inv_std_dev = inverseSqrt(${en("mean_square_vector",f)} / uniforms.norm_size ${s?"":"- mean * mean"} + uniforms.epsilon); - - for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) { - let f32input = ${so(b,f,"x[j + offset]")}; - let f32scale = ${so(b,f,"scale[j]")}; - output[j + offset] = ${y[0].type.value}((f32input ${s?"":"- mean"}) * inv_std_dev * f32scale - ${i?`+ ${so(b,f,"bias[j]")}`:""} - ); - } - - ${g?"mean_data_output[global_idx] = mean":""}; - ${w?"inv_std_output[global_idx] = inv_std_dev":""}; - }`},E=[{dims:a,dataType:e[0].dataType}];return g&&E.push({dims:_,dataType:1}),w&&E.push({dims:_,dataType:1}),{name:"LayerNormalization",shaderCache:{hint:`${f};${t};${s}`,inputDependencies:v},getRunData:()=>({outputs:E,dispatchGroup:{x:Math.ceil(u/64)},programUniforms:$}),getShaderSource:C}},o0=(e,r)=>{nw(e.inputs),e.compute(ow(e.inputs,r,e.outputCount))}}),iw,i0,Ux=je(()=>{xt(),gc(),wc(),iw=e=>{if(!e||e.length!==2)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.")},i0=e=>{iw(e.inputs);let r=no.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!r)throw new Error("Can't use matmul on the given tensors");let t=r[r.length-1],s=e.inputs[0].dims[e.inputs[0].dims.length-1];if(t<8&&s<8)e.compute(_c(e.inputs,{activation:""},r));else{let o=r[r.length-2],n=Me.size(e.inputs[0].dims.slice(0,-2)),i=Me.size(e.inputs[1].dims.slice(0,-2));if(n!==1&&o===1&&i===1){let a=e.inputs[0].reshape([1,n,s]),l=e.inputs[1].reshape([1,s,t]),u=[1,n,t],p=[a,l];e.compute(_a(p,{activation:""},r,u),{inputs:p})}else e.compute(_a(e.inputs,{activation:""},r))}}}),aw,lw,uw,a0,l0,Wx=je(()=>{ft(),xt(),lr(),Tt(),aw=(e,r)=>{if(e.length<3||e.length>4)throw new Error("MatMulNBits requires 3 or 4 inputs");let t=e[0],s=t.dims.length;if(t.dims[s-1]!==r.k)throw new Error("The last dim of input shape does not match the k value");let o=Math.floor((r.k+r.blockSize-1)/r.blockSize),n=r.blockSize/8*r.bits,i=e[1];if(!Me.areEqual(i.dims,[r.n,o,n]))throw new Error("The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize");let a=e[2].dims;if(Me.size(a)!==r.n*o)throw new Error("scales input size error.");if(e.length===4){let l=e[3].dims,u=r.bits>4?r.n*o:r.n*Math.floor((o+1)/2);if(Me.size(l)!==u)throw new Error("zeroPoints input size error.")}},lw=(e,r)=>{let t=e[0].dims,s=t.length,o=t[s-2],n=r.k,i=r.n,a=t.slice(0,s-2),l=Me.size(a),u=e[1].dims[2]/4,p=e[0].dataType,c=nr(r.k),d=nr(u),_=nr(i),f=a.concat([o,i]),v=o>1&&i/_%2===0?2:1,$=Me.size(f)/_/v,g=64,w=[],C=[l,o,n/c],E=Me.convertShape(e[1].dims).slice();E.splice(-1,1,u/d),w.push(...ut(C)),w.push(...ut(E)),w.push(...ut(e[2].dims)),e.length===4&&w.push(...ut(Me.convertShape(e[3].dims)));let x=[l,o,i/_];w.push(...ut(x));let b=y=>{let S=C.length,F=Ce("a",e[0].dataType,S,c),z=Ce("b",12,E.length,d),K=Ce("scales",e[2].dataType,e[2].dims.length),q=[F,z,K],R=e.length===4?Ce("zero_points",12,e[3].dims.length):void 0;R&&q.push(R);let Z=x.length,H=tt("output",e[0].dataType,Z,_),J=$r(e[0].dataType),Q=(()=>{switch(c){case 1:return`array<${J}, 8>`;case 2:return`mat4x2<${J}>`;case 4:return`mat2x4<${J}>`;default:throw new Error(`${c}-component is not supported.`)}})(),se=()=>{let V=` - // reuse a data - var input_offset = ${F.indicesToOffset(`${F.type.indices}(batch, row, word_offset)`)}; - var a_data: ${Q}; - for (var j: u32 = 0; j < ${8/c}; j++) { - a_data[j] = ${F.getByOffset("input_offset")}; - input_offset++; - } - `;for(let A=0;A<_*v;A++)V+=` - b_value = ${d===1?`b${A}_data`:`b${A}_data[i]`}; - b_value_lower = unpack4xU8(b_value & b_mask); - b_value_upper = unpack4xU8((b_value >> 4) & b_mask); - b_quantized_values = ${Q}(${Array.from({length:4},(U,ee)=>`${J}(b_value_lower[${ee}]), ${J}(b_value_upper[${ee}])`).join(", ")}); - b_dequantized_values = ${c===1?`${Q}(${Array.from({length:8},(U,ee)=>`(b_quantized_values[${ee}] - ${R?`zero_point${A}`:"zero_point"}) * scale${A}`).join(", ")});`:`(b_quantized_values - ${Q}(${Array(8).fill(`${R?`zero_point${A}`:"zero_point"}`).join(",")})) * scale${A};`}; - workgroup_shared[local_id.x * ${v} + ${Math.floor(A/_)}]${_>1?`[${A%_}]`:""} += ${Array.from({length:8/c},(U,ee)=>`${c===1?`a_data[${ee}] * b_dequantized_values[${ee}]`:`dot(a_data[${ee}], b_dequantized_values[${ee}])`}`).join(" + ")}; - `;return V},fe=()=>{let V=` - var col_index = col * ${_}; - ${R?` - let zero_point_bytes_per_col = (nBlocksPerCol + 1) / 2; - var zero_point_byte_count: u32; - var zero_point_word_index: u32; - var zero_point_byte_offset: u32; - let zero_point_nibble_offset: u32 = block & 0x1u; - var zero_point_bits_offset: u32; - var zero_point_word: u32;`:` - // The default zero point is 8 for unsigned 4-bit quantization. - let zero_point = ${J}(8);`} - `;for(let A=0;A<_*v;A++)V+=` - let scale${A} = ${K.getByOffset("col_index * nBlocksPerCol + block")}; - ${R?` - zero_point_byte_count = col_index * zero_point_bytes_per_col + (block >> 0x1u); - zero_point_word_index = zero_point_byte_count >> 0x2u; - zero_point_byte_offset = zero_point_byte_count & 0x3u; - zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); - zero_point_word = ${R.getByOffset("zero_point_word_index")} >> zero_point_bits_offset; - let zero_point${A} = ${J}((zero_point_word) & 0xFu);`:""} - col_index += 1;`;return V},ae=()=>{let V=`col_index = col * ${_};`;for(let A=0;A<_*v;A++)V+=` - let b${A}_data = ${z.getByIndices(`${z.type.indices}(col_index, block, word)`)}; - col_index += 1;`;return V+=` - var b_value: u32; - let b_mask: u32 = 0x0F0F0F0Fu; - var b_value_lower: vec4; - var b_value_upper: vec4; - var b_quantized_values: ${Q}; - var b_dequantized_values: ${Q};`,V};return` - var workgroup_shared: array<${H.type.value}, ${v*g}>; - ${y.declareVariables(...q,H)} - ${y.mainStart([g,1,1])} - let output_indices = ${H.offsetToIndices(`(global_idx / ${g}) * ${v}`)}; - let col = output_indices[2]; - let row = output_indices[1]; - let batch = output_indices[0]; - let nBlocksPerCol = uniforms.b_shape[1]; - - for (var block = local_id.x; block < nBlocksPerCol; block += ${g}) { - //process one block - var word_offset: u32 = block * ${r.blockSize/c}; - ${fe()} - for (var word: u32 = 0; word < ${u}; word += ${d}) { - ${ae()} - for (var i: u32 = 0; i < ${d}; i++) { - ${se()} - word_offset += ${8/c}; - } - } - } - workgroupBarrier(); - - if (local_id.x < ${v}) { - var output_value: ${H.type.value} = ${H.type.value}(0); - var workgroup_shared_offset: u32 = local_id.x; - for (var b: u32 = 0u; b < ${g}u; b++) { - output_value += workgroup_shared[workgroup_shared_offset]; - workgroup_shared_offset += ${v}; - } - ${H.setByIndices(`${H.type.indices}(batch, row, col + local_id.x)`,"output_value")}; - } - }`};return{name:"MatMulNBits",shaderCache:{hint:`${r.blockSize};${r.bits};${c};${d};${_};${v};${g}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:f,dataType:p}],dispatchGroup:{x:$},programUniforms:w}),getShaderSource:b}},uw=(e,r)=>{let t=e[0].dims,s=t.length,o=t[s-2],n=r.k,i=r.n,a=t.slice(0,s-2),l=Me.size(a),u=e[1].dims[2]/4,p=e[0].dataType,c=nr(r.k),d=nr(u),_=a.concat([o,i]),f=128,v=i%8===0?8:i%4===0?4:1,$=f/v,g=$*d*8,w=g/c,C=g/r.blockSize,E=Me.size(_)/v,x=[],b=[l,o,n/c],y=Me.convertShape(e[1].dims).slice();y.splice(-1,1,u/d),x.push(...ut(b)),x.push(...ut(y)),x.push(...ut(e[2].dims)),e.length===4&&x.push(...ut(Me.convertShape(e[3].dims)));let S=[l,o,i];x.push(...ut(S));let F=z=>{let K=b.length,q=Ce("a",e[0].dataType,K,c),R=Ce("b",12,y.length,d),Z=Ce("scales",e[2].dataType,e[2].dims.length),H=[q,R,Z],J=e.length===4?Ce("zero_points",12,e[3].dims.length):void 0;J&&H.push(J);let Q=S.length,se=tt("output",e[0].dataType,Q),fe=$r(e[0].dataType),ae=()=>{switch(c){case 1:return` - let a_data0 = vec4<${fe}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]); - let a_data1 = vec4<${fe}>(sub_a[word_offset + 4], sub_a[word_offset + 5], sub_a[word_offset + 6], sub_a[word_offset + 7]);`;case 2:return` - let a_data0 = vec4<${fe}>(sub_a[word_offset], sub_a[word_offset + 1]); - let a_data1 = vec4<${fe}>(sub_a[word_offset + 2], sub_a[word_offset + 3]);`;case 4:return` - let a_data0 = sub_a[word_offset]; - let a_data1 = sub_a[word_offset + 1];`;default:throw new Error(`${c}-component is not supported.`)}};return` - var sub_a: array<${q.type.value}, ${w}>; - var inter_results: array, ${v}>; - ${z.declareVariables(...H,se)} - ${z.mainStart([$,v,1])} - let output_indices = ${se.offsetToIndices(`workgroup_index * ${v}`)}; - let col = output_indices[2]; - let row = output_indices[1]; - let batch = output_indices[0]; - let n_blocks_per_col = uniforms.b_shape[1]; - let num_tiles = (n_blocks_per_col - 1) / ${C} + 1; - - // Loop over shared dimension. - for (var tile: u32 = 0; tile < num_tiles; tile += 1) { - let a_col_start = tile * ${w}; - // load one tile A data into shared memory. - for (var a_offset = local_idx; a_offset < ${w}; a_offset += ${f}) - { - let a_col = a_col_start + a_offset; - if (a_col < uniforms.a_shape[2]) - { - sub_a[a_offset] = ${q.getByIndices(`${q.type.indices}(batch, row, a_col)`)}; - } else { - sub_a[a_offset] = ${q.type.value}(0); - } - } - workgroupBarrier(); - - // each thread process one block - let b_row = col + local_id.y; - let block = tile * ${C} + local_id.x; - ${J?` - let zero_point_bytes_per_col = (n_blocks_per_col + 1) / 2; - let zero_point_byte_count = b_row * zero_point_bytes_per_col + (block >> 0x1u); - let zero_point_word_index = zero_point_byte_count >> 0x2u; - let zero_point_byte_offset = zero_point_byte_count & 0x3u; - let zero_point_nibble_offset: u32 = block & 0x1u; - let zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); - let zero_point_word = ${J.getByOffset("zero_point_word_index")} >> zero_point_bits_offset; - let zero_point = ${fe}((zero_point_word) & 0xFu);`:` - // The default zero point is 8 for unsigned 4-bit quantization. - let zero_point = ${fe}(8);`} - let scale = ${Z.getByOffset("b_row * n_blocks_per_col + block")}; - let b_data = ${R.getByIndices(`${R.type.indices}(b_row, block, 0)`)}; - var word_offset = local_id.x * ${r.blockSize/c}; - for (var i: u32 = 0; i < ${d}; i++) { - ${ae()} - let b_value = ${d===1?"b_data":"b_data[i]"}; - let b_value_lower = unpack4xU8(b_value & 0x0F0F0F0Fu); - let b_value_upper = unpack4xU8((b_value >> 4) & 0x0F0F0F0Fu); - let b_quantized_values = mat2x4<${fe}>(${Array.from({length:4},(V,A)=>`${fe}(b_value_lower[${A}]), ${fe}(b_value_upper[${A}])`).join(", ")}); - let b_dequantized_values = (b_quantized_values - mat2x4<${fe}>(${Array(8).fill("zero_point").join(",")})) * scale; - inter_results[local_id.y][local_id.x] += ${Array.from({length:2},(V,A)=>`${`dot(a_data${A}, b_dequantized_values[${A}])`}`).join(" + ")}; - word_offset += ${8/c}; - } - workgroupBarrier(); - } - - if (local_idx < ${v}) { - var output_value: ${se.type.value} = ${se.type.value}(0); - for (var b = 0u; b < ${$}; b++) { - output_value += inter_results[local_idx][b]; - } - if (col + local_idx < uniforms.output_shape[2]) - { - ${se.setByIndices(`${se.type.indices}(batch, row, col + local_idx)`,"output_value")} - } - } - }`};return{name:"BlockwiseMatMulNBits32",shaderCache:{hint:`${r.blockSize};${c};${d};${$};${v}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:_,dataType:p}],dispatchGroup:{x:E},programUniforms:x}),getShaderSource:F}},a0=(e,r)=>{aw(e.inputs,r),r.blockSize===32&&e.adapterInfo.isVendor("intel")&&e.adapterInfo.isArchitecture("gen-12lp")?e.compute(uw(e.inputs,r)):e.compute(lw(e.inputs,r))},l0=e=>Nt(e)}),cw,dw,pw,hw,mw,fw,_w,gw,u0,Gx=je(()=>{ft(),xt(),Tt(),cw=e=>{if(!e||e.length<1)throw new Error("Too few inputs");if(e[0].dataType!==1&&e[0].dataType!==10)throw new Error("Input type must be float or float16.");if(e.length>=2){let r=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(r=e[3].dims[0]*2===e[1].dims[0]),!r)throw new Error("The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].")}},dw=(e,r,t)=>{let s="";for(let o=r-1;o>=0;--o)s+=` - k = i32(${e.indicesGet("indices",o)}) - ${ot("uniforms.pads",o,t)}; - if (k < 0) { - break; - } - if (k >= i32(${ot("uniforms.x_shape",o,r)})) { - break; - } - offset += k * i32(${ot("uniforms.x_strides",o,r)}); - `;return` - value = ${e.type.value}(uniforms.constant_value); - for (var i = 0; i < 1; i++) { - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - } - `},pw=(e,r,t)=>{let s="";for(let o=r-1;o>=0;--o)s+=` - k = i32(${e.indicesGet("indices",o)}) - ${ot("uniforms.pads",o,t)}; - if (k < 0) { - k = -k; - } - { - let _2n_1 = 2 * (i32(${ot("uniforms.x_shape",o,r)}) - 1); - k = k % _2n_1; - if(k >= i32(${ot("uniforms.x_shape",o,r)})) { - k = _2n_1 - k; - } - } - offset += k * i32(${ot("uniforms.x_strides",o,r)}); - `;return` - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - `},hw=(e,r,t)=>{let s="";for(let o=r-1;o>=0;--o)s+=` - k = i32(${e.indicesGet("indices",o)}) - ${ot("uniforms.pads",o,t)}; - if (k < 0) { - k = 0; - } - if (k >= i32(${ot("uniforms.x_shape",o,r)})) { - k = i32(${ot("uniforms.x_shape",o,r)}) - 1; - } - offset += k * i32(${ot("uniforms.x_strides",o,r)}); - `;return` - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - `},mw=(e,r,t)=>{let s="";for(let o=r-1;o>=0;--o)s+=` - k = i32(${e.indicesGet("indices",o)}) - ${ot("uniforms.pads",o,t)}; - if (k < 0) { - k += i32(${ot("uniforms.x_shape",o,r)}]); - } - if (k >= i32(${ot("uniforms.x_shape",o,r)})) { - k -= i32(${ot("uniforms.x_shape",o,r)}); - } - offset += k * i32(${ot("uniforms.x_strides",o,r)}); - `;return` - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - `},fw=(e,r,t)=>{switch(t.mode){case 0:return dw(e,r,t.pads.length);case 1:return pw(e,r,t.pads.length);case 2:return hw(e,r,t.pads.length);case 3:return mw(e,r,t.pads.length);default:throw new Error("Invalid mode")}},_w=(e,r)=>{let t=Me.padShape(e[0].dims.slice(),r.pads),s=e[0].dims,o=Me.size(t),n=[{type:12,data:o},{type:6,data:r.pads}],i=e.length>=3&&e[2].data;r.mode===0&&n.push({type:i?e[2].dataType:1,data:r.value}),n.push(...ut(e[0].dims,t));let a=["rank"],l=u=>{let p=tt("output",e[0].dataType,t.length),c=Ce("x",e[0].dataType,s.length),d=c.type.value,_=fw(p,s.length,r),f=[{name:"output_size",type:"u32"},{name:"pads",type:"i32",length:r.pads.length}];return r.mode===0&&f.push({name:"constant_value",type:i?d:"f32"}),` - ${u.registerUniforms(f).declareVariables(c,p)} - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let indices = ${p.offsetToIndices("global_idx")}; - - var value = ${d}(0); - ${_} - output[global_idx] = value; - }`};return{name:"Pad",shaderCache:{hint:`${r.mode}${i}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Me.size(t)/64)},programUniforms:n}),getShaderSource:l}},gw=(e,r)=>{if(e.length>1){let t=e[1].getBigInt64Array(),s=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,o=e[0].dims.length,n=new Int32Array(2*o).fill(0);if(e.length>=4){let a=e[3].getBigInt64Array();for(let l=0;ln[Number(l)]=Number(a));let i=[];return n.forEach(a=>i.push(a)),{mode:r.mode,value:s,pads:i}}else return r},u0=(e,r)=>{cw(e.inputs);let t=gw(e.inputs,r);e.compute(_w(e.inputs,t),{inputs:[0]})}}),Wo,mu,fu,_u,gu,ww,bw,wu,bu,c0,d0,Mu,p0,h0,yu,m0,f0,_0,g0,Kx=je(()=>{Ps(),ft(),xt(),Tt(),Wo=e=>{if(Yt.webgpu.validateInputContent&&(!e||e.length!==1))throw new Error("Pool ops requires 1 input.")},mu=(e,r,t)=>{let s=r.format==="NHWC",o=e.dims.slice();s&&o.splice(1,0,o.pop());let n=Object.hasOwnProperty.call(r,"dilations"),i=r.kernelShape.slice(),a=r.strides.slice(),l=n?r.dilations.slice():[],u=r.pads.slice();ma.adjustPoolAttributes(t,o,i,a,l,u);let p=ma.computePoolOutputShape(t,o,a,l,i,u,r.autoPad),c=Object.assign({},r);n?Object.assign(c,{kernelShape:i,strides:a,pads:u,dilations:l,cacheKey:r.cacheKey}):Object.assign(c,{kernelShape:i,strides:a,pads:u,cacheKey:r.cacheKey});let d=p.slice();return d.push(d.splice(1,1)[0]),[c,s?d:p]},fu=(e,r)=>{let t=r.format==="NHWC",s=Me.size(e),o=Me.size(r.kernelShape),n=[{type:12,data:s},{type:12,data:o}],i=[{name:"outputSize",type:"u32"},{name:"kernelSize",type:"u32"}];if(r.kernelShape.length<=2){let a=r.kernelShape[r.kernelShape.length-1],l=r.strides[r.strides.length-1],u=r.pads[r.pads.length/2-1],p=r.pads[r.pads.length-1],c=!!(u+p);n.push({type:12,data:a},{type:12,data:l},{type:12,data:u},{type:12,data:p}),i.push({name:"kw",type:"u32"},{name:"sw",type:"u32"},{name:"pwStart",type:"u32"},{name:"pwEnd",type:"u32"});let d=!1;if(r.kernelShape.length===2){let _=r.kernelShape[r.kernelShape.length-2],f=r.strides[r.strides.length-2],v=r.pads[r.pads.length/2-2],$=r.pads[r.pads.length-2];d=!!(v+$),n.push({type:12,data:_},{type:12,data:f},{type:12,data:v},{type:12,data:$}),i.push({name:"kh",type:"u32"},{name:"sh",type:"u32"},{name:"phStart",type:"u32"},{name:"phEnd",type:"u32"})}return[n,i,!0,c,d]}else{if(t)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let a=Me.computeStrides(r.kernelShape);n.push({type:12,data:a},{type:12,data:r.pads},{type:12,data:r.strides}),i.push({name:"kernelStrides",type:"u32",length:a.length},{name:"pads",type:"u32",length:r.pads.length},{name:"strides",type:"u32",length:r.strides.length});let l=r.pads.reduce((u,p)=>u+p);return[n,i,!!l,!1,!1]}},_u=(e,r,t,s,o,n,i,a,l,u,p,c)=>{let d=o.format==="NHWC",_=r.type.value,f=tt("output",r.type.tensor,s);if(o.kernelShape.length<=2){let v="",$="",g="",w=t-(d?2:1);if(p?v=` - for (var i: u32 = 0u; i < uniforms.kw; i++) { - xIndices[${w}] = indices[${w}] * uniforms.sw - uniforms.pwStart + i; - if (xIndices[${w}] < 0 || xIndices[${w}] - >= uniforms.x_shape[${w}]) { - pad++; - continue; - } - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - }`:v=` - for (var i: u32 = 0u; i < uniforms.kw; i++) { - xIndices[${w}] = indices[${w}] * uniforms.sw - uniforms.pwStart + i; - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - }`,o.kernelShape.length===2){let C=t-(d?3:2);c?$=` - for (var j: u32 = 0u; j < uniforms.kh; j++) { - xIndices[${C}] = indices[${C}] * uniforms.sh - uniforms.phStart + j; - if (xIndices[${C}] < 0 || xIndices[${C}] >= uniforms.x_shape[${C}]) { - pad += i32(uniforms.kw); - continue; - } - `:$=` - for (var j: u32 = 0u; j < uniforms.kh; j++) { - xIndices[${C}] = indices[${C}] * uniforms.sh - uniforms.phStart + j; - `,g=` - } - `}return` - ${e.registerUniforms(l).declareVariables(r,f)} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - - let indices = ${f.offsetToIndices("global_idx")}; - var xIndices = ${f.offsetToIndices("global_idx")}; - - var value = ${_}(${a}); - var pad = 0; - ${$} - ${v} - ${g} - ${i} - - output[global_idx] = value; - }`}else{if(d)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let v=o.kernelShape.length,$=o.pads.length,g="";return u?g=` - if (xIndices[j] >= uniforms.x_shape[j]) { - pad++; - isPad = true; - break; - } - } - if (!isPad) { - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - }`:g=` - } - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - `,` - ${e.registerUniforms(l).declareVariables(r,f)} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - let indices = ${f.offsetToIndices("global_idx")}; - var xIndices = ${f.offsetToIndices("global_idx")}; - - var offsets: array; - - var value = ${_}(${a}); - var pad = 0; - var isPad = false; - - for (var i: u32 = 0u; i < uniforms.kernelSize; i++) { - var offset = i; - for (var j = 0u; j < ${v-1}u; j++) { - offsets[j] = offset / ${ot("uniforms.kernelStrides","j",v)}; - offset -= offsets[j] * ${ot("uniforms.kernelStrides","j",v)}; - } - offsets[${v-1}] = offset; - - isPad = false; - for (var j = ${t-v}u; j < ${t}u; j++) { - xIndices[j] = indices[j] * ${ot("uniforms.strides",`j - ${t-v}u`,v)} - + offsets[j - ${t-v}u] - ${ot("uniforms.pads","j - 2u",$)}; - ${g} - } - ${i} - - output[global_idx] = value; - }`}},gu=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,ww=e=>`${gu(e)};${e.countIncludePad}`,bw=e=>`${gu(e)};${e.storageOrder};${e.dilations}`,wu=e=>({format:e.format,autoPad:["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),bu=(e,r,t,s)=>{let[o,n]=mu(r,s,t),i=Ce("x",r.dataType,r.dims.length),a=i.type.value,l="value += x_val;",u="";o.countIncludePad?u+=`value /= ${a}(uniforms.kernelSize);`:u+=`value /= ${a}(i32(uniforms.kernelSize) - pad);`;let[p,c,d,_,f]=fu(n,o);p.push(...ut(r.dims,n));let v=["rank"];return{name:e,shaderCache:{hint:`${s.cacheKey};${d};${_};${f}`,inputDependencies:v},getRunData:()=>({outputs:[{dims:n,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(Me.size(n)/64)},programUniforms:p}),getShaderSource:$=>_u($,i,r.dims.length,n.length,o,l,u,0,c,d,_,f)}},c0=e=>{let r=e.count_include_pad!==0,t=wu(e);if(t.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");let s={countIncludePad:r,...t,cacheKey:""};return{...s,cacheKey:ww(s)}},d0=(e,r)=>{Wo(e.inputs),e.compute(bu("AveragePool",e.inputs[0],!1,r))},Mu={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},p0=e=>{let r=e.format;return{format:r,...Mu,cacheKey:r}},h0=(e,r)=>{Wo(e.inputs),e.compute(bu("GlobalAveragePool",e.inputs[0],!0,r))},yu=(e,r,t,s)=>{let[o,n]=mu(r,s,t),i=` - value = max(x_val, value); - `,a="",l=Ce("x",r.dataType,r.dims.length),u=["rank"],[p,c,d,_,f]=fu(n,o);return p.push(...ut(r.dims,n)),{name:e,shaderCache:{hint:`${s.cacheKey};${d};${_};${f}`,inputDependencies:u},getRunData:()=>({outputs:[{dims:n,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(Me.size(n)/64)},programUniforms:p}),getShaderSource:v=>_u(v,l,r.dims.length,n.length,o,i,a,r.dataType===10?-65504:-1e5,c,d,_,f)}},m0=(e,r)=>{Wo(e.inputs),e.compute(yu("MaxPool",e.inputs[0],!1,r))},f0=e=>{let r=e.storage_order,t=e.dilations,s=wu(e);if(r!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(s.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");let o={storageOrder:r,dilations:t,...s,cacheKey:""};return{...o,cacheKey:bw(o)}},_0=e=>{let r=e.format;return{format:r,...Mu,cacheKey:r}},g0=(e,r)=>{Wo(e.inputs),e.compute(yu("GlobalMaxPool",e.inputs[0],!0,r))}}),Mw,yw,w0,b0,Hx=je(()=>{ft(),xt(),lr(),Tt(),Mw=(e,r)=>{if(e.length<2||e.length>3)throw new Error("DequantizeLinear requires 2 or 3 inputs.");if(e.length===3&&e[1].dims===e[2].dims)throw new Error("x-scale and x-zero-point must have the same shape.");if(e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("x and x-zero-point must have the same data type.");if(e[0].dataType===6&&e.length>2)throw new Error("In the case of dequantizing int32 there is no zero point.");if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw new Error("scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.");if(e.length>2){if(e[0].dataType!==e[2].dataType)throw new Error("x and x-zero-point must have the same data type.");if(e[1].dims.length!==e[2].dims.length)throw new Error("scale and zero-point inputs must have the same rank.");if(!e[1].dims.map((t,s)=>t===e[2].dims[s]).reduce((t,s)=>t&&s,!0))throw new Error("scale and zero-point inputs must have the same shape.")}if(r.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw new Error("blockSize must be set only for block quantization.");if(!e[1].dims.map((o,n)=>n===r.axis||o===e[0].dims[n]).reduce((o,n)=>o&&n,!0))throw new Error("For block qunatization, scale input shape to match the input shape except for the axis");if(e[1].dims.length!==e[0].dims.length)throw new Error("For block qunatization the scale input rank must be the same as the x rank.");let t=e[0].dims[r.axis],s=e[1].dims[r.axis];if(r.blockSizeMath.ceil(t/(s-1)-1))throw new Error("blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].")}},yw=(e,r)=>{let t=Me.normalizeAxis(r.axis,e[0].dims.length),s=e[0].dataType,o=s===3,n=e[0].dims,i=e[1].dataType,a=Me.size(n),l=s===3||s===2,u=l?[Math.ceil(Me.size(e[0].dims)/4)]:e[0].dims,p=e[1].dims,c=e.length>2?e[2]:void 0,d=c?l?[Math.ceil(Me.size(c.dims)/4)]:c.dims:void 0,_=p.length===0||p.length===1&&p[0]===1,f=_===!1&&p.length===1,v=nr(a),$=_&&(!l||v===4),g=$?v:1,w=$&&!l?v:1,C=Ce("input",l?12:s,u.length,w),E=Ce("scale",i,p.length),x=c?Ce("zero_point",l?12:s,d.length):void 0,b=tt("output",i,n.length,g),y=[C,E];x&&y.push(x);let S=[u,p];c&&S.push(d);let F=[{type:12,data:a/g},{type:12,data:t},{type:12,data:r.blockSize},...ut(...S,n)],z=K=>{let q=[{name:"output_size",type:"u32"},{name:"axis",type:"u32"},{name:"block_size",type:"u32"}];return` - ${K.registerUniforms(q).declareVariables(...y,b)} - ${K.mainStart()} - ${K.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let output_indices = ${b.offsetToIndices("global_idx")}; - - // Set input x - ${l?` - let input = ${C.getByOffset("global_idx / 4")}; - let x_vec = ${o?"unpack4xI8(input)":"unpack4xU8(input)"}; - let x_value = ${g===1?"x_vec[global_idx % 4]":"x_vec"};`:`let x_value = ${C.getByOffset("global_idx")};`}; - - // Set scale input - ${_?`let scale_value= ${E.getByOffset("0")}`:f?` - let scale_index = ${b.indicesGet("output_indices","uniforms.axis")}; - let scale_value= ${E.getByOffset("scale_index")};`:` - var scale_indices: ${E.type.indices} = output_indices; - let index = ${E.indicesGet("scale_indices","uniforms.axis")} / uniforms.block_size; - ${E.indicesSet("scale_indices","uniforms.axis","index")}; - let scale_value= ${E.getByIndices("scale_indices")};`}; - - // Set zero-point input - ${x?_?l?` - let zero_point_input = ${x.getByOffset("0")}; - let zero_point_vec = ${o?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; - let zero_point_value= zero_point_vec[0]`:`let zero_point_value = ${x.getByOffset("0")}`:f?l?` - let zero_point_index = ${b.indicesGet("output_indices","uniforms.axis")}; - let zero_point_input = ${x.getByOffset("zero_point_index / 4")}; - let zero_point_vec = ${o?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; - let zero_point_value = zero_point_vec[zero_point_index % 4]`:` - let zero_point_index = ${b.indicesGet("output_indices","uniforms.axis")}; - let zero_point_value = ${x.getByOffset("zero_point_index")};`:l?` - let zero_point_offset = ${E.indicesToOffset("scale_indices")}; - let zero_point_input = ${x.getByOffset("zero_point_offset / 4")}; - let zero_point_vec = ${o?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; - let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${x.getByIndices("scale_indices")};`:`let zero_point_value = ${l?o?"i32":"u32":C.type.value}(0);`}; - // Compute and write output - ${b.setByOffset("global_idx",`${b.type.value}(x_value - zero_point_value) * scale_value`)}; - }`};return{name:"DequantizeLinear",shaderCache:{hint:r.cacheKey,inputDependencies:x?["rank","rank","rank"]:["rank","rank"]},getShaderSource:z,getRunData:()=>({outputs:[{dims:n,dataType:i}],dispatchGroup:{x:Math.ceil(a/g/64),y:1,z:1},programUniforms:F})}},w0=(e,r)=>{Mw(e.inputs,r),e.compute(yw(e.inputs,r))},b0=e=>Nt({axis:e.axis,blockSize:e.blockSize})}),vw,xw,M0,qx=je(()=>{Ps(),ft(),Tt(),vw=(e,r,t)=>{let s=e===r,o=er&&t>0;if(s||o||n)throw new Error("Range these inputs' contents are invalid.")},xw=(e,r,t,s)=>{let o=Math.abs(Math.ceil((r-e)/t)),n=[o],i=o,a=[{type:12,data:i},{type:s,data:e},{type:s,data:t},...ut(n)],l=u=>{let p=tt("output",s,n.length),c=p.type.value,d=[{name:"outputSize",type:"u32"},{name:"start",type:c},{name:"delta",type:c}];return` - ${u.registerUniforms(d).declareVariables(p)} - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - output[global_idx] = uniforms.start + ${c}(global_idx) * uniforms.delta; - }`};return{name:"Range",shaderCache:{hint:`${s}`},getShaderSource:l,getRunData:()=>({outputs:[{dims:n,dataType:s}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:a})}},M0=e=>{let r=0,t=0,s=0;e.inputs[0].dataType===6?(r=e.inputs[0].getInt32Array()[0],t=e.inputs[1].getInt32Array()[0],s=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(r=e.inputs[0].getFloat32Array()[0],t=e.inputs[1].getFloat32Array()[0],s=e.inputs[2].getFloat32Array()[0]),Yt.webgpu.validateInputContent&&vw(r,t,s),e.compute(xw(r,t,s,e.inputs[0].dataType),{inputs:[]})}}),Tw,vu,xu,Ew,y0,v0,Qx=je(()=>{ft(),xt(),lr(),Tt(),Tw=(e,r,t,s)=>{if(e!=="none"&&s!=="i32"&&s!=="u32"&&s!=="f32")throw new Error(`Input ${s} is not supported with reduction ${e}.`);let o=`{ - var oldValue = 0; - loop { - let newValueF32 =`,n=`; - let newValue = bitcast(newValueF32); - let res = atomicCompareExchangeWeak(&${r}, oldValue, newValue); - if res.exchanged { - break; - } - oldValue = res.old_value; - } - }`;switch(e){case"none":return`${r}=${t};`;case"add":return s==="i32"||s==="u32"?`atomicAdd(&${r}, bitcast<${s}>(${t}));`:` - ${o}bitcast<${s}>(oldValue) + (${t})${n}`;case"max":return s==="i32"||s==="u32"?`atomicMax(&${r}, bitcast<${s}>(${t}));`:` - ${o}max(bitcast(oldValue), (${t}))${n}`;case"min":return s==="i32"||s==="u32"?`atomicMin(&${r}, bitcast<${s}>(${t}));`:`${o}min(bitcast<${s}>(oldValue), (${t}))${n}`;case"mul":return`${o}(bitcast<${s}>(oldValue) * (${t}))${n}`;default:throw new Error(`Reduction ${e} is not supported.`)}},vu=(e,r)=>`${e===1?` - let element_count_dim = uniforms.output_strides; - let dim_value = uniforms.output_shape;`:` - let element_count_dim = uniforms.output_strides[${r?"i - indices_start":"i"}]; - let dim_value = uniforms.output_shape[${r?"i - indices_start":"i"} + uniforms.last_index_dimension];`} - - if (index >= 0) { - if (index >= i32(dim_value)) { - index = i32(dim_value - 1); - } - } else { - if (index < -i32(dim_value)) { - index = 0; - } else { - index += i32(dim_value); - } - } - data_offset += u32((u32(index) * element_count_dim));`,xu=(e,r,t)=>`for (var i = 0u; i < uniforms.num_updates_elements; i++) { - let value = updates[uniforms.num_updates_elements * ${t?"global_idx":"idx"} + i]; - ${Tw(e.reduction,"output[data_offset + i]","value",r)} - }`,Ew=(e,r)=>{let t=e[0].dims,s=e[1].dims,o=t,n=1,i=Math.ceil(Me.size(s)/n),a=s[s.length-1],l=Me.sizeFromDimension(t,a),u=Me.sizeFromDimension(s,0)/a,p=[{type:12,data:i},{type:12,data:a},{type:12,data:l},...ut(e[1].dims,e[2].dims,o)],c=d=>{let _=Ce("indices",e[1].dataType,e[1].dims.length),f=Ce("updates",e[2].dataType,e[2].dims.length,n),v=r.reduction!=="none"&&r.reduction!==""?Xb("output",e[0].dataType,o.length):tt("output",e[0].dataType,o.length,n);return` - ${d.registerUniform("output_size","u32").registerUniform("last_index_dimension","u32").registerUniform("num_updates_elements","u32").declareVariables(_,f,v)} - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - var hasDuplicates = false; - if (${r.reduction==="none"}) { - for (var i = 0; i < ${u}; i = i + 1) { - for (var j = i + 1; j < ${u}; j = j + 1) { - var index_i = i32(indices[i].x); - var index_j = i32(indices[j].x); - if (index_i == index_j) { - hasDuplicates = true; - break; - } - } - if (hasDuplicates) { - break; - } - } - } - - if (${r.reduction==="none"} && hasDuplicates) { - if (global_idx != 0u) { - return; - } - // Process each index-update pair individually when duplicates exist - for (var idx = 0u; idx < ${u}u; idx++) { - var data_offset = 0u; - for (var i = 0u; i < uniforms.last_index_dimension; i++) { - var index = i32(indices[idx * uniforms.last_index_dimension + i].x); - ${vu(t.length,!1)} - } - ${xu(r,v.type.value,!1)} - } - return; - } - - var data_offset = 0u; - var indices_start = uniforms.last_index_dimension * global_idx; - var indices_end = indices_start + uniforms.last_index_dimension; - for (var i = indices_start; i < indices_end; i++) { - var index = i32(indices[i].x); - ${vu(t.length,!0)} - } - ${xu(r,v.type.value,!0)} - }`};return{name:"ScatterND",shaderCache:{hint:`${r.cacheKey}_${r.reduction}`,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:p}),getShaderSource:c}},y0=e=>Nt({reduction:e.reduction}),v0=(e,r)=>{e.compute(Ew(e.inputs,r),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),Pw,Cw,Sw,Tu,$w,kw,Iw,Aw,Fw,Ow,Dw,Lw,Eu,zw,Bw,Rw,jw,Nw,x0,T0,Xx=je(()=>{ft(),xt(),lr(),Tt(),Pw=(e,r)=>{if(e.every(t=>t>0||(()=>{throw new Error("Resize requires scales input values to be positive")})),e.length>0){if(r.mode==="linear"){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw new Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and - one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(r.mode==="cubic"&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw new Error("Resize requires scales input size to be 2 or 4 for cubic mode")}},Cw=(e,r,t)=>{r.every(o=>o>=0&&o{throw new Error("Resize requires axes input values to be positive and less than rank")}));let s=new Array(t).fill(1);return r.forEach((o,n)=>s[o]=e[n]),s},Sw=(e,r,t,s,o,n)=>{let[i,a,l]=t>10?[1,2,3]:[-1,e.length>1?1:-1,-1],u=e[0].dims.length;if(i>0&&e.length>i&&e[i].dims.length>0)e[i].getFloat32Array().forEach(p=>n.push(p));else if(r.coordinateTransformMode==="tf_crop_and_resize")throw new Error("Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize");if(a>0&&e.length>a&&e[a].dims.length===1&&e[a].dims[0]>0){if(e[a].getFloat32Array().forEach(p=>s.push(p)),s.length!==0&&s.length!==u&&t>=18&&s.length!==r.axes.length)throw new Error("Resize requires scales input size to be same as input rank or axes size for opset 18 and up");Pw(s,r),r.axes.length>0&&Cw(s,r.axes,u).forEach((p,c)=>s[c]=p)}if(l>0&&e.length>l&&e[l].dims.length===1&&e[l].dims[0]>0&&(e[l].getBigInt64Array().forEach(p=>o.push(Number(p))),o.length!==0&&o.length!==u&&t>=18&&o.length!==r.axes.length))throw new Error("Resize requires sizes input size to be same as input rank or axes size for opset 18 and up");if(r.axes.length>0){if(s.length!==0&&s.length!==r.axes.length)throw new Error('Resize requires "scales" input size to be of axes rank when axes attributes is specified');if(o.length!==0&&o.length!==r.axes.length)throw new Error('Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified')}if(typeof s<"u"&&typeof o<"u"&&s.length>0&&o.length>u)throw new Error("Resize requires only of scales or sizes to be specified")},Tu=(e,r,t,s)=>` - // The whole part and the fractional part are calculated separately due to inaccuracy of floating - // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an - // offset-by-one error later in floor(). - let big = (${e}) * (${r}); - let whole = ${s}(big / (${t})); - let fract = ${s}(big % (${t})) / ${s}(${t}); - return whole + fract; -`,$w=(e,r)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32, - lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${r} { `+(()=>{switch(e){case"asymmetric":return` - if (xScale < 1.0 || floor(xScale) != xScale) { - return ${r}(xResized) / ${r}(xScale); - } else { - ${Tu("xResized","lengthOriginal","lengthResized",r)} - } - `;case"pytorch_half_pixel":return`if (lengthResized > 1) { - return (${r}(xResized) + 0.5) / ${r}(xScale) - 0.5; - } else { - return 0.0; - }`;case"tf_half_pixel_for_nn":return`return (${r}(xResized) + 0.5) / ${r}(xScale);`;case"align_corners":return`if (lengthResized == 1) { - return 0.0; - } else { - ${Tu("xResized","lengthOriginal - 1","lengthResized - 1",r)} - }`;case"tf_crop_and_resize":return`if (lengthResized > 1) { - return ${r}(roiStart) * ${r}(lengthOriginal - 1) + - (${r}(xResized) * ${r}(roiEnd - roiStart) * ${r}(lengthOriginal - 1)) / - ${r}(lengthResized - 1); - } else { - return 0.5 * ${r}(roiStart + roiEnd) * ${r}(lengthOriginal - 1); - }`;case"half_pixel_symmetric":return`const outputWidth = ${r}xScale * ${r}(lengthResized); - const adjustment = ${r}(lengthResized) / outputWidth; - const center = ${r}(lengthOriginal) / 2; - const offset = center * (1 - adjustment); - return offset + ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;case"half_pixel":return`return ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;default:throw new Error(`Coordinate transform mode ${e} is not supported`)}})()+"}",kw=(e,r,t)=>`fn getNearestPixelFromOriginal(xOriginal: ${t}, isDownSample: bool) -> ${t} {`+(()=>{switch(e){case"round_prefer_ceil":return"if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }";case"floor":return"return floor(xOriginal);";case"ceil":return"return ceil(xOriginal);";case"round_prefer_floor":return"if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }";case"simple":default:if(r<11)return"if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }";throw new Error(`Nearest mode ${e} is not supported`)}})()+"}",Iw=(e,r,t)=>{let s=new Array(t).fill(0).concat(new Array(t).fill(1)),o=e.length===0?s:e.slice();return r.length>0?(r.forEach((n,i)=>{s[n]=o[i],s[i+t]=o[r.length+i]}),s):o},Aw=(e,r,t,s)=>{let o=[];if(t.length>0)if(s.length>0){if(e.forEach(n=>o.push(n)),Math.max(...s)>e.length)throw new Error("axes is out of bound");s.forEach((n,i)=>o[n]=t[i])}else t.forEach(n=>o.push(n));else{if(r.length===0)throw new Error("Resize requires either scales or sizes.");o=e.map((n,i)=>Math.round(n*r[i]))}return o},Fw=(e,r,t)=>{let s=(()=>{switch(t.keepAspectRatioPolicy){case"not_larger":return t.axes.length>0?Math.min(...t.axes.map(n=>r[n]),Number.MAX_VALUE):Math.min(...r,Number.MAX_VALUE);case"not_smaller":return t.axes.length>0?Math.max(...t.axes.map(n=>r[n]),Number.MIN_VALUE):Math.max(...r,Number.MIN_VALUE);default:throw new Error(`Keep aspect ratio policy ${t.keepAspectRatioPolicy} is not supported`)}})();r.fill(1,0,r.length);let o=e.slice();return t.axes.length>0?(t.axes.forEach(n=>r[n]=s),t.axes.forEach(n=>o[n]=Math.round(e[n]*r[n]))):(r.fill(s,0,r.length),o.forEach((n,i)=>o[i]=Math.round(n*r[i]))),o},Ow=(e,r,t,s,o)=>` - fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${t.length}> { - var original_indices: array<${e.type.value}, ${t.length}>; - for (var i:u32 = 0; i < ${t.length}; i++) { - var output_index = ${e.indicesGet("output_indices","i")}; - var scale = ${ot("uniforms.scales","i",s)}; - var roi_low = ${ot("uniforms.roi","i",o)}; - var roi_hi = ${ot("uniforms.roi",`i + ${r.length}`,o)}; - if (scale == 1.0) { - original_indices[i] = ${e.type.value}(output_index); - } else { - var input_shape_i = ${ot("uniforms.input_shape","i",r.length)}; - var output_shape_i = ${ot("uniforms.output_shape","i",t.length)}; - original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, - input_shape_i, roi_low, roi_hi); - } - } - return original_indices; - }`,Dw=(e,r,t,s,o,n,i)=>` - fn calculateInputIndicesFromOutputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} { - var input_indices: ${e.type.indices}; - for (var i:u32 = 0; i < ${s.length}; i++) { - var output_index = ${r.indicesGet("output_indices","i")}; - var input_index: u32; - var scale = ${ot("uniforms.scales","i",o)}; - if (scale == 1.0) { - input_index = output_index; - } else { - var roi_low = ${ot("uniforms.roi","i",n)}; - var roi_hi = ${ot("uniforms.roi",`i + ${t.length}`,n)}; - var input_shape_i = ${ot("uniforms.input_shape","i",t.length)}; - var output_shape_i = ${ot("uniforms.output_shape","i",s.length)}; - var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, - input_shape_i, roi_low, roi_hi); - if (!${i} || (original_idx >= 0 && original_idx < ${r.type.value}(input_shape_i))) { - if (original_idx < 0) { - input_index = 0; - } else if (original_idx > ${r.type.value}(input_shape_i - 1)) { - input_index = input_shape_i - 1; - } else { - input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1)); - } - } else { - input_index = u32(original_idx); - } - } - ${e.indicesSet("input_indices","i","input_index")} - } - return input_indices; - }`,Lw=(e,r)=>` - fn checkInputIndices(input_indices: ${e.type.indices}) -> bool { - for (var i:u32 = 0; i < ${r.length}; i++) { - var input_index = ${e.indicesGet("input_indices","i")}; - if (input_index < 0 || input_index >= ${ot("uniforms.input_shape","i",r.length)}) { - return false; - } - } - return true; - }`,Eu=(e,r,t,s)=>e.rank>s?` - ${e.indicesSet("input_indices",r,"channel")}; - ${e.indicesSet("input_indices",t,"batch")}; -`:"",zw=(e,r,t,s,o)=>{let[n,i,a,l]=t.length===2?[-1,0,1,-1]:[0,2,3,1],u=e.type.value;return` - fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${u} { - var input_indices: ${e.type.indices}; - ${e.indicesSet("input_indices",i,`max(0, min(row, ${t[i]} - 1))`)}; - ${e.indicesSet("input_indices",a,`max(0, min(col, ${t[a]} - 1))`)}; - ${Eu(e,l,n,2)} - return ${e.getByIndices("input_indices")}; - } - - fn bilinearInterpolation(output_indices: ${r.type.indices}) -> ${u} { - var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); - var row:${u} = originalIndices[${i}]; - var col:${u} = originalIndices[${a}]; - ${s?`if (row < 0 || row > (${t[i]} - 1) || col < 0 || col > (${t[a]} - 1)) { - return ${o}; - }`:""}; - row = max(0, min(row, ${t[i]} - 1)); - col = max(0, min(col, ${t[a]} - 1)); - var row1: u32 = u32(row); - var col1: u32 = u32(col); - var row2: u32 = u32(row + 1); - var col2: u32 = u32(col + 1); - var channel: u32 = ${t.length>2?`u32(originalIndices[${l}])`:"0"}; - var batch: u32 = ${t.length>2?`u32(originalIndices[${n}])`:"0"}; - var x11: ${u} = getInputValue(batch, channel, row1, col1); - var x12: ${u} = getInputValue(batch, channel, row1, col2); - var x21: ${u} = getInputValue(batch, channel, row2, col1); - var x22: ${u} = getInputValue(batch, channel, row2, col2); - var dx1: ${u} = abs(row - ${u}(row1)); - var dx2: ${u} = abs(${u}(row2) - row); - var dy1: ${u} = abs(col - ${u}(col1)); - var dy2: ${u} = abs(${u}(col2) - col); - if (row1 == row2) { - dx1 = 0.5; - dx2 = 0.5; - } - if (col1 == col2) { - dy1 = 0.5; - dy2 = 0.5; - } - return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1); - }`},Bw=(e,r,t,s,o,n,i,a,l,u)=>{let p=t.length===2,[c,d]=p?[0,1]:[2,3],_=e.type.value,f=v=>{let $=v===c?"row":"col";return` - fn ${$}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${r.type.indices}) -> ${_} { - var output_index = ${r.indicesGet("output_indices",v)}; - var originalIdx: ${_} = getOriginalCoordinateFromResizedCoordinate(output_index, ${o[v]}, - ${s[v]}, ${t[v]}, ${n[v]}, ${n[v]} + ${t.length}); - var fractOriginalIdx: ${_} = originalIdx - floor(originalIdx); - var coefs = getCubicInterpolationCoefs(fractOriginalIdx); - - if (${a} && (originalIdx < 0 || originalIdx > (${t[v]} - 1))) { - return ${l}; - } - var data: array<${_}, 4> = array<${_}, 4>(0.0, 0.0, 0.0, 0.0); - for (var i: i32 = -1; i < 3; i++) { - var ${$}: ${_} = originalIdx + ${_}(i); - if (${$} < 0 || ${$} >= ${t[v]}) { - ${u?`coefs[i + 1] = 0.0; - continue;`:a?`return ${l};`:`${$} = max(0, min(${$}, ${t[v]} - 1));`}; - } - var input_indices_copy: ${e.type.indices} = input_indices; - ${e.indicesSet("input_indices_copy",v,`u32(${$})`)}; - data[i + 1] = ${v===c?e.getByIndices("input_indices_copy"):"rowCubicInterpolation(input_indices_copy, output_indices)"}; - } - return cubicInterpolation1D(data, coefs); - }`};return` - ${f(c)}; - ${f(d)}; - fn getCubicInterpolationCoefs(s: ${_}) -> array<${_}, 4> { - var absS = abs(s); - var coeffs: array<${_}, 4> = array<${_}, 4>(0.0, 0.0, 0.0, 0.0); - var oneMinusAbsS: ${_} = 1.0 - absS; - var twoMinusAbsS: ${_} = 2.0 - absS; - var onePlusAbsS: ${_} = 1.0 + absS; - coeffs[0] = ((${i} * onePlusAbsS - 5 * ${i}) * onePlusAbsS + 8 * ${i}) * onePlusAbsS - 4 * ${i}; - coeffs[1] = ((${i} + 2) * absS - (${i} + 3)) * absS * absS + 1; - coeffs[2] = ((${i} + 2) * oneMinusAbsS - (${i} + 3)) * oneMinusAbsS * oneMinusAbsS + 1; - coeffs[3] = ((${i} * twoMinusAbsS - 5 * ${i}) * twoMinusAbsS + 8 * ${i}) * twoMinusAbsS - 4 * ${i}; - return coeffs; - } - - fn cubicInterpolation1D(x: array<${_}, 4>, coefs: array<${_}, 4>) -> ${_} { - var coefsSum: ${_} = coefs[0] + coefs[1] + coefs[2] + coefs[3]; - return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum; - } - - fn bicubicInterpolation(output_indices: ${r.type.indices}) -> ${_} { - var input_indices: ${e.type.indices} = output_indices; - return colCubicInterpolation(input_indices, output_indices); - } - `},Rw=(e,r,t,s,o)=>{let[n,i,a,l,u]=t.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],p=e.type.value;return` - fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${p} { - var input_indices: ${e.type.indices}; - ${e.indicesSet("input_indices",i,`max(0, min(depth, ${t[i]} - 1))`)}; - ${e.indicesSet("input_indices",a,`max(0, min(height, ${t[a]} - 1))`)}; - ${e.indicesSet("input_indices",l,`max(0, min(width, ${t[l]} - 1))`)}; - ${Eu(e,u,n,3)} - return ${e.getByIndices("input_indices")}; - } - - fn trilinearInterpolation(output_indices: ${r.type.indices}) -> ${p} { - var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); - var depth:${p} = originalIndices[${i}]; - var height:${p} = originalIndices[${a}]; - var width:${p} = originalIndices[${l}]; - ${s?`if (depth < 0 || depth > (${t[i]} - 1) || height < 0 || height > (${t[a]} - 1) || width < 0 || (width > ${t[l]} - 1)) { - return ${o}; - }`:""}; - - depth = max(0, min(depth, ${t[i]} - 1)); - height = max(0, min(height, ${t[a]} - 1)); - width = max(0, min(width, ${t[l]} - 1)); - var depth1: u32 = u32(depth); - var height1: u32 = u32(height); - var width1: u32 = u32(width); - var depth2: u32 = u32(depth + 1); - var height2: u32 = u32(height + 1); - var width2: u32 = u32(width + 1); - var channel: u32 = ${t.length>3?`u32(originalIndices[${u}])`:"0"}; - var batch: u32 = ${t.length>3?`u32(originalIndices[${n}])`:"0"}; - - var x111: ${p} = getInputValue(batch, channel, depth1, height1, width1); - var x112: ${p} = getInputValue(batch, channel, depth1, height1, width2); - var x121: ${p} = getInputValue(batch, channel, depth1, height2, width1); - var x122: ${p} = getInputValue(batch, channel, depth1, height2, width2); - var x211: ${p} = getInputValue(batch, channel, depth2, height1, width1); - var x212: ${p} = getInputValue(batch, channel, depth2, height1, width2); - var x221: ${p} = getInputValue(batch, channel, depth2, height2, width1); - var x222: ${p} = getInputValue(batch, channel, depth2, height2, width2); - var dx1: ${p} = abs(depth - ${p}(depth1)); - var dx2: ${p} = abs(${p}(depth2) - depth); - var dy1: ${p} = abs(height - ${p}(height1)); - var dy2: ${p} = abs(${p}(height2) - height); - var dz1: ${p} = abs(width - ${p}(width1)); - var dz2: ${p} = abs(${p}(width2) - width); - if (depth1 == depth2) { - dx1 = 0.5; - dx2 = 0.5; - } - if (height1 == height2) { - dy1 = 0.5; - dy2 = 0.5; - } - if (width1 == width2) { - dz1 = 0.5; - dz2 = 0.5; - } - return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 + - x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1); - }`},jw=(e,r,t,s,o,n)=>{let i=e.dims,a=Iw(n,r.axes,i.length),l=Aw(i,s,o,r.axes),u=s.slice();s.length===0&&(u=i.map((w,C)=>w===0?1:l[C]/w),r.keepAspectRatioPolicy!=="stretch"&&(l=Fw(i,u,r)));let p=tt("output",e.dataType,l.length),c=Ce("input",e.dataType,i.length),d=Me.size(l),_=i.length===l.length&&i.every((w,C)=>w===l[C]),f=r.coordinateTransformMode==="tf_crop_and_resize",v=r.extrapolationValue,$=c.type.value,g=w=>` - ${_?"":` - ${$w(r.coordinateTransformMode,$)}; - ${(()=>{switch(r.mode){case"nearest":return` - ${Lw(c,i)}; - ${kw(r.nearestMode,t,$)}; - ${Dw(c,p,i,l,u.length,a.length,f)}; - `;case"linear":return` - ${Ow(p,i,l,u.length,a.length)}; - ${(()=>{if(i.length===2||i.length===4)return`${zw(c,p,i,f,v)}`;if(i.length===3||i.length===5)return`${Rw(c,p,i,f,v)}`;throw Error("Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.")})()}; - `;case"cubic":return` - ${(()=>{if(i.length===2||i.length===4)return`${Bw(c,p,i,l,u,a,r.cubicCoeffA,f,r.extrapolationValue,r.excludeOutside)}`;throw Error("Cubic mode only supports input dims 2 and 4 are supported in linear mode.")})()}; - `;default:throw Error("Invalid resize mode")}})()}; - `} - ${w.registerUniform("output_size","u32").registerUniform("scales","f32",u.length).registerUniform("roi","f32",a.length).declareVariables(c,p)} - ${w.mainStart()} - ${w.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - ${_?"output[global_idx] = input[global_idx];":` - let output_indices = ${p.offsetToIndices("global_idx")}; - var input_indices: ${c.type.indices}; - ${(()=>{switch(r.mode){case"nearest":return`input_indices = calculateInputIndicesFromOutputIndices(output_indices); - if (checkInputIndices(input_indices)) { - output[global_idx] = ${c.getByIndices("input_indices")}; - } else { - output[global_idx] = ${r.extrapolationValue}; - }`;case"linear":return`output[global_idx] = ${i.length===2||i.length===4?"bilinearInterpolation":"trilinearInterpolation"}(output_indices);`;case"cubic":return"output[global_idx] = bicubicInterpolation(output_indices);";default:throw Error(`Unsupported resize mode: ${r.mode}`)}})()}; -`} - }`;return{name:"Resize",shaderCache:{hint:`${r.cacheKey}|${t}|${u.length>0?r.mode==="cubic"?u:u.length:""}|${o.length>0?o:""}|${a.length>0?a:""}|${_}|${r.mode==="nearest"?i.length:i}`,inputDependencies:["rank"]},getShaderSource:g,getRunData:()=>({outputs:[{dims:l,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:[{type:12,data:d},{type:1,data:u},{type:1,data:a},...ut(i,l)]})}},Nw=e=>{let r=e.customDataBuffer;return new Uint32Array(r,r.byteOffset,1)[0]},x0=(e,r)=>{let t=[],s=[],o=[],n=Nw(e);if(r.antialias!==0)throw Error("Only default value (0) for Antialias attribute is supported");Sw(e.inputs,r,n,t,s,o),e.compute(jw(e.inputs[0],r,n,t,s,o),{inputs:[0]})},T0=e=>{let r=e.antialias,t=e.axes,s=e.coordinateTransformMode,o=e.cubicCoeffA,n=e.excludeOutside!==0,i=e.extrapolationValue,a=e.keepAspectRatioPolicy,l=e.mode,u=e.nearestMode===""?"simple":e.nearestMode;return Nt({antialias:r,axes:t,coordinateTransformMode:s,cubicCoeffA:o,excludeOutside:n,extrapolationValue:i,keepAspectRatioPolicy:a,mode:l,nearestMode:u})}}),Vw,Uw,E0,Jx=je(()=>{ft(),xt(),Tt(),Vw=e=>{if(!e||e.length<3)throw new Error("layerNorm requires at least 3 inputs.");let r=e[0],t=e[1],s=e[2];if(r.dataType!==t.dataType||r.dataType!==s.dataType)throw new Error("All inputs must have the same data type");if(r.dims.length!==3&&r.dims.length!==2)throw new Error("Input must be 2D or 3D");if(t.dims.length!==3&&t.dims.length!==2)throw new Error("Skip must be 2D or 3D");let o=r.dims[r.dims.length-1],n=r.dims[r.dims.length-2];if(t.dims[t.dims.length-1]!==o)throw new Error("Skip must have the same hidden size as input");if(t.dims[t.dims.length-2]!==n)throw new Error("Skip must have the same sequence length as input");if(s.dims.length!==1)throw new Error("Gamma must be 1D");if(s.dims[s.dims.length-1]!==o)throw new Error("Gamma must have the same hidden size as input");if(e.length>3){let i=e[3];if(i.dims.length!==1)throw new Error("Beta must be 1D");if(i.dims[i.dims.length-1]!==o)throw new Error("Beta must have the same hidden size as input")}if(e.length>4){let i=e[4];if(i.dims.length!==1)throw new Error("Bias must be 1D");if(i.dims[i.dims.length-1]!==o)throw new Error("Bias must have the same hidden size as input")}},Uw=(e,r,t,s)=>{let o=r.simplified,n=e[0].dims,i=Me.size(n),a=n,l=i,u=n.slice(-1)[0],p=s?n.slice(0,-1).concat(1):[],c=!o&&e.length>3,d=e.length>4,_=s&&t>1,f=s&&t>2,v=t>3,$=64,g=nr(u),w=[{type:12,data:l},{type:12,data:g},{type:12,data:u},{type:1,data:r.epsilon}],C=x=>{let b=[{name:"output_size",type:"u32"},{name:"components",type:"u32"},{name:"hidden_size",type:"u32"},{name:"epsilon",type:"f32"}],y=[Ce("x",e[0].dataType,e[0].dims,g),Ce("skip",e[1].dataType,e[1].dims,g),Ce("gamma",e[2].dataType,e[2].dims,g)];c&&y.push(Ce("beta",e[3].dataType,e[3].dims,g)),d&&y.push(Ce("bias",e[4].dataType,e[4].dims,g)),y.push(tt("output",e[0].dataType,a,g)),_&&y.push(tt("mean_output",1,p)),f&&y.push(tt("inv_std_output",1,p)),v&&y.push(tt("input_skip_bias_sum",e[0].dataType,a,g));let S=$r(e[0].dataType),F=$r(1,g);return` - - ${x.registerUniforms(b).declareVariables(...y)} - var sum_shared : array<${F}, ${$}>; - var sum_squared_shared : array<${F}, ${$}>; - - ${x.mainStart([$,1,1])} - let ix = local_id.x; - let iy = global_id.x / ${$}; - - let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components; - var stride = hidden_size_vectorized / ${$}; - let offset = ix * stride + iy * hidden_size_vectorized; - let offset1d = stride * ix; - if (ix == ${$-1}) { - stride = hidden_size_vectorized - stride * ix; - } - for (var i: u32 = 0; i < stride; i++) { - let skip_value = skip[offset + i]; - let bias_value = ${d?"bias[offset1d + i]":S+"(0.0)"}; - let input_value = x[offset + i]; - let value = input_value + skip_value + bias_value; - ${v?"input_skip_bias_sum[offset + i] = value;":""} - output[offset + i] = value; - let f32_value = ${so(S,g,"value")}; - sum_shared[ix] += f32_value; - sum_squared_shared[ix] += f32_value * f32_value; - } - workgroupBarrier(); - - var reduce_size : u32 = ${$}; - for (var curr_size = reduce_size >> 1; curr_size > 0; curr_size = reduce_size >> 1) { - reduce_size = curr_size + (reduce_size & 1); - if (ix < curr_size) { - sum_shared[ix] += sum_shared[ix + reduce_size]; - sum_squared_shared[ix] += sum_squared_shared[ix + reduce_size]; - } - workgroupBarrier(); - } - - let sum = sum_shared[0]; - let square_sum = sum_squared_shared[0]; - let mean = ${en("sum",g)} / f32(uniforms.hidden_size); - let inv_std_dev = inverseSqrt(${en("square_sum",g)} / f32(uniforms.hidden_size) ${o?"":"- mean * mean"} + uniforms.epsilon); - ${_?"mean_output[global_idx] = mean;":""} - ${f?"inv_std_output[global_idx] = inv_std_dev;":""} - - for (var i: u32 = 0; i < stride; i++) { - output[offset + i] = (output[offset + i] ${o?"":`- ${S}(mean)`}) * - ${S}(inv_std_dev) * gamma[offset1d + i] - ${c?"+ beta[offset1d + i]":""}; - } - }`},E=[{dims:a,dataType:e[0].dataType}];return t>1&&E.push({dims:p,dataType:1}),t>2&&E.push({dims:p,dataType:1}),t>3&&E.push({dims:n,dataType:e[0].dataType}),{name:"SkipLayerNormalization",shaderCache:{hint:`${g};${_};${f};${v}`,inputDependencies:e.map((x,b)=>"type")},getShaderSource:C,getRunData:()=>({outputs:E,dispatchGroup:{x:Math.ceil(l/u)},programUniforms:w})}},E0=(e,r)=>{Vw(e.inputs);let t=[0];e.outputCount>1&&t.push(-3),e.outputCount>2&&t.push(-3),e.outputCount>3&&t.push(3),e.compute(Uw(e.inputs,r,e.outputCount,!1),{outputs:t})}}),Ww,Go,Gw,Pu,Kw,Hw,P0,C0,Yx=je(()=>{ft(),xt(),lr(),Tt(),Ww=(e,r)=>{if(!e||e.length<1)throw new Error("too few inputs");if(r.axes.length!==0){if(r.axes.length!==r.starts.length||r.axes.length!==r.ends.length)throw new Error("axes, starts and ends must have the same length")}else if(r.starts.length!==r.ends.length)throw new Error("starts and ends must have the same length");e.slice(1).forEach((t,s)=>{if(e[s+1].dataType!==6&&e[s+1].dataType!==7)throw new Error(`Input ${s} must be an array of int32 or int64`)})},Go=(e,r)=>{let t=[];if(e.length>r)if(e[r].dataType===7)e[r].getBigInt64Array().forEach(s=>t.push(Number(s)));else if(e[r].dataType===6)e[r].getInt32Array().forEach(s=>t.push(Number(s)));else throw new Error(`Input ${r} must be an array of int32 or int64`);return t},Gw=(e,r)=>{if(e.length>1){let t=Go(e,1),s=Go(e,2),o=Go(e,3);return o.length===0&&(o=[...Array(e[0].dims.length).keys()]),Nt({starts:t,ends:s,axes:o})}else return r},Pu=(e,r,t,s,o)=>{let n=e;return e<0&&(n+=t[s[r]]),o[r]<0?Math.max(0,Math.min(n,t[s[r]]-1)):Math.max(0,Math.min(n,t[s[r]]))},Kw=(e,r,t)=>`fn calculateInputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} { - var input_indices: ${e.type.indices}; - var carry = 0u; - for (var i = ${t.length}; i >= 0; i--) { - let input_shape_i = ${ot("uniforms.input_shape","i",t.length)}; - let steps_i = ${ot("uniforms.steps","i",t.length)}; - let signs_i = ${ot("uniforms.signs","i",t.length)}; - let starts_i = ${ot("uniforms.starts","i",t.length)}; - var output_index = ${r.indicesGet("output_indices","i")}; - var input_index = output_index * steps_i + starts_i + carry; - carry = input_index / input_shape_i; - input_index = input_index % input_shape_i; - if (signs_i < 0) { - input_index = input_shape_i - input_index - 1u + starts_i; - } - ${e.indicesSet("input_indices","i","input_index")}; - } - return input_indices; - }`,Hw=(e,r)=>{let t=e[0].dims,s=Me.size(t),o=r.axes.length>0?Me.normalizeAxes(r.axes,t.length):[...Array(t.length).keys()],n=Go(e,4);n.forEach(g=>g!==0||(()=>{throw new Error("step cannot be 0")})),n.length===0&&(n=Array(o.length).fill(1));let i=r.starts.map((g,w)=>Pu(g,w,t,o,n)),a=r.ends.map((g,w)=>Pu(g,w,t,o,n));if(o.length!==i.length||o.length!==a.length)throw new Error("start, ends and axes should have the same number of elements");if(o.length!==t.length)for(let g=0;gMath.sign(g));n.forEach((g,w,C)=>{if(g<0){let E=(a[w]-i[w])/g,x=i[w],b=x+E*n[w];i[w]=b,a[w]=x,C[w]=-g}});let u=t.slice(0);o.forEach((g,w)=>{u[g]=Math.ceil((a[g]-i[g])/n[g])});let p={dims:u,dataType:e[0].dataType},c=tt("output",e[0].dataType,u.length),d=Ce("input",e[0].dataType,e[0].dims.length),_=Me.size(u),f=[{name:"outputSize",type:"u32"},{name:"starts",type:"u32",length:i.length},{name:"signs",type:"i32",length:l.length},{name:"steps",type:"u32",length:n.length}],v=[{type:12,data:_},{type:12,data:i},{type:6,data:l},{type:12,data:n},...ut(e[0].dims,u)],$=g=>` - ${g.registerUniforms(f).declareVariables(d,c)} - ${Kw(d,c,t)} - ${g.mainStart()} - ${g.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - let output_indices = ${c.offsetToIndices("global_idx")}; - let input_indices = calculateInputIndices(output_indices); - ${c.setByOffset("global_idx",d.getByIndices("input_indices"))} - }`;return{name:"Slice",shaderCache:{hint:`${l.length}_${i.length}_${n.length}`,inputDependencies:["rank"]},getShaderSource:$,getRunData:()=>({outputs:[p],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:v})}},P0=(e,r)=>{Ww(e.inputs,r);let t=Gw(e.inputs,r);e.compute(Hw(e.inputs,t),{inputs:[0]})},C0=e=>{let r=e.starts,t=e.ends,s=e.axes;return Nt({starts:r,ends:t,axes:s})}}),qw,Qw,S0,$0,Zx=je(()=>{ft(),xt(),lr(),tn(),Tt(),qw=e=>{if(!e||e.length!==1)throw new Error("Softmax op requires 1 input.")},Qw=(e,r)=>{let t=e.inputs[0],s=t.dims,o=Me.size(s),n=s.length,i=Me.normalizeAxis(r.axis,n),a=iS),u[i]=n-1,u[n-1]=i,l=e.compute(Yr(t,u),{inputs:[t],outputs:[-1]})[0]):l=t;let p=l.dims,c=p[n-1],d=o/c,_=nr(c),f=c/_,v=64;d===1&&(v=256);let $=(y,S)=>S===4?`max(max(${y}.x, ${y}.y), max(${y}.z, ${y}.w))`:S===2?`max(${y}.x, ${y}.y)`:S===3?`max(max(${y}.x, ${y}.y), ${y}.z)`:y,g=Ce("x",l.dataType,l.dims,_),w=tt("result",l.dataType,l.dims,_),C=g.type.value,E=$r(l.dataType)==="f32"?`var threadMax = ${C}(-3.402823e+38f);`:`var threadMax = ${C}(-65504.0h);`,x=y=>` - var rowMaxShared : ${C}; - var rowSumShared : ${C}; - var threadShared : array<${C}, ${v}>; - - fn getValue(row: i32, col: i32, row_stride: i32) -> ${C} { - let index = row * row_stride + col; - return x[index]; - } - - fn setValue(row: i32, col: i32, row_stride: i32, value: ${C}) { - let index = row * row_stride + col; - result[index] = value; - } - ${y.registerUniform("packedCols","i32").declareVariables(g,w)} - ${y.mainStart(v)} - let gindex = i32(global_idx); - let lindex = i32(local_idx); - const wg = ${v}; - let row = gindex / wg; - let cols = uniforms.packedCols; - let row_stride : i32 = uniforms.packedCols; - - // find the rows max - ${E} - for (var col = lindex; col < cols; col += wg) { - let value = getValue(row, col, row_stride); - threadMax = max(threadMax, value); - } - if (lindex < cols) { - threadShared[lindex] = threadMax; - } - workgroupBarrier(); - - var reduceSize = min(cols, wg); - for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) { - reduceSize = currSize + (reduceSize & 1); - if (lindex < currSize) { - threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]); - } - workgroupBarrier(); - } - if (lindex == 0) { - rowMaxShared = ${C}(${$("threadShared[0]",_)}); - } - workgroupBarrier(); - - // find the rows sum - var threadSum = ${C}(0.0); - for (var col = lindex; col < cols; col += wg) { - let subExp = exp(getValue(row, col, row_stride) - rowMaxShared); - threadSum += subExp; - } - threadShared[lindex] = threadSum; - workgroupBarrier(); - - for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) { - if (lindex < currSize) { - threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize]; - } - workgroupBarrier(); - } - if (lindex == 0) { - rowSumShared = ${C}(${en("threadShared[0]",_)}); - } - workgroupBarrier(); - - // calculate final value for each element in the row - for (var col = lindex; col < cols; col += wg) { - let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared; - setValue(row, col, row_stride, value); - } - }`,b=e.compute({name:"Softmax",shaderCache:{hint:`${_};${v}`,inputDependencies:["type"]},getRunData:()=>({outputs:[{dims:p,dataType:l.dataType}],dispatchGroup:{x:d},programUniforms:[{type:6,data:f}]}),getShaderSource:x},{inputs:[l],outputs:[a?-1:0]})[0];a&&e.compute(Yr(b,u),{inputs:[b]})},S0=(e,r)=>{qw(e.inputs),Qw(e,r)},$0=e=>Nt({axis:e.axis})}),Cu,Xw,Jw,Yw,k0,eT=je(()=>{ft(),xt(),Tt(),Cu=e=>Array.from(e.getBigInt64Array(),Number),Xw=e=>{if(!e||e.length!==2)throw new Error("Tile requires 2 inputs.");if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw new Error("Tile only support float, float16, int32, and uint32 data types");if(e[1].dataType!==7)throw new Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw new Error("Tile `repeats` input should be 1-D");if(Cu(e[1]).length!==e[0].dims.length)throw new Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},Jw=(e,r)=>{let t=[];for(let s=0;s{let t=e[0].dims,s=r??Cu(e[1]),o=Jw(t,s),n=Me.size(o),i=e[0].dataType,a=Ce("input",i,t.length),l=tt("output",i,o.length),u=p=>` - const inputShape = ${a.indices(...t)}; - ${p.registerUniform("output_size","u32").declareVariables(a,l)} - ${p.mainStart()} - ${p.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let output_indices = ${l.offsetToIndices("global_idx")}; - var input_indices: ${a.type.indices}; - for (var i = 0; i < ${t.length}; i++) { - let input_dim_i = ${a.indicesGet("uniforms.input_shape","i")}; - let input_dim_value = ${l.indicesGet("output_indices","i")} % input_dim_i; - - ${a.indicesSet("input_indices","i","input_dim_value")} - } - ${l.setByOffset("global_idx",a.getByIndices("input_indices"))} - }`;return{name:"Tile",shaderCache:{hint:`${s}`,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:[{type:12,data:n},...ut(e[0].dims,o)]}),getShaderSource:u}},k0=e=>{Xw(e.inputs),e.compute(Yw(e.inputs),{inputs:[0]})}}),Zw,eb,I0,tT=je(()=>{ft(),xt(),Tt(),Zw=(e,r,t,s,o)=>{let n=tt("output_data",o,t.length,4),i=Ce("a_data",r[1].dataType,r[1].dims.length,4),a=Ce("b_data",r[2].dataType,r[2].dims.length,4),l=Ce("c_data",r[0].dataType,r[0].dims.length,4),u,p=(c,d,_)=>`select(${d}, ${c}, ${_})`;if(!s)u=n.setByOffset("global_idx",p(i.getByOffset("global_idx"),a.getByOffset("global_idx"),l.getByOffset("global_idx")));else{let c=(d,_,f="")=>{let v=`a_data[index_a${_}][component_a${_}]`,$=`b_data[index_b${_}][component_b${_}]`,g=`bool(c_data[index_c${_}] & (0xffu << (component_c${_} * 8)))`;return` - let output_indices${_} = ${n.offsetToIndices(`global_idx * 4u + ${_}u`)}; - let offset_a${_} = ${i.broadcastedIndicesToOffset(`output_indices${_}`,n)}; - let offset_b${_} = ${a.broadcastedIndicesToOffset(`output_indices${_}`,n)}; - let offset_c${_} = ${l.broadcastedIndicesToOffset(`output_indices${_}`,n)}; - let index_a${_} = offset_a${_} / 4u; - let index_b${_} = offset_b${_} / 4u; - let index_c${_} = offset_c${_} / 4u; - let component_a${_} = offset_a${_} % 4u; - let component_b${_} = offset_b${_} % 4u; - let component_c${_} = offset_c${_} % 4u; - ${d}[${_}] = ${f}(${p(v,$,g)}); - `};o===9?u=` - var data = vec4(0); - ${c("data",0,"u32")} - ${c("data",1,"u32")} - ${c("data",2,"u32")} - ${c("data",3,"u32")} - output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:u=` - ${c("output_data[global_idx]",0)} - ${c("output_data[global_idx]",1)} - ${c("output_data[global_idx]",2)} - ${c("output_data[global_idx]",3)} - `}return` - ${e.registerUniform("vec_size","u32").declareVariables(l,i,a,n)} - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - ${u} - }`},eb=e=>{let r=e[1].dims,t=e[2].dims,s=e[0].dims,o=e[1].dataType,n=!(Me.areEqual(r,t)&&Me.areEqual(t,s)),i=r,a=Me.size(r);if(n){let u=no.calcShape(no.calcShape(r,t,!1),s,!1);if(!u)throw new Error("Can't perform where op on the given tensors");i=u,a=Me.size(i)}let l=Math.ceil(a/4);return{name:"Where",shaderCache:{inputDependencies:["rank","rank","rank"]},getShaderSource:u=>Zw(u,e,i,n,o),getRunData:()=>({outputs:[{dims:i,dataType:o}],dispatchGroup:{x:Math.ceil(a/64/4)},programUniforms:[{type:12,data:l},...ut(s,r,t,i)]})}},I0=e=>{e.compute(eb(e.inputs))}}),A0,rT=je(()=>{_x(),pc(),gx(),wx(),bx(),Mx(),yx(),Px(),Sx(),$x(),kx(),Ix(),Ax(),Fx(),Ox(),Dx(),Lx(),zx(),Bx(),Rx(),jx(),Nx(),Vx(),Ux(),Wx(),Jy(),Gx(),Kx(),Hx(),qx(),Qx(),dc(),Xx(),r0(),Jx(),Yx(),Zx(),e0(),eT(),tn(),hc(),tT(),A0=new Map([["Abs",[EM]],["Acos",[PM]],["Acosh",[CM]],["Add",[ay]],["ArgMax",[yM,ju]],["ArgMin",[MM,ju]],["Asin",[SM]],["Asinh",[$M]],["Atan",[kM]],["Atanh",[IM]],["Attention",[vM]],["AveragePool",[d0,c0]],["BatchNormalization",[xM]],["BiasAdd",[TM]],["BiasSplitGelu",[iy]],["Cast",[FM,AM]],["Ceil",[DM]],["Clip",[OM]],["Concat",[gy,wy]],["Conv",[Ku,Gu]],["ConvTranspose",[Sy,Cy]],["Cos",[LM]],["Cosh",[zM]],["CumSum",[$y,ky]],["DepthToSpace",[Iy,Ay]],["DequantizeLinear",[w0,b0]],["Div",[ly]],["Einsum",[Fy,Oy]],["Elu",[BM,Xo]],["Equal",[uy]],["Erf",[RM]],["Exp",[jM]],["Expand",[Dy]],["FastGelu",[Ly]],["Floor",[NM]],["FusedConv",[Ku,Gu]],["Gather",[By,zy]],["GatherElements",[Wy,Uy]],["GatherBlockQuantized",[Ny,Vy]],["GatherND",[Ry,jy]],["Gelu",[VM]],["Gemm",[Ky,Gy]],["GlobalAveragePool",[h0,p0]],["GlobalMaxPool",[g0,_0]],["Greater",[hy]],["GreaterOrEqual",[fy]],["GridSample",[Hy,qy]],["GroupQueryAttention",[s0]],["HardSigmoid",[XM,QM]],["InstanceNormalization",[n0]],["LayerNormalization",[o0]],["LeakyRelu",[UM,Xo]],["Less",[my]],["LessOrEqual",[_y]],["Log",[ny]],["MatMul",[i0]],["MatMulNBits",[a0,l0]],["MaxPool",[m0,f0]],["Mul",[cy]],["MultiHeadAttention",[Xy,Qy]],["Neg",[GM]],["Not",[WM]],["Pad",[u0]],["Pow",[dy]],["QuickGelu",[oy,Xo]],["Range",[M0]],["Reciprocal",[KM]],["ReduceMin",[fM]],["ReduceMean",[cM]],["ReduceMax",[mM]],["ReduceSum",[gM]],["ReduceProd",[_M]],["ReduceL1",[dM]],["ReduceL2",[pM]],["ReduceLogSum",[bM]],["ReduceLogSumExp",[hM]],["ReduceSumSquare",[wM]],["Relu",[HM]],["Resize",[x0,T0]],["RotaryEmbedding",[t0]],["ScatterND",[v0,y0]],["Sigmoid",[qM]],["Sin",[JM]],["Sinh",[YM]],["Slice",[P0,C0]],["SkipLayerNormalization",[E0]],["Split",[Yy,Zy]],["Sqrt",[ZM]],["Softmax",[S0,$0]],["Sub",[py]],["Tan",[ey]],["Tanh",[ty]],["ThresholdedRelu",[sy,Xo]],["Tile",[k0]],["Transpose",[Yb,Zb]],["Where",[I0]]])}),F0,sT=je(()=>{Ps(),Ns(),Tt(),F0=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,r){this.repo.set(e,r)}run(e,r,t,s,o){Es(e.programInfo.name);let n=this.backend.device,i=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let a=[];for(let u of r)a.push({binding:a.length,resource:{buffer:u.buffer}});for(let u of t)a.push({binding:a.length,resource:{buffer:u.buffer}});o&&a.push({binding:a.length,resource:o});let l=n.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:a,label:e.programInfo.name});if(this.backend.sessionStatus==="capturing"){let u={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:l,dispatchGroup:s};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(u)}i.setPipeline(e.computePipeline),i.setBindGroup(0,l),i.dispatchWorkgroups(...s),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType==="at-passes")&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),cs(e.programInfo.name)}dispose(){}build(e,r){Es(e.name);let t=this.backend.device,s=[];[{feature:"shader-f16",extension:"f16"},{feature:"subgroups",extension:"subgroups"}].forEach(u=>{t.features.has(u.feature)&&s.push(`enable ${u.extension};`)});let o=Jb(r,this.backend.device.limits),n=e.getShaderSource(o),i=`${s.join(` -`)} -${o.additionalImplementations} -${n}`,a=t.createShaderModule({code:i,label:e.name});It("verbose",()=>`[WebGPU] ${e.name} shader code: ${i}`);let l=t.createComputePipeline({compute:{module:a,entryPoint:"main"},layout:"auto",label:e.name});return cs(e.name),{programInfo:e,computePipeline:l,uniformVariablesInfo:o.variablesInfo}}normalizeDispatchGroupSize(e){let r=typeof e=="number"?e:e.x,t=typeof e=="number"?1:e.y||1,s=typeof e=="number"?1:e.z||1,o=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(r<=o&&t<=o&&s<=o)return[r,t,s];let n=r*t*s,i=Math.ceil(Math.sqrt(n));if(i>o){if(i=Math.ceil(Math.cbrt(n)),i>o)throw new Error("Total dispatch size exceeds WebGPU maximum.");return[i,i,i]}else return[i,i,1]}}}),O0={};io(O0,{WebGpuBackend:()=>D0});var tb,rb,sb,D0,nT=je(()=>{Ps(),ft(),Ns(),Kb(),mx(),rT(),sT(),tb=(e,r)=>{if(r.length!==e.length)throw new Error(`inputDependencies length ${r.length} is not equal to inputTensors length ${e.length}.`);let t=[];for(let s=0;s{var o,n;let s=e.name;return(o=e.shaderCache)!=null&&o.hint&&(s+="["+e.shaderCache.hint+"]"),s+=":"+t+`:${tb(r,((n=e.shaderCache)==null?void 0:n.inputDependencies)??new Array(r.length).fill("dims"))}`,s},sb=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},D0=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus="default",this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw new Error("currentKernelCustomData(): currentKernelId is null. (should not happen)");let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,r){this.env=e;let t=[],s={requiredLimits:{maxComputeWorkgroupStorageSize:r.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:r.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:r.limits.maxStorageBufferBindingSize,maxBufferSize:r.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:r.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:r.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:r.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:r.limits.maxComputeWorkgroupSizeZ},requiredFeatures:t},o=n=>r.features.has(n)&&t.push(n)&&!0;o("chromium-experimental-timestamp-query-inside-passes")||o("timestamp-query"),o("shader-f16"),o("subgroups"),this.device=await r.requestDevice(s),this.adapterInfo=new sb(r.info||await r.requestAdapterInfo()),this.gpuDataManager=Qb(this),this.programManager=new F0(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,ac(e.logLevel,!!e.debug),this.device.onuncapturederror=n=>{n.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${n.error.message}`)},Object.defineProperty(this.env.webgpu,"device",{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,"adapter",{value:r,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<"u"&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder()),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),r={};this.queryType==="at-passes"&&(r.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(r)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;Es(),this.endComputePass();let e;this.queryType!=="none"&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!=="none"&&e.mapAsync(GPUMapMode.READ).then(()=>{var s;let r=new BigUint64Array(e.getMappedRange()),t=this.pendingQueries.get(e);for(let o=0;o"u"&&(this.queryTimeBase=_);let v=Number(_-this.queryTimeBase),$=Number(f-this.queryTimeBase);if(!Number.isSafeInteger(v)||!Number.isSafeInteger($))throw new RangeError("incorrect timestamp range");if((s=this.env.webgpu.profiling)!=null&&s.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:c.map(g=>({dims:g.dims,dataType:js(g.dataType)})),outputsMetadata:d.map(g=>({dims:g.dims,dataType:js(g.dataType)})),kernelId:i,kernelType:l,kernelName:u,programName:p,startTime:v,endTime:$});else{let g="";c.forEach((C,E)=>{g+=`input[${E}]: [${C.dims}] | ${js(C.dataType)}, `});let w="";d.forEach((C,E)=>{w+=`output[${E}]: [${C.dims}] | ${js(C.dataType)}, `}),console.log(`[profiling] kernel "${i}|${l}|${u}|${p}" ${g}${w}execution time: ${$-v} ns`)}ei("GPU",`${p}::${_}::${f}`)}e.unmap(),this.pendingQueries.delete(e)}),cs()}run(e,r,t,s,o,n){Es(e.name);let i=[];for(let w=0;wC):t;if(p.length!==a.length)throw new Error(`Output size ${p.length} must be equal to ${a.length}.`);let c=[],d=[];for(let w=0;w=n)throw new Error(`Invalid output index: ${p[w]}`);if(p[w]===-3)continue;let C=p[w]===-1,E=p[w]===-2,x=C||E?o(a[w].dataType,a[w].dims):s(p[w],a[w].dataType,a[w].dims);if(c.push(x),x.data===0)continue;let b=this.gpuDataManager.get(x.data);if(!b)throw new Error(`no GPU data for output: ${x.data}`);if(C&&this.temporaryData.push(b),E){let y=this.kernelPersistentData.get(this.currentKernelId);y||(y=[],this.kernelPersistentData.set(this.currentKernelId,y)),y.push(b)}d.push(b)}if(i.length!==r.length||d.length!==c.length){if(d.length===0)return cs(e.name),c;throw new Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let _;if(u){let w=0,C=[];u.forEach(y=>{let S=typeof y.data=="number"?[y.data]:y.data;if(S.length===0)return;let F=y.type===10?2:4,z,K;y.type===10?(K=S.length>4?16:S.length>2?8:S.length*F,z=S.length>4?16:F*S.length):(K=S.length<=2?S.length*F:16,z=16),w=Math.ceil(w/K)*K,C.push(w);let q=y.type===10?8:4;w+=S.length>4?Math.ceil(S.length/q)*z:S.length*F});let E=16;w=Math.ceil(w/E)*E;let x=new ArrayBuffer(w);u.forEach((y,S)=>{let F=C[S],z=typeof y.data=="number"?[y.data]:y.data;if(y.type===6)new Int32Array(x,F,z.length).set(z);else if(y.type===12)new Uint32Array(x,F,z.length).set(z);else if(y.type===10)new Uint16Array(x,F,z.length).set(z);else if(y.type===1)new Float32Array(x,F,z.length).set(z);else throw new Error(`Unsupported uniform type: ${js(y.type)}`)});let b=this.gpuDataManager.create(w,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(b.buffer,0,x,0,w),this.gpuDataManager.release(b.id),_={offset:0,size:w,buffer:b.buffer}}let f=this.programManager.normalizeDispatchGroupSize(l),v=f[1]===1&&f[2]===1,$=rb(e,r,v),g=this.programManager.getArtifact($);if(g||(g=this.programManager.build(e,f),this.programManager.setArtifact($,g),It("info",()=>`[artifact] key: ${$}, programName: ${e.name}`)),u&&g.uniformVariablesInfo){if(u.length!==g.uniformVariablesInfo.length)throw new Error(`Uniform variables count mismatch: expect ${g.uniformVariablesInfo.length}, got ${u.length} in program "${g.programInfo.name}".`);for(let w=0;w`[ProgramManager] run "${e.name}" (key=${$}) with ${f[0]}x${f[1]}x${f[2]}`),this.queryType!=="none"||this.sessionStatus==="capturing"){let w={kernelId:this.currentKernelId,programName:g.programInfo.name,inputTensorViews:r,outputTensorViews:c};this.pendingKernels.push(w),this.sessionStatus==="capturing"&&this.capturedPendingKernels.get(this.currentSessionId).push(w)}return this.programManager.run(g,i,d,f,_),cs(e.name),c}upload(e,r){this.gpuDataManager.upload(e,r)}memcpy(e,r){this.gpuDataManager.memcpy(e,r)}async download(e,r){await this.gpuDataManager.download(e,r)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,r,t,s){let o=A0.get(e);if(!o)throw new Error(`kernel not implemented: ${e}`);let n={kernelType:e,kernelName:s,kernelEntry:o[0],attributes:[o[1],t]};this.kernels.set(r,n)}releaseKernel(e){let r=this.kernelPersistentData.get(e);if(r){for(let t of r)this.gpuDataManager.release(t.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,r,t){let s=this.kernels.get(e);if(!s)throw new Error(`kernel not created: ${e}`);let o=s.kernelType,n=s.kernelName,i=s.kernelEntry,a=s.attributes;if(this.currentKernelId!==null)throw new Error(`kernel "[${o}] ${n}" is not allowed to be called recursively`);this.currentKernelId=e,a[0]&&(a[1]=a[0](a[1]),a[0]=void 0),It("info",()=>`[WebGPU] Start to run kernel "[${o}] ${n}"...`);let l=this.env.debug;this.temporaryData=[];try{return l&&this.device.pushErrorScope("validation"),i(r,a[1]),0}catch(u){return t.push(Promise.resolve(`[WebGPU] Kernel "[${o}] ${n}" failed. ${u}`)),1}finally{l&&t.push(this.device.popErrorScope().then(u=>u?`GPU validation error for kernel "[${o}] ${n}": ${u.message}`:null));for(let u of this.temporaryData)this.gpuDataManager.release(u.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,r,t,s){let o=this.sessionExternalDataMapping.get(e);o||(o=new Map,this.sessionExternalDataMapping.set(e,o));let n=o.get(r),i=this.gpuDataManager.registerExternalBuffer(t,s,n);return o.set(r,[i,t]),i}unregisterBuffers(e){let r=this.sessionExternalDataMapping.get(e);r&&(r.forEach(t=>this.gpuDataManager.unregisterExternalBuffer(t[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let r=this.gpuDataManager.get(e);if(!r)throw new Error(`no GPU data for buffer: ${e}`);return r.buffer}createDownloader(e,r,t){return async()=>{let s=await zu(this,e,r);return lc(s.buffer,t)}}writeTimestamp(e){this.queryType==="inside-passes"&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){var e;this.queryType="none",(((e=this.env.webgpu.profiling)==null?void 0:e.mode)==="default"||(typeof this.env.trace>"u"?this.env.wasm.trace:this.env.trace))&&(this.device.features.has("chromium-experimental-timestamp-query-inside-passes")?this.queryType="inside-passes":this.device.features.has("timestamp-query")&&(this.queryType="at-passes"),this.queryType!=="none"&&typeof this.querySet>"u"&&(this.querySet=this.device.createQuerySet({type:"timestamp",count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){It("info","captureBegin"),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus="capturing"}captureEnd(){It("info","captureEnd"),this.flush(),this.sessionStatus="default"}replay(){It("info","replay"),this.sessionStatus="replaying";let e=this.capturedCommandList.get(this.currentSessionId),r=this.capturedPendingKernels.get(this.currentSessionId),t=e.length;this.pendingKernels=[];for(let s=0;s=this.maxDispatchNumber||this.queryType==="at-passes")&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus="default"}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),L0={};io(L0,{init:()=>z0});var oa,nb,z0,oT=je(()=>{ft(),Ns(),xt(),hx(),oa=class B0{constructor(r,t,s,o){this.module=r,this.dataType=t,this.data=s,this.dims=o}getFloat32Array(){if(this.dataType!==1)throw new Error("Invalid data type");let r=Me.size(this.dims);return r===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,r)}getBigInt64Array(){if(this.dataType!==7)throw new Error("Invalid data type");let r=Me.size(this.dims);return r===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,r)}getInt32Array(){if(this.dataType!==6)throw new Error("Invalid data type");let r=Me.size(this.dims);return r===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,r)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw new Error("Invalid data type");let r=Me.size(this.dims);return r===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,r)}reshape(r){if(Me.size(r)!==Me.size(this.dims))throw new Error("Invalid new shape");return new B0(this.module,this.dataType,this.data,r)}},nb=class{constructor(e,r,t){this.module=e,this.backend=r,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=r.adapterInfo;let s=e.PTR_SIZE,o=t/e.PTR_SIZE,n=s===4?"i32":"i64";this.opKernelContext=Number(e.getValue(s*o++,n));let i=Number(e.getValue(s*o++,n));this.outputCount=Number(e.getValue(s*o++,n)),this.customDataOffset=Number(e.getValue(s*o++,"*")),this.customDataSize=Number(e.getValue(s*o++,n));let a=[];for(let l=0;ltypeof a=="number"?this.inputs[a]:a))??this.inputs,s=(r==null?void 0:r.outputs)??[],o=(a,l,u)=>new oa(this.module,l,this.output(a,u),u),n=(a,l)=>{let u=An(a,l);if(!u)throw new Error(`Unsupported data type: ${a}`);let p=u>0?this.backend.gpuDataManager.create(u).id:0;return new oa(this.module,a,p,l)};return this.backend.run(e,t,s,o,n,this.outputCount)}output(e,r){let t=this.module.stackSave();try{let s=this.module.PTR_SIZE,o=s===4?"i32":"i64",n=this.module.stackAlloc((1+r.length)*s);this.module.setValue(n,r.length,o);for(let i=0;i{let o=r.jsepInit;if(!o)throw new Error("Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.");if(e==="webgpu"){let n=(nT(),Zo(O0)).WebGpuBackend,i=new n;await i.initialize(t,s),o("webgpu",[i,a=>i.alloc(Number(a)),a=>i.free(a),(a,l,u,p=!1)=>{if(p)It("verbose",()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(a)}, dst=${Number(l)}, size=${Number(u)}`),i.memcpy(Number(a),Number(l));else{It("verbose",()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(a)}, gpuDataId=${Number(l)}, size=${Number(u)}`);let c=r.HEAPU8.subarray(Number(a>>>0),Number(a>>>0)+Number(u));i.upload(Number(l),c)}},async(a,l,u)=>{It("verbose",()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${a}, dataOffset=${l}, size=${u}`),await i.download(Number(a),()=>r.HEAPU8.subarray(Number(l)>>>0,Number(l+u)>>>0))},(a,l,u)=>i.createKernel(a,Number(l),u,r.UTF8ToString(r._JsepGetNodeName(Number(l)))),a=>i.releaseKernel(a),(a,l,u,p)=>{It("verbose",()=>`[WebGPU] jsepRun: sessionHandle=${u}, kernel=${a}, contextDataOffset=${l}`);let c=new nb(r,i,Number(l));return i.computeKernel(Number(a),c,p)},()=>i.captureBegin(),()=>i.captureEnd(),()=>i.replay()])}else{let n=new qb(t);o("webnn",[n,()=>n.reserveTensorId(),i=>n.releaseTensorId(i),async(i,a,l,u,p)=>n.ensureTensor(i,a,l,u,p),(i,a)=>{n.uploadTensor(i,a)},async(i,a)=>n.downloadTensor(i,a)])}}}),ob,bc,Mc,Ys,ib,Su,wa,yc,vc,$u,xc,Tc,Ec,R0=je(()=>{cx(),dx(),ft(),zn(),rc(),Vb(),ob=(e,r)=>{Qt()._OrtInit(e,r)!==0&&Gt("Can't initialize onnxruntime.")},bc=async e=>{ob(e.wasm.numThreads,ha(e.logLevel))},Mc=async(e,r)=>{var t,s;(s=(t=Qt()).asyncInit)==null||s.call(t);{let o=(oT(),Zo(L0)).init;if(r==="webgpu"){if(typeof navigator>"u"||!navigator.gpu)throw new Error("WebGPU is not supported in current environment");let n=e.webgpu.adapter;if(n){if(typeof n.limits!="object"||typeof n.features!="object"||typeof n.requestDevice!="function")throw new Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let i=e.webgpu.powerPreference;if(i!==void 0&&i!=="low-power"&&i!=="high-performance")throw new Error(`Invalid powerPreference setting: "${i}"`);let a=e.webgpu.forceFallbackAdapter;if(a!==void 0&&typeof a!="boolean")throw new Error(`Invalid forceFallbackAdapter setting: "${a}"`);if(n=await navigator.gpu.requestAdapter({powerPreference:i,forceFallbackAdapter:a}),!n)throw new Error('Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.')}await o("webgpu",Qt(),e,n)}if(r==="webnn"){if(typeof navigator>"u"||!navigator.ml)throw new Error("WebNN is not supported in current environment");await o("webnn",Qt(),e)}}},Ys=new Map,ib=e=>{let r=Qt(),t=r.stackSave();try{let s=r.PTR_SIZE,o=r.stackAlloc(2*s);r._OrtGetInputOutputCount(e,o,o+s)!==0&&Gt("Can't get session input/output count.");let n=s===4?"i32":"i64";return[Number(r.getValue(o,n)),Number(r.getValue(o+s,n))]}finally{r.stackRestore(t)}},Su=(e,r)=>{let t=Qt(),s=t.stackSave(),o=0;try{let n=t.PTR_SIZE,i=t.stackAlloc(2*n);t._OrtGetInputOutputMetadata(e,r,i,i+n)!==0&&Gt("Can't get session input/output metadata.");let a=Number(t.getValue(i,"*"));o=Number(t.getValue(i+n,"*"));let l=t.HEAP32[o/4];if(l===0)return[a,0];let u=t.HEAPU32[o/4+1],p=[];for(let c=0;c{let r=Qt(),t=r._malloc(e.byteLength);if(t===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return r.HEAPU8.set(e,t),[t,e.byteLength]},yc=async(e,r)=>{var c,d,_,f;let t,s,o=Qt();Array.isArray(e)?[t,s]=e:e.buffer===o.HEAPU8.buffer?[t,s]=[e.byteOffset,e.byteLength]:[t,s]=wa(e);let n=0,i=0,a=0,l=[],u=[],p=[];try{if([i,l]=await Nb(r),(r==null?void 0:r.externalData)&&o.mountExternalData){let S=[];for(let F of r.externalData){let z=typeof F=="string"?F:F.path;S.push(ic(typeof F=="string"?F:F.data).then(K=>{o.mountExternalData(z,K)}))}await Promise.all(S)}for(let S of(r==null?void 0:r.executionProviders)??[])if((typeof S=="string"?S:S.name)==="webnn"){if(o.shouldTransferToMLTensor=!1,typeof S!="string"){let F=S,z=F==null?void 0:F.context,K=F==null?void 0:F.gpuDevice,q=F==null?void 0:F.deviceType,R=F==null?void 0:F.powerPreference;z?o.currentContext=z:K?o.currentContext=await o.webnnCreateMLContext(K):o.currentContext=await o.webnnCreateMLContext({deviceType:q,powerPreference:R})}else o.currentContext=await o.webnnCreateMLContext();break}n=await o._OrtCreateSession(t,s,i),(c=o.webgpuOnCreateSession)==null||c.call(o,n),n===0&&Gt("Can't create a session."),(d=o.jsepOnCreateSession)==null||d.call(o),o.currentContext&&(o.webnnRegisterMLContext(n,o.currentContext),o.currentContext=void 0,o.shouldTransferToMLTensor=!0);let[v,$]=ib(n),g=!!(r!=null&&r.enableGraphCapture),w=[],C=[],E=[],x=[],b=[];for(let S=0;SS==="gpu-buffer"||S==="ml-tensor")&&(a=o._OrtCreateBinding(n),a===0&&Gt("Can't create IO binding."),y={handle:a,outputPreferredLocations:b,outputPreferredLocationsEncoded:b.map(S=>Du(S))}),Ys.set(n,[n,u,p,y,g,!1]),[n,w,C,E,x]}catch(v){throw u.forEach($=>o._OrtFree($)),p.forEach($=>o._OrtFree($)),a!==0&&o._OrtReleaseBinding(a)!==0&&Gt("Can't release IO binding."),n!==0&&o._OrtReleaseSession(n)!==0&&Gt("Can't release session."),v}finally{o._free(t),i!==0&&o._OrtReleaseSessionOptions(i)!==0&&Gt("Can't release session options."),l.forEach(v=>o._free(v)),(f=o.unmountExternalData)==null||f.call(o)}},vc=e=>{var l,u,p;let r=Qt(),t=Ys.get(e);if(!t)throw new Error(`cannot release session. invalid session id: ${e}`);let[s,o,n,i,a]=t;i&&(a&&r._OrtClearBoundOutputs(i.handle)!==0&&Gt("Can't clear bound outputs."),r._OrtReleaseBinding(i.handle)!==0&&Gt("Can't release IO binding.")),(l=r.jsepOnReleaseSession)==null||l.call(r,e),(u=r.webnnOnReleaseSession)==null||u.call(r,e),(p=r.webgpuOnReleaseSession)==null||p.call(r,e),o.forEach(c=>r._OrtFree(c)),n.forEach(c=>r._OrtFree(c)),r._OrtReleaseSession(s)!==0&&Gt("Can't release session."),Ys.delete(e)},$u=async(e,r,t,s,o,n,i=!1)=>{if(!e){r.push(0);return}let a=Qt(),l=a.PTR_SIZE,u=e[0],p=e[1],c=e[3],d=c,_,f;if(u==="string"&&(c==="gpu-buffer"||c==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(i&&c!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${n} when enableGraphCapture is true.`);if(c==="gpu-buffer"){let g=e[2].gpuBuffer;f=An(to(u),p);{let w=a.jsepRegisterBuffer;if(!w)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');_=w(s,n,g,f)}}else if(c==="ml-tensor"){let g=e[2].mlTensor;f=An(to(u),p);let w=a.webnnRegisterMLTensor;if(!w)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');_=w(s,g,to(u),p)}else{let g=e[2];if(Array.isArray(g)){f=l*g.length,_=a._malloc(f),t.push(_);for(let w=0;wa.setValue($+C*l,w,l===4?"i32":"i64"));let g=a._OrtCreateTensor(to(u),_,f,$,p.length,Du(d));g===0&&Gt(`Can't create tensor for input/output. session=${s}, index=${n}.`),r.push(g)}finally{a.stackRestore(v)}},xc=async(e,r,t,s,o,n)=>{var K,q,R,Z;let i=Qt(),a=i.PTR_SIZE,l=Ys.get(e);if(!l)throw new Error(`cannot run inference. invalid session id: ${e}`);let u=l[0],p=l[1],c=l[2],d=l[3],_=l[4],f=l[5],v=r.length,$=s.length,g=0,w=[],C=[],E=[],x=[],b=i.stackSave(),y=i.stackAlloc(v*a),S=i.stackAlloc(v*a),F=i.stackAlloc($*a),z=i.stackAlloc($*a);try{[g,w]=jb(n);for(let Q=0;QW*re,1);A=js(_e);let pe=d==null?void 0:d.outputPreferredLocations[s[Q]];if(A==="string"){if(pe==="gpu-buffer"||pe==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let W=[];for(let re=0;re0){let W=i.jsepGetBuffer;if(!W)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let re=W(U),G=An(_e,Ue);if(G===void 0||!nc(A))throw new Error(`Unsupported data type: ${A}`);V=!0,J.push([A,ze,{gpuBuffer:re,download:i.jsepCreateDownloader(re,G,A),dispose:()=>{i._OrtReleaseTensor(se)!==0&&Gt("Can't release tensor.")}},"gpu-buffer"])}else if(pe==="ml-tensor"&&Ue>0){let W=i.webnnEnsureTensor,re=i.webnnIsInt64Supported;if(!W||!re)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(An(_e,Ue)===void 0||!oc(A))throw new Error(`Unsupported data type: ${A}`);if(A==="int64"&&!re(e))throw new Error('preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.');let G=await W(e,U,_e,ze,!1);V=!0,J.push([A,ze,{mlTensor:G,download:i.webnnCreateMLTensorDownloader(U,A),dispose:()=>{i.webnnReleaseTensorId(U),i._OrtReleaseTensor(se)}},"ml-tensor"])}else{let W=sc(A),re=new W(Ue);new Uint8Array(re.buffer,re.byteOffset,re.byteLength).set(i.HEAPU8.subarray(U,U+re.byteLength)),J.push([A,ze,re,"cpu"])}}finally{i.stackRestore(fe),A==="string"&&U&&i._free(U),V||i._OrtReleaseTensor(se),(Z=i.webnnOnRunEnd)==null||Z.call(i,u)}}return d&&!_&&(i._OrtClearBoundOutputs(d.handle)!==0&&Gt("Can't clear bound outputs."),Ys.set(e,[u,p,c,d,_,!1])),J}finally{i.stackRestore(b),C.forEach(H=>i._OrtReleaseTensor(H)),E.forEach(H=>i._OrtReleaseTensor(H)),x.forEach(H=>i._free(H)),g!==0&&i._OrtReleaseRunOptions(g),w.forEach(H=>i._free(H))}},Tc=e=>{let r=Qt(),t=Ys.get(e);if(!t)throw new Error("invalid session id");let s=t[0],o=r._OrtEndProfiling(s);o===0&&Gt("Can't get an profile file name."),r._OrtFree(o)},Ec=e=>{let r=[];for(let t of e){let s=t[2];!Array.isArray(s)&&"buffer"in s&&r.push(s.buffer)}return r}}),Zs,Gr,Zn,Ko,Ho,ia,ku,aa,Sn,$n,ab,j0,N0,V0,U0,W0,G0,K0,H0=je(()=>{Ps(),R0(),zn(),ec(),Zs=()=>!!Yt.wasm.proxy&&typeof document<"u",Zn=!1,Ko=!1,Ho=!1,aa=new Map,Sn=(e,r)=>{let t=aa.get(e);t?t.push(r):aa.set(e,[r])},$n=()=>{if(Zn||!Ko||Ho||!Gr)throw new Error("worker not ready")},ab=e=>{switch(e.data.type){case"init-wasm":Zn=!1,e.data.err?(Ho=!0,ku[1](e.data.err)):(Ko=!0,ku[0]()),ia&&(URL.revokeObjectURL(ia),ia=void 0);break;case"init-ep":case"copy-from":case"create":case"release":case"run":case"end-profiling":{let r=aa.get(e.data.type);e.data.err?r.shift()[1](e.data.err):r.shift()[0](e.data.out);break}}},j0=async()=>{if(!Ko){if(Zn)throw new Error("multiple calls to 'initWasm()' detected.");if(Ho)throw new Error("previous call to 'initWasm()' failed.");if(Zn=!0,Zs())return new Promise((e,r)=>{Gr==null||Gr.terminate(),Bb().then(([t,s])=>{try{Gr=s,Gr.onerror=n=>r(n),Gr.onmessage=ab,ku=[e,r];let o={type:"init-wasm",in:Yt};!o.in.wasm.wasmPaths&&(t||Ou)&&(o.in.wasm.wasmPaths={wasm:new URL("/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",import.meta.url).href}),Gr.postMessage(o),ia=t}catch(o){r(o)}},r)});try{await tc(Yt.wasm),await bc(Yt),Ko=!0}catch(e){throw Ho=!0,e}finally{Zn=!1}}},N0=async e=>{if(Zs())return $n(),new Promise((r,t)=>{Sn("init-ep",[r,t]);let s={type:"init-ep",in:{epName:e,env:Yt}};Gr.postMessage(s)});await Mc(Yt,e)},V0=async e=>Zs()?($n(),new Promise((r,t)=>{Sn("copy-from",[r,t]);let s={type:"copy-from",in:{buffer:e}};Gr.postMessage(s,[e.buffer])})):wa(e),U0=async(e,r)=>{if(Zs()){if(r!=null&&r.preferredOutputLocation)throw new Error('session option "preferredOutputLocation" is not supported for proxy.');return $n(),new Promise((t,s)=>{Sn("create",[t,s]);let o={type:"create",in:{model:e,options:{...r}}},n=[];e instanceof Uint8Array&&n.push(e.buffer),Gr.postMessage(o,n)})}else return yc(e,r)},W0=async e=>{if(Zs())return $n(),new Promise((r,t)=>{Sn("release",[r,t]);let s={type:"release",in:e};Gr.postMessage(s)});vc(e)},G0=async(e,r,t,s,o,n)=>{if(Zs()){if(t.some(i=>i[3]!=="cpu"))throw new Error("input tensor on GPU is not supported for proxy.");if(o.some(i=>i))throw new Error("pre-allocated output tensor is not supported for proxy.");return $n(),new Promise((i,a)=>{Sn("run",[i,a]);let l=t,u={type:"run",in:{sessionId:e,inputIndices:r,inputs:l,outputIndices:s,options:n}};Gr.postMessage(u,Ec(l))})}else return xc(e,r,t,s,o,n)},K0=async e=>{if(Zs())return $n(),new Promise((r,t)=>{Sn("end-profiling",[r,t]);let s={type:"end-profiling",in:e};Gr.postMessage(s)});Tc(e)}}),Iu,lb,q0,iT=je(()=>{Ps(),H0(),ft(),Zu(),Vb(),Iu=(e,r)=>{switch(e.location){case"cpu":return[e.type,e.dims,e.data,"cpu"];case"gpu-buffer":return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},"gpu-buffer"];case"ml-tensor":return[e.type,e.dims,{mlTensor:e.mlTensor},"ml-tensor"];default:throw new Error(`invalid data location: ${e.location} for ${r()}`)}},lb=e=>{switch(e[3]){case"cpu":return new xs(e[0],e[2],e[1]);case"gpu-buffer":{let r=e[0];if(!nc(r))throw new Error(`not supported data type: ${r} for deserializing GPU tensor`);let{gpuBuffer:t,download:s,dispose:o}=e[2];return xs.fromGpuBuffer(t,{dataType:r,dims:e[1],download:s,dispose:o})}case"ml-tensor":{let r=e[0];if(!oc(r))throw new Error(`not supported data type: ${r} for deserializing MLTensor tensor`);let{mlTensor:t,download:s,dispose:o}=e[2];return xs.fromMLTensor(t,{dataType:r,dims:e[1],download:s,dispose:o})}default:throw new Error(`invalid data location: ${e[3]}`)}},q0=class{async fetchModelAndCopyToWasmMemory(e){return V0(await ic(e))}async loadModel(e,r){Es();let t;typeof e=="string"?t=await this.fetchModelAndCopyToWasmMemory(e):t=e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await U0(t,r),cs()}async dispose(){return W0(this.sessionId)}async run(e,r,t){Es();let s=[],o=[];Object.entries(e).forEach(c=>{let d=c[0],_=c[1],f=this.inputNames.indexOf(d);if(f===-1)throw new Error(`invalid input '${d}'`);s.push(_),o.push(f)});let n=[],i=[];Object.entries(r).forEach(c=>{let d=c[0],_=c[1],f=this.outputNames.indexOf(d);if(f===-1)throw new Error(`invalid output '${d}'`);n.push(_),i.push(f)});let a=s.map((c,d)=>Iu(c,()=>`input "${this.inputNames[o[d]]}"`)),l=n.map((c,d)=>c?Iu(c,()=>`output "${this.outputNames[i[d]]}"`):null),u=await G0(this.sessionId,o,a,i,l,t),p={};for(let c=0;cQu,initializeFlags:()=>qu,wasmBackend:()=>X0});var qu,Qu,X0,aT=je(()=>{Ps(),H0(),iT(),qu=()=>{(typeof Yt.wasm.initTimeout!="number"||Yt.wasm.initTimeout<0)&&(Yt.wasm.initTimeout=0);let e=Yt.wasm.simd;if(typeof e!="boolean"&&e!==void 0&&e!=="fixed"&&e!=="relaxed"&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),Yt.wasm.simd=!1),typeof Yt.wasm.proxy!="boolean"&&(Yt.wasm.proxy=!1),typeof Yt.wasm.trace!="boolean"&&(Yt.wasm.trace=!1),typeof Yt.wasm.numThreads!="number"||!Number.isInteger(Yt.wasm.numThreads)||Yt.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)Yt.wasm.numThreads=1;else{let r=typeof navigator>"u"?Hv("node:os").cpus().length:navigator.hardwareConcurrency;Yt.wasm.numThreads=Math.min(4,Math.ceil((r||1)/2))}},Qu=class{async init(e){qu(),await j0(),await N0(e)}async createInferenceSessionHandler(e,r){let t=new q0;return await t.loadModel(e,r),t}},X0=new Qu});Ps();Ps();Ps();var lT="1.22.0-dev.20250409-89f8206ba4",uT=Ab;{let e=(aT(),Zo(Q0)).wasmBackend;Fn("webgpu",e,5),Fn("webnn",e,5),Fn("cpu",e,10),Fn("wasm",e,10)}Object.defineProperty(Yt.versions,"web",{value:lT,enumerable:!0});/** -* @license -* Copyright 2021 Google LLC. All Rights Reserved. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================================= -*//** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - *//** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */const cT=Object.freeze(Object.defineProperty({__proto__:null,get InferenceSession(){return Yu},get TRACE(){return ei},get TRACE_FUNC_BEGIN(){return Es},get TRACE_FUNC_END(){return cs},get Tensor(){return xs},default:uT,get env(){return Yt},get registerBackend(){return Fn}},Symbol.toStringTag,{value:"Module"}));var Rs={},dT={"onnxruntime-common":e=>{e.exports=Uv},"onnxruntime-web":e=>{e.exports=cT},"?2ce3":()=>{},"?7a2c":()=>{},"?a42a":()=>{},"?2b25":()=>{},"?569f":()=>{},"?3f59":()=>{},"?154a":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(e,r,t)=>{t.r(r),t.d(r,{Environment:()=>Be,Interpreter:()=>He,Template:()=>Zr,parse:()=>U,tokenize:()=>c});var s=Object.freeze({Text:"Text",NumericLiteral:"NumericLiteral",BooleanLiteral:"BooleanLiteral",NullLiteral:"NullLiteral",StringLiteral:"StringLiteral",Identifier:"Identifier",Equals:"Equals",OpenParen:"OpenParen",CloseParen:"CloseParen",OpenStatement:"OpenStatement",CloseStatement:"CloseStatement",OpenExpression:"OpenExpression",CloseExpression:"CloseExpression",OpenSquareBracket:"OpenSquareBracket",CloseSquareBracket:"CloseSquareBracket",OpenCurlyBracket:"OpenCurlyBracket",CloseCurlyBracket:"CloseCurlyBracket",Comma:"Comma",Dot:"Dot",Colon:"Colon",Pipe:"Pipe",CallOperator:"CallOperator",AdditiveBinaryOperator:"AdditiveBinaryOperator",MultiplicativeBinaryOperator:"MultiplicativeBinaryOperator",ComparisonBinaryOperator:"ComparisonBinaryOperator",UnaryOperator:"UnaryOperator",Set:"Set",If:"If",For:"For",In:"In",Is:"Is",NotIn:"NotIn",Else:"Else",EndSet:"EndSet",EndIf:"EndIf",ElseIf:"ElseIf",EndFor:"EndFor",And:"And",Or:"Or",Not:"UnaryOperator",Macro:"Macro",EndMacro:"EndMacro",Break:"Break",Continue:"Continue"}),o=Object.freeze({set:s.Set,for:s.For,in:s.In,is:s.Is,if:s.If,else:s.Else,endset:s.EndSet,endif:s.EndIf,elif:s.ElseIf,endfor:s.EndFor,and:s.And,or:s.Or,not:s.Not,"not in":s.NotIn,macro:s.Macro,endmacro:s.EndMacro,break:s.Break,continue:s.Continue,true:s.BooleanLiteral,false:s.BooleanLiteral,none:s.NullLiteral,True:s.BooleanLiteral,False:s.BooleanLiteral,None:s.NullLiteral}),n=class{constructor(D,oe){this.value=D,this.type=oe}};function i(D){return/\w/.test(D)}function a(D){return/[0-9]/.test(D)}var l=[["{%",s.OpenStatement],["%}",s.CloseStatement],["{{",s.OpenExpression],["}}",s.CloseExpression],["(",s.OpenParen],[")",s.CloseParen],["{",s.OpenCurlyBracket],["}",s.CloseCurlyBracket],["[",s.OpenSquareBracket],["]",s.CloseSquareBracket],[",",s.Comma],[".",s.Dot],[":",s.Colon],["|",s.Pipe],["<=",s.ComparisonBinaryOperator],[">=",s.ComparisonBinaryOperator],["==",s.ComparisonBinaryOperator],["!=",s.ComparisonBinaryOperator],["<",s.ComparisonBinaryOperator],[">",s.ComparisonBinaryOperator],["+",s.AdditiveBinaryOperator],["-",s.AdditiveBinaryOperator],["*",s.MultiplicativeBinaryOperator],["/",s.MultiplicativeBinaryOperator],["%",s.MultiplicativeBinaryOperator],["=",s.Equals]],u=new Map([["n",` -`],["t"," "],["r","\r"],["b","\b"],["f","\f"],["v","\v"],["'","'"],['"','"'],["\\","\\"]]);function p(D,oe={}){return D.endsWith(` -`)&&(D=D.slice(0,-1)),D=D.replace(/{#.*?#}/gs,"{##}"),oe.lstrip_blocks&&(D=D.replace(/^[ \t]*({[#%])/gm,"$1")),oe.trim_blocks&&(D=D.replace(/([#%]})\n/g,"$1")),D.replace(/{##}/g,"").replace(/-%}\s*/g,"%}").replace(/\s*{%-/g,"{%").replace(/-}}\s*/g,"}}").replace(/\s*{{-/g,"{{")}function c(D,oe={}){var ve,yt,Ft;const B=[],te=p(D,oe);let me=0;const Oe=ht=>{let lt="";for(;ht(te[me]);){if(te[me]==="\\"){if(++me,me>=te.length)throw new SyntaxError("Unexpected end of input");const rt=te[me++],Bt=u.get(rt);if(Bt===void 0)throw new SyntaxError(`Unexpected escaped character: ${rt}`);lt+=Bt;continue}if(lt+=te[me++],me>=te.length)throw new SyntaxError("Unexpected end of input")}return lt};e:for(;me0){B.push(new n(rt,s.Text));continue}}Oe(rt=>/\s/.test(rt));const lt=te[me];if(lt==="-"||lt==="+"){const rt=(yt=B.at(-1))==null?void 0:yt.type;if(rt===s.Text||rt===void 0)throw new SyntaxError(`Unexpected character: ${lt}`);switch(rt){case s.Identifier:case s.NumericLiteral:case s.BooleanLiteral:case s.NullLiteral:case s.StringLiteral:case s.CloseParen:case s.CloseSquareBracket:break;default:{++me;const Bt=Oe(a);B.push(new n(`${lt}${Bt}`,Bt.length>0?s.NumericLiteral:s.UnaryOperator));continue}}}for(const[rt,Bt]of l)if(te.slice(me,me+rt.length)===rt){B.push(new n(rt,Bt)),me+=rt.length;continue e}if(lt==="'"||lt==='"'){++me;const rt=Oe(Bt=>Bt!==lt);B.push(new n(rt,s.StringLiteral)),++me;continue}if(a(lt)){const rt=Oe(a);B.push(new n(rt,s.NumericLiteral));continue}if(i(lt)){const rt=Oe(i),Bt=Object.hasOwn(o,rt)?o[rt]:s.Identifier;Bt===s.In&&((Ft=B.at(-1))==null?void 0:Ft.type)===s.Not?(B.pop(),B.push(new n("not in",s.NotIn))):B.push(new n(rt,Bt));continue}throw new SyntaxError(`Unexpected character: ${lt}`)}return B}var d=class{constructor(){Y(this,"type","Statement")}},_=class extends d{constructor(oe){super();Y(this,"type","Program");this.body=oe}},f=class extends d{constructor(oe,B,te){super();Y(this,"type","If");this.test=oe,this.body=B,this.alternate=te}},v=class extends d{constructor(oe,B,te,me){super();Y(this,"type","For");this.loopvar=oe,this.iterable=B,this.body=te,this.defaultBlock=me}},$=class extends d{constructor(){super(...arguments);Y(this,"type","Break")}},g=class extends d{constructor(){super(...arguments);Y(this,"type","Continue")}},w=class extends d{constructor(oe,B,te){super();Y(this,"type","Set");this.assignee=oe,this.value=B,this.body=te}},C=class extends d{constructor(oe,B,te){super();Y(this,"type","Macro");this.name=oe,this.args=B,this.body=te}},E=class extends d{constructor(){super(...arguments);Y(this,"type","Expression")}},x=class extends E{constructor(oe,B,te){super();Y(this,"type","MemberExpression");this.object=oe,this.property=B,this.computed=te}},b=class extends E{constructor(oe,B){super();Y(this,"type","CallExpression");this.callee=oe,this.args=B}},y=class extends E{constructor(oe){super();Y(this,"type","Identifier");this.value=oe}},S=class extends E{constructor(oe){super();Y(this,"type","Literal");this.value=oe}},F=class extends S{constructor(){super(...arguments);Y(this,"type","NumericLiteral")}},z=class extends S{constructor(){super(...arguments);Y(this,"type","StringLiteral")}},K=class extends S{constructor(){super(...arguments);Y(this,"type","BooleanLiteral")}},q=class extends S{constructor(){super(...arguments);Y(this,"type","NullLiteral")}},R=class extends S{constructor(){super(...arguments);Y(this,"type","ArrayLiteral")}},Z=class extends S{constructor(){super(...arguments);Y(this,"type","TupleLiteral")}},H=class extends S{constructor(){super(...arguments);Y(this,"type","ObjectLiteral")}},J=class extends E{constructor(oe,B,te){super();Y(this,"type","BinaryExpression");this.operator=oe,this.left=B,this.right=te}},Q=class extends E{constructor(oe,B){super();Y(this,"type","FilterExpression");this.operand=oe,this.filter=B}},se=class extends E{constructor(oe,B){super();Y(this,"type","SelectExpression");this.iterable=oe,this.test=B}},fe=class extends E{constructor(oe,B,te){super();Y(this,"type","TestExpression");this.operand=oe,this.negate=B,this.test=te}},ae=class extends E{constructor(oe,B){super();Y(this,"type","UnaryExpression");this.operator=oe,this.argument=B}},V=class extends E{constructor(oe=void 0,B=void 0,te=void 0){super();Y(this,"type","SliceExpression");this.start=oe,this.stop=B,this.step=te}},A=class extends E{constructor(oe,B){super();Y(this,"type","KeywordArgumentExpression");this.key=oe,this.value=B}};function U(D){const oe=new _([]);let B=0;function te(Ae,Je){const it=D[B++];if(!it||it.type!==Ae)throw new Error(`Parser Error: ${Je}. ${it.type} !== ${Ae}.`);return it}function me(){switch(D[B].type){case s.Text:return yt();case s.OpenStatement:return Ft();case s.OpenExpression:return ht();default:throw new SyntaxError(`Unexpected token type: ${D[B].type}`)}}function Oe(...Ae){return B+Ae.length<=D.length&&Ae.some((Je,it)=>Je!==D[B+it].type)}function ve(...Ae){return B+Ae.length<=D.length&&Ae.every((Je,it)=>Je===D[B+it].type)}function yt(){return new z(te(s.Text,"Expected text token").value)}function Ft(){te(s.OpenStatement,"Expected opening statement token");let Ae;switch(D[B].type){case s.Set:++B,Ae=lt(),te(s.CloseStatement,"Expected closing statement token");break;case s.If:++B,Ae=rt(),te(s.OpenStatement,"Expected {% token"),te(s.EndIf,"Expected endif token"),te(s.CloseStatement,"Expected %} token");break;case s.Macro:++B,Ae=Bt(),te(s.OpenStatement,"Expected {% token"),te(s.EndMacro,"Expected endmacro token"),te(s.CloseStatement,"Expected %} token");break;case s.For:++B,Ae=wr(),te(s.OpenStatement,"Expected {% token"),te(s.EndFor,"Expected endfor token"),te(s.CloseStatement,"Expected %} token");break;case s.Break:++B,te(s.CloseStatement,"Expected closing statement token"),Ae=new $;break;case s.Continue:++B,te(s.CloseStatement,"Expected closing statement token"),Ae=new g;break;default:throw new SyntaxError(`Unknown statement type: ${D[B].type}`)}return Ae}function ht(){te(s.OpenExpression,"Expected opening expression token");const Ae=Xt();return te(s.CloseExpression,"Expected closing expression token"),Ae}function lt(){var Je,it;const Ae=Xt();if(ve(s.Equals)){++B;const Rt=Xt();return new w(Ae,Rt,[])}else{const Rt=[];for(te(s.CloseStatement,"Expected %} token");!(((Je=D[B])==null?void 0:Je.type)===s.OpenStatement&&((it=D[B+1])==null?void 0:it.type)===s.EndSet);){const rs=me();Rt.push(rs)}return te(s.OpenStatement,"Expected {% token"),te(s.EndSet,"Expected endset token"),new w(Ae,null,Rt)}}function rt(){var Rt,rs,ss,ur,ns,cr,hr,os;const Ae=Xt();te(s.CloseStatement,"Expected closing statement token");const Je=[],it=[];for(;!(((Rt=D[B])==null?void 0:Rt.type)===s.OpenStatement&&(((rs=D[B+1])==null?void 0:rs.type)===s.ElseIf||((ss=D[B+1])==null?void 0:ss.type)===s.Else||((ur=D[B+1])==null?void 0:ur.type)===s.EndIf));)Je.push(me());if(((ns=D[B])==null?void 0:ns.type)===s.OpenStatement&&((cr=D[B+1])==null?void 0:cr.type)!==s.EndIf)if(++B,ve(s.ElseIf))te(s.ElseIf,"Expected elseif token"),it.push(rt());else for(te(s.Else,"Expected else token"),te(s.CloseStatement,"Expected closing statement token");!(((hr=D[B])==null?void 0:hr.type)===s.OpenStatement&&((os=D[B+1])==null?void 0:os.type)===s.EndIf);)it.push(me());return new f(Ae,Je,it)}function Bt(){const Ae=zr();if(Ae.type!=="Identifier")throw new SyntaxError("Expected identifier following macro statement");const Je=ps();te(s.CloseStatement,"Expected closing statement token");const it=[];for(;Oe(s.OpenStatement,s.EndMacro);)it.push(me());return new C(Ae,Je,it)}function Ht(Ae=!1){const Je=Ae?zr:Xt,it=[Je()],Rt=ve(s.Comma);for(;Rt&&(++B,it.push(Je()),!!ve(s.Comma)););return Rt?new Z(it):it[0]}function wr(){const Ae=Ht(!0);if(!(Ae instanceof y||Ae instanceof Z))throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${Ae.type} instead`);te(s.In,"Expected `in` keyword following loop variable");const Je=Xt();te(s.CloseStatement,"Expected closing statement token");const it=[];for(;Oe(s.OpenStatement,s.EndFor)&&Oe(s.OpenStatement,s.Else);)it.push(me());const Rt=[];if(ve(s.OpenStatement,s.Else))for(++B,++B,te(s.CloseStatement,"Expected closing statement token");Oe(s.OpenStatement,s.EndFor);)Rt.push(me());return new v(Ae,Je,it,Rt)}function Xt(){return Or()}function Or(){const Ae=es();if(ve(s.If)){++B;const Je=es();if(ve(s.Else)){++B;const it=es();return new f(Je,[Ae],[it])}else return new se(Ae,Je)}return Ae}function es(){let Ae=ds();for(;ve(s.Or);){const Je=D[B];++B;const it=ds();Ae=new J(Je,Ae,it)}return Ae}function ds(){let Ae=ts();for(;ve(s.And);){const Je=D[B];++B;const it=ts();Ae=new J(Je,Ae,it)}return Ae}function ts(){let Ae;for(;ve(s.Not);){const Je=D[B];++B;const it=ts();Ae=new ae(Je,it)}return Ae??Cs()}function Cs(){let Ae=jr();for(;ve(s.ComparisonBinaryOperator)||ve(s.In)||ve(s.NotIn);){const Je=D[B];++B;const it=jr();Ae=new J(Je,Ae,it)}return Ae}function jr(){let Ae=Is();for(;ve(s.AdditiveBinaryOperator);){const Je=D[B];++B;const it=Is();Ae=new J(Je,Ae,it)}return Ae}function Ss(){const Ae=ir(zr());return ve(s.OpenParen)?Kr(Ae):Ae}function Kr(Ae){let Je=new b(Ae,ps());return Je=ir(Je),ve(s.OpenParen)&&(Je=Kr(Je)),Je}function ps(){te(s.OpenParen,"Expected opening parenthesis for arguments list");const Ae=$s();return te(s.CloseParen,"Expected closing parenthesis for arguments list"),Ae}function $s(){const Ae=[];for(;!ve(s.CloseParen);){let Je=Xt();if(ve(s.Equals)){if(++B,!(Je instanceof y))throw new SyntaxError("Expected identifier for keyword argument");const it=Xt();Je=new A(Je,it)}Ae.push(Je),ve(s.Comma)&&++B}return Ae}function ks(){const Ae=[];let Je=!1;for(;!ve(s.CloseSquareBracket);)ve(s.Colon)?(Ae.push(void 0),++B,Je=!0):(Ae.push(Xt()),ve(s.Colon)&&(++B,Je=!0));if(Ae.length===0)throw new SyntaxError("Expected at least one argument for member/slice expression");if(Je){if(Ae.length>3)throw new SyntaxError("Expected 0-3 arguments for slice expression");return new V(...Ae)}return Ae[0]}function ir(Ae){for(;ve(s.Dot)||ve(s.OpenSquareBracket);){const Je=D[B];++B;let it;const Rt=Je.type!==s.Dot;if(Rt)it=ks(),te(s.CloseSquareBracket,"Expected closing square bracket");else if(it=zr(),it.type!=="Identifier")throw new SyntaxError("Expected identifier following dot operator");Ae=new x(Ae,it,Rt)}return Ae}function Is(){let Ae=Tr();for(;ve(s.MultiplicativeBinaryOperator);){const Je=D[B];++B;const it=Tr();Ae=new J(Je,Ae,it)}return Ae}function Tr(){let Ae=hs();for(;ve(s.Is);){++B;const Je=ve(s.Not);Je&&++B;let it=zr();if(it instanceof K?it=new y(it.value.toString()):it instanceof q&&(it=new y("none")),!(it instanceof y))throw new SyntaxError("Expected identifier for the test");Ae=new fe(Ae,Je,it)}return Ae}function hs(){let Ae=Ss();for(;ve(s.Pipe);){++B;let Je=zr();if(!(Je instanceof y))throw new SyntaxError("Expected identifier for the filter");ve(s.OpenParen)&&(Je=Kr(Je)),Ae=new Q(Ae,Je)}return Ae}function zr(){const Ae=D[B];switch(Ae.type){case s.NumericLiteral:return++B,new F(Number(Ae.value));case s.StringLiteral:return++B,new z(Ae.value);case s.BooleanLiteral:return++B,new K(Ae.value.toLowerCase()==="true");case s.NullLiteral:return++B,new q(null);case s.Identifier:return++B,new y(Ae.value);case s.OpenParen:{++B;const Je=Ht();if(D[B].type!==s.CloseParen)throw new SyntaxError(`Expected closing parenthesis, got ${D[B].type} instead`);return++B,Je}case s.OpenSquareBracket:{++B;const Je=[];for(;!ve(s.CloseSquareBracket);)Je.push(Xt()),ve(s.Comma)&&++B;return++B,new R(Je)}case s.OpenCurlyBracket:{++B;const Je=new Map;for(;!ve(s.CloseCurlyBracket);){const it=Xt();te(s.Colon,"Expected colon between key and value in object literal");const Rt=Xt();Je.set(it,Rt),ve(s.Comma)&&++B}return++B,new H(Je)}default:throw new SyntaxError(`Unexpected token: ${Ae.type}`)}}for(;B=0?(oe=(oe??(oe=0))<0?Math.max(D.length+oe,0):Math.min(oe,D.length),B=(B??(B=D.length))<0?Math.max(D.length+B,0):Math.min(B,D.length)):(oe=(oe??(oe=D.length-1))<0?Math.max(D.length+oe,-1):Math.min(oe,D.length-1),B=(B??(B=-1))<-1?Math.max(D.length+B,-1):Math.min(B,D.length-1));const Oe=[];for(let ve=oe;me*veoe.toUpperCase())}var ye=class extends Error{},ze=class extends Error{},Ue=class{constructor(D=void 0){Y(this,"type","RuntimeValue");Y(this,"value");Y(this,"builtins",new Map);this.value=D}__bool__(){return new re(!!this.value)}},pe=class extends Ue{constructor(){super(...arguments);Y(this,"type","NumericValue")}},W=class extends Ue{constructor(){super(...arguments);Y(this,"type","StringValue");Y(this,"builtins",new Map([["upper",new Pe(()=>new W(this.value.toUpperCase()))],["lower",new Pe(()=>new W(this.value.toLowerCase()))],["strip",new Pe(()=>new W(this.value.trim()))],["title",new Pe(()=>new W(le(this.value)))],["length",new pe(this.value.length)],["rstrip",new Pe(()=>new W(this.value.trimEnd()))],["lstrip",new Pe(()=>new W(this.value.trimStart()))],["startswith",new Pe(oe=>{if(oe.length===0)throw new Error("startswith() requires at least one argument");const B=oe[0];if(!(B instanceof W))throw new Error("startswith() argument must be a string");return new re(this.value.startsWith(B.value))})],["endswith",new Pe(oe=>{if(oe.length===0)throw new Error("endswith() requires at least one argument");const B=oe[0];if(!(B instanceof W))throw new Error("endswith() argument must be a string");return new re(this.value.endsWith(B.value))})],["split",new Pe(oe=>{const B=oe[0]??new $e;if(!(B instanceof W||B instanceof $e))throw new Error("sep argument must be a string or null");const te=oe[1]??new pe(-1);if(!(te instanceof pe))throw new Error("maxsplit argument must be a number");let me=[];if(B instanceof $e){const Oe=this.value.trimStart();for(const{0:ve,index:yt}of Oe.matchAll(/\S+/g)){if(te.value!==-1&&me.length>=te.value&&yt!==void 0){me.push(ve+Oe.slice(yt+ve.length));break}me.push(ve)}}else{if(B.value==="")throw new Error("empty separator");me=this.value.split(B.value),te.value!==-1&&me.length>te.value&&me.push(me.splice(te.value).join(B.value))}return new we(me.map(Oe=>new W(Oe)))})]]))}},re=class extends Ue{constructor(){super(...arguments);Y(this,"type","BooleanValue")}},G=class extends Ue{constructor(){super(...arguments);Y(this,"type","ObjectValue");Y(this,"builtins",new Map([["get",new Pe(([oe,B])=>{if(!(oe instanceof W))throw new Error(`Object key must be a string: got ${oe.type}`);return this.value.get(oe.value)??B??new $e})],["items",new Pe(()=>new we(Array.from(this.value.entries()).map(([oe,B])=>new we([new W(oe),B]))))]]))}__bool__(){return new re(this.value.size>0)}},be=class extends G{constructor(){super(...arguments);Y(this,"type","KeywordArgumentsValue")}},we=class extends Ue{constructor(){super(...arguments);Y(this,"type","ArrayValue");Y(this,"builtins",new Map([["length",new pe(this.value.length)]]))}__bool__(){return new re(this.value.length>0)}},Se=class extends we{constructor(){super(...arguments);Y(this,"type","TupleValue")}},Pe=class extends Ue{constructor(){super(...arguments);Y(this,"type","FunctionValue")}},$e=class extends Ue{constructor(){super(...arguments);Y(this,"type","NullValue")}},Fe=class extends Ue{constructor(){super(...arguments);Y(this,"type","UndefinedValue")}},Be=class{constructor(D){Y(this,"variables",new Map([["namespace",new Pe(D=>{if(D.length===0)return new G(new Map);if(D.length!==1||!(D[0]instanceof G))throw new Error("`namespace` expects either zero arguments or a single object argument");return D[0]})]]));Y(this,"tests",new Map([["boolean",D=>D.type==="BooleanValue"],["callable",D=>D instanceof Pe],["odd",D=>{if(D.type!=="NumericValue")throw new Error(`Cannot apply test "odd" to type: ${D.type}`);return D.value%2!==0}],["even",D=>{if(D.type!=="NumericValue")throw new Error(`Cannot apply test "even" to type: ${D.type}`);return D.value%2===0}],["false",D=>D.type==="BooleanValue"&&!D.value],["true",D=>D.type==="BooleanValue"&&D.value],["none",D=>D.type==="NullValue"],["string",D=>D.type==="StringValue"],["number",D=>D.type==="NumericValue"],["integer",D=>D.type==="NumericValue"&&Number.isInteger(D.value)],["iterable",D=>D.type==="ArrayValue"||D.type==="StringValue"],["mapping",D=>D.type==="ObjectValue"],["lower",D=>{const oe=D.value;return D.type==="StringValue"&&oe===oe.toLowerCase()}],["upper",D=>{const oe=D.value;return D.type==="StringValue"&&oe===oe.toUpperCase()}],["none",D=>D.type==="NullValue"],["defined",D=>D.type!=="UndefinedValue"],["undefined",D=>D.type==="UndefinedValue"],["equalto",(D,oe)=>D.value===oe.value],["eq",(D,oe)=>D.value===oe.value]]));this.parent=D}set(D,oe){return this.declareVariable(D,qe(oe))}declareVariable(D,oe){if(this.variables.has(D))throw new SyntaxError(`Variable already declared: ${D}`);return this.variables.set(D,oe),oe}setVariable(D,oe){return this.variables.set(D,oe),oe}resolve(D){if(this.variables.has(D))return this;if(this.parent)return this.parent.resolve(D);throw new Error(`Unknown variable: ${D}`)}lookupVariable(D){try{return this.resolve(D).variables.get(D)??new Fe}catch{return new Fe}}},He=class{constructor(D){Y(this,"global");this.global=D??new Be}run(D){return this.evaluate(D,this.global)}evaluateBinaryExpression(D,oe){const B=this.evaluate(D.left,oe);switch(D.operator.value){case"and":return B.__bool__().value?this.evaluate(D.right,oe):B;case"or":return B.__bool__().value?B:this.evaluate(D.right,oe)}const te=this.evaluate(D.right,oe);switch(D.operator.value){case"==":return new re(B.value==te.value);case"!=":return new re(B.value!=te.value)}if(B instanceof Fe||te instanceof Fe)throw new Error("Cannot perform operation on undefined values");if(B instanceof $e||te instanceof $e)throw new Error("Cannot perform operation on null values");if(B instanceof pe&&te instanceof pe)switch(D.operator.value){case"+":return new pe(B.value+te.value);case"-":return new pe(B.value-te.value);case"*":return new pe(B.value*te.value);case"/":return new pe(B.value/te.value);case"%":return new pe(B.value%te.value);case"<":return new re(B.value":return new re(B.value>te.value);case">=":return new re(B.value>=te.value);case"<=":return new re(B.value<=te.value)}else if(B instanceof we&&te instanceof we)switch(D.operator.value){case"+":return new we(B.value.concat(te.value))}else if(te instanceof we){const me=te.value.find(Oe=>Oe.value===B.value)!==void 0;switch(D.operator.value){case"in":return new re(me);case"not in":return new re(!me)}}if(B instanceof W||te instanceof W)switch(D.operator.value){case"+":return new W(B.value.toString()+te.value.toString())}if(B instanceof W&&te instanceof W)switch(D.operator.value){case"in":return new re(te.value.includes(B.value));case"not in":return new re(!te.value.includes(B.value))}if(B instanceof W&&te instanceof G)switch(D.operator.value){case"in":return new re(te.value.has(B.value));case"not in":return new re(!te.value.has(B.value))}throw new SyntaxError(`Unknown operator "${D.operator.value}" between ${B.type} and ${te.type}`)}evaluateArguments(D,oe){const B=[],te=new Map;for(const me of D)if(me.type==="KeywordArgumentExpression"){const Oe=me;te.set(Oe.key.value,this.evaluate(Oe.value,oe))}else{if(te.size>0)throw new Error("Positional arguments must come before keyword arguments");B.push(this.evaluate(me,oe))}return[B,te]}evaluateFilterExpression(D,oe){const B=this.evaluate(D.operand,oe);if(D.filter.type==="Identifier"){const te=D.filter;if(te.value==="tojson")return new W(ke(B));if(B instanceof we)switch(te.value){case"list":return B;case"first":return B.value[0];case"last":return B.value[B.value.length-1];case"length":return new pe(B.value.length);case"reverse":return new we(B.value.reverse());case"sort":return new we(B.value.sort((me,Oe)=>{if(me.type!==Oe.type)throw new Error(`Cannot compare different types: ${me.type} and ${Oe.type}`);switch(me.type){case"NumericValue":return me.value-Oe.value;case"StringValue":return me.value.localeCompare(Oe.value);default:throw new Error(`Cannot compare type: ${me.type}`)}}));case"join":return new W(B.value.map(me=>me.value).join(""));case"string":return new W(ke(B));default:throw new Error(`Unknown ArrayValue filter: ${te.value}`)}else if(B instanceof W)switch(te.value){case"length":return new pe(B.value.length);case"upper":return new W(B.value.toUpperCase());case"lower":return new W(B.value.toLowerCase());case"title":return new W(le(B.value));case"capitalize":return new W(B.value.charAt(0).toUpperCase()+B.value.slice(1));case"trim":return new W(B.value.trim());case"indent":return new W(B.value.split(` -`).map((me,Oe)=>Oe===0||me.length===0?me:" "+me).join(` -`));case"join":case"string":return B;default:throw new Error(`Unknown StringValue filter: ${te.value}`)}else if(B instanceof pe)switch(te.value){case"abs":return new pe(Math.abs(B.value));default:throw new Error(`Unknown NumericValue filter: ${te.value}`)}else if(B instanceof G)switch(te.value){case"items":return new we(Array.from(B.value.entries()).map(([me,Oe])=>new we([new W(me),Oe])));case"length":return new pe(B.value.size);default:throw new Error(`Unknown ObjectValue filter: ${te.value}`)}throw new Error(`Cannot apply filter "${te.value}" to type: ${B.type}`)}else if(D.filter.type==="CallExpression"){const te=D.filter;if(te.callee.type!=="Identifier")throw new Error(`Unknown filter: ${te.callee.type}`);const me=te.callee.value;if(me==="tojson"){const[,Oe]=this.evaluateArguments(te.args,oe),ve=Oe.get("indent")??new $e;if(!(ve instanceof pe||ve instanceof $e))throw new Error("If set, indent must be a number");return new W(ke(B,ve.value))}else if(me==="join"){let Oe;if(B instanceof W)Oe=Array.from(B.value);else if(B instanceof we)Oe=B.value.map(ht=>ht.value);else throw new Error(`Cannot apply filter "${me}" to type: ${B.type}`);const[ve,yt]=this.evaluateArguments(te.args,oe),Ft=ve.at(0)??yt.get("separator")??new W("");if(!(Ft instanceof W))throw new Error("separator must be a string");return new W(Oe.join(Ft.value))}if(B instanceof we){switch(me){case"selectattr":case"rejectattr":{const Oe=me==="selectattr";if(B.value.some(rt=>!(rt instanceof G)))throw new Error(`\`${me}\` can only be applied to array of objects`);if(te.args.some(rt=>rt.type!=="StringLiteral"))throw new Error(`arguments of \`${me}\` must be strings`);const[ve,yt,Ft]=te.args.map(rt=>this.evaluate(rt,oe));let ht;if(yt){const rt=oe.tests.get(yt.value);if(!rt)throw new Error(`Unknown test: ${yt.value}`);ht=rt}else ht=(...rt)=>rt[0].__bool__().value;const lt=B.value.filter(rt=>{const Bt=rt.value.get(ve.value),Ht=Bt?ht(Bt,Ft):!1;return Oe?Ht:!Ht});return new we(lt)}case"map":{const[,Oe]=this.evaluateArguments(te.args,oe);if(Oe.has("attribute")){const ve=Oe.get("attribute");if(!(ve instanceof W))throw new Error("attribute must be a string");const yt=Oe.get("default"),Ft=B.value.map(ht=>{if(!(ht instanceof G))throw new Error("items in map must be an object");return ht.value.get(ve.value)??yt??new Fe});return new we(Ft)}else throw new Error("`map` expressions without `attribute` set are not currently supported.")}}throw new Error(`Unknown ArrayValue filter: ${me}`)}else if(B instanceof W){switch(me){case"indent":{const[Oe,ve]=this.evaluateArguments(te.args,oe),yt=Oe.at(0)??ve.get("width")??new pe(4);if(!(yt instanceof pe))throw new Error("width must be a number");const Ft=Oe.at(1)??ve.get("first")??new re(!1),ht=Oe.at(2)??ve.get("blank")??new re(!1),lt=B.value.split(` -`),rt=" ".repeat(yt.value),Bt=lt.map((Ht,wr)=>!Ft.value&&wr===0||!ht.value&&Ht.length===0?Ht:rt+Ht);return new W(Bt.join(` -`))}}throw new Error(`Unknown StringValue filter: ${me}`)}else throw new Error(`Cannot apply filter "${me}" to type: ${B.type}`)}throw new Error(`Unknown filter: ${D.filter.type}`)}evaluateTestExpression(D,oe){const B=this.evaluate(D.operand,oe),te=oe.tests.get(D.test.value);if(!te)throw new Error(`Unknown test: ${D.test.value}`);const me=te(B);return new re(D.negate?!me:me)}evaluateUnaryExpression(D,oe){const B=this.evaluate(D.argument,oe);switch(D.operator.value){case"not":return new re(!B.value);default:throw new SyntaxError(`Unknown operator: ${D.operator.value}`)}}evalProgram(D,oe){return this.evaluateBlock(D.body,oe)}evaluateBlock(D,oe){let B="";for(const te of D){const me=this.evaluate(te,oe);me.type!=="NullValue"&&me.type!=="UndefinedValue"&&(B+=me.value)}return new W(B)}evaluateIdentifier(D,oe){return oe.lookupVariable(D.value)}evaluateCallExpression(D,oe){const[B,te]=this.evaluateArguments(D.args,oe);te.size>0&&B.push(new be(te));const me=this.evaluate(D.callee,oe);if(me.type!=="FunctionValue")throw new Error(`Cannot call something that is not a function: got ${me.type}`);return me.value(B,oe)}evaluateSliceExpression(D,oe,B){if(!(D instanceof we||D instanceof W))throw new Error("Slice object must be an array or string");const te=this.evaluate(oe.start,B),me=this.evaluate(oe.stop,B),Oe=this.evaluate(oe.step,B);if(!(te instanceof pe||te instanceof Fe))throw new Error("Slice start must be numeric or undefined");if(!(me instanceof pe||me instanceof Fe))throw new Error("Slice stop must be numeric or undefined");if(!(Oe instanceof pe||Oe instanceof Fe))throw new Error("Slice step must be numeric or undefined");return D instanceof we?new we(_e(D.value,te.value,me.value,Oe.value)):new W(_e(Array.from(D.value),te.value,me.value,Oe.value).join(""))}evaluateMemberExpression(D,oe){const B=this.evaluate(D.object,oe);let te;if(D.computed){if(D.property.type==="SliceExpression")return this.evaluateSliceExpression(B,D.property,oe);te=this.evaluate(D.property,oe)}else te=new W(D.property.value);let me;if(B instanceof G){if(!(te instanceof W))throw new Error(`Cannot access property with non-string: got ${te.type}`);me=B.value.get(te.value)??B.builtins.get(te.value)}else if(B instanceof we||B instanceof W)if(te instanceof pe)me=B.value.at(te.value),B instanceof W&&(me=new W(B.value.at(te.value)));else if(te instanceof W)me=B.builtins.get(te.value);else throw new Error(`Cannot access property with non-string/non-number: got ${te.type}`);else{if(!(te instanceof W))throw new Error(`Cannot access property with non-string: got ${te.type}`);me=B.builtins.get(te.value)}return me instanceof Ue?me:new Fe}evaluateSet(D,oe){const B=D.value?this.evaluate(D.value,oe):this.evaluateBlock(D.body,oe);if(D.assignee.type==="Identifier"){const te=D.assignee.value;oe.setVariable(te,B)}else if(D.assignee.type==="MemberExpression"){const te=D.assignee,me=this.evaluate(te.object,oe);if(!(me instanceof G))throw new Error("Cannot assign to member of non-object");if(te.property.type!=="Identifier")throw new Error("Cannot assign to member with non-identifier property");me.value.set(te.property.value,B)}else throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(D.assignee)}`);return new $e}evaluateIf(D,oe){const B=this.evaluate(D.test,oe);return this.evaluateBlock(B.__bool__().value?D.body:D.alternate,oe)}evaluateFor(D,oe){const B=new Be(oe);let te,me;if(D.iterable.type==="SelectExpression"){const ht=D.iterable;me=this.evaluate(ht.iterable,B),te=ht.test}else me=this.evaluate(D.iterable,B);if(!(me instanceof we))throw new Error(`Expected iterable type in for loop: got ${me.type}`);const Oe=[],ve=[];for(let ht=0;htHt.setVariable(D.loopvar.value,rt);else if(D.loopvar.type==="TupleLiteral"){const Ht=D.loopvar;if(rt.type!=="ArrayValue")throw new Error(`Cannot unpack non-iterable type: ${rt.type}`);const wr=rt;if(Ht.value.length!==wr.value.length)throw new Error(`Too ${Ht.value.length>wr.value.length?"few":"many"} items to unpack`);Bt=Xt=>{for(let Or=0;Or0?Oe[ht-1]:new Fe],["nextitem",ht{var ve;const me=new Be(te);B=B.slice();let Oe;((ve=B.at(-1))==null?void 0:ve.type)==="KeywordArgumentsValue"&&(Oe=B.pop());for(let yt=0;ytthis.evaluate(B,oe)));case"TupleLiteral":return new Se(D.value.map(B=>this.evaluate(B,oe)));case"ObjectLiteral":{const B=new Map;for(const[te,me]of D.value){const Oe=this.evaluate(te,oe);if(!(Oe instanceof W))throw new Error(`Object keys must be strings: got ${Oe.type}`);B.set(Oe.value,this.evaluate(me,oe))}return new G(B)}case"Identifier":return this.evaluateIdentifier(D,oe);case"CallExpression":return this.evaluateCallExpression(D,oe);case"MemberExpression":return this.evaluateMemberExpression(D,oe);case"UnaryExpression":return this.evaluateUnaryExpression(D,oe);case"BinaryExpression":return this.evaluateBinaryExpression(D,oe);case"FilterExpression":return this.evaluateFilterExpression(D,oe);case"TestExpression":return this.evaluateTestExpression(D,oe);default:throw new SyntaxError(`Unknown node type: ${D.type}`)}}};function qe(D){switch(typeof D){case"number":return new pe(D);case"string":return new W(D);case"boolean":return new re(D);case"undefined":return new Fe;case"object":return D===null?new $e:Array.isArray(D)?new we(D.map(qe)):new G(new Map(Object.entries(D).map(([oe,B])=>[oe,qe(B)])));case"function":return new Pe((oe,B)=>{const te=D(...oe.map(me=>me.value))??null;return qe(te)});default:throw new Error(`Cannot convert to runtime value: ${D}`)}}function ke(D,oe,B){const te=B??0;switch(D.type){case"NullValue":case"UndefinedValue":return"null";case"NumericValue":case"StringValue":case"BooleanValue":return JSON.stringify(D.value);case"ArrayValue":case"ObjectValue":{const me=oe?" ".repeat(oe):"",Oe=` -`+me.repeat(te),ve=Oe+me;if(D.type==="ArrayValue"){const yt=D.value.map(Ft=>ke(Ft,oe,te+1));return oe?`[${ve}${yt.join(`,${ve}`)}${Oe}]`:`[${yt.join(", ")}]`}else{const yt=Array.from(D.value.entries()).map(([Ft,ht])=>{const lt=`"${Ft}": ${ke(ht,oe,te+1)}`;return oe?`${ve}${lt}`:lt});return oe?`{${yt.join(",")}${Oe}}`:`{${yt.join(", ")}}`}}default:throw new Error(`Cannot convert to JSON: ${D.type}`)}}var Ve=` -`,Ze="{%- ",st=" -%}",at={MultiplicativeBinaryOperator:2,AdditiveBinaryOperator:1,ComparisonBinaryOperator:0};function Ge(D,oe=" "){const B=typeof oe=="number"?" ".repeat(oe):oe;return pt(D.body,0,B).replace(/\n$/,"")}function Ie(...D){return Ze+D.join(" ")+st}function pt(D,oe,B){return D.map(te=>St(te,oe,B)).join(Ve)}function St(D,oe,B){const te=B.repeat(oe);switch(D.type){case"Program":return pt(D.body,oe,B);case"If":return Vt(D,oe,B);case"For":return zt(D,oe,B);case"Set":return gr(D,oe,B);case"Macro":return or(D,oe,B);case"Break":return te+Ie("break");case"Continue":return te+Ie("continue");default:return te+"{{- "+bt(D)+" -}}"}}function Vt(D,oe,B){const te=B.repeat(oe),me=[];let Oe=D;for(;Oe&&(me.push({test:Oe.test,body:Oe.body}),Oe.alternate.length===1&&Oe.alternate[0].type==="If");)Oe=Oe.alternate[0];let ve=te+Ie("if",bt(me[0].test))+Ve+pt(me[0].body,oe+1,B);for(let yt=1;yt0&&(ve+=Ve+te+Ie("else")+Ve+pt(Oe.alternate,oe+1,B)),ve+=Ve+te+Ie("endif"),ve}function zt(D,oe,B){const te=B.repeat(oe);let me="";if(D.iterable.type==="SelectExpression"){const ve=D.iterable;me=`${bt(ve.iterable)} if ${bt(ve.test)}`}else me=bt(D.iterable);let Oe=te+Ie("for",bt(D.loopvar),"in",me)+Ve+pt(D.body,oe+1,B);return D.defaultBlock.length>0&&(Oe+=Ve+te+Ie("else")+Ve+pt(D.defaultBlock,oe+1,B)),Oe+=Ve+te+Ie("endfor"),Oe}function gr(D,oe,B){const te=B.repeat(oe),me=bt(D.assignee),Oe=D.value?bt(D.value):"",ve=te+Ie("set",`${me}${D.value?" = "+Oe:""}`);return D.body.length===0?ve:ve+Ve+pt(D.body,oe+1,B)+Ve+te+Ie("endset")}function or(D,oe,B){const te=B.repeat(oe),me=D.args.map(bt).join(", ");return te+Ie("macro",`${D.name.value}(${me})`)+Ve+pt(D.body,oe+1,B)+Ve+te+Ie("endmacro")}function bt(D,oe=-1){switch(D.type){case"Identifier":return D.value;case"NullLiteral":return"none";case"NumericLiteral":case"BooleanLiteral":return`${D.value}`;case"StringLiteral":return JSON.stringify(D.value);case"BinaryExpression":{const B=D,te=at[B.operator.type]??0,me=bt(B.left,te),Oe=bt(B.right,te+1),ve=`${me} ${B.operator.value} ${Oe}`;return tebt(me,-1)).join(", ");return`${bt(B.callee,-1)}(${te})`}case"MemberExpression":{const B=D;let te=bt(B.object,-1);B.object.type!=="Identifier"&&(te=`(${te})`);let me=bt(B.property,-1);return!B.computed&&B.property.type!=="Identifier"&&(me=`(${me})`),B.computed?`${te}[${me}]`:`${te}.${me}`}case"FilterExpression":{const B=D,te=bt(B.operand,1/0);return B.filter.type==="CallExpression"?`${te} | ${bt(B.filter,-1)}`:`${te} | ${B.filter.value}`}case"SelectExpression":{const B=D;return`${bt(B.iterable,-1)} | select(${bt(B.test,-1)})`}case"TestExpression":{const B=D;return`${bt(B.operand,-1)} is${B.negate?" not":""} ${B.test.value}`}case"ArrayLiteral":case"TupleLiteral":{const B=D.value.map(me=>bt(me,-1)),te=D.type==="ArrayLiteral"?"[]":"()";return`${te[0]}${B.join(", ")}${te[1]}`}case"ObjectLiteral":return`{ ${Array.from(D.value.entries()).map(([te,me])=>`${bt(te,-1)}: ${bt(me,-1)}`).join(", ")} }`;case"SliceExpression":{const B=D,te=B.start?bt(B.start,-1):"",me=B.stop?bt(B.stop,-1):"",Oe=B.step?`:${bt(B.step,-1)}`:"";return`${te}:${me}${Oe}`}case"KeywordArgumentExpression":{const B=D;return`${B.key.value}=${bt(B.value,-1)}`}case"If":{const B=D,te=bt(B.test,-1),me=bt(B.body[0],0),Oe=bt(B.alternate[0],-1);return`${me} if ${te} else ${Oe}`}default:throw new Error(`Unknown expression type: ${D.type}`)}}var Zr=class{constructor(D){Y(this,"parsed");const oe=c(D,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=U(oe)}render(D){const oe=new Be;if(oe.set("false",!1),oe.set("true",!0),oe.set("raise_exception",me=>{throw new Error(me)}),oe.set("range",ee),D)for(const[me,Oe]of Object.entries(D))oe.set(me,Oe);return new He(oe).run(this.parsed).value}format(D){return Ge(this.parsed,(D==null?void 0:D.indent)||" ")}}},"./src/backends/onnx.js":(e,r,t)=>{var s;t.r(r),t.d(r,{Tensor:()=>a.Tensor,createInferenceSession:()=>$,deviceToExecutionProviders:()=>f,isONNXProxy:()=>C,isONNXTensor:()=>g});var o=t("./src/env.js"),n=t("?2ce3"),i=t("onnxruntime-web"),a=t("onnxruntime-common");const l=Object.freeze({auto:null,gpu:null,cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:{name:"webnn",deviceType:"cpu"},"webnn-npu":{name:"webnn",deviceType:"npu"},"webnn-gpu":{name:"webnn",deviceType:"gpu"},"webnn-cpu":{name:"webnn",deviceType:"cpu"}}),u=[];let p,c;const d=Symbol.for("onnxruntime");if(d in globalThis)c=globalThis[d];else if(o.apis.IS_NODE_ENV){switch(c=n??(s||(s=t.t(n,2))),process.platform){case"win32":u.push("dml");break;case"linux":process.arch==="x64"&&u.push("cuda");break}u.push("cpu"),p=["cpu"]}else c=i,o.apis.IS_WEBNN_AVAILABLE&&u.push("webnn-npu","webnn-gpu","webnn-cpu","webnn"),o.apis.IS_WEBGPU_AVAILABLE&&u.push("webgpu"),u.push("wasm"),p=["wasm"];const _=c.InferenceSession;function f(E=null){if(!E)return p;switch(E){case"auto":return u;case"gpu":return u.filter(x=>["webgpu","cuda","dml","webnn-gpu"].includes(x))}if(u.includes(E))return[l[E]??E];throw new Error(`Unsupported device: "${E}". Should be one of: ${u.join(", ")}.`)}let v=null;async function $(E,x,b){v&&await v;const y=_.create(E,x);v??(v=y);const S=await y;return S.config=b,S}function g(E){return E instanceof c.Tensor}const w=c==null?void 0:c.env;w!=null&&w.wasm&&(!(typeof ServiceWorkerGlobalScope<"u"&&self instanceof ServiceWorkerGlobalScope)&&!w.wasm.wasmPaths&&(w.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${o.env.version}/dist/`),w.wasm.proxy=!1),w!=null&&w.webgpu&&(w.webgpu.powerPreference="high-performance");function C(){var E;return(E=w==null?void 0:w.wasm)==null?void 0:E.proxy}o.env.backends.onnx=w},"./src/base/feature_extraction_utils.js":(e,r,t)=>{t.r(r),t.d(r,{FeatureExtractor:()=>i,validate_audio_inputs:()=>a});var s=t("./src/utils/constants.js"),o=t("./src/utils/generic.js"),n=t("./src/utils/hub.js");class i extends o.Callable{constructor(u){super(),this.config=u}static async from_pretrained(u,p){const c=await(0,n.getModelJSON)(u,s.FEATURE_EXTRACTOR_NAME,!0,p);return new this(c)}}function a(l,u){var p;if(!(l instanceof Float32Array||l instanceof Float64Array))throw new Error(`${u} expects input to be a Float32Array or a Float64Array, but got ${((p=l==null?void 0:l.constructor)==null?void 0:p.name)??typeof l} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}},"./src/base/image_processors_utils.js":(e,r,t)=>{t.r(r),t.d(r,{ImageProcessor:()=>E,center_to_corners_format:()=>c,post_process_instance_segmentation:()=>C,post_process_object_detection:()=>d,post_process_panoptic_segmentation:()=>w,post_process_semantic_segmentation:()=>_});var s=t("./src/utils/generic.js"),o=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");t("./src/utils/image.js");var i=t("./src/utils/core.js"),a=t("./src/utils/hub.js"),l=t("./src/utils/constants.js");function u(x,b,y=0,S=null){const F=x/b;let z=(0,n.bankers_round)(F)*b;return S!==null&&z>S&&(z=Math.floor(F)*b),zb&&A.push(ee)}else{let ee=(0,n.max)(V.data)[1];if(ee===R-1||(U=(0,n.softmax)(V.data),U[ee]le*J[(ye+1)%2])),Q.boxes.push(_e),Q.classes.push(ee),Q.scores.push(U[ee])}}Z.push(Q)}return Z}function _(x,b=null){const y=x.logits,S=y.dims[0];if(b!==null&&b.length!==S)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const F=[];for(let z=0;zJ[A]&&(J[A]=V[A],Q[A]=ae)}const se=new Array(q.dims[0]);for(let ae=0;aeae!==void 0);F.push({segmentation:H,labels:fe})}return F}function f(x,b,y,S){const F=[],z=[],K=[];for(let q=0;qy&&(F.push(Z),z.push(Q),K.push(H))}return[F,z,K]}function v(x,b,y,S=.5,F=.8){const z=[];let K=0,q=0;const R=b[y].data;for(let H=0;H=S&&++q;let Z=K>0&&q>0;return Z&&(Z=K/q>F),[Z,z]}function $(x,b,y,S,F,z=null,K=null){const[q,R]=K??x[0].dims,Z=new o.Tensor("int32",new Int32Array(q*R),[q,R]),H=[];if(K!==null)for(let ae=0;aeQ[U]&&(J[U]=ae,Q[U]=A[U])}let se=0;const fe=Z.data;for(let ae=0;ae200)throw new Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(x,b)/Math.min(x,b)}`);let z=Math.round(x/y)*y,K=Math.round(b/y)*y;if(z*K>F){const q=Math.sqrt(x*b/F);z=Math.floor(x/q/y)*y,K=Math.floor(b/q/y)*y}else if(z*Kz?Z=Math.floor(z*R/F):z>F&&(R=Math.floor(F*Z/z)),await b.resize(Z,R,{resample:S}))}async crop_margin(b,y=200){const S=b.clone().grayscale(),F=(0,n.min)(S.data)[0],K=(0,n.max)(S.data)[0]-F;if(K===0)return b;const q=y/255;let R=S.width,Z=S.height,H=0,J=0;const Q=S.data;for(let se=0;sethis.preprocess(z)));return{pixel_values:(0,o.stack)(S.map(z=>z.pixel_values),0),original_sizes:S.map(z=>z.original_size),reshaped_input_sizes:S.map(z=>z.reshaped_input_size)}}static async from_pretrained(b,y){const S=await(0,a.getModelJSON)(b,l.IMAGE_PROCESSOR_NAME,!0,y);return new this(S)}}},"./src/base/processing_utils.js":(e,r,t)=>{t.r(r),t.d(r,{Processor:()=>i});var s=t("./src/utils/constants.js"),o=t("./src/utils/generic.js"),n=t("./src/utils/hub.js");class i extends o.Callable{constructor(l,u){super(),this.config=l,this.components=u}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(l,u={}){if(!this.tokenizer)throw new Error("Unable to apply chat template without a tokenizer.");return this.tokenizer.apply_chat_template(l,{tokenize:!1,...u})}batch_decode(...l){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.batch_decode(...l)}decode(...l){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.decode(...l)}async _call(l,...u){for(const p of[this.image_processor,this.feature_extractor,this.tokenizer])if(p)return p(l,...u);throw new Error("No image processor, feature extractor, or tokenizer found.")}static async from_pretrained(l,u){const[p,c]=await Promise.all([this.uses_processor_config?(0,n.getModelJSON)(l,s.PROCESSOR_NAME,!0,u):{},Promise.all(this.classes.filter(d=>d in this).map(async d=>{const _=await this[d].from_pretrained(l,u);return[d.replace(/_class$/,""),_]})).then(Object.fromEntries)]);return new this(p,c)}}Y(i,"classes",["image_processor_class","tokenizer_class","feature_extractor_class"]),Y(i,"uses_processor_config",!1)},"./src/configs.js":(e,r,t)=>{t.r(r),t.d(r,{AutoConfig:()=>u,PretrainedConfig:()=>l,getKeyValueShapes:()=>a});var s=t("./src/utils/core.js"),o=t("./src/utils/hub.js");async function n(p,c){return await(0,o.getModelJSON)(p,"config.json",!0,c)}function i(p){const c={};let d={};switch(p.model_type){case"llava":case"paligemma":case"gemma3":case"florence2":case"llava_onevision":case"idefics3":case"ultravox":case"smolvlm":d=i(p.text_config);break;case"moondream1":d=i(p.phi_config);break;case"musicgen":d=i(p.decoder);break;case"multi_modality":d=i(p.language_config);break;case"gpt2":case"gptj":case"jais":case"codegen":case"gpt_bigcode":c.num_heads="n_head",c.num_layers="n_layer",c.hidden_size="n_embd";break;case"gpt_neox":case"stablelm":case"opt":case"falcon":c.num_heads="num_attention_heads",c.num_layers="num_hidden_layers",c.hidden_size="hidden_size";break;case"llama":case"olmo":case"olmo2":case"mobilellm":case"granite":case"cohere":case"mistral":case"starcoder2":case"qwen2":case"qwen2_vl":case"phi":case"phi3":case"phi3_v":c.num_heads="num_key_value_heads",c.num_layers="num_hidden_layers",c.hidden_size="hidden_size",c.num_attention_heads="num_attention_heads";break;case"qwen3":case"gemma":case"gemma2":case"gemma3_text":case"glm":case"helium":c.num_heads="num_key_value_heads",c.num_layers="num_hidden_layers",c.dim_kv="head_dim";break;case"openelm":c.num_heads="num_kv_heads",c.num_layers="num_transformer_layers",c.dim_kv="head_dim";break;case"gpt_neo":case"donut-swin":c.num_heads="num_heads",c.num_layers="num_layers",c.hidden_size="hidden_size";break;case"bloom":c.num_heads="n_head",c.num_layers="n_layer",c.hidden_size="hidden_size";break;case"mpt":c.num_heads="n_heads",c.num_layers="n_layers",c.hidden_size="d_model";break;case"exaone":c.num_heads="num_key_value_heads",c.num_layers="num_layers",c.dim_kv="head_dim",c.num_attention_heads="num_attention_heads";break;case"t5":case"mt5":case"longt5":c.num_decoder_layers="num_decoder_layers",c.num_decoder_heads="num_heads",c.decoder_dim_kv="d_kv",c.num_encoder_layers="num_layers",c.num_encoder_heads="num_heads",c.encoder_dim_kv="d_kv";break;case"bart":case"mbart":case"marian":case"whisper":case"lite-whisper":case"m2m_100":case"blenderbot":case"blenderbot-small":case"florence2_language":c.num_decoder_layers="decoder_layers",c.num_decoder_heads="decoder_attention_heads",c.decoder_hidden_size="d_model",c.num_encoder_layers="encoder_layers",c.num_encoder_heads="encoder_attention_heads",c.encoder_hidden_size="d_model";break;case"speecht5":c.num_decoder_layers="decoder_layers",c.num_decoder_heads="decoder_attention_heads",c.decoder_hidden_size="hidden_size",c.num_encoder_layers="encoder_layers",c.num_encoder_heads="encoder_attention_heads",c.encoder_hidden_size="hidden_size";break;case"trocr":c.num_encoder_layers=c.num_decoder_layers="decoder_layers",c.num_encoder_heads=c.num_decoder_heads="decoder_attention_heads",c.encoder_hidden_size=c.decoder_hidden_size="d_model";break;case"musicgen_decoder":c.num_encoder_layers=c.num_decoder_layers="num_hidden_layers",c.num_encoder_heads=c.num_decoder_heads="num_attention_heads",c.encoder_hidden_size=c.decoder_hidden_size="hidden_size";break;case"moonshine":c.num_decoder_layers="decoder_num_hidden_layers",c.num_decoder_heads="decoder_num_key_value_heads",c.num_encoder_layers="encoder_num_hidden_layers",c.num_encoder_heads="encoder_num_key_value_heads",c.encoder_hidden_size=c.decoder_hidden_size="hidden_size";break;case"vision-encoder-decoder":const f=i(p.decoder),v="num_decoder_layers"in f,$=(0,s.pick)(p,["model_type","is_encoder_decoder"]);return v?($.num_decoder_layers=f.num_decoder_layers,$.num_decoder_heads=f.num_decoder_heads,$.decoder_hidden_size=f.decoder_hidden_size,$.num_encoder_layers=f.num_encoder_layers,$.num_encoder_heads=f.num_encoder_heads,$.encoder_hidden_size=f.encoder_hidden_size):($.num_layers=f.num_layers,$.num_heads=f.num_heads,$.hidden_size=f.hidden_size),$}const _={...d,...(0,s.pick)(p,["model_type","multi_query","is_encoder_decoder"])};for(const f in c)_[f]=p[c[f]];return _}function a(p,{prefix:c="past_key_values",batch_size:d=1}={}){const _={},f=p.normalized_config;if(f.is_encoder_decoder&&"num_encoder_heads"in f&&"num_decoder_heads"in f){const v=f.encoder_dim_kv??f.encoder_hidden_size/f.num_encoder_heads,$=f.decoder_dim_kv??f.decoder_hidden_size/f.num_decoder_heads,g=[d,f.num_encoder_heads,0,v],w=[d,f.num_decoder_heads,0,$];for(let C=0;C{var S,F;t.r(r),t.d(r,{apis:()=>$,env:()=>b});var s=t("?569f"),o=t("?3f59"),n=t("?154a");const i="3.5.2",a=typeof window<"u"&&typeof window.document<"u",l=typeof self<"u"&&((S=self.constructor)==null?void 0:S.name)==="DedicatedWorkerGlobalScope",u=typeof self<"u"&&"caches"in self,p=typeof navigator<"u"&&"gpu"in navigator,c=typeof navigator<"u"&&"ml"in navigator,d=typeof process<"u",_=d&&((F=process==null?void 0:process.release)==null?void 0:F.name)==="node",f=!y(s),v=!y(o),$=Object.freeze({IS_BROWSER_ENV:a,IS_WEBWORKER_ENV:l,IS_WEB_CACHE_AVAILABLE:u,IS_WEBGPU_AVAILABLE:p,IS_WEBNN_AVAILABLE:c,IS_PROCESS_AVAILABLE:d,IS_NODE_ENV:_,IS_FS_AVAILABLE:f,IS_PATH_AVAILABLE:v}),g=f&&v;let w="./";if(g){const z=Object(import.meta).url;z?w=o.dirname(o.dirname(n.fileURLToPath(z))):typeof __dirname<"u"&&(w=o.dirname(__dirname))}const C=g?o.join(w,"/.cache/"):null,E="/models/",x=g?o.join(w,E):E,b={version:i,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:"https://huggingface.co/",remotePathTemplate:"{model}/resolve/{revision}/",allowLocalModels:!(a||l),localModelPath:x,useFS:f,useBrowserCache:u,useFSCache:f,cacheDir:C,useCustomCache:!1,customCache:null};function y(z){return Object.keys(z).length===0}},"./src/generation/configuration_utils.js":(e,r,t)=>{t.r(r),t.d(r,{GenerationConfig:()=>o});var s=t("./src/utils/core.js");class o{constructor(i){Y(this,"max_length",20);Y(this,"max_new_tokens",null);Y(this,"min_length",0);Y(this,"min_new_tokens",null);Y(this,"early_stopping",!1);Y(this,"max_time",null);Y(this,"do_sample",!1);Y(this,"num_beams",1);Y(this,"num_beam_groups",1);Y(this,"penalty_alpha",null);Y(this,"use_cache",!0);Y(this,"temperature",1);Y(this,"top_k",50);Y(this,"top_p",1);Y(this,"typical_p",1);Y(this,"epsilon_cutoff",0);Y(this,"eta_cutoff",0);Y(this,"diversity_penalty",0);Y(this,"repetition_penalty",1);Y(this,"encoder_repetition_penalty",1);Y(this,"length_penalty",1);Y(this,"no_repeat_ngram_size",0);Y(this,"bad_words_ids",null);Y(this,"force_words_ids",null);Y(this,"renormalize_logits",!1);Y(this,"constraints",null);Y(this,"forced_bos_token_id",null);Y(this,"forced_eos_token_id",null);Y(this,"remove_invalid_values",!1);Y(this,"exponential_decay_length_penalty",null);Y(this,"suppress_tokens",null);Y(this,"streamer",null);Y(this,"begin_suppress_tokens",null);Y(this,"forced_decoder_ids",null);Y(this,"guidance_scale",null);Y(this,"num_return_sequences",1);Y(this,"output_attentions",!1);Y(this,"output_hidden_states",!1);Y(this,"output_scores",!1);Y(this,"return_dict_in_generate",!1);Y(this,"pad_token_id",null);Y(this,"bos_token_id",null);Y(this,"eos_token_id",null);Y(this,"encoder_no_repeat_ngram_size",0);Y(this,"decoder_start_token_id",null);Y(this,"generation_kwargs",{});Object.assign(this,(0,s.pick)(i,Object.getOwnPropertyNames(this)))}}},"./src/generation/logits_process.js":(e,r,t)=>{t.r(r),t.d(r,{ClassifierFreeGuidanceLogitsProcessor:()=>g,ForcedBOSTokenLogitsProcessor:()=>l,ForcedEOSTokenLogitsProcessor:()=>u,LogitsProcessor:()=>n,LogitsProcessorList:()=>a,LogitsWarper:()=>i,MinLengthLogitsProcessor:()=>f,MinNewTokensLengthLogitsProcessor:()=>v,NoBadWordsLogitsProcessor:()=>$,NoRepeatNGramLogitsProcessor:()=>d,RepetitionPenaltyLogitsProcessor:()=>_,SuppressTokensAtBeginLogitsProcessor:()=>p,TemperatureLogitsWarper:()=>w,TopKLogitsWarper:()=>E,TopPLogitsWarper:()=>C,WhisperTimeStampLogitsProcessor:()=>c});var s=t("./src/utils/generic.js");t("./src/utils/tensor.js");var o=t("./src/utils/maths.js");class n extends s.Callable{_call(b,y){throw Error("`_call` should be implemented in a subclass")}}class i extends s.Callable{_call(b,y){throw Error("`_call` should be implemented in a subclass")}}class a extends s.Callable{constructor(){super(),this.processors=[]}push(b){this.processors.push(b)}extend(b){this.processors.push(...b)}_call(b,y){let S=y;for(const F of this.processors)S=F(b,S);return S}[Symbol.iterator](){return this.processors.values()}}class l extends n{constructor(b){super(),this.bos_token_id=b}_call(b,y){for(let S=0;S=1&&z[z.length-1]>=this.timestamp_begin,q=z.length<2||z[z.length-2]>=this.timestamp_begin;if(K&&(q?F.subarray(this.timestamp_begin).fill(-1/0):F.subarray(0,this.eos_token_id).fill(-1/0)),b[S].length===this.begin_index&&this.max_initial_timestamp_index!==null){const J=this.timestamp_begin+this.max_initial_timestamp_index;F.subarray(J+1).fill(-1/0)}const R=(0,o.log_softmax)(F),Z=Math.log(R.subarray(this.timestamp_begin).map(Math.exp).reduce((J,Q)=>J+Q)),H=(0,o.max)(R.subarray(0,this.timestamp_begin))[0];Z>H&&F.subarray(0,this.timestamp_begin).fill(-1/0)}return y}}class d extends n{constructor(b){super(),this.no_repeat_ngram_size=b}getNgrams(b){const y=b.length,S=[];for(let z=0;z1 to use the classifier free guidance processor, got guidance scale ${b}.`);this.guidance_scale=b}_call(b,y){if(y.dims[0]!==2*b.length)throw new Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${y.dims[0]} for the logits and ${b.length} for the input ids.`);const S=b.length,F=y.slice([0,S],null),z=y.slice([S,y.dims[0]],null);for(let K=0;K1)throw new Error(`\`top_p\` must be a float > 0 and < 1, but is ${b}`);if(!Number.isInteger(S)||S<1)throw new Error(`\`min_tokens_to_keep\` must be a positive integer, but is ${S}`);this.top_p=b,this.filter_value=y,this.min_tokens_to_keep=S}}class E extends i{constructor(b,{filter_value:y=-1/0,min_tokens_to_keep:S=1}={}){if(super(),!Number.isInteger(b)||b<0)throw new Error(`\`top_k\` must be a positive integer, but is ${b}`);this.top_k=Math.max(b,S),this.filter_value=y}}},"./src/generation/logits_sampler.js":(e,r,t)=>{t.r(r),t.d(r,{LogitsSampler:()=>i});var s=t("./src/utils/generic.js"),o=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");t("./src/generation/configuration_utils.js");class i extends s.Callable{constructor(c){super(),this.generation_config=c}async _call(c){return this.sample(c)}async sample(c){throw Error("sample should be implemented in subclasses.")}getLogits(c,d){let _=c.dims.at(-1),f=c.data;if(d===-1)f=f.slice(-_);else{let v=d*_;f=f.slice(v,v+_)}return f}randomSelect(c){let d=0;for(let f=0;f1)return new u(c);if(c.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${c.num_return_sequences}.`);return new a(c)}}class a extends i{async sample(c){const d=(0,n.max)(c.data)[1];return[[BigInt(d),0]]}}class l extends i{async sample(c){let d=c.dims.at(-1);this.generation_config.top_k>0&&(d=Math.min(this.generation_config.top_k,d));const[_,f]=await(0,o.topk)(c,d),v=(0,n.softmax)(_.data);return Array.from({length:this.generation_config.num_beams},()=>{const $=this.randomSelect(v);return[f.data[$],Math.log(v[$])]})}}class u extends i{async sample(c){let d=c.dims.at(-1);this.generation_config.top_k>0&&(d=Math.min(this.generation_config.top_k,d));const[_,f]=await(0,o.topk)(c,d),v=(0,n.softmax)(_.data);return Array.from({length:this.generation_config.num_beams},($,g)=>[f.data[g],Math.log(v[g])])}}},"./src/generation/stopping_criteria.js":(e,r,t)=>{t.r(r),t.d(r,{EosTokenCriteria:()=>a,InterruptableStoppingCriteria:()=>l,MaxLengthCriteria:()=>i,StoppingCriteria:()=>o,StoppingCriteriaList:()=>n});var s=t("./src/utils/generic.js");class o extends s.Callable{_call(p,c){throw Error("StoppingCriteria needs to be subclassed")}}class n extends s.Callable{constructor(){super(),this.criteria=[]}push(p){this.criteria.push(p)}extend(p){p instanceof n?p=p.criteria:p instanceof o&&(p=[p]),this.criteria.push(...p)}_call(p,c){const d=new Array(p.length).fill(!1);for(const _ of this.criteria){const f=_(p,c);for(let v=0;vc.length>=this.max_length)}}class a extends o{constructor(p){super(),Array.isArray(p)||(p=[p]),this.eos_token_id=p}_call(p,c){return p.map(d=>{const _=d.at(-1);return this.eos_token_id.some(f=>_==f)})}}class l extends o{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(p,c){return new Array(p.length).fill(this.interrupted)}}},"./src/generation/streamers.js":(e,r,t)=>{t.r(r),t.d(r,{BaseStreamer:()=>i,TextStreamer:()=>l,WhisperTextStreamer:()=>u});var s=t("./src/utils/core.js"),o=t("./src/tokenizers.js"),n=t("./src/env.js");class i{put(c){throw Error("Not implemented")}end(){throw Error("Not implemented")}}const a=n.apis.IS_PROCESS_AVAILABLE?p=>process.stdout.write(p):p=>console.log(p);class l extends i{constructor(c,{skip_prompt:d=!1,callback_function:_=null,token_callback_function:f=null,skip_special_tokens:v=!0,decode_kwargs:$={},...g}={}){super(),this.tokenizer=c,this.skip_prompt=d,this.callback_function=_??a,this.token_callback_function=f,this.decode_kwargs={skip_special_tokens:v,...$,...g},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(c){var $;if(c.length>1)throw Error("TextStreamer only supports batch size of 1");const d=this.next_tokens_are_prompt;if(d&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;const _=c[0];($=this.token_callback_function)==null||$.call(this,_),this.token_cache=(0,s.mergeArrays)(this.token_cache,_);const f=this.tokenizer.decode(this.token_cache,this.decode_kwargs);let v;d||f.endsWith(` -`)?(v=f.slice(this.print_len),this.token_cache=[],this.print_len=0):f.length>0&&(0,o.is_chinese_char)(f.charCodeAt(f.length-1))?(v=f.slice(this.print_len),this.print_len+=v.length):(v=f.slice(this.print_len,f.lastIndexOf(" ")+1),this.print_len+=v.length),this.on_finalized_text(v,!1)}end(){let c;this.token_cache.length>0?(c=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len),this.token_cache=[],this.print_len=0):c="",this.next_tokens_are_prompt=!0,this.on_finalized_text(c,!0)}on_finalized_text(c,d){var _,f;c.length>0&&((_=this.callback_function)==null||_.call(this,c)),d&&this.callback_function===a&&n.apis.IS_PROCESS_AVAILABLE&&((f=this.callback_function)==null||f.call(this,` -`))}}class u extends l{constructor(c,{skip_prompt:d=!1,callback_function:_=null,token_callback_function:f=null,on_chunk_start:v=null,on_chunk_end:$=null,on_finalize:g=null,time_precision:w=.02,skip_special_tokens:C=!0,decode_kwargs:E={}}={}){super(c,{skip_prompt:d,skip_special_tokens:C,callback_function:_,token_callback_function:f,decode_kwargs:E}),this.timestamp_begin=c.timestamp_begin,this.on_chunk_start=v,this.on_chunk_end=$,this.on_finalize=g,this.time_precision=w,this.waiting_for_timestamp=!1}put(c){var _,f,v;if(c.length>1)throw Error("WhisperTextStreamer only supports batch size of 1");const d=c[0];if(d.length===1){const $=Number(d[0])-this.timestamp_begin;if($>=0){const g=$*this.time_precision;this.waiting_for_timestamp?(_=this.on_chunk_end)==null||_.call(this,g):(f=this.on_chunk_start)==null||f.call(this,g),this.waiting_for_timestamp=!this.waiting_for_timestamp,(v=this.token_callback_function)==null||v.call(this,d);return}}return super.put(c)}end(){var c;super.end(),(c=this.on_finalize)==null||c.call(this)}}},"./src/models.js":(e,r,t)=>{t.r(r),t.d(r,{ASTForAudioClassification:()=>di,ASTModel:()=>ci,ASTPreTrainedModel:()=>lo,AlbertForMaskedLM:()=>X,AlbertForQuestionAnswering:()=>j,AlbertForSequenceClassification:()=>k,AlbertModel:()=>de,AlbertPreTrainedModel:()=>Fs,AutoModel:()=>El,AutoModelForAudioClassification:()=>uf,AutoModelForAudioFrameClassification:()=>df,AutoModelForAudioTextToText:()=>Mf,AutoModelForCTC:()=>lf,AutoModelForCausalLM:()=>Xm,AutoModelForDepthEstimation:()=>ff,AutoModelForDocumentQuestionAnswering:()=>pf,AutoModelForImageClassification:()=>ef,AutoModelForImageFeatureExtraction:()=>wf,AutoModelForImageMatting:()=>hf,AutoModelForImageSegmentation:()=>tf,AutoModelForImageTextToText:()=>bf,AutoModelForImageToImage:()=>mf,AutoModelForMaskGeneration:()=>af,AutoModelForMaskedLM:()=>Jm,AutoModelForNormalEstimation:()=>_f,AutoModelForObjectDetection:()=>nf,AutoModelForPoseEstimation:()=>gf,AutoModelForQuestionAnswering:()=>Ym,AutoModelForSemanticSegmentation:()=>rf,AutoModelForSeq2SeqLM:()=>Km,AutoModelForSequenceClassification:()=>Wm,AutoModelForSpeechSeq2Seq:()=>Hm,AutoModelForTextToSpectrogram:()=>qm,AutoModelForTextToWaveform:()=>Qm,AutoModelForTokenClassification:()=>Gm,AutoModelForUniversalSegmentation:()=>sf,AutoModelForVision2Seq:()=>Zm,AutoModelForXVector:()=>cf,AutoModelForZeroShotObjectDetection:()=>of,BartForConditionalGeneration:()=>Ut,BartForSequenceClassification:()=>mr,BartModel:()=>Jt,BartPretrainedModel:()=>At,BaseModelOutput:()=>we,BeitForImageClassification:()=>Pd,BeitModel:()=>Ed,BeitPreTrainedModel:()=>Va,BertForMaskedLM:()=>$e,BertForQuestionAnswering:()=>He,BertForSequenceClassification:()=>Fe,BertForTokenClassification:()=>Be,BertModel:()=>Pe,BertPreTrainedModel:()=>Se,BlenderbotForConditionalGeneration:()=>Dr,BlenderbotModel:()=>fr,BlenderbotPreTrainedModel:()=>Kt,BlenderbotSmallForConditionalGeneration:()=>kr,BlenderbotSmallModel:()=>qr,BlenderbotSmallPreTrainedModel:()=>Hr,BloomForCausalLM:()=>qc,BloomModel:()=>Hc,BloomPreTrainedModel:()=>ka,CLIPModel:()=>Mi,CLIPPreTrainedModel:()=>Ls,CLIPSegForImageSegmentation:()=>xo,CLIPSegModel:()=>vo,CLIPSegPreTrainedModel:()=>Vn,CLIPTextModel:()=>ba,CLIPTextModelWithProjection:()=>yi,CLIPVisionModel:()=>Ma,CLIPVisionModelWithProjection:()=>vi,CamembertForMaskedLM:()=>rt,CamembertForQuestionAnswering:()=>wr,CamembertForSequenceClassification:()=>Bt,CamembertForTokenClassification:()=>Ht,CamembertModel:()=>lt,CamembertPreTrainedModel:()=>ht,CausalLMOutput:()=>bn,CausalLMOutputWithPast:()=>dv,ChineseCLIPModel:()=>Nn,ChineseCLIPPreTrainedModel:()=>Ti,ClapAudioModelWithProjection:()=>Ph,ClapModel:()=>Th,ClapPreTrainedModel:()=>Fi,ClapTextModelWithProjection:()=>Eh,CodeGenForCausalLM:()=>Hn,CodeGenModel:()=>gn,CodeGenPreTrainedModel:()=>Kn,CohereForCausalLM:()=>Sc,CohereModel:()=>Cc,CoherePreTrainedModel:()=>ya,ConvBertForMaskedLM:()=>Zr,ConvBertForQuestionAnswering:()=>B,ConvBertForSequenceClassification:()=>D,ConvBertForTokenClassification:()=>oe,ConvBertModel:()=>bt,ConvBertPreTrainedModel:()=>or,ConvNextForImageClassification:()=>Mp,ConvNextModel:()=>bp,ConvNextPreTrainedModel:()=>sl,ConvNextV2ForImageClassification:()=>vp,ConvNextV2Model:()=>yp,ConvNextV2PreTrainedModel:()=>nl,DFineForObjectDetection:()=>Rd,DFineModel:()=>Bd,DFinePreTrainedModel:()=>qa,DPTForDepthEstimation:()=>tp,DPTModel:()=>ep,DPTPreTrainedModel:()=>el,DacDecoderModel:()=>mm,DacDecoderOutput:()=>dm,DacEncoderModel:()=>hm,DacEncoderOutput:()=>cm,DacModel:()=>pm,DacPreTrainedModel:()=>ji,DebertaForMaskedLM:()=>es,DebertaForQuestionAnswering:()=>Cs,DebertaForSequenceClassification:()=>ds,DebertaForTokenClassification:()=>ts,DebertaModel:()=>Or,DebertaPreTrainedModel:()=>Xt,DebertaV2ForMaskedLM:()=>Kr,DebertaV2ForQuestionAnswering:()=>ks,DebertaV2ForSequenceClassification:()=>ps,DebertaV2ForTokenClassification:()=>$s,DebertaV2Model:()=>Ss,DebertaV2PreTrainedModel:()=>jr,DecisionTransformerModel:()=>Hh,DecisionTransformerPreTrainedModel:()=>Kh,DeiTForImageClassification:()=>Wd,DeiTModel:()=>Ud,DeiTPreTrainedModel:()=>Xa,DepthAnythingForDepthEstimation:()=>sp,DepthAnythingPreTrainedModel:()=>rp,DepthProForDepthEstimation:()=>lp,DepthProPreTrainedModel:()=>ap,DetrForObjectDetection:()=>Sd,DetrForSegmentation:()=>Ua,DetrModel:()=>Cd,DetrObjectDetectionOutput:()=>Wa,DetrPreTrainedModel:()=>Ci,DetrSegmentationOutput:()=>$d,Dinov2ForImageClassification:()=>Tp,Dinov2Model:()=>xp,Dinov2PreTrainedModel:()=>ol,Dinov2WithRegistersForImageClassification:()=>Pp,Dinov2WithRegistersModel:()=>Ep,Dinov2WithRegistersPreTrainedModel:()=>il,DistilBertForMaskedLM:()=>Ae,DistilBertForQuestionAnswering:()=>zr,DistilBertForSequenceClassification:()=>Tr,DistilBertForTokenClassification:()=>hs,DistilBertModel:()=>Is,DistilBertPreTrainedModel:()=>ir,DonutSwinModel:()=>wp,DonutSwinPreTrainedModel:()=>gp,EfficientNetForImageClassification:()=>Fh,EfficientNetModel:()=>Ah,EfficientNetPreTrainedModel:()=>_l,ElectraForMaskedLM:()=>Oe,ElectraForQuestionAnswering:()=>Ft,ElectraForSequenceClassification:()=>ve,ElectraForTokenClassification:()=>yt,ElectraModel:()=>me,ElectraPreTrainedModel:()=>te,EsmForMaskedLM:()=>Rt,EsmForSequenceClassification:()=>rs,EsmForTokenClassification:()=>ss,EsmModel:()=>it,EsmPreTrainedModel:()=>Je,ExaoneForCausalLM:()=>N,ExaoneModel:()=>L,ExaonePreTrainedModel:()=>I,FalconForCausalLM:()=>xh,FalconModel:()=>vh,FalconPreTrainedModel:()=>hl,FastViTForImageClassification:()=>md,FastViTModel:()=>hd,FastViTPreTrainedModel:()=>za,Florence2ForConditionalGeneration:()=>_i,Florence2PreTrainedModel:()=>fo,GLPNForDepthEstimation:()=>_p,GLPNModel:()=>fp,GLPNPreTrainedModel:()=>rl,GPT2LMHeadModel:()=>Po,GPT2Model:()=>Eo,GPT2PreTrainedModel:()=>To,GPTBigCodeForCausalLM:()=>Io,GPTBigCodeModel:()=>ko,GPTBigCodePreTrainedModel:()=>_n,GPTJForCausalLM:()=>$o,GPTJModel:()=>So,GPTJPreTrainedModel:()=>Gn,GPTNeoForCausalLM:()=>mn,GPTNeoModel:()=>Co,GPTNeoPreTrainedModel:()=>Un,GPTNeoXForCausalLM:()=>Wn,GPTNeoXModel:()=>fn,GPTNeoXPreTrainedModel:()=>Wr,Gemma2ForCausalLM:()=>Ac,Gemma2Model:()=>Ic,Gemma2PreTrainedModel:()=>xa,Gemma3ForCausalLM:()=>Oc,Gemma3Model:()=>Fc,Gemma3PreTrainedModel:()=>Ta,GemmaForCausalLM:()=>kc,GemmaModel:()=>$c,GemmaPreTrainedModel:()=>va,GlmForCausalLM:()=>T,GlmModel:()=>h,GlmPreTrainedModel:()=>Qn,GraniteForCausalLM:()=>Pc,GraniteModel:()=>Pi,GranitePreTrainedModel:()=>Os,GroundingDinoForObjectDetection:()=>Sp,GroundingDinoPreTrainedModel:()=>Cp,GroupViTModel:()=>pd,GroupViTPreTrainedModel:()=>dd,HeliumForCausalLM:()=>Do,HeliumModel:()=>Oo,HeliumPreTrainedModel:()=>qn,HieraForImageClassification:()=>Kd,HieraModel:()=>Gd,HieraPreTrainedModel:()=>Ja,HubertForCTC:()=>nh,HubertForSequenceClassification:()=>oh,HubertModel:()=>sh,HubertPreTrainedModel:()=>J0,IJepaForImageClassification:()=>rd,IJepaModel:()=>td,IJepaPreTrainedModel:()=>Oa,Idefics3ForConditionalGeneration:()=>hn,Idefics3PreTrainedModel:()=>jn,ImageMattingOutput:()=>vf,JAISLMHeadModel:()=>Ei,JAISModel:()=>ct,JAISPreTrainedModel:()=>qs,JinaCLIPModel:()=>bo,JinaCLIPPreTrainedModel:()=>Hs,JinaCLIPTextModel:()=>Mo,JinaCLIPVisionModel:()=>yo,LiteWhisperForConditionalGeneration:()=>po,LlamaForCausalLM:()=>Fo,LlamaModel:()=>Ao,LlamaPreTrainedModel:()=>wn,LlavaForConditionalGeneration:()=>pn,LlavaOnevisionForConditionalGeneration:()=>Ws,LlavaPreTrainedModel:()=>mo,LongT5ForConditionalGeneration:()=>We,LongT5Model:()=>Qe,LongT5PreTrainedModel:()=>Re,M2M100ForConditionalGeneration:()=>Bp,M2M100Model:()=>zp,M2M100PreTrainedModel:()=>ul,MBartForCausalLM:()=>fs,MBartForConditionalGeneration:()=>Pr,MBartForSequenceClassification:()=>Zt,MBartModel:()=>Er,MBartPreTrainedModel:()=>br,MPNetForMaskedLM:()=>sn,MPNetForQuestionAnswering:()=>an,MPNetForSequenceClassification:()=>nn,MPNetForTokenClassification:()=>on,MPNetModel:()=>rn,MPNetPreTrainedModel:()=>ms,MT5ForConditionalGeneration:()=>Ot,MT5Model:()=>_t,MT5PreTrainedModel:()=>Ye,MarianMTModel:()=>Lp,MarianModel:()=>Dp,MarianPreTrainedModel:()=>ll,MaskFormerForInstanceSegmentation:()=>mp,MaskFormerModel:()=>hp,MaskFormerPreTrainedModel:()=>tl,MaskedLMOutput:()=>Ar,Metric3DForDepthEstimation:()=>cp,Metric3DPreTrainedModel:()=>up,Metric3Dv2ForDepthEstimation:()=>pp,Metric3Dv2PreTrainedModel:()=>dp,MgpstrForSceneTextRecognition:()=>Yh,MgpstrModelOutput:()=>Xh,MgpstrPreTrainedModel:()=>Jh,MimiDecoderModel:()=>um,MimiDecoderOutput:()=>im,MimiEncoderModel:()=>lm,MimiEncoderOutput:()=>om,MimiModel:()=>am,MimiPreTrainedModel:()=>Ri,MistralForCausalLM:()=>bh,MistralModel:()=>wh,MistralPreTrainedModel:()=>dl,MobileBertForMaskedLM:()=>cr,MobileBertForQuestionAnswering:()=>os,MobileBertForSequenceClassification:()=>hr,MobileBertModel:()=>ns,MobileBertPreTrainedModel:()=>ur,MobileLLMForCausalLM:()=>Le,MobileLLMModel:()=>Te,MobileLLMPreTrainedModel:()=>ue,MobileNetV1ForImageClassification:()=>Dh,MobileNetV1ForSemanticSegmentation:()=>Lh,MobileNetV1Model:()=>Oh,MobileNetV1PreTrainedModel:()=>Di,MobileNetV2ForImageClassification:()=>Bh,MobileNetV2ForSemanticSegmentation:()=>Rh,MobileNetV2Model:()=>zh,MobileNetV2PreTrainedModel:()=>Li,MobileNetV3ForImageClassification:()=>Nh,MobileNetV3ForSemanticSegmentation:()=>Vh,MobileNetV3Model:()=>jh,MobileNetV3PreTrainedModel:()=>zi,MobileNetV4ForImageClassification:()=>Wh,MobileNetV4ForSemanticSegmentation:()=>Gh,MobileNetV4Model:()=>Uh,MobileNetV4PreTrainedModel:()=>Bi,MobileViTForImageClassification:()=>wd,MobileViTModel:()=>gd,MobileViTPreTrainedModel:()=>Ba,MobileViTV2ForImageClassification:()=>Md,MobileViTV2Model:()=>bd,MobileViTV2PreTrainedModel:()=>Ra,ModelOutput:()=>be,ModernBertForMaskedLM:()=>Ve,ModernBertForSequenceClassification:()=>Ze,ModernBertForTokenClassification:()=>st,ModernBertModel:()=>ke,ModernBertPreTrainedModel:()=>qe,Moondream1ForConditionalGeneration:()=>fi,MoonshineForConditionalGeneration:()=>mi,MoonshineModel:()=>hi,MoonshinePreTrainedModel:()=>Rn,MptForCausalLM:()=>Xc,MptModel:()=>Qc,MptPreTrainedModel:()=>Ia,MultiModalityCausalLM:()=>Qh,MultiModalityPreTrainedModel:()=>qh,MusicgenForCausalLM:()=>tv,MusicgenForConditionalGeneration:()=>wl,MusicgenModel:()=>ev,MusicgenPreTrainedModel:()=>gl,NomicBertModel:()=>Ge,NomicBertPreTrainedModel:()=>at,OPTForCausalLM:()=>Yc,OPTModel:()=>Jc,OPTPreTrainedModel:()=>Aa,Olmo2ForCausalLM:()=>yr,Olmo2Model:()=>Wt,Olmo2PreTrainedModel:()=>kt,OlmoForCausalLM:()=>Mt,OlmoModel:()=>et,OlmoPreTrainedModel:()=>Ke,OpenELMForCausalLM:()=>Lc,OpenELMModel:()=>Dc,OpenELMPreTrainedModel:()=>Ea,OwlViTForObjectDetection:()=>vd,OwlViTModel:()=>yd,OwlViTPreTrainedModel:()=>ja,Owlv2ForObjectDetection:()=>Td,Owlv2Model:()=>xd,Owlv2PreTrainedModel:()=>Na,PaliGemmaForConditionalGeneration:()=>wi,PaliGemmaPreTrainedModel:()=>gi,PatchTSMixerForPrediction:()=>rm,PatchTSMixerModel:()=>tm,PatchTSMixerPreTrainedModel:()=>Ml,PatchTSTForPrediction:()=>em,PatchTSTModel:()=>Zh,PatchTSTPreTrainedModel:()=>bl,Phi3ForCausalLM:()=>Kc,Phi3Model:()=>Gc,Phi3PreTrainedModel:()=>$a,Phi3VForCausalLM:()=>go,Phi3VPreTrainedModel:()=>bi,PhiForCausalLM:()=>Wc,PhiModel:()=>Uc,PhiPreTrainedModel:()=>Sa,PreTrainedModel:()=>G,PretrainedMixin:()=>Dt,PvtForImageClassification:()=>id,PvtModel:()=>od,PvtPreTrainedModel:()=>Da,PyAnnoteForAudioFrameClassification:()=>Wp,PyAnnoteModel:()=>Up,PyAnnotePreTrainedModel:()=>cl,QuestionAnsweringModelOutput:()=>Br,Qwen2ForCausalLM:()=>Bc,Qwen2Model:()=>zc,Qwen2PreTrainedModel:()=>Pa,Qwen2VLForConditionalGeneration:()=>Vc,Qwen2VLPreTrainedModel:()=>Nc,Qwen3ForCausalLM:()=>jc,Qwen3Model:()=>Rc,Qwen3PreTrainedModel:()=>Ca,RFDetrForObjectDetection:()=>Ld,RFDetrModel:()=>Dd,RFDetrObjectDetectionOutput:()=>zd,RFDetrPreTrainedModel:()=>Ha,RTDetrForObjectDetection:()=>Id,RTDetrModel:()=>kd,RTDetrObjectDetectionOutput:()=>Lo,RTDetrPreTrainedModel:()=>Ga,RTDetrV2ForObjectDetection:()=>Fd,RTDetrV2Model:()=>Ad,RTDetrV2ObjectDetectionOutput:()=>Od,RTDetrV2PreTrainedModel:()=>Ka,ResNetForImageClassification:()=>qd,ResNetModel:()=>Hd,ResNetPreTrainedModel:()=>Ya,RoFormerForMaskedLM:()=>St,RoFormerForQuestionAnswering:()=>gr,RoFormerForSequenceClassification:()=>Vt,RoFormerForTokenClassification:()=>zt,RoFormerModel:()=>pt,RoFormerPreTrainedModel:()=>Ie,RobertaForMaskedLM:()=>er,RobertaForQuestionAnswering:()=>Ir,RobertaForSequenceClassification:()=>dr,RobertaForTokenClassification:()=>pr,RobertaModel:()=>Mr,RobertaPreTrainedModel:()=>Lr,SamImageSegmentationOutput:()=>Op,SamModel:()=>Fp,SamPreTrainedModel:()=>Ap,SapiensForDepthEstimation:()=>op,SapiensForNormalEstimation:()=>ip,SapiensForSemanticSegmentation:()=>np,SapiensPreTrainedModel:()=>$i,SegformerForImageClassification:()=>Sh,SegformerForSemanticSegmentation:()=>$h,SegformerModel:()=>Z0,SegformerPreTrainedModel:()=>Oi,Seq2SeqLMOutput:()=>cv,SequenceClassifierOutput:()=>vt,SiglipModel:()=>Ks,SiglipPreTrainedModel:()=>Gs,SiglipTextModel:()=>wo,SiglipVisionModel:()=>xi,SmolVLMForConditionalGeneration:()=>_o,SnacDecoderModel:()=>gm,SnacEncoderModel:()=>_m,SnacModel:()=>fm,SnacPreTrainedModel:()=>Ni,SpeechT5ForSpeechToText:()=>hh,SpeechT5ForTextToSpeech:()=>mh,SpeechT5HifiGan:()=>fh,SpeechT5Model:()=>Y0,SpeechT5PreTrainedModel:()=>Ai,SqueezeBertForMaskedLM:()=>ln,SqueezeBertForQuestionAnswering:()=>cn,SqueezeBertForSequenceClassification:()=>un,SqueezeBertModel:()=>Vs,SqueezeBertPreTrainedModel:()=>As,StableLmForCausalLM:()=>Ih,StableLmModel:()=>kh,StableLmPreTrainedModel:()=>fl,Starcoder2ForCausalLM:()=>yh,Starcoder2Model:()=>Mh,Starcoder2PreTrainedModel:()=>pl,StyleTextToSpeech2Model:()=>ph,StyleTextToSpeech2PreTrainedModel:()=>dh,Swin2SRForImageSuperResolution:()=>Zd,Swin2SRModel:()=>Yd,Swin2SRPreTrainedModel:()=>Za,SwinForImageClassification:()=>Xd,SwinForSemanticSegmentation:()=>Jd,SwinModel:()=>Qd,SwinPreTrainedModel:()=>Si,T5ForConditionalGeneration:()=>xe,T5Model:()=>ce,T5PreTrainedModel:()=>ie,TableTransformerForObjectDetection:()=>Nd,TableTransformerModel:()=>jd,TableTransformerObjectDetectionOutput:()=>Vd,TableTransformerPreTrainedModel:()=>Qa,TokenClassifierOutput:()=>Cr,TrOCRForCausalLM:()=>gh,TrOCRPreTrainedModel:()=>_h,UltravoxModel:()=>nm,UltravoxPreTrainedModel:()=>sm,UniSpeechForCTC:()=>qp,UniSpeechForSequenceClassification:()=>Qp,UniSpeechModel:()=>Hp,UniSpeechPreTrainedModel:()=>ki,UniSpeechSatForAudioFrameClassification:()=>Zp,UniSpeechSatForCTC:()=>Jp,UniSpeechSatForSequenceClassification:()=>Yp,UniSpeechSatModel:()=>Xp,UniSpeechSatPreTrainedModel:()=>zo,ViTForImageClassification:()=>ed,ViTMAEModel:()=>ld,ViTMAEPreTrainedModel:()=>ad,ViTMSNForImageClassification:()=>cd,ViTMSNModel:()=>ud,ViTMSNPreTrainedModel:()=>La,ViTModel:()=>Zc,ViTPreTrainedModel:()=>Fa,VisionEncoderDecoderModel:()=>ho,VitMatteForImageMatting:()=>_d,VitMattePreTrainedModel:()=>fd,VitPoseForPoseEstimation:()=>nd,VitPosePreTrainedModel:()=>sd,VitsModel:()=>ml,VitsModelOutput:()=>xf,VitsPreTrainedModel:()=>Ch,Wav2Vec2BertForCTC:()=>th,Wav2Vec2BertForSequenceClassification:()=>rh,Wav2Vec2BertModel:()=>eh,Wav2Vec2BertPreTrainedModel:()=>Ii,Wav2Vec2ForAudioFrameClassification:()=>Vp,Wav2Vec2ForCTC:()=>jp,Wav2Vec2ForSequenceClassification:()=>Np,Wav2Vec2Model:()=>Rp,Wav2Vec2PreTrainedModel:()=>Qs,WavLMForAudioFrameClassification:()=>ch,WavLMForCTC:()=>ah,WavLMForSequenceClassification:()=>lh,WavLMForXVector:()=>uh,WavLMModel:()=>ih,WavLMPreTrainedModel:()=>Xn,WeSpeakerResNetModel:()=>Kp,WeSpeakerResNetPreTrainedModel:()=>Gp,WhisperForConditionalGeneration:()=>co,WhisperModel:()=>pi,WhisperPreTrainedModel:()=>uo,XLMForQuestionAnswering:()=>ao,XLMForSequenceClassification:()=>si,XLMForTokenClassification:()=>ni,XLMModel:()=>dn,XLMPreTrainedModel:()=>is,XLMRobertaForMaskedLM:()=>ii,XLMRobertaForQuestionAnswering:()=>ui,XLMRobertaForSequenceClassification:()=>ai,XLMRobertaForTokenClassification:()=>li,XLMRobertaModel:()=>oi,XLMRobertaPreTrainedModel:()=>Us,XLMWithLMHeadModel:()=>ri,XVectorOutput:()=>yf,YolosForObjectDetection:()=>kp,YolosModel:()=>$p,YolosObjectDetectionOutput:()=>Ip,YolosPreTrainedModel:()=>al});var s=t("./src/configs.js"),o=t("./src/backends/onnx.js"),n=t("./src/utils/dtypes.js"),i=t("./src/utils/generic.js"),a=t("./src/utils/core.js"),l=t("./src/utils/hub.js"),u=t("./src/utils/constants.js"),p=t("./src/generation/logits_process.js"),c=t("./src/generation/configuration_utils.js"),d=t("./src/utils/tensor.js"),_=t("./src/utils/image.js"),f=t("./src/utils/maths.js"),v=t("./src/generation/stopping_criteria.js"),$=t("./src/generation/logits_sampler.js"),g=t("./src/env.js"),w=t("./src/models/whisper/generation_whisper.js"),C=t("./src/models/whisper/common_whisper.js");const E={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11},x=new Map,b=new Map,y=new Map;async function S(M,P,O){var Sr;let ne=((Sr=O.config)==null?void 0:Sr["transformers.js_config"])??{},ge=O.device??ne.device;ge&&typeof ge!="string"&&(ge.hasOwnProperty(P)?ge=ge[P]:(console.warn(`device not specified for "${P}". Using the default device.`),ge=null));const he=ge??(g.apis.IS_NODE_ENV?"cpu":"wasm"),Ee=(0,o.deviceToExecutionProviders)(he),De=ne.device_config??{};De.hasOwnProperty(he)&&(ne={...ne,...De[he]});let Ne=O.dtype??ne.dtype;if(typeof Ne!="string"&&(Ne&&Ne.hasOwnProperty(P)?Ne=Ne[P]:(Ne=n.DEFAULT_DEVICE_DTYPE_MAPPING[he]??n.DATA_TYPES.fp32,console.warn(`dtype not specified for "${P}". Using the default dtype (${Ne}) for this device (${he}).`))),Ne===n.DATA_TYPES.auto){let Ct=ne.dtype;typeof Ct!="string"&&(Ct=Ct==null?void 0:Ct[P]),Ct&&Ct!==n.DATA_TYPES.auto&&n.DATA_TYPES.hasOwnProperty(Ct)?Ne=Ct:Ne=n.DEFAULT_DEVICE_DTYPE_MAPPING[he]??n.DATA_TYPES.fp32}const Xe=Ne;if(n.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(Xe)){if(Xe===n.DATA_TYPES.fp16&&he==="webgpu"&&!await(0,n.isWebGpuFp16Supported)())throw new Error(`The device (${he}) does not support fp16.`)}else throw new Error(`Invalid dtype: ${Xe}. Should be one of: ${Object.keys(n.DATA_TYPES).join(", ")}`);const mt=ne.kv_cache_dtype,wt=mt?typeof mt=="string"?mt:mt[Xe]??"float32":void 0;if(wt&&!["float32","float16"].includes(wt))throw new Error(`Invalid kv_cache_dtype: ${wt}. Should be one of: float32, float16`);const dt={dtype:Xe,kv_cache_dtype:wt,device:he},Pt=n.DEFAULT_DTYPE_SUFFIX_MAPPING[Xe],gt=`${P}${Pt}.onnx`,Et=`${O.subfolder??""}/${gt}`,nt={...O.session_options};nt.executionProviders??(nt.executionProviders=Ee);const $t=ne.free_dimension_overrides;$t?nt.freeDimensionOverrides??(nt.freeDimensionOverrides=$t):he.startsWith("webnn")&&!nt.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${he}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);const qt=g.apis.IS_NODE_ENV&&g.env.useFSCache,tr=(0,l.getModelFile)(M,Et,!0,O,qt),ar=O.use_external_data_format??ne.use_external_data_format;let sr=[];if(ar){let Ct;typeof ar=="object"?ar.hasOwnProperty(gt)?Ct=ar[gt]:ar.hasOwnProperty(P)?Ct=ar[P]:Ct=!1:Ct=ar;const vr=+Ct;if(vr>l.MAX_EXTERNAL_DATA_CHUNKS)throw new Error(`The number of external data chunks (${vr}) exceeds the maximum allowed value (${l.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let Qr=0;Qr{const yn=await(0,l.getModelFile)(M,Nr,!0,O,qt);as(yn instanceof Uint8Array?{path:Mn,data:yn}:Mn)}))}}else nt.externalData!==void 0&&(sr=nt.externalData.map(async Ct=>{if(typeof Ct.data=="string"){const vr=await(0,l.getModelFile)(M,Ct.data,!0,O);return{...Ct,data:vr}}return Ct}));if(sr.length>0){const Ct=await Promise.all(sr);g.apis.IS_NODE_ENV||(nt.externalData=Ct)}if(he==="webgpu"){const Ct=(0,s.getKeyValueShapes)(O.config,{prefix:"present"});if(Object.keys(Ct).length>0&&!(0,o.isONNXProxy)()){const vr={};for(const Qr in Ct)vr[Qr]="gpu-buffer";nt.preferredOutputLocation=vr}}return{buffer_or_path:await tr,session_options:nt,session_config:dt}}async function F(M,P,O){return Object.fromEntries(await Promise.all(Object.keys(P).map(async ne=>{const{buffer_or_path:ge,session_options:he,session_config:Ee}=await S(M,P[ne],O),De=await(0,o.createInferenceSession)(ge,he,Ee);return[ne,De]})))}async function z(M,P,O){return Object.fromEntries(await Promise.all(Object.keys(P).map(async ne=>{const ge=await(0,l.getModelJSON)(M,P[ne],!1,O);return[ne,ge]})))}function K(M,P){const O=Object.create(null),ne=[];for(const Ee of M.inputNames){const De=P[Ee];if(!(De instanceof d.Tensor)){ne.push(Ee);continue}O[Ee]=(0,o.isONNXProxy)()?De.clone():De}if(ne.length>0)throw new Error(`An error occurred during model execution: "Missing the following inputs: ${ne.join(", ")}.`);const ge=Object.keys(P).length,he=M.inputNames.length;if(ge>he){let Ee=Object.keys(P).filter(De=>!M.inputNames.includes(De));console.warn(`WARNING: Too many inputs were provided (${ge} > ${he}). The following inputs will be ignored: "${Ee.join(", ")}".`)}return O}let q=Promise.resolve();async function R(M,P){const O=K(M,P);try{const ne=Object.fromEntries(Object.entries(O).map(([Ee,De])=>[Ee,De.ort_tensor])),ge=()=>M.run(ne),he=await(g.apis.IS_BROWSER_ENV||g.apis.IS_WEBWORKER_ENV?q=q.then(ge):ge());return Z(he)}catch(ne){const ge=Object.fromEntries(Object.entries(O).map(([he,Ee])=>{const De={type:Ee.type,dims:Ee.dims,location:Ee.location};return De.location!=="gpu-buffer"&&(De.data=Ee.data),[he,De]}));throw console.error(`An error occurred during model execution: "${ne}".`),console.error("Inputs given to model:",ge),ne}}function Z(M){for(let P in M)(0,o.isONNXTensor)(M[P])?M[P]=new d.Tensor(M[P]):typeof M[P]=="object"&&Z(M[P]);return M}function H(M){if(M instanceof d.Tensor)return M;if(M.length===0)throw Error("items must be non-empty");if(Array.isArray(M[0])){if(M.some(P=>P.length!==M[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new d.Tensor("int64",BigInt64Array.from(M.flat().map(P=>BigInt(P))),[M.length,M[0].length])}else return new d.Tensor("int64",BigInt64Array.from(M.map(P=>BigInt(P))),[1,M.length])}function J(M){return new d.Tensor("bool",[M],[1])}async function Q(M,P){let{encoder_outputs:O,input_ids:ne,decoder_input_ids:ge,...he}=P;if(!O){const De=(0,a.pick)(P,M.sessions.model.inputNames);O=(await se(M,De)).last_hidden_state}return he.input_ids=ge,he.encoder_hidden_states=O,M.sessions.decoder_model_merged.inputNames.includes("encoder_attention_mask")&&(he.encoder_attention_mask=P.attention_mask),await ae(M,he,!0)}async function se(M,P){const O=M.sessions.model,ne=(0,a.pick)(P,O.inputNames);if(O.inputNames.includes("inputs_embeds")&&!ne.inputs_embeds){if(!P.input_ids)throw new Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");ne.inputs_embeds=await M.encode_text({input_ids:P.input_ids})}if(O.inputNames.includes("token_type_ids")&&!ne.token_type_ids){if(!ne.input_ids)throw new Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");ne.token_type_ids=(0,d.zeros_like)(ne.input_ids)}if(O.inputNames.includes("pixel_mask")&&!ne.pixel_mask){if(!ne.pixel_values)throw new Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");const ge=ne.pixel_values.dims;ne.pixel_mask=(0,d.ones)([ge[0],ge[2],ge[3]])}return await R(O,ne)}async function fe(M,P){const O=await M.encode(P);return await M.decode(O)}async function ae(M,P,O=!1){const ne=M.sessions[O?"decoder_model_merged":"model"],{past_key_values:ge,...he}=P;if(ne.inputNames.includes("use_cache_branch")&&(he.use_cache_branch=J(!!ge)),ne.inputNames.includes("position_ids")&&he.attention_mask&&!he.position_ids){const De=["paligemma","gemma3_text","gemma3"].includes(M.config.model_type)?1:0;he.position_ids=ze(he,ge,De)}M.addPastKeyValues(he,ge);const Ee=(0,a.pick)(he,ne.inputNames);return await R(ne,Ee)}function V({modality_token_id:M,inputs_embeds:P,modality_features:O,input_ids:ne,attention_mask:ge}){const he=ne.tolist().map(Xe=>Xe.reduce((mt,wt,dt)=>(wt==M&&mt.push(dt),mt),[])),Ee=he.reduce((Xe,mt)=>Xe+mt.length,0),De=O.dims[0];if(Ee!==De)throw new Error(`Number of tokens and features do not match: tokens: ${Ee}, features ${De}`);let Ne=0;for(let Xe=0;Xehe.dims[1])){if(geDe==M.config.image_token_index)){const De=M.config.num_image_tokens;if(!De)throw new Error("`num_image_tokens` is missing in the model configuration.");const Ne=he.dims[1]-(ge-De);O.input_ids=he.slice(null,[-Ne,null]),O.attention_mask=(0,d.ones)([1,ge+Ne])}}}return O}function pe(M,P,O,ne){return O.past_key_values&&(P=P.map(ge=>[ge.at(-1)])),{...O,decoder_input_ids:H(P)}}function W(M,...P){return M.config.is_encoder_decoder?pe(M,...P):Ue(M,...P)}function re(M,P,O,ne){const ge=!!O.past_key_values;return ne.guidance_scale!==null&&ne.guidance_scale>1&&(ge?O.input_ids=(0,d.cat)([O.input_ids,O.input_ids],0):(O.input_ids=(0,d.cat)([O.input_ids,(0,d.full_like)(O.input_ids,BigInt(ne.pad_token_id))],0),O.attention_mask=(0,d.cat)([O.attention_mask,(0,d.full_like)(O.attention_mask,0n)],0))),(ge||!O.pixel_values)&&(O.pixel_values=(0,d.full)([0,0,3,384,384],1)),ge&&(O.images_seq_mask=new d.Tensor("bool",new Array(1).fill(!0).fill(!1,0,1),[1,1]),O.images_emb_mask=new d.Tensor("bool",new Array(0).fill(!1),[1,1,0])),O}class G extends i.Callable{constructor(O,ne,ge){super();Y(this,"main_input_name","input_ids");Y(this,"forward_params",["input_ids","attention_mask"]);this.config=O,this.sessions=ne,this.configs=ge;const he=y.get(this.constructor),Ee=x.get(he);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,Ee){case E.DecoderOnly:this.can_generate=!0,this._forward=ae,this._prepare_inputs_for_generation=Ue;break;case E.Seq2Seq:case E.Vision2Seq:case E.Musicgen:this.can_generate=!0,this._forward=Q,this._prepare_inputs_for_generation=pe;break;case E.EncoderDecoder:this._forward=Q;break;case E.ImageTextToText:this.can_generate=!0,this._forward=le,this._prepare_inputs_for_generation=W;break;case E.AudioTextToText:this.can_generate=!0,this._forward=_e,this._prepare_inputs_for_generation=W;break;case E.Phi3V:this.can_generate=!0,this._prepare_inputs_for_generation=W;break;case E.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=re;break;case E.AutoEncoder:this._forward=fe;break;default:this._forward=se;break}this.can_generate&&this.forward_params.push("past_key_values"),this.custom_config=this.config["transformers.js_config"]??{}}async dispose(){var ne;const O=[];for(const ge of Object.values(this.sessions))(ne=ge==null?void 0:ge.handler)!=null&&ne.dispose&&O.push(ge.handler.dispose());return await Promise.all(O)}static async from_pretrained(O,{progress_callback:ne=null,config:ge=null,cache_dir:he=null,local_files_only:Ee=!1,revision:De="main",model_file_name:Ne=null,subfolder:Xe="onnx",device:mt=null,dtype:wt=null,use_external_data_format:dt=null,session_options:Pt={}}={}){let gt={progress_callback:ne,config:ge,cache_dir:he,local_files_only:Ee,revision:De,model_file_name:Ne,subfolder:Xe,device:mt,dtype:wt,use_external_data_format:dt,session_options:Pt};const Et=y.get(this),nt=x.get(Et);ge=gt.config=await s.AutoConfig.from_pretrained(O,gt);let $t;if(nt===E.DecoderOnly)$t=await Promise.all([F(O,{model:gt.model_file_name??"model"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(nt===E.Seq2Seq||nt===E.Vision2Seq)$t=await Promise.all([F(O,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(nt===E.MaskGeneration)$t=await Promise.all([F(O,{model:"vision_encoder",prompt_encoder_mask_decoder:"prompt_encoder_mask_decoder"},gt)]);else if(nt===E.EncoderDecoder)$t=await Promise.all([F(O,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},gt)]);else if(nt===E.ImageTextToText){const qt={embed_tokens:"embed_tokens",vision_encoder:"vision_encoder",decoder_model_merged:"decoder_model_merged"};ge.is_encoder_decoder&&(qt.model="encoder_model"),$t=await Promise.all([F(O,qt,gt),z(O,{generation_config:"generation_config.json"},gt)])}else if(nt===E.AudioTextToText){const qt={embed_tokens:"embed_tokens",audio_encoder:"audio_encoder",decoder_model_merged:"decoder_model_merged"};$t=await Promise.all([F(O,qt,gt),z(O,{generation_config:"generation_config.json"},gt)])}else if(nt===E.Musicgen)$t=await Promise.all([F(O,{model:"text_encoder",decoder_model_merged:"decoder_model_merged",encodec_decode:"encodec_decode"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(nt===E.MultiModality)$t=await Promise.all([F(O,{prepare_inputs_embeds:"prepare_inputs_embeds",model:"language_model",lm_head:"lm_head",gen_head:"gen_head",gen_img_embeds:"gen_img_embeds",image_decode:"image_decode"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(nt===E.Phi3V)$t=await Promise.all([F(O,{prepare_inputs_embeds:"prepare_inputs_embeds",model:"model",vision_encoder:"vision_encoder"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(nt===E.AutoEncoder)$t=await Promise.all([F(O,{encoder_model:"encoder_model",decoder_model:"decoder_model"},gt)]);else{if(nt!==E.EncoderOnly){const qt=Et??(ge==null?void 0:ge.model_type);qt!=="custom"&&console.warn(`Model type for '${qt}' not found, assuming encoder-only architecture. Please report this at ${u.GITHUB_ISSUE_URL}.`)}$t=await Promise.all([F(O,{model:gt.model_file_name??"model"},gt)])}return new this(ge,...$t)}async _call(O){return await this.forward(O)}async forward(O){return await this._forward(this,O)}get generation_config(){var O;return((O=this.configs)==null?void 0:O.generation_config)??null}_get_logits_warper(O){const ne=new p.LogitsProcessorList;return O.temperature!==null&&O.temperature!==1&&ne.push(new p.TemperatureLogitsWarper(O.temperature)),O.top_k!==null&&O.top_k!==0&&ne.push(new p.TopKLogitsWarper(O.top_k)),O.top_p!==null&&O.top_p<1&&ne.push(new p.TopPLogitsWarper(O.top_p)),ne}_get_logits_processor(O,ne,ge=null){const he=new p.LogitsProcessorList;if(O.repetition_penalty!==null&&O.repetition_penalty!==1&&he.push(new p.RepetitionPenaltyLogitsProcessor(O.repetition_penalty)),O.no_repeat_ngram_size!==null&&O.no_repeat_ngram_size>0&&he.push(new p.NoRepeatNGramLogitsProcessor(O.no_repeat_ngram_size)),O.bad_words_ids!==null&&he.push(new p.NoBadWordsLogitsProcessor(O.bad_words_ids,O.eos_token_id)),O.min_length!==null&&O.eos_token_id!==null&&O.min_length>0&&he.push(new p.MinLengthLogitsProcessor(O.min_length,O.eos_token_id)),O.min_new_tokens!==null&&O.eos_token_id!==null&&O.min_new_tokens>0&&he.push(new p.MinNewTokensLengthLogitsProcessor(ne,O.min_new_tokens,O.eos_token_id)),O.forced_bos_token_id!==null&&he.push(new p.ForcedBOSTokenLogitsProcessor(O.forced_bos_token_id)),O.forced_eos_token_id!==null&&he.push(new p.ForcedEOSTokenLogitsProcessor(O.max_length,O.forced_eos_token_id)),O.begin_suppress_tokens!==null){const Ee=ne>1||O.forced_bos_token_id===null?ne:ne+1;he.push(new p.SuppressTokensAtBeginLogitsProcessor(O.begin_suppress_tokens,Ee))}return O.guidance_scale!==null&&O.guidance_scale>1&&he.push(new p.ClassifierFreeGuidanceLogitsProcessor(O.guidance_scale)),ge!==null&&he.extend(ge),he}_prepare_generation_config(O,ne,ge=c.GenerationConfig){const he={...this.config};for(const De of["decoder","generator","text_config"])De in he&&Object.assign(he,he[De]);const Ee=new ge(he);return Object.assign(Ee,this.generation_config??{}),O&&Object.assign(Ee,O),ne&&Object.assign(Ee,(0,a.pick)(ne,Object.getOwnPropertyNames(Ee))),Ee}_get_stopping_criteria(O,ne=null){const ge=new v.StoppingCriteriaList;return O.max_length!==null&&ge.push(new v.MaxLengthCriteria(O.max_length,this.config.max_position_embeddings??null)),O.eos_token_id!==null&&ge.push(new v.EosTokenCriteria(O.eos_token_id)),ne&&ge.extend(ne),ge}_validate_model_class(){if(!this.can_generate){const O=[xl,Tl,vl,yl],ne=y.get(this.constructor),ge=new Set,he=this.config.model_type;for(const De of O){const Ne=De.get(he);Ne&&ge.add(Ne[0])}let Ee=`The current model class (${ne}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw ge.size>0&&(Ee+=` Please use the following class instead: ${[...ge].join(", ")}`),Error(Ee)}}prepare_inputs_for_generation(...O){return this._prepare_inputs_for_generation(this,...O)}_update_model_kwargs_for_generation({generated_input_ids:O,outputs:ne,model_inputs:ge,is_encoder_decoder:he}){return ge.past_key_values=this.getPastKeyValues(ne,ge.past_key_values),ge.input_ids=new d.Tensor("int64",O.flat(),[O.length,1]),he||(ge.attention_mask=(0,d.cat)([ge.attention_mask,(0,d.ones)([ge.attention_mask.dims[0],1])],1)),ge.position_ids=null,ge}_prepare_model_inputs({inputs:O,bos_token_id:ne,model_kwargs:ge}){const he=(0,a.pick)(ge,this.forward_params),Ee=this.main_input_name;if(Ee in he){if(O)throw new Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else he[Ee]=O;return{inputs_tensor:he[Ee],model_inputs:he,model_input_name:Ee}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:O,model_inputs:ne,model_input_name:ge,generation_config:he}){if(this.sessions.model.inputNames.includes("inputs_embeds")&&!ne.inputs_embeds&&"_prepare_inputs_embeds"in this){const{input_ids:De,pixel_values:Ne,attention_mask:Xe,...mt}=ne,wt=await this._prepare_inputs_embeds(ne);ne={...mt,...(0,a.pick)(wt,["inputs_embeds","attention_mask"])}}let{last_hidden_state:Ee}=await se(this,ne);if(he.guidance_scale!==null&&he.guidance_scale>1)Ee=(0,d.cat)([Ee,(0,d.full_like)(Ee,0)],0),"attention_mask"in ne&&(ne.attention_mask=(0,d.cat)([ne.attention_mask,(0,d.zeros_like)(ne.attention_mask)],0));else if(ne.decoder_input_ids){const De=H(ne.decoder_input_ids).dims[0];if(De!==Ee.dims[0]){if(Ee.dims[0]!==1)throw new Error(`The encoder outputs have a different batch size (${Ee.dims[0]}) than the decoder inputs (${De}).`);Ee=(0,d.cat)(Array.from({length:De},()=>Ee),0)}}return ne.encoder_outputs=Ee,ne}_prepare_decoder_input_ids_for_generation({batch_size:O,model_input_name:ne,model_kwargs:ge,decoder_start_token_id:he,bos_token_id:Ee,generation_config:De}){let{decoder_input_ids:Ne,...Xe}=ge;if(!(Ne instanceof d.Tensor)){if(Ne)Array.isArray(Ne[0])||(Ne=Array.from({length:O},()=>Ne));else if(he??(he=Ee),this.config.model_type==="musicgen")Ne=Array.from({length:O*this.config.decoder.num_codebooks},()=>[he]);else if(Array.isArray(he)){if(he.length!==O)throw new Error(`\`decoder_start_token_id\` expcted to have length ${O} but got ${he.length}`);Ne=he}else Ne=Array.from({length:O},()=>[he]);Ne=H(Ne)}return ge.decoder_attention_mask=(0,d.ones_like)(Ne),{input_ids:Ne,model_inputs:Xe}}async generate({inputs:O=null,generation_config:ne=null,logits_processor:ge=null,stopping_criteria:he=null,streamer:Ee=null,...De}){this._validate_model_class(),ne=this._prepare_generation_config(ne,De);let{inputs_tensor:Ne,model_inputs:Xe,model_input_name:mt}=this._prepare_model_inputs({inputs:O,model_kwargs:De});const wt=this.config.is_encoder_decoder;wt&&("encoder_outputs"in Xe||(Xe=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:Ne,model_inputs:Xe,model_input_name:mt,generation_config:ne})));let dt;wt?{input_ids:dt,model_inputs:Xe}=this._prepare_decoder_input_ids_for_generation({batch_size:Xe[mt].dims.at(0),model_input_name:mt,model_kwargs:Xe,decoder_start_token_id:ne.decoder_start_token_id,bos_token_id:ne.bos_token_id,generation_config:ne}):dt=Xe[mt];let Pt=dt.dims.at(-1);ne.max_new_tokens!==null&&(ne.max_length=Pt+ne.max_new_tokens);const gt=this._get_logits_processor(ne,Pt,ge),Et=this._get_stopping_criteria(ne,he),nt=Xe[mt].dims.at(0),$t=$.LogitsSampler.getSampler(ne),qt=new Array(nt).fill(0),tr=dt.tolist();Ee&&Ee.put(tr);let ar,sr={};for(;;){if(Xe=this.prepare_inputs_for_generation(tr,Xe,ne),ar=await this.forward(Xe),ne.output_attentions&&ne.return_dict_in_generate){const Nr=this.getAttentions(ar);for(const as in Nr)as in sr||(sr[as]=[]),sr[as].push(Nr[as])}const Ct=ar.logits.slice(null,-1,null),vr=gt(tr,Ct),Qr=[];for(let Nr=0;NrNr))break;Xe=this._update_model_kwargs_for_generation({generated_input_ids:Qr,outputs:ar,model_inputs:Xe,is_encoder_decoder:wt})}Ee&&Ee.end();const _r=this.getPastKeyValues(ar,Xe.past_key_values,!0),Sr=new d.Tensor("int64",tr.flat(),[tr.length,tr[0].length]);if(ne.return_dict_in_generate)return{sequences:Sr,past_key_values:_r,...sr};for(const Ct of Object.values(ar))Ct.location==="gpu-buffer"&&Ct.dispose();return Sr}getPastKeyValues(O,ne,ge=!1){const he=Object.create(null);for(const Ee in O)if(Ee.startsWith("present")){const De=Ee.replace("present","past_key_values"),Ne=Ee.includes("encoder");if(Ne&&ne?he[De]=ne[De]:he[De]=O[Ee],ne&&(!Ne||ge)){const Xe=ne[De];Xe.location==="gpu-buffer"&&Xe.dispose()}}return he}getAttentions(O){const ne={};for(const ge of["cross_attentions","encoder_attentions","decoder_attentions"])for(const he in O)he.startsWith(ge)&&(ge in ne||(ne[ge]=[]),ne[ge].push(O[he]));return ne}addPastKeyValues(O,ne){var ge,he,Ee;if(ne)Object.assign(O,ne);else{const De=this.sessions.decoder_model_merged??this.sessions.model,Ne=((ge=De==null?void 0:De.config)==null?void 0:ge.kv_cache_dtype)??"float32",Xe=Ne==="float16"?new d.DataTypeMap.float16:[],mt=((Ee=(he=O[this.main_input_name]??O.attention_mask)==null?void 0:he.dims)==null?void 0:Ee[0])??1,wt=(0,s.getKeyValueShapes)(this.config,{batch_size:mt});for(const dt in wt)O[dt]=new d.Tensor(Ne,Xe,wt[dt])}}async encode_image({pixel_values:O}){const ne=(await R(this.sessions.vision_encoder,{pixel_values:O})).image_features;return this.config.num_image_tokens||(console.warn(`The number of image tokens was not set in the model configuration. Setting it to the number of features detected by the vision encoder (${ne.dims[1]}).`),this.config.num_image_tokens=ne.dims[1]),ne}async encode_text({input_ids:O}){return(await R(this.sessions.embed_tokens,{input_ids:O})).inputs_embeds}async encode_audio({audio_values:O}){return(await R(this.sessions.audio_encoder,{audio_values:O})).audio_features}}class be{}class we extends be{constructor({last_hidden_state:P,hidden_states:O=null,attentions:ne=null}){super(),this.last_hidden_state=P,this.hidden_states=O,this.attentions=ne}}class Se extends G{}class Pe extends Se{}class $e extends Se{async _call(P){return new Ar(await super._call(P))}}class Fe extends Se{async _call(P){return new vt(await super._call(P))}}class Be extends Se{async _call(P){return new Cr(await super._call(P))}}class He extends Se{async _call(P){return new Br(await super._call(P))}}class qe extends G{}class ke extends qe{}class Ve extends qe{async _call(P){return new Ar(await super._call(P))}}class Ze extends qe{async _call(P){return new vt(await super._call(P))}}class st extends qe{async _call(P){return new Cr(await super._call(P))}}class at extends G{}class Ge extends at{}class Ie extends G{}class pt extends Ie{}class St extends Ie{async _call(P){return new Ar(await super._call(P))}}class Vt extends Ie{async _call(P){return new vt(await super._call(P))}}class zt extends Ie{async _call(P){return new Cr(await super._call(P))}}class gr extends Ie{async _call(P){return new Br(await super._call(P))}}class or extends G{}class bt extends or{}class Zr extends or{async _call(P){return new Ar(await super._call(P))}}class D extends or{async _call(P){return new vt(await super._call(P))}}class oe extends or{async _call(P){return new Cr(await super._call(P))}}class B extends or{async _call(P){return new Br(await super._call(P))}}class te extends G{}class me extends te{}class Oe extends te{async _call(P){return new Ar(await super._call(P))}}class ve extends te{async _call(P){return new vt(await super._call(P))}}class yt extends te{async _call(P){return new Cr(await super._call(P))}}class Ft extends te{async _call(P){return new Br(await super._call(P))}}class ht extends G{}class lt extends ht{}class rt extends ht{async _call(P){return new Ar(await super._call(P))}}class Bt extends ht{async _call(P){return new vt(await super._call(P))}}class Ht extends ht{async _call(P){return new Cr(await super._call(P))}}class wr extends ht{async _call(P){return new Br(await super._call(P))}}class Xt extends G{}class Or extends Xt{}class es extends Xt{async _call(P){return new Ar(await super._call(P))}}class ds extends Xt{async _call(P){return new vt(await super._call(P))}}class ts extends Xt{async _call(P){return new Cr(await super._call(P))}}class Cs extends Xt{async _call(P){return new Br(await super._call(P))}}class jr extends G{}class Ss extends jr{}class Kr extends jr{async _call(P){return new Ar(await super._call(P))}}class ps extends jr{async _call(P){return new vt(await super._call(P))}}class $s extends jr{async _call(P){return new Cr(await super._call(P))}}class ks extends jr{async _call(P){return new Br(await super._call(P))}}class ir extends G{}class Is extends ir{}class Tr extends ir{async _call(P){return new vt(await super._call(P))}}class hs extends ir{async _call(P){return new Cr(await super._call(P))}}class zr extends ir{async _call(P){return new Br(await super._call(P))}}class Ae extends ir{async _call(P){return new Ar(await super._call(P))}}class Je extends G{}class it extends Je{}class Rt extends Je{async _call(P){return new Ar(await super._call(P))}}class rs extends Je{async _call(P){return new vt(await super._call(P))}}class ss extends Je{async _call(P){return new Cr(await super._call(P))}}class ur extends G{}class ns extends ur{}class cr extends ur{async _call(P){return new Ar(await super._call(P))}}class hr extends ur{async _call(P){return new vt(await super._call(P))}}class os extends ur{async _call(P){return new Br(await super._call(P))}}class ms extends G{}class rn extends ms{}class sn extends ms{async _call(P){return new Ar(await super._call(P))}}class nn extends ms{async _call(P){return new vt(await super._call(P))}}class on extends ms{async _call(P){return new Cr(await super._call(P))}}class an extends ms{async _call(P){return new Br(await super._call(P))}}class As extends G{}class Vs extends As{}class ln extends As{async _call(P){return new Ar(await super._call(P))}}class un extends As{async _call(P){return new vt(await super._call(P))}}class cn extends As{async _call(P){return new Br(await super._call(P))}}class Fs extends G{}class de extends Fs{}class k extends Fs{async _call(P){return new vt(await super._call(P))}}class j extends Fs{async _call(P){return new Br(await super._call(P))}}class X extends Fs{async _call(P){return new Ar(await super._call(P))}}class ie extends G{constructor(){super(...arguments);Y(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class ce extends ie{}class xe extends ie{}class Re extends G{}class Qe extends Re{}class We extends Re{}class Ye extends G{}class _t extends Ye{}class Ot extends Ye{}class At extends G{}class Jt extends At{}class Ut extends At{}class mr extends At{async _call(P){return new vt(await super._call(P))}}class br extends G{}class Er extends br{}class Pr extends br{}class Zt extends br{async _call(P){return new vt(await super._call(P))}}class fs extends br{}class Kt extends G{}class fr extends Kt{}class Dr extends Kt{}class Hr extends G{}class qr extends Hr{}class kr extends Hr{}class Lr extends G{}class Mr extends Lr{}class er extends Lr{async _call(P){return new Ar(await super._call(P))}}class dr extends Lr{async _call(P){return new vt(await super._call(P))}}class pr extends Lr{async _call(P){return new Cr(await super._call(P))}}class Ir extends Lr{async _call(P){return new Br(await super._call(P))}}class is extends G{}class dn extends is{}class ri extends is{async _call(P){return new Ar(await super._call(P))}}class si extends is{async _call(P){return new vt(await super._call(P))}}class ni extends is{async _call(P){return new Cr(await super._call(P))}}class ao extends is{async _call(P){return new Br(await super._call(P))}}class Us extends G{}class oi extends Us{}class ii extends Us{async _call(P){return new Ar(await super._call(P))}}class ai extends Us{async _call(P){return new vt(await super._call(P))}}class li extends Us{async _call(P){return new Cr(await super._call(P))}}class ui extends Us{async _call(P){return new Br(await super._call(P))}}class lo extends G{}class ci extends lo{}class di extends lo{}class uo extends G{constructor(){super(...arguments);Y(this,"requires_attention_mask",!1);Y(this,"main_input_name","input_features");Y(this,"forward_params",["input_features","attention_mask","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class pi extends uo{}class co extends uo{_prepare_generation_config(P,O){return super._prepare_generation_config(P,O,w.WhisperGenerationConfig)}_retrieve_init_tokens(P){const O=[P.decoder_start_token_id];let ne=P.language;const ge=P.task;if(P.is_multilingual){ne||(console.warn("No language specified - defaulting to English (en)."),ne="en");const Ee=`<|${(0,C.whisper_language_to_code)(ne)}|>`;O.push(P.lang_to_id[Ee]),O.push(P.task_to_id[ge??"transcribe"])}else if(ne||ge)throw new Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!P.return_timestamps&&P.no_timestamps_token_id&&O.at(-1)!==P.no_timestamps_token_id?O.push(P.no_timestamps_token_id):P.return_timestamps&&O.at(-1)===P.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),O.pop()),O.filter(he=>he!=null)}async generate({inputs:P=null,generation_config:O=null,logits_processor:ne=null,stopping_criteria:ge=null,...he}){O=this._prepare_generation_config(O,he);const Ee=he.decoder_input_ids??this._retrieve_init_tokens(O);if(O.return_timestamps&&(ne??(ne=new p.LogitsProcessorList),ne.push(new p.WhisperTimeStampLogitsProcessor(O,Ee))),O.begin_suppress_tokens&&(ne??(ne=new p.LogitsProcessorList),ne.push(new p.SuppressTokensAtBeginLogitsProcessor(O.begin_suppress_tokens,Ee.length))),O.return_token_timestamps){if(!O.alignment_heads)throw new Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");O.task==="translate"&&console.warn("Token-level timestamps may not be reliable for task 'translate'."),O.output_attentions=!0,O.return_dict_in_generate=!0}const De=await super.generate({inputs:P,generation_config:O,logits_processor:ne,decoder_input_ids:Ee,...he});return O.return_token_timestamps&&(De.token_timestamps=this._extract_token_timestamps(De,O.alignment_heads,O.num_frames)),De}_extract_token_timestamps(P,O,ne=null,ge=.02){if(!P.cross_attentions)throw new Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");ne==null&&console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let he=this.config.median_filter_width;he===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),he=7);const Ee=P.cross_attentions,De=Array.from({length:this.config.decoder_layers},(Et,nt)=>(0,d.cat)(Ee.map($t=>$t[nt]),2)),Ne=(0,d.stack)(O.map(([Et,nt])=>{if(Et>=De.length)throw new Error(`Layer index ${Et} is out of bounds for cross attentions (length ${De.length}).`);return ne?De[Et].slice(null,nt,null,[0,ne]):De[Et].slice(null,nt)})).transpose(1,0,2,3),[Xe,mt]=(0,d.std_mean)(Ne,-2,0,!0),wt=Ne.clone();for(let Et=0;Et$t[Sr+1]-$t[Sr]),ar=(0,a.mergeArrays)([1],tr).map(_r=>!!_r),sr=[];for(let _r=0;_rdt.findIndex(Pt=>Pt==he)),Ne=De.every(dt=>dt===-1),Xe=De.every(dt=>dt!==-1);if(!Ne&&!Xe)throw new Error("Every input should contain either 0 or 1 image token.");if(Ne)return{inputs_embeds:P,attention_mask:ge};const mt=[],wt=[];for(let dt=0;dtArray.from({length:P.dims[0]},tr=>Array.from({length:P.dims[1]},ar=>1))),gt=O?O.tolist():[],Et=ne?ne.tolist():[];let nt=0,$t=0;for(let qt=0;qtdt[qt][xr]==1),sr=tr.reduce((rr,xr,Xs)=>(xr==Ne&&rr.push(Xs),rr),[]).map(rr=>tr[rr+1]),_r=sr.filter(rr=>rr==Ee).length,Sr=sr.filter(rr=>rr==De).length;let Ct=[],vr=0,Qr=_r,Mn=Sr;for(let rr=0;rr_s>vr&&xn==Ee),Xs=tr.findIndex((xn,_s)=>_s>vr&&xn==De),vn=Qr>0&&xr!==-1?xr:tr.length+1,Yn=Mn>0&&Xs!==-1?Xs:tr.length+1;let Gi,Pl,Cl,Sl;vn0?(0,f.max)(Ct.at(-1))[0]+1:0;Ct.push(Array.from({length:3*kl},(xn,_s)=>Tf+_s%kl));const Il=kl+Tf,Hi=pv*$l*Ki,hv=Array.from({length:Hi},(xn,_s)=>Il+Math.floor(_s/($l*Ki))),mv=Array.from({length:Hi},(xn,_s)=>Il+Math.floor(_s/Ki)%$l),fv=Array.from({length:Hi},(xn,_s)=>Il+_s%Ki);Ct.push([hv,mv,fv].flat()),vr=Gi+Hi}if(vr0?(0,f.max)(Ct.at(-1))[0]+1:0,xr=tr.length-vr;Ct.push(Array.from({length:3*xr},(Xs,vn)=>rr+vn%xr))}const Nr=Ct.reduce((rr,xr)=>rr+xr.length,0),as=new Array(Nr);let Vi=0;for(let rr=0;rr<3;++rr)for(let xr=0;xrwt[nt%wt.length]),gt=Array.from({length:dt[0]},(Et,nt)=>(0,f.max)(wt.subarray(dt[1]*nt,dt[1]*(nt+1)))[0]+1n+BigInt(dt[1]));return[new d.Tensor("int64",Pt,[3,...dt]),new d.Tensor("int64",gt,[gt.length,1])]}else{const[wt,dt]=P.dims,Pt=BigInt64Array.from({length:3*wt*dt},(gt,Et)=>BigInt(Math.floor(Et%dt/wt)));return[new d.Tensor("int64",Pt,[3,...P.dims]),(0,d.zeros)([wt,1])]}}async encode_image({pixel_values:P,image_grid_thw:O}){return(await R(this.sessions.vision_encoder,{pixel_values:P,grid_thw:O})).image_features}_merge_input_ids_with_image_features(P){return A({image_token_id:this.config.image_token_id,...P})}prepare_inputs_for_generation(P,O,ne){if(O.attention_mask&&!O.position_ids)if(!O.past_key_values)[O.position_ids,O.rope_deltas]=this.get_rope_index(O.input_ids,O.image_grid_thw,O.video_grid_thw,O.attention_mask);else{O.pixel_values=null;const ge=BigInt(Object.values(O.past_key_values)[0].dims.at(-2)),he=O.rope_deltas.map(Ee=>ge+Ee);O.position_ids=(0,d.stack)([he,he,he],0)}return O}}class Sa extends G{}class Uc extends Sa{}class Wc extends Sa{}class $a extends G{}class Gc extends $a{}class Kc extends $a{}class ka extends G{}class Hc extends ka{}class qc extends ka{}class Ia extends G{}class Qc extends Ia{}class Xc extends Ia{}class Aa extends G{}class Jc extends Aa{}class Yc extends Aa{}class Fa extends G{}class Zc extends Fa{}class ed extends Fa{async _call(P){return new vt(await super._call(P))}}class Oa extends G{}class td extends Oa{}class rd extends Oa{async _call(P){return new vt(await super._call(P))}}class sd extends G{}class nd extends sd{}class Da extends G{}class od extends Da{}class id extends Da{async _call(P){return new vt(await super._call(P))}}class ad extends G{}class ld extends ad{}class La extends G{}class ud extends La{}class cd extends La{async _call(P){return new vt(await super._call(P))}}class dd extends G{}class pd extends dd{}class za extends G{}class hd extends za{}class md extends za{async _call(P){return new vt(await super._call(P))}}class fd extends G{}class _d extends fd{async _call(P){return new vf(await super._call(P))}}class Ba extends G{}class gd extends Ba{}class wd extends Ba{async _call(P){return new vt(await super._call(P))}}class Ra extends G{}class bd extends Ra{}class Md extends Ra{async _call(P){return new vt(await super._call(P))}}class ja extends G{}class yd extends ja{}class vd extends ja{}class Na extends G{}class xd extends Na{}class Td extends Na{}class Va extends G{}class Ed extends Va{}class Pd extends Va{async _call(P){return new vt(await super._call(P))}}class Ci extends G{}class Cd extends Ci{}class Sd extends Ci{async _call(P){return new Wa(await super._call(P))}}class Ua extends Ci{async _call(P){return new $d(await super._call(P))}}class Wa extends be{constructor({logits:P,pred_boxes:O}){super(),this.logits=P,this.pred_boxes=O}}class $d extends be{constructor({logits:P,pred_boxes:O,pred_masks:ne}){super(),this.logits=P,this.pred_boxes=O,this.pred_masks=ne}}class Ga extends G{}class kd extends Ga{}class Id extends Ga{async _call(P){return new Lo(await super._call(P))}}class Lo extends be{constructor({logits:P,pred_boxes:O}){super(),this.logits=P,this.pred_boxes=O}}class Ka extends G{}class Ad extends Ka{}class Fd extends Ka{async _call(P){return new Od(await super._call(P))}}class Od extends Lo{}class Ha extends G{}class Dd extends Ha{}class Ld extends Ha{async _call(P){return new zd(await super._call(P))}}class zd extends Lo{}class qa extends G{}class Bd extends qa{}class Rd extends qa{async _call(P){return new Lo(await super._call(P))}}class Qa extends G{}class jd extends Qa{}class Nd extends Qa{async _call(P){return new Vd(await super._call(P))}}class Vd extends Wa{}class Xa extends G{}class Ud extends Xa{}class Wd extends Xa{async _call(P){return new vt(await super._call(P))}}class Ja extends G{}class Gd extends Ja{}class Kd extends Ja{async _call(P){return new vt(await super._call(P))}}class Ya extends G{}class Hd extends Ya{}class qd extends Ya{async _call(P){return new vt(await super._call(P))}}class Si extends G{}class Qd extends Si{}class Xd extends Si{async _call(P){return new vt(await super._call(P))}}class Jd extends Si{}class Za extends G{}class Yd extends Za{}class Zd extends Za{}class el extends G{}class ep extends el{}class tp extends el{}class rp extends G{}class sp extends rp{}class $i extends G{}class np extends $i{}class op extends $i{}class ip extends $i{}class ap extends G{}class lp extends ap{}class up extends G{}class cp extends up{}class dp extends G{}class pp extends dp{}class tl extends G{}class hp extends tl{}class mp extends tl{}class rl extends G{}class fp extends rl{}class _p extends rl{}class gp extends G{}class wp extends gp{}class sl extends G{}class bp extends sl{}class Mp extends sl{async _call(P){return new vt(await super._call(P))}}class nl extends G{}class yp extends nl{}class vp extends nl{async _call(P){return new vt(await super._call(P))}}class ol extends G{}class xp extends ol{}class Tp extends ol{async _call(P){return new vt(await super._call(P))}}class il extends G{}class Ep extends il{}class Pp extends il{async _call(P){return new vt(await super._call(P))}}class Cp extends G{}class Sp extends Cp{}class al extends G{}class $p extends al{}class kp extends al{async _call(P){return new Ip(await super._call(P))}}class Ip extends be{constructor({logits:P,pred_boxes:O}){super(),this.logits=P,this.pred_boxes=O}}class Ap extends G{}class Fp extends Ap{async get_image_embeddings({pixel_values:P}){return await se(this,{pixel_values:P})}async forward(P){if((!P.image_embeddings||!P.image_positional_embeddings)&&(P={...P,...await this.get_image_embeddings(P)}),!P.input_labels&&P.input_points){const ne=P.input_points.dims.slice(0,-1),ge=ne.reduce((he,Ee)=>he*Ee,1);P.input_labels=new d.Tensor("int64",new BigInt64Array(ge).fill(1n),ne)}const O={image_embeddings:P.image_embeddings,image_positional_embeddings:P.image_positional_embeddings};return P.input_points&&(O.input_points=P.input_points),P.input_labels&&(O.input_labels=P.input_labels),P.input_boxes&&(O.input_boxes=P.input_boxes),await R(this.sessions.prompt_encoder_mask_decoder,O)}async _call(P){return new Op(await super._call(P))}}class Op extends be{constructor({iou_scores:P,pred_masks:O}){super(),this.iou_scores=P,this.pred_masks=O}}class ll extends G{}class Dp extends ll{}class Lp extends ll{}class ul extends G{}class zp extends ul{}class Bp extends ul{}class Qs extends G{}class Rp extends Qs{}class jp extends Qs{async _call(P){return new bn(await super._call(P))}}class Np extends Qs{async _call(P){return new vt(await super._call(P))}}class Vp extends Qs{async _call(P){return new Cr(await super._call(P))}}class cl extends G{}class Up extends cl{}class Wp extends cl{async _call(P){return new Cr(await super._call(P))}}class Gp extends G{}class Kp extends Gp{}class ki extends G{}class Hp extends ki{}class qp extends ki{async _call(P){return new bn(await super._call(P))}}class Qp extends ki{async _call(P){return new vt(await super._call(P))}}class zo extends G{}class Xp extends zo{}class Jp extends zo{async _call(P){return new bn(await super._call(P))}}class Yp extends zo{async _call(P){return new vt(await super._call(P))}}class Zp extends zo{async _call(P){return new Cr(await super._call(P))}}class Ii extends G{}class eh extends Ii{}class th extends Ii{async _call(P){return new bn(await super._call(P))}}class rh extends Ii{async _call(P){return new vt(await super._call(P))}}class J0 extends G{}class sh extends Qs{}class nh extends Qs{async _call(P){return new bn(await super._call(P))}}class oh extends Qs{async _call(P){return new vt(await super._call(P))}}class Xn extends G{}class ih extends Xn{}class ah extends Xn{async _call(P){return new bn(await super._call(P))}}class lh extends Xn{async _call(P){return new vt(await super._call(P))}}class uh extends Xn{async _call(P){return new yf(await super._call(P))}}class ch extends Xn{async _call(P){return new Cr(await super._call(P))}}class dh extends G{}class ph extends dh{}class Ai extends G{}class Y0 extends Ai{}class hh extends Ai{}class mh extends Ai{async generate_speech(P,O,{threshold:ne=.5,minlenratio:ge=0,maxlenratio:he=20,vocoder:Ee=null}={}){const De={input_ids:P},{encoder_outputs:Ne,encoder_attention_mask:Xe}=await se(this,De),mt=Ne.dims[1]/this.config.reduction_factor,wt=Math.floor(mt*he),dt=Math.floor(mt*ge),Pt=this.config.num_mel_bins;let gt=[],Et=null,nt=null,$t=0;for(;;){++$t;const ar=J(!!nt);let sr;nt?sr=nt.output_sequence_out:sr=new d.Tensor("float32",new Float32Array(Pt),[1,1,Pt]);let _r={use_cache_branch:ar,output_sequence:sr,encoder_attention_mask:Xe,speaker_embeddings:O,encoder_hidden_states:Ne};this.addPastKeyValues(_r,Et),nt=await R(this.sessions.decoder_model_merged,_r),Et=this.getPastKeyValues(nt,Et);const{prob:Sr,spectrum:Ct}=nt;if(gt.push(Ct),$t>=dt&&(Array.from(Sr.data).filter(vr=>vr>=ne).length>0||$t>=wt))break}const qt=(0,d.cat)(gt),{waveform:tr}=await R(Ee.sessions.model,{spectrogram:qt});return{spectrogram:qt,waveform:tr}}}class fh extends G{constructor(){super(...arguments);Y(this,"main_input_name","spectrogram")}}class _h extends G{}class gh extends _h{}class dl extends G{}class wh extends dl{}class bh extends dl{}class pl extends G{}class Mh extends pl{}class yh extends pl{}class hl extends G{}class vh extends hl{}class xh extends hl{}class Fi extends G{}class Th extends Fi{}class Eh extends Fi{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"text_model"})}}class Ph extends Fi{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"audio_model"})}}class Ch extends G{}class ml extends Ch{async _call(P){return new xf(await super._call(P))}}class Oi extends G{}class Z0 extends Oi{}class Sh extends Oi{}class $h extends Oi{}class fl extends G{}class kh extends fl{}class Ih extends fl{}class _l extends G{}class Ah extends _l{}class Fh extends _l{async _call(P){return new vt(await super._call(P))}}class gl extends G{}class ev extends gl{}class tv extends gl{}class wl extends G{constructor(){super(...arguments);Y(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}_apply_and_filter_by_delay_pattern_mask(O){const[ne,ge]=O.dims,he=this.config.decoder.num_codebooks,Ee=ge-he;let De=0;for(let mt=0;mt0&&Pt<=Ee&&(O.data[De++]=O.data[mt])}const Ne=Math.floor(ne/he),Xe=De/(Ne*he);return new d.Tensor(O.type,O.data.slice(0,De),[Ne,he,Xe])}prepare_inputs_for_generation(O,ne,ge){let he=structuredClone(O);for(let De=0;De=Ne&&(he[De][Ne]=BigInt(this.config.decoder.pad_token_id));return ge.guidance_scale!==null&&ge.guidance_scale>1&&(he=he.concat(he)),super.prepare_inputs_for_generation(he,ne,ge)}async generate(O){const ne=await super.generate(O),ge=this._apply_and_filter_by_delay_pattern_mask(ne).unsqueeze_(0),{audio_values:he}=await R(this.sessions.encodec_decode,{audio_codes:ge});return he}}class Di extends G{}class Oh extends Di{}class Dh extends Di{async _call(P){return new vt(await super._call(P))}}class Lh extends Di{}class Li extends G{}class zh extends Li{}class Bh extends Li{async _call(P){return new vt(await super._call(P))}}class Rh extends Li{}class zi extends G{}class jh extends zi{}class Nh extends zi{async _call(P){return new vt(await super._call(P))}}class Vh extends zi{}class Bi extends G{}class Uh extends Bi{}class Wh extends Bi{async _call(P){return new vt(await super._call(P))}}class Gh extends Bi{}class Kh extends G{}class Hh extends Kh{}class qh extends G{}class Qh extends qh{constructor(...O){super(...O);Y(this,"forward_params",["input_ids","pixel_values","images_seq_mask","images_emb_mask","attention_mask","position_ids","past_key_values"]);this._generation_mode="text"}async forward(O){const ne=this._generation_mode??"text";let ge;if(ne==="text"||!O.past_key_values){const Xe=this.sessions.prepare_inputs_embeds,mt=(0,a.pick)(O,Xe.inputNames);ge=await R(Xe,mt)}else{const Xe=this.sessions.gen_img_embeds,mt=(0,a.pick)({image_ids:O.input_ids},Xe.inputNames);ge=await R(Xe,mt)}const he={...O,...ge},Ee=await ae(this,he),De=this.sessions[ne==="text"?"lm_head":"gen_head"];if(!De)throw new Error(`Unable to find "${De}" generation head`);const Ne=await R(De,(0,a.pick)(Ee,De.inputNames));return{...ge,...Ee,...Ne}}async generate(O){return this._generation_mode="text",super.generate(O)}async generate_images(O){this._generation_mode="image";const ne=(O.inputs??O[this.main_input_name]).dims[1],he=(await super.generate(O)).slice(null,[ne,null]),Ee=this.sessions.image_decode,{decoded_image:De}=await R(Ee,{generated_tokens:he}),Ne=De.add_(1).mul_(255/2).clamp_(0,255).to("uint8"),Xe=[];for(const mt of Ne){const wt=_.RawImage.fromTensor(mt);Xe.push(wt)}return Xe}}class Xh extends be{constructor({char_logits:P,bpe_logits:O,wp_logits:ne}){super(),this.char_logits=P,this.bpe_logits=O,this.wp_logits=ne}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class Jh extends G{}class Yh extends Jh{async _call(P){return new Xh(await super._call(P))}}class bl extends G{}class Zh extends bl{}class em extends bl{}class Ml extends G{}class tm extends Ml{}class rm extends Ml{}class sm extends G{constructor(){super(...arguments);Y(this,"forward_params",["input_ids","attention_mask","position_ids","audio_values","past_key_values"])}}class nm extends sm{_merge_input_ids_with_audio_features(P){const O=P.audio_features.dims.at(-1),ne=P.audio_features.view(-1,O);return U({audio_token_id:this.config.ignore_index,...P,audio_features:ne})}}class Ri extends G{constructor(){super(...arguments);Y(this,"main_input_name","input_values");Y(this,"forward_params",["input_values"])}}class om extends be{constructor({audio_codes:P}){super(),this.audio_codes=P}}class im extends be{constructor({audio_values:P}){super(),this.audio_values=P}}class am extends Ri{async encode(P){return new om(await R(this.sessions.encoder_model,P))}async decode(P){return new im(await R(this.sessions.decoder_model,P))}}class lm extends Ri{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"encoder_model"})}}class um extends Ri{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"decoder_model"})}}class ji extends G{constructor(){super(...arguments);Y(this,"main_input_name","input_values");Y(this,"forward_params",["input_values"])}}class cm extends be{constructor({audio_codes:P}){super(),this.audio_codes=P}}class dm extends be{constructor({audio_values:P}){super(),this.audio_values=P}}class pm extends ji{async encode(P){return new cm(await R(this.sessions.encoder_model,P))}async decode(P){return new dm(await R(this.sessions.decoder_model,P))}}class hm extends ji{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"encoder_model"})}}class mm extends ji{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"decoder_model"})}}class Ni extends G{constructor(){super(...arguments);Y(this,"main_input_name","input_values");Y(this,"forward_params",["input_values"])}}class fm extends Ni{async encode(P){return await R(this.sessions.encoder_model,P)}async decode(P){return await R(this.sessions.decoder_model,P)}}class _m extends Ni{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"encoder_model"})}}class gm extends Ni{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"decoder_model"})}}class Dt{static async from_pretrained(P,{progress_callback:O=null,config:ne=null,cache_dir:ge=null,local_files_only:he=!1,revision:Ee="main",model_file_name:De=null,subfolder:Ne="onnx",device:Xe=null,dtype:mt=null,use_external_data_format:wt=null,session_options:dt={}}={}){const Pt={progress_callback:O,config:ne,cache_dir:ge,local_files_only:he,revision:Ee,model_file_name:De,subfolder:Ne,device:Xe,dtype:mt,use_external_data_format:wt,session_options:dt};if(Pt.config=await s.AutoConfig.from_pretrained(P,Pt),!this.MODEL_CLASS_MAPPINGS)throw new Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);const gt=Pt.config.model_type;for(const Et of this.MODEL_CLASS_MAPPINGS){let nt=Et.get(gt);if(!nt){for(const $t of Et.values())if($t[0]===gt){nt=$t;break}if(!nt)continue}return await nt[1].from_pretrained(P,Pt)}if(this.BASE_IF_FAIL)return Um.has(gt)||console.warn(`Unknown model class "${gt}", attempting to construct from base class.`),await G.from_pretrained(P,Pt);throw Error(`Unsupported model type: ${gt}`)}}Y(Dt,"MODEL_CLASS_MAPPINGS",null),Y(Dt,"BASE_IF_FAIL",!1);const rv=new Map([["bert",["BertModel",Pe]],["modernbert",["ModernBertModel",ke]],["nomic_bert",["NomicBertModel",Ge]],["roformer",["RoFormerModel",pt]],["electra",["ElectraModel",me]],["esm",["EsmModel",it]],["convbert",["ConvBertModel",bt]],["camembert",["CamembertModel",lt]],["deberta",["DebertaModel",Or]],["deberta-v2",["DebertaV2Model",Ss]],["mpnet",["MPNetModel",rn]],["albert",["AlbertModel",de]],["distilbert",["DistilBertModel",Is]],["roberta",["RobertaModel",Mr]],["xlm",["XLMModel",dn]],["xlm-roberta",["XLMRobertaModel",oi]],["clap",["ClapModel",Th]],["clip",["CLIPModel",Mi]],["clipseg",["CLIPSegModel",vo]],["chinese_clip",["ChineseCLIPModel",Nn]],["siglip",["SiglipModel",Ks]],["jina_clip",["JinaCLIPModel",bo]],["mobilebert",["MobileBertModel",ns]],["squeezebert",["SqueezeBertModel",Vs]],["wav2vec2",["Wav2Vec2Model",Rp]],["wav2vec2-bert",["Wav2Vec2BertModel",eh]],["unispeech",["UniSpeechModel",Hp]],["unispeech-sat",["UniSpeechSatModel",Xp]],["hubert",["HubertModel",sh]],["wavlm",["WavLMModel",ih]],["audio-spectrogram-transformer",["ASTModel",ci]],["vits",["VitsModel",ml]],["pyannote",["PyAnnoteModel",Up]],["wespeaker-resnet",["WeSpeakerResNetModel",Kp]],["detr",["DetrModel",Cd]],["rt_detr",["RTDetrModel",kd]],["rt_detr_v2",["RTDetrV2Model",Ad]],["rf_detr",["RFDetrModel",Dd]],["d_fine",["DFineModel",Bd]],["table-transformer",["TableTransformerModel",jd]],["vit",["ViTModel",Zc]],["ijepa",["IJepaModel",td]],["pvt",["PvtModel",od]],["vit_msn",["ViTMSNModel",ud]],["vit_mae",["ViTMAEModel",ld]],["groupvit",["GroupViTModel",pd]],["fastvit",["FastViTModel",hd]],["mobilevit",["MobileViTModel",gd]],["mobilevitv2",["MobileViTV2Model",bd]],["owlvit",["OwlViTModel",yd]],["owlv2",["Owlv2Model",xd]],["beit",["BeitModel",Ed]],["deit",["DeiTModel",Ud]],["hiera",["HieraModel",Gd]],["convnext",["ConvNextModel",bp]],["convnextv2",["ConvNextV2Model",yp]],["dinov2",["Dinov2Model",xp]],["dinov2_with_registers",["Dinov2WithRegistersModel",Ep]],["resnet",["ResNetModel",Hd]],["swin",["SwinModel",Qd]],["swin2sr",["Swin2SRModel",Yd]],["donut-swin",["DonutSwinModel",wp]],["yolos",["YolosModel",$p]],["dpt",["DPTModel",ep]],["glpn",["GLPNModel",fp]],["hifigan",["SpeechT5HifiGan",fh]],["efficientnet",["EfficientNetModel",Ah]],["decision_transformer",["DecisionTransformerModel",Hh]],["patchtst",["PatchTSTForPrediction",Zh]],["patchtsmixer",["PatchTSMixerForPrediction",tm]],["mobilenet_v1",["MobileNetV1Model",Oh]],["mobilenet_v2",["MobileNetV2Model",zh]],["mobilenet_v3",["MobileNetV3Model",jh]],["mobilenet_v4",["MobileNetV4Model",Uh]],["maskformer",["MaskFormerModel",hp]],["mgp-str",["MgpstrForSceneTextRecognition",Yh]],["style_text_to_speech_2",["StyleTextToSpeech2Model",ph]]]),sv=new Map([["t5",["T5Model",ce]],["longt5",["LongT5Model",Qe]],["mt5",["MT5Model",_t]],["bart",["BartModel",Jt]],["mbart",["MBartModel",Er]],["marian",["MarianModel",Dp]],["whisper",["WhisperModel",pi]],["m2m_100",["M2M100Model",zp]],["blenderbot",["BlenderbotModel",fr]],["blenderbot-small",["BlenderbotSmallModel",qr]]]),nv=new Map([["mimi",["MimiModel",am]],["dac",["DacModel",pm]],["snac",["SnacModel",fm]]]),ov=new Map([["bloom",["BloomModel",Hc]],["jais",["JAISModel",ct]],["gpt2",["GPT2Model",Eo]],["gptj",["GPTJModel",So]],["gpt_bigcode",["GPTBigCodeModel",ko]],["gpt_neo",["GPTNeoModel",Co]],["gpt_neox",["GPTNeoXModel",fn]],["codegen",["CodeGenModel",gn]],["llama",["LlamaModel",Ao]],["exaone",["ExaoneModel",L]],["olmo",["OlmoModel",et]],["olmo2",["Olmo2Model",Wt]],["mobilellm",["MobileLLMModel",Te]],["granite",["GraniteModel",Pi]],["cohere",["CohereModel",Cc]],["gemma",["GemmaModel",$c]],["gemma2",["Gemma2Model",Ic]],["gemma3_text",["Gemma3Model",Fc]],["helium",["HeliumModel",Oo]],["glm",["GlmModel",h]],["openelm",["OpenELMModel",Dc]],["qwen2",["Qwen2Model",zc]],["qwen3",["Qwen3Model",Rc]],["phi",["PhiModel",Uc]],["phi3",["Phi3Model",Gc]],["mpt",["MptModel",Qc]],["opt",["OPTModel",Jc]],["mistral",["MistralModel",wh]],["starcoder2",["Starcoder2Model",Mh]],["falcon",["FalconModel",vh]],["stablelm",["StableLmModel",kh]]]),yl=new Map([["speecht5",["SpeechT5ForSpeechToText",hh]],["whisper",["WhisperForConditionalGeneration",co]],["lite-whisper",["LiteWhisperForConditionalGeneration",po]],["moonshine",["MoonshineForConditionalGeneration",mi]]]),wm=new Map([["speecht5",["SpeechT5ForTextToSpeech",mh]]]),bm=new Map([["vits",["VitsModel",ml]],["musicgen",["MusicgenForConditionalGeneration",wl]]]),Mm=new Map([["bert",["BertForSequenceClassification",Fe]],["modernbert",["ModernBertForSequenceClassification",Ze]],["roformer",["RoFormerForSequenceClassification",Vt]],["electra",["ElectraForSequenceClassification",ve]],["esm",["EsmForSequenceClassification",rs]],["convbert",["ConvBertForSequenceClassification",D]],["camembert",["CamembertForSequenceClassification",Bt]],["deberta",["DebertaForSequenceClassification",ds]],["deberta-v2",["DebertaV2ForSequenceClassification",ps]],["mpnet",["MPNetForSequenceClassification",nn]],["albert",["AlbertForSequenceClassification",k]],["distilbert",["DistilBertForSequenceClassification",Tr]],["roberta",["RobertaForSequenceClassification",dr]],["xlm",["XLMForSequenceClassification",si]],["xlm-roberta",["XLMRobertaForSequenceClassification",ai]],["bart",["BartForSequenceClassification",mr]],["mbart",["MBartForSequenceClassification",Zt]],["mobilebert",["MobileBertForSequenceClassification",hr]],["squeezebert",["SqueezeBertForSequenceClassification",un]]]),ym=new Map([["bert",["BertForTokenClassification",Be]],["modernbert",["ModernBertForTokenClassification",st]],["roformer",["RoFormerForTokenClassification",zt]],["electra",["ElectraForTokenClassification",yt]],["esm",["EsmForTokenClassification",ss]],["convbert",["ConvBertForTokenClassification",oe]],["camembert",["CamembertForTokenClassification",Ht]],["deberta",["DebertaForTokenClassification",ts]],["deberta-v2",["DebertaV2ForTokenClassification",$s]],["mpnet",["MPNetForTokenClassification",on]],["distilbert",["DistilBertForTokenClassification",hs]],["roberta",["RobertaForTokenClassification",pr]],["xlm",["XLMForTokenClassification",ni]],["xlm-roberta",["XLMRobertaForTokenClassification",li]]]),vl=new Map([["t5",["T5ForConditionalGeneration",xe]],["longt5",["LongT5ForConditionalGeneration",We]],["mt5",["MT5ForConditionalGeneration",Ot]],["bart",["BartForConditionalGeneration",Ut]],["mbart",["MBartForConditionalGeneration",Pr]],["marian",["MarianMTModel",Lp]],["m2m_100",["M2M100ForConditionalGeneration",Bp]],["blenderbot",["BlenderbotForConditionalGeneration",Dr]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",kr]]]),xl=new Map([["bloom",["BloomForCausalLM",qc]],["gpt2",["GPT2LMHeadModel",Po]],["jais",["JAISLMHeadModel",Ei]],["gptj",["GPTJForCausalLM",$o]],["gpt_bigcode",["GPTBigCodeForCausalLM",Io]],["gpt_neo",["GPTNeoForCausalLM",mn]],["gpt_neox",["GPTNeoXForCausalLM",Wn]],["codegen",["CodeGenForCausalLM",Hn]],["llama",["LlamaForCausalLM",Fo]],["exaone",["ExaoneForCausalLM",N]],["olmo",["OlmoForCausalLM",Mt]],["olmo2",["Olmo2ForCausalLM",yr]],["mobilellm",["MobileLLMForCausalLM",Le]],["granite",["GraniteForCausalLM",Pc]],["cohere",["CohereForCausalLM",Sc]],["gemma",["GemmaForCausalLM",kc]],["gemma2",["Gemma2ForCausalLM",Ac]],["gemma3_text",["Gemma3ForCausalLM",Oc]],["helium",["HeliumForCausalLM",Do]],["glm",["GlmForCausalLM",T]],["openelm",["OpenELMForCausalLM",Lc]],["qwen2",["Qwen2ForCausalLM",Bc]],["qwen3",["Qwen3ForCausalLM",jc]],["phi",["PhiForCausalLM",Wc]],["phi3",["Phi3ForCausalLM",Kc]],["mpt",["MptForCausalLM",Xc]],["opt",["OPTForCausalLM",Yc]],["mbart",["MBartForCausalLM",fs]],["mistral",["MistralForCausalLM",bh]],["starcoder2",["Starcoder2ForCausalLM",yh]],["falcon",["FalconForCausalLM",xh]],["trocr",["TrOCRForCausalLM",gh]],["stablelm",["StableLmForCausalLM",Ih]],["phi3_v",["Phi3VForCausalLM",go]]]),iv=new Map([["multi_modality",["MultiModalityCausalLM",Qh]]]),vm=new Map([["bert",["BertForMaskedLM",$e]],["modernbert",["ModernBertForMaskedLM",Ve]],["roformer",["RoFormerForMaskedLM",St]],["electra",["ElectraForMaskedLM",Oe]],["esm",["EsmForMaskedLM",Rt]],["convbert",["ConvBertForMaskedLM",Zr]],["camembert",["CamembertForMaskedLM",rt]],["deberta",["DebertaForMaskedLM",es]],["deberta-v2",["DebertaV2ForMaskedLM",Kr]],["mpnet",["MPNetForMaskedLM",sn]],["albert",["AlbertForMaskedLM",X]],["distilbert",["DistilBertForMaskedLM",Ae]],["roberta",["RobertaForMaskedLM",er]],["xlm",["XLMWithLMHeadModel",ri]],["xlm-roberta",["XLMRobertaForMaskedLM",ii]],["mobilebert",["MobileBertForMaskedLM",cr]],["squeezebert",["SqueezeBertForMaskedLM",ln]]]),xm=new Map([["bert",["BertForQuestionAnswering",He]],["roformer",["RoFormerForQuestionAnswering",gr]],["electra",["ElectraForQuestionAnswering",Ft]],["convbert",["ConvBertForQuestionAnswering",B]],["camembert",["CamembertForQuestionAnswering",wr]],["deberta",["DebertaForQuestionAnswering",Cs]],["deberta-v2",["DebertaV2ForQuestionAnswering",ks]],["mpnet",["MPNetForQuestionAnswering",an]],["albert",["AlbertForQuestionAnswering",j]],["distilbert",["DistilBertForQuestionAnswering",zr]],["roberta",["RobertaForQuestionAnswering",Ir]],["xlm",["XLMForQuestionAnswering",ao]],["xlm-roberta",["XLMRobertaForQuestionAnswering",ui]],["mobilebert",["MobileBertForQuestionAnswering",os]],["squeezebert",["SqueezeBertForQuestionAnswering",cn]]]),Tl=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",ho]],["idefics3",["Idefics3ForConditionalGeneration",hn]],["smolvlm",["SmolVLMForConditionalGeneration",_o]]]),Tm=new Map([["llava",["LlavaForConditionalGeneration",pn]],["llava_onevision",["LlavaOnevisionForConditionalGeneration",Ws]],["moondream1",["Moondream1ForConditionalGeneration",fi]],["florence2",["Florence2ForConditionalGeneration",_i]],["qwen2-vl",["Qwen2VLForConditionalGeneration",Vc]],["idefics3",["Idefics3ForConditionalGeneration",hn]],["smolvlm",["SmolVLMForConditionalGeneration",_o]],["paligemma",["PaliGemmaForConditionalGeneration",wi]]]),Em=new Map([["ultravox",["UltravoxModel",nm]]]),av=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",ho]]]),Pm=new Map([["vit",["ViTForImageClassification",ed]],["ijepa",["IJepaForImageClassification",rd]],["pvt",["PvtForImageClassification",id]],["vit_msn",["ViTMSNForImageClassification",cd]],["fastvit",["FastViTForImageClassification",md]],["mobilevit",["MobileViTForImageClassification",wd]],["mobilevitv2",["MobileViTV2ForImageClassification",Md]],["beit",["BeitForImageClassification",Pd]],["deit",["DeiTForImageClassification",Wd]],["hiera",["HieraForImageClassification",Kd]],["convnext",["ConvNextForImageClassification",Mp]],["convnextv2",["ConvNextV2ForImageClassification",vp]],["dinov2",["Dinov2ForImageClassification",Tp]],["dinov2_with_registers",["Dinov2WithRegistersForImageClassification",Pp]],["resnet",["ResNetForImageClassification",qd]],["swin",["SwinForImageClassification",Xd]],["segformer",["SegformerForImageClassification",Sh]],["efficientnet",["EfficientNetForImageClassification",Fh]],["mobilenet_v1",["MobileNetV1ForImageClassification",Dh]],["mobilenet_v2",["MobileNetV2ForImageClassification",Bh]],["mobilenet_v3",["MobileNetV3ForImageClassification",Nh]],["mobilenet_v4",["MobileNetV4ForImageClassification",Wh]]]),Cm=new Map([["detr",["DetrForObjectDetection",Sd]],["rt_detr",["RTDetrForObjectDetection",Id]],["rt_detr_v2",["RTDetrV2ForObjectDetection",Fd]],["rf_detr",["RFDetrForObjectDetection",Ld]],["d_fine",["DFineForObjectDetection",Rd]],["table-transformer",["TableTransformerForObjectDetection",Nd]],["yolos",["YolosForObjectDetection",kp]]]),Sm=new Map([["owlvit",["OwlViTForObjectDetection",vd]],["owlv2",["Owlv2ForObjectDetection",Td]],["grounding-dino",["GroundingDinoForObjectDetection",Sp]]]),Jn=new Map([["detr",["DetrForSegmentation",Ua]],["clipseg",["CLIPSegForImageSegmentation",xo]]]),$m=new Map([["segformer",["SegformerForSemanticSegmentation",$h]],["sapiens",["SapiensForSemanticSegmentation",np]],["swin",["SwinForSemanticSegmentation",Jd]],["mobilenet_v1",["MobileNetV1ForSemanticSegmentation",Lh]],["mobilenet_v2",["MobileNetV2ForSemanticSegmentation",Rh]],["mobilenet_v3",["MobileNetV3ForSemanticSegmentation",Vh]],["mobilenet_v4",["MobileNetV4ForSemanticSegmentation",Gh]]]),km=new Map([["detr",["DetrForSegmentation",Ua]],["maskformer",["MaskFormerForInstanceSegmentation",mp]]]),Im=new Map([["sam",["SamModel",Fp]]]),Am=new Map([["wav2vec2",["Wav2Vec2ForCTC",jp]],["wav2vec2-bert",["Wav2Vec2BertForCTC",th]],["unispeech",["UniSpeechForCTC",qp]],["unispeech-sat",["UniSpeechSatForCTC",Jp]],["wavlm",["WavLMForCTC",ah]],["hubert",["HubertForCTC",nh]]]),Fm=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",Np]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",rh]],["unispeech",["UniSpeechForSequenceClassification",Qp]],["unispeech-sat",["UniSpeechSatForSequenceClassification",Yp]],["wavlm",["WavLMForSequenceClassification",lh]],["hubert",["HubertForSequenceClassification",oh]],["audio-spectrogram-transformer",["ASTForAudioClassification",di]]]),Om=new Map([["wavlm",["WavLMForXVector",uh]]]),Dm=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",Zp]],["wavlm",["WavLMForAudioFrameClassification",ch]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",Vp]],["pyannote",["PyAnnoteForAudioFrameClassification",Wp]]]),Lm=new Map([["vitmatte",["VitMatteForImageMatting",_d]]]),lv=new Map([["patchtst",["PatchTSTForPrediction",em]],["patchtsmixer",["PatchTSMixerForPrediction",rm]]]),zm=new Map([["swin2sr",["Swin2SRForImageSuperResolution",Zd]]]),Bm=new Map([["dpt",["DPTForDepthEstimation",tp]],["depth_anything",["DepthAnythingForDepthEstimation",sp]],["glpn",["GLPNForDepthEstimation",_p]],["sapiens",["SapiensForDepthEstimation",op]],["depth_pro",["DepthProForDepthEstimation",lp]],["metric3d",["Metric3DForDepthEstimation",cp]],["metric3dv2",["Metric3Dv2ForDepthEstimation",pp]]]),Rm=new Map([["sapiens",["SapiensForNormalEstimation",ip]]]),jm=new Map([["vitpose",["VitPoseForPoseEstimation",nd]]]),Nm=new Map([["clip",["CLIPVisionModelWithProjection",vi]],["siglip",["SiglipVisionModel",xi]],["jina_clip",["JinaCLIPVisionModel",yo]]]),Vm=[[rv,E.EncoderOnly],[sv,E.EncoderDecoder],[ov,E.DecoderOnly],[nv,E.AutoEncoder],[Mm,E.EncoderOnly],[ym,E.EncoderOnly],[vl,E.Seq2Seq],[yl,E.Seq2Seq],[xl,E.DecoderOnly],[iv,E.MultiModality],[vm,E.EncoderOnly],[xm,E.EncoderOnly],[Tl,E.Vision2Seq],[Tm,E.ImageTextToText],[Em,E.AudioTextToText],[Pm,E.EncoderOnly],[Jn,E.EncoderOnly],[km,E.EncoderOnly],[$m,E.EncoderOnly],[Lm,E.EncoderOnly],[lv,E.EncoderOnly],[zm,E.EncoderOnly],[Bm,E.EncoderOnly],[Rm,E.EncoderOnly],[jm,E.EncoderOnly],[Cm,E.EncoderOnly],[Sm,E.EncoderOnly],[Im,E.MaskGeneration],[Am,E.EncoderOnly],[Fm,E.EncoderOnly],[wm,E.Seq2Seq],[bm,E.EncoderOnly],[Om,E.EncoderOnly],[Dm,E.EncoderOnly],[Nm,E.EncoderOnly]];for(const[M,P]of Vm)for(const[O,ne]of M.values())x.set(O,P),y.set(ne,O),b.set(O,ne);const uv=[["MusicgenForConditionalGeneration",wl,E.Musicgen],["Phi3VForCausalLM",go,E.Phi3V],["CLIPTextModelWithProjection",yi,E.EncoderOnly],["SiglipTextModel",wo,E.EncoderOnly],["JinaCLIPTextModel",Mo,E.EncoderOnly],["ClapTextModelWithProjection",Eh,E.EncoderOnly],["ClapAudioModelWithProjection",Ph,E.EncoderOnly],["DacEncoderModel",hm,E.EncoderOnly],["DacDecoderModel",mm,E.EncoderOnly],["MimiEncoderModel",lm,E.EncoderOnly],["MimiDecoderModel",um,E.EncoderOnly],["SnacEncoderModel",_m,E.EncoderOnly],["SnacDecoderModel",gm,E.EncoderOnly]];for(const[M,P,O]of uv)x.set(M,O),y.set(P,M),b.set(M,P);const Um=new Map([["modnet",Jn],["birefnet",Jn],["isnet",Jn],["ben",Jn]]);for(const[M,P]of Um.entries())P.set(M,["PreTrainedModel",G]),x.set(M,E.EncoderOnly),y.set(G,M),b.set(M,G);class El extends Dt{}Y(El,"MODEL_CLASS_MAPPINGS",Vm.map(P=>P[0])),Y(El,"BASE_IF_FAIL",!0);class Wm extends Dt{}Y(Wm,"MODEL_CLASS_MAPPINGS",[Mm]);class Gm extends Dt{}Y(Gm,"MODEL_CLASS_MAPPINGS",[ym]);class Km extends Dt{}Y(Km,"MODEL_CLASS_MAPPINGS",[vl]);class Hm extends Dt{}Y(Hm,"MODEL_CLASS_MAPPINGS",[yl]);class qm extends Dt{}Y(qm,"MODEL_CLASS_MAPPINGS",[wm]);class Qm extends Dt{}Y(Qm,"MODEL_CLASS_MAPPINGS",[bm]);class Xm extends Dt{}Y(Xm,"MODEL_CLASS_MAPPINGS",[xl]);class Jm extends Dt{}Y(Jm,"MODEL_CLASS_MAPPINGS",[vm]);class Ym extends Dt{}Y(Ym,"MODEL_CLASS_MAPPINGS",[xm]);class Zm extends Dt{}Y(Zm,"MODEL_CLASS_MAPPINGS",[Tl]);class ef extends Dt{}Y(ef,"MODEL_CLASS_MAPPINGS",[Pm]);class tf extends Dt{}Y(tf,"MODEL_CLASS_MAPPINGS",[Jn]);class rf extends Dt{}Y(rf,"MODEL_CLASS_MAPPINGS",[$m]);class sf extends Dt{}Y(sf,"MODEL_CLASS_MAPPINGS",[km]);class nf extends Dt{}Y(nf,"MODEL_CLASS_MAPPINGS",[Cm]);class of extends Dt{}Y(of,"MODEL_CLASS_MAPPINGS",[Sm]);class af extends Dt{}Y(af,"MODEL_CLASS_MAPPINGS",[Im]);class lf extends Dt{}Y(lf,"MODEL_CLASS_MAPPINGS",[Am]);class uf extends Dt{}Y(uf,"MODEL_CLASS_MAPPINGS",[Fm]);class cf extends Dt{}Y(cf,"MODEL_CLASS_MAPPINGS",[Om]);class df extends Dt{}Y(df,"MODEL_CLASS_MAPPINGS",[Dm]);class pf extends Dt{}Y(pf,"MODEL_CLASS_MAPPINGS",[av]);class hf extends Dt{}Y(hf,"MODEL_CLASS_MAPPINGS",[Lm]);class mf extends Dt{}Y(mf,"MODEL_CLASS_MAPPINGS",[zm]);class ff extends Dt{}Y(ff,"MODEL_CLASS_MAPPINGS",[Bm]);class _f extends Dt{}Y(_f,"MODEL_CLASS_MAPPINGS",[Rm]);class gf extends Dt{}Y(gf,"MODEL_CLASS_MAPPINGS",[jm]);class wf extends Dt{}Y(wf,"MODEL_CLASS_MAPPINGS",[Nm]);class bf extends Dt{}Y(bf,"MODEL_CLASS_MAPPINGS",[Tm]);class Mf extends Dt{}Y(Mf,"MODEL_CLASS_MAPPINGS",[Em]);class cv extends be{constructor({logits:P,past_key_values:O,encoder_outputs:ne,decoder_attentions:ge=null,cross_attentions:he=null}){super(),this.logits=P,this.past_key_values=O,this.encoder_outputs=ne,this.decoder_attentions=ge,this.cross_attentions=he}}class vt extends be{constructor({logits:P,...O}){super(),this.logits=P;const ne=Object.values(O);ne.length>0&&(this.attentions=ne)}}class yf extends be{constructor({logits:P,embeddings:O}){super(),this.logits=P,this.embeddings=O}}class Cr extends be{constructor({logits:P}){super(),this.logits=P}}class Ar extends be{constructor({logits:P}){super(),this.logits=P}}class Br extends be{constructor({start_logits:P,end_logits:O}){super(),this.start_logits=P,this.end_logits=O}}class bn extends be{constructor({logits:P}){super(),this.logits=P}}class dv extends be{constructor({logits:P,past_key_values:O}){super(),this.logits=P,this.past_key_values=O}}class vf extends be{constructor({alphas:P}){super(),this.alphas=P}}class xf extends be{constructor({waveform:P,spectrogram:O}){super(),this.waveform=P,this.spectrogram=O}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,r,t)=>{t.r(r),t.d(r,{ASTFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var o=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a);const l=this.config.sampling_rate,u=(0,o.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(l/2),l,null,"kaldi",!0);this.mel_filters=u,this.window=(0,o.window_function)(400,"hann",{periodic:!1}),this.mean=this.config.mean,this.std=this.config.std}async _extract_fbank_features(a,l){return(0,o.spectrogram)(a,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:l,transpose:!0})}async _call(a){(0,s.validate_audio_inputs)(a,"ASTFeatureExtractor");const l=await this._extract_fbank_features(a,this.config.max_length);if(this.config.do_normalize){const u=this.std*2,p=l.data;for(let c=0;c{t.r(r),t.d(r,{AutoFeatureExtractor:()=>i});var s=t("./src/utils/constants.js"),o=t("./src/utils/hub.js");t("./src/base/feature_extraction_utils.js");var n=t("./src/models/feature_extractors.js");class i{static async from_pretrained(l,u={}){const p=await(0,o.getModelJSON)(l,s.FEATURE_EXTRACTOR_NAME,!0,u),c=p.feature_extractor_type,d=n[c];if(!d)throw new Error(`Unknown feature_extractor_type: '${c}'. Please report this at ${s.GITHUB_ISSUE_URL}.`);return new d(p)}}},"./src/models/auto/image_processing_auto.js":(e,r,t)=>{t.r(r),t.d(r,{AutoImageProcessor:()=>a});var s=t("./src/utils/constants.js"),o=t("./src/utils/hub.js"),n=t("./src/base/image_processors_utils.js"),i=t("./src/models/image_processors.js");class a{static async from_pretrained(u,p={}){const c=await(0,o.getModelJSON)(u,s.IMAGE_PROCESSOR_NAME,!0,p),d=c.image_processor_type??c.feature_extractor_type;let _=i[d];return _||(d!==void 0&&console.warn(`Image processor type '${d}' not found, assuming base ImageProcessor. Please report this at ${s.GITHUB_ISSUE_URL}.`),_=n.ImageProcessor),new _(c)}}},"./src/models/auto/processing_auto.js":(e,r,t)=>{t.r(r),t.d(r,{AutoProcessor:()=>u});var s=t("./src/utils/constants.js"),o=t("./src/utils/hub.js"),n=t("./src/base/processing_utils.js"),i=t("./src/models/processors.js"),a=t("./src/models/image_processors.js"),l=t("./src/models/feature_extractors.js");class u{static async from_pretrained(c,d={}){const _=await(0,o.getModelJSON)(c,s.IMAGE_PROCESSOR_NAME,!0,d),{image_processor_type:f,feature_extractor_type:v,processor_class:$}=_;if($&&i[$])return i[$].from_pretrained(c,d);if(!f&&!v)throw new Error("No `image_processor_type` or `feature_extractor_type` found in the config.");const g={};if(f){const C=a[f];if(!C)throw new Error(`Unknown image_processor_type: '${f}'.`);g.image_processor=new C(_)}if(v){const C=a[v];if(C)g.image_processor=new C(_);else{const E=l[v];if(!E)throw new Error(`Unknown feature_extractor_type: '${v}'.`);g.feature_extractor=new E(_)}}const w={};return new n.Processor(w,g)}}},"./src/models/beit/image_processing_beit.js":(e,r,t)=>{t.r(r),t.d(r,{BeitFeatureExtractor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/bit/image_processing_bit.js":(e,r,t)=>{t.r(r),t.d(r,{BitImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/chinese_clip/image_processing_chinese_clip.js":(e,r,t)=>{t.r(r),t.d(r,{ChineseCLIPFeatureExtractor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/clap/feature_extraction_clap.js":(e,r,t)=>{t.r(r),t.d(r,{ClapFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var o=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a),this.mel_filters=(0,o.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,null,"htk"),this.mel_filters_slaney=(0,o.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,"slaney","slaney"),this.window=(0,o.window_function)(this.config.fft_window_size,"hann")}async _get_input_mel(a,l,u,p){let c;const d=a.length-l;if(d>0)if(u==="rand_trunc"){const _=Math.floor(Math.random()*(d+1));a=a.subarray(_,_+l),c=await this._extract_fbank_features(a,this.mel_filters_slaney,this.config.nb_max_samples)}else throw new Error(`Truncation strategy "${u}" not implemented`);else{if(d<0){let _=new Float64Array(l);if(_.set(a),p==="repeat")for(let f=a.length;f{t.r(r),t.d(r,{CLIPFeatureExtractor:()=>n,CLIPImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/convnext/image_processing_convnext.js":(e,r,t)=>{t.r(r),t.d(r,{ConvNextFeatureExtractor:()=>n,ConvNextImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{constructor(a){super(a),this.crop_pct=this.config.crop_pct??224/256}async resize(a){var u;const l=(u=this.size)==null?void 0:u.shortest_edge;if(l===void 0)throw new Error("Size dictionary must contain 'shortest_edge' key.");if(l<384){const p=Math.floor(l/this.crop_pct),[c,d]=this.get_resize_output_image_size(a,{shortest_edge:p});a=await a.resize(c,d,{resample:this.resample}),a=await a.center_crop(l,l)}else a=await a.resize(l,l,{resample:this.resample});return a}}class n extends o{}},"./src/models/dac/feature_extraction_dac.js":(e,r,t)=>{t.r(r),t.d(r,{DacFeatureExtractor:()=>o});var s=t("./src/models/encodec/feature_extraction_encodec.js");class o extends s.EncodecFeatureExtractor{}},"./src/models/deit/image_processing_deit.js":(e,r,t)=>{t.r(r),t.d(r,{DeiTFeatureExtractor:()=>n,DeiTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/detr/image_processing_detr.js":(e,r,t)=>{t.r(r),t.d(r,{DetrFeatureExtractor:()=>i,DetrImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(l){const u=await super._call(l),p=[u.pixel_values.dims[0],64,64],c=(0,o.full)(p,1n);return{...u,pixel_mask:c}}post_process_object_detection(...l){return(0,s.post_process_object_detection)(...l)}post_process_panoptic_segmentation(...l){return(0,s.post_process_panoptic_segmentation)(...l)}post_process_instance_segmentation(...l){return(0,s.post_process_instance_segmentation)(...l)}}class i extends n{}},"./src/models/donut/image_processing_donut.js":(e,r,t)=>{t.r(r),t.d(r,{DonutFeatureExtractor:()=>n,DonutImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{pad_image(a,l,u,p={}){const[c,d,_]=l;let f=this.image_mean;Array.isArray(this.image_mean)||(f=new Array(_).fill(f));let v=this.image_std;Array.isArray(v)||(v=new Array(_).fill(f));const $=f.map((g,w)=>-g/v[w]);return super.pad_image(a,l,u,{center:!0,constant_values:$,...p})}}class n extends o{}},"./src/models/dpt/image_processing_dpt.js":(e,r,t)=>{t.r(r),t.d(r,{DPTFeatureExtractor:()=>n,DPTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/efficientnet/image_processing_efficientnet.js":(e,r,t)=>{t.r(r),t.d(r,{EfficientNetImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{constructor(i){super(i),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(a=>a*a))}}},"./src/models/encodec/feature_extraction_encodec.js":(e,r,t)=>{t.r(r),t.d(r,{EncodecFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{async _call(a){(0,s.validate_audio_inputs)(a,"EncodecFeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));const l=this.config.feature_size;if(a.length%l!==0)throw new Error(`The length of the audio data must be a multiple of the number of channels (${l}).`);const u=[1,l,a.length/l];return{input_values:new o.Tensor("float32",a,u)}}}},"./src/models/feature_extractors.js":(e,r,t)=>{t.r(r),t.d(r,{ASTFeatureExtractor:()=>s.ASTFeatureExtractor,ClapFeatureExtractor:()=>n.ClapFeatureExtractor,DacFeatureExtractor:()=>i.DacFeatureExtractor,EncodecFeatureExtractor:()=>o.EncodecFeatureExtractor,ImageFeatureExtractor:()=>v.ImageProcessor,MoonshineFeatureExtractor:()=>a.MoonshineFeatureExtractor,PyAnnoteFeatureExtractor:()=>l.PyAnnoteFeatureExtractor,SeamlessM4TFeatureExtractor:()=>u.SeamlessM4TFeatureExtractor,SnacFeatureExtractor:()=>p.SnacFeatureExtractor,SpeechT5FeatureExtractor:()=>c.SpeechT5FeatureExtractor,Wav2Vec2FeatureExtractor:()=>d.Wav2Vec2FeatureExtractor,WeSpeakerFeatureExtractor:()=>_.WeSpeakerFeatureExtractor,WhisperFeatureExtractor:()=>f.WhisperFeatureExtractor});var s=t("./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js"),o=t("./src/models/encodec/feature_extraction_encodec.js"),n=t("./src/models/clap/feature_extraction_clap.js"),i=t("./src/models/dac/feature_extraction_dac.js"),a=t("./src/models/moonshine/feature_extraction_moonshine.js"),l=t("./src/models/pyannote/feature_extraction_pyannote.js"),u=t("./src/models/seamless_m4t/feature_extraction_seamless_m4t.js"),p=t("./src/models/snac/feature_extraction_snac.js"),c=t("./src/models/speecht5/feature_extraction_speecht5.js"),d=t("./src/models/wav2vec2/feature_extraction_wav2vec2.js"),_=t("./src/models/wespeaker/feature_extraction_wespeaker.js"),f=t("./src/models/whisper/feature_extraction_whisper.js"),v=t("./src/base/image_processors_utils.js")},"./src/models/florence2/processing_florence2.js":(e,r,t)=>{t.r(r),t.d(r,{Florence2Processor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class i extends s.Processor{constructor(l,u){super(l,u);const{tasks_answer_post_processing_type:p,task_prompts_without_inputs:c,task_prompts_with_input:d}=this.image_processor.config;this.tasks_answer_post_processing_type=new Map(Object.entries(p??{})),this.task_prompts_without_inputs=new Map(Object.entries(c??{})),this.task_prompts_with_input=new Map(Object.entries(d??{})),this.regexes={quad_boxes:/(.+?)/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(l){typeof l=="string"&&(l=[l]);const u=[];for(const p of l)if(this.task_prompts_without_inputs.has(p))u.push(this.task_prompts_without_inputs.get(p));else{for(const[c,d]of this.task_prompts_with_input)if(p.includes(c)){u.push(d.replaceAll("{input}",p).replaceAll(c,""));break}u.length!==l.length&&u.push(p)}return u}post_process_generation(l,u,p){const c=this.tasks_answer_post_processing_type.get(u)??"pure_text";l=l.replaceAll("","").replaceAll("","");let d;switch(c){case"pure_text":d=l;break;case"description_with_bboxes":case"bboxes":case"phrase_grounding":case"ocr":const _=c==="ocr"?"quad_boxes":"bboxes",f=l.matchAll(this.regexes[_]),v=[],$=[];for(const[g,w,...C]of f)v.push(w?w.trim():v.at(-1)??""),$.push(C.map((E,x)=>(Number(E)+.5)/this.size_per_bin*p[x%2]));d={labels:v,[_]:$};break;default:throw new Error(`Task "${u}" (of type "${c}") not yet implemented.`)}return{[u]:d}}async _call(l,u=null,p={}){if(!l&&!u)throw new Error("Either text or images must be provided");const c=await this.image_processor(l,p),d=u?this.tokenizer(u,p):{};return{...c,...d}}}Y(i,"tokenizer_class",n.AutoTokenizer),Y(i,"image_processor_class",o.AutoImageProcessor)},"./src/models/glpn/image_processing_glpn.js":(e,r,t)=>{t.r(r),t.d(r,{GLPNFeatureExtractor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/grounding_dino/image_processing_grounding_dino.js":(e,r,t)=>{t.r(r),t.d(r,{GroundingDinoImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a){const l=await super._call(a),u=l.pixel_values.dims,p=(0,o.ones)([u[0],u[2],u[3]]);return{...l,pixel_mask:p}}}},"./src/models/grounding_dino/processing_grounding_dino.js":(e,r,t)=>{t.r(r),t.d(r,{GroundingDinoProcessor:()=>l});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),i=t("./src/base/image_processors_utils.js");function a(u,p){const d=u.dims.at(-1)-1,_=u.tolist();_.fill(!1,0,1),_.fill(!1,d);const f=p.tolist();return _.map((v,$)=>v?$:null).filter(v=>v!==null).map(v=>f[v])}class l extends s.Processor{async _call(p,c,d={}){const _=p?await this.image_processor(p,d):{};return{...c?this.tokenizer(c,d):{},..._}}post_process_grounded_object_detection(p,c,{box_threshold:d=.25,text_threshold:_=.25,target_sizes:f=null}={}){const{logits:v,pred_boxes:$}=p,g=v.dims[0];if(f!==null&&f.length!==g)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const w=v.dims.at(1),C=v.sigmoid(),E=C.max(-1).tolist(),x=$.tolist().map(y=>y.map(S=>(0,i.center_to_corners_format)(S))),b=[];for(let y=0;yR.map((Z,H)=>Z*S[(H+1)%2])));const F=E[y],z=[],K=[],q=[];for(let R=0;R{t.r(r),t.d(r,{Idefics3ImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{constructor(a){super(a),this.do_image_splitting=a.do_image_splitting??!0,this.max_image_size=a.max_image_size}get_resize_for_vision_encoder(a,l){let[u,p]=a.dims.slice(-2);const c=p/u;return p>=u?(p=Math.ceil(p/l)*l,u=Math.floor(p/c),u=Math.ceil(u/l)*l):(u=Math.ceil(u/l)*l,p=Math.floor(u*c),p=Math.ceil(p/l)*l),{height:u,width:p}}async _call(a,{do_image_splitting:l=null,return_row_col_info:u=!1}={}){let p;if(!Array.isArray(a))p=[[a]];else{if(a.length===0||!a[0])throw new Error("No images provided.");Array.isArray(a[0])?p=a:p=[a]}let c=[],d=[],_=[];const f=[],v=[];for(const y of p){let S=await Promise.all(y.map(K=>this.preprocess(K)));f.push(...S.map(K=>K.original_size)),v.push(...S.map(K=>K.reshaped_input_size)),S.forEach(K=>K.pixel_values.unsqueeze_(0));const{longest_edge:F}=this.max_image_size;let z;if(l??this.do_image_splitting){let K=new Array(S.length),q=new Array(S.length);z=await Promise.all(S.map(async(R,Z)=>{const H=this.get_resize_for_vision_encoder(R.pixel_values,F),J=await(0,o.interpolate_4d)(R.pixel_values,{size:[H.height,H.width]}),{frames:Q,num_splits_h:se,num_splits_w:fe}=await this.split_image(J,this.max_image_size);return K[Z]=se,q[Z]=fe,(0,o.cat)(Q,0)})),d.push(K),_.push(q)}else{const K=[F,F];z=await Promise.all(S.map(q=>(0,o.interpolate_4d)(q.pixel_values,{size:K}))),d.push(new Array(S.length).fill(0)),_.push(new Array(S.length).fill(0))}c.push((0,o.cat)(z,0))}const $=c.length,[g,w,C,E]=c[0].dims;let x,b;if($===1)x=c[0].unsqueeze_(0),b=(0,o.full)([$,g,C,E],!0);else{const y=Math.max(...c.map(z=>z.dims.at(0)));b=(0,o.full)([$,y,C,E],!0);const S=b.data,F=y*C*E;for(let z=0;z<$;++z){const K=c[z].dims[0];if(Ku||_>p){f=Math.ceil(d/u),v=Math.ceil(_/p);const $=Math.ceil(d/f),g=Math.ceil(_/v);for(let E=0;E{t.r(r),t.d(r,{Idefics3Processor:()=>p});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");var i=t("./src/utils/core.js");function a(c,d,_,f,v,$){let g="";for(let w=0;w`+v.repeat(c);g+=` -`}return g+=` -${f}${$}`+v.repeat(c)+`${f}`,g}function l(c,d,_,f){return`${d}${f}`+_.repeat(c)+`${d}`}function u(c,d,_,f,v,$){return c===0&&d===0?l(_,f,v,$):a(_,c,d,f,v,$)}class p extends s.Processor{constructor(){super(...arguments);Y(this,"fake_image_token","");Y(this,"image_token","");Y(this,"global_img_token","")}async _call(_,f=null,v={}){v.return_row_col_info??(v.return_row_col_info=!0);let $;f&&($=await this.image_processor(f,v)),Array.isArray(_)||(_=[_]);const g=$.rows??[new Array(_.length).fill(0)],w=$.cols??[new Array(_.length).fill(0)],C=this.config.image_seq_len,E=[],x=[];for(let y=0;y<_.length;++y){const S=_[y],F=g[y],z=w[y];E.push((0,i.count)(S,this.image_token));const K=F.map((Z,H)=>u(Z,z[H],C,this.fake_image_token,this.image_token,this.global_img_token)),q=S.split(this.image_token);if(q.length===0)throw new Error("The image token should be present in the text.");let R=q[0];for(let Z=0;Z{t.r(r),t.d(r,{BeitFeatureExtractor:()=>s.BeitFeatureExtractor,BitImageProcessor:()=>o.BitImageProcessor,CLIPFeatureExtractor:()=>i.CLIPFeatureExtractor,CLIPImageProcessor:()=>i.CLIPImageProcessor,ChineseCLIPFeatureExtractor:()=>n.ChineseCLIPFeatureExtractor,ConvNextFeatureExtractor:()=>a.ConvNextFeatureExtractor,ConvNextImageProcessor:()=>a.ConvNextImageProcessor,DPTFeatureExtractor:()=>c.DPTFeatureExtractor,DPTImageProcessor:()=>c.DPTImageProcessor,DeiTFeatureExtractor:()=>l.DeiTFeatureExtractor,DeiTImageProcessor:()=>l.DeiTImageProcessor,DetrFeatureExtractor:()=>u.DetrFeatureExtractor,DetrImageProcessor:()=>u.DetrImageProcessor,DonutFeatureExtractor:()=>p.DonutFeatureExtractor,DonutImageProcessor:()=>p.DonutImageProcessor,EfficientNetImageProcessor:()=>d.EfficientNetImageProcessor,GLPNFeatureExtractor:()=>_.GLPNFeatureExtractor,GroundingDinoImageProcessor:()=>f.GroundingDinoImageProcessor,Idefics3ImageProcessor:()=>v.Idefics3ImageProcessor,JinaCLIPImageProcessor:()=>g.JinaCLIPImageProcessor,LlavaOnevisionImageProcessor:()=>w.LlavaOnevisionImageProcessor,Mask2FormerImageProcessor:()=>C.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>E.MaskFormerFeatureExtractor,MaskFormerImageProcessor:()=>E.MaskFormerImageProcessor,MobileNetV1FeatureExtractor:()=>x.MobileNetV1FeatureExtractor,MobileNetV1ImageProcessor:()=>x.MobileNetV1ImageProcessor,MobileNetV2FeatureExtractor:()=>b.MobileNetV2FeatureExtractor,MobileNetV2ImageProcessor:()=>b.MobileNetV2ImageProcessor,MobileNetV3FeatureExtractor:()=>y.MobileNetV3FeatureExtractor,MobileNetV3ImageProcessor:()=>y.MobileNetV3ImageProcessor,MobileNetV4FeatureExtractor:()=>S.MobileNetV4FeatureExtractor,MobileNetV4ImageProcessor:()=>S.MobileNetV4ImageProcessor,MobileViTFeatureExtractor:()=>F.MobileViTFeatureExtractor,MobileViTImageProcessor:()=>F.MobileViTImageProcessor,NougatImageProcessor:()=>z.NougatImageProcessor,OwlViTFeatureExtractor:()=>q.OwlViTFeatureExtractor,OwlViTImageProcessor:()=>q.OwlViTImageProcessor,Owlv2ImageProcessor:()=>K.Owlv2ImageProcessor,Phi3VImageProcessor:()=>R.Phi3VImageProcessor,PvtImageProcessor:()=>Z.PvtImageProcessor,Qwen2VLImageProcessor:()=>H.Qwen2VLImageProcessor,RTDetrImageProcessor:()=>J.RTDetrImageProcessor,SamImageProcessor:()=>Q.SamImageProcessor,SegformerFeatureExtractor:()=>se.SegformerFeatureExtractor,SegformerImageProcessor:()=>se.SegformerImageProcessor,SiglipImageProcessor:()=>fe.SiglipImageProcessor,SmolVLMImageProcessor:()=>ae.SmolVLMImageProcessor,Swin2SRImageProcessor:()=>V.Swin2SRImageProcessor,VLMImageProcessor:()=>$.VLMImageProcessor,ViTFeatureExtractor:()=>A.ViTFeatureExtractor,ViTImageProcessor:()=>A.ViTImageProcessor,VitMatteImageProcessor:()=>U.VitMatteImageProcessor,VitPoseImageProcessor:()=>ee.VitPoseImageProcessor,YolosFeatureExtractor:()=>_e.YolosFeatureExtractor,YolosImageProcessor:()=>_e.YolosImageProcessor});var s=t("./src/models/beit/image_processing_beit.js"),o=t("./src/models/bit/image_processing_bit.js"),n=t("./src/models/chinese_clip/image_processing_chinese_clip.js"),i=t("./src/models/clip/image_processing_clip.js"),a=t("./src/models/convnext/image_processing_convnext.js"),l=t("./src/models/deit/image_processing_deit.js"),u=t("./src/models/detr/image_processing_detr.js"),p=t("./src/models/donut/image_processing_donut.js"),c=t("./src/models/dpt/image_processing_dpt.js"),d=t("./src/models/efficientnet/image_processing_efficientnet.js"),_=t("./src/models/glpn/image_processing_glpn.js"),f=t("./src/models/grounding_dino/image_processing_grounding_dino.js"),v=t("./src/models/idefics3/image_processing_idefics3.js"),$=t("./src/models/janus/image_processing_janus.js"),g=t("./src/models/jina_clip/image_processing_jina_clip.js"),w=t("./src/models/llava_onevision/image_processing_llava_onevision.js"),C=t("./src/models/mask2former/image_processing_mask2former.js"),E=t("./src/models/maskformer/image_processing_maskformer.js"),x=t("./src/models/mobilenet_v1/image_processing_mobilenet_v1.js"),b=t("./src/models/mobilenet_v2/image_processing_mobilenet_v2.js"),y=t("./src/models/mobilenet_v3/image_processing_mobilenet_v3.js"),S=t("./src/models/mobilenet_v4/image_processing_mobilenet_v4.js"),F=t("./src/models/mobilevit/image_processing_mobilevit.js"),z=t("./src/models/nougat/image_processing_nougat.js"),K=t("./src/models/owlv2/image_processing_owlv2.js"),q=t("./src/models/owlvit/image_processing_owlvit.js"),R=t("./src/models/phi3_v/image_processing_phi3_v.js"),Z=t("./src/models/pvt/image_processing_pvt.js"),H=t("./src/models/qwen2_vl/image_processing_qwen2_vl.js"),J=t("./src/models/rt_detr/image_processing_rt_detr.js"),Q=t("./src/models/sam/image_processing_sam.js"),se=t("./src/models/segformer/image_processing_segformer.js"),fe=t("./src/models/siglip/image_processing_siglip.js"),ae=t("./src/models/smolvlm/image_processing_smolvlm.js"),V=t("./src/models/swin2sr/image_processing_swin2sr.js"),A=t("./src/models/vit/image_processing_vit.js"),U=t("./src/models/vitmatte/image_processing_vitmatte.js"),ee=t("./src/models/vitpose/image_processing_vitpose.js"),_e=t("./src/models/yolos/image_processing_yolos.js")},"./src/models/janus/image_processing_janus.js":(e,r,t)=>{t.r(r),t.d(r,{VLMImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{constructor(i){super({do_pad:!0,pad_size:{width:i.image_size,height:i.image_size},...i}),this.constant_values=this.config.background_color.map(a=>a*this.rescale_factor)}pad_image(i,a,l,u){return super.pad_image(i,a,l,{constant_values:this.constant_values,center:!0,...u})}}},"./src/models/janus/processing_janus.js":(e,r,t)=>{t.r(r),t.d(r,{VLChatProcessor:()=>u});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),i=t("./src/utils/core.js"),a=t("./src/utils/tensor.js"),l=t("./src/utils/image.js");class u extends s.Processor{constructor(c,d){super(c,d),this.image_tag=this.config.image_tag,this.image_start_tag=this.config.image_start_tag,this.image_end_tag=this.config.image_end_tag,this.num_image_tokens=this.config.num_image_tokens}async _call(c,{images:d=null,chat_template:_="default"}={}){d?Array.isArray(d)||(d=[d]):d=await Promise.all(c.filter(z=>z.images).flatMap(z=>z.images).map(z=>l.RawImage.read(z)));const f=this.tokenizer,v=f.apply_chat_template(c,{tokenize:!1,add_generation_prompt:!0,chat_template:_}),$=z=>f.encode(z,{add_special_tokens:!1}),g=v.split(this.image_tag),w=g.length-1;if(d.length!==w)throw new Error(`Number of images provided (${d.length}) does not match number of "${this.image_tag}" image tags (${w})`);const[C,E,x]=f.model.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]);let b=$(g[0]),y=new Array(b.length).fill(!1);for(let z=1;z0){const z=await this.image_processor(d);return z.pixel_values.unsqueeze_(0),{...F,...z}}return F}}Y(u,"image_processor_class",o.AutoImageProcessor),Y(u,"tokenizer_class",n.AutoTokenizer),Y(u,"uses_processor_config",!0)},"./src/models/jina_clip/image_processing_jina_clip.js":(e,r,t)=>{t.r(r),t.d(r,{JinaCLIPImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{constructor(i){const{resize_mode:a,fill_color:l,interpolation:u,size:p,...c}=i,d=a==="squash"?{width:p,height:p}:a==="shortest"?{shortest_edge:p}:{longest_edge:p},_=u==="bicubic"?3:2;super({...c,size:d,resample:_,do_center_crop:!0,crop_size:p,do_normalize:!0})}}},"./src/models/jina_clip/processing_jina_clip.js":(e,r,t)=>{t.r(r),t.d(r,{JinaCLIPProcessor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class i extends s.Processor{async _call(l=null,u=null,p={}){if(!l&&!u)throw new Error("Either text or images must be provided");const c=l?this.tokenizer(l,p):{},d=u?await this.image_processor(u,p):{};return{...c,...d}}}Y(i,"tokenizer_class",n.AutoTokenizer),Y(i,"image_processor_class",o.AutoImageProcessor)},"./src/models/llava_onevision/image_processing_llava_onevision.js":(e,r,t)=>{t.r(r),t.d(r,{LlavaOnevisionImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/mask2former/image_processing_mask2former.js":(e,r,t)=>{t.r(r),t.d(r,{Mask2FormerImageProcessor:()=>o});var s=t("./src/models/maskformer/image_processing_maskformer.js");class o extends s.MaskFormerImageProcessor{}},"./src/models/maskformer/image_processing_maskformer.js":(e,r,t)=>{t.r(r),t.d(r,{MaskFormerFeatureExtractor:()=>n,MaskFormerImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_panoptic_segmentation(...a){return(0,s.post_process_panoptic_segmentation)(...a)}post_process_instance_segmentation(...a){return(0,s.post_process_instance_segmentation)(...a)}}class n extends o{}},"./src/models/mgp_str/processing_mgp_str.js":(e,r,t)=>{t.r(r),t.d(r,{MgpstrProcessor:()=>l});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),i=t("./src/utils/maths.js");const a={char:["char_decode",1],bpe:["bpe_decode",2],wp:["wp_decode",102]};class l extends s.Processor{get char_tokenizer(){return this.components.char_tokenizer}get bpe_tokenizer(){return this.components.bpe_tokenizer}get wp_tokenizer(){return this.components.wp_tokenizer}_decode_helper(p,c){if(!a.hasOwnProperty(c))throw new Error(`Format ${c} is not supported.`);const[d,_]=a[c],f=this[d].bind(this),[v,$]=p.dims,g=[],w=[],C=p.tolist();for(let x=0;x0?S.reduce((z,K)=>z*K,1):0;w.push(y),g.push(F)}return[f(w),g]}char_decode(p){return this.char_tokenizer.batch_decode(p).map(c=>c.replaceAll(" ",""))}bpe_decode(p){return this.bpe_tokenizer.batch_decode(p)}wp_decode(p){return this.wp_tokenizer.batch_decode(p).map(c=>c.replaceAll(" ",""))}batch_decode([p,c,d]){const[_,f]=this._decode_helper(p,"char"),[v,$]=this._decode_helper(c,"bpe"),[g,w]=this._decode_helper(d,"wp"),C=[],E=[];for(let x=0;x<_.length;++x){const[b,y]=(0,i.max)([f[x],$[x],w[x]]);C.push([_[x],v[x],g[x]][y]),E.push(b)}return{generated_text:C,scores:E,char_preds:_,bpe_preds:v,wp_preds:g}}static async from_pretrained(...p){const c=await super.from_pretrained(...p),d=await n.AutoTokenizer.from_pretrained("Xenova/gpt2"),_=await n.AutoTokenizer.from_pretrained("Xenova/bert-base-uncased");return c.components={image_processor:c.image_processor,char_tokenizer:c.tokenizer,bpe_tokenizer:d,wp_tokenizer:_},c}async _call(p,c=null){const d=await this.image_processor(p);return c&&(d.labels=this.tokenizer(c).input_ids),d}}Y(l,"tokenizer_class",n.AutoTokenizer),Y(l,"image_processor_class",o.AutoImageProcessor)},"./src/models/mobilenet_v1/image_processing_mobilenet_v1.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV1FeatureExtractor:()=>n,MobileNetV1ImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/mobilenet_v2/image_processing_mobilenet_v2.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV2FeatureExtractor:()=>n,MobileNetV2ImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/mobilenet_v3/image_processing_mobilenet_v3.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV3FeatureExtractor:()=>n,MobileNetV3ImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/mobilenet_v4/image_processing_mobilenet_v4.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV4FeatureExtractor:()=>n,MobileNetV4ImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/mobilevit/image_processing_mobilevit.js":(e,r,t)=>{t.r(r),t.d(r,{MobileViTFeatureExtractor:()=>n,MobileViTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/moonshine/feature_extraction_moonshine.js":(e,r,t)=>{t.r(r),t.d(r,{MoonshineFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{async _call(a){(0,s.validate_audio_inputs)(a,"MoonshineFeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));const l=[1,a.length];return{input_values:new o.Tensor("float32",a,l)}}}},"./src/models/moonshine/processing_moonshine.js":(e,r,t)=>{t.r(r),t.d(r,{MoonshineProcessor:()=>i});var s=t("./src/models/auto/feature_extraction_auto.js"),o=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",o.AutoTokenizer),Y(i,"feature_extractor_class",s.AutoFeatureExtractor)},"./src/models/nougat/image_processing_nougat.js":(e,r,t)=>{t.r(r),t.d(r,{NougatImageProcessor:()=>o});var s=t("./src/models/donut/image_processing_donut.js");class o extends s.DonutImageProcessor{}},"./src/models/owlv2/image_processing_owlv2.js":(e,r,t)=>{t.r(r),t.d(r,{Owlv2ImageProcessor:()=>o});var s=t("./src/models/owlvit/image_processing_owlvit.js");class o extends s.OwlViTImageProcessor{}},"./src/models/owlvit/image_processing_owlvit.js":(e,r,t)=>{t.r(r),t.d(r,{OwlViTFeatureExtractor:()=>n,OwlViTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_object_detection(...a){return(0,s.post_process_object_detection)(...a)}}class n extends o{}},"./src/models/owlvit/processing_owlvit.js":(e,r,t)=>{t.r(r),t.d(r,{OwlViTProcessor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class i extends s.Processor{}Y(i,"tokenizer_class",n.AutoTokenizer),Y(i,"image_processor_class",o.AutoImageProcessor)},"./src/models/paligemma/processing_paligemma.js":(e,r,t)=>{t.r(r),t.d(r,{PaliGemmaProcessor:()=>l});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");const i="";function a(u,p,c,d,_){return`${d.repeat(c*_)}${p}${u} -`}class l extends s.Processor{async _call(p,c=null,d={}){c||(console.warn("You are using PaliGemma without a text prefix. It will perform as a picture-captioning model."),c=""),Array.isArray(p)||(p=[p]),Array.isArray(c)||(c=[c]);const _=this.tokenizer.bos_token,f=this.image_processor.config.image_seq_length;let v;c.some(w=>w.includes(i))?v=c.map(w=>{const C=w.replaceAll(i,i.repeat(f)),E=C.lastIndexOf(i),x=E===-1?0:E+i.length;return C.slice(0,x)+_+C.slice(x)+` -`}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),v=c.map(w=>a(w,_,f,i,p.length)));const $=this.tokenizer(v,d);return{...await this.image_processor(p,d),...$}}}Y(l,"tokenizer_class",n.AutoTokenizer),Y(l,"image_processor_class",o.AutoImageProcessor),Y(l,"uses_processor_config",!1)},"./src/models/phi3_v/image_processing_phi3_v.js":(e,r,t)=>{t.r(r),t.d(r,{Phi3VImageProcessor:()=>p});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");const n=336,i=[2,3],{ceil:a,floor:l,sqrt:u}=Math;class p extends s.ImageProcessor{constructor(d){super({...d,do_normalize:!0,do_pad:!0,pad_size:"custom",do_convert_rgb:!0,do_resize:!0}),this._num_crops=d.num_crops}calc_num_image_tokens_from_image_size(d,_){const{num_img_tokens:f}=this.config;return l((l(_/n)*l(d/n)+1)*f+1+(l(_/n)+1)*u(f))}get_resize_output_image_size(d,_){const f=this._num_crops,[v,$]=d.size;let g=v/$,w=1;for(;w*Math.ceil(w/g)<=f;)w+=1;w-=1;const C=Math.floor(w*336),E=Math.floor(C/g);return[C,E]}pad_image(d,_,f,v={}){const[$,g]=_,w=n*a($/n),C=n*a(g/n),E=[1,1,1].map((x,b)=>(x-this.image_mean[b])/this.image_std[b]);return super.pad_image(d,_,{width:C,height:w},{center:!0,constant_values:E,...v})}async _call(d,{num_crops:_=null}={}){if(this._num_crops=_??(_=this.config.num_crops),_<4||u(_)%1!==0)throw new Error("num_crops must be a square number >= 4");Array.isArray(d)||(d=[d]);const f=d.length,v=await Promise.all(d.map(y=>this.preprocess(y))),$=v.map(y=>y.original_size),g=v.map(y=>y.reshaped_input_size),w=[];for(const{pixel_values:y}of v){y.unsqueeze_(0);const[S,F]=y.dims.slice(-2),z=await(0,o.interpolate_4d)(y,{size:[n,n],mode:"bicubic"});if(_>0){const K=[],q=u(_),R=l(F/q),Z=l(S/q);for(let J=0;Jy.map(S=>n*a(S/n))),x=new o.Tensor("int64",E.flat(),[f,2]),b=E.map(([y,S])=>this.calc_num_image_tokens_from_image_size(S,y));return{pixel_values:C,original_sizes:$,reshaped_input_sizes:g,image_sizes:x,num_img_tokens:b}}}},"./src/models/phi3_v/processing_phi3_v.js":(e,r,t)=>{t.r(r),t.d(r,{Phi3VProcessor:()=>l});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");const i="<|image|>",a=/<\|image_\d+\|>/g;class l extends s.Processor{async _call(p,c=null,{padding:d=!0,truncation:_=!0,num_crops:f=null}={}){Array.isArray(p)||(p=[p]);let v,$;if(c){$=await this.image_processor(c,{num_crops:f});const{num_img_tokens:g}=$,w=p.map((E,x)=>E.split(a).join(i.repeat(g[x])));v=this.tokenizer(w,{padding:d,truncation:_});const C=this.tokenizer.model.convert_tokens_to_ids([i])[0];v.input_ids.map_(E=>E==C?-E:E)}else v=this.tokenizer(p);return{...v,...$}}}Y(l,"image_processor_class",o.AutoImageProcessor),Y(l,"tokenizer_class",n.AutoTokenizer)},"./src/models/processors.js":(e,r,t)=>{t.r(r),t.d(r,{Florence2Processor:()=>s.Florence2Processor,GroundingDinoProcessor:()=>o.GroundingDinoProcessor,Idefics3Processor:()=>n.Idefics3Processor,JinaCLIPProcessor:()=>a.JinaCLIPProcessor,MgpstrProcessor:()=>l.MgpstrProcessor,MoonshineProcessor:()=>u.MoonshineProcessor,OwlViTProcessor:()=>p.OwlViTProcessor,PaliGemmaProcessor:()=>d.PaliGemmaProcessor,Phi3VProcessor:()=>c.Phi3VProcessor,PyAnnoteProcessor:()=>_.PyAnnoteProcessor,Qwen2VLProcessor:()=>f.Qwen2VLProcessor,SamProcessor:()=>v.SamProcessor,SmolVLMProcessor:()=>$.SmolVLMProcessor,SpeechT5Processor:()=>g.SpeechT5Processor,UltravoxProcessor:()=>w.UltravoxProcessor,VLChatProcessor:()=>i.VLChatProcessor,Wav2Vec2Processor:()=>C.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>E.Wav2Vec2ProcessorWithLM,WhisperProcessor:()=>x.WhisperProcessor});var s=t("./src/models/florence2/processing_florence2.js"),o=t("./src/models/grounding_dino/processing_grounding_dino.js"),n=t("./src/models/idefics3/processing_idefics3.js"),i=t("./src/models/janus/processing_janus.js"),a=t("./src/models/jina_clip/processing_jina_clip.js"),l=t("./src/models/mgp_str/processing_mgp_str.js"),u=t("./src/models/moonshine/processing_moonshine.js"),p=t("./src/models/owlvit/processing_owlvit.js"),c=t("./src/models/phi3_v/processing_phi3_v.js"),d=t("./src/models/paligemma/processing_paligemma.js"),_=t("./src/models/pyannote/processing_pyannote.js"),f=t("./src/models/qwen2_vl/processing_qwen2_vl.js"),v=t("./src/models/sam/processing_sam.js"),$=t("./src/models/smolvlm/processing_smolvlm.js"),g=t("./src/models/speecht5/processing_speecht5.js"),w=t("./src/models/ultravox/processing_ultravox.js"),C=t("./src/models/wav2vec2/processing_wav2vec2.js"),E=t("./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js"),x=t("./src/models/whisper/processing_whisper.js")},"./src/models/pvt/image_processing_pvt.js":(e,r,t)=>{t.r(r),t.d(r,{PvtImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/pyannote/feature_extraction_pyannote.js":(e,r,t)=>{t.r(r),t.d(r,{PyAnnoteFeatureExtractor:()=>i});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");class i extends s.FeatureExtractor{async _call(l){(0,s.validate_audio_inputs)(l,"PyAnnoteFeatureExtractor"),l instanceof Float64Array&&(l=new Float32Array(l));const u=[1,1,l.length];return{input_values:new o.Tensor("float32",l,u)}}samples_to_frames(l){return(l-this.config.offset)/this.config.step}post_process_speaker_diarization(l,u){const p=u/this.samples_to_frames(u)/this.config.sampling_rate,c=[];for(const d of l.tolist()){const _=[];let f=-1;for(let v=0;v({id:v,start:$*p,end:g*p,confidence:w/(g-$)})))}return c}}},"./src/models/pyannote/processing_pyannote.js":(e,r,t)=>{t.r(r),t.d(r,{PyAnnoteProcessor:()=>n});var s=t("./src/base/processing_utils.js"),o=t("./src/models/pyannote/feature_extraction_pyannote.js");class n extends s.Processor{async _call(a){return await this.feature_extractor(a)}post_process_speaker_diarization(...a){return this.feature_extractor.post_process_speaker_diarization(...a)}get sampling_rate(){return this.feature_extractor.config.sampling_rate}}Y(n,"feature_extractor_class",o.PyAnnoteFeatureExtractor)},"./src/models/qwen2_vl/image_processing_qwen2_vl.js":(e,r,t)=>{t.r(r),t.d(r,{Qwen2VLImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a,...l){const{pixel_values:u,original_sizes:p,reshaped_input_sizes:c}=await super._call(a,...l);let d=u;const{temporal_patch_size:_,merge_size:f,patch_size:v}=this.config;d.dims[0]===1&&(d=(0,o.cat)(Array.from({length:_},()=>d),0));const $=d.dims[0]/_,g=d.dims[1],w=Math.floor(d.dims[2]/v),C=Math.floor(d.dims[3]/v),E=d.view($,_,g,Math.floor(w/f),f,v,Math.floor(C/f),f,v).permute(0,3,6,4,7,2,1,5,8).view($*w*C,g*_*v*v),x=new o.Tensor("int64",[$,w,C],[1,3]);return{pixel_values:E,image_grid_thw:x,original_sizes:p,reshaped_input_sizes:c}}}},"./src/models/qwen2_vl/processing_qwen2_vl.js":(e,r,t)=>{t.r(r),t.d(r,{Qwen2VLProcessor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");class i extends s.Processor{async _call(l,u=null,...p){Array.isArray(l)||(l=[l]);let c,d;if(u&&(c=await this.image_processor(u),d=c.image_grid_thw),d){let f=this.image_processor.config.merge_size**2,v=0;const $=d.tolist();l=l.map(g=>{for(;g.includes("<|image_pad|>");){const w=Number($[v++].reduce((C,E)=>C*E,1n));g=g.replace("<|image_pad|>","<|placeholder|>".repeat(Math.floor(w/f)))}return g.replaceAll("<|placeholder|>","<|image_pad|>")})}return{...this.tokenizer(l),...c}}}Y(i,"image_processor_class",o.AutoImageProcessor),Y(i,"tokenizer_class",n.AutoTokenizer)},"./src/models/rt_detr/image_processing_rt_detr.js":(e,r,t)=>{t.r(r),t.d(r,{RTDetrImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_object_detection(...i){return(0,s.post_process_object_detection)(...i)}}},"./src/models/sam/image_processing_sam.js":(e,r,t)=>{t.r(r),t.d(r,{SamImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/core.js"),n=t("./src/utils/tensor.js");class i extends s.ImageProcessor{reshape_input_points(l,u,p,c=!1){l=structuredClone(l);let d=(0,o.calculateDimensions)(l);if(d.length===3)c||(d=[1,...d]),l=[l];else if(d.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let _=0;_c!==u.dims[d]))throw Error(`The first ${p.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new n.Tensor("int64",l.flat(1/0).map(BigInt),p)}async _call(l,{input_points:u=null,input_labels:p=null,input_boxes:c=null}={}){const d=await super._call(l);if(u&&(d.input_points=this.reshape_input_points(u,d.original_sizes,d.reshaped_input_sizes)),p){if(!d.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");d.input_labels=this.add_input_labels(p,d.input_points)}return c&&(d.input_boxes=this.reshape_input_points(c,d.original_sizes,d.reshaped_input_sizes,!0)),d}async post_process_masks(l,u,p,{mask_threshold:c=0,binarize:d=!0,pad_size:_=null}={}){const f=[];_=_??this.pad_size;const v=[_.height,_.width];for(let $=0;$c&&(x[b]=1);C=new n.Tensor("bool",x,C.dims)}f.push(C)}return f}generate_crop_boxes(l,u,{crop_n_layers:p=0,overlap_ratio:c=512/1500,points_per_crop:d=32,crop_n_points_downscale_factor:_=1}={}){}}},"./src/models/sam/processing_sam.js":(e,r,t)=>{t.r(r),t.d(r,{SamProcessor:()=>n});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js");class n extends s.Processor{async _call(...a){return await this.image_processor(...a)}post_process_masks(...a){return this.image_processor.post_process_masks(...a)}reshape_input_points(...a){return this.image_processor.reshape_input_points(...a)}}Y(n,"image_processor_class",o.AutoImageProcessor)},"./src/models/seamless_m4t/feature_extraction_seamless_m4t.js":(e,r,t)=>{t.r(r),t.d(r,{SeamlessM4TFeatureExtractor:()=>i});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js"),n=t("./src/utils/audio.js");class i extends s.FeatureExtractor{constructor(l){super(l);const u=this.config.sampling_rate,p=(0,n.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(u/2),u,null,"kaldi",!0);this.mel_filters=p,this.window=(0,n.window_function)(400,"povey",{periodic:!1})}async _extract_fbank_features(l,u){return l=l.map(p=>p*32768),(0,n.spectrogram)(l,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:u,transpose:!0})}async _call(l,{padding:u=!0,pad_to_multiple_of:p=2,do_normalize_per_mel_bins:c=!0,return_attention_mask:d=!0}={}){(0,s.validate_audio_inputs)(l,"SeamlessM4TFeatureExtractor");let _=await this._extract_fbank_features(l,this.config.max_length);if(c){const[x,b]=_.dims,y=_.data;for(let S=0;S0){const F=new Float32Array(b*(x+S));F.set(y),F.fill(this.config.padding_value,y.length);const z=x+S;_=new o.Tensor(_.type,F,[z,b]),d&&(f=new o.Tensor("int64",new BigInt64Array(z),[1,z]),f.data.fill(1n,0,x))}}const[v,$]=_.dims,g=this.config.stride;if(v%g!==0)throw new Error(`The number of frames (${v}) must be a multiple of the stride (${g}).`);const C=_.view(1,Math.floor(v/g),$*g),E={input_features:C};if(d){const x=C.dims[1],b=new BigInt64Array(x);if(f){const y=f.data;for(let S=1,F=0;S{t.r(r),t.d(r,{SegformerFeatureExtractor:()=>n,SegformerImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_semantic_segmentation(...a){return(0,s.post_process_semantic_segmentation)(...a)}}class n extends o{}},"./src/models/siglip/image_processing_siglip.js":(e,r,t)=>{t.r(r),t.d(r,{SiglipImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/smolvlm/image_processing_smolvlm.js":(e,r,t)=>{t.r(r),t.d(r,{SmolVLMImageProcessor:()=>s.Idefics3ImageProcessor});var s=t("./src/models/idefics3/image_processing_idefics3.js")},"./src/models/smolvlm/processing_smolvlm.js":(e,r,t)=>{t.r(r),t.d(r,{SmolVLMProcessor:()=>s.Idefics3Processor});var s=t("./src/models/idefics3/processing_idefics3.js")},"./src/models/snac/feature_extraction_snac.js":(e,r,t)=>{t.r(r),t.d(r,{SnacFeatureExtractor:()=>o});var s=t("./src/models/dac/feature_extraction_dac.js");class o extends s.DacFeatureExtractor{}},"./src/models/speecht5/feature_extraction_speecht5.js":(e,r,t)=>{t.r(r),t.d(r,{SpeechT5FeatureExtractor:()=>o});var s=t("./src/base/feature_extraction_utils.js");class o extends s.FeatureExtractor{}},"./src/models/speecht5/processing_speecht5.js":(e,r,t)=>{t.r(r),t.d(r,{SpeechT5Processor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/tokenizers.js"),n=t("./src/models/auto/feature_extraction_auto.js");class i extends s.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",o.AutoTokenizer),Y(i,"feature_extractor_class",n.AutoFeatureExtractor)},"./src/models/swin2sr/image_processing_swin2sr.js":(e,r,t)=>{t.r(r),t.d(r,{Swin2SRImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{pad_image(i,a,l,u={}){const[p,c,d]=a;return super.pad_image(i,a,{width:c+(l-c%l)%l,height:p+(l-p%l)%l},{mode:"symmetric",center:!1,constant_values:-1,...u})}}},"./src/models/ultravox/processing_ultravox.js":(e,r,t)=>{t.r(r),t.d(r,{UltravoxProcessor:()=>i});var s=t("./src/models/auto/feature_extraction_auto.js"),o=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l,u=null,p={}){if(Array.isArray(l))throw new Error("Batched inputs are not supported yet.");let c={};if(u){const _=u.length,{input_features:f}=await this.feature_extractor(u,{...p,max_length:_}),v=Math.round(_/this.config.encoder_ds_factor+1e-4),$=1+Math.ceil(v/this.config.stack_factor);c.audio_token_len=[$],c.audio_values=f;const g=this.config.audio_placeholder;if(!l.includes(g))throw new Error(`The input text does not contain the image token ${g}.`);l=l.replaceAll(g,g.repeat($))}return{...this.tokenizer(l,{add_special_tokens:!1,...p}),...c}}}Y(i,"tokenizer_class",o.AutoTokenizer),Y(i,"feature_extractor_class",s.AutoFeatureExtractor),Y(i,"uses_processor_config",!0)},"./src/models/vit/image_processing_vit.js":(e,r,t)=>{t.r(r),t.d(r,{ViTFeatureExtractor:()=>n,ViTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/vitmatte/image_processing_vitmatte.js":(e,r,t)=>{t.r(r),t.d(r,{VitMatteImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a,l){Array.isArray(a)||(a=[a]),Array.isArray(l)||(l=[l]);const u=await Promise.all(a.map(d=>this.preprocess(d))),p=await Promise.all(l.map(d=>this.preprocess(d,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:(0,o.stack)(u.map((d,_)=>(0,o.cat)([d.pixel_values,p[_].pixel_values],0)),0),original_sizes:u.map(d=>d.original_size),reshaped_input_sizes:u.map(d=>d.reshaped_input_size)}}}},"./src/models/vitpose/image_processing_vitpose.js":(e,r,t)=>{t.r(r),t.d(r,{VitPoseImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_pose_estimation(i,a,{threshold:l=null}={}){const u=i.tolist(),[p,c,d,_]=i.dims,f=[];for(let v=0;v{t.r(r),t.d(r,{Wav2Vec2FeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{_zero_mean_unit_var_norm(a){const u=a.reduce((c,d)=>c+d,0)/a.length,p=a.reduce((c,d)=>c+(d-u)**2,0)/a.length;return a.map(c=>(c-u)/Math.sqrt(p+1e-7))}async _call(a){(0,s.validate_audio_inputs)(a,"Wav2Vec2FeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));let l=a;this.config.do_normalize&&(l=this._zero_mean_unit_var_norm(l));const u=[1,l.length];return{input_values:new o.Tensor("float32",l,u),attention_mask:new o.Tensor("int64",new BigInt64Array(l.length).fill(1n),u)}}}},"./src/models/wav2vec2/processing_wav2vec2.js":(e,r,t)=>{t.r(r),t.d(r,{Wav2Vec2Processor:()=>i});var s=t("./src/tokenizers.js"),o=t("./src/models/auto/feature_extraction_auto.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",s.AutoTokenizer),Y(i,"feature_extractor_class",o.AutoFeatureExtractor)},"./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js":(e,r,t)=>{t.r(r),t.d(r,{Wav2Vec2ProcessorWithLM:()=>i});var s=t("./src/tokenizers.js"),o=t("./src/models/auto/feature_extraction_auto.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",s.AutoTokenizer),Y(i,"feature_extractor_class",o.AutoFeatureExtractor)},"./src/models/wespeaker/feature_extraction_wespeaker.js":(e,r,t)=>{t.r(r),t.d(r,{WeSpeakerFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var o=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a);const l=this.config.sampling_rate,u=(0,o.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(l/2),l,null,"kaldi",!0);this.mel_filters=u,this.window=(0,o.window_function)(400,"hamming",{periodic:!1}),this.min_num_frames=this.config.min_num_frames}async _extract_fbank_features(a){return a=a.map(l=>l*32768),(0,o.spectrogram)(a,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(a){(0,s.validate_audio_inputs)(a,"WeSpeakerFeatureExtractor");const l=(await this._extract_fbank_features(a)).unsqueeze_(0);if(this.config.fbank_centering_span===null){const u=l.mean(1).data,p=l.data,[c,d,_]=l.dims;for(let f=0;f{t.r(r),t.d(r,{WHISPER_LANGUAGE_MAPPING:()=>o,WHISPER_TO_LANGUAGE_CODE_MAPPING:()=>n,whisper_language_to_code:()=>i});const s=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],o=new Map(s),n=new Map([...s.map(([a,l])=>[l,a]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);function i(a){a=a.toLowerCase();let l=n.get(a);if(l===void 0){const u=a.match(/^<\|([a-z]{2})\|>$/);if(u&&(a=u[1]),o.has(a))l=a;else{const c=a.length===2?o.keys():o.values();throw new Error(`Language "${a}" is not supported. Must be one of: ${JSON.stringify(Array.from(c))}`)}}return l}},"./src/models/whisper/feature_extraction_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperFeatureExtractor:()=>i});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var o=t("./src/utils/audio.js"),n=t("./src/utils/maths.js");class i extends s.FeatureExtractor{constructor(l){var u;super(l),(u=this.config).mel_filters??(u.mel_filters=(0,o.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,"slaney","slaney")),this.window=(0,o.window_function)(this.config.n_fft,"hann")}async _extract_fbank_features(l){const u=await(0,o.spectrogram)(l,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:"log10",max_num_frames:Math.min(Math.floor(l.length/this.config.hop_length),this.config.nb_max_frames)}),p=u.data,c=(0,n.max)(p)[0];for(let d=0;dc?(l.length>this.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),p=l.slice(0,c)):(p=new Float32Array(c),p.set(l)),{input_features:(await this._extract_fbank_features(p)).unsqueeze_(0)}}}},"./src/models/whisper/generation_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperGenerationConfig:()=>o});var s=t("./src/generation/configuration_utils.js");class o extends s.GenerationConfig{constructor(){super(...arguments);Y(this,"return_timestamps",null);Y(this,"return_token_timestamps",null);Y(this,"num_frames",null);Y(this,"alignment_heads",null);Y(this,"task",null);Y(this,"language",null);Y(this,"no_timestamps_token_id",null);Y(this,"prompt_ids",null);Y(this,"is_multilingual",null);Y(this,"lang_to_id",null);Y(this,"task_to_id",null);Y(this,"max_initial_timestamp_index",1)}}},"./src/models/whisper/processing_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperProcessor:()=>i});var s=t("./src/models/auto/feature_extraction_auto.js"),o=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",o.AutoTokenizer),Y(i,"feature_extractor_class",s.AutoFeatureExtractor)},"./src/models/yolos/image_processing_yolos.js":(e,r,t)=>{t.r(r),t.d(r,{YolosFeatureExtractor:()=>n,YolosImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_object_detection(...a){return(0,s.post_process_object_detection)(...a)}}class n extends o{}},"./src/ops/registry.js":(e,r,t)=>{t.r(r),t.d(r,{TensorOpRegistry:()=>l});var s=t("./src/backends/onnx.js"),o=t("./src/utils/tensor.js"),n=t("./src/env.js");const i=n.apis.IS_BROWSER_ENV||n.apis.IS_WEBWORKER_ENV,a=async(u,p,c)=>{const d=await(0,s.createInferenceSession)(new Uint8Array(u),p);let _=Promise.resolve();return async f=>{const v=(0,s.isONNXProxy)(),$=Object.fromEntries(Object.entries(f).map(([w,C])=>[w,(v?C.clone():C).ort_tensor])),g=await(_=i?_.then(()=>d.run($)):d.run($));return Array.isArray(c)?c.map(w=>new o.Tensor(g[w])):new o.Tensor(g[c])}};class l{static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||(this._nearest_interpolate_4d=a([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,"y")),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||(this._bilinear_interpolate_4d=a([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||(this._bicubic_interpolate_4d=a([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||(this._matmul=a([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,"c")),this._matmul}static get stft(){return this._stft||(this._stft=a([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,"o")),this._stft}static get rfft(){return this._rfft||(this._rfft=a([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,"y")),this._rfft}static get top_k(){return this._top_k||(this._top_k=a([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,["v","i"])),this._top_k}static get slice(){return this._slice||(this._slice=a([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,"y")),this._slice}}Y(l,"session_options",{})},"./src/pipelines.js":(e,r,t)=>{t.r(r),t.d(r,{AudioClassificationPipeline:()=>q,AutomaticSpeechRecognitionPipeline:()=>Z,BackgroundRemovalPipeline:()=>se,DepthEstimationPipeline:()=>_e,DocumentQuestionAnsweringPipeline:()=>A,FeatureExtractionPipeline:()=>z,FillMaskPipeline:()=>C,ImageClassificationPipeline:()=>J,ImageFeatureExtractionPipeline:()=>K,ImageSegmentationPipeline:()=>Q,ImageToImagePipeline:()=>ee,ImageToTextPipeline:()=>H,ObjectDetectionPipeline:()=>ae,Pipeline:()=>v,QuestionAnsweringPipeline:()=>w,SummarizationPipeline:()=>x,Text2TextGenerationPipeline:()=>E,TextClassificationPipeline:()=>$,TextGenerationPipeline:()=>S,TextToAudioPipeline:()=>U,TokenClassificationPipeline:()=>g,TranslationPipeline:()=>b,ZeroShotAudioClassificationPipeline:()=>R,ZeroShotClassificationPipeline:()=>F,ZeroShotImageClassificationPipeline:()=>fe,ZeroShotObjectDetectionPipeline:()=>V,pipeline:()=>ze});var s=t("./src/tokenizers.js"),o=t("./src/models.js"),n=t("./src/models/auto/processing_auto.js");t("./src/base/processing_utils.js");var i=t("./src/utils/generic.js"),a=t("./src/utils/core.js"),l=t("./src/utils/maths.js"),u=t("./src/utils/audio.js"),p=t("./src/utils/tensor.js"),c=t("./src/utils/image.js");async function d(pe){return Array.isArray(pe)||(pe=[pe]),await Promise.all(pe.map(W=>c.RawImage.read(W)))}async function _(pe,W){return Array.isArray(pe)||(pe=[pe]),await Promise.all(pe.map(re=>typeof re=="string"||re instanceof URL?(0,u.read_audio)(re,W):re instanceof Float64Array?new Float32Array(re):re))}function f(pe,W){W&&(pe=pe.map(Se=>Se|0));const[re,G,be,we]=pe;return{xmin:re,ymin:G,xmax:be,ymax:we}}class v extends i.Callable{constructor({task:W,model:re,tokenizer:G=null,processor:be=null}){super(),this.task=W,this.model=re,this.tokenizer=G,this.processor=be}async dispose(){await this.model.dispose()}}class $ extends v{constructor(W){super(W)}async _call(W,{top_k:re=1}={}){const G=this.tokenizer(W,{padding:!0,truncation:!0}),be=await this.model(G),we=this.model.config.problem_type==="multi_label_classification"?$e=>$e.sigmoid():$e=>new p.Tensor("float32",(0,l.softmax)($e.data),$e.dims),Se=this.model.config.id2label,Pe=[];for(const $e of be.logits){const Fe=we($e),Be=await(0,p.topk)(Fe,re),He=Be[0].tolist(),ke=Be[1].tolist().map((Ve,Ze)=>({label:Se?Se[Ve]:`LABEL_${Ve}`,score:He[Ze]}));re===1?Pe.push(...ke):Pe.push(ke)}return Array.isArray(W)||re===1?Pe:Pe[0]}}class g extends v{constructor(W){super(W)}async _call(W,{ignore_labels:re=["O"]}={}){const G=Array.isArray(W),be=this.tokenizer(G?W:[W],{padding:!0,truncation:!0}),Se=(await this.model(be)).logits,Pe=this.model.config.id2label,$e=[];for(let Fe=0;FeIe==this.tokenizer.sep_token_id);$e[He].map((Ie,pt)=>Ie==1&&(pt===0||pt>ke&&Fe.findIndex(St=>St==qe[pt])===-1));const Ve=we[He].tolist(),Ze=Se[He].tolist();for(let Ie=1;Iept==qe[Ie])!==-1)&&(Ve[Ie]=-1/0,Ze[Ie]=-1/0);const st=(0,l.softmax)(Ve).map((Ie,pt)=>[Ie,pt]),at=(0,l.softmax)(Ze).map((Ie,pt)=>[Ie,pt]);st[0][0]=0,at[0][0]=0;const Ge=(0,a.product)(st,at).filter(Ie=>Ie[0][1]<=Ie[1][1]).map(Ie=>[Ie[0][1],Ie[1][1],Ie[0][0]*Ie[1][0]]).sort((Ie,pt)=>pt[2]-Ie[2]);for(let Ie=0;IeVe==this.tokenizer.mask_token_id);if(Fe===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);const Be=be[Pe][Fe],He=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(Be.data),Be.dims),re),qe=He[0].tolist(),ke=He[1].tolist();we.push(ke.map((Ve,Ze)=>{const st=$e.slice();return st[Fe]=Ve,{score:qe[Ze],token:Number(Ve),token_str:this.tokenizer.decode([Ve]),sequence:this.tokenizer.decode(st,{skip_special_tokens:!0})}}))}return Array.isArray(W)?we:we[0]}}class E extends v{constructor(re){super(re);Y(this,"_key","generated_text")}async _call(re,G={}){Array.isArray(re)||(re=[re]),this.model.config.prefix&&(re=re.map(Fe=>this.model.config.prefix+Fe));const be=this.model.config.task_specific_params;be&&be[this.task]&&be[this.task].prefix&&(re=re.map(Fe=>be[this.task].prefix+Fe));const we=this.tokenizer,Se={padding:!0,truncation:!0};let Pe;this instanceof b&&"_build_translation_inputs"in we?Pe=we._build_translation_inputs(re,Se,G):Pe=we(re,Se);const $e=await this.model.generate({...Pe,...G});return we.batch_decode($e,{skip_special_tokens:!0}).map(Fe=>({[this._key]:Fe}))}}class x extends E{constructor(re){super(re);Y(this,"_key","summary_text")}}class b extends E{constructor(re){super(re);Y(this,"_key","translation_text")}}function y(pe){return Array.isArray(pe)&&pe.every(W=>"role"in W&&"content"in W)}class S extends v{constructor(W){super(W)}async _call(W,re={}){let G=!1,be=!1,we;if(typeof W=="string")we=W=[W];else if(Array.isArray(W)&&W.every(ke=>typeof ke=="string"))G=!0,we=W;else{if(y(W))W=[W];else if(Array.isArray(W)&&W.every(y))G=!0;else throw new Error("Input must be a string, an array of strings, a Chat, or an array of Chats");be=!0,we=W.map(ke=>this.tokenizer.apply_chat_template(ke,{tokenize:!1,add_generation_prompt:!0}))}const Se=re.add_special_tokens??!1,Pe=be?!1:re.return_full_text??!0;this.tokenizer.padding_side="left";const $e=this.tokenizer(we,{add_special_tokens:Se,padding:!0,truncation:!0}),Fe=await this.model.generate({...$e,...re}),Be=this.tokenizer.batch_decode(Fe,{skip_special_tokens:!0});let He;!Pe&&$e.input_ids.dims.at(-1)>0&&(He=this.tokenizer.batch_decode($e.input_ids,{skip_special_tokens:!0}).map(ke=>ke.length));const qe=Array.from({length:W.length},ke=>[]);for(let ke=0;ke[re.toLowerCase(),G])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn("Could not find 'entailment' in label2id mapping. Using 2 as entailment_id."),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn("Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id."),this.contradiction_id=0)}async _call(W,re,{hypothesis_template:G="This example is {}.",multi_label:be=!1}={}){const we=Array.isArray(W);we||(W=[W]),Array.isArray(re)||(re=[re]);const Se=re.map(Fe=>G.replace("{}",Fe)),Pe=be||re.length===1,$e=[];for(const Fe of W){const Be=[];for(const ke of Se){const Ve=this.tokenizer(Fe,{text_pair:ke,padding:!0,truncation:!0}),Ze=await this.model(Ve);Pe?Be.push([Ze.logits.data[this.contradiction_id],Ze.logits.data[this.entailment_id]]):Be.push(Ze.logits.data[this.entailment_id])}const qe=(Pe?Be.map(ke=>(0,l.softmax)(ke)[1]):(0,l.softmax)(Be)).map((ke,Ve)=>[ke,Ve]).sort((ke,Ve)=>Ve[0]-ke[0]);$e.push({sequence:Fe,labels:qe.map(ke=>re[ke[1]]),scores:qe.map(ke=>ke[0])})}return we?$e:$e[0]}}class z extends v{constructor(W){super(W)}async _call(W,{pooling:re="none",normalize:G=!1,quantize:be=!1,precision:we="binary"}={}){const Se=this.tokenizer(W,{padding:!0,truncation:!0}),Pe=await this.model(Se);let $e=Pe.last_hidden_state??Pe.logits??Pe.token_embeddings;if(re!=="none")if(re==="mean")$e=(0,p.mean_pooling)($e,Se.attention_mask);else if(re==="cls")$e=$e.slice(null,0);else throw Error(`Pooling method '${re}' not supported.`);return G&&($e=$e.normalize(2,-1)),be&&($e=(0,p.quantize_embeddings)($e,we)),$e}}class K extends v{constructor(W){super(W)}async _call(W,{pool:re=null}={}){const G=await d(W),{pixel_values:be}=await this.processor(G),we=await this.model({pixel_values:be});let Se;if(re){if(!("pooler_output"in we))throw Error("No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.");Se=we.pooler_output}else Se=we.last_hidden_state??we.logits??we.image_embeds;return Se}}class q extends v{constructor(W){super(W)}async _call(W,{top_k:re=5}={}){const G=this.processor.feature_extractor.config.sampling_rate,be=await _(W,G),we=this.model.config.id2label,Se=[];for(const Pe of be){const $e=await this.processor(Pe),Be=(await this.model($e)).logits[0],He=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(Be.data),Be.dims),re),qe=He[0].tolist(),Ve=He[1].tolist().map((Ze,st)=>({label:we?we[Ze]:`LABEL_${Ze}`,score:qe[st]}));Se.push(Ve)}return Array.isArray(W)?Se:Se[0]}}class R extends v{constructor(W){super(W)}async _call(W,re,{hypothesis_template:G="This is a sound of {}."}={}){const be=!Array.isArray(W);be&&(W=[W]);const we=re.map(Be=>G.replace("{}",Be)),Se=this.tokenizer(we,{padding:!0,truncation:!0}),Pe=this.processor.feature_extractor.config.sampling_rate,$e=await _(W,Pe),Fe=[];for(const Be of $e){const He=await this.processor(Be),qe=await this.model({...Se,...He}),ke=(0,l.softmax)(qe.logits_per_audio.data);Fe.push([...ke].map((Ve,Ze)=>({score:Ve,label:re[Ze]})))}return be?Fe[0]:Fe}}class Z extends v{constructor(W){super(W)}async _call(W,re={}){switch(this.model.config.model_type){case"whisper":case"lite-whisper":return this._call_whisper(W,re);case"wav2vec2":case"wav2vec2-bert":case"unispeech":case"unispeech-sat":case"hubert":return this._call_wav2vec2(W,re);case"moonshine":return this._call_moonshine(W,re);default:throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(W,re){re.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),re.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');const G=!Array.isArray(W);G&&(W=[W]);const be=this.processor.feature_extractor.config.sampling_rate,we=await _(W,be),Se=[];for(const Pe of we){const $e=await this.processor(Pe),Be=(await this.model($e)).logits[0],He=[];for(const ke of Be)He.push((0,l.max)(ke.data)[1]);const qe=this.tokenizer.decode(He);Se.push({text:qe})}return G?Se[0]:Se}async _call_whisper(W,re){const G=re.return_timestamps??!1,be=re.chunk_length_s??0,we=re.force_full_sequences??!1;let Se=re.stride_length_s??null;const Pe={...re};G==="word"&&(Pe.return_token_timestamps=!0,Pe.return_timestamps=!1);const $e=!Array.isArray(W);$e&&(W=[W]);const Fe=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,Be=this.processor.feature_extractor.config.hop_length,He=this.processor.feature_extractor.config.sampling_rate,qe=await _(W,He),ke=[];for(const Ve of qe){let Ze=[];if(be>0){if(Se===null)Se=be/6;else if(be<=Se)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");const Ge=He*be,Ie=He*Se,pt=Ge-2*Ie;let St=0;for(;;){const Vt=St+Ge,zt=Ve.subarray(St,Vt),gr=await this.processor(zt),or=St===0,bt=Vt>=Ve.length;if(Ze.push({stride:[zt.length,or?0:Ie,bt?0:Ie],input_features:gr.input_features,is_last:bt}),bt)break;St+=pt}}else Ze=[{stride:[Ve.length,0,0],input_features:(await this.processor(Ve)).input_features,is_last:!0}];for(const Ge of Ze){Pe.num_frames=Math.floor(Ge.stride[0]/Be);const Ie=await this.model.generate({inputs:Ge.input_features,...Pe});G==="word"?(Ge.tokens=Ie.sequences.tolist()[0],Ge.token_timestamps=Ie.token_timestamps.tolist()[0].map(pt=>(0,l.round)(pt,2))):Ge.tokens=Ie[0].tolist(),Ge.stride=Ge.stride.map(pt=>pt/He)}const[st,at]=this.tokenizer._decode_asr(Ze,{time_precision:Fe,return_timestamps:G,force_full_sequences:we});ke.push({text:st,...at})}return $e?ke[0]:ke}async _call_moonshine(W,re){const G=!Array.isArray(W);G&&(W=[W]);const be=this.processor.feature_extractor.config.sampling_rate,we=await _(W,be),Se=[];for(const Pe of we){const $e=await this.processor(Pe),Fe=Math.floor(Pe.length/be)*6,Be=await this.model.generate({max_new_tokens:Fe,...re,...$e}),He=this.processor.batch_decode(Be,{skip_special_tokens:!0})[0];Se.push({text:He})}return G?Se[0]:Se}}class H extends v{constructor(W){super(W)}async _call(W,re={}){const G=Array.isArray(W),be=await d(W),{pixel_values:we}=await this.processor(be),Se=[];for(const Pe of we){Pe.dims=[1,...Pe.dims];const $e=await this.model.generate({inputs:Pe,...re}),Fe=this.tokenizer.batch_decode($e,{skip_special_tokens:!0}).map(Be=>({generated_text:Be.trim()}));Se.push(Fe)}return G?Se:Se[0]}}class J extends v{constructor(W){super(W)}async _call(W,{top_k:re=5}={}){const G=await d(W),{pixel_values:be}=await this.processor(G),we=await this.model({pixel_values:be}),Se=this.model.config.id2label,Pe=[];for(const $e of we.logits){const Fe=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)($e.data),$e.dims),re),Be=Fe[0].tolist(),qe=Fe[1].tolist().map((ke,Ve)=>({label:Se?Se[ke]:`LABEL_${ke}`,score:Be[Ve]}));Pe.push(qe)}return Array.isArray(W)?Pe:Pe[0]}}class Q extends v{constructor(W){super(W),this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(W,{threshold:re=.5,mask_threshold:G=.5,overlap_mask_area_threshold:be=.8,label_ids_to_fuse:we=null,target_sizes:Se=null,subtask:Pe=null}={}){if(Array.isArray(W)&&W.length!==1)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");const Fe=await d(W),Be=Fe.map(Ge=>[Ge.height,Ge.width]),He=await this.processor(Fe),{inputNames:qe,outputNames:ke}=this.model.sessions.model;if(!qe.includes("pixel_values")){if(qe.length!==1)throw Error(`Expected a single input name, but got ${qe.length} inputs: ${qe}.`);const Ge=qe[0];if(Ge in He)throw Error(`Input name ${Ge} already exists in the inputs.`);He[Ge]=He.pixel_values}const Ve=await this.model(He);let Ze=null;if(Pe!==null)Ze=this.subtasks_mapping[Pe];else if(this.processor.image_processor){for(const[Ge,Ie]of Object.entries(this.subtasks_mapping))if(Ie in this.processor.image_processor){Ze=this.processor.image_processor[Ie].bind(this.processor.image_processor),Pe=Ge;break}}const st=this.model.config.id2label,at=[];if(Pe)if(Pe==="panoptic"||Pe==="instance"){const Ge=Ze(Ve,re,G,be,we,Se??Be)[0],Ie=Ge.segmentation;for(const pt of Ge.segments_info){const St=new Uint8ClampedArray(Ie.data.length);for(let zt=0;ztgr<-1e-5||gr>1+1e-5)&&Vt.sigmoid_();const zt=await c.RawImage.fromTensor(Vt.mul_(255).to("uint8")).resize(St[1],St[0]);at.push({label:null,score:null,mask:zt})}}return at}}class se extends Q{constructor(W){super(W)}async _call(W,re={}){if(Array.isArray(W)&&W.length!==1)throw Error("Background removal pipeline currently only supports a batch size of 1.");const be=await d(W),we=await super._call(W,re);return be.map((Pe,$e)=>{const Fe=Pe.clone();return Fe.putAlpha(we[$e].mask),Fe})}}class fe extends v{constructor(W){super(W)}async _call(W,re,{hypothesis_template:G="This is a photo of {}"}={}){const be=Array.isArray(W),we=await d(W),Se=re.map(qe=>G.replace("{}",qe)),Pe=this.tokenizer(Se,{padding:this.model.config.model_type==="siglip"?"max_length":!0,truncation:!0}),{pixel_values:$e}=await this.processor(we),Fe=await this.model({...Pe,pixel_values:$e}),Be=this.model.config.model_type==="siglip"?qe=>qe.sigmoid().data:qe=>(0,l.softmax)(qe.data),He=[];for(const qe of Fe.logits_per_image){const Ve=[...Be(qe)].map((Ze,st)=>({score:Ze,label:re[st]}));Ve.sort((Ze,st)=>st.score-Ze.score),He.push(Ve)}return be?He:He[0]}}class ae extends v{constructor(W){super(W)}async _call(W,{threshold:re=.9,percentage:G=!1}={}){const be=Array.isArray(W);if(be&&W.length!==1)throw Error("Object detection pipeline currently only supports a batch size of 1.");const we=await d(W),Se=G?null:we.map(ke=>[ke.height,ke.width]),{pixel_values:Pe,pixel_mask:$e}=await this.processor(we),Fe=await this.model({pixel_values:Pe,pixel_mask:$e}),Be=this.processor.image_processor.post_process_object_detection(Fe,re,Se),He=this.model.config.id2label,qe=Be.map(ke=>ke.boxes.map((Ve,Ze)=>({score:ke.scores[Ze],label:He[ke.classes[Ze]],box:f(Ve,!G)})));return be?qe:qe[0]}}class V extends v{constructor(W){super(W)}async _call(W,re,{threshold:G=.1,top_k:be=null,percentage:we=!1}={}){const Se=Array.isArray(W),Pe=await d(W),$e=this.tokenizer(re,{padding:!0,truncation:!0}),Fe=await this.processor(Pe),Be=[];for(let He=0;He({score:at.scores[Ie],label:at.labels[Ie],box:f(Ge,!we)}))}else{const at=this.processor.image_processor.post_process_object_detection(Ze,G,ke,!0)[0];st=at.boxes.map((Ge,Ie)=>({score:at.scores[Ie],label:re[at.classes[Ie]],box:f(Ge,!we)}))}st.sort((at,Ge)=>Ge.score-at.score),be!==null&&(st=st.slice(0,be)),Be.push(st)}return Se?Be:Be[0]}}class A extends v{constructor(W){super(W)}async _call(W,re,G={}){const be=(await d(W))[0],{pixel_values:we}=await this.processor(be),Se=`${re}`,Pe=this.tokenizer(Se,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,$e=await this.model.generate({inputs:we,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:Pe,...G}),Be=this.tokenizer.batch_decode($e)[0].match(/(.*?)<\/s_answer>/);let He=null;return Be&&Be.length>=2&&(He=Be[1].trim()),[{answer:He}]}}class U extends v{constructor(re){super(re);Y(this,"DEFAULT_VOCODER_ID","Xenova/speecht5_hifigan");this.vocoder=re.vocoder??null}async _call(re,{speaker_embeddings:G=null}={}){return this.processor?this._call_text_to_spectrogram(re,{speaker_embeddings:G}):this._call_text_to_waveform(re)}async _call_text_to_waveform(re){const G=this.tokenizer(re,{padding:!0,truncation:!0}),{waveform:be}=await this.model(G),we=this.model.config.sampling_rate;return new u.RawAudio(be.data,we)}async _call_text_to_spectrogram(re,{speaker_embeddings:G}){if(this.vocoder||(console.log("No vocoder specified, using default HifiGan vocoder."),this.vocoder=await o.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:"fp32"})),(typeof G=="string"||G instanceof URL)&&(G=new Float32Array(await(await fetch(G)).arrayBuffer())),G instanceof Float32Array)G=new p.Tensor("float32",G,[1,G.length]);else if(!(G instanceof p.Tensor))throw new Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");const{input_ids:be}=this.tokenizer(re,{padding:!0,truncation:!0}),{waveform:we}=await this.model.generate_speech(be,G,{vocoder:this.vocoder}),Se=this.processor.feature_extractor.config.sampling_rate;return new u.RawAudio(we.data,Se)}}class ee extends v{constructor(W){super(W)}async _call(W){const re=await d(W),G=await this.processor(re),be=await this.model(G),we=[];for(const Se of be.reconstruction){const Pe=Se.squeeze().clamp_(0,1).mul_(255).round_().to("uint8");we.push(c.RawImage.fromTensor(Pe))}return we.length>1?we:we[0]}}class _e extends v{constructor(W){super(W)}async _call(W){const re=await d(W),G=await this.processor(re),{predicted_depth:be}=await this.model(G),we=[];for(let Se=0;Se1?we:we[0]}}const le=Object.freeze({"text-classification":{tokenizer:s.AutoTokenizer,pipeline:$,model:o.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:s.AutoTokenizer,pipeline:g,model:o.AutoModelForTokenClassification,default:{model:"Xenova/bert-base-multilingual-cased-ner-hrl"},type:"text"},"question-answering":{tokenizer:s.AutoTokenizer,pipeline:w,model:o.AutoModelForQuestionAnswering,default:{model:"Xenova/distilbert-base-cased-distilled-squad"},type:"text"},"fill-mask":{tokenizer:s.AutoTokenizer,pipeline:C,model:o.AutoModelForMaskedLM,default:{model:"Xenova/bert-base-uncased"},type:"text"},summarization:{tokenizer:s.AutoTokenizer,pipeline:x,model:o.AutoModelForSeq2SeqLM,default:{model:"Xenova/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:s.AutoTokenizer,pipeline:b,model:o.AutoModelForSeq2SeqLM,default:{model:"Xenova/t5-small"},type:"text"},"text2text-generation":{tokenizer:s.AutoTokenizer,pipeline:E,model:o.AutoModelForSeq2SeqLM,default:{model:"Xenova/flan-t5-small"},type:"text"},"text-generation":{tokenizer:s.AutoTokenizer,pipeline:S,model:o.AutoModelForCausalLM,default:{model:"Xenova/gpt2"},type:"text"},"zero-shot-classification":{tokenizer:s.AutoTokenizer,pipeline:F,model:o.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-mnli"},type:"text"},"audio-classification":{pipeline:q,model:o.AutoModelForAudioClassification,processor:n.AutoProcessor,default:{model:"Xenova/wav2vec2-base-superb-ks"},type:"audio"},"zero-shot-audio-classification":{tokenizer:s.AutoTokenizer,pipeline:R,model:o.AutoModel,processor:n.AutoProcessor,default:{model:"Xenova/clap-htsat-unfused"},type:"multimodal"},"automatic-speech-recognition":{tokenizer:s.AutoTokenizer,pipeline:Z,model:[o.AutoModelForSpeechSeq2Seq,o.AutoModelForCTC],processor:n.AutoProcessor,default:{model:"Xenova/whisper-tiny.en"},type:"multimodal"},"text-to-audio":{tokenizer:s.AutoTokenizer,pipeline:U,model:[o.AutoModelForTextToWaveform,o.AutoModelForTextToSpectrogram],processor:[n.AutoProcessor,null],default:{model:"Xenova/speecht5_tts"},type:"text"},"image-to-text":{tokenizer:s.AutoTokenizer,pipeline:H,model:o.AutoModelForVision2Seq,processor:n.AutoProcessor,default:{model:"Xenova/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:J,model:o.AutoModelForImageClassification,processor:n.AutoProcessor,default:{model:"Xenova/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:Q,model:[o.AutoModelForImageSegmentation,o.AutoModelForSemanticSegmentation,o.AutoModelForUniversalSegmentation],processor:n.AutoProcessor,default:{model:"Xenova/detr-resnet-50-panoptic"},type:"multimodal"},"background-removal":{pipeline:se,model:[o.AutoModelForImageSegmentation,o.AutoModelForSemanticSegmentation,o.AutoModelForUniversalSegmentation],processor:n.AutoProcessor,default:{model:"Xenova/modnet"},type:"image"},"zero-shot-image-classification":{tokenizer:s.AutoTokenizer,pipeline:fe,model:o.AutoModel,processor:n.AutoProcessor,default:{model:"Xenova/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:ae,model:o.AutoModelForObjectDetection,processor:n.AutoProcessor,default:{model:"Xenova/detr-resnet-50"},type:"multimodal"},"zero-shot-object-detection":{tokenizer:s.AutoTokenizer,pipeline:V,model:o.AutoModelForZeroShotObjectDetection,processor:n.AutoProcessor,default:{model:"Xenova/owlvit-base-patch32"},type:"multimodal"},"document-question-answering":{tokenizer:s.AutoTokenizer,pipeline:A,model:o.AutoModelForDocumentQuestionAnswering,processor:n.AutoProcessor,default:{model:"Xenova/donut-base-finetuned-docvqa"},type:"multimodal"},"image-to-image":{pipeline:ee,model:o.AutoModelForImageToImage,processor:n.AutoProcessor,default:{model:"Xenova/swin2SR-classical-sr-x2-64"},type:"image"},"depth-estimation":{pipeline:_e,model:o.AutoModelForDepthEstimation,processor:n.AutoProcessor,default:{model:"Xenova/dpt-large"},type:"image"},"feature-extraction":{tokenizer:s.AutoTokenizer,pipeline:z,model:o.AutoModel,default:{model:"Xenova/all-MiniLM-L6-v2"},type:"text"},"image-feature-extraction":{processor:n.AutoProcessor,pipeline:K,model:[o.AutoModelForImageFeatureExtraction,o.AutoModel],default:{model:"Xenova/vit-base-patch16-224-in21k"},type:"image"}}),ye=Object.freeze({"sentiment-analysis":"text-classification",ner:"token-classification",asr:"automatic-speech-recognition","text-to-speech":"text-to-audio",embeddings:"feature-extraction"});async function ze(pe,W=null,{progress_callback:re=null,config:G=null,cache_dir:be=null,local_files_only:we=!1,revision:Se="main",device:Pe=null,dtype:$e=null,subfolder:Fe="onnx",use_external_data_format:Be=null,model_file_name:He=null,session_options:qe={}}={}){pe=ye[pe]??pe;const ke=le[pe.split("_",1)[0]];if(!ke)throw Error(`Unsupported pipeline: ${pe}. Must be one of [${Object.keys(le)}]`);W||(W=ke.default.model,console.log(`No model specified. Using default model: "${W}".`));const Ve={progress_callback:re,config:G,cache_dir:be,local_files_only:we,revision:Se,device:Pe,dtype:$e,subfolder:Fe,use_external_data_format:Be,model_file_name:He,session_options:qe},Ze=new Map([["tokenizer",ke.tokenizer],["model",ke.model],["processor",ke.processor]]),st=await Ue(Ze,W,Ve);st.task=pe,(0,a.dispatchCallback)(re,{status:"ready",task:pe,model:W});const at=ke.pipeline;return new at(st)}async function Ue(pe,W,re){const G=Object.create(null),be=[];for(const[we,Se]of pe.entries()){if(!Se)continue;let Pe;Array.isArray(Se)?Pe=new Promise(async($e,Fe)=>{var He,qe;let Be;for(const ke of Se){if(ke===null){$e(null);return}try{$e(await ke.from_pretrained(W,re));return}catch(Ve){if((He=Ve.message)!=null&&He.includes("Unsupported model type"))Be=Ve;else if((qe=Ve.message)!=null&&qe.includes("Could not locate file"))Be=Ve;else{Fe(Ve);return}}}Fe(Be)}):Pe=Se.from_pretrained(W,re),G[we]=Pe,be.push(Pe)}await Promise.all(be);for(const[we,Se]of Object.entries(G))G[we]=await Se;return G}},"./src/tokenizers.js":(e,r,t)=>{t.r(r),t.d(r,{AlbertTokenizer:()=>Ft,AutoTokenizer:()=>Fs,BartTokenizer:()=>Ss,BertTokenizer:()=>yt,BlenderbotSmallTokenizer:()=>an,BlenderbotTokenizer:()=>on,BloomTokenizer:()=>ks,CLIPTokenizer:()=>ms,CamembertTokenizer:()=>es,CodeGenTokenizer:()=>os,CodeLlamaTokenizer:()=>Tr,CohereTokenizer:()=>un,ConvBertTokenizer:()=>wr,DebertaTokenizer:()=>rt,DebertaV2Tokenizer:()=>Bt,DistilBertTokenizer:()=>Or,ElectraTokenizer:()=>ts,EsmTokenizer:()=>it,FalconTokenizer:()=>Ae,GPT2Tokenizer:()=>jr,GPTNeoXTokenizer:()=>Je,GemmaTokenizer:()=>rs,Grok1Tokenizer:()=>ss,HerbertTokenizer:()=>Ht,LlamaTokenizer:()=>Is,M2M100Tokenizer:()=>cr,MBart50Tokenizer:()=>ps,MBartTokenizer:()=>Kr,MPNetTokenizer:()=>zr,MarianTokenizer:()=>sn,MgpstrTokenizer:()=>cn,MobileBertTokenizer:()=>ht,NllbTokenizer:()=>ns,NougatTokenizer:()=>Vs,PreTrainedTokenizer:()=>ve,Qwen2Tokenizer:()=>Rt,RoFormerTokenizer:()=>Xt,RobertaTokenizer:()=>$s,SiglipTokenizer:()=>rn,SpeechT5Tokenizer:()=>As,SqueezeBertTokenizer:()=>lt,T5Tokenizer:()=>Cs,TokenizerModel:()=>K,VitsTokenizer:()=>ln,Wav2Vec2CTCTokenizer:()=>nn,WhisperTokenizer:()=>hr,XLMRobertaTokenizer:()=>hs,XLMTokenizer:()=>ds,is_chinese_char:()=>C});var s=t("./src/utils/generic.js"),o=t("./src/utils/core.js"),n=t("./src/utils/hub.js"),i=t("./src/utils/maths.js"),a=t("./src/utils/tensor.js"),l=t("./src/utils/data-structures.js"),u=t("./node_modules/@huggingface/jinja/dist/index.js"),p=t("./src/models/whisper/common_whisper.js");async function c(de,k){const j=await Promise.all([(0,n.getModelJSON)(de,"tokenizer.json",!0,k),(0,n.getModelJSON)(de,"tokenizer_config.json",!0,k)]);return k.legacy!==null&&(j[1].legacy=k.legacy),j}function d(de,k){const j=[];let X=0;for(const ie of de.matchAll(k)){const ce=ie[0];X0&&j.push(ce),X=ie.index+ce.length}return X=19968&&de<=40959||de>=13312&&de<=19903||de>=131072&&de<=173791||de>=173824&&de<=177983||de>=177984&&de<=178207||de>=178208&&de<=183983||de>=63744&&de<=64255||de>=194560&&de<=195103}function E(de,k,j){const X=[];let ie=0;for(;iethis.tokens_to_ids.get(j)??this.unk_token_id)}convert_ids_to_tokens(k){return k.map(j=>this.vocab[j]??this.unk_token)}}class q extends K{constructor(k){super(k),this.tokens_to_ids=f(k.vocab),this.unk_token_id=this.tokens_to_ids.get(k.unk_token),this.unk_token=k.unk_token,this.max_input_chars_per_word=k.max_input_chars_per_word??100,this.vocab=new Array(this.tokens_to_ids.size);for(const[j,X]of this.tokens_to_ids)this.vocab[X]=j}encode(k){const j=[];for(const X of k){const ie=[...X];if(ie.length>this.max_input_chars_per_word){j.push(this.unk_token);continue}let ce=!1,xe=0;const Re=[];for(;xe0&&(Ye=this.config.continuing_subword_prefix+Ye),this.tokens_to_ids.has(Ye)){We=Ye;break}--Qe}if(We===null){ce=!0;break}Re.push(We),xe=Qe}ce?j.push(this.unk_token):j.push(...Re)}return j}}class R extends K{constructor(k,j){super(k);const X=k.vocab.length;this.vocab=new Array(X),this.scores=new Array(X);for(let ie=0;ie[ie,ce])),this.bos_token=" ",this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=j.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,i.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new l.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(k){const j=k.chars,X=1;let ie=0;for(;ie{const de=[...Array.from({length:94},(ie,ce)=>ce+33),...Array.from({length:12},(ie,ce)=>ce+161),...Array.from({length:82},(ie,ce)=>ce+174)],k=de.slice();let j=0;for(let ie=0;ie<256;++ie)de.includes(ie)||(de.push(ie),k.push(256+j),j+=1);const X=k.map(ie=>String.fromCharCode(ie));return Object.fromEntries(de.map((ie,ce)=>[ie,X[ce]]))})(),H=(0,o.reverseDictionary)(Z);class J extends K{constructor(k){super(k),this.tokens_to_ids=f(k.vocab),this.unk_token_id=this.tokens_to_ids.get(k.unk_token),this.unk_token=k.unk_token,this.vocab=new Array(this.tokens_to_ids.size);for(const[X,ie]of this.tokens_to_ids)this.vocab[ie]=X;const j=Array.isArray(k.merges[0]);this.merges=j?k.merges:k.merges.map(X=>X.split(" ",2)),this.bpe_ranks=new Map(this.merges.map((X,ie)=>[JSON.stringify(X),ie])),this.end_of_word_suffix=k.end_of_word_suffix,this.continuing_subword_suffix=k.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new l.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(k){if(k.length===0)return[];const j=this.cache.get(k);if(j!==void 0)return j;const X=Array.from(k);this.end_of_word_suffix&&(X[X.length-1]+=this.end_of_word_suffix);let ie=[];if(X.length>1){const ce=new l.PriorityQueue((Qe,We)=>Qe.score`<0x${Re.toString(16).toUpperCase().padStart(2,"0")}>`);xe.every(Re=>this.tokens_to_ids.has(Re))?j.push(...xe):j.push(this.unk_token)}else j.push(this.unk_token)}return j}}class Q extends K{constructor(k,j){super(k),this.tokens_to_ids=f(j.target_lang?k.vocab[j.target_lang]:k.vocab),this.bos_token=j.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=j.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=j.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=j.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=new Array(this.tokens_to_ids.size);for(const[X,ie]of this.tokens_to_ids)this.vocab[ie]=X}encode(k){return k}}class se extends s.Callable{constructor(k){super(),this.config=k}static fromConfig(k){if(k===null)return null;switch(k.type){case"BertNormalizer":return new pe(k);case"Precompiled":return new bt(k);case"Sequence":return new Ue(k);case"Replace":return new fe(k);case"NFC":return new V(k);case"NFD":return new A(k);case"NFKC":return new U(k);case"NFKD":return new ee(k);case"Strip":return new _e(k);case"StripAccents":return new le(k);case"Lowercase":return new ye(k);case"Prepend":return new ze(k);default:throw new Error(`Unknown Normalizer type: ${k.type}`)}}normalize(k){throw Error("normalize should be implemented in subclass.")}_call(k){return this.normalize(k)}}class fe extends se{normalize(k){const j=_(this.config.pattern);return j===null?k:k.replaceAll(j,this.config.content)}}class ae extends se{constructor(){super(...arguments);Y(this,"form")}normalize(j){return j=j.normalize(this.form),j}}class V extends ae{constructor(){super(...arguments);Y(this,"form","NFC")}}class A extends ae{constructor(){super(...arguments);Y(this,"form","NFD")}}class U extends ae{constructor(){super(...arguments);Y(this,"form","NFKC")}}class ee extends ae{constructor(){super(...arguments);Y(this,"form","NFKD")}}class _e extends se{normalize(k){return this.config.strip_left&&this.config.strip_right?k=k.trim():(this.config.strip_left&&(k=k.trimStart()),this.config.strip_right&&(k=k.trimEnd())),k}}class le extends se{normalize(k){return k=g(k),k}}class ye extends se{normalize(k){return k=k.toLowerCase(),k}}class ze extends se{normalize(k){return k=this.config.prepend+k,k}}class Ue extends se{constructor(k){super(k),this.normalizers=k.normalizers.map(j=>se.fromConfig(j))}normalize(k){return this.normalizers.reduce((j,X)=>X.normalize(j),k)}}class pe extends se{_tokenize_chinese_chars(k){const j=[];for(let X=0;Xthis.pre_tokenize_text(X,j)):this.pre_tokenize_text(k,j)).flat()}_call(k,j){return this.pre_tokenize(k,j)}}class re extends W{constructor(k){super(),this.pattern=new RegExp(`[^\\s${b}]+|[${b}]`,"gu")}pre_tokenize_text(k,j){return k.trim().match(this.pattern)||[]}}class G extends W{constructor(k){super(),this.config=k,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=new RegExp("'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+","gu"),this.byte_encoder=Z,this.text_encoder=new TextEncoder}pre_tokenize_text(k,j){return this.add_prefix_space&&!k.startsWith(" ")&&(k=" "+k),(this.use_regex?k.match(this.pattern)||[]:[k]).map(ie=>Array.from(this.text_encoder.encode(ie),ce=>this.byte_encoder[ce]).join(""))}}class be extends W{constructor(k){super(),this.config=k,this.pattern=_(this.config.pattern,this.config.invert)}pre_tokenize_text(k,j){var X;return this.pattern===null?[]:this.config.invert?k.match(this.pattern)||[]:((X=this.config.behavior)==null?void 0:X.toLowerCase())==="removed"?k.split(this.pattern).filter(ie=>ie):d(k,this.pattern)}}class we extends W{constructor(k){super(),this.config=k,this.pattern=new RegExp(`[^${b}]+|[${b}]+`,"gu")}pre_tokenize_text(k,j){return k.match(this.pattern)||[]}}class Se extends W{constructor(k){super(),this.config=k;const j=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=new RegExp(j,"gu")}pre_tokenize_text(k,j){return k.match(this.pattern)||[]}}class Pe extends s.Callable{constructor(k){super(),this.config=k}static fromConfig(k){if(k===null)return null;switch(k.type){case"TemplateProcessing":return new Be(k);case"ByteLevel":return new He(k);case"RobertaProcessing":return new Fe(k);case"BertProcessing":return new $e(k);case"Sequence":return new qe(k);default:throw new Error(`Unknown PostProcessor type: ${k.type}`)}}post_process(k,...j){throw Error("post_process should be implemented in subclass.")}_call(k,...j){return this.post_process(k,...j)}}class $e extends Pe{constructor(k){super(k),this.cls=k.cls[0],this.sep=k.sep[0]}post_process(k,j=null,{add_special_tokens:X=!0}={}){X&&(k=(0,o.mergeArrays)([this.cls],k,[this.sep]));let ie=new Array(k.length).fill(0);if(j!==null){const ce=X&&this instanceof Fe?[this.sep]:[],xe=X?[this.sep]:[];k=(0,o.mergeArrays)(k,ce,j,xe),ie=(0,o.mergeArrays)(ie,new Array(j.length+ce.length+xe.length).fill(1))}return{tokens:k,token_type_ids:ie}}}class Fe extends $e{}class Be extends Pe{constructor(k){super(k),this.single=k.single,this.pair=k.pair}post_process(k,j=null,{add_special_tokens:X=!0}={}){const ie=j===null?this.single:this.pair;let ce=[],xe=[];for(const Re of ie)"SpecialToken"in Re?X&&(ce.push(Re.SpecialToken.id),xe.push(Re.SpecialToken.type_id)):"Sequence"in Re&&(Re.Sequence.id==="A"?(ce=(0,o.mergeArrays)(ce,k),xe=(0,o.mergeArrays)(xe,new Array(k.length).fill(Re.Sequence.type_id))):Re.Sequence.id==="B"&&(ce=(0,o.mergeArrays)(ce,j),xe=(0,o.mergeArrays)(xe,new Array(j.length).fill(Re.Sequence.type_id))));return{tokens:ce,token_type_ids:xe}}}class He extends Pe{post_process(k,j=null){return j&&(k=(0,o.mergeArrays)(k,j)),{tokens:k}}}class qe extends Pe{constructor(k){super(k),this.processors=k.processors.map(j=>Pe.fromConfig(j))}post_process(k,j=null,X={}){let ie;for(const ce of this.processors)if(ce instanceof He)k=ce.post_process(k).tokens,j&&(j=ce.post_process(j).tokens);else{const xe=ce.post_process(k,j,X);k=xe.tokens,ie=xe.token_type_ids}return{tokens:k,token_type_ids:ie}}}class ke extends s.Callable{constructor(k){super(),this.config=k,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=k.trim_offsets}static fromConfig(k){if(k===null)return null;switch(k.type){case"WordPiece":return new Ge(k);case"Metaspace":return new or(k);case"ByteLevel":return new Ie(k);case"Replace":return new Ve(k);case"ByteFallback":return new Ze(k);case"Fuse":return new st(k);case"Strip":return new at(k);case"Sequence":return new St(k);case"CTC":return new pt(k);case"BPEDecoder":return new Vt(k);default:throw new Error(`Unknown Decoder type: ${k.type}`)}}_call(k){return this.decode(k)}decode(k){return this.decode_chain(k).join("")}decode_chain(k){throw Error("`decode_chain` should be implemented in subclass.")}}class Ve extends ke{decode_chain(k){const j=_(this.config.pattern);return j===null?k:k.map(X=>X.replaceAll(j,this.config.content))}}class Ze extends ke{constructor(k){super(k),this.text_decoder=new TextDecoder}decode_chain(k){const j=[];let X=[];for(const ie of k){let ce=null;if(ie.length===6&&ie.startsWith("<0x")&&ie.endsWith(">")){const xe=parseInt(ie.slice(3,5),16);isNaN(xe)||(ce=xe)}if(ce!==null)X.push(ce);else{if(X.length>0){const xe=this.text_decoder.decode(Uint8Array.from(X));j.push(xe),X=[]}j.push(ie)}}if(X.length>0){const ie=this.text_decoder.decode(Uint8Array.from(X));j.push(ie),X=[]}return j}}class st extends ke{decode_chain(k){return[k.join("")]}}class at extends ke{constructor(k){super(k),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(k){return k.map(j=>{let X=0;for(let ce=0;ce(X!==0&&(j.startsWith(this.config.prefix)?j=j.replace(this.config.prefix,""):j=" "+j),this.cleanup&&(j=$(j)),j))}}class Ie extends ke{constructor(k){super(k),this.byte_decoder=H,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(k){const j=k.join(""),X=new Uint8Array([...j].map(ce=>this.byte_decoder[ce]));return this.text_decoder.decode(X)}decode_chain(k){const j=[];let X=[];for(const ie of k)this.added_tokens.find(ce=>ce.content===ie)!==void 0?(X.length>0&&(j.push(this.convert_tokens_to_string(X)),X=[]),j.push(ie)):X.push(ie);return X.length>0&&j.push(this.convert_tokens_to_string(X)),j}}class pt extends ke{constructor(k){super(k),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(k){if(k.length===0)return"";const j=[k[0]];for(let ce=1;cece!==this.pad_token).join("");return this.cleanup&&(ie=$(ie).replaceAll(this.word_delimiter_token," ").trim()),ie}decode_chain(k){return[this.convert_tokens_to_string(k)]}}class St extends ke{constructor(k){super(k),this.decoders=k.decoders.map(j=>ke.fromConfig(j))}decode_chain(k){return this.decoders.reduce((j,X)=>X.decode_chain(j),k)}}class Vt extends ke{constructor(k){super(k),this.suffix=this.config.suffix}decode_chain(k){return k.map((j,X)=>j.replaceAll(this.suffix,X===k.length-1?"":" "))}}class zt extends ke{decode_chain(k){let j="";for(let X=1;XX.normalize("NFKC")).join("~"):k=k.normalize("NFKC"),k}}class Zr extends W{constructor(k){super(),this.tokenizers=k.pretokenizers.map(j=>W.fromConfig(j))}pre_tokenize_text(k,j){return this.tokenizers.reduce((X,ie)=>ie.pre_tokenize(X,j),[k])}}class D extends W{constructor(k){super()}pre_tokenize_text(k,j){return k.match(/\w+|[^\w\s]+/g)||[]}}class oe extends W{constructor(k){super()}pre_tokenize_text(k,j){return x(k)}}class B extends W{constructor(k){super(),this.config=k,this.pattern=_(this.config.pattern),this.content=this.config.content}pre_tokenize_text(k,j){return this.pattern===null?[k]:[k.replaceAll(this.pattern,this.config.content)]}}const te=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];function me(de,k,j,X){for(const ie of Object.keys(de)){const ce=k-de[ie].length,xe=j(ie),Re=new Array(ce).fill(xe);de[ie]=X==="right"?(0,o.mergeArrays)(de[ie],Re):(0,o.mergeArrays)(Re,de[ie])}}function Oe(de,k){for(const j of Object.keys(de))de[j].length=k}class ve extends s.Callable{constructor(j,X){super();Y(this,"return_token_type_ids",!1);Y(this,"padding_side","right");this._tokenizer_config=X,this.normalizer=se.fromConfig(j.normalizer),this.pre_tokenizer=W.fromConfig(j.pre_tokenizer),this.model=K.fromConfig(j.model,X),this.post_processor=Pe.fromConfig(j.post_processor),this.decoder=ke.fromConfig(j.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(const ie of j.added_tokens){const ce=new z(ie);this.added_tokens.push(ce),this.model.tokens_to_ids.set(ce.content,ce.id),this.model.vocab[ce.id]=ce.content,ce.special&&(this.special_tokens.push(ce.content),this.all_special_ids.push(ce.id))}if(this.additional_special_tokens=X.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_splitter=new l.DictionarySplitter(this.added_tokens.map(ie=>ie.content)),this.added_tokens_map=new Map(this.added_tokens.map(ie=>[ie.content,ie])),this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken("bos_token"),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken("eos_token"),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=X.model_max_length,this.remove_space=X.remove_space,this.clean_up_tokenization_spaces=X.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=X.do_lowercase_and_remove_accent??!1,X.padding_side&&(this.padding_side=X.padding_side),this.legacy=!1,this.chat_template=X.chat_template??null,Array.isArray(this.chat_template)){const ie=Object.create(null);for(const{name:ce,template:xe}of this.chat_template){if(typeof ce!="string"||typeof xe!="string")throw new Error('Chat template must be a list of objects with "name" and "template" properties');ie[ce]=xe}this.chat_template=ie}this._compiled_template_cache=new Map}getToken(...j){for(const X of j){const ie=this._tokenizer_config[X];if(ie)if(typeof ie=="object"){if(ie.__type==="AddedToken")return ie.content;throw Error(`Unknown token: ${ie}`)}else return ie}return null}static async from_pretrained(j,{progress_callback:X=null,config:ie=null,cache_dir:ce=null,local_files_only:xe=!1,revision:Re="main",legacy:Qe=null}={}){const We=await c(j,{progress_callback:X,config:ie,cache_dir:ce,local_files_only:xe,revision:Re,legacy:Qe});return new this(...We)}_call(j,{text_pair:X=null,add_special_tokens:ie=!0,padding:ce=!1,truncation:xe=null,max_length:Re=null,return_tensor:Qe=!0,return_token_type_ids:We=null}={}){const Ye=Array.isArray(j);let _t;if(Ye){if(j.length===0)throw Error("text array must be non-empty");if(X!==null){if(Array.isArray(X)){if(j.length!==X.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");_t=j.map((At,Jt)=>this._encode_plus(At,{text_pair:X[Jt],add_special_tokens:ie,return_token_type_ids:We}))}else _t=j.map(At=>this._encode_plus(At,{add_special_tokens:ie,return_token_type_ids:We}))}else{if(j==null)throw Error("text may not be null or undefined");if(Array.isArray(X))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");_t=[this._encode_plus(j,{text_pair:X,add_special_tokens:ie,return_token_type_ids:We})]}if(Re===null?Re=this.model_max_length:xe===null&&(ce===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),Re=this.model_max_length):ce===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),xe=!0)),ce===!0&&(Re=Math.min((0,i.max)(_t.map(At=>At.input_ids.length))[0],Re??1/0)),Re=Math.min(Re,this.model_max_length??1/0),ce||xe)for(let At=0;At<_t.length;++At)_t[At].input_ids.length!==Re&&(_t[At].input_ids.length>Re?xe&&Oe(_t[At],Re):ce&&me(_t[At],Re,Jt=>Jt==="input_ids"?this.pad_token_id:0,this.padding_side));const Ot={};if(Qe){if(!(ce&&xe)&&_t.some(Jt=>{var Ut;for(const mr of Object.keys(Jt))if(Jt[mr].length!==((Ut=_t[0][mr])==null?void 0:Ut.length))return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");const At=[_t.length,_t[0].input_ids.length];for(const Jt of Object.keys(_t[0]))Ot[Jt]=new a.Tensor("int64",BigInt64Array.from(_t.flatMap(Ut=>Ut[Jt]).map(BigInt)),At)}else{for(const At of Object.keys(_t[0]))Ot[At]=_t.map(Jt=>Jt[At]);if(!Ye)for(const At of Object.keys(Ot))Ot[At]=Ot[At][0]}return Ot}_encode_text(j){if(j===null)return null;const X=this.added_tokens_splitter.split(j);for(let ce=0;ce0&&(X[ce-1]=X[ce-1].trimEnd()),xe.rstrip&&ce{if(ce.length===0)return[];if(this.added_tokens_map.has(ce))return[ce];if(this.remove_space===!0&&(ce=ce.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(ce=w(ce)),this.normalizer!==null&&(ce=this.normalizer(ce)),ce.length===0)return[];const Re=this.pre_tokenizer!==null?this.pre_tokenizer(ce,{section_index:xe}):[ce];return this.model(Re)})}_encode_plus(j,{text_pair:X=null,add_special_tokens:ie=!0,return_token_type_ids:ce=null}={}){const{tokens:xe,token_type_ids:Re}=this._tokenize_helper(j,{pair:X,add_special_tokens:ie}),Qe=this.model.convert_tokens_to_ids(xe),We={input_ids:Qe,attention_mask:new Array(Qe.length).fill(1)};return(ce??this.return_token_type_ids)&&Re&&(We.token_type_ids=Re),We}_tokenize_helper(j,{pair:X=null,add_special_tokens:ie=!1}={}){const ce=this._encode_text(j),xe=this._encode_text(X);return this.post_processor?this.post_processor(ce,xe,{add_special_tokens:ie}):{tokens:(0,o.mergeArrays)(ce??[],xe??[])}}tokenize(j,{pair:X=null,add_special_tokens:ie=!1}={}){return this._tokenize_helper(j,{pair:X,add_special_tokens:ie}).tokens}encode(j,{text_pair:X=null,add_special_tokens:ie=!0,return_token_type_ids:ce=null}={}){return this._encode_plus(j,{text_pair:X,add_special_tokens:ie,return_token_type_ids:ce}).input_ids}batch_decode(j,X={}){return j instanceof a.Tensor&&(j=j.tolist()),j.map(ie=>this.decode(ie,X))}decode(j,X={}){if(j instanceof a.Tensor&&(j=v(j)),!Array.isArray(j)||j.length===0||!(0,o.isIntegralNumber)(j[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(j,X)}decode_single(j,{skip_special_tokens:X=!1,clean_up_tokenization_spaces:ie=null}){let ce=this.model.convert_ids_to_tokens(j);X&&(ce=ce.filter(Re=>!this.special_tokens.includes(Re)));let xe=this.decoder?this.decoder(ce):ce.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(xe=xe.replaceAll(this.decoder.end_of_word_suffix," "),X&&(xe=xe.trim())),(ie??this.clean_up_tokenization_spaces)&&(xe=$(xe)),xe}get_chat_template({chat_template:j=null,tools:X=null}={}){if(this.chat_template&&typeof this.chat_template=="object"){const ie=this.chat_template;if(j!==null&&Object.hasOwn(ie,j))j=ie[j];else if(j===null)if(X!==null&&"tool_use"in ie)j=ie.tool_use;else if("default"in ie)j=ie.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(ie).sort()}.`)}else if(j===null)if(this.chat_template)j=this.chat_template;else throw Error("Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating");return j}apply_chat_template(j,{tools:X=null,documents:ie=null,chat_template:ce=null,add_generation_prompt:xe=!1,tokenize:Re=!0,padding:Qe=!1,truncation:We=!1,max_length:Ye=null,return_tensor:_t=!0,return_dict:Ot=!1,tokenizer_kwargs:At={},...Jt}={}){if(ce=this.get_chat_template({chat_template:ce,tools:X}),typeof ce!="string")throw Error(`chat_template must be a string, but got ${typeof ce}`);let Ut=this._compiled_template_cache.get(ce);Ut===void 0&&(Ut=new u.Template(ce),this._compiled_template_cache.set(ce,Ut));const mr=Object.create(null);for(const Er of te){const Pr=this.getToken(Er);Pr&&(mr[Er]=Pr)}const br=Ut.render({messages:j,add_generation_prompt:xe,tools:X,documents:ie,...mr,...Jt});if(Re){const Er=this._call(br,{add_special_tokens:!1,padding:Qe,truncation:We,max_length:Ye,return_tensor:_t,...At});return Ot?Er:Er.input_ids}return br}}class yt extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Ft extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class ht extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class lt extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class rt extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Bt extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Ht extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class wr extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Xt extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Or extends ve{}class es extends ve{}class ds extends ve{constructor(j,X){super(j,X);Y(this,"return_token_type_ids",!0);console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class ts extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Cs extends ve{}class jr extends ve{}class Ss extends ve{}class Kr extends ve{constructor(k,j){super(k,j),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(X=>this.languageRegex.test(X)),this.lang_to_token=X=>X}_build_translation_inputs(k,j,X){return ur(this,k,j,X)}}class ps extends Kr{}class $s extends ve{}class ks extends ve{}const ir="▁";class Is extends ve{constructor(j,X){super(j,X);Y(this,"padding_side","left");this.legacy=X.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new gr({replacement:ir,add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(j){if(j===null)return null;if(this.legacy||j.length===0)return super._encode_text(j);let X=super._encode_text(ir+j.replaceAll(ir," "));return X.length>1&&X[0]===ir&&this.special_tokens.includes(X[1])&&(X=X.slice(1)),X}}class Tr extends ve{}class hs extends ve{}class zr extends ve{}class Ae extends ve{}class Je extends ve{}class it extends ve{}class Rt extends ve{}class rs extends ve{}class ss extends ve{}function ur(de,k,j,X){if(!("language_codes"in de)||!Array.isArray(de.language_codes))throw new Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in de)||!(de.languageRegex instanceof RegExp))throw new Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in de)||typeof de.lang_to_token!="function")throw new Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");const ie=X.src_lang,ce=X.tgt_lang;if(!de.language_codes.includes(ce))throw new Error(`Target language code "${ce}" is not valid. Must be one of: {${de.language_codes.join(", ")}}`);if(ie!==void 0){if(!de.language_codes.includes(ie))throw new Error(`Source language code "${ie}" is not valid. Must be one of: {${de.language_codes.join(", ")}}`);for(const xe of de.post_processor.config.single)if("SpecialToken"in xe&&de.languageRegex.test(xe.SpecialToken.id)){xe.SpecialToken.id=de.lang_to_token(ie);break}}return X.forced_bos_token_id=de.model.convert_tokens_to_ids([de.lang_to_token(ce)])[0],de._call(k,j)}class ns extends ve{constructor(k,j){super(k,j),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(X=>this.languageRegex.test(X)),this.lang_to_token=X=>X}_build_translation_inputs(k,j,X){return ur(this,k,j,X)}}class cr extends ve{constructor(k,j){super(k,j),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(X=>this.languageRegex.test(X)).map(X=>X.slice(2,-2)),this.lang_to_token=X=>`__${X}__`}_build_translation_inputs(k,j,X){return ur(this,k,j,X)}}class hr extends ve{get timestamp_begin(){return this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1}_decode_asr(k,{return_timestamps:j=!1,return_language:X=!1,time_precision:ie=null,force_full_sequences:ce=!0}={}){if(ie===null)throw Error("Must specify time_precision");let xe=null;const Re=j==="word";function Qe(){return{language:xe,timestamp:[null,null],text:""}}const We=[];let Ye=Qe(),_t=0;const Ot=this.timestamp_begin,Jt=Ot+1500;let Ut=[],mr=[],br=!1,Er=null;const Pr=new Set(this.all_special_ids);for(const Kt of k){const fr=Kt.tokens,Dr=Re?Kt.token_timestamps:null;let Hr=null,qr=Ot;if("stride"in Kt){const[Mr,er,dr]=Kt.stride;if(_t-=er,Er=Mr-dr,er&&(qr=er/ie+Ot),dr)for(let pr=fr.length-1;pr>=0;--pr){const Ir=Number(fr[pr]);if(Ir>=Ot){if(Hr!==null&&(Ir-Ot)*ie=Ot&&er<=Jt){const dr=(er-Ot)*ie+_t,pr=(0,i.round)(dr,2);if(Hr!==null&&er>=Hr)br=!0;else if(br||Ut.length>0&&er0?(Ut.push(kr),Re&&mr.push(Lr)):Ut.every(Mr=>Mr.length===0)&&(Ye=Qe(),Ut=[],kr=[],mr=[],Lr=[])}if(Ut.length>0){if(ce&&j)throw new Error("Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.");const[Kt,fr]=this.findLongestCommonSequence(Ut,mr),Dr=this.decode(Kt);Ye.text=Dr,Re&&(Ye.words=this.collateWordTimestamps(Kt,fr,xe)),We.push(Ye)}let Zt=Object.create(null);const fs=We.map(Kt=>Kt.text).join("");if(j||X){for(let Kt=0;Kt0;let Re=xe?[]:null,Qe=xe?j[0]:null;for(let We=1;Weer===qr[dr]&&Qe[fs+dr]<=j[We][Dr+dr]).length:kr=fr.filter((er,dr)=>er===qr[dr]).length;const Lr=Zt/1e4,Mr=kr/Zt+Lr;kr>1&&Mr>_t&&(_t=Mr,Ot=[fs,Kt,Dr,Hr])}const[Jt,Ut,mr,br]=Ot,Er=Math.floor((Ut+Jt)/2),Pr=Math.floor((br+mr)/2);ce.push(...X.slice(0,Er)),X=Ye.slice(Pr),ie=X.length,xe&&(Re.push(...Qe.slice(0,Er)),Qe=j[We].slice(Pr))}return ce.push(...X),xe?(Re.push(...Qe),[ce,Re]):[ce,[]]}collateWordTimestamps(k,j,X){const[ie,ce,xe]=this.combineTokensIntoWords(k,X),Re=[];for(let Qe=0;Qe=ie){const Re=((xe-ie)*X).toFixed(2);ce.push(`<|${Re}|>`),ce.push([])}else ce[ce.length-1].push(xe);return ce=ce.map(xe=>typeof xe=="string"?xe:super.decode(xe,j)),ce.join("")}splitTokensOnUnicode(k){const j=this.decode(k,{decode_with_timestamps:!0}),X="�",ie=[],ce=[],xe=[];let Re=[],Qe=[],We=0;for(let Ye=0;Ye=this.model.tokens_to_ids.get("<|endoftext|>"),Jt=Ye.startsWith(" "),Ut=Ye.trim(),mr=Qe.test(Ut);if(At||Jt||mr||ce.length===0)ce.push(Ye),xe.push(_t),Re.push(Ot);else{const br=ce.length-1;ce[br]+=Ye,xe[br].push(..._t),Re[br].push(...Ot)}}return[ce,xe,Re]}mergePunctuations(k,j,X,ie,ce){const xe=structuredClone(k),Re=structuredClone(j),Qe=structuredClone(X);let We=xe.length-2,Ye=xe.length-1;for(;We>=0;)xe[We].startsWith(" ")&&ie.includes(xe[We].trim())?(xe[Ye]=xe[We]+xe[Ye],Re[Ye]=(0,o.mergeArrays)(Re[We],Re[Ye]),Qe[Ye]=(0,o.mergeArrays)(Qe[We],Qe[Ye]),xe[We]="",Re[We]=[],Qe[We]=[]):Ye=We,--We;for(We=0,Ye=1;Ye_t),Re.filter(_t=>_t.length>0),Qe.filter(_t=>_t.length>0)]}}class os extends ve{}class ms extends ve{}class rn extends ve{}class sn extends ve{constructor(k,j){super(k,j),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(X=>this.languageRegex.test(X)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(k){if(k===null)return null;const[j,...X]=k.trim().split(this.languageRegex);if(X.length===0)return super._encode_text(j);if(X.length===2){const[ie,ce]=X;return this.supported_language_codes.includes(ie)||console.warn(`Unsupported language code "${ie}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,o.mergeArrays)([ie],super._encode_text(ce))}}}class nn extends ve{}class on extends ve{}class an extends ve{}class As extends ve{}class Vs extends ve{}class ln extends ve{constructor(k,j){super(k,j),this.decoder=new zt({})}}class un extends ve{}class cn extends ve{}class Fs{static async from_pretrained(k,{progress_callback:j=null,config:X=null,cache_dir:ie=null,local_files_only:ce=!1,revision:xe="main",legacy:Re=null}={}){var Ot;const[Qe,We]=await c(k,{progress_callback:j,config:X,cache_dir:ie,local_files_only:ce,revision:xe,legacy:Re}),Ye=((Ot=We.tokenizer_class)==null?void 0:Ot.replace(/Fast$/,""))??"PreTrainedTokenizer";let _t=this.TOKENIZER_CLASS_MAPPING[Ye];return _t||(console.warn(`Unknown tokenizer class "${Ye}", attempting to construct from base class.`),_t=ve),new _t(Qe,We)}}Y(Fs,"TOKENIZER_CLASS_MAPPING",{T5Tokenizer:Cs,DistilBertTokenizer:Or,CamembertTokenizer:es,DebertaTokenizer:rt,DebertaV2Tokenizer:Bt,BertTokenizer:yt,HerbertTokenizer:Ht,ConvBertTokenizer:wr,RoFormerTokenizer:Xt,XLMTokenizer:ds,ElectraTokenizer:ts,MobileBertTokenizer:ht,SqueezeBertTokenizer:lt,AlbertTokenizer:Ft,GPT2Tokenizer:jr,BartTokenizer:Ss,MBartTokenizer:Kr,MBart50Tokenizer:ps,RobertaTokenizer:$s,WhisperTokenizer:hr,CodeGenTokenizer:os,CLIPTokenizer:ms,SiglipTokenizer:rn,MarianTokenizer:sn,BloomTokenizer:ks,NllbTokenizer:ns,M2M100Tokenizer:cr,LlamaTokenizer:Is,CodeLlamaTokenizer:Tr,XLMRobertaTokenizer:hs,MPNetTokenizer:zr,FalconTokenizer:Ae,GPTNeoXTokenizer:Je,EsmTokenizer:it,Wav2Vec2CTCTokenizer:nn,BlenderbotTokenizer:on,BlenderbotSmallTokenizer:an,SpeechT5Tokenizer:As,NougatTokenizer:Vs,VitsTokenizer:ln,Qwen2Tokenizer:Rt,GemmaTokenizer:rs,Grok1Tokenizer:ss,CohereTokenizer:un,MgpstrTokenizer:cn,PreTrainedTokenizer:ve})},"./src/utils/audio.js":(e,r,t)=>{t.r(r),t.d(r,{RawAudio:()=>q,hamming:()=>d,hanning:()=>c,mel_filter_bank:()=>C,read_audio:()=>u,spectrogram:()=>S,window_function:()=>F});var s=t("./src/utils/hub.js"),o=t("./src/utils/maths.js"),n=t("./src/utils/core.js"),i=t("./src/env.js"),a=t("?7a2c"),l=t("./src/utils/tensor.js");async function u(R,Z){if(typeof AudioContext>"u")throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");const H=await(await(0,s.getFile)(R)).arrayBuffer(),J=new AudioContext({sampleRate:Z});typeof Z>"u"&&console.warn(`No sampling rate provided, using default of ${J.sampleRate}Hz.`);const Q=await J.decodeAudioData(H);let se;if(Q.numberOfChannels===2){const fe=Math.sqrt(2),ae=Q.getChannelData(0),V=Q.getChannelData(1);se=new Float32Array(ae.length);for(let A=0;A2595*Math.log10(1+R/700),kaldi:R=>1127*Math.log(1+R/700),slaney:(R,Z=1e3,H=15,J=27/Math.log(6.4))=>R>=Z?H+Math.log(R/Z)*J:3*R/200};function f(R,Z="htk"){const H=_[Z];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof R=="number"?H(R):R.map(J=>H(J))}const v={htk:R=>700*(10**(R/2595)-1),kaldi:R=>700*(Math.exp(R/1127)-1),slaney:(R,Z=1e3,H=15,J=Math.log(6.4)/27)=>R>=H?Z*Math.exp(J*(R-H)):200*R/3};function $(R,Z="htk"){const H=v[Z];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof R=="number"?H(R):R.map(J=>H(J))}function g(R,Z){const H=Float64Array.from({length:Z.length-1},(fe,ae)=>Z[ae+1]-Z[ae]),J=Array.from({length:R.length},()=>new Array(Z.length));for(let fe=0;fenew Array(R.length));for(let fe=0;feR+J*se)}function C(R,Z,H,J,Q,se=null,fe="htk",ae=!1){if(se!==null&&se!=="slaney")throw new Error('norm must be one of null or "slaney"');if(R<2)throw new Error(`Require num_frequency_bins: ${R} >= 2`);if(H>J)throw new Error(`Require min_frequency: ${H} <= max_frequency: ${J}`);const V=f(H,fe),A=f(J,fe),U=w(V,A,Z+2);let ee=$(U,fe),_e;if(ae){const ye=Q/((R-1)*2);_e=f(Float64Array.from({length:R},(ze,Ue)=>Ue*ye),fe),ee=U}else _e=w(0,Math.floor(Q/2),R);const le=g(_e,ee);if(se!==null&&se==="slaney")for(let ye=0;yeQ)throw Error(`frame_length (${H}) may not be larger than fft_length (${Q})`);if(be!==H)throw new Error(`Length of the window (${be}) must equal frame_length (${H})`);if(J<=0)throw new Error("hop_length must be greater than zero");if(se===null&&U!==null)throw new Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(fe){if(ae!=="reflect")throw new Error(`pad_mode="${ae}" not implemented yet.`);const st=Math.floor((Q-1)/2)+1;R=E(R,st,st)}let we=Math.floor(1+Math.floor((R.length-H)/J));pe!==null&&wewe?re&&($e=W):$e=Pe=W);const Fe=new o.FFT(Q),Be=new Float64Array(Q),He=new Float64Array(Fe.outputBufferSize),qe=new Float32Array(Se*$e);for(let st=0;st=1;--Ie)Be[Ie]-=A*Be[Ie-1];Be[0]*=1-A}for(let Ie=0;IeMath.pow(ae,.85));break;default:throw new Error(`Unknown window type ${Z}.`)}if(H&&(fe=fe.subarray(0,R)),J===null)return fe;if(R>J)throw new Error(`Length of the window (${R}) may not be larger than frame_length (${J})`);return fe}function z(R,Z){let H=44;const J=new ArrayBuffer(H+R.length*4),Q=new DataView(J);K(Q,0,"RIFF"),Q.setUint32(4,36+R.length*4,!0),K(Q,8,"WAVE"),K(Q,12,"fmt "),Q.setUint32(16,16,!0),Q.setUint16(20,3,!0),Q.setUint16(22,1,!0),Q.setUint32(24,Z,!0),Q.setUint32(28,Z*4,!0),Q.setUint16(32,4,!0),Q.setUint16(34,32,!0),K(Q,36,"data"),Q.setUint32(40,R.length*4,!0);for(let se=0;se{let se=await Q.arrayBuffer();a.writeFileSync(J,Buffer.from(se))};else throw new Error("Unable to save because filesystem is disabled in this environment.");await H(Z,this.toBlob())}}},"./src/utils/constants.js":(e,r,t)=>{t.r(r),t.d(r,{CHAT_TEMPLATE_NAME:()=>l,CONFIG_NAME:()=>o,FEATURE_EXTRACTOR_NAME:()=>n,GENERATION_CONFIG_NAME:()=>u,GITHUB_ISSUE_URL:()=>s,IMAGE_PROCESSOR_NAME:()=>i,PROCESSOR_NAME:()=>a});const s="https://github.com/huggingface/transformers.js/issues/new/choose",o="config.json",n="preprocessor_config.json",i=n,a="processor_config.json",l="chat_template.json",u="generation_config.json"},"./src/utils/core.js":(e,r,t)=>{t.r(r),t.d(r,{calculateDimensions:()=>u,calculateReflectOffset:()=>_,count:()=>g,dispatchCallback:()=>s,escapeRegExp:()=>n,isIntegralNumber:()=>a,isNullishDimension:()=>l,isTypedArray:()=>i,len:()=>$,mergeArrays:()=>c,pick:()=>v,pop:()=>p,product:()=>d,reverseDictionary:()=>o,saveBlob:()=>f});function s(w,C){w&&w(C)}function o(w){return Object.fromEntries(Object.entries(w).map(([C,E])=>[E,C]))}function n(w){return w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i(w){var C,E,x;return((x=(E=(C=w==null?void 0:w.prototype)==null?void 0:C.__proto__)==null?void 0:E.constructor)==null?void 0:x.name)==="TypedArray"}function a(w){return Number.isInteger(w)||typeof w=="bigint"}function l(w){return w==null||w===-1}function u(w){const C=[];let E=w;for(;Array.isArray(E);)C.push(E.length),E=E[0];return C}function p(w,C,E=void 0){const x=w[C];if(x!==void 0)return delete w[C],x;if(E===void 0)throw Error(`Key ${C} does not exist in object.`);return E}function c(...w){return Array.prototype.concat.apply([],w)}function d(...w){return w.reduce((C,E)=>C.flatMap(x=>E.map(b=>[x,b])))}function _(w,C){return Math.abs((w+C)%(2*C)-C)}function f(w,C){const E=URL.createObjectURL(C),x=document.createElement("a");x.href=E,x.download=w,x.click(),x.remove(),URL.revokeObjectURL(E)}function v(w,C){return Object.assign({},...C.map(E=>{if(w[E]!==void 0)return{[E]:w[E]}}))}function $(w){let C=0;for(const E of w)++C;return C}function g(w,C){let E=0;for(const x of w)x===C&&++E;return E}},"./src/utils/data-structures.js":(e,r,t)=>{t.r(r),t.d(r,{CharTrie:()=>o,DictionarySplitter:()=>l,LRUCache:()=>u,PriorityQueue:()=>s,TokenLattice:()=>i});class s{constructor(c=(_,f)=>_>f,d=1/0){this._heap=[],this._comparator=c,this._maxSize=d}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...c){return this.extend(c)}extend(c){for(const d of c)if(this.size0&&this._swap(0,d),this._heap.pop(),this._siftDown(),c}replace(c){const d=this.peek();return this._heap[0]=c,this._siftDown(),d}_parent(c){return(c+1>>>1)-1}_left(c){return(c<<1)+1}_right(c){return c+1<<1}_greater(c,d){return this._comparator(this._heap[c],this._heap[d])}_swap(c,d){const _=this._heap[c];this._heap[c]=this._heap[d],this._heap[d]=_}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(c){for(;c>0&&this._greater(c,this._parent(c));)this._swap(c,this._parent(c)),c=this._parent(c)}_siftDown(){let c=0;for(;this._left(c)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);const f=new a(this.bosTokenId,0,0,0,0),v=new a(this.eosTokenId,1,this.len,0,0);this.nodes.push(f.clone()),this.nodes.push(v.clone()),this.beginNodes[this.len].push(v),this.endNodes[0].push(f)}insert(c,d,_,f){const v=this.nodes.length,$=new a(f,v,c,d,_);this.beginNodes[c].push($),this.endNodes[c+d].push($),this.nodes.push($)}viterbi(){const c=this.len;let d=0;for(;d<=c;){if(this.beginNodes[d].length==0)return[];for(let g of this.beginNodes[d]){g.prev=null;let w=0,C=null;for(let E of this.endNodes[d]){const x=E.backtraceScore+g.score;(C===null||x>w)&&(C=E.clone(),w=x)}if(C!==null)g.prev=C,g.backtraceScore=w;else return[]}++d}const _=[],v=this.beginNodes[c][0].prev;if(v===null)return[];let $=v.clone();for(;$.prev!==null;)_.push($.clone()),$=$.clone().prev.clone();return _.reverse(),_}piece(c){return this.chars.slice(c.pos,c.pos+c.length).join("")}tokens(){return this.viterbi().map(d=>this.piece(d))}tokenIds(){return this.viterbi().map(d=>d.tokenId)}}class a{constructor(c,d,_,f,v){this.tokenId=c,this.nodeId=d,this.pos=_,this.length=f,this.score=v,this.prev=null,this.backtraceScore=0}clone(){const c=new a(this.tokenId,this.nodeId,this.pos,this.length,this.score);return c.prev=this.prev,c.backtraceScore=this.backtraceScore,c}}class l{constructor(c){this.trie=this._buildTrie(c)}_buildTrie(c){var _;const d=Object.create(null);for(const f of c){let v=d;for(let $=0;$f&&d.push(c.slice(f,v)),d.push(g),v+=g.length,f=v):++v}return f<_&&d.push(c.slice(f)),d}}class u{constructor(c){this.capacity=c,this.cache=new Map}get(c){if(!this.cache.has(c))return;const d=this.cache.get(c);return this.cache.delete(c),this.cache.set(c,d),d}put(c,d){this.cache.has(c)&&this.cache.delete(c),this.cache.set(c,d),this.cache.size>this.capacity&&this.cache.delete(this.cache.keys().next().value)}clear(){this.cache.clear()}}},"./src/utils/devices.js":(e,r,t)=>{t.r(r),t.d(r,{DEVICE_TYPES:()=>s});const s=Object.freeze({auto:"auto",gpu:"gpu",cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:"webnn","webnn-npu":"webnn-npu","webnn-gpu":"webnn-gpu","webnn-cpu":"webnn-cpu"})},"./src/utils/dtypes.js":(e,r,t)=>{t.r(r),t.d(r,{DATA_TYPES:()=>i,DEFAULT_DEVICE_DTYPE_MAPPING:()=>a,DEFAULT_DTYPE_SUFFIX_MAPPING:()=>l,isWebGpuFp16Supported:()=>n});var s=t("./src/env.js"),o=t("./src/utils/devices.js");const n=function(){let u;return async function(){if(u===void 0)if(!s.apis.IS_WEBGPU_AVAILABLE)u=!1;else try{u=(await navigator.gpu.requestAdapter()).features.has("shader-f16")}catch{u=!1}return u}}(),i=Object.freeze({auto:"auto",fp32:"fp32",fp16:"fp16",q8:"q8",int8:"int8",uint8:"uint8",q4:"q4",bnb4:"bnb4",q4f16:"q4f16"}),a=Object.freeze({[o.DEVICE_TYPES.wasm]:i.q8}),l=Object.freeze({[i.fp32]:"",[i.fp16]:"_fp16",[i.int8]:"_int8",[i.uint8]:"_uint8",[i.q8]:"_quantized",[i.q4]:"_q4",[i.q4f16]:"_q4f16",[i.bnb4]:"_bnb4"})},"./src/utils/generic.js":(e,r,t)=>{t.r(r),t.d(r,{Callable:()=>s});const s=class{constructor(){let o=function(...n){return o._call(...n)};return Object.setPrototypeOf(o,new.target.prototype)}_call(...o){throw Error("Must implement _call method in subclass")}}},"./src/utils/hub.js":(e,r,t)=>{t.r(r),t.d(r,{MAX_EXTERNAL_DATA_CHUNKS:()=>a,getFile:()=>_,getModelFile:()=>w,getModelJSON:()=>C});var s=t("?7a2c"),o=t("?a42a"),n=t("./src/env.js"),i=t("./src/utils/core.js");const a=100,l={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"};class u{constructor(y){if(this.filePath=y,this.headers=new Headers,this.exists=s.existsSync(y),this.exists){this.status=200,this.statusText="OK";let S=s.statSync(y);this.headers.set("content-length",S.size.toString()),this.updateContentType();const F=s.createReadStream(y);this.body=new ReadableStream({start(z){F.on("data",K=>z.enqueue(K)),F.on("end",()=>z.close()),F.on("error",K=>z.error(K))},cancel(){F.destroy()}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){const y=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",l[y]??"application/octet-stream")}clone(){let y=new u(this.filePath);return y.exists=this.exists,y.status=this.status,y.statusText=this.statusText,y.headers=new Headers(this.headers),y}async arrayBuffer(){return(await s.promises.readFile(this.filePath)).buffer}async blob(){const y=await s.promises.readFile(this.filePath);return new Blob([y],{type:this.headers.get("content-type")})}async text(){return await s.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function p(b,y=null,S=null){let F;try{F=new URL(b)}catch{return!1}return!(y&&!y.includes(F.protocol)||S&&!S.includes(F.hostname))}const c=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function d(b){return!(!c.test(b)||b.includes("..")||b.includes("--")||b.endsWith(".git")||b.endsWith(".ipynb"))}async function _(b){var y;if(n.env.useFS&&!p(b,["http:","https:","blob:"]))return new u(b instanceof URL?b.protocol==="file:"?b.pathname:b.toString():b);if(typeof process<"u"&&((y=process==null?void 0:process.release)==null?void 0:y.name)==="node"){const S=!!(Rs!=null&&Rs.TESTING_REMOTELY),F=n.env.version,z=new Headers;if(z.set("User-Agent",`transformers.js/${F}; is_ci/${S};`),p(b,["http:","https:"],["huggingface.co","hf.co"])){const q=(Rs==null?void 0:Rs.HF_TOKEN)??(Rs==null?void 0:Rs.HF_ACCESS_TOKEN);q&&z.set("Authorization",`Bearer ${q}`)}return fetch(b,{headers:z})}else return fetch(b)}const f={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};function v(b,y,S){if(!S)return null;const F=f[b]??`Error (${b}) occurred while trying to load file`;throw Error(`${F}: "${y}".`)}class ${constructor(y){this.path=y}async match(y){let S=o.join(this.path,y),F=new u(S);if(F.exists)return F}async put(y,S,F=void 0){let z=o.join(this.path,y);try{const K=S.headers.get("Content-Length"),q=parseInt(K??"0");let R=0;await s.promises.mkdir(o.dirname(z),{recursive:!0});const Z=s.createWriteStream(z),H=S.body.getReader();for(;;){const{done:J,value:Q}=await H.read();if(J)break;await new Promise((fe,ae)=>{Z.write(Q,V=>{if(V){ae(V);return}fe()})}),R+=Q.length;const se=q?R/q*100:0;F==null||F({progress:se,loaded:R,total:q})}Z.close()}catch(K){try{await s.promises.unlink(z)}catch{}throw K}}}async function g(b,...y){for(let S of y)try{let F=await b.match(S);if(F)return F}catch{continue}}async function w(b,y,S=!0,F={},z=!1){if(!n.env.allowLocalModels){if(F.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!n.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}(0,i.dispatchCallback)(F.progress_callback,{status:"initiate",name:b,file:y});let K;if(!K&&n.env.useCustomCache){if(!n.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!n.env.customCache.match||!n.env.customCache.put)throw new Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");K=n.env.customCache}if(!K&&n.env.useBrowserCache){if(typeof caches>"u")throw Error("Browser cache is not available in this environment.");try{K=await caches.open("transformers-cache")}catch(ee){console.warn("An error occurred while opening the browser cache:",ee)}}if(!K&&n.env.useFSCache){if(!n.apis.IS_FS_AVAILABLE)throw Error("File System Cache is not available in this environment.");K=new $(F.cache_dir??n.env.cacheDir)}const q=F.revision??"main",R=x(b,y),Z=d(b),H=Z?x(n.env.localModelPath,R):R,J=x(n.env.remoteHost,n.env.remotePathTemplate.replaceAll("{model}",b).replaceAll("{revision}",encodeURIComponent(q)),y);let Q;const se=K instanceof $?q==="main"?R:x(b,q,y):J;let fe=!1,ae;K&&(ae=await g(K,H,se));const V=ae!==void 0;if(ae===void 0){if(n.env.allowLocalModels)if(p(R,["http:","https:"])){if(F.local_files_only)throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${R}.`);if(!n.env.allowRemoteModels)throw new Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${R}.`)}else try{ae=await _(H),Q=H}catch(_e){console.warn(`Unable to load from local path "${H}": "${_e}"`)}if(ae===void 0||ae.status===404){if(F.local_files_only||!n.env.allowRemoteModels){if(S)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${H}".`);return null}if(!Z)throw Error(`Local file missing at "${H}" and download aborted due to invalid model ID "${b}".`);if(ae=await _(J),ae.status!==200)return v(ae.status,J,S);Q=se}fe=K&&typeof Response<"u"&&ae instanceof Response&&ae.status===200}(0,i.dispatchCallback)(F.progress_callback,{status:"download",name:b,file:y});let A;if(!(n.apis.IS_NODE_ENV&&z)){let ee;F.progress_callback?V&&typeof navigator<"u"&&/firefox/i.test(navigator.userAgent)?(ee=new Uint8Array(await ae.arrayBuffer()),(0,i.dispatchCallback)(F.progress_callback,{status:"progress",name:b,file:y,progress:100,loaded:ee.length,total:ee.length})):ee=await E(ae,_e=>{(0,i.dispatchCallback)(F.progress_callback,{status:"progress",name:b,file:y,..._e})}):ee=new Uint8Array(await ae.arrayBuffer()),A=ee}if(fe&&Q&&await K.match(Q)===void 0&&(A?await K.put(Q,new Response(A,{headers:ae.headers})).catch(ee=>{console.warn(`Unable to add response to browser cache: ${ee}.`)}):await K.put(Q,ae,F.progress_callback)),(0,i.dispatchCallback)(F.progress_callback,{status:"done",name:b,file:y}),A){if(!n.apis.IS_NODE_ENV&&z)throw new Error("Cannot return path in a browser environment.");return A}if(ae instanceof u)return ae.filePath;const U=await(K==null?void 0:K.match(Q));if(U instanceof u)return U.filePath;if(U instanceof Response)return new Uint8Array(await U.arrayBuffer());if(typeof U=="string")return U;throw new Error("Unable to get model file path or buffer.")}async function C(b,y,S=!0,F={}){const z=await w(b,y,S,F,!1);if(z===null)return{};const q=new TextDecoder("utf-8").decode(z);return JSON.parse(q)}async function E(b,y){const S=b.headers.get("Content-Length");S===null&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let F=parseInt(S??"0"),z=new Uint8Array(F),K=0;const q=b.body.getReader();async function R(){const{done:Z,value:H}=await q.read();if(Z)return;const J=K+H.length;if(J>F){F=J;const se=new Uint8Array(F);se.set(z),z=se}z.set(H,K),K=J;const Q=K/F*100;return y({progress:Q,loaded:K,total:F}),R()}return await R(),z}function x(...b){return b=b.map((y,S)=>(S&&(y=y.replace(new RegExp("^/"),"")),S!==b.length-1&&(y=y.replace(new RegExp("/$"),"")),y)),b.join("/")}},"./src/utils/image.js":(e,r,t)=>{t.r(r),t.d(r,{RawImage:()=>f,load_image:()=>v});var s=t("./src/utils/core.js"),o=t("./src/utils/hub.js"),n=t("./src/env.js"),i=t("./src/utils/tensor.js"),a=t("?2b25");let l,u,p;const c=n.apis.IS_BROWSER_ENV||n.apis.IS_WEBWORKER_ENV;if(c)l=($,g)=>{if(!self.OffscreenCanvas)throw new Error("OffscreenCanvas not supported by this browser.");return new self.OffscreenCanvas($,g)},p=self.createImageBitmap,u=self.ImageData;else if(a)p=async $=>{const w=(await $.metadata()).channels,{data:C,info:E}=await $.rotate().raw().toBuffer({resolveWithObject:!0}),x=new f(new Uint8ClampedArray(C),E.width,E.height,E.channels);return w!==void 0&&w!==E.channels&&x.convert(w),x};else throw new Error("Unable to load image processing library.");const d={0:"nearest",1:"lanczos",2:"bilinear",3:"bicubic",4:"box",5:"hamming"},_=new Map([["png","image/png"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["gif","image/gif"]]);class f{constructor(g,w,C,E){this.data=g,this.width=w,this.height=C,this.channels=E}get size(){return[this.width,this.height]}static async read(g){if(g instanceof f)return g;if(typeof g=="string"||g instanceof URL)return await this.fromURL(g);if(g instanceof Blob)return await this.fromBlob(g);if(typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&g instanceof OffscreenCanvas)return this.fromCanvas(g);throw new Error(`Unsupported input type: ${typeof g}`)}static fromCanvas(g){if(!c)throw new Error("fromCanvas() is only supported in browser environments.");const C=g.getContext("2d").getImageData(0,0,g.width,g.height).data;return new f(C,g.width,g.height,4)}static async fromURL(g){const w=await(0,o.getFile)(g);if(w.status!==200)throw new Error(`Unable to read image from "${g}" (${w.status} ${w.statusText})`);const C=await w.blob();return this.fromBlob(C)}static async fromBlob(g){if(c){const w=await p(g),C=l(w.width,w.height).getContext("2d");return C.drawImage(w,0,0),new this(C.getImageData(0,0,w.width,w.height).data,w.width,w.height,4)}else{const w=a(await g.arrayBuffer());return await p(w)}}static fromTensor(g,w="CHW"){if(g.dims.length!==3)throw new Error(`Tensor should have 3 dimensions, but has ${g.dims.length} dimensions.`);if(w==="CHW")g=g.transpose(1,2,0);else if(w!=="HWC")throw new Error(`Unsupported channel format: ${w}`);if(!(g.data instanceof Uint8ClampedArray||g.data instanceof Uint8Array))throw new Error(`Unsupported tensor type: ${g.type}`);switch(g.dims[2]){case 1:case 2:case 3:case 4:return new f(g.data,g.dims[1],g.dims[0],g.dims[2]);default:throw new Error(`Unsupported number of channels: ${g.dims[2]}`)}}grayscale(){if(this.channels===1)return this;const g=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let w=0,C=0;w=0?S=C:z=-C,E>=0?F=E:K=-E,y.drawImage(b,S,F,g,w,z,K,g,w),new f(y.getImageData(0,0,g,w).data,g,w,4).convert(x)}else{let x=this.toSharp();if(C>=0&&E>=0)x=x.extract({left:Math.floor(C),top:Math.floor(E),width:g,height:w});else if(C<=0&&E<=0){const b=Math.floor(-E),y=Math.floor(-C);x=x.extend({top:b,left:y,right:g-this.width-y,bottom:w-this.height-b})}else{let b=[0,0],y=0;E<0?(b[0]=Math.floor(-E),b[1]=w-this.height-b[0]):y=Math.floor(E);let S=[0,0],F=0;C<0?(S[0]=Math.floor(-C),S[1]=g-this.width-S[0]):F=Math.floor(C),x=x.extend({top:b[0],bottom:b[1],left:S[0],right:S[1]}).extract({left:F,top:y,width:g,height:w})}return await p(x)}}async toBlob(g="image/png",w=1){if(!c)throw new Error("toBlob() is only supported in browser environments.");return await this.toCanvas().convertToBlob({type:g,quality:w})}toTensor(g="CHW"){let w=new i.Tensor("uint8",new Uint8Array(this.data),[this.height,this.width,this.channels]);if(g!=="HWC")if(g==="CHW")w=w.permute(2,0,1);else throw new Error(`Unsupported channel format: ${g}`);return w}toCanvas(){if(!c)throw new Error("toCanvas() is only supported in browser environments.");const g=this.clone().rgba(),w=l(g.width,g.height),C=new u(g.data,g.width,g.height);return w.getContext("2d").putImageData(C,0,0),w}split(){const{data:g,width:w,height:C,channels:E}=this,x=g.constructor,b=g.length/E,y=Array.from({length:E},()=>new x(b));for(let S=0;Snew f(S,w,C,1))}_update(g,w,C,E=null){return this.data=g,this.width=w,this.height=C,E!==null&&(this.channels=E),this}clone(){return new f(this.data.slice(),this.width,this.height,this.channels)}convert(g){if(this.channels===g)return this;switch(g){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(g){if(c){if(n.apis.IS_WEBWORKER_ENV)throw new Error("Unable to save an image from a Web Worker.");const w=g.split(".").pop().toLowerCase(),C=_.get(w)??"image/png",E=await this.toBlob(C);(0,s.saveBlob)(g,E)}else{if(n.apis.IS_FS_AVAILABLE)return await this.toSharp().toFile(g);throw new Error("Unable to save the image because filesystem is disabled in this environment.")}}toSharp(){if(c)throw new Error("toSharp() is only supported in server-side environments.");return a(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}const v=f.read.bind(f)},"./src/utils/maths.js":(e,r,t)=>{t.r(r),t.d(r,{FFT:()=>v,bankers_round:()=>w,cos_sim:()=>l,dot:()=>a,dynamic_time_warping:()=>C,interpolate_data:()=>s,log_softmax:()=>i,magnitude:()=>u,max:()=>c,medianFilter:()=>$,min:()=>p,permute_data:()=>o,round:()=>g,softmax:()=>n});function s(E,[x,b,y],[S,F],z="bilinear",K=!1){const q=F/y,R=S/b,Z=new E.constructor(S*F*x),H=b*y,J=S*F;for(let Q=0;Q=0;--K)S[K]=q,y[K]=x[b[K]],q*=y[K];const F=b.map((K,q)=>S[b.indexOf(q)]),z=new E.constructor(E.length);for(let K=0;K=0;--R)q+=Z%x[R]*F[R],Z=Math.floor(Z/x[R]);z[q]=E[K]}return[z,y]}function n(E){const x=c(E)[0],b=E.map(F=>Math.exp(F-x)),y=b.reduce((F,z)=>F+z,0);return b.map(F=>F/y)}function i(E){const x=c(E)[0];let b=0;for(let F=0;FF-x-y)}function a(E,x){let b=0;for(let y=0;yx+b*b,0))}function p(E){if(E.length===0)throw Error("Array must not be empty");let x=E[0],b=0;for(let y=1;yx&&(x=E[y],b=y);return[x,b]}function d(E){return E>0&&(E&E-1)===0}class _{constructor(x){if(this.size=x|0,this.size<=1||!d(this.size))throw new Error("FFT size must be a power of two larger than 1");this._csize=x<<1,this.table=new Float64Array(this.size*2);for(let y=0;yy;y<<=1)++b;this._width=b%2===0?b-1:b,this._bitrev=new Int32Array(1<>>S&3)<>>1);for(let S=0;S>>1]=x[S];return y}toComplexArray(x,b){const y=b||this.createComplexArray();for(let S=0;S>>1],y[S+1]=0;return y}transform(x,b){if(x===b)throw new Error("Input and output buffers must be different");this._transform4(x,b,1)}realTransform(x,b){if(x===b)throw new Error("Input and output buffers must be different");this._realTransform4(x,b,1)}inverseTransform(x,b){if(x===b)throw new Error("Input and output buffers must be different");this._transform4(x,b,-1);for(let y=0;y>=2;z>=2;z>>=2){K=S/z<<1;const J=K>>>2;for(q=0;q>>1,z>>>1)}else for(q=0,R=0;q>>1,z>>>1,y)}const H=this.table;for(z>>=2;z>=2;z>>=2){K=S/z<<1;const Q=K>>>1,se=Q>>>1,fe=se>>>1;for(q=0;q>>1;for(let Q=2;Q>1;++Z){const H=(Z+1-x)**2/2,J=Math.sqrt(q**2+R**2)**H,Q=H*Math.atan2(R,q),se=2*Z;F[se]=J*Math.cos(Q),F[se+1]=J*Math.sin(Q),z[se]=F[se],z[se+1]=-F[se+1]}this._slicedChirpBuffer=F.subarray(b,y),this._f=new _(S>>1),this._f.transform(this._chirpBuffer,z)}_transform(x,b,y){const S=this._buffer1,F=this._buffer2,z=this._outBuffer1,K=this._outBuffer2,q=this._chirpBuffer,R=this._slicedChirpBuffer,Z=this._a;if(y)for(let H=0;H>1,se=b[Q];S[H]=se*R[H],S[J]=se*R[J]}else for(let H=0;H=E.length&&(q=2*(E.length-1)-q),y[z++]=E[q]}y.sort(),b[F]=y[S]}return b}function g(E,x){const b=Math.pow(10,x);return Math.round(E*b)/b}function w(E){const x=Math.round(E);return Math.abs(E)%1===.5?x%2===0?x:x-1:x}function C(E){const x=E.length,b=E[0].length,y=[x+1,b+1],S=Array.from({length:y[0]},()=>Array(y[1]).fill(1/0));S[0][0]=0;const F=Array.from({length:y[0]},()=>Array(y[1]).fill(-1));for(let Z=1;Z0||K>0;)switch(q.push(z-1),R.push(K-1),F[z][K]){case 0:--z,--K;break;case 1:--z;break;case 2:--K;break;default:throw new Error(`Internal error in dynamic time warping. Unexpected trace[${z}, ${K}]. Please file a bug report.`)}return q.reverse(),R.reverse(),[q,R]}},"./src/utils/tensor.js":(e,r,t)=>{t.r(r),t.d(r,{DataTypeMap:()=>i,Tensor:()=>a,cat:()=>b,full:()=>R,full_like:()=>Z,interpolate:()=>p,interpolate_4d:()=>c,layer_norm:()=>w,matmul:()=>d,mean:()=>z,mean_pooling:()=>g,ones:()=>H,ones_like:()=>J,permute:()=>u,quantize_embeddings:()=>ae,rand:()=>fe,rfft:()=>_,slice:()=>$,stack:()=>y,std_mean:()=>F,topk:()=>f,zeros:()=>Q,zeros_like:()=>se});var s=t("./src/utils/maths.js"),o=t("./src/backends/onnx.js"),n=t("./src/ops/registry.js");const i=Object.freeze({float32:Float32Array,float16:typeof Float16Array<"u"?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array});class a{constructor(...A){Y(this,"ort_tensor");return(0,o.isONNXTensor)(A[0])?this.ort_tensor=A[0]:this.ort_tensor=new o.Tensor(A[0],A[1],A[2]),new Proxy(this,{get:(U,ee)=>{if(typeof ee=="string"){let _e=Number(ee);if(Number.isInteger(_e))return U._getitem(_e)}return U[ee]},set:(U,ee,_e)=>U[ee]=_e})}get dims(){return this.ort_tensor.dims}set dims(A){this.ort_tensor.dims=A}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){const[A,...U]=this.dims;if(U.length>0){const ee=U.reduce((_e,le)=>_e*le);for(let _e=0;_e0){const _e=ee.reduce((le,ye)=>le*ye);return this._subarray(A,_e,ee)}else return new a(this.type,[this.data[A]],ee)}indexOf(A){const U=this.data;for(let ee=0;eeG)throw new Error(`Invalid slice: ${W}`);const be=[Math.max(re,0),Math.min(G,this.dims[pe])];ee.push(be),U.push(be[1]-be[0])}else throw new Error(`Invalid slice: ${W}`)}const _e=ee.map(([pe,W])=>W-pe),le=_e.reduce((pe,W)=>pe*W),ye=this.data,ze=new ye.constructor(le),Ue=this.stride();for(let pe=0;pe=0;--re){const be=_e[re];W+=(G%be+ee[re][0])*Ue[re],G=Math.floor(G/be)}ze[pe]=ye[W]}return new a(this.type,ze,U)}permute(...A){return u(this,A)}transpose(...A){return this.permute(...A)}sum(A=null,U=!1){return this.norm(1,A,U)}norm(A="fro",U=null,ee=!1){if(A==="fro")A=2;else if(typeof A=="string")throw Error(`Unsupported norm: ${A}`);const _e=this.data,le=(pe,W)=>pe+W**A;if(U===null){const pe=_e.reduce(le,0)**(1/A);return new a(this.type,[pe],[])}const[ye,ze,Ue]=S(le,this,U,ee);if(A!==1)for(let pe=0;pe=0;--Ue){const re=this.dims[Ue];if(Ue!==U){const G=pe%re;ze+=G*W,W*=this.dims[Ue]}pe=Math.floor(pe/re)}_e[ye]/=le[ze]}return this}normalize(A=2,U=1){return this.clone().normalize_(A,U)}stride(){return K(this.dims)}squeeze(A=null){return new a(this.type,this.data,C(this.dims,A))}squeeze_(A=null){return this.dims=C(this.dims,A),this}unsqueeze(A=null){return new a(this.type,this.data,E(this.dims,A))}unsqueeze_(A=null){return this.dims=E(this.dims,A),this}flatten_(A=0,U=-1){U=(U+this.dims.length)%this.dims.length;let ee=this.dims.slice(0,A),_e=this.dims.slice(A,U+1),le=this.dims.slice(U+1);return this.dims=[...ee,_e.reduce((ye,ze)=>ye*ze,1),...le],this}flatten(A=0,U=-1){return this.clone().flatten_(A,U)}view(...A){let U=-1;for(let _e=0;_eze!==U?le*ye:le,1);A[U]=ee.length/_e}return new a(this.type,ee,A)}neg_(){const A=this.data;for(let U=0;UA?1:0;return new a("bool",U,this.dims)}lt(A){const U=new Uint8Array(this.data.length),ee=this.data;for(let _e=0;_eMath.min(ye,ze),this,A,U,1/0);return new a(ee,_e,le)}max(A=null,U=!1){if(A===null){const ye=(0,s.max)(this.data)[0];return new a(this.type,[ye],[])}const[ee,_e,le]=S((ye,ze)=>Math.max(ye,ze),this,A,U,-1/0);return new a(ee,_e,le)}argmin(A=null,U=!1){if(A!==null)throw new Error("`dim !== null` not yet implemented.");const ee=(0,s.min)(this.data)[1];return new a("int64",[BigInt(ee)],[])}argmax(A=null,U=!1){if(A!==null)throw new Error("`dim !== null` not yet implemented.");const ee=(0,s.max)(this.data)[1];return new a("int64",[BigInt(ee)],[])}to(A){if(this.type===A)return this;if(!i.hasOwnProperty(A))throw new Error(`Unsupported type: ${A}`);let U;const ee=["int64","uint64"].includes(this.type),_e=["int64","uint64"].includes(A);return ee&&!_e?U=Number:!ee&&_e&&(U=BigInt),new a(A,i[A].from(this.data,U),this.dims)}}function l(V,A){const U=V.length,ee=A.reduce((le,ye)=>le*ye);if(U!==ee)throw Error(`cannot reshape array of size ${U} into shape (${A})`);let _e=V;for(let le=A.length-1;le>=0;le--)_e=_e.reduce((ye,ze)=>{let Ue=ye[ye.length-1];return Ue.lengthnew a("int64",V,[V.length]);async function $(V,A,U,ee,_e){return await(await n.TensorOpRegistry.slice)({x:V,s:v(A),e:v(U),a:v(ee),t:v(_e??new Array(ee.length).fill(1))})}function g(V,A){const U=V.data,ee=A.data,_e=[V.dims[0],V.dims[2]],le=new U.constructor(_e[0]*_e[1]),[ye,ze,Ue]=V.dims;let pe=0;for(let W=0;WU!==1):typeof A=="number"?V[A]===1&&V.splice(A,1):Array.isArray(A)&&(V=V.filter((U,ee)=>U!==1||!A.includes(ee))),V}function E(V,A){return A=x(A,V.length+1),V=V.slice(),V.splice(A,0,1),V}function x(V,A,U=null,ee=!0){if(V<-A||V>=A){if(ee)throw new Error(`IndexError: index ${V} is out of bounds for dimension${U===null?"":" "+U} with size ${A}`);return V<-A?0:A}return V<0&&(V=(V%A+A)%A),V}function b(V,A=0){A=x(A,V[0].dims.length);const U=V[0].dims.slice();U[A]=V.reduce((ye,ze)=>ye+ze.dims[A],0);const ee=U.reduce((ye,ze)=>ye*ze,1),_e=new V[0].data.constructor(ee),le=V[0].type;if(A===0){let ye=0;for(const ze of V){const Ue=ze.data;_e.set(Ue,ye),ye+=Ue.length}}else{let ye=0;for(let ze=0;ze=0;--G){const Se=pe[G];let Pe=be%Se;G===A&&(Pe+=ye),re+=Pe*we,we*=U[G],be=Math.floor(be/Se)}_e[re]=Ue[W]}ye+=pe[A]}}return new a(le,_e,U)}function y(V,A=0){return b(V.map(U=>U.unsqueeze(A)),A)}function S(V,A,U=null,ee=!1,_e=null){const le=A.data,ye=A.dims;U=x(U,ye.length);const ze=ye.slice();ze[U]=1;const Ue=new le.constructor(le.length/ye[U]);_e!==null&&Ue.fill(_e);for(let pe=0;pe=0;--re){const we=ye[re];if(re!==U){const Se=G%we;W+=Se*be,be*=ze[re]}G=Math.floor(G/we)}Ue[W]=V(Ue[W],le[pe],pe,W)}return ee||ze.splice(U,1),[A.type,Ue,ze]}function F(V,A=null,U=1,ee=!1){const _e=V.data,le=V.dims;if(A===null){const be=_e.reduce(($e,Fe)=>$e+Fe,0)/_e.length,we=Math.sqrt(_e.reduce(($e,Fe)=>$e+(Fe-be)**2,0)/(_e.length-U)),Se=new a(V.type,[be],[]);return[new a(V.type,[we],[]),Se]}A=x(A,le.length);const ye=z(V,A,ee),ze=ye.data,[Ue,pe,W]=S((G,be,we,Se)=>G+(be-ze[Se])**2,V,A,ee);for(let G=0;Gpe+W,0);return new a(V.type,[Ue/_e.length],[])}A=x(A,ee.length);const[le,ye,ze]=S((Ue,pe)=>Ue+pe,V,A,U);if(ee[A]!==1)for(let Ue=0;Ue=0;--U)A[U]=ee,ee*=V[U];return A}function q(V,A,U,ee){const _e=V.reduce((le,ye)=>le*ye,1);return new a(U,new ee(_e).fill(A),V)}function R(V,A){let U,ee;if(typeof A=="number")U="float32",ee=Float32Array;else if(typeof A=="bigint")U="int64",ee=BigInt64Array;else if(typeof A=="boolean")U="bool",ee=Uint8Array;else throw new Error(`Unsupported data type: ${typeof A}`);return q(V,A,U,ee)}function Z(V,A){return R(V.dims,A)}function H(V){return q(V,1n,"int64",BigInt64Array)}function J(V){return H(V.dims)}function Q(V){return q(V,0n,"int64",BigInt64Array)}function se(V){return Q(V.dims)}function fe(V){const A=V.reduce((U,ee)=>U*ee,1);return new a("float32",Float32Array.from({length:A},()=>Math.random()),V)}function ae(V,A){if(V.dims.length!==2)throw new Error("The tensor must have 2 dimensions");if(V.dims.at(-1)%8!==0)throw new Error("The last dimension of the tensor must be a multiple of 8");if(!["binary","ubinary"].includes(A))throw new Error("The precision must be either 'binary' or 'ubinary'");const U=A==="binary",ee=U?"int8":"uint8",_e=U?Int8Array:Uint8Array,le=V.data,ye=new _e(le.length/8);for(let ze=0;ze0?1:0,pe=Math.floor(ze/8),W=ze%8;ye[pe]|=Ue<<7-W,U&&W===0&&(ye[pe]-=128)}return new a(ee,ye,[V.dims[0],V.dims[1]/8])}},"./src/utils/video.js":(e,r,t)=>{t.r(r),t.d(r,{RawVideo:()=>i,RawVideoFrame:()=>n,load_video:()=>a});var s=t("./src/utils/image.js"),o=t("./src/env.js");class n{constructor(u,p){this.image=u,this.timestamp=p}}class i{constructor(u,p){u.length>0&&u[0]instanceof s.RawImage&&(u=u.map((c,d)=>new n(c,(d+1)/(u.length+1)*p))),this.frames=u,this.duration=p}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function a(l,{num_frames:u=null,fps:p=null}={}){if(!o.apis.IS_BROWSER_ENV)throw new Error("`load_video` is currently only supported in browser environments.");if(u==null&&p==null)throw new Error("Either num_frames or fps must be provided.");const c=[],d=document.createElement("video");if(d.crossOrigin="anonymous",d.muted=!0,typeof l=="string")d.src=l;else if(l instanceof Blob)d.src=URL.createObjectURL(l);else if(l instanceof HTMLVideoElement)d.src=l.src;else throw new Error("Invalid URL or video element provided.");if(await new Promise(C=>d.onloadedmetadata=C),d.seekable.start(0)===d.seekable.end(0)){const E=await(await fetch(d.src)).blob();d.src=URL.createObjectURL(E),await new Promise(x=>d.onloadedmetadata=x)}const _=d.duration;let f,v;u!=null?(f=u,v=u===1?0:_/(u-1)):(v=1/p,f=Math.floor(_/v));let $=[];for(let C=0;C{d.onseeked=y}),w.drawImage(d,0,0,g.width,g.height);const E=w.getImageData(0,0,g.width,g.height),x=new s.RawImage(E.data,g.width,g.height,4),b=new n(x,C);c.push(b)}return d.remove(),new i(c,_)}}},ub={};function jt(e){var r=ub[e];if(r!==void 0)return r.exports;var t=ub[e]={exports:{}};return dT[e](t,t.exports,jt),t.exports}(()=>{var e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,r;jt.t=function(t,s){if(s&1&&(t=this(t)),s&8||typeof t=="object"&&t&&(s&4&&t.__esModule||s&16&&typeof t.then=="function"))return t;var o=Object.create(null);jt.r(o);var n={};r=r||[null,e({}),e([]),e(e)];for(var i=s&2&&t;typeof i=="object"&&!~r.indexOf(i);i=e(i))Object.getOwnPropertyNames(i).forEach(a=>n[a]=()=>t[a]);return n.default=()=>t,jt.d(o,n),o}})();jt.d=(e,r)=>{for(var t in r)jt.o(r,t)&&!jt.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})};jt.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);jt.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var m={};(()=>{/*!*****************************!*\ - !*** ./src/transformers.js ***! - \*****************************/jt.r(m),jt.d(m,{ASTFeatureExtractor:()=>c.ASTFeatureExtractor,ASTForAudioClassification:()=>t.ASTForAudioClassification,ASTModel:()=>t.ASTModel,ASTPreTrainedModel:()=>t.ASTPreTrainedModel,AlbertForMaskedLM:()=>t.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>t.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>t.AlbertForSequenceClassification,AlbertModel:()=>t.AlbertModel,AlbertPreTrainedModel:()=>t.AlbertPreTrainedModel,AlbertTokenizer:()=>s.AlbertTokenizer,AudioClassificationPipeline:()=>r.AudioClassificationPipeline,AutoConfig:()=>o.AutoConfig,AutoFeatureExtractor:()=>d.AutoFeatureExtractor,AutoImageProcessor:()=>v.AutoImageProcessor,AutoModel:()=>t.AutoModel,AutoModelForAudioClassification:()=>t.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>t.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>t.AutoModelForAudioTextToText,AutoModelForCTC:()=>t.AutoModelForCTC,AutoModelForCausalLM:()=>t.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>t.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>t.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>t.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>t.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>t.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>t.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>t.AutoModelForImageTextToText,AutoModelForImageToImage:()=>t.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>t.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>t.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>t.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>t.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>t.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>t.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>t.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>t.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>t.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>t.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>t.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>t.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>t.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>t.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>t.AutoModelForVision2Seq,AutoModelForXVector:()=>t.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>t.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>w.AutoProcessor,AutoTokenizer:()=>s.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>r.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>r.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>t.BartForConditionalGeneration,BartForSequenceClassification:()=>t.BartForSequenceClassification,BartModel:()=>t.BartModel,BartPretrainedModel:()=>t.BartPretrainedModel,BartTokenizer:()=>s.BartTokenizer,BaseModelOutput:()=>t.BaseModelOutput,BaseStreamer:()=>C.BaseStreamer,BeitFeatureExtractor:()=>f.BeitFeatureExtractor,BeitForImageClassification:()=>t.BeitForImageClassification,BeitModel:()=>t.BeitModel,BeitPreTrainedModel:()=>t.BeitPreTrainedModel,BertForMaskedLM:()=>t.BertForMaskedLM,BertForQuestionAnswering:()=>t.BertForQuestionAnswering,BertForSequenceClassification:()=>t.BertForSequenceClassification,BertForTokenClassification:()=>t.BertForTokenClassification,BertModel:()=>t.BertModel,BertPreTrainedModel:()=>t.BertPreTrainedModel,BertTokenizer:()=>s.BertTokenizer,BitImageProcessor:()=>f.BitImageProcessor,BlenderbotForConditionalGeneration:()=>t.BlenderbotForConditionalGeneration,BlenderbotModel:()=>t.BlenderbotModel,BlenderbotPreTrainedModel:()=>t.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>t.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>t.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>t.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>s.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>s.BlenderbotTokenizer,BloomForCausalLM:()=>t.BloomForCausalLM,BloomModel:()=>t.BloomModel,BloomPreTrainedModel:()=>t.BloomPreTrainedModel,BloomTokenizer:()=>s.BloomTokenizer,CLIPFeatureExtractor:()=>f.CLIPFeatureExtractor,CLIPImageProcessor:()=>f.CLIPImageProcessor,CLIPModel:()=>t.CLIPModel,CLIPPreTrainedModel:()=>t.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>t.CLIPSegForImageSegmentation,CLIPSegModel:()=>t.CLIPSegModel,CLIPSegPreTrainedModel:()=>t.CLIPSegPreTrainedModel,CLIPTextModel:()=>t.CLIPTextModel,CLIPTextModelWithProjection:()=>t.CLIPTextModelWithProjection,CLIPTokenizer:()=>s.CLIPTokenizer,CLIPVisionModel:()=>t.CLIPVisionModel,CLIPVisionModelWithProjection:()=>t.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>t.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>t.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>t.CamembertForSequenceClassification,CamembertForTokenClassification:()=>t.CamembertForTokenClassification,CamembertModel:()=>t.CamembertModel,CamembertPreTrainedModel:()=>t.CamembertPreTrainedModel,CamembertTokenizer:()=>s.CamembertTokenizer,CausalLMOutput:()=>t.CausalLMOutput,CausalLMOutputWithPast:()=>t.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>f.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>t.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>t.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>t.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>c.ClapFeatureExtractor,ClapModel:()=>t.ClapModel,ClapPreTrainedModel:()=>t.ClapPreTrainedModel,ClapTextModelWithProjection:()=>t.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>x.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>t.CodeGenForCausalLM,CodeGenModel:()=>t.CodeGenModel,CodeGenPreTrainedModel:()=>t.CodeGenPreTrainedModel,CodeGenTokenizer:()=>s.CodeGenTokenizer,CodeLlamaTokenizer:()=>s.CodeLlamaTokenizer,CohereForCausalLM:()=>t.CohereForCausalLM,CohereModel:()=>t.CohereModel,CoherePreTrainedModel:()=>t.CoherePreTrainedModel,CohereTokenizer:()=>s.CohereTokenizer,ConvBertForMaskedLM:()=>t.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>t.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>t.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>t.ConvBertForTokenClassification,ConvBertModel:()=>t.ConvBertModel,ConvBertPreTrainedModel:()=>t.ConvBertPreTrainedModel,ConvBertTokenizer:()=>s.ConvBertTokenizer,ConvNextFeatureExtractor:()=>f.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>t.ConvNextForImageClassification,ConvNextImageProcessor:()=>f.ConvNextImageProcessor,ConvNextModel:()=>t.ConvNextModel,ConvNextPreTrainedModel:()=>t.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>t.ConvNextV2ForImageClassification,ConvNextV2Model:()=>t.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>t.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>t.DFineForObjectDetection,DFineModel:()=>t.DFineModel,DFinePreTrainedModel:()=>t.DFinePreTrainedModel,DPTFeatureExtractor:()=>f.DPTFeatureExtractor,DPTForDepthEstimation:()=>t.DPTForDepthEstimation,DPTImageProcessor:()=>f.DPTImageProcessor,DPTModel:()=>t.DPTModel,DPTPreTrainedModel:()=>t.DPTPreTrainedModel,DacDecoderModel:()=>t.DacDecoderModel,DacDecoderOutput:()=>t.DacDecoderOutput,DacEncoderModel:()=>t.DacEncoderModel,DacEncoderOutput:()=>t.DacEncoderOutput,DacFeatureExtractor:()=>c.DacFeatureExtractor,DacModel:()=>t.DacModel,DacPreTrainedModel:()=>t.DacPreTrainedModel,DataTypeMap:()=>l.DataTypeMap,DebertaForMaskedLM:()=>t.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>t.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>t.DebertaForSequenceClassification,DebertaForTokenClassification:()=>t.DebertaForTokenClassification,DebertaModel:()=>t.DebertaModel,DebertaPreTrainedModel:()=>t.DebertaPreTrainedModel,DebertaTokenizer:()=>s.DebertaTokenizer,DebertaV2ForMaskedLM:()=>t.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>t.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>t.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>t.DebertaV2ForTokenClassification,DebertaV2Model:()=>t.DebertaV2Model,DebertaV2PreTrainedModel:()=>t.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>s.DebertaV2Tokenizer,DecisionTransformerModel:()=>t.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>t.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>f.DeiTFeatureExtractor,DeiTForImageClassification:()=>t.DeiTForImageClassification,DeiTImageProcessor:()=>f.DeiTImageProcessor,DeiTModel:()=>t.DeiTModel,DeiTPreTrainedModel:()=>t.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>t.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>t.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>r.DepthEstimationPipeline,DepthProForDepthEstimation:()=>t.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>t.DepthProPreTrainedModel,DetrFeatureExtractor:()=>f.DetrFeatureExtractor,DetrForObjectDetection:()=>t.DetrForObjectDetection,DetrForSegmentation:()=>t.DetrForSegmentation,DetrImageProcessor:()=>f.DetrImageProcessor,DetrModel:()=>t.DetrModel,DetrObjectDetectionOutput:()=>t.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>t.DetrPreTrainedModel,DetrSegmentationOutput:()=>t.DetrSegmentationOutput,Dinov2ForImageClassification:()=>t.Dinov2ForImageClassification,Dinov2Model:()=>t.Dinov2Model,Dinov2PreTrainedModel:()=>t.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>t.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>t.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>t.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>t.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>t.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>t.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>t.DistilBertForTokenClassification,DistilBertModel:()=>t.DistilBertModel,DistilBertPreTrainedModel:()=>t.DistilBertPreTrainedModel,DistilBertTokenizer:()=>s.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>r.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>f.DonutFeatureExtractor,DonutImageProcessor:()=>f.DonutImageProcessor,DonutSwinModel:()=>t.DonutSwinModel,DonutSwinPreTrainedModel:()=>t.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>t.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>f.EfficientNetImageProcessor,EfficientNetModel:()=>t.EfficientNetModel,EfficientNetPreTrainedModel:()=>t.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>t.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>t.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>t.ElectraForSequenceClassification,ElectraForTokenClassification:()=>t.ElectraForTokenClassification,ElectraModel:()=>t.ElectraModel,ElectraPreTrainedModel:()=>t.ElectraPreTrainedModel,ElectraTokenizer:()=>s.ElectraTokenizer,EncodecFeatureExtractor:()=>c.EncodecFeatureExtractor,EosTokenCriteria:()=>E.EosTokenCriteria,EsmForMaskedLM:()=>t.EsmForMaskedLM,EsmForSequenceClassification:()=>t.EsmForSequenceClassification,EsmForTokenClassification:()=>t.EsmForTokenClassification,EsmModel:()=>t.EsmModel,EsmPreTrainedModel:()=>t.EsmPreTrainedModel,EsmTokenizer:()=>s.EsmTokenizer,ExaoneForCausalLM:()=>t.ExaoneForCausalLM,ExaoneModel:()=>t.ExaoneModel,ExaonePreTrainedModel:()=>t.ExaonePreTrainedModel,FFT:()=>u.FFT,FalconForCausalLM:()=>t.FalconForCausalLM,FalconModel:()=>t.FalconModel,FalconPreTrainedModel:()=>t.FalconPreTrainedModel,FalconTokenizer:()=>s.FalconTokenizer,FastViTForImageClassification:()=>t.FastViTForImageClassification,FastViTModel:()=>t.FastViTModel,FastViTPreTrainedModel:()=>t.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>r.FeatureExtractionPipeline,FeatureExtractor:()=>p.FeatureExtractor,FillMaskPipeline:()=>r.FillMaskPipeline,Florence2ForConditionalGeneration:()=>t.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>t.Florence2PreTrainedModel,Florence2Processor:()=>g.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>x.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>x.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>f.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>t.GLPNForDepthEstimation,GLPNModel:()=>t.GLPNModel,GLPNPreTrainedModel:()=>t.GLPNPreTrainedModel,GPT2LMHeadModel:()=>t.GPT2LMHeadModel,GPT2Model:()=>t.GPT2Model,GPT2PreTrainedModel:()=>t.GPT2PreTrainedModel,GPT2Tokenizer:()=>s.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>t.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>t.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>t.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>t.GPTJForCausalLM,GPTJModel:()=>t.GPTJModel,GPTJPreTrainedModel:()=>t.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>t.GPTNeoForCausalLM,GPTNeoModel:()=>t.GPTNeoModel,GPTNeoPreTrainedModel:()=>t.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>t.GPTNeoXForCausalLM,GPTNeoXModel:()=>t.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>t.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>s.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>t.Gemma2ForCausalLM,Gemma2Model:()=>t.Gemma2Model,Gemma2PreTrainedModel:()=>t.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>t.Gemma3ForCausalLM,Gemma3Model:()=>t.Gemma3Model,Gemma3PreTrainedModel:()=>t.Gemma3PreTrainedModel,GemmaForCausalLM:()=>t.GemmaForCausalLM,GemmaModel:()=>t.GemmaModel,GemmaPreTrainedModel:()=>t.GemmaPreTrainedModel,GemmaTokenizer:()=>s.GemmaTokenizer,GlmForCausalLM:()=>t.GlmForCausalLM,GlmModel:()=>t.GlmModel,GlmPreTrainedModel:()=>t.GlmPreTrainedModel,GraniteForCausalLM:()=>t.GraniteForCausalLM,GraniteModel:()=>t.GraniteModel,GranitePreTrainedModel:()=>t.GranitePreTrainedModel,Grok1Tokenizer:()=>s.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>t.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>f.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>t.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>g.GroundingDinoProcessor,GroupViTModel:()=>t.GroupViTModel,GroupViTPreTrainedModel:()=>t.GroupViTPreTrainedModel,HeliumForCausalLM:()=>t.HeliumForCausalLM,HeliumModel:()=>t.HeliumModel,HeliumPreTrainedModel:()=>t.HeliumPreTrainedModel,HerbertTokenizer:()=>s.HerbertTokenizer,HieraForImageClassification:()=>t.HieraForImageClassification,HieraModel:()=>t.HieraModel,HieraPreTrainedModel:()=>t.HieraPreTrainedModel,HubertForCTC:()=>t.HubertForCTC,HubertForSequenceClassification:()=>t.HubertForSequenceClassification,HubertModel:()=>t.HubertModel,HubertPreTrainedModel:()=>t.HubertPreTrainedModel,IJepaForImageClassification:()=>t.IJepaForImageClassification,IJepaModel:()=>t.IJepaModel,IJepaPreTrainedModel:()=>t.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>t.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>f.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>t.Idefics3PreTrainedModel,Idefics3Processor:()=>g.Idefics3Processor,ImageClassificationPipeline:()=>r.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>r.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>c.ImageFeatureExtractor,ImageMattingOutput:()=>t.ImageMattingOutput,ImageProcessor:()=>_.ImageProcessor,ImageSegmentationPipeline:()=>r.ImageSegmentationPipeline,ImageToImagePipeline:()=>r.ImageToImagePipeline,ImageToTextPipeline:()=>r.ImageToTextPipeline,InterruptableStoppingCriteria:()=>E.InterruptableStoppingCriteria,JAISLMHeadModel:()=>t.JAISLMHeadModel,JAISModel:()=>t.JAISModel,JAISPreTrainedModel:()=>t.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>f.JinaCLIPImageProcessor,JinaCLIPModel:()=>t.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>t.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>g.JinaCLIPProcessor,JinaCLIPTextModel:()=>t.JinaCLIPTextModel,JinaCLIPVisionModel:()=>t.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>t.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>t.LlamaForCausalLM,LlamaModel:()=>t.LlamaModel,LlamaPreTrainedModel:()=>t.LlamaPreTrainedModel,LlamaTokenizer:()=>s.LlamaTokenizer,LlavaForConditionalGeneration:()=>t.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>t.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>f.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>t.LlavaPreTrainedModel,LogitsProcessor:()=>x.LogitsProcessor,LogitsProcessorList:()=>x.LogitsProcessorList,LogitsWarper:()=>x.LogitsWarper,LongT5ForConditionalGeneration:()=>t.LongT5ForConditionalGeneration,LongT5Model:()=>t.LongT5Model,LongT5PreTrainedModel:()=>t.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>t.M2M100ForConditionalGeneration,M2M100Model:()=>t.M2M100Model,M2M100PreTrainedModel:()=>t.M2M100PreTrainedModel,M2M100Tokenizer:()=>s.M2M100Tokenizer,MBart50Tokenizer:()=>s.MBart50Tokenizer,MBartForCausalLM:()=>t.MBartForCausalLM,MBartForConditionalGeneration:()=>t.MBartForConditionalGeneration,MBartForSequenceClassification:()=>t.MBartForSequenceClassification,MBartModel:()=>t.MBartModel,MBartPreTrainedModel:()=>t.MBartPreTrainedModel,MBartTokenizer:()=>s.MBartTokenizer,MPNetForMaskedLM:()=>t.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>t.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>t.MPNetForSequenceClassification,MPNetForTokenClassification:()=>t.MPNetForTokenClassification,MPNetModel:()=>t.MPNetModel,MPNetPreTrainedModel:()=>t.MPNetPreTrainedModel,MPNetTokenizer:()=>s.MPNetTokenizer,MT5ForConditionalGeneration:()=>t.MT5ForConditionalGeneration,MT5Model:()=>t.MT5Model,MT5PreTrainedModel:()=>t.MT5PreTrainedModel,MarianMTModel:()=>t.MarianMTModel,MarianModel:()=>t.MarianModel,MarianPreTrainedModel:()=>t.MarianPreTrainedModel,MarianTokenizer:()=>s.MarianTokenizer,Mask2FormerImageProcessor:()=>f.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>f.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>t.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>f.MaskFormerImageProcessor,MaskFormerModel:()=>t.MaskFormerModel,MaskFormerPreTrainedModel:()=>t.MaskFormerPreTrainedModel,MaskedLMOutput:()=>t.MaskedLMOutput,MaxLengthCriteria:()=>E.MaxLengthCriteria,Metric3DForDepthEstimation:()=>t.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>t.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>t.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>t.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>t.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>t.MgpstrModelOutput,MgpstrPreTrainedModel:()=>t.MgpstrPreTrainedModel,MgpstrProcessor:()=>g.MgpstrProcessor,MgpstrTokenizer:()=>s.MgpstrTokenizer,MimiDecoderModel:()=>t.MimiDecoderModel,MimiDecoderOutput:()=>t.MimiDecoderOutput,MimiEncoderModel:()=>t.MimiEncoderModel,MimiEncoderOutput:()=>t.MimiEncoderOutput,MimiModel:()=>t.MimiModel,MimiPreTrainedModel:()=>t.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>x.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>x.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>t.MistralForCausalLM,MistralModel:()=>t.MistralModel,MistralPreTrainedModel:()=>t.MistralPreTrainedModel,MobileBertForMaskedLM:()=>t.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>t.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>t.MobileBertForSequenceClassification,MobileBertModel:()=>t.MobileBertModel,MobileBertPreTrainedModel:()=>t.MobileBertPreTrainedModel,MobileBertTokenizer:()=>s.MobileBertTokenizer,MobileLLMForCausalLM:()=>t.MobileLLMForCausalLM,MobileLLMModel:()=>t.MobileLLMModel,MobileLLMPreTrainedModel:()=>t.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>f.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>t.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>t.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>f.MobileNetV1ImageProcessor,MobileNetV1Model:()=>t.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>t.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>f.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>t.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>t.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>f.MobileNetV2ImageProcessor,MobileNetV2Model:()=>t.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>t.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>f.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>t.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>t.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>f.MobileNetV3ImageProcessor,MobileNetV3Model:()=>t.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>t.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>f.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>t.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>t.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>f.MobileNetV4ImageProcessor,MobileNetV4Model:()=>t.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>t.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>f.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>t.MobileViTForImageClassification,MobileViTImageProcessor:()=>f.MobileViTImageProcessor,MobileViTModel:()=>t.MobileViTModel,MobileViTPreTrainedModel:()=>t.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>t.MobileViTV2ForImageClassification,MobileViTV2Model:()=>t.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>t.MobileViTV2PreTrainedModel,ModelOutput:()=>t.ModelOutput,ModernBertForMaskedLM:()=>t.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>t.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>t.ModernBertForTokenClassification,ModernBertModel:()=>t.ModernBertModel,ModernBertPreTrainedModel:()=>t.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>t.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>c.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>t.MoonshineForConditionalGeneration,MoonshineModel:()=>t.MoonshineModel,MoonshinePreTrainedModel:()=>t.MoonshinePreTrainedModel,MoonshineProcessor:()=>g.MoonshineProcessor,MptForCausalLM:()=>t.MptForCausalLM,MptModel:()=>t.MptModel,MptPreTrainedModel:()=>t.MptPreTrainedModel,MultiModalityCausalLM:()=>t.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>t.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>t.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>t.MusicgenForConditionalGeneration,MusicgenModel:()=>t.MusicgenModel,MusicgenPreTrainedModel:()=>t.MusicgenPreTrainedModel,NllbTokenizer:()=>s.NllbTokenizer,NoBadWordsLogitsProcessor:()=>x.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>x.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>t.NomicBertModel,NomicBertPreTrainedModel:()=>t.NomicBertPreTrainedModel,NougatImageProcessor:()=>f.NougatImageProcessor,NougatTokenizer:()=>s.NougatTokenizer,OPTForCausalLM:()=>t.OPTForCausalLM,OPTModel:()=>t.OPTModel,OPTPreTrainedModel:()=>t.OPTPreTrainedModel,ObjectDetectionPipeline:()=>r.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>t.Olmo2ForCausalLM,Olmo2Model:()=>t.Olmo2Model,Olmo2PreTrainedModel:()=>t.Olmo2PreTrainedModel,OlmoForCausalLM:()=>t.OlmoForCausalLM,OlmoModel:()=>t.OlmoModel,OlmoPreTrainedModel:()=>t.OlmoPreTrainedModel,OpenELMForCausalLM:()=>t.OpenELMForCausalLM,OpenELMModel:()=>t.OpenELMModel,OpenELMPreTrainedModel:()=>t.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>f.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>t.OwlViTForObjectDetection,OwlViTImageProcessor:()=>f.OwlViTImageProcessor,OwlViTModel:()=>t.OwlViTModel,OwlViTPreTrainedModel:()=>t.OwlViTPreTrainedModel,OwlViTProcessor:()=>g.OwlViTProcessor,Owlv2ForObjectDetection:()=>t.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>f.Owlv2ImageProcessor,Owlv2Model:()=>t.Owlv2Model,Owlv2PreTrainedModel:()=>t.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>t.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>t.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>g.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>t.PatchTSMixerForPrediction,PatchTSMixerModel:()=>t.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>t.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>t.PatchTSTForPrediction,PatchTSTModel:()=>t.PatchTSTModel,PatchTSTPreTrainedModel:()=>t.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>t.Phi3ForCausalLM,Phi3Model:()=>t.Phi3Model,Phi3PreTrainedModel:()=>t.Phi3PreTrainedModel,Phi3VForCausalLM:()=>t.Phi3VForCausalLM,Phi3VImageProcessor:()=>f.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>t.Phi3VPreTrainedModel,Phi3VProcessor:()=>g.Phi3VProcessor,PhiForCausalLM:()=>t.PhiForCausalLM,PhiModel:()=>t.PhiModel,PhiPreTrainedModel:()=>t.PhiPreTrainedModel,Pipeline:()=>r.Pipeline,PreTrainedModel:()=>t.PreTrainedModel,PreTrainedTokenizer:()=>s.PreTrainedTokenizer,PretrainedConfig:()=>o.PretrainedConfig,PretrainedMixin:()=>t.PretrainedMixin,Processor:()=>$.Processor,PvtForImageClassification:()=>t.PvtForImageClassification,PvtImageProcessor:()=>f.PvtImageProcessor,PvtModel:()=>t.PvtModel,PvtPreTrainedModel:()=>t.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>c.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>t.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>t.PyAnnoteModel,PyAnnotePreTrainedModel:()=>t.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>g.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>t.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>r.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>t.Qwen2ForCausalLM,Qwen2Model:()=>t.Qwen2Model,Qwen2PreTrainedModel:()=>t.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>s.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>t.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>f.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>t.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>g.Qwen2VLProcessor,Qwen3ForCausalLM:()=>t.Qwen3ForCausalLM,Qwen3Model:()=>t.Qwen3Model,Qwen3PreTrainedModel:()=>t.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>t.RFDetrForObjectDetection,RFDetrModel:()=>t.RFDetrModel,RFDetrObjectDetectionOutput:()=>t.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>t.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>t.RTDetrForObjectDetection,RTDetrImageProcessor:()=>f.RTDetrImageProcessor,RTDetrModel:()=>t.RTDetrModel,RTDetrObjectDetectionOutput:()=>t.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>t.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>t.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>t.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>t.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>t.RTDetrV2PreTrainedModel,RawAudio:()=>n.RawAudio,RawImage:()=>i.RawImage,RawVideo:()=>a.RawVideo,RawVideoFrame:()=>a.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>x.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>t.ResNetForImageClassification,ResNetModel:()=>t.ResNetModel,ResNetPreTrainedModel:()=>t.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>t.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>t.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>t.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>t.RoFormerForTokenClassification,RoFormerModel:()=>t.RoFormerModel,RoFormerPreTrainedModel:()=>t.RoFormerPreTrainedModel,RoFormerTokenizer:()=>s.RoFormerTokenizer,RobertaForMaskedLM:()=>t.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>t.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>t.RobertaForSequenceClassification,RobertaForTokenClassification:()=>t.RobertaForTokenClassification,RobertaModel:()=>t.RobertaModel,RobertaPreTrainedModel:()=>t.RobertaPreTrainedModel,RobertaTokenizer:()=>s.RobertaTokenizer,SamImageProcessor:()=>f.SamImageProcessor,SamImageSegmentationOutput:()=>t.SamImageSegmentationOutput,SamModel:()=>t.SamModel,SamPreTrainedModel:()=>t.SamPreTrainedModel,SamProcessor:()=>g.SamProcessor,SapiensForDepthEstimation:()=>t.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>t.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>t.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>t.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>c.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>f.SegformerFeatureExtractor,SegformerForImageClassification:()=>t.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>t.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>f.SegformerImageProcessor,SegformerModel:()=>t.SegformerModel,SegformerPreTrainedModel:()=>t.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>t.Seq2SeqLMOutput,SequenceClassifierOutput:()=>t.SequenceClassifierOutput,SiglipImageProcessor:()=>f.SiglipImageProcessor,SiglipModel:()=>t.SiglipModel,SiglipPreTrainedModel:()=>t.SiglipPreTrainedModel,SiglipTextModel:()=>t.SiglipTextModel,SiglipTokenizer:()=>s.SiglipTokenizer,SiglipVisionModel:()=>t.SiglipVisionModel,SmolVLMForConditionalGeneration:()=>t.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>f.SmolVLMImageProcessor,SmolVLMProcessor:()=>g.SmolVLMProcessor,SnacDecoderModel:()=>t.SnacDecoderModel,SnacEncoderModel:()=>t.SnacEncoderModel,SnacFeatureExtractor:()=>c.SnacFeatureExtractor,SnacModel:()=>t.SnacModel,SnacPreTrainedModel:()=>t.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>c.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>t.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>t.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>t.SpeechT5HifiGan,SpeechT5Model:()=>t.SpeechT5Model,SpeechT5PreTrainedModel:()=>t.SpeechT5PreTrainedModel,SpeechT5Processor:()=>g.SpeechT5Processor,SpeechT5Tokenizer:()=>s.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>t.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>t.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>t.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>t.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>t.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>s.SqueezeBertTokenizer,StableLmForCausalLM:()=>t.StableLmForCausalLM,StableLmModel:()=>t.StableLmModel,StableLmPreTrainedModel:()=>t.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>t.Starcoder2ForCausalLM,Starcoder2Model:()=>t.Starcoder2Model,Starcoder2PreTrainedModel:()=>t.Starcoder2PreTrainedModel,StoppingCriteria:()=>E.StoppingCriteria,StoppingCriteriaList:()=>E.StoppingCriteriaList,StyleTextToSpeech2Model:()=>t.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>t.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>r.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>x.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>t.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>f.Swin2SRImageProcessor,Swin2SRModel:()=>t.Swin2SRModel,Swin2SRPreTrainedModel:()=>t.Swin2SRPreTrainedModel,SwinForImageClassification:()=>t.SwinForImageClassification,SwinForSemanticSegmentation:()=>t.SwinForSemanticSegmentation,SwinModel:()=>t.SwinModel,SwinPreTrainedModel:()=>t.SwinPreTrainedModel,T5ForConditionalGeneration:()=>t.T5ForConditionalGeneration,T5Model:()=>t.T5Model,T5PreTrainedModel:()=>t.T5PreTrainedModel,T5Tokenizer:()=>s.T5Tokenizer,TableTransformerForObjectDetection:()=>t.TableTransformerForObjectDetection,TableTransformerModel:()=>t.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>t.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>t.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>x.TemperatureLogitsWarper,Tensor:()=>l.Tensor,Text2TextGenerationPipeline:()=>r.Text2TextGenerationPipeline,TextClassificationPipeline:()=>r.TextClassificationPipeline,TextGenerationPipeline:()=>r.TextGenerationPipeline,TextStreamer:()=>C.TextStreamer,TextToAudioPipeline:()=>r.TextToAudioPipeline,TokenClassificationPipeline:()=>r.TokenClassificationPipeline,TokenClassifierOutput:()=>t.TokenClassifierOutput,TokenizerModel:()=>s.TokenizerModel,TopKLogitsWarper:()=>x.TopKLogitsWarper,TopPLogitsWarper:()=>x.TopPLogitsWarper,TrOCRForCausalLM:()=>t.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>t.TrOCRPreTrainedModel,TranslationPipeline:()=>r.TranslationPipeline,UltravoxModel:()=>t.UltravoxModel,UltravoxPreTrainedModel:()=>t.UltravoxPreTrainedModel,UltravoxProcessor:()=>g.UltravoxProcessor,UniSpeechForCTC:()=>t.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>t.UniSpeechForSequenceClassification,UniSpeechModel:()=>t.UniSpeechModel,UniSpeechPreTrainedModel:()=>t.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>t.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>t.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>t.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>t.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>t.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>g.VLChatProcessor,VLMImageProcessor:()=>f.VLMImageProcessor,ViTFeatureExtractor:()=>f.ViTFeatureExtractor,ViTForImageClassification:()=>t.ViTForImageClassification,ViTImageProcessor:()=>f.ViTImageProcessor,ViTMAEModel:()=>t.ViTMAEModel,ViTMAEPreTrainedModel:()=>t.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>t.ViTMSNForImageClassification,ViTMSNModel:()=>t.ViTMSNModel,ViTMSNPreTrainedModel:()=>t.ViTMSNPreTrainedModel,ViTModel:()=>t.ViTModel,ViTPreTrainedModel:()=>t.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>t.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>t.VitMatteForImageMatting,VitMatteImageProcessor:()=>f.VitMatteImageProcessor,VitMattePreTrainedModel:()=>t.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>t.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>f.VitPoseImageProcessor,VitPosePreTrainedModel:()=>t.VitPosePreTrainedModel,VitsModel:()=>t.VitsModel,VitsModelOutput:()=>t.VitsModelOutput,VitsPreTrainedModel:()=>t.VitsPreTrainedModel,VitsTokenizer:()=>s.VitsTokenizer,Wav2Vec2BertForCTC:()=>t.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>t.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>t.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>t.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>s.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>c.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>t.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>t.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>t.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>t.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>t.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>g.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>g.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>t.WavLMForAudioFrameClassification,WavLMForCTC:()=>t.WavLMForCTC,WavLMForSequenceClassification:()=>t.WavLMForSequenceClassification,WavLMForXVector:()=>t.WavLMForXVector,WavLMModel:()=>t.WavLMModel,WavLMPreTrainedModel:()=>t.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>c.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>t.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>t.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>c.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>t.WhisperForConditionalGeneration,WhisperModel:()=>t.WhisperModel,WhisperPreTrainedModel:()=>t.WhisperPreTrainedModel,WhisperProcessor:()=>g.WhisperProcessor,WhisperTextStreamer:()=>C.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>x.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>s.WhisperTokenizer,XLMForQuestionAnswering:()=>t.XLMForQuestionAnswering,XLMForSequenceClassification:()=>t.XLMForSequenceClassification,XLMForTokenClassification:()=>t.XLMForTokenClassification,XLMModel:()=>t.XLMModel,XLMPreTrainedModel:()=>t.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>t.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>t.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>t.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>t.XLMRobertaForTokenClassification,XLMRobertaModel:()=>t.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>t.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>s.XLMRobertaTokenizer,XLMTokenizer:()=>s.XLMTokenizer,XLMWithLMHeadModel:()=>t.XLMWithLMHeadModel,XVectorOutput:()=>t.XVectorOutput,YolosFeatureExtractor:()=>f.YolosFeatureExtractor,YolosForObjectDetection:()=>t.YolosForObjectDetection,YolosImageProcessor:()=>f.YolosImageProcessor,YolosModel:()=>t.YolosModel,YolosObjectDetectionOutput:()=>t.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>t.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>r.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>r.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>r.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>r.ZeroShotObjectDetectionPipeline,bankers_round:()=>u.bankers_round,cat:()=>l.cat,cos_sim:()=>u.cos_sim,dot:()=>u.dot,dynamic_time_warping:()=>u.dynamic_time_warping,env:()=>e.env,full:()=>l.full,full_like:()=>l.full_like,getKeyValueShapes:()=>o.getKeyValueShapes,hamming:()=>n.hamming,hanning:()=>n.hanning,interpolate:()=>l.interpolate,interpolate_4d:()=>l.interpolate_4d,interpolate_data:()=>u.interpolate_data,is_chinese_char:()=>s.is_chinese_char,layer_norm:()=>l.layer_norm,load_image:()=>i.load_image,load_video:()=>a.load_video,log_softmax:()=>u.log_softmax,magnitude:()=>u.magnitude,matmul:()=>l.matmul,max:()=>u.max,mean:()=>l.mean,mean_pooling:()=>l.mean_pooling,medianFilter:()=>u.medianFilter,mel_filter_bank:()=>n.mel_filter_bank,min:()=>u.min,ones:()=>l.ones,ones_like:()=>l.ones_like,permute:()=>l.permute,permute_data:()=>u.permute_data,pipeline:()=>r.pipeline,quantize_embeddings:()=>l.quantize_embeddings,rand:()=>l.rand,read_audio:()=>n.read_audio,rfft:()=>l.rfft,round:()=>u.round,slice:()=>l.slice,softmax:()=>u.softmax,spectrogram:()=>n.spectrogram,stack:()=>l.stack,std_mean:()=>l.std_mean,topk:()=>l.topk,window_function:()=>n.window_function,zeros:()=>l.zeros,zeros_like:()=>l.zeros_like});var e=jt("./src/env.js"),r=jt("./src/pipelines.js"),t=jt("./src/models.js"),s=jt("./src/tokenizers.js"),o=jt("./src/configs.js"),n=jt("./src/utils/audio.js"),i=jt("./src/utils/image.js"),a=jt("./src/utils/video.js"),l=jt("./src/utils/tensor.js"),u=jt("./src/utils/maths.js"),p=jt("./src/base/feature_extraction_utils.js"),c=jt("./src/models/feature_extractors.js"),d=jt("./src/models/auto/feature_extraction_auto.js"),_=jt("./src/base/image_processors_utils.js"),f=jt("./src/models/image_processors.js"),v=jt("./src/models/auto/image_processing_auto.js"),$=jt("./src/base/processing_utils.js"),g=jt("./src/models/processors.js"),w=jt("./src/models/auto/processing_auto.js"),C=jt("./src/generation/streamers.js"),E=jt("./src/generation/stopping_criteria.js"),x=jt("./src/generation/logits_process.js")})();m.ASTFeatureExtractor;m.ASTForAudioClassification;m.ASTModel;m.ASTPreTrainedModel;m.AlbertForMaskedLM;m.AlbertForQuestionAnswering;m.AlbertForSequenceClassification;m.AlbertModel;m.AlbertPreTrainedModel;m.AlbertTokenizer;m.AudioClassificationPipeline;m.AutoConfig;m.AutoFeatureExtractor;m.AutoImageProcessor;var pT=m.AutoModel;m.AutoModelForAudioClassification;m.AutoModelForAudioFrameClassification;m.AutoModelForAudioTextToText;m.AutoModelForCTC;m.AutoModelForCausalLM;m.AutoModelForDepthEstimation;m.AutoModelForDocumentQuestionAnswering;m.AutoModelForImageClassification;m.AutoModelForImageFeatureExtraction;m.AutoModelForImageMatting;m.AutoModelForImageSegmentation;m.AutoModelForImageTextToText;m.AutoModelForImageToImage;m.AutoModelForMaskGeneration;m.AutoModelForMaskedLM;m.AutoModelForNormalEstimation;m.AutoModelForObjectDetection;m.AutoModelForPoseEstimation;m.AutoModelForQuestionAnswering;m.AutoModelForSemanticSegmentation;m.AutoModelForSeq2SeqLM;m.AutoModelForSequenceClassification;m.AutoModelForSpeechSeq2Seq;m.AutoModelForTextToSpectrogram;m.AutoModelForTextToWaveform;m.AutoModelForTokenClassification;m.AutoModelForUniversalSegmentation;m.AutoModelForVision2Seq;m.AutoModelForXVector;m.AutoModelForZeroShotObjectDetection;var hT=m.AutoProcessor;m.AutoTokenizer;m.AutomaticSpeechRecognitionPipeline;m.BackgroundRemovalPipeline;m.BartForConditionalGeneration;m.BartForSequenceClassification;m.BartModel;m.BartPretrainedModel;m.BartTokenizer;m.BaseModelOutput;m.BaseStreamer;m.BeitFeatureExtractor;m.BeitForImageClassification;m.BeitModel;m.BeitPreTrainedModel;m.BertForMaskedLM;m.BertForQuestionAnswering;m.BertForSequenceClassification;m.BertForTokenClassification;m.BertModel;m.BertPreTrainedModel;m.BertTokenizer;m.BitImageProcessor;m.BlenderbotForConditionalGeneration;m.BlenderbotModel;m.BlenderbotPreTrainedModel;m.BlenderbotSmallForConditionalGeneration;m.BlenderbotSmallModel;m.BlenderbotSmallPreTrainedModel;m.BlenderbotSmallTokenizer;m.BlenderbotTokenizer;m.BloomForCausalLM;m.BloomModel;m.BloomPreTrainedModel;m.BloomTokenizer;m.CLIPFeatureExtractor;m.CLIPImageProcessor;m.CLIPModel;m.CLIPPreTrainedModel;m.CLIPSegForImageSegmentation;m.CLIPSegModel;m.CLIPSegPreTrainedModel;m.CLIPTextModel;m.CLIPTextModelWithProjection;m.CLIPTokenizer;m.CLIPVisionModel;m.CLIPVisionModelWithProjection;m.CamembertForMaskedLM;m.CamembertForQuestionAnswering;m.CamembertForSequenceClassification;m.CamembertForTokenClassification;m.CamembertModel;m.CamembertPreTrainedModel;m.CamembertTokenizer;m.CausalLMOutput;m.CausalLMOutputWithPast;m.ChineseCLIPFeatureExtractor;m.ChineseCLIPModel;m.ChineseCLIPPreTrainedModel;m.ClapAudioModelWithProjection;m.ClapFeatureExtractor;m.ClapModel;m.ClapPreTrainedModel;m.ClapTextModelWithProjection;m.ClassifierFreeGuidanceLogitsProcessor;m.CodeGenForCausalLM;m.CodeGenModel;m.CodeGenPreTrainedModel;m.CodeGenTokenizer;m.CodeLlamaTokenizer;m.CohereForCausalLM;m.CohereModel;m.CoherePreTrainedModel;m.CohereTokenizer;m.ConvBertForMaskedLM;m.ConvBertForQuestionAnswering;m.ConvBertForSequenceClassification;m.ConvBertForTokenClassification;m.ConvBertModel;m.ConvBertPreTrainedModel;m.ConvBertTokenizer;m.ConvNextFeatureExtractor;m.ConvNextForImageClassification;m.ConvNextImageProcessor;m.ConvNextModel;m.ConvNextPreTrainedModel;m.ConvNextV2ForImageClassification;m.ConvNextV2Model;m.ConvNextV2PreTrainedModel;m.DFineForObjectDetection;m.DFineModel;m.DFinePreTrainedModel;m.DPTFeatureExtractor;m.DPTForDepthEstimation;m.DPTImageProcessor;m.DPTModel;m.DPTPreTrainedModel;m.DacDecoderModel;m.DacDecoderOutput;m.DacEncoderModel;m.DacEncoderOutput;m.DacFeatureExtractor;m.DacModel;m.DacPreTrainedModel;m.DataTypeMap;m.DebertaForMaskedLM;m.DebertaForQuestionAnswering;m.DebertaForSequenceClassification;m.DebertaForTokenClassification;m.DebertaModel;m.DebertaPreTrainedModel;m.DebertaTokenizer;m.DebertaV2ForMaskedLM;m.DebertaV2ForQuestionAnswering;m.DebertaV2ForSequenceClassification;m.DebertaV2ForTokenClassification;m.DebertaV2Model;m.DebertaV2PreTrainedModel;m.DebertaV2Tokenizer;m.DecisionTransformerModel;m.DecisionTransformerPreTrainedModel;m.DeiTFeatureExtractor;m.DeiTForImageClassification;m.DeiTImageProcessor;m.DeiTModel;m.DeiTPreTrainedModel;m.DepthAnythingForDepthEstimation;m.DepthAnythingPreTrainedModel;m.DepthEstimationPipeline;m.DepthProForDepthEstimation;m.DepthProPreTrainedModel;m.DetrFeatureExtractor;m.DetrForObjectDetection;m.DetrForSegmentation;m.DetrImageProcessor;m.DetrModel;m.DetrObjectDetectionOutput;m.DetrPreTrainedModel;m.DetrSegmentationOutput;m.Dinov2ForImageClassification;m.Dinov2Model;m.Dinov2PreTrainedModel;m.Dinov2WithRegistersForImageClassification;m.Dinov2WithRegistersModel;m.Dinov2WithRegistersPreTrainedModel;m.DistilBertForMaskedLM;m.DistilBertForQuestionAnswering;m.DistilBertForSequenceClassification;m.DistilBertForTokenClassification;m.DistilBertModel;m.DistilBertPreTrainedModel;m.DistilBertTokenizer;m.DocumentQuestionAnsweringPipeline;m.DonutFeatureExtractor;m.DonutImageProcessor;m.DonutSwinModel;m.DonutSwinPreTrainedModel;m.EfficientNetForImageClassification;m.EfficientNetImageProcessor;m.EfficientNetModel;m.EfficientNetPreTrainedModel;m.ElectraForMaskedLM;m.ElectraForQuestionAnswering;m.ElectraForSequenceClassification;m.ElectraForTokenClassification;m.ElectraModel;m.ElectraPreTrainedModel;m.ElectraTokenizer;m.EncodecFeatureExtractor;m.EosTokenCriteria;m.EsmForMaskedLM;m.EsmForSequenceClassification;m.EsmForTokenClassification;m.EsmModel;m.EsmPreTrainedModel;m.EsmTokenizer;m.ExaoneForCausalLM;m.ExaoneModel;m.ExaonePreTrainedModel;m.FFT;m.FalconForCausalLM;m.FalconModel;m.FalconPreTrainedModel;m.FalconTokenizer;m.FastViTForImageClassification;m.FastViTModel;m.FastViTPreTrainedModel;m.FeatureExtractionPipeline;m.FeatureExtractor;m.FillMaskPipeline;m.Florence2ForConditionalGeneration;m.Florence2PreTrainedModel;m.Florence2Processor;m.ForcedBOSTokenLogitsProcessor;m.ForcedEOSTokenLogitsProcessor;m.GLPNFeatureExtractor;m.GLPNForDepthEstimation;m.GLPNModel;m.GLPNPreTrainedModel;m.GPT2LMHeadModel;m.GPT2Model;m.GPT2PreTrainedModel;m.GPT2Tokenizer;m.GPTBigCodeForCausalLM;m.GPTBigCodeModel;m.GPTBigCodePreTrainedModel;m.GPTJForCausalLM;m.GPTJModel;m.GPTJPreTrainedModel;m.GPTNeoForCausalLM;m.GPTNeoModel;m.GPTNeoPreTrainedModel;m.GPTNeoXForCausalLM;m.GPTNeoXModel;m.GPTNeoXPreTrainedModel;m.GPTNeoXTokenizer;m.Gemma2ForCausalLM;m.Gemma2Model;m.Gemma2PreTrainedModel;m.Gemma3ForCausalLM;m.Gemma3Model;m.Gemma3PreTrainedModel;m.GemmaForCausalLM;m.GemmaModel;m.GemmaPreTrainedModel;m.GemmaTokenizer;m.GlmForCausalLM;m.GlmModel;m.GlmPreTrainedModel;m.GraniteForCausalLM;m.GraniteModel;m.GranitePreTrainedModel;m.Grok1Tokenizer;m.GroundingDinoForObjectDetection;m.GroundingDinoImageProcessor;m.GroundingDinoPreTrainedModel;m.GroundingDinoProcessor;m.GroupViTModel;m.GroupViTPreTrainedModel;m.HeliumForCausalLM;m.HeliumModel;m.HeliumPreTrainedModel;m.HerbertTokenizer;m.HieraForImageClassification;m.HieraModel;m.HieraPreTrainedModel;m.HubertForCTC;m.HubertForSequenceClassification;m.HubertModel;m.HubertPreTrainedModel;m.IJepaForImageClassification;m.IJepaModel;m.IJepaPreTrainedModel;m.Idefics3ForConditionalGeneration;m.Idefics3ImageProcessor;m.Idefics3PreTrainedModel;m.Idefics3Processor;m.ImageClassificationPipeline;m.ImageFeatureExtractionPipeline;m.ImageFeatureExtractor;m.ImageMattingOutput;m.ImageProcessor;m.ImageSegmentationPipeline;m.ImageToImagePipeline;m.ImageToTextPipeline;m.InterruptableStoppingCriteria;m.JAISLMHeadModel;m.JAISModel;m.JAISPreTrainedModel;m.JinaCLIPImageProcessor;m.JinaCLIPModel;m.JinaCLIPPreTrainedModel;m.JinaCLIPProcessor;m.JinaCLIPTextModel;m.JinaCLIPVisionModel;m.LiteWhisperForConditionalGeneration;m.LlamaForCausalLM;m.LlamaModel;m.LlamaPreTrainedModel;m.LlamaTokenizer;m.LlavaForConditionalGeneration;m.LlavaOnevisionForConditionalGeneration;m.LlavaOnevisionImageProcessor;m.LlavaPreTrainedModel;m.LogitsProcessor;m.LogitsProcessorList;m.LogitsWarper;m.LongT5ForConditionalGeneration;m.LongT5Model;m.LongT5PreTrainedModel;m.M2M100ForConditionalGeneration;m.M2M100Model;m.M2M100PreTrainedModel;m.M2M100Tokenizer;m.MBart50Tokenizer;m.MBartForCausalLM;m.MBartForConditionalGeneration;m.MBartForSequenceClassification;m.MBartModel;m.MBartPreTrainedModel;m.MBartTokenizer;m.MPNetForMaskedLM;m.MPNetForQuestionAnswering;m.MPNetForSequenceClassification;m.MPNetForTokenClassification;m.MPNetModel;m.MPNetPreTrainedModel;m.MPNetTokenizer;m.MT5ForConditionalGeneration;m.MT5Model;m.MT5PreTrainedModel;m.MarianMTModel;m.MarianModel;m.MarianPreTrainedModel;m.MarianTokenizer;m.Mask2FormerImageProcessor;m.MaskFormerFeatureExtractor;m.MaskFormerForInstanceSegmentation;m.MaskFormerImageProcessor;m.MaskFormerModel;m.MaskFormerPreTrainedModel;m.MaskedLMOutput;m.MaxLengthCriteria;m.Metric3DForDepthEstimation;m.Metric3DPreTrainedModel;m.Metric3Dv2ForDepthEstimation;m.Metric3Dv2PreTrainedModel;m.MgpstrForSceneTextRecognition;m.MgpstrModelOutput;m.MgpstrPreTrainedModel;m.MgpstrProcessor;m.MgpstrTokenizer;m.MimiDecoderModel;m.MimiDecoderOutput;m.MimiEncoderModel;m.MimiEncoderOutput;m.MimiModel;m.MimiPreTrainedModel;m.MinLengthLogitsProcessor;m.MinNewTokensLengthLogitsProcessor;m.MistralForCausalLM;m.MistralModel;m.MistralPreTrainedModel;m.MobileBertForMaskedLM;m.MobileBertForQuestionAnswering;m.MobileBertForSequenceClassification;m.MobileBertModel;m.MobileBertPreTrainedModel;m.MobileBertTokenizer;m.MobileLLMForCausalLM;m.MobileLLMModel;m.MobileLLMPreTrainedModel;m.MobileNetV1FeatureExtractor;m.MobileNetV1ForImageClassification;m.MobileNetV1ForSemanticSegmentation;m.MobileNetV1ImageProcessor;m.MobileNetV1Model;m.MobileNetV1PreTrainedModel;m.MobileNetV2FeatureExtractor;m.MobileNetV2ForImageClassification;m.MobileNetV2ForSemanticSegmentation;m.MobileNetV2ImageProcessor;m.MobileNetV2Model;m.MobileNetV2PreTrainedModel;m.MobileNetV3FeatureExtractor;m.MobileNetV3ForImageClassification;m.MobileNetV3ForSemanticSegmentation;m.MobileNetV3ImageProcessor;m.MobileNetV3Model;m.MobileNetV3PreTrainedModel;m.MobileNetV4FeatureExtractor;m.MobileNetV4ForImageClassification;m.MobileNetV4ForSemanticSegmentation;m.MobileNetV4ImageProcessor;m.MobileNetV4Model;m.MobileNetV4PreTrainedModel;m.MobileViTFeatureExtractor;m.MobileViTForImageClassification;m.MobileViTImageProcessor;m.MobileViTModel;m.MobileViTPreTrainedModel;m.MobileViTV2ForImageClassification;m.MobileViTV2Model;m.MobileViTV2PreTrainedModel;m.ModelOutput;m.ModernBertForMaskedLM;m.ModernBertForSequenceClassification;m.ModernBertForTokenClassification;m.ModernBertModel;m.ModernBertPreTrainedModel;m.Moondream1ForConditionalGeneration;m.MoonshineFeatureExtractor;m.MoonshineForConditionalGeneration;m.MoonshineModel;m.MoonshinePreTrainedModel;m.MoonshineProcessor;m.MptForCausalLM;m.MptModel;m.MptPreTrainedModel;m.MultiModalityCausalLM;m.MultiModalityPreTrainedModel;m.MusicgenForCausalLM;m.MusicgenForConditionalGeneration;m.MusicgenModel;m.MusicgenPreTrainedModel;m.NllbTokenizer;m.NoBadWordsLogitsProcessor;m.NoRepeatNGramLogitsProcessor;m.NomicBertModel;m.NomicBertPreTrainedModel;m.NougatImageProcessor;m.NougatTokenizer;m.OPTForCausalLM;m.OPTModel;m.OPTPreTrainedModel;m.ObjectDetectionPipeline;m.Olmo2ForCausalLM;m.Olmo2Model;m.Olmo2PreTrainedModel;m.OlmoForCausalLM;m.OlmoModel;m.OlmoPreTrainedModel;m.OpenELMForCausalLM;m.OpenELMModel;m.OpenELMPreTrainedModel;m.OwlViTFeatureExtractor;m.OwlViTForObjectDetection;m.OwlViTImageProcessor;m.OwlViTModel;m.OwlViTPreTrainedModel;m.OwlViTProcessor;m.Owlv2ForObjectDetection;m.Owlv2ImageProcessor;m.Owlv2Model;m.Owlv2PreTrainedModel;m.PaliGemmaForConditionalGeneration;m.PaliGemmaPreTrainedModel;m.PaliGemmaProcessor;m.PatchTSMixerForPrediction;m.PatchTSMixerModel;m.PatchTSMixerPreTrainedModel;m.PatchTSTForPrediction;m.PatchTSTModel;m.PatchTSTPreTrainedModel;m.Phi3ForCausalLM;m.Phi3Model;m.Phi3PreTrainedModel;m.Phi3VForCausalLM;m.Phi3VImageProcessor;m.Phi3VPreTrainedModel;m.Phi3VProcessor;m.PhiForCausalLM;m.PhiModel;m.PhiPreTrainedModel;m.Pipeline;m.PreTrainedModel;m.PreTrainedTokenizer;m.PretrainedConfig;m.PretrainedMixin;m.Processor;m.PvtForImageClassification;m.PvtImageProcessor;m.PvtModel;m.PvtPreTrainedModel;m.PyAnnoteFeatureExtractor;m.PyAnnoteForAudioFrameClassification;m.PyAnnoteModel;m.PyAnnotePreTrainedModel;m.PyAnnoteProcessor;m.QuestionAnsweringModelOutput;m.QuestionAnsweringPipeline;m.Qwen2ForCausalLM;m.Qwen2Model;m.Qwen2PreTrainedModel;m.Qwen2Tokenizer;m.Qwen2VLForConditionalGeneration;m.Qwen2VLImageProcessor;m.Qwen2VLPreTrainedModel;m.Qwen2VLProcessor;m.Qwen3ForCausalLM;m.Qwen3Model;m.Qwen3PreTrainedModel;m.RFDetrForObjectDetection;m.RFDetrModel;m.RFDetrObjectDetectionOutput;m.RFDetrPreTrainedModel;m.RTDetrForObjectDetection;m.RTDetrImageProcessor;m.RTDetrModel;m.RTDetrObjectDetectionOutput;m.RTDetrPreTrainedModel;m.RTDetrV2ForObjectDetection;m.RTDetrV2Model;m.RTDetrV2ObjectDetectionOutput;m.RTDetrV2PreTrainedModel;m.RawAudio;var cb=m.RawImage;m.RawVideo;m.RawVideoFrame;m.RepetitionPenaltyLogitsProcessor;m.ResNetForImageClassification;m.ResNetModel;m.ResNetPreTrainedModel;m.RoFormerForMaskedLM;m.RoFormerForQuestionAnswering;m.RoFormerForSequenceClassification;m.RoFormerForTokenClassification;m.RoFormerModel;m.RoFormerPreTrainedModel;m.RoFormerTokenizer;m.RobertaForMaskedLM;m.RobertaForQuestionAnswering;m.RobertaForSequenceClassification;m.RobertaForTokenClassification;m.RobertaModel;m.RobertaPreTrainedModel;m.RobertaTokenizer;m.SamImageProcessor;m.SamImageSegmentationOutput;m.SamModel;m.SamPreTrainedModel;m.SamProcessor;m.SapiensForDepthEstimation;m.SapiensForNormalEstimation;m.SapiensForSemanticSegmentation;m.SapiensPreTrainedModel;m.SeamlessM4TFeatureExtractor;m.SegformerFeatureExtractor;m.SegformerForImageClassification;m.SegformerForSemanticSegmentation;m.SegformerImageProcessor;m.SegformerModel;m.SegformerPreTrainedModel;m.Seq2SeqLMOutput;m.SequenceClassifierOutput;m.SiglipImageProcessor;m.SiglipModel;m.SiglipPreTrainedModel;m.SiglipTextModel;m.SiglipTokenizer;m.SiglipVisionModel;m.SmolVLMForConditionalGeneration;m.SmolVLMImageProcessor;m.SmolVLMProcessor;m.SnacDecoderModel;m.SnacEncoderModel;m.SnacFeatureExtractor;m.SnacModel;m.SnacPreTrainedModel;m.SpeechT5FeatureExtractor;m.SpeechT5ForSpeechToText;m.SpeechT5ForTextToSpeech;m.SpeechT5HifiGan;m.SpeechT5Model;m.SpeechT5PreTrainedModel;m.SpeechT5Processor;m.SpeechT5Tokenizer;m.SqueezeBertForMaskedLM;m.SqueezeBertForQuestionAnswering;m.SqueezeBertForSequenceClassification;m.SqueezeBertModel;m.SqueezeBertPreTrainedModel;m.SqueezeBertTokenizer;m.StableLmForCausalLM;m.StableLmModel;m.StableLmPreTrainedModel;m.Starcoder2ForCausalLM;m.Starcoder2Model;m.Starcoder2PreTrainedModel;m.StoppingCriteria;m.StoppingCriteriaList;m.StyleTextToSpeech2Model;m.StyleTextToSpeech2PreTrainedModel;m.SummarizationPipeline;m.SuppressTokensAtBeginLogitsProcessor;m.Swin2SRForImageSuperResolution;m.Swin2SRImageProcessor;m.Swin2SRModel;m.Swin2SRPreTrainedModel;m.SwinForImageClassification;m.SwinForSemanticSegmentation;m.SwinModel;m.SwinPreTrainedModel;m.T5ForConditionalGeneration;m.T5Model;m.T5PreTrainedModel;m.T5Tokenizer;m.TableTransformerForObjectDetection;m.TableTransformerModel;m.TableTransformerObjectDetectionOutput;m.TableTransformerPreTrainedModel;m.TemperatureLogitsWarper;m.Tensor;m.Text2TextGenerationPipeline;m.TextClassificationPipeline;m.TextGenerationPipeline;m.TextStreamer;m.TextToAudioPipeline;m.TokenClassificationPipeline;m.TokenClassifierOutput;m.TokenizerModel;m.TopKLogitsWarper;m.TopPLogitsWarper;m.TrOCRForCausalLM;m.TrOCRPreTrainedModel;m.TranslationPipeline;m.UltravoxModel;m.UltravoxPreTrainedModel;m.UltravoxProcessor;m.UniSpeechForCTC;m.UniSpeechForSequenceClassification;m.UniSpeechModel;m.UniSpeechPreTrainedModel;m.UniSpeechSatForAudioFrameClassification;m.UniSpeechSatForCTC;m.UniSpeechSatForSequenceClassification;m.UniSpeechSatModel;m.UniSpeechSatPreTrainedModel;m.VLChatProcessor;m.VLMImageProcessor;m.ViTFeatureExtractor;m.ViTForImageClassification;m.ViTImageProcessor;m.ViTMAEModel;m.ViTMAEPreTrainedModel;m.ViTMSNForImageClassification;m.ViTMSNModel;m.ViTMSNPreTrainedModel;m.ViTModel;m.ViTPreTrainedModel;m.VisionEncoderDecoderModel;m.VitMatteForImageMatting;m.VitMatteImageProcessor;m.VitMattePreTrainedModel;m.VitPoseForPoseEstimation;m.VitPoseImageProcessor;m.VitPosePreTrainedModel;m.VitsModel;m.VitsModelOutput;m.VitsPreTrainedModel;m.VitsTokenizer;m.Wav2Vec2BertForCTC;m.Wav2Vec2BertForSequenceClassification;m.Wav2Vec2BertModel;m.Wav2Vec2BertPreTrainedModel;m.Wav2Vec2CTCTokenizer;m.Wav2Vec2FeatureExtractor;m.Wav2Vec2ForAudioFrameClassification;m.Wav2Vec2ForCTC;m.Wav2Vec2ForSequenceClassification;m.Wav2Vec2Model;m.Wav2Vec2PreTrainedModel;m.Wav2Vec2Processor;m.Wav2Vec2ProcessorWithLM;m.WavLMForAudioFrameClassification;m.WavLMForCTC;m.WavLMForSequenceClassification;m.WavLMForXVector;m.WavLMModel;m.WavLMPreTrainedModel;m.WeSpeakerFeatureExtractor;m.WeSpeakerResNetModel;m.WeSpeakerResNetPreTrainedModel;m.WhisperFeatureExtractor;m.WhisperForConditionalGeneration;m.WhisperModel;m.WhisperPreTrainedModel;m.WhisperProcessor;m.WhisperTextStreamer;m.WhisperTimeStampLogitsProcessor;m.WhisperTokenizer;m.XLMForQuestionAnswering;m.XLMForSequenceClassification;m.XLMForTokenClassification;m.XLMModel;m.XLMPreTrainedModel;m.XLMRobertaForMaskedLM;m.XLMRobertaForQuestionAnswering;m.XLMRobertaForSequenceClassification;m.XLMRobertaForTokenClassification;m.XLMRobertaModel;m.XLMRobertaPreTrainedModel;m.XLMRobertaTokenizer;m.XLMTokenizer;m.XLMWithLMHeadModel;m.XVectorOutput;m.YolosFeatureExtractor;m.YolosForObjectDetection;m.YolosImageProcessor;m.YolosModel;m.YolosObjectDetectionOutput;m.YolosPreTrainedModel;m.ZeroShotAudioClassificationPipeline;m.ZeroShotClassificationPipeline;m.ZeroShotImageClassificationPipeline;m.ZeroShotObjectDetectionPipeline;m.bankers_round;m.cat;m.cos_sim;m.dot;m.dynamic_time_warping;var mT=m.env;m.full;m.full_like;m.getKeyValueShapes;m.hamming;m.hanning;m.interpolate;m.interpolate_4d;m.interpolate_data;m.is_chinese_char;m.layer_norm;m.load_image;m.load_video;m.log_softmax;m.magnitude;m.matmul;m.max;m.mean;m.mean_pooling;m.medianFilter;m.mel_filter_bank;m.min;m.ones;m.ones_like;m.permute;m.permute_data;m.pipeline;m.quantize_embeddings;m.rand;m.read_audio;m.rfft;m.round;m.slice;m.softmax;m.spectrogram;m.stack;m.std_mean;m.topk;m.window_function;m.zeros;m.zeros_like;const fT={flex:"","flex-col":"","items-center":"","gap-4":""},_T=["disabled"],gT={"h-full":"","w-full":"",flex:"","gap-2":""},wT={w:"[50%]",border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","min-h":"120",h:"auto","overflow-hidden":"","rounded-lg":""},bT=["src"],MT={w:"[50%]",border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","min-h":"120",h:"auto",relative:"","overflow-hidden":"","rounded-lg":""},yT={key:0,bg:"black/50",absolute:"","inset-0":"","z-10":"",flex:"","flex-col":"","items-center":"","justify-center":""},vT={"mb-4":"","text-white":"","font-medium":""},xT={bg:"gray-200/30",w:"70%","h-2":"","overflow-hidden":"","rounded-full":""},TT=["src"],ET={bg:"black/0 group-hover:black/20",absolute:"","inset-0":"",flex:"","items-center":"","justify-center":"","transition-all":"","duration-200":""},PT=["onClick"],CT={key:1,absolute:"","bottom-2":"","right-2":""},OT=Mv({__name:"background-remove",setup(e){const r=zs(),t=zs(),s=zs(),o=zs(),n=zs(!1),i=zs(0),a=zs(),l=zs(),u=zs([]),p=yv(()=>u.value.map(f=>URL.createObjectURL(f)));vv(async()=>{try{if(!(await bv()).supported)throw new Error("WebGPU is not supported in this browser.");const f="Xenova/modnet";mT.backends.onnx.wasm.proxy=!1,r.value??(r.value=await pT.from_pretrained(f,{device:"webgpu"})),t.value??(t.value=await hT.from_pretrained(f,{}))}catch(f){s.value=f}o.value=!1});async function c(){if(!r.value||!t.value)return;n.value=!0,i.value=0,a.value=[];const f=p.value.length;for(let v=0;v=a.value.length||!u.value[f])return;const v=u.value[f].name,$=v.substring(0,v.lastIndexOf("."))||v,g=v.substring(v.lastIndexOf("."))||".png",w=`${$}-background-removed${g}`,C=document.createElement("a");C.href=a.value[f],C.download=w,document.body.appendChild(C),C.click(),document.body.removeChild(C)}function _(){!a.value||a.value.length===0||a.value.forEach((f,v)=>{setTimeout(()=>d(v),v*100)})}return(f,v)=>(En(),Tn("div",fT,[Vr("button",{bg:"neutral-100 dark:neutral-800","w-full":"","cursor-pointer":"","rounded-lg":"","px-3":"","py-2":"",disabled:n.value,onClick:c},Ef(n.value?"Processing...":"Process"),9,_T),Vr("div",gT,[Vr("div",wT,[(En(!0),Tn(Pf,null,Cf(p.value,($,g)=>(En(),Tn("img",{key:g,src:$,"h-full":"","w-full":"","object-cover":""},null,8,bT))),128))]),Vr("div",MT,[n.value?(En(),Tn("div",yT,[Vr("div",vT,Ef(i.value)+"% ",1),Vr("div",xT,[Vr("div",{bg:"emerald-500","h-full":"",style:Tv({width:`${i.value}%`}),"transition-all":"","duration-200":""},null,4)])])):Sf("",!0),(En(!0),Tn(Pf,null,Cf(a.value,($,g)=>(En(),Tn("div",{key:g,relative:"",class:"group","h-full":"","w-full":""},[Vr("img",{src:$,"h-full":"","w-full":"","object-cover":""},null,8,TT),Vr("div",ET,[Vr("button",{bg:"emerald-500 hover:emerald-600","rounded-full":"","p-2":"","text-white":"","opacity-0":"","transition-all":"","duration-200":"","group-hover:opacity-100":"",onClick:w=>d(g)},v[1]||(v[1]=[Vr("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[Vr("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)]),8,PT)])]))),128)),a.value&&a.value.length>1?(En(),Tn("div",CT,[Vr("button",{bg:"emerald-500 hover:emerald-600","rounded-full":"","p-2":"","text-white":"",onClick:_},v[2]||(v[2]=[Vr("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[Vr("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})],-1)]))])):Sf("",!0)])]),xv(Ev(wv),{modelValue:u.value,"onUpdate:modelValue":v[0]||(v[0]=$=>u.value=$),"w-full":""},null,8,["modelValue"])]))}});export{OT as default}; diff --git a/assets/background-remove-CI-N-inF.js b/assets/background-remove-CI-N-inF.js new file mode 100644 index 0000000000000000000000000000000000000000..0c444cdd33259fe6ef1d659ba8e26d00e8cfc8ce --- /dev/null +++ b/assets/background-remove-CI-N-inF.js @@ -0,0 +1,3568 @@ +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-BtAisBe9.js";import"./src-bHDRqBSs.js";import{InputFile_default as _}from"./InputFile-B1bjga7G.js";import{check as v}from"./webgpu-Cnn5XZ2r.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. +* Licensed under the MIT License. +*/ +var he=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,_e=Object.getOwnPropertyNames,ve=Object.prototype.hasOwnProperty,ye=(e=>typeof r<`u`?r:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof r<`u`?r:e)[t]}):e)(function(e){if(typeof r<`u`)return r.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),L=(e,t)=>()=>(e&&(t=e(e=0)),t),be=(e,t)=>{for(var n in t)he(e,n,{get:t[n],enumerable:!0})},xe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of _e(t))!ve.call(e,i)&&i!==n&&he(e,i,{get:()=>t[i],enumerable:!(r=ge(t,i))||r.enumerable});return e},Se=e=>xe(he({},`__esModule`,{value:!0}),e),Ce,we,Te,Ee,De,Oe=L(()=>{"use strict";Ce=new Map,we=[],Te=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=Ce.get(e);if(r===void 0)Ce.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=we.indexOf(e);t!==-1&&we.splice(t,1);for(let t=0;t{let t=Ce.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}}},De=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?we:n,i,a=[],o=new Set;for(let e of r){let t=await Ee(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)})]}}),ke=L(()=>{"use strict";Oe()}),Ae,je=L(()=>{"use strict";Ae=`1.22.0-dev.20250409-89f8206ba4`}),Me,Ne,Pe=L(()=>{"use strict";je(),Me=`warning`,Ne={wasm:{},webgl:{},webgpu:{},versions:{common:Ae},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}`);Me=e}},get logLevel(){return Me}},Object.defineProperty(Ne,`logLevel`,{enumerable:!0})}),R,Fe=L(()=>{"use strict";Pe(),R=Ne}),Ie,Le,Re=L(()=>{"use strict";Ie=(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?t.format:`RGB`,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{"use strict";et(),ze=(e,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?t.tensorFormat:`RGB`,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,ze(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(ze(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return ze(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},Ve=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new $e({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},z=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new $e({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},He=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new $e({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},Ue=(e,t,n)=>new $e({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),Ge,Ke,qe,Je,Ye=L(()=>{"use strict";Ge=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),Ke=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),qe=!1,Je=()=>{if(!qe){qe=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(Ge.set(`int64`,BigInt64Array),Ke.set(BigInt64Array,`int64`)),t&&(Ge.set(`uint64`,BigUint64Array),Ke.set(BigUint64Array,`uint64`)),r?(Ge.set(`float16`,n),Ke.set(n,`float16`)):Ge.set(`float16`,Uint16Array)}}}),Xe,Ze,Qe=L(()=>{"use strict";et(),Xe=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new $e(e.type,e.data,t);case`cpu-pinned`:return new $e({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new $e({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new $e({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new $e({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),$e,et=L(()=>{"use strict";Re(),We(),Ye(),Qe(),$e=class{constructor(e,t,n){Je();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=Ge.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=Ge.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=Ke.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=Xe(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 Be(e,t)}static fromTexture(e,t){return Ve(e,t)}static fromGpuBuffer(e,t){return z(e,t)}static fromMLTensor(e,t){return He(e,t)}static fromPinnedBuffer(e,t,n){return Ue(e,t,n)}toDataURL(e){return Ie(this,e)}toImageData(e){return Le(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 Ze(this,e)}}}),tt,nt=L(()=>{"use strict";et(),tt=$e}),rt,it,at,ot,st=L(()=>{"use strict";Pe(),rt=(e,t)=>{(typeof Ne.trace>`u`?!Ne.wasm.trace:!Ne.trace)||console.timeStamp(`${e}::ORT::${t}`)},it=(e,t)=>{var n;let r=(n=Error().stack)?.split(/\r\n|\r|\n/g)||[],i=!1;for(let n=0;n{(typeof Ne.trace>`u`?!Ne.wasm.trace:!Ne.trace)||it(`BEGIN`,e)},ot=e=>{(typeof Ne.trace>`u`?!Ne.wasm.trace:!Ne.trace)||it(`END`,e)}}),ct,lt=L(()=>{"use strict";Oe(),nt(),st(),ct=class e{constructor(e){this.handler=e}async run(e,t,n){at();let r={},i={};if(typeof e!=`object`||!e||e instanceof tt||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 tt)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(typeof n<`u`)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 tt)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)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 tt?s[e]=t:s[e]=new tt(t.type,t.data,t.dims)}return ot(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){at();let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)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(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)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 De(o),l=await s.createInferenceSessionHandler(a,c);return ot(),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}}}),ut,dt=L(()=>{"use strict";lt(),ut=ct}),ft=L(()=>{"use strict";}),pt=L(()=>{"use strict";}),mt=L(()=>{"use strict";}),ht=L(()=>{"use strict";}),gt={};be(gt,{InferenceSession:()=>ut,TRACE:()=>rt,TRACE_FUNC_BEGIN:()=>at,TRACE_FUNC_END:()=>ot,Tensor:()=>tt,env:()=>R,registerBackend:()=>Te});var _t=L(()=>{"use strict";ke(),Fe(),dt(),nt(),ft(),pt(),st(),mt(),ht()}),vt=L(()=>{"use strict";}),yt={};be(yt,{default:()=>St});var bt,xt,St,Ct=L(()=>{"use strict";var e;Wd(),en(),Wt(),bt=`ort-wasm-proxy-worker`,xt=(e=globalThis.self)?.name===bt,xt&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:Qt(n.wasm).then(()=>{Md(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;Nd(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=Ld(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;Rd(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:zd(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;Vd(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},Ud([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:Hd(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),St=xt?null:e=>new Worker(e??Nt,{type:`module`,name:bt})}),wt={};be(wt,{default:()=>Dt});var Tt,Et,Dt,Ot,kt=L(()=>{"use strict";var t;Et=(Tt=import.meta.url,async function(t={}){var n,r,i,a=t,o=new Promise((e,t)=>{r=e,i=t}),s=typeof window==`object`,c=typeof WorkerGlobalScope<`u`,l=c&&(n=self.name)?.startsWith(`em-pthread`);a.mountExternalData=(e,t)=>{e.startsWith(`./`)&&(e=e.substring(2)),(a.Eb||=new Map).set(e,t)},a.unmountExternalData=()=>{delete a.Eb};var u=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let d=e=>async(...t)=>{try{var n;if(a.Fb)throw Error(`Session already started`);let r=a.Fb={dc:t[0],errors:[]},i=await e(...t);if(a.Fb!==r)throw Error(`Session mismatch`);(n=a.Jb)?.flush();let o=r.errors;if(0e),0{if(e===`webgpu`){[a.Jb,a.Ub,a.Yb,a.Kb,a.Xb,a.jb,a.Zb,a.ac,a.Vb,a.Wb,a.$b]=t;let e=a.Jb;a.jsepRegisterBuffer=(t,n,r,i)=>e.registerBuffer(t,n,r,i),a.jsepGetBuffer=t=>e.getBuffer(t),a.jsepCreateDownloader=(t,n,r)=>e.createDownloader(t,n,r),a.jsepOnCreateSession=t=>{e.onCreateSession(t)},a.jsepOnReleaseSession=t=>{e.onReleaseSession(t)},a.jsepOnRunStart=t=>e.onRunStart(t),a.bc=(t,n)=>{e.upload(t,n)}}else if(e===`webnn`){let e=t[0];[a.nc,a.Nb,a.webnnEnsureTensor,a.Ob,a.webnnDownloadTensor]=t.slice(1),a.webnnReleaseTensorId=a.Nb,a.webnnUploadTensor=a.Ob,a.webnnOnRunStart=t=>e.onRunStart(t),a.webnnOnRunEnd=e.onRunEnd.bind(e),a.webnnRegisterMLContext=(t,n)=>{e.registerMLContext(t,n)},a.webnnOnReleaseSession=t=>{e.onReleaseSession(t)},a.webnnCreateMLTensorDownloader=(t,n)=>e.createMLTensorDownloader(t,n),a.webnnRegisterMLTensor=(t,n,r,i)=>e.registerMLTensor(t,n,r,i),a.webnnCreateMLContext=t=>e.createMLContext(t),a.webnnRegisterMLConstant=(t,n,r,i,o,s)=>e.registerMLConstant(t,n,r,i,o,a.Eb,s),a.webnnRegisterGraphInput=e.registerGraphInput.bind(e),a.webnnIsGraphInput=e.isGraphInput.bind(e),a.webnnCreateTemporaryTensor=e.createTemporaryTensor.bind(e),a.webnnIsInt64Supported=e.isInt64Supported.bind(e)}};let f=()=>{let e=(e,t,n)=>(...r)=>{let i=rn,a=t?.();r=e(...r);let o=t?.();return a!==o&&(e=o,n(a),t=n=null),rn==i?r:new Promise((e,t)=>{un={resolve:e,reject:t}})};(()=>{for(let t of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])a[t]=e(a[t],()=>a[t],e=>a[t]=e)})(),d!==void 0&&(a._OrtRun=d(a._OrtRun),a._OrtRunWithBinding=d(a._OrtRunWithBinding)),f=void 0};a.asyncInit=()=>{f?.()};var p,m,h=Object.assign({},a),g=(e,t)=>{throw t},_=``;(s||c)&&(c?_=self.location.href:typeof document<`u`&&document.currentScript&&(_=document.currentScript.src),Tt&&(_=Tt),_=_.startsWith(`blob:`)?``:_.slice(0,_.replace(/[?#].*/,``).lastIndexOf(`/`)+1),c&&(m=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),p=async e=>{if(oe(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});var v=console.log.bind(console),y=console.error.bind(console),b=v,x=y;Object.assign(a,h),h=null;var S,C,w,T,E,D,O,ee,k,te,ne,re,ie,A=a.wasmBinary,ae=!1,oe=e=>e.startsWith(`file://`);function se(){return S.buffer!=T.buffer&&F(),T}function ce(){return S.buffer!=T.buffer&&F(),E}function le(){return S.buffer!=T.buffer&&F(),D}function ue(){return S.buffer!=T.buffer&&F(),O}function j(){return S.buffer!=T.buffer&&F(),ee}function M(){return S.buffer!=T.buffer&&F(),k}function de(){return S.buffer!=T.buffer&&F(),te}function fe(){return S.buffer!=T.buffer&&F(),ie}if(l){let e=function(t){try{var n=t.data,r=n.Bb;if(r===`load`){let t=[];self.onmessage=e=>t.push(e),self.startWorker=()=>{postMessage({Bb:`loaded`});for(let n of t)e(n);self.onmessage=e};for(let e of n.Rb)a[e]&&!a[e].proxy||(a[e]=(...t)=>{postMessage({Bb:`callHandler`,Qb:e,args:t})},e==`print`&&(b=a[e]),e==`printErr`&&(x=a[e]));S=n.kc,F(),N(n.lc)}else if(r===`run`){Re(n.Ab),xr(n.Ab,0,0,1,0,0),Fe(),Wt(n.Ab),P||(J(),P=!0);try{ze(n.fc,n.Hb)}catch(e){if(e!=`unwind`)throw e}}else n.target!==`setimmediate`&&(r===`checkMailbox`?P&&Gt():r&&(x(`worker: received unknown command ${r}`),x(n)))}catch(e){throw Sr(),e}};var pe=e,N,P=!1;x=function(...e){e=e.join(` `),console.error(e)},self.alert=function(...e){postMessage({Bb:`alert`,text:e.join(` `),ic:br()})},self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}function F(){var e=S.buffer;a.HEAP8=T=new Int8Array(e),a.HEAP16=D=new Int16Array(e),a.HEAPU8=E=new Uint8Array(e),a.HEAPU16=O=new Uint16Array(e),a.HEAP32=ee=new Int32Array(e),a.HEAPU32=k=new Uint32Array(e),a.HEAPF32=te=new Float32Array(e),a.HEAPF64=ie=new Float64Array(e),a.HEAP64=ne=new BigInt64Array(e),a.HEAPU64=re=new BigUint64Array(e)}function I(){l?startWorker(a):q.Ca()}l||(S=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),F());var me,he=0,ge=null;function _e(){if(--he==0&&ge){var e=ge;ge=null,e()}}function ve(e){throw x(e=`Aborted(`+e+`)`),ae=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),i(e),e}function ye(){return{a:{L:xe,Aa:be,b:Ve,$:He,A:Ke,pa:qe,X:Xe,Z:Ze,qa:Qe,na:$e,ga:et,ma:tt,J:nt,Y:rt,V:it,oa:at,W:ot,va:lt,E:gt,Q:vt,O:Dt,D:kt,u:At,r:jt,P:Mt,z:Bt,R:Vt,ja:Ht,T:Kt,aa:Jt,M:Yt,F:Xt,ia:Wt,sa:Zt,t:en,Ba:tn,w:pn,o:hn,l:vn,c:xt,n:bn,j:Cn,v:wn,p:Tn,f:En,s:Dn,m:On,e:kn,k:H,i:An,g:jn,d:Mn,da:U,ea:In,fa:W,ba:Ln,ca:Rn,N:Vn,xa:Hn,ua:Gn,h:Jn,C:Yn,G:Xn,ta:Un,x:Zn,ra:Qn,U:$n,q:Bn,y:er,K:tr,S:nr,za:or,ya:sr,ka:dr,la:G,_:Ae,B:fr,I:pr,ha:mr,H:gr,a:S,wa:Oe}}}var L={829644:(e,t,n,r,i)=>{if(a===void 0||!a.Eb)return 1;if((e=Ge(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=a.Eb.get(e)))return 2;if(t=Number(t>>>0),n=Number(n>>>0),r=Number(r>>>0),t+n>e.byteLength)return 3;try{let o=e.subarray(t,t+n);switch(i){case 0:ce().set(o,r>>>0);break;case 1:a.mc?a.mc(r,o):a.bc(r,o);break;default:return 4}return 0}catch{return 4}},830468:(e,t,n)=>{a.Ob(e,ce().subarray(t>>>0,t+n>>>0))},830532:()=>a.nc(),830574:e=>{a.Nb(e)},830611:()=>{a.Vb()},830642:()=>{a.Wb()},830671:()=>{a.$b()},830696:e=>a.Ub(e),830729:e=>a.Yb(e),830761:(e,t,n)=>{a.Kb(Number(e),Number(t),Number(n),!0)},830824:(e,t,n)=>{a.Kb(Number(e),Number(t),Number(n))},830881:()=>typeof wasmOffsetConverter<`u`,830938:e=>{a.jb(`Abs`,e,void 0)},830989:e=>{a.jb(`Neg`,e,void 0)},831040:e=>{a.jb(`Floor`,e,void 0)},831093:e=>{a.jb(`Ceil`,e,void 0)},831145:e=>{a.jb(`Reciprocal`,e,void 0)},831203:e=>{a.jb(`Sqrt`,e,void 0)},831255:e=>{a.jb(`Exp`,e,void 0)},831306:e=>{a.jb(`Erf`,e,void 0)},831357:e=>{a.jb(`Sigmoid`,e,void 0)},831412:(e,t,n)=>{a.jb(`HardSigmoid`,e,{alpha:t,beta:n})},831491:e=>{a.jb(`Log`,e,void 0)},831542:e=>{a.jb(`Sin`,e,void 0)},831593:e=>{a.jb(`Cos`,e,void 0)},831644:e=>{a.jb(`Tan`,e,void 0)},831695:e=>{a.jb(`Asin`,e,void 0)},831747:e=>{a.jb(`Acos`,e,void 0)},831799:e=>{a.jb(`Atan`,e,void 0)},831851:e=>{a.jb(`Sinh`,e,void 0)},831903:e=>{a.jb(`Cosh`,e,void 0)},831955:e=>{a.jb(`Asinh`,e,void 0)},832008:e=>{a.jb(`Acosh`,e,void 0)},832061:e=>{a.jb(`Atanh`,e,void 0)},832114:e=>{a.jb(`Tanh`,e,void 0)},832166:e=>{a.jb(`Not`,e,void 0)},832217:(e,t,n)=>{a.jb(`Clip`,e,{min:t,max:n})},832286:e=>{a.jb(`Clip`,e,void 0)},832338:(e,t)=>{a.jb(`Elu`,e,{alpha:t})},832396:e=>{a.jb(`Gelu`,e,void 0)},832448:e=>{a.jb(`Relu`,e,void 0)},832500:(e,t)=>{a.jb(`LeakyRelu`,e,{alpha:t})},832564:(e,t)=>{a.jb(`ThresholdedRelu`,e,{alpha:t})},832634:(e,t)=>{a.jb(`Cast`,e,{to:t})},832692:e=>{a.jb(`Add`,e,void 0)},832743:e=>{a.jb(`Sub`,e,void 0)},832794:e=>{a.jb(`Mul`,e,void 0)},832845:e=>{a.jb(`Div`,e,void 0)},832896:e=>{a.jb(`Pow`,e,void 0)},832947:e=>{a.jb(`Equal`,e,void 0)},833e3:e=>{a.jb(`Greater`,e,void 0)},833055:e=>{a.jb(`GreaterOrEqual`,e,void 0)},833117:e=>{a.jb(`Less`,e,void 0)},833169:e=>{a.jb(`LessOrEqual`,e,void 0)},833228:(e,t,n,r,i)=>{a.jb(`ReduceMean`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},833403:(e,t,n,r,i)=>{a.jb(`ReduceMax`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},833577:(e,t,n,r,i)=>{a.jb(`ReduceMin`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},833751:(e,t,n,r,i)=>{a.jb(`ReduceProd`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},833926:(e,t,n,r,i)=>{a.jb(`ReduceSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834100:(e,t,n,r,i)=>{a.jb(`ReduceL1`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834273:(e,t,n,r,i)=>{a.jb(`ReduceL2`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834446:(e,t,n,r,i)=>{a.jb(`ReduceLogSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834623:(e,t,n,r,i)=>{a.jb(`ReduceSumSquare`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834803:(e,t,n,r,i)=>{a.jb(`ReduceLogSumExp`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834983:e=>{a.jb(`Where`,e,void 0)},835036:(e,t,n)=>{a.jb(`Transpose`,e,{perm:t?Array.from(j().subarray(Number(t)>>>0,Number(n)>>>0)):[]})},835160:(e,t,n,r)=>{a.jb(`DepthToSpace`,e,{blocksize:t,mode:Ge(n),format:r?`NHWC`:`NCHW`})},835293:(e,t,n,r)=>{a.jb(`DepthToSpace`,e,{blocksize:t,mode:Ge(n),format:r?`NHWC`:`NCHW`})},835426:(e,t,n,r,i,o,s,c,l,u,d,f,p,m,h)=>{a.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:r,kernelShape:[i],pads:[o,s],strides:[c],wIsConst:()=>!!se()[u>>>0],outputPadding:d?Array.from(j().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(j().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:Ge(h)})},835859:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(j().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:r,kernelShape:Array.from(j().subarray(Number(i)>>>0,2+(Number(i)>>>0)>>>0)),pads:Array.from(j().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(j().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!se()[l>>>0],outputPadding:u?Array.from(j().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(j().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:Ge(m)})},836520:(e,t,n,r,i,o,s,c,l,u,d,f,p,m,h)=>{a.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:r,kernelShape:[i],pads:[o,s],strides:[c],wIsConst:()=>!!se()[u>>>0],outputPadding:d?Array.from(j().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(j().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:Ge(h)})},836953:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(j().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:r,kernelShape:Array.from(j().subarray(Number(i)>>>0,2+(Number(i)>>>0)>>>0)),pads:Array.from(j().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(j().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!se()[l>>>0],outputPadding:u?Array.from(j().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(j().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:Ge(m)})},837614:(e,t)=>{a.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},837705:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:r,storage_order:i,dilations:o?Array.from(j().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(j().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(j().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(j().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838184:(e,t)=>{a.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},838275:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:r,storage_order:i,dilations:o?Array.from(j().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(j().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(j().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(j().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838754:(e,t)=>{a.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},838841:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:r,storage_order:i,dilations:o?Array.from(j().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(j().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(j().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(j().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839316:(e,t)=>{a.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},839403:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:r,storage_order:i,dilations:o?Array.from(j().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(j().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(j().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(j().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839878:(e,t,n,r,i)=>{a.jb(`Gemm`,e,{alpha:t,beta:n,transA:r,transB:i})},839982:e=>{a.jb(`MatMul`,e,void 0)},840036:(e,t,n,r)=>{a.jb(`ArgMax`,e,{keepDims:!!t,selectLastIndex:!!n,axis:r})},840144:(e,t,n,r)=>{a.jb(`ArgMin`,e,{keepDims:!!t,selectLastIndex:!!n,axis:r})},840252:(e,t)=>{a.jb(`Softmax`,e,{axis:t})},840315:(e,t)=>{a.jb(`Concat`,e,{axis:t})},840375:(e,t,n,r,i)=>{a.jb(`Split`,e,{axis:t,numOutputs:n,splitSizes:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},840531:e=>{a.jb(`Expand`,e,void 0)},840585:(e,t)=>{a.jb(`Gather`,e,{axis:Number(t)})},840656:(e,t)=>{a.jb(`GatherElements`,e,{axis:Number(t)})},840735:(e,t)=>{a.jb(`GatherND`,e,{batch_dims:Number(t)})},840814:(e,t,n,r,i,o,s,c,l,u,d)=>{a.jb(`Resize`,e,{antialias:t,axes:n?Array.from(j().subarray(Number(n)>>>0,Number(r)>>>0)):[],coordinateTransformMode:Ge(i),cubicCoeffA:o,excludeOutside:s,extrapolationValue:c,keepAspectRatioPolicy:Ge(l),mode:Ge(u),nearestMode:Ge(d)})},841176:(e,t,n,r,i,o,s)=>{a.jb(`Slice`,e,{starts:t?Array.from(j().subarray(Number(t)>>>0,Number(n)>>>0)):[],ends:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[],axes:o?Array.from(j().subarray(Number(o)>>>0,Number(s)>>>0)):[]})},841440:e=>{a.jb(`Tile`,e,void 0)},841492:(e,t,n)=>{a.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841606:(e,t,n)=>{a.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841720:e=>{a.jb(`Range`,e,void 0)},841773:(e,t)=>{a.jb(`Einsum`,e,{equation:Ge(t)})},841854:(e,t,n,r,i)=>{a.jb(`Pad`,e,{mode:t,value:n,pads:r?Array.from(j().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},841997:(e,t,n,r,i,o)=>{a.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!i,trainingMode:!!r,format:o?`NHWC`:`NCHW`})},842166:(e,t,n,r,i,o)=>{a.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!i,trainingMode:!!r,format:o?`NHWC`:`NCHW`})},842335:(e,t,n)=>{a.jb(`CumSum`,e,{exclusive:Number(t),reverse:Number(n)})},842432:(e,t,n)=>{a.jb(`DequantizeLinear`,e,{axis:t,blockSize:n})},842522:(e,t,n,r,i)=>{a.jb(`GridSample`,e,{align_corners:t,mode:Ge(n),padding_mode:Ge(r),format:i?`NHWC`:`NCHW`})},842692:(e,t,n,r,i)=>{a.jb(`GridSample`,e,{align_corners:t,mode:Ge(n),padding_mode:Ge(r),format:i?`NHWC`:`NCHW`})},842862:(e,t)=>{a.jb(`ScatterND`,e,{reduction:Ge(t)})},842947:(e,t,n,r,i,o,s,c,l)=>{a.jb(`Attention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:r,scale:i,doRotary:o,qkvHiddenSizes:s?Array.from(j().subarray(Number(c)>>>0,Number(c)+s>>>0)):[],pastPresentShareBuffer:!!l})},843219:e=>{a.jb(`BiasAdd`,e,void 0)},843274:e=>{a.jb(`BiasSplitGelu`,e,void 0)},843335:e=>{a.jb(`FastGelu`,e,void 0)},843391:(e,t,n,r,i,o,s,c,l,u,d,f,p,m,h,g)=>{a.jb(`Conv`,e,{format:f?`NHWC`:`NCHW`,auto_pad:t,dilations:n?Array.from(j().subarray(Number(n)>>>0,Number(r)>>>0)):[],group:i,kernel_shape:o?Array.from(j().subarray(Number(o)>>>0,Number(s)>>>0)):[],pads:c?Array.from(j().subarray(Number(c)>>>0,Number(l)>>>0)):[],strides:u?Array.from(j().subarray(Number(u)>>>0,Number(d)>>>0)):[],w_is_const:()=>!!se()[Number(p)>>>0],activation:Ge(m),activation_params:h?Array.from(de().subarray(Number(h)>>>0,Number(g)>>>0)):[]})},843975:e=>{a.jb(`Gelu`,e,void 0)},844027:(e,t,n,r,i,o,s,c,l)=>{a.jb(`GroupQueryAttention`,e,{numHeads:t,kvNumHeads:n,scale:r,softcap:i,doRotary:o,rotaryInterleaved:s,smoothSoftmax:c,localWindowSize:l})},844244:(e,t,n,r)=>{a.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!r})},844355:(e,t,n,r)=>{a.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!r})},844466:(e,t,n,r,i,o)=>{a.jb(`MatMulNBits`,e,{k:t,n,accuracyLevel:r,bits:i,blockSize:o})},844593:(e,t,n,r,i,o)=>{a.jb(`MultiHeadAttention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:r,scale:i,doRotary:o})},844752:(e,t)=>{a.jb(`QuickGelu`,e,{alpha:t})},844816:(e,t,n,r,i)=>{a.jb(`RotaryEmbedding`,e,{interleaved:!!t,numHeads:n,rotaryEmbeddingDim:r,scale:i})},844955:(e,t,n)=>{a.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845057:(e,t,n)=>{a.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845159:(e,t,n,r)=>{a.jb(`GatherBlockQuantized`,e,{gatherAxis:t,quantizeAxis:n,blockSize:r})},845280:e=>{a.Zb(e)},845314:(e,t)=>a.ac(Number(e),Number(t),a.Fb.dc,a.Fb.errors)};function be(e,t,n){return fn(async()=>{await a.Xb(Number(e),Number(t),Number(n))})}function xe(){return typeof wasmOffsetConverter<`u`}class Se{constructor(t){e.defineProperty(this,`name`,`ExitStatus`),this.message=`Program terminated with exit(${t})`,this.status=t}}var Ce=e=>{e.terminate(),e.onmessage=()=>{}},we=[],Te=e=>{je.length==0&&(Le(),Ie(je[0]));var t=je.pop();if(!t)return 6;Me.push(t),Pe[e.Ab]=t,t.Ab=e.Ab;var n={Bb:`run`,fc:e.ec,Hb:e.Hb,Ab:e.Ab};return t.postMessage(n,e.Mb),0},Ee=0,De=(e,t,...n)=>{for(var r=2*n.length,i=Ar(),a=kr(8*r),o=a>>>3,s=0;s>>0]=c)}return e=Cr(e,0,r,a,t),Or(i),e};function Oe(e){if(l)return De(0,1,e);if(w=e,!(0{if(w=e,l)throw ke(e),`unwind`;Oe(e)},je=[],Me=[],Ne=[],Pe={},R=e=>{var t=e.Ab;delete Pe[t],je.push(e),Me.splice(Me.indexOf(e),1),e.Ab=0,wr(t)};function Fe(){Ne.forEach(e=>e())}var Ie=e=>new Promise(t=>{e.onmessage=n=>{var r=(n=n.data).Bb;if(n.Gb&&n.Gb!=br()){var i=Pe[n.Gb];i?i.postMessage(n,n.Mb):x(`Internal error! Worker sent a message "${r}" to target pthread ${n.Gb}, but that thread no longer exists!`)}else r===`checkMailbox`?Gt():r===`spawnThread`?Te(n):r===`cleanupThread`?R(Pe[n.hc]):r===`loaded`?(e.loaded=!0,t(e)):r===`alert`?alert(`Thread ${n.ic}: ${n.text}`):n.target===`setimmediate`?e.postMessage(n):r===`callHandler`?a[n.Qb](...n.args):r&&x(`worker sent an unknown command ${r}`)},e.onerror=e=>{throw x(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var n,r=[];for(n of[])a.propertyIsEnumerable(n)&&r.push(n);e.postMessage({Bb:`load`,Rb:r,kc:S,lc:C})});function Le(){var e=new Worker((()=>{let e=URL;return import.meta.url>`file:`&&import.meta.url<`file;`?new e(`ort.bundle.min.mjs`,import.meta.url):new URL(import.meta.url)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});je.push(e)}var Re=e=>{F();var t=M()[e+52>>>2>>>0];e=M()[e+56>>>2>>>0],Dr(t,t-e),Or(t)},ze=(e,t)=>{Ee=0,e=jr(e,t),0>>=0);throw t>>>=0,n>>>=0,M()[r.Ib+16>>>2>>>0]=0,M()[r.Ib+4>>>2>>>0]=t,M()[r.Ib+8>>>2>>>0]=n,e}function z(e,t,n,r){return l?De(2,1,e,t,n,r):He(e,t,n,r)}function He(e,t,n,r){if(e>>>=0,n>>>=0,r>>>=0,u===void 0)return 6;var i=[];return l&&i.length===0?z(e,t>>>=0,n,r):(e={ec:n,Ab:e,Hb:r,Mb:i},l?(e.Bb=`spawnThread`,postMessage(e,i),0):Te(e))}var Ue=typeof TextDecoder<`u`?new TextDecoder:void 0,We=(e,t=0,n=NaN)=>{var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},Ge=(e,t)=>(e>>>=0)?We(ce(),e,t):``;function Ke(e,t,n){return l?De(3,1,e,t,n):0}function qe(e,t){if(l)return De(4,1,e,t)}var Je=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},Ye=(e,t,n)=>{var r=ce();if(t>>>=0,0=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(t>=n)break;r[t++>>>0]=o}else{if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6}else{if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63}r[t++>>>0]=128|o>>6&63}r[t++>>>0]=128|63&o}}r[t>>>0]=0,e=t-i}else e=0;return e};function Xe(e,t){if(l)return De(5,1,e,t)}function Ze(e,t,n){if(l)return De(6,1,e,t,n)}function Qe(e,t,n){return l?De(7,1,e,t,n):0}function $e(e,t){if(l)return De(8,1,e,t)}function et(e,t,n){if(l)return De(9,1,e,t,n)}function tt(e,t,n,r){if(l)return De(10,1,e,t,n,r)}function nt(e,t,n,r){if(l)return De(11,1,e,t,n,r)}function rt(e,t,n,r){if(l)return De(12,1,e,t,n,r)}function it(e){if(l)return De(13,1,e)}function at(e,t){if(l)return De(14,1,e,t)}function ot(e,t,n){if(l)return De(15,1,e,t,n)}var st,ct,lt=()=>ve(``),ut=e=>{for(var t=``;ce()[e>>>0];)t+=st[ce()[e++>>>0]];return t},dt={},ft={},pt={};function mt(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new ct(`type "${r}" must have a positive integer typeid pointer`);if(ft.hasOwnProperty(e)){if(n.Sb)return;throw new ct(`Cannot register type '${r}' twice`)}ft[e]=t,delete pt[e],dt.hasOwnProperty(e)&&(t=dt[e],delete dt[e],t.forEach(e=>e()))}(e,t,n)}var ht=(e,t,n)=>{switch(t){case 1:return n?e=>se()[e>>>0]:e=>ce()[e>>>0];case 2:return n?e=>le()[e>>>1>>>0]:e=>ue()[e>>>1>>>0];case 4:return n?e=>j()[e>>>2>>>0]:e=>M()[e>>>2>>>0];case 8:return n?e=>ne[e>>>3]:e=>re[e>>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function gt(e,t,n){n>>>=0,mt(e>>>=0,{name:t=ut(t>>>0),fromWireType:e=>e,toWireType:function(e,t){if(typeof t!=`bigint`&&typeof t!=`number`)throw t=t===null?`null`:(e=typeof t)==`object`||e===`array`||e===`function`?t.toString():``+t,TypeError(`Cannot convert "${t}" to ${this.name}`);return typeof t==`number`&&(t=BigInt(t)),t},Cb:_t,readValueFromPointer:ht(t,n,t.indexOf(`u`)==-1),Db:null})}var _t=8;function vt(e,t,n,r){mt(e>>>=0,{name:t=ut(t>>>0),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},Cb:_t,readValueFromPointer:function(e){return this.fromWireType(ce()[e>>>0])},Db:null})}var yt=[],bt=[];function xt(e){9<(e>>>=0)&&--bt[e+1]==0&&(bt[e]=void 0,yt.push(e))}var St=e=>{if(!e)throw new ct(`Cannot use deleted val. handle = `+e);return bt[e]},Ct=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=yt.pop()||bt.length;return bt[t]=e,bt[t+1]=1,t}};function wt(e){return this.fromWireType(M()[e>>>2>>>0])}var Et={name:`emscripten::val`,fromWireType:e=>{var t=St(e);return xt(e),t},toWireType:(e,t)=>Ct(t),Cb:_t,readValueFromPointer:wt,Db:null};function Dt(e){return mt(e>>>0,Et)}var Ot=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(de()[e>>>2>>>0])};case 8:return function(e){return this.fromWireType(fe()[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function kt(e,t,n){n>>>=0,mt(e>>>=0,{name:t=ut(t>>>0),fromWireType:e=>e,toWireType:(e,t)=>t,Cb:_t,readValueFromPointer:Ot(t,n),Db:null})}function At(e,t,n,r,i){if(e>>>=0,n>>>=0,t=ut(t>>>0),i===-1&&(i=4294967295),i=e=>e,r===0){var a=32-8*n;i=e=>e<>>a}var o=t.includes(`unsigned`)?function(e,t){return t>>>0}:function(e,t){return t};mt(e,{name:t,fromWireType:i,toWireType:o,Cb:_t,readValueFromPointer:ht(t,n,r!==0),Db:null})}function jt(e,t,n){function r(e){var t=M()[e>>>2>>>0];return e=M()[e+4>>>2>>>0],new i(se().buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];mt(e>>>=0,{name:n=ut(n>>>0),fromWireType:r,Cb:_t,readValueFromPointer:r},{Sb:!0})}function Mt(e,t){mt(e>>>=0,{name:t=ut(t>>>0),fromWireType:function(e){for(var t,n=M()[e>>>2>>>0],r=e+4,i=r,a=0;a<=n;++a){var o=r+a;a!=n&&ce()[o>>>0]!=0||(i=Ge(i,o-i),t===void 0?t=i:(t+=`\0`,t+=i),i=o+1)}return Y(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new ct(`Cannot pass non-string to std::string`);var r=n?Je(t):t.length,i=X(4+r+1),a=i+4;if(M()[i>>>2>>>0]=r,n)Ye(t,a,r+1);else if(n)for(n=0;n>>0]=o}else for(n=0;n>>0]=t[n];return e!==null&&e.push(Y,i),i},Cb:_t,readValueFromPointer:wt,Db(e){Y(e)}})}var Nt=typeof TextDecoder<`u`?new TextDecoder(`utf-16le`):void 0,Pt=(e,t)=>{for(var n=e>>1,r=n+t/2;!(n>=r)&&ue()[n>>>0];)++n;if(32<(n<<=1)-e&&Nt)return Nt.decode(ce().slice(e,n));for(n=``,r=0;!(r>=t/2);++r){var i=le()[e+2*r>>>1>>>0];if(i==0)break;n+=String.fromCharCode(i)}return n},Ft=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return le()[t>>>1>>>0]=0,t-r},It=e=>2*e.length,Lt=(e,t)=>{for(var n=0,r=``;!(n>=t/4);){var i=j()[e+4*n>>>2>>>0];if(i==0)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r},Rt=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),j()[t>>>2>>>0]=a,(t+=4)+4>n)break}return j()[t>>>2>>>0]=0,t-r},zt=e=>{for(var t=0,n=0;n=r&&++n,t+=4}return t};function Bt(e,t,n){if(e>>>=0,t>>>=0,n=ut(n>>>=0),t===2)var r=Pt,i=Ft,a=It,o=e=>ue()[e>>>1>>>0];else t===4&&(r=Lt,i=Rt,a=zt,o=e=>M()[e>>>2>>>0]);mt(e,{name:n,fromWireType:e=>{for(var n,i=M()[e>>>2>>>0],a=e+4,s=0;s<=i;++s){var c=e+4+s*t;s!=i&&o(c)!=0||(a=r(a,c-a),n===void 0?n=a:(n+=`\0`,n+=a),a=c+t)}return Y(e),n},toWireType:(e,r)=>{if(typeof r!=`string`)throw new ct(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=X(4+o+t);return M()[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(Y,s),s},Cb:_t,readValueFromPointer:wt,Db(e){Y(e)}})}function Vt(e,t){mt(e>>>=0,{Tb:!0,name:t=ut(t>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function Ht(e){xr(e>>>0,!c,1,!s,131072,!1),Fe()}var Ut=e=>{if(!ae)try{if(e(),!(0>>=0,typeof Atomics.jc==`function`&&(Atomics.jc(j(),e>>>2,e).value.then(Gt),e+=128,Atomics.store(j(),e>>>2,1))}var Gt=()=>{var e=br();e&&(Wt(e),Ut(Er))};function Kt(e,t){(e>>>=0)==t>>>0?setTimeout(Gt):l?postMessage({Gb:e,Bb:`checkMailbox`}):(e=Pe[e])&&e.postMessage({Bb:`checkMailbox`})}var qt=[];function Jt(e,t,n,r,i){for(t>>>=0,r/=2,qt.length=r,n=i>>>0>>>3,i=0;i>>0];return(t?L[t]:vr[e])(...qt)}var Yt=()=>{Ee=0};function Xt(e){e>>>=0,l?postMessage({Bb:`cleanupThread`,hc:e}):R(Pe[e])}function Zt(e){}var Qt=(e,t)=>{var n=ft[e];if(n===void 0)throw e=yr(e),n=ut(e),Y(e),new ct(`${t} has unknown type ${n}`);return n},$t=(e,t,n)=>{var r=[];return e=e.toWireType(r,n),r.length&&(M()[t>>>2>>>0]=Ct(r)),e};function en(e,t,n){return t>>>=0,n>>>=0,e=St(e>>>0),t=Qt(t,`emval::as`),$t(t,n,e)}function tn(e,t){return t>>>=0,e=St(e>>>0),(t=Qt(t,`emval::as`)).toWireType(null,e)}var nn=e=>{try{e()}catch(e){ve(e)}},B=0,rn=null,an=0,on=[],sn={},cn={},ln=0,un=null,dn=[];function fn(e){return function(e){if(!ae){if(B===0){var t=!1,n=!1;e((e=0)=>{if(!ae&&(an=e,t=!0,n)){B=2,nn(()=>Pr(rn)),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.resume(),e=!1;try{var r=function(){var e=j()[rn+8>>>2>>>0];return e=q[cn[e]],--Ee,e()}()}catch(t){r=t,e=!0}var i=!1;if(!rn){var a=un;a&&(un=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(B=1,rn=function(){var e=X(65548),t=e+12;M()[e>>>2>>>0]=t,M()[e+4>>>2>>>0]=t+65536,t=on[0];var n=sn[t];return n===void 0&&(n=ln++,sn[t]=n,cn[n]=t),t=n,j()[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.pause(),nn(()=>Mr(rn)))}else B===2?(B=0,nn(Fr),Y(rn),rn=null,dn.forEach(Ut)):ve(`invalid state: ${B}`);return an}}(t=>{e().then(t)})}function pn(e){return e>>>=0,fn(async()=>{var t=await St(e);return Ct(t)})}var mn=[];function hn(e,t,n,r){return n>>>=0,r>>>=0,(e=mn[e>>>0])(null,t=St(t>>>0),n,r)}var gn={},_n=e=>{var t=gn[e];return t===void 0?ut(e):t};function vn(e,t,n,r,i){return n>>>=0,r>>>=0,i>>>=0,(e=mn[e>>>0])(t=St(t>>>0),t[n=_n(n)],r,i)}var yn=()=>typeof globalThis==`object`?globalThis:Function(`return this`)();function bn(e){return(e>>>=0)==0?Ct(yn()):(e=_n(e),Ct(yn()[e]))}var xn=e=>{var t=mn.length;return mn.push(e),t},V=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],`parameter `+r);return n},Sn=(e,t)=>Object.defineProperty(t,`name`,{value:e});function Cn(e,t,n){var r=(t=V(e,t>>>0)).shift();e--;var i=`return function (obj, func, destructorsRef, args) { +`,a=0,o=[];n===0&&o.push(`obj`);for(var s=[`retType`],c=[r],l=0;le.name).join(`, `)}) => ${r.name}>`,xn(Sn(n,e))}function wn(e){return e=_n(e>>>0),Ct(a[e])}function Tn(e,t){return t>>>=0,e=St(e>>>0),t=St(t),Ct(e[t])}function En(e){9<(e>>>=0)&&(bt[e+1]+=1)}function Dn(){return Ct([])}function On(e){e=St(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function H(){return Ct({})}function An(e){for(var t=St(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}xt(e)}function jn(e,t,n){t>>>=0,n>>>=0,e=St(e>>>0),t=St(t),n=St(n),e[t]=n}function Mn(e,t){return t>>>=0,e=(e=Qt(e>>>0,`_emval_take_value`)).readValueFromPointer(t),Ct(e)}function U(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),j()[t>>>2>>>0]=e.getUTCSeconds(),j()[t+4>>>2>>>0]=e.getUTCMinutes(),j()[t+8>>>2>>>0]=e.getUTCHours(),j()[t+12>>>2>>>0]=e.getUTCDate(),j()[t+16>>>2>>>0]=e.getUTCMonth(),j()[t+20>>>2>>>0]=e.getUTCFullYear()-1900,j()[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,j()[t+28>>>2>>>0]=e}var Nn=e=>e%4==0&&(e%100!=0||e%400==0),Pn=[0,31,60,91,121,152,182,213,244,274,305,335],Fn=[0,31,59,90,120,151,181,212,243,273,304,334];function In(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),j()[t>>>2>>>0]=e.getSeconds(),j()[t+4>>>2>>>0]=e.getMinutes(),j()[t+8>>>2>>>0]=e.getHours(),j()[t+12>>>2>>>0]=e.getDate(),j()[t+16>>>2>>>0]=e.getMonth(),j()[t+20>>>2>>>0]=e.getFullYear()-1900,j()[t+24>>>2>>>0]=e.getDay();var n=(Nn(e.getFullYear())?Pn:Fn)[e.getMonth()]+e.getDate()-1|0;j()[t+28>>>2>>>0]=n,j()[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),j()[t+32>>>2>>>0]=e}function W(e){e>>>=0;var t=new Date(j()[e+20>>>2>>>0]+1900,j()[e+16>>>2>>>0],j()[e+12>>>2>>>0],j()[e+8>>>2>>>0],j()[e+4>>>2>>>0],j()[e>>>2>>>0],0),n=j()[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?j()[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(Nn(t.getFullYear())?Pn:Fn)[t.getMonth()]+t.getDate()-1|0,j()[e+28>>>2>>>0]=n,j()[e>>>2>>>0]=t.getSeconds(),j()[e+4>>>2>>>0]=t.getMinutes(),j()[e+8>>>2>>>0]=t.getHours(),j()[e+12>>>2>>>0]=t.getDate(),j()[e+16>>>2>>>0]=t.getMonth(),j()[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function Ln(e,t,n,r,i,a,o){return l?De(16,1,e,t,n,r,i,a,o):-52}function Rn(e,t,n,r,i,a){if(l)return De(17,1,e,t,n,r,i,a)}var zn={},Bn=()=>performance.timeOrigin+performance.now();function Vn(e,t){if(l)return De(18,1,e,t);if(zn[e]&&(clearTimeout(zn[e].id),delete zn[e]),!t)return 0;var n=setTimeout(()=>{delete zn[e],Ut(()=>Tr(e,performance.timeOrigin+performance.now()))},t);return zn[e]={id:n,qc:t},0}function Hn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);M()[e>>>2>>>0]=60*o,j()[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),Wn=1;function Gn(e,t,n){if(!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Wn)return 52;e=performance.timeOrigin+performance.now()}return ne[n>>>0>>>3]=BigInt(Math.round(1e6*e)),0}var Kn=[],qn=(e,t)=>{Kn.length=0;for(var n;n=ce()[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,Kn.push(n==112?M()[t>>>2>>>0]:n==106?ne[t>>>3]:n==105?j()[t>>>2>>>0]:fe()[t>>>3>>>0]),t+=r?8:4}return Kn};function Jn(e,t,n){return e>>>=0,t=qn(t>>>0,n>>>0),L[e](...t)}function Yn(e,t,n){return e>>>=0,t=qn(t>>>0,n>>>0),L[e](...t)}var Xn=()=>{};function Zn(e,t){return x(Ge(e>>>0,t>>>0))}var Qn=()=>{throw Ee+=1,`unwind`};function $n(){return 4294901760}var er=()=>navigator.hardwareConcurrency;function tr(){return ve(`Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER`),0}function nr(e){e>>>=0;var t=ce().length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-S.buffer.byteLength+65535)/65536|0;try{S.grow(r),F();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}var rr=()=>(ve(`Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER`),0),ir={},ar=e=>{e.forEach(e=>{var t=rr();t&&(ir[t]=e)})};function or(){var e=Error().stack.toString().split(` +`);return e[0]==`Error`&&e.shift(),ar(e),ir.Lb=rr(),ir.cc=e,ir.Lb}function sr(e,t,n){if(e>>>=0,t>>>=0,ir.Lb==e)var r=ir.cc;else (r=Error().stack.toString().split(` +`))[0]==`Error`&&r.shift(),ar(r);for(var i=3;r[i]&&rr()!=e;)++i;for(e=0;e>>2>>>0]=rr();return e}var cr,lr={},ur=()=>{if(!cr){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in lr)lr[e]===void 0?delete t[e]:t[e]=lr[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);cr=n}return cr};function dr(e,t){if(l)return De(19,1,e,t);e>>>=0,t>>>=0;var n=0;return ur().forEach((r,i)=>{var a=t+n;for(i=M()[e+4*i>>>2>>>0]=a,a=0;a>>0]=r.charCodeAt(a);se()[i>>>0]=0,n+=r.length+1}),0}function G(e,t){if(l)return De(20,1,e,t);e>>>=0,t>>>=0;var n=ur();M()[e>>>2>>>0]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),M()[t>>>2>>>0]=r,0}function fr(e){return l?De(21,1,e):52}function pr(e,t,n,r){return l?De(22,1,e,t,n,r):52}function mr(e,t,n,r){return l?De(23,1,e,t,n,r):70}var hr=[null,[],[]];function gr(e,t,n,r){if(l)return De(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var i=0,a=0;a>>2>>>0],s=M()[t+4>>>2>>>0];t+=8;for(var c=0;c>>0],d=hr[e];u===0||u===10?((e===1?b:x)(We(d)),d.length=0):d.push(u)}i+=s}return M()[r>>>2>>>0]=i,0}l||function(){for(var e=a.numThreads-1;e--;)Le();we.unshift(()=>{he++,function(e){l?e():Promise.all(je.map(Ie)).then(e)}(()=>_e())})}();for(var K=Array(256),_r=0;256>_r;++_r)K[_r]=String.fromCharCode(_r);st=K,ct=a.BindingError=class extends Error{constructor(e){super(e),this.name=`BindingError`}},a.InternalError=class extends Error{constructor(e){super(e),this.name=`InternalError`}},bt.push(0,1,void 0,1,null,1,!0,1,!1,1),a.count_emval_handles=()=>bt.length/2-5-yt.length;var q,vr=[Oe,ke,z,Ke,qe,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,Ln,Rn,Vn,dr,G,fr,pr,mr,gr];(async function(){function e(e,t){return q=e.exports,q=function(){var e=q,t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`function`?(...e)=>{on.push(n);try{return r(...e)}finally{ae||(on.pop(),rn&&B===1&&on.length===0&&(B=0,Ee+=1,nn(Nr),typeof Fibers<`u`&&Fibers.rc()))}}:r;return t}(),q=function(){var e=q,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).Da=t(e.Da),e.fb=n(e.fb),e.hb=t(e.hb),e.tb=t(e.tb),e.ub=n(e.ub),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}(),Ne.push(q.ib),C=t,_e(),q}he++;var t=ye();if(a.instantiateWasm)return new Promise(n=>{a.instantiateWasm(t,(t,r)=>{e(t,r),n(t.exports)})});if(l)return new Promise(t=>{N=n=>{var r=new WebAssembly.Instance(n,ye());t(e(r,n))}});me??=a.locateFile?a.locateFile?a.locateFile(`ort-wasm-simd-threaded.jsep.wasm`,_):_+`ort-wasm-simd-threaded.jsep.wasm`:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+import.meta.url).href;try{var n=await async function(e){var t=me;if(!A&&typeof WebAssembly.instantiateStreaming==`function`&&!oe(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){x(`wasm streaming compile failed: ${e}`),x(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!A)try{var t=await p(e);return new Uint8Array(t)}catch{}if(e==me&&A)e=new Uint8Array(A);else{if(!m)throw`both async and sync fetching of the wasm failed`;e=m(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){x(`failed to asynchronously prepare wasm: ${e}`),ve(e)}}(t,e)}(t);return e(n.instance,n.module)}catch(e){return i(e),Promise.reject(e)}})();var yr=e=>(yr=q.Da)(e),J=()=>(J=q.Ea)();a._OrtInit=(e,t)=>(a._OrtInit=q.Fa)(e,t),a._OrtGetLastError=(e,t)=>(a._OrtGetLastError=q.Ga)(e,t),a._OrtCreateSessionOptions=(e,t,n,r,i,o,s,c,l,u)=>(a._OrtCreateSessionOptions=q.Ha)(e,t,n,r,i,o,s,c,l,u),a._OrtAppendExecutionProvider=(e,t,n,r,i)=>(a._OrtAppendExecutionProvider=q.Ia)(e,t,n,r,i),a._OrtAddFreeDimensionOverride=(e,t,n)=>(a._OrtAddFreeDimensionOverride=q.Ja)(e,t,n),a._OrtAddSessionConfigEntry=(e,t,n)=>(a._OrtAddSessionConfigEntry=q.Ka)(e,t,n),a._OrtReleaseSessionOptions=e=>(a._OrtReleaseSessionOptions=q.La)(e),a._OrtCreateSession=(e,t,n)=>(a._OrtCreateSession=q.Ma)(e,t,n),a._OrtReleaseSession=e=>(a._OrtReleaseSession=q.Na)(e),a._OrtGetInputOutputCount=(e,t,n)=>(a._OrtGetInputOutputCount=q.Oa)(e,t,n),a._OrtGetInputOutputMetadata=(e,t,n,r)=>(a._OrtGetInputOutputMetadata=q.Pa)(e,t,n,r),a._OrtFree=e=>(a._OrtFree=q.Qa)(e),a._OrtCreateTensor=(e,t,n,r,i,o)=>(a._OrtCreateTensor=q.Ra)(e,t,n,r,i,o),a._OrtGetTensorData=(e,t,n,r,i)=>(a._OrtGetTensorData=q.Sa)(e,t,n,r,i),a._OrtReleaseTensor=e=>(a._OrtReleaseTensor=q.Ta)(e),a._OrtCreateRunOptions=(e,t,n,r)=>(a._OrtCreateRunOptions=q.Ua)(e,t,n,r),a._OrtAddRunConfigEntry=(e,t,n)=>(a._OrtAddRunConfigEntry=q.Va)(e,t,n),a._OrtReleaseRunOptions=e=>(a._OrtReleaseRunOptions=q.Wa)(e),a._OrtCreateBinding=e=>(a._OrtCreateBinding=q.Xa)(e),a._OrtBindInput=(e,t,n)=>(a._OrtBindInput=q.Ya)(e,t,n),a._OrtBindOutput=(e,t,n,r)=>(a._OrtBindOutput=q.Za)(e,t,n,r),a._OrtClearBoundOutputs=e=>(a._OrtClearBoundOutputs=q._a)(e),a._OrtReleaseBinding=e=>(a._OrtReleaseBinding=q.$a)(e),a._OrtRunWithBinding=(e,t,n,r,i)=>(a._OrtRunWithBinding=q.ab)(e,t,n,r,i),a._OrtRun=(e,t,n,r,i,o,s,c)=>(a._OrtRun=q.bb)(e,t,n,r,i,o,s,c),a._OrtEndProfiling=e=>(a._OrtEndProfiling=q.cb)(e),a._JsepOutput=(e,t,n)=>(a._JsepOutput=q.db)(e,t,n),a._JsepGetNodeName=e=>(a._JsepGetNodeName=q.eb)(e);var br=()=>(br=q.fb)(),Y=a._free=e=>(Y=a._free=q.gb)(e),X=a._malloc=e=>(X=a._malloc=q.hb)(e),xr=(e,t,n,r,i,a)=>(xr=q.kb)(e,t,n,r,i,a),Sr=()=>(Sr=q.lb)(),Cr=(e,t,n,r,i)=>(Cr=q.mb)(e,t,n,r,i),wr=e=>(wr=q.nb)(e),Z=e=>(Z=q.ob)(e),Tr=(e,t)=>(Tr=q.pb)(e,t),Er=()=>(Er=q.qb)(),Dr=(e,t)=>(Dr=q.rb)(e,t),Or=e=>(Or=q.sb)(e),kr=e=>(kr=q.tb)(e),Ar=()=>(Ar=q.ub)(),jr=a.dynCall_ii=(e,t)=>(jr=a.dynCall_ii=q.vb)(e,t),Mr=e=>(Mr=q.wb)(e),Nr=()=>(Nr=q.xb)(),Pr=e=>(Pr=q.yb)(e),Fr=()=>(Fr=q.zb)();return a.stackSave=()=>Ar(),a.stackRestore=e=>Or(e),a.stackAlloc=e=>kr(e),a.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:se()[e>>>0]=t;break;case`i16`:le()[e>>>1>>>0]=t;break;case`i32`:j()[e>>>2>>>0]=t;break;case`i64`:ne[e>>>3]=BigInt(t);break;case`float`:de()[e>>>2>>>0]=t;break;case`double`:fe()[e>>>3>>>0]=t;break;case`*`:M()[e>>>2>>>0]=t;break;default:ve(`invalid type for setValue: ${n}`)}},a.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return se()[e>>>0];case`i16`:return le()[e>>>1>>>0];case`i32`:return j()[e>>>2>>>0];case`i64`:return ne[e>>>3];case`float`:return de()[e>>>2>>>0];case`double`:return fe()[e>>>3>>>0];case`*`:return M()[e>>>2>>>0];default:ve(`invalid type for getValue: ${t}`)}},a.UTF8ToString=Ge,a.stringToUTF8=Ye,a.lengthBytesUTF8=Je,function e(){if(0{"use strict";vt(),At=typeof location>`u`?void 0:location.origin,jt=import.meta.url>`file:`&&import.meta.url<`file;`,Mt=()=>{if(jt){let e=URL;return new URL(new e(`ort.bundle.min.mjs`,import.meta.url).href,At).href}return import.meta.url},Nt=Mt(),Pt=()=>{if(Nt&&!Nt.startsWith(`blob:`))return Nt.substring(0,Nt.lastIndexOf(`/`)+1)},Ft=(e,t)=>{try{let n=t??Nt;return(n?new URL(e,n):new URL(e)).origin===At}catch{return!1}},It=(e,t)=>{let n=t??Nt;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},Lt=(e,t)=>`${t??`./`}${e}`,Rt=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},zt=async e=>(await import(e)).default,Bt=(Ct(),Se(yt)).default,Vt=async()=>{if(!Nt)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(Ft(Nt))return[void 0,Bt()];let e=await Rt(Nt);return[e,Bt(e)]},Ht=(kt(),Se(wt)).default,Ut=async(e,t,n)=>{if(!e&&!t&&Ht&&Nt&&Ft(Nt))return[void 0,Ht];{let r=`ort-wasm-simd-threaded.jsep.mjs`,i=e??It(r,t),a=n&&i&&!Ft(i,t),o=a?await Rt(i):i??Lt(r,t);return[a?o:void 0,await zt(o)]}}}),Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en=L(()=>{"use strict";Wt(),Kt=!1,qt=!1,Jt=!1,Yt=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return 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}},Xt=()=>{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}},Zt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},Qt=async e=>{if(Kt)return Promise.resolve();if(qt)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(Jt)throw Error(`previous call to 'initializeWebAssembly()' failed.`);qt=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!Zt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!Xt())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=Yt();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Ut(s,a,n>1),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=Pt();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{qt=!1,Kt=!0,Gt=t,e(),d&&URL.revokeObjectURL(d)},e=>{qt=!1,Jt=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},$t=()=>{if(Kt&&Gt)return Gt;throw Error(`WebAssembly is not initialized yet.`)}}),tn,nn,B,rn=L(()=>{"use strict";en(),tn=(e,t)=>{let n=$t(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},nn=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)nn(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},B=e=>{let t=$t(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),an,on=L(()=>{"use strict";en(),rn(),an=e=>{let t=$t(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=tn(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&B(`Can't create run options.`),e?.extra!==void 0&&nn(e.extra,``,new WeakSet,(e,i)=>{let a=tn(e,r),o=tn(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&B(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),sn,cn,ln,un,dn,fn,pn=L(()=>{"use strict";en(),rn(),sn=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},cn=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},ln=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},un=(e,t,n,r)=>{let i=tn(t,r),a=tn(n,r);$t()._OrtAddSessionConfigEntry(e,i,a)!==0&&B(`Can't set a session config entry: ${t} - ${n}.`)},dn=async(e,t,n)=>{for(let r of t){let t=typeof r==`string`?r:r.name,i=[];switch(t){case`webnn`:if(t=`WEBNN`,typeof r!=`string`){let t=r?.deviceType;t&&un(e,`deviceType`,t,n)}break;case`webgpu`:if(t=`JS`,typeof r!=`string`){let t=r;if(t?.preferredLayout){if(t.preferredLayout!==`NCHW`&&t.preferredLayout!==`NHWC`)throw Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${t.preferredLayout}`);un(e,`preferredLayout`,t.preferredLayout,n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${t}`)}let a=tn(t,n),o=i.length,s=0,c=0;if(o>0){s=$t()._malloc(o*$t().PTR_SIZE),n.push(s),c=$t()._malloc(o*$t().PTR_SIZE),n.push(c);for(let e=0;e{let t=$t(),n=0,r=[],i=e||{};ln(i);try{let e=sn(i.graphOptimizationLevel??`all`),a=cn(i.executionMode??`sequential`),o=typeof i.logId==`string`?tn(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log serverity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?tn(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&B(`Can't create session options.`),i.executionProviders&&await dn(n,i.executionProviders,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);un(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=tn(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&B(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&nn(i.extra,``,new WeakSet,(e,t)=>{un(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&B(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),mn,hn,gn,_n,vn,yn,bn,xn,V=L(()=>{"use strict";mn=e=>{switch(e){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`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},hn=e=>{switch(e){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 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},gn=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},_n=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},vn=e=>{switch(e){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: ${e}`)}},yn=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,bn=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,xn=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),Sn,Cn=L(()=>{"use strict";vt(),Sn=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),wn,Tn,En,Dn,On,kn,H,An=L(()=>{"use strict";V(),wn=[`V`,`I`,`W`,`E`,`F`],Tn=(e,t)=>{console.log(`[${wn[e]},${new Date().toISOString()}]${t}`)},On=(e,t)=>{En=e,Dn=t},kn=(e,t)=>{let n=vn(e),r=vn(En);n>=r&&Tn(n,typeof t==`function`?t():t)},H=(...e)=>{Dn&&kn(...e)}}),jn,Mn,U,Nn,Pn,Fn,In,W=L(()=>{"use strict";jn=class{static calcMatMulShape(e,t){return e[1]===t[0]?[e[0],t[1]]:void 0}},Mn=class{static calcShape(e,t,n=!1){let r=e.length,i=t.length;if(r===0)return t;if(i===0)return e;let a=Math.max(e.length,t.length),o=Array(a);if(n){if(r<2||i<2)return;let n=jn.calcMatMulShape([e[r-2],e[r-1]],[t[i-2],t[i-1]]);if(n===void 0)return;[o[a-2],o[a-1]]=n}for(let s=n?3:1;s<=a;s++){let n=r-s<0?1:e[r-s],c=i-s<0?1:t[i-s];if(n!==c&&n>1&&c>1)return;let l=Math.max(n,c);if(n&&c)o[a-s]=Math.max(n,c);else{if(l>1)return;o[a-s]=0}}return o}static isValidBroadcast(e,t){let n=e.length,r=t.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(e[n-i]!==1&&e[n-i]!==t[r-i])return!1;return!0}},U=class e{static size(t){return e.getSizeFromDimensionRange(t,0,t.length)}static convertShape(e,t=4){let n=e.length;if(n===0)return[];let r=Array(n),i=n-1;for(;i>=0;){if(e[i]%t===0){r[i]=e[i]/t;break}if(t%e[i]!==0)throw Error(`cannot convert shape`);r[i]=1,t/=e[i],i--}for(i--;i>=0;i--)r[i]=e[i];return r}static sizeFromDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,n,t.length)}static sizeToDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeToDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,0,n)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let i=t;i=0;--r)n[r]=n[r+1]*e[r+1];return n}static normalizeAxis(e,t){if(e<-t&&e>=t)throw Error(`unsupported axis for this operation.`);return e<0?e+t:e}static normalizeAxes(e,t){return e.map(n=>this.normalizeAxis(n,t??e.length))}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){let n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}},Nn=class e{static adjustPoolAttributes(e,t,n,r,i,a){if(!e&&n.length!==t.length-2)throw Error(`length of specified kernel shapes should be 2 less than length of input dimensions`);if(e)for(let e=0;e=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e=n[e]||a[e+n.length]>=n[e])throw Error(`pads should be smaller than kernel`)}}static adjustPadsBasedOnAutoPad(t,n,r,i,a,o,s){if(s){if(a.length!==2*(t.length-2))throw Error(`length of pads should be twice the length of data dimensions`);if(n.length!==t.length-2)throw Error(`length of strides should be the length of data dimensions`);if(i.length!==t.length-2)throw Error(`length of kernel shapes should be the length of data dimensions`);for(let c=0;c{"use strict";V(),Ln=(e,t)=>new(_n(t))(e)}),zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn=L(()=>{"use strict";An(),zn=(e,t=!0)=>{if(e.byteLength%8!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 8 (BigInt).`);let n=e.byteLength/8,r=new BigInt64Array(e.buffer,e.byteOffset,n),i=new Int32Array(n);for(let e=0;e2147483647n||t<-2147483648n)throw Error(`Overflow occurred when converting BigInt to Int32 at index ${e}: ${t}`);i[e]=Number(t)}return t?new Uint8Array(i.buffer):i},Bn=(e,t=!0)=>{if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (Int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n),i=BigInt64Array.from(r,BigInt);return t?new Uint8Array(i.buffer):i},Vn=1,Hn=()=>Vn++,Un=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),Wn=(e,t)=>{let n=Un.get(e);if(!n)throw Error(`Unsupported data type.`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},Gn=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,shouldConvertInt64toInt32:o=!1}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.shouldConvertInt64toInt32=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return Wn(this.dataType,this.tensorShape)}destroy(){H(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,t){if(e){let e=await this.mlContext.readTensor(this.mlTensor),n=Bn(new Uint8Array(e));if(t){(t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).set(n);return}else return n.buffer}else return t?this.mlContext.readTensor(this.mlTensor,t):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},Kn=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=t,a=this.tensorManager.getMLContext(e),o=i===`int64`&&!a.opSupportLimits().input.dataTypes.includes(`int64`);if(o&&(i=`int32`,H(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32`)),this.wrapper){if(this.wrapper.canReuseTensor(a,i,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==Wn(i,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,i,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(t=zn(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),t.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else H(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor();this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){var t,n;if(this.activeUpload){var r;let t=(r=this.wrapper)?.isInt64ToInt32Converted?Bn(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read((t=this.wrapper)?.shouldConvertInt64toInt32,e):this.wrapper.read((n=this.wrapper)?.shouldConvertInt64toInt32)}},qn=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}reserveTensorId(){let e=Hn();return this.tensorTrackersById.set(e,new Kn(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){H(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){H(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=Hn(),o=new Gn({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new Kn(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o=!1){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){H(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, shape: ${n}}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}H(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, shape: ${n}}`);let c=await s.createTensor({dataType:t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new Gn({sessionId:e,context:s,tensor:c,dataType:t,shape:n,shouldConvertInt64toInt32:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},Jn=(...e)=>new qn(...e)}),Xn,Zn,Qn,$n=L(()=>{"use strict";V(),en(),Rn(),Yn(),An(),Xn=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),Zn=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},Qn=class{constructor(e){this.tensorManager=Jn(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,On(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){H(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){H(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)H(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>Zn(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){H(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=Xn.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){H(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=Xn.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!$t().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);H(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return Ln(n,t)}}registerMLTensor(e,t,n,r){let i=Xn.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return H(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:o?(u=zn(new Uint8Array(l),!1),i.dataType=`int32`):u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return H(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isInt64Supported(e){var t;return!!(t=this.mlContextBySessionId.get(e))?.opSupportLimits().input.dataTypes.includes(`int64`)}flush(){}}}),er=L(()=>{"use strict";}),tr,nr,rr,ir,ar,or,sr,cr,lr,ur=L(()=>{"use strict";An(),er(),tr=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),nr=[],rr=e=>Math.ceil(Number(e)/16)*16,ir=e=>{for(let t=0;tar++,sr=async(e,t,n,r)=>{let i=rr(n),a=e.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let o=e.getCommandEncoder();e.endComputePass(),o.copyBufferToBuffer(t,0,a,0,i),e.flush(),await a.mapAsync(GPUMapMode.READ);let s=a.getMappedRange();if(r){let e=r();return e.set(new Uint8Array(s,0,n)),e}else return new Uint8Array(s.slice(0,n))}finally{a.destroy()}},cr=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[e]of tr)nr.push(e),this.freeBuffers.set(e,[]),this.freeUniformBuffers.set(e,[]);this.sessionCount=0}upload(e,t){let n=t.buffer,r=t.byteOffset,i=t.byteLength,a=rr(i),o=this.storageCache.get(e);if(!o)throw Error(`gpu data for uploading does not exist`);if(Number(o.originalSize)!==i)throw Error(`inconsistent data size. gpu data size=${o.originalSize}, data size=${i}`);let s=this.backend.device.createBuffer({mappedAtCreation:!0,size:a,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),c=s.getMappedRange();new Uint8Array(c).set(new Uint8Array(n,r,i)),s.unmap();let l=this.backend.device.createCommandEncoder();l.copyBufferToBuffer(s,0,o.gpuData.buffer,0,a),this.backend.device.queue.submit([l.finish()]),s.destroy(),H(`verbose`,()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,t){let n=this.storageCache.get(e);if(!n)throw Error(`source gpu data for memcpy does not exist`);let r=this.storageCache.get(t);if(!r)throw Error(`destination gpu data for memcpy does not exist`);if(n.originalSize!==r.originalSize)throw Error(`inconsistent source and destination gpu data size`);let i=rr(n.originalSize),a=this.backend.getCommandEncoder();this.backend.endComputePass(),a.copyBufferToBuffer(n.gpuData.buffer,0,r.gpuData.buffer,0,i)}registerExternalBuffer(e,t,n){let r;if(n){if(r=n[0],e===n[1])return H(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, buffer is the same, skip.`),r;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw Error(`Registering a different external buffer under graph capture mode is not supported yet. + Please use the previous external buffer!`)}else r=or();return this.storageCache.set(r,{gpuData:{id:r,type:0,buffer:e},originalSize:t}),H(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, registered.`),r}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),H(`verbose`,()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let n=ir(e),r,i=(t&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,a=(t&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(i||a){let e=(i?this.freeBuffers:this.freeUniformBuffers).get(n);r=e&&e.length>0?e.pop():this.backend.device.createBuffer({size:n,usage:t})}else r=this.backend.device.createBuffer({size:n,usage:t});let o={id:or(),type:0,buffer:r};return this.storageCache.set(o.id,{gpuData:o,originalSize:Number(e)}),H(`verbose`,()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${o.id}`),o}get(e){var t;return(t=this.storageCache.get(e))?.gpuData}release(e){let t=typeof e==`bigint`?Number(e):e,n=this.storageCache.get(t);if(!n){if(this.storageCache.size===0)return 0;throw Error(`releasing data does not exist`)}return H(`verbose`,()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${n.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(n.gpuData.buffer),n.originalSize}async download(e,t){let n=this.storageCache.get(Number(e));if(!n)throw Error(`data does not exist`);await sr(this.backend,n.gpuData.buffer,n.originalSize,t)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus===`default`){for(let e of this.buffersPending){let t=tr.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let n=this.freeBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let n=this.freeUniformBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let t of this.buffersPending)e.push(t);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let t=this.capturedPendingBuffers.get(e);t&&(t.forEach(e=>{e.destroy()}),this.capturedPendingBuffers.delete(e)),--this.sessionCount,this.sessionCount===0&&(H(`warning`,()=>`[WebGPU] Clearing webgpu buffer cache`),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.storageCache=new Map)}},lr=(...e)=>new cr(...e)}),dr,G,fr=L(()=>{"use strict";dr=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(`;`),this.key}},G=e=>new dr(e)}),pr,mr,hr,gr,K,_r,q,vr,yr,J,br,Y,X,xr,Sr,Cr,wr,Z=L(()=>{"use strict";V(),W(),pr=64,mr=(e,t)=>{if(t===3)throw Error(`vec3 has same alignment as vec4, use vec4 instead`);switch(Number(e)){case 10:return t>1?`vec${t}`:`f16`;case 1:return t>1?`vec${t}`:`f32`;case 6:return t>1?`vec${t}`:`i32`;case 12:return t>1?`vec${t}`:`u32`;case 7:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`i32`];case 13:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`u32`];case 9:if(t!==4)throw Error(`bool must be vec4`);return[`u32`,`vec4`];case 22:return`i32`;case 21:return`u32`;default:throw Error(`Unknown data type: ${e}`)}},hr=(e,t=1)=>{let n=mr(e,t);return typeof n==`string`?n:n[0]},gr=(e,t=1)=>{let n=mr(e,t);return typeof n==`string`?n:n[1]},K=(...e)=>{let t=[];return e.forEach(e=>{e.length!==0&&t.push({type:12,data:e},{type:12,data:U.computeStrides(e)})}),t},_r=e=>e%4==0?4:e%2==0?2:1,q=(e=`f32`,t,n=`0`)=>!t||t===1?`${e}(${n})`:`vec${t}<${e}>(${n})`,vr=(e,t,n)=>e===`f32`?n:t===1?`f32(${n})`:`vec${t}(${n})`,yr=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,J=(e,t,n,r)=>e.startsWith(`uniforms.`)&&n>4?typeof t==`string`?r===`f16`?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:r===`f16`?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:n>1?`${e}[${t}]`:e,br=(e,t,n,r,i)=>{let a=typeof n==`number`,o=a?n:n.length,s=[...Array(o).keys()],c=o<2?`u32`:o<=4?`vec${o}`:`array`,l=mr(t,i),u=typeof l==`string`?l:l[1],d=typeof l==`string`?l:l[0],f={indices:c,value:u,storage:d,tensor:t},p=e=>typeof e==`string`?e:`${e}u`,m={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},h=a?`uniforms.`:``,g=`${h}${e}_shape`,_=`${h}${e}_strides`,v=``;for(let e=0;e ${f.indices} { + var indices: ${f.indices}; + var current = offset; + ${v} + return indices; + }`,b=t=>(m.offsetToIndices=!0,o<2?t:`o2i_${e}(${t})`),x=[];if(o>=2)for(let e=o-1;e>=0;e--)x.push(`${J(_,e,o)} * (indices[${e}])`);let S=o<2?``:` + fn i2o_${e}(indices: ${f.indices}) -> u32 { + return ${x.join(`+`)}; + }`,C=t=>(m.indicesToOffset=!0,o<2?t:`i2o_${e}(${t})`),w=(...e)=>o===0?`0u`:`${f.indices}(${e.map(p).join(`,`)})`,T=(e,t)=>o<2?`${e}`:`${J(e,t,o)}`,E=(e,t,n)=>o<2?`${e}=${n};`:`${J(e,t,o)}=${n};`,D={},O=(t,n)=>{m.broadcastedIndicesToOffset=!0;let r=`${n.name}broadcastedIndicesTo${e}Offset`;if(r in D)return`${r}(${t})`;let i=[];for(let e=o-1;e>=0;e--){let t=n.indicesGet(`outputIndices`,e+n.rank-o);i.push(`${T(_,e)} * (${t} % ${T(g,e)})`)}return D[r]=`fn ${r}(outputIndices: ${n.type.indices}) -> u32 { + return ${i.length>0?i.join(`+`):`0u`}; + }`,`${r}(${t})`},ee=(t,n)=>(()=>{if(f.storage===f.value)return`${e}[${t}]=${n};`;if(f.storage===`vec2`&&f.value===`i32`)return`${e}[${t}]=vec2(u32(${n}), select(0u, 0xFFFFFFFFu, ${n} < 0));`;if(f.storage===`vec2`&&f.value===`u32`)return`${e}[${t}]=vec2(u32(${n}), 0u);`;if(f.storage===`u32`&&f.value===`vec4`)return`${e}[${t}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${n}));`;throw Error(`not supported combination of storage type ${f.storage} and value type ${f.value} yet`)})(),k=t=>(()=>{if(f.storage===f.value)return`${e}[${t}]`;if(f.storage===`vec2`&&f.value===`i32`)return`i32(${e}[${t}].x)`;if(f.storage===`vec2`&&f.value===`u32`)return`u32(${e}[${t}].x)`;if(f.storage===`u32`&&f.value===`vec4`)return`vec4(bool(${e}[${t}] & 0xFFu), bool(${e}[${t}] & 0xFF00u), bool(${e}[${t}] & 0xFF0000u), bool(${e}[${t}] & 0xFF000000u))`;throw Error(`not supported combination of storage type ${f.storage} and value type ${f.value} yet`)})(),te=o<2?``:` + fn get_${e}ByIndices(indices: ${f.indices}) -> ${u} { + return ${k(`i2o_${e}(indices)`)}; + }`,ne=o<2?``:(()=>{let t=s.map(e=>`d${e}: u32`).join(`, `),n=s.map(e=>`d${e}`).join(`, `);return` + fn get_${e}(${t}) -> ${u} { + return get_${e}ByIndices(${w(n)}); + }`})(),re=(...t)=>{if(t.length!==o)throw Error(`indices length must be ${o}`);let n=t.map(p).join(`,`);return o===0?k(`0u`):o===1?k(n[0]):(m.get=!0,m.getByIndices=!0,m.indicesToOffset=!0,`get_${e}(${n})`)},ie=t=>o<2?k(t):(m.getByIndices=!0,m.indicesToOffset=!0,`get_${e}ByIndices(${t})`),A=o<2?``:` + fn set_${e}ByIndices(indices: ${f.indices}, value: ${u}) { + ${ee(`i2o_${e}(indices)`,`value`)} + }`,ae=o<2?``:(()=>{let t=s.map(e=>`d${e}: u32`).join(`, `),n=s.map(e=>`d${e}`).join(`, `);return` + fn set_${e}(${t}, value: ${u}) { + set_${e}ByIndices(${w(n)}, value); + }`})();return{impl:()=>{let e=[],t=!1;return m.offsetToIndices&&(e.push(y),t=!0),m.indicesToOffset&&(e.push(S),t=!0),m.broadcastedIndicesToOffset&&(Object.values(D).forEach(t=>e.push(t)),t=!0),m.set&&(e.push(ae),t=!0),m.setByIndices&&(e.push(A),t=!0),m.get&&(e.push(ne),t=!0),m.getByIndices&&(e.push(te),t=!0),!a&&t&&e.unshift(`const ${g} = ${f.indices}(${n.join(`,`)});`,`const ${_} = ${f.indices}(${U.computeStrides(n).join(`,`)});`),e.join(` +`)},type:f,offsetToIndices:b,indicesToOffset:C,broadcastedIndicesToOffset:O,indices:w,indicesGet:T,indicesSet:E,set:(...t)=>{if(t.length!==o+1)throw Error(`indices length must be ${o}`);let n=t[o];if(typeof n!=`string`)throw Error(`value must be string`);let r=t.slice(0,o).map(p).join(`,`);return o===0?ee(`0u`,n):o===1?ee(r[0],n):(m.set=!0,m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}(${r}, ${n})`)},setByOffset:ee,setByIndices:(t,n)=>o<2?ee(t,n):(m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}ByIndices(${t}, ${n});`),get:re,getByOffset:k,getByIndices:ie,usage:r,name:e,strides:_,shape:g,rank:o}},Y=(e,t,n,r=1)=>br(e,t,n,`input`,r),X=(e,t,n,r=1)=>br(e,t,n,`output`,r),xr=(e,t,n)=>br(e,t,n,`atomicOutput`,1),Sr=(e,t,n,r=1)=>br(e,t,n,`internal`,r),Cr=class{constructor(e,t){this.normalizedDispatchGroup=e,this.limits=t,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e==`number`?`${e}u`:e}) { return; }`}mainStart(e=pr){let t=typeof e==`number`?e:e[0],n=typeof e==`number`?1:e[1],r=typeof e==`number`?1:e[2];if(t>this.limits.maxComputeWorkgroupSizeX||n>this.limits.maxComputeWorkgroupSizeY||r>this.limits.maxComputeWorkgroupSizeZ)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(t*n*r>this.limits.maxComputeInvocationsPerWorkgroup)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let i=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,a=i?`@builtin(global_invocation_id) global_id : vec3, + @builtin(workgroup_id) workgroup_id : vec3, + @builtin(local_invocation_index) local_idx : u32, + @builtin(local_invocation_id) local_id : vec3`:`@builtin(global_invocation_id) global_id : vec3, + @builtin(local_invocation_id) local_id : vec3, + @builtin(local_invocation_index) local_idx : u32, + @builtin(workgroup_id) workgroup_id : vec3, + @builtin(num_workgroups) num_workgroups : vec3`,o=i?`let global_idx = global_id.x; + let workgroup_index = workgroup_id.x;`:`let workgroup_index = workgroup_id.z * num_workgroups[0] * num_workgroups[1] + + workgroup_id.y * num_workgroups[0] + workgroup_id.x; + let global_idx = workgroup_index * ${t*n*r}u + local_idx;`;return`@compute @workgroup_size(${t}, ${n}, ${r}) + fn main(${a}) { + ${o} + `}appendVariableUniforms(e){e.rank!==0&&(e.shape.startsWith(`uniforms.`)&&this.uniforms.push({name:e.shape.replace(`uniforms.`,``),type:`u32`,length:e.rank}),e.strides.startsWith(`uniforms.`)&&this.uniforms.push({name:e.strides.replace(`uniforms.`,``),type:`u32`,length:e.rank}))}declareVariable(e,t){if(e.usage===`internal`)throw Error(`cannot use internal variable with declareVariable(). use registerInternalVariables() instead.`);this.variables.push(e),this.appendVariableUniforms(e);let n=e.usage===`input`?`read`:`read_write`,r=e.usage===`atomicOutput`?`atomic`:e.type.storage;return`@group(0) @binding(${t}) var ${e.name}: array<${r}>;`}declareVariables(...e){return e.map(e=>this.declareVariable(e,this.variableIndex++)).join(` +`)}registerInternalVariable(e){if(e.usage!==`internal`)throw Error(`cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.`);this.internalVariables.push(e),this.appendVariableUniforms(e)}registerInternalVariables(...e){return e.forEach(e=>this.registerInternalVariable(e)),this}registerUniform(e,t,n=1){return this.uniforms.push({name:e,type:t,length:n}),this}registerUniforms(e){return this.uniforms=this.uniforms.concat(e),this}uniformDeclaration(){if(this.uniforms.length===0)return``;let e=[];for(let{name:t,type:n,length:r}of this.uniforms)if(r&&r>4)n===`f16`?e.push(`@align(16) ${t}:array, ${Math.ceil(r/8)}>`):e.push(`${t}:array, ${Math.ceil(r/4)}>`);else{let i=r==null||r===1?n:`vec${r}<${n}>`;e.push(`${t}:${i}`)}return` + struct Uniforms { ${e.join(`, `)} }; + @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(e=>e.impl()).join(` +`)+this.internalVariables.map(e=>e.impl()).join(` +`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=e=>[12,10,1,6][[`u32`,`f16`,`f32`,`i32`].indexOf(e)];return this.uniforms.map(t=>[e(t.type),t.length??1])}},wr=(e,t)=>new Cr(e,t)}),Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr=L(()=>{"use strict";V(),W(),fr(),Z(),Tr=(e,t)=>{if(!e||e.length!==1)throw Error(`Transpose requires 1 input.`);if(t.length!==0&&t.length!==e[0].dims.length)throw Error(`perm size ${t.length} does not match input rank ${e[0].dims.length}`)},Er=(e,t)=>t.length===0?[...Array(e).keys()].reverse():t,Dr=(e,t)=>U.sortBasedOnPerm(e,Er(e.length,t)),Or=(e,t,n,r)=>{let i=`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + var a: ${n.type.indices};`;for(let n=0;n{let n=[],r=[];for(let i=0;i{let n=0;for(let r=0;r{let n=e.dataType,r=e.dims.length,i=Er(r,t),a=Dr(e.dims,i),o=e.dims,s=a,c=r<2||Ar(i,e.dims),l;if(c)return l=e=>{let t=Y(`input`,n,o,4),r=X(`output`,n,s,4);return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(t,r)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + output[global_idx] = input[global_idx]; + }`},{name:`TransposeCopy`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let t=U.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64/4)},programUniforms:[{type:12,data:Math.ceil(t/4)}]}},getShaderSource:l};let{newShape:u,newPerm:d}=kr(e.dims,i),f=U.areEqual(d,[2,3,1]),p=U.areEqual(d,[3,1,2]);if(u.length===2||f||p){o=f?[u[0],u[1]*u[2]]:p?[u[0]*u[1],u[2]]:u,s=[o[1],o[0]];let t=16;return l=e=>{let r=Y(`a`,n,o.length),i=X(`output`,n,s.length);return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(r,i)} + var tile : array, ${t}>; + ${e.mainStart([t,t,1])} + let stride = (uniforms.output_shape[1] - 1) / ${t} + 1; + let workgroup_id_x = workgroup_index % stride; + let workgroup_id_y = workgroup_index / stride; + let input_col = workgroup_id_y * ${t}u + local_id.x; + let input_row = workgroup_id_x * ${t}u + local_id.y; + if (input_row < uniforms.a_shape[0] && input_col < uniforms.a_shape[1]) { + tile[local_id.y][local_id.x] = ${r.getByIndices(`${r.type.indices}(input_row, input_col)`)}; + } + workgroupBarrier(); + + let output_col = workgroup_id_x * ${t}u + local_id.x; + let output_row = workgroup_id_y * ${t}u + local_id.y; + if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) { + ${i.setByIndices(`${i.type.indices}(output_row, output_col)`,`tile[local_id.x][local_id.y]`)} + } + }`},{name:`TransposeShared`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let n=U.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(s[1]/t),y:Math.ceil(s[0]/t)},programUniforms:[{type:12,data:n},...K(o,s)]}},getShaderSource:l}}return l=e=>{let t=Y(`a`,n,o.length),a=X(`output`,n,s.length);return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(t,a)} + + ${Or(i,r,t,a)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let indices = ${a.offsetToIndices(`global_idx`)}; + let aIndices = perm(indices); + + ${a.setByOffset(`global_idx`,t.getByIndices(`aIndices`))} + }`},{name:`Transpose`,shaderCache:{hint:`${t}`,inputDependencies:[`rank`]},getRunData:()=>{let t=U.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:[{type:12,data:t},...K(o,s)]}},getShaderSource:l}},Mr=(e,t)=>{Tr(e.inputs,t.perm),e.compute(jr(e.inputs[0],t.perm))},Nr=e=>G({perm:e.perm})}),Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni=L(()=>{"use strict";V(),W(),Z(),ki(),Pr(),Fr={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate * candidate`,logSumExp:`bestValue + exp(candidate)`,l1:`bestValue + abs(candidate)`,l2:`bestValue + candidate * candidate`,logSum:`bestValue + candidate`},Ir={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate`,logSumExp:`bestValue + candidate`,l1:`bestValue + candidate`,l2:`bestValue + candidate`,logSum:`bestValue + candidate`},Lr={max:`_A[offset]`,min:`_A[offset]`,mean:`0`,sum:`0`,prod:`1`,sumSquare:`0`,logSumExp:`0`,l1:`0`,l2:`0`,logSum:`0`},Rr={max:`bestValue`,min:`bestValue`,sum:`bestValue`,prod:`bestValue`,sumSquare:`bestValue`,logSumExp:`log(bestValue)`,l1:`bestValue`,l2:`sqrt(bestValue)`,logSum:`log(bestValue)`},zr=(e,t)=>{let n=[];for(let r=t-e;r{let n=[],r=e.length;for(let i=0;ie[t]);return[n,i]},Vr=(e,t)=>{let n=e.length+t.length,r=[],i=0;for(let a=0;a{for(let n=0;n{let n=[];if(!Hr(e,t)){for(let r=0;rn.push(e))}return n},Wr=(e,t,n,r,i,a,o)=>{let s=n[0].dims,c=U.size(a),l=U.size(o),u=Y(`_A`,n[0].dataType,s),d=X(`output`,i,a),f=64;c===1&&(f=256);let p=` + var aBestValues : array; + `,m=e=>` + ${e.registerUniform(`reduceSize`,`u32`).declareVariables(u,d)} + ${p} + fn DIV_CEIL(a : u32, b : u32) -> u32 { + return ((a - 1u) / b + 1u); + } + ${e.mainStart(f)} + + let outputIndex = global_idx / ${f}; + let offset = outputIndex * uniforms.reduceSize; + + var bestValue = f32(${Lr[r]}); + let Length = uniforms.reduceSize; + for (var k = local_idx; k < Length; k = k + ${f}) { + let candidate = f32(${u.getByOffset(`offset + k`)}); + bestValue = ${Fr[r]}; + } + aBestValues[local_idx] = bestValue; + workgroupBarrier(); + + var reduceSize = min(Length, ${f}u); + for (var currentSize = reduceSize / 2u; reduceSize > 1u; + currentSize = reduceSize / 2u) { + let interval = DIV_CEIL(reduceSize, 2u); + if (local_idx < currentSize) { + let candidate = aBestValues[local_idx + interval]; + bestValue = ${Ir[r]}; + aBestValues[local_idx] = bestValue; + } + reduceSize = interval; + workgroupBarrier(); + } + + if (local_idx == 0u) { + ${d.setByOffset(`outputIndex`,`${r===`mean`?`${d.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${d.type.storage}(${Rr[r]})`}`)}; + } + }`;return{name:e,shaderCache:{hint:`${t};${f}`,inputDependencies:[`type`]},getShaderSource:m,getRunData:()=>({outputs:[{dims:a,dataType:i}],dispatchGroup:{x:c},programUniforms:[{type:12,data:l}]})}},Gr=(e,t,n,r)=>{let i=e.inputs.length===1?n:oi(e.inputs,n),a=i.axes;a.length===0&&!i.noopWithEmptyAxes&&(a=e.inputs[0].dims.map((e,t)=>t));let o=U.normalizeAxes(a,e.inputs[0].dims.length),s=o,c=e.inputs[0],l=Ur(s,e.inputs[0].dims.length);l.length>0&&(c=e.compute(jr(e.inputs[0],l),{inputs:[0],outputs:[-1]})[0],s=zr(s.length,c.dims.length));let[u,d]=Br(c.dims,s),f=u;i.keepDims&&(f=Vr(u,o)),e.compute(Wr(t,i.cacheKey,[c],r,e.inputs[0].dataType,f,d),{inputs:[c]})},Kr=(e,t)=>{Gr(e,`ReduceMeanShared`,t,`mean`)},qr=(e,t)=>{Gr(e,`ReduceL1Shared`,t,`l1`)},Jr=(e,t)=>{Gr(e,`ReduceL2Shared`,t,`l2`)},Yr=(e,t)=>{Gr(e,`ReduceLogSumExpShared`,t,`logSumExp`)},Xr=(e,t)=>{Gr(e,`ReduceMaxShared`,t,`max`)},Zr=(e,t)=>{Gr(e,`ReduceMinShared`,t,`min`)},Qr=(e,t)=>{Gr(e,`ReduceProdShared`,t,`prod`)},$r=(e,t)=>{Gr(e,`ReduceSumShared`,t,`sum`)},ei=(e,t)=>{Gr(e,`ReduceSumSquareShared`,t,`sumSquare`)},ti=(e,t)=>{Gr(e,`ReduceLogSumShared`,t,`logSum`)}}),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=L(()=>{"use strict";V(),W(),fr(),Z(),ni(),ri=e=>{if(!e||e.length===0||e.length>2)throw Error(`Reduce op requires 1 or 2 inputs.`);if(e.length===2&&e[1].dims.length!==1)throw Error(`Invalid axes input dims.`)},ii=e=>[``,``,`var value = ${e.getByIndices(`input_indices`)};`,``],ai=(e,t,n,r,i,a,o=!1,s=!1)=>{let c=[],l=n[0].dims,u=l.length,d=U.normalizeAxes(i,u),f=!s&&d.length===0;l.forEach((e,t)=>{f||d.indexOf(t)>=0?o&&c.push(1):c.push(e)});let p=c.length,m=U.size(c);return{name:e,shaderCache:t,getShaderSource:e=>{let t=[],i=Y(`_A`,n[0].dataType,u),s=X(`output`,a,p),c=r(i,s,d),m=c[2];for(let e=0,n=0;e=0?(o&&n++,m=`for(var j${e}: u32 = 0; j${e} < ${l[e]}; j${e}++) { + ${c[2].includes(`last_index`)?`let last_index = j${e};`:``} + ${i.indicesSet(`input_indices`,e,`j${e}`)} + ${m} + }`):(t.push(`${i.indicesSet(`input_indices`,e,s.indicesGet(`output_indices`,n))};`),n++);return` + + ${e.registerUniform(`output_size`,`u32`).declareVariables(i,s)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + var input_indices: ${i.type.indices}; + let output_indices = ${s.offsetToIndices(`global_idx`)}; + + ${t.join(` +`)} + ${c[0]} // init ops for reduce max/min + ${c[1]} + ${m} + ${c[3]} + ${c.length===4?s.setByOffset(`global_idx`,`value`):c.slice(4).join(` +`)} + }`},getRunData:()=>({outputs:[{dims:c,dataType:a}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...K(l,c)]})}},oi=(e,t)=>{let n=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),G({axes:n,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},si=(e,t,n,r)=>{let i=e.inputs,a=i.length===1?n:oi(i,n);e.compute(ai(t,{hint:a.cacheKey,inputDependencies:[`rank`]},[i[0]],a.noopWithEmptyAxes&&a.axes.length===0?ii:r,a.axes,i[0].dataType,a.keepDims,a.noopWithEmptyAxes),{inputs:[0]})},ci=(e,t)=>{ri(e.inputs),si(e,`ReduceLogSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,`value = log(value);`])},li=(e,t)=>{ri(e.inputs),si(e,`ReduceL1`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += abs(${e.getByIndices(`input_indices`)});`,``])},ui=(e,t)=>{ri(e.inputs),si(e,`ReduceL2`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += (t * t);`,`value = sqrt(value);`])},di=(e,t)=>{ri(e.inputs),si(e,`ReduceLogSumExp`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += exp(${e.getByIndices(`input_indices`)});`,`value = log(value);`])},fi=(e,t)=>{ri(e.inputs),si(e,`ReduceMax`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(e.indicesSet(`input_indices`,t,0));return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = max(value, ${e.getByIndices(`input_indices`)});`,``]})},pi=(e,t)=>{ri(e.inputs),si(e,`ReduceMean`,t,(t,n,r)=>{let i=1;for(let n=0;n=0||r.length===0)&&(i*=e.inputs[0].dims[n]);return[`var sum = f32(0);`,``,`sum += f32(${t.getByIndices(`input_indices`)});`,`let value = ${n.type.value}(sum / ${i});`]})},mi=(e,t)=>{ri(e.inputs),si(e,`ReduceMin`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(`input_indices[${t}] = 0;`);return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = min(value, ${e.getByIndices(`input_indices`)});`,``]})},hi=(e,t)=>{ri(e.inputs),si(e,`ReduceProd`,t,(e,t)=>[`var value = ${t.type.storage}(1);`,``,`value *= ${e.getByIndices(`input_indices`)};`,``])},gi=(e,t)=>{ri(e.inputs),si(e,`ReduceSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,``])},_i=(e,t)=>{ri(e.inputs),si(e,`ReduceSumSquare`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += t * t;`,``])},vi=(e,t,n)=>{if(t.length===0)return n;let r=1,i=1;for(let n=0;n1024},yi=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?pi(e,t):Kr(e,t)},bi=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?li(e,t):qr(e,t)},xi=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ui(e,t):Jr(e,t)},Si=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?di(e,t):Yr(e,t)},Ci=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?fi(e,t):Xr(e,t)},wi=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?mi(e,t):Zr(e,t)},Ti=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?hi(e,t):Qr(e,t)},Ei=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?gi(e,t):$r(e,t)},Di=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?_i(e,t):ei(e,t)},Oi=(e,t)=>{vi(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ci(e,t):ti(e,t)}}),Ai,ji,Mi,Ni,Pi=L(()=>{"use strict";V(),fr(),ki(),Ai=e=>{if(!e||e.length===0||e.length>2)throw Error(`ArgMinMaxOp op requires 1 or 2 inputs.`);if(e[0].dataType!==1)throw Error(`Invalid input type.`)},ji=(e,t)=>{Ai(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)}; +var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`<=`:`<`} value) { + value = ${e.getByIndices(`input_indices`)}; + best_index = i32(last_index); + }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(ai(`ArgMin`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},Mi=(e,t)=>{Ai(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)}; +var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`>=`:`>`} value) { + value = ${e.getByIndices(`input_indices`)}; + best_index = i32(last_index); + }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(ai(`argMax`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},Ni=e=>G(e)}),Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui=L(()=>{"use strict";V(),W(),er(),Z(),Fi=(e,t)=>{let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5];if(o&&s)throw Error(`Attention cannot have both past and attention_bias`);if(n.dims.length!==3)throw Error(`Input "input" must have 3 dimensions`);let c=n.dims[0],l=n.dims[1],u=n.dims[2];if(i.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimensions`);if(r.dims.length!==2)throw Error(`Input "weights" is expected to have 2 dimensions`);if(r.dims[0]!==u)throw Error(`Input 1 dimension 0 should have same length as dimension 2 of input 0`);if(i.dims[0]!==r.dims[1])throw Error(`Input "bias" dimension 0 should have same length as dimension 1 of input "weights"`);let d=i.dims[0]/3,f=d,p=f;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw Error(`qkv_hidden_sizes attribute should have 3 elements`);for(let e of t.qkvHiddenSizes)if(e%t.numHeads!==0)throw Error(`qkv_hidden_sizes should be divisible by num_heads`);d=t.qkvHiddenSizes[0],f=t.qkvHiddenSizes[1],p=t.qkvHiddenSizes[2]}let m=l;if(d!==f)throw Error(`qkv_hidden_sizes first element should be same as the second`);if(i.dims[0]!==d+f+p)throw Error(`Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes`);let h=0;if(o){if(f!==p)throw Error(`Input "past" expect k_hidden_size == v_hidden_size`);if(o.dims.length!==5)throw Error(`Input "past" must have 5 dimensions`);if(o.dims[0]!==2)throw Error(`Input "past" first dimension must be 2`);if(o.dims[1]!==c)throw Error(`Input "past" second dimension must be batch_size`);if(o.dims[2]!==t.numHeads)throw Error(`Input "past" third dimension must be num_heads`);if(o.dims[4]!==f/t.numHeads)throw Error(`Input "past" fifth dimension must be k_hidden_size / num_heads`);t.pastPresentShareBuffer||(h=o.dims[3])}let g=m+h,_=-1,v=0;if(a)throw Error(`Mask not supported`);if(o)throw Error(`past is not supported`);if(s){if(s.dims.length!==4)throw Error(`Input "attention_bias" must have 4 dimensions`);if(s.dims[0]!==c||s.dims[1]!==t.numHeads||s.dims[2]!==l||s.dims[3]!==g)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:c,sequenceLength:l,pastSequenceLength:h,kvSequenceLength:m,totalSequenceLength:g,maxSequenceLength:_,inputHiddenSize:u,hiddenSize:d,vHiddenSize:p,headSize:Math.floor(d/t.numHeads),vHeadSize:Math.floor(p/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},Ii=(e,t,n)=>t&&e?` + let total_sequence_length_input = u32(${t.getByOffset(`0`)}); + let present_sequence_length = max(total_sequence_length_input, uniforms.past_sequence_length); + let is_subsequent_prompt: bool = sequence_length > 1 && sequence_length != total_sequence_length_input; + let is_first_prompt: bool = is_subsequent_prompt == false && sequence_length == total_sequence_length_input; + total_sequence_length = u32(${e?.getByOffset(`batchIdx`)}) + 1; + var past_sequence_length: u32 = 0; + if (is_first_prompt == false) { + past_sequence_length = total_sequence_length - sequence_length; + } + `:` + ${n?`let past_sequence_length = uniforms.past_sequence_length`:``}; + let present_sequence_length = total_sequence_length; + `,Li=(e,t,n,r,i,a,o,s)=>{let c=_r(o?1:a),l=64,u=a/c;u{let n=X(`x`,e.dataType,e.dims,c),r=[n],i=o?Y(`seq_lens`,o.dataType,o.dims):void 0;i&&r.push(i);let a=s?Y(`total_sequence_length_input`,s.dataType,s.dims):void 0;a&&r.push(a);let u=gr(e.dataType),d=[{name:`batch_size`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`total_sequence_length`,type:`u32`},{name:`elements_per_thread`,type:`u32`}];return` + var thread_max: array; + var thread_sum: array; + ${t.registerUniforms(d).declareVariables(...r)} + ${t.mainStart([l,1,1])} + let batchIdx = workgroup_id.z / uniforms.num_heads; + let headIdx = workgroup_id.z % uniforms.num_heads; + let sequence_length = uniforms.sequence_length; + var total_sequence_length = uniforms.total_sequence_length; + ${Ii(i,a,!1)} + let local_offset = local_idx * uniforms.elements_per_thread; + let offset = (global_idx / ${l}) * uniforms.total_sequence_length + local_offset; + let seq_causal_length = ${o?`u32(past_sequence_length + workgroup_id.y + 1)`:`total_sequence_length`}; + var thread_max_vector = ${m}(-3.402823e+38f); + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + thread_max_vector = max(${m}(x[offset + i]), thread_max_vector); + } + thread_max[local_idx] = ${(()=>{switch(c){case 1:return`thread_max_vector`;case 2:return`max(thread_max_vector.x, thread_max_vector.y)`;case 4:return`max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))`;default:throw Error(`Unsupported components: ${c}`)}})()}; + workgroupBarrier(); + + var max_value = f32(-3.402823e+38f); + for (var i = 0u; i < ${l}; i++) { + max_value = max(thread_max[i], max_value); + } + + var sum_vector = ${m}(0); + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + sum_vector += exp(${m}(x[offset + i]) - max_value); + } + thread_sum[local_idx] = ${(()=>{switch(c){case 1:return`sum_vector`;case 2:return`sum_vector.x + sum_vector.y`;case 4:return`sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w`;default:throw Error(`Unsupported components: ${c}`)}})()}; + workgroupBarrier(); + + var sum: f32 = 0; + for (var i = 0u; i < ${l}; i++) { + sum += thread_sum[i]; + } + + if (sum == 0) { + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + x[offset + i] = ${n.type.value}(${u}(1.0) / ${u}(seq_causal_length)); + } + } else { + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + var f32input = ${m}(x[offset + i]); + x[offset + i] = ${n.type.value}(exp(f32input - max_value) / sum); + } + } + ${o?` + for (var total_seq_id: u32 = seq_causal_length; total_seq_id + local_offset < uniforms.total_sequence_length; total_seq_id++) { + x[offset + total_seq_id] = ${n.type.value}(${u}(0)); + }`:``}; + }`};return{name:`AttentionProbsSoftmax`,shaderCache:{hint:`${l};${p};${c}`,inputDependencies:h},getShaderSource:g,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:i,z:t*n},programUniforms:f})}},Ri=(e,t,n,r,i,a,o,s,c)=>{let l=o+a.kvSequenceLength,u=[a.batchSize,a.numHeads,a.sequenceLength,l],d=e>1&&r,f=a.kvNumHeads?a.kvNumHeads:a.numHeads,p=d?[a.batchSize,f,l,a.headSize]:void 0,m=a.nReps?a.nReps:1,h=a.scale===0?1/Math.sqrt(a.headSize):a.scale,g=_r(a.headSize),_=a.headSize/g,v=12,y={x:Math.ceil(l/v),y:Math.ceil(a.sequenceLength/v),z:a.batchSize*a.numHeads},b=[{type:12,data:a.sequenceLength},{type:12,data:_},{type:12,data:l},{type:12,data:a.numHeads},{type:12,data:a.headSize},{type:1,data:h},{type:12,data:o},{type:12,data:a.kvSequenceLength},{type:12,data:m}],x=d&&r&&U.size(r.dims)>0,S=[`type`,`type`];x&&S.push(`type`),i&&S.push(`type`),s&&S.push(`type`),c&&S.push(`type`);let C=[{dims:u,dataType:t.dataType,gpuDataType:0}];d&&C.push({dims:p,dataType:t.dataType,gpuDataType:0});let w=e=>{let a=Y(`q`,t.dataType,t.dims,g),o=Y(`key`,n.dataType,n.dims,g),l=[a,o];if(x){let e=Y(`past_key`,r.dataType,r.dims,g);l.push(e)}i&&l.push(Y(`attention_bias`,i.dataType,i.dims));let f=s?Y(`seq_lens`,s.dataType,s.dims):void 0;f&&l.push(f);let h=c?Y(`total_sequence_length_input`,c.dataType,c.dims):void 0;h&&l.push(h);let _=X(`output`,t.dataType,u),y=[_];d&&y.push(X(`present_key`,t.dataType,p,g));let b=gr(1,g),S=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`alpha`,type:`f32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` + const TILE_SIZE = ${v}u; + + var tileQ: array<${a.type.storage}, ${v*v}>; + var tileK: array<${a.type.storage}, ${v*v}>; + ${e.registerUniforms(S).declareVariables(...l,...y)} + ${e.mainStart([v,v,1])} + // x holds the N and y holds the M + let headIdx = workgroup_id.z % uniforms.num_heads; + let kvHeadIdx = ${m===1?`headIdx`:`headIdx / uniforms.n_reps`}; + let kv_num_heads = ${m===1?`uniforms.num_heads`:`uniforms.num_heads / uniforms.n_reps`}; + let batchIdx = workgroup_id.z / uniforms.num_heads; + let m = workgroup_id.y * TILE_SIZE; + let n = workgroup_id.x * TILE_SIZE; + let sequence_length = uniforms.M; + var total_sequence_length = uniforms.N; + ${Ii(f,h,!0)} + let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; + let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; + ${x&&d?`let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;`:``}; + let kOffset = absKvHeadIdx * uniforms.kv_sequence_length * uniforms.K; + ${d?`let presentKeyOffset = absKvHeadIdx * uniforms.N * uniforms.K;`:``} + var value = ${b}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) { + tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x]; + } + if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) { + var idx = TILE_SIZE * local_id.y + local_id.x; + ${x&&d?` + if (n + local_id.y < past_sequence_length) { + tileK[idx] = past_key[pastKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; + } else if (n + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { + tileK[idx] = key[kOffset + (n + local_id.y - past_sequence_length) * uniforms.K + w + local_id.x]; + }`:` + if (n + local_id.y < uniforms.kv_sequence_length) { + tileK[idx] = key[kOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; + }`} + ${d?`if (n + local_id.y < present_sequence_length) { + present_key[presentKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x] = tileK[idx]; + }`:``} + } + workgroupBarrier(); + + for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) { + value += ${b}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]); + } + + workgroupBarrier(); + } + + if (global_id.y < uniforms.M && global_id.x < total_sequence_length) { + let headOffset = workgroup_id.z * uniforms.M * uniforms.N; + let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x; + var sum: f32 = ${(()=>{switch(g){case 1:return`value`;case 2:return`value.x + value.y`;case 4:return`value.x + value.y + value.z + value.w`;default:throw Error(`Unsupported components: ${g}`)}})()}; + output[outputIdx] = ${_.type.value} (sum * uniforms.alpha) + ${i?`attention_bias[outputIdx]`:`0.0`}; + } + }`};return{name:`AttentionProbs`,shaderCache:{hint:`${g};${i!==void 0};${r!==void 0};${e}`,inputDependencies:S},getRunData:()=>({outputs:C,dispatchGroup:y,programUniforms:b}),getShaderSource:w}},zi=(e,t,n,r,i,a,o=void 0,s=void 0)=>{let c=a+i.kvSequenceLength,l=i.nReps?i.nReps:1,u=i.vHiddenSize*l,d=e>1&&r,f=i.kvNumHeads?i.kvNumHeads:i.numHeads,p=d?[i.batchSize,f,c,i.headSize]:void 0,m=[i.batchSize,i.sequenceLength,u],h=12,g={x:Math.ceil(i.vHeadSize/h),y:Math.ceil(i.sequenceLength/h),z:i.batchSize*i.numHeads},_=[{type:12,data:i.sequenceLength},{type:12,data:c},{type:12,data:i.vHeadSize},{type:12,data:i.numHeads},{type:12,data:i.headSize},{type:12,data:u},{type:12,data:a},{type:12,data:i.kvSequenceLength},{type:12,data:l}],v=d&&r&&U.size(r.dims)>0,y=[`type`,`type`];v&&y.push(`type`),o&&y.push(`type`),s&&y.push(`type`);let b=[{dims:m,dataType:t.dataType,gpuDataType:0}];d&&b.push({dims:p,dataType:t.dataType,gpuDataType:0});let x=e=>{let i=Y(`probs`,t.dataType,t.dims),a=Y(`v`,n.dataType,n.dims),c=[i,a];v&&c.push(Y(`past_value`,r.dataType,r.dims));let u=o?Y(`seq_lens`,o.dataType,o.dims):void 0;o&&c.push(u);let f=s?Y(`total_sequence_length_input`,s.dataType,s.dims):void 0;s&&c.push(f);let g=[X(`output`,t.dataType,m)];d&&g.push(X(`present_value`,t.dataType,p));let _=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`v_hidden_size`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` + const TILE_SIZE = ${h}u; + var tileQ: array<${i.type.value}, ${h*h}>; + var tileV: array<${i.type.value}, ${h*h}>; + ${e.registerUniforms(_).declareVariables(...c,...g)} + ${e.mainStart([h,h,1])} + let headIdx = workgroup_id.z % uniforms.num_heads; + let batchIdx = workgroup_id.z / uniforms.num_heads; + let kvHeadIdx = ${l===1?`headIdx`:`headIdx / uniforms.n_reps`}; + let kv_num_heads = ${l===1?`uniforms.num_heads`:`uniforms.num_heads / uniforms.n_reps`}; + let m = global_id.y; + let n = global_id.x; + let sequence_length = uniforms.M; + var total_sequence_length = uniforms.K; + ${Ii(u,f,!0)} + let offsetA = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; + let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; // kvHeadIdx is relative to the batch + ${v&&d?`let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;`:``}; + let vOffset = absKvHeadIdx * uniforms.N * uniforms.kv_sequence_length + n; + ${d?`let presentValueOffset = absKvHeadIdx * uniforms.N * uniforms.K + n;`:``} + var value = ${i.type.storage}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (m < uniforms.M && w + local_id.x < uniforms.K) { + tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x]; + } + if (n < uniforms.N && w + local_id.y < uniforms.K) { + var idx = TILE_SIZE * local_id.y + local_id.x; + ${v&&d?` + if (w + local_id.y < past_sequence_length) { + tileV[idx] = past_value[pastValueOffset + (w + local_id.y) * uniforms.N]; + } else if (w + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { + tileV[idx] = v[vOffset + (w + local_id.y - past_sequence_length) * uniforms.N]; + } + `:` + if (w + local_id.y < uniforms.kv_sequence_length) { + tileV[idx] = v[vOffset + (w + local_id.y) * uniforms.N]; + }`} + ${d?` + if (w + local_id.y < present_sequence_length) { + present_value[presentValueOffset + (w + local_id.y) * uniforms.N] = tileV[idx]; + }`:``} + } + workgroupBarrier(); + for (var k: u32 = 0u; k < TILE_SIZE && w+k < total_sequence_length; k++) { + value += tileQ[TILE_SIZE * local_id.y + k] * tileV[TILE_SIZE * k + local_id.x]; + } + workgroupBarrier(); + } + + // we need to transpose output from BNSH_v to BSND_v + if (m < uniforms.M && n < uniforms.N) { + let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size + + headIdx * uniforms.N + n; + output[outputIdx] = value; + } + }`};return{name:`AttentionScore`,shaderCache:{hint:`${r!==void 0};${e}`,inputDependencies:y},getRunData:()=>({outputs:b,dispatchGroup:g,programUniforms:_}),getShaderSource:x}},Bi=(e,t,n,r,i,a,o,s,c,l,u=void 0,d=void 0)=>{let f=Math.min(e.outputCount,1+(o?1:0)+(s?1:0)),p=f>1?l.pastSequenceLength:0,m=p+l.kvSequenceLength,h=c&&U.size(c.dims)>0?c:void 0,g=[t,n];f>1&&o&&U.size(o.dims)>0&&g.push(o),h&&g.push(h),u&&g.push(u),d&&g.push(d);let _=e.compute(Ri(f,t,n,o,h,l,p,u,d),{inputs:g,outputs:f>1?[-1,1]:[-1]})[0];e.compute(Li(_,l.batchSize,l.numHeads,p,l.sequenceLength,m,u,d),{inputs:u&&d?[_,u,d]:[_],outputs:[]});let v=[_,r];f>1&&s&&U.size(s.dims)>0&&v.push(s),u&&v.push(u),d&&v.push(d),e.compute(zi(f,_,r,s,l,p,u,d),{inputs:v,outputs:f>1?[0,2]:[0]})},Vi=(e,t)=>{let n=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],r=t.sequenceLength,i=t.inputHiddenSize,a=t.headSize,o=12,s={x:Math.ceil(t.headSize/o),y:Math.ceil(t.sequenceLength/o),z:t.batchSize*t.numHeads},c=[e.inputs[0],e.inputs[1],e.inputs[2]],l=[{type:12,data:r},{type:12,data:i},{type:12,data:a},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}],u=e=>{let t=X(`output_q`,c[0].dataType,n),r=X(`output_k`,c[0].dataType,n),i=X(`output_v`,c[0].dataType,n),a=Y(`input`,c[0].dataType,c[0].dims),s=Y(`weight`,c[1].dataType,c[1].dims),l=Y(`bias`,c[2].dataType,c[2].dims),u=a.type.storage,d=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`ldb`,type:`u32`}];return` + const TILE_SIZE = ${o}u; + var tileInput: array<${u}, ${o*o}>; + var tileWeightQ: array<${u}, ${o*o}>; + var tileWeightK: array<${u}, ${o*o}>; + var tileWeightV: array<${u}, ${o*o}>; + ${e.registerUniforms(d).declareVariables(a,s,l,t,r,i)} + ${e.mainStart([o,o,1])} + let batchIndex = workgroup_id.z / uniforms.num_heads; + let headNumber = workgroup_id.z % uniforms.num_heads; + let m = global_id.y; + let n = global_id.x; + + let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K; + let biasOffsetQ = headNumber * uniforms.head_size; + let biasOffsetK = uniforms.hidden_size + biasOffsetQ; + let biasOffsetV = uniforms.hidden_size + biasOffsetK; + + var valueQ = ${u}(0); + var valueK = ${u}(0); + var valueV = ${u}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (m < uniforms.M && w + local_id.x < uniforms.K) { + tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x]; + } + if (n < uniforms.N && w + local_id.y < uniforms.K) { + let offset = n + (w + local_id.y) * uniforms.ldb; + tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset]; + tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset]; + tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset]; + } + workgroupBarrier(); + for (var k: u32 = 0u; k({outputs:[{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:s,programUniforms:l}),getShaderSource:u},{inputs:c,outputs:[-1,-1,-1]})},Hi=(e,t)=>{let n=Fi(e.inputs,t),[r,i,a]=Vi(e,n);return Bi(e,r,i,a,e.inputs[4],void 0,void 0,void 0,e.inputs[5],n)}}),Wi,Gi,Ki,qi,Ji=L(()=>{"use strict";_t(),V(),W(),fr(),Z(),Wi=(e,t)=>{if(!e||e.length!==5)throw Error(`BatchNormalization requires 5 inputs`);let n=(e,t,n)=>{let r=t.length;if(r!==e.length)throw Error(`${n}: num dimensions != ${r}`);t.forEach((t,r)=>{if(t!==e[r])throw Error(`${n}: dim[${r}] do not match`)})};if(e[0].dims.length>1){let r=t.format===`NHWC`?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);n(e[1].dims,r,`Invalid input scale`),n(e[2].dims,r,`Invalid input B`),n(e[3].dims,r,`Invalid input mean`),n(e[4].dims,r,`Invalid input var`)}else n(e[1].dims,[1],`Invalid input scale`),n(e[2].dims,[1],`Invalid input B`),n(e[3].dims,[1],`Invalid input mean`),n(e[4].dims,[1],`Invalid input var`)},Gi=(e,t)=>{let{epsilon:n,spatial:r,format:i}=t,a=e[0].dims,o=r?_r(a[a.length-1]):1,s=i===`NHWC`&&a.length>1?o:1,c=U.size(a)/o,l=r,u=l?a.length:a,d=Y(`x`,e[0].dataType,e[0].dims,o),f=Y(`scale`,e[1].dataType,e[1].dims,s),p=Y(`bias`,e[2].dataType,e[2].dims,s),m=Y(`inputMean`,e[3].dataType,e[3].dims,s),h=Y(`inputVar`,e[4].dataType,e[4].dims,s),g=X(`y`,e[0].dataType,u,o),_=()=>{let e=``;if(r)e=`let cOffset = ${a.length===1?`0u`:i===`NHWC`?`outputIndices[${a.length-1}] / ${o}`:`outputIndices[1]`};`;else if(i===`NCHW`)e=` + ${g.indicesSet(`outputIndices`,`0`,`0`)} + let cOffset = ${g.indicesToOffset(`outputIndices`)};`;else{e=`var cIndices = ${f.type.indices}(0); + cIndices[0] = outputIndices[${a.length-1}];`;for(let t=1;t` + const epsilon = ${n}; + ${e.registerUniform(`outputSize`,`u32`).declareVariables(d,f,p,m,h,g)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + var outputIndices = ${g.offsetToIndices(`global_idx * ${o}`)}; + ${_()} + let scale = ${f.getByOffset(`cOffset`)}; + let bias = ${p.getByOffset(`cOffset`)}; + let inputMean = ${m.getByOffset(`cOffset`)}; + let inputVar = ${h.getByOffset(`cOffset`)}; + let x = ${d.getByOffset(`global_idx`)}; + let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias; + ${g.setByOffset(`global_idx`,`value`)} + }`;return{name:`BatchNormalization`,shaderCache:{hint:`${t.epsilon}_${t.format}_${r}_${o}`,inputDependencies:l?[`rank`,`type`,`type`,`type`,`type`]:void 0},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l?[{type:12,data:c},...K(a)]:[{type:12,data:c}]})}},Ki=e=>G(e),qi=(e,t)=>{let{inputs:n,outputCount:r}=e,i=Ki({...t,outputCount:r});if(R.webgpu.validateInputContent&&Wi(n,i),t.trainingMode)throw Error(`BatchNormalization trainingMode is not supported yet.`);e.compute(Gi(n,i))}}),Yi,Xi,Zi,Qi=L(()=>{"use strict";W(),Z(),Yi=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![320,640,1280].includes(e[0].dims[2]))throw Error(`number of channels should be 320, 640 or 1280`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},Xi=e=>{let t=e[0].dims,n=e[0].dims[2],r=U.size(t)/4,i=e[0].dataType,a=Y(`input`,i,t,4),o=Y(`bias`,i,[n],4),s=Y(`residual`,i,t,4),c=X(`output`,i,t,4);return{name:`BiasAdd`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(r/64)}}),getShaderSource:e=>` + const channels = ${n}u / 4; + ${e.declareVariables(a,o,s,c)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(r)} + let value = ${a.getByOffset(`global_idx`)} + + ${o.getByOffset(`global_idx % channels`)} + ${s.getByOffset(`global_idx`)}; + ${c.setByOffset(`global_idx`,`value`)} + }`}},Zi=e=>{Yi(e.inputs),e.compute(Xi(e.inputs))}}),$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa=L(()=>{"use strict";V(),W(),fr(),Z(),$i=(e,t,n,r,i,a,o)=>{let s=Math.ceil(t/4),c=``;c=typeof i==`string`?`${i}(a)`:i(`a`);let l=Y(`inputData`,n,[s],4),u=X(`outputData`,r,[s],4),d=[{name:`vec_size`,type:`u32`}];return o&&d.push(...o),` + ${e.registerUniforms(d).declareVariables(l,u)} + + ${a??``} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + + let a = ${l.getByOffset(`global_idx`)}; + ${u.setByOffset(`global_idx`,c)} + }`},ea=(e,t,n,r,i,a=e.dataType,o,s)=>{let c=[{type:12,data:Math.ceil(U.size(e.dims)/4)}];return o&&c.push(...o),{name:t,shaderCache:{hint:i,inputDependencies:[`type`]},getShaderSource:t=>$i(t,U.size(e.dims),e.dataType,a,n,r,s),getRunData:t=>({outputs:[{dims:e.dims,dataType:a}],dispatchGroup:{x:Math.ceil(U.size(t[0].dims)/64/4)},programUniforms:c})}},ta=e=>{e.compute(ea(e.inputs[0],`Abs`,`abs`))},na=e=>{e.compute(ea(e.inputs[0],`Acos`,`acos`))},ra=e=>{e.compute(ea(e.inputs[0],`Acosh`,`acosh`))},ia=e=>{e.compute(ea(e.inputs[0],`Asin`,`asin`))},aa=e=>{e.compute(ea(e.inputs[0],`Asinh`,`asinh`))},oa=e=>{e.compute(ea(e.inputs[0],`Atan`,`atan`))},sa=e=>{e.compute(ea(e.inputs[0],`Atanh`,`atanh`))},ca=e=>G(e),la=(e,t)=>{let n;switch(t.to){case 10:n=`vec4`;break;case 1:n=`vec4`;break;case 12:n=`vec4`;break;case 6:n=`vec4`;break;case 9:n=`vec4`;break;default:throw RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${t.to}`)}e.compute(ea(e.inputs[0],`Cast`,n,void 0,t.cacheKey,t.to))},ua=e=>{let t,n,r=e.length>=2&&e[1].data!==0,i=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:t=r?e[1].getFloat32Array()[0]:-34028234663852886e22,n=i?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:t=r?e[1].getUint16Array()[0]:64511,n=i?e[2].getUint16Array()[0]:31743;break;default:throw Error(`Unsupport data type`)}return G({min:t,max:n})},da=(e,t)=>{let n=t||ua(e.inputs),r=gr(e.inputs[0].dataType);e.compute(ea(e.inputs[0],`Clip`,e=>`clamp(${e}, vec4<${r}>(uniforms.min), vec4<${r}>(uniforms.max))`,void 0,n.cacheKey,void 0,[{type:e.inputs[0].dataType,data:n.min},{type:e.inputs[0].dataType,data:n.max}],[{name:`min`,type:r},{name:`max`,type:r}]),{inputs:[0]})},fa=e=>{e.compute(ea(e.inputs[0],`Ceil`,`ceil`))},pa=e=>{e.compute(ea(e.inputs[0],`Cos`,`cos`))},ma=e=>{e.compute(ea(e.inputs[0],`Cosh`,`cosh`))},ha=e=>G(e),ga=(e,t)=>{let n=gr(e.inputs[0].dataType);e.compute(ea(e.inputs[0],`Elu`,e=>`elu_vf32(${e})`,` + const elu_alpha_ = ${n}(${t.alpha}); + + fn elu_f32(a: ${n}) -> ${n} { + return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0); + } + + fn elu_vf32(v: vec4<${n}>) -> vec4<${n}> { + return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w)); + }`,t.cacheKey))},_a=(e=`f32`)=>` +const r0: ${e} = 0.3275911; +const r1: ${e} = 0.254829592; +const r2: ${e} = -0.284496736; +const r3: ${e} = 1.421413741; +const r4: ${e} = -1.453152027; +const r5: ${e} = 1.061405429; + +fn erf_vf32(v: vec4<${e}>) -> vec4<${e}> { + let absv = abs(v); + let x = 1.0 / (1.0 + r0 * absv); + return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv)); +}`,va=e=>{let t=gr(e.inputs[0].dataType);e.compute(ea(e.inputs[0],`Erf`,e=>`erf_vf32(${e})`,_a(t)))},ya=e=>{e.compute(ea(e.inputs[0],`Exp`,`exp`))},ba=e=>{e.compute(ea(e.inputs[0],`Floor`,`floor`))},xa=e=>{let t=gr(e.inputs[0].dataType);e.compute(ea(e.inputs[0],`Gelu`,e=>`0.5 * ${e} * (1.0 + erf_vf32(${e} * 0.7071067811865475))`,_a(t)))},Sa=(e,t)=>{let n=gr(e.inputs[0].dataType);e.compute(ea(e.inputs[0],`LeakyRelu`,e=>`select(leaky_relu_alpha_ * ${e}, ${e}, ${e} >= vec4<${n}>(0.0))`,`const leaky_relu_alpha_ = ${n}(${t.alpha});`,t.cacheKey))},Ca=e=>{e.compute(ea(e.inputs[0],`Not`,e=>`!${e}`))},wa=e=>{e.compute(ea(e.inputs[0],`Neg`,e=>`-${e}`))},Ta=e=>{e.compute(ea(e.inputs[0],`Reciprocal`,e=>`1.0/${e}`))},Ea=e=>{let t=gr(e.inputs[0].dataType);e.compute(ea(e.inputs[0],`Relu`,e=>`select(vec4<${t}>(0.0), ${e}, ${e} > vec4<${t}>(0.0))`))},Da=e=>{e.compute(ea(e.inputs[0],`Sigmoid`,e=>`(1.0 / (1.0 + exp(-${e})))`))},Oa=e=>G(e),ka=(e,t)=>{let n=gr(e.inputs[0].dataType);e.compute(ea(e.inputs[0],`HardSigmoid`,e=>`max(vec4<${n}>(0.0), min(vec4<${n}>(1.0), ${t.alpha} * ${e} + vec4<${n}>(${t.beta})))`,void 0,t.cacheKey))},Aa=e=>{e.compute(ea(e.inputs[0],`Sin`,`sin`))},ja=e=>{e.compute(ea(e.inputs[0],`Sinh`,`sinh`))},Ma=e=>{e.compute(ea(e.inputs[0],`Sqrt`,`sqrt`))},Na=e=>{e.compute(ea(e.inputs[0],`Tan`,`tan`))},Pa=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,Fa=e=>{e.compute(ea(e.inputs[0],`Tanh`,Pa))},Ia=(e=`f32`)=>` +const fast_gelu_a: ${e} = 0.5; +const fast_gelu_b: ${e} = 0.7978845608028654; +const fast_gelu_c: ${e} = 0.035677408136300125; + +fn tanh_v(v: vec4<${e}>) -> vec4<${e}> { + return ${Pa(`v`)}; +} +`,La=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,Ra=e=>{let t=gr(e.inputs[0].dataType);e.compute(ea(e.inputs[0],`FastGelu`,La,Ia(t),void 0,e.inputs[0].dataType))},za=(e,t)=>{let n=gr(e.inputs[0].dataType);return e.compute(ea(e.inputs[0],`ThresholdedRelu`,e=>`select(vec4<${n}>(0.0), ${e}, ${e} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${n}>(${t.alpha});`,t.cacheKey)),0},Ba=e=>{e.compute(ea(e.inputs[0],`Log`,`log`))},Va=(e,t)=>` +const alpha = vec4<${e}>(${t}); +const one = ${e}(1.0); +const zero = ${e}(0.0); + +fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { + let v = x *alpha; + var x1 : vec4<${e}>; + for (var i = 0; i < 4; i = i + 1) { + if (v[i] >= zero) { + x1[i] = one / (one + exp(-v[i])); + } else { + x1[i] = one - one / (one + exp(v[i])); + } + } + return x * x1; +} +`,Ha=e=>`quick_gelu_impl(${e})`,Ua=(e,t)=>{let n=gr(e.inputs[0].dataType);e.compute(ea(e.inputs[0],`QuickGelu`,Ha,Va(n,t.alpha),t.cacheKey,e.inputs[0].dataType))}}),Ga,Ka,qa,Ja=L(()=>{"use strict";W(),Z(),Wa(),Ga=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![2560,5120,10240].includes(e[0].dims[2]))throw Error(`hidden state should be 2560, 5120 or 10240`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},Ka=e=>{let t=e[0].dims.slice();t[2]/=2;let n=Y(`input`,e[0].dataType,e[0].dims,4),r=Y(`bias`,e[0].dataType,[e[0].dims[2]],4),i=X(`output`,e[0].dataType,t,4),a=U.size(t)/4,o=hr(e[0].dataType);return{name:`BiasSplitGelu`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)}}),getShaderSource:t=>` + const M_SQRT2 = sqrt(2.0); + const halfChannels = ${e[0].dims[2]/4/2}u; + + ${t.declareVariables(n,r,i)} + + ${_a(o)} + + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(a)} + let biasIdx = global_idx % halfChannels; + let batchIndex = global_idx / halfChannels; + let inputOffset = biasIdx + batchIndex * halfChannels * 2; + let valueLeft = input[inputOffset] + bias[biasIdx]; + let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels]; + let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1); + + ${i.setByOffset(`global_idx`,`valueLeft * geluRight`)} + }`}},qa=e=>{Ga(e.inputs),e.compute(Ka(e.inputs))}}),Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so,co=L(()=>{"use strict";V(),W(),Z(),Ya=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f,p;typeof s==`string`?f=p=(e,t)=>`${s}((${e}),(${t}))`:typeof s==`function`?f=p=s:(f=s.scalar,p=s.vector);let m=X(`outputData`,u,r.length,4),h=Y(`aData`,c,t.length,4),g=Y(`bData`,l,n.length,4),_;if(i)if(a){let e=U.size(t)===1,r=U.size(n)===1,i=t.length>0&&t[t.length-1]%4==0,a=n.length>0&&n[n.length-1]%4==0;_=e||r?m.setByOffset(`global_idx`,p(e?`${h.type.value}(${h.getByOffset(`0`)}.x)`:h.getByOffset(`global_idx`),r?`${g.type.value}(${g.getByOffset(`0`)}.x)`:g.getByOffset(`global_idx`))):` + let outputIndices = ${m.offsetToIndices(`global_idx * 4u`)}; + let offsetA = ${h.broadcastedIndicesToOffset(`outputIndices`,m)}; + let offsetB = ${g.broadcastedIndicesToOffset(`outputIndices`,m)}; + ${m.setByOffset(`global_idx`,p(o||i?h.getByOffset(`offsetA / 4u`):`${h.type.value}(${h.getByOffset(`offsetA / 4u`)}[offsetA % 4u])`,o||a?g.getByOffset(`offsetB / 4u`):`${g.type.value}(${g.getByOffset(`offsetB / 4u`)}[offsetB % 4u])`))} + `}else _=m.setByOffset(`global_idx`,p(h.getByOffset(`global_idx`),g.getByOffset(`global_idx`)));else{if(!a)throw Error(`no necessary to use scalar implementation for element-wise binary op implementation.`);let e=(e,t,n=``)=>{let r=`aData[indexA${t}][componentA${t}]`,i=`bData[indexB${t}][componentB${t}]`;return` + let outputIndices${t} = ${m.offsetToIndices(`global_idx * 4u + ${t}u`)}; + let offsetA${t} = ${h.broadcastedIndicesToOffset(`outputIndices${t}`,m)}; + let offsetB${t} = ${g.broadcastedIndicesToOffset(`outputIndices${t}`,m)}; + let indexA${t} = offsetA${t} / 4u; + let indexB${t} = offsetB${t} / 4u; + let componentA${t} = offsetA${t} % 4u; + let componentB${t} = offsetB${t} % 4u; + ${e}[${t}] = ${n}(${f(r,i)}); + `};_=u===9?` + var data = vec4(0); + ${e(`data`,0,`u32`)} + ${e(`data`,1,`u32`)} + ${e(`data`,2,`u32`)} + ${e(`data`,3,`u32`)} + outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:` + ${e(`outputData[global_idx]`,0)} + ${e(`outputData[global_idx]`,1)} + ${e(`outputData[global_idx]`,2)} + ${e(`outputData[global_idx]`,3)} + `}return` + ${e.registerUniform(`vec_size`,`u32`).declareVariables(h,g,m)} + + ${d??``} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + ${_} + }`},Xa=(e,t,n,r,i,a,o=n.dataType)=>{let s=n.dims.map(e=>Number(e)??1),c=r.dims.map(e=>Number(e)??1),l=!U.areEqual(s,c),u=s,d=U.size(s),f=!1,p=!1,m=[l];if(l){let e=Mn.calcShape(s,c,!1);if(!e)throw Error(`Can't perform binary op on the given tensors`);u=e.slice(),d=U.size(u);let t=U.size(s)===1,n=U.size(c)===1,r=s.length>0&&s[s.length-1]%4==0,i=c.length>0&&c[c.length-1]%4==0;m.push(t),m.push(n),m.push(r),m.push(i);let a=1;for(let e=1;ee.toString()).join(`_`),inputDependencies:[`rank`,`rank`]},getShaderSource:e=>Ya(e,s,c,u,f,l,p,i,n.dataType,r.dataType,o,a),getRunData:()=>({outputs:[{dims:u,dataType:o}],dispatchGroup:{x:Math.ceil(d/64/4)},programUniforms:[{type:12,data:Math.ceil(U.size(u)/4)},...K(s,c,u)]})}},Za=(e,t,n,r,i,a)=>{e.compute(Xa(t,i??``,e.inputs[0],e.inputs[1],n,r,a))},Qa=e=>{Za(e,`Add`,(e,t)=>`${e}+${t}`)},$a=e=>{Za(e,`Div`,(e,t)=>`${e}/${t}`)},eo=e=>{Za(e,`Equal`,{scalar:(e,t)=>`u32(${e}==${t})`,vector:(e,t)=>`vec4(${e}==${t})`},void 0,void 0,9)},to=e=>{Za(e,`Mul`,(e,t)=>`${e}*${t}`)},no=e=>{let t=Y(`input`,e.inputs[0].dataType,e.inputs[0].dims).type.value;Za(e,`Pow`,{scalar:(e,t)=>`pow_custom(${e},${t})`,vector:(e,t)=>`pow_vector_custom(${e},${t})`},` + fn pow_custom(a : ${t}, b : ${t}) -> ${t} { + if (b == ${t}(0.0)) { + return ${t}(1.0); + } else if (a < ${t}(0.0) && f32(b) != floor(f32(b))) { + return ${t}(pow(f32(a), f32(b))); // NaN + } + return select(sign(a), ${t}(1.0), round(f32(abs(b) % ${t}(2.0))) != 1.0) * ${t}(${t===`i32`?`round`:``}(pow(f32(abs(a)), f32(b)))); + } + fn pow_vector_custom(a : vec4<${t}>, b : vec4<${t}>) -> vec4<${t}> { + // TODO: implement vectorized pow + return vec4<${t}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w)); + } + `)},ro=e=>{Za(e,`Sub`,(e,t)=>`${e}-${t}`)},io=e=>{Za(e,`Greater`,{scalar:(e,t)=>`u32(${e}>${t})`,vector:(e,t)=>`vec4(${e}>${t})`},void 0,void 0,9)},ao=e=>{Za(e,`Less`,{scalar:(e,t)=>`u32(${e}<${t})`,vector:(e,t)=>`vec4(${e}<${t})`},void 0,void 0,9)},oo=e=>{Za(e,`GreaterOrEqual`,{scalar:(e,t)=>`u32(${e}>=${t})`,vector:(e,t)=>`vec4(${e}>=${t})`},void 0,void 0,9)},so=e=>{Za(e,`LessOrEqual`,{scalar:(e,t)=>`u32(${e}<=${t})`,vector:(e,t)=>`vec4(${e}<=${t})`},void 0,void 0,9)}}),lo,uo,fo,po,mo,ho,go=L(()=>{"use strict";V(),W(),fr(),Z(),lo=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);let n=0,r=e[n],i=r.dataType,a=r.dims.length;e.forEach((e,o)=>{if(o!==n){if(e.dataType!==i)throw Error(`input tensors should be one type`);if(e.dims.length!==a)throw Error(`input tensors should have the same shape`);e.dims.forEach((e,n)=>{if(n!==t&&e!==r.dims[n])throw Error(`non concat dimensions must match`)})}})},uo=(e,t)=>` + fn calculateInputIndex(index: u32) -> u32 { + let sizeInConcatAxis = array(${t}); + for (var i: u32 = 0u; i < ${e}; i += 1u ) { + if (index < sizeInConcatAxis[i]) { + return i; + } + } + return ${e}u; + }`,fo=(e,t)=>{let n=e.length,r=[];for(let i=0;i{let i=U.size(n),a=Array(e.length),o=Array(e.length),s=0,c=[],l=[],u=[{type:12,data:i}];for(let n=0;n`uniforms.sizeInConcatAxis${e}`).join(`,`),m=t=>` + + ${(()=>{t.registerUniform(`outputSize`,`u32`);for(let n=0;n(${p}); + ${f} -= sizeInConcatAxis[inputIndex - 1u]; + } + + ${fo(o,d)} + }`;return{name:`Concat`,shaderCache:{hint:`${t}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:n,dataType:r}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:u}),getShaderSource:m}},mo=(e,t)=>{let n=e.inputs,r=n[0].dims,i=U.normalizeAxis(t.axis,r.length);lo(n,i);let a=r.slice();a[i]=n.reduce((e,t)=>e+(t.dims.length>i?t.dims[i]:0),0);let o=n.filter(e=>U.size(e.dims)>0);e.compute(po(o,i,a,n[0].dataType),{inputs:o})},ho=e=>G({axis:e.axis})}),_o,vo,yo,bo,xo=L(()=>{"use strict";V(),W(),_o=(e,t,n=`f32`)=>{switch(e.activation){case`Relu`:return`value = max(value, ${t}(0.0));`;case`Sigmoid`:return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case`Clip`:return`value = clamp(value, ${t}(${n}(uniforms.clip_min)), ${t}(${n}(uniforms.clip_max)));`;case`HardSigmoid`:return`value = max(${t}(0.0), min(${t}(1.0), ${n}(uniforms.alpha) * value + ${n}(uniforms.beta)));`;case`LeakyRelu`:return`value = select(${n}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case`Tanh`:return`let e2x = exp(-2.0 * abs(value)); + value = sign(value) * (1.0 - e2x) / (1.0 + e2x); + `;case``:return``;default:throw Error(`Unsupported activation ${e.activation}`)}},vo=(e,t)=>{e.activation===`Clip`?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===`HardSigmoid`?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===`LeakyRelu`&&t.push({type:1,data:e.alpha})},yo=(e,t)=>{e.activation===`Clip`?t.push({name:`clip_max`,type:`f32`},{name:`clip_min`,type:`f32`}):e.activation===`HardSigmoid`?t.push({name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}):e.activation===`LeakyRelu`&&t.push({name:`alpha`,type:`f32`})},bo=e=>{let t=e?.activation||``;if(t===`HardSigmoid`){let[n,r]=e?.activation_params||[.2,.5];return{activation:t,alpha:n,beta:r}}else if(t===`Clip`){let[n,r]=e?.activation_params||[Fn,In];return{activation:t,clipMax:r,clipMin:n}}else if(t===`LeakyRelu`){let[n]=e?.activation_params||[.01];return{activation:t,alpha:n}}return{activation:t}}}),So,Co,wo=L(()=>{"use strict";So=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw Error(`${e}-component is not supported.`)}},Co=e=>` + ${e?`value = value + getBiasByOutputCoords(coords);`:``} + `}),To,Eo=L(()=>{"use strict";To=e=>` +fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 { + return dot(coords, vec4( + shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1)); +} +fn getOutputIndexFromCoords(coords : vec4) -> i32 { + return dot(coords, vec4( + i32(${e}.x), i32(${e}.y), i32(${e}.z), 1)); +} +`}),Do,Oo,ko=L(()=>{"use strict";V(),W(),Z(),xo(),Do=(e,t,n,r,i)=>{let a=r-n;return` + ${Array.from({length:n}).map((n,o)=>` + if (${J(t.shape,o,t.rank)} != 1) { + ${t.indicesSet(e,o,J(i,o+a,r))} + } else { + ${t.indicesSet(e,o,0)} + }`).join(``)} +`},Oo=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o[o.length-2],l=s[s.length-1],u=o[o.length-1],d=_r(l),f=_r(u),p=_r(c),m=U.size(n)/d/p,h=e.length>2,g=r?r.slice(0,-2):n.slice(0,-2),_=[U.size(g),c,l],v=[{type:12,data:m},{type:12,data:c},{type:12,data:l},{type:12,data:u}];vo(t,v),v.push(...K(g,o,s)),h&&v.push(...K(e[2].dims)),v.push(...K(_));let y=r=>{let a=Sr(`batch_dims`,e[0].dataType,g.length),c=Y(`a`,e[0].dataType,o.length,f),l=Y(`b`,e[1].dataType,s.length,d),u=X(`output`,e[0].dataType,_.length,d),m=hr(u.type.tensor),v=_o(t,u.type.value,m),y=[c,l],b=``;if(h){let t=i?d:1;y.push(Y(`bias`,e[2].dataType,e[2].dims.length,t)),b=`${i?`value += bias[col / ${t}];`:`value += ${u.type.value}(bias[row + i]);`}`}let x=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`}];yo(t,x);let S=()=>{let e=`var a_data: ${c.type.value};`;for(let t=0;t; + for (var k: u32 = 0u; k < uniforms.K; k = k + ${f}) { + ${S()} + } + for (var i = 0u; i < ${p}u; i++) { + var value = values[i]; + ${b} + ${v} + let cur_indices = ${u.type.indices}(batch, row + i, col); + let offset = ${u.indicesToOffset(`cur_indices`)}; + ${u.setByOffset(`offset / ${d}`,`value`)}; + } + } + `};return{name:`MatMulNaive`,shaderCache:{hint:`${t.activation};${d};${f};${p};${i}`,inputDependencies:h?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:v}),getShaderSource:y}}}),Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro=L(()=>{"use strict";V(),W(),Z(),xo(),ko(),wo(),Ao=(e,t)=>e?` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + kStart + inputRow, + globalRowStart / innerElementSize + inputCol${t?`, batchIndices`:``}); + `:` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + globalRow + innerRow, + kStart / innerElementSize + inputCol${t?`, batchIndices`:``}); + `,jo=(e,t)=>e?` + let ACached0 = mm_Asub[k * innerElementSize][localRow]; + let ACached1 = mm_Asub[k * innerElementSize + 1][localRow]; + let ACached2 = mm_Asub[k * innerElementSize + 2][localRow]; + ${t===3?``:`let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];`} + for (var i = 0; i < rowPerThread; i = i + 1) { + acc[i] = BCached0 * ACached0[i] + acc[i]; + acc[i] = BCached1 * ACached1[i] + acc[i]; + acc[i] = BCached2 * ACached2[i] + acc[i]; + ${t===3?``:`acc[i] = BCached3 * ACached3[i] + acc[i];`} + }`:` + for (var i = 0; i < rowPerThread; i = i + 1) { + let ACached = mm_Asub[tileRow + i][k]; + acc[i] = BCached0 * ACached.x + acc[i]; + acc[i] = BCached1 * ACached.y + acc[i]; + acc[i] = BCached2 * ACached.z + acc[i]; + ${t===3?``:`acc[i] = BCached3 * ACached.w + acc[i];`} + }`,Mo=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32)=>{let c=t[1]*e[1],l=t[0]*e[0],u=i?c:a,d=i?a:c,f=u/t[0],p=a/t[1];if(!((i&&f===4&&e[1]===4||!i&&(f===3||f===4))&&u%t[0]===0&&a%t[1]===0&&e[0]===4))throw Error(`If transposeA ${i} is true, innerElementSize ${f} and workPerThread[1] ${e[1]} must be 4. + Otherwise, innerElementSize ${f} must be 3 or 4. + tileAWidth ${u} must be divisible by workgroupSize[0]${t[0]}. tileInner ${a} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`);return` +var mm_Asub: array, ${u/f}>, ${d}>; +var mm_Bsub: array, ${l/e[0]}>, ${a}>; + +const rowPerThread = ${e[1]}; +const colPerThread = ${e[0]}; +const innerElementSize = ${f}; +const tileInner = ${a}; + +@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]}) +fn main(@builtin(local_invocation_id) localId : vec3, + @builtin(global_invocation_id) globalId : vec3, + @builtin(workgroup_id) workgroupId : vec3) { + let localRow = i32(localId.y); + let tileRow = localRow * rowPerThread; + let tileCol = i32(localId.x); + + let globalRow =i32(globalId.y) * rowPerThread; + let globalCol = i32(globalId.x); + let batch = ${o?`0`:`i32(globalId.z)`}; + ${r?`let batchIndices = ${r.offsetToIndices(`u32(batch)`)};`:``} + let globalRowStart = i32(workgroupId.y) * ${c}; + + let num_tiles = ${o?`${Math.ceil(s/a)}`:`(uniforms.dim_inner - 1) / tileInner + 1`}; + var kStart = ${o?`i32(globalId.z) * ${s}`:`0`}; + + var acc: array, rowPerThread>; + + // Loop over shared dimension. + let tileRowB = localRow * ${p}; + for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let inputRow = tileRow + innerRow; + let inputCol = tileCol; + ${Ao(i,r)} + } + + // Load one tile of B into local memory. + for (var innerRow = 0; innerRow < ${p}; innerRow = innerRow + 1) { + let inputRow = tileRowB + innerRow; + let inputCol = tileCol; + mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${r?`, batchIndices`:``}); + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + for (var k = 0; k < tileInner / innerElementSize; k = k + 1) { + let BCached0 = mm_Bsub[k * innerElementSize][tileCol]; + let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol]; + let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol]; + ${f===3?``:`let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];`} + + ${jo(i,f)} + } + + workgroupBarrier(); + } + + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); + } +}`},No=(e,t)=>e?` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + kStart + inputRow, + globalRowStart + inputCol${t?`, batchIndices`:``}); + `:` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + globalRowStart + inputRow, + kStart + inputCol${t?`, batchIndices`:``}); + `,Po=e=>e?`let ACached = mm_Asub[k][tileRow + innerRow];`:`let ACached = mm_Asub[tileRow + innerRow][k];`,Fo=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32,c=!1)=>{let l=e[1]*t[1],u=e[0]*t[0],d=i?l:a,f=i?a:l;if(!(f%t[1]===0&&d%t[0]===0&&a%t[1]===0))throw Error(`tileAHight ${f} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${d} must be divisible by workgroupSize[0]${t[0]}, tileInner ${a} must be divisible by workgroupSize[1]${t[1]}`);let p=f/t[1],m=d/t[0],h=a/t[1],g=c?` + let localRow = i32(localId.y); + let localCol = i32(localId.x); + let globalRowStart = i32(workgroupId.y) * ${l}; + let globalColStart = i32(workgroupId.x) * ${u}; + + // Loop over shared dimension. + for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var inputRow = localRow; inputRow < ${f}; inputRow = inputRow + ${t[1]}) { + for (var inputCol = localCol; inputCol < ${d}; inputCol = inputCol + ${t[0]}) { + ${No(i,r)} + } + } + // Load one tile of B into local memory. + for (var inputRow = localRow; inputRow < ${a}; inputRow = inputRow + ${t[1]}) { + for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${t[0]}) { + mm_Bsub[inputRow][inputCol] = mm_readB(batch, + kStart + inputRow, + globalColStart + inputCol${r?`, batchIndices`:``}); + } + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + var BCached : array<${n}, colPerThread>; + for (var k = 0; k < tileInner; k = k + 1) { + for (var inner = 0; inner < colPerThread; inner = inner + 1) { + BCached[inner] = mm_Bsub[k][localCol + inner * ${t[0]}]; + } + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let ACached = ${i?`mm_Asub[k][localRow + innerRow * ${t[1]}];`:`mm_Asub[localRow + innerRow * ${t[1]}][k];`} + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + acc[innerRow][innerCol] = acc[innerRow][innerCol] + + ACached * BCached[innerCol]; + } + } + } + workgroupBarrier(); + } + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let gRow = globalRowStart + localRow + innerRow * ${t[1]}; + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + let gCol = globalColStart + localCol + innerCol * ${t[0]}; + mm_write(batch, gRow, gCol, acc[innerRow][innerCol]); + } + } + `:` +let tileRow = i32(localId.y) * rowPerThread; +let tileCol = i32(localId.x) * colPerThread; + +let globalRow = i32(globalId.y) * rowPerThread; +let globalCol = i32(globalId.x) * colPerThread; +let globalRowStart = i32(workgroupId.y) * ${l}; + +let tileRowA = i32(localId.y) * ${p}; +let tileColA = i32(localId.x) * ${m}; +let tileRowB = i32(localId.y) * ${h}; +// Loop over shared dimension. +for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var innerRow = 0; innerRow < ${p}; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < ${m}; innerCol = innerCol + 1) { + let inputRow = tileRowA + innerRow; + let inputCol = tileColA + innerCol; + ${No(i,r)} + } + } + + // Load one tile of B into local memory. + for (var innerRow = 0; innerRow < ${h}; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + let inputRow = tileRowB + innerRow; + let inputCol = tileCol + innerCol; + mm_Bsub[inputRow][inputCol] = mm_readB(batch, + kStart + inputRow, + globalCol + innerCol${r?`, batchIndices`:``}); + } + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + var BCached : array<${n}, colPerThread>; + for (var k = 0; k < tileInner; k = k + 1) { + for (var inner = 0; inner < colPerThread; inner = inner + 1) { + BCached[inner] = mm_Bsub[k][tileCol + inner]; + } + + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + ${Po(i)} + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol]; + } + } + } + + workgroupBarrier(); +} + +for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + mm_write(batch, globalRow + innerRow, globalCol + innerCol, + acc[innerRow][innerCol]); + } +} +`;return` + var mm_Asub : array, ${f}>; + var mm_Bsub : array, ${a}>; + const rowPerThread = ${e[1]}; + const colPerThread = ${e[0]}; + const tileInner = ${a}; + +@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]}) +fn main(@builtin(local_invocation_id) localId : vec3, + @builtin(global_invocation_id) globalId : vec3, + @builtin(workgroup_id) workgroupId : vec3) { + let batch = ${o?`0`:`i32(globalId.z)`}; + ${r?`let batchIndices = ${r.offsetToIndices(`u32(batch)`)};`:``} + let num_tiles = ${o?`${Math.ceil(s/a)}`:`(uniforms.dim_inner - 1) / tileInner + 1`}; + var kStart = ${o?`i32(globalId.z) * ${s}`:`0`}; + + var acc : array, rowPerThread>; + ${g} + } +`},Io=(e,t,n,r,i=!1)=>{let[a,o,s,c]=r,l=hr(r[0].type.tensor);return` + fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${So(e,l)} { + var value = ${So(e,l)}(0.0); + let col = colIn * ${e}; + if(row < uniforms.dim_a_outer && col < uniforms.dim_inner) + { + var aIndices: ${o.type.indices}; + ${Do(`aIndices`,o,o.rank-2,a.rank,`batchIndices`)} + ${o.indicesSet(`aIndices`,o.rank-2,`u32(row)`)} + ${o.indicesSet(`aIndices`,o.rank-1,`u32(colIn)`)} + value = ${o.getByIndices(`aIndices`)}; + } + return value; + } + + fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${So(e,l)} { + var value = ${So(e,l)}(0.0); + let col = colIn * ${e}; + if(row < uniforms.dim_inner && col < uniforms.dim_b_outer) + { + var bIndices: ${s.type.indices}; + ${Do(`bIndices`,s,s.rank-2,a.rank,`batchIndices`)} + ${s.indicesSet(`bIndices`,s.rank-2,`u32(row)`)} + ${s.indicesSet(`bIndices`,s.rank-1,`u32(colIn)`)} + value = ${s.getByIndices(`bIndices`)}; + } + return value; + } + + fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${So(e,l)}) { + let col = colIn * ${e}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) { + var value = valueIn; + let coords = vec3(batch, row, colIn); + ${t?`value = value + ${i?`bias[colIn]`:`${So(e,l)}(bias[row])`};`:``} + ${n} + ${c.setByIndices(`vec3(coords)`,`value`)} + } + } + `},Lo=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o.slice(0,-2),l=s.slice(0,-2),u=r?r.slice(0,-2):n.slice(0,-2),d=U.size(u),f=o[o.length-2],p=o[o.length-1],m=s[s.length-1],h=p%4==0&&m%4==0,g=f<=8?[4,1,1]:[4,4,1],_=[8,8,1],v=[Math.ceil(m/_[0]/g[0]),Math.ceil(f/_[1]/g[1]),Math.ceil(d/_[2]/g[2])],y=h?4:1,b=[...c,f,p/y],x=b.length,S=[...l,p,m/y],C=S.length,w=[d,f,m/y],T=[{type:6,data:f},{type:6,data:m},{type:6,data:p}];vo(t,T),T.push(...K(u,b,S));let E=[`rank`,`rank`],D=e.length>2;D&&(T.push(...K(e[2].dims)),E.push(`rank`)),T.push(...K(w));let O=n=>{let r=u.length,a=Sr(`batchDims`,e[0].dataType,r,1),o=hr(e[0].dataType),s=Y(`a`,e[0].dataType,x,y),c=Y(`b`,e[1].dataType,C,y),l=X(`result`,e[0].dataType,w.length,y),d=[s,c];if(D){let t=i?y:1;d.push(Y(`bias`,e[2].dataType,e[2].dims.length,t))}let f=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`}];yo(t,f);let p=hr(l.type.tensor),m=_o(t,l.type.value,p),v=Io(y,D,m,[a,s,c,l],i);return` + ${n.registerUniforms(f).registerInternalVariables(a).declareVariables(...d,l)} + ${v} + ${h?Mo(g,_,o,a):Fo(g,_,o,a)} + `};return{name:`MatMul`,shaderCache:{hint:`${g};${t.activation};${h};${i}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:v[0],y:v[1],z:v[2]},programUniforms:T}),getShaderSource:O}}}),zo,Bo,Vo=L(()=>{"use strict";V(),An(),Z(),xo(),wo(),Eo(),Ro(),zo=(e,t,n,r,i=!1,a,o=4,s=4,c=4,l=`f32`)=>{let u=e=>{switch(e){case 1:return`resData = x[xIndex];`;case 3:return`resData = vec3<${l}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return`resData = x[xIndex / 4];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},d=e=>{switch(e){case 1:return`return w[row * i32(uniforms.w_shape[3]) + colIn];`;case 4:return`return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},f=e?` + let coord = vec4(batch, xRow, xCol, xCh); + `:` + let coord = vec4(batch, xCh, xRow, xCol); + `,p=e?` + let coords = vec4( + batch, + row / outWidth, + row % outWidth, + col); + `:` + let coords = vec4( + batch, + row, + col / outWidth, + col % outWidth); + `,m=e?`i32(uniforms.x_shape[1])`:`i32(uniforms.x_shape[2])`,h=e?`i32(uniforms.x_shape[2])`:`i32(uniforms.x_shape[3])`,g=e?`row`:`col`,_=e?`col`:`row`,v=` + let inChannels = i32(uniforms.w_shape[2]); + let outWidth = ${e?`i32(uniforms.result_shape[2])`:`i32(uniforms.result_shape[3])`}; + let outRow = ${g} / outWidth; + let outCol = ${g} % outWidth; + + let WRow = ${_} / (i32(uniforms.w_shape[1]) * inChannels); + let WCol = ${_} / inChannels % i32(uniforms.w_shape[1]); + let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0]; + let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1]; + let xCh = ${_} % inChannels; + var resData = ${So(o,l)}(0.0); + // The bounds checking is always needed since we use it to pad zero for + // the 'same' padding type. + if (xRow >= 0 && xRow < ${m} && xCol >= 0 && xCol < ${h}) { + ${f} + let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape)); + ${u(o)} + } + return resData;`,y=e?t&&r?` + let col = colIn * ${o}; + ${v}`:` + let col = colIn * ${o}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) { + ${v} + } + return ${So(o,l)}(0.0);`:r&&n?` + let col = colIn * ${o}; + ${v}`:` + let col = colIn * ${o}; + if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { + ${v} + } + return ${So(o,l)}(0.0);`,b=e?r&&n?d(s):` + let col = colIn * ${s}; + if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { + ${d(s)} + } + return ${So(s,l)}(0.0);`:` + let col = colIn * ${s}; + if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) { + ${d(s)} + } + return ${So(s,l)}(0.0);`,x=So(c,l),S=So(e?o:s,l),C=So(e?s:o,l),w=_o(a,x,l);return` + fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${S} { + ${e?y:b} + } + + fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${C} { + ${e?b:y} + } + + fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${x}) { + let col = colIn * ${c}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) + { + var value = valueIn; + let outWidth = ${e?`i32(uniforms.result_shape[2])`:`i32(uniforms.result_shape[3])`}; + ${p} + ${Co(i)} + ${w} + setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); + } + }`},Bo=(e,t,n,r,i,a,o,s,c)=>{let l=t.format===`NHWC`,u=l?e[0].dims[3]:e[0].dims[1],d=n[0],f=l?n[2]:n[3],p=l?n[1]:n[2],m=l?n[3]:n[1],h=l&&(u%4==0||u%3==0)&&m%4==0,g=l?m:f*p,_=l?f*p:m,v=[8,8,1],y=r<=8?[4,1,1]:[4,4,1],b=[Math.ceil(g/v[0]/y[0]),Math.ceil(_/v[1]/y[1]),Math.ceil(d/v[2]/y[2])];H(`verbose`,()=>`[conv2d_mm_webgpu] dispatch = ${b}`);let x=h?l&&u%4!=0?3:4:1,S=v[1]*y[1],C=v[0]*y[0],w=Math.max(v[0]*x,v[1]),T=r%S===0,E=i%C===0,D=a%w===0,O=h?[x,4,4]:[1,1,1],ee=[{type:6,data:r},{type:6,data:i},{type:6,data:a},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];vo(t,ee),ee.push(...K(e[0].dims,e[1].dims));let k=[`rank`,`rank`];o&&(ee.push(...K(e[2].dims)),k.push(`rank`)),ee.push(...K(n));let te=r=>{let i=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`},{name:`pad`,type:`i32`,length:2},{name:`stride`,type:`i32`,length:2},{name:`dilation`,type:`i32`,length:2}];yo(t,i);let a=h?4:1,c=hr(e[0].dataType),u=` + fn setOutputAtIndex(flatIndex : i32, value : ${h?`vec4<${c}>`:c}) { + result[flatIndex] = ${h?`vec4<${c}>`:c}(value); + } + fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${h?`vec4<${c}>`:c}) { + let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3)); + setOutputAtIndex(flatIndex ${h?`/ 4`:``}, value); + }`,d=Y(`x`,e[0].dataType,e[0].dims.length,x===3?1:x),f=Y(`w`,e[1].dataType,e[1].dims.length,a),p=[d,f],m=X(`result`,e[0].dataType,n.length,a);if(o){let t=Y(`bias`,e[2].dataType,e[2].dims.length,a);p.push(t),u+=` + fn getBiasByOutputCoords(coords : vec4) -> ${h?`vec4<${c}>`:c} { + return bias[coords.${l?`w`:`y`}${h?`/ 4`:``}]; + }`}return` + ${To(`uniforms.result_strides`)} + //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4, + // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2, + // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 }; + ${r.registerUniforms(i).declareVariables(...p,m)} + ${u} + ${zo(l,T,E,D,o,t,O[0],O[1],O[2],c)} + ${h?Mo(y,v,c,void 0,!l,w):Fo(y,v,c,void 0,!l,w,!1,void 0,s)}`};return{name:`Conv2DMatMul`,shaderCache:{hint:`${t.cacheKey};${x};${h};${T};${E};${D};${S};${C};${w}`,inputDependencies:k},getRunData:()=>({outputs:[{dims:c?c(n):n,dataType:e[0].dataType}],dispatchGroup:{x:b[0],y:b[1],z:b[2]},programUniforms:ee}),getShaderSource:te}}}),Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo=L(()=>{"use strict";V(),An(),W(),Z(),xo(),wo(),Ho=e=>{let t=1;for(let n=0;ntypeof e==`number`?[e,e,e]:e,Wo=(e,t)=>t<=1?e:e+(e-1)*(t-1),Go=(e,t,n,r=1)=>{let i=Wo(t,r);return Math.floor((e[0]*(n-1)-n+i)/2)},Ko=(e,t,n,r,i)=>{i??=Go(e,t[0],r[0]);let a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*i>=t[n]&&(a[n]=Math.trunc((e[n]-t[n]+2*i)/r[n]+1));return a},qo=(e,t,n,r,i,a,o,s,c,l)=>{let u,d,f,p;if(e===`VALID`&&(e=0),typeof e==`number`){u={top:e,bottom:e,left:e,right:e,front:e,back:e};let m=Ko([t,n,r,1],[s,c,l],1,[i,a,o],e);d=m[0],f=m[1],p=m[2]}else if(Array.isArray(e)){if(!e.every((e,t,n)=>e===n[0]))throw Error(`Unsupported padding parameter: ${e}`);u={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let m=Ko([t,n,r,1],[s,c,l],1,[i,a,o],e[0]);d=m[0],f=m[1],p=m[2]}else if(e===`SAME_UPPER`){d=Math.ceil(t/i),f=Math.ceil(n/a),p=Math.ceil(r/o);let e=(d-1)*i+s-t,m=(f-1)*a+c-n,h=(p-1)*o+l-r,g=Math.floor(e/2),_=e-g,v=Math.floor(m/2),y=m-v,b=Math.floor(h/2),x=h-b;u={top:v,bottom:y,left:b,right:x,front:g,back:_}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outDepth:d,outHeight:f,outWidth:p}},Jo=(e,t,n,r,i,a=!1,o=`channelsLast`)=>{let s,c,l,u,d;if(o===`channelsLast`)[s,c,l,u,d]=e;else if(o===`channelsFirst`)[s,d,c,l,u]=e;else throw Error(`Unknown dataFormat ${o}`);let[f,,p,m,h]=t,[g,_,v]=Uo(n),[y,b,x]=Uo(r),S=Wo(p,y),C=Wo(m,b),w=Wo(h,x),{padInfo:T,outDepth:E,outHeight:D,outWidth:O}=qo(i,c,l,u,g,_,v,S,C,w),ee=a?f*d:f,k=[0,0,0,0,0];return o===`channelsFirst`?k=[s,ee,E,D,O]:o===`channelsLast`&&(k=[s,E,D,O,ee]),{batchSize:s,dataFormat:o,inDepth:c,inHeight:l,inWidth:u,inChannels:d,outDepth:E,outHeight:D,outWidth:O,outChannels:ee,padInfo:T,strideDepth:g,strideHeight:_,strideWidth:v,filterDepth:p,filterHeight:m,filterWidth:h,effectiveFilterDepth:S,effectiveFilterHeight:C,effectiveFilterWidth:w,dilationDepth:y,dilationHeight:b,dilationWidth:x,inShape:e,outShape:k,filterShape:t}},Yo=(e,t,n,r,i,a)=>{let o=a===`channelsLast`,s=o?e[0].dims[3]:e[0].dims[1],c=!1,l=[64,1,1],u={x:n.map((e,t)=>t)},d=[Math.ceil(Ho(u.x.map(e=>n[e]))/l[0]),1,1];H(`verbose`,()=>`[conv3d_naive_webgpu] dispatch = ${d}`);let f=c?o&&s%4!=0?3:4:1,p=U.size(n),m=[{type:12,data:p},{type:12,data:r},{type:12,data:i},{type:12,data:t.strides},{type:12,data:t.dilations}];vo(t,m),m.push(...K(e[0].dims,e[1].dims));let h=[`rank`,`rank`],g=e.length===3;g&&(m.push(...K(e[2].dims)),h.push(`rank`)),m.push(...K(n));let _=a=>{let s=[{name:`output_size`,type:`u32`},{name:`filter_dims`,type:`u32`,length:r.length},{name:`pads`,type:`u32`,length:i.length},{name:`strides`,type:`u32`,length:t.strides.length},{name:`dilations`,type:`u32`,length:t.dilations.length}];yo(t,s);let l=c?4:1,u=hr(e[0].dataType),d=Y(`x`,e[0].dataType,e[0].dims.length,f===3?1:f),p=Y(`W`,e[1].dataType,e[1].dims.length,l),m=[d,p],h=X(`result`,e[0].dataType,n.length,l),_=``;if(g){let t=Y(`bias`,e[2].dataType,e[2].dims.length,l);m.push(t),_+=` + fn getBiasByOutputCoords(coords : array) -> ${c?`vec4<${u}>`:u} { + return bias[${o?J(`coords`,4,5):J(`coords`,1,5)}${c?`/ 4`:``}]; + }`}let v=So(f,u),y=_o(t,v,u);return` + ${_} + fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { + let aIndices = array(d0, d1, d2, d3, d4); + return ${d.getByIndices(`aIndices`)}; + } + fn getW(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { + let aIndices = array(d0, d1, d2, d3, d4); + return ${p.getByIndices(`aIndices`)}; + } + ${a.registerUniforms(s).declareVariables(...m,h)} + ${a.mainStart()} + ${a.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let coords = ${h.offsetToIndices(`global_idx`)}; + let batch = ${J(`coords`,0,d.rank)}; + let d2 = ${o?J(`coords`,d.rank-1,d.rank):J(`coords`,1,d.rank)}; + let xFRCCorner = vec3(${o?J(`coords`,1,d.rank):J(`coords`,2,d.rank)}, + ${o?J(`coords`,2,d.rank):J(`coords`,3,d.rank)}, + ${o?J(`coords`,3,d.rank):J(`coords`,4,d.rank)}) * uniforms.strides - uniforms.pads; + let xFCorner = xFRCCorner.x; + let xRCorner = xFRCCorner.y; + let xCCorner = xFRCCorner.z; + let xShapeY = ${o?J(`uniforms.x_shape`,1,d.rank):J(`uniforms.x_shape`,2,d.rank)}; + let xShapeZ = ${o?J(`uniforms.x_shape`,2,d.rank):J(`uniforms.x_shape`,3,d.rank)}; + let xShapeW = ${o?J(`uniforms.x_shape`,3,d.rank):J(`uniforms.x_shape`,4,d.rank)}; + let xShapeU = ${o?J(`uniforms.x_shape`,4,d.rank):J(`uniforms.x_shape`,1,d.rank)}; + let inputDepthNearestVec4 = (xShapeU / 4) * 4; + let inputDepthVec4Remainder = xShapeU % 4; + + var value = 0.0; + for (var wF = 0u; wF < uniforms.filter_dims[0]; wF++) { + let xF = xFCorner + wF * uniforms.dilations[0]; + if (xF < 0 || xF >= xShapeY) { + continue; + } + + for (var wR = 0u; wR < uniforms.filter_dims[1]; wR++) { + let xR = xRCorner + wR * uniforms.dilations[1]; + if (xR < 0 || xR >= xShapeZ) { + continue; + } + + for (var wC = 0u; wC < uniforms.filter_dims[2]; wC++) { + let xC = xCCorner + wC * uniforms.dilations[2]; + if (xC < 0 || xC >= xShapeW) { + continue; + } + + for (var d1 = 0u; d1 < inputDepthNearestVec4; d1 += 4) { + ${o?`let xValues = vec4( + getX(batch, xF, xR, xC, d1), + getX(batch, xF, xR, xC, d1 + 1), + getX(batch, xF, xR, xC, d1 + 2), + getX(batch, xF, xR, xC, d1 + 3)); + `:`let xValues = vec4( + getX(batch, d1, xF, xR, xC), + getX(batch, d1 + 1, xF, xR, xC), + getX(batch, d1 + 2, xF, xR, xC), + getX(batch, d1 + 3, xF, xR, xC)); + `} + let wValues = vec4( + getW(d2, d1, wF, wR, wC), + getW(d2, d1 + 1, wF, wR, wC), + getW(d2, d1 + 2, wF, wR, wC), + getW(d2, d1 + 3, wF, wR, wC)); + value += dot(xValues, wValues); + } + if (inputDepthVec4Remainder == 1) { + ${o?`value += getX(batch, xF, xR, xC, inputDepthNearestVec4) + * getW(d2, inputDepthNearestVec4, wF, wR, wC);`:`value += getX(batch, inputDepthNearestVec4, xF, xR, xC) + * getW(d2, inputDepthNearestVec4, wF, wR, wC);`} + } else if (inputDepthVec4Remainder == 2) { + ${o?`let xValues = vec2( + getX(batch, xF, xR, xC, inputDepthNearestVec4), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)); + `:`let xValues = vec2( + getX(batch, inputDepthNearestVec4, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC)); + `} + let wValues = vec2( + getW(d2, inputDepthNearestVec4, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC)); + value += dot(xValues, wValues); + } else if (inputDepthVec4Remainder == 3) { + ${o?`let xValues = vec3( + getX(batch, xF, xR, xC, inputDepthNearestVec4), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)); + `:`let xValues = vec3( + getX(batch, inputDepthNearestVec4, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 2, xF, xR, xC)); + `} + let wValues = vec3( + getW(d2, inputDepthNearestVec4, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 2, wF, wR, wC)); + value += dot(xValues, wValues); + } + } + } + } + ${g?`value = value + getBiasByOutputCoords(coords)`:``}; + ${y} + result[global_idx] = f32(value); + }`};return{name:`Conv3DNaive`,shaderCache:{hint:`${t.cacheKey};${o};${f};${g}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:d[0],y:d[1],z:d[2]},programUniforms:m}),getShaderSource:_}}}),Zo,Qo,$o=L(()=>{"use strict";V(),W(),Z(),xo(),Zo=(e,t,n,r)=>{let i=e.length>2,a=i?`value += b[output_channel];`:``,o=e[0].dims,s=e[1].dims,c=t.format===`NHWC`,l=c?n[3]:n[1],u=l/t.group,d=c&&u>=4?_r(l):1,f=U.size(n)/d,p=[{type:12,data:f},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:u}];vo(t,p),p.push(...K(o,[s[0],s[1],s[2],s[3]/d]));let m=i?[`rank`,`rank`,`rank`]:[`rank`,`rank`];p.push(...K([n[0],n[1],n[2],n[3]/d]));let h=r=>{let l=X(`output`,e[0].dataType,n.length,d),u=hr(l.type.tensor),f=_o(t,l.type.value,u),p=Y(`x`,e[0].dataType,o.length),m=Y(`w`,e[1].dataType,s.length,d),h=[p,m];i&&h.push(Y(`b`,e[2].dataType,e[2].dims,d));let g=[{name:`output_size`,type:`u32`},{name:`dilations`,type:`u32`,length:t.dilations.length},{name:`strides`,type:`u32`,length:2},{name:`pads`,type:`u32`,length:2},{name:`output_channels_per_group`,type:`u32`}];yo(t,g);let _=c?` + for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) { + let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; + + if (xHeight < 0u || xHeight >= uniforms.x_shape[1]) { + continue; + } + + for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[1]; wWidth++) { + let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; + if (xWidth < 0u || xWidth >= uniforms.x_shape[2]) { + continue; + } + + for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[2]; wInChannel++) { + let input_channel = in_channel_offset + wInChannel; + let xVal = ${p.get(`batch`,`xHeight`,`xWidth`,`input_channel`)}; + let wVal = ${m.get(`wHeight`,`wWidth`,`wInChannel`,`output_channel`)}; + value += xVal * wVal; + } + } + } + `:` + for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) { + let input_channel = in_channel_offset + wInChannel; + for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) { + let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; + + if (xHeight < 0u || xHeight >= uniforms.x_shape[2]) { + continue; + } + + for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) { + let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; + if (xWidth < 0u || xWidth >= uniforms.x_shape[3]) { + continue; + } + + let xVal = ${p.get(`batch`,`input_channel`,`xHeight`,`xWidth`)}; + let wVal = ${m.get(`output_channel`,`wInChannel`,`wHeight`,`wWidth`)}; + value += xVal * wVal; + } + } + } + `;return` + ${r.registerUniforms(g).declareVariables(...h,l)} + + ${r.mainStart()} + ${r.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let outputIndices = ${l.offsetToIndices(`global_idx`)}; + let batch: u32 = outputIndices[0]; + let output_channel: u32 = outputIndices[${c?3:1}]; + let xRCCorner: vec2 = vec2(outputIndices[${c?1:2}], outputIndices[${c?2:3}]) * uniforms.strides - uniforms.pads; + let group_id: u32 = output_channel * ${d} / uniforms.output_channels_per_group; + var in_channel_offset = group_id * uniforms.w_shape[${c?2:1}]; + + var value: ${l.type.value} = ${l.type.value}(0); + ${_} + ${a} + ${f} + ${l.setByOffset(`global_idx`,`value`)} + }`};return{name:`GroupedConv`,shaderCache:{hint:`${t.cacheKey}_${d}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},Qo=(e,t,n,r)=>{let i=e.length>2,a=_r(n[3]),o=_r(n[2]),s=U.size(n)/a/o,c=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/a],l=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/a],u=[n[0],n[1],n[2],n[3]/a],d=[{type:12,data:s},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];vo(t,d),d.push(...K(c,l,u));let f=(o-1)*t.strides[1]+l[1],p=n=>{let r=X(`output`,e[0].dataType,u.length,a),s=hr(r.type.tensor),d=_o(t,r.type.value,s),p=Y(`x`,e[0].dataType,c.length,a),m=Y(`w`,e[1].dataType,l.length,a),h=[p,m];i&&h.push(Y(`b`,e[2].dataType,e[2].dims,a));let g=i?`value += b[output_channel];`:``,_=[{name:`output_size`,type:`u32`},{name:`strides`,type:`i32`,length:2},{name:`pads`,type:`i32`,length:2}];return yo(t,_),` + ${n.registerUniforms(_).declareVariables(...h,r)} + ${n.mainStart()} + ${n.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let width0 = uniforms.output_shape[3]; + let output_channel = global_idx % width0; + var index1 = global_idx / width0; + let width1 = uniforms.output_shape[2] / ${o}u; + let col = (index1 % width1) * ${o}u; + index1 = index1 / width1; + let row = index1 % uniforms.output_shape[1]; + let batch = index1 / uniforms.output_shape[1]; + + let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads; + + var x_vals: array<${p.type.value}, ${f}>; + var values: array<${r.type.value}, ${o}>; + let input_channel = output_channel; + // Use constant instead of uniform can give better performance for w's height/width. + for (var w_height: u32 = 0u; w_height < ${l[0]}; w_height++) { + let x_height = x_corner.x + i32(w_height); + if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) { + for (var i = 0; i < ${f}; i++) { + let x_width = x_corner.y + i; + if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) { + x_vals[i] = ${p.get(`batch`,`u32(x_height)`,`u32(x_width)`,`input_channel`)}; + } else { + x_vals[i] = ${p.type.value}(0); + } + } + for (var w_width: u32 = 0u; w_width < ${l[1]}; w_width++) { + let w_val = ${m.get(`w_height`,`w_width`,`0`,`output_channel`)}; + for (var i = 0u; i < ${o}u; i++) { + values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]); + } + } + } + } + + for (var i = 0u; i < ${o}u; i++) { + var value = values[i]; + ${g} + ${d} + ${r.set(`batch`,`row`,`col + i`,`output_channel`,`value`)}; + } + }`};return{name:`GroupedConv-Vectorize`,shaderCache:{hint:`${t.cacheKey};${a};${o};${f};${l[0]};${l[1]}`,inputDependencies:i?[`rank`,`rank`,`type`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:d}),getShaderSource:p}}}),es,ts,ns,rs,os,ss,cs,ls,us,ds=L(()=>{"use strict";W(),Vo(),Xo(),Ro(),$o(),xo(),ko(),Pr(),es=(e,t,n,r,i,a)=>{let o=e[0],s=e.slice(a?1:2,a?3:4),c=s.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),d=s.map((e,t)=>e+r[t]+r[t+c]).map((e,t)=>Math.floor((e-u[t]+i[t])/i[t]));return d.splice(0,0,o),d.splice(a?3:1,0,l),d},ts=[2,3,1,0],ns=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length>5)throw Error(`greater than 5D is not supported`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[1]*t.group;if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw Error(`invalid bias`);let i=e[0].dims.length-2;if(t.dilations.length!==i)throw Error(`dilations should be ${i}D`);if(t.strides.length!==i)throw Error(`strides should be ${i}D`);if(t.pads.length!==i*2)throw Error(`pads should be ${i*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`)},rs=(e,t)=>{let n=e.kernelShape.slice();n.length{let t=bo(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],i=e.dilations,a=e.group,o=e.kernel_shape,s=e.pads,c=e.strides,l=e.w_is_const();return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},ss=(e,t,n,r)=>{let i=n.format===`NHWC`,a=es(t[0].dims,t[1].dims,n.dilations,n.pads,n.strides,i);if(n.group!==1){let o=[t[0]];if(i){let r=e.kernelCustomData.wT??e.compute(jr(t[1],ts),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),o.push(r)}else o.push(t[1]);t.length===3&&o.push(t[2]),!e.adapterInfo.isArchitecture(`ampere`)&&i&&t[1].dims[0]===n.group&&t[1].dims[1]===1&&n.dilations[0]===1&&n.dilations[1]===1?e.compute(Qo(o,n,a,r),{inputs:o}):e.compute(Zo(o,n,a,r),{inputs:o});return}let o=t.length===3,s=t[0].dims[i?1:2],c=t[0].dims[i?2:3],l=t[0].dims[i?3:1],u=t[1].dims[2],d=t[1].dims[3],f=a[i?1:2],p=a[i?2:3],m=a[i?3:1],h=i&&u===s&&d===c&&n.pads[0]===0&&n.pads[1]===0;if(h||u===1&&d===1&&n.dilations[0]===1&&n.dilations[1]===1&&n.strides[0]===1&&n.strides[1]===1&&n.pads[0]===0&&n.pads[1]===0){let u=a[0],d,g,_,v=[];if(i){let r=e.kernelCustomData.wT??e.compute(jr(t[1],ts),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];if(n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),h){let e=s*c*l;d=t[0].reshape([1,u,e]),g=r.reshape([1,e,m]),_=[1,u,m]}else d=t[0].reshape([u,s*c,l]),g=r.reshape([1,l,m]),_=[u,f*p,m];v.push(d),v.push(g)}else d=t[0].reshape([u,l,s*c]),g=t[1].reshape([1,m,l]),_=[u,m,f*p],v.push(g),v.push(d);o&&v.push(t[2]);let y=_[2],b=v[0].dims[v[0].dims.length-1];y<8&&b<8?e.compute(Oo(v,n,a,_,i,r),{inputs:v}):e.compute(Lo(v,n,a,_,i,r),{inputs:v});return}let g=!0,_=e.kernelCustomData.wT??e.compute(jr(t[1],ts),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=_);let v=[t[0],_];o&&v.push(t[2]);let y=i?f*p:m,b=i?m:f*p,x=u*d*l;e.compute(Bo(v,n,a,y,b,x,o,g,r),{inputs:v})},cs=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=[0,t.pads[0],0,t.pads[1]],a=[1].concat(t.strides),o=[1].concat(t.dilations),s=[1].concat(t.kernelShape),c=rs({...t,pads:i,strides:a,dilations:o,kernelShape:s},r);ss(e,r,c,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},ls=(e,t,n)=>{let r=n.format===`NHWC`?`channelsLast`:`channelsFirst`,i=rs(n,t),a=n.autoPad===`NOTSET`?n.pads:n.autoPad,o=Jo(t[0].dims,t[1].dims,n.strides,n.dilations,a,!1,r);e.compute(Yo(t,i,o.outShape,[o.filterDepth,o.filterHeight,o.filterWidth],[o.padInfo.front,o.padInfo.top,o.padInfo.left],r))},us=(e,t)=>{if(ns(e.inputs,t),e.inputs[0].dims.length===3)cs(e,t);else if(e.inputs[0].dims.length===5)ls(e,e.inputs,t);else{let n=rs(t,e.inputs);ss(e,e.inputs,n)}}}),fs,ps=L(()=>{"use strict";V(),An(),W(),Z(),fs=(e,t,n)=>{let r=e.length>2,i=t.outputShape,a=t.format===`NHWC`,o=t.group,s=e[1].dims,c=s[2]/o,l=s[3],u=a?_r(c):1,d=a&&l===1&&c>=4,f=d?Math.floor(c/4)*4:Math.floor(c/u)*u,p=c-f,m=a?_r(l):1,h=a?l===1?u:m:1,g=U.size(i)/m,_=[Math.ceil(g/64),1,1];H(`verbose`,()=>`[conv2d_backprop_webgpu] dispatch = ${_}`);let v=[`rank`,`rank`],y=[t.strides[0],t.strides[1]],b=[t.kernelShape[a?1:2],t.kernelShape[a?2:3]],x=[t.dilations[0],t.dilations[1]],S=[b[0]+(t.dilations[0]<=1?0:(t.kernelShape[a?1:2]-1)*(t.dilations[0]-1)),b[1]+(t.dilations[1]<=1?0:(t.kernelShape[a?2:3]-1)*(t.dilations[1]-1))],C=[S[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),S[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],w=[{type:12,data:g},{type:12,data:y},{type:12,data:b},{type:12,data:x},{type:12,data:S},{type:6,data:C},{type:12,data:f},{type:12,data:c},{type:12,data:l},...K(e[0].dims,e[1].dims)];r&&(w.push(...K(e[2].dims)),v.push(`rank`)),w.push(...K(i));let T=t=>{let n=[{name:`output_size`,type:`u32`},{name:`strides`,type:`u32`,length:y.length},{name:`filter_dims`,type:`u32`,length:b.length},{name:`dilations`,type:`u32`,length:b.length},{name:`effective_filter_dims`,type:`u32`,length:S.length},{name:`pads`,type:`i32`,length:C.length},{name:`input_channels_per_group_int`,type:`u32`},{name:`input_channels_per_group`,type:`u32`},{name:`output_channels_per_group`,type:`u32`}],o=hr(e[0].dataType),s=a?1:2,c=a?2:3,l=a?3:1,f=Y(`W`,e[1].dataType,e[1].dims.length,h),g=Y(`Dy`,e[0].dataType,e[0].dims.length,u),_=[g,f];r&&_.push(Y(`bias`,e[2].dataType,[i[l]].length,m));let v=X(`result`,e[0].dataType,i.length,m),x=()=>{let e=``;if(d)u===4?e+=` + let xValue = ${g.getByOffset(`x_offset`)}; + let wValue = ${f.getByOffset(`w_offset`)}; + dotProd = dotProd + dot(xValue, wValue); + x_offset += 1u; + w_offset += 1u;`:u===2?e+=` + dotProd = dotProd + dot(vec4<${o}>(${g.getByOffset(`x_offset`)}, ${g.getByOffset(`x_offset + 1u`)}), vec4<${o}>(${f.getByOffset(`w_offset`)}, ${f.getByOffset(`w_offset + 1u`)})); + x_offset += 2u; + w_offset += 2u;`:u===1&&(e+=` + dotProd = dotProd + dot(vec4<${o}>(${g.getByOffset(`x_offset`)}, ${g.getByOffset(`x_offset + 1u`)}, ${g.getByOffset(`x_offset + 2u`)}, ${g.getByOffset(`x_offset + 3u`)}), vec4<${o}>(${f.getByOffset(`w_offset`)}, ${f.getByOffset(`w_offset + 1u`)}, ${f.getByOffset(`w_offset + 2u`)}, ${f.getByOffset(`w_offset + 3u`)})); + x_offset += 4u; + w_offset += 4u;`);else if(e+=` + let xValue = ${a?g.getByOffset(`${g.indicesToOffset(`${g.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${u}`):g.get(`batch`,`inputChannel`,`idyR`,`idyC`)}; + `,u===1)e+=` + let w_offset = ${f.indicesToOffset(`${f.type.indices}(u32(wRPerm), u32(wCPerm), inputChannel, wOutChannel)`)}; + let wValue = ${f.getByOffset(`w_offset / ${h}`)}; + dotProd = dotProd + xValue * wValue;`;else for(let t=0;t{if(p===0)return``;if(!d)throw Error(`packInputAs4 ${d} is not true.`);let e=``;if(u===1){e+=`dotProd = dotProd`;for(let t=0;t(i32(r), i32(c)) - uniforms.pads; + let dyRCorner = dyCorner.x; + let dyCCorner = dyCorner.y; + let groupId = d1 / uniforms.output_channels_per_group; + let wOutChannel = d1 - groupId * uniforms.output_channels_per_group; + // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). + // ? = to be determined. : = across all values in that axis. + var dotProd = ${v.type.value}(0.0); + var wR: u32 = 0; + if (uniforms.dilations.x == 1) { + // Minimum wR >= 0 that satisfies (dyRCorner + wR) % (uniforms.strides.x) == 0 + wR = u32(((dyRCorner + i32(uniforms.strides.x) - 1) / i32(uniforms.strides.x)) * i32(uniforms.strides.x) - dyRCorner); + } + for (; wR < uniforms.effective_filter_dims.x; wR = wR + 1) { + if (wR % uniforms.dilations.x != 0) { + continue; + } + let dyR = (${o}(dyRCorner) + ${o}(wR)) / ${o}(uniforms.strides[0]); + let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x; + if (dyR < 0.0 || dyR >= ${o}(uniforms.Dy_shape[${s}]) || fract(dyR) > 0.0 || + wRPerm < 0) { + continue; + } + let idyR: u32 = u32(dyR); + var wC: u32 = 0; + if (uniforms.dilations.y == 1) { + // Minimum wC >= 0 that satisfies (dyCCorner + wC) % (uniforms.strides.y) == 0 + wC = u32(((dyCCorner + i32(uniforms.strides.y) - 1) / i32(uniforms.strides.y)) * i32(uniforms.strides.y) - dyCCorner); + } + for (; wC < uniforms.effective_filter_dims.y; wC = wC + 1) { + if (wC % uniforms.dilations.y != 0) { + continue; + } + let dyC = (${o}(dyCCorner) + ${o}(wC)) / ${o}(uniforms.strides.y); + let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y; + if (dyC < 0.0 || dyC >= ${o}(uniforms.Dy_shape[${c}]) || + fract(dyC) > 0.0 || wCPerm < 0) { + continue; + } + let idyC: u32 = u32(dyC); + var inputChannel = groupId * uniforms.input_channels_per_group; + ${d?` + var x_offset = ${g.indicesToOffset(`${g.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${u}; + var w_offset = ${f.indicesToOffset(`${f.type.indices}(wRPerm, wCPerm, inputChannel, wOutChannel)`)} / ${h}; + `:``} + for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group_int; d2 = d2 + ${d?4:u}) { + ${x()} + inputChannel = inputChannel + ${d?4:u}; + } + ${w()} + wC = wC + uniforms.strides.y - 1; + } + wR = wR + uniforms.strides[0] - 1; + } + let value = dotProd${r?` + bias[d1 / ${m}]`:``}; + ${v.setByOffset(`global_idx`,`value`)}; + `;return` + ${t.registerUniforms(n).declareVariables(..._,v)} + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)}; + ${T}}`};return{name:`ConvTranspose2D`,shaderCache:{hint:`${t.cacheKey};${u}${h}${m}${d}${p}`,inputDependencies:v},getRunData:()=>({dispatchGroup:{x:_[0],y:_[1],z:_[2]},outputs:[{dims:n?n(i):i,dataType:e[0].dataType}],programUniforms:w}),getShaderSource:T}}}),ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs=L(()=>{"use strict";ps(),xo(),Pr(),ms=(e,t,n,r,i,a)=>(e-1)*t+n+(r-1)*i+1-a,hs=(e,t,n,r,i)=>{let a=Math.floor(e/2);t===`SAME_UPPER`?(n[r]=a,n[i]=e-a):t===`SAME_LOWER`&&(n[r]=e-a,n[i]=a)},gs=(e,t,n,r,i,a,o,s,c,l)=>{let u=e.length-2,d=l.length===0;c.length{let n=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((e,t)=>e*t,1)===0){n.length=0;for(let e=2;ee+t,0)===0){let e=t[0].dims.length-2;c=Array(e).fill(1)}let l=e.strides.slice();if(l.reduce((e,t)=>e+t,0)===0){let e=t[0].dims.length-2;l=Array(e).fill(1)}gs(s,n,c,e.autoPad,e.group,i,l,r,o,a);let u=Object.assign({},e);return Object.assign(u,{kernelShape:n,pads:i,outputPadding:o,outputShape:a,dilations:c,strides:l}),u},vs=e=>{let t=bo(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][typeof e.autoPad>`u`?0:e.autoPad],i=e.dilations,a=e.group,o=e.kernelShape,s=e.pads,c=e.strides,l=e.wIsConst(),u=e.outputPadding,d=e.outputShape;return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,outputPadding:u,outputShape:d,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},ys=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length!==4&&e[0].dims.length!==3)throw Error(`currently only support 2-dimensional conv`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[0];if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);let i=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==i))throw Error(`invalid bias`);let a=e[0].dims.length-2;if(t.dilations.reduce((e,t)=>e+t,0)>0&&t.dilations.length!==a)throw Error(`dilations should be ${a}D`);if(t.strides.reduce((e,t)=>e+t,0)>0&&t.strides.length!==a)throw Error(`strides should be ${a}D`);if(t.pads.reduce((e,t)=>e+t,0)>0&&t.pads.length!==a*2)throw Error(`pads should be ${a*2}D`);if(t.outputPadding.length!==a&&t.outputPadding.length!==0)throw Error(`output_padding should be ${a}D`);if(t.kernelShape.reduce((e,t)=>e+t,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`);if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw Error(`invalid output shape`)},bs=(e,t,n,r)=>{let i=e.kernelCustomData.wT??e.compute(jr(t[1],[2,3,0,1]),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=i);let a=[t[0],i];t.length===3&&a.push(t[2]),e.compute(fs(a,n,r),{inputs:a})},xs=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=t.kernelShape;(i.length===0||i[0]===0)&&(i=[e.inputs[1].dims[2]]);let a=t.dilations;(a.length===0||a[0]===0)&&(a=[1]);let o=t.strides;(o.length===0||o[0]===0)&&(o=[1]);let s=t.pads;s.length===0&&(s=[0,0]),s=[0,s[0],0,s[1]],o=[1].concat(o),a=[1].concat(a),i=[1].concat(i);let c=t.outputPadding;c=[0].concat(c);let l=_s({...t,pads:s,strides:o,dilations:a,kernelShape:i,outputPadding:c},r);bs(e,r,l,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},Ss=(e,t)=>{if(ys(e.inputs,t),e.inputs[0].dims.length===3)xs(e,t);else{let n=_s(t,e.inputs);bs(e,e.inputs,n)}}}),ws,Ts,Es,Ds=L(()=>{"use strict";V(),W(),fr(),Z(),ws=(e,t,n,r)=>{let i=U.size(t),a=t.length,o=Y(`input`,e,a),s=X(`output`,e,a),c=n.dataType===6?n.getInt32Array()[0]:Number(n.getBigInt64Array()[0]),l=U.normalizeAxis(c,a),u=e=>{let t=` i32(${o.indicesGet(`inputIndices`,`uniforms.axis`)}) `,n=J(`uniforms.input_shape`,`uniforms.axis`,a),i=r.reverse?t+(r.exclusive?` + 1`:``):`0`,c=r.reverse?n:t+(r.exclusive?``:` + 1`);return` + ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axis`,`u32`).declareVariables(o,s)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + var inputIndices = ${s.offsetToIndices(`global_idx`)}; + var sum = ${s.type.value}(0); + let first : i32 = ${i}; + let last : i32 = ${c}; + for (var i : i32 = first; i < last; i++) { + ${o.indicesSet(`inputIndices`,`uniforms.axis`,`u32(i)`)}; + sum = sum + ${o.getByIndices(`inputIndices`)}; + } + ${s.setByOffset(`global_idx`,`sum`)}; + }`};return{name:`CumSum`,shaderCache:{hint:r.cacheKey,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:[{type:12,data:i},{type:12,data:l},...K(t,t)]}),getShaderSource:u}},Ts=(e,t)=>{let n=e.inputs[0].dims,r=e.inputs[0].dataType,i=e.inputs[1];e.compute(ws(r,n,i,t),{inputs:[0]})},Es=e=>{let t=e.exclusive===1,n=e.reverse===1;return G({exclusive:t,reverse:n})}}),Os,ks,As,js,Ms,Ns=L(()=>{"use strict";V(),W(),fr(),Z(),Os=e=>{if(!e||e.length!==1)throw Error(`DepthToSpace requires 1 input.`);if(e[0].dims.length!==4)throw Error(`DepthToSpace requires 4D input.`)},ks=(e,t,n,r)=>{let i=[];i.push(`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + var a: ${n.type.indices};`);for(let r=0;r{let n,r,i,a,o,s,c=t.format===`NHWC`,l=t.blocksize,u=t.mode===`DCR`;c?([n,r,i,a]=e.dims,o=u?[n,r,i,l,l,a/l**2]:[n,r,i,a/l**2,l,l],s=u?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([n,r,i,a]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],o=u?[n,l,l,a/l**2,r,i]:[n,a/l**2,l,l,r,i],s=u?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let d=e.reshape(o),f=d.dims.length,p=e.dataType,m=Y(`a`,p,f),h=X(`output`,p,f),g=e=>` + ${e.registerUniform(`output_size`,`u32`).declareVariables(m,h)} + + ${ks(s,f,m,h)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let indices = ${h.offsetToIndices(`global_idx`)}; + let aIndices = perm(indices); + + ${h.setByOffset(`global_idx`,m.getByIndices(`aIndices`))} + }`;return{name:`DepthToSpace`,shaderCache:{hint:`${e.dims};${t.blocksize};${t.mode}`,inputDependencies:[`rank`]},getRunData:e=>{let t=c?[n,r*l,i*l,a/l**2]:[n,a/l**2,r*l,i*l],o=U.size(t),u=d.dims,f=U.sortBasedOnPerm(u,s);return{outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:[{type:12,data:o},...K(u,f)]}},getShaderSource:g}},js=(e,t)=>{Os(e.inputs),e.compute(As(e.inputs[0],t))},Ms=e=>G({blocksize:e.blocksize,mode:e.mode,format:e.format})}),Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs=L(()=>{"use strict";V(),W(),fr(),Z(),Ps=`[a-zA-Z]|\\.\\.\\.`,Fs=`(`+Ps+`)+`,Is=`^`+Fs+`$`,Ls=`(`+Fs+`,)*`+Fs,Rs=`^`+Ls+`$`,zs=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,t){let n=this.symbolToIndices.get(e);n===void 0?n=[t]:n.push(t),this.symbolToIndices.set(e,n)}},Bs=class{constructor(e,t){var n;this.equation=t,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=[],this.outputDims=[];let[r,i]=t.includes(`->`)?t.split(`->`,2):[t,``];if(!r.match(RegExp(Rs)))throw Error(`Invalid LHS term`);if(r.split(`,`).forEach((t,n)=>{let r=e[n].dims.slice();if(!t.match(RegExp(Is)))throw Error(`Invalid LHS term`);let i=this.processTerm(t,!0,r,n);this.lhs.push(i)}),i===``)i+=[...this.symbolToInfo.entries()].filter(([e,t])=>t.count===1||e===`...`).map(([e])=>e).join(``);else if(!i.match(RegExp(Fs)))throw Error(`Invalid RHS`);(n=i.match(RegExp(Ps,`g`)))?.forEach(e=>{if(e===`...`)this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let t=this.symbolToInfo.get(e);if(t===void 0)throw Error(`Invalid RHS symbol`);this.outputDims.push(t.dimValue)}}),this.rhs=this.processTerm(i,!1,this.outputDims)}addSymbol(e,t,n){let r=this.symbolToInfo.get(e);if(r!==void 0){if(r.dimValue!==t&&r.count!==1)throw Error(`Dimension mismatch`);r.count++,r.inputIndices.push(n)}else r={count:1,dimValue:t,inputIndices:[n]};this.symbolToInfo.set(e,r)}processTerm(e,t,n,r=-1){let i=n.length,a=!1,o=[],s=0;if(!e.match(RegExp(Is))&&!t&&e!==``)throw Error(`Invalid LHS term`);let c=e.match(RegExp(Ps,`g`)),l=new zs(r);return c?.forEach((e,u)=>{if(e===`...`){if(a)throw Error(`Only one ellipsis is allowed per input term`);a=!0;let e=i-c.length+1;if(e<0)throw Error(`Ellipsis out of bounds`);if(o=n.slice(s,s+e),this.hasEllipsis){if(this.ellipsisDims.length!==o.length||this.ellipsisDims.toString()!==o.toString())throw Error(`Ellipsis dimensions mismatch`)}else if(t)this.hasEllipsis=!0,this.ellipsisDims=o;else throw Error(`Ellipsis must be specified in the LHS`);for(let e=0;ee+`_max`,Hs=(e,t,n,r)=>{let i=e.map(e=>e.length).map((e,n)=>Y(`input${n}`,t,e)),a=U.size(r),o=X(`output`,t,r.length),s=[...n.symbolToInfo.keys()].filter(e=>!n.rhs.symbolToIndices.has(e)),c=e=>{let t=[],r=`var prod = 1.0;`,a=`var sum = 0.0;`,c=`sum += prod;`,l=[],u=[],d=[],f=[],p=n.symbolToInfo.size===n.rhs.symbolToIndices.size;n.symbolToInfo.forEach((e,r)=>{if(n.rhs.symbolToIndices.has(r)){var a;let s=(a=n.rhs.symbolToIndices.get(r))?.[0];s!==void 0&&n.lhs.forEach((n,a)=>{if(e.inputIndices.includes(a)){let e=n.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{t.push(`${i[a].indicesSet(`input${a}Indices`,e,o.indicesGet(`outputIndices`,s))}`)})}})}else n.lhs.forEach((t,n)=>{if(e.inputIndices.includes(n)){let e=t.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{l.push(`${i[n].indicesSet(`input${n}Indices`,e,`${r}`)}`)}),f.push(`prod *= ${i[n].getByIndices(`input${n}Indices`)};`)}}),u.push(`for(var ${r}: u32 = 0; ${r} < uniforms.${Vs(r)}; ${r}++) {`),d.push(`}`)});let m=p?[...t,`let sum = ${i.map((e,t)=>e.getByIndices(`input${t}Indices`)).join(` * `)};`]:[...t,a,...u,...l,r,...f,c,...d];return` + ${e.registerUniforms(s.map(e=>({name:`${Vs(e)}`,type:`u32`}))).registerUniform(`outputSize`,`u32`).declareVariables(...i,o)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + var outputIndices = ${o.offsetToIndices(`global_idx`)}; + ${i.map((e,t)=>`var input${t}Indices: ${i[t].type.indices};`).join(` +`)} + ${m.join(` +`)}; + ${o.setByOffset(`global_idx`,`sum`)}; + }`};return{name:`Einsum`,shaderCache:{hint:n.equation,inputDependencies:e.map(()=>`rank`)},getRunData:()=>{let i=s.filter(e=>n.symbolToInfo.has(e)).map(e=>{var t;return{type:12,data:(t=n.symbolToInfo.get(e))?.dimValue||0}});i.push({type:12,data:a});let o=e.map((e,t)=>[...K(e)]).reduce((e,t)=>e.concat(t),i);return o.push(...K(r)),{outputs:[{dims:r,dataType:t}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:o}},getShaderSource:c}},Us=(e,t)=>{let n=new Bs(e.inputs,t.equation),r=n.outputDims,i=e.inputs.map((e,t)=>e.dims);e.compute(Hs(i,e.inputs[0].dataType,n,r))},Ws=e=>{let t=e.equation.replace(/\s+/g,``);return G({equation:t})}}),Ks,qs,Js,Ys,Xs,Zs=L(()=>{"use strict";V(),W(),Z(),Ks=e=>{if(!e||e.length!==2)throw Error(`Expand requires 2 input.`);let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=n.length{let n=e.length-t.length,r=[];for(let t=0;te.length>t.length?qs(e,t):qs(t,e),Ys=e=>{let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=Js(t,n),i=e[0].dataType,a=i===9||U.size(t)===1,o=i===9||t.length>0&&t[t.length-1]%4==0?4:1,s=a||r.length>0&&r[r.length-1]%4==0?4:1,c=Math.ceil(U.size(r)/s),l=e=>{let n=Y(`input`,i,t.length,o),a=X(`output`,i,r.length,s),c;if(i===9){let e=(e,t,r=``)=>` + let outputIndices${t} = ${a.offsetToIndices(`outputOffset + ${t}u`)}; + let offset${t} = ${n.broadcastedIndicesToOffset(`outputIndices${t}`,a)}; + let index${t} = offset${t} / 4u; + let component${t} = offset${t} % 4u; + ${e}[${t}] = ${r}(${n.getByOffset(`index${t}`)}[component${t}]); + `;c=` + let outputOffset = global_idx * ${s}; + var data = vec4(0); + ${e(`data`,0,`u32`)} + ${e(`data`,1,`u32`)} + ${e(`data`,2,`u32`)} + ${e(`data`,3,`u32`)} + ${a.setByOffset(`global_idx`,`data`)} + }`}else c=` + let outputIndices = ${a.offsetToIndices(`global_idx * ${s}`)}; + let inputOffset = ${n.broadcastedIndicesToOffset(`outputIndices`,a)}; + let data = ${a.type.value}(${n.getByOffset(`inputOffset / ${o}`)}); + ${a.setByOffset(`global_idx`,`data`)} + }`;return` + ${e.registerUniform(`vec_size`,`u32`).declareVariables(n,a)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + ${c}`},u=[{type:12,data:c},...K(t,r)];return{name:`Expand`,shaderCache:{hint:`${r.length};${o}${s}`,inputDependencies:[`rank`]},getShaderSource:l,getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:u})}},Xs=e=>{Ks(e.inputs),e.compute(Ys(e.inputs),{inputs:[0]})}}),Qs,$s,ec=L(()=>{"use strict";V(),W(),Z(),Wa(),Qs=e=>{let t=e[0].dataType,n=U.size(e[0].dims),r=U.size(e[1].dims),i=r%4==0,a=e=>{let n=Y(`x`,t,[1],4),r=Y(`bias`,t,[1],4),a=X(`y`,t,[1],4),o=[{name:`output_vec_size`,type:`u32`},{name:`bias_size`,type:`u32`}],s=e=>` + let bias${e}_offset: u32 = (global_idx * 4 + ${e}) % uniforms.bias_size; + let bias${e} = ${r.getByOffset(`bias${e}_offset / 4`)}[bias${e}_offset % 4];`,c=i?` + let bias = ${r.getByOffset(`global_idx % (uniforms.bias_size / 4)`)};`:`${s(0)}${s(1)}${s(2)}${s(3)} + let bias = ${n.type.value}(bias0, bias1, bias2, bias3);`;return`${e.registerUniforms(o).declareVariables(n,r,a)} + + ${Ia(gr(t))} + + ${e.mainStart(pr)} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_vec_size`)} + + let x = ${n.getByOffset(`global_idx`)}; + ${c} + let x_in = x + bias; + ${a.setByOffset(`global_idx`,La(`x_in`))} + }`};return{name:`FastGeluWithBias`,shaderCache:{hint:`${i}`,inputDependencies:[`type`,`type`]},getShaderSource:a,getRunData:e=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],programUniforms:[{type:12,data:Math.ceil(n/4)},{type:12,data:r}],dispatchGroup:{x:Math.ceil(n/pr/4)}})}},$s=e=>{e.inputs.length<2||U.size(e.inputs[1].dims)===0?Ra(e):e.compute(Qs(e.inputs))}}),tc,nc,rc,ic,ac=L(()=>{"use strict";V(),W(),fr(),Z(),tc=e=>{if(!e||e.length!==2)throw Error(`Gather requires 2 inputs.`)},nc=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=U.normalizeAxis(t.axis,i),o=n.slice(0);o.splice(a,1,...r);let s=n[a],c=e[0].dataType===9?4:1,l=Math.ceil(U.size(o)/c),u=[{type:12,data:l},{type:6,data:s},{type:12,data:a},...K(e[0].dims,e[1].dims,o)],d=t=>{let n=Y(`data`,e[0].dataType,e[0].dims.length,c),s=Y(`inputIndices`,e[1].dataType,e[1].dims.length),l=X(`output`,e[0].dataType,o.length,c),u=e=>{let t=r.length,c=`var indicesIndices${e} = ${s.type.indices}(0);`;for(let n=0;n1?`indicesIndices${e}[${n}]`:`indicesIndices${e}`} = ${o.length>1?`outputIndices${e}[uniforms.axis + ${n}]`:`outputIndices${e}`};`;c+=` + var idx${e} = ${s.getByIndices(`indicesIndices${e}`)}; + if (idx${e} < 0) { + idx${e} = idx${e} + uniforms.axisDimLimit; + } + var dataIndices${e} : ${n.type.indices}; + `;for(let n=0,r=0;n1?`dataIndices${e}[${n}]`:`dataIndices${e}`} = u32(idx${e});`,r+=t):(c+=`${i>1?`dataIndices${e}[${n}]`:`dataIndices${e}`} = ${o.length>1?`outputIndices${e}[${r}]`:`outputIndices${e}`};`,r++);return c},d;if(e[0].dataType===9){let e=(e,t,r=``)=>` + let outputIndices${t} = ${l.offsetToIndices(`outputOffset + ${t}u`)}; + ${u(t)}; + let offset${t} = ${n.indicesToOffset(`dataIndices${t}`)}; + let index${t} = offset${t} / 4u; + let component${t} = offset${t} % 4u; + ${e}[${t}] = ${r}(${n.getByOffset(`index${t}`)}[component${t}]); + `;d=` + let outputOffset = global_idx * ${c}; + var value = vec4(0); + ${e(`value`,0,`u32`)} + ${e(`value`,1,`u32`)} + ${e(`value`,2,`u32`)} + ${e(`value`,3,`u32`)} + ${l.setByOffset(`global_idx`,`value`)} + `}else d=` + let outputIndices = ${l.offsetToIndices(`global_idx`)}; + ${u(``)}; + let value = ${n.getByIndices(`dataIndices`)}; + ${l.setByOffset(`global_idx`,`value`)}; + `;return` + ${t.registerUniform(`outputSize`,`u32`).registerUniform(`axisDimLimit`,`i32`).registerUniform(`axis`,`u32`).declareVariables(n,s,l)} + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + ${d} + }`};return{name:`Gather`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:d}},rc=e=>G({axis:e.axis}),ic=(e,t)=>{let n=e.inputs;tc(n),e.compute(nc(e.inputs,t))}}),oc,sc,cc,lc=L(()=>{"use strict";V(),W(),Z(),oc=(e,t,n,r,i,a,o,s,c)=>{let l=[{type:12,data:a},{type:12,data:r},{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:12,data:s},{type:12,data:c}],u=[a];l.push(...K(t.dims,u));let d=e=>{let r=Y(`indices_data`,t.dataType,t.dims.length),a=X(`input_slice_offsets_data`,12,1,1),o=[r,a],s=[{name:`output_size`,type:`u32`},{name:`batch_dims`,type:`u32`},{name:`input_dims`,type:`u32`,length:i.length},{name:`sizes_from_slice_dims_data`,type:`u32`,length:n.length},{name:`num_slices_per_batch`,type:`u32`},{name:`input_batch_stride`,type:`u32`},{name:`num_slice_dims`,type:`u32`}];return` + ${e.registerUniforms(s).declareVariables(...o)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let batch_idx = global_idx / uniforms.num_slices_per_batch; + let base_offset = batch_idx * uniforms.input_batch_stride; + + let slice_indices_base_offset = global_idx * uniforms.num_slice_dims; + var relative_slice_offset = 0; + for (var dim_idx = 0u; dim_idx < uniforms.num_slice_dims; dim_idx ++) { + var index = i32(indices_data[dim_idx + slice_indices_base_offset].x); + let input_dim_idx = uniforms.batch_dims + dim_idx; + if (index < 0) { + ${i.length===1?`index += i32(uniforms.input_dims);`:`index += i32(uniforms.input_dims[input_dim_idx]);`} + } + ${n.length===1?`relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data);`:`relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data[dim_idx]);`} + } + + input_slice_offsets_data[global_idx] = base_offset + u32(relative_slice_offset); + }`};return e.compute({name:`computeSliceOffsets`,shaderCache:{hint:`${i.length}_${n.length}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:u,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:d},{inputs:[t],outputs:[-1]})[0]},sc=(e,t)=>{let n=e.inputs,r=n[0].dims,i=n[0].dataType,a=n[1].dims,o=a[a.length-1],s=U.sizeToDimension(a,a.length-1),c=U.sizeFromDimension(r,t.batchDims+o),l=U.sizeToDimension(r,t.batchDims),u=U.sizeFromDimension(r,t.batchDims),d=s/l,f=Array(o),p=c;for(let e=0;er.length)throw Error(`last dimension of indices must not be larger than rank of input tensor`);let g=a.slice(0,-1).concat(r.slice(h)),_=U.size(g),v=[{type:12,data:_},{type:12,data:c},...K(n[0].dims,m.dims,g)],y=e=>{let t=Y(`data`,n[0].dataType,n[0].dims.length),r=Y(`slice_offsets`,12,m.dims.length),i=X(`output`,n[0].dataType,g.length);return` + ${e.registerUniform(`output_size`,`u32`).registerUniform(`slice_size`,`u32`).declareVariables(t,r,i)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let slice_offset = slice_offsets[global_idx / uniforms.slice_size]; + output[global_idx] = data[u32(slice_offset) + global_idx % uniforms.slice_size]; + }`};e.compute({name:`GatherND`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:g,dataType:i}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:v}),getShaderSource:y},{inputs:[n[0],m]})},cc=e=>({batchDims:e.batch_dims,cacheKey:``})}),uc,dc,fc,pc,mc=L(()=>{"use strict";V(),W(),fr(),Z(),uc=(e,t)=>{if(e.length<3||e.length>4)throw Error(`GatherBlockQuantized requires 3 or 4 inputs.`);let n=U.normalizeAxis(t.quantizeAxis,e[0].dims.length),r=t.blockSize,i=e[0],a=e[2],o=e.length===4?e[3]:void 0;if(a.dims.length!==i.dims.length||!i.dims.map((e,t)=>t===n?Math.ceil(e/r)===a.dims[t]:e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.`);if(o){if(o.dataType!==i.dataType)throw Error(`Zero point must have the same data type as the input tensor.`);if(o.dims.length!==a.dims.length||!o.dims.map((e,t)=>e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.`)}},dc=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=U.normalizeAxis(t.gatherAxis,i),o=U.normalizeAxis(t.quantizeAxis,i),s=n.slice(0);s.splice(a,1,...r);let c=U.size(s),l=e[2].dataType,u=e[0].dataType===22,d=[{type:12,data:c},{type:12,data:o},{type:12,data:a},{type:12,data:t.blockSize},...K(...e.map((e,t)=>e.dims),s)],f=t=>{let i=Y(`data`,e[0].dataType,e[0].dims.length),o=Y(`inputIndices`,e[1].dataType,e[1].dims.length),c=Y(`scales`,e[2].dataType,e[2].dims.length),d=e.length>3?Y(`zeroPoint`,e[3].dataType,e[3].dims.length):void 0,f=X(`output`,l,s.length),p=[i,o,c];d&&p.push(d);let m=[{name:`output_size`,type:`u32`},{name:`quantize_axis`,type:`u32`},{name:`gather_axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` + ${t.registerUniforms(m).declareVariables(...p,f)} + ${t.mainStart()} + let output_indices = ${f.offsetToIndices(`global_idx`)}; + var indices_indices = ${o.type.indices}(0); + ${r.length>1?` + for (var i: u32 = 0; i < ${r.length}; i++) { + let index = ${f.indicesGet(`output_indices`,`uniforms.gather_axis + i`)}; + ${o.indicesSet(`indices_indices`,`i`,`index`)}; + }`:`indices_indices = ${f.indicesGet(`output_indices`,`uniforms.gather_axis`)};`}; + var data_indices = ${i.type.indices}(0); + for (var i: u32 = 0; i < uniforms.gather_axis; i++) { + let index = ${f.indicesGet(`output_indices`,`i`)}; + ${i.indicesSet(`data_indices`,`i`,`index`)}; + } + var index_from_indices = ${o.getByIndices(`indices_indices`)}; + if (index_from_indices < 0) { + index_from_indices += ${n[a]}; + } + ${i.indicesSet(`data_indices`,`uniforms.gather_axis`,`u32(index_from_indices)`)}; + for (var i = uniforms.gather_axis + 1; i < ${s.length}; i++) { + let index = ${f.indicesGet(`output_indices`,`i + ${r.length} - 1`)}; + ${i.indicesSet(`data_indices`,`i`,`index`)}; + } + let data_offset = ${i.indicesToOffset(`data_indices`)}; + let data_index = data_offset % 8; + // Convert 4-bit packed data to 8-bit packed data. + let packed_4bit_quantized_data = ${i.getByOffset(`data_offset / 8`)}; + let packed_8bit_quantized_data = (packed_4bit_quantized_data >> (4 * (data_index % 2))) & 0x0f0f0f0f; + let quantized_data_vec = ${u?`unpack4xI8`:`unpack4xU8`}(u32(packed_8bit_quantized_data)); + let quantized_data = quantized_data_vec[data_index / 2]; + var scale_indices = data_indices; + let quantize_axis_index = ${c.indicesGet(`data_indices`,`uniforms.quantize_axis`)} / uniforms.block_size; + ${c.indicesSet(`scale_indices`,`uniforms.quantize_axis`,`quantize_axis_index`)}; + var scale = ${c.getByIndices(`scale_indices`)}; + ${d?` + let zero_point_indices = scale_indices; + let zero_point_offset = ${d.indicesToOffset(`zero_point_indices`)}; + let zero_point_index = zero_point_offset % 8; + let packed_4bit_zero_points = ${d.getByOffset(`zero_point_offset / 8`)}; + let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f; + let zero_point_vec = ${u?`unpack4xI8`:`unpack4xU8`}(u32(packed_8bit_zero_points)); + let zero_point = zero_point_vec[zero_point_index / 2];`:`var zero_point = 0`}; + let dequantized_data = ${gr(l)}(quantized_data - zero_point) * scale; + ${f.setByOffset(`global_idx`,`dequantized_data`)}; + }`};return{name:`GatherBlockQuantized`,shaderCache:{hint:`${t.cacheKey};${e.filter((e,t)=>t!==1).map(e=>e.dims.join(`_`)).join(`;`)}`,inputDependencies:Array.from({length:e.length},(e,t)=>`rank`)},getRunData:()=>({outputs:[{dims:s,dataType:l}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:d}),getShaderSource:f}},fc=(e,t)=>{let n=e.inputs;uc(n,t),e.compute(dc(e.inputs,t))},pc=e=>G({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),hc,gc,_c,vc,yc=L(()=>{"use strict";V(),W(),fr(),Z(),hc=e=>{if(!e||e.length!==2)throw Error(`GatherElements requires 2 inputs.`);if(e[0].dims.length<1)throw Error(`GatherElements requires that the data input be rank >= 1.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`GatherElements requires that the data input and + indices input tensors be of same rank.`)},gc=(e,t)=>{let n=e[0].dims,r=e[0].dataType,i=n.length,a=e[1].dims,o=e[1].dataType,s=U.normalizeAxis(t.axis,i),c=n[s],l=a.slice(0),u=U.size(l),d=Y(`input`,r,i),f=Y(`indicesInput`,o,a.length),p=X(`output`,r,l.length),m=[{type:12,data:u},{type:6,data:c},{type:12,data:s}];return m.push(...K(n,a,l)),{name:`GatherElements`,shaderCache:{inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:m}),getShaderSource:e=>` + ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axisDimLimit`,`i32`).registerUniform(`axis`,`u32`).declareVariables(d,f,p)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + + let outputIndices = ${p.offsetToIndices(`global_idx`)}; + + var idx = ${f.getByOffset(`global_idx`)}; + if (idx < 0) { + idx = idx + uniforms.axisDimLimit; + } + var inputIndices = ${d.type.indices}(outputIndices); + ${d.indicesSet(`inputIndices`,`uniforms.axis`,`u32(idx)`)}; + let value = ${d.getByIndices(`inputIndices`)}; + + ${p.setByOffset(`global_idx`,`value`)}; + }`}},_c=e=>G({axis:e.axis}),vc=(e,t)=>{let n=e.inputs;hc(n),e.compute(gc(e.inputs,t))}}),bc,xc,Sc,Cc,wc=L(()=>{"use strict";V(),W(),Z(),bc=e=>{if(!e)throw Error(`Input is missing`);if(e.length<2||e.length>3)throw Error(`Invaid input number.`);if(e.length===3&&e[2].dims.length>2)throw Error(`Invalid input shape of C`);if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`Input types are mismatched`)},xc=(e,t)=>{let n=e[0].dims.slice(),r=e[1].dims.slice(),[i,a,o]=Pn.getShapeOfGemmResult(n,t.transA,r,t.transB,e.length===3?e[2].dims:void 0),s=[i,a];if(!s)throw Error(`Can't use gemm on the given tensors`);let c=16,l=Math.ceil(a/c),u=Math.ceil(i/c),d=!0,f=U.size(s),p=[{type:12,data:d?l:f},{type:12,data:i},{type:12,data:a},{type:12,data:o},{type:1,data:t.alpha},{type:1,data:t.beta}],m=[`type`,`type`];e.length===3&&(p.push(...K(e[2].dims)),m.push(`rank`)),p.push(...K(s));let h=n=>{let r=``;t.transA&&t.transB?r=`value += a[k * uniforms.M + m] * b[n * uniforms.K + k];`:t.transA&&!t.transB?r=`value += a[k * uniforms.M + m] * b[k * uniforms.N + n];`:!t.transA&&t.transB?r=`value += a[m * uniforms.K + k] * b[n * uniforms.K + k];`:!t.transA&&!t.transB&&(r=`value += a[m * uniforms.K + k] * b[k * uniforms.N + n];`);let i=t.alpha===1?``:`value *= uniforms.alpha;`,a=Y(`a`,e[0].dataType,e[0].dims),o=Y(`b`,e[1].dataType,e[1].dims),c=a.type.value,l=null,u=[a,o];e.length===3&&(l=Y(`c`,e[2].dataType,e[2].dims.length),u.push(l));let d=X(`output`,e[0].dataType,s.length);u.push(d);let f=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}];return` + ${n.registerUniforms(f).declareVariables(...u)} + + ${n.mainStart()} + ${n.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let m = global_idx / uniforms.N; + let n = global_idx % uniforms.N; + + var value = ${c}(0); + for (var k: u32 = 0u; k < uniforms.K; k++) { + ${r} + } + + ${i} + ${l==null?``:`let cOffset = ${l.broadcastedIndicesToOffset(`vec2(m, n)`,d)}; value += ${c}(uniforms.beta) * ${l.getByOffset(`cOffset`)};`} + output[global_idx] = value; + }`},g=n=>{let r=Y(`a`,e[0].dataType,e[0].dims),i=Y(`b`,e[1].dataType,e[1].dims),a=null,o=[r,i];e.length===3&&(a=Y(`c`,e[2].dataType,e[2].dims.length),o.push(a));let l=X(`output`,e[0].dataType,s.length);o.push(l);let u=[{name:`num_tile_n`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}],d=``,f=``;t.transA&&t.transB?(f=` + var col = tile_row_start + local_id.x; + var row = k_start + local_id.y; + if (col < uniforms.M && row < uniforms.K) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = k_start + local_id.x; + row = tile_col_start + local_id.y; + if (col < uniforms.K && row < uniforms.N) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,d=`value += tile_a[k][local_id.y] * tile_b[local_id.x][k];`):t.transA&&!t.transB?(f=` + var col = tile_row_start + local_id.x; + var row = k_start + local_id.y; + if (col < uniforms.M && row < uniforms.K) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = tile_col_start + local_id.x; + row = k_start + local_id.y; + if (col < uniforms.N && row < uniforms.K) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,d=`value += tile_a[k][local_id.y] * tile_b[k][local_id.x];`):!t.transA&&t.transB?(f=` + var col = k_start + local_id.x; + var row = tile_row_start + local_id.y; + if (col < uniforms.K && row < uniforms.M) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = k_start + local_id.x; + row = tile_col_start + local_id.y; + if (col < uniforms.K && row < uniforms.N) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,d=`value += tile_a[local_id.y][k] * tile_b[local_id.x][k];`):!t.transA&&!t.transB&&(f=` + var col = k_start + local_id.x; + var row = tile_row_start + local_id.y; + if (col < uniforms.K && row < uniforms.M) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = tile_col_start + local_id.x; + row = k_start + local_id.y; + if (col < uniforms.N && row < uniforms.K) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,d=`value += tile_a[local_id.y][k] * tile_b[k][local_id.x];`);let p=t.alpha===1?``:`value *= uniforms.alpha;`;return` + ${n.registerUniforms(u).declareVariables(...o)} + var tile_a: array, ${c}>; + var tile_b: array, ${c}>; + ${n.mainStart([c,c,1])} + let tile_col_start = (workgroup_index % uniforms.num_tile_n) * ${c}; + let tile_row_start = (workgroup_index / uniforms.num_tile_n) * ${c}; + let num_tiles = (uniforms.K - 1) / ${c} + 1; + var k_start = 0u; + var value = ${l.type.value}(0); + for (var t: u32 = 0u; t < num_tiles; t++) { + ${f} + k_start = k_start + ${c}; + workgroupBarrier(); + + for (var k: u32 = 0u; k < ${c}; k++) { + ${d} + } + workgroupBarrier(); + } + + ${p} + let m = tile_row_start + local_id.y; + let n = tile_col_start + local_id.x; + ${a==null?``:`let cOffset = ${a.broadcastedIndicesToOffset(`vec2(m, n)`,l)}; value += ${l.type.value}(uniforms.beta) * ${a.getByOffset(`cOffset`)};`} + if (m < uniforms.M && n < uniforms.N) { + output[m * uniforms.N + n] = value; + } + }`};return d?{name:`GemmShared`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:l*u},programUniforms:p}),getShaderSource:g}:{name:`Gemm`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},Sc=e=>{let t=e.transA,n=e.transB,r=e.alpha,i=e.beta;return{transA:t,transB:n,alpha:r,beta:i,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},Cc=(e,t)=>{bc(e.inputs),e.compute(xc(e.inputs,t))}}),Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc=L(()=>{"use strict";V(),W(),fr(),Z(),[Tc,Ec,Dc,Oc]=[0,1,2,3],kc=e=>{if(e[0].dims.length!==4)throw Error(`only 4-D tensor is supported.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`input dimensions must be equal to grid dimensions`);if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw Error(`grid batch size must match input batch size`)},Ac=` + fn gs_get_cubic_coeffs(x: f32) -> vec4 { + let cubic_alpha = -0.75f; + let x_abs = abs(x); + var coeffs: vec4; + coeffs[0] = (((cubic_alpha * (x_abs + 1) - 5 * cubic_alpha) * (x_abs + 1) + 8 * cubic_alpha) * (x_abs + 1) - 4 * cubic_alpha); + coeffs[1] = (((cubic_alpha + 2) * x_abs - (cubic_alpha + 3)) * x_abs * x_abs + 1); + coeffs[2] = (((cubic_alpha + 2) * (1 - x_abs) - (cubic_alpha + 3)) * (1 - x_abs) * (1 - x_abs) + 1); + coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha); + return coeffs; + } +`,jc=e=>` + fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} { + var v: vec4; + var coeffs = gs_get_cubic_coeffs(x); + for (var i = 0; i < 4; i++) { + v[i] = coeffs[0] * p[i][0] + coeffs[1] * p[i][1] + coeffs[2] * p[i][2] + coeffs[3] * p[i][3]; + } + coeffs = gs_get_cubic_coeffs(y); + let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]); + return pixel; + } +`,Mc=e=>` + fn gs_denormalize(n: f32, length: i32) -> f32 { + ${e.alignCorners===0?` + // alignCorners: false => [-1, 1] to [-0.5, length - 0.5] + return ((n + 1.0) * f32(length) - 1.0) / 2.0; + `:` + // alignCorners: true => [-1, 1] to [0, length - 1] + return (n + 1.0) / 2.0 * (f32(length - 1)); + `} + } +`,Nc=e=>` + ${e.paddingMode===`reflection`?` + fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 { + var dx = 0.0; + var fx = f32(x); + let range = x_max - x_min; + if (fx < x_min) { + dx = x_min - fx; + let n = u32(dx / range); + let r = dx - f32(n) * range; + if (n % 2 == 0) { + fx = x_min + r; + } else { + fx = x_max - r; + } + } else if (fx > x_max) { + dx = fx - x_max; + let n = u32(dx / range); + let r = dx - f32(n) * range; + if (n % 2 == 0) { + fx = x_max - r; + } else { + fx = x_min + r; + } + } + return u32(fx); + }`:``} +`,Pc=(e,t,n)=>` + fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4) -> ${t} { + var pixel = ${t}(0); + var indices = vec4(0); + indices[${Tc}] = batch; + indices[${Ec}] = channel;`+(()=>{switch(n.paddingMode){case`zeros`:return` + if (r >= 0 && r < H && c >=0 && c < W) { + indices[${Dc}] = u32(r); + indices[${Oc}] = u32(c); + } else { + return ${t}(0); + } + `;case`border`:return` + indices[${Dc}] = u32(clamp(r, 0, H - 1)); + indices[${Oc}] = u32(clamp(c, 0, W - 1)); + `;case`reflection`:return` + indices[${Dc}] = gs_reflect(r, border[1], border[3]); + indices[${Oc}] = gs_reflect(c, border[0], border[2]); + `;default:throw Error(`padding mode ${n.paddingMode} is not supported`)}})()+` + return ${e.getByIndices(`indices`)}; + } +`,Fc=(e,t,n)=>(()=>{switch(n.mode){case`nearest`:return` + let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${Tc}], indices[${Ec}], border); + `;case`bilinear`:return` + let x1 = i32(floor(x)); + let y1 = i32(floor(y)); + let x2 = x1 + 1; + let y2 = y1 + 1; + + let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${Tc}], indices[${Ec}], border); + let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${Tc}], indices[${Ec}], border); + let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${Tc}], indices[${Ec}], border); + let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${Tc}], indices[${Ec}], border); + + let dx2 = ${t}(f32(x2) - x); + let dx1 = ${t}(x - f32(x1)); + let dy2 = ${t}(f32(y2) - y); + let dy1 = ${t}(y - f32(y1)); + let result = dy2 * (dx2 * p11 + dx1 * p12) + dy1 * (dx2 * p21 + dx1 * p22); + `;case`bicubic`:return` + let x0 = i32(floor(x)) - 1; + let y0 = i32(floor(y)) - 1; + var p: mat4x4<${t}>; + for (var h = 0; h < 4; h++) { + for (var w = 0; w < 4; w++) { + p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${Tc}], indices[${Ec}], border); + } + } + + let dx = x - f32(x0 + 1); + let dy = y - f32(y0 + 1); + let result = gs_bicubic_interpolate(p, dx, dy); + `;default:throw Error(`mode ${n.mode} is not supported`)}})()+`${e.setByOffset(`global_idx`,`result`)}`,Ic=(e,t)=>{let n=Y(`x`,e[0].dataType,e[0].dims.length),r=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],i=Y(`grid`,e[1].dataType,r.length,2),a=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];t.format===`NHWC`&&(a=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[Tc,Ec,Dc,Oc]=[0,3,1,2]);let o=X(`output`,e[0].dataType,a.length),s=n.type.value,c=U.size(a),l=[{type:12,data:c},...K(e[0].dims,r,a)],u=e=>` + ${e.registerUniform(`output_size`,`u32`).declareVariables(n,i,o)} + ${Ac} + ${jc(s)} + ${Mc(t)} + ${Nc(t)} + ${Pc(n,s,t)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let H_in = i32(uniforms.x_shape[${Dc}]); + let W_in = i32(uniforms.x_shape[${Oc}]); + + ${t.alignCorners===0?` + let x_min = -0.5; + let x_max = f32(W_in) - 0.5; + let y_min = -0.5; + let y_max = f32(H_in) - 0.5; + `:` + let x_min = 0.0; + let x_max = f32(W_in) - 1.0; + let y_min = 0.0; + let y_max = f32(H_in) - 1.0; + `}; + let border = vec4(x_min, y_min, x_max, y_max); + + let indices = ${o.offsetToIndices(`global_idx`)}; + var grid_indices = vec3(indices[${Tc}], indices[${Dc}], indices[${Oc}]); + let nxy = ${i.getByIndices(`grid_indices`)}; + var x = gs_denormalize(f32(nxy[0]), W_in); + var y = gs_denormalize(f32(nxy[1]), H_in); + + ${Fc(o,s,t)} + }`;return{name:`GridSample`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:[`type`,`type`]},getRunData:e=>{let t=U.size(a);return{outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:l}},getShaderSource:u}},Lc=(e,t)=>{kc(e.inputs),e.compute(Ic(e.inputs,t))},Rc=e=>G({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc=L(()=>{"use strict";V(),W(),fr(),er(),Ui(),Z(),Pr(),Bc=(e,t)=>e.length>t&&e[t].dims.length>0?e[t]:void 0,Vc=(e,t)=>{let n=e[0],r=Bc(e,1),i=Bc(e,2),a=Bc(e,3),o=Bc(e,4),s=Bc(e,5),c=Bc(e,6),l=Bc(e,7);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let u=n.dims[0],d=n.dims[1],f=n.dims.length===3?n.dims[2]:t.numHeads*n.dims[4],p=d,m=0,h=0,g=Math.floor(f/t.numHeads);if(c&&l&&U.size(c.dims)&&U.size(l.dims)){if(c.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(c.dims[0]!==u||c.dims[1]!==t.numHeads||c.dims[3]!==g)throw Error(`Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(l.dims[0]!==u||l.dims[1]!==t.numHeads||l.dims[3]!==g)throw Error(`Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(c.dims[2]!==l.dims[2])throw Error(`Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)`);if(l.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);m=c.dims[2],h=c.dims[2]}else if(c&&U.size(c.dims)||l&&U.size(l.dims))throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _;if(r&&U.size(r.dims)>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(r.dims[2]!==n.dims[2])throw Error(`Input "query" and "key" shall have same dim 2 (hidden_size)`);_=2,p=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==g)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);_=5,p=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==g)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);_=0,p=r.dims[2]}}else{if(n.dims.length!==5)throw Error(`Input "query" is expected to have 5 dimensions when key is empty`);if(n.dims[2]!==t.numHeads||n.dims[3]!==3)throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}if(a&&U.size(a.dims)>0){if(a.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimension`);if(r&&r.dims.length===5&&r.dims[3]===2)throw Error(`bias is not allowed for packed kv.`)}let v=m+p,y=0;if(o&&U.size(o.dims)>0){y=8;let e=o.dims;throw e.length===1?e[0]===u?y=1:e[0]===3*u+2&&(y=3):e.length===2&&e[0]===u&&e[1]===v&&(y=5),y===8?Error(`Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)`):Error(`Mask not supported`)}let b=!1,x=f;if(i&&U.size(i.dims)>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(p!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);x=i.dims[2]}else{if(p!==i.dims[2])throw Error(`Input "key" and "value" shall have the same dim 2 (kv_sequence_length)`);x=i.dims[1]*i.dims[3],b=!0}}let S=!1;if(o&&U.size(o.dims)>0)throw Error(`Key padding mask is not supported`);if(s&&U.size(s.dims)>0){if(s.dims.length!==4)throw Error(`Input "attention_bias" is expected to have 4 dimensions`);if(s.dims[0]!==u||s.dims[1]!==t.numHeads||s.dims[2]!==d||s.dims[3]!==v)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:u,sequenceLength:d,pastSequenceLength:m,kvSequenceLength:p,totalSequenceLength:v,maxSequenceLength:h,inputHiddenSize:0,hiddenSize:f,vHiddenSize:x,headSize:g,vHeadSize:Math.floor(x/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:y,scale:t.scale,broadcastResPosBias:S,passPastInKv:b,qkvFormat:_}},Hc=e=>G({...e}),Uc=G({perm:[0,2,1,3]}),Wc=(e,t,n,r,i,a,o)=>{let s=[r,i,a],c=U.size(s),l=[{type:12,data:c},{type:12,data:o},{type:12,data:a}],u=e=>{let r=X(`qkv_with_bias`,t.dataType,s),i=Y(`qkv`,t.dataType,s),a=Y(`bias`,n.dataType,s),o=[{name:`output_size`,type:`u32`},{name:`bias_offset`,type:`u32`},{name:`hidden_size`,type:`u32`}];return` + ${e.registerUniforms(o).declareVariables(i,a,r)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset; + + qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx]; + }`};return e.compute({name:`MultiHeadAttentionAddBias`,shaderCache:{inputDependencies:[`type`,`type`]},getRunData:()=>({outputs:[{dims:s,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l}),getShaderSource:u},{inputs:[t,n],outputs:[-1]})[0]},Gc=(e,t,n,r,i,a,o,s)=>{let c=a;if(o&&U.size(o.dims)>0){if(r===1)throw Error(`AddBiasReshape is not implemented. Please export your model with packed QKV or KV`);return c=Wc(e,a,o,t,r,n*i,s),c=c.reshape([t,r,n,i]),n===1||r===1?c:e.compute(jr(c,Uc.perm),{inputs:[c],outputs:[-1]})[0]}else return a.dims.length===3&&(c=a.reshape([t,r,n,i])),n===1||r===1?c:e.compute(jr(c,Uc.perm),{inputs:[c],outputs:[-1]})[0]},Kc=(e,t)=>{let n=Vc(e.inputs,t),r=e.inputs[0],i=Bc(e.inputs,1),a=Bc(e.inputs,2),o=Bc(e.inputs,3),s=Bc(e.inputs,4),c=Bc(e.inputs,5),l=Bc(e.inputs,6),u=Bc(e.inputs,7);if(r.dims.length===5)throw Error(`Packed QKV is not implemented`);if(i?.dims.length===5)throw Error(`Packed KV is not implemented`);let d=i&&a&&i.dims.length===4&&a.dims.length===4,f=Gc(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,r,o,0);if(d)return Bi(e,f,i,a,s,void 0,l,u,c,n);if(!i||!a)throw Error(`key and value must be provided`);let p=Gc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.headSize,i,o,n.hiddenSize),m=Gc(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.vHeadSize,a,o,2*n.hiddenSize);Bi(e,f,p,m,s,void 0,l,u,c,n)}}),Jc,Yc,Xc,Zc,Qc,$c,el,tl=L(()=>{"use strict";V(),W(),fr(),Z(),Jc=e=>{if(!e||e.length<1)throw Error(`too few inputs`)},Yc=(e,t)=>{let n=[],r=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),r=n.length),G({numOutputs:r,axis:t.axis,splitSizes:n})},Xc=e=>` +fn calculateOutputIndex(index: u32) -> u32 { + for (var i: u32 = 0u; i < ${e}u; i += 1u ) { + if (index < ${J(`uniforms.size_in_split_axis`,`i`,e)}) { + return i; + } + } + return ${e}u; +}`,Zc=e=>{let t=e.length,n=[];for(let r=0;r{let n=e[0].dims,r=U.size(n),i=e[0].dataType,a=U.normalizeAxis(t.axis,n.length),o=Array(t.numOutputs),s=Y(`input`,i,n.length),c=Array(t.numOutputs),l=[],u=[],d=0,f=[{type:12,data:r}];for(let r=0;r` + ${e.registerUniform(`input_size`,`u32`).registerUniform(`size_in_split_axis`,`u32`,c.length).declareVariables(s,...o)} + ${Xc(c.length)} + ${Zc(o)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.input_size`)} + + var indices = ${s.offsetToIndices(`global_idx`)}; + var index = ${s.indicesGet(`indices`,a)}; + let output_number = calculateOutputIndex(index); + if (output_number != 0) { + index -= ${J(`uniforms.size_in_split_axis`,`output_number - 1u`,c.length)}; + ${s.indicesSet(`indices`,a,`index`)}; + } + writeBufferData(output_number, indices, global_idx); + }`;return{name:`Split`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`]},getShaderSource:p,getRunData:()=>({outputs:l,dispatchGroup:{x:Math.ceil(r/64)},programUniforms:f})}},$c=(e,t)=>{Jc(e.inputs);let n=e.inputs.length===1?t:Yc(e.inputs,t);e.compute(Qc(e.inputs,n),{inputs:[0]})},el=e=>{let t=e.axis,n=e.splitSizes,r=e.numOutputs<0?n.length:e.numOutputs;if(r!==n.length)throw Error(`numOutputs and splitSizes lengh must be equal`);return G({axis:t,numOutputs:r,splitSizes:n})}}),nl,rl,il,al=L(()=>{"use strict";V(),W(),fr(),Z(),nl=(e,t)=>{let[n,r,i,a]=e,{numHeads:o,rotaryEmbeddingDim:s}=t;if(n.dims.length!==3&&n.dims.length!==4)throw Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${n.dims.length}`);if(!U.areEqual(r.dims,[])&&!U.areEqual(r.dims,[1])&&r.dims.length!==2)throw Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${r.dims.length}`);if(i.dims.length!==2)throw Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${i.dims.length}`);if(a.dims.length!==2)throw Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${a.dims.length}`);if(!U.areEqual(i.dims,a.dims))throw Error(`Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape`);if(s>0&&o===0)throw Error(`num_heads must be provided if rotary_embedding_dim is specified`);let c=n.dims[0],l=n.dims[n.dims.length-2],u=i.dims[0],d=U.sizeFromDimension(n.dims,1)/l,f=s===0?i.dims[1]*2:d/o;if(s>f)throw Error(`rotary_embedding_dim must be less than or equal to head_size`);if(r.dims.length===2){if(c!==r.dims[0])throw Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${r.dims[0]}`);if(l!==r.dims[1])throw Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${r.dims[1]}`)}if(f/2!==i.dims[1]&&s/2!==i.dims[1])throw Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${i.dims[1]}`);if(l>u)throw Error(`Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported`)},rl=(e,t)=>{let{interleaved:n,numHeads:r,rotaryEmbeddingDim:i,scale:a}=t,o=e[0].dims[0],s=U.sizeFromDimension(e[0].dims,1),c=e[0].dims[e[0].dims.length-2],l=s/c,u=e[2].dims[1],d=i===0?u*2:l/r,f=[o,c,l/d,d-u],p=U.computeStrides(f),m=[{type:1,data:a},{type:12,data:f},{type:12,data:p},...e[0].dims.length===3?Array({type:12,data:[s,l,d,1]}):[],...e[0].dims.length===4?Array({type:12,data:[s,d,c*d,1]}):[],...K(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],h=t=>{let r=Y(`input`,e[0].dataType,e[0].dims.length),i=Y(`position_ids`,e[1].dataType,e[1].dims.length),a=Y(`cos_cache`,e[2].dataType,e[2].dims.length),o=Y(`sin_cache`,e[3].dataType,e[3].dims.length),s=X(`output`,e[0].dataType,e[0].dims.length);return t.registerUniforms([{name:`scale`,type:`f32`},{name:`global_shape`,type:`u32`,length:f.length},{name:`global_strides`,type:`u32`,length:p.length},{name:`input_output_strides`,type:`u32`,length:p.length}]),` + ${t.declareVariables(r,i,a,o,s)} + + ${t.mainStart(pr)} + let half_rotary_emb_dim = uniforms.${a.name}_shape[1]; + let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape; + let size = uniforms.global_shape[0] * uniforms.global_strides[0]; + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`size`)} + + if (bsnh[3] < half_rotary_emb_dim) { + let position_ids_idx = + ${i.broadcastedIndicesToOffset(`bsnh.xy`,X(``,i.type.tensor,2))}; + let position_id = + u32(${i.getByOffset(`position_ids_idx`)}) + select(0, bsnh[1], position_ids_idx == 0); + let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${n}); + let j = i + select(half_rotary_emb_dim, 1, ${n}); + let re = ${r.getByOffset(`i`)} * ${a.get(`position_id`,`bsnh[3]`)} - + ${r.getByOffset(`j`)} * ${o.get(`position_id`,`bsnh[3]`)}; + ${s.setByOffset(`i`,`re`)} + let im = ${r.getByOffset(`i`)} * ${o.get(`position_id`,`bsnh[3]`)} + + ${r.getByOffset(`j`)} * ${a.get(`position_id`,`bsnh[3]`)}; + ${s.setByOffset(`j`,`im`)} + } else { + let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim; + ${s.setByOffset(`k`,r.getByOffset(`k`))} + } + }`};return{name:`RotaryEmbedding`,shaderCache:{hint:G({interleaved:n}).cacheKey,inputDependencies:[`rank`,`rank`,`rank`,`rank`]},getShaderSource:h,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(U.size(f)/pr)},programUniforms:m})}},il=(e,t)=>{nl(e.inputs,t),e.compute(rl(e.inputs,t))}}),ol,sl,cl,ll,ul,dl=L(()=>{"use strict";fr(),V(),Ui(),qc(),tl(),Pr(),al(),Z(),ol=(e,t)=>{if(t.doRotary&&e.length<=7)throw Error(`cos_cache and sin_cache inputs are required if do_rotary is specified`);let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(t.doRotary!==0&&e.length<=7)throw Error(`cos_cast and sin_cache are expected if do_rotary attribute is non-zero`);if(t.localWindowSize!==-1)throw Error(`Local attention is not supported`);if(t.softcap!==0)throw Error(`Softcap is not supported`);if(t.rotaryInterleaved!==0)throw Error(`Rotary interleaved is not supported`);if(t.smoothSoftmax)throw Error(`Smooth softmax is not supported`);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let s=!1,c=n.dims[0],l=n.dims[1],u=n.dims.length===3?s?n.dims[2]/3:n.dims[2]:t.numHeads*n.dims[4],d=l,f=0,p=!r||r.dims.length===0,m=Math.floor(p?u/(t.numHeads+2*t.kvNumHeads):u/t.numHeads);p&&(u=m*t.numHeads);let h=a&&a.dims.length!==0,g=o&&o.dims.length!==0;if(h&&a.dims.length===4&&a.dims[0]===c&&a.dims[1]!==t.kvNumHeads&&a.dims[2]===t.kvNumHeads&&a.dims[3]===m)throw Error(`BSNH pastKey/pastValue is not supported`);if(h&&g){if(a.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(o.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);f=a.dims[2]}else if(h||g)throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _=1;if(r&&r.dims.length>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(n.dims[2]%r.dims[2]!==0)throw Error(`Dimension 2 of "query" should be a multiple of "key"`);d=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==m)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);d=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==m)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);d=r.dims[2]}}else{if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input "query" is expected to have 3 or 5 dimensions when key is empty`);if(n.dims.length===5&&(n.dims[2]!==t.numHeads||n.dims[3]!==3))throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}let v=0,y=!1,b=t.kvNumHeads?m*t.kvNumHeads:u;if(i&&i.dims.length>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(d!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);b=i.dims[2]}else{if(d!==i.dims[2])throw Error(`Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)`);b=i.dims[1]*i.dims[3],y=!0}}let x=e.length>4?e[5]:void 0;if(x&&x.dims.length!==1&&x.dims[0]!==c)throw Error(`Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size`);return{batchSize:c,sequenceLength:l,pastSequenceLength:f,kvSequenceLength:d,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:u,vHiddenSize:b,headSize:m,vHeadSize:Math.floor(b/t.kvNumHeads),numHeads:t.numHeads,kvNumHeads:t.kvNumHeads,nReps:t.numHeads/t.kvNumHeads,pastPresentShareBuffer:!1,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:y,qkvFormat:_}},sl=G({perm:[0,2,1,3]}),cl=(e,t,n)=>{let r=t,i=n.kvNumHeads;return t.dims.length===3&&n.kvSequenceLength!==0&&(r=t.reshape([n.batchSize,n.kvSequenceLength,i,n.headSize]),r=e.compute(jr(r,sl.perm),{inputs:[r],outputs:[-1]})[0]),r},ll=(e,t,n,r)=>{let i=7,a=[`type`,`type`],o=[e*t],s=e*t,c=[{type:12,data:s},{type:12,data:t},{type:12,data:e}],l=e=>{let t=Y(`seq_lens`,n.dataType,n.dims),a=Y(`total_seq_lens`,r.dataType,r.dims),s=X(`pos_ids`,i,o),c=[{name:`output_size`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`batch_size`,type:`u32`}];return` + ${e.registerUniforms(c).declareVariables(t,a,s)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let total_sequence_length = u32(${a.getByOffset(`0`)}); + let is_subsequent_prompt = uniforms.sequence_length > 1 && uniforms.sequence_length != total_sequence_length; + let is_first_prompt = !is_subsequent_prompt && uniforms.sequence_length == total_sequence_length; + let batch_idx = global_idx / uniforms.sequence_length; + let sequence_idx = i32(global_idx % uniforms.sequence_length); + var pos_id: i32 = 0; + let seqlen = ${t.getByOffset(`batch_idx`)}; + let total_seqlen = seqlen + 1; + if (is_first_prompt) { + if (sequence_idx < total_seqlen) { + pos_id = sequence_idx; + } else { + pos_id = 1; + } + ${s.setByOffset(`global_idx`,`pos_id`)} + } else if (is_subsequent_prompt) { + let past_seqlen = total_seqlen - i32(uniforms.sequence_length); + if (past_seqlen + sequence_idx < total_seqlen) { + pos_id = past_seqlen + sequence_idx; + } else { + pos_id = 1; + } + ${s.setByOffset(`global_idx`,`pos_id`)} + } else if (global_idx < uniforms.batch_size) { + ${s.setByOffset(`global_idx`,`seqlen`)} + }; + } + `};return{name:`GeneratePositionIds`,shaderCache:{hint:`${e};${t}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:c}),getShaderSource:l}},ul=(e,t)=>{var n;let r=ol(e.inputs,t);if(e.inputs[0].dims.length===5)throw Error(`Packed QKV is not implemented`);if((n=e.inputs[1])?.dims.length===5)throw Error(`Packed KV is not implemented`);let i=e.inputs[0],a=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,o=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,s=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,c=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,l=e.inputs.length>4?e.inputs[5]:void 0,u=e.inputs.length>5?e.inputs[6]:void 0,d=r.kvNumHeads?r.kvNumHeads:r.numHeads,f=G({axis:2,numOutputs:3,splitSizes:[r.numHeads*r.headSize,d*r.headSize,d*r.headSize]}),[p,m,h]=!a&&!o?e.compute(Qc([i],f),{inputs:[i],outputs:[-1,-1,-1]}):[i,a,o],g,_;if(t.doRotary){let n=e.compute(ll(r.batchSize,r.sequenceLength,l,u),{inputs:[l,u],outputs:[-1]})[0],i=e.inputs[7],a=e.inputs[8],o=G({interleaved:t.rotaryInterleaved!==0,numHeads:r.numHeads,rotaryEmbeddingDim:0,scale:t.scale}),s=[p,n,i,a],c=[-1];g=e.compute(rl(s,o),{inputs:s,outputs:c})[0],s.splice(0,1,m);let d=G({interleaved:t.rotaryInterleaved!==0,numHeads:r.kvNumHeads,rotaryEmbeddingDim:0,scale:t.scale});_=e.compute(rl(s,d),{inputs:s,outputs:c})[0]}let v=Gc(e,r.batchSize,r.numHeads,r.sequenceLength,r.headSize,t.doRotary?g:p,void 0,0),y=cl(e,t.doRotary?_:m,r),b=cl(e,h,r);Bi(e,v,y,b,void 0,void 0,s,c,void 0,r,l,u)}}),fl,pl,ml,hl,gl=L(()=>{"use strict";V(),W(),Pr(),Z(),fl=(e,t,n,r,i,a,o,s)=>{let c=_r(a),l=c===1?`f32`:`vec${c}f`,u=c===1?`vec2f`:`mat2x${c}f`,d=i*o,f=64;d===1&&(f=256);let p=[i,o,a/c],m=[i,o,2],h=[`rank`,`type`,`type`],g=[];g.push(...K(p,m));let _=e=>{let i=Y(`x`,t.dataType,3,c),a=Y(`scale`,n.dataType,n.dims),o=Y(`bias`,r.dataType,r.dims),d=X(`output`,1,3,2),p=[i,a,o,d];return` + var workgroup_shared : array<${u}, ${f}>; + const workgroup_size = ${f}u; + ${e.declareVariables(...p)} + ${e.mainStart(f)} + let batch = workgroup_index / uniforms.x_shape[1]; + let channel = workgroup_index % uniforms.x_shape[1]; + let hight = uniforms.x_shape[2]; + // initialize workgroup memory + var sum = ${l}(0); + var squared_sum = ${l}(0); + for (var h = local_idx; h < hight; h += workgroup_size) { + let value = ${l}(${i.get(`batch`,`channel`,`h`)}); + sum += value; + squared_sum += value * value; + } + workgroup_shared[local_idx] = ${u}(sum, squared_sum); + workgroupBarrier(); + + for (var currSize = workgroup_size >> 1; currSize > 0; currSize = currSize >> 1) { + if (local_idx < currSize) { + workgroup_shared[local_idx] = workgroup_shared[local_idx] + workgroup_shared[local_idx + currSize]; + } + workgroupBarrier(); + } + if (local_idx == 0) { + let sum_final = ${yr(`workgroup_shared[0][0]`,c)} / f32(hight * ${c}); + let squared_sum_final = ${yr(`workgroup_shared[0][1]`,c)} / f32(hight * ${c}); + + let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${s})); + let channel_scale = inv_std_dev * f32(scale[channel]); + let channel_shift = f32(bias[channel]) - sum_final * channel_scale; + output[workgroup_index] = vec2f(channel_scale, channel_shift); + } + }`};return e.compute({name:`InstanceNormComputeChannelScaleShift`,shaderCache:{hint:`${c};${s};${f}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:m,dataType:1}],dispatchGroup:{x:d},programUniforms:g}),getShaderSource:_},{inputs:[t,n,r],outputs:[-1]})[0]},pl=(e,t,n)=>{let r=t[0].dims,i=r,a=2,o=r[0],s=r[1],c=U.sizeFromDimension(r,a),l=_r(c),u=U.size(i)/l,d=fl(e,t[0],t[1],t[2],o,c,s,n.epsilon),f=[o,s,c/l],p=[o,s],m=[`type`,`none`],h=e=>{let n=Y(`x`,t[0].dataType,f.length,l),r=Y(`scale_shift`,1,p.length,2),i=X(`output`,t[0].dataType,f.length,l),a=[n,r,i];return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(...a)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let outputIndices = ${i.offsetToIndices(`global_idx`)}; + let batch = outputIndices[0]; + let channel = outputIndices[1]; + let scale_shift = ${r.getByIndices(`vec2(batch, channel)`)}; + let value = ${n.getByOffset(`global_idx`)} * ${i.type.value}(scale_shift.x) + ${i.type.value}(scale_shift.y); + ${i.setByOffset(`global_idx`,`value`)}; + }`};e.compute({name:`InstanceNormalization`,shaderCache:{hint:`${l}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:[{type:12,data:u},...K(f,p,f)]}),getShaderSource:h},{inputs:[t[0],d]})},ml=(e,t,n)=>{let r=t[0].dims,i=r,a=r[0],o=r[r.length-1],s=U.sizeFromDimension(r,1)/o,c=_r(o),l=U.size(i)/c,u=[{type:12,data:s},{type:12,data:Math.floor(o/c)}],d=[`type`,`type`],f=!1,p=[0,r.length-1];for(let e=0;er[p[t]])),h=fl(e,m,t[1],t[2],a,s,o,n.epsilon),g=e=>{let n=hr(t[0].dataType),r=c===1?`vec2f`:`mat${c}x2f`,a=e=>{let t=e===0?`x`:`y`,r=c===1?`f32`:`vec${c}f`;switch(c){case 1:return`${n}(${r}(scale.${t}))`;case 2:return`vec2<${n}>(${r}(scale[0].${t}, scale[1].${t}))`;case 4:return`vec4<${n}>(${r}(scale[0].${t}, scale[1].${t}, scale[2].${t}, scale[3].${t}))`;default:throw Error(`Not supported compoents ${c}`)}},o=Y(`input`,t[0].dataType,t[0].dims,c),s=X(`output`,t[0].dataType,i,c);return` + @group(0) @binding(0) var input : array<${o.type.storage}>; + @group(0) @binding(1) var scale_input : array<${r}>; + @group(0) @binding(2) var output : array<${s.type.storage}>; + struct Uniforms {H: u32, C : u32}; + @group(0) @binding(3) var uniforms: Uniforms; + + ${e.mainStart()} + let current_image_number = global_idx / (uniforms.C * uniforms.H); + let current_channel_number = global_idx % uniforms.C; + + let scale_offset = current_image_number * uniforms.C + current_channel_number; + let scale = scale_input[scale_offset]; + output[global_idx] = fma(input[global_idx], ${a(0)}, ${a(1)}); + }`};e.compute({name:`InstanceNormalizationNHWC`,shaderCache:{hint:`${c}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:g},{inputs:[t[0],h]})},hl=(e,t)=>{t.format===`NHWC`?ml(e,e.inputs,t):pl(e,e.inputs,t)}}),_l,vl,yl,bl=L(()=>{"use strict";V(),W(),Z(),_l=e=>{if(!e||e.length<2)throw Error(`layerNorm requires at least 2 inputs.`)},vl=(e,t,n)=>{let r=t.simplified,i=e[0].dims,a=e[1],o=!r&&e[2],s=i,c=U.normalizeAxis(t.axis,i.length),l=U.sizeToDimension(i,c),u=U.sizeFromDimension(i,c),d=U.size(a.dims),f=o?U.size(o.dims):0;if(d!==u||o&&f!==u)throw Error(`Size of X.shape()[axis:] == ${u}. + Size of scale and bias (if provided) must match this. + Got scale size of ${d} and bias size of ${f}`);let p=[];for(let e=0;e1,v=n>2,y=t=>{let n=hr(e[0].dataType),i=[Y(`x`,e[0].dataType,e[0].dims,m),Y(`scale`,a.dataType,a.dims,m)];o&&i.push(Y(`bias`,o.dataType,o.dims,m)),i.push(X(`output`,e[0].dataType,s,m)),_&&i.push(X(`mean_data_output`,1,p)),v&&i.push(X(`inv_std_output`,1,p));let c=[{name:`norm_count`,type:`u32`},{name:`norm_size`,type:`f32`},{name:`norm_size_vectorized`,type:`u32`},{name:`epsilon`,type:`f32`}];return` + ${t.registerUniforms(c).declareVariables(...i)} + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.norm_count`)} + let offset = global_idx * uniforms.norm_size_vectorized; + var mean_vector = ${q(`f32`,m)}; + var mean_square_vector = ${q(`f32`,m)}; + + for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) { + let value = ${vr(n,m,`x[h + offset]`)}; + mean_vector += value; + mean_square_vector += value * value; + } + let mean = ${yr(`mean_vector`,m)} / uniforms.norm_size; + let inv_std_dev = inverseSqrt(${yr(`mean_square_vector`,m)} / uniforms.norm_size ${r?``:`- mean * mean`} + uniforms.epsilon); + + for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) { + let f32input = ${vr(n,m,`x[j + offset]`)}; + let f32scale = ${vr(n,m,`scale[j]`)}; + output[j + offset] = ${i[0].type.value}((f32input ${r?``:`- mean`}) * inv_std_dev * f32scale + ${o?`+ ${vr(n,m,`bias[j]`)}`:``} + ); + } + + ${_?`mean_data_output[global_idx] = mean`:``}; + ${v?`inv_std_output[global_idx] = inv_std_dev`:``}; + }`},b=[{dims:s,dataType:e[0].dataType}];return _&&b.push({dims:p,dataType:1}),v&&b.push({dims:p,dataType:1}),{name:`LayerNormalization`,shaderCache:{hint:`${m};${n};${r}`,inputDependencies:h},getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(l/64)},programUniforms:g}),getShaderSource:y}},yl=(e,t)=>{_l(e.inputs),e.compute(vl(e.inputs,t,e.outputCount))}}),xl,Sl,Cl=L(()=>{"use strict";W(),ko(),Ro(),xl=e=>{if(!e||e.length!==2)throw Error(`MatMul requires 2 inputs.`);if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw Error(`shared dimension does not match.`)},Sl=e=>{xl(e.inputs);let t=Mn.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw Error(`Can't use matmul on the given tensors`);let n=t[t.length-1],r=e.inputs[0].dims[e.inputs[0].dims.length-1];if(n<8&&r<8)e.compute(Oo(e.inputs,{activation:``},t));else{let i=t[t.length-2],a=U.size(e.inputs[0].dims.slice(0,-2)),o=U.size(e.inputs[1].dims.slice(0,-2));if(a!==1&&i===1&&o===1){let i=e.inputs[0].reshape([1,a,r]),o=e.inputs[1].reshape([1,r,n]),s=[1,a,n],c=[i,o];e.compute(Lo(c,{activation:``},t,s),{inputs:c})}else e.compute(Lo(e.inputs,{activation:``},t))}}}),wl,Tl,El,Dl,Ol,kl=L(()=>{"use strict";V(),W(),fr(),Z(),wl=(e,t)=>{if(e.length<3||e.length>4)throw Error(`MatMulNBits requires 3 or 4 inputs`);let n=e[0],r=n.dims.length;if(n.dims[r-1]!==t.k)throw Error(`The last dim of input shape does not match the k value`);let i=Math.floor((t.k+t.blockSize-1)/t.blockSize),a=t.blockSize/8*t.bits,o=e[1];if(!U.areEqual(o.dims,[t.n,i,a]))throw Error(`The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize`);let s=e[2].dims;if(U.size(s)!==t.n*i)throw Error(`scales input size error.`);if(e.length===4){let n=e[3].dims,r=t.bits>4?t.n*i:t.n*Math.floor((i+1)/2);if(U.size(n)!==r)throw Error(`zeroPoints input size error.`)}},Tl=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=U.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=_r(t.k),f=_r(l),p=_r(o),m=s.concat([i,o]),h=i>1&&o/p%2==0?2:1,g=U.size(m)/p/h,_=64,v=[],y=[c,i,a/d],b=U.convertShape(e[1].dims).slice();b.splice(-1,1,l/f),v.push(...K(y)),v.push(...K(b)),v.push(...K(e[2].dims)),e.length===4&&v.push(...K(U.convertShape(e[3].dims)));let x=[c,i,o/p];v.push(...K(x));let S=n=>{let r=y.length,i=Y(`a`,e[0].dataType,r,d),a=Y(`b`,12,b.length,f),o=Y(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?Y(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let u=x.length,m=X(`output`,e[0].dataType,u,p),g=hr(e[0].dataType),v=(()=>{switch(d){case 1:return`array<${g}, 8>`;case 2:return`mat4x2<${g}>`;case 4:return`mat2x4<${g}>`;default:throw Error(`${d}-component is not supported.`)}})(),S=()=>{let e=` + // reuse a data + var input_offset = ${i.indicesToOffset(`${i.type.indices}(batch, row, word_offset)`)}; + var a_data: ${v}; + for (var j: u32 = 0; j < ${8/d}; j++) { + a_data[j] = ${i.getByOffset(`input_offset`)}; + input_offset++; + } + `;for(let t=0;t> 4) & b_mask); + b_quantized_values = ${v}(${Array.from({length:4},(e,t)=>`${g}(b_value_lower[${t}]), ${g}(b_value_upper[${t}])`).join(`, `)}); + b_dequantized_values = ${d===1?`${v}(${Array.from({length:8},(e,n)=>`(b_quantized_values[${n}] - ${c?`zero_point${t}`:`zero_point`}) * scale${t}`).join(`, `)});`:`(b_quantized_values - ${v}(${Array(8).fill(`${c?`zero_point${t}`:`zero_point`}`).join(`,`)})) * scale${t};`}; + workgroup_shared[local_id.x * ${h} + ${Math.floor(t/p)}]${p>1?`[${t%p}]`:``} += ${Array.from({length:8/d},(e,t)=>`${d===1?`a_data[${t}] * b_dequantized_values[${t}]`:`dot(a_data[${t}], b_dequantized_values[${t}])`}`).join(` + `)}; + `;return e},C=()=>{let e=` + var col_index = col * ${p}; + ${c?` + let zero_point_bytes_per_col = (nBlocksPerCol + 1) / 2; + var zero_point_byte_count: u32; + var zero_point_word_index: u32; + var zero_point_byte_offset: u32; + let zero_point_nibble_offset: u32 = block & 0x1u; + var zero_point_bits_offset: u32; + var zero_point_word: u32;`:` + // The default zero point is 8 for unsigned 4-bit quantization. + let zero_point = ${g}(8);`} + `;for(let t=0;t> 0x1u); + zero_point_word_index = zero_point_byte_count >> 0x2u; + zero_point_byte_offset = zero_point_byte_count & 0x3u; + zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); + zero_point_word = ${c.getByOffset(`zero_point_word_index`)} >> zero_point_bits_offset; + let zero_point${t} = ${g}((zero_point_word) & 0xFu);`:``} + col_index += 1;`;return e},w=()=>{let e=`col_index = col * ${p};`;for(let t=0;t; + var b_value_upper: vec4; + var b_quantized_values: ${v}; + var b_dequantized_values: ${v};`,e};return` + var workgroup_shared: array<${m.type.value}, ${h*_}>; + ${n.declareVariables(...s,m)} + ${n.mainStart([_,1,1])} + let output_indices = ${m.offsetToIndices(`(global_idx / ${_}) * ${h}`)}; + let col = output_indices[2]; + let row = output_indices[1]; + let batch = output_indices[0]; + let nBlocksPerCol = uniforms.b_shape[1]; + + for (var block = local_id.x; block < nBlocksPerCol; block += ${_}) { + //process one block + var word_offset: u32 = block * ${t.blockSize/d}; + ${C()} + for (var word: u32 = 0; word < ${l}; word += ${f}) { + ${w()} + for (var i: u32 = 0; i < ${f}; i++) { + ${S()} + word_offset += ${8/d}; + } + } + } + workgroupBarrier(); + + if (local_id.x < ${h}) { + var output_value: ${m.type.value} = ${m.type.value}(0); + var workgroup_shared_offset: u32 = local_id.x; + for (var b: u32 = 0u; b < ${_}u; b++) { + output_value += workgroup_shared[workgroup_shared_offset]; + workgroup_shared_offset += ${h}; + } + ${m.setByIndices(`${m.type.indices}(batch, row, col + local_id.x)`,`output_value`)}; + } + }`};return{name:`MatMulNBits`,shaderCache:{hint:`${t.blockSize};${t.bits};${d};${f};${p};${h};${_}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:m,dataType:u}],dispatchGroup:{x:g},programUniforms:v}),getShaderSource:S}},El=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=U.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=_r(t.k),f=_r(l),p=s.concat([i,o]),m=128,h=o%8==0?8:o%4==0?4:1,g=m/h,_=g*f*8,v=_/d,y=_/t.blockSize,b=U.size(p)/h,x=[],S=[c,i,a/d],C=U.convertShape(e[1].dims).slice();C.splice(-1,1,l/f),x.push(...K(S)),x.push(...K(C)),x.push(...K(e[2].dims)),e.length===4&&x.push(...K(U.convertShape(e[3].dims)));let w=[c,i,o];x.push(...K(w));let T=n=>{let r=S.length,i=Y(`a`,e[0].dataType,r,d),a=Y(`b`,12,C.length,f),o=Y(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?Y(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let l=w.length,u=X(`output`,e[0].dataType,l),p=hr(e[0].dataType),_=()=>{switch(d){case 1:return` + let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]); + let a_data1 = vec4<${p}>(sub_a[word_offset + 4], sub_a[word_offset + 5], sub_a[word_offset + 6], sub_a[word_offset + 7]);`;case 2:return` + let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1]); + let a_data1 = vec4<${p}>(sub_a[word_offset + 2], sub_a[word_offset + 3]);`;case 4:return` + let a_data0 = sub_a[word_offset]; + let a_data1 = sub_a[word_offset + 1];`;default:throw Error(`${d}-component is not supported.`)}};return` + var sub_a: array<${i.type.value}, ${v}>; + var inter_results: array, ${h}>; + ${n.declareVariables(...s,u)} + ${n.mainStart([g,h,1])} + let output_indices = ${u.offsetToIndices(`workgroup_index * ${h}`)}; + let col = output_indices[2]; + let row = output_indices[1]; + let batch = output_indices[0]; + let n_blocks_per_col = uniforms.b_shape[1]; + let num_tiles = (n_blocks_per_col - 1) / ${y} + 1; + + // Loop over shared dimension. + for (var tile: u32 = 0; tile < num_tiles; tile += 1) { + let a_col_start = tile * ${v}; + // load one tile A data into shared memory. + for (var a_offset = local_idx; a_offset < ${v}; a_offset += ${m}) + { + let a_col = a_col_start + a_offset; + if (a_col < uniforms.a_shape[2]) + { + sub_a[a_offset] = ${i.getByIndices(`${i.type.indices}(batch, row, a_col)`)}; + } else { + sub_a[a_offset] = ${i.type.value}(0); + } + } + workgroupBarrier(); + + // each thread process one block + let b_row = col + local_id.y; + let block = tile * ${y} + local_id.x; + ${c?` + let zero_point_bytes_per_col = (n_blocks_per_col + 1) / 2; + let zero_point_byte_count = b_row * zero_point_bytes_per_col + (block >> 0x1u); + let zero_point_word_index = zero_point_byte_count >> 0x2u; + let zero_point_byte_offset = zero_point_byte_count & 0x3u; + let zero_point_nibble_offset: u32 = block & 0x1u; + let zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); + let zero_point_word = ${c.getByOffset(`zero_point_word_index`)} >> zero_point_bits_offset; + let zero_point = ${p}((zero_point_word) & 0xFu);`:` + // The default zero point is 8 for unsigned 4-bit quantization. + let zero_point = ${p}(8);`} + let scale = ${o.getByOffset(`b_row * n_blocks_per_col + block`)}; + let b_data = ${a.getByIndices(`${a.type.indices}(b_row, block, 0)`)}; + var word_offset = local_id.x * ${t.blockSize/d}; + for (var i: u32 = 0; i < ${f}; i++) { + ${_()} + let b_value = ${f===1?`b_data`:`b_data[i]`}; + let b_value_lower = unpack4xU8(b_value & 0x0F0F0F0Fu); + let b_value_upper = unpack4xU8((b_value >> 4) & 0x0F0F0F0Fu); + let b_quantized_values = mat2x4<${p}>(${Array.from({length:4},(e,t)=>`${p}(b_value_lower[${t}]), ${p}(b_value_upper[${t}])`).join(`, `)}); + let b_dequantized_values = (b_quantized_values - mat2x4<${p}>(${Array(8).fill(`zero_point`).join(`,`)})) * scale; + inter_results[local_id.y][local_id.x] += ${Array.from({length:2},(e,t)=>`${`dot(a_data${t}, b_dequantized_values[${t}])`}`).join(` + `)}; + word_offset += ${8/d}; + } + workgroupBarrier(); + } + + if (local_idx < ${h}) { + var output_value: ${u.type.value} = ${u.type.value}(0); + for (var b = 0u; b < ${g}; b++) { + output_value += inter_results[local_idx][b]; + } + if (col + local_idx < uniforms.output_shape[2]) + { + ${u.setByIndices(`${u.type.indices}(batch, row, col + local_idx)`,`output_value`)} + } + } + }`};return{name:`BlockwiseMatMulNBits32`,shaderCache:{hint:`${t.blockSize};${d};${f};${g};${h}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:p,dataType:u}],dispatchGroup:{x:b},programUniforms:x}),getShaderSource:T}},Dl=(e,t)=>{wl(e.inputs,t),t.blockSize===32&&e.adapterInfo.isVendor(`intel`)&&e.adapterInfo.isArchitecture(`gen-12lp`)?e.compute(El(e.inputs,t)):e.compute(Tl(e.inputs,t))},Ol=e=>G(e)}),Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl=L(()=>{"use strict";V(),W(),Z(),Al=e=>{if(!e||e.length<1)throw Error(`Too few inputs`);if(e[0].dataType!==1&&e[0].dataType!==10)throw Error(`Input type must be float or float16.`);if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw Error(`The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].`)}},jl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${J(`uniforms.pads`,i,n)}; + if (k < 0) { + break; + } + if (k >= i32(${J(`uniforms.x_shape`,i,t)})) { + break; + } + offset += k * i32(${J(`uniforms.x_strides`,i,t)}); + `;return` + value = ${e.type.value}(uniforms.constant_value); + for (var i = 0; i < 1; i++) { + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + } + `},Ml=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${J(`uniforms.pads`,i,n)}; + if (k < 0) { + k = -k; + } + { + let _2n_1 = 2 * (i32(${J(`uniforms.x_shape`,i,t)}) - 1); + k = k % _2n_1; + if(k >= i32(${J(`uniforms.x_shape`,i,t)})) { + k = _2n_1 - k; + } + } + offset += k * i32(${J(`uniforms.x_strides`,i,t)}); + `;return` + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + `},Nl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${J(`uniforms.pads`,i,n)}; + if (k < 0) { + k = 0; + } + if (k >= i32(${J(`uniforms.x_shape`,i,t)})) { + k = i32(${J(`uniforms.x_shape`,i,t)}) - 1; + } + offset += k * i32(${J(`uniforms.x_strides`,i,t)}); + `;return` + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + `},Pl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${J(`uniforms.pads`,i,n)}; + if (k < 0) { + k += i32(${J(`uniforms.x_shape`,i,t)}]); + } + if (k >= i32(${J(`uniforms.x_shape`,i,t)})) { + k -= i32(${J(`uniforms.x_shape`,i,t)}); + } + offset += k * i32(${J(`uniforms.x_strides`,i,t)}); + `;return` + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + `},Fl=(e,t,n)=>{switch(n.mode){case 0:return jl(e,t,n.pads.length);case 1:return Ml(e,t,n.pads.length);case 2:return Nl(e,t,n.pads.length);case 3:return Pl(e,t,n.pads.length);default:throw Error(`Invalid mode`)}},Il=(e,t)=>{let n=U.padShape(e[0].dims.slice(),t.pads),r=e[0].dims,i=U.size(n),a=[{type:12,data:i},{type:6,data:t.pads}],o=e.length>=3&&e[2].data;t.mode===0&&a.push({type:o?e[2].dataType:1,data:t.value}),a.push(...K(e[0].dims,n));let s=[`rank`],c=i=>{let a=X(`output`,e[0].dataType,n.length),s=Y(`x`,e[0].dataType,r.length),c=s.type.value,l=Fl(a,r.length,t),u=[{name:`output_size`,type:`u32`},{name:`pads`,type:`i32`,length:t.pads.length}];return t.mode===0&&u.push({name:`constant_value`,type:o?c:`f32`}),` + ${i.registerUniforms(u).declareVariables(s,a)} + ${i.mainStart()} + ${i.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let indices = ${a.offsetToIndices(`global_idx`)}; + + var value = ${c}(0); + ${l} + output[global_idx] = value; + }`};return{name:`Pad`,shaderCache:{hint:`${t.mode}${o}`,inputDependencies:s},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(U.size(n)/64)},programUniforms:a}),getShaderSource:c}},Ll=(e,t)=>{if(e.length>1){let n=e[1].getBigInt64Array(),r=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,i=e[0].dims.length,a=new Int32Array(2*i).fill(0);if(e.length>=4){let t=e[3].getBigInt64Array();for(let e=0;ea[Number(t)]=Number(e));let o=[];return a.forEach(e=>o.push(e)),{mode:t.mode,value:r,pads:o}}else return t},Rl=(e,t)=>{Al(e.inputs);let n=Ll(e.inputs,t);e.compute(Il(e.inputs,n),{inputs:[0]})}}),Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au=L(()=>{"use strict";_t(),V(),W(),Z(),Bl=e=>{if(R.webgpu.validateInputContent&&(!e||e.length!==1))throw Error(`Pool ops requires 1 input.`)},Vl=(e,t,n)=>{let r=t.format===`NHWC`,i=e.dims.slice();r&&i.splice(1,0,i.pop());let a=Object.hasOwnProperty.call(t,`dilations`),o=t.kernelShape.slice(),s=t.strides.slice(),c=a?t.dilations.slice():[],l=t.pads.slice();Nn.adjustPoolAttributes(n,i,o,s,c,l);let u=Nn.computePoolOutputShape(n,i,s,c,o,l,t.autoPad),d=Object.assign({},t);a?Object.assign(d,{kernelShape:o,strides:s,pads:l,dilations:c,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:o,strides:s,pads:l,cacheKey:t.cacheKey});let f=u.slice();return f.push(f.splice(1,1)[0]),[d,r?f:u]},Hl=(e,t)=>{let n=t.format===`NHWC`,r=U.size(e),i=U.size(t.kernelShape),a=[{type:12,data:r},{type:12,data:i}],o=[{name:`outputSize`,type:`u32`},{name:`kernelSize`,type:`u32`}];if(t.kernelShape.length<=2){let e=t.kernelShape[t.kernelShape.length-1],n=t.strides[t.strides.length-1],r=t.pads[t.pads.length/2-1],i=t.pads[t.pads.length-1],s=!!(r+i);a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kw`,type:`u32`},{name:`sw`,type:`u32`},{name:`pwStart`,type:`u32`},{name:`pwEnd`,type:`u32`});let c=!1;if(t.kernelShape.length===2){let e=t.kernelShape[t.kernelShape.length-2],n=t.strides[t.strides.length-2],r=t.pads[t.pads.length/2-2],i=t.pads[t.pads.length-2];c=!!(r+i),a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kh`,type:`u32`},{name:`sh`,type:`u32`},{name:`phStart`,type:`u32`},{name:`phEnd`,type:`u32`})}return[a,o,!0,s,c]}else{if(n)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let e=U.computeStrides(t.kernelShape);a.push({type:12,data:e},{type:12,data:t.pads},{type:12,data:t.strides}),o.push({name:`kernelStrides`,type:`u32`,length:e.length},{name:`pads`,type:`u32`,length:t.pads.length},{name:`strides`,type:`u32`,length:t.strides.length});let r=t.pads.reduce((e,t)=>e+t);return[a,o,!!r,!1,!1]}},Ul=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f=i.format===`NHWC`,p=t.type.value,m=X(`output`,t.type.tensor,r);if(i.kernelShape.length<=2){let r=``,l=``,h=``,g=n-(f?2:1);if(r=u?` + for (var i: u32 = 0u; i < uniforms.kw; i++) { + xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i; + if (xIndices[${g}] < 0 || xIndices[${g}] + >= uniforms.x_shape[${g}]) { + pad++; + continue; + } + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + }`:` + for (var i: u32 = 0u; i < uniforms.kw; i++) { + xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i; + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + }`,i.kernelShape.length===2){let e=n-(f?3:2);l=d?` + for (var j: u32 = 0u; j < uniforms.kh; j++) { + xIndices[${e}] = indices[${e}] * uniforms.sh - uniforms.phStart + j; + if (xIndices[${e}] < 0 || xIndices[${e}] >= uniforms.x_shape[${e}]) { + pad += i32(uniforms.kw); + continue; + } + `:` + for (var j: u32 = 0u; j < uniforms.kh; j++) { + xIndices[${e}] = indices[${e}] * uniforms.sh - uniforms.phStart + j; + `,h=` + } + `}return` + ${e.registerUniforms(c).declareVariables(t,m)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + + let indices = ${m.offsetToIndices(`global_idx`)}; + var xIndices = ${m.offsetToIndices(`global_idx`)}; + + var value = ${p}(${s}); + var pad = 0; + ${l} + ${r} + ${h} + ${o} + + output[global_idx] = value; + }`}else{if(f)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let r=i.kernelShape.length,u=i.pads.length,d=``;return d=l?` + if (xIndices[j] >= uniforms.x_shape[j]) { + pad++; + isPad = true; + break; + } + } + if (!isPad) { + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + }`:` + } + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + `,` + ${e.registerUniforms(c).declareVariables(t,m)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + let indices = ${m.offsetToIndices(`global_idx`)}; + var xIndices = ${m.offsetToIndices(`global_idx`)}; + + var offsets: array; + + var value = ${p}(${s}); + var pad = 0; + var isPad = false; + + for (var i: u32 = 0u; i < uniforms.kernelSize; i++) { + var offset = i; + for (var j = 0u; j < ${r-1}u; j++) { + offsets[j] = offset / ${J(`uniforms.kernelStrides`,`j`,r)}; + offset -= offsets[j] * ${J(`uniforms.kernelStrides`,`j`,r)}; + } + offsets[${r-1}] = offset; + + isPad = false; + for (var j = ${n-r}u; j < ${n}u; j++) { + xIndices[j] = indices[j] * ${J(`uniforms.strides`,`j - ${n-r}u`,r)} + + offsets[j - ${n-r}u] - ${J(`uniforms.pads`,`j - 2u`,u)}; + ${d} + } + ${o} + + output[global_idx] = value; + }`}},Wl=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,Gl=e=>`${Wl(e)};${e.countIncludePad}`,Kl=e=>`${Wl(e)};${e.storageOrder};${e.dilations}`,ql=e=>({format:e.format,autoPad:[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),Jl=(e,t,n,r)=>{let[i,a]=Vl(t,r,n),o=Y(`x`,t.dataType,t.dims.length),s=o.type.value,c=`value += x_val;`,l=``;i.countIncludePad?l+=`value /= ${s}(uniforms.kernelSize);`:l+=`value /= ${s}(i32(uniforms.kernelSize) - pad);`;let[u,d,f,p,m]=Hl(a,i);u.push(...K(t.dims,a));let h=[`rank`];return{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(U.size(a)/64)},programUniforms:u}),getShaderSource:e=>Ul(e,o,t.dims.length,a.length,i,c,l,0,d,f,p,m)}},Yl=e=>{let t=e.count_include_pad!==0,n=ql(e);if(n.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for AveragePool`);let r={countIncludePad:t,...n,cacheKey:``};return{...r,cacheKey:Gl(r)}},Xl=(e,t)=>{Bl(e.inputs),e.compute(Jl(`AveragePool`,e.inputs[0],!1,t))},Zl={autoPad:``,ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},Ql=e=>{let t=e.format;return{format:t,...Zl,cacheKey:t}},$l=(e,t)=>{Bl(e.inputs),e.compute(Jl(`GlobalAveragePool`,e.inputs[0],!0,t))},eu=(e,t,n,r)=>{let[i,a]=Vl(t,r,n),o=` + value = max(x_val, value); + `,s=``,c=Y(`x`,t.dataType,t.dims.length),l=[`rank`],[u,d,f,p,m]=Hl(a,i);return u.push(...K(t.dims,a)),{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(U.size(a)/64)},programUniforms:u}),getShaderSource:e=>Ul(e,c,t.dims.length,a.length,i,o,s,t.dataType===10?-65504:-1e5,d,f,p,m)}},tu=(e,t)=>{Bl(e.inputs),e.compute(eu(`MaxPool`,e.inputs[0],!1,t))},nu=e=>{let t=e.storage_order,n=e.dilations,r=ql(e);if(t!==0)throw Error(`column major storage order is not yet supported for MaxPool`);if(r.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for MaxPool`);let i={storageOrder:t,dilations:n,...r,cacheKey:``};return{...i,cacheKey:Kl(i)}},ru=e=>{let t=e.format;return{format:t,...Zl,cacheKey:t}},iu=(e,t)=>{Bl(e.inputs),e.compute(eu(`GlobalMaxPool`,e.inputs[0],!0,t))}}),ou,su,cu,lu,uu=L(()=>{"use strict";V(),W(),fr(),Z(),ou=(e,t)=>{if(e.length<2||e.length>3)throw Error(`DequantizeLinear requires 2 or 3 inputs.`);if(e.length===3&&e[1].dims===e[2].dims)throw Error(`x-scale and x-zero-point must have the same shape.`);if(e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[0].dataType===6&&e.length>2)throw Error(`In the case of dequantizing int32 there is no zero point.`);if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw Error(`scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.`);if(e.length>2){if(e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[1].dims.length!==e[2].dims.length)throw Error(`scale and zero-point inputs must have the same rank.`);if(!e[1].dims.map((t,n)=>t===e[2].dims[n]).reduce((e,t)=>e&&t,!0))throw Error(`scale and zero-point inputs must have the same shape.`)}if(t.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw Error(`blockSize must be set only for block quantization.`);if(!e[1].dims.map((n,r)=>r===t.axis||n===e[0].dims[r]).reduce((e,t)=>e&&t,!0))throw Error(`For block qunatization, scale input shape to match the input shape except for the axis`);if(e[1].dims.length!==e[0].dims.length)throw Error(`For block qunatization the scale input rank must be the same as the x rank.`);let n=e[0].dims[t.axis],r=e[1].dims[t.axis];if(t.blockSizeMath.ceil(n/(r-1)-1))throw Error(`blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].`)}},su=(e,t)=>{let n=U.normalizeAxis(t.axis,e[0].dims.length),r=e[0].dataType,i=r===3,a=e[0].dims,o=e[1].dataType,s=U.size(a),c=r===3||r===2,l=c?[Math.ceil(U.size(e[0].dims)/4)]:e[0].dims,u=e[1].dims,d=e.length>2?e[2]:void 0,f=d?c?[Math.ceil(U.size(d.dims)/4)]:d.dims:void 0,p=u.length===0||u.length===1&&u[0]===1,m=p===!1&&u.length===1,h=_r(s),g=p&&(!c||h===4),_=g?h:1,v=g&&!c?h:1,y=Y(`input`,c?12:r,l.length,v),b=Y(`scale`,o,u.length),x=d?Y(`zero_point`,c?12:r,f.length):void 0,S=X(`output`,o,a.length,_),C=[y,b];x&&C.push(x);let w=[l,u];d&&w.push(f);let T=[{type:12,data:s/_},{type:12,data:n},{type:12,data:t.blockSize},...K(...w,a)],E=e=>{let t=[{name:`output_size`,type:`u32`},{name:`axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` + ${e.registerUniforms(t).declareVariables(...C,S)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let output_indices = ${S.offsetToIndices(`global_idx`)}; + + // Set input x + ${c?` + let input = ${y.getByOffset(`global_idx / 4`)}; + let x_vec = ${i?`unpack4xI8(input)`:`unpack4xU8(input)`}; + let x_value = ${_===1?`x_vec[global_idx % 4]`:`x_vec`};`:`let x_value = ${y.getByOffset(`global_idx`)};`}; + + // Set scale input + ${p?`let scale_value= ${b.getByOffset(`0`)}`:m?` + let scale_index = ${S.indicesGet(`output_indices`,`uniforms.axis`)}; + let scale_value= ${b.getByOffset(`scale_index`)};`:` + var scale_indices: ${b.type.indices} = output_indices; + let index = ${b.indicesGet(`scale_indices`,`uniforms.axis`)} / uniforms.block_size; + ${b.indicesSet(`scale_indices`,`uniforms.axis`,`index`)}; + let scale_value= ${b.getByIndices(`scale_indices`)};`}; + + // Set zero-point input + ${x?p?c?` + let zero_point_input = ${x.getByOffset(`0`)}; + let zero_point_vec = ${i?`unpack4xI8(zero_point_input)`:`unpack4xU8(zero_point_input)`}; + let zero_point_value= zero_point_vec[0]`:`let zero_point_value = ${x.getByOffset(`0`)}`:m?c?` + let zero_point_index = ${S.indicesGet(`output_indices`,`uniforms.axis`)}; + let zero_point_input = ${x.getByOffset(`zero_point_index / 4`)}; + let zero_point_vec = ${i?`unpack4xI8(zero_point_input)`:`unpack4xU8(zero_point_input)`}; + let zero_point_value = zero_point_vec[zero_point_index % 4]`:` + let zero_point_index = ${S.indicesGet(`output_indices`,`uniforms.axis`)}; + let zero_point_value = ${x.getByOffset(`zero_point_index`)};`:c?` + let zero_point_offset = ${b.indicesToOffset(`scale_indices`)}; + let zero_point_input = ${x.getByOffset(`zero_point_offset / 4`)}; + let zero_point_vec = ${i?`unpack4xI8(zero_point_input)`:`unpack4xU8(zero_point_input)`}; + let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${x.getByIndices(`scale_indices`)};`:`let zero_point_value = ${c?i?`i32`:`u32`:y.type.value}(0);`}; + // Compute and write output + ${S.setByOffset(`global_idx`,`${S.type.value}(x_value - zero_point_value) * scale_value`)}; + }`};return{name:`DequantizeLinear`,shaderCache:{hint:t.cacheKey,inputDependencies:x?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getShaderSource:E,getRunData:()=>({outputs:[{dims:a,dataType:o}],dispatchGroup:{x:Math.ceil(s/_/64),y:1,z:1},programUniforms:T})}},cu=(e,t)=>{ou(e.inputs,t),e.compute(su(e.inputs,t))},lu=e=>G({axis:e.axis,blockSize:e.blockSize})}),du,fu,pu,mu=L(()=>{"use strict";_t(),V(),Z(),du=(e,t,n)=>{let r=e===t,i=et&&n>0;if(r||i||a)throw Error(`Range these inputs' contents are invalid.`)},fu=(e,t,n,r)=>{let i=Math.abs(Math.ceil((t-e)/n)),a=[i],o=i,s=[{type:12,data:o},{type:r,data:e},{type:r,data:n},...K(a)],c=e=>{let t=X(`output`,r,a.length),n=t.type.value,i=[{name:`outputSize`,type:`u32`},{name:`start`,type:n},{name:`delta`,type:n}];return` + ${e.registerUniforms(i).declareVariables(t)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + output[global_idx] = uniforms.start + ${n}(global_idx) * uniforms.delta; + }`};return{name:`Range`,shaderCache:{hint:`${r}`},getShaderSource:c,getRunData:()=>({outputs:[{dims:a,dataType:r}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:s})}},pu=e=>{let t=0,n=0,r=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],n=e.inputs[1].getInt32Array()[0],r=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],n=e.inputs[1].getFloat32Array()[0],r=e.inputs[2].getFloat32Array()[0]),R.webgpu.validateInputContent&&du(t,n,r),e.compute(fu(t,n,r,e.inputs[0].dataType),{inputs:[]})}}),hu,gu,_u,vu,yu,bu,xu=L(()=>{"use strict";V(),W(),fr(),Z(),hu=(e,t,n,r)=>{if(e!==`none`&&r!==`i32`&&r!==`u32`&&r!==`f32`)throw Error(`Input ${r} is not supported with reduction ${e}.`);let i=`{ + var oldValue = 0; + loop { + let newValueF32 =`,a=`; + let newValue = bitcast(newValueF32); + let res = atomicCompareExchangeWeak(&${t}, oldValue, newValue); + if res.exchanged { + break; + } + oldValue = res.old_value; + } + }`;switch(e){case`none`:return`${t}=${n};`;case`add`:return r===`i32`||r===`u32`?`atomicAdd(&${t}, bitcast<${r}>(${n}));`:` + ${i}bitcast<${r}>(oldValue) + (${n})${a}`;case`max`:return r===`i32`||r===`u32`?`atomicMax(&${t}, bitcast<${r}>(${n}));`:` + ${i}max(bitcast(oldValue), (${n}))${a}`;case`min`:return r===`i32`||r===`u32`?`atomicMin(&${t}, bitcast<${r}>(${n}));`:`${i}min(bitcast<${r}>(oldValue), (${n}))${a}`;case`mul`:return`${i}(bitcast<${r}>(oldValue) * (${n}))${a}`;default:throw Error(`Reduction ${e} is not supported.`)}},gu=(e,t)=>`${e===1?` + let element_count_dim = uniforms.output_strides; + let dim_value = uniforms.output_shape;`:` + let element_count_dim = uniforms.output_strides[${t?`i - indices_start`:`i`}]; + let dim_value = uniforms.output_shape[${t?`i - indices_start`:`i`} + uniforms.last_index_dimension];`} + + if (index >= 0) { + if (index >= i32(dim_value)) { + index = i32(dim_value - 1); + } + } else { + if (index < -i32(dim_value)) { + index = 0; + } else { + index += i32(dim_value); + } + } + data_offset += u32((u32(index) * element_count_dim));`,_u=(e,t,n)=>`for (var i = 0u; i < uniforms.num_updates_elements; i++) { + let value = updates[uniforms.num_updates_elements * ${n?`global_idx`:`idx`} + i]; + ${hu(e.reduction,`output[data_offset + i]`,`value`,t)} + }`,vu=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n,a=1,o=Math.ceil(U.size(r)/a),s=r[r.length-1],c=U.sizeFromDimension(n,s),l=U.sizeFromDimension(r,0)/s,u=[{type:12,data:o},{type:12,data:s},{type:12,data:c},...K(e[1].dims,e[2].dims,i)],d=r=>{let o=Y(`indices`,e[1].dataType,e[1].dims.length),s=Y(`updates`,e[2].dataType,e[2].dims.length,a),c=t.reduction!==`none`&&t.reduction!==``?xr(`output`,e[0].dataType,i.length):X(`output`,e[0].dataType,i.length,a);return` + ${r.registerUniform(`output_size`,`u32`).registerUniform(`last_index_dimension`,`u32`).registerUniform(`num_updates_elements`,`u32`).declareVariables(o,s,c)} + ${r.mainStart()} + ${r.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + var hasDuplicates = false; + if (${t.reduction===`none`}) { + for (var i = 0; i < ${l}; i = i + 1) { + for (var j = i + 1; j < ${l}; j = j + 1) { + var index_i = i32(indices[i].x); + var index_j = i32(indices[j].x); + if (index_i == index_j) { + hasDuplicates = true; + break; + } + } + if (hasDuplicates) { + break; + } + } + } + + if (${t.reduction===`none`} && hasDuplicates) { + if (global_idx != 0u) { + return; + } + // Process each index-update pair individually when duplicates exist + for (var idx = 0u; idx < ${l}u; idx++) { + var data_offset = 0u; + for (var i = 0u; i < uniforms.last_index_dimension; i++) { + var index = i32(indices[idx * uniforms.last_index_dimension + i].x); + ${gu(n.length,!1)} + } + ${_u(t,c.type.value,!1)} + } + return; + } + + var data_offset = 0u; + var indices_start = uniforms.last_index_dimension * global_idx; + var indices_end = indices_start + uniforms.last_index_dimension; + for (var i = indices_start; i < indices_end; i++) { + var index = i32(indices[i].x); + ${gu(n.length,!0)} + } + ${_u(t,c.type.value,!0)} + }`};return{name:`ScatterND`,shaderCache:{hint:`${t.cacheKey}_${t.reduction}`,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:u}),getShaderSource:d}},yu=e=>G({reduction:e.reduction}),bu=(e,t)=>{e.compute(vu(e.inputs,t),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Q,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu=L(()=>{"use strict";V(),W(),fr(),Z(),Su=(e,t)=>{if(e.every(e=>e>0||(()=>{throw Error(`Resize requires scales input values to be positive`)})),e.length>0){if(t.mode===`linear`){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and + one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(t.mode===`cubic`&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw Error(`Resize requires scales input size to be 2 or 4 for cubic mode`)}},Cu=(e,t,n)=>{t.every(e=>e>=0&&e{throw Error(`Resize requires axes input values to be positive and less than rank`)}));let r=Array(n).fill(1);return t.forEach((t,n)=>r[t]=e[n]),r},wu=(e,t,n,r,i,a)=>{let[o,s,c]=n>10?[1,2,3]:[-1,e.length>1?1:-1,-1],l=e[0].dims.length;if(o>0&&e.length>o&&e[o].dims.length>0)e[o].getFloat32Array().forEach(e=>a.push(e));else if(t.coordinateTransformMode===`tf_crop_and_resize`)throw Error(`Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize`);if(s>0&&e.length>s&&e[s].dims.length===1&&e[s].dims[0]>0){if(e[s].getFloat32Array().forEach(e=>r.push(e)),r.length!==0&&r.length!==l&&n>=18&&r.length!==t.axes.length)throw Error(`Resize requires scales input size to be same as input rank or axes size for opset 18 and up`);Su(r,t),t.axes.length>0&&Cu(r,t.axes,l).forEach((e,t)=>r[t]=e)}if(c>0&&e.length>c&&e[c].dims.length===1&&e[c].dims[0]>0&&(e[c].getBigInt64Array().forEach(e=>i.push(Number(e))),i.length!==0&&i.length!==l&&n>=18&&i.length!==t.axes.length))throw Error(`Resize requires sizes input size to be same as input rank or axes size for opset 18 and up`);if(t.axes.length>0){if(r.length!==0&&r.length!==t.axes.length)throw Error(`Resize requires "scales" input size to be of axes rank when axes attributes is specified`);if(i.length!==0&&i.length!==t.axes.length)throw Error(`Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified`)}if(typeof r<`u`&&typeof i<`u`&&r.length>0&&i.length>l)throw Error(`Resize requires only of scales or sizes to be specified`)},Tu=(e,t,n,r)=>` + // The whole part and the fractional part are calculated separately due to inaccuracy of floating + // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an + // offset-by-one error later in floor(). + let big = (${e}) * (${t}); + let whole = ${r}(big / (${n})); + let fract = ${r}(big % (${n})) / ${r}(${n}); + return whole + fract; +`,Eu=(e,t)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32, + lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${t} { `+(()=>{switch(e){case`asymmetric`:return` + if (xScale < 1.0 || floor(xScale) != xScale) { + return ${t}(xResized) / ${t}(xScale); + } else { + ${Tu(`xResized`,`lengthOriginal`,`lengthResized`,t)} + } + `;case`pytorch_half_pixel`:return`if (lengthResized > 1) { + return (${t}(xResized) + 0.5) / ${t}(xScale) - 0.5; + } else { + return 0.0; + }`;case`tf_half_pixel_for_nn`:return`return (${t}(xResized) + 0.5) / ${t}(xScale);`;case`align_corners`:return`if (lengthResized == 1) { + return 0.0; + } else { + ${Tu(`xResized`,`lengthOriginal - 1`,`lengthResized - 1`,t)} + }`;case`tf_crop_and_resize`:return`if (lengthResized > 1) { + return ${t}(roiStart) * ${t}(lengthOriginal - 1) + + (${t}(xResized) * ${t}(roiEnd - roiStart) * ${t}(lengthOriginal - 1)) / + ${t}(lengthResized - 1); + } else { + return 0.5 * ${t}(roiStart + roiEnd) * ${t}(lengthOriginal - 1); + }`;case`half_pixel_symmetric`:return`const outputWidth = ${t}xScale * ${t}(lengthResized); + const adjustment = ${t}(lengthResized) / outputWidth; + const center = ${t}(lengthOriginal) / 2; + const offset = center * (1 - adjustment); + return offset + ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;case`half_pixel`:return`return ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;default:throw Error(`Coordinate transform mode ${e} is not supported`)}})()+`}`,Du=(e,t,n)=>`fn getNearestPixelFromOriginal(xOriginal: ${n}, isDownSample: bool) -> ${n} {`+(()=>{switch(e){case`round_prefer_ceil`:return`if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }`;case`floor`:return`return floor(xOriginal);`;case`ceil`:return`return ceil(xOriginal);`;case`round_prefer_floor`:return`if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }`;case`simple`:default:if(t<11)return`if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }`;throw Error(`Nearest mode ${e} is not supported`)}})()+`}`,Ou=(e,t,n)=>{let r=Array(n).fill(0).concat(Array(n).fill(1)),i=e.length===0?r:e.slice();return t.length>0?(t.forEach((e,a)=>{r[e]=i[a],r[a+n]=i[t.length+a]}),r):i},ku=(e,t,n,r)=>{let i=[];if(n.length>0)if(r.length>0){if(e.forEach(e=>i.push(e)),Math.max(...r)>e.length)throw Error(`axes is out of bound`);r.forEach((e,t)=>i[e]=n[t])}else n.forEach(e=>i.push(e));else{if(t.length===0)throw Error(`Resize requires either scales or sizes.`);i=e.map((e,n)=>Math.round(e*t[n]))}return i},Au=(e,t,n)=>{let r=(()=>{switch(n.keepAspectRatioPolicy){case`not_larger`:return n.axes.length>0?Math.min(...n.axes.map(e=>t[e]),Number.MAX_VALUE):Math.min(...t,Number.MAX_VALUE);case`not_smaller`:return n.axes.length>0?Math.max(...n.axes.map(e=>t[e]),Number.MIN_VALUE):Math.max(...t,Number.MIN_VALUE);default:throw Error(`Keep aspect ratio policy ${n.keepAspectRatioPolicy} is not supported`)}})();t.fill(1,0,t.length);let i=e.slice();return n.axes.length>0?(n.axes.forEach(e=>t[e]=r),n.axes.forEach(n=>i[n]=Math.round(e[n]*t[n]))):(t.fill(r,0,t.length),i.forEach((e,n)=>i[n]=Math.round(e*t[n]))),i},ju=(e,t,n,r,i)=>` + fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${n.length}> { + var original_indices: array<${e.type.value}, ${n.length}>; + for (var i:u32 = 0; i < ${n.length}; i++) { + var output_index = ${e.indicesGet(`output_indices`,`i`)}; + var scale = ${J(`uniforms.scales`,`i`,r)}; + var roi_low = ${J(`uniforms.roi`,`i`,i)}; + var roi_hi = ${J(`uniforms.roi`,`i + ${t.length}`,i)}; + if (scale == 1.0) { + original_indices[i] = ${e.type.value}(output_index); + } else { + var input_shape_i = ${J(`uniforms.input_shape`,`i`,t.length)}; + var output_shape_i = ${J(`uniforms.output_shape`,`i`,n.length)}; + original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, + input_shape_i, roi_low, roi_hi); + } + } + return original_indices; + }`,Mu=(e,t,n,r,i,a,o)=>` + fn calculateInputIndicesFromOutputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { + var input_indices: ${e.type.indices}; + for (var i:u32 = 0; i < ${r.length}; i++) { + var output_index = ${t.indicesGet(`output_indices`,`i`)}; + var input_index: u32; + var scale = ${J(`uniforms.scales`,`i`,i)}; + if (scale == 1.0) { + input_index = output_index; + } else { + var roi_low = ${J(`uniforms.roi`,`i`,a)}; + var roi_hi = ${J(`uniforms.roi`,`i + ${n.length}`,a)}; + var input_shape_i = ${J(`uniforms.input_shape`,`i`,n.length)}; + var output_shape_i = ${J(`uniforms.output_shape`,`i`,r.length)}; + var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, + input_shape_i, roi_low, roi_hi); + if (!${o} || (original_idx >= 0 && original_idx < ${t.type.value}(input_shape_i))) { + if (original_idx < 0) { + input_index = 0; + } else if (original_idx > ${t.type.value}(input_shape_i - 1)) { + input_index = input_shape_i - 1; + } else { + input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1)); + } + } else { + input_index = u32(original_idx); + } + } + ${e.indicesSet(`input_indices`,`i`,`input_index`)} + } + return input_indices; + }`,Q=(e,t)=>` + fn checkInputIndices(input_indices: ${e.type.indices}) -> bool { + for (var i:u32 = 0; i < ${t.length}; i++) { + var input_index = ${e.indicesGet(`input_indices`,`i`)}; + if (input_index < 0 || input_index >= ${J(`uniforms.input_shape`,`i`,t.length)}) { + return false; + } + } + return true; + }`,Nu=(e,t,n,r)=>e.rank>r?` + ${e.indicesSet(`input_indices`,t,`channel`)}; + ${e.indicesSet(`input_indices`,n,`batch`)}; +`:``,Pu=(e,t,n,r,i)=>{let[a,o,s,c]=n.length===2?[-1,0,1,-1]:[0,2,3,1],l=e.type.value;return` + fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${l} { + var input_indices: ${e.type.indices}; + ${e.indicesSet(`input_indices`,o,`max(0, min(row, ${n[o]} - 1))`)}; + ${e.indicesSet(`input_indices`,s,`max(0, min(col, ${n[s]} - 1))`)}; + ${Nu(e,c,a,2)} + return ${e.getByIndices(`input_indices`)}; + } + + fn bilinearInterpolation(output_indices: ${t.type.indices}) -> ${l} { + var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); + var row:${l} = originalIndices[${o}]; + var col:${l} = originalIndices[${s}]; + ${r?`if (row < 0 || row > (${n[o]} - 1) || col < 0 || col > (${n[s]} - 1)) { + return ${i}; + }`:``}; + row = max(0, min(row, ${n[o]} - 1)); + col = max(0, min(col, ${n[s]} - 1)); + var row1: u32 = u32(row); + var col1: u32 = u32(col); + var row2: u32 = u32(row + 1); + var col2: u32 = u32(col + 1); + var channel: u32 = ${n.length>2?`u32(originalIndices[${c}])`:`0`}; + var batch: u32 = ${n.length>2?`u32(originalIndices[${a}])`:`0`}; + var x11: ${l} = getInputValue(batch, channel, row1, col1); + var x12: ${l} = getInputValue(batch, channel, row1, col2); + var x21: ${l} = getInputValue(batch, channel, row2, col1); + var x22: ${l} = getInputValue(batch, channel, row2, col2); + var dx1: ${l} = abs(row - ${l}(row1)); + var dx2: ${l} = abs(${l}(row2) - row); + var dy1: ${l} = abs(col - ${l}(col1)); + var dy2: ${l} = abs(${l}(col2) - col); + if (row1 == row2) { + dx1 = 0.5; + dx2 = 0.5; + } + if (col1 == col2) { + dy1 = 0.5; + dy2 = 0.5; + } + return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1); + }`},Fu=(e,t,n,r,i,a,o,s,c,l)=>{let u=n.length===2,d=!0,[f,p]=u?[0,1]:d?[2,3]:[1,2],m=e.type.value,h=o=>{let u=o===f?`row`:`col`;return` + fn ${u}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${t.type.indices}) -> ${m} { + var output_index = ${t.indicesGet(`output_indices`,o)}; + var originalIdx: ${m} = getOriginalCoordinateFromResizedCoordinate(output_index, ${i[o]}, + ${r[o]}, ${n[o]}, ${a[o]}, ${a[o]} + ${n.length}); + var fractOriginalIdx: ${m} = originalIdx - floor(originalIdx); + var coefs = getCubicInterpolationCoefs(fractOriginalIdx); + + if (${s} && (originalIdx < 0 || originalIdx > (${n[o]} - 1))) { + return ${c}; + } + var data: array<${m}, 4> = array<${m}, 4>(0.0, 0.0, 0.0, 0.0); + for (var i: i32 = -1; i < 3; i++) { + var ${u}: ${m} = originalIdx + ${m}(i); + if (${u} < 0 || ${u} >= ${n[o]}) { + ${l?`coefs[i + 1] = 0.0; + continue;`:s?`return ${c};`:`${u} = max(0, min(${u}, ${n[o]} - 1));`}; + } + var input_indices_copy: ${e.type.indices} = input_indices; + ${e.indicesSet(`input_indices_copy`,o,`u32(${u})`)}; + data[i + 1] = ${o===f?e.getByIndices(`input_indices_copy`):`rowCubicInterpolation(input_indices_copy, output_indices)`}; + } + return cubicInterpolation1D(data, coefs); + }`};return` + ${h(f)}; + ${h(p)}; + fn getCubicInterpolationCoefs(s: ${m}) -> array<${m}, 4> { + var absS = abs(s); + var coeffs: array<${m}, 4> = array<${m}, 4>(0.0, 0.0, 0.0, 0.0); + var oneMinusAbsS: ${m} = 1.0 - absS; + var twoMinusAbsS: ${m} = 2.0 - absS; + var onePlusAbsS: ${m} = 1.0 + absS; + coeffs[0] = ((${o} * onePlusAbsS - 5 * ${o}) * onePlusAbsS + 8 * ${o}) * onePlusAbsS - 4 * ${o}; + coeffs[1] = ((${o} + 2) * absS - (${o} + 3)) * absS * absS + 1; + coeffs[2] = ((${o} + 2) * oneMinusAbsS - (${o} + 3)) * oneMinusAbsS * oneMinusAbsS + 1; + coeffs[3] = ((${o} * twoMinusAbsS - 5 * ${o}) * twoMinusAbsS + 8 * ${o}) * twoMinusAbsS - 4 * ${o}; + return coeffs; + } + + fn cubicInterpolation1D(x: array<${m}, 4>, coefs: array<${m}, 4>) -> ${m} { + var coefsSum: ${m} = coefs[0] + coefs[1] + coefs[2] + coefs[3]; + return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum; + } + + fn bicubicInterpolation(output_indices: ${t.type.indices}) -> ${m} { + var input_indices: ${e.type.indices} = output_indices; + return colCubicInterpolation(input_indices, output_indices); + } + `},Iu=(e,t,n,r,i)=>{let[a,o,s,c,l]=n.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],u=e.type.value;return` + fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${u} { + var input_indices: ${e.type.indices}; + ${e.indicesSet(`input_indices`,o,`max(0, min(depth, ${n[o]} - 1))`)}; + ${e.indicesSet(`input_indices`,s,`max(0, min(height, ${n[s]} - 1))`)}; + ${e.indicesSet(`input_indices`,c,`max(0, min(width, ${n[c]} - 1))`)}; + ${Nu(e,l,a,3)} + return ${e.getByIndices(`input_indices`)}; + } + + fn trilinearInterpolation(output_indices: ${t.type.indices}) -> ${u} { + var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); + var depth:${u} = originalIndices[${o}]; + var height:${u} = originalIndices[${s}]; + var width:${u} = originalIndices[${c}]; + ${r?`if (depth < 0 || depth > (${n[o]} - 1) || height < 0 || height > (${n[s]} - 1) || width < 0 || (width > ${n[c]} - 1)) { + return ${i}; + }`:``}; + + depth = max(0, min(depth, ${n[o]} - 1)); + height = max(0, min(height, ${n[s]} - 1)); + width = max(0, min(width, ${n[c]} - 1)); + var depth1: u32 = u32(depth); + var height1: u32 = u32(height); + var width1: u32 = u32(width); + var depth2: u32 = u32(depth + 1); + var height2: u32 = u32(height + 1); + var width2: u32 = u32(width + 1); + var channel: u32 = ${n.length>3?`u32(originalIndices[${l}])`:`0`}; + var batch: u32 = ${n.length>3?`u32(originalIndices[${a}])`:`0`}; + + var x111: ${u} = getInputValue(batch, channel, depth1, height1, width1); + var x112: ${u} = getInputValue(batch, channel, depth1, height1, width2); + var x121: ${u} = getInputValue(batch, channel, depth1, height2, width1); + var x122: ${u} = getInputValue(batch, channel, depth1, height2, width2); + var x211: ${u} = getInputValue(batch, channel, depth2, height1, width1); + var x212: ${u} = getInputValue(batch, channel, depth2, height1, width2); + var x221: ${u} = getInputValue(batch, channel, depth2, height2, width1); + var x222: ${u} = getInputValue(batch, channel, depth2, height2, width2); + var dx1: ${u} = abs(depth - ${u}(depth1)); + var dx2: ${u} = abs(${u}(depth2) - depth); + var dy1: ${u} = abs(height - ${u}(height1)); + var dy2: ${u} = abs(${u}(height2) - height); + var dz1: ${u} = abs(width - ${u}(width1)); + var dz2: ${u} = abs(${u}(width2) - width); + if (depth1 == depth2) { + dx1 = 0.5; + dx2 = 0.5; + } + if (height1 == height2) { + dy1 = 0.5; + dy2 = 0.5; + } + if (width1 == width2) { + dz1 = 0.5; + dz2 = 0.5; + } + return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 + + x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1); + }`},Lu=(e,t,n,r,i,a)=>{let o=e.dims,s=Ou(a,t.axes,o.length),c=ku(o,r,i,t.axes),l=r.slice();r.length===0&&(l=o.map((e,t)=>e===0?1:c[t]/e),t.keepAspectRatioPolicy!==`stretch`&&(c=Au(o,l,t)));let u=X(`output`,e.dataType,c.length),d=Y(`input`,e.dataType,o.length),f=U.size(c),p=o.length===c.length&&o.every((e,t)=>e===c[t]),m=t.coordinateTransformMode===`tf_crop_and_resize`,h=t.extrapolationValue,g=d.type.value,_=e=>` + ${p?``:` + ${Eu(t.coordinateTransformMode,g)}; + ${(()=>{switch(t.mode){case`nearest`:return` + ${Q(d,o)}; + ${Du(t.nearestMode,n,g)}; + ${Mu(d,u,o,c,l.length,s.length,m)}; + `;case`linear`:return` + ${ju(u,o,c,l.length,s.length)}; + ${(()=>{if(o.length===2||o.length===4)return`${Pu(d,u,o,m,h)}`;if(o.length===3||o.length===5)return`${Iu(d,u,o,m,h)}`;throw Error(`Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.`)})()}; + `;case`cubic`:return` + ${(()=>{if(o.length===2||o.length===4)return`${Fu(d,u,o,c,l,s,t.cubicCoeffA,m,t.extrapolationValue,t.excludeOutside)}`;throw Error(`Cubic mode only supports input dims 2 and 4 are supported in linear mode.`)})()}; + `;default:throw Error(`Invalid resize mode`)}})()}; + `} + ${e.registerUniform(`output_size`,`u32`).registerUniform(`scales`,`f32`,l.length).registerUniform(`roi`,`f32`,s.length).declareVariables(d,u)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + ${p?`output[global_idx] = input[global_idx];`:` + let output_indices = ${u.offsetToIndices(`global_idx`)}; + var input_indices: ${d.type.indices}; + ${(()=>{switch(t.mode){case`nearest`:return`input_indices = calculateInputIndicesFromOutputIndices(output_indices); + if (checkInputIndices(input_indices)) { + output[global_idx] = ${d.getByIndices(`input_indices`)}; + } else { + output[global_idx] = ${t.extrapolationValue}; + }`;case`linear`:return`output[global_idx] = ${o.length===2||o.length===4?`bilinearInterpolation`:`trilinearInterpolation`}(output_indices);`;case`cubic`:return`output[global_idx] = bicubicInterpolation(output_indices);`;default:throw Error(`Unsupported resize mode: ${t.mode}`)}})()}; +`} + }`;return{name:`Resize`,shaderCache:{hint:`${t.cacheKey}|${n}|${l.length>0?t.mode===`cubic`?l:l.length:``}|${i.length>0?i:``}|${s.length>0?s:``}|${p}|${t.mode===`nearest`?o.length:o}`,inputDependencies:[`rank`]},getShaderSource:_,getRunData:()=>({outputs:[{dims:c,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},{type:1,data:l},{type:1,data:s},...K(o,c)]})}},Ru=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},zu=(e,t)=>{let n=[],r=[],i=[],a=Ru(e);if(t.antialias!==0)throw Error(`Only default value (0) for Antialias attribute is supported`);wu(e.inputs,t,a,n,r,i),e.compute(Lu(e.inputs[0],t,a,n,r,i),{inputs:[0]})},Bu=e=>{let t=e.antialias,n=e.axes,r=e.coordinateTransformMode,i=e.cubicCoeffA,a=e.excludeOutside!==0,o=e.extrapolationValue,s=e.keepAspectRatioPolicy,c=e.mode,l=e.nearestMode===``?`simple`:e.nearestMode;return G({antialias:t,axes:n,coordinateTransformMode:r,cubicCoeffA:i,excludeOutside:a,extrapolationValue:o,keepAspectRatioPolicy:s,mode:c,nearestMode:l})}}),Hu,Uu,Wu,Gu=L(()=>{"use strict";V(),W(),Z(),Hu=e=>{if(!e||e.length<3)throw Error(`layerNorm requires at least 3 inputs.`);let t=e[0],n=e[1],r=e[2];if(t.dataType!==n.dataType||t.dataType!==r.dataType)throw Error(`All inputs must have the same data type`);if(t.dims.length!==3&&t.dims.length!==2)throw Error(`Input must be 2D or 3D`);if(n.dims.length!==3&&n.dims.length!==2)throw Error(`Skip must be 2D or 3D`);let i=t.dims[t.dims.length-1],a=t.dims[t.dims.length-2];if(n.dims[n.dims.length-1]!==i)throw Error(`Skip must have the same hidden size as input`);if(n.dims[n.dims.length-2]!==a)throw Error(`Skip must have the same sequence length as input`);if(r.dims.length!==1)throw Error(`Gamma must be 1D`);if(r.dims[r.dims.length-1]!==i)throw Error(`Gamma must have the same hidden size as input`);if(e.length>3){let t=e[3];if(t.dims.length!==1)throw Error(`Beta must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Beta must have the same hidden size as input`)}if(e.length>4){let t=e[4];if(t.dims.length!==1)throw Error(`Bias must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Bias must have the same hidden size as input`)}},Uu=(e,t,n,r)=>{let i=t.simplified,a=e[0].dims,o=U.size(a),s=a,c=o,l=a.slice(-1)[0],u=r?a.slice(0,-1).concat(1):[],d=!i&&e.length>3,f=e.length>4,p=r&&n>1,m=r&&n>2,h=n>3,g=64,_=_r(l),v=[{type:12,data:c},{type:12,data:_},{type:12,data:l},{type:1,data:t.epsilon}],y=t=>{let n=[{name:`output_size`,type:`u32`},{name:`components`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`epsilon`,type:`f32`}],r=[Y(`x`,e[0].dataType,e[0].dims,_),Y(`skip`,e[1].dataType,e[1].dims,_),Y(`gamma`,e[2].dataType,e[2].dims,_)];d&&r.push(Y(`beta`,e[3].dataType,e[3].dims,_)),f&&r.push(Y(`bias`,e[4].dataType,e[4].dims,_)),r.push(X(`output`,e[0].dataType,s,_)),p&&r.push(X(`mean_output`,1,u)),m&&r.push(X(`inv_std_output`,1,u)),h&&r.push(X(`input_skip_bias_sum`,e[0].dataType,s,_));let a=hr(e[0].dataType),o=hr(1,_);return` + + ${t.registerUniforms(n).declareVariables(...r)} + var sum_shared : array<${o}, ${g}>; + var sum_squared_shared : array<${o}, ${g}>; + + ${t.mainStart([g,1,1])} + let ix = local_id.x; + let iy = global_id.x / ${g}; + + let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components; + var stride = hidden_size_vectorized / ${g}; + let offset = ix * stride + iy * hidden_size_vectorized; + let offset1d = stride * ix; + if (ix == ${g-1}) { + stride = hidden_size_vectorized - stride * ix; + } + for (var i: u32 = 0; i < stride; i++) { + let skip_value = skip[offset + i]; + let bias_value = ${f?`bias[offset1d + i]`:a+`(0.0)`}; + let input_value = x[offset + i]; + let value = input_value + skip_value + bias_value; + ${h?`input_skip_bias_sum[offset + i] = value;`:``} + output[offset + i] = value; + let f32_value = ${vr(a,_,`value`)}; + sum_shared[ix] += f32_value; + sum_squared_shared[ix] += f32_value * f32_value; + } + workgroupBarrier(); + + var reduce_size : u32 = ${g}; + for (var curr_size = reduce_size >> 1; curr_size > 0; curr_size = reduce_size >> 1) { + reduce_size = curr_size + (reduce_size & 1); + if (ix < curr_size) { + sum_shared[ix] += sum_shared[ix + reduce_size]; + sum_squared_shared[ix] += sum_squared_shared[ix + reduce_size]; + } + workgroupBarrier(); + } + + let sum = sum_shared[0]; + let square_sum = sum_squared_shared[0]; + let mean = ${yr(`sum`,_)} / f32(uniforms.hidden_size); + let inv_std_dev = inverseSqrt(${yr(`square_sum`,_)} / f32(uniforms.hidden_size) ${i?``:`- mean * mean`} + uniforms.epsilon); + ${p?`mean_output[global_idx] = mean;`:``} + ${m?`inv_std_output[global_idx] = inv_std_dev;`:``} + + for (var i: u32 = 0; i < stride; i++) { + output[offset + i] = (output[offset + i] ${i?``:`- ${a}(mean)`}) * + ${a}(inv_std_dev) * gamma[offset1d + i] + ${d?`+ beta[offset1d + i]`:``}; + } + }`},b=[{dims:s,dataType:e[0].dataType}];return n>1&&b.push({dims:u,dataType:1}),n>2&&b.push({dims:u,dataType:1}),n>3&&b.push({dims:a,dataType:e[0].dataType}),{name:`SkipLayerNormalization`,shaderCache:{hint:`${_};${p};${m};${h}`,inputDependencies:e.map((e,t)=>`type`)},getShaderSource:y,getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(c/l)},programUniforms:v})}},Wu=(e,t)=>{Hu(e.inputs);let n=[0];e.outputCount>1&&n.push(-3),e.outputCount>2&&n.push(-3),e.outputCount>3&&n.push(3),e.compute(Uu(e.inputs,t,e.outputCount,!1),{outputs:n})}}),Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed=L(()=>{"use strict";V(),W(),fr(),Z(),Ku=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw Error(`axes, starts and ends must have the same length`)}else if(t.starts.length!==t.ends.length)throw Error(`starts and ends must have the same length`);e.slice(1).forEach((t,n)=>{if(e[n+1].dataType!==6&&e[n+1].dataType!==7)throw Error(`Input ${n} must be an array of int32 or int64`)})},qu=(e,t)=>{let n=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(e=>n.push(Number(e)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(e=>n.push(Number(e)));else throw Error(`Input ${t} must be an array of int32 or int64`);return n},Ju=(e,t)=>{if(e.length>1){let t=qu(e,1),n=qu(e,2),r=qu(e,3);return r.length===0&&(r=[...Array(e[0].dims.length).keys()]),G({starts:t,ends:n,axes:r})}else return t},Yu=(e,t,n,r,i)=>{let a=e;return e<0&&(a+=n[r[t]]),i[t]<0?Math.max(0,Math.min(a,n[r[t]]-1)):Math.max(0,Math.min(a,n[r[t]]))},Xu=(e,t,n)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { + var input_indices: ${e.type.indices}; + var carry = 0u; + for (var i = ${n.length}; i >= 0; i--) { + let input_shape_i = ${J(`uniforms.input_shape`,`i`,n.length)}; + let steps_i = ${J(`uniforms.steps`,`i`,n.length)}; + let signs_i = ${J(`uniforms.signs`,`i`,n.length)}; + let starts_i = ${J(`uniforms.starts`,`i`,n.length)}; + var output_index = ${t.indicesGet(`output_indices`,`i`)}; + var input_index = output_index * steps_i + starts_i + carry; + carry = input_index / input_shape_i; + input_index = input_index % input_shape_i; + if (signs_i < 0) { + input_index = input_shape_i - input_index - 1u + starts_i; + } + ${e.indicesSet(`input_indices`,`i`,`input_index`)}; + } + return input_indices; + }`,Zu=(e,t)=>{let n=e[0].dims,r=U.size(n),i=t.axes.length>0?U.normalizeAxes(t.axes,n.length):[...Array(n.length).keys()],a=qu(e,4);a.forEach(e=>e!==0||(()=>{throw Error(`step cannot be 0`)})),a.length===0&&(a=Array(i.length).fill(1));let o=t.starts.map((e,t)=>Yu(e,t,n,i,a)),s=t.ends.map((e,t)=>Yu(e,t,n,i,a));if(i.length!==o.length||i.length!==s.length)throw Error(`start, ends and axes should have the same number of elements`);if(i.length!==n.length)for(let e=0;eMath.sign(e));a.forEach((e,t,n)=>{if(e<0){let r=(s[t]-o[t])/e,i=o[t],c=i+r*a[t];o[t]=c,s[t]=i,n[t]=-e}});let l=n.slice(0);i.forEach((e,t)=>{l[e]=Math.ceil((s[e]-o[e])/a[e])});let u={dims:l,dataType:e[0].dataType},d=X(`output`,e[0].dataType,l.length),f=Y(`input`,e[0].dataType,e[0].dims.length),p=U.size(l),m=[{name:`outputSize`,type:`u32`},{name:`starts`,type:`u32`,length:o.length},{name:`signs`,type:`i32`,length:c.length},{name:`steps`,type:`u32`,length:a.length}],h=[{type:12,data:p},{type:12,data:o},{type:6,data:c},{type:12,data:a},...K(e[0].dims,l)],g=e=>` + ${e.registerUniforms(m).declareVariables(f,d)} + ${Xu(f,d,n)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + let output_indices = ${d.offsetToIndices(`global_idx`)}; + let input_indices = calculateInputIndices(output_indices); + ${d.setByOffset(`global_idx`,f.getByIndices(`input_indices`))} + }`;return{name:`Slice`,shaderCache:{hint:`${c.length}_${o.length}_${a.length}`,inputDependencies:[`rank`]},getShaderSource:g,getRunData:()=>({outputs:[u],dispatchGroup:{x:Math.ceil(r/64)},programUniforms:h})}},Qu=(e,t)=>{Ku(e.inputs,t);let n=Ju(e.inputs,t);e.compute(Zu(e.inputs,n),{inputs:[0]})},$u=e=>{let t=e.starts,n=e.ends,r=e.axes;return G({starts:t,ends:n,axes:r})}}),td,nd,rd,id,ad=L(()=>{"use strict";V(),W(),fr(),Pr(),Z(),td=e=>{if(!e||e.length!==1)throw Error(`Softmax op requires 1 input.`)},nd=(e,t)=>{let n=e.inputs[0],r=n.dims,i=U.size(r),a=r.length,o=U.normalizeAxis(t.axis,a),s=ot),l[o]=a-1,l[a-1]=o,c=e.compute(jr(n,l),{inputs:[n],outputs:[-1]})[0]):c=n;let u=c.dims,d=u[a-1],f=i/d,p=_r(d),m=d/p,h=64;f===1&&(h=256);let g=(e,t)=>t===4?`max(max(${e}.x, ${e}.y), max(${e}.z, ${e}.w))`:t===2?`max(${e}.x, ${e}.y)`:t===3?`max(max(${e}.x, ${e}.y), ${e}.z)`:e,_=Y(`x`,c.dataType,c.dims,p),v=X(`result`,c.dataType,c.dims,p),y=_.type.value,b=hr(c.dataType)===`f32`?`var threadMax = ${y}(-3.402823e+38f);`:`var threadMax = ${y}(-65504.0h);`,x=e=>` + var rowMaxShared : ${y}; + var rowSumShared : ${y}; + var threadShared : array<${y}, ${h}>; + + fn getValue(row: i32, col: i32, row_stride: i32) -> ${y} { + let index = row * row_stride + col; + return x[index]; + } + + fn setValue(row: i32, col: i32, row_stride: i32, value: ${y}) { + let index = row * row_stride + col; + result[index] = value; + } + ${e.registerUniform(`packedCols`,`i32`).declareVariables(_,v)} + ${e.mainStart(h)} + let gindex = i32(global_idx); + let lindex = i32(local_idx); + const wg = ${h}; + let row = gindex / wg; + let cols = uniforms.packedCols; + let row_stride : i32 = uniforms.packedCols; + + // find the rows max + ${b} + for (var col = lindex; col < cols; col += wg) { + let value = getValue(row, col, row_stride); + threadMax = max(threadMax, value); + } + if (lindex < cols) { + threadShared[lindex] = threadMax; + } + workgroupBarrier(); + + var reduceSize = min(cols, wg); + for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) { + reduceSize = currSize + (reduceSize & 1); + if (lindex < currSize) { + threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]); + } + workgroupBarrier(); + } + if (lindex == 0) { + rowMaxShared = ${y}(${g(`threadShared[0]`,p)}); + } + workgroupBarrier(); + + // find the rows sum + var threadSum = ${y}(0.0); + for (var col = lindex; col < cols; col += wg) { + let subExp = exp(getValue(row, col, row_stride) - rowMaxShared); + threadSum += subExp; + } + threadShared[lindex] = threadSum; + workgroupBarrier(); + + for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) { + if (lindex < currSize) { + threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize]; + } + workgroupBarrier(); + } + if (lindex == 0) { + rowSumShared = ${y}(${yr(`threadShared[0]`,p)}); + } + workgroupBarrier(); + + // calculate final value for each element in the row + for (var col = lindex; col < cols; col += wg) { + let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared; + setValue(row, col, row_stride, value); + } + }`,S=e.compute({name:`Softmax`,shaderCache:{hint:`${p};${h}`,inputDependencies:[`type`]},getRunData:()=>({outputs:[{dims:u,dataType:c.dataType}],dispatchGroup:{x:f},programUniforms:[{type:6,data:m}]}),getShaderSource:x},{inputs:[c],outputs:[s?-1:0]})[0];s&&e.compute(jr(S,l),{inputs:[S]})},rd=(e,t)=>{td(e.inputs),nd(e,t)},id=e=>G({axis:e.axis})}),od,sd,cd,ld,ud,dd=L(()=>{"use strict";V(),W(),Z(),od=e=>Array.from(e.getBigInt64Array(),Number),sd=e=>{if(!e||e.length!==2)throw Error(`Tile requires 2 inputs.`);if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw Error(`Tile only support float, float16, int32, and uint32 data types`);if(e[1].dataType!==7)throw Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw Error("Tile `repeats` input should be 1-D");if(od(e[1]).length!==e[0].dims.length)throw Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},cd=(e,t)=>{let n=[];for(let r=0;r{let n=e[0].dims,r=t??od(e[1]),i=cd(n,r),a=U.size(i),o=e[0].dataType,s=Y(`input`,o,n.length),c=X(`output`,o,i.length),l=e=>` + const inputShape = ${s.indices(...n)}; + ${e.registerUniform(`output_size`,`u32`).declareVariables(s,c)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let output_indices = ${c.offsetToIndices(`global_idx`)}; + var input_indices: ${s.type.indices}; + for (var i = 0; i < ${n.length}; i++) { + let input_dim_i = ${s.indicesGet(`uniforms.input_shape`,`i`)}; + let input_dim_value = ${c.indicesGet(`output_indices`,`i`)} % input_dim_i; + + ${s.indicesSet(`input_indices`,`i`,`input_dim_value`)} + } + ${c.setByOffset(`global_idx`,s.getByIndices(`input_indices`))} + }`;return{name:`Tile`,shaderCache:{hint:`${r}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:[{type:12,data:a},...K(e[0].dims,i)]}),getShaderSource:l}},ud=e=>{sd(e.inputs),e.compute(ld(e.inputs),{inputs:[0]})}}),fd,pd,md,hd=L(()=>{"use strict";V(),W(),Z(),fd=(e,t,n,r,i)=>{let a=X(`output_data`,i,n.length,4),o=Y(`a_data`,t[1].dataType,t[1].dims.length,4),s=Y(`b_data`,t[2].dataType,t[2].dims.length,4),c=Y(`c_data`,t[0].dataType,t[0].dims.length,4),l,u=(e,t,n)=>`select(${t}, ${e}, ${n})`;if(!r)l=a.setByOffset(`global_idx`,u(o.getByOffset(`global_idx`),s.getByOffset(`global_idx`),c.getByOffset(`global_idx`)));else{let e=(e,t,n=``)=>{let r=`a_data[index_a${t}][component_a${t}]`,i=`b_data[index_b${t}][component_b${t}]`,l=`bool(c_data[index_c${t}] & (0xffu << (component_c${t} * 8)))`;return` + let output_indices${t} = ${a.offsetToIndices(`global_idx * 4u + ${t}u`)}; + let offset_a${t} = ${o.broadcastedIndicesToOffset(`output_indices${t}`,a)}; + let offset_b${t} = ${s.broadcastedIndicesToOffset(`output_indices${t}`,a)}; + let offset_c${t} = ${c.broadcastedIndicesToOffset(`output_indices${t}`,a)}; + let index_a${t} = offset_a${t} / 4u; + let index_b${t} = offset_b${t} / 4u; + let index_c${t} = offset_c${t} / 4u; + let component_a${t} = offset_a${t} % 4u; + let component_b${t} = offset_b${t} % 4u; + let component_c${t} = offset_c${t} % 4u; + ${e}[${t}] = ${n}(${u(r,i,l)}); + `};l=i===9?` + var data = vec4(0); + ${e(`data`,0,`u32`)} + ${e(`data`,1,`u32`)} + ${e(`data`,2,`u32`)} + ${e(`data`,3,`u32`)} + output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:` + ${e(`output_data[global_idx]`,0)} + ${e(`output_data[global_idx]`,1)} + ${e(`output_data[global_idx]`,2)} + ${e(`output_data[global_idx]`,3)} + `}return` + ${e.registerUniform(`vec_size`,`u32`).declareVariables(c,o,s,a)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + ${l} + }`},pd=e=>{let t=e[1].dims,n=e[2].dims,r=e[0].dims,i=e[1].dataType,a=!(U.areEqual(t,n)&&U.areEqual(n,r)),o=t,s=U.size(t);if(a){let e=Mn.calcShape(Mn.calcShape(t,n,!1),r,!1);if(!e)throw Error(`Can't perform where op on the given tensors`);o=e,s=U.size(o)}let c=Math.ceil(s/4);return{name:`Where`,shaderCache:{inputDependencies:[`rank`,`rank`,`rank`]},getShaderSource:t=>fd(t,e,o,a,i),getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64/4)},programUniforms:[{type:12,data:c},...K(r,t,n,o)]})}},md=e=>{e.compute(pd(e.inputs))}}),gd,_d=L(()=>{"use strict";Pi(),Ui(),Ji(),Qi(),Ja(),co(),go(),ds(),Cs(),Ds(),Ns(),Gs(),Zs(),ec(),ac(),lc(),mc(),yc(),wc(),zc(),dl(),gl(),bl(),Cl(),kl(),qc(),zl(),au(),uu(),mu(),xu(),ki(),Vu(),al(),Gu(),ed(),ad(),tl(),dd(),Pr(),Wa(),hd(),gd=new Map([[`Abs`,[ta]],[`Acos`,[na]],[`Acosh`,[ra]],[`Add`,[Qa]],[`ArgMax`,[Mi,Ni]],[`ArgMin`,[ji,Ni]],[`Asin`,[ia]],[`Asinh`,[aa]],[`Atan`,[oa]],[`Atanh`,[sa]],[`Attention`,[Hi]],[`AveragePool`,[Xl,Yl]],[`BatchNormalization`,[qi]],[`BiasAdd`,[Zi]],[`BiasSplitGelu`,[qa]],[`Cast`,[la,ca]],[`Ceil`,[fa]],[`Clip`,[da]],[`Concat`,[mo,ho]],[`Conv`,[us,os]],[`ConvTranspose`,[Ss,vs]],[`Cos`,[pa]],[`Cosh`,[ma]],[`CumSum`,[Ts,Es]],[`DepthToSpace`,[js,Ms]],[`DequantizeLinear`,[cu,lu]],[`Div`,[$a]],[`Einsum`,[Us,Ws]],[`Elu`,[ga,ha]],[`Equal`,[eo]],[`Erf`,[va]],[`Exp`,[ya]],[`Expand`,[Xs]],[`FastGelu`,[$s]],[`Floor`,[ba]],[`FusedConv`,[us,os]],[`Gather`,[ic,rc]],[`GatherElements`,[vc,_c]],[`GatherBlockQuantized`,[fc,pc]],[`GatherND`,[sc,cc]],[`Gelu`,[xa]],[`Gemm`,[Cc,Sc]],[`GlobalAveragePool`,[$l,Ql]],[`GlobalMaxPool`,[iu,ru]],[`Greater`,[io]],[`GreaterOrEqual`,[oo]],[`GridSample`,[Lc,Rc]],[`GroupQueryAttention`,[ul]],[`HardSigmoid`,[ka,Oa]],[`InstanceNormalization`,[hl]],[`LayerNormalization`,[yl]],[`LeakyRelu`,[Sa,ha]],[`Less`,[ao]],[`LessOrEqual`,[so]],[`Log`,[Ba]],[`MatMul`,[Sl]],[`MatMulNBits`,[Dl,Ol]],[`MaxPool`,[tu,nu]],[`Mul`,[to]],[`MultiHeadAttention`,[Kc,Hc]],[`Neg`,[wa]],[`Not`,[Ca]],[`Pad`,[Rl]],[`Pow`,[no]],[`QuickGelu`,[Ua,ha]],[`Range`,[pu]],[`Reciprocal`,[Ta]],[`ReduceMin`,[wi]],[`ReduceMean`,[yi]],[`ReduceMax`,[Ci]],[`ReduceSum`,[Ei]],[`ReduceProd`,[Ti]],[`ReduceL1`,[bi]],[`ReduceL2`,[xi]],[`ReduceLogSum`,[Oi]],[`ReduceLogSumExp`,[Si]],[`ReduceSumSquare`,[Di]],[`Relu`,[Ea]],[`Resize`,[zu,Bu]],[`RotaryEmbedding`,[il]],[`ScatterND`,[bu,yu]],[`Sigmoid`,[Da]],[`Sin`,[Aa]],[`Sinh`,[ja]],[`Slice`,[Qu,$u]],[`SkipLayerNormalization`,[Wu]],[`Split`,[$c,el]],[`Sqrt`,[Ma]],[`Softmax`,[rd,id]],[`Sub`,[ro]],[`Tan`,[Na]],[`Tanh`,[Fa]],[`ThresholdedRelu`,[za,ha]],[`Tile`,[ud]],[`Transpose`,[Mr,Nr]],[`Where`,[md]]])}),vd,yd=L(()=>{"use strict";_t(),An(),Z(),vd=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n,r,i){at(e.programInfo.name);let a=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let s=[];for(let e of t)s.push({binding:s.length,resource:{buffer:e.buffer}});for(let e of n)s.push({binding:s.length,resource:{buffer:e.buffer}});i&&s.push({binding:s.length,resource:i});let c=a.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:s,label:e.programInfo.name});if(this.backend.sessionStatus===`capturing`){let t={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:c,dispatchGroup:r};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(t)}o.setPipeline(e.computePipeline),o.setBindGroup(0,c),o.dispatchWorkgroups(...r),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===`at-passes`)&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),ot(e.programInfo.name)}dispose(){}build(e,t){at(e.name);let n=this.backend.device,r=[];[{feature:`shader-f16`,extension:`f16`},{feature:`subgroups`,extension:`subgroups`}].forEach(e=>{n.features.has(e.feature)&&r.push(`enable ${e.extension};`)});let i=wr(t,this.backend.device.limits),a=e.getShaderSource(i),o=`${r.join(` +`)} +${i.additionalImplementations} +${a}`,s=n.createShaderModule({code:o,label:e.name});H(`verbose`,()=>`[WebGPU] ${e.name} shader code: ${o}`);let c=n.createComputePipeline({compute:{module:s,entryPoint:`main`},layout:`auto`,label:e.name});return ot(e.name),{programInfo:e,computePipeline:c,uniformVariablesInfo:i.variablesInfo}}normalizeDispatchGroupSize(e){let t=typeof e==`number`?e:e.x,n=typeof e==`number`?1:e.y||1,r=typeof e==`number`?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=i&&n<=i&&r<=i)return[t,n,r];let a=t*n*r,o=Math.ceil(Math.sqrt(a));if(o>i){if(o=Math.ceil(Math.cbrt(a)),o>i)throw Error(`Total dispatch size exceeds WebGPU maximum.`);return[o,o,o]}else return[o,o,1]}}}),bd={};be(bd,{WebGpuBackend:()=>wd});var xd,Sd,Cd,wd,Td=L(()=>{"use strict";_t(),V(),An(),Rn(),ur(),_d(),yd(),xd=(e,t)=>{if(t.length!==e.length)throw Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let n=[];for(let r=0;r{var r,i;let a=e.name;return(r=e.shaderCache)?.hint&&(a+=`[`+e.shaderCache.hint+`]`),a+=`:`+n+`:${xd(t,(i=e.shaderCache)?.inputDependencies??Array(t.length).fill(`dims`))}`,a},Cd=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},wd=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus=`default`,this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw Error(`currentKernelCustomData(): currentKernelId is null. (should not happen)`);let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,t){this.env=e;let n=[],r={requiredLimits:{maxComputeWorkgroupStorageSize:t.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:t.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:t.limits.maxStorageBufferBindingSize,maxBufferSize:t.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:t.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:t.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:t.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:t.limits.maxComputeWorkgroupSizeZ},requiredFeatures:n},i=e=>t.features.has(e)&&n.push(e)&&!0;i(`chromium-experimental-timestamp-query-inside-passes`)||i(`timestamp-query`),i(`shader-f16`),i(`subgroups`),this.device=await t.requestDevice(r),this.adapterInfo=new Cd(t.info||await t.requestAdapterInfo()),this.gpuDataManager=lr(this),this.programManager=new vd(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,On(e.logLevel,!!e.debug),this.device.onuncapturederror=e=>{e.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${e.error.message}`)},Object.defineProperty(this.env.webgpu,`device`,{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,`adapter`,{value:t,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<`u`&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||=this.device.createCommandEncoder(),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),t={};this.queryType===`at-passes`&&(t.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(t)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;at(),this.endComputePass();let e;this.queryType!==`none`&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==`none`&&e.mapAsync(GPUMapMode.READ).then(()=>{let t=new BigUint64Array(e.getMappedRange()),n=this.pendingQueries.get(e);for(let e=0;e`u`&&(this.queryTimeBase=f);let m=Number(f-this.queryTimeBase),h=Number(p-this.queryTimeBase);if(!Number.isSafeInteger(m)||!Number.isSafeInteger(h))throw RangeError(`incorrect timestamp range`);if((r=this.env.webgpu.profiling)?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:u.map(e=>({dims:e.dims,dataType:hn(e.dataType)})),outputsMetadata:d.map(e=>({dims:e.dims,dataType:hn(e.dataType)})),kernelId:a,kernelType:s,kernelName:c,programName:l,startTime:m,endTime:h});else{let e=``;u.forEach((t,n)=>{e+=`input[${n}]: [${t.dims}] | ${hn(t.dataType)}, `});let t=``;d.forEach((e,n)=>{t+=`output[${n}]: [${e.dims}] | ${hn(e.dataType)}, `}),console.log(`[profiling] kernel "${a}|${s}|${c}|${l}" ${e}${t}execution time: ${h-m} ns`)}rt(`GPU`,`${l}::${f}::${p}`)}e.unmap(),this.pendingQueries.delete(e)}),ot()}run(e,t,n,r,i,a){at(e.name);let o=[];for(let e=0;et):n;if(u.length!==s.length)throw Error(`Output size ${u.length} must be equal to ${s.length}.`);let d=[],f=[];for(let e=0;e=a)throw Error(`Invalid output index: ${u[e]}`);if(u[e]===-3)continue;let t=u[e]===-1,n=u[e]===-2,o=t||n?i(s[e].dataType,s[e].dims):r(u[e],s[e].dataType,s[e].dims);if(d.push(o),o.data===0)continue;let c=this.gpuDataManager.get(o.data);if(!c)throw Error(`no GPU data for output: ${o.data}`);if(t&&this.temporaryData.push(c),n){let e=this.kernelPersistentData.get(this.currentKernelId);e||(e=[],this.kernelPersistentData.set(this.currentKernelId,e)),e.push(c)}f.push(c)}if(o.length!==t.length||f.length!==d.length){if(f.length===0)return ot(e.name),d;throw Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let p;if(l){let e=0,t=[];l.forEach(n=>{let r=typeof n.data==`number`?[n.data]:n.data;if(r.length===0)return;let i=n.type===10?2:4,a,o;n.type===10?(o=r.length>4?16:r.length>2?8:r.length*i,a=r.length>4?16:i*r.length):(o=r.length<=2?r.length*i:16,a=16),e=Math.ceil(e/o)*o,t.push(e);let s=n.type===10?8:4;e+=r.length>4?Math.ceil(r.length/s)*a:r.length*i});let n=16;e=Math.ceil(e/n)*n;let r=new ArrayBuffer(e);l.forEach((e,n)=>{let i=t[n],a=typeof e.data==`number`?[e.data]:e.data;if(e.type===6)new Int32Array(r,i,a.length).set(a);else if(e.type===12)new Uint32Array(r,i,a.length).set(a);else if(e.type===10)new Uint16Array(r,i,a.length).set(a);else if(e.type===1)new Float32Array(r,i,a.length).set(a);else throw Error(`Unsupported uniform type: ${hn(e.type)}`)});let i=this.gpuDataManager.create(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(i.buffer,0,r,0,e),this.gpuDataManager.release(i.id),p={offset:0,size:e,buffer:i.buffer}}let m=this.programManager.normalizeDispatchGroupSize(c),h=m[1]===1&&m[2]===1,g=Sd(e,t,h),_=this.programManager.getArtifact(g);if(_||(_=this.programManager.build(e,m),this.programManager.setArtifact(g,_),H(`info`,()=>`[artifact] key: ${g}, programName: ${e.name}`)),l&&_.uniformVariablesInfo){if(l.length!==_.uniformVariablesInfo.length)throw Error(`Uniform variables count mismatch: expect ${_.uniformVariablesInfo.length}, got ${l.length} in program "${_.programInfo.name}".`);for(let e=0;e`[ProgramManager] run "${e.name}" (key=${g}) with ${m[0]}x${m[1]}x${m[2]}`),this.queryType!==`none`||this.sessionStatus===`capturing`){let e={kernelId:this.currentKernelId,programName:_.programInfo.name,inputTensorViews:t,outputTensorViews:d};this.pendingKernels.push(e),this.sessionStatus===`capturing`&&this.capturedPendingKernels.get(this.currentSessionId).push(e)}return this.programManager.run(_,o,f,m,p),ot(e.name),d}upload(e,t){this.gpuDataManager.upload(e,t)}memcpy(e,t){this.gpuDataManager.memcpy(e,t)}async download(e,t){await this.gpuDataManager.download(e,t)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,t,n,r){let i=gd.get(e);if(!i)throw Error(`kernel not implemented: ${e}`);let a={kernelType:e,kernelName:r,kernelEntry:i[0],attributes:[i[1],n]};this.kernels.set(t,a)}releaseKernel(e){let t=this.kernelPersistentData.get(e);if(t){for(let e of t)this.gpuDataManager.release(e.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,t,n){let r=this.kernels.get(e);if(!r)throw Error(`kernel not created: ${e}`);let i=r.kernelType,a=r.kernelName,o=r.kernelEntry,s=r.attributes;if(this.currentKernelId!==null)throw Error(`kernel "[${i}] ${a}" is not allowed to be called recursively`);this.currentKernelId=e,s[0]&&(s[1]=s[0](s[1]),s[0]=void 0),H(`info`,()=>`[WebGPU] Start to run kernel "[${i}] ${a}"...`);let c=this.env.debug;this.temporaryData=[];try{return c&&this.device.pushErrorScope(`validation`),o(t,s[1]),0}catch(e){return n.push(Promise.resolve(`[WebGPU] Kernel "[${i}] ${a}" failed. ${e}`)),1}finally{c&&n.push(this.device.popErrorScope().then(e=>e?`GPU validation error for kernel "[${i}] ${a}": ${e.message}`:null));for(let e of this.temporaryData)this.gpuDataManager.release(e.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,t,n,r){let i=this.sessionExternalDataMapping.get(e);i||(i=new Map,this.sessionExternalDataMapping.set(e,i));let a=i.get(t),o=this.gpuDataManager.registerExternalBuffer(n,r,a);return i.set(t,[o,n]),o}unregisterBuffers(e){let t=this.sessionExternalDataMapping.get(e);t&&(t.forEach(e=>this.gpuDataManager.unregisterExternalBuffer(e[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let t=this.gpuDataManager.get(e);if(!t)throw Error(`no GPU data for buffer: ${e}`);return t.buffer}createDownloader(e,t,n){return async()=>{let r=await sr(this,e,t);return Ln(r.buffer,n)}}writeTimestamp(e){this.queryType===`inside-passes`&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){var e;this.queryType=`none`,((e=this.env.webgpu.profiling)?.mode===`default`||(typeof this.env.trace>`u`?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(`chromium-experimental-timestamp-query-inside-passes`)?this.queryType=`inside-passes`:this.device.features.has(`timestamp-query`)&&(this.queryType=`at-passes`),this.queryType!==`none`&&typeof this.querySet>`u`&&(this.querySet=this.device.createQuerySet({type:`timestamp`,count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){H(`info`,`captureBegin`),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=`capturing`}captureEnd(){H(`info`,`captureEnd`),this.flush(),this.sessionStatus=`default`}replay(){H(`info`,`replay`),this.sessionStatus=`replaying`;let e=this.capturedCommandList.get(this.currentSessionId),t=this.capturedPendingKernels.get(this.currentSessionId),n=e.length;this.pendingKernels=[];for(let r=0;r=this.maxDispatchNumber||this.queryType===`at-passes`)&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=`default`}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),Ed={};be(Ed,{init:()=>kd});var Dd,Od,kd,Ad=L(()=>{"use strict";V(),An(),W(),$n(),Dd=class e{constructor(e,t,n,r){this.module=e,this.dataType=t,this.data=n,this.dims=r}getFloat32Array(){if(this.dataType!==1)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,e)}getBigInt64Array(){if(this.dataType!==7)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,e)}getInt32Array(){if(this.dataType!==6)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,e)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw Error(`Invalid data type`);let e=U.size(this.dims);return e===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,e)}reshape(t){if(U.size(t)!==U.size(this.dims))throw Error(`Invalid new shape`);return new e(this.module,this.dataType,this.data,t)}},Od=class{constructor(e,t,n){this.module=e,this.backend=t,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=t.adapterInfo;let r=e.PTR_SIZE,i=n/e.PTR_SIZE,a=r===4?`i32`:`i64`;this.opKernelContext=Number(e.getValue(r*i++,a));let o=Number(e.getValue(r*i++,a));this.outputCount=Number(e.getValue(r*i++,a)),this.customDataOffset=Number(e.getValue(r*i++,`*`)),this.customDataSize=Number(e.getValue(r*i++,a));let s=[];for(let t=0;ttypeof e==`number`?this.inputs[e]:e))??this.inputs,i=t?.outputs??[],a=(e,t,n)=>new Dd(this.module,t,this.output(e,n),n),o=(e,t)=>{let n=gn(e,t);if(!n)throw Error(`Unsupported data type: ${e}`);let r=n>0?this.backend.gpuDataManager.create(n).id:0;return new Dd(this.module,e,r,t)};return this.backend.run(e,r,i,a,o,this.outputCount)}output(e,t){let n=this.module.stackSave();try{let n=this.module.PTR_SIZE,r=n===4?`i32`:`i64`,i=this.module.stackAlloc((1+t.length)*n);this.module.setValue(i,t.length,r);for(let e=0;e{let i=t.jsepInit;if(!i)throw Error(`Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.`);if(e===`webgpu`){let e=(Td(),Se(bd)).WebGpuBackend,a=new e;await a.initialize(n,r),i(`webgpu`,[a,e=>a.alloc(Number(e)),e=>a.free(e),(e,n,r,i=!1)=>{if(i)H(`verbose`,()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(e)}, dst=${Number(n)}, size=${Number(r)}`),a.memcpy(Number(e),Number(n));else{H(`verbose`,()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(e)}, gpuDataId=${Number(n)}, size=${Number(r)}`);let i=t.HEAPU8.subarray(Number(e>>>0),Number(e>>>0)+Number(r));a.upload(Number(n),i)}},async(e,n,r)=>{H(`verbose`,()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${e}, dataOffset=${n}, size=${r}`),await a.download(Number(e),()=>t.HEAPU8.subarray(Number(n)>>>0,Number(n+r)>>>0))},(e,n,r)=>a.createKernel(e,Number(n),r,t.UTF8ToString(t._JsepGetNodeName(Number(n)))),e=>a.releaseKernel(e),(e,n,r,i)=>{H(`verbose`,()=>`[WebGPU] jsepRun: sessionHandle=${r}, kernel=${e}, contextDataOffset=${n}`);let o=new Od(t,a,Number(n));return a.computeKernel(Number(e),o,i)},()=>a.captureBegin(),()=>a.captureEnd(),()=>a.replay()])}else{let e=new Qn(n);i(`webnn`,[e,()=>e.reserveTensorId(),t=>e.releaseTensorId(t),async(t,n,r,i,a)=>e.ensureTensor(t,n,r,i,a),(t,n)=>{e.uploadTensor(t,n)},async(t,n)=>e.downloadTensor(t,n)])}}}),jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd=L(()=>{"use strict";on(),pn(),V(),en(),rn(),Cn(),jd=(e,t)=>{$t()._OrtInit(e,t)!==0&&B(`Can't initialize onnxruntime.`)},Md=async e=>{jd(e.wasm.numThreads,vn(e.logLevel))},Nd=async(e,t)=>{var n,r;(n=(r=$t()).asyncInit)?.call(r);{let n=(Ad(),Se(Ed)).init;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);let t=e.webgpu.adapter;if(t){if(typeof t.limits!=`object`||typeof t.features!=`object`||typeof t.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let n=e.webgpu.powerPreference;if(n!==void 0&&n!==`low-power`&&n!==`high-performance`)throw Error(`Invalid powerPreference setting: "${n}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(t=await navigator.gpu.requestAdapter({powerPreference:n,forceFallbackAdapter:r}),!t)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}await n(`webgpu`,$t(),e,t)}if(t===`webnn`){if(typeof navigator>`u`||!navigator.ml)throw Error(`WebNN is not supported in current environment`);await n(`webnn`,$t(),e)}}},Pd=new Map,Fd=e=>{let t=$t(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&B(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},Id=(e,t)=>{let n=$t(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&B(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=$t(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},Rd=async(e,t)=>{let n,r,i=$t();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=Ld(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{var d,f;if([o,c]=await fn(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(Sn(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),(d=i.webgpuOnCreateSession)?.call(i,a),a===0&&B(`Can't create a session.`),(f=i.jsepOnCreateSession)?.call(i),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,m]=Fd(a),h=!!t?.enableGraphCapture,g=[],_=[],v=[],y=[],b=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`)&&(s=i._OrtCreateBinding(a),s===0&&B(`Can't create IO binding.`),x={handle:s,outputPreferredLocations:b,outputPreferredLocationsEncoded:b.map(e=>xn(e))}),Pd.set(a,[a,l,u,x,h,!1]),[a,g,_,v,y]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&B(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&B(`Can't release session.`),e}finally{var m;i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&B(`Can't release session options.`),c.forEach(e=>i._free(e)),(m=i.unmountExternalData)?.call(i)}},zd=e=>{var t,n,r;let i=$t(),a=Pd.get(e);if(!a)throw Error(`cannot release session. invalid session id: ${e}`);let[o,s,c,l,u]=a;l&&(u&&i._OrtClearBoundOutputs(l.handle)!==0&&B(`Can't clear bound outputs.`),i._OrtReleaseBinding(l.handle)!==0&&B(`Can't release IO binding.`)),(t=i.jsepOnReleaseSession)?.call(i,e),(n=i.webnnOnReleaseSession)?.call(i,e),(r=i.webgpuOnReleaseSession)?.call(i,e),s.forEach(e=>i._OrtFree(e)),c.forEach(e=>i._OrtFree(e)),i._OrtReleaseSession(o)!==0&&B(`Can't release session.`),Pd.delete(e)},Bd=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=$t(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=gn(mn(l),u);{let e=s.jsepRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(r,a,t,m)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=gn(mn(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,mn(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(mn(l),p,m,g,u.length,xn(f));e===0&&B(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},Vd=async(e,t,n,r,i,a)=>{let o=$t(),s=o.PTR_SIZE,c=Pd.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],S=o.stackSave(),C=o.stackAlloc(h*s),w=o.stackAlloc(h*s),T=o.stackAlloc(g*s),E=o.stackAlloc(g*s);try{var D,O;[_,v]=an(a);for(let r=0;re*t,1);d=hn(a);let _=f?.outputPreferredLocations[r[t]];if(d===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let e=o.jsepGetBuffer;if(!e)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let t=e(p),r=gn(a,g);if(r===void 0||!yn(d))throw Error(`Unsupported data type: ${d}`);u=!0,S.push([d,h,{gpuBuffer:t,download:o.jsepCreateDownloader(t,r,d),dispose:()=>{o._OrtReleaseTensor(n)!==0&&B(`Can't release tensor.`)}},`gpu-buffer`])}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsInt64Supported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(gn(a,g)===void 0||!bn(d))throw Error(`Unsupported data type: ${d}`);if(d===`int64`&&!r(e))throw Error(`preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.`);let i=await t(e,p,a,h,!1);u=!0,S.push([d,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(p,d),dispose:()=>{o.webnnReleaseTensorId(p),o._OrtReleaseTensor(n)}},`ml-tensor`])}else{let e=_n(d),t=new e(g);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(o.HEAPU8.subarray(p,p+t.byteLength)),S.push([d,h,t,`cpu`])}}finally{var k;o.stackRestore(a),d===`string`&&p&&o._free(p),u||o._OrtReleaseTensor(n),(k=o.webnnOnRunEnd)?.call(o,l)}}return f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&B(`Can't clear bound outputs.`),Pd.set(e,[l,u,d,f,p,!1])),S}finally{o.stackRestore(S),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},Hd=e=>{let t=$t(),n=Pd.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&B(`Can't get an profile file name.`),t._OrtFree(i)},Ud=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,sf,cf,lf,uf,df=L(()=>{"use strict";_t(),Wd(),en(),Wt(),Gd=()=>!!R.wasm.proxy&&typeof document<`u`,qd=!1,Jd=!1,Yd=!1,Qd=new Map,$d=(e,t)=>{let n=Qd.get(e);n?n.push(t):Qd.set(e,[t])},ef=()=>{if(qd||!Jd||Yd||!Kd)throw Error(`worker not ready`)},tf=e=>{switch(e.data.type){case`init-wasm`:qd=!1,e.data.err?(Yd=!0,Zd[1](e.data.err)):(Jd=!0,Zd[0]()),Xd&&(URL.revokeObjectURL(Xd),Xd=void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=Qd.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},nf=async()=>{if(!Jd){if(qd)throw Error(`multiple calls to 'initWasm()' detected.`);if(Yd)throw Error(`previous call to 'initWasm()' failed.`);if(qd=!0,Gd())return new Promise((e,t)=>{Kd?.terminate(),Vt().then(([n,r])=>{try{Kd=r,Kd.onerror=e=>t(e),Kd.onmessage=tf,Zd=[e,t];let i={type:`init-wasm`,in:R};!i.in.wasm.wasmPaths&&(n||jt)&&(i.in.wasm.wasmPaths={wasm:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+import.meta.url).href}),Kd.postMessage(i),Xd=n}catch(e){t(e)}},t)});try{await Qt(R.wasm),await Md(R),Jd=!0}catch(e){throw Yd=!0,e}finally{qd=!1}}},rf=async e=>{if(Gd())return ef(),new Promise((t,n)=>{$d(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:R}};Kd.postMessage(r)});await Nd(R,e)},af=async e=>Gd()?(ef(),new Promise((t,n)=>{$d(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};Kd.postMessage(r,[e.buffer])})):Ld(e),sf=async(e,t)=>{if(Gd()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return ef(),new Promise((n,r)=>{$d(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),Kd.postMessage(i,a)})}else return Rd(e,t)},cf=async e=>{if(Gd())return ef(),new Promise((t,n)=>{$d(`release`,[t,n]);let r={type:`release`,in:e};Kd.postMessage(r)});zd(e)},lf=async(e,t,n,r,i,a)=>{if(Gd()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return ef(),new Promise((i,o)=>{$d(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};Kd.postMessage(c,Ud(s))})}else return Vd(e,t,n,r,i,a)},uf=async e=>{if(Gd())return ef(),new Promise((t,n)=>{$d(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};Kd.postMessage(r)});Hd(e)}}),ff,pf,mf,hf=L(()=>{"use strict";_t(),df(),V(),vt(),Cn(),ff=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},pf=e=>{switch(e[3]){case`cpu`:return new tt(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!yn(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return tt.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!bn(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return tt.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},mf=class{async fetchModelAndCopyToWasmMemory(e){return af(await Sn(e))}async loadModel(e,t){at();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await sf(n,t),ot()}async dispose(){return cf(this.sessionId)}async run(e,t,n){at();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>ff(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?ff(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await lf(this.sessionId,i,s,o,c,n),u={};for(let e=0;evf,initializeFlags:()=>_f,wasmBackend:()=>yf});var _f,vf,yf,bf=L(()=>{"use strict";_t(),df(),hf(),_f=()=>{(typeof R.wasm.initTimeout!=`number`||R.wasm.initTimeout<0)&&(R.wasm.initTimeout=0);let e=R.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),R.wasm.simd=!1),typeof R.wasm.proxy!=`boolean`&&(R.wasm.proxy=!1),typeof R.wasm.trace!=`boolean`&&(R.wasm.trace=!1),typeof R.wasm.numThreads!=`number`||!Number.isInteger(R.wasm.numThreads)||R.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)R.wasm.numThreads=1;else{let e=typeof navigator>`u`?ye(`node:os`).cpus().length:navigator.hardwareConcurrency;R.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},vf=class{async init(e){_f(),await nf(),await rf(e)}async createInferenceSessionHandler(e,t){let n=new mf;return await n.loadModel(e,t),n}},yf=new vf});_t(),_t(),_t();var xf=`1.22.0-dev.20250409-89f8206ba4`,Sf=gt;{let e=(bf(),Se(gf)).wasmBackend;Te(`webgpu`,e,5),Te(`webnn`,e,5),Te(`cpu`,e,10),Te(`wasm`,e,10)}Object.defineProperty(R.versions,`web`,{value:xf,enumerable:!0}); +/** +* @license +* Copyright 2021 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*/ +/** +* @license +* Copyright 2020 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*/ +/** +* @license +* Copyright 2019 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*/ +var Cf={"onnxruntime-common":e=>{e.exports=I},"onnxruntime-web":e=>{e.exports=me},"?2ce3":()=>{},"?7a2c":()=>{},"?a42a":()=>{},"?2b25":()=>{},"?569f":()=>{},"?3f59":()=>{},"?154a":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(t,n,r)=>{r.r(n),r.d(n,{Environment:()=>L,Interpreter:()=>be,Template:()=>Fe,parse:()=>le,tokenize:()=>f});var i=Object.freeze({Text:`Text`,NumericLiteral:`NumericLiteral`,BooleanLiteral:`BooleanLiteral`,NullLiteral:`NullLiteral`,StringLiteral:`StringLiteral`,Identifier:`Identifier`,Equals:`Equals`,OpenParen:`OpenParen`,CloseParen:`CloseParen`,OpenStatement:`OpenStatement`,CloseStatement:`CloseStatement`,OpenExpression:`OpenExpression`,CloseExpression:`CloseExpression`,OpenSquareBracket:`OpenSquareBracket`,CloseSquareBracket:`CloseSquareBracket`,OpenCurlyBracket:`OpenCurlyBracket`,CloseCurlyBracket:`CloseCurlyBracket`,Comma:`Comma`,Dot:`Dot`,Colon:`Colon`,Pipe:`Pipe`,CallOperator:`CallOperator`,AdditiveBinaryOperator:`AdditiveBinaryOperator`,MultiplicativeBinaryOperator:`MultiplicativeBinaryOperator`,ComparisonBinaryOperator:`ComparisonBinaryOperator`,UnaryOperator:`UnaryOperator`,Set:`Set`,If:`If`,For:`For`,In:`In`,Is:`Is`,NotIn:`NotIn`,Else:`Else`,EndSet:`EndSet`,EndIf:`EndIf`,ElseIf:`ElseIf`,EndFor:`EndFor`,And:`And`,Or:`Or`,Not:`UnaryOperator`,Macro:`Macro`,EndMacro:`EndMacro`,Break:`Break`,Continue:`Continue`}),a=Object.freeze({set:i.Set,for:i.For,in:i.In,is:i.Is,if:i.If,else:i.Else,endset:i.EndSet,endif:i.EndIf,elif:i.ElseIf,endfor:i.EndFor,and:i.And,or:i.Or,not:i.Not,"not in":i.NotIn,macro:i.Macro,endmacro:i.EndMacro,break:i.Break,continue:i.Continue,true:i.BooleanLiteral,false:i.BooleanLiteral,none:i.NullLiteral,True:i.BooleanLiteral,False:i.BooleanLiteral,None:i.NullLiteral}),o=class{constructor(e,t){this.value=e,this.type=t}};function s(e){return/\w/.test(e)}function c(e){return/[0-9]/.test(e)}var l=[[`{%`,i.OpenStatement],[`%}`,i.CloseStatement],[`{{`,i.OpenExpression],[`}}`,i.CloseExpression],[`(`,i.OpenParen],[`)`,i.CloseParen],[`{`,i.OpenCurlyBracket],[`}`,i.CloseCurlyBracket],[`[`,i.OpenSquareBracket],[`]`,i.CloseSquareBracket],[`,`,i.Comma],[`.`,i.Dot],[`:`,i.Colon],[`|`,i.Pipe],[`<=`,i.ComparisonBinaryOperator],[`>=`,i.ComparisonBinaryOperator],[`==`,i.ComparisonBinaryOperator],[`!=`,i.ComparisonBinaryOperator],[`<`,i.ComparisonBinaryOperator],[`>`,i.ComparisonBinaryOperator],[`+`,i.AdditiveBinaryOperator],[`-`,i.AdditiveBinaryOperator],[`*`,i.MultiplicativeBinaryOperator],[`/`,i.MultiplicativeBinaryOperator],[`%`,i.MultiplicativeBinaryOperator],[`=`,i.Equals]],u=new Map([[`n`,` +`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function d(e,t={}){return e.endsWith(` +`)&&(e=e.slice(0,-1)),e=e.replace(/{#.*?#}/gs,`{##}`),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%]})\n/g,`$1`)),e.replace(/{##}/g,``).replace(/-%}\s*/g,`%}`).replace(/\s*{%-/g,`{%`).replace(/-}}\s*/g,`}}`).replace(/\s*{{-/g,`{{`)}function f(e,t={}){let n=[],r=d(e,t),f=0,p=e=>{let t=``;for(;e(r[f]);){if(r[f]===`\\`){if(++f,f>=r.length)throw SyntaxError(`Unexpected end of input`);let e=r[f++],n=u.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=r[f++],f>=r.length)throw SyntaxError(`Unexpected end of input`)}return t};main:for(;f0){n.push(new o(e,i.Text));continue}}p(e=>/\s/.test(e));let t=r[f];if(t===`-`||t===`+`){var h;let e=(h=n.at(-1))?.type;if(e===i.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case i.Identifier:case i.NumericLiteral:case i.BooleanLiteral:case i.NullLiteral:case i.StringLiteral:case i.CloseParen:case i.CloseSquareBracket:break;default:{++f;let e=p(c);n.push(new o(`${t}${e}`,e.length>0?i.NumericLiteral:i.UnaryOperator));continue}}}for(let[e,t]of l){let i=r.slice(f,f+e.length);if(i===e){n.push(new o(e,t)),f+=e.length;continue main}}if(t===`'`||t===`"`){++f;let e=p(e=>e!==t);n.push(new o(e,i.StringLiteral)),++f;continue}if(c(t)){let e=p(c);n.push(new o(e,i.NumericLiteral));continue}if(s(t)){var g;let e=p(s),t=Object.hasOwn(a,e)?a[e]:i.Identifier;t===i.In&&(g=n.at(-1))?.type===i.Not?(n.pop(),n.push(new o(`not in`,i.NotIn))):n.push(new o(e,t));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var p=class{constructor(){e.defineProperty(this,`type`,`Statement`)}},m=class extends p{constructor(t){super(),e.defineProperty(this,`type`,`Program`),this.body=t}},h=class extends p{constructor(t,n,r){super(),e.defineProperty(this,`type`,`If`),this.test=t,this.body=n,this.alternate=r}},g=class extends p{constructor(t,n,r,i){super(),e.defineProperty(this,`type`,`For`),this.loopvar=t,this.iterable=n,this.body=r,this.defaultBlock=i}},_=class extends p{constructor(...t){super(...t),e.defineProperty(this,`type`,`Break`)}},v=class extends p{constructor(...t){super(...t),e.defineProperty(this,`type`,`Continue`)}},y=class extends p{constructor(t,n,r){super(),e.defineProperty(this,`type`,`Set`),this.assignee=t,this.value=n,this.body=r}},b=class extends p{constructor(t,n,r){super(),e.defineProperty(this,`type`,`Macro`),this.name=t,this.args=n,this.body=r}},x=class extends p{constructor(...t){super(...t),e.defineProperty(this,`type`,`Expression`)}},S=class extends x{constructor(t,n,r){super(),e.defineProperty(this,`type`,`MemberExpression`),this.object=t,this.property=n,this.computed=r}},C=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`CallExpression`),this.callee=t,this.args=n}},w=class extends x{constructor(t){super(),e.defineProperty(this,`type`,`Identifier`),this.value=t}},T=class extends x{constructor(t){super(),e.defineProperty(this,`type`,`Literal`),this.value=t}},E=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`NumericLiteral`)}},D=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`StringLiteral`)}},O=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`BooleanLiteral`)}},ee=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`NullLiteral`)}},k=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`ArrayLiteral`)}},te=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`TupleLiteral`)}},ne=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`ObjectLiteral`)}},re=class extends x{constructor(t,n,r){super(),e.defineProperty(this,`type`,`BinaryExpression`),this.operator=t,this.left=n,this.right=r}},ie=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`FilterExpression`),this.operand=t,this.filter=n}},A=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`SelectExpression`),this.iterable=t,this.test=n}},ae=class extends x{constructor(t,n,r){super(),e.defineProperty(this,`type`,`TestExpression`),this.operand=t,this.negate=n,this.test=r}},oe=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`UnaryExpression`),this.operator=t,this.argument=n}},se=class extends x{constructor(t=void 0,n=void 0,r=void 0){super(),e.defineProperty(this,`type`,`SliceExpression`),this.start=t,this.stop=n,this.step=r}},ce=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`KeywordArgumentExpression`),this.key=t,this.value=n}};function le(e){let t=new m([]),n=0;function r(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function a(){switch(e[n].type){case i.Text:return c();case i.OpenStatement:return l();case i.OpenExpression:return u();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function o(...t){return n+t.length<=e.length&&t.some((t,r)=>t!==e[n+r].type)}function s(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function c(){return new D(r(i.Text,`Expected text token`).value)}function l(){r(i.OpenStatement,`Expected opening statement token`);let t;switch(e[n].type){case i.Set:++n,t=d(),r(i.CloseStatement,`Expected closing statement token`);break;case i.If:++n,t=f(),r(i.OpenStatement,`Expected {% token`),r(i.EndIf,`Expected endif token`),r(i.CloseStatement,`Expected %} token`);break;case i.Macro:++n,t=p(),r(i.OpenStatement,`Expected {% token`),r(i.EndMacro,`Expected endmacro token`),r(i.CloseStatement,`Expected %} token`);break;case i.For:++n,t=T(),r(i.OpenStatement,`Expected {% token`),r(i.EndFor,`Expected endfor token`),r(i.CloseStatement,`Expected %} token`);break;case i.Break:++n,r(i.CloseStatement,`Expected closing statement token`),t=new _;break;case i.Continue:++n,r(i.CloseStatement,`Expected closing statement token`),t=new v;break;default:throw SyntaxError(`Unknown statement type: ${e[n].type}`)}return t}function u(){r(i.OpenExpression,`Expected opening expression token`);let e=le();return r(i.CloseExpression,`Expected closing expression token`),e}function d(){let t=le();if(s(i.Equals)){++n;let e=le();return new y(t,e,[])}else{var o,c;let s=[];for(r(i.CloseStatement,`Expected %} token`);!((o=e[n])?.type===i.OpenStatement&&(c=e[n+1])?.type===i.EndSet);){let e=a();s.push(e)}return r(i.OpenStatement,`Expected {% token`),r(i.EndSet,`Expected endset token`),new y(t,null,s)}}function f(){var t,o,c,l,u,d;let p=le();r(i.CloseStatement,`Expected closing statement token`);let m=[],g=[];for(;!((t=e[n])?.type===i.OpenStatement&&((o=e[n+1])?.type===i.ElseIf||(c=e[n+1])?.type===i.Else||(l=e[n+1])?.type===i.EndIf));)m.push(a());if((u=e[n])?.type===i.OpenStatement&&(d=e[n+1])?.type!==i.EndIf)if(++n,s(i.ElseIf))r(i.ElseIf,`Expected elseif token`),g.push(f());else{var _,v;for(r(i.Else,`Expected else token`),r(i.CloseStatement,`Expected closing statement token`);!((_=e[n])?.type===i.OpenStatement&&(v=e[n+1])?.type===i.EndIf);)g.push(a())}return new h(p,m,g)}function p(){let e=ye();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=F();r(i.CloseStatement,`Expected closing statement token`);let n=[];for(;o(i.OpenStatement,i.EndMacro);)n.push(a());return new b(e,t,n)}function x(e=!1){let t=e?ye:le,r=[t()],a=s(i.Comma);for(;a&&(++n,r.push(t()),s(i.Comma)););return a?new te(r):r[0]}function T(){let e=x(!0);if(!(e instanceof w||e instanceof te))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);r(i.In,"Expected `in` keyword following loop variable");let t=le();r(i.CloseStatement,`Expected closing statement token`);let c=[];for(;o(i.OpenStatement,i.EndFor)&&o(i.OpenStatement,i.Else);)c.push(a());let l=[];if(s(i.OpenStatement,i.Else))for(++n,++n,r(i.CloseStatement,`Expected closing statement token`);o(i.OpenStatement,i.EndFor);)l.push(a());return new g(e,t,c,l)}function le(){return ue()}function ue(){let e=j();if(s(i.If)){++n;let t=j();if(s(i.Else)){++n;let r=j();return new h(t,[e],[r])}else return new A(e,t)}return e}function j(){let t=M();for(;s(i.Or);){let r=e[n];++n;let i=M();t=new re(r,t,i)}return t}function M(){let t=de();for(;s(i.And);){let r=e[n];++n;let i=de();t=new re(r,t,i)}return t}function de(){let t;for(;s(i.Not);){let r=e[n];++n;let i=de();t=new oe(r,i)}return t??fe()}function fe(){let t=pe();for(;s(i.ComparisonBinaryOperator)||s(i.In)||s(i.NotIn);){let r=e[n];++n;let i=pe();t=new re(r,t,i)}return t}function pe(){let t=ge();for(;s(i.AdditiveBinaryOperator);){let r=e[n];++n;let i=ge();t=new re(r,t,i)}return t}function N(){let e=he(ye());return s(i.OpenParen)?P(e):e}function P(e){let t=new C(e,F());return t=he(t),s(i.OpenParen)&&(t=P(t)),t}function F(){r(i.OpenParen,`Expected opening parenthesis for arguments list`);let e=I();return r(i.CloseParen,`Expected closing parenthesis for arguments list`),e}function I(){let e=[];for(;!s(i.CloseParen);){let t=le();if(s(i.Equals)){if(++n,!(t instanceof w))throw SyntaxError(`Expected identifier for keyword argument`);let e=le();t=new ce(t,e)}e.push(t),s(i.Comma)&&++n}return e}function me(){let e=[],t=!1;for(;!s(i.CloseSquareBracket);)s(i.Colon)?(e.push(void 0),++n,t=!0):(e.push(le()),s(i.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new se(...e)}return e[0]}function he(t){for(;s(i.Dot)||s(i.OpenSquareBracket);){let a=e[n];++n;let o,s=a.type!==i.Dot;if(s)o=me(),r(i.CloseSquareBracket,`Expected closing square bracket`);else if(o=ye(),o.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new S(t,o,s)}return t}function ge(){let t=_e();for(;s(i.MultiplicativeBinaryOperator);){let r=e[n];++n;let i=_e();t=new re(r,t,i)}return t}function _e(){let e=ve();for(;s(i.Is);){++n;let t=s(i.Not);t&&++n;let r=ye();if(r instanceof O?r=new w(r.value.toString()):r instanceof ee&&(r=new w(`none`)),!(r instanceof w))throw SyntaxError(`Expected identifier for the test`);e=new ae(e,t,r)}return e}function ve(){let e=N();for(;s(i.Pipe);){++n;let t=ye();if(!(t instanceof w))throw SyntaxError(`Expected identifier for the filter`);s(i.OpenParen)&&(t=P(t)),e=new ie(e,t)}return e}function ye(){let t=e[n];switch(t.type){case i.NumericLiteral:return++n,new E(Number(t.value));case i.StringLiteral:return++n,new D(t.value);case i.BooleanLiteral:return++n,new O(t.value.toLowerCase()===`true`);case i.NullLiteral:return++n,new ee(null);case i.Identifier:return++n,new w(t.value);case i.OpenParen:{++n;let t=x();if(e[n].type!==i.CloseParen)throw SyntaxError(`Expected closing parenthesis, got ${e[n].type} instead`);return++n,t}case i.OpenSquareBracket:{++n;let e=[];for(;!s(i.CloseSquareBracket);)e.push(le()),s(i.Comma)&&++n;return++n,new k(e)}case i.OpenCurlyBracket:{++n;let e=new Map;for(;!s(i.CloseCurlyBracket);){let t=le();r(i.Colon,`Expected colon between key and value in object literal`);let a=le();e.set(t,a),s(i.Comma)&&++n}return++n,new ne(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}var de=class extends Error{},fe=class extends Error{},pe=class{constructor(t=void 0){e.defineProperty(this,`type`,`RuntimeValue`),e.defineProperty(this,`value`,void 0),e.defineProperty(this,`builtins`,new Map),this.value=t}__bool__(){return new F(!!this.value)}},N=class extends pe{constructor(...t){super(...t),e.defineProperty(this,`type`,`NumericValue`)}},P=class extends pe{constructor(...t){super(...t),e.defineProperty(this,`type`,`StringValue`),e.defineProperty(this,`builtins`,new Map([[`upper`,new _e(()=>new P(this.value.toUpperCase()))],[`lower`,new _e(()=>new P(this.value.toLowerCase()))],[`strip`,new _e(()=>new P(this.value.trim()))],[`title`,new _e(()=>new P(M(this.value)))],[`length`,new N(this.value.length)],[`rstrip`,new _e(()=>new P(this.value.trimEnd()))],[`lstrip`,new _e(()=>new P(this.value.trimStart()))],[`startswith`,new _e(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(!(t instanceof P))throw Error(`startswith() argument must be a string`);return new F(this.value.startsWith(t.value))})],[`endswith`,new _e(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(!(t instanceof P))throw Error(`endswith() argument must be a string`);return new F(this.value.endsWith(t.value))})],[`split`,new _e(e=>{let t=e[0]??new ve;if(!(t instanceof P||t instanceof ve))throw Error(`sep argument must be a string or null`);let n=e[1]??new N(-1);if(!(n instanceof N))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof ve){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new he(r.map(e=>new P(e)))})]]))}},F=class extends pe{constructor(...t){super(...t),e.defineProperty(this,`type`,`BooleanValue`)}},I=class extends pe{constructor(...t){super(...t),e.defineProperty(this,`type`,`ObjectValue`),e.defineProperty(this,`builtins`,new Map([[`get`,new _e(([e,t])=>{if(!(e instanceof P))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new ve})],[`items`,new _e(()=>new he(Array.from(this.value.entries()).map(([e,t])=>new he([new P(e),t]))))]]))}__bool__(){return new F(this.value.size>0)}},me=class extends I{constructor(...t){super(...t),e.defineProperty(this,`type`,`KeywordArgumentsValue`)}},he=class extends pe{constructor(...t){super(...t),e.defineProperty(this,`type`,`ArrayValue`),e.defineProperty(this,`builtins`,new Map([[`length`,new N(this.value.length)]]))}__bool__(){return new F(this.value.length>0)}},ge=class extends he{constructor(...t){super(...t),e.defineProperty(this,`type`,`TupleValue`)}},_e=class extends pe{constructor(...t){super(...t),e.defineProperty(this,`type`,`FunctionValue`)}},ve=class extends pe{constructor(...t){super(...t),e.defineProperty(this,`type`,`NullValue`)}},ye=class extends pe{constructor(...t){super(...t),e.defineProperty(this,`type`,`UndefinedValue`)}},L=class{constructor(t){e.defineProperty(this,`variables`,new Map([[`namespace`,new _e(e=>{if(e.length===0)return new I(new Map);if(e.length!==1||!(e[0]instanceof I))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]])),e.defineProperty(this,`tests`,new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof _e],[`odd`,e=>{if(e.type!==`NumericValue`)throw Error(`Cannot apply test "odd" to type: ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(e.type!==`NumericValue`)throw Error(`Cannot apply test "even" to type: ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e.type===`NumericValue`],[`integer`,e=>e.type===`NumericValue`&&Number.isInteger(e.value)],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e.type===`ObjectValue`],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]])),this.parent=t}set(e,t){return this.declareVariable(e,xe(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new ye}catch{return new ye}}},be=class{constructor(t){e.defineProperty(this,`global`,void 0),this.global=t??new L}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new F(n.value==r.value);case`!=`:return new F(n.value!=r.value)}if(n instanceof ye||r instanceof ye)throw Error(`Cannot perform operation on undefined values`);if(n instanceof ve||r instanceof ve)throw Error(`Cannot perform operation on null values`);if(n instanceof N&&r instanceof N)switch(e.operator.value){case`+`:return new N(n.value+r.value);case`-`:return new N(n.value-r.value);case`*`:return new N(n.value*r.value);case`/`:return new N(n.value/r.value);case`%`:return new N(n.value%r.value);case`<`:return new F(n.value`:return new F(n.value>r.value);case`>=`:return new F(n.value>=r.value);case`<=`:return new F(n.value<=r.value)}else if(n instanceof he&&r instanceof he)switch(e.operator.value){case`+`:return new he(n.value.concat(r.value))}else if(r instanceof he){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new F(t);case`not in`:return new F(!t)}}if(n instanceof P||r instanceof P)switch(e.operator.value){case`+`:return new P(n.value.toString()+r.value.toString())}if(n instanceof P&&r instanceof P)switch(e.operator.value){case`in`:return new F(r.value.includes(n.value));case`not in`:return new F(!r.value.includes(n.value))}if(n instanceof P&&r instanceof I)switch(e.operator.value){case`in`:return new F(r.value.has(n.value));case`not in`:return new F(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);if(e.filter.type===`Identifier`){let t=e.filter;if(t.value===`tojson`)return new P(Se(n));if(n instanceof he)switch(t.value){case`list`:return n;case`first`:return n.value[0];case`last`:return n.value[n.value.length-1];case`length`:return new N(n.value.length);case`reverse`:return new he(n.value.reverse());case`sort`:return new he(n.value.sort((e,t)=>{if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`NumericValue`:return e.value-t.value;case`StringValue`:return e.value.localeCompare(t.value);default:throw Error(`Cannot compare type: ${e.type}`)}}));case`join`:return new P(n.value.map(e=>e.value).join(``));case`string`:return new P(Se(n));default:throw Error(`Unknown ArrayValue filter: ${t.value}`)}else if(n instanceof P)switch(t.value){case`length`:return new N(n.value.length);case`upper`:return new P(n.value.toUpperCase());case`lower`:return new P(n.value.toLowerCase());case`title`:return new P(M(n.value));case`capitalize`:return new P(n.value.charAt(0).toUpperCase()+n.value.slice(1));case`trim`:return new P(n.value.trim());case`indent`:return new P(n.value.split(` +`).map((e,t)=>t===0||e.length===0?e:` `+e).join(` +`));case`join`:case`string`:return n;default:throw Error(`Unknown StringValue filter: ${t.value}`)}else if(n instanceof N)switch(t.value){case`abs`:return new N(Math.abs(n.value));default:throw Error(`Unknown NumericValue filter: ${t.value}`)}else if(n instanceof I)switch(t.value){case`items`:return new he(Array.from(n.value.entries()).map(([e,t])=>new he([new P(e),t])));case`length`:return new N(n.value.size);default:throw Error(`Unknown ObjectValue filter: ${t.value}`)}throw Error(`Cannot apply filter "${t.value}" to type: ${n.type}`)}else if(e.filter.type===`CallExpression`){let r=e.filter;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,e]=this.evaluateArguments(r.args,t),i=e.get(`indent`)??new ve;if(!(i instanceof N||i instanceof ve))throw Error(`If set, indent must be a number`);return new P(Se(n,i.value))}else if(i===`join`){let e;if(n instanceof P)e=Array.from(n.value);else if(n instanceof he)e=n.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${n.type}`);let[a,o]=this.evaluateArguments(r.args,t),s=a.at(0)??o.get(`separator`)??new P(``);if(!(s instanceof P))throw Error(`separator must be a string`);return new P(e.join(s.value))}if(n instanceof he){switch(i){case`selectattr`:case`rejectattr`:{let e=i===`selectattr`;if(n.value.some(e=>!(e instanceof I)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,t)),c;if(o){let e=t.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;let l=n.value.filter(t=>{let n=t.value.get(a.value),r=n?c(n,s):!1;return e?r:!r});return new he(l)}case`map`:{let[,e]=this.evaluateArguments(r.args,t);if(e.has(`attribute`)){let t=e.get(`attribute`);if(!(t instanceof P))throw Error(`attribute must be a string`);let r=e.get(`default`),i=n.value.map(e=>{if(!(e instanceof I))throw Error(`items in map must be an object`);return e.value.get(t.value)??r??new ye});return new he(i)}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(n instanceof P){switch(i){case`indent`:{let[e,i]=this.evaluateArguments(r.args,t),a=e.at(0)??i.get(`width`)??new N(4);if(!(a instanceof N))throw Error(`width must be a number`);let o=e.at(1)??i.get(`first`)??new F(!1),s=e.at(2)??i.get(`blank`)??new F(!1),c=n.value.split(` +`),l=` `.repeat(a.value),u=c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e);return new P(u.join(` +`))}}throw Error(`Unknown StringValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${n.type}`)}throw Error(`Unknown filter: ${e.filter.type}`)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new F(e.negate?!i:i)}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new F(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.value)}return new P(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new me(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof he||e instanceof P))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof N||r instanceof ye))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof N||i instanceof ye))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof N||a instanceof ye))throw Error(`Slice step must be numeric or undefined`);return e instanceof he?new he(j(e.value,r.value,i.value,a.value)):new P(j(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new P(e.property.value);let i;if(n instanceof I){if(!(r instanceof P))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof he||n instanceof P)if(r instanceof N)i=n.value.at(r.value),n instanceof P&&(i=new P(n.value.at(r.value)));else if(r instanceof P)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof P))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof pe?i:new ye}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`MemberExpression`){let r=e.assignee,i=this.evaluate(r.object,t);if(!(i instanceof I))throw Error(`Cannot assign to member of non-object`);if(r.property.type!==`Identifier`)throw Error(`Cannot assign to member with non-identifier property`);i.value.set(r.property.value,n)}else throw Error(`Invalid LHS inside assignment expression: ${JSON.stringify(e.assignee)}`);return new ve}evaluateIf(e,t){let n=this.evaluate(e.test,t);return this.evaluateBlock(n.__bool__().value?e.body:e.alternate,t)}evaluateFor(e,t){let n=new L(t),r,i;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=this.evaluate(t.iterable,n),r=t.test}else i=this.evaluate(e.iterable,n);if(!(i instanceof he))throw Error(`Expected iterable type in for loop: got ${i.type}`);let a=[],o=[];for(let t=0;tt.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new ye],[`nextitem`,t{var r;let i=new L(n);t=t.slice();let a;(r=t.at(-1))?.type===`KeywordArgumentsValue`&&(a=t.pop());for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new ge(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof P))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new I(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function xe(e){switch(typeof e){case`number`:return new N(e);case`string`:return new P(e);case`boolean`:return new F(e);case`undefined`:return new ye;case`object`:return e===null?new ve:Array.isArray(e)?new he(e.map(xe)):new I(new Map(Object.entries(e).map(([e,t])=>[e,xe(t)])));case`function`:return new _e((t,n)=>{let r=e(...t.map(e=>e.value))??null;return xe(r)});default:throw Error(`Cannot convert to runtime value: ${e}`)}}function Se(e,t,n){let r=n??0;switch(e.type){case`NullValue`:case`UndefinedValue`:return`null`;case`NumericValue`:case`StringValue`:case`BooleanValue`:return JSON.stringify(e.value);case`ArrayValue`:case`ObjectValue`:{let n=t?` `.repeat(t):``,i=` +`+n.repeat(r),a=i+n;if(e.type===`ArrayValue`){let n=e.value.map(e=>Se(e,t,r+1));return t?`[${a}${n.join(`,${a}`)}${i}]`:`[${n.join(`, `)}]`}else{let n=Array.from(e.value.entries()).map(([e,n])=>{let i=`"${e}": ${Se(n,t,r+1)}`;return t?`${a}${i}`:i});return t?`{${n.join(`,`)}${i}}`:`{${n.join(`, `)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var Ce=` +`,we=`{%- `,Te=` -%}`,Ee={MultiplicativeBinaryOperator:2,AdditiveBinaryOperator:1,ComparisonBinaryOperator:0};function De(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t,r=ke(e.body,0,n);return r.replace(/\n$/,``)}function Oe(...e){return we+e.join(` `)+Te}function ke(e,t,n){return e.map(e=>Ae(e,t,n)).join(Ce)}function Ae(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return ke(e.body,t,n);case`If`:return je(e,t,n);case`For`:return Me(e,t,n);case`Set`:return Ne(e,t,n);case`Macro`:return Pe(e,t,n);case`Break`:return r+Oe(`break`);case`Continue`:return r+Oe(`continue`);default:return r+`{{- `+R(e)+` -}}`}}function je(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+Oe(`if`,R(i[0].test))+Ce+ke(i[0].body,t+1,n);for(let e=1;e0&&(o+=Ce+r+Oe(`else`)+Ce+ke(a.alternate,t+1,n)),o+=Ce+r+Oe(`endif`),o}function Me(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${R(t.iterable)} if ${R(t.test)}`}else i=R(e.iterable);let a=r+Oe(`for`,R(e.loopvar),`in`,i)+Ce+ke(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=Ce+r+Oe(`else`)+Ce+ke(e.defaultBlock,t+1,n)),a+=Ce+r+Oe(`endfor`),a}function Ne(e,t,n){let r=n.repeat(t),i=R(e.assignee),a=e.value?R(e.value):``,o=r+Oe(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+Ce+ke(e.body,t+1,n)+Ce+r+Oe(`endset`)}function Pe(e,t,n){let r=n.repeat(t),i=e.args.map(R).join(`, `);return r+Oe(`macro`,`${e.name.value}(${i})`)+Ce+ke(e.body,t+1,n)+Ce+r+Oe(`endmacro`)}function R(e,t=-1){switch(e.type){case`Identifier`:return e.value;case`NullLiteral`:return`none`;case`NumericLiteral`:case`BooleanLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=Ee[n.operator.type]??0,i=R(n.left,r),a=R(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return rR(e,-1)).join(`, `);return`${R(t.callee,-1)}(${n})`}case`MemberExpression`:{let t=e,n=R(t.object,-1);t.object.type!==`Identifier`&&(n=`(${n})`);let r=R(t.property,-1);return!t.computed&&t.property.type!==`Identifier`&&(r=`(${r})`),t.computed?`${n}[${r}]`:`${n}.${r}`}case`FilterExpression`:{let t=e,n=R(t.operand,1/0);return t.filter.type===`CallExpression`?`${n} | ${R(t.filter,-1)}`:`${n} | ${t.filter.value}`}case`SelectExpression`:{let t=e;return`${R(t.iterable,-1)} | select(${R(t.test,-1)})`}case`TestExpression`:{let t=e;return`${R(t.operand,-1)} is${t.negate?` not`:``} ${t.test.value}`}case`ArrayLiteral`:case`TupleLiteral`:{let t=e.value.map(e=>R(e,-1)),n=e.type===`ArrayLiteral`?`[]`:`()`;return`${n[0]}${t.join(`, `)}${n[1]}`}case`ObjectLiteral`:{let t=Array.from(e.value.entries()).map(([e,t])=>`${R(e,-1)}: ${R(t,-1)}`);return`{ ${t.join(`, `)} }`}case`SliceExpression`:{let t=e,n=t.start?R(t.start,-1):``,r=t.stop?R(t.stop,-1):``,i=t.step?`:${R(t.step,-1)}`:``;return`${n}:${r}${i}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${R(t.value,-1)}`}case`If`:{let t=e,n=R(t.test,-1),r=R(t.body[0],0),i=R(t.alternate[0],-1);return`${r} if ${n} else ${i}`}default:throw Error(`Unknown expression type: ${e.type}`)}}var Fe=class{constructor(t){e.defineProperty(this,`parsed`,void 0);let n=f(t,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=le(n)}render(e){let t=new L;if(t.set(`false`,!1),t.set(`true`,!0),t.set(`raise_exception`,e=>{throw Error(e)}),t.set(`range`,ue),e)for(let[n,r]of Object.entries(e))t.set(n,r);let n=new be(t),r=n.run(this.parsed);return r.value}format(e){return De(this.parsed,e?.indent||` `)}}},"./src/backends/onnx.js":(e,t,n)=>{var r;n.r(t),n.d(t,{Tensor:()=>s.Tensor,createInferenceSession:()=>g,deviceToExecutionProviders:()=>m,isONNXProxy:()=>y,isONNXTensor:()=>_});var i=n( +/*! ../env.js */ +`./src/env.js`),a=n( +/*! onnxruntime-node */ +`?2ce3`),o=n( +/*! onnxruntime-web */ +`onnxruntime-web`),s=n( +/*! onnxruntime-common */ +`onnxruntime-common`);let c=Object.freeze({auto:null,gpu:null,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,webnn:{name:`webnn`,deviceType:`cpu`},"webnn-npu":{name:`webnn`,deviceType:`npu`},"webnn-gpu":{name:`webnn`,deviceType:`gpu`},"webnn-cpu":{name:`webnn`,deviceType:`cpu`}}),l=[],u,d,f=Symbol.for(`onnxruntime`);if(f in globalThis)d=globalThis[f];else if(i.apis.IS_NODE_ENV){switch(d=a??(r||=n.t(a,2)),process.platform){case`win32`:l.push(`dml`);break;case`linux`:process.arch===`x64`&&l.push(`cuda`);break;case`darwin`:break}l.push(`cpu`),u=[`cpu`]}else d=o,i.apis.IS_WEBNN_AVAILABLE&&l.push(`webnn-npu`,`webnn-gpu`,`webnn-cpu`,`webnn`),i.apis.IS_WEBGPU_AVAILABLE&&l.push(`webgpu`),l.push(`wasm`),u=[`wasm`];let p=d.InferenceSession;function m(e=null){if(!e)return u;switch(e){case`auto`:return l;case`gpu`:return l.filter(e=>[`webgpu`,`cuda`,`dml`,`webnn-gpu`].includes(e))}if(l.includes(e))return[c[e]??e];throw Error(`Unsupported device: "${e}". Should be one of: ${l.join(`, `)}.`)}let h=null;async function g(e,t,n){h&&await h;let r=p.create(e,t);h??=r;let i=await r;return i.config=n,i}function _(e){return e instanceof d.Tensor}let v=d?.env;v?.wasm&&(!(typeof ServiceWorkerGlobalScope<`u`&&self instanceof ServiceWorkerGlobalScope)&&!v.wasm.wasmPaths&&(v.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${i.env.version}/dist/`),v.wasm.proxy=!1),v?.webgpu&&(v.webgpu.powerPreference=`high-performance`);function y(){var e;return v==null||(e=v.wasm)==null?void 0:e.proxy}i.env.backends.onnx=v},"./src/base/feature_extraction_utils.js":(e,t,n)=>{n.r(t),n.d(t,{FeatureExtractor:()=>o,validate_audio_inputs:()=>s});var r=n( +/*! ../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),a=n( +/*! ../utils/hub.js */ +`./src/utils/hub.js`);class o extends i.Callable{constructor(e){super(),this.config=e}static async from_pretrained(e,t){let n=await(0,a.getModelJSON)(e,r.FEATURE_EXTRACTOR_NAME,!0,t);return new this(n)}}function s(e,t){var n;if(!(e instanceof Float32Array||e instanceof Float64Array))throw Error(`${t} expects input to be a Float32Array or a Float64Array, but got ${(e==null||(n=e.constructor)==null?void 0:n.name)??typeof e} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}},"./src/base/image_processors_utils.js":(e,t,n)=>{n.r(t),n.d(t,{ImageProcessor:()=>x,center_to_corners_format:()=>f,post_process_instance_segmentation:()=>b,post_process_object_detection:()=>p,post_process_panoptic_segmentation:()=>y,post_process_semantic_segmentation:()=>m});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),i=n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../utils/maths.js */ +`./src/utils/maths.js`),o=n( +/*! ../utils/image.js */ +`./src/utils/image.js`),s=n( +/*! ../utils/core.js */ +`./src/utils/core.js`),c=n( +/*! ../utils/hub.js */ +`./src/utils/hub.js`),l=n( +/*! ../utils/constants.js */ +`./src/utils/constants.js`);function u(e,t,n=0,r=null){let i=e/t,o=(0,a.bankers_round)(i)*t;return r!==null&&o>r&&(o=Math.floor(i)*t),ot&&i.push(e)}else{let e=(0,a.max)(n.data)[1];if(e===l-1||(o=(0,a.softmax)(n.data),o[e]e*s[(t+1)%2])),d.boxes.push(n),d.classes.push(t),d.scores.push(o[t])}}u.push(d)}return u}function m(e,t=null){let n=e.logits,r=n.dims[0];if(t!==null&&t.length!==r)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let a=[];for(let e=0;eu[n]&&(u[n]=t[n],d[n]=e)}let f=Array(o.dims[0]);for(let e=0;ee!==void 0);a.push({segmentation:l,labels:p})}return a}function h(e,t,n,r){let i=[],o=[],s=[];for(let c=0;cn&&(i.push(u),o.push(p),s.push(d))}return[i,o,s]}function g(e,t,n,r=.5,i=.8){let a=[],o=0,s=0,c=t[n].data;for(let t=0;t=r&&++s;let l=o>0&&s>0;if(l){let e=o/s;l=e>i}return[l,a]}function _(e,t,n,r,a,o=null,s=null){let[c,l]=s??e[0].dims,u=new i.Tensor(`int32`,new Int32Array(c*l),[c,l]),d=[];if(s!==null)for(let t=0;tp[e]&&(f[e]=n,p[e]=i[e])}let m=0,h=u.data;for(let i=0;i200)throw Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(e,t)/Math.min(e,t)}`);let a=Math.round(e/n)*n,o=Math.round(t/n)*n;if(a*o>i){let r=Math.sqrt(e*t/i);a=Math.floor(e/r/n)*n,o=Math.floor(t/r/n)*n}else if(a*oi?c=Math.floor(i*s/r):i>r&&(s=Math.floor(r*c/i)),await e.resize(c,s,{resample:n}))}async crop_margin(e,t=200){let n=e.clone().grayscale(),r=(0,a.min)(n.data)[0],i=(0,a.max)(n.data)[0],o=i-r;if(o===0)return e;let s=t/255,c=n.width,l=n.height,u=0,d=0,f=n.data;for(let e=0;ethis.preprocess(e))),r=(0,i.stack)(n.map(e=>e.pixel_values),0);return{pixel_values:r,original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}static async from_pretrained(e,t){let n=await(0,c.getModelJSON)(e,l.IMAGE_PROCESSOR_NAME,!0,t);return new this(n)}}},"./src/base/processing_utils.js":(t,n,r)=>{r.r(n),r.d(n,{Processor:()=>s});var i=r( +/*! ../utils/constants.js */ +`./src/utils/constants.js`),a=r( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),o=r( +/*! ../utils/hub.js */ +`./src/utils/hub.js`);class s extends a.Callable{constructor(e,t){super(),this.config=e,this.components=t}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(e,t={}){if(!this.tokenizer)throw Error(`Unable to apply chat template without a tokenizer.`);return this.tokenizer.apply_chat_template(e,{tokenize:!1,...t})}batch_decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.batch_decode(...e)}decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.decode(...e)}async _call(e,...t){for(let n of[this.image_processor,this.feature_extractor,this.tokenizer])if(n)return n(e,...t);throw Error(`No image processor, feature extractor, or tokenizer found.`)}static async from_pretrained(e,t){let[n,r]=await Promise.all([this.uses_processor_config?(0,o.getModelJSON)(e,i.PROCESSOR_NAME,!0,t):{},Promise.all(this.classes.filter(e=>e in this).map(async n=>{let r=await this[n].from_pretrained(e,t);return[n.replace(/_class$/,``),r]})).then(Object.fromEntries)]);return new this(n,r)}}e.defineProperty(s,`classes`,[`image_processor_class`,`tokenizer_class`,`feature_extractor_class`]),e.defineProperty(s,`uses_processor_config`,!1)},"./src/configs.js":(t,n,r)=>{r.r(n),r.d(n,{AutoConfig:()=>u,PretrainedConfig:()=>l,getKeyValueShapes:()=>c});var i=r( +/*! ./utils/core.js */ +`./src/utils/core.js`),a=r( +/*! ./utils/hub.js */ +`./src/utils/hub.js`);async function o(e,t){return await(0,a.getModelJSON)(e,`config.json`,!0,t)}function s(e){let t={},n={};switch(e.model_type){case`llava`:case`paligemma`:case`gemma3`:case`florence2`:case`llava_onevision`:case`idefics3`:case`ultravox`:case`smolvlm`:n=s(e.text_config);break;case`moondream1`:n=s(e.phi_config);break;case`musicgen`:n=s(e.decoder);break;case`multi_modality`:n=s(e.language_config);break;case`gpt2`:case`gptj`:case`jais`:case`codegen`:case`gpt_bigcode`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`n_embd`;break;case`gpt_neox`:case`stablelm`:case`opt`:case`falcon`:t.num_heads=`num_attention_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`;break;case`llama`:case`olmo`:case`olmo2`:case`mobilellm`:case`granite`:case`cohere`:case`mistral`:case`starcoder2`:case`qwen2`:case`qwen2_vl`:case`phi`:case`phi3`:case`phi3_v`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`,t.num_attention_heads=`num_attention_heads`;break;case`qwen3`:case`gemma`:case`gemma2`:case`gemma3_text`:case`glm`:case`helium`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.dim_kv=`head_dim`;break;case`openelm`:t.num_heads=`num_kv_heads`,t.num_layers=`num_transformer_layers`,t.dim_kv=`head_dim`;break;case`gpt_neo`:case`donut-swin`:t.num_heads=`num_heads`,t.num_layers=`num_layers`,t.hidden_size=`hidden_size`;break;case`bloom`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`hidden_size`;break;case`mpt`:t.num_heads=`n_heads`,t.num_layers=`n_layers`,t.hidden_size=`d_model`;break;case`exaone`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_layers`,t.dim_kv=`head_dim`,t.num_attention_heads=`num_attention_heads`;break;case`t5`:case`mt5`:case`longt5`:t.num_decoder_layers=`num_decoder_layers`,t.num_decoder_heads=`num_heads`,t.decoder_dim_kv=`d_kv`,t.num_encoder_layers=`num_layers`,t.num_encoder_heads=`num_heads`,t.encoder_dim_kv=`d_kv`;break;case`bart`:case`mbart`:case`marian`:case`whisper`:case`lite-whisper`:case`m2m_100`:case`blenderbot`:case`blenderbot-small`:case`florence2_language`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`d_model`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`d_model`;break;case`speecht5`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`hidden_size`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`hidden_size`;break;case`trocr`:t.num_encoder_layers=t.num_decoder_layers=`decoder_layers`,t.num_encoder_heads=t.num_decoder_heads=`decoder_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`d_model`;break;case`musicgen_decoder`:t.num_encoder_layers=t.num_decoder_layers=`num_hidden_layers`,t.num_encoder_heads=t.num_decoder_heads=`num_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`moonshine`:t.num_decoder_layers=`decoder_num_hidden_layers`,t.num_decoder_heads=`decoder_num_key_value_heads`,t.num_encoder_layers=`encoder_num_hidden_layers`,t.num_encoder_heads=`encoder_num_key_value_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`vision-encoder-decoder`:let r=s(e.decoder),a=`num_decoder_layers`in r,o=(0,i.pick)(e,[`model_type`,`is_encoder_decoder`]);return a?(o.num_decoder_layers=r.num_decoder_layers,o.num_decoder_heads=r.num_decoder_heads,o.decoder_hidden_size=r.decoder_hidden_size,o.num_encoder_layers=r.num_encoder_layers,o.num_encoder_heads=r.num_encoder_heads,o.encoder_hidden_size=r.encoder_hidden_size):(o.num_layers=r.num_layers,o.num_heads=r.num_heads,o.hidden_size=r.hidden_size),o}let r={...n,...(0,i.pick)(e,[`model_type`,`multi_query`,`is_encoder_decoder`])};for(let n in t)r[n]=e[t[n]];return r}function c(e,{prefix:t=`past_key_values`,batch_size:n=1}={}){let r={},i=e.normalized_config;if(i.is_encoder_decoder&&`num_encoder_heads`in i&&`num_decoder_heads`in i){let e=i.encoder_dim_kv??i.encoder_hidden_size/i.num_encoder_heads,a=i.decoder_dim_kv??i.decoder_hidden_size/i.num_decoder_heads,o=[n,i.num_encoder_heads,0,e],s=[n,i.num_decoder_heads,0,a];for(let e=0;e{var r,i;n.r(t),n.d(t,{apis:()=>v,env:()=>w});var a=n( +/*! fs */ +`?569f`),o=n( +/*! path */ +`?3f59`),s=n( +/*! url */ +`?154a`);let c=`3.5.2`,l=typeof window<`u`&&window.document!==void 0,u=typeof self<`u`&&(r=self.constructor)?.name===`DedicatedWorkerGlobalScope`,d=typeof self<`u`&&`caches`in self,f=typeof navigator<`u`&&`gpu`in navigator,p=typeof navigator<`u`&&`ml`in navigator,m=typeof process<`u`,h=m&&((i=process)==null||(i=i.release)==null?void 0:i.name)===`node`,g=!T(a),_=!T(o),v=Object.freeze({IS_BROWSER_ENV:l,IS_WEBWORKER_ENV:u,IS_WEB_CACHE_AVAILABLE:d,IS_WEBGPU_AVAILABLE:f,IS_WEBNN_AVAILABLE:p,IS_PROCESS_AVAILABLE:m,IS_NODE_ENV:h,IS_FS_AVAILABLE:g,IS_PATH_AVAILABLE:_}),y=g&&_,b=`./`;if(y){let e=Object(import.meta).url;e?b=o.dirname(o.dirname(s.fileURLToPath(e))):typeof __dirname<`u`&&(b=o.dirname(__dirname))}let x=y?o.join(b,`/.cache/`):null,S=`/models/`,C=y?o.join(b,S):S,w={version:c,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(l||u),localModelPath:C,useFS:g,useBrowserCache:d,useFSCache:g,cacheDir:x,useCustomCache:!1,customCache:null};function T(e){return Object.keys(e).length===0}},"./src/generation/configuration_utils.js":(t,n,r)=>{r.r(n),r.d(n,{GenerationConfig:()=>a});var i=r( +/*! ../utils/core.js */ +`./src/utils/core.js`);class a{constructor(t){e.defineProperty(this,`max_length`,20),e.defineProperty(this,`max_new_tokens`,null),e.defineProperty(this,`min_length`,0),e.defineProperty(this,`min_new_tokens`,null),e.defineProperty(this,`early_stopping`,!1),e.defineProperty(this,`max_time`,null),e.defineProperty(this,`do_sample`,!1),e.defineProperty(this,`num_beams`,1),e.defineProperty(this,`num_beam_groups`,1),e.defineProperty(this,`penalty_alpha`,null),e.defineProperty(this,`use_cache`,!0),e.defineProperty(this,`temperature`,1),e.defineProperty(this,`top_k`,50),e.defineProperty(this,`top_p`,1),e.defineProperty(this,`typical_p`,1),e.defineProperty(this,`epsilon_cutoff`,0),e.defineProperty(this,`eta_cutoff`,0),e.defineProperty(this,`diversity_penalty`,0),e.defineProperty(this,`repetition_penalty`,1),e.defineProperty(this,`encoder_repetition_penalty`,1),e.defineProperty(this,`length_penalty`,1),e.defineProperty(this,`no_repeat_ngram_size`,0),e.defineProperty(this,`bad_words_ids`,null),e.defineProperty(this,`force_words_ids`,null),e.defineProperty(this,`renormalize_logits`,!1),e.defineProperty(this,`constraints`,null),e.defineProperty(this,`forced_bos_token_id`,null),e.defineProperty(this,`forced_eos_token_id`,null),e.defineProperty(this,`remove_invalid_values`,!1),e.defineProperty(this,`exponential_decay_length_penalty`,null),e.defineProperty(this,`suppress_tokens`,null),e.defineProperty(this,`streamer`,null),e.defineProperty(this,`begin_suppress_tokens`,null),e.defineProperty(this,`forced_decoder_ids`,null),e.defineProperty(this,`guidance_scale`,null),e.defineProperty(this,`num_return_sequences`,1),e.defineProperty(this,`output_attentions`,!1),e.defineProperty(this,`output_hidden_states`,!1),e.defineProperty(this,`output_scores`,!1),e.defineProperty(this,`return_dict_in_generate`,!1),e.defineProperty(this,`pad_token_id`,null),e.defineProperty(this,`bos_token_id`,null),e.defineProperty(this,`eos_token_id`,null),e.defineProperty(this,`encoder_no_repeat_ngram_size`,0),e.defineProperty(this,`decoder_start_token_id`,null),e.defineProperty(this,`generation_kwargs`,{}),Object.assign(this,(0,i.pick)(t,Object.getOwnPropertyNames(this)))}}},"./src/generation/logits_process.js":(e,t,n)=>{n.r(t),n.d(t,{ClassifierFreeGuidanceLogitsProcessor:()=>v,ForcedBOSTokenLogitsProcessor:()=>l,ForcedEOSTokenLogitsProcessor:()=>u,LogitsProcessor:()=>o,LogitsProcessorList:()=>c,LogitsWarper:()=>s,MinLengthLogitsProcessor:()=>h,MinNewTokensLengthLogitsProcessor:()=>g,NoBadWordsLogitsProcessor:()=>_,NoRepeatNGramLogitsProcessor:()=>p,RepetitionPenaltyLogitsProcessor:()=>m,SuppressTokensAtBeginLogitsProcessor:()=>d,TemperatureLogitsWarper:()=>y,TopKLogitsWarper:()=>x,TopPLogitsWarper:()=>b,WhisperTimeStampLogitsProcessor:()=>f});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),i=n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../utils/maths.js */ +`./src/utils/maths.js`);class o extends r.Callable{_call(e,t){throw Error("`_call` should be implemented in a subclass")}}class s extends r.Callable{_call(e,t){throw Error("`_call` should be implemented in a subclass")}}class c extends r.Callable{constructor(){super(),this.processors=[]}push(e){this.processors.push(e)}extend(e){this.processors.push(...e)}_call(e,t){let n=t;for(let t of this.processors)n=t(e,n);return n}[Symbol.iterator](){return this.processors.values()}}class l extends o{constructor(e){super(),this.bos_token_id=e}_call(e,t){for(let n=0;n=1&&i[i.length-1]>=this.timestamp_begin,s=i.length<2||i[i.length-2]>=this.timestamp_begin;if(o&&(s?r.subarray(this.timestamp_begin).fill(-1/0):r.subarray(0,this.eos_token_id).fill(-1/0)),e[n].length===this.begin_index&&this.max_initial_timestamp_index!==null){let e=this.timestamp_begin+this.max_initial_timestamp_index;r.subarray(e+1).fill(-1/0)}let c=(0,a.log_softmax)(r),l=Math.log(c.subarray(this.timestamp_begin).map(Math.exp).reduce((e,t)=>e+t)),u=(0,a.max)(c.subarray(0,this.timestamp_begin))[0];l>u&&r.subarray(0,this.timestamp_begin).fill(-1/0)}return t}}class p extends o{constructor(e){super(),this.no_repeat_ngram_size=e}getNgrams(e){let t=e.length,n=[];for(let r=0;r1 to use the classifier free guidance processor, got guidance scale ${e}.`);this.guidance_scale=e}_call(e,t){if(t.dims[0]!==2*e.length)throw Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${t.dims[0]} for the logits and ${e.length} for the input ids.`);let n=e.length,r=t.slice([0,n],null),i=t.slice([n,t.dims[0]],null);for(let e=0;e1)throw Error(`\`top_p\` must be a float > 0 and < 1, but is ${e}`);if(!Number.isInteger(n)||n<1)throw Error(`\`min_tokens_to_keep\` must be a positive integer, but is ${n}`);this.top_p=e,this.filter_value=t,this.min_tokens_to_keep=n}}class x extends s{constructor(e,{filter_value:t=-1/0,min_tokens_to_keep:n=1}={}){if(super(),!Number.isInteger(e)||e<0)throw Error(`\`top_k\` must be a positive integer, but is ${e}`);this.top_k=Math.max(e,n),this.filter_value=t}}},"./src/generation/logits_sampler.js":(e,t,n)=>{n.r(t),n.d(t,{LogitsSampler:()=>s});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),i=n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../utils/maths.js */ +`./src/utils/maths.js`),o=n( +/*! ../generation/configuration_utils.js */ +`./src/generation/configuration_utils.js`);class s extends r.Callable{constructor(e){super(),this.generation_config=e}async _call(e){return this.sample(e)}async sample(e){throw Error(`sample should be implemented in subclasses.`)}getLogits(e,t){let n=e.dims.at(-1),r=e.data;if(t===-1)r=r.slice(-n);else{let e=t*n;r=r.slice(e,e+n)}return r}randomSelect(e){let t=0;for(let n=0;n1)return new u(e);if(e.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${e.num_return_sequences}.`);return new c(e)}}class c extends s{async sample(e){let t=(0,a.max)(e.data)[1];return[[BigInt(t),0]]}}class l extends s{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await(0,i.topk)(e,t),o=(0,a.softmax)(n.data);return Array.from({length:this.generation_config.num_beams},()=>{let e=this.randomSelect(o);return[r.data[e],Math.log(o[e])]})}}class u extends s{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await(0,i.topk)(e,t),o=(0,a.softmax)(n.data);return Array.from({length:this.generation_config.num_beams},(e,t)=>[r.data[t],Math.log(o[t])])}}},"./src/generation/stopping_criteria.js":(e,t,n)=>{n.r(t),n.d(t,{EosTokenCriteria:()=>s,InterruptableStoppingCriteria:()=>c,MaxLengthCriteria:()=>o,StoppingCriteria:()=>i,StoppingCriteriaList:()=>a});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`);class i extends r.Callable{_call(e,t){throw Error(`StoppingCriteria needs to be subclassed`)}}class a extends r.Callable{constructor(){super(),this.criteria=[]}push(e){this.criteria.push(e)}extend(e){e instanceof a?e=e.criteria:e instanceof i&&(e=[e]),this.criteria.push(...e)}_call(e,t){let n=Array(e.length).fill(!1);for(let i of this.criteria){var r;let a=i(e,t);for(let e=0;ee.length>=this.max_length)}}class s extends i{constructor(e){super(),Array.isArray(e)||(e=[e]),this.eos_token_id=e}_call(e,t){return e.map(e=>{let t=e.at(-1);return this.eos_token_id.some(e=>t==e)})}}class c extends i{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(e,t){return Array(e.length).fill(this.interrupted)}}},"./src/generation/streamers.js":(e,t,n)=>{n.r(t),n.d(t,{BaseStreamer:()=>o,TextStreamer:()=>c,WhisperTextStreamer:()=>l});var r=n( +/*! ../utils/core.js */ +`./src/utils/core.js`),i=n( +/*! ../tokenizers.js */ +`./src/tokenizers.js`),a=n( +/*! ../env.js */ +`./src/env.js`);class o{put(e){throw Error(`Not implemented`)}end(){throw Error(`Not implemented`)}}let s=a.apis.IS_PROCESS_AVAILABLE?e=>process.stdout.write(e):e=>console.log(e);class c extends o{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,skip_special_tokens:i=!0,decode_kwargs:a={},...o}={}){super(),this.tokenizer=e,this.skip_prompt=t,this.callback_function=n??s,this.token_callback_function=r,this.decode_kwargs={skip_special_tokens:i,...a,...o},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(e){var t;if(e.length>1)throw Error(`TextStreamer only supports batch size of 1`);let n=this.next_tokens_are_prompt;if(n&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;let a=e[0];(t=this.token_callback_function)?.call(this,a),this.token_cache=(0,r.mergeArrays)(this.token_cache,a);let o=this.tokenizer.decode(this.token_cache,this.decode_kwargs),s;n||o.endsWith(` +`)?(s=o.slice(this.print_len),this.token_cache=[],this.print_len=0):o.length>0&&(0,i.is_chinese_char)(o.charCodeAt(o.length-1))?(s=o.slice(this.print_len),this.print_len+=s.length):(s=o.slice(this.print_len,o.lastIndexOf(` `)+1),this.print_len+=s.length),this.on_finalized_text(s,!1)}end(){let e;if(this.token_cache.length>0){let t=this.tokenizer.decode(this.token_cache,this.decode_kwargs);e=t.slice(this.print_len),this.token_cache=[],this.print_len=0}else e=``;this.next_tokens_are_prompt=!0,this.on_finalized_text(e,!0)}on_finalized_text(e,t){var n,r;e.length>0&&(n=this.callback_function)?.call(this,e),t&&this.callback_function===s&&a.apis.IS_PROCESS_AVAILABLE&&(r=this.callback_function)?.call(this,` +`)}}class l extends c{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,on_chunk_start:i=null,on_chunk_end:a=null,on_finalize:o=null,time_precision:s=.02,skip_special_tokens:c=!0,decode_kwargs:l={}}={}){super(e,{skip_prompt:t,skip_special_tokens:c,callback_function:n,token_callback_function:r,decode_kwargs:l}),this.timestamp_begin=e.timestamp_begin,this.on_chunk_start=i,this.on_chunk_end=a,this.on_finalize=o,this.time_precision=s,this.waiting_for_timestamp=!1}put(e){if(e.length>1)throw Error(`WhisperTextStreamer only supports batch size of 1`);let t=e[0];if(t.length===1){let e=Number(t[0])-this.timestamp_begin;if(e>=0){var n,r,i;let a=e*this.time_precision;this.waiting_for_timestamp?(n=this.on_chunk_end)?.call(this,a):(r=this.on_chunk_start)?.call(this,a),this.waiting_for_timestamp=!this.waiting_for_timestamp,(i=this.token_callback_function)?.call(this,t);return}}return super.put(e)}end(){var e;super.end(),(e=this.on_finalize)?.call(this)}}},"./src/models.js":(t,n,r)=>{r.r(n),r.d(n,{ASTForAudioClassification:()=>kn,ASTModel:()=>On,ASTPreTrainedModel:()=>Dn,AlbertForMaskedLM:()=>zt,AlbertForQuestionAnswering:()=>Rt,AlbertForSequenceClassification:()=>Lt,AlbertModel:()=>It,AlbertPreTrainedModel:()=>Ft,AutoModel:()=>tu,AutoModelForAudioClassification:()=>bu,AutoModelForAudioFrameClassification:()=>Su,AutoModelForAudioTextToText:()=>ju,AutoModelForCTC:()=>yu,AutoModelForCausalLM:()=>cu,AutoModelForDepthEstimation:()=>Eu,AutoModelForDocumentQuestionAnswering:()=>Cu,AutoModelForImageClassification:()=>fu,AutoModelForImageFeatureExtraction:()=>ku,AutoModelForImageMatting:()=>wu,AutoModelForImageSegmentation:()=>pu,AutoModelForImageTextToText:()=>Au,AutoModelForImageToImage:()=>Tu,AutoModelForMaskGeneration:()=>vu,AutoModelForMaskedLM:()=>lu,AutoModelForNormalEstimation:()=>Du,AutoModelForObjectDetection:()=>gu,AutoModelForPoseEstimation:()=>Ou,AutoModelForQuestionAnswering:()=>uu,AutoModelForSemanticSegmentation:()=>mu,AutoModelForSeq2SeqLM:()=>iu,AutoModelForSequenceClassification:()=>nu,AutoModelForSpeechSeq2Seq:()=>au,AutoModelForTextToSpectrogram:()=>ou,AutoModelForTextToWaveform:()=>su,AutoModelForTokenClassification:()=>ru,AutoModelForUniversalSegmentation:()=>hu,AutoModelForVision2Seq:()=>du,AutoModelForXVector:()=>xu,AutoModelForZeroShotObjectDetection:()=>_u,BartForConditionalGeneration:()=>Zt,BartForSequenceClassification:()=>Qt,BartModel:()=>Xt,BartPretrainedModel:()=>Yt,BaseModelOutput:()=>he,BeitForImageClassification:()=>va,BeitModel:()=>_a,BeitPreTrainedModel:()=>ga,BertForMaskedLM:()=>ve,BertForQuestionAnswering:()=>be,BertForSequenceClassification:()=>ye,BertForTokenClassification:()=>L,BertModel:()=>_e,BertPreTrainedModel:()=>ge,BlenderbotForConditionalGeneration:()=>on,BlenderbotModel:()=>an,BlenderbotPreTrainedModel:()=>rn,BlenderbotSmallForConditionalGeneration:()=>ln,BlenderbotSmallModel:()=>cn,BlenderbotSmallPreTrainedModel:()=>sn,BloomForCausalLM:()=>Oi,BloomModel:()=>Di,BloomPreTrainedModel:()=>Ei,CLIPModel:()=>Yn,CLIPPreTrainedModel:()=>Jn,CLIPSegForImageSegmentation:()=>G,CLIPSegModel:()=>dr,CLIPSegPreTrainedModel:()=>ur,CLIPTextModel:()=>Xn,CLIPTextModelWithProjection:()=>Zn,CLIPVisionModel:()=>Qn,CLIPVisionModelWithProjection:()=>$n,CamembertForMaskedLM:()=>Ke,CamembertForQuestionAnswering:()=>Ye,CamembertForSequenceClassification:()=>qe,CamembertForTokenClassification:()=>Je,CamembertModel:()=>Ge,CamembertPreTrainedModel:()=>We,CausalLMOutput:()=>Lu,CausalLMOutputWithPast:()=>Ru,ChineseCLIPModel:()=>ar,ChineseCLIPPreTrainedModel:()=>ir,ClapAudioModelWithProjection:()=>ac,ClapModel:()=>rc,ClapPreTrainedModel:()=>nc,ClapTextModelWithProjection:()=>ic,CodeGenForCausalLM:()=>Er,CodeGenModel:()=>Tr,CodeGenPreTrainedModel:()=>Z,CohereForCausalLM:()=>$r,CohereModel:()=>Qr,CoherePreTrainedModel:()=>Zr,ConvBertForMaskedLM:()=>Fe,ConvBertForQuestionAnswering:()=>Re,ConvBertForSequenceClassification:()=>Ie,ConvBertForTokenClassification:()=>Le,ConvBertModel:()=>R,ConvBertPreTrainedModel:()=>Pe,ConvNextForImageClassification:()=>Mo,ConvNextModel:()=>jo,ConvNextPreTrainedModel:()=>Ao,ConvNextV2ForImageClassification:()=>Fo,ConvNextV2Model:()=>Po,ConvNextV2PreTrainedModel:()=>No,DFineForObjectDetection:()=>za,DFineModel:()=>Ra,DFinePreTrainedModel:()=>La,DPTForDepthEstimation:()=>co,DPTModel:()=>so,DPTPreTrainedModel:()=>oo,DacDecoderModel:()=>ul,DacDecoderOutput:()=>sl,DacEncoderModel:()=>ll,DacEncoderOutput:()=>ol,DacModel:()=>cl,DacPreTrainedModel:()=>al,DebertaForMaskedLM:()=>Qe,DebertaForQuestionAnswering:()=>tt,DebertaForSequenceClassification:()=>$e,DebertaForTokenClassification:()=>et,DebertaModel:()=>Ze,DebertaPreTrainedModel:()=>Xe,DebertaV2ForMaskedLM:()=>it,DebertaV2ForQuestionAnswering:()=>st,DebertaV2ForSequenceClassification:()=>at,DebertaV2ForTokenClassification:()=>ot,DebertaV2Model:()=>rt,DebertaV2PreTrainedModel:()=>nt,DecisionTransformerModel:()=>zc,DecisionTransformerPreTrainedModel:()=>Rc,DeiTForImageClassification:()=>Ka,DeiTModel:()=>Ga,DeiTPreTrainedModel:()=>Wa,DepthAnythingForDepthEstimation:()=>uo,DepthAnythingPreTrainedModel:()=>lo,DepthProForDepthEstimation:()=>_o,DepthProPreTrainedModel:()=>go,DetrForObjectDetection:()=>xa,DetrForSegmentation:()=>Sa,DetrModel:()=>ba,DetrObjectDetectionOutput:()=>Ca,DetrPreTrainedModel:()=>ya,DetrSegmentationOutput:()=>wa,Dinov2ForImageClassification:()=>Ro,Dinov2Model:()=>Lo,Dinov2PreTrainedModel:()=>Io,Dinov2WithRegistersForImageClassification:()=>Vo,Dinov2WithRegistersModel:()=>Bo,Dinov2WithRegistersPreTrainedModel:()=>zo,DistilBertForMaskedLM:()=>pt,DistilBertForQuestionAnswering:()=>ft,DistilBertForSequenceClassification:()=>ut,DistilBertForTokenClassification:()=>dt,DistilBertModel:()=>lt,DistilBertPreTrainedModel:()=>ct,DonutSwinModel:()=>ko,DonutSwinPreTrainedModel:()=>Oo,EfficientNetForImageClassification:()=>_c,EfficientNetModel:()=>gc,EfficientNetPreTrainedModel:()=>hc,ElectraForMaskedLM:()=>Ve,ElectraForQuestionAnswering:()=>Ue,ElectraForSequenceClassification:()=>z,ElectraForTokenClassification:()=>He,ElectraModel:()=>Be,ElectraPreTrainedModel:()=>ze,EsmForMaskedLM:()=>gt,EsmForSequenceClassification:()=>_t,EsmForTokenClassification:()=>vt,EsmModel:()=>ht,EsmPreTrainedModel:()=>mt,ExaoneForCausalLM:()=>Rr,ExaoneModel:()=>Lr,ExaonePreTrainedModel:()=>Ir,FalconForCausalLM:()=>tc,FalconModel:()=>ec,FalconPreTrainedModel:()=>$s,FastViTForImageClassification:()=>ta,FastViTModel:()=>ea,FastViTPreTrainedModel:()=>$i,Florence2ForConditionalGeneration:()=>Bn,Florence2PreTrainedModel:()=>zn,GLPNForDepthEstimation:()=>Do,GLPNModel:()=>Eo,GLPNPreTrainedModel:()=>To,GPT2LMHeadModel:()=>mr,GPT2Model:()=>pr,GPT2PreTrainedModel:()=>fr,GPTBigCodeForCausalLM:()=>wr,GPTBigCodeModel:()=>Cr,GPTBigCodePreTrainedModel:()=>Sr,GPTJForCausalLM:()=>xr,GPTJModel:()=>X,GPTJPreTrainedModel:()=>Y,GPTNeoForCausalLM:()=>vr,GPTNeoModel:()=>q,GPTNeoPreTrainedModel:()=>_r,GPTNeoXForCausalLM:()=>br,GPTNeoXModel:()=>J,GPTNeoXPreTrainedModel:()=>yr,Gemma2ForCausalLM:()=>ai,Gemma2Model:()=>ii,Gemma2PreTrainedModel:()=>ri,Gemma3ForCausalLM:()=>ci,Gemma3Model:()=>si,Gemma3PreTrainedModel:()=>oi,GemmaForCausalLM:()=>ni,GemmaModel:()=>ti,GemmaPreTrainedModel:()=>ei,GlmForCausalLM:()=>Fr,GlmModel:()=>Pr,GlmPreTrainedModel:()=>Nr,GraniteForCausalLM:()=>Xr,GraniteModel:()=>Yr,GranitePreTrainedModel:()=>Jr,GroundingDinoForObjectDetection:()=>Uo,GroundingDinoPreTrainedModel:()=>Ho,GroupViTModel:()=>Qi,GroupViTPreTrainedModel:()=>Zi,HeliumForCausalLM:()=>Mr,HeliumModel:()=>jr,HeliumPreTrainedModel:()=>Ar,HieraForImageClassification:()=>Ya,HieraModel:()=>Ja,HieraPreTrainedModel:()=>qa,HubertForCTC:()=>As,HubertForSequenceClassification:()=>js,HubertModel:()=>ks,HubertPreTrainedModel:()=>Os,IJepaForImageClassification:()=>Bi,IJepaModel:()=>zi,IJepaPreTrainedModel:()=>Ri,Idefics3ForConditionalGeneration:()=>Wn,Idefics3PreTrainedModel:()=>Un,ImageMattingOutput:()=>zu,JAISLMHeadModel:()=>K,JAISModel:()=>gr,JAISPreTrainedModel:()=>hr,JinaCLIPModel:()=>sr,JinaCLIPPreTrainedModel:()=>or,JinaCLIPTextModel:()=>cr,JinaCLIPVisionModel:()=>lr,LiteWhisperForConditionalGeneration:()=>Mn,LlamaForCausalLM:()=>kr,LlamaModel:()=>Or,LlamaPreTrainedModel:()=>Dr,LlavaForConditionalGeneration:()=>W,LlavaOnevisionForConditionalGeneration:()=>Ln,LlavaPreTrainedModel:()=>In,LongT5ForConditionalGeneration:()=>Gt,LongT5Model:()=>Wt,LongT5PreTrainedModel:()=>Ut,M2M100ForConditionalGeneration:()=>ns,M2M100Model:()=>ts,M2M100PreTrainedModel:()=>es,MBartForCausalLM:()=>B,MBartForConditionalGeneration:()=>tn,MBartForSequenceClassification:()=>nn,MBartModel:()=>en,MBartPreTrainedModel:()=>$t,MPNetForMaskedLM:()=>Et,MPNetForQuestionAnswering:()=>kt,MPNetForSequenceClassification:()=>Dt,MPNetForTokenClassification:()=>Ot,MPNetModel:()=>Tt,MPNetPreTrainedModel:()=>wt,MT5ForConditionalGeneration:()=>Jt,MT5Model:()=>qt,MT5PreTrainedModel:()=>Kt,MarianMTModel:()=>$o,MarianModel:()=>Qo,MarianPreTrainedModel:()=>Zo,MaskFormerForInstanceSegmentation:()=>wo,MaskFormerModel:()=>Co,MaskFormerPreTrainedModel:()=>So,MaskedLMOutput:()=>Fu,Metric3DForDepthEstimation:()=>yo,Metric3DPreTrainedModel:()=>vo,Metric3Dv2ForDepthEstimation:()=>xo,Metric3Dv2PreTrainedModel:()=>bo,MgpstrForSceneTextRecognition:()=>Wc,MgpstrModelOutput:()=>Hc,MgpstrPreTrainedModel:()=>Uc,MimiDecoderModel:()=>il,MimiDecoderOutput:()=>tl,MimiEncoderModel:()=>rl,MimiEncoderOutput:()=>el,MimiModel:()=>nl,MimiPreTrainedModel:()=>$c,MistralForCausalLM:()=>Ys,MistralModel:()=>Js,MistralPreTrainedModel:()=>qs,MobileBertForMaskedLM:()=>xt,MobileBertForQuestionAnswering:()=>Ct,MobileBertForSequenceClassification:()=>St,MobileBertModel:()=>bt,MobileBertPreTrainedModel:()=>yt,MobileLLMForCausalLM:()=>Vr,MobileLLMModel:()=>Br,MobileLLMPreTrainedModel:()=>zr,MobileNetV1ForImageClassification:()=>wc,MobileNetV1ForSemanticSegmentation:()=>Tc,MobileNetV1Model:()=>Cc,MobileNetV1PreTrainedModel:()=>Sc,MobileNetV2ForImageClassification:()=>Oc,MobileNetV2ForSemanticSegmentation:()=>kc,MobileNetV2Model:()=>Dc,MobileNetV2PreTrainedModel:()=>Ec,MobileNetV3ForImageClassification:()=>Mc,MobileNetV3ForSemanticSegmentation:()=>Nc,MobileNetV3Model:()=>jc,MobileNetV3PreTrainedModel:()=>Ac,MobileNetV4ForImageClassification:()=>Ic,MobileNetV4ForSemanticSegmentation:()=>Lc,MobileNetV4Model:()=>Fc,MobileNetV4PreTrainedModel:()=>Pc,MobileViTForImageClassification:()=>oa,MobileViTModel:()=>aa,MobileViTPreTrainedModel:()=>ia,MobileViTV2ForImageClassification:()=>la,MobileViTV2Model:()=>ca,MobileViTV2PreTrainedModel:()=>sa,ModelOutput:()=>me,ModernBertForMaskedLM:()=>Ce,ModernBertForSequenceClassification:()=>we,ModernBertForTokenClassification:()=>Te,ModernBertModel:()=>Se,ModernBertPreTrainedModel:()=>xe,Moondream1ForConditionalGeneration:()=>Rn,MoonshineForConditionalGeneration:()=>Pn,MoonshineModel:()=>Nn,MoonshinePreTrainedModel:()=>U,MptForCausalLM:()=>ji,MptModel:()=>Ai,MptPreTrainedModel:()=>ki,MultiModalityCausalLM:()=>Vc,MultiModalityPreTrainedModel:()=>Bc,MusicgenForCausalLM:()=>bc,MusicgenForConditionalGeneration:()=>xc,MusicgenModel:()=>yc,MusicgenPreTrainedModel:()=>vc,NomicBertModel:()=>De,NomicBertPreTrainedModel:()=>Ee,OPTForCausalLM:()=>Pi,OPTModel:()=>Ni,OPTPreTrainedModel:()=>Mi,Olmo2ForCausalLM:()=>qr,Olmo2Model:()=>Kr,Olmo2PreTrainedModel:()=>Gr,OlmoForCausalLM:()=>Wr,OlmoModel:()=>Ur,OlmoPreTrainedModel:()=>Hr,OpenELMForCausalLM:()=>di,OpenELMModel:()=>ui,OpenELMPreTrainedModel:()=>li,OwlViTForObjectDetection:()=>fa,OwlViTModel:()=>da,OwlViTPreTrainedModel:()=>ua,Owlv2ForObjectDetection:()=>ha,Owlv2Model:()=>ma,Owlv2PreTrainedModel:()=>pa,PaliGemmaForConditionalGeneration:()=>Hn,PaliGemmaPreTrainedModel:()=>Vn,PatchTSMixerForPrediction:()=>Xc,PatchTSMixerModel:()=>Yc,PatchTSMixerPreTrainedModel:()=>Jc,PatchTSTForPrediction:()=>qc,PatchTSTModel:()=>Kc,PatchTSTPreTrainedModel:()=>Gc,Phi3ForCausalLM:()=>Ti,Phi3Model:()=>wi,Phi3PreTrainedModel:()=>Ci,Phi3VForCausalLM:()=>qn,Phi3VPreTrainedModel:()=>Kn,PhiForCausalLM:()=>Si,PhiModel:()=>xi,PhiPreTrainedModel:()=>bi,PreTrainedModel:()=>I,PretrainedMixin:()=>hl,PvtForImageClassification:()=>Gi,PvtModel:()=>Wi,PvtPreTrainedModel:()=>Ui,PyAnnoteForAudioFrameClassification:()=>fs,PyAnnoteModel:()=>ds,PyAnnotePreTrainedModel:()=>us,QuestionAnsweringModelOutput:()=>Iu,Qwen2ForCausalLM:()=>mi,Qwen2Model:()=>pi,Qwen2PreTrainedModel:()=>fi,Qwen2VLForConditionalGeneration:()=>yi,Qwen2VLPreTrainedModel:()=>vi,Qwen3ForCausalLM:()=>_i,Qwen3Model:()=>gi,Qwen3PreTrainedModel:()=>hi,RFDetrForObjectDetection:()=>Fa,RFDetrModel:()=>Pa,RFDetrObjectDetectionOutput:()=>Ia,RFDetrPreTrainedModel:()=>Na,RTDetrForObjectDetection:()=>Da,RTDetrModel:()=>Ea,RTDetrObjectDetectionOutput:()=>Oa,RTDetrPreTrainedModel:()=>Ta,RTDetrV2ForObjectDetection:()=>ja,RTDetrV2Model:()=>Aa,RTDetrV2ObjectDetectionOutput:()=>Ma,RTDetrV2PreTrainedModel:()=>ka,ResNetForImageClassification:()=>Qa,ResNetModel:()=>Za,ResNetPreTrainedModel:()=>Xa,RoFormerForMaskedLM:()=>Ae,RoFormerForQuestionAnswering:()=>Ne,RoFormerForSequenceClassification:()=>je,RoFormerForTokenClassification:()=>Me,RoFormerModel:()=>ke,RoFormerPreTrainedModel:()=>Oe,RobertaForMaskedLM:()=>fn,RobertaForQuestionAnswering:()=>hn,RobertaForSequenceClassification:()=>pn,RobertaForTokenClassification:()=>mn,RobertaModel:()=>dn,RobertaPreTrainedModel:()=>un,SamImageSegmentationOutput:()=>Xo,SamModel:()=>Yo,SamPreTrainedModel:()=>Jo,SapiensForDepthEstimation:()=>mo,SapiensForNormalEstimation:()=>ho,SapiensForSemanticSegmentation:()=>po,SapiensPreTrainedModel:()=>fo,SegformerForImageClassification:()=>uc,SegformerForSemanticSegmentation:()=>dc,SegformerModel:()=>lc,SegformerPreTrainedModel:()=>cc,Seq2SeqLMOutput:()=>Mu,SequenceClassifierOutput:()=>Q,SiglipModel:()=>tr,SiglipPreTrainedModel:()=>er,SiglipTextModel:()=>nr,SiglipVisionModel:()=>rr,SmolVLMForConditionalGeneration:()=>Gn,SnacDecoderModel:()=>ml,SnacEncoderModel:()=>pl,SnacModel:()=>fl,SnacPreTrainedModel:()=>dl,SpeechT5ForSpeechToText:()=>Hs,SpeechT5ForTextToSpeech:()=>Us,SpeechT5HifiGan:()=>Ws,SpeechT5Model:()=>Vs,SpeechT5PreTrainedModel:()=>Bs,SqueezeBertForMaskedLM:()=>Mt,SqueezeBertForQuestionAnswering:()=>Pt,SqueezeBertForSequenceClassification:()=>Nt,SqueezeBertModel:()=>jt,SqueezeBertPreTrainedModel:()=>At,StableLmForCausalLM:()=>mc,StableLmModel:()=>pc,StableLmPreTrainedModel:()=>fc,Starcoder2ForCausalLM:()=>Qs,Starcoder2Model:()=>Zs,Starcoder2PreTrainedModel:()=>Xs,StyleTextToSpeech2Model:()=>zs,StyleTextToSpeech2PreTrainedModel:()=>Rs,Swin2SRForImageSuperResolution:()=>ao,Swin2SRModel:()=>io,Swin2SRPreTrainedModel:()=>ro,SwinForImageClassification:()=>to,SwinForSemanticSegmentation:()=>no,SwinModel:()=>eo,SwinPreTrainedModel:()=>$a,T5ForConditionalGeneration:()=>Ht,T5Model:()=>Vt,T5PreTrainedModel:()=>Bt,TableTransformerForObjectDetection:()=>Ha,TableTransformerModel:()=>Va,TableTransformerObjectDetectionOutput:()=>Ua,TableTransformerPreTrainedModel:()=>Ba,TokenClassifierOutput:()=>Pu,TrOCRForCausalLM:()=>Ks,TrOCRPreTrainedModel:()=>Gs,UltravoxModel:()=>Qc,UltravoxPreTrainedModel:()=>Zc,UniSpeechForCTC:()=>_s,UniSpeechForSequenceClassification:()=>vs,UniSpeechModel:()=>gs,UniSpeechPreTrainedModel:()=>hs,UniSpeechSatForAudioFrameClassification:()=>Cs,UniSpeechSatForCTC:()=>xs,UniSpeechSatForSequenceClassification:()=>Ss,UniSpeechSatModel:()=>bs,UniSpeechSatPreTrainedModel:()=>ys,ViTForImageClassification:()=>Li,ViTMAEModel:()=>qi,ViTMAEPreTrainedModel:()=>Ki,ViTMSNForImageClassification:()=>Xi,ViTMSNModel:()=>Yi,ViTMSNPreTrainedModel:()=>Ji,ViTModel:()=>Ii,ViTPreTrainedModel:()=>Fi,VisionEncoderDecoderModel:()=>Fn,VitMatteForImageMatting:()=>ra,VitMattePreTrainedModel:()=>na,VitPoseForPoseEstimation:()=>Hi,VitPosePreTrainedModel:()=>Vi,VitsModel:()=>sc,VitsModelOutput:()=>Bu,VitsPreTrainedModel:()=>oc,Wav2Vec2BertForCTC:()=>Es,Wav2Vec2BertForSequenceClassification:()=>Ds,Wav2Vec2BertModel:()=>Ts,Wav2Vec2BertPreTrainedModel:()=>ws,Wav2Vec2ForAudioFrameClassification:()=>ls,Wav2Vec2ForCTC:()=>ss,Wav2Vec2ForSequenceClassification:()=>cs,Wav2Vec2Model:()=>os,Wav2Vec2PreTrainedModel:()=>rs,WavLMForAudioFrameClassification:()=>Ls,WavLMForCTC:()=>Ps,WavLMForSequenceClassification:()=>Fs,WavLMForXVector:()=>Is,WavLMModel:()=>Ns,WavLMPreTrainedModel:()=>Ms,WeSpeakerResNetModel:()=>ms,WeSpeakerResNetPreTrainedModel:()=>ps,WhisperForConditionalGeneration:()=>jn,WhisperModel:()=>An,WhisperPreTrainedModel:()=>H,XLMForQuestionAnswering:()=>xn,XLMForSequenceClassification:()=>yn,XLMForTokenClassification:()=>bn,XLMModel:()=>_n,XLMPreTrainedModel:()=>gn,XLMRobertaForMaskedLM:()=>Cn,XLMRobertaForQuestionAnswering:()=>En,XLMRobertaForSequenceClassification:()=>wn,XLMRobertaForTokenClassification:()=>Tn,XLMRobertaModel:()=>Sn,XLMRobertaPreTrainedModel:()=>V,XLMWithLMHeadModel:()=>vn,XVectorOutput:()=>Nu,YolosForObjectDetection:()=>Ko,YolosModel:()=>Go,YolosObjectDetectionOutput:()=>qo,YolosPreTrainedModel:()=>Wo});var i=r( +/*! ./configs.js */ +`./src/configs.js`),a=r( +/*! ./backends/onnx.js */ +`./src/backends/onnx.js`),o=r( +/*! ./utils/dtypes.js */ +`./src/utils/dtypes.js`),s=r( +/*! ./utils/generic.js */ +`./src/utils/generic.js`),c=r( +/*! ./utils/core.js */ +`./src/utils/core.js`),l=r( +/*! ./utils/hub.js */ +`./src/utils/hub.js`),u=r( +/*! ./utils/constants.js */ +`./src/utils/constants.js`),d=r( +/*! ./generation/logits_process.js */ +`./src/generation/logits_process.js`),f=r( +/*! ./generation/configuration_utils.js */ +`./src/generation/configuration_utils.js`),p=r( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),m=r( +/*! ./utils/image.js */ +`./src/utils/image.js`),h=r( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),g=r( +/*! ./generation/stopping_criteria.js */ +`./src/generation/stopping_criteria.js`),_=r( +/*! ./generation/logits_sampler.js */ +`./src/generation/logits_sampler.js`),v=r( +/*! ./env.js */ +`./src/env.js`),y=r( +/*! ./models/whisper/generation_whisper.js */ +`./src/models/whisper/generation_whisper.js`),b=r( +/*! ./models/whisper/common_whisper.js */ +`./src/models/whisper/common_whisper.js`);let x={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11},S=new Map,C=new Map,w=new Map;async function T(e,t,n){var r;let s=(r=n.config)?.[`transformers.js_config`]??{},c=n.device??s.device;c&&typeof c!=`string`&&(c.hasOwnProperty(t)?c=c[t]:(console.warn(`device not specified for "${t}". Using the default device.`),c=null));let u=c??(v.apis.IS_NODE_ENV?`cpu`:`wasm`),d=(0,a.deviceToExecutionProviders)(u),f=s.device_config??{};f.hasOwnProperty(u)&&(s={...s,...f[u]});let p=n.dtype??s.dtype;if(typeof p!=`string`&&(p&&p.hasOwnProperty(t)?p=p[t]:(p=o.DEFAULT_DEVICE_DTYPE_MAPPING[u]??o.DATA_TYPES.fp32,console.warn(`dtype not specified for "${t}". Using the default dtype (${p}) for this device (${u}).`))),p===o.DATA_TYPES.auto){let e=s.dtype;typeof e!=`string`&&(e=e?.[t]),p=e&&e!==o.DATA_TYPES.auto&&o.DATA_TYPES.hasOwnProperty(e)?e:o.DEFAULT_DEVICE_DTYPE_MAPPING[u]??o.DATA_TYPES.fp32}let m=p;if(o.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(m)){if(m===o.DATA_TYPES.fp16&&u===`webgpu`&&!await(0,o.isWebGpuFp16Supported)())throw Error(`The device (${u}) does not support fp16.`)}else throw Error(`Invalid dtype: ${m}. Should be one of: ${Object.keys(o.DATA_TYPES).join(`, `)}`);let h=s.kv_cache_dtype,g=h?typeof h==`string`?h:h[m]??`float32`:void 0;if(g&&![`float32`,`float16`].includes(g))throw Error(`Invalid kv_cache_dtype: ${g}. Should be one of: float32, float16`);let _={dtype:m,kv_cache_dtype:g,device:u},y=o.DEFAULT_DTYPE_SUFFIX_MAPPING[m],b=`${t}${y}.onnx`,x=`${n.subfolder??``}/${b}`,S={...n.session_options};S.executionProviders??=d;let C=s.free_dimension_overrides;C?S.freeDimensionOverrides??=C:u.startsWith(`webnn`)&&!S.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${u}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let w=v.apis.IS_NODE_ENV&&v.env.useFSCache,T=(0,l.getModelFile)(e,x,!0,n,w),E=n.use_external_data_format??s.use_external_data_format,D=[];if(E){let r;r=typeof E==`object`?E.hasOwnProperty(b)?E[b]:E.hasOwnProperty(t)?E[t]:!1:E;let i=+r;if(i>l.MAX_EXTERNAL_DATA_CHUNKS)throw Error(`The number of external data chunks (${i}) exceeds the maximum allowed value (${l.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let t=0;t{let o=await(0,l.getModelFile)(e,i,!0,n,w);t(o instanceof Uint8Array?{path:r,data:o}:r)}))}}else S.externalData!==void 0&&(D=S.externalData.map(async t=>{if(typeof t.data==`string`){let r=await(0,l.getModelFile)(e,t.data,!0,n);return{...t,data:r}}return t}));if(D.length>0){let e=await Promise.all(D);v.apis.IS_NODE_ENV||(S.externalData=e)}if(u===`webgpu`){let e=(0,i.getKeyValueShapes)(n.config,{prefix:`present`});if(Object.keys(e).length>0&&!(0,a.isONNXProxy)()){let t={};for(let n in e)t[n]=`gpu-buffer`;S.preferredOutputLocation=t}}let O=await T;return{buffer_or_path:O,session_options:S,session_config:_}}async function E(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let{buffer_or_path:i,session_options:o,session_config:s}=await T(e,t[r],n),c=await(0,a.createInferenceSession)(i,o,s);return[r,c]})))}async function D(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let i=await(0,l.getModelJSON)(e,t[r],!1,n);return[r,i]})))}function O(e,t){let n=Object.create(null),r=[];for(let i of e.inputNames){let e=t[i];if(!(e instanceof p.Tensor)){r.push(i);continue}n[i]=(0,a.isONNXProxy)()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let i=Object.keys(t).length,o=e.inputNames.length;if(i>o){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));console.warn(`WARNING: Too many inputs were provided (${i} > ${o}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}let ee=Promise.resolve();async function k(e,t){let n=O(e,t);try{let t=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,t.ort_tensor])),r=()=>e.run(t),i=await(v.apis.IS_BROWSER_ENV||v.apis.IS_WEBWORKER_ENV?ee=ee.then(r):r());return te(i)}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw console.error(`An error occurred during model execution: "${e}".`),console.error(`Inputs given to model:`,t),e}}function te(e){for(let t in e)(0,a.isONNXTensor)(e[t])?e[t]=new p.Tensor(e[t]):typeof e[t]==`object`&&te(e[t]);return e}function ne(e){if(e instanceof p.Tensor)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new p.Tensor(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new p.Tensor(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function re(e){return new p.Tensor(`bool`,[e],[1])}async function ie(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,...a}=t;if(!n){let r=(0,c.pick)(t,e.sessions.model.inputNames);n=(await A(e,r)).last_hidden_state}a.input_ids=i,a.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(a.encoder_attention_mask=t.attention_mask);let o=await oe(e,a,!0);return o}async function A(e,t){let n=e.sessions.model,r=(0,c.pick)(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=(0,p.zeros_like)(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=(0,p.ones)([e[0],e[2],e[3]])}return await k(n,r)}async function ae(e,t){let n=await e.encode(t),r=await e.decode(n);return r}async function oe(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;if(r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=re(!!i)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids){let t=[`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type)?1:0;a.position_ids=fe(a,i,t)}e.addPastKeyValues(a,i);let o=(0,c.pick)(a,r.inputNames);return await k(r,o)}function se({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;er.dims[1])){if(tt==e.config.image_token_index)){let i=e.config.num_image_tokens;if(!i)throw Error("`num_image_tokens` is missing in the model configuration.");let a=r.dims[1]-(t-i);n.input_ids=r.slice(null,[-a,null]),n.attention_mask=(0,p.ones)([1,t+a])}}}return n}function N(e,t,n,r){return n.past_key_values&&(t=t.map(e=>[e.at(-1)])),{...n,decoder_input_ids:ne(t)}}function P(e,...t){return e.config.is_encoder_decoder?N(e,...t):pe(e,...t)}function F(e,t,n,r){let i=!!n.past_key_values;if(r.guidance_scale!==null&&r.guidance_scale>1&&(i?n.input_ids=(0,p.cat)([n.input_ids,n.input_ids],0):(n.input_ids=(0,p.cat)([n.input_ids,(0,p.full_like)(n.input_ids,BigInt(r.pad_token_id))],0),n.attention_mask=(0,p.cat)([n.attention_mask,(0,p.full_like)(n.attention_mask,0n)],0))),(i||!n.pixel_values)&&(n.pixel_values=(0,p.full)([0,0,3,384,384],1)),i){let e=0,t=1,r=e>0?1:0,i=1;n.images_seq_mask=new p.Tensor(`bool`,Array(e+t).fill(!0).fill(!1,0,t),[i,e+t]),n.images_emb_mask=new p.Tensor(`bool`,Array(e).fill(!!r),[i,1,e])}return n}class I extends s.Callable{constructor(t,n,r){super(),e.defineProperty(this,`main_input_name`,`input_ids`),e.defineProperty(this,`forward_params`,[`input_ids`,`attention_mask`]),this.config=t,this.sessions=n,this.configs=r;let i=w.get(this.constructor),a=S.get(i);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,a){case x.DecoderOnly:this.can_generate=!0,this._forward=oe,this._prepare_inputs_for_generation=pe;break;case x.Seq2Seq:case x.Vision2Seq:case x.Musicgen:this.can_generate=!0,this._forward=ie,this._prepare_inputs_for_generation=N;break;case x.EncoderDecoder:this._forward=ie;break;case x.ImageTextToText:this.can_generate=!0,this._forward=M,this._prepare_inputs_for_generation=P;break;case x.AudioTextToText:this.can_generate=!0,this._forward=j,this._prepare_inputs_for_generation=P;break;case x.Phi3V:this.can_generate=!0,this._prepare_inputs_for_generation=P;break;case x.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=F;break;case x.AutoEncoder:this._forward=ae;break;default:this._forward=A;break}this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){var e;let t=[];for(let n of Object.values(this.sessions))!(n==null||(e=n.handler)==null)&&e.dispose&&t.push(n.handler.dispose());return await Promise.all(t)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:l=null,dtype:d=null,use_external_data_format:f=null,session_options:p={}}={}){let m={progress_callback:t,config:n,cache_dir:r,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:l,dtype:d,use_external_data_format:f,session_options:p},h=w.get(this),g=S.get(h);n=m.config=await i.AutoConfig.from_pretrained(e,m);let _;if(g===x.DecoderOnly)_=await Promise.all([E(e,{model:m.model_file_name??`model`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.Seq2Seq||g===x.Vision2Seq)_=await Promise.all([E(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.MaskGeneration)_=await Promise.all([E(e,{model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`},m)]);else if(g===x.EncoderDecoder)_=await Promise.all([E(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m)]);else if(g===x.ImageTextToText){let t={embed_tokens:`embed_tokens`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};n.is_encoder_decoder&&(t.model=`encoder_model`),_=await Promise.all([E(e,t,m),D(e,{generation_config:`generation_config.json`},m)])}else if(g===x.AudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([E(e,t,m),D(e,{generation_config:`generation_config.json`},m)])}else if(g===x.Musicgen)_=await Promise.all([E(e,{model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.MultiModality)_=await Promise.all([E(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.Phi3V)_=await Promise.all([E(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.AutoEncoder)_=await Promise.all([E(e,{encoder_model:`encoder_model`,decoder_model:`decoder_model`},m)]);else{if(g!==x.EncoderOnly){let e=h??n?.model_type;e!==`custom`&&console.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${u.GITHUB_ISSUE_URL}.`)}_=await Promise.all([E(e,{model:m.model_file_name??`model`},m)])}return new this(n,..._)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){var e;return(e=this.configs)?.generation_config??null}_get_logits_warper(e){let t=new d.LogitsProcessorList;return e.temperature!==null&&e.temperature!==1&&t.push(new d.TemperatureLogitsWarper(e.temperature)),e.top_k!==null&&e.top_k!==0&&t.push(new d.TopKLogitsWarper(e.top_k)),e.top_p!==null&&e.top_p<1&&t.push(new d.TopPLogitsWarper(e.top_p)),t}_get_logits_processor(e,t,n=null){let r=new d.LogitsProcessorList;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new d.RepetitionPenaltyLogitsProcessor(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new d.NoRepeatNGramLogitsProcessor(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new d.NoBadWordsLogitsProcessor(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new d.MinLengthLogitsProcessor(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new d.MinNewTokensLengthLogitsProcessor(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new d.ForcedBOSTokenLogitsProcessor(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new d.ForcedEOSTokenLogitsProcessor(e.max_length,e.forced_eos_token_id)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new d.SuppressTokensAtBeginLogitsProcessor(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new d.ClassifierFreeGuidanceLogitsProcessor(e.guidance_scale)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=f.GenerationConfig){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,(0,c.pick)(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new g.StoppingCriteriaList;return e.max_length!==null&&n.push(new g.MaxLengthCriteria(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new g.EosTokenCriteria(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[El,Al,Tl,bl],t=w.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t.get(r);e&&n.add(e[0])}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=this.getPastKeyValues(t,n.past_key_values),n.input_ids=new p.Tensor(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n:n.attention_mask=(0,p.cat)([n.attention_mask,(0,p.ones)([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=(0,c.pick)(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;let a=r[i];return{inputs_tensor:a,model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...(0,c.pick)(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await A(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=(0,p.cat)([i,(0,p.full_like)(i,0)],0),`attention_mask`in t&&(t.attention_mask=(0,p.cat)([t.attention_mask,(0,p.zeros_like)(t.attention_mask)],0));else if(t.decoder_input_ids){let e=ne(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=(0,p.cat)(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof p.Tensor)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=ne(o)}return n.decoder_attention_mask=(0,p.ones_like)(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let f=this._get_logits_processor(t,d,n),m=this._get_stopping_criteria(t,r),h=s[c].dims.at(0),g=_.LogitsSampler.getSampler(t),v=Array(h).fill(0),y=u.tolist();i&&i.put(y);let b,x={};for(;;){if(s=this.prepare_inputs_for_generation(y,s,t),b=await this.forward(s),t.output_attentions&&t.return_dict_in_generate){let e=this.getAttentions(b);for(let t in e)t in x||(x[t]=[]),x[t].push(e[t])}let e=b.logits.slice(null,-1,null),n=f(y,e),r=[];for(let e=0;ee))break;s=this._update_model_kwargs_for_generation({generated_input_ids:r,outputs:b,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let S=this.getPastKeyValues(b,s.past_key_values,!0),C=new p.Tensor(`int64`,y.flat(),[y.length,y[0].length]);if(t.return_dict_in_generate)return{sequences:C,past_key_values:S,...x};for(let e of Object.values(b))e.location===`gpu-buffer`&&e.dispose();return C}getPastKeyValues(e,t,n=!1){let r=Object.create(null);for(let i in e)if(i.startsWith(`present`)){let a=i.replace(`present`,`past_key_values`),o=i.includes(`encoder`);if(o&&t?r[a]=t[a]:r[a]=e[i],t&&(!o||n)){let e=t[a];e.location===`gpu-buffer`&&e.dispose()}}return r}getAttentions(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}addPastKeyValues(e,t){if(t)Object.assign(e,t);else{var n,r;let t=this.sessions.decoder_model_merged??this.sessions.model,a=(t==null||(n=t.config)==null?void 0:n.kv_cache_dtype)??`float32`,o=a===`float16`?new p.DataTypeMap.float16:[],s=((r=e[this.main_input_name]??e.attention_mask)==null||(r=r.dims)==null?void 0:r[0])??1,c=(0,i.getKeyValueShapes)(this.config,{batch_size:s});for(let t in c)e[t]=new p.Tensor(a,o,c[t])}}async encode_image({pixel_values:e}){let t=(await k(this.sessions.vision_encoder,{pixel_values:e})).image_features;return this.config.num_image_tokens||(console.warn(`The number of image tokens was not set in the model configuration. Setting it to the number of features detected by the vision encoder (${t.dims[1]}).`),this.config.num_image_tokens=t.dims[1]),t}async encode_text({input_ids:e}){return(await k(this.sessions.embed_tokens,{input_ids:e})).inputs_embeds}async encode_audio({audio_values:e}){return(await k(this.sessions.audio_encoder,{audio_values:e})).audio_features}}class me{}class he extends me{constructor({last_hidden_state:e,hidden_states:t=null,attentions:n=null}){super(),this.last_hidden_state=e,this.hidden_states=t,this.attentions=n}}class ge extends I{}class _e extends ge{}class ve extends ge{async _call(e){return new Fu(await super._call(e))}}class ye extends ge{async _call(e){return new Q(await super._call(e))}}class L extends ge{async _call(e){return new Pu(await super._call(e))}}class be extends ge{async _call(e){return new Iu(await super._call(e))}}class xe extends I{}class Se extends xe{}class Ce extends xe{async _call(e){return new Fu(await super._call(e))}}class we extends xe{async _call(e){return new Q(await super._call(e))}}class Te extends xe{async _call(e){return new Pu(await super._call(e))}}class Ee extends I{}class De extends Ee{}class Oe extends I{}class ke extends Oe{}class Ae extends Oe{async _call(e){return new Fu(await super._call(e))}}class je extends Oe{async _call(e){return new Q(await super._call(e))}}class Me extends Oe{async _call(e){return new Pu(await super._call(e))}}class Ne extends Oe{async _call(e){return new Iu(await super._call(e))}}class Pe extends I{}class R extends Pe{}class Fe extends Pe{async _call(e){return new Fu(await super._call(e))}}class Ie extends Pe{async _call(e){return new Q(await super._call(e))}}class Le extends Pe{async _call(e){return new Pu(await super._call(e))}}class Re extends Pe{async _call(e){return new Iu(await super._call(e))}}class ze extends I{}class Be extends ze{}class Ve extends ze{async _call(e){return new Fu(await super._call(e))}}class z extends ze{async _call(e){return new Q(await super._call(e))}}class He extends ze{async _call(e){return new Pu(await super._call(e))}}class Ue extends ze{async _call(e){return new Iu(await super._call(e))}}class We extends I{}class Ge extends We{}class Ke extends We{async _call(e){return new Fu(await super._call(e))}}class qe extends We{async _call(e){return new Q(await super._call(e))}}class Je extends We{async _call(e){return new Pu(await super._call(e))}}class Ye extends We{async _call(e){return new Iu(await super._call(e))}}class Xe extends I{}class Ze extends Xe{}class Qe extends Xe{async _call(e){return new Fu(await super._call(e))}}class $e extends Xe{async _call(e){return new Q(await super._call(e))}}class et extends Xe{async _call(e){return new Pu(await super._call(e))}}class tt extends Xe{async _call(e){return new Iu(await super._call(e))}}class nt extends I{}class rt extends nt{}class it extends nt{async _call(e){return new Fu(await super._call(e))}}class at extends nt{async _call(e){return new Q(await super._call(e))}}class ot extends nt{async _call(e){return new Pu(await super._call(e))}}class st extends nt{async _call(e){return new Iu(await super._call(e))}}class ct extends I{}class lt extends ct{}class ut extends ct{async _call(e){return new Q(await super._call(e))}}class dt extends ct{async _call(e){return new Pu(await super._call(e))}}class ft extends ct{async _call(e){return new Iu(await super._call(e))}}class pt extends ct{async _call(e){return new Fu(await super._call(e))}}class mt extends I{}class ht extends mt{}class gt extends mt{async _call(e){return new Fu(await super._call(e))}}class _t extends mt{async _call(e){return new Q(await super._call(e))}}class vt extends mt{async _call(e){return new Pu(await super._call(e))}}class yt extends I{}class bt extends yt{}class xt extends yt{async _call(e){return new Fu(await super._call(e))}}class St extends yt{async _call(e){return new Q(await super._call(e))}}class Ct extends yt{async _call(e){return new Iu(await super._call(e))}}class wt extends I{}class Tt extends wt{}class Et extends wt{async _call(e){return new Fu(await super._call(e))}}class Dt extends wt{async _call(e){return new Q(await super._call(e))}}class Ot extends wt{async _call(e){return new Pu(await super._call(e))}}class kt extends wt{async _call(e){return new Iu(await super._call(e))}}class At extends I{}class jt extends At{}class Mt extends At{async _call(e){return new Fu(await super._call(e))}}class Nt extends At{async _call(e){return new Q(await super._call(e))}}class Pt extends At{async _call(e){return new Iu(await super._call(e))}}class Ft extends I{}class It extends Ft{}class Lt extends Ft{async _call(e){return new Q(await super._call(e))}}class Rt extends Ft{async _call(e){return new Iu(await super._call(e))}}class zt extends Ft{async _call(e){return new Fu(await super._call(e))}}class Bt extends I{constructor(...t){super(...t),e.defineProperty(this,`forward_params`,[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`])}}class Vt extends Bt{}class Ht extends Bt{}class Ut extends I{}class Wt extends Ut{}class Gt extends Ut{}class Kt extends I{}class qt extends Kt{}class Jt extends Kt{}class Yt extends I{}class Xt extends Yt{}class Zt extends Yt{}class Qt extends Yt{async _call(e){return new Q(await super._call(e))}}class $t extends I{}class en extends $t{}class tn extends $t{}class nn extends $t{async _call(e){return new Q(await super._call(e))}}class B extends $t{}class rn extends I{}class an extends rn{}class on extends rn{}class sn extends I{}class cn extends sn{}class ln extends sn{}class un extends I{}class dn extends un{}class fn extends un{async _call(e){return new Fu(await super._call(e))}}class pn extends un{async _call(e){return new Q(await super._call(e))}}class mn extends un{async _call(e){return new Pu(await super._call(e))}}class hn extends un{async _call(e){return new Iu(await super._call(e))}}class gn extends I{}class _n extends gn{}class vn extends gn{async _call(e){return new Fu(await super._call(e))}}class yn extends gn{async _call(e){return new Q(await super._call(e))}}class bn extends gn{async _call(e){return new Pu(await super._call(e))}}class xn extends gn{async _call(e){return new Iu(await super._call(e))}}class V extends I{}class Sn extends V{}class Cn extends V{async _call(e){return new Fu(await super._call(e))}}class wn extends V{async _call(e){return new Q(await super._call(e))}}class Tn extends V{async _call(e){return new Pu(await super._call(e))}}class En extends V{async _call(e){return new Iu(await super._call(e))}}class Dn extends I{}class On extends Dn{}class kn extends Dn{}class H extends I{constructor(...t){super(...t),e.defineProperty(this,`requires_attention_mask`,!1),e.defineProperty(this,`main_input_name`,`input_features`),e.defineProperty(this,`forward_params`,[`input_features`,`attention_mask`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`])}}class An extends H{}class jn extends H{_prepare_generation_config(e,t){return super._prepare_generation_config(e,t,y.WhisperGenerationConfig)}_retrieve_init_tokens(e){let t=[e.decoder_start_token_id],n=e.language,r=e.task;if(e.is_multilingual){n||(console.warn(`No language specified - defaulting to English (en).`),n=`en`);let i=(0,b.whisper_language_to_code)(n),a=`<|${i}|>`;t.push(e.lang_to_id[a]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new d.LogitsProcessorList,n.push(new d.WhisperTimeStampLogitsProcessor(t,a))),t.begin_suppress_tokens&&(n??=new d.LogitsProcessorList,n.push(new d.SuppressTokensAtBeginLogitsProcessor(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&console.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames)),o}_extract_token_timestamps(e,t,n=null,r=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let i=this.config.median_filter_width;i===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let a=e.cross_attentions,o=Array.from({length:this.config.decoder_layers},(e,t)=>(0,p.cat)(a.map(e=>e[t]),2)),s=(0,p.stack)(t.map(([e,t])=>{if(e>=o.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${o.length}).`);return n?o[e].slice(null,t,null,[0,n]):o[e].slice(null,t)})).transpose(1,0,2,3),[l,u]=(0,p.std_mean)(s,-2,0,!0),d=s.clone();for(let e=0;en[t+1]-n[t]),o=(0,c.mergeArrays)([1],a).map(e=>!!e),s=[];for(let e=0;ee.findIndex(e=>e==i)),s=o.every(e=>e===-1),c=o.every(e=>e!==-1);if(!s&&!c)throw Error(`Every input should contain either 0 or 1 image token.`);if(s)return{inputs_embeds:e,attention_mask:r};let l=[],u=[];for(let n=0;nArray.from({length:e.dims[0]},t=>Array.from({length:e.dims[1]},e=>1))),f=t?t.tolist():[],m=n?n.tolist():[],g=0,_=0;for(let e=0;eu[e][n]==1),n=t.reduce((e,t,n)=>(t==s&&e.push(n),e),[]),r=n.map(e=>t[e+1]),p=r.filter(e=>e==a).length,v=r.filter(e=>e==o).length,y=[],b=0,x=p,S=v;for(let e=0;et>b&&e==a),n=t.findIndex((e,t)=>t>b&&e==o),r=x>0&&e!==-1?e:t.length+1,i=S>0&&n!==-1?n:t.length+1,s,l,u,d;r0?(0,h.max)(y.at(-1))[0]+1:0;y.push(Array.from({length:3*w},(e,t)=>T+t%w));let E=w+T,D=p*v*C,O=Array.from({length:D},(e,t)=>E+Math.floor(t/(v*C))),ee=Array.from({length:D},(e,t)=>E+Math.floor(t/C)%v),k=Array.from({length:D},(e,t)=>E+t%C);y.push([O,ee,k].flat()),b=s+D}if(b0?(0,h.max)(y.at(-1))[0]+1:0,n=t.length-b;y.push(Array.from({length:3*n},(t,r)=>e+r%n))}let C=y.reduce((e,t)=>e+t.length,0),w=Array(C),T=0;for(let e=0;e<3;++e)for(let t=0;te[n%e.length]),i=Array.from({length:t[0]},(n,r)=>(0,h.max)(e.subarray(t[1]*r,t[1]*(r+1)))[0]+1n+BigInt(t[1]));return[new p.Tensor(`int64`,n,[3,...t]),new p.Tensor(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims,r=BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t)));return[new p.Tensor(`int64`,r,[3,...e.dims]),(0,p.zeros)([t,1])]}}async encode_image({pixel_values:e,image_grid_thw:t}){let n=(await k(this.sessions.vision_encoder,{pixel_values:e,grid_thw:t})).image_features;return n}_merge_input_ids_with_image_features(e){return ce({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(t.attention_mask&&!t.position_ids)if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=BigInt(Object.values(t.past_key_values)[0].dims.at(-2)),n=t.rope_deltas.map(t=>e+t);t.position_ids=(0,p.stack)([n,n,n],0)}return t}}class bi extends I{}class xi extends bi{}class Si extends bi{}class Ci extends I{}class wi extends Ci{}class Ti extends Ci{}class Ei extends I{}class Di extends Ei{}class Oi extends Ei{}class ki extends I{}class Ai extends ki{}class ji extends ki{}class Mi extends I{}class Ni extends Mi{}class Pi extends Mi{}class Fi extends I{}class Ii extends Fi{}class Li extends Fi{async _call(e){return new Q(await super._call(e))}}class Ri extends I{}class zi extends Ri{}class Bi extends Ri{async _call(e){return new Q(await super._call(e))}}class Vi extends I{}class Hi extends Vi{}class Ui extends I{}class Wi extends Ui{}class Gi extends Ui{async _call(e){return new Q(await super._call(e))}}class Ki extends I{}class qi extends Ki{}class Ji extends I{}class Yi extends Ji{}class Xi extends Ji{async _call(e){return new Q(await super._call(e))}}class Zi extends I{}class Qi extends Zi{}class $i extends I{}class ea extends $i{}class ta extends $i{async _call(e){return new Q(await super._call(e))}}class na extends I{}class ra extends na{async _call(e){return new zu(await super._call(e))}}class ia extends I{}class aa extends ia{}class oa extends ia{async _call(e){return new Q(await super._call(e))}}class sa extends I{}class ca extends sa{}class la extends sa{async _call(e){return new Q(await super._call(e))}}class ua extends I{}class da extends ua{}class fa extends ua{}class pa extends I{}class ma extends pa{}class ha extends pa{}class ga extends I{}class _a extends ga{}class va extends ga{async _call(e){return new Q(await super._call(e))}}class ya extends I{}class ba extends ya{}class xa extends ya{async _call(e){return new Ca(await super._call(e))}}class Sa extends ya{async _call(e){return new wa(await super._call(e))}}class Ca extends me{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class wa extends me{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}}class Ta extends I{}class Ea extends Ta{}class Da extends Ta{async _call(e){return new Oa(await super._call(e))}}class Oa extends me{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class ka extends I{}class Aa extends ka{}class ja extends ka{async _call(e){return new Ma(await super._call(e))}}class Ma extends Oa{}class Na extends I{}class Pa extends Na{}class Fa extends Na{async _call(e){return new Ia(await super._call(e))}}class Ia extends Oa{}class La extends I{}class Ra extends La{}class za extends La{async _call(e){return new Oa(await super._call(e))}}class Ba extends I{}class Va extends Ba{}class Ha extends Ba{async _call(e){return new Ua(await super._call(e))}}class Ua extends Ca{}class Wa extends I{}class Ga extends Wa{}class Ka extends Wa{async _call(e){return new Q(await super._call(e))}}class qa extends I{}class Ja extends qa{}class Ya extends qa{async _call(e){return new Q(await super._call(e))}}class Xa extends I{}class Za extends Xa{}class Qa extends Xa{async _call(e){return new Q(await super._call(e))}}class $a extends I{}class eo extends $a{}class to extends $a{async _call(e){return new Q(await super._call(e))}}class no extends $a{}class ro extends I{}class io extends ro{}class ao extends ro{}class oo extends I{}class so extends oo{}class co extends oo{}class lo extends I{}class uo extends lo{}class fo extends I{}class po extends fo{}class mo extends fo{}class ho extends fo{}class go extends I{}class _o extends go{}class vo extends I{}class yo extends vo{}class bo extends I{}class xo extends bo{}class So extends I{}class Co extends So{}class wo extends So{}class To extends I{}class Eo extends To{}class Do extends To{}class Oo extends I{}class ko extends Oo{}class Ao extends I{}class jo extends Ao{}class Mo extends Ao{async _call(e){return new Q(await super._call(e))}}class No extends I{}class Po extends No{}class Fo extends No{async _call(e){return new Q(await super._call(e))}}class Io extends I{}class Lo extends Io{}class Ro extends Io{async _call(e){return new Q(await super._call(e))}}class zo extends I{}class Bo extends zo{}class Vo extends zo{async _call(e){return new Q(await super._call(e))}}class Ho extends I{}class Uo extends Ho{}class Wo extends I{}class Go extends Wo{}class Ko extends Wo{async _call(e){return new qo(await super._call(e))}}class qo extends me{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Jo extends I{}class Yo extends Jo{async get_image_embeddings({pixel_values:e}){return await A(this,{pixel_values:e})}async forward(e){if((!e.image_embeddings||!e.image_positional_embeddings)&&(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels&&e.input_points){let t=e.input_points.dims.slice(0,-1),n=t.reduce((e,t)=>e*t,1);e.input_labels=new p.Tensor(`int64`,new BigInt64Array(n).fill(1n),t)}let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await k(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new Xo(await super._call(e))}}class Xo extends me{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}}class Zo extends I{}class Qo extends Zo{}class $o extends Zo{}class es extends I{}class ts extends es{}class ns extends es{}class rs extends I{}class os extends rs{}class ss extends rs{async _call(e){return new Lu(await super._call(e))}}class cs extends rs{async _call(e){return new Q(await super._call(e))}}class ls extends rs{async _call(e){return new Pu(await super._call(e))}}class us extends I{}class ds extends us{}class fs extends us{async _call(e){return new Pu(await super._call(e))}}class ps extends I{}class ms extends ps{}class hs extends I{}class gs extends hs{}class _s extends hs{async _call(e){return new Lu(await super._call(e))}}class vs extends hs{async _call(e){return new Q(await super._call(e))}}class ys extends I{}class bs extends ys{}class xs extends ys{async _call(e){return new Lu(await super._call(e))}}class Ss extends ys{async _call(e){return new Q(await super._call(e))}}class Cs extends ys{async _call(e){return new Pu(await super._call(e))}}class ws extends I{}class Ts extends ws{}class Es extends ws{async _call(e){return new Lu(await super._call(e))}}class Ds extends ws{async _call(e){return new Q(await super._call(e))}}class Os extends I{}class ks extends rs{}class As extends rs{async _call(e){return new Lu(await super._call(e))}}class js extends rs{async _call(e){return new Q(await super._call(e))}}class Ms extends I{}class Ns extends Ms{}class Ps extends Ms{async _call(e){return new Lu(await super._call(e))}}class Fs extends Ms{async _call(e){return new Q(await super._call(e))}}class Is extends Ms{async _call(e){return new Nu(await super._call(e))}}class Ls extends Ms{async _call(e){return new Pu(await super._call(e))}}class Rs extends I{}class zs extends Rs{}class Bs extends I{}class Vs extends Bs{}class Hs extends Bs{}class Us extends Bs{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let o={input_ids:e},{encoder_outputs:s,encoder_attention_mask:c}=await A(this,o),l=s.dims[1]/this.config.reduction_factor,u=Math.floor(l*i),d=Math.floor(l*r),f=this.config.num_mel_bins,m=[],h=null,g=null,_=0;for(;;){++_;let e=re(!!g),r;r=g?g.output_sequence_out:new p.Tensor(`float32`,new Float32Array(f),[1,1,f]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:s};this.addPastKeyValues(i,h),g=await k(this.sessions.decoder_model_merged,i),h=this.getPastKeyValues(g,h);let{prob:a,spectrum:o}=g;if(m.push(o),_>=d&&(Array.from(a.data).filter(e=>e>=n).length>0||_>=u))break}let v=(0,p.cat)(m),{waveform:y}=await k(a.sessions.model,{spectrogram:v});return{spectrogram:v,waveform:y}}}class Ws extends I{constructor(...t){super(...t),e.defineProperty(this,`main_input_name`,`spectrogram`)}}class Gs extends I{}class Ks extends Gs{}class qs extends I{}class Js extends qs{}class Ys extends qs{}class Xs extends I{}class Zs extends Xs{}class Qs extends Xs{}class $s extends I{}class ec extends $s{}class tc extends $s{}class nc extends I{}class rc extends nc{}class ic extends nc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}}class ac extends nc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`audio_model`})}}class oc extends I{}class sc extends oc{async _call(e){return new Bu(await super._call(e))}}class cc extends I{}class lc extends cc{}class uc extends cc{}class dc extends cc{}class fc extends I{}class pc extends fc{}class mc extends fc{}class hc extends I{}class gc extends hc{}class _c extends hc{async _call(e){return new Q(await super._call(e))}}class vc extends I{}class yc extends vc{}class bc extends vc{}class xc extends I{constructor(...t){super(...t),e.defineProperty(this,`forward_params`,[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`])}_apply_and_filter_by_delay_pattern_mask(e){let[t,n]=e.dims,r=this.config.decoder.num_codebooks,i=n-r,a=0;for(let t=0;t0&&c<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new p.Tensor(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=structuredClone(e);for(let e=0;e=t&&(r[e][t]=BigInt(this.config.decoder.pad_token_id));n.guidance_scale!==null&&n.guidance_scale>1&&(r=r.concat(r));let i=super.prepare_inputs_for_generation(r,t,n);return i}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await k(this.sessions.encodec_decode,{audio_codes:n});return r}}class Sc extends I{}class Cc extends Sc{}class wc extends Sc{async _call(e){return new Q(await super._call(e))}}class Tc extends Sc{}class Ec extends I{}class Dc extends Ec{}class Oc extends Ec{async _call(e){return new Q(await super._call(e))}}class kc extends Ec{}class Ac extends I{}class jc extends Ac{}class Mc extends Ac{async _call(e){return new Q(await super._call(e))}}class Nc extends Ac{}class Pc extends I{}class Fc extends Pc{}class Ic extends Pc{async _call(e){return new Q(await super._call(e))}}class Lc extends Pc{}class Rc extends I{}class zc extends Rc{}class Bc extends I{}class Vc extends Bc{constructor(...t){super(...t),e.defineProperty(this,`forward_params`,[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`]),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds,r=(0,c.pick)(e,t.inputNames);n=await k(t,r)}else{let t=this.sessions.gen_img_embeds,r=(0,c.pick)({image_ids:e.input_ids},t.inputNames);n=await k(t,r)}let r={...e,...n},i=await oe(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await k(a,(0,c.pick)(i,a.inputNames));return{...n,...i,...o}}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=await super.generate(e),r=n.slice(null,[t,null]),i=this.sessions.image_decode,{decoded_image:a}=await k(i,{generated_tokens:r}),o=a.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),s=[];for(let e of o){let t=m.RawImage.fromTensor(e);s.push(t)}return s}}class Hc extends me{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class Uc extends I{}class Wc extends Uc{async _call(e){return new Hc(await super._call(e))}}class Gc extends I{}class Kc extends Gc{}class qc extends Gc{}class Jc extends I{}class Yc extends Jc{}class Xc extends Jc{}class Zc extends I{constructor(...t){super(...t),e.defineProperty(this,`forward_params`,[`input_ids`,`attention_mask`,`position_ids`,`audio_values`,`past_key_values`])}}class Qc extends Zc{_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return le({audio_token_id:this.config.ignore_index,...e,audio_features:n})}}class $c extends I{constructor(...t){super(...t),e.defineProperty(this,`main_input_name`,`input_values`),e.defineProperty(this,`forward_params`,[`input_values`])}}class el extends me{constructor({audio_codes:e}){super(),this.audio_codes=e}}class tl extends me{constructor({audio_values:e}){super(),this.audio_values=e}}class nl extends $c{async encode(e){return new el(await k(this.sessions.encoder_model,e))}async decode(e){return new tl(await k(this.sessions.decoder_model,e))}}class rl extends $c{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class il extends $c{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class al extends I{constructor(...t){super(...t),e.defineProperty(this,`main_input_name`,`input_values`),e.defineProperty(this,`forward_params`,[`input_values`])}}class ol extends me{constructor({audio_codes:e}){super(),this.audio_codes=e}}class sl extends me{constructor({audio_values:e}){super(),this.audio_values=e}}class cl extends al{async encode(e){return new ol(await k(this.sessions.encoder_model,e))}async decode(e){return new sl(await k(this.sessions.decoder_model,e))}}class ll extends al{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class ul extends al{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class dl extends I{constructor(...t){super(...t),e.defineProperty(this,`main_input_name`,`input_values`),e.defineProperty(this,`forward_params`,[`input_values`])}}class fl extends dl{async encode(e){return await k(this.sessions.encoder_model,e)}async decode(e){return await k(this.sessions.decoder_model,e)}}class pl extends dl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class ml extends dl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class hl{static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:l=null,dtype:u=null,use_external_data_format:d=null,session_options:f={}}={}){let p={progress_callback:t,config:n,cache_dir:r,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:l,dtype:u,use_external_data_format:d,session_options:f};if(p.config=await i.AutoConfig.from_pretrained(e,p),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);let m=p.config.model_type;for(let t of this.MODEL_CLASS_MAPPINGS){let n=t.get(m);if(!n){for(let e of t.values())if(e[0]===m){n=e;break}if(!n)continue}return await n[1].from_pretrained(e,p)}if(this.BASE_IF_FAIL)return eu.has(m)||console.warn(`Unknown model class "${m}", attempting to construct from base class.`),await I.from_pretrained(e,p);throw Error(`Unsupported model type: ${m}`)}}e.defineProperty(hl,`MODEL_CLASS_MAPPINGS`,null),e.defineProperty(hl,`BASE_IF_FAIL`,!1);let gl=new Map([[`bert`,[`BertModel`,_e]],[`modernbert`,[`ModernBertModel`,Se]],[`nomic_bert`,[`NomicBertModel`,De]],[`roformer`,[`RoFormerModel`,ke]],[`electra`,[`ElectraModel`,Be]],[`esm`,[`EsmModel`,ht]],[`convbert`,[`ConvBertModel`,R]],[`camembert`,[`CamembertModel`,Ge]],[`deberta`,[`DebertaModel`,Ze]],[`deberta-v2`,[`DebertaV2Model`,rt]],[`mpnet`,[`MPNetModel`,Tt]],[`albert`,[`AlbertModel`,It]],[`distilbert`,[`DistilBertModel`,lt]],[`roberta`,[`RobertaModel`,dn]],[`xlm`,[`XLMModel`,_n]],[`xlm-roberta`,[`XLMRobertaModel`,Sn]],[`clap`,[`ClapModel`,rc]],[`clip`,[`CLIPModel`,Yn]],[`clipseg`,[`CLIPSegModel`,dr]],[`chinese_clip`,[`ChineseCLIPModel`,ar]],[`siglip`,[`SiglipModel`,tr]],[`jina_clip`,[`JinaCLIPModel`,sr]],[`mobilebert`,[`MobileBertModel`,bt]],[`squeezebert`,[`SqueezeBertModel`,jt]],[`wav2vec2`,[`Wav2Vec2Model`,os]],[`wav2vec2-bert`,[`Wav2Vec2BertModel`,Ts]],[`unispeech`,[`UniSpeechModel`,gs]],[`unispeech-sat`,[`UniSpeechSatModel`,bs]],[`hubert`,[`HubertModel`,ks]],[`wavlm`,[`WavLMModel`,Ns]],[`audio-spectrogram-transformer`,[`ASTModel`,On]],[`vits`,[`VitsModel`,sc]],[`pyannote`,[`PyAnnoteModel`,ds]],[`wespeaker-resnet`,[`WeSpeakerResNetModel`,ms]],[`detr`,[`DetrModel`,ba]],[`rt_detr`,[`RTDetrModel`,Ea]],[`rt_detr_v2`,[`RTDetrV2Model`,Aa]],[`rf_detr`,[`RFDetrModel`,Pa]],[`d_fine`,[`DFineModel`,Ra]],[`table-transformer`,[`TableTransformerModel`,Va]],[`vit`,[`ViTModel`,Ii]],[`ijepa`,[`IJepaModel`,zi]],[`pvt`,[`PvtModel`,Wi]],[`vit_msn`,[`ViTMSNModel`,Yi]],[`vit_mae`,[`ViTMAEModel`,qi]],[`groupvit`,[`GroupViTModel`,Qi]],[`fastvit`,[`FastViTModel`,ea]],[`mobilevit`,[`MobileViTModel`,aa]],[`mobilevitv2`,[`MobileViTV2Model`,ca]],[`owlvit`,[`OwlViTModel`,da]],[`owlv2`,[`Owlv2Model`,ma]],[`beit`,[`BeitModel`,_a]],[`deit`,[`DeiTModel`,Ga]],[`hiera`,[`HieraModel`,Ja]],[`convnext`,[`ConvNextModel`,jo]],[`convnextv2`,[`ConvNextV2Model`,Po]],[`dinov2`,[`Dinov2Model`,Lo]],[`dinov2_with_registers`,[`Dinov2WithRegistersModel`,Bo]],[`resnet`,[`ResNetModel`,Za]],[`swin`,[`SwinModel`,eo]],[`swin2sr`,[`Swin2SRModel`,io]],[`donut-swin`,[`DonutSwinModel`,ko]],[`yolos`,[`YolosModel`,Go]],[`dpt`,[`DPTModel`,so]],[`glpn`,[`GLPNModel`,Eo]],[`hifigan`,[`SpeechT5HifiGan`,Ws]],[`efficientnet`,[`EfficientNetModel`,gc]],[`decision_transformer`,[`DecisionTransformerModel`,zc]],[`patchtst`,[`PatchTSTForPrediction`,Kc]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,Yc]],[`mobilenet_v1`,[`MobileNetV1Model`,Cc]],[`mobilenet_v2`,[`MobileNetV2Model`,Dc]],[`mobilenet_v3`,[`MobileNetV3Model`,jc]],[`mobilenet_v4`,[`MobileNetV4Model`,Fc]],[`maskformer`,[`MaskFormerModel`,Co]],[`mgp-str`,[`MgpstrForSceneTextRecognition`,Wc]],[`style_text_to_speech_2`,[`StyleTextToSpeech2Model`,zs]]]),_l=new Map([[`t5`,[`T5Model`,Vt]],[`longt5`,[`LongT5Model`,Wt]],[`mt5`,[`MT5Model`,qt]],[`bart`,[`BartModel`,Xt]],[`mbart`,[`MBartModel`,en]],[`marian`,[`MarianModel`,Qo]],[`whisper`,[`WhisperModel`,An]],[`m2m_100`,[`M2M100Model`,ts]],[`blenderbot`,[`BlenderbotModel`,an]],[`blenderbot-small`,[`BlenderbotSmallModel`,cn]]]),vl=new Map([[`mimi`,[`MimiModel`,nl]],[`dac`,[`DacModel`,cl]],[`snac`,[`SnacModel`,fl]]]),yl=new Map([[`bloom`,[`BloomModel`,Di]],[`jais`,[`JAISModel`,gr]],[`gpt2`,[`GPT2Model`,pr]],[`gptj`,[`GPTJModel`,X]],[`gpt_bigcode`,[`GPTBigCodeModel`,Cr]],[`gpt_neo`,[`GPTNeoModel`,q]],[`gpt_neox`,[`GPTNeoXModel`,J]],[`codegen`,[`CodeGenModel`,Tr]],[`llama`,[`LlamaModel`,Or]],[`exaone`,[`ExaoneModel`,Lr]],[`olmo`,[`OlmoModel`,Ur]],[`olmo2`,[`Olmo2Model`,Kr]],[`mobilellm`,[`MobileLLMModel`,Br]],[`granite`,[`GraniteModel`,Yr]],[`cohere`,[`CohereModel`,Qr]],[`gemma`,[`GemmaModel`,ti]],[`gemma2`,[`Gemma2Model`,ii]],[`gemma3_text`,[`Gemma3Model`,si]],[`helium`,[`HeliumModel`,jr]],[`glm`,[`GlmModel`,Pr]],[`openelm`,[`OpenELMModel`,ui]],[`qwen2`,[`Qwen2Model`,pi]],[`qwen3`,[`Qwen3Model`,gi]],[`phi`,[`PhiModel`,xi]],[`phi3`,[`Phi3Model`,wi]],[`mpt`,[`MptModel`,Ai]],[`opt`,[`OPTModel`,Ni]],[`mistral`,[`MistralModel`,Js]],[`starcoder2`,[`Starcoder2Model`,Zs]],[`falcon`,[`FalconModel`,ec]],[`stablelm`,[`StableLmModel`,pc]]]),bl=new Map([[`speecht5`,[`SpeechT5ForSpeechToText`,Hs]],[`whisper`,[`WhisperForConditionalGeneration`,jn]],[`lite-whisper`,[`LiteWhisperForConditionalGeneration`,Mn]],[`moonshine`,[`MoonshineForConditionalGeneration`,Pn]]]),xl=new Map([[`speecht5`,[`SpeechT5ForTextToSpeech`,Us]]]),Sl=new Map([[`vits`,[`VitsModel`,sc]],[`musicgen`,[`MusicgenForConditionalGeneration`,xc]]]),Cl=new Map([[`bert`,[`BertForSequenceClassification`,ye]],[`modernbert`,[`ModernBertForSequenceClassification`,we]],[`roformer`,[`RoFormerForSequenceClassification`,je]],[`electra`,[`ElectraForSequenceClassification`,z]],[`esm`,[`EsmForSequenceClassification`,_t]],[`convbert`,[`ConvBertForSequenceClassification`,Ie]],[`camembert`,[`CamembertForSequenceClassification`,qe]],[`deberta`,[`DebertaForSequenceClassification`,$e]],[`deberta-v2`,[`DebertaV2ForSequenceClassification`,at]],[`mpnet`,[`MPNetForSequenceClassification`,Dt]],[`albert`,[`AlbertForSequenceClassification`,Lt]],[`distilbert`,[`DistilBertForSequenceClassification`,ut]],[`roberta`,[`RobertaForSequenceClassification`,pn]],[`xlm`,[`XLMForSequenceClassification`,yn]],[`xlm-roberta`,[`XLMRobertaForSequenceClassification`,wn]],[`bart`,[`BartForSequenceClassification`,Qt]],[`mbart`,[`MBartForSequenceClassification`,nn]],[`mobilebert`,[`MobileBertForSequenceClassification`,St]],[`squeezebert`,[`SqueezeBertForSequenceClassification`,Nt]]]),wl=new Map([[`bert`,[`BertForTokenClassification`,L]],[`modernbert`,[`ModernBertForTokenClassification`,Te]],[`roformer`,[`RoFormerForTokenClassification`,Me]],[`electra`,[`ElectraForTokenClassification`,He]],[`esm`,[`EsmForTokenClassification`,vt]],[`convbert`,[`ConvBertForTokenClassification`,Le]],[`camembert`,[`CamembertForTokenClassification`,Je]],[`deberta`,[`DebertaForTokenClassification`,et]],[`deberta-v2`,[`DebertaV2ForTokenClassification`,ot]],[`mpnet`,[`MPNetForTokenClassification`,Ot]],[`distilbert`,[`DistilBertForTokenClassification`,dt]],[`roberta`,[`RobertaForTokenClassification`,mn]],[`xlm`,[`XLMForTokenClassification`,bn]],[`xlm-roberta`,[`XLMRobertaForTokenClassification`,Tn]]]),Tl=new Map([[`t5`,[`T5ForConditionalGeneration`,Ht]],[`longt5`,[`LongT5ForConditionalGeneration`,Gt]],[`mt5`,[`MT5ForConditionalGeneration`,Jt]],[`bart`,[`BartForConditionalGeneration`,Zt]],[`mbart`,[`MBartForConditionalGeneration`,tn]],[`marian`,[`MarianMTModel`,$o]],[`m2m_100`,[`M2M100ForConditionalGeneration`,ns]],[`blenderbot`,[`BlenderbotForConditionalGeneration`,on]],[`blenderbot-small`,[`BlenderbotSmallForConditionalGeneration`,ln]]]),El=new Map([[`bloom`,[`BloomForCausalLM`,Oi]],[`gpt2`,[`GPT2LMHeadModel`,mr]],[`jais`,[`JAISLMHeadModel`,K]],[`gptj`,[`GPTJForCausalLM`,xr]],[`gpt_bigcode`,[`GPTBigCodeForCausalLM`,wr]],[`gpt_neo`,[`GPTNeoForCausalLM`,vr]],[`gpt_neox`,[`GPTNeoXForCausalLM`,br]],[`codegen`,[`CodeGenForCausalLM`,Er]],[`llama`,[`LlamaForCausalLM`,kr]],[`exaone`,[`ExaoneForCausalLM`,Rr]],[`olmo`,[`OlmoForCausalLM`,Wr]],[`olmo2`,[`Olmo2ForCausalLM`,qr]],[`mobilellm`,[`MobileLLMForCausalLM`,Vr]],[`granite`,[`GraniteForCausalLM`,Xr]],[`cohere`,[`CohereForCausalLM`,$r]],[`gemma`,[`GemmaForCausalLM`,ni]],[`gemma2`,[`Gemma2ForCausalLM`,ai]],[`gemma3_text`,[`Gemma3ForCausalLM`,ci]],[`helium`,[`HeliumForCausalLM`,Mr]],[`glm`,[`GlmForCausalLM`,Fr]],[`openelm`,[`OpenELMForCausalLM`,di]],[`qwen2`,[`Qwen2ForCausalLM`,mi]],[`qwen3`,[`Qwen3ForCausalLM`,_i]],[`phi`,[`PhiForCausalLM`,Si]],[`phi3`,[`Phi3ForCausalLM`,Ti]],[`mpt`,[`MptForCausalLM`,ji]],[`opt`,[`OPTForCausalLM`,Pi]],[`mbart`,[`MBartForCausalLM`,B]],[`mistral`,[`MistralForCausalLM`,Ys]],[`starcoder2`,[`Starcoder2ForCausalLM`,Qs]],[`falcon`,[`FalconForCausalLM`,tc]],[`trocr`,[`TrOCRForCausalLM`,Ks]],[`stablelm`,[`StableLmForCausalLM`,mc]],[`phi3_v`,[`Phi3VForCausalLM`,qn]]]),Dl=new Map([[`multi_modality`,[`MultiModalityCausalLM`,Vc]]]),Ol=new Map([[`bert`,[`BertForMaskedLM`,ve]],[`modernbert`,[`ModernBertForMaskedLM`,Ce]],[`roformer`,[`RoFormerForMaskedLM`,Ae]],[`electra`,[`ElectraForMaskedLM`,Ve]],[`esm`,[`EsmForMaskedLM`,gt]],[`convbert`,[`ConvBertForMaskedLM`,Fe]],[`camembert`,[`CamembertForMaskedLM`,Ke]],[`deberta`,[`DebertaForMaskedLM`,Qe]],[`deberta-v2`,[`DebertaV2ForMaskedLM`,it]],[`mpnet`,[`MPNetForMaskedLM`,Et]],[`albert`,[`AlbertForMaskedLM`,zt]],[`distilbert`,[`DistilBertForMaskedLM`,pt]],[`roberta`,[`RobertaForMaskedLM`,fn]],[`xlm`,[`XLMWithLMHeadModel`,vn]],[`xlm-roberta`,[`XLMRobertaForMaskedLM`,Cn]],[`mobilebert`,[`MobileBertForMaskedLM`,xt]],[`squeezebert`,[`SqueezeBertForMaskedLM`,Mt]]]),kl=new Map([[`bert`,[`BertForQuestionAnswering`,be]],[`roformer`,[`RoFormerForQuestionAnswering`,Ne]],[`electra`,[`ElectraForQuestionAnswering`,Ue]],[`convbert`,[`ConvBertForQuestionAnswering`,Re]],[`camembert`,[`CamembertForQuestionAnswering`,Ye]],[`deberta`,[`DebertaForQuestionAnswering`,tt]],[`deberta-v2`,[`DebertaV2ForQuestionAnswering`,st]],[`mpnet`,[`MPNetForQuestionAnswering`,kt]],[`albert`,[`AlbertForQuestionAnswering`,Rt]],[`distilbert`,[`DistilBertForQuestionAnswering`,ft]],[`roberta`,[`RobertaForQuestionAnswering`,hn]],[`xlm`,[`XLMForQuestionAnswering`,xn]],[`xlm-roberta`,[`XLMRobertaForQuestionAnswering`,En]],[`mobilebert`,[`MobileBertForQuestionAnswering`,Ct]],[`squeezebert`,[`SqueezeBertForQuestionAnswering`,Pt]]]),Al=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Fn]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Wn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,Gn]]]),jl=new Map([[`llava`,[`LlavaForConditionalGeneration`,W]],[`llava_onevision`,[`LlavaOnevisionForConditionalGeneration`,Ln]],[`moondream1`,[`Moondream1ForConditionalGeneration`,Rn]],[`florence2`,[`Florence2ForConditionalGeneration`,Bn]],[`qwen2-vl`,[`Qwen2VLForConditionalGeneration`,yi]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Wn]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,Gn]],[`paligemma`,[`PaliGemmaForConditionalGeneration`,Hn]]]),Ml=new Map([[`ultravox`,[`UltravoxModel`,Qc]]]),Nl=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Fn]]]),Pl=new Map([[`vit`,[`ViTForImageClassification`,Li]],[`ijepa`,[`IJepaForImageClassification`,Bi]],[`pvt`,[`PvtForImageClassification`,Gi]],[`vit_msn`,[`ViTMSNForImageClassification`,Xi]],[`fastvit`,[`FastViTForImageClassification`,ta]],[`mobilevit`,[`MobileViTForImageClassification`,oa]],[`mobilevitv2`,[`MobileViTV2ForImageClassification`,la]],[`beit`,[`BeitForImageClassification`,va]],[`deit`,[`DeiTForImageClassification`,Ka]],[`hiera`,[`HieraForImageClassification`,Ya]],[`convnext`,[`ConvNextForImageClassification`,Mo]],[`convnextv2`,[`ConvNextV2ForImageClassification`,Fo]],[`dinov2`,[`Dinov2ForImageClassification`,Ro]],[`dinov2_with_registers`,[`Dinov2WithRegistersForImageClassification`,Vo]],[`resnet`,[`ResNetForImageClassification`,Qa]],[`swin`,[`SwinForImageClassification`,to]],[`segformer`,[`SegformerForImageClassification`,uc]],[`efficientnet`,[`EfficientNetForImageClassification`,_c]],[`mobilenet_v1`,[`MobileNetV1ForImageClassification`,wc]],[`mobilenet_v2`,[`MobileNetV2ForImageClassification`,Oc]],[`mobilenet_v3`,[`MobileNetV3ForImageClassification`,Mc]],[`mobilenet_v4`,[`MobileNetV4ForImageClassification`,Ic]]]),Fl=new Map([[`detr`,[`DetrForObjectDetection`,xa]],[`rt_detr`,[`RTDetrForObjectDetection`,Da]],[`rt_detr_v2`,[`RTDetrV2ForObjectDetection`,ja]],[`rf_detr`,[`RFDetrForObjectDetection`,Fa]],[`d_fine`,[`DFineForObjectDetection`,za]],[`table-transformer`,[`TableTransformerForObjectDetection`,Ha]],[`yolos`,[`YolosForObjectDetection`,Ko]]]),Il=new Map([[`owlvit`,[`OwlViTForObjectDetection`,fa]],[`owlv2`,[`Owlv2ForObjectDetection`,ha]],[`grounding-dino`,[`GroundingDinoForObjectDetection`,Uo]]]),Ll=new Map([[`detr`,[`DetrForSegmentation`,Sa]],[`clipseg`,[`CLIPSegForImageSegmentation`,G]]]),Rl=new Map([[`segformer`,[`SegformerForSemanticSegmentation`,dc]],[`sapiens`,[`SapiensForSemanticSegmentation`,po]],[`swin`,[`SwinForSemanticSegmentation`,no]],[`mobilenet_v1`,[`MobileNetV1ForSemanticSegmentation`,Tc]],[`mobilenet_v2`,[`MobileNetV2ForSemanticSegmentation`,kc]],[`mobilenet_v3`,[`MobileNetV3ForSemanticSegmentation`,Nc]],[`mobilenet_v4`,[`MobileNetV4ForSemanticSegmentation`,Lc]]]),zl=new Map([[`detr`,[`DetrForSegmentation`,Sa]],[`maskformer`,[`MaskFormerForInstanceSegmentation`,wo]]]),Bl=new Map([[`sam`,[`SamModel`,Yo]]]),Vl=new Map([[`wav2vec2`,[`Wav2Vec2ForCTC`,ss]],[`wav2vec2-bert`,[`Wav2Vec2BertForCTC`,Es]],[`unispeech`,[`UniSpeechForCTC`,_s]],[`unispeech-sat`,[`UniSpeechSatForCTC`,xs]],[`wavlm`,[`WavLMForCTC`,Ps]],[`hubert`,[`HubertForCTC`,As]]]),Hl=new Map([[`wav2vec2`,[`Wav2Vec2ForSequenceClassification`,cs]],[`wav2vec2-bert`,[`Wav2Vec2BertForSequenceClassification`,Ds]],[`unispeech`,[`UniSpeechForSequenceClassification`,vs]],[`unispeech-sat`,[`UniSpeechSatForSequenceClassification`,Ss]],[`wavlm`,[`WavLMForSequenceClassification`,Fs]],[`hubert`,[`HubertForSequenceClassification`,js]],[`audio-spectrogram-transformer`,[`ASTForAudioClassification`,kn]]]),Ul=new Map([[`wavlm`,[`WavLMForXVector`,Is]]]),Wl=new Map([[`unispeech-sat`,[`UniSpeechSatForAudioFrameClassification`,Cs]],[`wavlm`,[`WavLMForAudioFrameClassification`,Ls]],[`wav2vec2`,[`Wav2Vec2ForAudioFrameClassification`,ls]],[`pyannote`,[`PyAnnoteForAudioFrameClassification`,fs]]]),Gl=new Map([[`vitmatte`,[`VitMatteForImageMatting`,ra]]]),Kl=new Map([[`patchtst`,[`PatchTSTForPrediction`,qc]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,Xc]]]),ql=new Map([[`swin2sr`,[`Swin2SRForImageSuperResolution`,ao]]]),Jl=new Map([[`dpt`,[`DPTForDepthEstimation`,co]],[`depth_anything`,[`DepthAnythingForDepthEstimation`,uo]],[`glpn`,[`GLPNForDepthEstimation`,Do]],[`sapiens`,[`SapiensForDepthEstimation`,mo]],[`depth_pro`,[`DepthProForDepthEstimation`,_o]],[`metric3d`,[`Metric3DForDepthEstimation`,yo]],[`metric3dv2`,[`Metric3Dv2ForDepthEstimation`,xo]]]),Yl=new Map([[`sapiens`,[`SapiensForNormalEstimation`,ho]]]),Xl=new Map([[`vitpose`,[`VitPoseForPoseEstimation`,Hi]]]),Zl=new Map([[`clip`,[`CLIPVisionModelWithProjection`,$n]],[`siglip`,[`SiglipVisionModel`,rr]],[`jina_clip`,[`JinaCLIPVisionModel`,lr]]]),Ql=[[gl,x.EncoderOnly],[_l,x.EncoderDecoder],[yl,x.DecoderOnly],[vl,x.AutoEncoder],[Cl,x.EncoderOnly],[wl,x.EncoderOnly],[Tl,x.Seq2Seq],[bl,x.Seq2Seq],[El,x.DecoderOnly],[Dl,x.MultiModality],[Ol,x.EncoderOnly],[kl,x.EncoderOnly],[Al,x.Vision2Seq],[jl,x.ImageTextToText],[Ml,x.AudioTextToText],[Pl,x.EncoderOnly],[Ll,x.EncoderOnly],[zl,x.EncoderOnly],[Rl,x.EncoderOnly],[Gl,x.EncoderOnly],[Kl,x.EncoderOnly],[ql,x.EncoderOnly],[Jl,x.EncoderOnly],[Yl,x.EncoderOnly],[Xl,x.EncoderOnly],[Fl,x.EncoderOnly],[Il,x.EncoderOnly],[Bl,x.MaskGeneration],[Vl,x.EncoderOnly],[Hl,x.EncoderOnly],[xl,x.Seq2Seq],[Sl,x.EncoderOnly],[Ul,x.EncoderOnly],[Wl,x.EncoderOnly],[Zl,x.EncoderOnly]];for(let[e,t]of Ql)for(let[n,r]of e.values())S.set(n,t),w.set(r,n),C.set(n,r);let $l=[[`MusicgenForConditionalGeneration`,xc,x.Musicgen],[`Phi3VForCausalLM`,qn,x.Phi3V],[`CLIPTextModelWithProjection`,Zn,x.EncoderOnly],[`SiglipTextModel`,nr,x.EncoderOnly],[`JinaCLIPTextModel`,cr,x.EncoderOnly],[`ClapTextModelWithProjection`,ic,x.EncoderOnly],[`ClapAudioModelWithProjection`,ac,x.EncoderOnly],[`DacEncoderModel`,ll,x.EncoderOnly],[`DacDecoderModel`,ul,x.EncoderOnly],[`MimiEncoderModel`,rl,x.EncoderOnly],[`MimiDecoderModel`,il,x.EncoderOnly],[`SnacEncoderModel`,pl,x.EncoderOnly],[`SnacDecoderModel`,ml,x.EncoderOnly]];for(let[e,t,n]of $l)S.set(e,n),w.set(t,e),C.set(e,t);let eu=new Map([[`modnet`,Ll],[`birefnet`,Ll],[`isnet`,Ll],[`ben`,Ll]]);for(let[e,t]of eu.entries())t.set(e,[`PreTrainedModel`,I]),S.set(e,x.EncoderOnly),w.set(I,e),C.set(e,I);class tu extends hl{}e.defineProperty(tu,`MODEL_CLASS_MAPPINGS`,Ql.map(e=>e[0])),e.defineProperty(tu,`BASE_IF_FAIL`,!0);class nu extends hl{}e.defineProperty(nu,`MODEL_CLASS_MAPPINGS`,[Cl]);class ru extends hl{}e.defineProperty(ru,`MODEL_CLASS_MAPPINGS`,[wl]);class iu extends hl{}e.defineProperty(iu,`MODEL_CLASS_MAPPINGS`,[Tl]);class au extends hl{}e.defineProperty(au,`MODEL_CLASS_MAPPINGS`,[bl]);class ou extends hl{}e.defineProperty(ou,`MODEL_CLASS_MAPPINGS`,[xl]);class su extends hl{}e.defineProperty(su,`MODEL_CLASS_MAPPINGS`,[Sl]);class cu extends hl{}e.defineProperty(cu,`MODEL_CLASS_MAPPINGS`,[El]);class lu extends hl{}e.defineProperty(lu,`MODEL_CLASS_MAPPINGS`,[Ol]);class uu extends hl{}e.defineProperty(uu,`MODEL_CLASS_MAPPINGS`,[kl]);class du extends hl{}e.defineProperty(du,`MODEL_CLASS_MAPPINGS`,[Al]);class fu extends hl{}e.defineProperty(fu,`MODEL_CLASS_MAPPINGS`,[Pl]);class pu extends hl{}e.defineProperty(pu,`MODEL_CLASS_MAPPINGS`,[Ll]);class mu extends hl{}e.defineProperty(mu,`MODEL_CLASS_MAPPINGS`,[Rl]);class hu extends hl{}e.defineProperty(hu,`MODEL_CLASS_MAPPINGS`,[zl]);class gu extends hl{}e.defineProperty(gu,`MODEL_CLASS_MAPPINGS`,[Fl]);class _u extends hl{}e.defineProperty(_u,`MODEL_CLASS_MAPPINGS`,[Il]);class vu extends hl{}e.defineProperty(vu,`MODEL_CLASS_MAPPINGS`,[Bl]);class yu extends hl{}e.defineProperty(yu,`MODEL_CLASS_MAPPINGS`,[Vl]);class bu extends hl{}e.defineProperty(bu,`MODEL_CLASS_MAPPINGS`,[Hl]);class xu extends hl{}e.defineProperty(xu,`MODEL_CLASS_MAPPINGS`,[Ul]);class Su extends hl{}e.defineProperty(Su,`MODEL_CLASS_MAPPINGS`,[Wl]);class Cu extends hl{}e.defineProperty(Cu,`MODEL_CLASS_MAPPINGS`,[Nl]);class wu extends hl{}e.defineProperty(wu,`MODEL_CLASS_MAPPINGS`,[Gl]);class Tu extends hl{}e.defineProperty(Tu,`MODEL_CLASS_MAPPINGS`,[ql]);class Eu extends hl{}e.defineProperty(Eu,`MODEL_CLASS_MAPPINGS`,[Jl]);class Du extends hl{}e.defineProperty(Du,`MODEL_CLASS_MAPPINGS`,[Yl]);class Ou extends hl{}e.defineProperty(Ou,`MODEL_CLASS_MAPPINGS`,[Xl]);class ku extends hl{}e.defineProperty(ku,`MODEL_CLASS_MAPPINGS`,[Zl]);class Au extends hl{}e.defineProperty(Au,`MODEL_CLASS_MAPPINGS`,[jl]);class ju extends hl{}e.defineProperty(ju,`MODEL_CLASS_MAPPINGS`,[Ml]);class Mu extends me{constructor({logits:e,past_key_values:t,encoder_outputs:n,decoder_attentions:r=null,cross_attentions:i=null}){super(),this.logits=e,this.past_key_values=t,this.encoder_outputs=n,this.decoder_attentions=r,this.cross_attentions=i}}class Q extends me{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}}class Nu extends me{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}}class Pu extends me{constructor({logits:e}){super(),this.logits=e}}class Fu extends me{constructor({logits:e}){super(),this.logits=e}}class Iu extends me{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}}class Lu extends me{constructor({logits:e}){super(),this.logits=e}}class Ru extends me{constructor({logits:e,past_key_values:t}){super(),this.logits=e,this.past_key_values=t}}class zu extends me{constructor({alphas:e}){super(),this.alphas=e}}class Bu extends me{constructor({waveform:e,spectrogram:t}){super(),this.waveform=e,this.spectrogram=t}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e);let t=this.config.sampling_rate,n=(0,a.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=(0,a.window_function)(400,`hann`,{periodic:!1}),this.mean=this.config.mean,this.std=this.config.std}async _extract_fbank_features(e,t){return(0,a.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e){(0,r.validate_audio_inputs)(e,`ASTFeatureExtractor`);let t=await this._extract_fbank_features(e,this.config.max_length);if(this.config.do_normalize){let e=this.std*2,n=t.data;for(let t=0;t{n.r(t),n.d(t,{AutoFeatureExtractor:()=>s});var r=n( +/*! ../../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../../utils/hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),o=n( +/*! ../feature_extractors.js */ +`./src/models/feature_extractors.js`);class s{static async from_pretrained(e,t={}){let n=await(0,i.getModelJSON)(e,r.FEATURE_EXTRACTOR_NAME,!0,t),a=n.feature_extractor_type,s=o[a];if(!s)throw Error(`Unknown feature_extractor_type: '${a}'. Please report this at ${r.GITHUB_ISSUE_URL}.`);return new s(n)}}},"./src/models/auto/image_processing_auto.js":(e,t,n)=>{n.r(t),n.d(t,{AutoImageProcessor:()=>s});var r=n( +/*! ../../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../../utils/hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),o=n( +/*! ../image_processors.js */ +`./src/models/image_processors.js`);class s{static async from_pretrained(e,t={}){let n=await(0,i.getModelJSON)(e,r.IMAGE_PROCESSOR_NAME,!0,t),s=n.image_processor_type??n.feature_extractor_type,c=o[s];return c||(s!==void 0&&console.warn(`Image processor type '${s}' not found, assuming base ImageProcessor. Please report this at ${r.GITHUB_ISSUE_URL}.`),c=a.ImageProcessor),new c(n)}}},"./src/models/auto/processing_auto.js":(e,t,n)=>{n.r(t),n.d(t,{AutoProcessor:()=>l});var r=n( +/*! ../../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../../utils/hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),o=n( +/*! ../processors.js */ +`./src/models/processors.js`),s=n( +/*! ../image_processors.js */ +`./src/models/image_processors.js`),c=n( +/*! ../feature_extractors.js */ +`./src/models/feature_extractors.js`);class l{static async from_pretrained(e,t={}){let n=await(0,i.getModelJSON)(e,r.IMAGE_PROCESSOR_NAME,!0,t),{image_processor_type:l,feature_extractor_type:u,processor_class:d}=n;if(d&&o[d])return o[d].from_pretrained(e,t);if(!l&&!u)throw Error("No `image_processor_type` or `feature_extractor_type` found in the config.");let f={};if(l){let e=s[l];if(!e)throw Error(`Unknown image_processor_type: '${l}'.`);f.image_processor=new e(n)}if(u){let e=s[u];if(e)f.image_processor=new e(n);else{let e=c[u];if(!e)throw Error(`Unknown feature_extractor_type: '${u}'.`);f.feature_extractor=new e(n)}}let p={};return new a.Processor(p,f)}}},"./src/models/beit/image_processing_beit.js":(e,t,n)=>{n.r(t),n.d(t,{BeitFeatureExtractor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/bit/image_processing_bit.js":(e,t,n)=>{n.r(t),n.d(t,{BitImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/chinese_clip/image_processing_chinese_clip.js":(e,t,n)=>{n.r(t),n.d(t,{ChineseCLIPFeatureExtractor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/clap/feature_extraction_clap.js":(e,t,n)=>{n.r(t),n.d(t,{ClapFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e),this.mel_filters=(0,a.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,null,`htk`),this.mel_filters_slaney=(0,a.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,`slaney`,`slaney`),this.window=(0,a.window_function)(this.config.fft_window_size,`hann`)}async _get_input_mel(e,t,n,r){let i,a=!1,o=e.length-t;if(o>0)if(n===`rand_trunc`){a=!0;let n=Math.floor(Math.random()*(o+1));e=e.subarray(n,n+t),i=await this._extract_fbank_features(e,this.mel_filters_slaney,this.config.nb_max_samples)}else throw Error(`Truncation strategy "${n}" not implemented`);else{if(o<0){let n=new Float64Array(t);if(n.set(e),r===`repeat`)for(let r=e.length;r{n.r(t),n.d(t,{CLIPFeatureExtractor:()=>a,CLIPImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/convnext/image_processing_convnext.js":(e,t,n)=>{n.r(t),n.d(t,{ConvNextFeatureExtractor:()=>a,ConvNextImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){super(e),this.crop_pct=this.config.crop_pct??224/256}async resize(e){var t;let n=(t=this.size)?.shortest_edge;if(n===void 0)throw Error(`Size dictionary must contain 'shortest_edge' key.`);if(n<384){let t=Math.floor(n/this.crop_pct),[r,i]=this.get_resize_output_image_size(e,{shortest_edge:t});e=await e.resize(r,i,{resample:this.resample}),e=await e.center_crop(n,n)}else e=await e.resize(n,n,{resample:this.resample});return e}}class a extends i{}},"./src/models/dac/feature_extraction_dac.js":(e,t,n)=>{n.r(t),n.d(t,{DacFeatureExtractor:()=>i});var r=n( +/*! ../encodec/feature_extraction_encodec.js */ +`./src/models/encodec/feature_extraction_encodec.js`);class i extends r.EncodecFeatureExtractor{}},"./src/models/deit/image_processing_deit.js":(e,t,n)=>{n.r(t),n.d(t,{DeiTFeatureExtractor:()=>a,DeiTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/detr/image_processing_detr.js":(e,t,n)=>{n.r(t),n.d(t,{DetrFeatureExtractor:()=>o,DetrImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e){let t=await super._call(e),n=[t.pixel_values.dims[0],64,64],r=(0,i.full)(n,1n);return{...t,pixel_mask:r}}post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}post_process_panoptic_segmentation(...e){return(0,r.post_process_panoptic_segmentation)(...e)}post_process_instance_segmentation(...e){return(0,r.post_process_instance_segmentation)(...e)}}class o extends a{}},"./src/models/donut/image_processing_donut.js":(e,t,n)=>{n.r(t),n.d(t,{DonutFeatureExtractor:()=>a,DonutImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{pad_image(e,t,n,r={}){let[i,a,o]=t,s=this.image_mean;Array.isArray(this.image_mean)||(s=Array(o).fill(s));let c=this.image_std;Array.isArray(c)||(c=Array(o).fill(s));let l=s.map((e,t)=>-e/c[t]);return super.pad_image(e,t,n,{center:!0,constant_values:l,...r})}}class a extends i{}},"./src/models/dpt/image_processing_dpt.js":(e,t,n)=>{n.r(t),n.d(t,{DPTFeatureExtractor:()=>a,DPTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/efficientnet/image_processing_efficientnet.js":(e,t,n)=>{n.r(t),n.d(t,{EfficientNetImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){super(e),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(e=>e*e))}}},"./src/models/encodec/feature_extraction_encodec.js":(e,t,n)=>{n.r(t),n.d(t,{EncodecFeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.FeatureExtractor{async _call(e){(0,r.validate_audio_inputs)(e,`EncodecFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=this.config.feature_size;if(e.length%t!==0)throw Error(`The length of the audio data must be a multiple of the number of channels (${t}).`);let n=[1,t,e.length/t];return{input_values:new i.Tensor(`float32`,e,n)}}}},"./src/models/feature_extractors.js":(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>r.ASTFeatureExtractor,ClapFeatureExtractor:()=>a.ClapFeatureExtractor,DacFeatureExtractor:()=>o.DacFeatureExtractor,EncodecFeatureExtractor:()=>i.EncodecFeatureExtractor,ImageFeatureExtractor:()=>h.ImageProcessor,MoonshineFeatureExtractor:()=>s.MoonshineFeatureExtractor,PyAnnoteFeatureExtractor:()=>c.PyAnnoteFeatureExtractor,SeamlessM4TFeatureExtractor:()=>l.SeamlessM4TFeatureExtractor,SnacFeatureExtractor:()=>u.SnacFeatureExtractor,SpeechT5FeatureExtractor:()=>d.SpeechT5FeatureExtractor,Wav2Vec2FeatureExtractor:()=>f.Wav2Vec2FeatureExtractor,WeSpeakerFeatureExtractor:()=>p.WeSpeakerFeatureExtractor,WhisperFeatureExtractor:()=>m.WhisperFeatureExtractor});var r=n( +/*! ./audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js */ +`./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js`),i=n( +/*! ./encodec/feature_extraction_encodec.js */ +`./src/models/encodec/feature_extraction_encodec.js`),a=n( +/*! ./clap/feature_extraction_clap.js */ +`./src/models/clap/feature_extraction_clap.js`),o=n( +/*! ./dac/feature_extraction_dac.js */ +`./src/models/dac/feature_extraction_dac.js`),s=n( +/*! ./moonshine/feature_extraction_moonshine.js */ +`./src/models/moonshine/feature_extraction_moonshine.js`),c=n( +/*! ./pyannote/feature_extraction_pyannote.js */ +`./src/models/pyannote/feature_extraction_pyannote.js`),l=n( +/*! ./seamless_m4t/feature_extraction_seamless_m4t.js */ +`./src/models/seamless_m4t/feature_extraction_seamless_m4t.js`),u=n( +/*! ./snac/feature_extraction_snac.js */ +`./src/models/snac/feature_extraction_snac.js`),d=n( +/*! ./speecht5/feature_extraction_speecht5.js */ +`./src/models/speecht5/feature_extraction_speecht5.js`),f=n( +/*! ./wav2vec2/feature_extraction_wav2vec2.js */ +`./src/models/wav2vec2/feature_extraction_wav2vec2.js`),p=n( +/*! ./wespeaker/feature_extraction_wespeaker.js */ +`./src/models/wespeaker/feature_extraction_wespeaker.js`),m=n( +/*! ./whisper/feature_extraction_whisper.js */ +`./src/models/whisper/feature_extraction_whisper.js`),h=n( +/*! ../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`)},"./src/models/florence2/processing_florence2.js":(t,n,r)=>{r.r(n),r.d(n,{Florence2Processor:()=>s});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class s extends i.Processor{constructor(e,t){super(e,t);let{tasks_answer_post_processing_type:n,task_prompts_without_inputs:r,task_prompts_with_input:i}=this.image_processor.config;this.tasks_answer_post_processing_type=new Map(Object.entries(n??{})),this.task_prompts_without_inputs=new Map(Object.entries(r??{})),this.task_prompts_with_input=new Map(Object.entries(i??{})),this.regexes={quad_boxes:/(.+?)/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(e){typeof e==`string`&&(e=[e]);let t=[];for(let n of e)if(this.task_prompts_without_inputs.has(n))t.push(this.task_prompts_without_inputs.get(n));else{for(let[e,r]of this.task_prompts_with_input)if(n.includes(e)){t.push(r.replaceAll(`{input}`,n).replaceAll(e,``));break}t.length!==e.length&&t.push(n)}return t}post_process_generation(e,t,n){let r=this.tasks_answer_post_processing_type.get(t)??`pure_text`;e=e.replaceAll(``,``).replaceAll(``,``);let i;switch(r){case`pure_text`:i=e;break;case`description_with_bboxes`:case`bboxes`:case`phrase_grounding`:case`ocr`:let a=r===`ocr`?`quad_boxes`:`bboxes`,o=e.matchAll(this.regexes[a]),s=[],c=[];for(let[e,t,...r]of o)s.push(t?t.trim():s.at(-1)??``),c.push(r.map((e,t)=>(Number(e)+.5)/this.size_per_bin*n[t%2]));i={labels:s,[a]:c};break;default:throw Error(`Task "${t}" (of type "${r}") not yet implemented.`)}return{[t]:i}}async _call(e,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=await this.image_processor(e,n),i=t?this.tokenizer(t,n):{};return{...r,...i}}}e.defineProperty(s,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(s,`image_processor_class`,a.AutoImageProcessor)},"./src/models/glpn/image_processing_glpn.js":(e,t,n)=>{n.r(t),n.d(t,{GLPNFeatureExtractor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/grounding_dino/image_processing_grounding_dino.js":(e,t,n)=>{n.r(t),n.d(t,{GroundingDinoImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e){let t=await super._call(e),n=t.pixel_values.dims,r=(0,i.ones)([n[0],n[2],n[3]]);return{...t,pixel_mask:r}}}},"./src/models/grounding_dino/processing_grounding_dino.js":(t,n,r)=>{r.r(n),r.d(n,{GroundingDinoProcessor:()=>l});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);function c(e,t){let n=0,r=e.dims.at(-1)-1,i=e.tolist();i.fill(!1,0,n+1),i.fill(!1,r);let a=t.tolist();return i.map((e,t)=>e?t:null).filter(e=>e!==null).map(e=>a[e])}class l extends i.Processor{async _call(e,t,n={}){let r=e?await this.image_processor(e,n):{},i=t?this.tokenizer(t,n):{};return{...i,...r}}post_process_grounded_object_detection(e,t,{box_threshold:n=.25,text_threshold:r=.25,target_sizes:i=null}={}){let{logits:a,pred_boxes:o}=e,l=a.dims[0];if(i!==null&&i.length!==l)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let u=a.dims.at(1),d=a.sigmoid(),f=d.max(-1).tolist(),p=o.tolist().map(e=>e.map(e=>(0,s.center_to_corners_format)(e))),m=[];for(let e=0;ee.map((e,t)=>e*a[(t+1)%2])));let o=f[e],s=[],l=[],h=[];for(let i=0;i{n.r(t),n.d(t,{Idefics3ImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{constructor(e){super(e),this.do_image_splitting=e.do_image_splitting??!0,this.max_image_size=e.max_image_size}get_resize_for_vision_encoder(e,t){let[n,r]=e.dims.slice(-2),i=r/n;return r>=n?(r=Math.ceil(r/t)*t,n=Math.floor(r/i),n=Math.ceil(n/t)*t):(n=Math.ceil(n/t)*t,r=Math.floor(n*i),r=Math.ceil(r/t)*t),{height:n,width:r}}async _call(e,{do_image_splitting:t=null,return_row_col_info:n=!1}={}){let r;if(!Array.isArray(e))r=[[e]];else{if(e.length===0||!e[0])throw Error(`No images provided.`);r=Array.isArray(e[0])?e:[e]}let a=[],o=[],s=[],c=[],l=[];for(let e of r){let n=await Promise.all(e.map(e=>this.preprocess(e)));c.push(...n.map(e=>e.original_size)),l.push(...n.map(e=>e.reshaped_input_size)),n.forEach(e=>e.pixel_values.unsqueeze_(0));let{longest_edge:r}=this.max_image_size,u;if(t??this.do_image_splitting){let e=Array(n.length),t=Array(n.length);u=await Promise.all(n.map(async(n,a)=>{let o=this.get_resize_for_vision_encoder(n.pixel_values,r),s=await(0,i.interpolate_4d)(n.pixel_values,{size:[o.height,o.width]}),{frames:c,num_splits_h:l,num_splits_w:u}=await this.split_image(s,this.max_image_size);return e[a]=l,t[a]=u,(0,i.cat)(c,0)})),o.push(e),s.push(t)}else{let e=[r,r];u=await Promise.all(n.map(t=>(0,i.interpolate_4d)(t.pixel_values,{size:e}))),o.push(Array(n.length).fill(0)),s.push(Array(n.length).fill(0))}a.push((0,i.cat)(u,0))}let u=a.length,[d,f,p,m]=a[0].dims,h,g;if(u===1)h=a[0].unsqueeze_(0),g=(0,i.full)([u,d,p,m],!0);else{let e=Math.max(...a.map(e=>e.dims.at(0)));g=(0,i.full)([u,e,p,m],!0);let t=g.data,n=e*p*m;for(let r=0;rn||s>r){c=Math.ceil(o/n),l=Math.ceil(s/r);let t=Math.ceil(o/c),u=Math.ceil(s/l);for(let n=0;n{r.r(n),r.d(n,{Idefics3Processor:()=>f});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/image.js */ +`./src/utils/image.js`),c=r( +/*! ../../utils/core.js */ +`./src/utils/core.js`);function l(e,t,n,r,i,a){let o=``;for(let a=0;a`+i.repeat(e);o+=` +`}return o+=`\n${r}${a}`+i.repeat(e)+`${r}`,o}function u(e,t,n,r){return`${t}${r}`+n.repeat(e)+`${t}`}function d(e,t,n,r,i,a){return e===0&&t===0?u(n,r,i,a):l(n,e,t,r,i,a)}class f extends i.Processor{constructor(...t){super(...t),e.defineProperty(this,`fake_image_token`,``),e.defineProperty(this,`image_token`,``),e.defineProperty(this,`global_img_token`,``)}async _call(e,t=null,n={}){n.return_row_col_info??=!0;let r;t&&(r=await this.image_processor(t,n)),Array.isArray(e)||(e=[e]);let i=r.rows??[Array(e.length).fill(0)],a=r.cols??[Array(e.length).fill(0)],o=this.config.image_seq_len,s=[],l=[];for(let t=0;td(e,u[t],o,this.fake_image_token,this.image_token,this.global_img_token)),p=n.split(this.image_token);if(p.length===0)throw Error(`The image token should be present in the text.`);let m=p[0];for(let e=0;e{n.r(t),n.d(t,{BeitFeatureExtractor:()=>r.BeitFeatureExtractor,BitImageProcessor:()=>i.BitImageProcessor,CLIPFeatureExtractor:()=>o.CLIPFeatureExtractor,CLIPImageProcessor:()=>o.CLIPImageProcessor,ChineseCLIPFeatureExtractor:()=>a.ChineseCLIPFeatureExtractor,ConvNextFeatureExtractor:()=>s.ConvNextFeatureExtractor,ConvNextImageProcessor:()=>s.ConvNextImageProcessor,DPTFeatureExtractor:()=>d.DPTFeatureExtractor,DPTImageProcessor:()=>d.DPTImageProcessor,DeiTFeatureExtractor:()=>c.DeiTFeatureExtractor,DeiTImageProcessor:()=>c.DeiTImageProcessor,DetrFeatureExtractor:()=>l.DetrFeatureExtractor,DetrImageProcessor:()=>l.DetrImageProcessor,DonutFeatureExtractor:()=>u.DonutFeatureExtractor,DonutImageProcessor:()=>u.DonutImageProcessor,EfficientNetImageProcessor:()=>f.EfficientNetImageProcessor,GLPNFeatureExtractor:()=>p.GLPNFeatureExtractor,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,Idefics3ImageProcessor:()=>h.Idefics3ImageProcessor,JinaCLIPImageProcessor:()=>_.JinaCLIPImageProcessor,LlavaOnevisionImageProcessor:()=>v.LlavaOnevisionImageProcessor,Mask2FormerImageProcessor:()=>y.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>b.MaskFormerFeatureExtractor,MaskFormerImageProcessor:()=>b.MaskFormerImageProcessor,MobileNetV1FeatureExtractor:()=>x.MobileNetV1FeatureExtractor,MobileNetV1ImageProcessor:()=>x.MobileNetV1ImageProcessor,MobileNetV2FeatureExtractor:()=>S.MobileNetV2FeatureExtractor,MobileNetV2ImageProcessor:()=>S.MobileNetV2ImageProcessor,MobileNetV3FeatureExtractor:()=>C.MobileNetV3FeatureExtractor,MobileNetV3ImageProcessor:()=>C.MobileNetV3ImageProcessor,MobileNetV4FeatureExtractor:()=>w.MobileNetV4FeatureExtractor,MobileNetV4ImageProcessor:()=>w.MobileNetV4ImageProcessor,MobileViTFeatureExtractor:()=>T.MobileViTFeatureExtractor,MobileViTImageProcessor:()=>T.MobileViTImageProcessor,NougatImageProcessor:()=>E.NougatImageProcessor,OwlViTFeatureExtractor:()=>O.OwlViTFeatureExtractor,OwlViTImageProcessor:()=>O.OwlViTImageProcessor,Owlv2ImageProcessor:()=>D.Owlv2ImageProcessor,Phi3VImageProcessor:()=>ee.Phi3VImageProcessor,PvtImageProcessor:()=>k.PvtImageProcessor,Qwen2VLImageProcessor:()=>te.Qwen2VLImageProcessor,RTDetrImageProcessor:()=>ne.RTDetrImageProcessor,SamImageProcessor:()=>re.SamImageProcessor,SegformerFeatureExtractor:()=>ie.SegformerFeatureExtractor,SegformerImageProcessor:()=>ie.SegformerImageProcessor,SiglipImageProcessor:()=>A.SiglipImageProcessor,SmolVLMImageProcessor:()=>ae.SmolVLMImageProcessor,Swin2SRImageProcessor:()=>oe.Swin2SRImageProcessor,VLMImageProcessor:()=>g.VLMImageProcessor,ViTFeatureExtractor:()=>se.ViTFeatureExtractor,ViTImageProcessor:()=>se.ViTImageProcessor,VitMatteImageProcessor:()=>ce.VitMatteImageProcessor,VitPoseImageProcessor:()=>le.VitPoseImageProcessor,YolosFeatureExtractor:()=>ue.YolosFeatureExtractor,YolosImageProcessor:()=>ue.YolosImageProcessor});var r=n( +/*! ./beit/image_processing_beit.js */ +`./src/models/beit/image_processing_beit.js`),i=n( +/*! ./bit/image_processing_bit.js */ +`./src/models/bit/image_processing_bit.js`),a=n( +/*! ./chinese_clip/image_processing_chinese_clip.js */ +`./src/models/chinese_clip/image_processing_chinese_clip.js`),o=n( +/*! ./clip/image_processing_clip.js */ +`./src/models/clip/image_processing_clip.js`),s=n( +/*! ./convnext/image_processing_convnext.js */ +`./src/models/convnext/image_processing_convnext.js`),c=n( +/*! ./deit/image_processing_deit.js */ +`./src/models/deit/image_processing_deit.js`),l=n( +/*! ./detr/image_processing_detr.js */ +`./src/models/detr/image_processing_detr.js`),u=n( +/*! ./donut/image_processing_donut.js */ +`./src/models/donut/image_processing_donut.js`),d=n( +/*! ./dpt/image_processing_dpt.js */ +`./src/models/dpt/image_processing_dpt.js`),f=n( +/*! ./efficientnet/image_processing_efficientnet.js */ +`./src/models/efficientnet/image_processing_efficientnet.js`),p=n( +/*! ./glpn/image_processing_glpn.js */ +`./src/models/glpn/image_processing_glpn.js`),m=n( +/*! ./grounding_dino/image_processing_grounding_dino.js */ +`./src/models/grounding_dino/image_processing_grounding_dino.js`),h=n( +/*! ./idefics3/image_processing_idefics3.js */ +`./src/models/idefics3/image_processing_idefics3.js`),g=n( +/*! ./janus/image_processing_janus.js */ +`./src/models/janus/image_processing_janus.js`),_=n( +/*! ./jina_clip/image_processing_jina_clip.js */ +`./src/models/jina_clip/image_processing_jina_clip.js`),v=n( +/*! ./llava_onevision/image_processing_llava_onevision.js */ +`./src/models/llava_onevision/image_processing_llava_onevision.js`),y=n( +/*! ./mask2former/image_processing_mask2former.js */ +`./src/models/mask2former/image_processing_mask2former.js`),b=n( +/*! ./maskformer/image_processing_maskformer.js */ +`./src/models/maskformer/image_processing_maskformer.js`),x=n( +/*! ./mobilenet_v1/image_processing_mobilenet_v1.js */ +`./src/models/mobilenet_v1/image_processing_mobilenet_v1.js`),S=n( +/*! ./mobilenet_v2/image_processing_mobilenet_v2.js */ +`./src/models/mobilenet_v2/image_processing_mobilenet_v2.js`),C=n( +/*! ./mobilenet_v3/image_processing_mobilenet_v3.js */ +`./src/models/mobilenet_v3/image_processing_mobilenet_v3.js`),w=n( +/*! ./mobilenet_v4/image_processing_mobilenet_v4.js */ +`./src/models/mobilenet_v4/image_processing_mobilenet_v4.js`),T=n( +/*! ./mobilevit/image_processing_mobilevit.js */ +`./src/models/mobilevit/image_processing_mobilevit.js`),E=n( +/*! ./nougat/image_processing_nougat.js */ +`./src/models/nougat/image_processing_nougat.js`),D=n( +/*! ./owlv2/image_processing_owlv2.js */ +`./src/models/owlv2/image_processing_owlv2.js`),O=n( +/*! ./owlvit/image_processing_owlvit.js */ +`./src/models/owlvit/image_processing_owlvit.js`),ee=n( +/*! ./phi3_v/image_processing_phi3_v.js */ +`./src/models/phi3_v/image_processing_phi3_v.js`),k=n( +/*! ./pvt/image_processing_pvt.js */ +`./src/models/pvt/image_processing_pvt.js`),te=n( +/*! ./qwen2_vl/image_processing_qwen2_vl.js */ +`./src/models/qwen2_vl/image_processing_qwen2_vl.js`),ne=n( +/*! ./rt_detr/image_processing_rt_detr.js */ +`./src/models/rt_detr/image_processing_rt_detr.js`),re=n( +/*! ./sam/image_processing_sam.js */ +`./src/models/sam/image_processing_sam.js`),ie=n( +/*! ./segformer/image_processing_segformer.js */ +`./src/models/segformer/image_processing_segformer.js`),A=n( +/*! ./siglip/image_processing_siglip.js */ +`./src/models/siglip/image_processing_siglip.js`),ae=n( +/*! ./smolvlm/image_processing_smolvlm.js */ +`./src/models/smolvlm/image_processing_smolvlm.js`),oe=n( +/*! ./swin2sr/image_processing_swin2sr.js */ +`./src/models/swin2sr/image_processing_swin2sr.js`),se=n( +/*! ./vit/image_processing_vit.js */ +`./src/models/vit/image_processing_vit.js`),ce=n( +/*! ./vitmatte/image_processing_vitmatte.js */ +`./src/models/vitmatte/image_processing_vitmatte.js`),le=n( +/*! ./vitpose/image_processing_vitpose.js */ +`./src/models/vitpose/image_processing_vitpose.js`),ue=n( +/*! ./yolos/image_processing_yolos.js */ +`./src/models/yolos/image_processing_yolos.js`)},"./src/models/janus/image_processing_janus.js":(e,t,n)=>{n.r(t),n.d(t,{VLMImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){super({do_pad:!0,pad_size:{width:e.image_size,height:e.image_size},...e}),this.constant_values=this.config.background_color.map(e=>e*this.rescale_factor)}pad_image(e,t,n,r){return super.pad_image(e,t,n,{constant_values:this.constant_values,center:!0,...r})}}},"./src/models/janus/processing_janus.js":(t,n,r)=>{r.r(n),r.d(n,{VLChatProcessor:()=>u});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/core.js */ +`./src/utils/core.js`),c=r( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),l=r( +/*! ../../utils/image.js */ +`./src/utils/image.js`);class u extends i.Processor{constructor(e,t){super(e,t),this.image_tag=this.config.image_tag,this.image_start_tag=this.config.image_start_tag,this.image_end_tag=this.config.image_end_tag,this.num_image_tokens=this.config.num_image_tokens}async _call(e,{images:t=null,chat_template:n=`default`}={}){t?Array.isArray(t)||(t=[t]):t=await Promise.all(e.filter(e=>e.images).flatMap(e=>e.images).map(e=>l.RawImage.read(e)));let r=this.tokenizer,i=r.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0,chat_template:n}),a=e=>r.encode(e,{add_special_tokens:!1}),o=i.split(this.image_tag),u=o.length-1;if(t.length!==u)throw Error(`Number of images provided (${t.length}) does not match number of "${this.image_tag}" image tags (${u})`);let[d,f,p]=r.model.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]),m=a(o[0]),h=Array(m.length).fill(!1);for(let e=1;e0){let e=await this.image_processor(t);return e.pixel_values.unsqueeze_(0),{..._,...e}}return _}}e.defineProperty(u,`image_processor_class`,a.AutoImageProcessor),e.defineProperty(u,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(u,`uses_processor_config`,!0)},"./src/models/jina_clip/image_processing_jina_clip.js":(e,t,n)=>{n.r(t),n.d(t,{JinaCLIPImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){let{resize_mode:t,fill_color:n,interpolation:r,size:i,...a}=e,o=t===`squash`?{width:i,height:i}:t===`shortest`?{shortest_edge:i}:{longest_edge:i},s=r===`bicubic`?3:2;super({...a,size:o,resample:s,do_center_crop:!0,crop_size:i,do_normalize:!0})}}},"./src/models/jina_clip/processing_jina_clip.js":(t,n,r)=>{r.r(n),r.d(n,{JinaCLIPProcessor:()=>s});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class s extends i.Processor{async _call(e=null,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=e?this.tokenizer(e,n):{},i=t?await this.image_processor(t,n):{};return{...r,...i}}}e.defineProperty(s,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(s,`image_processor_class`,a.AutoImageProcessor)},"./src/models/llava_onevision/image_processing_llava_onevision.js":(e,t,n)=>{n.r(t),n.d(t,{LlavaOnevisionImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/mask2former/image_processing_mask2former.js":(e,t,n)=>{n.r(t),n.d(t,{Mask2FormerImageProcessor:()=>i});var r=n( +/*! ../maskformer/image_processing_maskformer.js */ +`./src/models/maskformer/image_processing_maskformer.js`);class i extends r.MaskFormerImageProcessor{}},"./src/models/maskformer/image_processing_maskformer.js":(e,t,n)=>{n.r(t),n.d(t,{MaskFormerFeatureExtractor:()=>a,MaskFormerImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_panoptic_segmentation(...e){return(0,r.post_process_panoptic_segmentation)(...e)}post_process_instance_segmentation(...e){return(0,r.post_process_instance_segmentation)(...e)}}class a extends i{}},"./src/models/mgp_str/processing_mgp_str.js":(t,n,r)=>{r.r(n),r.d(n,{MgpstrProcessor:()=>l});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/maths.js */ +`./src/utils/maths.js`);let c={char:[`char_decode`,1],bpe:[`bpe_decode`,2],wp:[`wp_decode`,102]};class l extends i.Processor{get char_tokenizer(){return this.components.char_tokenizer}get bpe_tokenizer(){return this.components.bpe_tokenizer}get wp_tokenizer(){return this.components.wp_tokenizer}_decode_helper(e,t){if(!c.hasOwnProperty(t))throw Error(`Format ${t} is not supported.`);let[n,r]=c[t],i=this[n].bind(this),[a,o]=e.dims,l=[],u=[],d=e.tolist();for(let e=0;e0?i.reduce((e,t)=>e*t,1):0;u.push(n),l.push(a)}let f=i(u);return[f,l]}char_decode(e){return this.char_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}bpe_decode(e){return this.bpe_tokenizer.batch_decode(e)}wp_decode(e){return this.wp_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}batch_decode([e,t,n]){let[r,i]=this._decode_helper(e,`char`),[a,o]=this._decode_helper(t,`bpe`),[c,l]=this._decode_helper(n,`wp`),u=[],d=[];for(let e=0;e{n.r(t),n.d(t,{MobileNetV1FeatureExtractor:()=>a,MobileNetV1ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/mobilenet_v2/image_processing_mobilenet_v2.js":(e,t,n)=>{n.r(t),n.d(t,{MobileNetV2FeatureExtractor:()=>a,MobileNetV2ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/mobilenet_v3/image_processing_mobilenet_v3.js":(e,t,n)=>{n.r(t),n.d(t,{MobileNetV3FeatureExtractor:()=>a,MobileNetV3ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/mobilenet_v4/image_processing_mobilenet_v4.js":(e,t,n)=>{n.r(t),n.d(t,{MobileNetV4FeatureExtractor:()=>a,MobileNetV4ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/mobilevit/image_processing_mobilevit.js":(e,t,n)=>{n.r(t),n.d(t,{MobileViTFeatureExtractor:()=>a,MobileViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/moonshine/feature_extraction_moonshine.js":(e,t,n)=>{n.r(t),n.d(t,{MoonshineFeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.FeatureExtractor{async _call(e){(0,r.validate_audio_inputs)(e,`MoonshineFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=[1,e.length];return{input_values:new i.Tensor(`float32`,e,t)}}}},"./src/models/moonshine/processing_moonshine.js":(t,n,r)=>{r.r(n),r.d(n,{MoonshineProcessor:()=>s});var i=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),a=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,a.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,i.AutoFeatureExtractor)},"./src/models/nougat/image_processing_nougat.js":(e,t,n)=>{n.r(t),n.d(t,{NougatImageProcessor:()=>i});var r=n( +/*! ../donut/image_processing_donut.js */ +`./src/models/donut/image_processing_donut.js`);class i extends r.DonutImageProcessor{}},"./src/models/owlv2/image_processing_owlv2.js":(e,t,n)=>{n.r(t),n.d(t,{Owlv2ImageProcessor:()=>i});var r=n( +/*! ../owlvit/image_processing_owlvit.js */ +`./src/models/owlvit/image_processing_owlvit.js`);class i extends r.OwlViTImageProcessor{}},"./src/models/owlvit/image_processing_owlvit.js":(e,t,n)=>{n.r(t),n.d(t,{OwlViTFeatureExtractor:()=>a,OwlViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}}class a extends i{}},"./src/models/owlvit/processing_owlvit.js":(t,n,r)=>{r.r(n),r.d(n,{OwlViTProcessor:()=>s});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class s extends i.Processor{}e.defineProperty(s,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(s,`image_processor_class`,a.AutoImageProcessor)},"./src/models/paligemma/processing_paligemma.js":(t,n,r)=>{r.r(n),r.d(n,{PaliGemmaProcessor:()=>l});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);let s=``;function c(e,t,n,r,i){return`${r.repeat(n*i)}${t}${e}\n`}class l extends i.Processor{async _call(e,t=null,n={}){t||(console.warn(`You are using PaliGemma without a text prefix. It will perform as a picture-captioning model.`),t=``),Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let r=this.tokenizer.bos_token,i=this.image_processor.config.image_seq_length,a;t.some(e=>e.includes(s))?a=t.map(e=>{let t=e.replaceAll(s,s.repeat(i)),n=t.lastIndexOf(s),a=n===-1?0:n+s.length;return t.slice(0,a)+r+t.slice(a)+` +`}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),a=t.map(t=>c(t,r,i,s,e.length)));let o=this.tokenizer(a,n),l=await this.image_processor(e,n);return{...l,...o}}}e.defineProperty(l,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(l,`image_processor_class`,a.AutoImageProcessor),e.defineProperty(l,`uses_processor_config`,!1)},"./src/models/phi3_v/image_processing_phi3_v.js":(e,t,n)=>{n.r(t),n.d(t,{Phi3VImageProcessor:()=>u});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);let a=336,o=[2,3],{ceil:s,floor:c,sqrt:l}=Math;class u extends r.ImageProcessor{constructor(e){super({...e,do_normalize:!0,do_pad:!0,pad_size:`custom`,do_convert_rgb:!0,do_resize:!0}),this._num_crops=e.num_crops}calc_num_image_tokens_from_image_size(e,t){let{num_img_tokens:n}=this.config;return c((c(t/a)*c(e/a)+1)*n+1+(c(t/a)+1)*l(n))}get_resize_output_image_size(e,t){let n=this._num_crops,[r,i]=e.size,a=r/i,o=1;for(;o*Math.ceil(o/a)<=n;)o+=1;--o;let s=Math.floor(o*336),c=Math.floor(s/a);return[s,c]}pad_image(e,t,n,r={}){let[i,o]=t,c=a*s(i/a),l=a*s(o/a),u=[1,1,1].map((e,t)=>(e-this.image_mean[t])/this.image_std[t]);return super.pad_image(e,t,{width:l,height:c},{center:!0,constant_values:u,...r})}async _call(e,{num_crops:t=null}={}){if(this._num_crops=t??=this.config.num_crops,t<4||l(t)%1!=0)throw Error(`num_crops must be a square number >= 4`);Array.isArray(e)||(e=[e]);let n=e.length,r=await Promise.all(e.map(e=>this.preprocess(e))),u=r.map(e=>e.original_size),d=r.map(e=>e.reshaped_input_size),f=[];for(let{pixel_values:e}of r){e.unsqueeze_(0);let[n,r]=e.dims.slice(-2),s=await(0,i.interpolate_4d)(e,{size:[a,a],mode:`bicubic`});if(t>0){let u=[],d=l(t),p=c(r/d),m=c(n/d);for(let t=0;te.map(e=>a*s(e/a))),h=new i.Tensor(`int64`,m.flat(),[n,2]),g=m.map(([e,t])=>this.calc_num_image_tokens_from_image_size(t,e));return{pixel_values:p,original_sizes:u,reshaped_input_sizes:d,image_sizes:h,num_img_tokens:g}}}},"./src/models/phi3_v/processing_phi3_v.js":(t,n,r)=>{r.r(n),r.d(n,{Phi3VProcessor:()=>u});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/image.js */ +`./src/utils/image.js`);let c=`<|image|>`,l=/<\|image_\d+\|>/g;class u extends i.Processor{async _call(e,t=null,{padding:n=!0,truncation:r=!0,num_crops:i=null}={}){Array.isArray(e)||(e=[e]);let a,o;if(t){o=await this.image_processor(t,{num_crops:i});let{num_img_tokens:s}=o,u=e.map((e,t)=>e.split(l).join(c.repeat(s[t])));a=this.tokenizer(u,{padding:n,truncation:r});let d=this.tokenizer.model.convert_tokens_to_ids([c])[0];a.input_ids.map_(e=>e==d?-e:e)}else a=this.tokenizer(e);return{...a,...o}}}e.defineProperty(u,`image_processor_class`,a.AutoImageProcessor),e.defineProperty(u,`tokenizer_class`,o.AutoTokenizer)},"./src/models/processors.js":(e,t,n)=>{n.r(t),n.d(t,{Florence2Processor:()=>r.Florence2Processor,GroundingDinoProcessor:()=>i.GroundingDinoProcessor,Idefics3Processor:()=>a.Idefics3Processor,JinaCLIPProcessor:()=>s.JinaCLIPProcessor,MgpstrProcessor:()=>c.MgpstrProcessor,MoonshineProcessor:()=>l.MoonshineProcessor,OwlViTProcessor:()=>u.OwlViTProcessor,PaliGemmaProcessor:()=>f.PaliGemmaProcessor,Phi3VProcessor:()=>d.Phi3VProcessor,PyAnnoteProcessor:()=>p.PyAnnoteProcessor,Qwen2VLProcessor:()=>m.Qwen2VLProcessor,SamProcessor:()=>h.SamProcessor,SmolVLMProcessor:()=>g.SmolVLMProcessor,SpeechT5Processor:()=>_.SpeechT5Processor,UltravoxProcessor:()=>v.UltravoxProcessor,VLChatProcessor:()=>o.VLChatProcessor,Wav2Vec2Processor:()=>y.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>b.Wav2Vec2ProcessorWithLM,WhisperProcessor:()=>x.WhisperProcessor});var r=n( +/*! ./florence2/processing_florence2.js */ +`./src/models/florence2/processing_florence2.js`),i=n( +/*! ./grounding_dino/processing_grounding_dino.js */ +`./src/models/grounding_dino/processing_grounding_dino.js`),a=n( +/*! ./idefics3/processing_idefics3.js */ +`./src/models/idefics3/processing_idefics3.js`),o=n( +/*! ./janus/processing_janus.js */ +`./src/models/janus/processing_janus.js`),s=n( +/*! ./jina_clip/processing_jina_clip.js */ +`./src/models/jina_clip/processing_jina_clip.js`),c=n( +/*! ./mgp_str/processing_mgp_str.js */ +`./src/models/mgp_str/processing_mgp_str.js`),l=n( +/*! ./moonshine/processing_moonshine.js */ +`./src/models/moonshine/processing_moonshine.js`),u=n( +/*! ./owlvit/processing_owlvit.js */ +`./src/models/owlvit/processing_owlvit.js`),d=n( +/*! ./phi3_v/processing_phi3_v.js */ +`./src/models/phi3_v/processing_phi3_v.js`),f=n( +/*! ./paligemma/processing_paligemma.js */ +`./src/models/paligemma/processing_paligemma.js`),p=n( +/*! ./pyannote/processing_pyannote.js */ +`./src/models/pyannote/processing_pyannote.js`),m=n( +/*! ./qwen2_vl/processing_qwen2_vl.js */ +`./src/models/qwen2_vl/processing_qwen2_vl.js`),h=n( +/*! ./sam/processing_sam.js */ +`./src/models/sam/processing_sam.js`),g=n( +/*! ./smolvlm/processing_smolvlm.js */ +`./src/models/smolvlm/processing_smolvlm.js`),_=n( +/*! ./speecht5/processing_speecht5.js */ +`./src/models/speecht5/processing_speecht5.js`),v=n( +/*! ./ultravox/processing_ultravox.js */ +`./src/models/ultravox/processing_ultravox.js`),y=n( +/*! ./wav2vec2/processing_wav2vec2.js */ +`./src/models/wav2vec2/processing_wav2vec2.js`),b=n( +/*! ./wav2vec2_with_lm/processing_wav2vec2_with_lm.js */ +`./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js`),x=n( +/*! ./whisper/processing_whisper.js */ +`./src/models/whisper/processing_whisper.js`)},"./src/models/pvt/image_processing_pvt.js":(e,t,n)=>{n.r(t),n.d(t,{PvtImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/pyannote/feature_extraction_pyannote.js":(e,t,n)=>{n.r(t),n.d(t,{PyAnnoteFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/maths.js */ +`./src/utils/maths.js`);class o extends r.FeatureExtractor{async _call(e){(0,r.validate_audio_inputs)(e,`PyAnnoteFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=[1,1,e.length];return{input_values:new i.Tensor(`float32`,e,t)}}samples_to_frames(e){return(e-this.config.offset)/this.config.step}post_process_speaker_diarization(e,t){let n=t/this.samples_to_frames(t)/this.config.sampling_rate,r=[];for(let t of e.tolist()){let e=[],i=-1;for(let n=0;n({id:e,start:t*n,end:r*n,confidence:i/(r-t)})))}return r}}},"./src/models/pyannote/processing_pyannote.js":(t,n,r)=>{r.r(n),r.d(n,{PyAnnoteProcessor:()=>o});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ./feature_extraction_pyannote.js */ +`./src/models/pyannote/feature_extraction_pyannote.js`);class o extends i.Processor{async _call(e){return await this.feature_extractor(e)}post_process_speaker_diarization(...e){return this.feature_extractor.post_process_speaker_diarization(...e)}get sampling_rate(){return this.feature_extractor.config.sampling_rate}}e.defineProperty(o,`feature_extractor_class`,a.PyAnnoteFeatureExtractor)},"./src/models/qwen2_vl/image_processing_qwen2_vl.js":(e,t,n)=>{n.r(t),n.d(t,{Qwen2VLImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e,...t){let{pixel_values:n,original_sizes:r,reshaped_input_sizes:a}=await super._call(e,...t),o=n,{temporal_patch_size:s,merge_size:c,patch_size:l}=this.config;o.dims[0]===1&&(o=(0,i.cat)(Array.from({length:s},()=>o),0));let u=o.dims[0]/s,d=o.dims[1],f=Math.floor(o.dims[2]/l),p=Math.floor(o.dims[3]/l),m=o.view(u,s,d,Math.floor(f/c),c,l,Math.floor(p/c),c,l).permute(0,3,6,4,7,2,1,5,8).view(u*f*p,d*s*l*l),h=new i.Tensor(`int64`,[u,f,p],[1,3]);return{pixel_values:m,image_grid_thw:h,original_sizes:r,reshaped_input_sizes:a}}}},"./src/models/qwen2_vl/processing_qwen2_vl.js":(t,n,r)=>{r.r(n),r.d(n,{Qwen2VLProcessor:()=>c});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/image.js */ +`./src/utils/image.js`);class c extends i.Processor{async _call(e,t=null,...n){Array.isArray(e)||(e=[e]);let r,i;if(t&&(r=await this.image_processor(t),i=r.image_grid_thw),i){let t=this.image_processor.config.merge_size**2,n=0,r=i.tolist();e=e.map(e=>{for(;e.includes(`<|image_pad|>`);){let i=Number(r[n++].reduce((e,t)=>e*t,1n));e=e.replace(`<|image_pad|>`,`<|placeholder|>`.repeat(Math.floor(i/t)))}return e.replaceAll(`<|placeholder|>`,`<|image_pad|>`)})}let a=this.tokenizer(e);return{...a,...r}}}e.defineProperty(c,`image_processor_class`,a.AutoImageProcessor),e.defineProperty(c,`tokenizer_class`,o.AutoTokenizer)},"./src/models/rt_detr/image_processing_rt_detr.js":(e,t,n)=>{n.r(t),n.d(t,{RTDetrImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}}},"./src/models/sam/image_processing_sam.js":(e,t,n)=>{n.r(t),n.d(t,{SamImageProcessor:()=>o});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/core.js */ +`./src/utils/core.js`),a=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class o extends r.ImageProcessor{reshape_input_points(e,t,n,r=!1){e=structuredClone(e);let o=(0,i.calculateDimensions)(e);if(o.length===3)r||(o=[1,...o]),e=[e];else if(o.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let r=0;re!==t.dims[n]))throw Error(`The first ${n.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new a.Tensor(`int64`,e.flat(1/0).map(BigInt),n)}async _call(e,{input_points:t=null,input_labels:n=null,input_boxes:r=null}={}){let i=await super._call(e);if(t&&(i.input_points=this.reshape_input_points(t,i.original_sizes,i.reshaped_input_sizes)),n){if(!i.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");i.input_labels=this.add_input_labels(n,i.input_points)}return r&&(i.input_boxes=this.reshape_input_points(r,i.original_sizes,i.reshaped_input_sizes,!0)),i}async post_process_masks(e,t,n,{mask_threshold:r=0,binarize:i=!0,pad_size:o=null}={}){let s=[];o??=this.pad_size;let c=[o.height,o.width];for(let o=0;or&&(t[n]=1);d=new a.Tensor(`bool`,t,d.dims)}s.push(d)}return s}generate_crop_boxes(e,t,{crop_n_layers:n=0,overlap_ratio:r=512/1500,points_per_crop:i=32,crop_n_points_downscale_factor:a=1}={}){}}},"./src/models/sam/processing_sam.js":(t,n,r)=>{r.r(n),r.d(n,{SamProcessor:()=>o});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`);class o extends i.Processor{async _call(...e){return await this.image_processor(...e)}post_process_masks(...e){return this.image_processor.post_process_masks(...e)}reshape_input_points(...e){return this.image_processor.reshape_input_points(...e)}}e.defineProperty(o,`image_processor_class`,a.AutoImageProcessor)},"./src/models/seamless_m4t/feature_extraction_seamless_m4t.js":(e,t,n)=>{n.r(t),n.d(t,{SeamlessM4TFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e);let t=this.config.sampling_rate,n=(0,a.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=(0,a.window_function)(400,`povey`,{periodic:!1})}async _extract_fbank_features(e,t){return e=e.map(e=>e*32768),(0,a.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e,{padding:t=!0,pad_to_multiple_of:n=2,do_normalize_per_mel_bins:a=!0,return_attention_mask:o=!0}={}){(0,r.validate_audio_inputs)(e,`SeamlessM4TFeatureExtractor`);let s=await this._extract_fbank_features(e,this.config.max_length);if(a){let[e,t]=s.dims,n=s.data;for(let r=0;r0){let n=new Float32Array(t*(e+a));n.set(r),n.fill(this.config.padding_value,r.length);let l=e+a;s=new i.Tensor(s.type,n,[l,t]),o&&(c=new i.Tensor(`int64`,new BigInt64Array(l),[1,l]),c.data.fill(1n,0,e))}}let[l,u]=s.dims,d=this.config.stride,f=l%d;if(f!==0)throw Error(`The number of frames (${l}) must be a multiple of the stride (${d}).`);let p=s.view(1,Math.floor(l/d),u*d),m={input_features:p};if(o){let e=p.dims[1],t=new BigInt64Array(e);if(c){let e=c.data;for(let n=1,r=0;n{n.r(t),n.d(t,{SegformerFeatureExtractor:()=>a,SegformerImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_semantic_segmentation(...e){return(0,r.post_process_semantic_segmentation)(...e)}}class a extends i{}},"./src/models/siglip/image_processing_siglip.js":(e,t,n)=>{n.r(t),n.d(t,{SiglipImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/smolvlm/image_processing_smolvlm.js":(e,t,n)=>{n.r(t),n.d(t,{SmolVLMImageProcessor:()=>r.Idefics3ImageProcessor});var r=n( +/*! ../idefics3/image_processing_idefics3.js */ +`./src/models/idefics3/image_processing_idefics3.js`)},"./src/models/smolvlm/processing_smolvlm.js":(e,t,n)=>{n.r(t),n.d(t,{SmolVLMProcessor:()=>r.Idefics3Processor});var r=n( +/*! ../idefics3/processing_idefics3.js */ +`./src/models/idefics3/processing_idefics3.js`)},"./src/models/snac/feature_extraction_snac.js":(e,t,n)=>{n.r(t),n.d(t,{SnacFeatureExtractor:()=>i});var r=n( +/*! ../dac/feature_extraction_dac.js */ +`./src/models/dac/feature_extraction_dac.js`);class i extends r.DacFeatureExtractor{}},"./src/models/speecht5/feature_extraction_speecht5.js":(e,t,n)=>{n.r(t),n.d(t,{SpeechT5FeatureExtractor:()=>i});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`);class i extends r.FeatureExtractor{}},"./src/models/speecht5/processing_speecht5.js":(t,n,r)=>{r.r(n),r.d(n,{SpeechT5Processor:()=>s});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`);class s extends i.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,a.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,o.AutoFeatureExtractor)},"./src/models/swin2sr/image_processing_swin2sr.js":(e,t,n)=>{n.r(t),n.d(t,{Swin2SRImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{pad_image(e,t,n,r={}){let[i,a,o]=t;return super.pad_image(e,t,{width:a+(n-a%n)%n,height:i+(n-i%n)%n},{mode:`symmetric`,center:!1,constant_values:-1,...r})}}},"./src/models/ultravox/processing_ultravox.js":(t,n,r)=>{r.r(n),r.d(n,{UltravoxProcessor:()=>s});var i=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),a=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e,t=null,n={}){if(Array.isArray(e))throw Error(`Batched inputs are not supported yet.`);let r={};if(t){let i=t.length,{input_features:a}=await this.feature_extractor(t,{...n,max_length:i}),o=Math.round(i/this.config.encoder_ds_factor+1e-4),s=1+Math.ceil(o/this.config.stack_factor);r.audio_token_len=[s],r.audio_values=a;let c=this.config.audio_placeholder;if(!e.includes(c))throw Error(`The input text does not contain the image token ${c}.`);e=e.replaceAll(c,c.repeat(s))}let i=this.tokenizer(e,{add_special_tokens:!1,...n});return{...i,...r}}}e.defineProperty(s,`tokenizer_class`,a.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,i.AutoFeatureExtractor),e.defineProperty(s,`uses_processor_config`,!0)},"./src/models/vit/image_processing_vit.js":(e,t,n)=>{n.r(t),n.d(t,{ViTFeatureExtractor:()=>a,ViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/vitmatte/image_processing_vitmatte.js":(e,t,n)=>{n.r(t),n.d(t,{VitMatteImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e,t){Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let n=await Promise.all(e.map(e=>this.preprocess(e))),r=await Promise.all(t.map(e=>this.preprocess(e,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0}))),a=(0,i.stack)(n.map((e,t)=>(0,i.cat)([e.pixel_values,r[t].pixel_values],0)),0);return{pixel_values:a,original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}}},"./src/models/vitpose/image_processing_vitpose.js":(e,t,n)=>{n.r(t),n.d(t,{VitPoseImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_pose_estimation(e,t,{threshold:n=null}={}){let r=e.tolist(),[i,a,o,s]=e.dims,c=[];for(let e=0;e{n.r(t),n.d(t,{Wav2Vec2FeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.FeatureExtractor{_zero_mean_unit_var_norm(e){let t=e.reduce((e,t)=>e+t,0),n=t/e.length,r=e.reduce((e,t)=>e+(t-n)**2,0)/e.length;return e.map(e=>(e-n)/Math.sqrt(r+1e-7))}async _call(e){(0,r.validate_audio_inputs)(e,`Wav2Vec2FeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=e;this.config.do_normalize&&(t=this._zero_mean_unit_var_norm(t));let n=[1,t.length];return{input_values:new i.Tensor(`float32`,t,n),attention_mask:new i.Tensor(`int64`,new BigInt64Array(t.length).fill(1n),n)}}}},"./src/models/wav2vec2/processing_wav2vec2.js":(t,n,r)=>{r.r(n),r.d(n,{Wav2Vec2Processor:()=>s});var i=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),a=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,i.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,a.AutoFeatureExtractor)},"./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js":(t,n,r)=>{r.r(n),r.d(n,{Wav2Vec2ProcessorWithLM:()=>s});var i=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),a=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,i.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,a.AutoFeatureExtractor)},"./src/models/wespeaker/feature_extraction_wespeaker.js":(e,t,n)=>{n.r(t),n.d(t,{WeSpeakerFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e);let t=this.config.sampling_rate,n=(0,a.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=(0,a.window_function)(400,`hamming`,{periodic:!1}),this.min_num_frames=this.config.min_num_frames}async _extract_fbank_features(e){return e=e.map(e=>e*32768),(0,a.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(e){(0,r.validate_audio_inputs)(e,`WeSpeakerFeatureExtractor`);let t=(await this._extract_fbank_features(e)).unsqueeze_(0);if(this.config.fbank_centering_span===null){let e=t.mean(1).data,n=t.data,[r,i,a]=t.dims;for(let t=0;t{n.r(t),n.d(t,{WHISPER_LANGUAGE_MAPPING:()=>i,WHISPER_TO_LANGUAGE_CODE_MAPPING:()=>a,whisper_language_to_code:()=>o});let r=[[`en`,`english`],[`zh`,`chinese`],[`de`,`german`],[`es`,`spanish`],[`ru`,`russian`],[`ko`,`korean`],[`fr`,`french`],[`ja`,`japanese`],[`pt`,`portuguese`],[`tr`,`turkish`],[`pl`,`polish`],[`ca`,`catalan`],[`nl`,`dutch`],[`ar`,`arabic`],[`sv`,`swedish`],[`it`,`italian`],[`id`,`indonesian`],[`hi`,`hindi`],[`fi`,`finnish`],[`vi`,`vietnamese`],[`he`,`hebrew`],[`uk`,`ukrainian`],[`el`,`greek`],[`ms`,`malay`],[`cs`,`czech`],[`ro`,`romanian`],[`da`,`danish`],[`hu`,`hungarian`],[`ta`,`tamil`],[`no`,`norwegian`],[`th`,`thai`],[`ur`,`urdu`],[`hr`,`croatian`],[`bg`,`bulgarian`],[`lt`,`lithuanian`],[`la`,`latin`],[`mi`,`maori`],[`ml`,`malayalam`],[`cy`,`welsh`],[`sk`,`slovak`],[`te`,`telugu`],[`fa`,`persian`],[`lv`,`latvian`],[`bn`,`bengali`],[`sr`,`serbian`],[`az`,`azerbaijani`],[`sl`,`slovenian`],[`kn`,`kannada`],[`et`,`estonian`],[`mk`,`macedonian`],[`br`,`breton`],[`eu`,`basque`],[`is`,`icelandic`],[`hy`,`armenian`],[`ne`,`nepali`],[`mn`,`mongolian`],[`bs`,`bosnian`],[`kk`,`kazakh`],[`sq`,`albanian`],[`sw`,`swahili`],[`gl`,`galician`],[`mr`,`marathi`],[`pa`,`punjabi`],[`si`,`sinhala`],[`km`,`khmer`],[`sn`,`shona`],[`yo`,`yoruba`],[`so`,`somali`],[`af`,`afrikaans`],[`oc`,`occitan`],[`ka`,`georgian`],[`be`,`belarusian`],[`tg`,`tajik`],[`sd`,`sindhi`],[`gu`,`gujarati`],[`am`,`amharic`],[`yi`,`yiddish`],[`lo`,`lao`],[`uz`,`uzbek`],[`fo`,`faroese`],[`ht`,`haitian creole`],[`ps`,`pashto`],[`tk`,`turkmen`],[`nn`,`nynorsk`],[`mt`,`maltese`],[`sa`,`sanskrit`],[`lb`,`luxembourgish`],[`my`,`myanmar`],[`bo`,`tibetan`],[`tl`,`tagalog`],[`mg`,`malagasy`],[`as`,`assamese`],[`tt`,`tatar`],[`haw`,`hawaiian`],[`ln`,`lingala`],[`ha`,`hausa`],[`ba`,`bashkir`],[`jw`,`javanese`],[`su`,`sundanese`]],i=new Map(r),a=new Map([...r.map(([e,t])=>[t,e]),...[[`burmese`,`my`],[`valencian`,`ca`],[`flemish`,`nl`],[`haitian`,`ht`],[`letzeburgesch`,`lb`],[`pushto`,`ps`],[`panjabi`,`pa`],[`moldavian`,`ro`],[`moldovan`,`ro`],[`sinhalese`,`si`],[`castilian`,`es`]]]);function o(e){e=e.toLowerCase();let t=a.get(e);if(t===void 0){let n=e.match(/^<\|([a-z]{2})\|>$/);if(n&&(e=n[1]),i.has(e))t=e;else{let t=e.length===2,n=t?i.keys():i.values();throw Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(Array.from(n))}`)}}return t}},"./src/models/whisper/feature_extraction_whisper.js":(e,t,n)=>{n.r(t),n.d(t,{WhisperFeatureExtractor:()=>s});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`),o=n( +/*! ../../utils/maths.js */ +`./src/utils/maths.js`);class s extends r.FeatureExtractor{constructor(e){var t;super(e),(t=this.config).mel_filters??(t.mel_filters=(0,a.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,`slaney`,`slaney`)),this.window=(0,a.window_function)(this.config.n_fft,`hann`)}async _extract_fbank_features(e){let t=await(0,a.spectrogram)(e,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:`log10`,max_num_frames:Math.min(Math.floor(e.length/this.config.hop_length),this.config.nb_max_frames)}),n=t.data,r=(0,o.max)(n)[0];for(let e=0;ei?(e.length>this.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),n=e.slice(0,i)):(n=new Float32Array(i),n.set(e));let a=await this._extract_fbank_features(n);return{input_features:a.unsqueeze_(0)}}}},"./src/models/whisper/generation_whisper.js":(t,n,r)=>{r.r(n),r.d(n,{WhisperGenerationConfig:()=>a});var i=r( +/*! ../../generation/configuration_utils.js */ +`./src/generation/configuration_utils.js`);class a extends i.GenerationConfig{constructor(...t){super(...t),e.defineProperty(this,`return_timestamps`,null),e.defineProperty(this,`return_token_timestamps`,null),e.defineProperty(this,`num_frames`,null),e.defineProperty(this,`alignment_heads`,null),e.defineProperty(this,`task`,null),e.defineProperty(this,`language`,null),e.defineProperty(this,`no_timestamps_token_id`,null),e.defineProperty(this,`prompt_ids`,null),e.defineProperty(this,`is_multilingual`,null),e.defineProperty(this,`lang_to_id`,null),e.defineProperty(this,`task_to_id`,null),e.defineProperty(this,`max_initial_timestamp_index`,1)}}},"./src/models/whisper/processing_whisper.js":(t,n,r)=>{r.r(n),r.d(n,{WhisperProcessor:()=>s});var i=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),a=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,a.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,i.AutoFeatureExtractor)},"./src/models/yolos/image_processing_yolos.js":(e,t,n)=>{n.r(t),n.d(t,{YolosFeatureExtractor:()=>a,YolosImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}}class a extends i{}},"./src/ops/registry.js":(t,n,r)=>{r.r(n),r.d(n,{TensorOpRegistry:()=>l});var i=r( +/*! ../backends/onnx.js */ +`./src/backends/onnx.js`),a=r( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),o=r( +/*! ../env.js */ +`./src/env.js`);let s=o.apis.IS_BROWSER_ENV||o.apis.IS_WEBWORKER_ENV,c=async(e,t,n)=>{let r=await(0,i.createInferenceSession)(new Uint8Array(e),t),o=Promise.resolve();return async e=>{let t=(0,i.isONNXProxy)(),c=Object.fromEntries(Object.entries(e).map(([e,n])=>[e,(t?n.clone():n).ort_tensor])),l=await(o=s?o.then(()=>r.run(c)):r.run(c));return Array.isArray(n)?n.map(e=>new a.Tensor(l[e])):new a.Tensor(l[n])}};class l{static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||=c([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,`y`),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||=c([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||=c([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||=c([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,`c`),this._matmul}static get stft(){return this._stft||=c([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,`o`),this._stft}static get rfft(){return this._rfft||=c([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,`y`),this._rfft}static get top_k(){return this._top_k||=c([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,[`v`,`i`]),this._top_k}static get slice(){return this._slice||=c([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,`y`),this._slice}}e.defineProperty(l,`session_options`,{})},"./src/pipelines.js":(t,n,r)=>{r.r(n),r.d(n,{AudioClassificationPipeline:()=>k,AutomaticSpeechRecognitionPipeline:()=>ne,BackgroundRemovalPipeline:()=>ae,DepthEstimationPipeline:()=>M,DocumentQuestionAnsweringPipeline:()=>le,FeatureExtractionPipeline:()=>O,FillMaskPipeline:()=>x,ImageClassificationPipeline:()=>ie,ImageFeatureExtractionPipeline:()=>ee,ImageSegmentationPipeline:()=>A,ImageToImagePipeline:()=>j,ImageToTextPipeline:()=>re,ObjectDetectionPipeline:()=>se,Pipeline:()=>_,QuestionAnsweringPipeline:()=>b,SummarizationPipeline:()=>C,Text2TextGenerationPipeline:()=>S,TextClassificationPipeline:()=>v,TextGenerationPipeline:()=>E,TextToAudioPipeline:()=>ue,TokenClassificationPipeline:()=>y,TranslationPipeline:()=>w,ZeroShotAudioClassificationPipeline:()=>te,ZeroShotClassificationPipeline:()=>D,ZeroShotImageClassificationPipeline:()=>oe,ZeroShotObjectDetectionPipeline:()=>ce,pipeline:()=>pe});var i=r( +/*! ./tokenizers.js */ +`./src/tokenizers.js`),a=r( +/*! ./models.js */ +`./src/models.js`),o=r( +/*! ./models/auto/processing_auto.js */ +`./src/models/auto/processing_auto.js`),s=r( +/*! ./base/processing_utils.js */ +`./src/base/processing_utils.js`),c=r( +/*! ./utils/generic.js */ +`./src/utils/generic.js`),l=r( +/*! ./utils/core.js */ +`./src/utils/core.js`),u=r( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),d=r( +/*! ./utils/audio.js */ +`./src/utils/audio.js`),f=r( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),p=r( +/*! ./utils/image.js */ +`./src/utils/image.js`);async function m(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>p.RawImage.read(e)))}async function h(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?(0,d.read_audio)(e,t):e instanceof Float64Array?new Float32Array(e):e))}function g(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}class _ extends c.Callable{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}}class v extends _{constructor(e){super(e)}async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),i=this.model.config.problem_type===`multi_label_classification`?e=>e.sigmoid():e=>new f.Tensor(`float32`,(0,u.softmax)(e.data),e.dims),a=this.model.config.id2label,o=[];for(let e of r.logits){let n=i(e),r=await(0,f.topk)(n,t),s=r[0].tolist(),c=r[1].tolist(),l=c.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:s[t]}));t===1?o.push(...l):o.push(l)}return Array.isArray(e)||t===1?o:o[0]}}class y extends _{constructor(e){super(e)}async _call(e,{ignore_labels:t=[`O`]}={}){let n=Array.isArray(e),r=this.tokenizer(n?e:[e],{padding:!0,truncation:!0}),i=await this.model(r),a=i.logits,o=this.model.config.id2label,s=[];for(let e=0;ee==this.tokenizer.sep_token_id),f=s[e].map((e,n)=>e==1&&(n===0||n>r&&c.findIndex(e=>e==t[n])===-1)),p=i[e].tolist(),m=a[e].tolist();for(let n=1;ne==t[n])!==-1)&&(p[n]=-1/0,m[n]=-1/0);let h=(0,u.softmax)(p).map((e,t)=>[e,t]),g=(0,u.softmax)(m).map((e,t)=>[e,t]);h[0][0]=0,g[0][0]=0;let _=(0,l.product)(h,g).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]);for(let e=0;ee==this.tokenizer.mask_token_id);if(o===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);let s=r[e][o],c=await(0,f.topk)(new f.Tensor(`float32`,(0,u.softmax)(s.data),s.dims),t),l=c[0].tolist(),d=c[1].tolist();i.push(d.map((e,t)=>{let r=n.slice();return r[o]=e,{score:l[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(r,{skip_special_tokens:!0})}}))}return Array.isArray(e)?i:i[0]}}class S extends _{constructor(t){super(t),e.defineProperty(this,`_key`,`generated_text`)}async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this instanceof w&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}}class C extends S{constructor(t){super(t),e.defineProperty(this,`_key`,`summary_text`)}}class w extends S{constructor(t){super(t),e.defineProperty(this,`_key`,`translation_text`)}}function T(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}class E extends _{constructor(e){super(e)}async _call(e,t={}){let n=!1,r=!1,i;if(typeof e==`string`)i=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))n=!0,i=e;else{if(T(e))e=[e];else if(Array.isArray(e)&&e.every(T))n=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);r=!0,i=e.map(e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0}))}let a=t.add_special_tokens??!1,o=r?!1:t.return_full_text??!0;this.tokenizer.padding_side=`left`;let s=this.tokenizer(i,{add_special_tokens:a,padding:!0,truncation:!0}),c=await this.model.generate({...s,...t}),l=this.tokenizer.batch_decode(c,{skip_special_tokens:!0}),u;!o&&s.input_ids.dims.at(-1)>0&&(u=this.tokenizer.batch_decode(s.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let d=Array.from({length:e.length},e=>[]);for(let t=0;t[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=o?e.map(e=>(0,u.softmax)(e)[1]):(0,u.softmax)(e),i=r.map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:i.map(e=>t[e[1]]),scores:i.map(e=>e[0])})}return i?s:s[0]}}class O extends _{constructor(e){super(e)}async _call(e,{pooling:t=`none`,normalize:n=!1,quantize:r=!1,precision:i=`binary`}={}){let a=this.tokenizer(e,{padding:!0,truncation:!0}),o=await this.model(a),s=o.last_hidden_state??o.logits??o.token_embeddings;if(t!==`none`)if(t===`mean`)s=(0,f.mean_pooling)(s,a.attention_mask);else if(t===`cls`)s=s.slice(null,0);else throw Error(`Pooling method '${t}' not supported.`);return n&&(s=s.normalize(2,-1)),r&&(s=(0,f.quantize_embeddings)(s,i)),s}}class ee extends _{constructor(e){super(e)}async _call(e,{pool:t=null}={}){let n=await m(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a;if(t){if(!(`pooler_output`in i))throw Error(`No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.`);a=i.pooler_output}else a=i.last_hidden_state??i.logits??i.image_embeds;return a}}class k extends _{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await h(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=await this.model(n),o=r.logits[0],s=await(0,f.topk)(new f.Tensor(`float32`,(0,u.softmax)(o.data),o.dims),t),c=s[0].tolist(),l=s[1].tolist(),d=l.map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:c[t]}));a.push(d)}return Array.isArray(e)?a:a[0]}}class te extends _{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await h(e,o),c=[];for(let e of s){let n=await this.processor(e),r=await this.model({...a,...n}),i=(0,u.softmax)(r.logits_per_audio.data);c.push([...i].map((e,n)=>({score:e,label:t[n]})))}return r?c[0]:c}}class ne extends _{constructor(e){super(e)}async _call(e,t={}){switch(this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await h(e,r),a=[];for(let e of i){let t=await this.processor(e),n=await this.model(t),r=n.logits[0],i=[];for(let e of r)i.push((0,u.max)(e.data)[1]);let o=this.tokenizer.decode(i);a.push({text:o})}return n?a[0]:a}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!1);let s=!Array.isArray(e);s&&(e=[e]);let c=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,l=this.processor.feature_extractor.config.hop_length,d=this.processor.feature_extractor.config.sampling_rate,f=await h(e,d),p=[];for(let e of f){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=d*r,i=d*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/l);let t=await this.model.generate({inputs:e.input_features,...o});n===`word`?(e.tokens=t.sequences.tolist()[0],e.token_timestamps=t.token_timestamps.tolist()[0].map(e=>(0,u.round)(e,2))):e.tokens=t[0].tolist(),e.stride=e.stride.map(e=>e/d)}let[s,f]=this.tokenizer._decode_asr(t,{time_precision:c,return_timestamps:n,force_full_sequences:i});p.push({text:s,...f})}return s?p[0]:p}async _call_moonshine(e,t){let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await h(e,r),a=[];for(let e of i){let n=await this.processor(e),i=Math.floor(e.length/r)*6,o=await this.model.generate({max_new_tokens:i,...t,...n}),s=this.processor.batch_decode(o,{skip_special_tokens:!0})[0];a.push({text:s})}return n?a[0]:a}}class re extends _{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e),r=await m(e),{pixel_values:i}=await this.processor(r),a=[];for(let e of i){e.dims=[1,...e.dims];let n=await this.model.generate({inputs:e,...t}),r=this.tokenizer.batch_decode(n,{skip_special_tokens:!0}).map(e=>({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}}class ie extends _{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=await m(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a=this.model.config.id2label,o=[];for(let e of i.logits){let n=await(0,f.topk)(new f.Tensor(`float32`,(0,u.softmax)(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist(),s=i.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(s)}return Array.isArray(e)?o:o[0]}}class A extends _{constructor(e){super(e),this.subtasks_mapping={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`}}async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){let s=Array.isArray(e);if(s&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let c=await m(e),l=c.map(e=>[e.height,e.width]),u=await this.processor(c),{inputNames:d,outputNames:f}=this.model.sessions.model;if(!d.includes(`pixel_values`)){if(d.length!==1)throw Error(`Expected a single input name, but got ${d.length} inputs: ${d}.`);let e=d[0];if(e in u)throw Error(`Input name ${e} already exists in the inputs.`);u[e]=u.pixel_values}let h=await this.model(u),g=null;if(o!==null)g=this.subtasks_mapping[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(this.subtasks_mapping))if(t in this.processor.image_processor){g=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let _=this.model.config.id2label,v=[];if(o)if(o===`panoptic`||o===`instance`){let e=g(h,t,n,r,i,a??l)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;nt<-e||t>1+e)&&i.sigmoid_();let a=await p.RawImage.fromTensor(i.mul_(255).to(`uint8`)).resize(r[1],r[0]);v.push({label:null,score:null,mask:a})}}return v}}class ae extends A{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e);if(n&&e.length!==1)throw Error(`Background removal pipeline currently only supports a batch size of 1.`);let r=await m(e),i=await super._call(e,t),a=r.map((e,t)=>{let n=e.clone();return n.putAlpha(i[t].mask),n});return a}}class oe extends _{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await m(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),c=await this.model({...o,pixel_values:s}),l=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>(0,u.softmax)(e.data),d=[];for(let e of c.logits_per_image){let n=l(e),r=[...n].map((e,n)=>({score:e,label:t[n]}));r.sort((e,t)=>t.score-e.score),d.push(r)}return r?d:d[0]}}class se extends _{constructor(e){super(e)}async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await m(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),u=this.model.config.id2label,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:g(t,!n)})));return r?d:d[0]}}class ce extends _{constructor(e){super(e)}async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await m(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:g(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:g(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}}class le extends _{constructor(e){super(e)}async _call(e,t,n={}){let r=(await m(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...n}),c=this.tokenizer.batch_decode(s)[0],l=c.match(/(.*?)<\/s_answer>/),u=null;return l&&l.length>=2&&(u=l[1].trim()),[{answer:u}]}}class ue extends _{constructor(t){super(t),e.defineProperty(this,`DEFAULT_VOCODER_ID`,`Xenova/speecht5_hifigan`),this.vocoder=t.vocoder??null}async _call(e,{speaker_embeddings:t=null}={}){return this.processor?this._call_text_to_spectrogram(e,{speaker_embeddings:t}):this._call_text_to_waveform(e)}async _call_text_to_waveform(e){let t=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:n}=await this.model(t),r=this.model.config.sampling_rate;return new d.RawAudio(n.data,r)}async _call_text_to_spectrogram(e,{speaker_embeddings:t}){if(this.vocoder||(console.log(`No vocoder specified, using default HifiGan vocoder.`),this.vocoder=await a.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:`fp32`})),(typeof t==`string`||t instanceof URL)&&(t=new Float32Array(await(await fetch(t)).arrayBuffer())),t instanceof Float32Array)t=new f.Tensor(`float32`,t,[1,t.length]);else if(!(t instanceof f.Tensor))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");let{input_ids:n}=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:r}=await this.model.generate_speech(n,t,{vocoder:this.vocoder}),i=this.processor.feature_extractor.config.sampling_rate;return new d.RawAudio(r.data,i)}}class j extends _{constructor(e){super(e)}async _call(e){let t=await m(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(p.RawImage.fromTensor(t))}return i.length>1?i:i[0]}}class M extends _{constructor(e){super(e)}async _call(e){let t=await m(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;e1?i:i[0]}}let de=Object.freeze({"text-classification":{tokenizer:i.AutoTokenizer,pipeline:v,model:a.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-finetuned-sst-2-english`},type:`text`},"token-classification":{tokenizer:i.AutoTokenizer,pipeline:y,model:a.AutoModelForTokenClassification,default:{model:`Xenova/bert-base-multilingual-cased-ner-hrl`},type:`text`},"question-answering":{tokenizer:i.AutoTokenizer,pipeline:b,model:a.AutoModelForQuestionAnswering,default:{model:`Xenova/distilbert-base-cased-distilled-squad`},type:`text`},"fill-mask":{tokenizer:i.AutoTokenizer,pipeline:x,model:a.AutoModelForMaskedLM,default:{model:`Xenova/bert-base-uncased`},type:`text`},summarization:{tokenizer:i.AutoTokenizer,pipeline:C,model:a.AutoModelForSeq2SeqLM,default:{model:`Xenova/distilbart-cnn-6-6`},type:`text`},translation:{tokenizer:i.AutoTokenizer,pipeline:w,model:a.AutoModelForSeq2SeqLM,default:{model:`Xenova/t5-small`},type:`text`},"text2text-generation":{tokenizer:i.AutoTokenizer,pipeline:S,model:a.AutoModelForSeq2SeqLM,default:{model:`Xenova/flan-t5-small`},type:`text`},"text-generation":{tokenizer:i.AutoTokenizer,pipeline:E,model:a.AutoModelForCausalLM,default:{model:`Xenova/gpt2`},type:`text`},"zero-shot-classification":{tokenizer:i.AutoTokenizer,pipeline:D,model:a.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-mnli`},type:`text`},"audio-classification":{pipeline:k,model:a.AutoModelForAudioClassification,processor:o.AutoProcessor,default:{model:`Xenova/wav2vec2-base-superb-ks`},type:`audio`},"zero-shot-audio-classification":{tokenizer:i.AutoTokenizer,pipeline:te,model:a.AutoModel,processor:o.AutoProcessor,default:{model:`Xenova/clap-htsat-unfused`},type:`multimodal`},"automatic-speech-recognition":{tokenizer:i.AutoTokenizer,pipeline:ne,model:[a.AutoModelForSpeechSeq2Seq,a.AutoModelForCTC],processor:o.AutoProcessor,default:{model:`Xenova/whisper-tiny.en`},type:`multimodal`},"text-to-audio":{tokenizer:i.AutoTokenizer,pipeline:ue,model:[a.AutoModelForTextToWaveform,a.AutoModelForTextToSpectrogram],processor:[o.AutoProcessor,null],default:{model:`Xenova/speecht5_tts`},type:`text`},"image-to-text":{tokenizer:i.AutoTokenizer,pipeline:re,model:a.AutoModelForVision2Seq,processor:o.AutoProcessor,default:{model:`Xenova/vit-gpt2-image-captioning`},type:`multimodal`},"image-classification":{pipeline:ie,model:a.AutoModelForImageClassification,processor:o.AutoProcessor,default:{model:`Xenova/vit-base-patch16-224`},type:`multimodal`},"image-segmentation":{pipeline:A,model:[a.AutoModelForImageSegmentation,a.AutoModelForSemanticSegmentation,a.AutoModelForUniversalSegmentation],processor:o.AutoProcessor,default:{model:`Xenova/detr-resnet-50-panoptic`},type:`multimodal`},"background-removal":{pipeline:ae,model:[a.AutoModelForImageSegmentation,a.AutoModelForSemanticSegmentation,a.AutoModelForUniversalSegmentation],processor:o.AutoProcessor,default:{model:`Xenova/modnet`},type:`image`},"zero-shot-image-classification":{tokenizer:i.AutoTokenizer,pipeline:oe,model:a.AutoModel,processor:o.AutoProcessor,default:{model:`Xenova/clip-vit-base-patch32`},type:`multimodal`},"object-detection":{pipeline:se,model:a.AutoModelForObjectDetection,processor:o.AutoProcessor,default:{model:`Xenova/detr-resnet-50`},type:`multimodal`},"zero-shot-object-detection":{tokenizer:i.AutoTokenizer,pipeline:ce,model:a.AutoModelForZeroShotObjectDetection,processor:o.AutoProcessor,default:{model:`Xenova/owlvit-base-patch32`},type:`multimodal`},"document-question-answering":{tokenizer:i.AutoTokenizer,pipeline:le,model:a.AutoModelForDocumentQuestionAnswering,processor:o.AutoProcessor,default:{model:`Xenova/donut-base-finetuned-docvqa`},type:`multimodal`},"image-to-image":{pipeline:j,model:a.AutoModelForImageToImage,processor:o.AutoProcessor,default:{model:`Xenova/swin2SR-classical-sr-x2-64`},type:`image`},"depth-estimation":{pipeline:M,model:a.AutoModelForDepthEstimation,processor:o.AutoProcessor,default:{model:`Xenova/dpt-large`},type:`image`},"feature-extraction":{tokenizer:i.AutoTokenizer,pipeline:O,model:a.AutoModel,default:{model:`Xenova/all-MiniLM-L6-v2`},type:`text`},"image-feature-extraction":{processor:o.AutoProcessor,pipeline:ee,model:[a.AutoModelForImageFeatureExtraction,a.AutoModel],default:{model:`Xenova/vit-base-patch16-224-in21k`},type:`image`}}),fe=Object.freeze({"sentiment-analysis":`text-classification`,ner:`token-classification`,asr:`automatic-speech-recognition`,"text-to-speech":`text-to-audio`,embeddings:`feature-extraction`});async function pe(e,t=null,{progress_callback:n=null,config:r=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,device:s=null,dtype:c=null,subfolder:u=`onnx`,use_external_data_format:d=null,model_file_name:f=null,session_options:p={}}={}){e=fe[e]??e;let m=de[e.split(`_`,1)[0]];if(!m)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(de)}]`);t||(t=m.default.model,console.log(`No model specified. Using default model: "${t}".`));let h={progress_callback:n,config:r,cache_dir:i,local_files_only:a,revision:o,device:s,dtype:c,subfolder:u,use_external_data_format:d,model_file_name:f,session_options:p},g=new Map([[`tokenizer`,m.tokenizer],[`model`,m.model],[`processor`,m.processor]]),_=await N(g,t,h);_.task=e,(0,l.dispatchCallback)(n,{status:`ready`,task:e,model:t});let v=m.pipeline;return new v(_)}async function N(e,t,n){let r=Object.create(null),i=[];for(let[a,o]of e.entries()){if(!o)continue;let e;e=Array.isArray(o)?new Promise(async(e,r)=>{let i;for(let c of o){if(c===null){e(null);return}try{e(await c.from_pretrained(t,n));return}catch(e){var a,s;if((a=e.message)?.includes(`Unsupported model type`))i=e;else if((s=e.message)?.includes(`Could not locate file`))i=e;else{r(e);return}}}r(i)}):o.from_pretrained(t,n),r[a]=e,i.push(e)}await Promise.all(i);for(let[e,t]of Object.entries(r))r[e]=await t;return r}},"./src/tokenizers.js":(t,n,r)=>{r.r(n),r.d(n,{AlbertTokenizer:()=>Ue,AutoTokenizer:()=>Ft,BartTokenizer:()=>rt,BertTokenizer:()=>He,BlenderbotSmallTokenizer:()=>kt,BlenderbotTokenizer:()=>Ot,BloomTokenizer:()=>st,CLIPTokenizer:()=>wt,CamembertTokenizer:()=>Qe,CodeGenTokenizer:()=>Ct,CodeLlamaTokenizer:()=>ut,CohereTokenizer:()=>Nt,ConvBertTokenizer:()=>Ye,DebertaTokenizer:()=>Ke,DebertaV2Tokenizer:()=>qe,DistilBertTokenizer:()=>Ze,ElectraTokenizer:()=>et,EsmTokenizer:()=>ht,FalconTokenizer:()=>pt,GPT2Tokenizer:()=>nt,GPTNeoXTokenizer:()=>mt,GemmaTokenizer:()=>_t,Grok1Tokenizer:()=>vt,HerbertTokenizer:()=>Je,LlamaTokenizer:()=>lt,M2M100Tokenizer:()=>xt,MBart50Tokenizer:()=>at,MBartTokenizer:()=>it,MPNetTokenizer:()=>ft,MarianTokenizer:()=>Et,MgpstrTokenizer:()=>Pt,MobileBertTokenizer:()=>We,NllbTokenizer:()=>bt,NougatTokenizer:()=>jt,PreTrainedTokenizer:()=>z,Qwen2Tokenizer:()=>gt,RoFormerTokenizer:()=>Xe,RobertaTokenizer:()=>ot,SiglipTokenizer:()=>Tt,SpeechT5Tokenizer:()=>At,SqueezeBertTokenizer:()=>Ge,T5Tokenizer:()=>tt,TokenizerModel:()=>O,VitsTokenizer:()=>Mt,Wav2Vec2CTCTokenizer:()=>Dt,WhisperTokenizer:()=>St,XLMRobertaTokenizer:()=>dt,XLMTokenizer:()=>$e,is_chinese_char:()=>b});var i=r( +/*! ./utils/generic.js */ +`./src/utils/generic.js`),a=r( +/*! ./utils/core.js */ +`./src/utils/core.js`),o=r( +/*! ./utils/hub.js */ +`./src/utils/hub.js`),s=r( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),c=r( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),l=r( +/*! ./utils/data-structures.js */ +`./src/utils/data-structures.js`),u=r( +/*! @huggingface/jinja */ +`./node_modules/@huggingface/jinja/dist/index.js`),d=r( +/*! ./models/whisper/common_whisper.js */ +`./src/models/whisper/common_whisper.js`);async function f(e,t){let n=await Promise.all([(0,o.getModelJSON)(e,`tokenizer.json`,!0,t),(0,o.getModelJSON)(e,`tokenizer_config.json`,!0,t)]);return t.legacy!==null&&(n[1].legacy=t.legacy),n}function p(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return r=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}function x(e,t,n){let r=[],i=0;for(;ithis.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class ee extends O{constructor(e){super(e),this.tokens_to_ids=h(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){let t=[];for(let n of e){let e=[...n];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}}class k extends O{constructor(e,t){super(e);let n=e.vocab.length;this.vocab=Array(n),this.scores=Array(n);for(let t=0;t[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,s.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new l.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.chars,n=1,r=0;for(;r{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),ne=(0,a.reverseDictionary)(te);class re extends O{constructor(e){super(e),this.tokens_to_ids=h(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;let t=Array.isArray(e.merges[0]);this.merges=t?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new l.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new l.PriorityQueue((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):t.push(this.unk_token)}else t.push(this.unk_token)}return t}}class ie extends O{constructor(e,t){super(e),this.tokens_to_ids=h(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}}class A extends i.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new N(e);case`Precompiled`:return new R(e);case`Sequence`:return new pe(e);case`Replace`:return new ae(e);case`NFC`:return new se(e);case`NFD`:return new ce(e);case`NFKC`:return new le(e);case`NFKD`:return new ue(e);case`Strip`:return new j(e);case`StripAccents`:return new M(e);case`Lowercase`:return new de(e);case`Prepend`:return new fe(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error(`normalize should be implemented in subclass.`)}_call(e){return this.normalize(e)}}class ae extends A{normalize(e){let t=m(this.config.pattern);return t===null?e:e.replaceAll(t,this.config.content)}}class oe extends A{constructor(...t){super(...t),e.defineProperty(this,`form`,void 0)}normalize(e){return e=e.normalize(this.form),e}}class se extends oe{constructor(...t){super(...t),e.defineProperty(this,`form`,`NFC`)}}class ce extends oe{constructor(...t){super(...t),e.defineProperty(this,`form`,`NFD`)}}class le extends oe{constructor(...t){super(...t),e.defineProperty(this,`form`,`NFKC`)}}class ue extends oe{constructor(...t){super(...t),e.defineProperty(this,`form`,`NFKD`)}}class j extends A{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class M extends A{normalize(e){return e=v(e),e}}class de extends A{normalize(e){return e=e.toLowerCase(),e}}class fe extends A{normalize(e){return e=this.config.prepend+e,e}}class pe extends A{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>A.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class N extends A{_tokenize_chinese_chars(e){let t=[];for(let n=0;nthis.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class F extends P{constructor(e){super(),this.pattern=RegExp(`[^\\s${C}]+|[${C}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class I extends P{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=te,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e);let n=this.use_regex?e.match(this.pattern)||[]:[e];return n.map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}}class me extends P{constructor(e){super(),this.config=e,this.pattern=m(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){var n;return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:(n=this.config.behavior)?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):p(e,this.pattern)}}class he extends P{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${C}]+|[${C}]+`,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class ge extends P{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class _e extends i.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new L(e);case`ByteLevel`:return new be(e);case`RobertaProcessing`:return new ye(e);case`BertProcessing`:return new ve(e);case`Sequence`:return new xe(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error(`post_process should be implemented in subclass.`)}_call(e,...t){return this.post_process(e,...t)}}class ve extends _e{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:n=!0}={}){n&&(e=(0,a.mergeArrays)([this.cls],e,[this.sep]));let r=Array(e.length).fill(0);if(t!==null){let i=n&&this instanceof ye?[this.sep]:[],o=n?[this.sep]:[];e=(0,a.mergeArrays)(e,i,t,o),r=(0,a.mergeArrays)(r,Array(t.length+i.length+o.length).fill(1))}return{tokens:e,token_type_ids:r}}}class ye extends ve{}class L extends _e{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:n=!0}={}){let r=t===null?this.single:this.pair,i=[],o=[];for(let s of r)`SpecialToken`in s?n&&(i.push(s.SpecialToken.id),o.push(s.SpecialToken.type_id)):`Sequence`in s&&(s.Sequence.id===`A`?(i=(0,a.mergeArrays)(i,e),o=(0,a.mergeArrays)(o,Array(e.length).fill(s.Sequence.type_id))):s.Sequence.id===`B`&&(i=(0,a.mergeArrays)(i,t),o=(0,a.mergeArrays)(o,Array(t.length).fill(s.Sequence.type_id))));return{tokens:i,token_type_ids:o}}}class be extends _e{post_process(e,t=null){return t&&(e=(0,a.mergeArrays)(e,t)),{tokens:e}}}class xe extends _e{constructor(e){super(e),this.processors=e.processors.map(e=>_e.fromConfig(e))}post_process(e,t=null,n={}){let r;for(let i of this.processors)if(i instanceof be){let n=i.post_process(e);if(e=n.tokens,t){let e=i.post_process(t);t=e.tokens}}else{let a=i.post_process(e,t,n);e=a.tokens,r=a.token_type_ids}return{tokens:e,token_type_ids:r}}}class Se extends i.Callable{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(e===null)return null;switch(e.type){case`WordPiece`:return new De(e);case`Metaspace`:return new Pe(e);case`ByteLevel`:return new Oe(e);case`Replace`:return new Ce(e);case`ByteFallback`:return new we(e);case`Fuse`:return new Te(e);case`Strip`:return new Ee(e);case`Sequence`:return new Ae(e);case`CTC`:return new ke(e);case`BPEDecoder`:return new je(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class Ce extends Se{decode_chain(e){let t=m(this.config.pattern);return t===null?e:e.map(e=>e.replaceAll(t,this.config.content))}}class we extends Se{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],n=[];for(let r of e){let e=null;if(r.length===6&&r.startsWith(`<0x`)&&r.endsWith(`>`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}}class Te extends Se{decode_chain(e){return[e.join(``)]}}class Ee extends Se{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n(t!==0&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,``):` `+e),this.cleanup&&(e=_(e)),e))}}class Oe extends Se{constructor(e){super(e),this.byte_decoder=ne,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e])),r=this.text_decoder.decode(n);return r}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}}class ke extends Se{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token),r=n.join(``);return this.cleanup&&(r=_(r).replaceAll(this.word_delimiter_token,` `).trim()),r}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class Ae extends Se{constructor(e){super(e),this.decoders=e.decoders.map(e=>Se.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class je extends Se{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,n)=>t.replaceAll(this.suffix,n===e.length-1?``:` `))}}class Me extends Se{decode_chain(e){let t=``;for(let n=1;ne.normalize(`NFKC`)).join(`~`)}else e=e.normalize(`NFKC`);return e}}class Fe extends P{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>P.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n.pre_tokenize(e,t),[e])}}class Ie extends P{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class Le extends P{constructor(e){super()}pre_tokenize_text(e,t){return S(e)}}class Re extends P{constructor(e){super(),this.config=e,this.pattern=m(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let ze=[`bos_token`,`eos_token`,`unk_token`,`sep_token`,`pad_token`,`cls_token`,`mask_token`];function Be(e,t,n,r){for(let i of Object.keys(e)){let o=t-e[i].length,s=n(i),c=Array(o).fill(s);e[i]=r===`right`?(0,a.mergeArrays)(e[i],c):(0,a.mergeArrays)(c,e[i])}}function Ve(e,t){for(let n of Object.keys(e))e[n].length=t}class z extends i.Callable{constructor(t,n){super(),e.defineProperty(this,`return_token_type_ids`,!1),e.defineProperty(this,`padding_side`,`right`),this._tokenizer_config=n,this.normalizer=A.fromConfig(t.normalizer),this.pre_tokenizer=P.fromConfig(t.pre_tokenizer),this.model=O.fromConfig(t.model,n),this.post_processor=_e.fromConfig(t.post_processor),this.decoder=Se.fromConfig(t.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(let e of t.added_tokens){let t=new D(e);this.added_tokens.push(t),this.model.tokens_to_ids.set(t.content,t.id),this.model.vocab[t.id]=t.content,t.special&&(this.special_tokens.push(t.content),this.all_special_ids.push(t.id))}if(this.additional_special_tokens=n.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_splitter=new l.DictionarySplitter(this.added_tokens.map(e=>e.content)),this.added_tokens_map=new Map(this.added_tokens.map(e=>[e.content,e])),this.mask_token=this.getToken(`mask_token`),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken(`pad_token`,`eos_token`),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken(`sep_token`),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken(`unk_token`),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken(`bos_token`),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken(`eos_token`),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=n.model_max_length,this.remove_space=n.remove_space,this.clean_up_tokenization_spaces=n.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=n.do_lowercase_and_remove_accent??!1,n.padding_side&&(this.padding_side=n.padding_side),this.legacy=!1,this.chat_template=n.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this._tokenizer_config[t];if(!e)continue;if(typeof e==`object`){if(e.__type===`AddedToken`)return e.content;throw Error(`Unknown token: ${e}`)}else return e}return null}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let s=await f(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o});return new this(...s)}_call(e,{text_pair:t=null,add_special_tokens:n=!0,padding:r=!1,truncation:i=null,max_length:a=null,return_tensor:o=!0,return_token_type_ids:l=null}={}){let u=Array.isArray(e),d;if(u){if(e.length===0)throw Error(`text array must be non-empty`);if(t!==null){if(Array.isArray(t)){if(e.length!==t.length)throw Error(`text and text_pair must have the same length`)}else throw Error(`text_pair must also be an array`);d=e.map((e,r)=>this._encode_plus(e,{text_pair:t[r],add_special_tokens:n,return_token_type_ids:l}))}else d=e.map(e=>this._encode_plus(e,{add_special_tokens:n,return_token_type_ids:l}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");d=[this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:l})]}if(a===null?a=this.model_max_length:i===null&&(r===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),a=this.model_max_length):r===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),i=!0)),r===!0&&(a=Math.min((0,s.max)(d.map(e=>e.input_ids.length))[0],a??1/0)),a=Math.min(a,this.model_max_length??1/0),r||i)for(let e=0;ea?i&&Ve(d[e],a):r&&Be(d[e],a,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let f={};if(o){if(!(r&&i)&&d.some(e=>{var t;for(let n of Object.keys(e))if(e[n].length!==(t=d[0][n])?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[d.length,d[0].input_ids.length];for(let t of Object.keys(d[0]))f[t]=new c.Tensor(`int64`,BigInt64Array.from(d.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(d[0]))f[e]=d.map(t=>t[e]);if(!u)for(let e of Object.keys(f))f[e]=f[e][0]}return f}_encode_text(e){if(e===null)return null;let t=this.added_tokens_splitter.split(e);for(let e=0;e0&&(t[e-1]=t[e-1].trimEnd()),n.rstrip&&e{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=y(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t}),r=this.model(n);return r});return n}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this._tokenize_helper(e,{pair:t,add_special_tokens:n}),o=this.model.convert_tokens_to_ids(i),s={input_ids:o,attention_mask:Array(o.length).fill(1)};return(r??this.return_token_type_ids)&&a&&(s.token_type_ids=a),s}_tokenize_helper(e,{pair:t=null,add_special_tokens:n=!1}={}){let r=this._encode_text(e),i=this._encode_text(t);return this.post_processor?this.post_processor(r,i,{add_special_tokens:n}):{tokens:(0,a.mergeArrays)(r??[],i??[])}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenize_helper(e,{pair:t,add_special_tokens:n}).tokens}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).input_ids}batch_decode(e,t={}){return e instanceof c.Tensor&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof c.Tensor&&(e=g(e)),!Array.isArray(e)||e.length===0||!(0,a.isIntegralNumber)(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){let r=this.model.convert_ids_to_tokens(e);t&&(r=r.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(r):r.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix,` `),t&&(i=i.trim())),(n??this.clean_up_tokenization_spaces)&&(i=_(i)),i}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,{tools:t=null,documents:n=null,chat_template:r=null,add_generation_prompt:i=!1,tokenize:a=!0,padding:o=!1,truncation:s=!1,max_length:c=null,return_tensor:l=!0,return_dict:d=!1,tokenizer_kwargs:f={},...p}={}){if(r=this.get_chat_template({chat_template:r,tools:t}),typeof r!=`string`)throw Error(`chat_template must be a string, but got ${typeof r}`);let m=this._compiled_template_cache.get(r);m===void 0&&(m=new u.Template(r),this._compiled_template_cache.set(r,m));let h=Object.create(null);for(let e of ze){let t=this.getToken(e);t&&(h[e]=t)}let g=m.render({messages:e,add_generation_prompt:i,tools:t,documents:n,...h,...p});if(a){let e=this._call(g,{add_special_tokens:!1,padding:o,truncation:s,max_length:c,return_tensor:l,...f});return d?e:e.input_ids}return g}}class He extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Ue extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class We extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Ge extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Ke extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class qe extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Je extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Ye extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Xe extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Ze extends z{}class Qe extends z{}class $e extends z{constructor(t,n){super(t,n),e.defineProperty(this,`return_token_type_ids`,!0),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class et extends z{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class tt extends z{}class nt extends z{}class rt extends z{}class it extends z{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return yt(this,e,t,n)}}class at extends it{}class ot extends z{}class st extends z{}let ct=`▁`;class lt extends z{constructor(t,n){super(t,n),e.defineProperty(this,`padding_side`,`left`),this.legacy=n.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new Ne({replacement:ct,add_prefix_space:!0,prepend_scheme:`first`}))}_encode_text(e){if(e===null)return null;if(this.legacy||e.length===0)return super._encode_text(e);let t=super._encode_text(ct+e.replaceAll(ct,` `));return t.length>1&&t[0]===ct&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}}class ut extends z{}class dt extends z{}class ft extends z{}class pt extends z{}class mt extends z{}class ht extends z{}class gt extends z{}class _t extends z{}class vt extends z{}function yt(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(a)])[0],e._call(t,n)}class bt extends z{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return yt(this,e,t,n)}}class xt extends z{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return yt(this,e,t,n)}}class St extends z{get timestamp_begin(){return this.model.convert_tokens_to_ids([`<|notimestamps|>`])[0]+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,o=t===`word`;function c(){return{language:a,timestamp:[null,null],text:``}}let l=[],u=c(),f=0,p=this.timestamp_begin,m=1500,h=p+m,g=[],_=[],v=!1,y=null,b=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=o?n.token_timestamps:null,m=null,x=p;if(`stride`in n){let[t,i,a]=n.stride;if(f-=i,y=t-a,i&&(x=i/r+p),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=p){if(m!==null&&(n-p)*r=p&&y<=h){let e=(y-p)*r+f,t=(0,s.round)(e,2);if(m!==null&&y>=m)v=!0;else if(v||g.length>0&&y0?(g.push(S),o&&_.push(C)):g.every(e=>e.length===0)&&(u=c(),g=[],S=[],_=[],C=[])}if(g.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(g,_),r=this.decode(e);u.text=r,o&&(u.words=this.collateWordTimestamps(e,n,a)),l.push(u)}let x=Object.create(null),S=l.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n]<=t[c][m+n]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=`�`,r=[],i=[],a=[],o=[],s=[],c=0;for(let l=0;l=this.model.tokens_to_ids.get(`<|endoftext|>`),f=c.startsWith(` `),p=c.trim(),m=s.test(p);if(d||f||m||i.length===0)i.push(c),a.push(l),o.push(u);else{let e=i.length-1;i[e]+=c,a[e].push(...l),o[e].push(...u)}}return[i,a,o]}mergePunctuations(e,t,n,r,i){let o=structuredClone(e),s=structuredClone(t),c=structuredClone(n),l=o.length-2,u=o.length-1;for(;l>=0;)o[l].startsWith(` `)&&r.includes(o[l].trim())?(o[u]=o[l]+o[u],s[u]=(0,a.mergeArrays)(s[l],s[u]),c[u]=(0,a.mergeArrays)(c[l],c[u]),o[l]=``,s[l]=[],c[l]=[]):u=l,--l;for(l=0,u=1;ue),s.filter(e=>e.length>0),c.filter(e=>e.length>0)]}}class Ct extends z{}class wt extends z{}class Tt extends z{}class Et extends z{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,a.mergeArrays)([e],super._encode_text(t))}}}class Dt extends z{}class Ot extends z{}class kt extends z{}class At extends z{}class jt extends z{}class Mt extends z{constructor(e,t){super(e,t),this.decoder=new Me({})}}class Nt extends z{}class Pt extends z{}class Ft{static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){var s;let[c,l]=await f(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o}),u=(s=l.tokenizer_class)?.replace(/Fast$/,``)??`PreTrainedTokenizer`,d=this.TOKENIZER_CLASS_MAPPING[u];return d||(console.warn(`Unknown tokenizer class "${u}", attempting to construct from base class.`),d=z),new d(c,l)}}e.defineProperty(Ft,`TOKENIZER_CLASS_MAPPING`,{T5Tokenizer:tt,DistilBertTokenizer:Ze,CamembertTokenizer:Qe,DebertaTokenizer:Ke,DebertaV2Tokenizer:qe,BertTokenizer:He,HerbertTokenizer:Je,ConvBertTokenizer:Ye,RoFormerTokenizer:Xe,XLMTokenizer:$e,ElectraTokenizer:et,MobileBertTokenizer:We,SqueezeBertTokenizer:Ge,AlbertTokenizer:Ue,GPT2Tokenizer:nt,BartTokenizer:rt,MBartTokenizer:it,MBart50Tokenizer:at,RobertaTokenizer:ot,WhisperTokenizer:St,CodeGenTokenizer:Ct,CLIPTokenizer:wt,SiglipTokenizer:Tt,MarianTokenizer:Et,BloomTokenizer:st,NllbTokenizer:bt,M2M100Tokenizer:xt,LlamaTokenizer:lt,CodeLlamaTokenizer:ut,XLMRobertaTokenizer:dt,MPNetTokenizer:ft,FalconTokenizer:pt,GPTNeoXTokenizer:mt,EsmTokenizer:ht,Wav2Vec2CTCTokenizer:Dt,BlenderbotTokenizer:Ot,BlenderbotSmallTokenizer:kt,SpeechT5Tokenizer:At,NougatTokenizer:jt,VitsTokenizer:Mt,Qwen2Tokenizer:gt,GemmaTokenizer:_t,Grok1Tokenizer:vt,CohereTokenizer:Nt,MgpstrTokenizer:Pt,PreTrainedTokenizer:z})},"./src/utils/audio.js":(e,t,n)=>{n.r(t),n.d(t,{RawAudio:()=>O,hamming:()=>f,hanning:()=>d,mel_filter_bank:()=>y,read_audio:()=>l,spectrogram:()=>w,window_function:()=>T});var r=n( +/*! ./hub.js */ +`./src/utils/hub.js`),i=n( +/*! ./maths.js */ +`./src/utils/maths.js`),a=n( +/*! ./core.js */ +`./src/utils/core.js`),o=n( +/*! ../env.js */ +`./src/env.js`),s=n( +/*! fs */ +`?7a2c`),c=n( +/*! ./tensor.js */ +`./src/utils/tensor.js`);async function l(e,t){if(typeof AudioContext>`u`)throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");let n=await(await(0,r.getFile)(e)).arrayBuffer(),i=new AudioContext({sampleRate:t});t===void 0&&console.warn(`No sampling rate provided, using default of ${i.sampleRate}Hz.`);let a=await i.decodeAudioData(n),o;if(a.numberOfChannels===2){let e=Math.sqrt(2),t=a.getChannelData(0),n=a.getChannelData(1);o=new Float32Array(t.length);for(let r=0;r2595*Math.log10(1+e/700),kaldi:e=>1127*Math.log(1+e/700),slaney:(e,t=1e3,n=15,r=27/Math.log(6.4))=>e>=t?n+Math.log(e/t)*r:3*e/200};function m(e,t=`htk`){let n=p[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}let h={htk:e=>700*(10**(e/2595)-1),kaldi:e=>700*(Math.exp(e/1127)-1),slaney:(e,t=1e3,n=15,r=Math.log(6.4)/27)=>e>=n?t*Math.exp(r*(e-n)):200*e/3};function g(e,t=`htk`){let n=h[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}function _(e,t){let n=Float64Array.from({length:t.length-1},(e,n)=>t[n+1]-t[n]),r=Array.from({length:e.length},()=>Array(t.length));for(let n=0;nArray(e.length));for(let t=0;te+r*n)}function y(e,t,n,r,i,a=null,o=`htk`,s=!1){if(a!==null&&a!==`slaney`)throw Error(`norm must be one of null or "slaney"`);if(e<2)throw Error(`Require num_frequency_bins: ${e} >= 2`);if(n>r)throw Error(`Require min_frequency: ${n} <= max_frequency: ${r}`);let c=m(n,o),l=m(r,o),u=v(c,l,t+2),d=g(u,o),f;if(s){let t=i/((e-1)*2);f=m(Float64Array.from({length:e},(e,n)=>n*t),o),d=u}else f=v(0,Math.floor(i/2),e);let p=_(f,d);if(a!==null&&a===`slaney`)for(let n=0;na)throw Error(`frame_length (${n}) may not be larger than fft_length (${a})`);if(E!==n)throw Error(`Length of the window (${E}) must equal frame_length (${n})`);if(r<=0)throw Error(`hop_length must be greater than zero`);if(o===null&&f!==null)throw Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(s){if(l!==`reflect`)throw Error(`pad_mode="${l}" not implemented yet.`);let t=Math.floor((a-1)/2)+1;e=b(e,t,t)}let D=Math.floor(1+Math.floor((e.length-n)/r));y!==null&&DD?w&&(k=x):k=ee=x);let te=new i.FFT(a),ne=new Float64Array(a),re=new Float64Array(te.outputBufferSize),ie=new Float32Array(O*k);for(let i=0;i=1;--e)ne[e]-=d*ne[e-1];ne[0]*=1-d}for(let e=0;ee**.85);break;default:throw Error(`Unknown window type ${t}.`)}if(n&&(o=o.subarray(0,e)),r===null)return o;if(e>r)throw Error(`Length of the window (${e}) may not be larger than frame_length (${r})`);return o}function E(e,t){let n=44,r=new ArrayBuffer(n+e.length*4),i=new DataView(r);D(i,0,`RIFF`),i.setUint32(4,36+e.length*4,!0),D(i,8,`WAVE`),D(i,12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,3,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*4,!0),i.setUint16(32,4,!0),i.setUint16(34,32,!0),D(i,36,`data`),i.setUint32(40,e.length*4,!0);for(let t=0;t{let n=await t.arrayBuffer();s.writeFileSync(e,Buffer.from(n))};else throw Error(`Unable to save because filesystem is disabled in this environment.`);await t(e,this.toBlob())}}},"./src/utils/constants.js":(e,t,n)=>{n.r(t),n.d(t,{CHAT_TEMPLATE_NAME:()=>c,CONFIG_NAME:()=>i,FEATURE_EXTRACTOR_NAME:()=>a,GENERATION_CONFIG_NAME:()=>l,GITHUB_ISSUE_URL:()=>r,IMAGE_PROCESSOR_NAME:()=>o,PROCESSOR_NAME:()=>s});let r=`https://github.com/huggingface/transformers.js/issues/new/choose`,i=`config.json`,a=`preprocessor_config.json`,o=a,s=`processor_config.json`,c=`chat_template.json`,l=`generation_config.json`},"./src/utils/core.js":(e,t,n)=>{n.r(t),n.d(t,{calculateDimensions:()=>l,calculateReflectOffset:()=>p,count:()=>_,dispatchCallback:()=>r,escapeRegExp:()=>a,isIntegralNumber:()=>s,isNullishDimension:()=>c,isTypedArray:()=>o,len:()=>g,mergeArrays:()=>d,pick:()=>h,pop:()=>u,product:()=>f,reverseDictionary:()=>i,saveBlob:()=>m});function r(e,t){e&&e(t)}function i(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[t,e]))}function a(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function o(e){var t;return(e==null||(t=e.prototype)==null||(t=t.__proto__)==null||(t=t.constructor)==null?void 0:t.name)===`TypedArray`}function s(e){return Number.isInteger(e)||typeof e==`bigint`}function c(e){return e==null||e===-1}function l(e){let t=[],n=e;for(;Array.isArray(n);)t.push(n.length),n=n[0];return t}function u(e,t,n=void 0){let r=e[t];if(r!==void 0)return delete e[t],r;if(n===void 0)throw Error(`Key ${t} does not exist in object.`);return n}function d(...e){return Array.prototype.concat.apply([],e)}function f(...e){return e.reduce((e,t)=>e.flatMap(e=>t.map(t=>[e,t])))}function p(e,t){return Math.abs((e+t)%(2*t)-t)}function m(e,t){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),r.remove(),URL.revokeObjectURL(n)}function h(e,t){return Object.assign({},...t.map(t=>{if(e[t]!==void 0)return{[t]:e[t]}}))}function g(e){let t=0;for(let n of e)++t;return t}function _(e,t){let n=0;for(let r of e)r===t&&++n;return n}},"./src/utils/data-structures.js":(e,t,n)=>{n.r(t),n.d(t,{CharTrie:()=>i,DictionarySplitter:()=>c,LRUCache:()=>l,PriorityQueue:()=>r,TokenLattice:()=>o});class r{constructor(e=(e,t)=>e>t,t=1/0){this._heap=[],this._comparator=e,this._maxSize=t}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...e){return this.extend(e)}extend(e){for(let t of e)if(this.size0&&this._swap(0,t),this._heap.pop(),this._siftDown(),e}replace(e){let t=this.peek();return this._heap[0]=e,this._siftDown(),t}_parent(e){return(e+1>>>1)-1}_left(e){return(e<<1)+1}_right(e){return e+1<<1}_greater(e,t){return this._comparator(this._heap[e],this._heap[t])}_swap(e,t){let n=this._heap[e];this._heap[e]=this._heap[t],this._heap[t]=n}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(e){for(;e>0&&this._greater(e,this._parent(e));)this._swap(e,this._parent(e)),e=this._parent(e)}_siftDown(){let e=0;for(;this._left(e)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);let r=new s(this.bosTokenId,0,0,0,0),i=new s(this.eosTokenId,1,this.len,0,0);this.nodes.push(r.clone()),this.nodes.push(i.clone()),this.beginNodes[this.len].push(i),this.endNodes[0].push(r)}insert(e,t,n,r){let i=this.nodes.length,a=new s(r,i,e,t,n);this.beginNodes[e].push(a),this.endNodes[e+t].push(a),this.nodes.push(a)}viterbi(){let e=this.len,t=0;for(;t<=e;){if(this.beginNodes[t].length==0)return[];for(let e of this.beginNodes[t]){e.prev=null;let n=0,r=null;for(let i of this.endNodes[t]){let t=i.backtraceScore+e.score;(r===null||t>n)&&(r=i.clone(),n=t)}if(r!==null)e.prev=r,e.backtraceScore=n;else return[]}++t}let n=[],r=this.beginNodes[e][0],i=r.prev;if(i===null)return[];let a=i.clone();for(;a.prev!==null;){n.push(a.clone());let e=a.clone();a=e.prev.clone()}return n.reverse(),n}piece(e){return this.chars.slice(e.pos,e.pos+e.length).join(``)}tokens(){let e=this.viterbi();return e.map(e=>this.piece(e))}tokenIds(){let e=this.viterbi();return e.map(e=>e.tokenId)}}class s{constructor(e,t,n,r,i){this.tokenId=e,this.nodeId=t,this.pos=n,this.length=r,this.score=i,this.prev=null,this.backtraceScore=0}clone(){let e=new s(this.tokenId,this.nodeId,this.pos,this.length,this.score);return e.prev=this.prev,e.backtraceScore=this.backtraceScore,e}}class c{constructor(e){this.trie=this._buildTrie(e)}_buildTrie(e){let t=Object.create(null);for(let i of e){var n,r;let e=t;for(let t=0;tr&&t.push(e.slice(r,i)),t.push(o),i+=o.length,r=i):++i}return rthis.capacity&&this.cache.delete(this.cache.keys().next().value)}clear(){this.cache.clear()}}},"./src/utils/devices.js":(e,t,n)=>{n.r(t),n.d(t,{DEVICE_TYPES:()=>r});let r=Object.freeze({auto:`auto`,gpu:`gpu`,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,webnn:`webnn`,"webnn-npu":`webnn-npu`,"webnn-gpu":`webnn-gpu`,"webnn-cpu":`webnn-cpu`})},"./src/utils/dtypes.js":(e,t,n)=>{n.r(t),n.d(t,{DATA_TYPES:()=>o,DEFAULT_DEVICE_DTYPE_MAPPING:()=>s,DEFAULT_DTYPE_SUFFIX_MAPPING:()=>c,isWebGpuFp16Supported:()=>a});var r=n( +/*! ../env.js */ +`./src/env.js`),i=n( +/*! ./devices.js */ +`./src/utils/devices.js`);let a=function(){let e;return async function(){if(e===void 0)if(!r.apis.IS_WEBGPU_AVAILABLE)e=!1;else try{let t=await navigator.gpu.requestAdapter();e=t.features.has(`shader-f16`)}catch{e=!1}return e}}(),o=Object.freeze({auto:`auto`,fp32:`fp32`,fp16:`fp16`,q8:`q8`,int8:`int8`,uint8:`uint8`,q4:`q4`,bnb4:`bnb4`,q4f16:`q4f16`}),s=Object.freeze({[i.DEVICE_TYPES.wasm]:o.q8}),c=Object.freeze({[o.fp32]:``,[o.fp16]:`_fp16`,[o.int8]:`_int8`,[o.uint8]:`_uint8`,[o.q8]:`_quantized`,[o.q4]:`_q4`,[o.q4f16]:`_q4f16`,[o.bnb4]:`_bnb4`})},"./src/utils/generic.js":(e,t,n)=>{n.r(t),n.d(t,{Callable:()=>r});let r=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}_call(...e){throw Error(`Must implement _call method in subclass`)}}},"./src/utils/hub.js":(e,t,n)=>{n.r(t),n.d(t,{MAX_EXTERNAL_DATA_CHUNKS:()=>s,getFile:()=>p,getModelFile:()=>v,getModelJSON:()=>y});var r=n( +/*! fs */ +`?7a2c`),i=n( +/*! path */ +`?a42a`),a=n( +/*! ../env.js */ +`./src/env.js`),o=n( +/*! ./core.js */ +`./src/utils/core.js`);let s=100,c={txt:`text/plain`,html:`text/html`,css:`text/css`,js:`text/javascript`,json:`application/json`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`};class l{constructor(e){if(this.filePath=e,this.headers=new Headers,this.exists=r.existsSync(e),this.exists){this.status=200,this.statusText=`OK`;let t=r.statSync(e);this.headers.set(`content-length`,t.size.toString()),this.updateContentType();let n=r.createReadStream(e);this.body=new ReadableStream({start(e){n.on(`data`,t=>e.enqueue(t)),n.on(`end`,()=>e.close()),n.on(`error`,t=>e.error(t))},cancel(){n.destroy()}})}else this.status=404,this.statusText=`Not Found`,this.body=null}updateContentType(){let e=this.filePath.toString().split(`.`).pop().toLowerCase();this.headers.set(`content-type`,c[e]??`application/octet-stream`)}clone(){let e=new l(this.filePath);return e.exists=this.exists,e.status=this.status,e.statusText=this.statusText,e.headers=new Headers(this.headers),e}async arrayBuffer(){let e=await r.promises.readFile(this.filePath);return e.buffer}async blob(){let e=await r.promises.readFile(this.filePath);return new Blob([e],{type:this.headers.get(`content-type`)})}async text(){let e=await r.promises.readFile(this.filePath,`utf8`);return e}async json(){return JSON.parse(await this.text())}}function u(e,t=null,n=null){let r;try{r=new URL(e)}catch{return!1}return!(t&&!t.includes(r.protocol)||n&&!n.includes(r.hostname))}let d=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function f(e){return!(!d.test(e)||e.includes(`..`)||e.includes(`--`)||e.endsWith(`.git`)||e.endsWith(`.ipynb`))}async function p(e){var t;if(a.env.useFS&&!u(e,[`http:`,`https:`,`blob:`]))return new l(e instanceof URL?e.protocol===`file:`?e.pathname:e.toString():e);if(typeof process<`u`&&((t=process)==null||(t=t.release)==null?void 0:t.name)===`node`){var n;let t=!!(n={})?.TESTING_REMOTELY,o=a.env.version,s=new Headers;s.set(`User-Agent`,`transformers.js/${o}; is_ci/${t};`);let c=u(e,[`http:`,`https:`],[`huggingface.co`,`hf.co`]);if(c){var r,i;let e=(r={})?.HF_TOKEN??(i={})?.HF_ACCESS_TOKEN;e&&s.set(`Authorization`,`Bearer ${e}`)}return fetch(e,{headers:s})}else return fetch(e)}let m={400:`Bad request error occurred while trying to load file`,401:`Unauthorized access to file`,403:`Forbidden access to file`,404:`Could not locate file`,408:`Request timeout error occurred while trying to load file`,500:`Internal server error error occurred while trying to load file`,502:`Bad gateway error occurred while trying to load file`,503:`Service unavailable error occurred while trying to load file`,504:`Gateway timeout error occurred while trying to load file`};function h(e,t,n){if(!n)return null;let r=m[e]??`Error (${e}) occurred while trying to load file`;throw Error(`${r}: "${t}".`)}class g{constructor(e){this.path=e}async match(e){let t=i.join(this.path,e),n=new l(t);if(n.exists)return n}async put(e,t,n=void 0){let a=i.join(this.path,e);try{let e=t.headers.get(`Content-Length`),o=parseInt(e??`0`),s=0;await r.promises.mkdir(i.dirname(a),{recursive:!0});let c=r.createWriteStream(a),l=t.body.getReader();for(;;){let{done:e,value:t}=await l.read();if(e)break;await new Promise((e,n)=>{c.write(t,t=>{if(t){n(t);return}e()})}),s+=t.length;let r=o?s/o*100:0;n?.({progress:r,loaded:s,total:o})}c.close()}catch(e){try{await r.promises.unlink(a)}catch{}throw e}}}async function _(e,...t){for(let n of t)try{let t=await e.match(n);if(t)return t}catch{continue}}async function v(e,t,n=!0,r={},i=!1){if(!a.env.allowLocalModels){if(r.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!a.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}(0,o.dispatchCallback)(r.progress_callback,{status:`initiate`,name:e,file:t});let s;if(!s&&a.env.useCustomCache){if(!a.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!a.env.customCache.match||!a.env.customCache.put)throw Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");s=a.env.customCache}if(!s&&a.env.useBrowserCache){if(typeof caches>`u`)throw Error(`Browser cache is not available in this environment.`);try{s=await caches.open(`transformers-cache`)}catch(e){console.warn(`An error occurred while opening the browser cache:`,e)}}if(!s&&a.env.useFSCache){if(!a.apis.IS_FS_AVAILABLE)throw Error(`File System Cache is not available in this environment.`);s=new g(r.cache_dir??a.env.cacheDir)}let c=r.revision??`main`,d=x(e,t),m=f(e),v=m?x(a.env.localModelPath,d):d,y=x(a.env.remoteHost,a.env.remotePathTemplate.replaceAll(`{model}`,e).replaceAll(`{revision}`,encodeURIComponent(c)),t),S,C=s instanceof g?c===`main`?d:x(e,c,t):y,w=!1,T;s&&(T=await _(s,v,C));let E=T!==void 0;if(T===void 0){if(a.env.allowLocalModels){let e=u(d,[`http:`,`https:`]);if(e){if(r.local_files_only)throw Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${d}.`);if(!a.env.allowRemoteModels)throw Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${d}.`)}else try{T=await p(v),S=v}catch(e){console.warn(`Unable to load from local path "${v}": "${e}"`)}}if(T===void 0||T.status===404){if(r.local_files_only||!a.env.allowRemoteModels){if(n)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${v}".`);return null}if(!m)throw Error(`Local file missing at "${v}" and download aborted due to invalid model ID "${e}".`);if(T=await p(y),T.status!==200)return h(T.status,y,n);S=C}w=s&&typeof Response<`u`&&T instanceof Response&&T.status===200}(0,o.dispatchCallback)(r.progress_callback,{status:`download`,name:e,file:t});let D;if(!(a.apis.IS_NODE_ENV&&i)){let n;r.progress_callback?E&&typeof navigator<`u`&&/firefox/i.test(navigator.userAgent)?(n=new Uint8Array(await T.arrayBuffer()),(0,o.dispatchCallback)(r.progress_callback,{status:`progress`,name:e,file:t,progress:100,loaded:n.length,total:n.length})):n=await b(T,n=>{(0,o.dispatchCallback)(r.progress_callback,{status:`progress`,name:e,file:t,...n})}):n=new Uint8Array(await T.arrayBuffer()),D=n}if(w&&S&&await s.match(S)===void 0&&(D?await s.put(S,new Response(D,{headers:T.headers})).catch(e=>{console.warn(`Unable to add response to browser cache: ${e}.`)}):await s.put(S,T,r.progress_callback)),(0,o.dispatchCallback)(r.progress_callback,{status:`done`,name:e,file:t}),D){if(!a.apis.IS_NODE_ENV&&i)throw Error(`Cannot return path in a browser environment.`);return D}if(T instanceof l)return T.filePath;let O=await s?.match(S);if(O instanceof l)return O.filePath;if(O instanceof Response)return new Uint8Array(await O.arrayBuffer());if(typeof O==`string`)return O;throw Error(`Unable to get model file path or buffer.`)}async function y(e,t,n=!0,r={}){let i=await v(e,t,n,r,!1);if(i===null)return{};let a=new TextDecoder(`utf-8`),o=a.decode(i);return JSON.parse(o)}async function b(e,t){let n=e.headers.get(`Content-Length`);n===null&&console.warn(`Unable to determine content-length from response headers. Will expand buffer when needed.`);let r=parseInt(n??`0`),i=new Uint8Array(r),a=0,o=e.body.getReader();async function s(){let{done:e,value:n}=await o.read();if(e)return;let c=a+n.length;if(c>r){r=c;let e=new Uint8Array(r);e.set(i),i=e}i.set(n,a),a=c;let l=a/r*100;return t({progress:l,loaded:a,total:r}),s()}return await s(),i}function x(...e){return e=e.map((t,n)=>(n&&(t=t.replace(RegExp(`^/`),``)),n!==e.length-1&&(t=t.replace(RegExp(`/$`),``)),t)),e.join(`/`)}},"./src/utils/image.js":(e,t,n)=>{n.r(t),n.d(t,{RawImage:()=>m,load_image:()=>h});var r=n( +/*! ./core.js */ +`./src/utils/core.js`),i=n( +/*! ./hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../env.js */ +`./src/env.js`),o=n( +/*! ./tensor.js */ +`./src/utils/tensor.js`),s=n( +/*! sharp */ +`?2b25`);let c,l,u,d=a.apis.IS_BROWSER_ENV||a.apis.IS_WEBWORKER_ENV;if(d)c=(e,t)=>{if(!self.OffscreenCanvas)throw Error(`OffscreenCanvas not supported by this browser.`);return new self.OffscreenCanvas(e,t)},u=self.createImageBitmap,l=self.ImageData;else if(s)u=async e=>{let t=await e.metadata(),n=t.channels,{data:r,info:i}=await e.rotate().raw().toBuffer({resolveWithObject:!0}),a=new m(new Uint8ClampedArray(r),i.width,i.height,i.channels);return n!==void 0&&n!==i.channels&&a.convert(n),a};else throw Error(`Unable to load image processing library.`);let f={0:`nearest`,1:`lanczos`,2:`bilinear`,3:`bicubic`,4:`box`,5:`hamming`},p=new Map([[`png`,`image/png`],[`jpg`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`gif`,`image/gif`]]);class m{constructor(e,t,n,r){this.data=e,this.width=t,this.height=n,this.channels=r}get size(){return[this.width,this.height]}static async read(e){if(e instanceof m)return e;if(typeof e==`string`||e instanceof URL)return await this.fromURL(e);if(e instanceof Blob)return await this.fromBlob(e);if(typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas)return this.fromCanvas(e);throw Error(`Unsupported input type: ${typeof e}`)}static fromCanvas(e){if(!d)throw Error(`fromCanvas() is only supported in browser environments.`);let t=e.getContext(`2d`),n=t.getImageData(0,0,e.width,e.height).data;return new m(n,e.width,e.height,4)}static async fromURL(e){let t=await(0,i.getFile)(e);if(t.status!==200)throw Error(`Unable to read image from "${e}" (${t.status} ${t.statusText})`);let n=await t.blob();return this.fromBlob(n)}static async fromBlob(e){if(d){let t=await u(e),n=c(t.width,t.height).getContext(`2d`);return n.drawImage(t,0,0),new this(n.getImageData(0,0,t.width,t.height).data,t.width,t.height,4)}else{let t=s(await e.arrayBuffer());return await u(t)}}static fromTensor(e,t=`CHW`){if(e.dims.length!==3)throw Error(`Tensor should have 3 dimensions, but has ${e.dims.length} dimensions.`);if(t===`CHW`)e=e.transpose(1,2,0);else if(t!==`HWC`)throw Error(`Unsupported channel format: ${t}`);if(!(e.data instanceof Uint8ClampedArray||e.data instanceof Uint8Array))throw Error(`Unsupported tensor type: ${e.type}`);switch(e.dims[2]){case 1:case 2:case 3:case 4:return new m(e.data,e.dims[1],e.dims[0],e.dims[2]);default:throw Error(`Unsupported number of channels: ${e.dims[2]}`)}}grayscale(){if(this.channels===1)return this;let e=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let t=0,n=0;t=0?s=n:u=-n,r>=0?l=r:d=-r,o.drawImage(a,s,l,e,t,u,d,e,t);let f=new m(o.getImageData(0,0,e,t).data,e,t,4);return f.convert(i)}else{let i=this.toSharp();if(n>=0&&r>=0)i=i.extract({left:Math.floor(n),top:Math.floor(r),width:e,height:t});else if(n<=0&&r<=0){let a=Math.floor(-r),o=Math.floor(-n);i=i.extend({top:a,left:o,right:e-this.width-o,bottom:t-this.height-a})}else{let a=[0,0],o=0;r<0?(a[0]=Math.floor(-r),a[1]=t-this.height-a[0]):o=Math.floor(r);let s=[0,0],c=0;n<0?(s[0]=Math.floor(-n),s[1]=e-this.width-s[0]):c=Math.floor(n),i=i.extend({top:a[0],bottom:a[1],left:s[0],right:s[1]}).extract({left:c,top:o,width:e,height:t})}return await u(i)}}async toBlob(e=`image/png`,t=1){if(!d)throw Error(`toBlob() is only supported in browser environments.`);let n=this.toCanvas();return await n.convertToBlob({type:e,quality:t})}toTensor(e=`CHW`){let t=new o.Tensor(`uint8`,new Uint8Array(this.data),[this.height,this.width,this.channels]);if(e!==`HWC`)if(e===`CHW`)t=t.permute(2,0,1);else throw Error(`Unsupported channel format: ${e}`);return t}toCanvas(){if(!d)throw Error(`toCanvas() is only supported in browser environments.`);let e=this.clone().rgba(),t=c(e.width,e.height),n=new l(e.data,e.width,e.height);return t.getContext(`2d`).putImageData(n,0,0),t}split(){let{data:e,width:t,height:n,channels:r}=this,i=e.constructor,a=e.length/r,o=Array.from({length:r},()=>new i(a));for(let t=0;tnew m(e,t,n,1))}_update(e,t,n,r=null){return this.data=e,this.width=t,this.height=n,r!==null&&(this.channels=r),this}clone(){return new m(this.data.slice(),this.width,this.height,this.channels)}convert(e){if(this.channels===e)return this;switch(e){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(e){if(d){if(a.apis.IS_WEBWORKER_ENV)throw Error(`Unable to save an image from a Web Worker.`);let t=e.split(`.`).pop().toLowerCase(),n=p.get(t)??`image/png`,i=await this.toBlob(n);(0,r.saveBlob)(e,i)}else if(a.apis.IS_FS_AVAILABLE){let t=this.toSharp();return await t.toFile(e)}else throw Error(`Unable to save the image because filesystem is disabled in this environment.`)}toSharp(){if(d)throw Error(`toSharp() is only supported in server-side environments.`);return s(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}let h=m.read.bind(m)},"./src/utils/maths.js":(e,t,n)=>{n.r(t),n.d(t,{FFT:()=>h,bankers_round:()=>v,cos_sim:()=>c,dot:()=>s,dynamic_time_warping:()=>y,interpolate_data:()=>r,log_softmax:()=>o,magnitude:()=>l,max:()=>d,medianFilter:()=>g,min:()=>u,permute_data:()=>i,round:()=>_,softmax:()=>a});function r(e,[t,n,r],[i,a],o=`bilinear`,s=!1){let c=a/r,l=i/n,u=new e.constructor(i*a*t),d=n*r,f=i*a;for(let o=0;o=0;--e)i[e]=a,r[e]=t[n[e]],a*=r[e];let a=n.map((e,t)=>i[n.indexOf(t)]),o=new e.constructor(e.length);for(let n=0;n=0;--e)r+=i%t[e]*a[e],i=Math.floor(i/t[e]);o[r]=e[n]}return[o,r]}function a(e){let t=d(e)[0],n=e.map(e=>Math.exp(e-t)),r=n.reduce((e,t)=>e+t,0),i=n.map(e=>e/r);return i}function o(e){let t=d(e)[0],n=0;for(let r=0;re-t-r);return i}function s(e,t){let n=0;for(let r=0;re+t*t,0))}function u(e){if(e.length===0)throw Error(`Array must not be empty`);let t=e[0],n=0;for(let r=1;rt&&(t=e[r],n=r);return[t,n]}function f(e){return e>0&&(e&e-1)==0}class p{constructor(e){if(this.size=e|0,this.size<=1||!f(this.size))throw Error(`FFT size must be a power of two larger than 1`);this._csize=e<<1,this.table=new Float64Array(this.size*2);for(let e=0;ee;e<<=1)++t;this._width=t%2==0?t-1:t,this._bitrev=new Int32Array(1<>>t&3)<>>1);for(let t=0;t>>1]=e[t];return n}toComplexArray(e,t){let n=t||this.createComplexArray();for(let t=0;t>>1],n[t+1]=0;return n}transform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,1)}realTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._realTransform4(e,t,1)}inverseTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,-1);for(let t=0;t>=2;a>=2;a>>=2){o=r/a<<1;let t=o>>>2;for(s=0;s>>1,a>>>1)}else for(s=0,c=0;s>>1,a>>>1,n)}let u=this.table;for(a>>=2;a>=2;a>>=2){o=r/a<<1;let t=o>>>1,i=t>>>1,c=i>>>1;for(s=0;s>>1;for(let t=2;t>1;++t){let n=(t+1-e)**2/2,r=Math.sqrt(s**2+c**2)**n,o=n*Math.atan2(c,s),l=2*t;i[l]=r*Math.cos(o),i[l+1]=r*Math.sin(o),a[l]=i[l],a[l+1]=-i[l+1]}this._slicedChirpBuffer=i.subarray(t,n),this._f=new p(r>>1),this._f.transform(this._chirpBuffer,a)}_transform(e,t,n){let r=this._buffer1,i=this._buffer2,a=this._outBuffer1,o=this._outBuffer2,s=this._chirpBuffer,c=this._slicedChirpBuffer,l=this._a;if(n)for(let e=0;e>1,a=t[i];r[e]=a*c[e],r[n]=a*c[n]}else for(let e=0;e=e.length&&(i=2*(e.length-1)-i),r[a++]=e[i]}r.sort(),n[t]=r[i]}return n}function _(e,t){let n=10**t;return Math.round(e*n)/n}function v(e){let t=Math.round(e),n=Math.abs(e)%1==.5?t%2==0?t:t-1:t;return n}function y(e){let t=e.length,n=e[0].length,r=[t+1,n+1],i=Array.from({length:r[0]},()=>Array(r[1]).fill(1/0));i[0][0]=0;let a=Array.from({length:r[0]},()=>Array(r[1]).fill(-1));for(let t=1;t0||s>0;)switch(c.push(o-1),l.push(s-1),a[o][s]){case 0:--o,--s;break;case 1:--o;break;case 2:--s;break;default:throw Error(`Internal error in dynamic time warping. Unexpected trace[${o}, ${s}]. Please file a bug report.`)}return c.reverse(),l.reverse(),[c,l]}},"./src/utils/tensor.js":(t,n,r)=>{let i;r.r(n),r.d(n,{DataTypeMap:()=>c,Tensor:()=>l,cat:()=>w,full:()=>te,full_like:()=>ne,interpolate:()=>f,interpolate_4d:()=>p,layer_norm:()=>b,matmul:()=>m,mean:()=>O,mean_pooling:()=>y,ones:()=>re,ones_like:()=>ie,permute:()=>d,quantize_embeddings:()=>se,rand:()=>oe,rfft:()=>h,slice:()=>v,stack:()=>T,std_mean:()=>D,topk:()=>g,zeros:()=>A,zeros_like:()=>ae});var a=r( +/*! ./maths.js */ +`./src/utils/maths.js`),o=r( +/*! ../backends/onnx.js */ +`./src/backends/onnx.js`),s=r( +/*! ../ops/registry.js */ +`./src/ops/registry.js`);let c=Object.freeze({float32:Float32Array,float16:typeof Float16Array<`u`?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array});i=Symbol.iterator;class l{get dims(){return this.ort_tensor.dims}set dims(e){this.ort_tensor.dims=e}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}constructor(...t){return e.defineProperty(this,`ort_tensor`,void 0),(0,o.isONNXTensor)(t[0])?this.ort_tensor=t[0]:this.ort_tensor=new o.Tensor(t[0],t[1],t[2]),new Proxy(this,{get:(e,t)=>{if(typeof t==`string`){let n=Number(t);if(Number.isInteger(n))return e._getitem(n)}return e[t]},set:(e,t,n)=>e[t]=n})}dispose(){this.ort_tensor.dispose()}*[i](){let[e,...t]=this.dims;if(t.length>0){let n=t.reduce((e,t)=>e*t);for(let r=0;r0){let t=n.reduce((e,t)=>e*t);return this._subarray(e,t,n)}else return new l(this.type,[this.data[e]],n)}indexOf(e){let t=this.data;for(let n=0;na)throw Error(`Invalid slice: ${i}`);let o=[Math.max(e,0),Math.min(a,this.dims[r])];n.push(o),t.push(o[1]-o[0])}else throw Error(`Invalid slice: ${i}`)}let r=n.map(([e,t])=>t-e),i=r.reduce((e,t)=>e*t),a=this.data,o=new a.constructor(i),s=this.stride();for(let e=0;e=0;--i){let e=r[i];t+=(a%e+n[i][0])*s[i],a=Math.floor(a/e)}o[e]=a[t]}return new l(this.type,o,t)}permute(...e){return d(this,e)}transpose(...e){return this.permute(...e)}sum(e=null,t=!1){return this.norm(1,e,t)}norm(e=`fro`,t=null,n=!1){if(e===`fro`)e=2;else if(typeof e==`string`)throw Error(`Unsupported norm: ${e}`);let r=this.data,i=(t,n)=>t+n**e;if(t===null){let t=r.reduce(i,0)**(1/e);return new l(this.type,[t],[])}let[a,o,s]=E(i,this,t,n);if(e!==1)for(let t=0;t=0;--r){let e=this.dims[r];if(r!==t){let t=i%e;n+=t*a,a*=this.dims[r]}i=Math.floor(i/e)}r[e]/=i[n]}return this}normalize(e=2,t=1){return this.clone().normalize_(e,t)}stride(){return ee(this.dims)}squeeze(e=null){return new l(this.type,this.data,x(this.dims,e))}squeeze_(e=null){return this.dims=x(this.dims,e),this}unsqueeze(e=null){return new l(this.type,this.data,S(this.dims,e))}unsqueeze_(e=null){return this.dims=S(this.dims,e),this}flatten_(e=0,t=-1){t=(t+this.dims.length)%this.dims.length;let n=this.dims.slice(0,e),r=this.dims.slice(e,t+1),i=this.dims.slice(t+1);return this.dims=[...n,r.reduce((e,t)=>e*t,1),...i],this}flatten(e=0,t=-1){return this.clone().flatten_(e,t)}view(...e){let t=-1;for(let n=0;nr===t?e:e*n,1);e[t]=n.length/r}return new l(this.type,n,e)}neg_(){let e=this.data;for(let t=0;te?1:0;return new l(`bool`,t,this.dims)}lt(e){let t=new Uint8Array(this.data.length),n=this.data;for(let r=0;rMath.min(e,t),this,e,t,1/0);return new l(n,r,i)}max(e=null,t=!1){if(e===null){let e=(0,a.max)(this.data)[0];return new l(this.type,[e],[])}let[n,r,i]=E((e,t)=>Math.max(e,t),this,e,t,-1/0);return new l(n,r,i)}argmin(e=null,t=!1){if(e!==null)throw Error("`dim !== null` not yet implemented.");let n=(0,a.min)(this.data)[1];return new l(`int64`,[BigInt(n)],[])}argmax(e=null,t=!1){if(e!==null)throw Error("`dim !== null` not yet implemented.");let n=(0,a.max)(this.data)[1];return new l(`int64`,[BigInt(n)],[])}to(e){if(this.type===e)return this;if(!c.hasOwnProperty(e))throw Error(`Unsupported type: ${e}`);let t,n=[`int64`,`uint64`].includes(this.type),r=[`int64`,`uint64`].includes(e);return n&&!r?t=Number:!n&&r&&(t=BigInt),new l(e,c[e].from(this.data,t),this.dims)}}function u(e,t){let n=e.length,r=t.reduce((e,t)=>e*t);if(n!==r)throw Error(`cannot reshape array of size ${n} into shape (${t})`);let i=e;for(let e=t.length-1;e>=0;e--)i=i.reduce((n,r)=>{let i=n[n.length-1];return i.lengthnew l(`int64`,e,[e.length]);async function v(e,t,n,r,i){let a=await s.TensorOpRegistry.slice;return await a({x:e,s:_(t),e:_(n),a:_(r),t:_(i??Array(r.length).fill(1))})}function y(e,t){let n=e.data,r=t.data,i=[e.dims[0],e.dims[2]],a=new n.constructor(i[0]*i[1]),[o,s,c]=e.dims,u=0;for(let e=0;ee!==1):typeof t==`number`?e[t]===1&&e.splice(t,1):Array.isArray(t)&&(e=e.filter((e,n)=>e!==1||!t.includes(n))),e}function S(e,t){return t=C(t,e.length+1),e=e.slice(),e.splice(t,0,1),e}function C(e,t,n=null,r=!0){if(e<-t||e>=t){if(r)throw Error(`IndexError: index ${e} is out of bounds for dimension${n===null?``:` `+n} with size ${t}`);return e<-t?0:t}return e<0&&(e=(e%t+t)%t),e}function w(e,t=0){t=C(t,e[0].dims.length);let n=e[0].dims.slice();n[t]=e.reduce((e,n)=>e+n.dims[t],0);let r=n.reduce((e,t)=>e*t,1),i=new e[0].data.constructor(r),a=e[0].type;if(t===0){let t=0;for(let n of e){let e=n.data;i.set(e,t),t+=e.length}}else{let r=0;for(let a=0;a=0;--i){let e=s[i],l=o%e;i===t&&(l+=r),a+=l*c,c*=n[i],o=Math.floor(o/e)}i[a]=o[e]}r+=s[t]}}return new l(a,i,n)}function T(e,t=0){return w(e.map(e=>e.unsqueeze(t)),t)}function E(e,t,n=null,r=!1,i=null){let a=t.data,o=t.dims;n=C(n,o.length);let s=o.slice();s[n]=1;let c=new a.constructor(a.length/o[n]);i!==null&&c.fill(i);for(let t=0;t=0;--e){let t=o[e];if(e!==n){let n=i%t;r+=n*a,a*=s[e]}i=Math.floor(i/t)}c[r]=e(c[r],a[t],t,r)}return r||s.splice(n,1),[t.type,c,s]}function D(e,t=null,n=1,r=!1){let i=e.data,a=e.dims;if(t===null){let t=i.reduce((e,t)=>e+t,0),r=t/i.length,a=Math.sqrt(i.reduce((e,t)=>e+(t-r)**2,0)/(i.length-n)),o=new l(e.type,[r],[]),s=new l(e.type,[a],[]);return[s,o]}t=C(t,a.length);let o=O(e,t,r),s=o.data,[c,u,d]=E((e,t,n,r)=>e+(t-s[r])**2,e,t,r);for(let e=0;ee+t,0);return new l(e.type,[t/i.length],[])}t=C(t,r.length);let[a,o,s]=E((e,t)=>e+t,e,t,n);if(r[t]!==1)for(let e=0;e=0;--n)t[n]=r,r*=e[n];return t}function k(e,t,n,r){let i=e.reduce((e,t)=>e*t,1);return new l(n,new r(i).fill(t),e)}function te(e,t){let n,r;if(typeof t==`number`)n=`float32`,r=Float32Array;else if(typeof t==`bigint`)n=`int64`,r=BigInt64Array;else if(typeof t==`boolean`)n=`bool`,r=Uint8Array;else throw Error(`Unsupported data type: ${typeof t}`);return k(e,t,n,r)}function ne(e,t){return te(e.dims,t)}function re(e){return k(e,1n,`int64`,BigInt64Array)}function ie(e){return re(e.dims)}function A(e){return k(e,0n,`int64`,BigInt64Array)}function ae(e){return A(e.dims)}function oe(e){let t=e.reduce((e,t)=>e*t,1);return new l(`float32`,Float32Array.from({length:t},()=>Math.random()),e)}function se(e,t){if(e.dims.length!==2)throw Error(`The tensor must have 2 dimensions`);if(e.dims.at(-1)%8!=0)throw Error(`The last dimension of the tensor must be a multiple of 8`);if(![`binary`,`ubinary`].includes(t))throw Error(`The precision must be either 'binary' or 'ubinary'`);let n=t===`binary`,r=n?`int8`:`uint8`,i=n?Int8Array:Uint8Array,a=e.data,o=new i(a.length/8);for(let e=0;e0?1:0,r=Math.floor(e/8),i=e%8;o[r]|=t<<7-i,n&&i===0&&(o[r]-=128)}return new l(r,o,[e.dims[0],e.dims[1]/8])}},"./src/utils/video.js":(e,t,n)=>{n.r(t),n.d(t,{RawVideo:()=>o,RawVideoFrame:()=>a,load_video:()=>s});var r=n( +/*! ./image.js */ +`./src/utils/image.js`),i=n( +/*! ../env.js */ +`./src/env.js`);class a{constructor(e,t){this.image=e,this.timestamp=t}}class o{constructor(e,t){e.length>0&&e[0]instanceof r.RawImage&&(e=e.map((n,r)=>new a(n,(r+1)/(e.length+1)*t))),this.frames=e,this.duration=t}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function s(e,{num_frames:t=null,fps:n=null}={}){if(!i.apis.IS_BROWSER_ENV)throw Error("`load_video` is currently only supported in browser environments.");if(t==null&&n==null)throw Error(`Either num_frames or fps must be provided.`);let s=[],c=document.createElement(`video`);if(c.crossOrigin=`anonymous`,c.muted=!0,typeof e==`string`)c.src=e;else if(e instanceof Blob)c.src=URL.createObjectURL(e);else if(e instanceof HTMLVideoElement)c.src=e.src;else throw Error(`Invalid URL or video element provided.`);if(await new Promise(e=>c.onloadedmetadata=e),c.seekable.start(0)===c.seekable.end(0)){let e=await fetch(c.src),t=await e.blob();c.src=URL.createObjectURL(t),await new Promise(e=>c.onloadedmetadata=e)}let l=c.duration,u,d;t==null?(d=1/n,u=Math.floor(l/d)):(u=t,d=t===1?0:l/(t-1));let f=[];for(let e=0;e{c.onseeked=e}),m.drawImage(c,0,0,p.width,p.height);let t=m.getImageData(0,0,p.width,p.height),n=new r.RawImage(t.data,p.width,p.height,4),i=new a(n,e);s.push(i)}return c.remove(),new o(s,l)}}},wf={};function Tf(e){var t=wf[e];if(t!==void 0)return t.exports;var n=wf[e]={exports:{}};return Cf[e](n,n.exports,Tf),n.exports}(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t;Tf.t=function(n,r){if(r&1&&(n=this(n)),r&8||typeof n==`object`&&n&&(r&4&&n.__esModule||r&16&&typeof n.then==`function`))return n;var i=Object.create(null);Tf.r(i);var a={};t||=[null,e({}),e([]),e(e)];for(var o=r&2&&n;typeof o==`object`&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,Tf.d(i,a),i}})(),Tf.d=(exports,t)=>{for(var n in t)Tf.o(t,n)&&!Tf.o(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:t[n]})},Tf.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Tf.r=exports=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(exports,`__esModule`,{value:!0})};var $={};(()=>{Tf.r($),Tf.d($,{ASTFeatureExtractor:()=>d.ASTFeatureExtractor,ASTForAudioClassification:()=>n.ASTForAudioClassification,ASTModel:()=>n.ASTModel,ASTPreTrainedModel:()=>n.ASTPreTrainedModel,AlbertForMaskedLM:()=>n.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>n.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>n.AlbertForSequenceClassification,AlbertModel:()=>n.AlbertModel,AlbertPreTrainedModel:()=>n.AlbertPreTrainedModel,AlbertTokenizer:()=>r.AlbertTokenizer,AudioClassificationPipeline:()=>t.AudioClassificationPipeline,AutoConfig:()=>i.AutoConfig,AutoFeatureExtractor:()=>f.AutoFeatureExtractor,AutoImageProcessor:()=>h.AutoImageProcessor,AutoModel:()=>n.AutoModel,AutoModelForAudioClassification:()=>n.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>n.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>n.AutoModelForAudioTextToText,AutoModelForCTC:()=>n.AutoModelForCTC,AutoModelForCausalLM:()=>n.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>n.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>n.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>n.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>n.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>n.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>n.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>n.AutoModelForImageTextToText,AutoModelForImageToImage:()=>n.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>n.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>n.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>n.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>n.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>n.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>n.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>n.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>n.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>n.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>n.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>n.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>n.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>n.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>n.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>n.AutoModelForVision2Seq,AutoModelForXVector:()=>n.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>n.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>v.AutoProcessor,AutoTokenizer:()=>r.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>t.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>t.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>n.BartForConditionalGeneration,BartForSequenceClassification:()=>n.BartForSequenceClassification,BartModel:()=>n.BartModel,BartPretrainedModel:()=>n.BartPretrainedModel,BartTokenizer:()=>r.BartTokenizer,BaseModelOutput:()=>n.BaseModelOutput,BaseStreamer:()=>y.BaseStreamer,BeitFeatureExtractor:()=>m.BeitFeatureExtractor,BeitForImageClassification:()=>n.BeitForImageClassification,BeitModel:()=>n.BeitModel,BeitPreTrainedModel:()=>n.BeitPreTrainedModel,BertForMaskedLM:()=>n.BertForMaskedLM,BertForQuestionAnswering:()=>n.BertForQuestionAnswering,BertForSequenceClassification:()=>n.BertForSequenceClassification,BertForTokenClassification:()=>n.BertForTokenClassification,BertModel:()=>n.BertModel,BertPreTrainedModel:()=>n.BertPreTrainedModel,BertTokenizer:()=>r.BertTokenizer,BitImageProcessor:()=>m.BitImageProcessor,BlenderbotForConditionalGeneration:()=>n.BlenderbotForConditionalGeneration,BlenderbotModel:()=>n.BlenderbotModel,BlenderbotPreTrainedModel:()=>n.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>n.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>n.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>n.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>r.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>r.BlenderbotTokenizer,BloomForCausalLM:()=>n.BloomForCausalLM,BloomModel:()=>n.BloomModel,BloomPreTrainedModel:()=>n.BloomPreTrainedModel,BloomTokenizer:()=>r.BloomTokenizer,CLIPFeatureExtractor:()=>m.CLIPFeatureExtractor,CLIPImageProcessor:()=>m.CLIPImageProcessor,CLIPModel:()=>n.CLIPModel,CLIPPreTrainedModel:()=>n.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>n.CLIPSegForImageSegmentation,CLIPSegModel:()=>n.CLIPSegModel,CLIPSegPreTrainedModel:()=>n.CLIPSegPreTrainedModel,CLIPTextModel:()=>n.CLIPTextModel,CLIPTextModelWithProjection:()=>n.CLIPTextModelWithProjection,CLIPTokenizer:()=>r.CLIPTokenizer,CLIPVisionModel:()=>n.CLIPVisionModel,CLIPVisionModelWithProjection:()=>n.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>n.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>n.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>n.CamembertForSequenceClassification,CamembertForTokenClassification:()=>n.CamembertForTokenClassification,CamembertModel:()=>n.CamembertModel,CamembertPreTrainedModel:()=>n.CamembertPreTrainedModel,CamembertTokenizer:()=>r.CamembertTokenizer,CausalLMOutput:()=>n.CausalLMOutput,CausalLMOutputWithPast:()=>n.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>m.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>n.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>n.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>n.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>d.ClapFeatureExtractor,ClapModel:()=>n.ClapModel,ClapPreTrainedModel:()=>n.ClapPreTrainedModel,ClapTextModelWithProjection:()=>n.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>x.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>n.CodeGenForCausalLM,CodeGenModel:()=>n.CodeGenModel,CodeGenPreTrainedModel:()=>n.CodeGenPreTrainedModel,CodeGenTokenizer:()=>r.CodeGenTokenizer,CodeLlamaTokenizer:()=>r.CodeLlamaTokenizer,CohereForCausalLM:()=>n.CohereForCausalLM,CohereModel:()=>n.CohereModel,CoherePreTrainedModel:()=>n.CoherePreTrainedModel,CohereTokenizer:()=>r.CohereTokenizer,ConvBertForMaskedLM:()=>n.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>n.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>n.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>n.ConvBertForTokenClassification,ConvBertModel:()=>n.ConvBertModel,ConvBertPreTrainedModel:()=>n.ConvBertPreTrainedModel,ConvBertTokenizer:()=>r.ConvBertTokenizer,ConvNextFeatureExtractor:()=>m.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>n.ConvNextForImageClassification,ConvNextImageProcessor:()=>m.ConvNextImageProcessor,ConvNextModel:()=>n.ConvNextModel,ConvNextPreTrainedModel:()=>n.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>n.ConvNextV2ForImageClassification,ConvNextV2Model:()=>n.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>n.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>n.DFineForObjectDetection,DFineModel:()=>n.DFineModel,DFinePreTrainedModel:()=>n.DFinePreTrainedModel,DPTFeatureExtractor:()=>m.DPTFeatureExtractor,DPTForDepthEstimation:()=>n.DPTForDepthEstimation,DPTImageProcessor:()=>m.DPTImageProcessor,DPTModel:()=>n.DPTModel,DPTPreTrainedModel:()=>n.DPTPreTrainedModel,DacDecoderModel:()=>n.DacDecoderModel,DacDecoderOutput:()=>n.DacDecoderOutput,DacEncoderModel:()=>n.DacEncoderModel,DacEncoderOutput:()=>n.DacEncoderOutput,DacFeatureExtractor:()=>d.DacFeatureExtractor,DacModel:()=>n.DacModel,DacPreTrainedModel:()=>n.DacPreTrainedModel,DataTypeMap:()=>c.DataTypeMap,DebertaForMaskedLM:()=>n.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>n.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>n.DebertaForSequenceClassification,DebertaForTokenClassification:()=>n.DebertaForTokenClassification,DebertaModel:()=>n.DebertaModel,DebertaPreTrainedModel:()=>n.DebertaPreTrainedModel,DebertaTokenizer:()=>r.DebertaTokenizer,DebertaV2ForMaskedLM:()=>n.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>n.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>n.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>n.DebertaV2ForTokenClassification,DebertaV2Model:()=>n.DebertaV2Model,DebertaV2PreTrainedModel:()=>n.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>r.DebertaV2Tokenizer,DecisionTransformerModel:()=>n.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>n.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>m.DeiTFeatureExtractor,DeiTForImageClassification:()=>n.DeiTForImageClassification,DeiTImageProcessor:()=>m.DeiTImageProcessor,DeiTModel:()=>n.DeiTModel,DeiTPreTrainedModel:()=>n.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>n.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>n.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>t.DepthEstimationPipeline,DepthProForDepthEstimation:()=>n.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>n.DepthProPreTrainedModel,DetrFeatureExtractor:()=>m.DetrFeatureExtractor,DetrForObjectDetection:()=>n.DetrForObjectDetection,DetrForSegmentation:()=>n.DetrForSegmentation,DetrImageProcessor:()=>m.DetrImageProcessor,DetrModel:()=>n.DetrModel,DetrObjectDetectionOutput:()=>n.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>n.DetrPreTrainedModel,DetrSegmentationOutput:()=>n.DetrSegmentationOutput,Dinov2ForImageClassification:()=>n.Dinov2ForImageClassification,Dinov2Model:()=>n.Dinov2Model,Dinov2PreTrainedModel:()=>n.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>n.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>n.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>n.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>n.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>n.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>n.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>n.DistilBertForTokenClassification,DistilBertModel:()=>n.DistilBertModel,DistilBertPreTrainedModel:()=>n.DistilBertPreTrainedModel,DistilBertTokenizer:()=>r.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>t.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>m.DonutFeatureExtractor,DonutImageProcessor:()=>m.DonutImageProcessor,DonutSwinModel:()=>n.DonutSwinModel,DonutSwinPreTrainedModel:()=>n.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>n.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>m.EfficientNetImageProcessor,EfficientNetModel:()=>n.EfficientNetModel,EfficientNetPreTrainedModel:()=>n.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>n.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>n.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>n.ElectraForSequenceClassification,ElectraForTokenClassification:()=>n.ElectraForTokenClassification,ElectraModel:()=>n.ElectraModel,ElectraPreTrainedModel:()=>n.ElectraPreTrainedModel,ElectraTokenizer:()=>r.ElectraTokenizer,EncodecFeatureExtractor:()=>d.EncodecFeatureExtractor,EosTokenCriteria:()=>b.EosTokenCriteria,EsmForMaskedLM:()=>n.EsmForMaskedLM,EsmForSequenceClassification:()=>n.EsmForSequenceClassification,EsmForTokenClassification:()=>n.EsmForTokenClassification,EsmModel:()=>n.EsmModel,EsmPreTrainedModel:()=>n.EsmPreTrainedModel,EsmTokenizer:()=>r.EsmTokenizer,ExaoneForCausalLM:()=>n.ExaoneForCausalLM,ExaoneModel:()=>n.ExaoneModel,ExaonePreTrainedModel:()=>n.ExaonePreTrainedModel,FFT:()=>l.FFT,FalconForCausalLM:()=>n.FalconForCausalLM,FalconModel:()=>n.FalconModel,FalconPreTrainedModel:()=>n.FalconPreTrainedModel,FalconTokenizer:()=>r.FalconTokenizer,FastViTForImageClassification:()=>n.FastViTForImageClassification,FastViTModel:()=>n.FastViTModel,FastViTPreTrainedModel:()=>n.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>t.FeatureExtractionPipeline,FeatureExtractor:()=>u.FeatureExtractor,FillMaskPipeline:()=>t.FillMaskPipeline,Florence2ForConditionalGeneration:()=>n.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>n.Florence2PreTrainedModel,Florence2Processor:()=>_.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>x.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>x.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>m.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>n.GLPNForDepthEstimation,GLPNModel:()=>n.GLPNModel,GLPNPreTrainedModel:()=>n.GLPNPreTrainedModel,GPT2LMHeadModel:()=>n.GPT2LMHeadModel,GPT2Model:()=>n.GPT2Model,GPT2PreTrainedModel:()=>n.GPT2PreTrainedModel,GPT2Tokenizer:()=>r.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>n.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>n.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>n.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>n.GPTJForCausalLM,GPTJModel:()=>n.GPTJModel,GPTJPreTrainedModel:()=>n.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>n.GPTNeoForCausalLM,GPTNeoModel:()=>n.GPTNeoModel,GPTNeoPreTrainedModel:()=>n.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>n.GPTNeoXForCausalLM,GPTNeoXModel:()=>n.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>n.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>r.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>n.Gemma2ForCausalLM,Gemma2Model:()=>n.Gemma2Model,Gemma2PreTrainedModel:()=>n.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>n.Gemma3ForCausalLM,Gemma3Model:()=>n.Gemma3Model,Gemma3PreTrainedModel:()=>n.Gemma3PreTrainedModel,GemmaForCausalLM:()=>n.GemmaForCausalLM,GemmaModel:()=>n.GemmaModel,GemmaPreTrainedModel:()=>n.GemmaPreTrainedModel,GemmaTokenizer:()=>r.GemmaTokenizer,GlmForCausalLM:()=>n.GlmForCausalLM,GlmModel:()=>n.GlmModel,GlmPreTrainedModel:()=>n.GlmPreTrainedModel,GraniteForCausalLM:()=>n.GraniteForCausalLM,GraniteModel:()=>n.GraniteModel,GranitePreTrainedModel:()=>n.GranitePreTrainedModel,Grok1Tokenizer:()=>r.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>n.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>n.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>_.GroundingDinoProcessor,GroupViTModel:()=>n.GroupViTModel,GroupViTPreTrainedModel:()=>n.GroupViTPreTrainedModel,HeliumForCausalLM:()=>n.HeliumForCausalLM,HeliumModel:()=>n.HeliumModel,HeliumPreTrainedModel:()=>n.HeliumPreTrainedModel,HerbertTokenizer:()=>r.HerbertTokenizer,HieraForImageClassification:()=>n.HieraForImageClassification,HieraModel:()=>n.HieraModel,HieraPreTrainedModel:()=>n.HieraPreTrainedModel,HubertForCTC:()=>n.HubertForCTC,HubertForSequenceClassification:()=>n.HubertForSequenceClassification,HubertModel:()=>n.HubertModel,HubertPreTrainedModel:()=>n.HubertPreTrainedModel,IJepaForImageClassification:()=>n.IJepaForImageClassification,IJepaModel:()=>n.IJepaModel,IJepaPreTrainedModel:()=>n.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>n.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>m.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>n.Idefics3PreTrainedModel,Idefics3Processor:()=>_.Idefics3Processor,ImageClassificationPipeline:()=>t.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>t.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>d.ImageFeatureExtractor,ImageMattingOutput:()=>n.ImageMattingOutput,ImageProcessor:()=>p.ImageProcessor,ImageSegmentationPipeline:()=>t.ImageSegmentationPipeline,ImageToImagePipeline:()=>t.ImageToImagePipeline,ImageToTextPipeline:()=>t.ImageToTextPipeline,InterruptableStoppingCriteria:()=>b.InterruptableStoppingCriteria,JAISLMHeadModel:()=>n.JAISLMHeadModel,JAISModel:()=>n.JAISModel,JAISPreTrainedModel:()=>n.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>m.JinaCLIPImageProcessor,JinaCLIPModel:()=>n.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>n.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>_.JinaCLIPProcessor,JinaCLIPTextModel:()=>n.JinaCLIPTextModel,JinaCLIPVisionModel:()=>n.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>n.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>n.LlamaForCausalLM,LlamaModel:()=>n.LlamaModel,LlamaPreTrainedModel:()=>n.LlamaPreTrainedModel,LlamaTokenizer:()=>r.LlamaTokenizer,LlavaForConditionalGeneration:()=>n.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>n.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>m.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>n.LlavaPreTrainedModel,LogitsProcessor:()=>x.LogitsProcessor,LogitsProcessorList:()=>x.LogitsProcessorList,LogitsWarper:()=>x.LogitsWarper,LongT5ForConditionalGeneration:()=>n.LongT5ForConditionalGeneration,LongT5Model:()=>n.LongT5Model,LongT5PreTrainedModel:()=>n.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>n.M2M100ForConditionalGeneration,M2M100Model:()=>n.M2M100Model,M2M100PreTrainedModel:()=>n.M2M100PreTrainedModel,M2M100Tokenizer:()=>r.M2M100Tokenizer,MBart50Tokenizer:()=>r.MBart50Tokenizer,MBartForCausalLM:()=>n.MBartForCausalLM,MBartForConditionalGeneration:()=>n.MBartForConditionalGeneration,MBartForSequenceClassification:()=>n.MBartForSequenceClassification,MBartModel:()=>n.MBartModel,MBartPreTrainedModel:()=>n.MBartPreTrainedModel,MBartTokenizer:()=>r.MBartTokenizer,MPNetForMaskedLM:()=>n.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>n.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>n.MPNetForSequenceClassification,MPNetForTokenClassification:()=>n.MPNetForTokenClassification,MPNetModel:()=>n.MPNetModel,MPNetPreTrainedModel:()=>n.MPNetPreTrainedModel,MPNetTokenizer:()=>r.MPNetTokenizer,MT5ForConditionalGeneration:()=>n.MT5ForConditionalGeneration,MT5Model:()=>n.MT5Model,MT5PreTrainedModel:()=>n.MT5PreTrainedModel,MarianMTModel:()=>n.MarianMTModel,MarianModel:()=>n.MarianModel,MarianPreTrainedModel:()=>n.MarianPreTrainedModel,MarianTokenizer:()=>r.MarianTokenizer,Mask2FormerImageProcessor:()=>m.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>m.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>n.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>m.MaskFormerImageProcessor,MaskFormerModel:()=>n.MaskFormerModel,MaskFormerPreTrainedModel:()=>n.MaskFormerPreTrainedModel,MaskedLMOutput:()=>n.MaskedLMOutput,MaxLengthCriteria:()=>b.MaxLengthCriteria,Metric3DForDepthEstimation:()=>n.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>n.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>n.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>n.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>n.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>n.MgpstrModelOutput,MgpstrPreTrainedModel:()=>n.MgpstrPreTrainedModel,MgpstrProcessor:()=>_.MgpstrProcessor,MgpstrTokenizer:()=>r.MgpstrTokenizer,MimiDecoderModel:()=>n.MimiDecoderModel,MimiDecoderOutput:()=>n.MimiDecoderOutput,MimiEncoderModel:()=>n.MimiEncoderModel,MimiEncoderOutput:()=>n.MimiEncoderOutput,MimiModel:()=>n.MimiModel,MimiPreTrainedModel:()=>n.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>x.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>x.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>n.MistralForCausalLM,MistralModel:()=>n.MistralModel,MistralPreTrainedModel:()=>n.MistralPreTrainedModel,MobileBertForMaskedLM:()=>n.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>n.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>n.MobileBertForSequenceClassification,MobileBertModel:()=>n.MobileBertModel,MobileBertPreTrainedModel:()=>n.MobileBertPreTrainedModel,MobileBertTokenizer:()=>r.MobileBertTokenizer,MobileLLMForCausalLM:()=>n.MobileLLMForCausalLM,MobileLLMModel:()=>n.MobileLLMModel,MobileLLMPreTrainedModel:()=>n.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>m.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>n.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>n.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>m.MobileNetV1ImageProcessor,MobileNetV1Model:()=>n.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>n.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>m.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>n.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>n.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>m.MobileNetV2ImageProcessor,MobileNetV2Model:()=>n.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>n.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>m.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>n.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>n.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>m.MobileNetV3ImageProcessor,MobileNetV3Model:()=>n.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>n.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>m.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>n.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>n.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>m.MobileNetV4ImageProcessor,MobileNetV4Model:()=>n.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>n.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>m.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>n.MobileViTForImageClassification,MobileViTImageProcessor:()=>m.MobileViTImageProcessor,MobileViTModel:()=>n.MobileViTModel,MobileViTPreTrainedModel:()=>n.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>n.MobileViTV2ForImageClassification,MobileViTV2Model:()=>n.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>n.MobileViTV2PreTrainedModel,ModelOutput:()=>n.ModelOutput,ModernBertForMaskedLM:()=>n.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>n.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>n.ModernBertForTokenClassification,ModernBertModel:()=>n.ModernBertModel,ModernBertPreTrainedModel:()=>n.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>n.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>d.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>n.MoonshineForConditionalGeneration,MoonshineModel:()=>n.MoonshineModel,MoonshinePreTrainedModel:()=>n.MoonshinePreTrainedModel,MoonshineProcessor:()=>_.MoonshineProcessor,MptForCausalLM:()=>n.MptForCausalLM,MptModel:()=>n.MptModel,MptPreTrainedModel:()=>n.MptPreTrainedModel,MultiModalityCausalLM:()=>n.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>n.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>n.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>n.MusicgenForConditionalGeneration,MusicgenModel:()=>n.MusicgenModel,MusicgenPreTrainedModel:()=>n.MusicgenPreTrainedModel,NllbTokenizer:()=>r.NllbTokenizer,NoBadWordsLogitsProcessor:()=>x.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>x.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>n.NomicBertModel,NomicBertPreTrainedModel:()=>n.NomicBertPreTrainedModel,NougatImageProcessor:()=>m.NougatImageProcessor,NougatTokenizer:()=>r.NougatTokenizer,OPTForCausalLM:()=>n.OPTForCausalLM,OPTModel:()=>n.OPTModel,OPTPreTrainedModel:()=>n.OPTPreTrainedModel,ObjectDetectionPipeline:()=>t.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>n.Olmo2ForCausalLM,Olmo2Model:()=>n.Olmo2Model,Olmo2PreTrainedModel:()=>n.Olmo2PreTrainedModel,OlmoForCausalLM:()=>n.OlmoForCausalLM,OlmoModel:()=>n.OlmoModel,OlmoPreTrainedModel:()=>n.OlmoPreTrainedModel,OpenELMForCausalLM:()=>n.OpenELMForCausalLM,OpenELMModel:()=>n.OpenELMModel,OpenELMPreTrainedModel:()=>n.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>m.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>n.OwlViTForObjectDetection,OwlViTImageProcessor:()=>m.OwlViTImageProcessor,OwlViTModel:()=>n.OwlViTModel,OwlViTPreTrainedModel:()=>n.OwlViTPreTrainedModel,OwlViTProcessor:()=>_.OwlViTProcessor,Owlv2ForObjectDetection:()=>n.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>m.Owlv2ImageProcessor,Owlv2Model:()=>n.Owlv2Model,Owlv2PreTrainedModel:()=>n.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>n.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>n.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>_.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>n.PatchTSMixerForPrediction,PatchTSMixerModel:()=>n.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>n.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>n.PatchTSTForPrediction,PatchTSTModel:()=>n.PatchTSTModel,PatchTSTPreTrainedModel:()=>n.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>n.Phi3ForCausalLM,Phi3Model:()=>n.Phi3Model,Phi3PreTrainedModel:()=>n.Phi3PreTrainedModel,Phi3VForCausalLM:()=>n.Phi3VForCausalLM,Phi3VImageProcessor:()=>m.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>n.Phi3VPreTrainedModel,Phi3VProcessor:()=>_.Phi3VProcessor,PhiForCausalLM:()=>n.PhiForCausalLM,PhiModel:()=>n.PhiModel,PhiPreTrainedModel:()=>n.PhiPreTrainedModel,Pipeline:()=>t.Pipeline,PreTrainedModel:()=>n.PreTrainedModel,PreTrainedTokenizer:()=>r.PreTrainedTokenizer,PretrainedConfig:()=>i.PretrainedConfig,PretrainedMixin:()=>n.PretrainedMixin,Processor:()=>g.Processor,PvtForImageClassification:()=>n.PvtForImageClassification,PvtImageProcessor:()=>m.PvtImageProcessor,PvtModel:()=>n.PvtModel,PvtPreTrainedModel:()=>n.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>d.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>n.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>n.PyAnnoteModel,PyAnnotePreTrainedModel:()=>n.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>_.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>n.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>t.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>n.Qwen2ForCausalLM,Qwen2Model:()=>n.Qwen2Model,Qwen2PreTrainedModel:()=>n.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>r.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>n.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>m.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>n.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>_.Qwen2VLProcessor,Qwen3ForCausalLM:()=>n.Qwen3ForCausalLM,Qwen3Model:()=>n.Qwen3Model,Qwen3PreTrainedModel:()=>n.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>n.RFDetrForObjectDetection,RFDetrModel:()=>n.RFDetrModel,RFDetrObjectDetectionOutput:()=>n.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>n.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>n.RTDetrForObjectDetection,RTDetrImageProcessor:()=>m.RTDetrImageProcessor,RTDetrModel:()=>n.RTDetrModel,RTDetrObjectDetectionOutput:()=>n.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>n.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>n.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>n.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>n.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>n.RTDetrV2PreTrainedModel,RawAudio:()=>a.RawAudio,RawImage:()=>o.RawImage,RawVideo:()=>s.RawVideo,RawVideoFrame:()=>s.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>x.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>n.ResNetForImageClassification,ResNetModel:()=>n.ResNetModel,ResNetPreTrainedModel:()=>n.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>n.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>n.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>n.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>n.RoFormerForTokenClassification,RoFormerModel:()=>n.RoFormerModel,RoFormerPreTrainedModel:()=>n.RoFormerPreTrainedModel,RoFormerTokenizer:()=>r.RoFormerTokenizer,RobertaForMaskedLM:()=>n.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>n.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>n.RobertaForSequenceClassification,RobertaForTokenClassification:()=>n.RobertaForTokenClassification,RobertaModel:()=>n.RobertaModel,RobertaPreTrainedModel:()=>n.RobertaPreTrainedModel,RobertaTokenizer:()=>r.RobertaTokenizer,SamImageProcessor:()=>m.SamImageProcessor,SamImageSegmentationOutput:()=>n.SamImageSegmentationOutput,SamModel:()=>n.SamModel,SamPreTrainedModel:()=>n.SamPreTrainedModel,SamProcessor:()=>_.SamProcessor,SapiensForDepthEstimation:()=>n.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>n.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>n.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>n.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>m.SegformerFeatureExtractor,SegformerForImageClassification:()=>n.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>n.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>m.SegformerImageProcessor,SegformerModel:()=>n.SegformerModel,SegformerPreTrainedModel:()=>n.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>n.Seq2SeqLMOutput,SequenceClassifierOutput:()=>n.SequenceClassifierOutput,SiglipImageProcessor:()=>m.SiglipImageProcessor,SiglipModel:()=>n.SiglipModel,SiglipPreTrainedModel:()=>n.SiglipPreTrainedModel,SiglipTextModel:()=>n.SiglipTextModel,SiglipTokenizer:()=>r.SiglipTokenizer,SiglipVisionModel:()=>n.SiglipVisionModel,SmolVLMForConditionalGeneration:()=>n.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>m.SmolVLMImageProcessor,SmolVLMProcessor:()=>_.SmolVLMProcessor,SnacDecoderModel:()=>n.SnacDecoderModel,SnacEncoderModel:()=>n.SnacEncoderModel,SnacFeatureExtractor:()=>d.SnacFeatureExtractor,SnacModel:()=>n.SnacModel,SnacPreTrainedModel:()=>n.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>d.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>n.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>n.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>n.SpeechT5HifiGan,SpeechT5Model:()=>n.SpeechT5Model,SpeechT5PreTrainedModel:()=>n.SpeechT5PreTrainedModel,SpeechT5Processor:()=>_.SpeechT5Processor,SpeechT5Tokenizer:()=>r.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>n.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>n.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>n.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>n.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>n.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>r.SqueezeBertTokenizer,StableLmForCausalLM:()=>n.StableLmForCausalLM,StableLmModel:()=>n.StableLmModel,StableLmPreTrainedModel:()=>n.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>n.Starcoder2ForCausalLM,Starcoder2Model:()=>n.Starcoder2Model,Starcoder2PreTrainedModel:()=>n.Starcoder2PreTrainedModel,StoppingCriteria:()=>b.StoppingCriteria,StoppingCriteriaList:()=>b.StoppingCriteriaList,StyleTextToSpeech2Model:()=>n.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>n.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>t.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>x.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>n.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>m.Swin2SRImageProcessor,Swin2SRModel:()=>n.Swin2SRModel,Swin2SRPreTrainedModel:()=>n.Swin2SRPreTrainedModel,SwinForImageClassification:()=>n.SwinForImageClassification,SwinForSemanticSegmentation:()=>n.SwinForSemanticSegmentation,SwinModel:()=>n.SwinModel,SwinPreTrainedModel:()=>n.SwinPreTrainedModel,T5ForConditionalGeneration:()=>n.T5ForConditionalGeneration,T5Model:()=>n.T5Model,T5PreTrainedModel:()=>n.T5PreTrainedModel,T5Tokenizer:()=>r.T5Tokenizer,TableTransformerForObjectDetection:()=>n.TableTransformerForObjectDetection,TableTransformerModel:()=>n.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>n.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>n.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>x.TemperatureLogitsWarper,Tensor:()=>c.Tensor,Text2TextGenerationPipeline:()=>t.Text2TextGenerationPipeline,TextClassificationPipeline:()=>t.TextClassificationPipeline,TextGenerationPipeline:()=>t.TextGenerationPipeline,TextStreamer:()=>y.TextStreamer,TextToAudioPipeline:()=>t.TextToAudioPipeline,TokenClassificationPipeline:()=>t.TokenClassificationPipeline,TokenClassifierOutput:()=>n.TokenClassifierOutput,TokenizerModel:()=>r.TokenizerModel,TopKLogitsWarper:()=>x.TopKLogitsWarper,TopPLogitsWarper:()=>x.TopPLogitsWarper,TrOCRForCausalLM:()=>n.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>n.TrOCRPreTrainedModel,TranslationPipeline:()=>t.TranslationPipeline,UltravoxModel:()=>n.UltravoxModel,UltravoxPreTrainedModel:()=>n.UltravoxPreTrainedModel,UltravoxProcessor:()=>_.UltravoxProcessor,UniSpeechForCTC:()=>n.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>n.UniSpeechForSequenceClassification,UniSpeechModel:()=>n.UniSpeechModel,UniSpeechPreTrainedModel:()=>n.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>n.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>n.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>n.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>n.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>n.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>_.VLChatProcessor,VLMImageProcessor:()=>m.VLMImageProcessor,ViTFeatureExtractor:()=>m.ViTFeatureExtractor,ViTForImageClassification:()=>n.ViTForImageClassification,ViTImageProcessor:()=>m.ViTImageProcessor,ViTMAEModel:()=>n.ViTMAEModel,ViTMAEPreTrainedModel:()=>n.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>n.ViTMSNForImageClassification,ViTMSNModel:()=>n.ViTMSNModel,ViTMSNPreTrainedModel:()=>n.ViTMSNPreTrainedModel,ViTModel:()=>n.ViTModel,ViTPreTrainedModel:()=>n.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>n.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>n.VitMatteForImageMatting,VitMatteImageProcessor:()=>m.VitMatteImageProcessor,VitMattePreTrainedModel:()=>n.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>n.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>m.VitPoseImageProcessor,VitPosePreTrainedModel:()=>n.VitPosePreTrainedModel,VitsModel:()=>n.VitsModel,VitsModelOutput:()=>n.VitsModelOutput,VitsPreTrainedModel:()=>n.VitsPreTrainedModel,VitsTokenizer:()=>r.VitsTokenizer,Wav2Vec2BertForCTC:()=>n.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>n.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>n.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>n.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>r.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>d.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>n.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>n.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>n.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>n.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>n.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>_.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>_.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>n.WavLMForAudioFrameClassification,WavLMForCTC:()=>n.WavLMForCTC,WavLMForSequenceClassification:()=>n.WavLMForSequenceClassification,WavLMForXVector:()=>n.WavLMForXVector,WavLMModel:()=>n.WavLMModel,WavLMPreTrainedModel:()=>n.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>d.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>n.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>n.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>d.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>n.WhisperForConditionalGeneration,WhisperModel:()=>n.WhisperModel,WhisperPreTrainedModel:()=>n.WhisperPreTrainedModel,WhisperProcessor:()=>_.WhisperProcessor,WhisperTextStreamer:()=>y.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>x.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>r.WhisperTokenizer,XLMForQuestionAnswering:()=>n.XLMForQuestionAnswering,XLMForSequenceClassification:()=>n.XLMForSequenceClassification,XLMForTokenClassification:()=>n.XLMForTokenClassification,XLMModel:()=>n.XLMModel,XLMPreTrainedModel:()=>n.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>n.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>n.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>n.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>n.XLMRobertaForTokenClassification,XLMRobertaModel:()=>n.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>n.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>r.XLMRobertaTokenizer,XLMTokenizer:()=>r.XLMTokenizer,XLMWithLMHeadModel:()=>n.XLMWithLMHeadModel,XVectorOutput:()=>n.XVectorOutput,YolosFeatureExtractor:()=>m.YolosFeatureExtractor,YolosForObjectDetection:()=>n.YolosForObjectDetection,YolosImageProcessor:()=>m.YolosImageProcessor,YolosModel:()=>n.YolosModel,YolosObjectDetectionOutput:()=>n.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>n.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>t.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>t.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>t.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>t.ZeroShotObjectDetectionPipeline,bankers_round:()=>l.bankers_round,cat:()=>c.cat,cos_sim:()=>l.cos_sim,dot:()=>l.dot,dynamic_time_warping:()=>l.dynamic_time_warping,env:()=>e.env,full:()=>c.full,full_like:()=>c.full_like,getKeyValueShapes:()=>i.getKeyValueShapes,hamming:()=>a.hamming,hanning:()=>a.hanning,interpolate:()=>c.interpolate,interpolate_4d:()=>c.interpolate_4d,interpolate_data:()=>l.interpolate_data,is_chinese_char:()=>r.is_chinese_char,layer_norm:()=>c.layer_norm,load_image:()=>o.load_image,load_video:()=>s.load_video,log_softmax:()=>l.log_softmax,magnitude:()=>l.magnitude,matmul:()=>c.matmul,max:()=>l.max,mean:()=>c.mean,mean_pooling:()=>c.mean_pooling,medianFilter:()=>l.medianFilter,mel_filter_bank:()=>a.mel_filter_bank,min:()=>l.min,ones:()=>c.ones,ones_like:()=>c.ones_like,permute:()=>c.permute,permute_data:()=>l.permute_data,pipeline:()=>t.pipeline,quantize_embeddings:()=>c.quantize_embeddings,rand:()=>c.rand,read_audio:()=>a.read_audio,rfft:()=>c.rfft,round:()=>l.round,slice:()=>c.slice,softmax:()=>l.softmax,spectrogram:()=>a.spectrogram,stack:()=>c.stack,std_mean:()=>c.std_mean,topk:()=>c.topk,window_function:()=>a.window_function,zeros:()=>c.zeros,zeros_like:()=>c.zeros_like});var e=Tf( +/*! ./env.js */ +`./src/env.js`),t=Tf( +/*! ./pipelines.js */ +`./src/pipelines.js`),n=Tf( +/*! ./models.js */ +`./src/models.js`),r=Tf( +/*! ./tokenizers.js */ +`./src/tokenizers.js`),i=Tf( +/*! ./configs.js */ +`./src/configs.js`),a=Tf( +/*! ./utils/audio.js */ +`./src/utils/audio.js`),o=Tf( +/*! ./utils/image.js */ +`./src/utils/image.js`),s=Tf( +/*! ./utils/video.js */ +`./src/utils/video.js`),c=Tf( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),l=Tf( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),u=Tf( +/*! ./base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),d=Tf( +/*! ./models/feature_extractors.js */ +`./src/models/feature_extractors.js`),f=Tf( +/*! ./models/auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),p=Tf( +/*! ./base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),m=Tf( +/*! ./models/image_processors.js */ +`./src/models/image_processors.js`),h=Tf( +/*! ./models/auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),g=Tf( +/*! ./base/processing_utils.js */ +`./src/base/processing_utils.js`),_=Tf( +/*! ./models/processors.js */ +`./src/models/processors.js`),v=Tf( +/*! ./models/auto/processing_auto.js */ +`./src/models/auto/processing_auto.js`),y=Tf( +/*! ./generation/streamers.js */ +`./src/generation/streamers.js`),b=Tf( +/*! ./generation/stopping_criteria.js */ +`./src/generation/stopping_criteria.js`),x=Tf( +/*! ./generation/logits_process.js */ +`./src/generation/logits_process.js`)})();var Ef=$.ASTFeatureExtractor,Df=$.ASTForAudioClassification,Of=$.ASTModel,kf=$.ASTPreTrainedModel,Af=$.AlbertForMaskedLM,jf=$.AlbertForQuestionAnswering,Mf=$.AlbertForSequenceClassification,Nf=$.AlbertModel,Pf=$.AlbertPreTrainedModel,Ff=$.AlbertTokenizer,If=$.AudioClassificationPipeline,Lf=$.AutoConfig,Rf=$.AutoFeatureExtractor,zf=$.AutoImageProcessor,Bf=$.AutoModel,Vf=$.AutoModelForAudioClassification,Hf=$.AutoModelForAudioFrameClassification,Uf=$.AutoModelForAudioTextToText,Wf=$.AutoModelForCTC,Gf=$.AutoModelForCausalLM,Kf=$.AutoModelForDepthEstimation,qf=$.AutoModelForDocumentQuestionAnswering,Jf=$.AutoModelForImageClassification,Yf=$.AutoModelForImageFeatureExtraction,Xf=$.AutoModelForImageMatting,Zf=$.AutoModelForImageSegmentation,Qf=$.AutoModelForImageTextToText,$f=$.AutoModelForImageToImage,ep=$.AutoModelForMaskGeneration,tp=$.AutoModelForMaskedLM,np=$.AutoModelForNormalEstimation,rp=$.AutoModelForObjectDetection,ip=$.AutoModelForPoseEstimation,ap=$.AutoModelForQuestionAnswering,op=$.AutoModelForSemanticSegmentation,sp=$.AutoModelForSeq2SeqLM,cp=$.AutoModelForSequenceClassification,lp=$.AutoModelForSpeechSeq2Seq,up=$.AutoModelForTextToSpectrogram,dp=$.AutoModelForTextToWaveform,fp=$.AutoModelForTokenClassification,pp=$.AutoModelForUniversalSegmentation,mp=$.AutoModelForVision2Seq,hp=$.AutoModelForXVector,gp=$.AutoModelForZeroShotObjectDetection,_p=$.AutoProcessor,vp=$.AutoTokenizer,yp=$.AutomaticSpeechRecognitionPipeline,bp=$.BackgroundRemovalPipeline,xp=$.BartForConditionalGeneration,Sp=$.BartForSequenceClassification,Cp=$.BartModel,wp=$.BartPretrainedModel,Tp=$.BartTokenizer,Ep=$.BaseModelOutput,Dp=$.BaseStreamer,Op=$.BeitFeatureExtractor,kp=$.BeitForImageClassification,Ap=$.BeitModel,jp=$.BeitPreTrainedModel,Mp=$.BertForMaskedLM,Np=$.BertForQuestionAnswering,Pp=$.BertForSequenceClassification,Fp=$.BertForTokenClassification,Ip=$.BertModel,Lp=$.BertPreTrainedModel,Rp=$.BertTokenizer,zp=$.BitImageProcessor,Bp=$.BlenderbotForConditionalGeneration,Vp=$.BlenderbotModel,Hp=$.BlenderbotPreTrainedModel,Up=$.BlenderbotSmallForConditionalGeneration,Wp=$.BlenderbotSmallModel,Gp=$.BlenderbotSmallPreTrainedModel,Kp=$.BlenderbotSmallTokenizer,qp=$.BlenderbotTokenizer,Jp=$.BloomForCausalLM,Yp=$.BloomModel,Xp=$.BloomPreTrainedModel,Zp=$.BloomTokenizer,Qp=$.CLIPFeatureExtractor,$p=$.CLIPImageProcessor,em=$.CLIPModel,tm=$.CLIPPreTrainedModel,nm=$.CLIPSegForImageSegmentation,rm=$.CLIPSegModel,im=$.CLIPSegPreTrainedModel,am=$.CLIPTextModel,om=$.CLIPTextModelWithProjection,sm=$.CLIPTokenizer,cm=$.CLIPVisionModel,lm=$.CLIPVisionModelWithProjection,um=$.CamembertForMaskedLM,dm=$.CamembertForQuestionAnswering,fm=$.CamembertForSequenceClassification,pm=$.CamembertForTokenClassification,mm=$.CamembertModel,hm=$.CamembertPreTrainedModel,gm=$.CamembertTokenizer,_m=$.CausalLMOutput,vm=$.CausalLMOutputWithPast,ym=$.ChineseCLIPFeatureExtractor,bm=$.ChineseCLIPModel,xm=$.ChineseCLIPPreTrainedModel,Sm=$.ClapAudioModelWithProjection,Cm=$.ClapFeatureExtractor,wm=$.ClapModel,Tm=$.ClapPreTrainedModel,Em=$.ClapTextModelWithProjection,Dm=$.ClassifierFreeGuidanceLogitsProcessor,Om=$.CodeGenForCausalLM,km=$.CodeGenModel,Am=$.CodeGenPreTrainedModel,jm=$.CodeGenTokenizer,Mm=$.CodeLlamaTokenizer,Nm=$.CohereForCausalLM,Pm=$.CohereModel,Fm=$.CoherePreTrainedModel,Im=$.CohereTokenizer,Lm=$.ConvBertForMaskedLM,Rm=$.ConvBertForQuestionAnswering,zm=$.ConvBertForSequenceClassification,Bm=$.ConvBertForTokenClassification,Vm=$.ConvBertModel,Hm=$.ConvBertPreTrainedModel,Um=$.ConvBertTokenizer,Wm=$.ConvNextFeatureExtractor,Gm=$.ConvNextForImageClassification,Km=$.ConvNextImageProcessor,qm=$.ConvNextModel,Jm=$.ConvNextPreTrainedModel,Ym=$.ConvNextV2ForImageClassification,Xm=$.ConvNextV2Model,Zm=$.ConvNextV2PreTrainedModel,Qm=$.DFineForObjectDetection,$m=$.DFineModel,eh=$.DFinePreTrainedModel,th=$.DPTFeatureExtractor,nh=$.DPTForDepthEstimation,rh=$.DPTImageProcessor,ih=$.DPTModel,ah=$.DPTPreTrainedModel,oh=$.DacDecoderModel,sh=$.DacDecoderOutput,ch=$.DacEncoderModel,lh=$.DacEncoderOutput,uh=$.DacFeatureExtractor,dh=$.DacModel,fh=$.DacPreTrainedModel,ph=$.DataTypeMap,mh=$.DebertaForMaskedLM,hh=$.DebertaForQuestionAnswering,gh=$.DebertaForSequenceClassification,_h=$.DebertaForTokenClassification,vh=$.DebertaModel,yh=$.DebertaPreTrainedModel,bh=$.DebertaTokenizer,xh=$.DebertaV2ForMaskedLM,Sh=$.DebertaV2ForQuestionAnswering,Ch=$.DebertaV2ForSequenceClassification,wh=$.DebertaV2ForTokenClassification,Th=$.DebertaV2Model,Eh=$.DebertaV2PreTrainedModel,Dh=$.DebertaV2Tokenizer,Oh=$.DecisionTransformerModel,kh=$.DecisionTransformerPreTrainedModel,Ah=$.DeiTFeatureExtractor,jh=$.DeiTForImageClassification,Mh=$.DeiTImageProcessor,Nh=$.DeiTModel,Ph=$.DeiTPreTrainedModel,Fh=$.DepthAnythingForDepthEstimation,Ih=$.DepthAnythingPreTrainedModel,Lh=$.DepthEstimationPipeline,Rh=$.DepthProForDepthEstimation,zh=$.DepthProPreTrainedModel,Bh=$.DetrFeatureExtractor,Vh=$.DetrForObjectDetection,Hh=$.DetrForSegmentation,Uh=$.DetrImageProcessor,Wh=$.DetrModel,Gh=$.DetrObjectDetectionOutput,Kh=$.DetrPreTrainedModel,qh=$.DetrSegmentationOutput,Jh=$.Dinov2ForImageClassification,Yh=$.Dinov2Model,Xh=$.Dinov2PreTrainedModel,Zh=$.Dinov2WithRegistersForImageClassification,Qh=$.Dinov2WithRegistersModel,$h=$.Dinov2WithRegistersPreTrainedModel,eg=$.DistilBertForMaskedLM,tg=$.DistilBertForQuestionAnswering,ng=$.DistilBertForSequenceClassification,rg=$.DistilBertForTokenClassification,ig=$.DistilBertModel,ag=$.DistilBertPreTrainedModel,og=$.DistilBertTokenizer,sg=$.DocumentQuestionAnsweringPipeline,cg=$.DonutFeatureExtractor,lg=$.DonutImageProcessor,ug=$.DonutSwinModel,dg=$.DonutSwinPreTrainedModel,fg=$.EfficientNetForImageClassification,pg=$.EfficientNetImageProcessor,mg=$.EfficientNetModel,hg=$.EfficientNetPreTrainedModel,gg=$.ElectraForMaskedLM,_g=$.ElectraForQuestionAnswering,vg=$.ElectraForSequenceClassification,yg=$.ElectraForTokenClassification,bg=$.ElectraModel,xg=$.ElectraPreTrainedModel,Sg=$.ElectraTokenizer,Cg=$.EncodecFeatureExtractor,wg=$.EosTokenCriteria,Tg=$.EsmForMaskedLM,Eg=$.EsmForSequenceClassification,Dg=$.EsmForTokenClassification,Og=$.EsmModel,kg=$.EsmPreTrainedModel,Ag=$.EsmTokenizer,jg=$.ExaoneForCausalLM,Mg=$.ExaoneModel,Ng=$.ExaonePreTrainedModel,Pg=$.FFT,Fg=$.FalconForCausalLM,Ig=$.FalconModel,Lg=$.FalconPreTrainedModel,Rg=$.FalconTokenizer,zg=$.FastViTForImageClassification,Bg=$.FastViTModel,Vg=$.FastViTPreTrainedModel,Hg=$.FeatureExtractionPipeline,Ug=$.FeatureExtractor,Wg=$.FillMaskPipeline,Gg=$.Florence2ForConditionalGeneration,Kg=$.Florence2PreTrainedModel,qg=$.Florence2Processor,Jg=$.ForcedBOSTokenLogitsProcessor,Yg=$.ForcedEOSTokenLogitsProcessor,Xg=$.GLPNFeatureExtractor,Zg=$.GLPNForDepthEstimation,Qg=$.GLPNModel,$g=$.GLPNPreTrainedModel,e_=$.GPT2LMHeadModel,t_=$.GPT2Model,n_=$.GPT2PreTrainedModel,r_=$.GPT2Tokenizer,i_=$.GPTBigCodeForCausalLM,a_=$.GPTBigCodeModel,o_=$.GPTBigCodePreTrainedModel,s_=$.GPTJForCausalLM,c_=$.GPTJModel,l_=$.GPTJPreTrainedModel,u_=$.GPTNeoForCausalLM,d_=$.GPTNeoModel,f_=$.GPTNeoPreTrainedModel,p_=$.GPTNeoXForCausalLM,m_=$.GPTNeoXModel,h_=$.GPTNeoXPreTrainedModel,g_=$.GPTNeoXTokenizer,__=$.Gemma2ForCausalLM,v_=$.Gemma2Model,y_=$.Gemma2PreTrainedModel,b_=$.Gemma3ForCausalLM,x_=$.Gemma3Model,S_=$.Gemma3PreTrainedModel,C_=$.GemmaForCausalLM,w_=$.GemmaModel,T_=$.GemmaPreTrainedModel,E_=$.GemmaTokenizer,D_=$.GlmForCausalLM,O_=$.GlmModel,k_=$.GlmPreTrainedModel,A_=$.GraniteForCausalLM,j_=$.GraniteModel,M_=$.GranitePreTrainedModel,N_=$.Grok1Tokenizer,P_=$.GroundingDinoForObjectDetection,F_=$.GroundingDinoImageProcessor,I_=$.GroundingDinoPreTrainedModel,L_=$.GroundingDinoProcessor,R_=$.GroupViTModel,z_=$.GroupViTPreTrainedModel,B_=$.HeliumForCausalLM,V_=$.HeliumModel,H_=$.HeliumPreTrainedModel,U_=$.HerbertTokenizer,W_=$.HieraForImageClassification,G_=$.HieraModel,K_=$.HieraPreTrainedModel,q_=$.HubertForCTC,J_=$.HubertForSequenceClassification,Y_=$.HubertModel,X_=$.HubertPreTrainedModel,Z_=$.IJepaForImageClassification,Q_=$.IJepaModel,$_=$.IJepaPreTrainedModel,ev=$.Idefics3ForConditionalGeneration,tv=$.Idefics3ImageProcessor,nv=$.Idefics3PreTrainedModel,rv=$.Idefics3Processor,iv=$.ImageClassificationPipeline,av=$.ImageFeatureExtractionPipeline,ov=$.ImageFeatureExtractor,sv=$.ImageMattingOutput,cv=$.ImageProcessor,lv=$.ImageSegmentationPipeline,uv=$.ImageToImagePipeline,dv=$.ImageToTextPipeline,fv=$.InterruptableStoppingCriteria,pv=$.JAISLMHeadModel,mv=$.JAISModel,hv=$.JAISPreTrainedModel,gv=$.JinaCLIPImageProcessor,_v=$.JinaCLIPModel,vv=$.JinaCLIPPreTrainedModel,yv=$.JinaCLIPProcessor,bv=$.JinaCLIPTextModel,xv=$.JinaCLIPVisionModel,Sv=$.LiteWhisperForConditionalGeneration,Cv=$.LlamaForCausalLM,wv=$.LlamaModel,Tv=$.LlamaPreTrainedModel,Ev=$.LlamaTokenizer,Dv=$.LlavaForConditionalGeneration,Ov=$.LlavaOnevisionForConditionalGeneration,kv=$.LlavaOnevisionImageProcessor,Av=$.LlavaPreTrainedModel,jv=$.LogitsProcessor,Mv=$.LogitsProcessorList,Nv=$.LogitsWarper,Pv=$.LongT5ForConditionalGeneration,Fv=$.LongT5Model,Iv=$.LongT5PreTrainedModel,Lv=$.M2M100ForConditionalGeneration,Rv=$.M2M100Model,zv=$.M2M100PreTrainedModel,Bv=$.M2M100Tokenizer,Vv=$.MBart50Tokenizer,Hv=$.MBartForCausalLM,Uv=$.MBartForConditionalGeneration,Wv=$.MBartForSequenceClassification,Gv=$.MBartModel,Kv=$.MBartPreTrainedModel,qv=$.MBartTokenizer,Jv=$.MPNetForMaskedLM,Yv=$.MPNetForQuestionAnswering,Xv=$.MPNetForSequenceClassification,Zv=$.MPNetForTokenClassification,Qv=$.MPNetModel,$v=$.MPNetPreTrainedModel,ey=$.MPNetTokenizer,ty=$.MT5ForConditionalGeneration,ny=$.MT5Model,ry=$.MT5PreTrainedModel,iy=$.MarianMTModel,ay=$.MarianModel,oy=$.MarianPreTrainedModel,sy=$.MarianTokenizer,cy=$.Mask2FormerImageProcessor,ly=$.MaskFormerFeatureExtractor,uy=$.MaskFormerForInstanceSegmentation,dy=$.MaskFormerImageProcessor,fy=$.MaskFormerModel,py=$.MaskFormerPreTrainedModel,my=$.MaskedLMOutput,hy=$.MaxLengthCriteria,gy=$.Metric3DForDepthEstimation,_y=$.Metric3DPreTrainedModel,vy=$.Metric3Dv2ForDepthEstimation,yy=$.Metric3Dv2PreTrainedModel,by=$.MgpstrForSceneTextRecognition,xy=$.MgpstrModelOutput,Sy=$.MgpstrPreTrainedModel,Cy=$.MgpstrProcessor,wy=$.MgpstrTokenizer,Ty=$.MimiDecoderModel,Ey=$.MimiDecoderOutput,Dy=$.MimiEncoderModel,Oy=$.MimiEncoderOutput,ky=$.MimiModel,Ay=$.MimiPreTrainedModel,jy=$.MinLengthLogitsProcessor,My=$.MinNewTokensLengthLogitsProcessor,Ny=$.MistralForCausalLM,Py=$.MistralModel,Fy=$.MistralPreTrainedModel,Iy=$.MobileBertForMaskedLM,Ly=$.MobileBertForQuestionAnswering,Ry=$.MobileBertForSequenceClassification,zy=$.MobileBertModel,By=$.MobileBertPreTrainedModel,Vy=$.MobileBertTokenizer,Hy=$.MobileLLMForCausalLM,Uy=$.MobileLLMModel,Wy=$.MobileLLMPreTrainedModel,Gy=$.MobileNetV1FeatureExtractor,Ky=$.MobileNetV1ForImageClassification,qy=$.MobileNetV1ForSemanticSegmentation,Jy=$.MobileNetV1ImageProcessor,Yy=$.MobileNetV1Model,Xy=$.MobileNetV1PreTrainedModel,Zy=$.MobileNetV2FeatureExtractor,Qy=$.MobileNetV2ForImageClassification,$y=$.MobileNetV2ForSemanticSegmentation,eb=$.MobileNetV2ImageProcessor,tb=$.MobileNetV2Model,nb=$.MobileNetV2PreTrainedModel,rb=$.MobileNetV3FeatureExtractor,ib=$.MobileNetV3ForImageClassification,ab=$.MobileNetV3ForSemanticSegmentation,ob=$.MobileNetV3ImageProcessor,sb=$.MobileNetV3Model,cb=$.MobileNetV3PreTrainedModel,lb=$.MobileNetV4FeatureExtractor,ub=$.MobileNetV4ForImageClassification,db=$.MobileNetV4ForSemanticSegmentation,fb=$.MobileNetV4ImageProcessor,pb=$.MobileNetV4Model,mb=$.MobileNetV4PreTrainedModel,hb=$.MobileViTFeatureExtractor,gb=$.MobileViTForImageClassification,_b=$.MobileViTImageProcessor,vb=$.MobileViTModel,yb=$.MobileViTPreTrainedModel,bb=$.MobileViTV2ForImageClassification,xb=$.MobileViTV2Model,Sb=$.MobileViTV2PreTrainedModel,Cb=$.ModelOutput,wb=$.ModernBertForMaskedLM,Tb=$.ModernBertForSequenceClassification,Eb=$.ModernBertForTokenClassification,Db=$.ModernBertModel,Ob=$.ModernBertPreTrainedModel,kb=$.Moondream1ForConditionalGeneration,Ab=$.MoonshineFeatureExtractor,jb=$.MoonshineForConditionalGeneration,Mb=$.MoonshineModel,Nb=$.MoonshinePreTrainedModel,Pb=$.MoonshineProcessor,Fb=$.MptForCausalLM,Ib=$.MptModel,Lb=$.MptPreTrainedModel,Rb=$.MultiModalityCausalLM,zb=$.MultiModalityPreTrainedModel,Bb=$.MusicgenForCausalLM,Vb=$.MusicgenForConditionalGeneration,Hb=$.MusicgenModel,Ub=$.MusicgenPreTrainedModel,Wb=$.NllbTokenizer,Gb=$.NoBadWordsLogitsProcessor,Kb=$.NoRepeatNGramLogitsProcessor,qb=$.NomicBertModel,Jb=$.NomicBertPreTrainedModel,Yb=$.NougatImageProcessor,Xb=$.NougatTokenizer,Zb=$.OPTForCausalLM,Qb=$.OPTModel,$b=$.OPTPreTrainedModel,ex=$.ObjectDetectionPipeline,tx=$.Olmo2ForCausalLM,nx=$.Olmo2Model,rx=$.Olmo2PreTrainedModel,ix=$.OlmoForCausalLM,ax=$.OlmoModel,ox=$.OlmoPreTrainedModel,sx=$.OpenELMForCausalLM,cx=$.OpenELMModel,lx=$.OpenELMPreTrainedModel,ux=$.OwlViTFeatureExtractor,dx=$.OwlViTForObjectDetection,fx=$.OwlViTImageProcessor,px=$.OwlViTModel,mx=$.OwlViTPreTrainedModel,hx=$.OwlViTProcessor,gx=$.Owlv2ForObjectDetection,_x=$.Owlv2ImageProcessor,vx=$.Owlv2Model,yx=$.Owlv2PreTrainedModel,bx=$.PaliGemmaForConditionalGeneration,xx=$.PaliGemmaPreTrainedModel,Sx=$.PaliGemmaProcessor,Cx=$.PatchTSMixerForPrediction,wx=$.PatchTSMixerModel,Tx=$.PatchTSMixerPreTrainedModel,Ex=$.PatchTSTForPrediction,Dx=$.PatchTSTModel,Ox=$.PatchTSTPreTrainedModel,kx=$.Phi3ForCausalLM,Ax=$.Phi3Model,jx=$.Phi3PreTrainedModel,Mx=$.Phi3VForCausalLM,Nx=$.Phi3VImageProcessor,Px=$.Phi3VPreTrainedModel,Fx=$.Phi3VProcessor,Ix=$.PhiForCausalLM,Lx=$.PhiModel,Rx=$.PhiPreTrainedModel,zx=$.Pipeline,Bx=$.PreTrainedModel,Vx=$.PreTrainedTokenizer,Hx=$.PretrainedConfig,Ux=$.PretrainedMixin,Wx=$.Processor,Gx=$.PvtForImageClassification,Kx=$.PvtImageProcessor,qx=$.PvtModel,Jx=$.PvtPreTrainedModel,Yx=$.PyAnnoteFeatureExtractor,Xx=$.PyAnnoteForAudioFrameClassification,Zx=$.PyAnnoteModel,Qx=$.PyAnnotePreTrainedModel,$x=$.PyAnnoteProcessor,eS=$.QuestionAnsweringModelOutput,tS=$.QuestionAnsweringPipeline,nS=$.Qwen2ForCausalLM,rS=$.Qwen2Model,iS=$.Qwen2PreTrainedModel,aS=$.Qwen2Tokenizer,oS=$.Qwen2VLForConditionalGeneration,sS=$.Qwen2VLImageProcessor,cS=$.Qwen2VLPreTrainedModel,lS=$.Qwen2VLProcessor,uS=$.Qwen3ForCausalLM,dS=$.Qwen3Model,fS=$.Qwen3PreTrainedModel,pS=$.RFDetrForObjectDetection,mS=$.RFDetrModel,hS=$.RFDetrObjectDetectionOutput,gS=$.RFDetrPreTrainedModel,_S=$.RTDetrForObjectDetection,vS=$.RTDetrImageProcessor,yS=$.RTDetrModel,bS=$.RTDetrObjectDetectionOutput,xS=$.RTDetrPreTrainedModel,SS=$.RTDetrV2ForObjectDetection,CS=$.RTDetrV2Model,wS=$.RTDetrV2ObjectDetectionOutput,TS=$.RTDetrV2PreTrainedModel,ES=$.RawAudio,DS=$.RawImage,OS=$.RawVideo,kS=$.RawVideoFrame,AS=$.RepetitionPenaltyLogitsProcessor,jS=$.ResNetForImageClassification,MS=$.ResNetModel,NS=$.ResNetPreTrainedModel,PS=$.RoFormerForMaskedLM,FS=$.RoFormerForQuestionAnswering,IS=$.RoFormerForSequenceClassification,LS=$.RoFormerForTokenClassification,RS=$.RoFormerModel,zS=$.RoFormerPreTrainedModel,BS=$.RoFormerTokenizer,VS=$.RobertaForMaskedLM,HS=$.RobertaForQuestionAnswering,US=$.RobertaForSequenceClassification,WS=$.RobertaForTokenClassification,GS=$.RobertaModel,KS=$.RobertaPreTrainedModel,qS=$.RobertaTokenizer,JS=$.SamImageProcessor,YS=$.SamImageSegmentationOutput,XS=$.SamModel,ZS=$.SamPreTrainedModel,QS=$.SamProcessor,$S=$.SapiensForDepthEstimation,eC=$.SapiensForNormalEstimation,tC=$.SapiensForSemanticSegmentation,nC=$.SapiensPreTrainedModel,rC=$.SeamlessM4TFeatureExtractor,iC=$.SegformerFeatureExtractor,aC=$.SegformerForImageClassification,oC=$.SegformerForSemanticSegmentation,sC=$.SegformerImageProcessor,cC=$.SegformerModel,lC=$.SegformerPreTrainedModel,uC=$.Seq2SeqLMOutput,dC=$.SequenceClassifierOutput,fC=$.SiglipImageProcessor,pC=$.SiglipModel,mC=$.SiglipPreTrainedModel,hC=$.SiglipTextModel,gC=$.SiglipTokenizer,_C=$.SiglipVisionModel,vC=$.SmolVLMForConditionalGeneration,yC=$.SmolVLMImageProcessor,bC=$.SmolVLMProcessor,xC=$.SnacDecoderModel,SC=$.SnacEncoderModel,CC=$.SnacFeatureExtractor,wC=$.SnacModel,TC=$.SnacPreTrainedModel,EC=$.SpeechT5FeatureExtractor,DC=$.SpeechT5ForSpeechToText,OC=$.SpeechT5ForTextToSpeech,kC=$.SpeechT5HifiGan,AC=$.SpeechT5Model,jC=$.SpeechT5PreTrainedModel,MC=$.SpeechT5Processor,NC=$.SpeechT5Tokenizer,PC=$.SqueezeBertForMaskedLM,FC=$.SqueezeBertForQuestionAnswering,IC=$.SqueezeBertForSequenceClassification,LC=$.SqueezeBertModel,RC=$.SqueezeBertPreTrainedModel,zC=$.SqueezeBertTokenizer,BC=$.StableLmForCausalLM,VC=$.StableLmModel,HC=$.StableLmPreTrainedModel,UC=$.Starcoder2ForCausalLM,WC=$.Starcoder2Model,GC=$.Starcoder2PreTrainedModel,KC=$.StoppingCriteria,qC=$.StoppingCriteriaList,JC=$.StyleTextToSpeech2Model,YC=$.StyleTextToSpeech2PreTrainedModel,XC=$.SummarizationPipeline,ZC=$.SuppressTokensAtBeginLogitsProcessor,QC=$.Swin2SRForImageSuperResolution,$C=$.Swin2SRImageProcessor,ew=$.Swin2SRModel,tw=$.Swin2SRPreTrainedModel,nw=$.SwinForImageClassification,rw=$.SwinForSemanticSegmentation,iw=$.SwinModel,aw=$.SwinPreTrainedModel,ow=$.T5ForConditionalGeneration,sw=$.T5Model,cw=$.T5PreTrainedModel,lw=$.T5Tokenizer,uw=$.TableTransformerForObjectDetection,dw=$.TableTransformerModel,fw=$.TableTransformerObjectDetectionOutput,pw=$.TableTransformerPreTrainedModel,mw=$.TemperatureLogitsWarper,hw=$.Tensor,gw=$.Text2TextGenerationPipeline,_w=$.TextClassificationPipeline,vw=$.TextGenerationPipeline,yw=$.TextStreamer,bw=$.TextToAudioPipeline,xw=$.TokenClassificationPipeline,Sw=$.TokenClassifierOutput,Cw=$.TokenizerModel,ww=$.TopKLogitsWarper,Tw=$.TopPLogitsWarper,Ew=$.TrOCRForCausalLM,Dw=$.TrOCRPreTrainedModel,Ow=$.TranslationPipeline,kw=$.UltravoxModel,Aw=$.UltravoxPreTrainedModel,jw=$.UltravoxProcessor,Mw=$.UniSpeechForCTC,Nw=$.UniSpeechForSequenceClassification,Pw=$.UniSpeechModel,Fw=$.UniSpeechPreTrainedModel,Iw=$.UniSpeechSatForAudioFrameClassification,Lw=$.UniSpeechSatForCTC,Rw=$.UniSpeechSatForSequenceClassification,zw=$.UniSpeechSatModel,Bw=$.UniSpeechSatPreTrainedModel,Vw=$.VLChatProcessor,Hw=$.VLMImageProcessor,Uw=$.ViTFeatureExtractor,Ww=$.ViTForImageClassification,Gw=$.ViTImageProcessor,Kw=$.ViTMAEModel,qw=$.ViTMAEPreTrainedModel,Jw=$.ViTMSNForImageClassification,Yw=$.ViTMSNModel,Xw=$.ViTMSNPreTrainedModel,Zw=$.ViTModel,Qw=$.ViTPreTrainedModel,$w=$.VisionEncoderDecoderModel,eT=$.VitMatteForImageMatting,tT=$.VitMatteImageProcessor,nT=$.VitMattePreTrainedModel,rT=$.VitPoseForPoseEstimation,iT=$.VitPoseImageProcessor,aT=$.VitPosePreTrainedModel,oT=$.VitsModel,sT=$.VitsModelOutput,cT=$.VitsPreTrainedModel,lT=$.VitsTokenizer,uT=$.Wav2Vec2BertForCTC,dT=$.Wav2Vec2BertForSequenceClassification,fT=$.Wav2Vec2BertModel,pT=$.Wav2Vec2BertPreTrainedModel,mT=$.Wav2Vec2CTCTokenizer,hT=$.Wav2Vec2FeatureExtractor,gT=$.Wav2Vec2ForAudioFrameClassification,_T=$.Wav2Vec2ForCTC,vT=$.Wav2Vec2ForSequenceClassification,yT=$.Wav2Vec2Model,bT=$.Wav2Vec2PreTrainedModel,xT=$.Wav2Vec2Processor,ST=$.Wav2Vec2ProcessorWithLM,CT=$.WavLMForAudioFrameClassification,wT=$.WavLMForCTC,TT=$.WavLMForSequenceClassification,ET=$.WavLMForXVector,DT=$.WavLMModel,OT=$.WavLMPreTrainedModel,kT=$.WeSpeakerFeatureExtractor,AT=$.WeSpeakerResNetModel,jT=$.WeSpeakerResNetPreTrainedModel,MT=$.WhisperFeatureExtractor,NT=$.WhisperForConditionalGeneration,PT=$.WhisperModel,FT=$.WhisperPreTrainedModel,IT=$.WhisperProcessor,LT=$.WhisperTextStreamer,RT=$.WhisperTimeStampLogitsProcessor,zT=$.WhisperTokenizer,BT=$.XLMForQuestionAnswering,VT=$.XLMForSequenceClassification,HT=$.XLMForTokenClassification,UT=$.XLMModel,WT=$.XLMPreTrainedModel,GT=$.XLMRobertaForMaskedLM,KT=$.XLMRobertaForQuestionAnswering,qT=$.XLMRobertaForSequenceClassification,JT=$.XLMRobertaForTokenClassification,YT=$.XLMRobertaModel,XT=$.XLMRobertaPreTrainedModel,ZT=$.XLMRobertaTokenizer,QT=$.XLMTokenizer,$T=$.XLMWithLMHeadModel,eE=$.XVectorOutput,tE=$.YolosFeatureExtractor,nE=$.YolosForObjectDetection,rE=$.YolosImageProcessor,iE=$.YolosModel,aE=$.YolosObjectDetectionOutput,oE=$.YolosPreTrainedModel,sE=$.ZeroShotAudioClassificationPipeline,cE=$.ZeroShotClassificationPipeline,lE=$.ZeroShotImageClassificationPipeline,uE=$.ZeroShotObjectDetectionPipeline,dE=$.bankers_round,fE=$.cat,pE=$.cos_sim,mE=$.dot,hE=$.dynamic_time_warping,gE=$.env,_E=$.full,vE=$.full_like,yE=$.getKeyValueShapes,bE=$.hamming,xE=$.hanning,SE=$.interpolate,CE=$.interpolate_4d,wE=$.interpolate_data,TE=$.is_chinese_char,EE=$.layer_norm,DE=$.load_image,OE=$.load_video,kE=$.log_softmax,AE=$.magnitude,jE=$.matmul,ME=$.max,NE=$.mean,PE=$.mean_pooling,FE=$.medianFilter,IE=$.mel_filter_bank,LE=$.min,RE=$.ones,zE=$.ones_like,BE=$.permute,VE=$.permute_data,HE=$.pipeline,UE=$.quantize_embeddings,WE=$.rand,GE=$.read_audio,KE=$.rfft,qE=$.round,JE=$.slice,YE=$.softmax,XE=$.spectrogram,ZE=$.stack,QE=$.std_mean,$E=$.topk,eD=$.window_function,tD=$.zeros,nD=$.zeros_like;const rD={flex:``,"flex-col":``,"items-center":``,"gap-4":``},iD=[`disabled`],aD={"h-full":``,"w-full":``,flex:``,"gap-2":``},oD={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,"overflow-hidden":``,"rounded-lg":``},sD=[`src`],cD={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,relative:``,"overflow-hidden":``,"rounded-lg":``},lD={key:0,bg:`black/50`,absolute:``,"inset-0":``,"z-10":``,flex:``,"flex-col":``,"items-center":``,"justify-center":``},uD={"mb-4":``,"text-white":``,"font-medium":``},dD={bg:`gray-200/30`,w:`70%`,"h-2":``,"overflow-hidden":``,"rounded-full":``},fD=[`src`],pD={bg:`black/0 group-hover:black/20`,absolute:``,"inset-0":``,flex:``,"items-center":``,"justify-center":``,"transition-all":``,"duration-200":``},mD=[`onClick`],hD={key:1,absolute:``,"bottom-2":``,"right-2":``};var gD=l({__name:`background-remove`,setup(e){let n=p(),r=p(),l=p(),y=p(),b=p(!1),x=p(0),S=p(),C=p(),w=p([]),T=i(()=>w.value.map(e=>URL.createObjectURL(e)));d(async()=>{try{if(!(await v()).supported)throw Error(`WebGPU is not supported in this browser.`);let e=`Xenova/modnet`;gE.backends.onnx.wasm.proxy=!1,n.value??=await Bf.from_pretrained(e,{device:`webgpu`}),r.value??=await _p.from_pretrained(e,{})}catch(e){l.value=e}y.value=!1});async function E(){if(!n.value||!r.value)return;b.value=!0,x.value=0,S.value=[];let e=T.value.length;for(let t=0;t=S.value.length||!w.value[e])return;let t=w.value[e].name,n=t.substring(0,t.lastIndexOf(`.`))||t,r=t.substring(t.lastIndexOf(`.`))||`.png`,i=`${n}-background-removed${r}`,a=document.createElement(`a`);a.href=S.value[e],a.download=i,document.body.appendChild(a),a.click(),document.body.removeChild(a)}function O(){!S.value||S.value.length===0||S.value.forEach((e,t)=>{setTimeout(()=>D(t),t*100)})}return(e,n)=>(f(),s(`div`,rD,[a(`button`,{bg:`neutral-100 dark:neutral-800`,"w-full":``,"cursor-pointer":``,"rounded-lg":``,"px-3":``,"py-2":``,disabled:b.value,onClick:E},h(b.value?`Processing...`:`Process`),9,iD),a(`div`,aD,[a(`div`,oD,[(f(!0),s(t,null,m(T.value,(e,t)=>(f(),s(`img`,{key:t,src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,sD))),128))]),a(`div`,cD,[b.value?(f(),s(`div`,lD,[a(`div`,uD,h(x.value)+`% `,1),a(`div`,dD,[a(`div`,{bg:`emerald-500`,"h-full":``,style:u({width:`${x.value}%`}),"transition-all":``,"duration-200":``},null,4)])])):o(``,!0),(f(!0),s(t,null,m(S.value,(e,t)=>(f(),s(`div`,{key:t,relative:``,class:`group`,"h-full":``,"w-full":``},[a(`img`,{src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,fD),a(`div`,pD,[a(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,"opacity-0":``,"transition-all":``,"duration-200":``,"group-hover:opacity-100":``,onClick:e=>D(t)},n[1]||=[a(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[a(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})],-1)],8,mD)])]))),128)),S.value&&S.value.length>1?(f(),s(`div`,hD,[a(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,onClick:O},n[2]||=[a(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[a(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12`})],-1)])])):o(``,!0)])]),c(g(_),{modelValue:w.value,"onUpdate:modelValue":n[0]||=e=>w.value=e,"w-full":``},null,8,[`modelValue`])]))}}),_D=gD;export{_D as default}; \ No newline at end of file diff --git a/assets/browser-C4moGI0I.js b/assets/browser-C4moGI0I.js new file mode 100644 index 0000000000000000000000000000000000000000..314eb64a2379587df5913be9fb270d0717dd9c08 --- /dev/null +++ b/assets/browser-C4moGI0I.js @@ -0,0 +1 @@ +var e=class{constructor(e,t){this.pixels=e,this.opts=t;let{sigBits:n}=t,r=(e,t,r)=>(e<<2*n)+(t<>=i,m>>=i,h>>=i;let n=r(p,m,h);o[n]===void 0&&(o[n]=0),o[n]+=1,p>s&&(s=p),pl&&(l=m),md&&(d=h),ht>0?e+1:e,0),this.hist=o,this.rmax=s,this.rmin=c,this.gmax=l,this.gmin=u,this.bmax=d,this.bmin=f}get colorCount(){return this._colorCount}},t=class{scaleDown(e){let t=this.getWidth(),n=this.getHeight(),r=1;if(e.maxDimension>0){let i=Math.max(t,n);i>e.maxDimension&&(r=e.maxDimension/i)}else r=1/e.quality;r<1&&this.resize(t*r,n*r,r)}};function n(e,t){var n;if(t.length>0){let r=e.data,i=r.length/4,a,o,s,c,l;for(let e=0;e{let i=()=>{this._initCanvas(),e(this)};t.complete?i():(t.onload=i,t.onerror=e=>r(Error(`Fail to load image: ${n}`)))})}clear(){this._getContext().clearRect(0,0,this._getWidth(),this._getHeight())}update(e){this._getContext().putImageData(e,0,0)}getWidth(){return this._getWidth()}getHeight(){return this._getHeight()}resize(e,t,n){if(!this.image)throw Error(`Image is not initialized`);this._width=this._getCanvas().width=e,this._height=this._getCanvas().height=t,this._getContext().scale(n,n),this._getContext().drawImage(this.image,0,0)}getPixelCount(){return this._getWidth()*this._getHeight()}getImageData(){return this._getContext().getImageData(0,0,this._getWidth(),this._getHeight())}remove(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)}};function o(e,...t){return t.forEach(t=>{if(t){for(let n in t)if(t.hasOwnProperty(n)){let r=t[n];Array.isArray(r)?e[n]=r.slice(0):typeof r==`object`?(e[n]||(e[n]={}),o(e[n],r)):e[n]=r}}}),e}function s(e,t){let{colorCount:n,quantizer:r,generators:i,filters:a}=e,s={colorCount:n},c=typeof r==`string`?{name:r,options:{}}:r;return c.options=o({},s,c.options),o({},{quantizer:c,generators:i,filters:a},t)}var c=class{constructor(e,t={}){this._src=e,this._opts=o({},g.DefaultOpts,t)}maxColorCount(e){return this._opts.colorCount=e,this}maxDimension(e){return this._opts.maxDimension=e,this}addFilter(e){return this._opts.filters?this._opts.filters.push(e):this._opts.filters=[e],this}removeFilter(e){if(this._opts.filters){let t=this._opts.filters.indexOf(e);t>0&&this._opts.filters.splice(t)}return this}clearFilters(){return this._opts.filters=[],this}quality(e){return this._opts.quality=e,this}useImageClass(e){return this._opts.ImageClass=e,this}useGenerator(e,t){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(t?{name:e,options:t}:e),this}useQuantizer(e,t){return this._opts.quantizer=t?{name:e,options:t}:e,this}build(){return new g(this._src,this._opts)}getPalette(){return this.build().getPalette()}},l=class{constructor(e){this.pipeline=e,this._map={}}names(){return Object.keys(this._map)}has(e){return!!this._map[e]}get(e){return this._map[e]}register(e,t){return this._map[e]=t,this.pipeline}},u=class{constructor(){this.filter=new l(this),this.quantizer=new l(this),this.generator=new l(this)}_buildProcessTasks({filters:e,quantizer:t,generators:n}){return n.length===1&&n[0]===`*`&&(n=this.generator.names()),{filters:e.map(e=>r(this.filter,e)),quantizer:r(this.quantizer,t),generators:n.map(e=>r(this.generator,e))};function r(e,t){let n,r;return typeof t==`string`?n=t:(n=t.name,r=t.options),{name:n,fn:e.get(n),options:r}}}async process(e,t){let{filters:n,quantizer:r,generators:i}=this._buildProcessTasks(t),a=await this._filterColors(n,e),o=await this._generateColors(r,a),s=await this._generatePalettes(i,o);return{colors:o,palettes:s}}_filterColors(e,t){return Promise.resolve(n(t,e.map(({fn:e})=>e)))}_generateColors(e,t){return Promise.resolve(e.fn(t.data,e.options))}async _generatePalettes(e,t){let n=await Promise.all(e.map(({fn:e,options:n})=>Promise.resolve(e(t,n))));return Promise.resolve(n.reduce((t,n,r)=>(t[e[r].name]=n,t),{}))}};function d(e,t,n){return`#`+((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1,7)}function f(e,t,n){e/=255,t/=255,n/=255;let r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=0,s=(r+i)/2;if(r!==i){let c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(t===0)r=i=a=n;else{let s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return[r*255,i*255,a*255]}var m=class e{static applyFilters(e,t){return t.length>0?e.filter(({r:e,g:n,b:r})=>{var i;for(let a=0;a>=v,n>>=v,r>>=v,t>=i&&t<=a&&n>=o&&n<=s&&r>=c&&r<=l}split(){let{hist:e,getColorIndex:t}=this.histogram,{r1:n,r2:r,g1:i,g2:a,b1:o,b2:s}=this.dimension,c=this.count();if(!c)return[];if(c===1)return[this.clone()];let l=r-n+1,u=a-i+1,d=s-o+1,f=Math.max(l,u,d),p=null,m,h;m=h=0;let g=null;if(f===l){g=`r`,p=new Uint32Array(r+1);for(let c=n;c<=r;c++){m=0;for(let n=i;n<=a;n++)for(let r=o;r<=s;r++){let i=t(c,n,r);e[i]&&(m+=e[i])}h+=m,p[c]=h}}else if(f===u){g=`g`,p=new Uint32Array(a+1);for(let c=i;c<=a;c++){m=0;for(let i=n;i<=r;i++)for(let n=o;n<=s;n++){let r=t(i,c,n);e[r]&&(m+=e[r])}h+=m,p[c]=h}}else{g=`b`,p=new Uint32Array(s+1);for(let c=o;c<=s;c++){m=0;for(let o=n;o<=r;o++)for(let n=i;n<=a;n++){let r=t(o,n,c);e[r]&&(m+=e[r])}h+=m,p[c]=h}}let _=-1,v=new Uint32Array(p.length);for(let e=0;eh/2&&(_=e),v[e]=h-t)}let y=this;function b(e){let t=e+`1`,n=e+`2`,r=y.dimension[t],i=y.dimension[n],a=y.clone(),o=y.clone(),s=_-r,c=i-_;for(s<=c?(i=Math.min(i-1,~~(_+c/2)),i=Math.max(0,i)):(i=Math.max(r,~~(_-1-s/2)),i=Math.min(y.dimension[n],i));!p[i];)i++;let l=v[i];for(;!l&&p[i-1];)l=v[--i];return a.dimension[n]=i,o.dimension[t]=i+1,[a,o]}return b(g)}},b=class{_sort(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)}constructor(e){this._comparator=e,this.contents=[],this._sorted=!1}push(e){this.contents.push(e),this._sorted=!1}peek(e){return this._sort(),e=typeof e==`number`?e:this.contents.length-1,this.contents[e]}pop(){return this._sort(),this.contents.pop()}size(){return this.contents.length}map(e){return this._sort(),this.contents.map(e)}};const x=.75;function S(e,t){let n=e.size();for(;e.size()0){let[r,i]=t.split();if(!r||(e.push(r),i&&i.count()>0&&e.push(i),e.size()===n))break;n=e.size()}else break}}const C=(e,t)=>{if(e.length===0||t.colorCount<2||t.colorCount>256)throw Error(`Wrong MMCQ parameters`);let n=y.build(e);n.histogram.colorCount;let r=new b((e,t)=>e.count()-t.count());r.push(n),S(r,x*t.colorCount);let i=new b((e,t)=>e.count()*e.volume()-t.count()*t.volume());return i.contents=r.contents,S(i,t.colorCount-i.size()),w(i)};function w(e){let t=[];for(;e.size();){let n=e.pop(),r=n.avg();t.push(new m(r,n.count()))}return t}const T={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function E(e){let t=0;return e.forEach(e=>{t=Math.max(t,e.population)}),t}function D(e,t){return e.Vibrant===t||e.DarkVibrant===t||e.LightVibrant===t||e.Muted===t||e.DarkMuted===t||e.LightMuted===t}function O(e,t,n,r,i,a,o){function s(...e){let t=0,n=0;for(let r=0;r{let[,f,p]=t.hsl;if(f>=s&&f<=c&&p>=i&&p<=a&&!D(e,t)){let e=O(f,o,p,r,t.population,n,l);(u===null||e>d)&&(u=t,d=e)}}),u}function A(e,t,n){let r={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return r.Vibrant=k(r,e,t,n.targetNormalLuma,n.minNormalLuma,n.maxNormalLuma,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.LightVibrant=k(r,e,t,n.targetLightLuma,n.minLightLuma,1,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.DarkVibrant=k(r,e,t,n.targetDarkLuma,0,n.maxDarkLuma,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.Muted=k(r,e,t,n.targetNormalLuma,n.minNormalLuma,n.maxNormalLuma,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r.LightMuted=k(r,e,t,n.targetLightLuma,n.minLightLuma,1,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r.DarkMuted=k(r,e,t,n.targetDarkLuma,0,n.maxDarkLuma,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r}function j(e,t,n){if(!e.Vibrant&&!e.DarkVibrant&&!e.LightVibrant){if(!e.DarkVibrant&&e.DarkMuted){let[t,r,i]=e.DarkMuted.hsl;i=n.targetDarkLuma,e.DarkVibrant=new m(p(t,r,i),0)}if(!e.LightVibrant&&e.LightMuted){let[t,r,i]=e.LightMuted.hsl;i=n.targetDarkLuma,e.DarkVibrant=new m(p(t,r,i),0)}}if(!e.Vibrant&&e.DarkVibrant){let[t,r,i]=e.DarkVibrant.hsl;i=n.targetNormalLuma,e.Vibrant=new m(p(t,r,i),0)}else if(!e.Vibrant&&e.LightVibrant){let[t,r,i]=e.LightVibrant.hsl;i=n.targetNormalLuma,e.Vibrant=new m(p(t,r,i),0)}if(!e.DarkVibrant&&e.Vibrant){let[t,r,i]=e.Vibrant.hsl;i=n.targetDarkLuma,e.DarkVibrant=new m(p(t,r,i),0)}if(!e.LightVibrant&&e.Vibrant){let[t,r,i]=e.Vibrant.hsl;i=n.targetLightLuma,e.LightVibrant=new m(p(t,r,i),0)}if(!e.Muted&&e.Vibrant){let[t,r,i]=e.Vibrant.hsl;i=n.targetMutesSaturation,e.Muted=new m(p(t,r,i),0)}if(!e.DarkMuted&&e.DarkVibrant){let[t,r,i]=e.DarkVibrant.hsl;i=n.targetMutesSaturation,e.DarkMuted=new m(p(t,r,i),0)}if(!e.LightMuted&&e.LightVibrant){let[t,r,i]=e.LightVibrant.hsl;i=n.targetMutesSaturation,e.LightMuted=new m(p(t,r,i),0)}}const M=(e,t)=>{t=Object.assign({},T,t);let n=E(e),r=A(e,n,t);return j(r,n,t),r},N=new u().filter.register(`default`,(e,t,n,r)=>r>=125&&!(e>250&&t>250&&n>250)).quantizer.register(`mmcq`,C).generator.register(`default`,M);g.use(N);export{g as Vibrant}; \ No newline at end of file diff --git a/assets/browser-CMSJHaBF.js b/assets/browser-CMSJHaBF.js new file mode 100644 index 0000000000000000000000000000000000000000..98eafa7deca52d0941cbebaf395615ed724a3b5b --- /dev/null +++ b/assets/browser-CMSJHaBF.js @@ -0,0 +1 @@ +var e=typeof Worker<`u`?Worker:void 0;export{e as default}; \ No newline at end of file diff --git a/assets/browser-CkchkNbv.js b/assets/browser-CkchkNbv.js deleted file mode 100644 index 0ffab0dff80f0ac04e9e7967a535ed67a79de9a7..0000000000000000000000000000000000000000 --- a/assets/browser-CkchkNbv.js +++ /dev/null @@ -1 +0,0 @@ -class R{constructor(t,e){this.pixels=t,this.opts=e;const{sigBits:i}=e,n=(x,k,f)=>(x<<2*i)+(k<>s,g=g>>s,d=d>>s;const k=n(c,g,d);o[k]===void 0&&(o[k]=0),o[k]+=1,c>h&&(h=c),cl&&(l=g),g_&&(_=d),dk>0?x+1:x,0),this.hist=o,this.rmax=h,this.rmin=u,this.gmax=l,this.gmin=m,this.bmax=_,this.bmin=b}get colorCount(){return this._colorCount}}class Q{scaleDown(t){const e=this.getWidth(),i=this.getHeight();let n=1;if(t.maxDimension>0){const s=Math.max(e,i);s>t.maxDimension&&(n=t.maxDimension/s)}else n=1/t.quality;n<1&&this.resize(e*n,i*n,n)}}function G(r,t){var e;if(t.length>0){const i=r.data,n=i.length/4;let s,a,o,h,u;for(let l=0;l{const a=()=>{this._initCanvas(),n(this)};e.complete?a():(e.onload=a,e.onerror=o=>s(new Error(`Fail to load image: ${i}`)))})}clear(){this._getContext().clearRect(0,0,this._getWidth(),this._getHeight())}update(t){this._getContext().putImageData(t,0,0)}getWidth(){return this._getWidth()}getHeight(){return this._getHeight()}resize(t,e,i){if(!this.image)throw new Error("Image is not initialized");this._width=this._getCanvas().width=t,this._height=this._getCanvas().height=e,this._getContext().scale(i,i),this._getContext().drawImage(this.image,0,0)}getPixelCount(){return this._getWidth()*this._getHeight()}getImageData(){return this._getContext().getImageData(0,0,this._getWidth(),this._getHeight())}remove(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)}}function I(r,...t){return t.forEach(e=>{if(e){for(const i in e)if(e.hasOwnProperty(i)){const n=e[i];Array.isArray(n)?r[i]=n.slice(0):typeof n=="object"?(r[i]||(r[i]={}),I(r[i],n)):r[i]=n}}}),r}function $(r,t){const{colorCount:e,quantizer:i,generators:n,filters:s}=r,a={colorCount:e},o=typeof i=="string"?{name:i,options:{}}:i;return o.options=I({},a,o.options),I({},{quantizer:o,generators:n,filters:s},t)}class K{constructor(t,e={}){this._src=t,this._opts=I({},S.DefaultOpts,e)}maxColorCount(t){return this._opts.colorCount=t,this}maxDimension(t){return this._opts.maxDimension=t,this}addFilter(t){return this._opts.filters?this._opts.filters.push(t):this._opts.filters=[t],this}removeFilter(t){if(this._opts.filters){const e=this._opts.filters.indexOf(t);e>0&&this._opts.filters.splice(e)}return this}clearFilters(){return this._opts.filters=[],this}quality(t){return this._opts.quality=t,this}useImageClass(t){return this._opts.ImageClass=t,this}useGenerator(t,e){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(e?{name:t,options:e}:t),this}useQuantizer(t,e){return this._opts.quantizer=e?{name:t,options:e}:t,this}build(){return new S(this._src,this._opts)}getPalette(){return this.build().getPalette()}}class E{constructor(t){this.pipeline=t,this._map={}}names(){return Object.keys(this._map)}has(t){return!!this._map[t]}get(t){return this._map[t]}register(t,e){return this._map[t]=e,this.pipeline}}class Z{constructor(){this.filter=new E(this),this.quantizer=new E(this),this.generator=new E(this)}_buildProcessTasks({filters:t,quantizer:e,generators:i}){return i.length===1&&i[0]==="*"&&(i=this.generator.names()),{filters:t.map(s=>n(this.filter,s)),quantizer:n(this.quantizer,e),generators:i.map(s=>n(this.generator,s))};function n(s,a){let o,h;return typeof a=="string"?o=a:(o=a.name,h=a.options),{name:o,fn:s.get(o),options:h}}}async process(t,e){const{filters:i,quantizer:n,generators:s}=this._buildProcessTasks(e),a=await this._filterColors(i,t),o=await this._generateColors(n,a),h=await this._generatePalettes(s,o);return{colors:o,palettes:h}}_filterColors(t,e){return Promise.resolve(G(e,t.map(({fn:i})=>i)))}_generateColors(t,e){return Promise.resolve(t.fn(e.data,t.options))}async _generatePalettes(t,e){const i=await Promise.all(t.map(({fn:n,options:s})=>Promise.resolve(n(e,s))));return Promise.resolve(i.reduce((n,s,a)=>(n[t[a].name]=s,n),{}))}}function tt(r,t,e){return"#"+((1<<24)+(r<<16)+(t<<8)+e).toString(16).slice(1,7)}function et(r,t,e){r/=255,t/=255,e/=255;const i=Math.max(r,t,e),n=Math.min(r,t,e);let s=0,a=0;const o=(i+n)/2;if(i!==n){const h=i-n;switch(a=o>.5?h/(2-i-n):h/(i+n),i){case r:s=(t-e)/h+(t1&&(u-=1),u<1/6?o+(h-o)*6*u:u<1/2?h:u<2/3?o+(h-o)*(2/3-u)*6:o}if(t===0)i=n=s=e;else{const o=e<.5?e*(1+t):e+t-e*t,h=2*e-o;i=a(h,o,r+1/3),n=a(h,o,r),s=a(h,o,r-1/3)}return[i*255,n*255,s*255]}class V{static applyFilters(t,e){return e.length>0?t.filter(({r:i,g:n,b:s})=>{var a;for(let o=0;o>=O,i>>=O,n>>=O,e>=s&&e<=a&&i>=o&&i<=h&&n>=u&&n<=l}split(){const{hist:t,getColorIndex:e}=this.histogram,{r1:i,r2:n,g1:s,g2:a,b1:o,b2:h}=this.dimension,u=this.count();if(!u)return[];if(u===1)return[this.clone()];const l=n-i+1,m=a-s+1,_=h-o+1,b=Math.max(l,m,_);let c=null,g,d;g=d=0;let M=null;if(b===l){M="r",c=new Uint32Array(n+1);for(let f=i;f<=n;f++){g=0;for(let w=s;w<=a;w++)for(let v=o;v<=h;v++){const D=e(f,w,v);t[D]&&(g+=t[D])}d+=g,c[f]=d}}else if(b===m){M="g",c=new Uint32Array(a+1);for(let f=s;f<=a;f++){g=0;for(let w=i;w<=n;w++)for(let v=o;v<=h;v++){const D=e(w,f,v);t[D]&&(g+=t[D])}d+=g,c[f]=d}}else{M="b",c=new Uint32Array(h+1);for(let f=o;f<=h;f++){g=0;for(let w=i;w<=n;w++)for(let v=s;v<=a;v++){const D=e(w,v,f);t[D]&&(g+=t[D])}d+=g,c[f]=d}}let L=-1;const y=new Uint32Array(c.length);for(let f=0;fd/2&&(L=f),y[f]=d-w)}const x=this;function k(f){const w=f+"1",v=f+"2",D=x.dimension[w];let C=x.dimension[v];const q=x.clone(),H=x.clone(),A=L-D,U=C-L;for(A<=U?(C=Math.min(C-1,~~(L+U/2)),C=Math.max(0,C)):(C=Math.max(D,~~(L-1-A/2)),C=Math.min(x.dimension[v],C));!c[C];)C++;let F=y[C];for(;!F&&c[C-1];)F=y[--C];return q.dimension[v]=C,H.dimension[w]=C+1,[q,H]}return k(M)}}class W{_sort(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)}constructor(t){this._comparator=t,this.contents=[],this._sorted=!1}push(t){this.contents.push(t),this._sorted=!1}peek(t){return this._sort(),t=typeof t=="number"?t:this.contents.length-1,this.contents[t]}pop(){return this._sort(),this.contents.pop()}size(){return this.contents.length}map(t){return this._sort(),this.contents.map(t)}}const it=.75;function j(r,t){let e=r.size();for(;r.size()0){const[n,s]=i.split();if(!n||(r.push(n),s&&s.count()>0&&r.push(s),r.size()===e))break;e=r.size()}else break}}const rt=(r,t)=>{if(r.length===0||t.colorCount<2||t.colorCount>256)throw new Error("Wrong MMCQ parameters");const e=P.build(r);e.histogram.colorCount;const i=new W((s,a)=>s.count()-a.count());i.push(e),j(i,it*t.colorCount);const n=new W((s,a)=>s.count()*s.volume()-a.count()*a.volume());return n.contents=i.contents,j(n,t.colorCount-n.size()),nt(n)};function nt(r){const t=[];for(;r.size();){const e=r.pop(),i=e.avg();t.push(new V(i,e.count()))}return t}const st={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function ot(r){let t=0;return r.forEach(e=>{t=Math.max(t,e.population)}),t}function at(r,t){return r.Vibrant===t||r.DarkVibrant===t||r.LightVibrant===t||r.Muted===t||r.DarkMuted===t||r.LightMuted===t}function ht(r,t,e,i,n,s,a){function o(...u){let l=0,m=0;for(let _=0;_{const[,b,c]=_.hsl;if(b>=o&&b<=h&&c>=n&&c<=s&&!at(r,_)){const g=ht(b,a,c,i,_.population,e,u);(l===null||g>m)&&(l=_,m=g)}}),l}function ut(r,t,e){const i={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return i.Vibrant=z(i,r,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.LightVibrant=z(i,r,t,e.targetLightLuma,e.minLightLuma,1,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.DarkVibrant=z(i,r,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.Muted=z(i,r,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.LightMuted=z(i,r,t,e.targetLightLuma,e.minLightLuma,1,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.DarkMuted=z(i,r,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i}function lt(r,t,e){if(!r.Vibrant&&!r.DarkVibrant&&!r.LightVibrant){if(!r.DarkVibrant&&r.DarkMuted){let[i,n,s]=r.DarkMuted.hsl;s=e.targetDarkLuma,r.DarkVibrant=new V(p(i,n,s),0)}if(!r.LightVibrant&&r.LightMuted){let[i,n,s]=r.LightMuted.hsl;s=e.targetDarkLuma,r.DarkVibrant=new V(p(i,n,s),0)}}if(!r.Vibrant&&r.DarkVibrant){let[i,n,s]=r.DarkVibrant.hsl;s=e.targetNormalLuma,r.Vibrant=new V(p(i,n,s),0)}else if(!r.Vibrant&&r.LightVibrant){let[i,n,s]=r.LightVibrant.hsl;s=e.targetNormalLuma,r.Vibrant=new V(p(i,n,s),0)}if(!r.DarkVibrant&&r.Vibrant){let[i,n,s]=r.Vibrant.hsl;s=e.targetDarkLuma,r.DarkVibrant=new V(p(i,n,s),0)}if(!r.LightVibrant&&r.Vibrant){let[i,n,s]=r.Vibrant.hsl;s=e.targetLightLuma,r.LightVibrant=new V(p(i,n,s),0)}if(!r.Muted&&r.Vibrant){let[i,n,s]=r.Vibrant.hsl;s=e.targetMutesSaturation,r.Muted=new V(p(i,n,s),0)}if(!r.DarkMuted&&r.DarkVibrant){let[i,n,s]=r.DarkVibrant.hsl;s=e.targetMutesSaturation,r.DarkMuted=new V(p(i,n,s),0)}if(!r.LightMuted&&r.LightVibrant){let[i,n,s]=r.LightVibrant.hsl;s=e.targetMutesSaturation,r.LightMuted=new V(p(i,n,s),0)}}const ct=(r,t)=>{t=Object.assign({},st,t);const e=ot(r),i=ut(r,e,t);return lt(i,e,t),i},gt=new Z().filter.register("default",(r,t,e,i)=>i>=125&&!(r>250&&t>250&&e>250)).quantizer.register("mmcq",rt).generator.register("default",ct);S.use(gt);export{S as V}; diff --git a/assets/chat-Cm78FyKU.js b/assets/chat-Cm78FyKU.js new file mode 100644 index 0000000000000000000000000000000000000000..0b1f1929e4595214b3238c10e1d219f07ed3be66 --- /dev/null +++ b/assets/chat-Cm78FyKU.js @@ -0,0 +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-BtAisBe9.js";import{streamText as g}from"./dist-DQi82Mjd.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/chat-w4dxGa81.js b/assets/chat-w4dxGa81.js deleted file mode 100644 index 96ecaadbbc5571e3c2cac9124522cc9dee0e8920..0000000000000000000000000000000000000000 --- a/assets/chat-w4dxGa81.js +++ /dev/null @@ -1,3 +0,0 @@ -var V=t=>{throw TypeError(t)};var P=(t,o,e)=>o.has(t)||V("Cannot "+e);var b=(t,o,e)=>(P(t,o,"read from private field"),e?e.call(t):o.get(t)),M=(t,o,e)=>o.has(t)?V("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(t):o.set(t,e),_=(t,o,e,n)=>(P(t,o,"write to private field"),n?n.call(t,e):o.set(t,e),e);import{d as re,c9 as j,e as L,c as T,o as C,a as c,bh as R,ca as A,u as U,bE as N,c3 as oe,c4 as se,bd as ae,W as B,Y as J}from"./index-D7HCX4VR.js";import{s as le}from"./index-Dpfqqu9L.js";import"./index-LHmcipjy.js";const X=()=>{let t=null;return{getStore:()=>(t===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),t),run(o,e){t=o;try{return e()}finally{t=null}}}},Z=new WeakMap,ee=new WeakMap;let ue=0,ie=0;const W=t=>{const o=`${ue++}`,e={debugLabel:o,include:s=>n.has(s),with:s=>{const i=`${ie++}`,l={[Symbol.toStringTag]:`WorkflowEvent(${o}.${i})`,toString:()=>`WorkflowEvent(${o}.${i})`,toJSON:()=>({type:o,data:s}),get data(){return s}};return n.add(l),ee.set(l,e),l}},n=new WeakSet;Z.set(e,n),Object.defineProperty(e,Symbol.toStringTag,{get:()=>(e==null?void 0:e.debugLabel)??`WorkflowEvent<${o}>`}),Object.defineProperty(e,"displayName",{value:(e==null?void 0:e.debugLabel)??`WorkflowEvent<${o}>`});let r=t==null?void 0:t.uniqueId;return Object.defineProperty(e,"uniqueId",{get:()=>(r||(r=o),r),set:()=>{throw new Error("uniqueId is readonly")}}),e.toString=()=>`WorkflowEvent<${o}>`,e},K=t=>typeof t=="object"&&t!==null?Z.has(t):!1,H=t=>typeof t=="object"&&t!==null?ee.get(t):void 0,F=t=>t!=null&&typeof t=="object"&&"data"in t,ce=t=>t!=null&&typeof t.then=="function";function z(t,o){const e=new Array(t.length);for(const n of o)for(let r=0;r(t.add(e),()=>{t.delete(e)}),publish:(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}};return te.set(o,t),o}var de=class extends TransformStream{constructor(){super({transform:(t,o)=>{H(t)&&o.enqueue(JSON.stringify({data:t.data,uniqueId:H(t).uniqueId})+` -`)}})}},q,Q,pe=(Q=class extends TransformStream{constructor(o){super({transform:(e,n)=>{e.split(` -`).map(s=>s.trim()).filter(s=>s.length>0).forEach(s=>{const i=JSON.parse(s),l=Object.values(b(this,q)).find(a=>a.uniqueId===i.uniqueId);if(l){const a=l.with(i.data);n.enqueue(a)}else console.warn(`Unknown event: ${i.uniqueId}`)})}});M(this,q);_(this,q,o)}},q=new WeakMap,Q),w,x,y,fe=(y=class extends ReadableStream{constructor(e,n){if(!e&&!n)throw new TypeError("Either subscribable or root stream must be provided");super();M(this,w);M(this,x);if(e){_(this,x,e);let r;_(this,w,n??new ReadableStream({start:s=>{r=e.subscribe(i=>{s.enqueue(i)})},cancel:()=>{r()}}))}else{_(this,x,I()),_(this,w,n.pipeThrough(new TransformStream({transform:(r,s)=>{b(this,x).publish(r),s.enqueue(r)}})));return}}on(e,n){return b(this,x).subscribe(r=>{e.include(r)&&n(r)})}static fromReadableStream(e){return new y(null,e.pipeThrough(new TransformStream({transform:(n,r)=>{r.enqueue(n)}})))}static fromResponse(e,n){const r=e.body;if(!r)throw new Error("Response body is not readable");return new y(null,r.pipeThrough(new TextDecoderStream).pipeThrough(new pe(n)))}toResponse(e,n=new de){return new Response(b(this,w).pipeThrough(n).pipeThrough(new TextEncoderStream),e)}get locked(){return b(this,w).locked}[Symbol.asyncIterator](){return b(this,w)[Symbol.asyncIterator]()}cancel(e){return b(this,w).cancel(e)}getReader(){return b(this,w).getReader()}pipeThrough(e,n){const r=b(this,w).pipeThrough(e,n);return new y(null,r)}pipeTo(e,n){return b(this,w).pipeTo(e,n)}tee(){const[e,n]=b(this,w).tee();return[new y(b(this,x),e),new y(b(this,x),n)]}forEach(e){return b(this,w).pipeTo(new WritableStream({write:n=>{e(n)}}))}map(e){return this.pipeThrough(new TransformStream({transform:(n,r)=>{r.enqueue(e(n))}}))}values(e){return b(this,w).values(e)}take(e){let n=0;return this.pipeThrough(new TransformStream({transform:(r,s)=>{n=e&&s.terminate()}}))}filter(e){return this.pipeThrough(new TransformStream({transform:(n,r)=>{(typeof e=="function"?e(n):K(e)?e.include(n):e===n)&&r.enqueue(n)}}))}until(e){return this.pipeThrough(new TransformStream({transform:(n,r)=>{r.enqueue(n),(typeof e=="function"?e(n):K(e)?e.include(n):e===n)&&r.terminate()}}))}async toArray(){const e=[];return await this.pipeTo(new WritableStream({write:n=>{e.push(n)}})),e}},w=new WeakMap,x=new WeakMap,y);const ne=X();function O(){const t=ne.getStore();if(!t)throw new Error("No current context found");return t}const he=X(),G=new WeakMap,me=({listeners:t})=>{const o=[],e=(a,d,f,m)=>{let h;const g={get abortController(){return h||(h=new AbortController),h},async:"constructor"in a?a.constructor.name==="AsyncFunction":!1,pending:null,handler:a,inputEvents:d,inputs:f,outputs:[],prev:m,next:new Set,get root(){return i}};g.prev.next.add(g);const v=r(g);he.run(g,()=>{const u=[...new Set([...Y(l.__internal__call_context),...Y(v.__internal__call_context)])];ne.run(v,()=>{let p=0;const k=$=>{if(p===u.length){let E;try{E=$.handler(...$.inputs)}catch(S){if(h??s)(h??s).abort(S);else throw console.error("unhandled error in handler",S),S}ce(E)?(g.async=!0,g.pending=E.then(S=>(F(S)&&v.sendEvent(S),S))):F(E)&&v.sendEvent(E)}const D=u[p];D&&(p++,D($,k))};k(g)})})},n=a=>{const d=[...o];[...t].filter(([f])=>z(f,d).length===f.length).map(([f,m])=>{const h=z(f,d);h.forEach(g=>{o.splice(o.indexOf(g),1)});for(const g of m)e(g,f,h,a)})},r=a=>{let d=null;return{get stream(){if(!d){const f=I();l.__internal__call_send_event.subscribe(m=>{let h=G.get(m);for(;h;){if(h===a){f.publish(m);break}h=h.prev}}),d=new fe(f,null)}return d},get signal(){return a.abortController.signal},sendEvent:(...f)=>{f.forEach(m=>{G.set(m,a),a.outputs.push(m),o.push(m),l.__internal__call_send_event.publish(m,a),n(a)})},__internal__call_context:I(),__internal__call_send_event:I()}};let s=new AbortController;const i={get abortController(){return s||(s=new AbortController),s},async:!1,pending:null,inputEvents:[],inputs:[],outputs:[],handler:null,prev:null,next:new Set,get root(){return i}},l=r(i);return l},be=()=>{const t={steps:new Map};return{handle:(o,e)=>{if(t.steps.has(o))t.steps.get(o).add(e);else{const n=new Set;n.add(e),t.steps.set(o,n)}},createContext(){return me({listeners:t.steps})}}};function we(t,o){const e=(...n)=>{const r=o.filter(([l])=>l.every((a,d)=>a.include(n[d]))).map(([l,a])=>a),i=O().sendEvent;return(...l)=>{for(let a=0;af.include(l[m])))return i(...l)}return console.warn("Invalid input detected [%s]",l.map(a=>a.data).join(", ")),i(...l)}};return{...t,strictHandle:(n,r)=>{const s=(...i)=>{const l=O();return r(l.safeSendEvent,...i)};return t.handle(n,s)},createContext(){const n=t.createContext();return n.__internal__call_context.subscribe((r,s)=>{O().safeSendEvent=e(...r.inputs),s(r)}),n}}}async function ge(t,o,e){const{stream:n,sendEvent:r}=t.createContext();r(o);const s=(await n.until(e).toArray()).at(-1);if(!s)throw new Error("No output event received");return s}const ve={flex:"","flex-col":"","gap-2":""},ye={flex:"~ col","gap-2":""},xe={flex:"","flex-col":"","gap-2":""},ke={grid:"","grid-cols-2":"","gap-2":""},Se={flex:"","items-center":"","gap-2":""},_e={flex:"","items-center":"","gap-2":""},Ee={flex:"","items-center":"","gap-2":""},Te={key:0},Ce={key:1},Re=re({__name:"chat",setup(t){const o=j("settings/llm/baseUrl","https://openrouter.ai/api/v1/"),e=j("settings/llm/apiKey",""),n=j("settings/llm/model","openai/gpt-4o-mini"),r=L(""),s=L([]),i=L({role:"assistant",content:""}),l=L(!1),a=W(),d=W(),f=W(),m=W(),h=W();async function g(){l.value=!0;try{const v=we(be(),[[[a],[d,h]],[[d],[f]],[[f],[m]]]);v.handle([a],async()=>{const{sendEvent:u}=v.createContext();i.value={role:"assistant",content:""},s.value.push({role:"user",content:r.value}),s.value.push(i.value);const p=await le({baseURL:o.value,apiKey:e.value,model:n.value,messages:s.value.slice(0,s.value.length-1).map(k=>ae(k))});for await(const k of p.chunkStream)u(d.with(k.choices[0].delta.content||""));return h.with()}),v.handle([d],async u=>{i.value.content?i.value.content+=u.data:i.value.content=u.data}),await ge(v,a.with(),h)}catch(v){console.error(v)}finally{l.value=!1}}return(v,u)=>(C(),T("div",ve,[c("div",ye,[c("div",xe,[u[7]||(u[7]=c("div",null,[c("span",{"text-neutral-500":"","dark:text-neutral-400":""},"LLM")],-1)),c("div",ke,[c("label",Se,[u[4]||(u[4]=c("span",{"text-nowrap":""}," Base URL ",-1)),R(c("input",{"onUpdate:modelValue":u[0]||(u[0]=p=>N(o)?o.value=p: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),[[A,U(o)]])]),c("label",_e,[u[5]||(u[5]=c("span",{"text-nowrap":""}," API Key ",-1)),R(c("input",{"onUpdate:modelValue":u[1]||(u[1]=p=>N(e)?e.value=p: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),[[A,U(e)]])]),c("label",Ee,[u[6]||(u[6]=c("span",{"text-nowrap":""}," Model ",-1)),R(c("input",{"onUpdate:modelValue":u[2]||(u[2]=p=>N(n)?n.value=p: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),[[A,U(n)]])])])]),c("div",null,[R(c("textarea",{"onUpdate:modelValue":u[3]||(u[3]=p=>r.value=p),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),[[A,r.value]])]),c("button",{"rounded-lg":"",bg:"blue-100 dark:blue-900","px-4":"","py-2":"",onClick:g}," Send "),c("div",null,[(C(!0),T(oe,null,se(s.value,(p,k)=>(C(),T("div",{key:k},[p.role==="user"?(C(),T("div",Te,[c("span",null,J(p.content),1)])):B("",!0),p.role==="assistant"?(C(),T("div",Ce,[c("span",null,J(p.content),1)])):B("",!0)]))),128))])])]))}});export{Re as default}; diff --git a/assets/cloudflare-workers-ai-CUVYqqAF.js b/assets/cloudflare-workers-ai-CUVYqqAF.js new file mode 100644 index 0000000000000000000000000000000000000000..e09076764daa439444ec78bb6d411743eed7f7d3 --- /dev/null +++ b/assets/cloudflare-workers-ai-CUVYqqAF.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import{ProviderAccountIdInput_default as p,ProviderApiKeyInput_default as m,ProviderBasicSettings_default as h,ProviderSettingsContainer_default as g,ProviderSettingsLayout_default as _}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as v}from"./route-block-DNPbw0zT.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/cloudflare-workers-ai-DaNcyxus.js b/assets/cloudflare-workers-ai-DaNcyxus.js deleted file mode 100644 index 7e910424d8656abd33c464eda97c20d6f7298066..0000000000000000000000000000000000000000 --- a/assets/cloudflare-workers-ai-DaNcyxus.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as k,cg as y,ch as $,bf as I,o as h,u as r,$ as M,V as q,a0 as x,f as v,T as K,w as P,bg as f,b as c}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{_ as A}from"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import{_ as B}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as C}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as N}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as V}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const S=k({__name:"ProviderAccountIdInput",props:y({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const l=p,u=$(p,"modelValue");return(n,e)=>(h(),I(r(A),{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),label:l.label||"Account ID",description:l.description||"Account ID",placeholder:l.placeholder,required:l.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}}),a="cloudflare-workers-ai",U=k({__name:"cloudflare-workers-ai",setup(p){const{t:l}=M(),u=q(),n=z(),{providers:e}=x(n),t=v(()=>n.getProviderMetadata(a)),s=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.apiKey)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].apiKey=o}}),d=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.accountId)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].accountId=o}});K(()=>{var o,i;n.initializeProvider(a),s.value=((o=e.value[a])==null?void 0:o.apiKey)||"",d.value=((i=e.value[a])==null?void 0:i.accountId)||""}),P([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function w(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,g;return h(),I(r(R),{"provider-name":(_=t.value)==null?void 0:_.localizedName,"provider-icon-color":(g=t.value)==null?void 0:g.iconColor,"on-back":()=>r(u).back()},{default:f(()=>[c(r(N),null,{default:f(()=>[c(r(C),{title:r(l)("settings.pages.providers.common.section.basic.title"),description:r(l)("settings.pages.providers.common.section.basic.description"),"on-reset":w},{default:f(()=>{var b;return[c(r(B),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=m=>s.value=m),"provider-name":(b=t.value)==null?void 0:b.localizedName,placeholder:r(l)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder")},null,8,["modelValue","provider-name","placeholder"]),c(r(S),{modelValue:d.value,"onUpdate:modelValue":i[1]||(i[1]=m=>d.value=m),label:r(l)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label"),description:r(l)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description"),placeholder:r(l)("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(U);export{U as default}; diff --git a/assets/color-scheme-CHJXy8qz.css b/assets/color-scheme-CHJXy8qz.css new file mode 100644 index 0000000000000000000000000000000000000000..cf0c19f6030a12cf476bba55080711ae453e02f3 --- /dev/null +++ b/assets/color-scheme-CHJXy8qz.css @@ -0,0 +1 @@ +.color-bar[data-v-29f357ba]{text-align:center;--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity));border-radius:.5rem;line-height:2.5rem;display:flex;overflow:hidden}.color-bar [data-v-29f357ba]{flex:1}.color-bar div[data-v-29f357ba]{display:contents}.transparency-grid[data-v-29f357ba]{background-color:#fff;background-image:linear-gradient(45deg,#ccc 25%,#0000 25%),linear-gradient(-45deg,#ccc 25%,#0000 25%),linear-gradient(45deg,#0000 75%,#ccc 75%),linear-gradient(-45deg,#0000 75%,#ccc 75%);background-position:0 0,0 10px,10px -10px,-10px 0;background-size:20px 20px} diff --git a/assets/color-scheme-CSVp68xe.js b/assets/color-scheme-CSVp68xe.js deleted file mode 100644 index ec268a2d15096dde1391ffd5eccf1a0602cf704d..0000000000000000000000000000000000000000 --- a/assets/color-scheme-CSVp68xe.js +++ /dev/null @@ -1 +0,0 @@ -import{d as D,cg as V,ch as E,bh as i,c as n,o as r,X as w,ca as $,b_ as v,be as F,$ as H,c2 as S,bf as y,bg as b,a as e,Y as m,ci as M,u as o,bi as R,b as g,c3 as f,c4 as j}from"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{_ as C,a as I}from"./ColorPalette.vue_vue_type_script_setup_true_lang-Dcu1mOYZ.js";import{b as B}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./index-Cynu-bMx.js";const N=["disabled"],T=D({__name:"ColorHueRange",props:V({disabled:{type:Boolean},class:null},{colorValue:{type:String,default:""},colorValueModifiers:{}}),emits:["update:colorValue"],setup(c){const s=c,p=E(c,"colorValue");return(l,t)=>i((r(),n("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>p.value=a),type:"range",min:"0",max:"360",step:"0.01",class:w(["color-hue-range",[s.disabled?"opacity-25 cursor-not-allowed":"cursor-pointer",s.class||""]]),transition:"all ease-in-out duration-250",disabled:s.disabled},null,10,N)),[[$,p.value]])}}),U=v(T,[["__scopeId","data-v-ae80cb9d"]]),z=[[],["#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"]],L={flex:"","items-center":"","justify-between":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+5*10,delay:5*50,transition:"all ease-in-out duration-250"},O={"text-lg":"","font-semibold":""},P={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},X={class:"color-bar",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+7*10,delay:7*50,transition:"all ease-in-out duration-250"},Y={"text-white":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+8*10,delay:8*50,transition:"all ease-in-out duration-250"},q={class:"color-bar transparency-grid",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+9*10,delay:9*50,transition:"all ease-in-out duration-250"},G=["duration","delay"],J={"font-medium":""},K={text:"sm neutral-500"},Q={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":""},A=D({__name:"color-scheme",setup(c){const s=F(),{t:p}=H();return(l,t)=>{const a=S("motion");return r(),n(f,null,[i((r(),y(o(C),{"mb-2":"",title:o(p)("settings.pages.themes.sections.section.custom-color.title"),icon:"i-solar:pallete-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+4*10,delay:4*50,transition:"all ease-in-out duration-250"},{default:b(()=>[i((r(),n("div",L,[e("span",O,m(l.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",P,[i(e("input",{"onUpdate:modelValue":t[0]||(t[0]=d=>o(s).themeColorsHueDynamic=d),type:"checkbox",class:"peer sr-only"},null,512),[[R,o(s).themeColorsHueDynamic]]),t[2]||(t[2]=e("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)),M(" "+m(l.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)])])),[[a]]),i(g(o(U),{modelValue:o(s).themeColorsHue,"onUpdate:modelValue":t[1]||(t[1]=d=>o(s).themeColorsHue=d),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+6*10,delay:6*50,disabled:o(s).themeColorsHueDynamic},null,8,["modelValue","disabled"]),[[a]]),i((r(),n("div",X,[t[4]||(t[4]=e("span",{"bg-primary-50":""},"50",-1)),t[5]||(t[5]=e("span",{"bg-primary-100":""},"100",-1)),t[6]||(t[6]=e("span",{"bg-primary-200":""},"200",-1)),t[7]||(t[7]=e("span",{"bg-primary-300":""},"300",-1)),t[8]||(t[8]=e("span",{"bg-primary-400":""},"400",-1)),t[9]||(t[9]=e("span",{"bg-primary-500":""},"500",-1)),i((r(),n("div",Y,t[3]||(t[3]=[e("span",{"bg-primary-600":""},"600",-1),e("span",{"bg-primary-700":""},"700",-1),e("span",{"bg-primary-800":""},"800",-1),e("span",{"bg-primary-900":""},"900",-1),e("span",{"bg-primary-950":""},"950",-1)]))),[[a]])])),[[a]]),i((r(),n("div",q,t[10]||(t[10]=[e("span",{bg:"primary-500/5"},"500/5",-1),e("span",{bg:"primary-500/10"},"500/10",-1),e("span",{bg:"primary-500/20"},"500/20",-1),e("span",{bg:"primary-500/30"},"500/30",-1),e("span",{bg:"primary-500/40"},"500/40",-1),e("span",{bg:"primary-500/50"},"500/50",-1),e("span",{bg:"primary-500/60"},"500/60",-1),e("span",{bg:"primary-500/70"},"500/70",-1),e("span",{bg:"primary-500/80"},"500/80",-1),e("span",{bg:"primary-500/90"},"500/90",-1),e("span",{bg:"primary-500"},"500",-1)]))),[[a]])]),_:1},8,["title"])),[[a]]),i((r(),y(o(C),{"mb-2":"",title:o(p)("settings.pages.themes.sections.section.theme-presets.title"),icon:"i-solar:magic-stick-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+10*10,delay:10*50,transition:"all ease-in-out duration-250"},{default:b(()=>[(r(!0),n(f,null,j(l.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:d,description:h,colors:x},u)=>i((r(),n("div",{key:u,class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+11*10+u*10,delay:11*50+u*50,transition:"all ease-in-out duration-250"},[e("div",null,[e("span",J,m(l.$rt(d)),1),e("div",K,m(l.$rt(h)),1)]),g(I,{colors:x.map((_,k)=>({hex:o(z)[u][k],name:l.$rt(_)}))},null,8,["colors"])],8,G)),[[a]])),128))]),_:1},8,["title"])),[[a]]),i((r(),n("div",Q,t[11]||(t[11]=[e("div",{text:"60","i-solar:pallete-2-bold-duotone":""},null,-1)]))),[[a]])],64)}}});typeof B=="function"&&B(A);const de=v(A,[["__scopeId","data-v-29f357ba"]]);export{de as default}; diff --git a/assets/color-scheme-DHCqV_sd.js b/assets/color-scheme-DHCqV_sd.js new file mode 100644 index 0000000000000000000000000000000000000000..074773179cba52d3cc91de237a6e794ca74245b8 --- /dev/null +++ b/assets/color-scheme-DHCqV_sd.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import{ColorHueRange_default as v}from"./src-bHDRqBSs.js";import"./dist-DzeHt4xm.js";import{Section_default as y}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as b}from"./route-block-DNPbw0zT.js";import{ColorPalette_default as x}from"./ColorPalette-DaCdckPj.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/color-scheme-QyqrmPIG.css b/assets/color-scheme-QyqrmPIG.css deleted file mode 100644 index 572ea2fa14ded15fadcc4f50df6869c37a6aff33..0000000000000000000000000000000000000000 --- a/assets/color-scheme-QyqrmPIG.css +++ /dev/null @@ -1 +0,0 @@ -.color-bar[data-v-29f357ba]{display:flex;overflow:hidden;border-radius:.5rem;text-align:center;--un-text-opacity:1;color:rgb(0 0 0 / var(--un-text-opacity));line-height:2.5rem}.color-bar [data-v-29f357ba]{flex:1}.color-bar div[data-v-29f357ba]{display:contents}.transparency-grid[data-v-29f357ba]{background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0px;background-color:#fff} diff --git a/assets/components-B-QNW1cA.js b/assets/components-B-QNW1cA.js new file mode 100644 index 0000000000000000000000000000000000000000..bd911ff716ec351a54094213b23d78542deda9b3 --- /dev/null +++ b/assets/components-B-QNW1cA.js @@ -0,0 +1,3773 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-CIQGHXr-.js","assets/index-BtAisBe9.js","assets/index-D4gBs-70.css","assets/default-node-TdRV4SdH.js","assets/import-url-browser-QqZ6rd6v.js","assets/import-url-browser-BvZvAmFy.js","assets/duckdb-mvp-C3i5IjU8.js","assets/import-url-node-DT7wRTjn.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-BtAisBe9.js";import{getImportUrlBundles as In}from"./import-url-browser-BvZvAmFy.js";import{generateSpeech as Ln,useAudioContext as Rn,useChatStore as zn,useProvidersStore as Bn,useSpeakingStore as Vn,useSpeechStore as Hn}from"./stores-mOXXrrXB.js";import{Collapsable_default as Un,TransitionVertical_default as Wn}from"./Button-BUWHo0FI.js";import{FieldCheckbox_default as Gn,FieldInput_default as Kn,Input_default as qn}from"./src-bHDRqBSs.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-DnqWi3UL.js";import{useQueue as ar}from"./queue-BZUURX31.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-U6a2FwNq.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♥ + +`,`background: #ff66a5; padding:5px 0;`,`background: #ff66a5; padding:5px 0;`,`color: #ff66a5; background: #030307; padding:5px 0;`,`background: #ff66a5; padding:5px 0;`,`background: #ffc3dc; padding:5px 0;`,`background: #ff66a5; padding:5px 0;`,`color: #ff2424; background: #fff; padding:5px 0;`,`color: #ff2424; background: #fff; padding:5px 0;`,`color: #ff2424; background: #fff; padding:5px 0;`];(t=globalThis.console).log.apply(t,n)}else globalThis.console&&globalThis.console.log(`PixiJS `+Co+` - `+e+` - http://www.pixijs.com/`);So=!0}}var To;function Eo(){return To===void 0&&(To=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:oo.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!oo.ADAPTER.getWebGLRenderingContext())return!1;var t=oo.ADAPTER.createCanvas(),n=t.getContext(`webgl`,e)||t.getContext(`experimental-webgl`,e),r=!!(n&&n.getContextAttributes().stencil);if(n){var i=n.getExtension(`WEBGL_lose_context`);i&&i.loseContext()}return n=null,r}catch{return!1}}()),To}function Do(e,t){return t===void 0&&(t=[]),t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(e&255)/255,t}function Oo(e){var t=e.toString(16);return t=`000000`.substring(0,6-t.length)+t,`#`+t}function ko(e){return(e[0]*255<<16)+(e[1]*255<<8)+(e[2]*255|0)}function Ao(){for(var e=[],t=[],n=0;n<32;n++)e[n]=n,t[n]=n;e[xa.NORMAL_NPM]=xa.NORMAL,e[xa.ADD_NPM]=xa.ADD,e[xa.SCREEN_NPM]=xa.SCREEN,t[xa.NORMAL]=xa.NORMAL_NPM,t[xa.ADD]=xa.ADD_NPM,t[xa.SCREEN]=xa.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}var jo=Ao();function Mo(e,t){if(t===1)return(t*255<<24)+e;if(t===0)return 0;var n=e>>16&255,r=e>>8&255,i=e&255;return n=n*t+.5|0,r=r*t+.5|0,i=i*t+.5|0,(t*255<<24)+(n<<16)+(r<<8)+i}function No(e){if(e.BYTES_PER_ELEMENT===4)return e instanceof Float32Array?`Float32Array`:e instanceof Uint32Array?`Uint32Array`:`Int32Array`;if(e.BYTES_PER_ELEMENT===2){if(e instanceof Uint16Array)return`Uint16Array`}else if(e.BYTES_PER_ELEMENT===1&&e instanceof Uint8Array)return`Uint8Array`;return null}function Po(e){return e+=e===0?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function Fo(e){return!(e&e-1)&&!!e}function Io(e){var t=(e>65535?1:0)<<4;e>>>=t;var n=(e>255?1:0)<<3;return e>>>=n,t|=n,n=(e>15?1:0)<<2,e>>>=n,t|=n,n=(e>3?1:0)<<1,e>>>=n,t|=n,t|e>>1}function Lo(e,t,n){var r=e.length,i;if(!(t>=r||n===0)){n=t+n>r?r-t:n;var a=r-n;for(i=t;i8)throw Error(`max arguments reached`);var c=this,l=c.name,u=c.items;this._aliasCount++;for(var d=0,f=u.length;d0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},e.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},e.prototype.remove=function(e){var t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},e.prototype.contains=function(e){return this.items.indexOf(e)!==-1},e.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},e.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(e.prototype,`empty`,{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`name`,{get:function(){return this._name},enumerable:!1,configurable:!0}),e}();Object.defineProperties($o.prototype,{dispatch:{value:$o.prototype.emit},run:{value:$o.prototype.emit}}),oo.TARGET_FPMS=.06;var es;(function(e){e[e.INTERACTION=50]=`INTERACTION`,e[e.HIGH=25]=`HIGH`,e[e.NORMAL=0]=`NORMAL`,e[e.LOW=-25]=`LOW`,e[e.UTILITY=-50]=`UTILITY`})(es||={});var ts=function(){function e(e,t,n,r){t===void 0&&(t=null),n===void 0&&(n=0),r===void 0&&(r=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=n,this.once=r}return e.prototype.match=function(e,t){return t===void 0&&(t=null),this.fn===e&&this.context===t},e.prototype.emit=function(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));var t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t},e.prototype.connect=function(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this},e.prototype.destroy=function(e){e===void 0&&(e=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var t=this.next;return this.next=e?null:t,this.previous=null,t},e}(),ns=function(){function e(){var e=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new ts(null,null,1/0),this.deltaMS=1/oo.TARGET_FPMS,this.elapsedMS=1/oo.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&e._requestId===null&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return e.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},e.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},e.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},e.prototype.add=function(e,t,n){return n===void 0&&(n=es.NORMAL),this._addListener(new ts(e,t,n))},e.prototype.addOnce=function(e,t,n){return n===void 0&&(n=es.NORMAL),this._addListener(new ts(e,t,n,!0))},e.prototype._addListener=function(e){var t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var n=this._head.next;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,`count`,{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(e){e===void 0&&(e=performance.now());var t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var n=e-this._lastFrame|0;if(n=this.x&&e=this.y&&te.right?e.right:this.right;if(r<=n)return!1;var i=this.ye.bottom?e.bottom:this.bottom;return a>i}var o=this.left,s=this.right,c=this.top,l=this.bottom;if(s<=o||l<=c)return!1;var u=ds[0].set(e.left,e.top),d=ds[1].set(e.left,e.bottom),f=ds[2].set(e.right,e.top),p=ds[3].set(e.right,e.bottom);if(f.x<=u.x||d.y<=u.y)return!1;var m=Math.sign(t.a*t.d-t.b*t.c);if(m===0||(t.apply(u,u),t.apply(d,d),t.apply(f,f),t.apply(p,p),Math.max(u.x,d.x,f.x,p.x)<=o||Math.min(u.x,d.x,f.x,p.x)>=s||Math.max(u.y,d.y,f.y,p.y)<=c||Math.min(u.y,d.y,f.y,p.y)>=l))return!1;var h=m*(d.y-u.y),g=m*(u.x-d.x),_=h*o+g*c,v=h*s+g*c,y=h*o+g*l,b=h*s+g*l;if(Math.max(_,v,y,b)<=h*u.x+g*u.y||Math.min(_,v,y,b)>=h*p.x+g*p.y)return!1;var x=m*(u.y-f.y),S=m*(f.x-u.x),C=x*o+S*c,w=x*s+S*c,T=x*o+S*l,E=x*s+S*l;return!(Math.max(C,w,T,E)<=x*u.x+S*u.y||Math.min(C,w,T,E)>=x*p.x+S*p.y)},e.prototype.pad=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this},e.prototype.fit=function(e){var t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=r,this.height=Math.max(i-r,0),this},e.prototype.ceil=function(e,t){e===void 0&&(e=1),t===void 0&&(t=.001);var n=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=r-this.y,this},e.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=r,this.height=i-r,this},e.prototype.toString=function(){return`[@pixi/math:Rectangle x=`+this.x+` y=`+this.y+` width=`+this.width+` height=`+this.height+`]`},e}(),ps=function(){function e(e,t,n){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),this.x=e,this.y=t,this.radius=n,this.type=ls.CIRC}return e.prototype.clone=function(){return new e(this.x,this.y,this.radius)},e.prototype.contains=function(e,t){if(this.radius<=0)return!1;var n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n},e.prototype.getBounds=function(){return new fs(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},e.prototype.toString=function(){return`[@pixi/math:Circle x=`+this.x+` y=`+this.y+` radius=`+this.radius+`]`},e}(),ms=function(){function e(e,t,n,r){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),this.x=e,this.y=t,this.width=n,this.height=r,this.type=ls.ELIP}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var n=(e-this.x)/this.width,r=(t-this.y)/this.height;return n*=n,r*=r,n+r<=1},e.prototype.getBounds=function(){return new fs(this.x-this.width,this.y-this.height,this.width,this.height)},e.prototype.toString=function(){return`[@pixi/math:Ellipse x=`+this.x+` y=`+this.y+` width=`+this.width+` height=`+this.height+`]`},e}(),hs=function(){function e(){for(var e=arguments,t=[],n=0;nt!=l>t&&e<(c-o)*((t-s)/(l-s))+o;u&&(n=!n)}return n},e.prototype.toString=function(){return`[@pixi/math:Polygon`+(`closeStroke=`+this.closeStroke)+(`points=`+this.points.reduce(function(e,t){return e+`, `+t},``)+`]`)},e}(),gs=function(){function e(e,t,n,r,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=20),this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i,this.type=ls.RREC}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;var r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1},e.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=`+this.x+` y=`+this.y+(`width=`+this.width+` height=`+this.height+` radius=`+this.radius+`]`)},e}(),_s=function(){function e(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0),this._x=n,this._y=r,this.cb=e,this.scope=t}return e.prototype.clone=function(t,n){return t===void 0&&(t=this.cb),n===void 0&&(n=this.scope),new e(t,n,this._x,this._y)},e.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this},e.prototype.copyFrom=function(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},e.prototype.copyTo=function(e){return e.set(this._x,this._y),e},e.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},e.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=`+this.scope+`]`},Object.defineProperty(e.prototype,`x`,{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`y`,{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),e}(),vs=function(){function e(e,t,n,r,i,a){e===void 0&&(e=1),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=1),i===void 0&&(i=0),a===void 0&&(a=0),this.array=null,this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a}return e.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},e.prototype.set=function(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a,this},e.prototype.toArray=function(e,t){this.array||=new Float32Array(9);var n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},e.prototype.apply=function(e,t){t||=new us;var n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t},e.prototype.applyInverse=function(e,t){t||=new us;var n=1/(this.a*this.d+this.c*-this.b),r=e.x,i=e.y;return t.x=this.d*n*r+-this.c*n*i+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*i+-this.b*n*r+(-this.ty*this.a+this.tx*this.b)*n,t},e.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},e.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},e.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),r=this.a,i=this.c,a=this.tx;return this.a=r*t-this.b*n,this.b=r*n+this.b*t,this.c=i*t-this.d*n,this.d=i*n+this.d*t,this.tx=a*t-this.ty*n,this.ty=a*n+this.ty*t,this},e.prototype.append=function(e){var t=this.a,n=this.b,r=this.c,i=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*n+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*n+e.d*i,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*n+e.ty*i+this.ty,this},e.prototype.setTransform=function(e,t,n,r,i,a,o,s,c){return this.a=Math.cos(o+c)*i,this.b=Math.sin(o+c)*i,this.c=-Math.sin(o-s)*a,this.d=Math.cos(o-s)*a,this.tx=e-(n*this.a+r*this.c),this.ty=t-(n*this.b+r*this.d),this},e.prototype.prepend=function(e){var t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){var n=this.a,r=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},e.prototype.decompose=function(e){var t=this.a,n=this.b,r=this.c,i=this.d,a=e.pivot,o=-Math.atan2(-r,i),s=Math.atan2(n,t),c=Math.abs(o+s);return c<1e-5||Math.abs(os-c)<1e-5?(e.rotation=s,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=s),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(a.x*t+a.y*r),e.position.y=this.ty+(a.x*n+a.y*i),e},e.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,a=e*r-t*n;return this.a=r/a,this.b=-t/a,this.c=-n/a,this.d=e/a,this.tx=(n*this.ty-r*i)/a,this.ty=-(e*this.ty-t*i)/a,this},e.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},e.prototype.clone=function(){var t=new e;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},e.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},e.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},e.prototype.toString=function(){return`[@pixi/math:Matrix a=`+this.a+` b=`+this.b+` c=`+this.c+` d=`+this.d+` tx=`+this.tx+` ty=`+this.ty+`]`},Object.defineProperty(e,`IDENTITY`,{get:function(){return new e},enumerable:!1,configurable:!0}),Object.defineProperty(e,`TEMP_MATRIX`,{get:function(){return new e},enumerable:!1,configurable:!0}),e}(),ys=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],bs=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],xs=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Ss=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Cs=[],ws=[],Ts=Math.sign;function Es(){for(var e=0;e<16;e++){var t=[];Cs.push(t);for(var n=0;n<16;n++)for(var r=Ts(ys[e]*ys[n]+xs[e]*bs[n]),i=Ts(bs[e]*ys[n]+Ss[e]*bs[n]),a=Ts(ys[e]*xs[n]+xs[e]*Ss[n]),o=Ts(bs[e]*xs[n]+Ss[e]*Ss[n]),s=0;s<16;s++)if(ys[s]===r&&bs[s]===i&&xs[s]===a&&Ss[s]===o){t.push(s);break}}for(var e=0;e<16;e++){var c=new vs;c.set(ys[e],bs[e],xs[e],Ss[e],0,0),ws.push(c)}}Es();var Ds={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(e){return ys[e]},uY:function(e){return bs[e]},vX:function(e){return xs[e]},vY:function(e){return Ss[e]},inv:function(e){return e&8?e&15:-e&7},add:function(e,t){return Cs[e][t]},sub:function(e,t){return Cs[e][Ds.inv(t)]},rotate180:function(e){return e^4},isVertical:function(e){return(e&3)==2},byDirection:function(e,t){return Math.abs(e)*2<=Math.abs(t)?t>=0?Ds.S:Ds.N:Math.abs(t)*2<=Math.abs(e)?e>0?Ds.E:Ds.W:t>0?e>0?Ds.SE:Ds.SW:e>0?Ds.NE:Ds.NW},matrixAppendRotationInv:function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0);var i=ws[Ds.inv(t)];i.tx=n,i.ty=r,e.append(i)}},Os=function(){function e(){this.worldTransform=new vs,this.localTransform=new vs,this.position=new _s(this.onChange,this,0,0),this.scale=new _s(this.onChange,this,1,1),this.pivot=new _s(this.onChange,this,0,0),this.skew=new _s(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return e.prototype.onChange=function(){this._localID++},e.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},e.prototype.toString=function(){return`[@pixi/math:Transform `+(`position=(`+this.position.x+`, `+this.position.y+`) `)+(`rotation=`+this.rotation+` `)+(`scale=(`+this.scale.x+`, `+this.scale.y+`) `)+(`skew=(`+this.skew.x+`, `+this.skew.y+`) `)+`]`},e.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},e.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var n=e.worldTransform,r=this.worldTransform;r.a=t.a*n.a+t.b*n.c,r.b=t.a*n.b+t.b*n.d,r.c=t.c*n.a+t.d*n.c,r.d=t.c*n.b+t.d*n.d,r.tx=t.tx*n.a+t.ty*n.c+n.tx,r.ty=t.tx*n.b+t.ty*n.d+n.ty,this._parentID=e._worldID,this._worldID++}},e.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(e.prototype,`rotation`,{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),e.IDENTITY=new e,e}();oo.PREFER_ENV=ro.any?va.WEBGL:va.WEBGL2,oo.STRICT_TEXTURE_CACHE=!1;var ks=[];function As(e,t){if(!e)return null;var n=``;if(typeof e==`string`){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(e);r&&(n=r[1].toLowerCase())}for(var i=ks.length-1;i>=0;--i){var a=ks[i];if(a.test&&a.test(e,n))return new a(e,t)}throw Error(`Unrecognized source type to auto-detect Resource`)} +/*! ***************************************************************************** + +Copyright (c) Microsoft Corporation. + + + +Permission to use, copy, modify, and/or distribute this software for any + +purpose with or without fee is hereby granted. + + + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + +PERFORMANCE OF THIS SOFTWARE. + +***************************************************************************** */ +var js=function(e,t){return js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},js(e,t)};function Ms(e,t){js(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ns=function(){return Ns=Object.assign||function(e){for(var t=arguments,n,r=1,i=arguments.length;r0&&l>0,r.textureCacheIds=[],r.destroyed=!1,r.resource=null,r._batchEnabled=0,r._batchLocation=0,r.parentTextureArray=null,r.setResource(t),r}return Object.defineProperty(t.prototype,`realWidth`,{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`realHeight`,{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`mipmap`,{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`scaleMode`,{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`wrapMode`,{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var n;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,n){return n||=this.resolution,this.setRealSize(e*n,t*n,n)},t.prototype.setRealSize=function(e,t,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=Fo(this.realWidth)&&Fo(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit(`update`,this)),this._refreshPOT(),this)},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw Error(`Resource can be set only once`);return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit(`update`,this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit(`loaded`,this),this.emit(`update`,this))},t.prototype.onError=function(e){this.emit(`error`,this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Wo[this.cacheId],delete Uo[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit(`dispose`,this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,n,r){r===void 0&&(r=oo.STRICT_TEXTURE_CACHE);var i=typeof e==`string`,a=null;if(i)a=e;else{if(!e._pixiId){var o=n&&n.pixiIdPrefix||`pixiid`;e._pixiId=o+`_`+zo()}a=e._pixiId}var s=Wo[a];if(i&&r&&!s)throw Error(`The cacheId "`+a+`" does not exist in BaseTextureCache.`);return s||(s=new t(e,n),s.cacheId=a,t.addToCache(s,a)),s},t.fromBuffer=function(e,n,r,i){e||=new Float32Array(n*r*4);var a=new Is(e,{width:n,height:r}),o=e instanceof Float32Array?Ta.FLOAT:Ta.UNSIGNED_BYTE;return new t(a,Object.assign({},Ls,i||{width:n,height:r,type:o}))},t.addToCache=function(e,t){t&&(e.textureCacheIds.indexOf(t)===-1&&e.textureCacheIds.push(t),Wo[t]&&console.warn(`BaseTexture added to the cache with an id [`+t+`] that already had an entry`),Wo[t]=e)},t.removeFromCache=function(e){if(typeof e==`string`){var t=Wo[e];if(t){var n=t.textureCacheIds.indexOf(e);return n>-1&&t.textureCacheIds.splice(n,1),delete Wo[e],t}}else if(e&&e.textureCacheIds){for(var r=0;r0)if(e.resource)this.addResourceAt(e.resource,t);else throw Error(`CubeResource does not support copying of renderTexture.`);else e.target=wa.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,n,r){for(var i=this.itemDirtyIds,a=0;a)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(Vs),Ks=function(e){Ms(t,e);function t(n,r){var i=this;if(r||={},!(n instanceof HTMLVideoElement)){var a=document.createElement(`video`);a.setAttribute(`preload`,`auto`),a.setAttribute(`webkit-playsinline`,``),a.setAttribute(`playsinline`,``),typeof n==`string`&&(n=[n]);var o=n[0].src||n[0];Vs.crossOrigin(a,o,r.crossorigin);for(var s=0;s2},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(ns.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(ns.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(ns.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener(`error`,this._onError,!0),t.pause(),t.src=``,t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,`autoUpdate`,{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(ns.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(ns.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`updateFPS`,{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,n){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(n)>-1},t.TYPES=[`mp4`,`m4v`,`webm`,`ogg`,`ogv`,`h264`,`avi`,`mov`],t.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`},t}(Vs),qs=function(e){Ms(t,e);function t(t){return e.call(this,t)||this}return t.test=function(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<`u`&&e instanceof ImageBitmap},t}(Vs);ks.push(Ws,qs,Hs,Ks,Gs,Is,Us,Bs);var Js={__proto__:null,Resource:Fs,BaseImageResource:Vs,INSTALLED:ks,autoDetectResource:As,AbstractMultiResource:zs,ArrayResource:Bs,BufferResource:Is,CanvasResource:Hs,CubeResource:Us,ImageResource:Ws,SVGResource:Gs,VideoResource:Ks,ImageBitmapResource:qs},Ys=function(e){Ms(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.upload=function(e,t,n){var r=e.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===Aa.UNPACK);var i=t.realWidth,a=t.realHeight;return n.width===i&&n.height===a?r.texSubImage2D(t.target,0,0,0,i,a,t.format,n.type,this.data):(n.width=i,n.height=a,r.texImage2D(t.target,0,n.internalFormat,i,a,0,t.format,n.type,this.data)),!0},t}(Is),Xs=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new $o(`disposeFramebuffer`),this.multisample=Ia.NONE}return Object.defineProperty(e.prototype,`colorTexture`,{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new Rs(null,{scaleMode:Da.NEAREST,resolution:1,mipmap:ka.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Rs(new Ys(null,{width:this.width,height:this.height}),{scaleMode:Da.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ka.OFF,format:Ca.DEPTH_COMPONENT,type:Ta.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&t.textureCacheIds.splice(n,1),delete Uo[e],t}}else if(e&&e.textureCacheIds){for(var r=0;rthis.baseTexture.width,o=n+i>this.baseTexture.height;if(a||o){var s=a&&o?`and`:`or`,c=`X: `+t+` + `+r+` = `+(t+r)+` > `+this.baseTexture.width,l=`Y: `+n+` + `+i+` = `+(n+i)+` > `+this.baseTexture.height;throw Error(`Texture Error: frame does not fit inside the base Texture dimensions: `+(c+` `+s+` `+l))}this.valid=r&&i&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`rotate`,{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`width`,{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`height`,{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,`EMPTY`,{get:function(){return t._EMPTY||(t._EMPTY=new t(new Rs),ec(t._EMPTY),ec(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,`WHITE`,{get:function(){if(!t._WHITE){var e=oo.ADAPTER.createCanvas(16,16),n=e.getContext(`2d`);e.width=16,e.height=16,n.fillStyle=`white`,n.fillRect(0,0,16,16),t._WHITE=new t(Rs.from(e)),ec(t._WHITE),ec(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(vo.default),nc=function(e){Ms(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return Object.defineProperty(t.prototype,`framebuffer`,{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`multisample`,{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,n){n===void 0&&(n=!0);var r=this.baseTexture.resolution,i=Math.round(e*r)/r,a=Math.round(t*r)/r;this.valid=i>0&&a>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(i,a),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var n=arguments,r=[],i=1;i>>0,r>1&&(i+=r*4294967296)):i=r>1?-r:-1,this.texturePool[i]||(this.texturePool[i]=[]);var a=this.texturePool[i].pop();return a||=this.createTexture(e,t,r),a.filterPoolKey=i,a.setResolution(n),a},e.prototype.getFilterTexture=function(e,t,n){var r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||Ia.NONE);return r.filterFrame=e.filterFrame,r},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=e!==!1,e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var r=0;r0&&e.height>0,this.texturePool){if(!(Number(t)<0))continue;var n=this.texturePool[t];if(n)for(var r=0;r1){for(var l=0;l1&&(u=this.getOptimalFilterTexture(l.width,l.height,t.resolution),u.filterFrame=l.filterFrame),n[d].apply(this,l,u,ja.CLEAR,t);var f=l;l=u,u=f}n[d].apply(this,l,c.renderTexture,ja.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(u)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){t===void 0&&(t=ja.CLEAR);var n=this.renderer,r=n.renderTexture,i=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,r.bind(e,e.filterFrame,a)}else e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame):r.bind(e);var o=i.stateId&1||this.forceClear;(t===ja.CLEAR||t===ja.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,n,r){var i=this.renderer;i.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,i.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),i.geometry.bind(this.quadUv),i.geometry.draw(Sa.TRIANGLES)):(i.geometry.bind(this.quad),i.geometry.draw(Sa.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,r=n.sourceFrame,i=n.destinationFrame,a=t._texture.orig,o=e.set(i.width,0,0,i.height,r.x,r.y),s=t.worldTransform.copyTo(vs.TEMP_MATRIX);return s.invert(),o.prepend(s),o.scale(1/a.width,1/a.height),o.translate(t.anchor.x,t.anchor.y),o},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,n,r){return n===void 0&&(n=1),r===void 0&&(r=Ia.NONE),this.texturePool.getOptimalTexture(e,t,n,r)},e.prototype.getFilterTexture=function(e,t,n){if(typeof e==`number`){var r=e;e=t,t=r}e||=this.activeState.renderTexture;var i=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||Ia.NONE);return i.filterFrame=e.filterFrame,i},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var n=vc[0],r=vc[1],i=vc[2],a=vc[3];n.set(t.left,t.top),r.set(t.left,t.bottom),i.set(t.right,t.top),a.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(i,i),e.apply(a,a);var o=Math.min(n.x,r.x,i.x,a.x),s=Math.min(n.y,r.y,i.y,a.y),c=Math.max(n.x,r.x,i.x,a.x),l=Math.max(n.y,r.y,i.y,a.y);t.x=o,t.y=s,t.width=c-o,t.height=l-s},e.prototype.roundFrame=function(e,t,n,r,i){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(i){var a=i.a,o=i.b,s=i.c,c=i.d;if((Math.abs(o)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(c)>1e-4))return}i=i?yc.copyFrom(i):yc.identity(),i.translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),xc=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),Sc=function(){function e(e){this.renderer=e,this.emptyRenderer=new xc(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)},e.prototype.boundArray=function(e,t,n,r){for(var i=e.elements,a=e.ids,o=e.count,s=0,c=0;c=0&&u=va.WEBGL2&&(n=e.getContext(`webgl2`,t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext(`webgl`,t)||e.getContext(`experimental-webgl`,t),!n)throw Error(`This browser does not support WebGL. Try using the canvas renderer`);return this.gl=n,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={loseContext:e.getExtension(`WEBGL_lose_context`),anisotropicFiltering:e.getExtension(`EXT_texture_filter_anisotropic`),floatTextureLinear:e.getExtension(`OES_texture_float_linear`),s3tc:e.getExtension(`WEBGL_compressed_texture_s3tc`),s3tc_sRGB:e.getExtension(`WEBGL_compressed_texture_s3tc_srgb`),etc:e.getExtension(`WEBGL_compressed_texture_etc`),etc1:e.getExtension(`WEBGL_compressed_texture_etc1`),pvrtc:e.getExtension(`WEBGL_compressed_texture_pvrtc`)||e.getExtension(`WEBKIT_WEBGL_compressed_texture_pvrtc`),atc:e.getExtension(`WEBGL_compressed_texture_atc`),astc:e.getExtension(`WEBGL_compressed_texture_astc`)};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension(`WEBGL_draw_buffers`),depthTexture:e.getExtension(`WEBGL_depth_texture`),vertexArrayObject:e.getExtension(`OES_vertex_array_object`)||e.getExtension(`MOZ_OES_vertex_array_object`)||e.getExtension(`WEBKIT_OES_vertex_array_object`),uint32ElementIndex:e.getExtension(`OES_element_index_uint`),floatTexture:e.getExtension(`OES_texture_float`),floatTextureLinear:e.getExtension(`OES_texture_float_linear`),textureHalfFloat:e.getExtension(`OES_texture_half_float`),textureHalfFloatLinear:e.getExtension(`OES_texture_half_float_linear`)}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension(`EXT_color_buffer_float`)})},e.prototype.handleContextLost=function(e){var t=this;e.preventDefault(),setTimeout(function(){t.gl.isContextLost()&&t.extensions.loseContext&&t.extensions.loseContext.restoreContext()},0)},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener(`webglcontextlost`,this.handleContextLost),e.removeEventListener(`webglcontextrestored`,this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),n=`WebGL2RenderingContext`in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn(`Provided WebGL context does not have a stencil buffer, masks may not render correctly`);var r=n||!!e.getExtension(`OES_element_index_uint`);this.supports.uint32Indices=r,r||console.warn(`Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly`)},e}(),Tc=function(){function e(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Ia.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return e}(),Ec=new fs,Dc=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Xs(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new fs,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;oo.PREFER_ENV===va.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,n){n===void 0&&(n=0);var r=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=n),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat===e.dirtyFormat?i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)):(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)));for(var a=0;a>n,c=t.height>>n,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,c)}else{var s=e.width>>n,c=e.height>>n;this.setViewport(0,0,s,c)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,n,r){var i=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),(i.width!==n||i.height!==r||i.x!==e||i.y!==t)&&(i.x=e,i.y=t,i.width=n,i.height=r,this.gl.viewport(e,t,n,r))},Object.defineProperty(e.prototype,`size`,{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,n,r,i){i===void 0&&(i=ba.COLOR|ba.DEPTH);var a=this.gl;a.clearColor(e,t,n,r),a.clear(i)},e.prototype.initFramebuffer=function(e){var t=this.gl,n=new Tc(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},e.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var r=e.colorTextures,i=r.length;t.drawBuffers||(i=Math.min(i,1));for(var a=0;a1&&this.canMultisampleFramebuffer(e)?(r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var o=[],s=0;s1&&n.drawBuffers(o),e.depthTexture){var u=this.writeDepthTexture;if(u){var d=e.depthTexture;this.renderer.texture.bind(d,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,d._glTextures[this.CONTEXT_UID].texture,t)}}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(r.stencil=r.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,r.stencil)):r.stencil&&(n.deleteRenderbuffer(r.stencil),r.stencil=null)},e.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,n=Ia.NONE;if(e<=1||t===null)return n;for(var r=0;r=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n=va.WEBGL2&&(t=e.getContext(`webgl2`,{})),t||(t=e.getContext(`webgl`,{})||e.getContext(`experimental-webgl`,{}),t?t.getExtension(`WEBGL_draw_buffers`):t=null),Lc=t}return Lc}var zc;function Bc(){if(!zc){zc=Na.MEDIUM;var e=Rc();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);zc=t.precision?Na.HIGH:Na.MEDIUM}}return zc}function Vc(e,t,n){if(e.substring(0,9)!==`precision`){var r=t;return t===Na.HIGH&&n!==Na.HIGH&&(r=Na.MEDIUM),`precision `+r+` float; +`+e}else if(n!==Na.HIGH&&e.substring(0,15)===`precision highp`)return e.replace(`precision highp`,`precision mediump`);return e}var Hc={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Uc(e){return Hc[e]}var Wc=null,Gc={FLOAT:`float`,FLOAT_VEC2:`vec2`,FLOAT_VEC3:`vec3`,FLOAT_VEC4:`vec4`,INT:`int`,INT_VEC2:`ivec2`,INT_VEC3:`ivec3`,INT_VEC4:`ivec4`,UNSIGNED_INT:`uint`,UNSIGNED_INT_VEC2:`uvec2`,UNSIGNED_INT_VEC3:`uvec3`,UNSIGNED_INT_VEC4:`uvec4`,BOOL:`bool`,BOOL_VEC2:`bvec2`,BOOL_VEC3:`bvec3`,BOOL_VEC4:`bvec4`,FLOAT_MAT2:`mat2`,FLOAT_MAT3:`mat3`,FLOAT_MAT4:`mat4`,SAMPLER_2D:`sampler2D`,INT_SAMPLER_2D:`sampler2D`,UNSIGNED_INT_SAMPLER_2D:`sampler2D`,SAMPLER_CUBE:`samplerCube`,INT_SAMPLER_CUBE:`samplerCube`,UNSIGNED_INT_SAMPLER_CUBE:`samplerCube`,SAMPLER_2D_ARRAY:`sampler2DArray`,INT_SAMPLER_2D_ARRAY:`sampler2DArray`,UNSIGNED_INT_SAMPLER_2D_ARRAY:`sampler2DArray`};function Kc(e,t){if(!Wc){var n=Object.keys(Gc);Wc={};for(var r=0;r0&&(t+=` +else `),n0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==t&&this.renderer.gl.colorMask((n&1)!=0,(n&2)!=0,(n&4)!=0,(n&8)!=0)},e.prototype.destroy=function(){this.renderer=null},e}(),wl=function(){function e(e){this.renderer=e,this.maskStack=[],this.glConst=0}return e.prototype.getStackLength=function(){return this.maskStack.length},e.prototype.setMaskStack=function(e){var t=this.renderer.gl,n=this.getStackLength();this.maskStack=e;var r=this.getStackLength();r!==n&&(r===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))},e.prototype._useCurrent=function(){},e.prototype.destroy=function(){this.renderer=null,this.maskStack=null},e}(),Tl=new vs,El=[],Dl=function(e){Ms(t,e);function t(t){var n=e.call(this,t)||this;return n.glConst=oo.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,n}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},t.prototype.calcScissorRect=function(e){var t;if(!e._scissorRectLocal){var n=e._scissorRect,r=e.maskObject,i=this.renderer,a=i.renderTexture,o=r.getBounds(!0,(t=El.pop())??new fs);this.roundFrameToPixels(o,a.current?a.current.resolution:i.resolution,a.sourceFrame,a.destinationFrame,i.projection.transform),n&&o.fit(n),e._scissorRectLocal=o}},t.isMatrixRotated=function(e){if(!e)return!1;var t=e.a,n=e.b,r=e.c,i=e.d;return(Math.abs(n)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var n=e.maskObject;if(!n.isFastRect||!n.isFastRect()||t.isMatrixRotated(n.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var r=e._scissorRectLocal;return r.width>0&&r.height>0},t.prototype.roundFrameToPixels=function(e,n,r,i,a){t.isMatrixRotated(a)||(a=a?Tl.copyFrom(a):Tl.identity(),a.translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(a,e),e.fit(i),e.x=Math.round(e.x*n),e.y=Math.round(e.y*n),e.width=Math.round(e.width*n),e.height=Math.round(e.height*n))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;e&&El.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e=this.maskStack[this.maskStack.length-1]._scissorRect,t;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},t}(wl),Ol=function(e){Ms(t,e);function t(t){var n=e.call(this,t)||this;return n.glConst=oo.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,n}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,n=this.renderer.gl,r=e._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;var i=e._colorMask;i!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,r,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,i!==0&&(e._colorMask=i,n.colorMask((i&1)!=0,(i&2)!=0,(i&4)!=0,(i&8)!=0)),this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{var n=this.maskStack.length===0?null:this.maskStack[this.maskStack.length-1],r=n?n._colorMask:15;r!==0&&(n._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,r!==0&&(n._colorMask=r,t.colorMask((r&1)!=0,(r&2)!=0,(r&4)!=0,(r&8)!=0)),this._useCurrent()}},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(wl),kl=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new vs,this.transform=null}return e.prototype.update=function(e,t,n,r){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,r),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,n,r){var i=this.projectionMatrix,a=r?-1:1;i.identity(),i.a=1/t.width*2,i.d=a*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-a-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),Al=new fs,jl=new fs,Ml=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new fs,this.destinationFrame=new fs,this.viewportFrame=new fs}return e.prototype.bind=function(e,t,n){e===void 0&&(e=null);var r=this.renderer;this.current=e;var i,a,o;e?(i=e.baseTexture,o=i.resolution,t||(Al.width=e.frame.width,Al.height=e.frame.height,t=Al),n||(jl.x=e.frame.x,jl.y=e.frame.y,jl.width=t.width,jl.height=t.height,n=jl),a=i.framebuffer):(o=r.resolution,t||(Al.width=r.screen.width,Al.height=r.screen.height,t=Al),n||(n=Al,n.width=t.width,n.height=t.height));var s=this.viewportFrame;s.x=n.x*o,s.y=n.y*o,s.width=n.width*o,s.height=n.height*o,e||(s.y=r.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(a,s),this.renderer.projection.update(n,t,o,!a),e?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},e.prototype.clear=function(e,t){this.current?e||=this.current.baseTexture.clearColor:e||=this.clearColor;var n=this.destinationFrame,r=this.current?this.current.baseTexture:this.renderer.screen,i=n.width!==r.width||n.height!==r.height;if(i){var a=this.viewportFrame,o=a.x,s=a.y,c=a.width,l=a.height;o=Math.round(o),s=Math.round(s),c=Math.round(c),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,s,c,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function Nl(e,t,n,r,i){n.buffer.update(i)}var Pl={float:` + data[offset] = v; + `,vec2:` + data[offset] = v[0]; + data[offset+1] = v[1]; + `,vec3:` + data[offset] = v[0]; + data[offset+1] = v[1]; + data[offset+2] = v[2]; + + `,vec4:` + data[offset] = v[0]; + data[offset+1] = v[1]; + data[offset+2] = v[2]; + data[offset+3] = v[3]; + `,mat2:` + data[offset] = v[0]; + data[offset+1] = v[1]; + + data[offset+4] = v[2]; + data[offset+5] = v[3]; + `,mat3:` + data[offset] = v[0]; + data[offset+1] = v[1]; + data[offset+2] = v[2]; + + data[offset + 4] = v[3]; + data[offset + 5] = v[4]; + data[offset + 6] = v[5]; + + data[offset + 8] = v[6]; + data[offset + 9] = v[7]; + data[offset + 10] = v[8]; + `,mat4:` + for(var i = 0; i < 16; i++) + { + data[offset + i] = v[i]; + } + `},Fl={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function Il(e){for(var t=e.map(function(e){return{data:e,offset:0,dataLen:0,dirty:0}}),n=0,r=0,i=0,a=0;a1&&(n=Math.max(n,16)*o.data.size),o.dataLen=n,r%n!==0&&r<16){var s=r%n%16;r+=s,i+=s}r+n>16?(i=Math.ceil(i/16)*16,o.offset=i,i+=n,r=n):(o.offset=i,r+=n,i+=n)}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}function Ll(e,t){var n=[];for(var r in e)t[r]&&n.push(t[r]);return n.sort(function(e,t){return e.index-t.index}),n}function Rl(e,t){if(!e.autoManage)return{size:0,syncFunc:Nl};for(var n=Ll(e.uniforms,t),r=Il(n),i=r.uboElements,a=r.size,o=[` + var v = null; + var v2 = null; + var cv = null; + var t = 0; + var gl = renderer.gl + var index = 0; + var data = buffer.data; + `],s=0;s1){var m=Uc(c.data.type),h=Math.max(Fl[c.data.type]/16,1),g=m/h,_=(4-g%4)%4;o.push(` + cv = ud.`+u+`.value; + v = uv.`+u+`; + offset = `+c.offset/4+`; + + t = 0; + + for(var i=0; i < `+c.data.size*h+`; i++) + { + for(var j = 0; j < `+g+`; j++) + { + data[offset++] = v[t++]; + } + offset += `+_+`; + } + + `)}else{var v=Pl[c.data.type];o.push(` + cv = ud.`+u+`.value; + v = uv.`+u+`; + offset = `+c.offset/4+`; + `+v+`; + `)}}return o.push(` + renderer.buffer.update(buffer); + `),{size:a,syncFunc:Function(`ud`,`uv`,`renderer`,`syncData`,`buffer`,o.join(` +`))}}var zl=function(){function e(){}return e}(),Bl=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();function Vl(e,t){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1});for(var o=0;o>=1,n++;this.stateId=e.data}for(var n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,r=0;rthis.maxIdle&&(e.destroyTexture(i,!0),t[r]=null,n=!0)}if(n){for(var a=0,r=0;r=0;r--)this.unload(e.children[r])},e.prototype.destroy=function(){this.renderer=null},e}();function nu(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C;return C=`WebGL2RenderingContext`in globalThis&&e instanceof globalThis.WebGL2RenderingContext?(t={},t[Ta.UNSIGNED_BYTE]=(n={},n[Ca.RGBA]=e.RGBA8,n[Ca.RGB]=e.RGB8,n[Ca.RG]=e.RG8,n[Ca.RED]=e.R8,n[Ca.RGBA_INTEGER]=e.RGBA8UI,n[Ca.RGB_INTEGER]=e.RGB8UI,n[Ca.RG_INTEGER]=e.RG8UI,n[Ca.RED_INTEGER]=e.R8UI,n[Ca.ALPHA]=e.ALPHA,n[Ca.LUMINANCE]=e.LUMINANCE,n[Ca.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,n),t[Ta.BYTE]=(r={},r[Ca.RGBA]=e.RGBA8_SNORM,r[Ca.RGB]=e.RGB8_SNORM,r[Ca.RG]=e.RG8_SNORM,r[Ca.RED]=e.R8_SNORM,r[Ca.RGBA_INTEGER]=e.RGBA8I,r[Ca.RGB_INTEGER]=e.RGB8I,r[Ca.RG_INTEGER]=e.RG8I,r[Ca.RED_INTEGER]=e.R8I,r),t[Ta.UNSIGNED_SHORT]=(i={},i[Ca.RGBA_INTEGER]=e.RGBA16UI,i[Ca.RGB_INTEGER]=e.RGB16UI,i[Ca.RG_INTEGER]=e.RG16UI,i[Ca.RED_INTEGER]=e.R16UI,i[Ca.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,i),t[Ta.SHORT]=(a={},a[Ca.RGBA_INTEGER]=e.RGBA16I,a[Ca.RGB_INTEGER]=e.RGB16I,a[Ca.RG_INTEGER]=e.RG16I,a[Ca.RED_INTEGER]=e.R16I,a),t[Ta.UNSIGNED_INT]=(o={},o[Ca.RGBA_INTEGER]=e.RGBA32UI,o[Ca.RGB_INTEGER]=e.RGB32UI,o[Ca.RG_INTEGER]=e.RG32UI,o[Ca.RED_INTEGER]=e.R32UI,o[Ca.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,o),t[Ta.INT]=(s={},s[Ca.RGBA_INTEGER]=e.RGBA32I,s[Ca.RGB_INTEGER]=e.RGB32I,s[Ca.RG_INTEGER]=e.RG32I,s[Ca.RED_INTEGER]=e.R32I,s),t[Ta.FLOAT]=(c={},c[Ca.RGBA]=e.RGBA32F,c[Ca.RGB]=e.RGB32F,c[Ca.RG]=e.RG32F,c[Ca.RED]=e.R32F,c[Ca.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,c),t[Ta.HALF_FLOAT]=(l={},l[Ca.RGBA]=e.RGBA16F,l[Ca.RGB]=e.RGB16F,l[Ca.RG]=e.RG16F,l[Ca.RED]=e.R16F,l),t[Ta.UNSIGNED_SHORT_5_6_5]=(u={},u[Ca.RGB]=e.RGB565,u),t[Ta.UNSIGNED_SHORT_4_4_4_4]=(d={},d[Ca.RGBA]=e.RGBA4,d),t[Ta.UNSIGNED_SHORT_5_5_5_1]=(f={},f[Ca.RGBA]=e.RGB5_A1,f),t[Ta.UNSIGNED_INT_2_10_10_10_REV]=(p={},p[Ca.RGBA]=e.RGB10_A2,p[Ca.RGBA_INTEGER]=e.RGB10_A2UI,p),t[Ta.UNSIGNED_INT_10F_11F_11F_REV]=(m={},m[Ca.RGB]=e.R11F_G11F_B10F,m),t[Ta.UNSIGNED_INT_5_9_9_9_REV]=(h={},h[Ca.RGB]=e.RGB9_E5,h),t[Ta.UNSIGNED_INT_24_8]=(g={},g[Ca.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,g),t[Ta.FLOAT_32_UNSIGNED_INT_24_8_REV]=(_={},_[Ca.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,_),t):(v={},v[Ta.UNSIGNED_BYTE]=(y={},y[Ca.RGBA]=e.RGBA,y[Ca.RGB]=e.RGB,y[Ca.ALPHA]=e.ALPHA,y[Ca.LUMINANCE]=e.LUMINANCE,y[Ca.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,y),v[Ta.UNSIGNED_SHORT_5_6_5]=(b={},b[Ca.RGB]=e.RGB,b),v[Ta.UNSIGNED_SHORT_4_4_4_4]=(x={},x[Ca.RGBA]=e.RGBA,x),v[Ta.UNSIGNED_SHORT_5_5_5_1]=(S={},S[Ca.RGBA]=e.RGBA,S),v),C}var ru=function(){function e(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=Ta.UNSIGNED_BYTE,this.internalFormat=Ca.RGBA,this.samplerType=0}return e}(),iu=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Rs,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=nu(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var n=0;n=0;--a){var o=n[a];if(o){var s=o._glTextures[i];s.samplerType!==Ea.FLOAT&&this.renderer.texture.unbind(o)}}},e.prototype.initTexture=function(e){var t=new ru(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on(`dispose`,this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var n,r;t.internalFormat=(r=(n=this.internalFormats[e.type])?.[e.format])??e.format,this.webGLVersion===2&&e.type===Ta.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==Ea.FLOAT&&(this.hasIntegerTextures=!0);else{var r=e.realWidth,i=e.realHeight,a=n.gl;(t.width!==r||t.height!==i||t.dirtyId<0)&&(t.width=r,t.height=i,a.texImage2D(e.target,0,t.internalFormat,r,i,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var n=this.gl;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off(`dispose`,this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var r=this.managedTextures.indexOf(e);r!==-1&&Lo(this.managedTextures,r,1)}},e.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===ka.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Oa.CLAMP:t.wrapMode=e.wrapMode,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==ka.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Da.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&e.anisotropicLevel>0&&e.scaleMode===Da.LINEAR){var i=Math.min(e.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY_EXT,i)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Da.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===Da.LINEAR?n.LINEAR:n.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),au={__proto__:null,FilterSystem:bc,BatchSystem:Sc,ContextSystem:wc,FramebufferSystem:Dc,GeometrySystem:kc,MaskSystem:Cl,ScissorSystem:Dl,StencilSystem:Ol,ProjectionSystem:kl,RenderTextureSystem:Ml,ShaderSystem:Kl,StateSystem:eu,TextureGCSystem:tu,TextureSystem:iu},ou=new vs,su=function(e){Ms(t,e);function t(t,n){t===void 0&&(t=ya.UNKNOWN);var r=e.call(this)||this;return n=Object.assign({},oo.RENDER_OPTIONS,n),r.options=n,r.type=t,r.screen=new fs(0,0,n.width,n.height),r.view=n.view||oo.ADAPTER.createCanvas(),r.resolution=n.resolution||oo.RESOLUTION,r.useContextAlpha=n.useContextAlpha,r.autoDensity=!!n.autoDensity,r.preserveDrawingBuffer=n.preserveDrawingBuffer,r.clearBeforeRender=n.clearBeforeRender,r._backgroundColor=0,r._backgroundColorRgba=[0,0,0,1],r._backgroundColorString=`#000000`,r.backgroundColor=n.backgroundColor||r._backgroundColor,r.backgroundAlpha=n.backgroundAlpha,n.transparent!==void 0&&(Vo(`6.0.0`,`Option transparent is deprecated, please use backgroundAlpha instead.`),r.useContextAlpha=n.transparent,r.backgroundAlpha=n.transparent?0:1),r._lastObjectRendered=null,r.plugins={},r}return t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,`width`,{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`height`,{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var n=this.view.width/this.resolution,r=this.view.height/this.resolution;this.screen.width=n,this.screen.height=r,this.autoDensity&&(this.view.style.width=n+`px`,this.view.style.height=r+`px`),this.emit(`resize`,n,r)},t.prototype.generateTexture=function(e,t,n,r){t===void 0&&(t={}),typeof t==`number`&&(Vo(`6.1.0`,`generateTexture options (scaleMode, resolution, region) are now object options.`),t={scaleMode:t,resolution:n,region:r});var i=t.region,a=Ps(t,[`region`]);r=i||e.getLocalBounds(null,!0),r.width===0&&(r.width=1),r.height===0&&(r.height=1);var o=nc.create(Ns({width:r.width,height:r.height},a));return ou.tx=-r.x,ou.ty=-r.y,this.render(e,{renderTexture:o,clear:!1,transform:ou,skipUpdateTransform:!!e.parent}),o},t.prototype.destroy=function(e){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var n=this;n.plugins=null,n.type=ya.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(t.prototype,`backgroundColor`,{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=Oo(e),Do(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`backgroundAlpha`,{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(vo.default),cu=function(){function e(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return e}(),lu=function(){function e(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return e.prototype.destroy=function(){this.renderer=null},e.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},e.prototype.bind=function(e){var t=this,n=t.gl,r=t.CONTEXT_UID,i=e._glBuffers[r]||this.createGLBuffer(e);n.bindBuffer(e.type,i.buffer)},e.prototype.bindBufferBase=function(e,t){var n=this,r=n.gl,i=n.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var a=e._glBuffers[i]||this.createGLBuffer(e);this.boundBufferBases[t]=e,r.bindBufferBase(r.UNIFORM_BUFFER,t,a.buffer)}},e.prototype.bindBufferRange=function(e,t,n){var r=this,i=r.gl,a=r.CONTEXT_UID;n||=0;var o=e._glBuffers[a]||this.createGLBuffer(e);i.bindBufferRange(i.UNIFORM_BUFFER,t||0,o.buffer,n*256,256)},e.prototype.update=function(e){var t=this,n=t.gl,r=t.CONTEXT_UID,i=e._glBuffers[r];if(e._updateID!==i.updateID)if(i.updateID=e._updateID,n.bindBuffer(e.type,i.buffer),i.byteLength>=e.data.byteLength)n.bufferSubData(e.type,0,e.data);else{var a=e.static?n.STATIC_DRAW:n.DYNAMIC_DRAW;i.byteLength=e.data.byteLength,n.bufferData(e.type,e.data,a)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n=Ia.HIGH?this.multisample=Ia.HIGH:t>=Ia.MEDIUM?this.multisample=Ia.MEDIUM:t>=Ia.LOW?this.multisample=Ia.LOW:this.multisample=Ia.NONE},t.prototype.addSystem=function(e,t){var n=new e(this);if(this[t])throw Error(`Whoops! The name "`+t+`" is already in use`);for(var r in this[t]=n,this.runners)this.runners[r].add(n);return this},t.prototype.render=function(e,t){var n,r,i,a;if(t&&(t instanceof nc?(Vo(`6.0.0`,`Renderer#render arguments changed, use options instead.`),n=t,r=arguments[2],i=arguments[3],a=arguments[4]):(n=t.renderTexture,r=t.clear,i=t.transform,a=t.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit(`prerender`),this.projection.transform=i,!this.context.isLost){if(n||(this._lastObjectRendered=e),!a){var o=e.enableTempParent();e.updateTransform(),e.disableTempParent(o)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(r===void 0?this.clearBeforeRender:r)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit(`postrender`)}},t.prototype.generateTexture=function(t,n,r,i){n===void 0&&(n={});var a=e.prototype.generateTexture.call(this,t,n,r,i);return this.framebuffer.blit(),a},t.prototype.resize=function(t,n){e.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,`extract`,{get:function(){return Vo(`6.0.0`,`Renderer#extract has been deprecated, please use Renderer#plugins.extract instead.`),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,t){Vo(`6.5.0`,`Renderer.registerPlugin() has been deprecated, please use extensions.add() instead.`),Qo.add({name:e,type:Xo.RendererPlugin,ref:t})},t.__plugins={},t}(su);Qo.handleByMap(Xo.RendererPlugin,uu.__plugins);function du(e){return uu.create(e)}var fu=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,pu=fu,mu=function(){function e(e){Vo(`6.1.0`,`System class is deprecated, implemement ISystem interface instead.`),this.renderer=e}return e.prototype.destroy=function(){this.renderer=null},e}(),hu=function(){function e(){this.texArray=null,this.blend=0,this.type=Sa.TRIANGLES,this.start=0,this.size=0,this.data=null}return e}(),gu=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this,n=e._bufferedTextures,r=e.MAX_TEXTURES,i=t._textureArrayPool,a=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,c=++Rs._globalBatch,l=0,u=i[0],d=0;a.copyBoundTextures(o,r);for(var f=0;f=r&&(a.boundArray(u,o,c,r),this.buildDrawCalls(u,d,f),d=f,u=i[++l],++c),p._batchEnabled=c,p.touched=s,u.elements[u.count++]=p)}u.count>0&&(a.boundArray(u,o,c,r),this.buildDrawCalls(u,d,this._bufferSize),++l,++c);for(var f=0;f0&&(t+=` +else `),nthis.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?fs.EMPTY:(e||=new fs(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addPointMatrix=function(e,t){var n=e.a,r=e.b,i=e.c,a=e.d,o=e.tx,s=e.ty,c=n*t.x+i*t.y+o,l=r*t.x+a*t.y+s;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},e.prototype.addQuad=function(e){var t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,a=e[0],o=e[1];t=ar?a:r,i=o>i?o:i,a=e[2],o=e[3],t=ar?a:r,i=o>i?o:i,a=e[4],o=e[5],t=ar?a:r,i=o>i?o:i,a=e[6],o=e[7],t=ar?a:r,i=o>i?o:i,this.minX=t,this.minY=n,this.maxX=r,this.maxY=i},e.prototype.addFrame=function(e,t,n,r,i){this.addFrameMatrix(e.worldTransform,t,n,r,i)},e.prototype.addFrameMatrix=function(e,t,n,r,i){var a=e.a,o=e.b,s=e.c,c=e.d,l=e.tx,u=e.ty,d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,h=a*t+s*n+l,g=o*t+c*n+u;d=hp?h:p,m=g>m?g:m,h=a*r+s*n+l,g=o*r+c*n+u,d=hp?h:p,m=g>m?g:m,h=a*t+s*i+l,g=o*t+c*i+u,d=hp?h:p,m=g>m?g:m,h=a*r+s*i+l,g=o*r+c*i+u,d=hp?h:p,m=g>m?g:m,this.minX=d,this.minY=f,this.maxX=p,this.maxY=m},e.prototype.addVertexData=function(e,t,n){for(var r=this.minX,i=this.minY,a=this.maxX,o=this.maxY,s=t;sa?c:a,o=l>o?l:o}this.minX=r,this.minY=i,this.maxX=a,this.maxY=o},e.prototype.addVertices=function(e,t,n,r){this.addVerticesMatrix(e.worldTransform,t,n,r)},e.prototype.addVerticesMatrix=function(e,t,n,r,i,a){i===void 0&&(i=0),a===void 0&&(a=i);for(var o=e.a,s=e.b,c=e.c,l=e.d,u=e.tx,d=e.ty,f=this.minX,p=this.minY,m=this.maxX,h=this.maxY,g=n;gr?e.maxX:r,this.maxY=e.maxY>i?e.maxY:i},e.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,r=e.minY>t.minY?e.minY:t.minY,i=e.maxXc?i:c,this.maxY=a>l?a:l}},e.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},e.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,r=e.minY>t.y?e.minY:t.y,i=e.maxXc?i:c,this.maxY=a>l?a:l}},e.prototype.pad=function(e,t){e===void 0&&(e=0),t===void 0&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},e.prototype.addFramePad=function(e,t,n,r,i,a){e-=i,t-=a,n+=i,r+=a,this.minX=this.minXn?this.maxX:n,this.minY=this.minYr?this.maxY:r},e}(),ju=function(e,t){return ju=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},ju(e,t)};function Mu(e,t){ju(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Nu=function(e){Mu(t,e);function t(){var t=e.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new Os,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new Au,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return t.mixin=function(e){for(var n=Object.keys(e),r=0;r1)for(var r=0;rthis.children.length)throw Error(e+`addChildAt: The index `+t+` supplied is out of bounds `+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit(`added`,this),this.emit(`childAdded`,e,this,t),e},t.prototype.swapChildren=function(e,t){if(e!==t){var n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e,this.onChildrenChange(n=this.children.length)throw Error(`The index `+t+` supplied is out of bounds `+this.children.length);var n=this.getChildIndex(e);Lo(this.children,n,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw Error(`getChildAt: Index (`+e+`) does not exist.`);return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,t=[],n=0;n1)for(var r=0;r0&&i<=r){a=this.children.splice(n,i);for(var o=0;o1&&this.children.sort(Fu),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,t=this.children.length;e0&&n.height>0){var r,i;if(this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==t.prototype._render&&(r=this.getBounds(!0)),r&&n.intersects(r,i))this._render(e);else if(this.cullArea)return;for(var a=0,o=this.children.length;anew Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Vu=class e{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new e}setParameters(e){this._breathParameters=e}getParameters(){return this._breathParameters}updateParameters(e,t){this._currentTime+=t;let n=this._currentTime*2*3.14159;for(let t=0;t=1&&(r=1,this._blinkingState=Gu.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),n=1-r;break;case Gu.EyeState_Closed:r=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,r>=1&&(this._blinkingState=Gu.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),n=0;break;case Gu.EyeState_Opening:r=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,r>=1&&(r=1,this._blinkingState=Gu.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),n=r;break;case Gu.EyeState_Interval:this._nextBlinkingTime(e[e.EyeState_First=0]=`EyeState_First`,e[e.EyeState_Interval=1]=`EyeState_Interval`,e[e.EyeState_Closing=2]=`EyeState_Closing`,e[e.EyeState_Closed=3]=`EyeState_Closed`,e[e.EyeState_Opening=4]=`EyeState_Opening`,e))(Gu||{});const Ku=.001,qu=.5;var Ju=class e{static create(t){let n=new e;typeof t.FadeInTime==`number`&&(n._fadeTimeSeconds=t.FadeInTime,n._fadeTimeSeconds<=0&&(n._fadeTimeSeconds=qu));let r=t.Groups,i=r.length;for(let e=0;eKu){if(i>=0)break;i=o,a=e.getPartOpacityByIndex(n),a+=t/this._fadeTimeSeconds,a>1&&(a=1)}}i<0&&(i=0,a=1);for(let t=n;ts&&(r=1-s/(1-a)),t>r&&(t=r),e.setPartOpacityByIndex(n,t)}}}constructor(){this._fadeTimeSeconds=qu,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}},Yu=class e{constructor(e){this.parameterIndex=0,this.partIndex=0,this.partId=``,this.link=[],e!=null&&this.assignment(e)}assignment(e){return this.partId=e.partId,this.link=e.link.map(e=>e.clone()),this}initialize(e){this.parameterIndex=e.getParameterIndex(this.partId),this.partIndex=e.getPartIndex(this.partId),e.setParameterValueByIndex(this.parameterIndex,1)}clone(){let t=new e;return t.partId=this.partId,t.parameterIndex=this.parameterIndex,t.partIndex=this.partIndex,t.link=this.link.map(e=>e.clone()),t}},Xu=class e{constructor(e,t){this.x=e||0,this.y=t||0}add(t){let n=new e(0,0);return n.x=this.x+t.x,n.y=this.y+t.y,n}substract(t){let n=new e(0,0);return n.x=this.x-t.x,n.y=this.y-t.y,n}multiply(t){let n=new e(0,0);return n.x=this.x*t.x,n.y=this.y*t.y,n}multiplyByScaler(t){return this.multiply(new e(t,t))}division(t){let n=new e(0,0);return n.x=this.x/t.x,n.y=this.y/t.y,n}divisionByScalar(t){return this.division(new e(t,t))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(e){return Math.sqrt((this.x-e.x)*(this.x-e.x)+(this.y-e.y)*(this.y-e.y))}dot(e){return this.x*e.x+this.y*e.y}normalize(){let e=(this.x*this.x+this.y*this.y)**.5;this.x/=e,this.y/=e}isEqual(e){return this.x==e.x&&this.y==e.y}isNotEqual(e){return!this.isEqual(e)}};const Zu=class{static range(e,t,n){return en&&(e=n),e}static sin(e){return Math.sin(e)}static cos(e){return Math.cos(e)}static abs(e){return Math.abs(e)}static sqrt(e){return Math.sqrt(e)}static cbrt(e){if(e===0)return e;let t=e,n=t<0;n&&(t=-t);let r;return t===1/0?r=1/0:(r=Math.exp(Math.log(t)/3),r=(t/(r*r)+2*r)/3),n?-r:r}static getEasingSine(e){return e<0?0:e>1?1:.5-.5*this.cos(e*Math.PI)}static max(e,t){return e>t?e:t}static min(e,t){return e>t?t:e}static degreesToRadian(e){return e/180*Math.PI}static radianToDegrees(e){return e*180/Math.PI}static directionToRadian(e,t){let n=Math.atan2(t.y,t.x),r=Math.atan2(e.y,e.x),i=n-r;for(;i<-Math.PI;)i+=Math.PI*2;for(;i>Math.PI;)i-=Math.PI*2;return i}static directionToDegrees(e,t){let n=this.directionToRadian(e,t),r=this.radianToDegrees(n);return t.x-e.x>0&&(r=-r),r}static radianToDirection(e){let t=new Xu;return t.x=this.sin(e),t.y=this.cos(e),t}static quadraticEquation(e,t,n){return this.abs(e)1&&(e=1),t<0?t=0:t>1&&(t=1),n<0?n=0:n>1&&(n=1),r<0?r=0:r>1&&(r=1),this._modelColor.R=e,this._modelColor.G=t,this._modelColor.B=n,this._modelColor.A=r}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(e){this._isPremultipliedAlpha=e}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(e){this._isCulling=e}isCulling(){return this._isCulling}setAnisotropy(e){this._anisortopy=e}getAnisotropy(){return this._anisortopy}getModel(){return this._model}constructor(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._modelColor=new nd,this._mvpMatrix4x4=new $u,this._mvpMatrix4x4.loadIdentity()}},td=(e=>(e[e.CubismBlendMode_Normal=0]=`CubismBlendMode_Normal`,e[e.CubismBlendMode_Additive=1]=`CubismBlendMode_Additive`,e[e.CubismBlendMode_Multiplicative=2]=`CubismBlendMode_Multiplicative`,e))(td||{}),nd=class{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}};let rd=!1,id=!1,ad;const od={vertexOffset:0,vertexStep:2};var sd=class{static startUp(e){if(rd)return dd(`CubismFramework.startUp() is already done.`),rd;if(Live2DCubismCore._isStarted)return rd=!0,!0;if(Live2DCubismCore._isStarted=!0,ad=e,ad&&Live2DCubismCore.Logging.csmSetLogFunction(ad.logFunction),rd=!0,rd){let e=Live2DCubismCore.Version.csmGetVersion(),t=(e&4278190080)>>24,n=(e&16711680)>>16,r=e&65535,i=e;dd(`Live2D Cubism Core version: {0}.{1}.{2} ({3})`,(`00`+t).slice(-2),(`00`+n).slice(-2),(`0000`+r).slice(-4),i)}return dd(`CubismFramework.startUp() is complete.`),rd}static cleanUp(){rd=!1,id=!1,ad=void 0}static initialize(){if(!rd){fd(`CubismFramework is not started.`);return}if(id){fd(`CubismFramework.initialize() skipped, already initialized.`);return}id=!0,dd(`CubismFramework.initialize() is complete.`)}static dispose(){if(!rd){fd(`CubismFramework is not started.`);return}if(!id){fd(`CubismFramework.dispose() skipped, not initialized.`);return}ed.staticRelease(),id=!1,dd(`CubismFramework.dispose() is complete.`)}static isStarted(){return rd}static isInitialized(){return id}static coreLogFunction(e){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(e)}static getLoggingLevel(){return ad==null?cd.LogLevel_Off:ad.loggingLevel}constructor(){}},cd=(e=>(e[e.LogLevel_Verbose=0]=`LogLevel_Verbose`,e[e.LogLevel_Debug=1]=`LogLevel_Debug`,e[e.LogLevel_Info=2]=`LogLevel_Info`,e[e.LogLevel_Warning=3]=`LogLevel_Warning`,e[e.LogLevel_Error=4]=`LogLevel_Error`,e[e.LogLevel_Off=5]=`LogLevel_Off`,e))(cd||{});const ld=()=>{};function ud(e,...t){md.print(cd.LogLevel_Debug,`[CSM][D]`+e+` +`,t)}function dd(e,...t){md.print(cd.LogLevel_Info,`[CSM][I]`+e+` +`,t)}function fd(e,...t){md.print(cd.LogLevel_Warning,`[CSM][W]`+e+` +`,t)}function pd(e,...t){md.print(cd.LogLevel_Error,`[CSM][E]`+e+` +`,t)}var md=class{static print(e,t,n){if(en[t]);r(i)}static dumpBytes(e,t,n){for(let r=0;r0?this.print(e,` +`):r%8==0&&r>0&&this.print(e,` `),this.print(e,`{0} `,[t[r]&255]);this.print(e,` +`)}constructor(){}},hd=class{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){let e=this._model.parameters.count,t=this._savedParameters.length;for(let n=0;nt&&(t=this._model.parameters.minimumValues[e]),this._parameterValues[e]=n==1?t:this._parameterValues[e]=this._parameterValues[e]*(1-n)+t*n}setParameterValueById(e,t,n=1){let r=this.getParameterIndex(e);this.setParameterValueByIndex(r,t,n)}addParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)+t*n)}addParameterValueById(e,t,n=1){let r=this.getParameterIndex(e);this.addParameterValueByIndex(r,t,n)}multiplyParameterValueById(e,t,n=1){let r=this.getParameterIndex(e);this.multiplyParameterValueByIndex(r,t,n)}multiplyParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)*(1+(t-1)*n))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(e){let t=this._model.drawables.count;for(let n=0;nt&&(e=t);for(let t=0;t0&&t.getEndTime()(e[e.ExpressionBlendType_Add=0]=`ExpressionBlendType_Add`,e[e.ExpressionBlendType_Multiply=1]=`ExpressionBlendType_Multiply`,e[e.ExpressionBlendType_Overwrite=2]=`ExpressionBlendType_Overwrite`,e))(bd||{}),xd;(e=>{e.supportMoreMaskDivisions=!0,e.setOpacityFromMotion=!1})(xd||={});var Sd=(e=>(e[e.CubismMotionCurveTarget_Model=0]=`CubismMotionCurveTarget_Model`,e[e.CubismMotionCurveTarget_Parameter=1]=`CubismMotionCurveTarget_Parameter`,e[e.CubismMotionCurveTarget_PartOpacity=2]=`CubismMotionCurveTarget_PartOpacity`,e))(Sd||{}),Cd=(e=>(e[e.CubismMotionSegmentType_Linear=0]=`CubismMotionSegmentType_Linear`,e[e.CubismMotionSegmentType_Bezier=1]=`CubismMotionSegmentType_Bezier`,e[e.CubismMotionSegmentType_Stepped=2]=`CubismMotionSegmentType_Stepped`,e[e.CubismMotionSegmentType_InverseStepped=3]=`CubismMotionSegmentType_InverseStepped`,e))(Cd||{}),wd=class{constructor(e=0,t=0){this.time=e,this.value=t}},Td=class{constructor(){this.basePointIndex=0,this.segmentType=0}},Ed=class{constructor(){this.id=``,this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}},Dd=class{constructor(){this.fireTime=0,this.value=``}},Od=class{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=[],this.segments=[],this.points=[],this.events=[]}},kd=class{constructor(e){this._json=e}release(){this._json=void 0}getMotionDuration(){return this._json.Meta.Duration}isMotionLoop(){return this._json.Meta.Loop||!1}getEvaluationOptionFlag(e){return Ad.EvaluationOptionFlag_AreBeziersRistricted==e?!!this._json.Meta.AreBeziersRestricted:!1}getMotionCurveCount(){return this._json.Meta.CurveCount}getMotionFps(){return this._json.Meta.Fps}getMotionTotalSegmentCount(){return this._json.Meta.TotalSegmentCount}getMotionTotalPointCount(){return this._json.Meta.TotalPointCount}getMotionFadeInTime(){return this._json.Meta.FadeInTime}getMotionFadeOutTime(){return this._json.Meta.FadeOutTime}getMotionCurveTarget(e){return this._json.Curves[e].Target}getMotionCurveId(e){return this._json.Curves[e].Id}getMotionCurveFadeInTime(e){return this._json.Curves[e].FadeInTime}getMotionCurveFadeOutTime(e){return this._json.Curves[e].FadeOutTime}getMotionCurveSegmentCount(e){return this._json.Curves[e].Segments.length}getMotionCurveSegment(e,t){return this._json.Curves[e].Segments[t]}getEventCount(){return this._json.Meta.UserDataCount||0}getTotalEventValueSize(){return this._json.Meta.TotalUserDataSize}getEventTime(e){return this._json.UserData[e].Time}getEventValue(e){return this._json.UserData[e].Value}},Ad=(e=>(e[e.EvaluationOptionFlag_AreBeziersRistricted=0]=`EvaluationOptionFlag_AreBeziersRistricted`,e))(Ad||{});const jd=`EyeBlink`,Md=`LipSync`,Nd=`Model`,Pd=`Parameter`,Fd=`PartOpacity`,Id=!1;function Ld(e,t,n){let r=new wd;return r.time=e.time+(t.time-e.time)*n,r.value=e.value+(t.value-e.value)*n,r}function Rd(e,t){let n=(t-e[0].time)/(e[1].time-e[0].time);return n<0&&(n=0),e[0].value+(e[1].value-e[0].value)*n}function zd(e,t){let n=(t-e[0].time)/(e[3].time-e[0].time);n<0&&(n=0);let r=Ld(e[0],e[1],n),i=Ld(e[1],e[2],n),a=Ld(e[2],e[3],n),o=Ld(r,i,n),s=Ld(i,a,n);return Ld(o,s,n).value}function Bd(e,t){let n=t,r=e[0].time,i=e[3].time,a=e[1].time,o=e[2].time,s=i-3*o+3*a-r,c=3*o-6*a+3*r,l=3*a-3*r,u=r-n,d=Qu.cardanoAlgorithmForBezier(s,c,l,u),f=Ld(e[0],e[1],d),p=Ld(e[1],e[2],d),m=Ld(e[2],e[3],d),h=Ld(f,p,d),g=Ld(p,m,d);return Ld(h,g,d).value}function Vd(e,t){return e[0].value}function Hd(e,t){return e[1].value}function Ud(e,t,n){let r=e.curves[t],i=-1,a=r.baseSegmentIndex+r.segmentCount,o=0;for(let t=r.baseSegmentIndex;tn){i=t;break}if(i==-1)return e.points[o].value;let s=e.segments[i];return s.evaluate(e.points.slice(s.basePointIndex),n)}var Wd=class e extends _d{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(t,n){let r=new e;return r.parse(t),r._sourceFrameRate=r._motionData.fps,r._loopDurationSeconds=r._motionData.duration,r._onFinishedMotion=n,r}doUpdateParameters(e,t,n,r){this._modelCurveIdEyeBlink??=jd,this._modelCurveIdLipSync??=Md;let i=t-r.getStartTime();i<0&&(i=0);let a=Number.MAX_VALUE,o=Number.MAX_VALUE,s=64,c=0,l=0;this._eyeBlinkParameterIds.length>s&&ud(`too many eye blink targets : {0}`,this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>s&&ud(`too many lip sync targets : {0}`,this._lipSyncParameterIds.length);let u=this._fadeInSeconds<=0?1:Qu.getEasingSine((t-r.getFadeInStartTime())/this._fadeInSeconds),d=this._fadeOutSeconds<=0||r.getEndTime()<0?1:Qu.getEasingSine((r.getEndTime()-t)/this._fadeOutSeconds),f,p,m,h=i;if(this._isLoop)for(;h>this._motionData.duration;)h-=this._motionData.duration;let g=this._motionData.curves;for(p=0;p>t&1)continue;let i=r+(o-r)*n;e.setParameterValueById(this._eyeBlinkParameterIds[t],i)}if(a!=Number.MAX_VALUE)for(let t=0;t>t&1)continue;let i=r+(a-r)*n;e.setParameterValueById(this._lipSyncParameterIds[t],i)}for(;p=this._motionData.duration&&(this._isLoop?(r.setStartTime(t),this._isLoopFadeIn&&r.setFadeInStartTime(t)):(this._onFinishedMotion&&this._onFinishedMotion(this),r.setIsFinished(!0))),this._lastWeight=n}setIsLoop(e){this._isLoop=e}isLoop(){return this._isLoop}setIsLoopFadeIn(e){this._isLoopFadeIn=e}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(e,t){let n=this._motionData.curves;for(let r=0;rnew Ed),this._motionData.segments=Array.from({length:t.getMotionTotalSegmentCount()}).map(()=>new Td),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new Dd),this._motionData.points=[];let a=0,o=0;for(let e=0;ee&&this._motionData.events[n].fireTime<=t&&this._firedEventValues.push(this._motionData.events[n].value);return this._firedEventValues}},Gd=class{constructor(){this._autoDelete=!1,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&this._motion.release()}setFadeOut(e){this._fadeOutSeconds=e,this._isTriggeredFadeOut=!0}startFadeOut(e,t){let n=t+e;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||nt!=null&&t._motionQueueEntryHandle==e)}setEventCallback(e,t=null){this._eventCallBack=e,this._eventCustomData=t}doUpdateMotion(e,t){let n=!1,r=0;for(;r(e[e.CubismPhysicsTargetType_Parameter=0]=`CubismPhysicsTargetType_Parameter`,e))(Jd||{}),Yd=(e=>(e[e.CubismPhysicsSource_X=0]=`CubismPhysicsSource_X`,e[e.CubismPhysicsSource_Y=1]=`CubismPhysicsSource_Y`,e[e.CubismPhysicsSource_Angle=2]=`CubismPhysicsSource_Angle`,e))(Yd||{}),Xd=class{constructor(){this.initialPosition=new Xu(0,0),this.position=new Xu(0,0),this.lastPosition=new Xu(0,0),this.lastGravity=new Xu(0,0),this.force=new Xu(0,0),this.velocity=new Xu(0,0)}},Zd=class{constructor(){this.normalizationPosition={},this.normalizationAngle={}}},Qd=class{constructor(){this.source={}}},$d=class{constructor(){this.destination={},this.translationScale=new Xu(0,0)}},ef=class{constructor(){this.settings=[],this.inputs=[],this.outputs=[],this.particles=[],this.gravity=new Xu(0,0),this.wind=new Xu(0,0)}},tf=class{constructor(e){this._json=e}release(){this._json=void 0}getGravity(){let e=new Xu(0,0);return e.x=this._json.Meta.EffectiveForces.Gravity.X,e.y=this._json.Meta.EffectiveForces.Gravity.Y,e}getWind(){let e=new Xu(0,0);return e.x=this._json.Meta.EffectiveForces.Wind.X,e.y=this._json.Meta.EffectiveForces.Wind.Y,e}getSubRigCount(){return this._json.Meta.PhysicsSettingCount}getTotalInputCount(){return this._json.Meta.TotalInputCount}getTotalOutputCount(){return this._json.Meta.TotalOutputCount}getVertexCount(){return this._json.Meta.VertexCount}getNormalizationPositionMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Minimum}getNormalizationPositionMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Maximum}getNormalizationPositionDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Default}getNormalizationAngleMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Minimum}getNormalizationAngleMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Maximum}getNormalizationAngleDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Default}getInputCount(e){return this._json.PhysicsSettings[e].Input.length}getInputWeight(e,t){return this._json.PhysicsSettings[e].Input[t].Weight}getInputReflect(e,t){return this._json.PhysicsSettings[e].Input[t].Reflect}getInputType(e,t){return this._json.PhysicsSettings[e].Input[t].Type}getInputSourceId(e,t){return this._json.PhysicsSettings[e].Input[t].Source.Id}getOutputCount(e){return this._json.PhysicsSettings[e].Output.length}getOutputVertexIndex(e,t){return this._json.PhysicsSettings[e].Output[t].VertexIndex}getOutputAngleScale(e,t){return this._json.PhysicsSettings[e].Output[t].Scale}getOutputWeight(e,t){return this._json.PhysicsSettings[e].Output[t].Weight}getOutputDestinationId(e,t){return this._json.PhysicsSettings[e].Output[t].Destination.Id}getOutputType(e,t){return this._json.PhysicsSettings[e].Output[t].Type}getOutputReflect(e,t){return this._json.PhysicsSettings[e].Output[t].Reflect}getParticleCount(e){return this._json.PhysicsSettings[e].Vertices.length}getParticleMobility(e,t){return this._json.PhysicsSettings[e].Vertices[t].Mobility}getParticleDelay(e,t){return this._json.PhysicsSettings[e].Vertices[t].Delay}getParticleAcceleration(e,t){return this._json.PhysicsSettings[e].Vertices[t].Acceleration}getParticleRadius(e,t){return this._json.PhysicsSettings[e].Vertices[t].Radius}getParticlePosition(e,t){let n=new Xu(0,0);return n.x=this._json.PhysicsSettings[e].Vertices[t].Position.X,n.y=this._json.PhysicsSettings[e].Vertices[t].Position.Y,n}};const nf=`X`,rf=`Y`,af=`Angle`,sf=5,cf=100,lf=.001;var uf=class e{static create(t){let n=new e;return n.parse(t),n._physicsRig.gravity.y=0,n}evaluate(e,t){let n,r,i,a,o=new Xu,s,c,l,u,d,f,p,m;d=e.getModel().parameters.values,f=e.getModel().parameters.maximumValues,p=e.getModel().parameters.minimumValues,m=e.getModel().parameters.defaultValues;for(let h=0;h=s.particleCount)break;l[t].destinationParameterIndex==-1&&(l[t].destinationParameterIndex=e.getParameterIndex(l[t].destination.id));let r=new Xu;r.x=u[n].position.x-u[n-1].position.x,r.y=u[n].position.y-u[n-1].position.y,a=l[t].getValue(r,u,n,l[t].reflect,this._options.gravity);let i=l[t].destinationParameterIndex,o=!Float32Array.prototype.slice&&`subarray`in Float32Array.prototype?JSON.parse(JSON.stringify(d.subarray(i))):d.slice(i);wf(o,p[i],f[i],a,l[t]);for(let e=i,t=0;e=2?t[n-1].position.substract(t[n-2].position):i.multiplyByScaler(-1),a=Qu.directionToRadian(i,e),r&&(a*=-1),a}function vf(e,t){return Math.abs(Math.max(e,t)-Math.min(e,t))}function yf(e,t){let n=Math.min(e,t);return n+vf(e,t)/2}function bf(e,t){return e.x}function xf(e,t){return e.y}function Sf(e,t){return t}function Cf(e,t,n,r,i,a,o,s){let c,l,u,d,f=new Xu(0,0),p=new Xu(0,0),m=new Xu(0,0),h=new Xu(0,0);e[0].position=new Xu(n.x,n.y),c=Qu.degreesToRadian(r),d=Qu.radianToDirection(c),d.normalize();for(let n=1;nn&&(o>i.valueExceededMaximum&&(i.valueExceededMaximum=o),o=n),s=i.weight/cf,s>=1||(o=e[0]*(1-s)+o*s),e[0]=o}function Tf(e,t,n,r,i,a,o,s){let c=0,l=Qu.max(n,t);le&&(e=u);let d=Qu.min(i,a),f=Qu.max(i,a),p=o,m=yf(u,l),h=e-m;switch(Math.sign(h)){case 1:{let e=f-p,t=l-m;t!=0&&(c=h*(e/t),c+=p);break}case-1:{let e=d-p,t=u-m;t!=0&&(c=h*(e/t),c+=p);break}case 0:c=p;break}return s?c:c*-1}var Ef=class{constructor(e=0,t=0,n=0,r=0){this.x=e,this.y=t,this.width=n,this.height=r}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height}expand(e,t){this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2}};const Df=4,Of=10;let kf,Af,jf;var Mf=class{getChannelFlagAsColor(e){return this._channelColors[e]}getMaskRenderTexture(){let e=0;if(this._maskTexture&&this._maskTexture.texture!=0&&(this._maskTexture.frameNo=this._currentFrameNo,e=this._maskTexture.texture),e==0){let t=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),e=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,jf),this._maskTexture=new Nf(this._currentFrameNo,e)}return e}setGL(e){this.gl=e}calcClippedDrawTotalBounds(e,t){let n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MIN_VALUE,o=t._clippedDrawableIndexList.length;for(let s=0;sf&&(f=t),np&&(p=n)}if(u!=Number.MAX_VALUE)if(ui&&(i=f),p>a&&(a=p),n==Number.MAX_VALUE)t._allClippedDrawRect.x=0,t._allClippedDrawRect.y=0,t._allClippedDrawRect.width=0,t._allClippedDrawRect.height=0,t._isUsing=!1;else{t._isUsing=!0;let e=i-n,o=a-r;t._allClippedDrawRect.x=n,t._allClippedDrawRect.y=r,t._allClippedDrawRect.width=e,t._allClippedDrawRect.height=o}}}constructor(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=[],this._clippingContextListForDraw=[],this._channelColors=[],this._tmpBoundsOnModel=new Ef,this._tmpMatrix=new $u,this._tmpMatrixForMask=new $u,this._tmpMatrixForDraw=new $u;let e=new nd;e.R=1,e.G=0,e.B=0,e.A=0,this._channelColors.push(e),e=new nd,e.R=0,e.G=1,e.B=0,e.A=0,this._channelColors.push(e),e=new nd,e.R=0,e.G=0,e.B=1,e.A=0,this._channelColors.push(e),e=new nd,e.R=0,e.G=0,e.B=0,e.A=1,this._channelColors.push(e)}release(){var e,t,n;let r=this;for(let t=0;t0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture(),t.getMvpMatrix(),t.preDraw(),this.setupLayoutBounds(n),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let n=0;n(e[e.ShaderNames_SetupMask=0]=`ShaderNames_SetupMask`,e[e.ShaderNames_NormalPremultipliedAlpha=1]=`ShaderNames_NormalPremultipliedAlpha`,e[e.ShaderNames_NormalMaskedPremultipliedAlpha=2]=`ShaderNames_NormalMaskedPremultipliedAlpha`,e[e.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]=`ShaderNames_NomralMaskedInvertedPremultipliedAlpha`,e[e.ShaderNames_AddPremultipliedAlpha=4]=`ShaderNames_AddPremultipliedAlpha`,e[e.ShaderNames_AddMaskedPremultipliedAlpha=5]=`ShaderNames_AddMaskedPremultipliedAlpha`,e[e.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]=`ShaderNames_AddMaskedPremultipliedAlphaInverted`,e[e.ShaderNames_MultPremultipliedAlpha=7]=`ShaderNames_MultPremultipliedAlpha`,e[e.ShaderNames_MultMaskedPremultipliedAlpha=8]=`ShaderNames_MultMaskedPremultipliedAlpha`,e[e.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]=`ShaderNames_MultMaskedPremultipliedAlphaInverted`,e))(If||{});const Lf=`attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_myPos;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_clipMatrix * a_position; v_myPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}`,Rf=`precision mediump float;varying vec2 v_texCoord;varying vec4 v_myPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;void main(){ float isInside = step(u_baseColor.x, v_myPos.x/v_myPos.w) * step(u_baseColor.y, v_myPos.y/v_myPos.w) * step(v_myPos.x/v_myPos.w, u_baseColor.z) * step(v_myPos.y/v_myPos.w, u_baseColor.w); gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;}`,zf=`attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;uniform mat4 u_matrix;void main(){ gl_Position = u_matrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}`,Bf=`attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform mat4 u_matrix;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_matrix * a_position; v_clipPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}`,Vf=`precision mediump float;varying vec2 v_texCoord;uniform vec4 u_baseColor;uniform sampler2D s_texture0;void main(){ gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;}`,Hf=`precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;uniform sampler2D s_texture1;void main(){ vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor; vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}`,Uf=`precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;void main(){vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;col_formask = col_formask * (1.0 - maskVal);gl_FragColor = col_formask;}`;var Wf=class extends ed{constructor(){super(),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._clippingManager=new Mf,this.firstDraw=!0,this._textures={},this._sortedDrawableIndexList=[],this._bufferData={vertex:null,uv:null,index:null}}initialize(e){e.isUsingMasking()&&(this._clippingManager=new Mf,this._clippingManager.initialize(e,e.getDrawableCount(),e.getDrawableMasks(),e.getDrawableMaskCounts()));for(let t=e.getDrawableCount()-1;t>=0;t--)this._sortedDrawableIndexList[t]=0;super.initialize(e)}bindTexture(e,t){this._textures[e]=t}getBindedTextures(){return this._textures}setClippingMaskBufferSize(e){this._clippingManager.release(),this._clippingManager=new Mf,this._clippingManager.setClippingMaskBufferSize(e),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var e,t,n;let r=this;this._clippingManager.release(),r._clippingManager=void 0,(e=this.gl)==null||e.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,(t=this.gl)==null||t.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,(n=this.gl)==null||n.deleteBuffer(this._bufferData.index),this._bufferData.index=null,r._bufferData=void 0,r._textures=void 0}doDrawModel(){this.preDraw(),this._clippingManager!=null&&this._clippingManager.setupClippingContext(this.getModel(),this);let e=this.getModel().getDrawableCount(),t=this.getModel().getDrawableRenderOrders();for(let n=0;n{Wf.doStaticRelease()};var Gf=class{constructor(e){this.groups=e.Groups,this.hitAreas=e.HitAreas,this.layout=e.Layout,this.moc=e.FileReferences.Moc,this.expressions=e.FileReferences.Expressions,this.motions=e.FileReferences.Motions,this.textures=e.FileReferences.Textures,this.physics=e.FileReferences.Physics,this.pose=e.FileReferences.Pose}getEyeBlinkParameters(){var e,t;return(t=(e=this.groups)?.find(e=>e.Name===`EyeBlink`))?.Ids}getLipSyncParameters(){var e,t;return(t=(e=this.groups)?.find(e=>e.Name===`LipSync`))?.Ids}};const Kf=`ParamAngleX`,qf=`ParamAngleY`,Jf=`ParamAngleZ`,Yf=`ParamEyeBallX`,Xf=`ParamEyeBallY`,Zf=`ParamBodyAngleX`,Qf=`ParamBreath`,$f=2,ep=2;var tp;(e=>{e.LOG_LEVEL_VERBOSE=0,e.LOG_LEVEL_WARNING=1,e.LOG_LEVEL_ERROR=2,e.LOG_LEVEL_NONE=999,e.logLevel=e.LOG_LEVEL_WARNING,e.sound=!0,e.motionSync=!0,e.motionFadingDuration=500,e.idleMotionFadingDuration=2e3,e.expressionFadingDuration=500,e.preserveExpressionOnMotion=!0,e.cubism4=xd})(tp||={});const np={log(e,...t){tp.logLevel<=tp.LOG_LEVEL_VERBOSE&&console.log(`[${e}]`,...t)},warn(e,...t){tp.logLevel<=tp.LOG_LEVEL_WARNING&&console.warn(`[${e}]`,...t)},error(e,...t){tp.logLevel<=tp.LOG_LEVEL_ERROR&&console.error(`[${e}]`,...t)}};function rp(e,t,n){return en?n:e}function ip(e,t){t.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!==`constructor`&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})})}function ap(e){let t=e.lastIndexOf(`/`);return t!=-1&&(e=e.slice(0,t)),t=e.lastIndexOf(`/`),t!==-1&&(e=e.slice(t+1)),e}function op(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}var sp=class extends vo.default{constructor(e,t){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=e,this.tag=`ExpressionManager(${e.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(e){return Bu(this,null,function*(){if(!this.definitions[e]){np.warn(this.tag,`Undefined expression at [${e}]`);return}if(this.expressions[e]===null){np.warn(this.tag,`Cannot set expression at [${e}] because it's already failed in loading.`);return}if(this.expressions[e])return this.expressions[e];let t=yield this._loadExpression(e);return this.expressions[e]=t,t})}_loadExpression(e){throw Error(`Not implemented.`)}setRandomExpression(){return Bu(this,null,function*(){if(this.definitions.length){let e=[];for(let t=0;t-1&&ec&&(a*=c/s,o*=c/s),this.vx+=a,this.vy+=o;let l=Math.sqrt(zu(this.vx,2)+zu(this.vy,2)),u=.5*(Math.sqrt(zu(c,2)+8*c*r)-c);l>u&&(this.vx*=u/l,this.vy*=u/l),this.x+=this.vx,this.y+=this.vy}},fp=class{constructor(e){this.json=e;let t=e.url;if(typeof t!=`string`)throw TypeError("The `url` field in settings JSON must be defined as a string.");this.url=t,this.name=ap(this.url)}resolveURL(e){return xo.resolve(this.url,e)}replaceFiles(e){this.moc=e(this.moc,`moc`),this.pose!==void 0&&(this.pose=e(this.pose,`pose`)),this.physics!==void 0&&(this.physics=e(this.physics,`physics`));for(let t=0;t(e.push(t),t)),e}validateFiles(e){let t=(t,n)=>{let r=this.resolveURL(t);if(!e.includes(r)){if(n)throw Error(`File "${t}" is defined in settings, but doesn't exist in given files`);return!1}return!0},n=[this.moc,...this.textures];n.forEach(e=>t(e,!0));let r=this.getDefinedFiles();return r.filter(e=>t(e,!1))}},pp=(e=>(e[e.NONE=0]=`NONE`,e[e.IDLE=1]=`IDLE`,e[e.NORMAL=2]=`NORMAL`,e[e.FORCE=3]=`FORCE`,e))(pp||{}),mp=class{constructor(){this.debug=!1,this.currentPriority=0,this.reservePriority=0}reserve(e,t,n){if(n<=0)return np.log(this.tag,`Cannot start a motion with MotionPriority.NONE.`),!1;if(e===this.currentGroup&&t===this.currentIndex)return np.log(this.tag,`Motion is already playing.`,this.dump(e,t)),!1;if(e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex)return np.log(this.tag,`Motion is already reserved.`,this.dump(e,t)),!1;if(n===1){if(this.currentPriority!==0)return np.log(this.tag,`Cannot start idle motion because another motion is playing.`,this.dump(e,t)),!1;if(this.reservedIdleGroup!==void 0)return np.log(this.tag,`Cannot start idle motion because another idle motion has reserved.`,this.dump(e,t)),!1;this.setReservedIdle(e,t)}else{if(n<3){if(n<=this.currentPriority)return np.log(this.tag,`Cannot start motion because another motion is playing as an equivalent or higher priority.`,this.dump(e,t)),!1;if(n<=this.reservePriority)return np.log(this.tag,`Cannot start motion because another motion has reserved as an equivalent or higher priority.`,this.dump(e,t)),!1}this.setReserved(e,t,n)}return!0}start(e,t,n,r){if(r===1){if(this.setReservedIdle(void 0,void 0),this.currentPriority!==0)return np.log(this.tag,`Cannot start idle motion because another motion is playing.`,this.dump(t,n)),!1}else{if(t!==this.reservedGroup||n!==this.reservedIndex)return np.log(this.tag,`Cannot start motion because another motion has taken the place.`,this.dump(t,n)),!1;this.setReserved(void 0,void 0,0)}return e?(this.setCurrent(t,n,r),!0):!1}complete(){this.setCurrent(void 0,void 0,0)}setCurrent(e,t,n){this.currentPriority=n,this.currentGroup=e,this.currentIndex=t}setReserved(e,t,n){this.reservePriority=n,this.reservedGroup=e,this.reservedIndex=t}setReservedIdle(e,t){this.reservedIdleGroup=e,this.reservedIdleIndex=t}isActive(e,t){return e===this.currentGroup&&t===this.currentIndex||e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex}reset(){this.setCurrent(void 0,void 0,0),this.setReserved(void 0,void 0,0),this.setReservedIdle(void 0,void 0)}shouldRequestIdleMotion(){return this.currentGroup===void 0&&this.reservedIdleGroup===void 0}shouldOverrideExpression(){return!tp.preserveExpressionOnMotion&&this.currentPriority>1}dump(e,t){if(this.debug){let n=[`currentPriority`,`reservePriority`,`currentGroup`,`currentIndex`,`reservedGroup`,`reservedIndex`,`reservedIdleGroup`,`reservedIdleIndex`];return` + group = "${e}", index = ${t} +`+n.map(e=>`[`+e+`] `+this[e]).join(` +`)}return``}};const hp=`SoundManager`,gp=.5;var _p=class{static get volume(){return this._volume}static set volume(e){this._volume=(e>1?1:e<0?0:e)||0,this.audios.forEach(e=>e.volume=this._volume)}static add(e,t,n){let r=new Audio(e);return r.volume=this._volume,r.preload=`auto`,r.addEventListener(`ended`,()=>{this.dispose(r),t?.()}),r.addEventListener(`error`,t=>{this.dispose(r),np.warn(hp,`Error occurred on "${e}"`,t.error),n?.(t.error)}),this.audios.push(r),r}static play(e){return new Promise((t,n)=>{var r;(r=e.play())==null||r.catch(t=>{e.dispatchEvent(new ErrorEvent(`error`,{error:t})),n(t)}),e.readyState===e.HAVE_ENOUGH_DATA?t():e.addEventListener(`canplaythrough`,t)})}static dispose(e){e.pause(),e.removeAttribute(`src`),op(this.audios,e)}static destroy(){for(let e=this.audios.length-1;e>=0;e--)this.dispose(this.audios[e])}};_p.audios=[],_p._volume=gp;var vp=class extends vo.default{constructor(e,t){super(),this.motionGroups={},this.state=new mp,this.playing=!1,this.destroyed=!1,this.settings=e,this.tag=`MotionManager(${e.name})`,this.state.tag=this.tag}init(e){e?.idleMotionGroup&&(this.groups.idle=e.idleMotionGroup),this.setupMotions(e),this.stopAllMotions()}setupMotions(e){for(let e of Object.keys(this.definitions))this.motionGroups[e]=[];let t;switch(e?.motionPreload){case`NONE`:return;case`ALL`:t=Object.keys(this.definitions);break;case`IDLE`:default:t=[this.groups.idle];break}for(let e of t)if(this.definitions[e])for(let t=0;tthis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=a}catch(t){np.warn(this.tag,`Failed to create audio`,e,t)}}let o=yield this.loadMotion(e,t);if(a){let e=_p.play(a).catch(e=>np.warn(this.tag,`Failed to play audio`,a.src,e));tp.motionSync&&(yield e)}return this.state.start(o,e,t,n)?(np.log(this.tag,`Start motion:`,this.getMotionName(i)),this.emit(`motionStart`,e,t,a),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(o),!0):(a&&(_p.dispose(a),this.currentAudio=void 0),!1)})}startRandomMotion(e,t){return Bu(this,null,function*(){let n=this.definitions[e];if(n?.length){let r=[];for(let t=0;te.index>=0);for(let t of e)this.hitAreas[t.name]=t}hitTest(e,t){return Object.keys(this.hitAreas).filter(n=>this.isHit(n,e,t))}isHit(e,t,n){if(!this.hitAreas[e])return!1;let r=this.hitAreas[e].index,i=this.getDrawableBounds(r,yp);return i.x<=t&&t<=i.x+i.width&&i.y<=n&&n<=i.y+i.height}getDrawableBounds(e,t){let n=this.getDrawableVertices(e),r=n[0],i=n[0],a=n[1],o=n[1];for(let e=0;e{(a.status===200||a.status===0)&&a.response?r(a.response):a.onerror()},a.onerror=()=>{np.warn(xp,`Failed to load resource as ${a.responseType} (Status ${a.status}): ${t}`),i(new Sp(`Network error.`,t,a.status))},a.onabort=()=>i(new Sp(`Aborted.`,t,a.status,!0)),a.onloadend=()=>{var t;Cp.allXhrSet.delete(a),e&&((t=Cp.xhrMap.get(e))==null||t.delete(a))},a}static cancelXHRs(){var e;(e=Cp.xhrMap.get(this))==null||e.forEach(e=>{e.abort(),Cp.allXhrSet.delete(e)}),Cp.xhrMap.delete(this)}static release(){Cp.allXhrSet.forEach(e=>e.abort()),Cp.allXhrSet.clear(),Cp.xhrMap=new WeakMap}};let wp=Cp;wp.xhrMap=new WeakMap,wp.allXhrSet=new Set,wp.loader=(e,t)=>new Promise((t,n)=>{let r=Cp.createXHR(e.target,e.settings?e.settings.resolveURL(e.url):e.url,e.type,n=>{e.result=n,t()},n);r.send()});function Tp(e,t){let n=-1;return r(0);function r(i,a){if(a)return Promise.reject(a);if(i<=n)return Promise.reject(Error(`next() called multiple times`));n=i;let o=e[i];if(!o)return Promise.resolve();try{return Promise.resolve(o(t,r.bind(null,i+1)))}catch(e){return Promise.reject(e)}}}var Ep=class{static load(e){return Tp(this.middlewares,e).then(()=>e.result)}};Ep.middlewares=[wp.loader];function Dp(e,t={}){var n;let r={resourceOptions:{crossorigin:t.crossOrigin}};if(tc.fromURL)return tc.fromURL(e,r).catch(e=>{if(e instanceof Error)throw e;let t=Error(`Texture loading error`);throw t.event=e,t});r.resourceOptions.autoLoad=!1;let i=tc.from(e,r);if(i.baseTexture.valid)return Promise.resolve(i);let a=i.baseTexture.resource;return(n=a._live2d_load)??(a._live2d_load=new Promise((e,t)=>{let n=e=>{a.source.removeEventListener(`error`,n);let r=Error(`Texture loading error`);r.event=e,t(r)};a.source.addEventListener(`error`,n),a.load().then(()=>e(i)).catch(n)})),a._live2d_load}const Op=`Live2DFactory`,kp=(e,t)=>Bu(void 0,null,function*(){if(typeof e.source==`string`){let t=yield Ep.load({url:e.source,type:`json`,target:e.live2dModel});t.url=e.source,e.source=t,e.live2dModel.emit(`settingsJSONLoaded`,t)}return t()}),Ap=(e,t)=>Bu(void 0,null,function*(){if(e.source instanceof fp)return e.settings=e.source,t();if(typeof e.source==`object`){let n=Ip.findRuntime(e.source);if(n){let r=n.createModelSettings(e.source);return e.settings=r,e.live2dModel.emit(`settingsLoaded`,r),t()}}throw TypeError(`Unknown settings format.`)}),jp=(e,t)=>{if(e.settings){let n=Ip.findRuntime(e.settings);if(n)return n.ready().then(t)}return t()},Mp=(e,t)=>Bu(void 0,null,function*(){yield t();let n=e.internalModel;if(n){let t=e.settings,r=Ip.findRuntime(t);if(r){let i=[];t.pose&&i.push(Ep.load({settings:t,url:t.pose,type:`json`,target:n}).then(t=>{n.pose=r.createPose(n.coreModel,t),e.live2dModel.emit(`poseLoaded`,n.pose)}).catch(t=>{e.live2dModel.emit(`poseLoadError`,t),np.warn(Op,`Failed to load pose.`,t)})),t.physics&&i.push(Ep.load({settings:t,url:t.physics,type:`json`,target:n}).then(t=>{n.physics=r.createPhysics(n.coreModel,t),e.live2dModel.emit(`physicsLoaded`,n.physics)}).catch(t=>{e.live2dModel.emit(`physicsLoadError`,t),np.warn(Op,`Failed to load physics.`,t)})),i.length&&(yield Promise.all(i))}}}),Np=(e,t)=>Bu(void 0,null,function*(){if(e.settings){let n=e.live2dModel,r=e.settings.textures.map(t=>{let n=e.settings.resolveURL(t);return Dp(n,{crossOrigin:e.options.crossOrigin})});if(yield t(),e.internalModel)n.internalModel=e.internalModel,n.emit(`modelLoaded`,e.internalModel);else throw TypeError(`Missing internal model.`);n.textures=yield Promise.all(r),n.emit(`textureLoaded`,n.textures)}else throw TypeError(`Missing settings.`)}),Pp=(e,t)=>Bu(void 0,null,function*(){let n=e.settings;if(n instanceof fp){let r=Ip.findRuntime(n);if(!r)throw TypeError(`Unknown model settings.`);let i=yield Ep.load({settings:n,url:n.moc,type:`arraybuffer`,target:e.live2dModel});if(!r.isValidMoc(i))throw Error(`Invalid moc data`);let a=r.createCoreModel(i);return e.internalModel=r.createInternalModel(a,n,e.options),t()}throw TypeError(`Missing settings.`)}),Fp=class{static registerRuntime(e){Fp.runtimes.push(e),Fp.runtimes.sort((e,t)=>t.version-e.version)}static findRuntime(e){for(let t of Fp.runtimes)if(t.test(e))return t}static setupLive2DModel(e,t,n){return Bu(this,null,function*(){let r=new Promise(t=>e.once(`textureLoaded`,t)),i=new Promise(t=>e.once(`modelLoaded`,t)),a=Promise.all([r,i]).then(()=>e.emit(`ready`));yield Tp(Fp.live2DModelMiddlewares,{live2dModel:e,source:t,options:n||{}}),yield a,e.emit(`load`)})}static loadMotion(e,t,n){var r,i;let a=r=>e.emit(`motionLoadError`,t,n,r);try{let o=(r=e.definitions[t])?.[n];if(!o)return Promise.resolve(void 0);e.listeners(`destroy`).includes(Fp.releaseTasks)||e.once(`destroy`,Fp.releaseTasks);let s=Fp.motionTasksMap.get(e);s||(s={},Fp.motionTasksMap.set(e,s));let c=s[t];c||(c=[],s[t]=c);let l=e.getMotionFile(o);return(i=c[n])??(c[n]=Ep.load({url:l,settings:e.settings,type:e.motionDataType,target:e}).then(r=>{var i;let a=(i=Fp.motionTasksMap.get(e))?.[t];a&&delete a[n];let s=e.createMotion(r,t,o);return e.emit(`motionLoaded`,t,n,s),s}).catch(t=>{np.warn(e.tag,`Failed to load motion: ${l} +`,t),a(t)})),c[n]}catch(r){np.warn(e.tag,`Failed to load motion at "${t}"[${n}] +`,r),a(r)}return Promise.resolve(void 0)}static loadExpression(e,t){var n;let r=n=>e.emit(`expressionLoadError`,t,n);try{let i=e.definitions[t];if(!i)return Promise.resolve(void 0);e.listeners(`destroy`).includes(Fp.releaseTasks)||e.once(`destroy`,Fp.releaseTasks);let a=Fp.expressionTasksMap.get(e);a||(a=[],Fp.expressionTasksMap.set(e,a));let o=e.getExpressionFile(i);return(n=a[t])??(a[t]=Ep.load({url:o,settings:e.settings,type:`json`,target:e}).then(n=>{let r=Fp.expressionTasksMap.get(e);r&&delete r[t];let a=e.createExpression(n,i);return e.emit(`expressionLoaded`,t,a),a}).catch(t=>{np.warn(e.tag,`Failed to load expression: ${o} +`,t),r(t)})),a[t]}catch(n){np.warn(e.tag,`Failed to load expression at [${t}] +`,n),r(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof vp?Fp.motionTasksMap.delete(this):Fp.expressionTasksMap.delete(this)}};let Ip=Fp;Ip.runtimes=[],Ip.urlToJSON=kp,Ip.jsonToSettings=Ap,Ip.waitUntilReady=jp,Ip.setupOptionals=Mp,Ip.setupEssentials=Np,Ip.createInternalModel=Pp,Ip.live2DModelMiddlewares=[kp,Ap,jp,Mp,Np,Pp],Ip.motionTasksMap=new WeakMap,Ip.expressionTasksMap=new WeakMap,vp.prototype._loadMotion=function(e,t){return Ip.loadMotion(this,e,t)},sp.prototype._loadExpression=function(e){return Ip.loadExpression(this,e)};var Lp=class{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on(`pointertap`,Rp,this):this.off(`pointertap`,Rp,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on(`pointermove`,zp,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off(`pointermove`,zp,this),this.interactionManager=void 0)}};function Rp(e){this.tap(e.data.global.x,e.data.global.y)}function zp(e){this.focus(e.data.global.x,e.data.global.y)}var Bp=class extends Os{};const Vp=new us,Hp=new vs;let Up;var Wp=class extends Iu{constructor(e){super(),this.tag=`Live2DModel(uninitialized)`,this.textures=[],this.transform=new Bp,this.anchor=new _s(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once(`modelLoaded`,()=>this.init(e))}static from(e,t){let n=new this(t);return Ip.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){let n=new this(t);return Ip.setupLive2DModel(n,e,t).then(t?.onLoad).catch(t?.onError),n}static registerTicker(e){Up=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;Up||=(t=window.PIXI)?.Ticker,e?this._destroyed||(Up?(Up.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):np.warn(this.tag,`No Ticker registered, please call Live2DModel.registerTicker(Ticker).`)):(Up?.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(e){this.tag=`Live2DModel(${this.internalModel.settings.name})`;let t=Object.assign({autoUpdate:!0,autoInteract:!0},e);t.autoInteract&&(this.interactive=!0),this.autoInteract=t.autoInteract,this.autoUpdate=t.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(e,t,n){return t===void 0?this.internalModel.motionManager.startRandomMotion(e,n):this.internalModel.motionManager.startMotion(e,t,n)}expression(e){return this.internalModel.motionManager.expressionManager?e===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(e):Promise.resolve(!1)}focus(e,t,n=!1){Vp.x=e,Vp.y=t,this.toModelPosition(Vp,Vp,!0);let r=Vp.x/this.internalModel.originalWidth*2-1,i=Vp.y/this.internalModel.originalHeight*2-1,a=Math.atan2(i,r);this.internalModel.focusController.focus(Math.cos(a),-Math.sin(a),n)}tap(e,t){let n=this.hitTest(e,t);n.length&&(np.log(this.tag,`Hit`,n),this.emit(`hit`,n))}hitTest(e,t){return Vp.x=e,Vp.y=t,this.toModelPosition(Vp,Vp),this.internalModel.hitTest(Vp.x,Vp.y)}toModelPosition(e,t=e.clone(),n){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(e,t),this.internalModel.localTransform.applyInverse(t,t),t}containsPoint(e){return this.getBounds(!0).contains(e.x,e.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(Up.shared.deltaMS)}update(e){this.deltaTime+=e,this.elapsedTime+=e}_render(e){this.registerInteraction(e.plugins.interaction),e.batch.reset(),e.geometry.reset(),e.shader.reset(),e.state.reset();let t=!1;this.glContextID!==e.CONTEXT_UID&&(this.glContextID=e.CONTEXT_UID,this.internalModel.updateWebGLContext(e.gl,this.glContextID),t=!0);for(let n=0;nt.destroy(e.baseTexture)),this.internalModel.destroy(),super.destroy(e)}};ip(Wp,[Lp]);const Gp=class{static resolveURL(e,t){var n;let r=(n=Gp.filesMap[e])?.[t];if(r===void 0)throw Error(`Cannot find this file from uploaded files: `+t);return r}static upload(e,t){return Bu(this,null,function*(){let n={};for(let r of t.getDefinedFiles()){let i=decodeURI(xo.resolve(t.url,r)),a=e.find(e=>e.webkitRelativePath===i);a&&(n[r]=URL.createObjectURL(a))}Gp.filesMap[t._objectURL]=n})}static createSettings(e){return Bu(this,null,function*(){let t=e.find(e=>e.name.endsWith(`model.json`)||e.name.endsWith(`model3.json`));if(!t)throw TypeError(`Settings file not found`);let n=yield Gp.readText(t),r=JSON.parse(n);r.url=t.webkitRelativePath;let i=Ip.findRuntime(r);if(!i)throw Error(`Unknown settings JSON`);let a=i.createModelSettings(r);return a._objectURL=URL.createObjectURL(t),a})}static readText(e){return Bu(this,null,function*(){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsText(e,`utf8`)})})}};let Kp=Gp;Kp.filesMap={},Kp.factory=(e,t)=>Bu(void 0,null,function*(){if(Array.isArray(e.source)&&e.source[0]instanceof File){let t=e.source,n=t.settings;if(!n)n=yield Gp.createSettings(t);else if(!n._objectURL)throw Error(`"_objectURL" must be specified in ModelSettings`);n.validateFiles(t.map(e=>encodeURI(e.webkitRelativePath))),yield Gp.upload(t,n),n.resolveURL=function(e){return Gp.resolveURL(this._objectURL,e)},e.source=n,e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){let e=this.settings._objectURL;if(URL.revokeObjectURL(e),Gp.filesMap[e])for(let t of Object.values(Gp.filesMap[e]))URL.revokeObjectURL(t);delete Gp.filesMap[e]})})}return t()}),Ip.live2DModelMiddlewares.unshift(Kp.factory);const qp=class{static unzip(e,t){return Bu(this,null,function*(){let n=yield qp.getFilePaths(e),r=[];for(let e of t.getDefinedFiles()){let i=decodeURI(xo.resolve(t.url,e));n.includes(i)&&r.push(i)}let i=yield qp.getFiles(e,r);for(let e=0;ee.endsWith(`model.json`)||e.endsWith(`model3.json`));if(!n)throw Error(`Settings file not found`);let r=yield qp.readText(e,n);if(!r)throw Error(`Empty settings file: `+n);let i=JSON.parse(r);i.url=n;let a=Ip.findRuntime(i);if(!a)throw Error(`Unknown settings JSON`);return a.createModelSettings(i)})}static zipReader(e,t){return Bu(this,null,function*(){throw Error(`Not implemented`)})}static getFilePaths(e){return Bu(this,null,function*(){throw Error(`Not implemented`)})}static getFiles(e,t){return Bu(this,null,function*(){throw Error(`Not implemented`)})}static readText(e,t){return Bu(this,null,function*(){throw Error(`Not implemented`)})}static releaseReader(e){}};let Jp=qp;if(Jp.ZIP_PROTOCOL=`zip://`,Jp.uid=0,Jp.factory=(e,t)=>Bu(void 0,null,function*(){let n=e.source,r,i,a;if(typeof n==`string`&&(n.endsWith(`.zip`)||n.startsWith(qp.ZIP_PROTOCOL))?(r=n.startsWith(qp.ZIP_PROTOCOL)?n.slice(qp.ZIP_PROTOCOL.length):n,i=yield Ep.load({url:r,type:`blob`,target:e.live2dModel})):Array.isArray(n)&&n.length===1&&n[0]instanceof File&&n[0].name.endsWith(`.zip`)&&(i=n[0],r=URL.createObjectURL(i),a=n.settings),i){if(!i.size)throw Error(`Empty zip file`);let t=yield qp.zipReader(i,r);a||=yield qp.createSettings(t),a._objectURL=qp.ZIP_PROTOCOL+qp.uid+`/`+a.url;let n=yield qp.unzip(t,a);n.settings=a,e.source=n,r.startsWith(`blob:`)&&e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){URL.revokeObjectURL(r)})}),qp.releaseReader(t)}return t()}),Ip.live2DModelMiddlewares.unshift(Jp.factory),!window.Live2DCubismCore)throw Error(`Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.`);var Yp=class extends sp{constructor(e,t){var n;super(e,t),this.queueManager=new Kd,this.definitions=(n=e.expressions)??[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(e){return this.definitions.findIndex(t=>t.Name===e)}getExpressionFile(e){return e.File}createExpression(e,t){return yd.create(e)}_setExpression(e){return this.queueManager.startMotion(e,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}},Xp=class e extends fp{constructor(t){if(super(t),!e.isValidJSON(t))throw TypeError(`Invalid JSON.`);Object.assign(this,new Gf(t))}static isValidJSON(e){var t;return!!e?.FileReferences&&typeof e.FileReferences.Moc==`string`&&(t=e.FileReferences.Textures)?.length>0&&e.FileReferences.Textures.every(e=>typeof e==`string`)}replaceFiles(e){if(super.replaceFiles(e),this.motions)for(let[t,n]of Object.entries(this.motions))for(let r=0;r{this.emit(`motion:`+t)})}isFinished(){return this.queueManager.isFinished()}_startMotion(e,t){return e.setFinishedMotionHandler(t),this.queueManager.stopAllMotions(),this.queueManager.startMotion(e,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(e,t,n){let r=Wd.create(e),i=new kd(e),a=(t===this.groups.idle?tp.idleMotionFadingDuration:tp.motionFadingDuration)/1e3;return i.getMotionFadeInTime()===void 0&&r.setFadeInTime(n.FadeInTime>0?n.FadeInTime:a),i.getMotionFadeOutTime()===void 0&&r.setFadeOutTime(n.FadeOutTime>0?n.FadeOutTime:a),r.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),r}getMotionFile(e){return e.File}getMotionName(e){return e.File}getSoundFile(e){return e.Sound}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}};const Qp=new $u;var $p=class extends bp{constructor(e,t,n){super(),this.lipSync=!0,this.breath=Vu.create(),this.renderer=new Wf,this.idParamAngleX=Kf,this.idParamAngleY=qf,this.idParamAngleZ=Jf,this.idParamEyeBallX=Yf,this.idParamEyeBallY=Xf,this.idParamBodyAngleX=Zf,this.idParamBreath=Qf,this.pixelsPerUnit=1,this.centeringTransform=new vs,this.coreModel=e,this.settings=t,this.motionManager=new Zp(t,n),this.init()}init(){var e;super.init(),(e=this.settings.getEyeBlinkParameters())?.length>0&&(this.eyeBlink=Wu.create(this.settings)),this.breath.setParameters([new Hu(this.idParamAngleX,0,15,6.5345,.5),new Hu(this.idParamAngleY,0,8,3.5345,.5),new Hu(this.idParamAngleZ,0,10,5.5345,.5),new Hu(this.idParamBodyAngleX,0,4,15.5345,.5),new Hu(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){let e={};if(this.settings.layout)for(let t of Object.keys(this.settings.layout)){let n=t.charAt(0).toLowerCase()+t.slice(1);e[n]=this.settings.layout[t]}return e}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(e,t){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(e),this.renderer._clippingManager._currentFrameNo=t,this.renderer._clippingManager._maskTexture=void 0,Ff.getInstance()._shaderSets=[]}bindTexture(e,t){this.renderer.bindTexture(e,t)}getHitAreaDefs(){var e,t;return(t=(e=this.settings.hitAreas)?.map(e=>({id:e.Id,name:e.Name,index:this.coreModel.getDrawableIndex(e.Id)})))??[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(e){return this.coreModel.getDrawableIndex(e)}getDrawableVertices(e){if(typeof e==`string`&&(e=this.coreModel.getDrawableIndex(e),e===-1))throw TypeError(`Unable to find drawable ID: `+e);let t=this.coreModel.getDrawableVertices(e).slice();for(let e=0;e{function n(){try{rm(),e()}catch(e){if(tm--,tm<0){let n=Error(`Failed to start up Cubism 4 framework.`);n.cause=e,t(n);return}np.log(`Cubism4`,`Startup failed, retrying 10ms later...`),setTimeout(n,10)}}n()}),em)}function rm(e){e=Object.assign({logFunction:console.log,loggingLevel:cd.LogLevel_Verbose},e),sd.startUp(e),sd.initialize()}Ip.registerRuntime({version:4,ready:nm,test(e){return e instanceof Xp||Xp.isValidJSON(e)},isValidMoc(e){if(e.byteLength<4)return!1;let t=new Int8Array(e,0,4);return String.fromCharCode(...t)===`MOC3`},createModelSettings(e){return new Xp(e)},createCoreModel(e){let t=gd.create(e);try{let e=t.createModel();return e.__moc=t,e}catch(e){try{t.release()}catch{}throw e}},createInternalModel(e,t,n){let r=new $p(e,t,n),i=e;return i.__moc&&(r.__moc=i.__moc,delete i.__moc,r.once(`destroy`,im)),r},createPhysics(e,t){return uf.create(t)},createPose(e,t){return Ju.create(t)}});function im(){var e;(e=this.__moc)==null||e.release()}var am=H({__name:`Canvas`,props:{width:null,height:null,resolution:{default:2}},setup(e,{expose:t}){let n=e,r=W(),i=W(),a=W();async function o(e){Wp.registerTicker(ns),Qo.add(rs),i.value=new Ru({width:n.width*n.resolution,height:n.height*n.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),a.value=i.value.view,a.value.style.width=`100%`,a.value.style.height=`100%`,a.value.style.objectFit=`cover`,a.value.style.display=`block`,e.appendChild(i.value.view)}function s(){i.value&&i.value.renderer.resize(n.width,n.height)}K([()=>n.width,()=>n.height],()=>s()),K(()=>n.resolution,e=>{i.value&&e&&(i.value.renderer.resolution=e,s())}),Yt(async()=>r.value&&await o(r.value)),Zt(()=>{var e;return(e=i.value)?.destroy()});async function c(){let e=new Promise(e=>{if(!a.value||!i.value)return e(null);i.value.render(),a.value.toBlob(e)});return e}function l(){return a.value}return t({captureFrame:c,canvasElement:l}),(e,t)=>(U(),V(`div`,{ref_key:`containerRef`,ref:r,"h-full":``,"w-full":``},[nn(e.$slots,`default`,{app:i.value})],512))}}),om=am,sm=function(){function e(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new us,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(e.prototype,`pointerId`,{get:function(){return this.identifier},enumerable:!1,configurable:!0}),e.prototype.getLocalPosition=function(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)},e.prototype.copyEvent=function(e){`isPrimary`in e&&e.isPrimary&&(this.isPrimary=!0),this.button=`button`in e&&e.button;var t=`buttons`in e&&e.buttons;this.buttons=Number.isInteger(t)?t:`which`in e&&e.which,this.width=`width`in e&&e.width,this.height=`height`in e&&e.height,this.tiltX=`tiltX`in e&&e.tiltX,this.tiltY=`tiltY`in e&&e.tiltY,this.pointerType=`pointerType`in e&&e.pointerType,this.pressure=`pressure`in e&&e.pressure,this.rotationAngle=`rotationAngle`in e&&e.rotationAngle,this.twist=`twist`in e&&e.twist||0,this.tangentialPressure=`tangentialPressure`in e&&e.tangentialPressure||0},e.prototype.reset=function(){this.isPrimary=!1},e}(),cm=function(e,t){return cm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},cm(e,t)};function lm(e,t){cm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var um=function(){function e(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return e.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},e.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},e}(),dm=function(){function e(t){this._pointerId=t,this._flags=e.FLAGS.NONE}return e.prototype._doSet=function(e,t){t?this._flags|=e:this._flags&=~e},Object.defineProperty(e.prototype,`pointerId`,{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`flags`,{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`none`,{get:function(){return this._flags===e.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`over`,{get:function(){return(this._flags&e.FLAGS.OVER)!==0},set:function(t){this._doSet(e.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`rightDown`,{get:function(){return(this._flags&e.FLAGS.RIGHT_DOWN)!==0},set:function(t){this._doSet(e.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`leftDown`,{get:function(){return(this._flags&e.FLAGS.LEFT_DOWN)!==0},set:function(t){this._doSet(e.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),e.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),e}(),fm=function(){function e(){this._tempPoint=new us}return e.prototype.recursiveFindHit=function(e,t,n,r,i){var a;if(!t||!t.visible)return!1;var o=e.data.global;i=t.interactive||i;var s=!1,c=i,l=!0;if(t.hitArea)r&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?s=!0:(r=!1,l=!1)),c=!1;else if(t._mask&&r){var u=t._mask.isMaskData?t._mask.maskObject:t._mask;u&&!(a=u.containsPoint)?.call(u,o)&&(r=!1)}if(l&&t.interactiveChildren&&t.children)for(var d=t.children,f=d.length-1;f>=0;f--){var p=d[f],m=this.recursiveFindHit(e,p,n,r,c);if(m){if(!p.parent)continue;c=!1,m&&(e.target&&(r=!1),s=!0)}}return i&&(r&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(s=!0),t.interactive&&(s&&!e.target&&(e.target=t),n&&n(e,t,!!s))),s},e.prototype.findHit=function(e,t,n,r){this.recursiveFindHit(e,t,n,r,!1)},e}(),pm={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor===`pointer`},set buttonMode(e){e?this.cursor=`pointer`:this.cursor===`pointer`&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Nu.mixin(pm);var mm=1,hm={target:null,data:{global:null}},gm=function(e){lm(t,e);function t(t,n){var r=e.call(this)||this;return n||={},r.renderer=t,r.autoPreventDefault=n.autoPreventDefault===void 0?!0:n.autoPreventDefault,r.interactionFrequency=n.interactionFrequency||10,r.mouse=new sm,r.mouse.identifier=mm,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[mm]=r.mouse,r.interactionDataPool=[],r.eventData=new um,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!(`PointerEvent`in globalThis),r.supportsTouchEvents=`ontouchstart`in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:`inherit`,pointer:`pointer`},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new fm,r._tempDisplayObject=new Pu,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=n.useSystemTicker===void 0?!0:n.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return Object.defineProperty(t.prototype,`useSystemTicker`,{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lastObjectRendered`,{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return hm.target=null,hm.data.global=e,t||=this.lastObjectRendered,this.processInteractive(hm,t,null,!0),hm.target},t.prototype.setTargetElement=function(e,t){t===void 0&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(ns.system.add(this.tickerUpdate,this,es.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(ns.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime0&&(a=e.composedPath()[0]);for(var o=a===this.interactionDOMElement?``:`outside`,s=0;s{ +/*! +localForage -- Offline Storage, Improved +Version 1.10.0 +https://localforage.github.io/localForage +(c) 2013-2017 Mozilla, Apache License 2.0 +*/ +(function(n){if(typeof exports==`object`&&t!==void 0)t.exports=n();else if(typeof define==`function`&&define.amd)define([],n);else{var r;r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this,r.localforage=n()}})(function(){var e,t,n;return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof Ct==`function`&&Ct;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof Ct==`function`&&Ct,o=0;o`u`&&e(3);var l=Promise;function u(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function d(e,t,n){typeof t==`function`&&e.then(t),typeof n==`function`&&e.catch(n)}function f(e){return typeof e!=`string`&&(console.warn(e+` used as a key, but it is not a string.`),e=String(e)),e}function p(){if(arguments.length&&typeof arguments[arguments.length-1]==`function`)return arguments[arguments.length-1]}var m=`local-forage-detect-blob-support`,h=void 0,g={},_=Object.prototype.toString,v=`readonly`,y=`readwrite`;function b(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i=43)}}).catch(function(){return!1})}function S(e){return typeof h==`boolean`?l.resolve(h):x(e).then(function(e){return h=e,h})}function C(e){var t=g[e.name],n={};n.promise=new l(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then(function(){return n.promise}):t.dbReady=n.promise}function w(e){var t=g[e.name],n=t.deferredOperations.pop();if(n)return n.resolve(),n.promise}function T(e,t){var n=g[e.name],r=n.deferredOperations.pop();if(r)return r.reject(t),r.promise}function E(e,t){return new l(function(n,r){if(g[e.name]=g[e.name]||F(),e.db)if(t)C(e),e.db.close();else return n(e.db);var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(m)}catch(n){if(n.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+t.oldVersion+` to version `+t.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw n}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),w(e)}})}function D(e){return E(e,!1)}function O(e){return E(e,!0)}function k(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.versione.db.version;if(r&&(e.version!==t&&console.warn(`The database "`+e.name+`" can't be downgraded from version `+e.db.version+` to version `+e.version+`.`),e.version=e.db.version),i||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function A(e){return new l(function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||``);t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)})}function j(e){var t=b(atob(e.data));return c([t],{type:e.type})}function M(e){return e&&e.__local_forage_encoded_blob}function N(e){var t=this,n=t._initReady().then(function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return d(n,e,e),n}function ee(e){C(e);for(var t=g[e.name],n=t.forages,r=0;r0&&(!e.db||i.name===`InvalidStateError`||i.name===`NotFoundError`))return l.resolve().then(function(){if(!e.db||i.name===`NotFoundError`&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),O(e)}).then(function(){return ee(e).then(function(){P(e,t,n,r-1)})}).catch(n);n(i)}}function F(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=g[n.name];i||(i=F(),g[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=N);var a=[];function o(){return l.resolve()}for(var s=0;s>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}function ke(e){var t=new Uint8Array(e),n=``,r;for(r=0;r>2],n+=ue[(t[r]&3)<<4|t[r+1]>>4],n+=ue[(t[r+1]&15)<<2|t[r+2]>>6],n+=ue[t[r+2]&63];return t.length%3==2?n=n.substring(0,n.length-1)+`=`:t.length%3==1&&(n=n.substring(0,n.length-2)+`==`),n}function Ae(e,t){var n=``;if(e&&(n=De.call(e)),e&&(n===`[object ArrayBuffer]`||e.buffer&&De.call(e.buffer)===`[object ArrayBuffer]`)){var r,i=pe;e instanceof ArrayBuffer?(r=e,i+=he):(r=e.buffer,n===`[object Int8Array]`?i+=_e:n===`[object Uint8Array]`?i+=ve:n===`[object Uint8ClampedArray]`?i+=ye:n===`[object Int16Array]`?i+=be:n===`[object Uint16Array]`?i+=Se:n===`[object Int32Array]`?i+=xe:n===`[object Uint32Array]`?i+=Ce:n===`[object Float32Array]`?i+=we:n===`[object Float64Array]`?i+=Te:t(Error(`Failed to get type for BinaryArray`))),t(i+ke(r))}else if(n===`[object Blob]`){var a=new FileReader;a.onload=function(){var n=de+e.type+`~`+ke(this.result);t(pe+ge+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error(`Couldn't convert value into a JSON string: `,e),t(null,n)}}function je(e){if(e.substring(0,me)!==pe)return JSON.parse(e);var t=e.substring(Ee),n=e.substring(me,Ee),r;if(n===ge&&fe.test(t)){var i=t.match(fe);r=i[1],t=t.substring(i[0].length)}var a=Oe(t);switch(n){case he:return a;case ge:return c([a],{type:r});case _e:return new Int8Array(a);case ve:return new Uint8Array(a);case ye:return new Uint8ClampedArray(a);case be:return new Int16Array(a);case Se:return new Uint16Array(a);case xe:return new Int32Array(a);case Ce:return new Uint32Array(a);case we:return new Float32Array(a);case Te:return new Float64Array(a);default:throw Error(`Unkown type: `+n)}}var Me={serialize:Ae,deserialize:je,stringToBuffer:Oe,bufferToString:ke};function Ne(e,t,n,r){e.executeSql(`CREATE TABLE IF NOT EXISTS `+t.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],n,r)}function Pe(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=typeof e[r]==`string`?e[r]:e[r].toString();var i=new l(function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction(function(i){Ne(i,n,function(){t._dbInfo=n,e()},function(e,t){r(t)})},r)});return n.serializer=Me,i}function Fe(e,t,n,r,i,a){e.executeSql(n,r,i,function(e,o){o.code===o.SYNTAX_ERR?e.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[t.storeName],function(e,s){s.rows.length?a(e,o):Ne(e,t,function(){e.executeSql(n,r,i,a)},a)},a):a(e,o)},a)}function Ie(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Fe(n,i,`SELECT * FROM `+i.storeName+` WHERE key = ? LIMIT 1`,[e],function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&=i.serializer.deserialize(r),t(r)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function Le(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Fe(n,i,`SELECT * FROM `+i.storeName,[],function(n,r){for(var a=r.rows,o=a.length,s=0;s0){a(Re.apply(i,[e,s,n,r-1]));return}o(t)}})})}).catch(o)});return u(a,n),a}function ze(e,t,n){return Re.apply(this,[e,t,n,1])}function Be(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Fe(n,i,`DELETE FROM `+i.storeName+` WHERE key = ?`,[e],function(){t()},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function Ve(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Fe(t,r,`DELETE FROM `+r.storeName,[],function(){e()},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function He(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Fe(t,r,`SELECT COUNT(key) as c FROM `+r.storeName,[],function(t,n){var r=n.rows.item(0).c;e(r)},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function Ue(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Fe(n,i,`SELECT key FROM `+i.storeName+` WHERE id = ? LIMIT 1`,[e+1],function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function We(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Fe(t,r,`SELECT key FROM `+r.storeName,[],function(t,n){for(var r=[],i=0;i '__WebKitDatabaseInfoTable__'`,[],function(n,r){for(var i=[],a=0;a0}function Qe(e){var t=this,n={};if(e)for(var r in e)n[r]=e[r];return n.keyPrefix=Ye(e,t._defaultConfig),Ze()?(t._dbInfo=n,n.serializer=Me,l.resolve()):l.reject()}function $e(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);r.indexOf(e)===0&&localStorage.removeItem(r)}});return u(n,e),n}function et(e,t){var n=this;e=f(e);var r=n.ready().then(function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&=t.serializer.deserialize(r),r});return u(r,t),r}function tt(e,t){var n=this,r=n.ready().then(function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,a=localStorage.length,o=1,s=0;s=0;t--){var n=localStorage.key(t);n.indexOf(e)===0&&localStorage.removeItem(n)}}):l.reject(`Invalid arguments`),u(i,t),i}var ct={_driver:`localStorageWrapper`,_initStorage:Qe,_support:Je(),iterate:tt,getItem:et,setItem:ot,removeItem:at,clear:$e,length:it,key:nt,keys:rt,dropInstance:st},lt=function(e,t){return e===t||typeof e==`number`&&typeof t==`number`&&isNaN(e)&&isNaN(t)},ut=function(e,t){for(var n=e.length,r=0;r 0.0) { + c.rgb /= c.a; + + vec3 rgb = pow(c.rgb, vec3(1. / gamma)); + rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast); + rgb.r *= red; + rgb.g *= green; + rgb.b *= blue; + c.rgb = rgb * brightness; + + c.rgb *= c.a; + } + + gl_FragColor = c * alpha; +} +`,Sm=function(e){ym(t,e);function t(t){var n=e.call(this,bm,xm)||this;return n.gamma=1,n.saturation=1,n.contrast=1,n.brightness=1,n.red=1,n.green=1,n.blue=1,n.alpha=1,Object.assign(n,t),n}return t.prototype.apply=function(e,t,n,r){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,n,r)},t}(_l),Cm=function(e,t){return Cm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Cm(e,t)};function wm(e,t){Cm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Tm=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Em=` +varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec2 uOffset; + +void main(void) +{ + vec4 color = vec4(0.0); + + // Sample top left pixel + color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y)); + + // Sample top right pixel + color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y)); + + // Sample bottom right pixel + color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y)); + + // Sample bottom left pixel + color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y)); + + // Average + color *= 0.25; + + gl_FragColor = color; +}`,Dm=` +varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec2 uOffset; +uniform vec4 filterClamp; + +void main(void) +{ + vec4 color = vec4(0.0); + + // Sample top left pixel + color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw)); + + // Sample top right pixel + color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw)); + + // Sample bottom right pixel + color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw)); + + // Sample bottom left pixel + color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw)); + + // Average + color *= 0.25; + + gl_FragColor = color; +} +`,Om=function(e){wm(t,e);function t(t,n,r){t===void 0&&(t=4),n===void 0&&(n=3),r===void 0&&(r=!1);var i=e.call(this,Tm,r?Dm:Em)||this;return i._kernels=[],i._blur=4,i._quality=3,i.uniforms.uOffset=new Float32Array(2),i._pixelSize=new us,i.pixelSize=1,i._clamp=r,Array.isArray(t)?i.kernels=t:(i._blur=t,i.quality=n),i}return t.prototype.apply=function(e,t,n,r){var i=this._pixelSize.x/t._frame.width,a=this._pixelSize.y/t._frame.height,o;if(this._quality===1||this._blur===0)o=this._kernels[0]+.5,this.uniforms.uOffset[0]=o*i,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,t,n,r);else{for(var s=e.getFilterTexture(),c=t,l=s,u=void 0,d=this._quality-1,f=0;f0)for(var r=e,i=e/t,a=1;a0?(this._kernels=e,this._quality=e.length,this._blur=Math.max.apply(Math,e)):(this._kernels=[0],this._quality=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`clamp`,{get:function(){return this._clamp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`pixelSize`,{get:function(){return this._pixelSize},set:function(e){typeof e==`number`?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof us?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`quality`,{get:function(){return this._quality},set:function(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`blur`,{get:function(){return this._blur},set:function(e){this._blur=e,this._generateKernels()},enumerable:!1,configurable:!0}),t}(_l),km=function(e,t){return km=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},km(e,t)};function Am(e,t){km(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var jm=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Mm=` +uniform sampler2D uSampler; +varying vec2 vTextureCoord; + +uniform float threshold; + +void main() { + vec4 color = texture2D(uSampler, vTextureCoord); + + // A simple & fast algorithm for getting brightness. + // It's inaccuracy , but good enought for this feature. + float _max = max(max(color.r, color.g), color.b); + float _min = min(min(color.r, color.g), color.b); + float brightness = (_max + _min) * 0.5; + + if(brightness > threshold) { + gl_FragColor = color; + } else { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } +} +`,Nm=function(e){Am(t,e);function t(t){t===void 0&&(t=.5);var n=e.call(this,jm,Mm)||this;return n.threshold=t,n}return Object.defineProperty(t.prototype,`threshold`,{get:function(){return this.uniforms.threshold},set:function(e){this.uniforms.threshold=e},enumerable:!1,configurable:!0}),t}(_l),Pm=`uniform sampler2D uSampler; +varying vec2 vTextureCoord; + +uniform sampler2D bloomTexture; +uniform float bloomScale; +uniform float brightness; + +void main() { + vec4 color = texture2D(uSampler, vTextureCoord); + color.rgb *= brightness; + vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0); + bloomColor.rgb *= bloomScale; + gl_FragColor = color + bloomColor; +} +`,Fm=function(e){Am(t,e);function t(n){var r=e.call(this,jm,Pm)||this;r.bloomScale=1,r.brightness=1,r._resolution=oo.FILTER_RESOLUTION,typeof n==`number`&&(n={threshold:n});var i=Object.assign(t.defaults,n);r.bloomScale=i.bloomScale,r.brightness=i.brightness;var a=i.kernels,o=i.blur,s=i.quality,c=i.pixelSize,l=i.resolution;return r._extractFilter=new Nm(i.threshold),r._extractFilter.resolution=l,r._blurFilter=a?new Om(a):new Om(o,s),r.pixelSize=c,r.resolution=l,r}return t.prototype.apply=function(e,t,n,r,i){var a=e.getFilterTexture();this._extractFilter.apply(e,t,a,1,i);var o=e.getFilterTexture();this._blurFilter.apply(e,a,o,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=o,e.applyFilter(this,t,n,r),e.returnFilterTexture(o),e.returnFilterTexture(a)},Object.defineProperty(t.prototype,`resolution`,{get:function(){return this._resolution},set:function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`threshold`,{get:function(){return this._extractFilter.threshold},set:function(e){this._extractFilter.threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`kernels`,{get:function(){return this._blurFilter.kernels},set:function(e){this._blurFilter.kernels=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`blur`,{get:function(){return this._blurFilter.blur},set:function(e){this._blurFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`quality`,{get:function(){return this._blurFilter.quality},set:function(e){this._blurFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`pixelSize`,{get:function(){return this._blurFilter.pixelSize},set:function(e){this._blurFilter.pixelSize=e},enumerable:!1,configurable:!0}),t.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:oo.FILTER_RESOLUTION},t}(_l),Im=function(e,t){return Im=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Im(e,t)};function Lm(e,t){Im(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rm=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,zm=`varying vec2 vTextureCoord; + +uniform vec4 filterArea; +uniform float pixelSize; +uniform sampler2D uSampler; + +vec2 mapCoord( vec2 coord ) +{ + coord *= filterArea.xy; + coord += filterArea.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= filterArea.zw; + coord /= filterArea.xy; + + return coord; +} + +vec2 pixelate(vec2 coord, vec2 size) +{ + return floor( coord / size ) * size; +} + +vec2 getMod(vec2 coord, vec2 size) +{ + return mod( coord , size) / size; +} + +float character(float n, vec2 p) +{ + p = floor(p*vec2(4.0, -4.0) + 2.5); + + if (clamp(p.x, 0.0, 4.0) == p.x) + { + if (clamp(p.y, 0.0, 4.0) == p.y) + { + if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0; + } + } + return 0.0; +} + +void main() +{ + vec2 coord = mapCoord(vTextureCoord); + + // get the rounded color.. + vec2 pixCoord = pixelate(coord, vec2(pixelSize)); + pixCoord = unmapCoord(pixCoord); + + vec4 color = texture2D(uSampler, pixCoord); + + // determine the character to use + float gray = (color.r + color.g + color.b) / 3.0; + + float n = 65536.0; // . + if (gray > 0.2) n = 65600.0; // : + if (gray > 0.3) n = 332772.0; // * + if (gray > 0.4) n = 15255086.0; // o + if (gray > 0.5) n = 23385164.0; // & + if (gray > 0.6) n = 15252014.0; // 8 + if (gray > 0.7) n = 13199452.0; // @ + if (gray > 0.8) n = 11512810.0; // # + + // get the mod.. + vec2 modd = getMod(coord, vec2(pixelSize)); + + gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0); + +} +`,Bm=function(e){Lm(t,e);function t(t){t===void 0&&(t=8);var n=e.call(this,Rm,zm)||this;return n.size=t,n}return Object.defineProperty(t.prototype,`size`,{get:function(){return this.uniforms.pixelSize},set:function(e){this.uniforms.pixelSize=e},enumerable:!1,configurable:!0}),t}(_l),Vm=function(e,t){return Vm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Vm(e,t)};function Hm(e,t){Vm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Um=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Wm=`precision mediump float; + +varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec4 filterArea; + +uniform float transformX; +uniform float transformY; +uniform vec3 lightColor; +uniform float lightAlpha; +uniform vec3 shadowColor; +uniform float shadowAlpha; + +void main(void) { + vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY); + vec4 color = texture2D(uSampler, vTextureCoord); + float light = texture2D(uSampler, vTextureCoord - transform).a; + float shadow = texture2D(uSampler, vTextureCoord + transform).a; + + color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0)); + color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0)); + gl_FragColor = vec4(color.rgb * color.a, color.a); +} +`,Gm=function(e){Hm(t,e);function t(t){var n=e.call(this,Um,Wm)||this;return n._thickness=2,n._angle=0,n.uniforms.lightColor=new Float32Array(3),n.uniforms.shadowColor=new Float32Array(3),Object.assign(n,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),n.padding=1,n}return t.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},Object.defineProperty(t.prototype,`rotation`,{get:function(){return this._angle/cs},set:function(e){this._angle=e*cs,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`thickness`,{get:function(){return this._thickness},set:function(e){this._thickness=e,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lightColor`,{get:function(){return ko(this.uniforms.lightColor)},set:function(e){Do(e,this.uniforms.lightColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lightAlpha`,{get:function(){return this.uniforms.lightAlpha},set:function(e){this.uniforms.lightAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`shadowColor`,{get:function(){return ko(this.uniforms.shadowColor)},set:function(e){Do(e,this.uniforms.shadowColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`shadowAlpha`,{get:function(){return this.uniforms.shadowAlpha},set:function(e){this.uniforms.shadowAlpha=e},enumerable:!1,configurable:!0}),t}(_l),Km=function(e,t){return Km=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Km(e,t)};function qm(e,t){Km(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Jm=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform float uAlpha; + +void main(void) +{ + gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha; +} +`,Ym=function(e){qm(t,e);function t(t){t===void 0&&(t=1);var n=e.call(this,pu,Jm,{uAlpha:1})||this;return n.alpha=t,n}return Object.defineProperty(t.prototype,`alpha`,{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}(_l),Xm=function(e,t){return Xm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Xm(e,t)};function Zm(e,t){Xm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Qm=` + attribute vec2 aVertexPosition; + + uniform mat3 projectionMatrix; + + uniform float strength; + + varying vec2 vBlurTexCoords[%size%]; + + uniform vec4 inputSize; + uniform vec4 outputFrame; + + vec4 filterVertexPosition( void ) + { + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); + } + + vec2 filterTextureCoord( void ) + { + return aVertexPosition * (outputFrame.zw * inputSize.zw); + } + + void main(void) + { + gl_Position = filterVertexPosition(); + + vec2 textureCoord = filterTextureCoord(); + %blur% + }`;function $m(e,t){var n=Math.ceil(e/2),r=Qm,i=``,a;a=t?`vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);`:`vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);`;for(var o=0;o=n&&(o=e-s-1),c=c.replace(`%value%`,t[o].toString()),i+=c,i+=` +`}return r=r.replace(`%blur%`,i),r=r.replace(`%size%`,e.toString()),r}var rh=function(e){Zm(t,e);function t(t,n,r,i,a){n===void 0&&(n=8),r===void 0&&(r=4),i===void 0&&(i=oo.FILTER_RESOLUTION),a===void 0&&(a=5);var o=this,s=$m(a,t),c=nh(a);return o=e.call(this,s,c)||this,o.horizontal=t,o.resolution=i,o._quality=0,o.quality=r,o.blur=n,o}return t.prototype.apply=function(e,t,n,r){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/t.width):this.uniforms.strength=1/n.height*(n.height/t.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/t.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/t.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,t,n,r);else{var i=e.getFilterTexture(),a=e.renderer,o=t,s=i;this.state.blend=!1,e.applyFilter(this,o,s,ja.CLEAR);for(var c=1;c 0.0) { + coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); + } else { + coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent); + } + } + coord += center * dimensions.xy; + coord /= filterArea.xy; + vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw); + vec4 color = texture2D(uSampler, clampedCoord); + if (coord != clampedCoord) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + gl_FragColor = color; +} +`,fh=function(e){lh(t,e);function t(n){var r=e.call(this,uh,dh)||this;return r.uniforms.dimensions=new Float32Array(2),Object.assign(r,t.defaults,n),r}return t.prototype.apply=function(e,t,n,r){var i=t.filterFrame,a=i.width,o=i.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=o,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`radius`,{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`strength`,{get:function(){return this.uniforms.strength},set:function(e){this.uniforms.strength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`center`,{get:function(){return this.uniforms.center},set:function(e){this.uniforms.center=e},enumerable:!1,configurable:!0}),t.defaults={center:[.5,.5],radius:100,strength:1},t}(_l),ph=function(e,t){return ph=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ph(e,t)};function mh(e,t){ph(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var hh=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,gh=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform sampler2D colorMap; +uniform float _mix; +uniform float _size; +uniform float _sliceSize; +uniform float _slicePixelSize; +uniform float _sliceInnerSize; +void main() { + vec4 color = texture2D(uSampler, vTextureCoord.xy); + + vec4 adjusted; + if (color.a > 0.0) { + color.rgb /= color.a; + float innerWidth = _size - 1.0; + float zSlice0 = min(floor(color.b * innerWidth), innerWidth); + float zSlice1 = min(zSlice0 + 1.0, innerWidth); + float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize; + float s0 = xOffset + (zSlice0 * _sliceSize); + float s1 = xOffset + (zSlice1 * _sliceSize); + float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize); + vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset)); + vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset)); + float zOffset = fract(color.b * innerWidth); + adjusted = mix(slice0Color, slice1Color, zOffset); + + color.rgb *= color.a; + } + gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a); + +}`,_h=function(e){mh(t,e);function t(t,n,r){n===void 0&&(n=!1),r===void 0&&(r=1);var i=e.call(this,hh,gh)||this;return i.mix=1,i._size=0,i._sliceSize=0,i._slicePixelSize=0,i._sliceInnerSize=0,i._nearest=!1,i._scaleMode=null,i._colorMap=null,i._scaleMode=null,i.nearest=n,i.mix=r,i.colorMap=t,i}return t.prototype.apply=function(e,t,n,r){this.uniforms._mix=this.mix,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`colorSize`,{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`colorMap`,{get:function(){return this._colorMap},set:function(e){var t;e&&(e instanceof tc||(e=tc.from(e)),(t=e)?.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=ka.OFF,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`nearest`,{get:function(){return this._nearest},set:function(e){this._nearest=e,this._scaleMode=e?Da.NEAREST:Da.LINEAR;var t=this._colorMap;t&&t.baseTexture&&(t.baseTexture._glTextures={},t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=ka.OFF,t._updateID++,t.baseTexture.emit(`update`,t.baseTexture))},enumerable:!1,configurable:!0}),t.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit(`update`,e.baseTexture),this.colorMap=e)},t.prototype.destroy=function(t){t===void 0&&(t=!1),this._colorMap&&this._colorMap.destroy(t),e.prototype.destroy.call(this)},t}(_l),vh=function(e,t){return vh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},vh(e,t)};function yh(e,t){vh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var bh=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,xh=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec3 color; +uniform float alpha; + +void main(void) { + vec4 currentColor = texture2D(uSampler, vTextureCoord); + gl_FragColor = vec4(mix(currentColor.rgb, color.rgb, currentColor.a * alpha), currentColor.a); +} +`,Sh=function(e){yh(t,e);function t(t,n){t===void 0&&(t=0),n===void 0&&(n=1);var r=e.call(this,bh,xh)||this;return r._color=0,r._alpha=1,r.uniforms.color=new Float32Array(3),r.color=t,r.alpha=n,r}return Object.defineProperty(t.prototype,`color`,{get:function(){return this._color},set:function(e){var t=this.uniforms.color;typeof e==`number`?(Do(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._color=ko(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`alpha`,{get:function(){return this._alpha},set:function(e){this.uniforms.alpha=e,this._alpha=e},enumerable:!1,configurable:!0}),t}(_l),Ch=function(e,t){return Ch=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ch(e,t)};function wh(e,t){Ch(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Th=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Eh=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec3 originalColor; +uniform vec3 newColor; +uniform float epsilon; +void main(void) { + vec4 currentColor = texture2D(uSampler, vTextureCoord); + vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001)); + float colorDistance = length(colorDiff); + float doReplace = step(colorDistance, epsilon); + gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a); +} +`,Dh=function(e){wh(t,e);function t(t,n,r){t===void 0&&(t=16711680),n===void 0&&(n=0),r===void 0&&(r=.4);var i=e.call(this,Th,Eh)||this;return i._originalColor=16711680,i._newColor=0,i.uniforms.originalColor=new Float32Array(3),i.uniforms.newColor=new Float32Array(3),i.originalColor=t,i.newColor=n,i.epsilon=r,i}return Object.defineProperty(t.prototype,`originalColor`,{get:function(){return this._originalColor},set:function(e){var t=this.uniforms.originalColor;typeof e==`number`?(Do(e,t),this._originalColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._originalColor=ko(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`newColor`,{get:function(){return this._newColor},set:function(e){var t=this.uniforms.newColor;typeof e==`number`?(Do(e,t),this._newColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._newColor=ko(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`epsilon`,{get:function(){return this.uniforms.epsilon},set:function(e){this.uniforms.epsilon=e},enumerable:!1,configurable:!0}),t}(_l),Oh=function(e,t){return Oh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Oh(e,t)};function kh(e,t){Oh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ah=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,jh=`precision mediump float; + +varying mediump vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform vec2 texelSize; +uniform float matrix[9]; + +void main(void) +{ + vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left + vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center + vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right + + vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left + vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center + vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right + + vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left + vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center + vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right + + gl_FragColor = + c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] + + c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] + + c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8]; + + gl_FragColor.a = c22.a; +} +`,Mh=function(e){kh(t,e);function t(t,n,r){n===void 0&&(n=200),r===void 0&&(r=200);var i=e.call(this,Ah,jh)||this;return i.uniforms.texelSize=new Float32Array(2),i.uniforms.matrix=new Float32Array(9),t!==void 0&&(i.matrix=t),i.width=n,i.height=r,i}return Object.defineProperty(t.prototype,`matrix`,{get:function(){return this.uniforms.matrix},set:function(e){var t=this;e.forEach(function(e,n){t.uniforms.matrix[n]=e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`width`,{get:function(){return 1/this.uniforms.texelSize[0]},set:function(e){this.uniforms.texelSize[0]=1/e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`height`,{get:function(){return 1/this.uniforms.texelSize[1]},set:function(e){this.uniforms.texelSize[1]=1/e},enumerable:!1,configurable:!0}),t}(_l),Nh=function(e,t){return Nh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Nh(e,t)};function Ph(e,t){Nh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Fh=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Ih=`precision mediump float; + +varying vec2 vTextureCoord; + +uniform sampler2D uSampler; + +void main(void) +{ + float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb); + + gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); + + if (lum < 1.00) + { + if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) + { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.75) + { + if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) + { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.50) + { + if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) + { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.3) + { + if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) + { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } +} +`,Lh=function(e){Ph(t,e);function t(){return e.call(this,Fh,Ih)||this}return t}(_l),Rh=function(e,t){return Rh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Rh(e,t)};function zh(e,t){Rh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Bh=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Vh=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec4 filterArea; +uniform vec2 dimensions; + +const float SQRT_2 = 1.414213; + +const float light = 1.0; + +uniform float curvature; +uniform float lineWidth; +uniform float lineContrast; +uniform bool verticalLine; +uniform float noise; +uniform float noiseSize; + +uniform float vignetting; +uniform float vignettingAlpha; +uniform float vignettingBlur; + +uniform float seed; +uniform float time; + +float rand(vec2 co) { + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void main(void) +{ + vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; + vec2 dir = vec2(vTextureCoord.xy * filterArea.xy / dimensions - vec2(0.5, 0.5)); + + gl_FragColor = texture2D(uSampler, vTextureCoord); + vec3 rgb = gl_FragColor.rgb; + + if (noise > 0.0 && noiseSize > 0.0) + { + pixelCoord.x = floor(pixelCoord.x / noiseSize); + pixelCoord.y = floor(pixelCoord.y / noiseSize); + float _noise = rand(pixelCoord * noiseSize * seed) - 0.5; + rgb += _noise * noise; + } + + if (lineWidth > 0.0) + { + float _c = curvature > 0. ? curvature : 1.; + float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.; + vec2 uv = dir * k; + + float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c; + float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast; + rgb *= j; + float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.); + rgb *= 0.99 + ceil(segment) * 0.015; + } + + if (vignetting > 0.0) + { + float outter = SQRT_2 - vignetting * SQRT_2; + float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0); + rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha); + } + + gl_FragColor.rgb = rgb; +} +`,Hh=function(e){zh(t,e);function t(n){var r=e.call(this,Bh,Vh)||this;return r.time=0,r.seed=0,r.uniforms.dimensions=new Float32Array(2),Object.assign(r,t.defaults,n),r}return t.prototype.apply=function(e,t,n,r){var i=t.filterFrame,a=i.width,o=i.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=o,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`curvature`,{get:function(){return this.uniforms.curvature},set:function(e){this.uniforms.curvature=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lineWidth`,{get:function(){return this.uniforms.lineWidth},set:function(e){this.uniforms.lineWidth=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lineContrast`,{get:function(){return this.uniforms.lineContrast},set:function(e){this.uniforms.lineContrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`verticalLine`,{get:function(){return this.uniforms.verticalLine},set:function(e){this.uniforms.verticalLine=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`noise`,{get:function(){return this.uniforms.noise},set:function(e){this.uniforms.noise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`noiseSize`,{get:function(){return this.uniforms.noiseSize},set:function(e){this.uniforms.noiseSize=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`vignetting`,{get:function(){return this.uniforms.vignetting},set:function(e){this.uniforms.vignetting=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`vignettingAlpha`,{get:function(){return this.uniforms.vignettingAlpha},set:function(e){this.uniforms.vignettingAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`vignettingBlur`,{get:function(){return this.uniforms.vignettingBlur},set:function(e){this.uniforms.vignettingBlur=e},enumerable:!1,configurable:!0}),t.defaults={curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},t}(_l),Uh=function(e,t){return Uh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Uh(e,t)};function Wh(e,t){Uh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Gh=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Kh=`precision mediump float; + +varying vec2 vTextureCoord; +varying vec4 vColor; + +uniform vec4 filterArea; +uniform sampler2D uSampler; + +uniform float angle; +uniform float scale; + +float pattern() +{ + float s = sin(angle), c = cos(angle); + vec2 tex = vTextureCoord * filterArea.xy; + vec2 point = vec2( + c * tex.x - s * tex.y, + s * tex.x + c * tex.y + ) * scale; + return (sin(point.x) * sin(point.y)) * 4.0; +} + +void main() +{ + vec4 color = texture2D(uSampler, vTextureCoord); + float average = (color.r + color.g + color.b) / 3.0; + gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a); +} +`,qh=function(e){Wh(t,e);function t(t,n){t===void 0&&(t=1),n===void 0&&(n=5);var r=e.call(this,Gh,Kh)||this;return r.scale=t,r.angle=n,r}return Object.defineProperty(t.prototype,`scale`,{get:function(){return this.uniforms.scale},set:function(e){this.uniforms.scale=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`angle`,{get:function(){return this.uniforms.angle},set:function(e){this.uniforms.angle=e},enumerable:!1,configurable:!0}),t}(_l),Jh=function(e,t){return Jh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Jh(e,t)};function Yh(e,t){Jh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Xh=function(){return Xh=Object.assign||function(e){for(var t=arguments,n,r=1,i=arguments.length;r 1.0 || coord.y > 1.0) { + return; + } + + float cx = coord.x - 0.5; + float cy = (coord.y - 0.5) * aspect; + float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5; + + // displacementMap: repeat + // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny); + + // displacementMap: mirror + ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny); + + vec4 dc = texture2D(displacementMap, vec2(0.5, ny)); + + float displacement = (dc.r - dc.g) * (offset / filterArea.x); + + coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect); + + if (fillMode == CLAMP) { + coord = clamp(coord, filterClamp.xy, filterClamp.zw); + } else { + if( coord.x > filterClamp.z ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.x -= filterClamp.z; + } else if (fillMode == MIRROR) { + coord.x = filterClamp.z * 2.0 - coord.x; + } + } else if( coord.x < filterClamp.x ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.x += filterClamp.z; + } else if (fillMode == MIRROR) { + coord.x *= -filterClamp.z; + } + } + + if( coord.y > filterClamp.w ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.y -= filterClamp.w; + } else if (fillMode == MIRROR) { + coord.y = filterClamp.w * 2.0 - coord.y; + } + } else if( coord.y < filterClamp.y ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.y += filterClamp.w; + } else if (fillMode == MIRROR) { + coord.y *= -filterClamp.w; + } + } + } + + gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r; + gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g; + gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b; + gl_FragColor.a = texture2D(uSampler, coord).a; +} +`,lg=function(e){og(t,e);function t(n){var r=e.call(this,sg,cg)||this;return r.offset=100,r.fillMode=t.TRANSPARENT,r.average=!1,r.seed=0,r.minSize=8,r.sampleSize=512,r._slices=0,r._offsets=new Float32Array(1),r._sizes=new Float32Array(1),r._direction=-1,r.uniforms.dimensions=new Float32Array(2),r._canvas=document.createElement(`canvas`),r._canvas.width=4,r._canvas.height=r.sampleSize,r.texture=tc.from(r._canvas,{scaleMode:Da.NEAREST}),Object.assign(r,t.defaults,n),r}return t.prototype.apply=function(e,t,n,r){var i=t.filterFrame,a=i.width,o=i.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/a,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,t,n,r)},t.prototype._randomizeSizes=function(){var e=this._sizes,t=this._slices-1,n=this.sampleSize,r=Math.min(this.minSize/n,.9/this._slices);if(this.average){for(var i=this._slices,a=1,o=0;o0;n--){var r=Math.random()*n>>0,i=e[n];e[n]=e[r],e[r]=i}},t.prototype._randomizeOffsets=function(){for(var e=0;e0?r:0,c=r<0?-r:0;n.fillStyle=`rgba(`+s+`, `+c+`, 0, 1)`,n.fillRect(0,i>>0,e,o+1>>0),i+=o}t.baseTexture.update(),this.uniforms.displacementMap=t},Object.defineProperty(t.prototype,`sizes`,{get:function(){return this._sizes},set:function(e){for(var t=Math.min(this._slices,e.length),n=0;n>0)+1},Object.defineProperty(t.prototype,`offset`,{get:function(){return this.uniforms.uOffset},set:function(e){this.uniforms.uOffset=e},enumerable:!1,configurable:!0}),t}(_l),Eg=function(e,t){return Eg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Eg(e,t)};function Dg(e,t){Eg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Og=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,kg=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform float epsilon; + +const int MAX_COLORS = %maxColors%; + +uniform vec3 originalColors[MAX_COLORS]; +uniform vec3 targetColors[MAX_COLORS]; + +void main(void) +{ + gl_FragColor = texture2D(uSampler, vTextureCoord); + + float alpha = gl_FragColor.a; + if (alpha < 0.0001) + { + return; + } + + vec3 color = gl_FragColor.rgb / alpha; + + for(int i = 0; i < MAX_COLORS; i++) + { + vec3 origColor = originalColors[i]; + if (origColor.r < 0.0) + { + break; + } + vec3 colorDiff = origColor - color; + if (length(colorDiff) < epsilon) + { + vec3 targetColor = targetColors[i]; + gl_FragColor = vec4((targetColor + colorDiff) * alpha, alpha); + return; + } + } +} +`,Ag=function(e){Dg(t,e);function t(t,n,r){n===void 0&&(n=.05),r===void 0&&(r=t.length);var i=e.call(this,Og,kg.replace(/%maxColors%/g,r.toFixed(0)))||this;return i._replacements=[],i._maxColors=0,i.epsilon=n,i._maxColors=r,i.uniforms.originalColors=new Float32Array(r*3),i.uniforms.targetColors=new Float32Array(r*3),i.replacements=t,i}return Object.defineProperty(t.prototype,`replacements`,{get:function(){return this._replacements},set:function(e){var t=this.uniforms.originalColors,n=this.uniforms.targetColors,r=e.length;if(r>this._maxColors)throw Error(`Length of replacements (`+r+`) exceeds the maximum colors length (`+this._maxColors+`)`);t[r*3]=-1;for(var i=0;i 0.5) then: 1 - 2 * (1 - dst) * (1 - src) + return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)), + (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)), + (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z))); +} + + +void main() +{ + gl_FragColor = texture2D(uSampler, vTextureCoord); + vec3 color = gl_FragColor.rgb; + + if (sepia > 0.0) + { + float gray = (color.x + color.y + color.z) / 3.0; + vec3 grayscale = vec3(gray); + + color = Overlay(SEPIA_RGB, grayscale); + + color = grayscale + sepia * (color - grayscale); + } + + vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy; + + if (vignetting > 0.0) + { + float outter = SQRT_2 - vignetting * SQRT_2; + vec2 dir = vec2(vec2(0.5, 0.5) - coord); + dir.y *= dimensions.y / dimensions.x; + float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0); + color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha); + } + + if (scratchDensity > seed && scratch != 0.0) + { + float phase = seed * 256.0; + float s = mod(floor(phase), 2.0); + float dist = 1.0 / scratchDensity; + float d = distance(coord, vec2(seed * dist, abs(s - seed * dist))); + if (d < seed * 0.6 + 0.4) + { + highp float period = scratchDensity * 10.0; + + float xx = coord.x * period + phase; + float aa = abs(mod(xx, 0.5) * 4.0); + float bb = mod(floor(xx / 0.5), 2.0); + float yy = (1.0 - bb) * aa + bb * (2.0 - aa); + + float kk = 2.0 * period; + float dw = scratchWidth / dimensions.x * (0.75 + seed); + float dh = dw * kk; + + float tine = (yy - (2.0 - dh)); + + if (tine > 0.0) { + float _sign = sign(scratch); + + tine = s * tine / period + scratch + 0.1; + tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5); + + color.rgb *= tine; + } + } + } + + if (noise > 0.0 && noiseSize > 0.0) + { + vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; + pixelCoord.x = floor(pixelCoord.x / noiseSize); + pixelCoord.y = floor(pixelCoord.y / noiseSize); + // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0); + // float _noise = snoise(d) * 0.5; + float _noise = rand(pixelCoord * noiseSize * seed) - 0.5; + color += _noise * noise; + } + + gl_FragColor.rgb = color; +} +`,Fg=function(e){Mg(t,e);function t(n,r){r===void 0&&(r=0);var i=e.call(this,Ng,Pg)||this;return i.seed=0,i.uniforms.dimensions=new Float32Array(2),typeof n==`number`?(i.seed=n,n=void 0):i.seed=r,Object.assign(i,t.defaults,n),i}return t.prototype.apply=function(e,t,n,r){var i,a;this.uniforms.dimensions[0]=(i=t.filterFrame)?.width,this.uniforms.dimensions[1]=(a=t.filterFrame)?.height,this.uniforms.seed=this.seed,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`sepia`,{get:function(){return this.uniforms.sepia},set:function(e){this.uniforms.sepia=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`noise`,{get:function(){return this.uniforms.noise},set:function(e){this.uniforms.noise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`noiseSize`,{get:function(){return this.uniforms.noiseSize},set:function(e){this.uniforms.noiseSize=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`scratch`,{get:function(){return this.uniforms.scratch},set:function(e){this.uniforms.scratch=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`scratchDensity`,{get:function(){return this.uniforms.scratchDensity},set:function(e){this.uniforms.scratchDensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`scratchWidth`,{get:function(){return this.uniforms.scratchWidth},set:function(e){this.uniforms.scratchWidth=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`vignetting`,{get:function(){return this.uniforms.vignetting},set:function(e){this.uniforms.vignetting=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`vignettingAlpha`,{get:function(){return this.uniforms.vignettingAlpha},set:function(e){this.uniforms.vignettingAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`vignettingBlur`,{get:function(){return this.uniforms.vignettingBlur},set:function(e){this.uniforms.vignettingBlur=e},enumerable:!1,configurable:!0}),t.defaults={sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},t}(_l),Ig=function(e,t){return Ig=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ig(e,t)};function Lg(e,t){Ig(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rg=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,zg=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec2 thickness; +uniform vec4 outlineColor; +uniform vec4 filterClamp; + +const float DOUBLE_PI = 3.14159265358979323846264 * 2.; + +void main(void) { + vec4 ownColor = texture2D(uSampler, vTextureCoord); + vec4 curColor; + float maxAlpha = 0.; + vec2 displaced; + for (float angle = 0.; angle <= DOUBLE_PI; angle += \${angleStep}) { + displaced.x = vTextureCoord.x + thickness.x * cos(angle); + displaced.y = vTextureCoord.y + thickness.y * sin(angle); + curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw)); + maxAlpha = max(maxAlpha, curColor.a); + } + float resultAlpha = max(maxAlpha, ownColor.a); + gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha); +} +`,Bg=function(e){Lg(t,e);function t(n,r,i){n===void 0&&(n=1),r===void 0&&(r=0),i===void 0&&(i=.1);var a=e.call(this,Rg,zg.replace(/\$\{angleStep\}/,t.getAngleStep(i)))||this;return a._thickness=1,a.uniforms.thickness=new Float32Array([0,0]),a.uniforms.outlineColor=new Float32Array([0,0,0,1]),Object.assign(a,{thickness:n,color:r,quality:i}),a}return t.getAngleStep=function(e){var n=Math.max(e*t.MAX_SAMPLES,t.MIN_SAMPLES);return(Math.PI*2/n).toFixed(7)},t.prototype.apply=function(e,t,n,r){this.uniforms.thickness[0]=this._thickness/t._frame.width,this.uniforms.thickness[1]=this._thickness/t._frame.height,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`color`,{get:function(){return ko(this.uniforms.outlineColor)},set:function(e){Do(e,this.uniforms.outlineColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`thickness`,{get:function(){return this._thickness},set:function(e){this._thickness=e,this.padding=e},enumerable:!1,configurable:!0}),t.MIN_SAMPLES=1,t.MAX_SAMPLES=100,t}(_l),Vg=function(e,t){return Vg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Vg(e,t)};function Hg(e,t){Vg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ug=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Wg=`precision mediump float; + +varying vec2 vTextureCoord; + +uniform vec2 size; +uniform sampler2D uSampler; + +uniform vec4 filterArea; + +vec2 mapCoord( vec2 coord ) +{ + coord *= filterArea.xy; + coord += filterArea.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= filterArea.zw; + coord /= filterArea.xy; + + return coord; +} + +vec2 pixelate(vec2 coord, vec2 size) +{ + return floor( coord / size ) * size; +} + +void main(void) +{ + vec2 coord = mapCoord(vTextureCoord); + + coord = pixelate(coord, size); + + coord = unmapCoord(coord); + + gl_FragColor = texture2D(uSampler, coord); +} +`,Gg=function(e){Hg(t,e);function t(t){t===void 0&&(t=10);var n=e.call(this,Ug,Wg)||this;return n.size=t,n}return Object.defineProperty(t.prototype,`size`,{get:function(){return this.uniforms.size},set:function(e){typeof e==`number`&&(e=[e,e]),this.uniforms.size=e},enumerable:!1,configurable:!0}),t}(_l),Kg=function(e,t){return Kg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Kg(e,t)};function qg(e,t){Kg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Jg=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Yg=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec4 filterArea; + +uniform float uRadian; +uniform vec2 uCenter; +uniform float uRadius; +uniform int uKernelSize; + +const int MAX_KERNEL_SIZE = 2048; + +void main(void) +{ + vec4 color = texture2D(uSampler, vTextureCoord); + + if (uKernelSize == 0) + { + gl_FragColor = color; + return; + } + + float aspect = filterArea.y / filterArea.x; + vec2 center = uCenter.xy / filterArea.xy; + float gradient = uRadius / filterArea.x * 0.3; + float radius = uRadius / filterArea.x - gradient * 0.5; + int k = uKernelSize - 1; + + vec2 coord = vTextureCoord; + vec2 dir = vec2(center - coord); + float dist = length(vec2(dir.x, dir.y * aspect)); + + float radianStep = uRadian; + if (radius >= 0.0 && dist > radius) { + float delta = dist - radius; + float gap = gradient; + float scale = 1.0 - abs(delta / gap); + if (scale <= 0.0) { + gl_FragColor = color; + return; + } + radianStep *= scale; + } + radianStep /= float(k); + + float s = sin(radianStep); + float c = cos(radianStep); + mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c)); + + for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) { + if (i == k) { + break; + } + + coord -= center; + coord.y *= aspect; + coord = rotationMatrix * coord; + coord.y /= aspect; + coord += center; + + vec4 sample = texture2D(uSampler, coord); + + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + + color += sample; + } + + gl_FragColor = color / float(uKernelSize); +} +`,Xg=function(e){qg(t,e);function t(t,n,r,i){t===void 0&&(t=0),n===void 0&&(n=[0,0]),r===void 0&&(r=5),i===void 0&&(i=-1);var a=e.call(this,Jg,Yg)||this;return a._angle=0,a.angle=t,a.center=n,a.kernelSize=r,a.radius=i,a}return t.prototype.apply=function(e,t,n,r){this.uniforms.uKernelSize=this._angle===0?0:this.kernelSize,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`angle`,{get:function(){return this._angle},set:function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`center`,{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`radius`,{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),t}(_l),Zg=function(e,t){return Zg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Zg(e,t)};function Qg(e,t){Zg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var $g=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,e_=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec4 filterArea; +uniform vec4 filterClamp; +uniform vec2 dimensions; + +uniform bool mirror; +uniform float boundary; +uniform vec2 amplitude; +uniform vec2 waveLength; +uniform vec2 alpha; +uniform float time; + +float rand(vec2 co) { + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void main(void) +{ + vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; + vec2 coord = pixelCoord / dimensions; + + if (coord.y < boundary) { + gl_FragColor = texture2D(uSampler, vTextureCoord); + return; + } + + float k = (coord.y - boundary) / (1. - boundary + 0.0001); + float areaY = boundary * dimensions.y / filterArea.y; + float v = areaY + areaY - vTextureCoord.y; + float y = mirror ? v : vTextureCoord.y; + + float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x; + float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y; + float _alpha = (alpha.y - alpha.x) * k + alpha.x; + + float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude; + x = clamp(x, filterClamp.x, filterClamp.z); + + vec4 color = texture2D(uSampler, vec2(x, y)); + + gl_FragColor = color * _alpha; +} +`,t_=function(e){Qg(t,e);function t(n){var r=e.call(this,$g,e_)||this;return r.time=0,r.uniforms.amplitude=new Float32Array(2),r.uniforms.waveLength=new Float32Array(2),r.uniforms.alpha=new Float32Array(2),r.uniforms.dimensions=new Float32Array(2),Object.assign(r,t.defaults,n),r}return t.prototype.apply=function(e,t,n,r){var i,a;this.uniforms.dimensions[0]=(i=t.filterFrame)?.width,this.uniforms.dimensions[1]=(a=t.filterFrame)?.height,this.uniforms.time=this.time,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`mirror`,{get:function(){return this.uniforms.mirror},set:function(e){this.uniforms.mirror=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`boundary`,{get:function(){return this.uniforms.boundary},set:function(e){this.uniforms.boundary=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`amplitude`,{get:function(){return this.uniforms.amplitude},set:function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`waveLength`,{get:function(){return this.uniforms.waveLength},set:function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`alpha`,{get:function(){return this.uniforms.alpha},set:function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},enumerable:!1,configurable:!0}),t.defaults={mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},t}(_l),n_=function(e,t){return n_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n_(e,t)};function r_(e,t){n_(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var i_=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,a_=`precision mediump float; + +varying vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform vec4 filterArea; +uniform vec2 red; +uniform vec2 green; +uniform vec2 blue; + +void main(void) +{ + gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r; + gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g; + gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b; + gl_FragColor.a = texture2D(uSampler, vTextureCoord).a; +} +`,o_=function(e){r_(t,e);function t(t,n,r){t===void 0&&(t=[-10,0]),n===void 0&&(n=[0,10]),r===void 0&&(r=[0,0]);var i=e.call(this,i_,a_)||this;return i.red=t,i.green=n,i.blue=r,i}return Object.defineProperty(t.prototype,`red`,{get:function(){return this.uniforms.red},set:function(e){this.uniforms.red=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`green`,{get:function(){return this.uniforms.green},set:function(e){this.uniforms.green=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`blue`,{get:function(){return this.uniforms.blue},set:function(e){this.uniforms.blue=e},enumerable:!1,configurable:!0}),t}(_l),s_=function(e,t){return s_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s_(e,t)};function c_(e,t){s_(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var l_=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,u_=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec4 filterArea; +uniform vec4 filterClamp; + +uniform vec2 center; + +uniform float amplitude; +uniform float wavelength; +// uniform float power; +uniform float brightness; +uniform float speed; +uniform float radius; + +uniform float time; + +const float PI = 3.14159; + +void main() +{ + float halfWavelength = wavelength * 0.5 / filterArea.x; + float maxRadius = radius / filterArea.x; + float currentRadius = time * speed / filterArea.x; + + float fade = 1.0; + + if (maxRadius > 0.0) { + if (currentRadius > maxRadius) { + gl_FragColor = texture2D(uSampler, vTextureCoord); + return; + } + fade = 1.0 - pow(currentRadius / maxRadius, 2.0); + } + + vec2 dir = vec2(vTextureCoord - center / filterArea.xy); + dir.y *= filterArea.y / filterArea.x; + float dist = length(dir); + + if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) { + gl_FragColor = texture2D(uSampler, vTextureCoord); + return; + } + + vec2 diffUV = normalize(dir); + + float diff = (dist - currentRadius) / halfWavelength; + + float p = 1.0 - pow(abs(diff), 2.0); + + // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade ); + float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade ); + + vec2 offset = diffUV * powDiff / filterArea.xy; + + // Do clamp : + vec2 coord = vTextureCoord + offset; + vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw); + vec4 color = texture2D(uSampler, clampedCoord); + if (coord != clampedCoord) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + // No clamp : + // gl_FragColor = texture2D(uSampler, vTextureCoord + offset); + + color.rgb *= 1.0 + (brightness - 1.0) * p * fade; + + gl_FragColor = color; +} +`,d_=function(e){c_(t,e);function t(n,r,i){n===void 0&&(n=[0,0]),i===void 0&&(i=0);var a=e.call(this,l_,u_)||this;return a.center=n,Object.assign(a,t.defaults,r),a.time=i,a}return t.prototype.apply=function(e,t,n,r){this.uniforms.time=this.time,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`center`,{get:function(){return this.uniforms.center},set:function(e){this.uniforms.center=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`amplitude`,{get:function(){return this.uniforms.amplitude},set:function(e){this.uniforms.amplitude=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`wavelength`,{get:function(){return this.uniforms.wavelength},set:function(e){this.uniforms.wavelength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`brightness`,{get:function(){return this.uniforms.brightness},set:function(e){this.uniforms.brightness=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`speed`,{get:function(){return this.uniforms.speed},set:function(e){this.uniforms.speed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`radius`,{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),t.defaults={amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t}(_l),f_=function(e,t){return f_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},f_(e,t)};function p_(e,t){f_(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var m_=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,h_=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform sampler2D uLightmap; +uniform vec4 filterArea; +uniform vec2 dimensions; +uniform vec4 ambientColor; +void main() { + vec4 diffuseColor = texture2D(uSampler, vTextureCoord); + vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions; + vec4 light = texture2D(uLightmap, lightCoord); + vec3 ambient = ambientColor.rgb * ambientColor.a; + vec3 intensity = ambient + light.rgb; + vec3 finalColor = diffuseColor.rgb * intensity; + gl_FragColor = vec4(finalColor, diffuseColor.a); +} +`,g_=function(e){p_(t,e);function t(t,n,r){n===void 0&&(n=0),r===void 0&&(r=1);var i=e.call(this,m_,h_)||this;return i._color=0,i.uniforms.dimensions=new Float32Array(2),i.uniforms.ambientColor=new Float32Array([0,0,0,r]),i.texture=t,i.color=n,i}return t.prototype.apply=function(e,t,n,r){var i,a;this.uniforms.dimensions[0]=(i=t.filterFrame)?.width,this.uniforms.dimensions[1]=(a=t.filterFrame)?.height,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`texture`,{get:function(){return this.uniforms.uLightmap},set:function(e){this.uniforms.uLightmap=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`color`,{get:function(){return this._color},set:function(e){var t=this.uniforms.ambientColor;typeof e==`number`?(Do(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._color=ko(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`alpha`,{get:function(){return this.uniforms.ambientColor[3]},set:function(e){this.uniforms.ambientColor[3]=e},enumerable:!1,configurable:!0}),t}(_l),__=function(e,t){return __=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},__(e,t)};function v_(e,t){__(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var y_=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,b_=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform float blur; +uniform float gradientBlur; +uniform vec2 start; +uniform vec2 end; +uniform vec2 delta; +uniform vec2 texSize; + +float random(vec3 scale, float seed) +{ + return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed); +} + +void main(void) +{ + vec4 color = vec4(0.0); + float total = 0.0; + + float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); + vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x)); + float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur; + + for (float t = -30.0; t <= 30.0; t++) + { + float percent = (t + offset - 0.5) / 30.0; + float weight = 1.0 - abs(percent); + vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius); + sample.rgb *= sample.a; + color += sample * weight; + total += weight; + } + + color /= total; + color.rgb /= color.a + 0.00001; + + gl_FragColor = color; +} +`,x_=function(e){v_(t,e);function t(t,n,r,i){t===void 0&&(t=100),n===void 0&&(n=600);var a=e.call(this,y_,b_)||this;return a.uniforms.blur=t,a.uniforms.gradientBlur=n,a.uniforms.start=r||new us(0,window.innerHeight/2),a.uniforms.end=i||new us(600,window.innerHeight/2),a.uniforms.delta=new us(30,30),a.uniforms.texSize=new us(window.innerWidth,window.innerHeight),a.updateDelta(),a}return t.prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},Object.defineProperty(t.prototype,`blur`,{get:function(){return this.uniforms.blur},set:function(e){this.uniforms.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`gradientBlur`,{get:function(){return this.uniforms.gradientBlur},set:function(e){this.uniforms.gradientBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`start`,{get:function(){return this.uniforms.start},set:function(e){this.uniforms.start=e,this.updateDelta()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`end`,{get:function(){return this.uniforms.end},set:function(e){this.uniforms.end=e,this.updateDelta()},enumerable:!1,configurable:!0}),t}(_l),S_=function(e){v_(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,n=Math.sqrt(e*e+t*t);this.uniforms.delta.x=e/n,this.uniforms.delta.y=t/n},t}(x_),C_=function(e){v_(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,n=Math.sqrt(e*e+t*t);this.uniforms.delta.x=-t/n,this.uniforms.delta.y=e/n},t}(x_),w_=function(e){v_(t,e);function t(t,n,r,i){t===void 0&&(t=100),n===void 0&&(n=600);var a=e.call(this)||this;return a.tiltShiftXFilter=new S_(t,n,r,i),a.tiltShiftYFilter=new C_(t,n,r,i),a}return t.prototype.apply=function(e,t,n,r){var i=e.getFilterTexture();this.tiltShiftXFilter.apply(e,t,i,1),this.tiltShiftYFilter.apply(e,i,n,r),e.returnFilterTexture(i)},Object.defineProperty(t.prototype,`blur`,{get:function(){return this.tiltShiftXFilter.blur},set:function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`gradientBlur`,{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`start`,{get:function(){return this.tiltShiftXFilter.start},set:function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`end`,{get:function(){return this.tiltShiftXFilter.end},set:function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},enumerable:!1,configurable:!0}),t}(_l),T_=function(e,t){return T_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},T_(e,t)};function E_(e,t){T_(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var D_=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,O_=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform float radius; +uniform float angle; +uniform vec2 offset; +uniform vec4 filterArea; + +vec2 mapCoord( vec2 coord ) +{ + coord *= filterArea.xy; + coord += filterArea.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= filterArea.zw; + coord /= filterArea.xy; + + return coord; +} + +vec2 twist(vec2 coord) +{ + coord -= offset; + + float dist = length(coord); + + if (dist < radius) + { + float ratioDist = (radius - dist) / radius; + float angleMod = ratioDist * ratioDist * angle; + float s = sin(angleMod); + float c = cos(angleMod); + coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c); + } + + coord += offset; + + return coord; +} + +void main(void) +{ + + vec2 coord = mapCoord(vTextureCoord); + + coord = twist(coord); + + coord = unmapCoord(coord); + + gl_FragColor = texture2D(uSampler, coord ); + +} +`,k_=function(e){E_(t,e);function t(n){var r=e.call(this,D_,O_)||this;return Object.assign(r,t.defaults,n),r}return Object.defineProperty(t.prototype,`offset`,{get:function(){return this.uniforms.offset},set:function(e){this.uniforms.offset=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`radius`,{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`angle`,{get:function(){return this.uniforms.angle},set:function(e){this.uniforms.angle=e},enumerable:!1,configurable:!0}),t.defaults={radius:200,angle:4,padding:20,offset:new us},t}(_l),A_=function(e,t){return A_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},A_(e,t)};function j_(e,t){A_(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function M_(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);i= 0.0 && dist > radius) { // radius < 0 means it's infinity + delta = dist - radius; + gap = gradient; + } + + if (delta > 0.0) { + float normalCount = gap / filterArea.x; + delta = (normalCount - delta) / normalCount; + countLimit *= delta; + strength *= delta; + if (countLimit < 1.0) + { + gl_FragColor = texture2D(uSampler, vTextureCoord); + return; + } + } + + // randomize the lookup values to hide the fixed number of samples + float offset = rand(vTextureCoord, 0.0); + + float total = 0.0; + vec4 color = vec4(0.0); + + dir *= strength; + + for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) { + float percent = (t + offset) / MAX_KERNEL_SIZE; + float weight = 4.0 * (percent - percent * percent); + vec2 p = vTextureCoord + dir * percent; + vec4 sample = texture2D(uSampler, p); + + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + + color += sample * weight; + total += weight; + + if (t > countLimit){ + break; + } + } + + color /= total; + // switch back from pre-multiplied alpha + // color.rgb /= color.a + 0.00001; + + gl_FragColor = color; +} +`,F_=function(e){j_(t,e);function t(n){var r=this,i=Object.assign(t.defaults,n),a=i.maxKernelSize,o=M_(i,[`maxKernelSize`]);return r=e.call(this,N_,P_.replace("${maxKernelSize}",a.toFixed(1)))||this,Object.assign(r,o),r}return Object.defineProperty(t.prototype,`center`,{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`strength`,{get:function(){return this.uniforms.uStrength},set:function(e){this.uniforms.uStrength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`innerRadius`,{get:function(){return this.uniforms.uInnerRadius},set:function(e){this.uniforms.uInnerRadius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`radius`,{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),t.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32},t}(_l);function I_(){let e=-1,t,n=-1;function r(r,i){(i>=e||i({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1}},emits:[`modelLoaded`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=fn(()=>r.app),o=fn(()=>r.paused),s=fn(()=>r.focusAt),c=W(),l=W(0),u=W(0),d=Ot(()=>Math.max(0,Math.min(100,r.mouthOpenSize))),f=_n(),p=gn(Dt),m=Ot(()=>p.between(`sm`,`md`).value||p.smaller(`sm`).value),h=I_(),g=sn(new $h({alpha:.2,blur:0,distance:20,rotation:45}));function _(){return c.value.internalModel.coreModel}function v(e){if(!e.value)return;let t=2.2;m.value&&(t=2.2);let n=r.height*.95/u.value*t,i=r.width*.95/l.value*t,a=Math.min(n,i);e.value.scale.set(a,a)}let{live2dModelFile:y,loadingLive2dModel:b,live2dCurrentMotion:x,availableLive2dMotions:S,live2dLoadSource:C,live2dModelUrl:w,themeColorsHue:T,themeColorsHueDynamic:E}=ln(Cn()),D=W({group:`Idle`,index:0});async function O(){var e;if(!a.value)return;c.value&&(a.value.stage.removeChild(c.value),c.value.destroy(),c.value=void 0);let t=new Wp;C.value===`file`?await Ip.setupLive2DModel(t,[y.value],{autoInteract:!1}):C.value===`url`&&await Ip.setupLive2DModel(t,w.value,{autoInteract:!1}),c.value=t,a.value.stage.addChild(c.value),l.value=c.value.width,u.value=c.value.height,c.value.x=r.width/2,c.value.y=r.height,c.value.anchor.set(.5,.5),v(c),c.value.on(`hit`,e=>{c.value&&e.includes(`body`)&&c.value.motion(`tap_body`)});let n=c.value.internalModel,o=n.coreModel,s=n.motionManager;o.setParameterValueById(`ParamMouthOpenY`,d.value),S.value=Object.entries(s.definitions).flatMap(([e,t])=>t?t.map((t,n)=>({motionName:e,motionIndex:n,fileName:t.File})):[]).filter(Boolean),s.groups.idle&&(e=s.motionGroups[s.groups.idle])?.forEach(e=>{e._motionData.curves.forEach(e=>{(e.id===`ParamEyeBallX`||e.id===`ParamEyeBallY`)&&(e.id=`_${e.id}`)})});let f=s.update;s.update=function(e,t){return f?.call(this,e,t),s.state.currentGroup===s.groups.idle&&h.update(n,t),!0},s.on(`motionStart`,(e,t)=>{D.value={group:e,index:t}}),y.value&&await L_.default.setItem(`live2dModel`,y.value),i(`modelLoaded`),b.value=!1}async function k(){if(!a.value)return;Wp.registerTicker(ns),Qo.add(rs),Qo.add(gm);let e=await L_.default.getItem(`live2dModel`);if(e){y.value=e,C.value=`file`,b.value=!0;return}if(w.value){C.value=`url`,b.value=!0;return}b.value=!1}async function A(e,t){await c.value.motion(e,t,pp.FORCE)}let j=vn(()=>{c.value&&(c.value.x=r.width/2,c.value.y=r.height,v(c))},100),M=W(),N=W(0);function ee(){if(c.value){let e=getComputedStyle(M.value).backgroundColor;g.value.color=Number(Ft(e).replace(`#`,`0x`)),c.value.filters=[g.value]}}K([()=>r.width,()=>r.height],()=>j()),K(f,ee,{immediate:!0}),K([c,T],ee);function F(){ee(),N.value=requestAnimationFrame(F)}K(E,()=>{E.value?N.value=requestAnimationFrame(F):(cancelAnimationFrame(N.value),N.value=0)},{immediate:!0}),K(d,e=>_().setParameterValueById(`ParamMouthOpenY`,e)),K(a,k),K(x,e=>A(e.group,e.index)),K(o,e=>{var t,n;return e?(t=a.value)?.stop():(n=a.value)?.start()}),K(s,e=>{c.value&&(r.disableFocusAt||c.value.focus(e.x,e.y))}),An(b,e=>{e&&O()},{debounce:1e3}),Yt(ee),Zt(()=>{var e;cancelAnimationFrame(N.value),c.value&&(e=a.value)?.stage.removeChild(c.value)});function I(){return S.value}return t({setMotion:A,listMotionGroups:I}),(e,t)=>(U(),V(P,null,[B(`div`,{ref_key:`dropShadowColorComputer`,ref:M,hidden:``,bg:`primary-400 dark:primary-500`},null,512),nn(e.$slots,`default`)],64))}}),z_=R_;const B_={"z-1":``,"flex-1":``},V_={"text-lg":``,"font-thin":``,class:`menu-icon-item-title`,transition:`all ease-in-out duration-400`},H_={text:`sm neutral-500 dark:neutral-400`,class:`menu-icon-item-description`,transition:`all ease-in-out duration-400`};var U_=H({__name:`IconItem`,props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(e){return(t,n)=>{let r=rn(`RouterLink`);return U(),kt(r,{box:`border`,flex:`~ row`,bg:`neutral-50 dark:neutral-900`,border:`neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2`,"drop-shadow":`none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none`,class:`menu-icon-item`,transition:`all ease-in-out duration-400`,relative:``,"w-full":``,"items-center":``,"overflow-hidden":``,"rounded-lg":``,"p-5":``,"text-left":``,cursor:`pointer`,to:e.to},{default:Nn(()=>[B(`div`,B_,[B(`div`,V_,un(e.title),1),B(`div`,H_,[B(`span`,null,un(e.description),1)])]),typeof e.icon==`string`?(U(),V(`div`,{key:0,class:Gt([`menu-icon-item-icon`,[e.icon]]),transition:`all ease-in-out duration-400`,absolute:``,"right-0":``,"size-24":``,"translate-y-4":``,text:`neutral-400/50 dark:neutral-600/50`},null,2)):At(``,!0),e.iconTemplate?nn(t.$slots,`icon`,{key:1},void 0,!0):At(``,!0)]),_:3},8,[`to`])}}}),W_=St(U_,[[`__scopeId`,`data-v-b1037d36`]]);const G_={flex:`~ col`,bg:`neutral-50 dark:neutral-800`,border:`neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2`,"drop-shadow":`none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none`,class:`menu-icon-status-item`,transition:`all ease-in-out duration-400`,"w-full":``,"cursor-pointer":``,"of-hidden":``,"rounded-xl":``},K_={"z-1":``,"flex-1":``},q_={"text-lg":``,"font-thin":``,class:`menu-icon-status-item-title`,transition:`all ease-in-out duration-400`},J_={text:`sm neutral-500 dark:neutral-400`,class:`menu-icon-status-item-description`,transition:`all ease-in-out duration-400`},Y_=[`src`],X_={"p-2":``},Z_={key:0,"size-3":``,bg:`green-500 dark:green-600`,"rounded-full":``},Q_={key:1,"size-3":``,bg:`neutral-400 dark:neutral-500`,"rounded-full":``};var $_=H({__name:`IconStatusItem`,props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(e){let t=e;return(e,n)=>{let r=rn(`RouterLink`);return U(),V(`div`,G_,[Mt(r,{flex:`~ row`,class:`menu-icon-status-item-link`,bg:`white dark:neutral-900`,transition:`all ease-in-out duration-400`,relative:``,"h-full":``,"w-full":``,"items-center":``,"overflow-hidden":``,"rounded-lg":``,"p-5":``,"text-left":``,to:t.to},{default:Nn(()=>[B(`div`,K_,[B(`div`,q_,un(t.title),1),B(`div`,J_,[B(`span`,null,un(t.description||``),1)])]),t.icon?(U(),V(`div`,{key:0,class:Gt([`menu-icon-status-item-icon`,[t.icon]]),transition:`all ease-in-out duration-400`,absolute:``,"right-0":``,"size-16":``,"translate-y-2":``,text:`neutral-400/50 dark:neutral-600/50`,"grayscale-100":``},null,2)):At(``,!0),t.iconColor?(U(),V(`div`,{key:1,class:Gt([`menu-icon-status-item-icon-color`,[t.iconColor]]),transition:`all ease-in-out duration-400`,absolute:``,"right-0":``,"size-16":``,"translate-y-2":``,text:`neutral-400/50 dark:neutral-600/50`,"grayscale-100":``},null,2)):At(``,!0),t.iconImage?(U(),V(`img`,{key:2,src:t.iconImage,class:`menu-icon-status-item-icon-image`,transition:`all ease-in-out duration-400`,absolute:``,"right-0":``,"size-16":``,"translate-y-2":``,"grayscale-100":``},null,8,Y_)):At(``,!0)]),_:1},8,[`to`]),B(`div`,X_,[t.configured?(U(),V(`div`,Z_)):(U(),V(`div`,Q_))])])}}}),ev=St($_,[[`__scopeId`,`data-v-b53bc3f0`]]);const tv=[`checked`,`name`,`value`],nv={class:`relative mr-3 mt-0.5 flex-shrink-0`},rv={class:`w-full flex flex-col gap-2`},iv={class:`flex items-center`},av={key:0,class:`relative`},ov=[`title`],sv={key:1,class:`mt-2`};var cv=H({__name:`RadioCardDetail`,props:Ht({id:null,name:null,value:null,title:null,description:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:``},customInputPlaceholder:{default:``},showCustomInput:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=xn(e,`modelValue`),n=W(!1);function r(){n.value=!n.value}return(i,a)=>(U(),V(`label`,{key:e.id,class:Gt([`form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]`,[t.value===e.value?`bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30`:`bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30`,t.value===e.value?`form_radio-card-detail-active`:``,e.deprecated?`opacity-60`:``]]),transition:`all duration-200 ease-in-out`,border:`2 solid`},[Pn(B(`input`,{"onUpdate:modelValue":a[0]||=e=>t.value=e,checked:t.value===e.value,type:`radio`,name:e.name,value:e.value,class:`absolute opacity-0`},null,8,tv),[[Dn,t.value]]),B(`div`,nv,[B(`div`,{class:Gt([`size-5 border-2 rounded-full transition-colors duration-200`,[t.value===e.value?`border-primary-500 dark:border-primary-400`:`border-neutral-300 dark:border-neutral-600`]])},[B(`div`,{class:Gt([`absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2`,[t.value===e.value?`opacity-100 bg-primary-500 dark:bg-primary-400`:`opacity-0`]])},null,2)],2)]),B(`div`,rv,[B(`div`,iv,[B(`span`,{class:Gt([`line-clamp-1 font-thin`,[t.value===e.value?`text-neutral-700 dark:text-neutral-300`:`text-neutral-700 dark:text-neutral-400`]])},un(e.title),3)]),e.description?(U(),V(`div`,av,[Mt(G(Wn),null,{default:Nn(()=>[!n.value||!e.showExpandCollapse?(U(),V(`div`,{key:0,class:Gt([`line-clamp-2 cursor-pointer text-xs`,[t.value===e.value?`text-neutral-600 dark:text-neutral-400`:`text-neutral-500 dark:text-neutral-500`]]),title:e.description,onClick:Fn(r,[`prevent`])},un(e.description),11,ov)):(U(),V(`div`,{key:1,class:Gt([`cursor-pointer text-xs`,[t.value===e.value?`text-neutral-600 dark:text-neutral-400`:`text-neutral-500 dark:text-neutral-500`]]),onClick:Fn(r,[`prevent`])},un(e.description),3))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(U(),V(`button`,{key:0,class:`mt-0.5 inline-flex items-center text-xs text-primary-500 dark:text-primary-600`,onClick:Fn(r,[`prevent`])},[B(`span`,null,un(n.value?`Show less`:`Show more`),1),B(`div`,{class:Gt([{"rotate-180":n.value},`transition-transform duration-200`])},a[2]||=[B(`div`,{"i-solar:alt-arrow-down-bold-duotone":``,"ml-0.5":``,"text-xs":``},null,-1)],2)])):At(``,!0)])):At(``,!0),e.showCustomInput&&t.value===e.value?(U(),V(`div`,sv,[Mt(G(qn),{modelValue:t.value,"onUpdate:modelValue":a[1]||=e=>t.value=e,type:`text`,class:`w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900`,placeholder:e.customInputPlaceholder},null,8,[`modelValue`,`placeholder`])])):At(``,!0)])],2))}}),lv=St(cv,[[`__scopeId`,`data-v-01e1298e`]]);const uv={class:`radio-card-detail-many-select`},dv={key:0,class:`relative`,"inline-flex":`~`,"w-full":``,"items-center":``},fv=[`placeholder`],pv={class:`mt-4 space-y-2`},mv={key:0,class:`text-sm text-neutral-500 dark:text-neutral-400`},hv={key:1,class:`flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20`},gv={class:`flex flex-col`},_v={class:`font-medium`},vv={class:`text-sm text-amber-600 dark:text-amber-400`},yv={class:`relative`};var bv=H({__name:`RadioCardManySelect`,props:Ht({items:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:`Search...`},searchNoResultsTitle:{default:`No results found`},searchNoResultsDescription:{default:`Try a different search term`},searchResultsText:{default:`{count} of {total} results`},customInputPlaceholder:{default:`Enter custom value`},expandButtonText:{default:`Show more`},collapseButtonText:{default:`Show less`},showMore:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:Ht([`update:customValue`],[`update:modelValue`]),setup(e,{emit:t}){let n=e,r=t,i=xn(e,`modelValue`),a=W(``),o=W(!1),s=W(``),c=Ot(()=>{if(!a.value)return n.items;let e=a.value.toLowerCase();return n.items.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function l(e){s.value=e,r(`update:customValue`,e)}return(t,n)=>(U(),V(`div`,uv,[e.searchable?(U(),V(`div`,dv,[n[4]||=B(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[B(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),Pn(B(`input`,{"onUpdate:modelValue":n[0]||=e=>a.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:e.searchPlaceholder},null,8,fv),[[kn,a.value]])])):At(``,!0),B(`div`,pv,[a.value?(U(),V(`div`,mv,un(e.searchResultsText.replace(`{count}`,c.value.length.toString()).replace(`{total}`,e.items.length.toString())),1)):At(``,!0),a.value&&c.value.length===0?(U(),V(`div`,hv,[n[5]||=B(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),B(`div`,gv,[B(`span`,_v,un(e.searchNoResultsTitle),1),B(`span`,vv,un(e.searchNoResultsDescription.replace(`{query}`,a.value)),1)])])):At(``,!0),B(`div`,yv,[B(`div`,{class:Gt([`grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4 scrollbar-none`,[o.value?`grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto`:``]]),transition:`all duration-200 ease-in-out`,style:{"scroll-snap-type":`x mandatory`}},[(U(!0),V(P,null,tn(c.value,t=>(U(),kt(lv,{id:t.id,key:t.id,modelValue:i.value,"onUpdate:modelValue":n[1]||=e=>i.value=e,value:t.id,title:t.name,description:t.description,deprecated:t.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":t.customizable,"custom-input-value":s.value,"custom-input-placeholder":e.customInputPlaceholder,name:`radio-card-detail-many-select`,class:`scroll-snap-align-start`,"onUpdate:customInputValue":n[2]||=e=>l(e)},null,8,[`id`,`modelValue`,`value`,`title`,`description`,`deprecated`,`show-expand-collapse`,`show-custom-input`,`custom-input-value`,`custom-input-placeholder`]))),128))],2),B(`div`,{bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,class:Gt([o.value?`w-full`:`mt-4 w-full rounded-lg`])},[B(`button`,{"w-full":``,flex:``,"items-center":``,"justify-center":``,"gap-2":``,"rounded-lg":``,"py-2":``,transition:`all duration-200 ease-in-out`,class:Gt([o.value?`bg-primary-500 hover:bg-primary-600 text-white`:`bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800`]),onClick:n[3]||=e=>o.value=!o.value},[B(`span`,null,un(o.value?e.collapseButtonText:e.expandButtonText),1),B(`div`,{class:Gt([o.value?`rotate-180`:``,`text-lg`]),"i-solar:alt-arrow-down-bold-duotone":``,transition:`transform duration-200 ease-in-out`},null,2)],2)],2)])])]))}}),xv=St(bv,[[`__scopeId`,`data-v-7ad6d626`]]);const Sv=[`checked`,`name`,`value`],Cv={flex:`~ col`,"min-h-16":``,"w-full":``,"items-start":``,"justify-center":``,"pb-2":``,"pl-5":``,"pr-4":``,"pt-2":``};var wv=H({__name:`RadioCardSimple`,props:Ht({id:null,name:null,value:null,title:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=xn(e,`modelValue`);return(n,r)=>(U(),V(`label`,{key:e.id,border:`2px solid`,class:Gt([`form_radio-card-simple relative`,[t.value===e.value?`bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30`:`bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30`,t.value===e.value?`form_radio-card-simple-active`:``]]),transition:`all duration-200 ease-in-out`,flex:`~ col`,block:``,"min-w-50":``,"w-fit":``,"cursor-pointer":``,"items-start":``,"rounded-xl":``,"p-4":``,"text-left":``},[Pn(B(`input`,{"onUpdate:modelValue":r[0]||=e=>t.value=e,checked:t.value===e.value,type:`radio`,name:e.name,value:e.value,class:`absolute opacity-0 [&:checked+div]:border-primary-500 [&:checked+div_.radio-dot]:opacity-100 dark:[&:checked+div]:border-primary-400`},null,8,Sv),[[Dn,t.value]]),r[1]||=B(`div`,{class:`radio-circle absolute left-2 top-2 size-5 rounded-full`,border:`2 solid neutral-300 dark:neutral-600`,transition:`all duration-200 ease-in-out`},[B(`div`,{class:`radio-dot absolute left-1/2 top-1/2 size-3 rounded-full opacity-0 -translate-x-1/2 -translate-y-1/2`,transition:`all duration-200 ease-in-out`,bg:`primary-500 dark:primary-400`})],-1),B(`div`,Cv,[B(`span`,{class:Gt([`radio-item-name font-thin`,[t.value===e.value?`text-neutral-700 dark:text-neutral-300`:`text-neutral-500 dark:text-neutral-500`]]),text:`md`,transition:`all duration-200 ease-in-out`},un(e.title),3),e.description?(U(),V(`span`,{key:0,class:Gt([`radio-item-description`,[t.value===e.value?`text-neutral-600 dark:text-neutral-400`:`text-neutral-400 dark:text-neutral-600`]]),transition:`all duration-200 ease-in-out`},un(e.description),3)):At(``,!0)]),r[2]||=B(`div`,{class:`bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50 [input:checked~&]:bg-dotted-primary-300/50 dark:[input:checked~&]:bg-dotted-primary-200/20`,absolute:``,"inset-0":``,"z--1":``,style:{"background-size":`10px 10px`,"mask-image":`linear-gradient(165deg, white 30%, transparent 50%)`}},null,-1)],2))}}),Tv=St(wv,[[`__scopeId`,`data-v-50bfb5e4`]]);const Ev={class:`p-3`},Dv={class:`flex items-start`},Ov=[`checked`,`name`,`value`],kv={class:`relative mr-3 mt-0.5 flex-shrink-0`},Av={key:0,class:`i-solar:pause-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500`},jv={key:1,class:`i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500`},Mv={key:1,class:`mt-auto w-full flex items-center justify-center bg-neutral-50 py-3 text-xs text-neutral-400 italic dark:bg-neutral-800/50 dark:text-neutral-600`},Nv={class:`flex-1 cursor-pointer`},Pv={class:`flex items-center`},Fv={key:0,class:`mt-1 flex flex-wrap gap-1`},Iv={key:1,class:`mt-3`},Lv={relative:``},Rv={key:0,class:`h-16 px-3 pb-2`};var zv=H({__name:`VoiceCard`,props:Ht({name:null,voice:null,currentlyPlayingId:null,customInputPlaceholder:{default:`Enter custom voice name`},showVisualizer:{type:Boolean,default:!0},audioStream:{default:null}},{"voice-id":{required:!1,default:``},"voice-idModifiers":{},"custom-voice-name":{required:!1,default:``},"custom-voice-nameModifiers":{}}),emits:Ht([`togglePlayback`],[`update:voice-id`,`update:custom-voice-name`]),setup(e,{emit:t}){let n=e,r=t,i=xn(e,`voice-id`),a=xn(e,`custom-voice-name`);function o(e){return e.previewURL||e.preview_audio_url}function s(e){var t,n,r;let i=[];if((t=e.labels)?.gender&&i.push(e.labels.gender),(n=e.labels)?.age&&i.push(e.labels.age),(r=e.labels)?.accent&&i.push(e.labels.accent),e.languages&&e.languages.length>0){let t=e.languages.map(e=>e.name).join(`, `);i.push(t)}return i}function c(){r(`togglePlayback`,n.voice)}return(t,r)=>(U(),V(`label`,{border:`2px solid`,class:Gt([`scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl`,[i.value===n.voice.id?`bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30`:`bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30`,i.value===n.voice.id?`form_voice-card-active`:``]]),transition:`all duration-200 ease-in-out`},[B(`div`,Ev,[B(`div`,Dv,[Pn(B(`input`,{"onUpdate:modelValue":r[0]||=e=>i.value=e,checked:i.value===n.voice.id,type:`radio`,name:e.name,value:n.voice.id,class:`absolute cursor-pointer opacity-0`},null,8,Ov),[[Dn,i.value]]),B(`div`,kv,[B(`div`,{class:Gt([`size-5 border-2 rounded-full transition-colors duration-200`,[i.value===n.voice.id?`border-primary-500 dark:border-primary-400`:`border-neutral-300 dark:border-neutral-600`]])},[B(`div`,{class:Gt([`absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2`,[i.value===n.voice.id?`opacity-100 bg-primary-500 dark:bg-primary-400`:`opacity-0`]])},null,2)],2)]),o(e.voice)?(U(),V(`button`,{key:0,absolute:``,"right-0":``,top:`0`,"z-3":``,class:Gt([`translate-x-[-50%] translate-y-[50%]`,[e.currentlyPlayingId===e.voice.id?`text-white dark:text-white`:``]]),onClick:c},[e.currentlyPlayingId===e.voice.id?(U(),V(`div`,Av)):(U(),V(`div`,jv))],2)):(U(),V(`div`,Mv,` No preview available `)),B(`div`,Nv,[B(`div`,Pv,[B(`span`,{class:Gt([`line-clamp-1 font-medium`,[i.value===e.voice.id?`text-neutral-700 dark:text-neutral-300`:`text-neutral-700 dark:text-neutral-400`]])},un(e.voice.name),3)]),s(e.voice).length>0?(U(),V(`div`,Fv,[(U(!0),V(P,null,tn(s(e.voice),(t,n)=>(U(),V(`span`,{key:n,class:Gt([`inline-flex items-center rounded-md px-1.5 py-0.5 text-xs`,[i.value===e.voice.id?`bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400`:`bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300`]])},un(t),3))),128))])):At(``,!0),e.voice.customizable&&i.value===e.voice.id?(U(),V(`div`,Iv,[Mt(G(qn),{modelValue:a.value,"onUpdate:modelValue":r[1]||=e=>a.value=e,type:`text`,class:`w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900`,placeholder:e.customInputPlaceholder},null,8,[`modelValue`,`placeholder`])])):At(``,!0),e.voice.description?(U(),V(`div`,{key:2,class:Gt([`line-clamp-2 mt-1 text-xs`,[i.value===e.voice.id?`text-neutral-600 dark:text-neutral-400`:`text-neutral-500 dark:text-neutral-500`]])},un(e.voice.description),3)):At(``,!0)])])]),B(`div`,Lv,[Mt(G(Wn),null,{default:Nn(()=>[e.showVisualizer&&e.currentlyPlayingId===e.voice.id&&e.audioStream?(U(),V(`div`,Rv,[Mt(G(aa),{stream:e.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:Nn(({frequencies:t})=>[Mt(G(la),{frequencies:t,"bars-class":i.value===e.voice.id?`bg-primary-500 dark:bg-primary-400`:`bg-neutral-400 dark:bg-neutral-600`},null,8,[`frequencies`,`bars-class`])]),_:1},8,[`stream`])])):At(``,!0)]),_:1})])],2))}}),Bv=St(zv,[[`__scopeId`,`data-v-a5ae8da9`]]);const Vv={class:`voice-preview-player`},Hv={key:0,class:`relative`,"inline-flex":`~`,"w-full":``,"items-center":``},Uv=[`placeholder`],Wv={class:`mt-4 space-y-2`},Gv={key:0,class:`text-sm text-neutral-500 dark:text-neutral-400`},Kv={key:1,class:`flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20`},qv={class:`flex flex-col`},Jv={class:`font-medium`},Yv={class:`text-sm text-amber-600 dark:text-amber-400`},Xv={class:`relative`};var Zv=H({__name:`VoiceCardManySelect`,props:Ht({voices:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:`Search voices...`},searchNoResultsTitle:{default:`No voices found`},searchNoResultsDescription:{default:`Try a different search term`},searchResultsText:{default:`{count} of {total} voices`},customInputPlaceholder:{default:`Enter custom voice name`},expandButtonText:{default:`Show more`},collapseButtonText:{default:`Show less`},playButtonText:{default:`Play sample`},pauseButtonText:{default:`Pause`},showVisualizer:{type:Boolean,default:!0}},{"search-query":{required:!1,default:``},"search-queryModifiers":{},"voice-id":{required:!1,default:``},"voice-idModifiers":{}}),emits:[`update:search-query`,`update:voice-id`],setup(e){let t=e,n=W(!1),r=W(),i=W(new Map),a=W(new Map),o=W(new Map),s=W(new Map),c=W(null);function l(){return c.value||=new(window.AudioContext||window.webkitAudioContext),c.value}let u=xn(e,`search-query`),d=xn(e,`voice-id`),f=Ot(()=>{if(!u.value)return t.voices;let e=u.value.toLowerCase();return t.voices.filter(t=>{let n=t.name.toLowerCase().includes(e),r=t.description&&t.description.toLowerCase().includes(e),i=t.tags&&t.tags.some(t=>t.toLowerCase().includes(e)),a=t.labels&&Object.values(t.labels).some(t=>typeof t==`string`&&t.toLowerCase().includes(e)),o=t.languages&&t.languages.some(t=>t.name.toLowerCase().includes(e)||t.code.toLowerCase().includes(e));return n||r||i||a||o})});function p(e){return e.previewURL||e.preview_audio_url}function m(e){let t=p(e);if(!t)return null;if(i.value.has(e.id))return i.value.get(e.id)||null;let n=new Audio(t);return n.crossOrigin=`anonymous`,n.preload=`auto`,n.addEventListener(`ended`,()=>{if(r.value===e.id){r.value=void 0;let t=a.value.get(e.id);t&&(t.getTracks().forEach(e=>e.stop()),a.value.delete(e.id))}}),i.value.set(e.id,n),n}function h(e,t){try{if(a.value.has(t))return a.value.get(t)||null;let n=l();if(s.value.has(t)){let e=s.value.get(t),r=n.createMediaStreamDestination();e.connect(r);let i=r.stream;return a.value.set(t,i),i}let r=n.createMediaElementSource(e);s.value.set(t,r),r.connect(n.destination);let i=n.createMediaStreamDestination();r.connect(i);let o=i.stream;return a.value.set(t,o),o}catch(e){return console.error(`Failed to create audio stream for visualizer:`,e),null}}function g(e){try{let n=p(e);if(!n)return;let o=m(e);if(!o)return;if(r.value===e.id){o.pause(),r.value=void 0;let t=a.value.get(e.id);t&&(t.getTracks().forEach(e=>e.stop()),a.value.delete(e.id));return}if(r.value){let e=i.value.get(r.value);e&&e.pause();let t=a.value.get(r.value);t&&(t.getTracks().forEach(e=>e.stop()),a.value.delete(r.value))}t.showVisualizer&&!a.value.has(e.id)&&h(o,e.id),o.currentTime=0,o.play().catch(e=>{console.error(`Failed to play audio:`,e)}),r.value=e.id}catch(e){console.error(e),r.value=void 0}}function _(){i.value.forEach(e=>{e.pause(),e.src=``}),i.value.clear(),a.value.forEach(e=>{e.getTracks().forEach(e=>e.stop())}),a.value.clear(),o.value.forEach(e=>{e.state!==`closed`&&e.close()}),o.value.clear(),s.value.clear(),r.value=void 0}K(u,()=>{if(r.value){let e=i.value.get(r.value);e&&e.pause();let t=a.value.get(r.value);t&&(t.getTracks().forEach(e=>e.stop()),a.value.delete(r.value)),r.value=void 0}}),Jt(_);let v=W(``);return(t,i)=>(U(),V(`div`,Vv,[e.searchable?(U(),V(`div`,Hv,[i[4]||=B(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[B(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),Pn(B(`input`,{"onUpdate:modelValue":i[0]||=e=>u.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:e.searchPlaceholder},null,8,Uv),[[kn,u.value]])])):At(``,!0),B(`div`,Wv,[u.value?(U(),V(`div`,Gv,un(e.searchResultsText.replace(`{count}`,f.value.length.toString()).replace(`{total}`,e.voices.length.toString())),1)):At(``,!0),u.value&&f.value.length===0?(U(),V(`div`,Kv,[i[5]||=B(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),B(`div`,qv,[B(`span`,Jv,un(e.searchNoResultsTitle),1),B(`span`,Yv,un(e.searchNoResultsDescription.replace(`{query}`,u.value)),1)])])):At(``,!0),B(`div`,Xv,[B(`div`,{class:Gt([`grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto scrollbar-none`,[n.value?`grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto`:``]]),transition:`all duration-200 ease-in-out`,style:{"scroll-snap-type":`x mandatory`}},[(U(!0),V(P,null,tn(f.value,t=>(U(),kt(Bv,{key:t.id,"voice-id":d.value,"onUpdate:voiceId":i[1]||=e=>d.value=e,"custom-voice-name":v.value,"onUpdate:customVoiceName":i[2]||=e=>v.value=e,name:`voice`,voice:t,"currently-playing-id":r.value,"custom-input-placeholder":e.customInputPlaceholder,"show-visualizer":e.showVisualizer,"audio-stream":a.value.get(t.id),onTogglePlayback:g},null,8,[`voice-id`,`custom-voice-name`,`voice`,`currently-playing-id`,`custom-input-placeholder`,`show-visualizer`,`audio-stream`]))),128))],2),B(`div`,{bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,class:Gt([n.value?`w-full`:`mt-4 w-full rounded-lg`])},[B(`button`,{"w-full":``,flex:``,"items-center":``,"justify-center":``,"gap-2":``,"rounded-lg":``,"py-2":``,transition:`all duration-200 ease-in-out`,class:Gt([n.value?`bg-primary-500 hover:bg-primary-600 text-white`:`bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800`]),onClick:i[3]||=e=>n.value=!n.value},[B(`span`,null,un(n.value?e.collapseButtonText:e.expandButtonText),1),B(`div`,{class:Gt([n.value?`rotate-180`:``,`text-lg`]),"i-solar:alt-arrow-down-bold-duotone":``,transition:`transform duration-200 ease-in-out`},null,2)],2)],2)])])]))}}),Qv=St(Zv,[[`__scopeId`,`data-v-4dd3b9e2`]]),$v=H({__name:`CursorFloating`,props:{intensity:{default:1.5}},setup(e){let t=e,n=W(null),r=W(``),i=W(`50% 50%`),a=W(`50% 50%`),o=W(.5);function s(e){if(!n.value)return;let s=n.value,c=s.getBoundingClientRect(),l=e.clientX-c.left,u=e.clientY-c.top,d=s.offsetWidth,f=s.offsetHeight,p=Math.abs(Math.floor(100/d*l)-100),m=Math.abs(Math.floor(100/f*u)-100),h=50+(p-50)/1.5,g=50+(m-50)/1.5,_=50+(p-50)/7,v=50+(m-50)/7,y=(h-50)/1.5*.2*t.intensity,b=(g-50)/2*-1*.2*t.intensity,x=50-p+(50-m),S=.5+Math.abs(x)*.008*t.intensity;r.value=`perspective(1200px) rotateX(${b}deg) rotateY(${y}deg) scale3d(${1+.015*t.intensity}, ${1+.015*t.intensity}, ${1+.015*t.intensity})`,i.value=`${h}% ${g}%`,a.value=`${_}% ${v}%`,o.value=S}function c(){r.value=`perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`,i.value=`50% 50%`,a.value=`50% 50%`,o.value=.5}return Yt(()=>{r.value=`perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`}),(t,i)=>(U(),V(`div`,{ref_key:`cardRef`,ref:n,class:`card-hover-effect`,style:qt({transform:r.value,"--effect-intensity":e.intensity}),onMousemove:s,onMouseleave:c},[nn(t.$slots,`default`,{},void 0,!0)],36))}}),ey=St($v,[[`__scopeId`,`data-v-895421da`]]),ty=H({__name:`ProviderAccountIdInput`,props:Ht({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=xn(e,`modelValue`);return(e,r)=>(U(),kt(G(Kn),{modelValue:n.value,"onUpdate:modelValue":r[0]||=e=>n.value=e,label:t.label||`Account ID`,description:t.description||`Account ID`,placeholder:t.placeholder,required:t.required,type:`text`},null,8,[`modelValue`,`label`,`description`,`placeholder`,`required`]))}}),ny=ty;const ry=[`onClick`],iy={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},ay={"mt-4":``};var oy=H({__name:`ProviderAdvancedSettings`,props:{title:null,initialVisible:{type:Boolean}},setup(e){let t=e,n=W(t.initialVisible||!1);function r(){n.value=!n.value}return(t,n)=>(U(),kt(Un,{"w-full":``},{trigger:Nn(t=>[B(`button`,{transition:`all ease-in-out duration-250`,"w-full":``,flex:``,"items-center":``,"gap-1.5":``,"outline-none":``,class:`[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0`,onClick:()=>t.setVisible(!t.visible)&&r()},[B(`h2`,iy,[B(`span`,null,un(e.title||`Advanced`),1)]),B(`div`,{transform:``,transition:`transform duration-250`,class:Gt({"rotate-180":t.visible})},n[0]||=[B(`div`,{"i-solar:alt-arrow-down-bold-duotone":``},null,-1)],2)],8,ry)]),default:Nn(()=>[B(`div`,ay,[nn(t.$slots,`default`)])]),_:3}))}}),sy=oy,cy=H({__name:`ProviderApiKeyInput`,props:Ht({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,{t:n}=bn(),r=xn(e,`modelValue`),i=Ot(()=>t.description||`API Key for ${t.providerName}`);return(t,a)=>(U(),kt(G(Kn),{modelValue:r.value,"onUpdate:modelValue":a[0]||=e=>r.value=e,label:e.label||G(n)(`settings.pages.providers.common.fields.field.api-key.label`),description:i.value,placeholder:e.placeholder,required:e.required,type:`password`},null,8,[`modelValue`,`label`,`description`,`placeholder`,`required`]))}}),ly=cy,uy=H({__name:`ProviderBaseUrlInput`,props:Ht({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=xn(e,`modelValue`);return(e,r)=>(U(),kt(G(Kn),{modelValue:n.value,"onUpdate:modelValue":r[0]||=e=>n.value=e,label:t.label||`Base URL`,description:t.description||`Custom base URL (optional)`,placeholder:t.placeholder,required:t.required,type:`text`},null,8,[`modelValue`,`label`,`description`,`placeholder`,`required`]))}}),dy=uy;const fy={flex:`~ col gap-6`},py={flex:`~ row`,"items-center":``,"justify-between":``},my={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},hy={text:`neutral-400 dark:neutral-500`};var gy=H({__name:`ProviderBasicSettings`,props:{title:null,description:null,onReset:{type:Function}},setup(e){return(t,n)=>(U(),V(`div`,fy,[B(`div`,py,[B(`div`,null,[B(`h2`,my,un(e.title||`Basic`),1),B(`div`,hy,[B(`span`,null,un(e.description||`Essential settings`),1)])]),e.onReset?(U(),V(`button`,{key:0,title:`Reset settings`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-2":``,transition:`all duration-250 ease-in-out`,text:`neutral-500 dark:neutral-400`,bg:`transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700`,onClick:n[0]||=(...t)=>e.onReset&&e.onReset(...t)},n[1]||=[B(`div`,{"i-solar:refresh-bold-duotone":``,"text-xl":``},null,-1)])):At(``,!0)]),nn(t.$slots,`default`)]))}}),_y=gy;const vy={bg:`neutral-50 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-6`};var yy=H({__name:`ProviderSettingsContainer`,setup(e){return(e,t)=>(U(),V(`div`,vy,[nn(e.$slots,`default`)]))}}),by=yy;const xy={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":``};var Sy=H({__name:`ProviderSettingsLayout2`,props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(t,n)=>{let r=an(`motion`);return U(),V(P,null,[nn(t.$slots,`default`),Pn((U(),V(`div`,xy,[B(`div`,{text:`60`,class:Gt(e.providerIcon||e.providerIconColor)},null,2)])),[[r]])],64)}}}),Cy=Sy;const wy={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":``};var Ty=H({__name:`ProviderSettingsLayout`,props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(t,n)=>{let r=an(`motion`);return U(),V(P,null,[nn(t.$slots,`default`),Pn((U(),V(`div`,wy,[B(`div`,{text:`60`,class:Gt(e.providerIcon||e.providerIconColor)},null,2)])),[[r]])],64)}}}),Ey=Ty;const Dy={"w-full":``,"rounded-xl":``},Oy={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},ky={class:`inline-flex items-center gap-4`},Ay={flex:`~ col gap-4`},jy=[`placeholder`],My=[`placeholder`],Ny={flex:`~ col gap-6`},Py={grid:`~ cols-2 gap-4`},Fy={class:`flex items-center gap-1 text-sm font-medium`},Iy={class:`text-xs text-neutral-500 dark:text-neutral-400`},Ly=[`value`],Ry={flex:`~ row`,"gap-4":``},zy=[`disabled`],By={flex:`~ row`,"items-center":``,"gap-2":``},Vy={flex:`~ row`,"items-center":``,"gap-2":``},Hy={key:2,class:`mt-2 text-sm text-red-500`},Uy={key:3,class:`mt-2 text-sm text-red-500`},Wy={key:4,class:`mt-2 text-sm text-red-500`},Gy=[`src`];var Ky=H({__name:`SpeechPlayground`,props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(e,{expose:t}){let n=e,{t:r}=bn(),i=W(n.defaultText||`Hello! This is a test of the voice synthesis.`),a=W(!1),o=W(``),s=W(``),c=W(null),l=W(!1),u=W(``),d=W(``);K(()=>n.availableVoices,e=>{var t;e.length>0&&!d.value&&(d.value=(t=e[0])?.id||``)},{immediate:!0});async function f(){if(!(!i.value.trim()&&!l.value||l.value&&!u.value.trim()||!d.value)){a.value=!0,s.value=``;try{o.value&&p();let e=l.value?u.value:i.value,t=await n.generateSpeech(e,d.value,l.value);o.value=URL.createObjectURL(new Blob([t])),setTimeout(()=>{c.value&&c.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),s.value=e instanceof Error?e.message:`An unknown error occurred`}finally{a.value=!1}}}function p(){c.value&&(c.value.pause(),c.value.currentTime=0),o.value&&(URL.revokeObjectURL(o.value),o.value=``)}return Zt(()=>{o.value&&URL.revokeObjectURL(o.value)}),t({testText:i,ssmlText:u,useSSML:l,selectedVoice:d,isGenerating:a,audioUrl:o,errorMessage:s,audioPlayer:c,generateTestSpeech:f,stopTestAudio:p}),(t,n)=>(U(),V(`div`,Dy,[B(`h2`,Oy,[B(`div`,ky,[Mt(G(_a)),B(`div`,null,un(G(r)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),B(`div`,Ay,[Mt(G(Gn),{modelValue:l.value,"onUpdate:modelValue":n[0]||=e=>l.value=e,label:G(r)(`settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label`),description:G(r)(`settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description`)},null,8,[`modelValue`,`label`,`description`]),l.value?Pn((U(),V(`textarea`,{key:1,"onUpdate:modelValue":n[2]||=e=>u.value=e,placeholder:G(r)(`settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder`),border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-48":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"font-mono":``,"outline-none":``},null,8,My)),[[kn,u.value]]):Pn((U(),V(`textarea`,{key:0,"onUpdate:modelValue":n[1]||=e=>i.value=e,placeholder:G(r)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`),border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-24":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"outline-none":``},null,8,jy)),[[kn,i.value]]),B(`div`,Ny,[B(`label`,Py,[B(`div`,null,[B(`div`,Fy,un(G(r)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label`)),1),B(`div`,Iy,un(G(r)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description`)),1)]),Pn(B(`select`,{"onUpdate:modelValue":n[3]||=e=>d.value=e,border:`neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600`,transition:`border duration-250 ease-in-out`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``},[(U(!0),V(P,null,tn(e.availableVoices,e=>(U(),V(`option`,{key:e.id,value:e.id},un(e.name),9,Ly))),128))],512),[[On,d.value]])])]),B(`div`,Ry,[B(`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:a.value||!i.value.trim()&&!l.value||l.value&&!u.value.trim()||!d.value||!e.apiKeyConfigured,class:Gt({"opacity-50 cursor-not-allowed":a.value||!i.value.trim()&&!l.value||l.value&&!u.value.trim()||!d.value||!e.apiKeyConfigured}),bg:`neutral-700 dark:neutral-300`,onClick:f},[B(`div`,By,[n[4]||=B(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),B(`span`,null,un(a.value?G(r)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):G(r)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,zy),o.value?(U(),V(`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:p},[B(`div`,Vy,[n[5]||=B(`div`,{"i-solar:stop-circle-bold-duotone":``},null,-1),B(`span`,null,un(G(r)(`settings.pages.modules.speech.sections.section.playground.buttons.stop.label`)),1)])])):At(``,!0)]),e.apiKeyConfigured?At(``,!0):(U(),V(`div`,Hy,un(G(r)(`settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key`)),1)),d.value?At(``,!0):(U(),V(`div`,Uy,un(G(r)(`settings.pages.modules.speech.sections.section.playground.select-voice.required`)),1)),s.value?(U(),V(`div`,Wy,un(s.value),1)):At(``,!0),o.value?(U(),V(`audio`,{key:5,ref_key:`audioPlayer`,ref:c,src:o.value,controls:``,class:`mt-2 w-full`},null,8,Gy)):At(``,!0)]),nn(t.$slots,`default`)]))}}),qy=Ky;const Jy={flex:`~ col md:row gap-6`},Yy={flex:`~ col gap-6`},Xy={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},Zy={flex:`~ col gap-4`},Qy={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},$y={"w-full":``,"rounded-xl":``};var eb=H({__name:`SpeechProviderSettings`,props:{providerId:null,defaultModel:null,additionalSettings:null},setup(e){let t=e,{t:n}=bn(),r=Sn(),i=Bn(),a=Hn(),{providers:o}=ln(i),s=Ot(()=>i.getProviderMetadata(t.providerId)),c=Ot({get:()=>{var e;return(e=o.value[t.providerId])?.apiKey||``},set:e=>{o.value[t.providerId]||(o.value[t.providerId]={}),o.value[t.providerId].apiKey=e}}),l=Ot({get:()=>{var e,n,r;return(e=o.value[t.providerId])?.baseUrl||((n=s.value)==null||(r=n.defaultOptions)==null?void 0:r.call(n).baseUrl)||``},set:e=>{o.value[t.providerId]||(o.value[t.providerId]={}),o.value[t.providerId].baseUrl=e}}),u=W(`Hello! This is a test of voice synthesis.`),d=W(!1),f=W(``),p=W(``),m=W(null),h=W(!1),g=W(``),_=W(``),v=W({});function y(){var e;(e=o.value[t.providerId])?.voiceSettings?v.value={...o.value[t.providerId].voiceSettings}:v.value={pitch:0,speed:1,volume:0,...t.additionalSettings}}Yt(()=>{var e,n,r,u;i.initializeProvider(t.providerId),c.value=(e=o.value[t.providerId])?.apiKey||``,l.value=(n=o.value[t.providerId])?.baseUrl||((r=s.value)==null||(u=r.defaultOptions)==null?void 0:u.call(r).baseUrl)||``,y(),i.configuredProviders[t.providerId]&&a.loadVoicesForProvider(t.providerId)});let b=vn(()=>{var e,n;o.value[t.providerId]={...o.value[t.providerId],apiKey:c.value,baseUrl:l.value||((e=s.value)==null||(n=e.defaultOptions)==null?void 0:n.call(e).baseUrl)||``,voiceSettings:{...v.value}}},1e3);K([c,l],b),K(v,b,{deep:!0});async function x(){if(!u.value.trim()&&!h.value||h.value&&!g.value.trim())return;let e=i.getProviderInstance(t.providerId);if(!e){console.error(`Failed to initialize speech provider`);return}if(!_.value){console.error(`No active speech voice selected`);return}d.value=!0,p.value=``;try{f.value&&S();let n=t.defaultModel||`default`,r=h.value?g.value:u.value,i=await Ln({...e.speech(n,{voiceSettings:v.value}),input:r,voice:_.value});f.value=URL.createObjectURL(new Blob([i])),setTimeout(()=>{m.value&&m.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),p.value=e instanceof Error?e.message:`An unknown error occurred`}finally{d.value=!1}}function S(){m.value&&(m.value.pause(),m.value.currentTime=0),f.value&&(URL.revokeObjectURL(f.value),f.value=``)}Zt(()=>{f.value&&URL.revokeObjectURL(f.value)});function C(){var e,t;v.value={...((e=s.value)==null||(t=e.defaultOptions)==null?void 0:t.call(e).voiceSettings)||{}},b()}function w(e,t){v.value[e]=t}let T=Ot(()=>({voiceSettings:v.value,updateVoiceSettings:w,isGenerating:d.value,testText:u.value,useSSML:h.value,ssmlText:g.value,generateTestSpeech:x,stopTestAudio:S,audioUrl:f.value,audioPlayer:m.value,errorMessage:p.value}));return(e,t)=>{var i,a;return U(),kt(Cy,{"provider-name":(i=s.value)?.localizedName,"provider-icon":(a=s.value)?.icon,"on-back":()=>G(r).back()},{default:Nn(()=>[B(`div`,Jy,[Mt(G(by),{class:`w-full md:w-[40%]`},{default:Nn(()=>[Mt(G(_y),{title:G(n)(`settings.pages.providers.common.section.basic.title`),description:G(n)(`settings.pages.providers.common.section.basic.description`),"on-reset":C},{default:Nn(()=>{var n;return[Mt(G(ly),{modelValue:c.value,"onUpdate:modelValue":t[0]||=e=>c.value=e,"provider-name":(n=s.value)?.localizedName,placeholder:`sk-`},null,8,[`modelValue`,`provider-name`]),nn(e.$slots,`basic-settings`)]}),_:3},8,[`title`,`description`]),B(`div`,Yy,[B(`h2`,Xy,un(G(n)(`settings.pages.providers.common.section.voice.title`)),1),B(`div`,Zy,[nn(e.$slots,`voice-settings`,Kt(Rt(T.value)))])]),Mt(G(sy),{title:G(n)(`settings.pages.providers.common.section.advanced.title`)},{default:Nn(()=>{var n,r;return[Mt(G(dy),{modelValue:l.value,"onUpdate:modelValue":t[1]||=e=>l.value=e,placeholder:((n=s.value)==null||(r=n.defaultOptions)==null?void 0:r.call(n).baseUrl)||``,required:``},null,8,[`modelValue`,`placeholder`]),nn(e.$slots,`advanced-settings`)]}),_:3},8,[`title`])]),_:3}),B(`div`,Qy,[B(`div`,$y,[nn(e.$slots,`playground`,Kt(Rt(T.value)))])])])]),_:3},8,[`provider-name`,`provider-icon`,`on-back`])}}}),tb=eb,nb=H({__name:`Screen`,setup(e){let t=W(),n=gn(Dt),{width:r,height:i}=Tn(),a=yn(t,{immediate:!0,windowResize:!0,reset:!0}),o=Ot(()=>n.between(`sm`,`md`).value||n.smaller(`sm`).value),s=Ot(()=>n.between(`md`,`lg`).value),c=Ot(()=>n.greaterOrEqual(`lg`).value),l=Ot(()=>c.value?a.width.value:o.value||s.value?r.value-16:a.width.value),u=W(0);return K([r,i,t],()=>{var e;let n=(e=t.value)==null||(e=e.parentElement)==null?void 0:e.getBoundingClientRect();c.value||o.value||s.value?u.value=n?.height||0:u.value=600}),K([a.width,a.height],()=>{c.value||o.value||s.value?u.value=a.height.value:u.value=600}),Yt(async()=>{t.value&&a.update()}),(e,n)=>(U(),V(`div`,{ref_key:`containerRef`,ref:t,"h-full":``,"w-full":``},[nn(e.$slots,`default`,{width:l.value,height:u.value})],512))}}),rb=nb,ib=bt((exports,t)=>{ +/*! + +JSZip v3.10.1 - A JavaScript class for generating and reading zip files + + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/main/LICENSE +*/ +(function(n){typeof exports==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof Ct==`function`&&Ct;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof Ct==`function`&&Ct,o=0;o>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){"use strict";var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=` +\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){"use strict";var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n `+e:e}},t.exports=r},{}],29:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{var e=function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){"use strict";var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function N(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function F(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)}function I(e,t){e.pending_buf[e.pending++]=t}function te(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&ac&&--i!=0);return o<=e.lookahead?o:e.lookahead}function L(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(L(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,F(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(F(e,!1),e.strm.avail_out),O)}),new ie(4,4,8,4,re),new ie(4,5,16,8,re),new ie(4,6,32,32,re),new ie(4,4,16,16,R),new ie(8,16,32,32,R),new ie(8,16,128,128,R),new ie(8,32,128,256,R),new ie(32,128,258,1024,R),new ie(32,258,258,4096,R)],n.deflateInit=function(e,t){return ce(e,t,g,15,8,0)},n.deflateInit2=ce,n.deflateReset=se,n.deflateResetKeep=oe,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5>8&255),I(i,i.gzhead.time>>16&255),I(i,i.gzhead.time>>24&255),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(I(i,255&i.gzhead.extra.length),I(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(I(i,0),I(i,0),I(i,0),I(i,0),I(i,0),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,te(i,p),i.strstart!==0&&(te(i,e.adler>>>16),te(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending!==i.pending_buf_size));)I(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&P(e),i.pending+2<=i.pending_buf_size&&(I(i,255&e.adler),I(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(P(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(L(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(L(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(ee(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),P(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(I(i,255&e.adler),I(i,e.adler>>8&255),I(i,e.adler>>16&255),I(i,e.adler>>24&255),I(i,255&e.total_in),I(i,e.total_in>>8&255),I(i,e.total_in>>16&255),I(i,e.total_in>>24&255)):(te(i,e.adler>>>16),te(i,65535&e.adler)),P(e),0=n.w_size&&(s===0&&(ee(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,L(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<>>=b,m-=b),m<15&&(p+=T[r++]<>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<>>=b,m-=b,(b=a-o)>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,L,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,P=8+(15&(b>>>=4)),n.wbits===0)n.wbits=P;else if(P>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(L[0]=255&b,L[1]=b>>>8&255,n.check=a(n.check,L,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,L[2]=b>>>16&255,L[3]=b>>>24&255,n.check=a(n.check,L,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>8),512&n.flags&&(L[0]=255&b,L[1]=b>>>8&255,n.check=a(n.check,L,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>>8&255,n.check=a(n.check,L,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(P=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,P)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;P=p[g+ E++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P)),P&&E>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;n.have<19;)n.lens[re[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,I={bits:n.lenbits},F=s(0,n.lens,0,19,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,j=65535&ne,!((k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(te=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}P=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(te=k+3;x>>=k)),b>>>=3,x-=3}else{for(te=k+7;x>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=P}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,I={bits:n.lenbits},F=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,I={bits:n.distbits},F=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,I),n.distbits=I.bits,F){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(ne=n.lencode[b&(1<>>16&255,j=65535&ne,!((k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&ne,!(M+(k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(te=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(ne=n.distcode[b&(1<>>16&255,j=65535&ne,!((k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&ne,!(M+(k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(te=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(yv?(b=I[te+d[w]],N[ee+d[w]]):(b=96,0),p=1<>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--P[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function I(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function te(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function re(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=L(a[s]++,s))}}function R(e){var t;for(t=0;t>1;1<=n;n--)oe(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],oe(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,oe(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?fe(e,t,n,r):e.strategy===4||s===o?(te(e,2+(r?1:0),3),se(e,T,E)):(te(e,4+(r?1:0),3),function(e,t,n,r){var i;for(te(e,t-257,5),te(e,n-1,5),te(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*F(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){te(e,2,3),ne(e,_,T),function(e){e.bi_valid===16?(I(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){"use strict";if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})}),ab=Tt(ib());Jp.zipReader=(e,t)=>ab.default.loadAsync(e);const ob=Jp.createSettings;Jp.createSettings=async e=>{let t=Object.keys(e.files);return t.find(e=>sb(e))?ob(e):ub(t)};function sb(e){return e.endsWith(`model3.json`)}function cb(e){return e.endsWith(`.moc3`)}function lb(e){return e.split(/[\\/]/).pop()}function ub(e){let t=e.filter(e=>cb(e));if(t.length!==1){let e=t.length?`(${t.map(e=>`"${e}"`).join(`,`)})`:``;throw Error(`Expected exactly one moc file, got ${t.length} ${e}`)}let n=t[0],r=lb(n).replace(/\.moc3?/,``),i=e.filter(e=>e.endsWith(`.png`));if(!i.length)throw Error(`Textures not found`);let a=e.filter(e=>e.endsWith(`.mtn`)||e.endsWith(`.motion3.json`)),o=e.find(e=>e.includes(`physics`)),s=e.find(e=>e.includes(`pose`)),c=new Xp({url:`${r}.model3.json`,Version:3,FileReferences:{Moc:n,Textures:i,Physics:o,Pose:s,Motions:a.length?{"":a.map(e=>({File:e}))}:void 0}});return c.name=r,c._objectURL=`example://${c.url}`,c}Jp.readText=(e,t)=>{let n=e.file(t);if(!n)throw Error(`Cannot find file: ${t}`);return n.async(`text`)},Jp.getFilePaths=e=>{let t=[];return e.forEach(e=>t.push(e)),Promise.resolve(t)},Jp.getFiles=(e,t)=>Promise.all(t.map(async t=>{let n=t.slice(t.lastIndexOf(`/`)+1),r=await e.file(t).async(`blob`);return new File([r],n)}));const db={absolute:``,bottom:`3`,right:`3`},fb={flex:`~ row`,"cursor-pointer":``},pb=[`checked`,`aria-checked`],mb={key:0,"min-w":`50vw`,z:`(U(),kt(rb,{relative:``},{default:Nn(({width:i,height:o})=>[Mt(om,{width:i,height:o,resolution:2,"max-h":`100dvh`},{default:Nn(({app:t})=>[Mt(z_,{app:t,"mouth-open-size":e.mouthOpenSize,width:i,height:o,paused:e.paused,"focus-at":e.focusAt},null,8,[`app`,`mouth-open-size`,`width`,`height`,`paused`,`focus-at`])]),_:2},1032,[`width`,`height`]),B(`div`,db,[B(`div`,fb,[B(`label`,{class:Gt([n.value?`bg-neutral-300 dark:bg-neutral-200`:`bg-neutral-100 dark:bg-neutral-700`]),transition:`all ease-in-out duration-500`,text:`lg neutral-500 dark:neutral-400`,"m-1":``,"h-fit":``,"w-fit":``,"cursor-pointer":``,"appearance-none":``,"gap-1":``,"rounded-lg":``,"rounded-md":``,"border-none":``,"p-2":``,"outline-none":``},[Pn(B(`input`,{"onUpdate:modelValue":a[0]||=e=>n.value=e,checked:n.value,"aria-checked":n.value,name:`showLive2DViewerInspector`,type:`checkbox`,"appearance-none":``,"outline-none":``,hidden:``},null,8,pb),[[En,n.value]]),a[8]||=B(`div`,{"select-none":``},[B(`div`,{"i-solar:bug-bold-duotone":``})],-1)],2)]),Mt(G(Wn),null,{default:Nn(()=>[n.value?(U(),V(`div`,mb,[B(`div`,hb,[B(`div`,gb,[B(`span`,null,un(G(t)(`stage.viewers.debug-menu.emotions`)),1)]),B(`div`,_b,[B(`button`,{"rounded-lg":``,bg:`neutral-100/70 dark:neutral-800/50`,"px-2":``,"py-1":``,"backdrop-blur-sm":``,onClick:a[1]||=e=>r.value={group:`Surprise`,index:0}},un(G(t)(`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:a[2]||=e=>r.value={group:`Sad`,index:0}},un(G(t)(`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:a[3]||=e=>r.value={group:`Angry`,index:0}},un(G(t)(`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:a[4]||=e=>r.value={group:`Happy`,index:0}},un(G(t)(`stage.viewers.debug-menu.emotions-btn.happy`)),1),B(`button`,{"rounded-lg":``,bg:`neutral-100/70 dark:neutral-800/50`,"px-2":``,"py-1":``,"backdrop-blur-sm":``,onClick:a[5]||=e=>r.value={group:`Awkward`,index:0}},un(G(t)(`stage.viewers.debug-menu.emotions-btn.awkward`)),1),B(`button`,{"rounded-lg":``,bg:`neutral-100/70 dark:neutral-800/50`,"px-2":``,"py-1":``,"backdrop-blur-sm":``,onClick:a[6]||=e=>r.value={group:`Question`,index:0}},un(G(t)(`stage.viewers.debug-menu.emotions-btn.question`)),1),B(`button`,{"rounded-lg":``,bg:`neutral-100/70 dark:neutral-800/50`,"px-2":``,"py-1":``,"backdrop-blur-sm":``,onClick:a[7]||=e=>r.value={group:`Think`,index:0}},un(G(t)(`stage.viewers.debug-menu.emotions-btn.think`)),1)])])])):At(``,!0)]),_:1})])]),_:1}))}}),yb=vb,bb=Object.defineProperty,xb=(e,t,n)=>t in e?bb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sb=(e,t,n)=>xb(e,typeof t==`symbol`?t:t+``,n);function Cb(e){return Lt()?(Xt(e),!0):!1}function wb(e){return typeof e==`function`?e():G(e)}const Tb=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;const Eb=Object.prototype.toString,Db=e=>Eb.call(e)===`[object Object]`,Ob=()=>{};function kb(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 Ab(e,t={}){let n,r,i=Ob,a=e=>{clearTimeout(e),i(),i=Ob};return o=>{let s=wb(e),c=wb(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 jb(...e){let t=0,n,r=!0,i=Ob,a,o,s,c,l;!Vt(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=Ob)};return e=>{let d=wb(o),f=Date.now()-t,p=()=>a=e();return u(),d<=0?(t=Date.now(),p()):(f>d&&(c||!r)?(t=Date.now(),p()):s&&(a=new Promise((e,a)=>{i=l?a:e,n=setTimeout(()=>{t=Date.now(),r=!0,e(p()),u()},Math.max(0,d-f))})),!c&&!n&&(n=setTimeout(()=>r=!0,d)),r=!1,a)}}function Mb(e){return It()}function Nb(e,t=200,n={}){return kb(Ab(t,n),e)}function Pb(e,t=200,n=!1,r=!0,i=!1){return kb(jb(t,n,r,i),e)}function Fb(e,t=!0,n){Mb()?Yt(e,n):t?e():Wt(e)}const Ib=Tb?window:void 0;function Lb(e){var t;let n=wb(e);return(t=n?.$el)??n}function Rb(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=Ib):[t,n,r,i]=e,!t)return Ob;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=K(()=>[Lb(t),wb(i)],([e,t])=>{if(o(),!e)return;let i=Db(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return Cb(l),l}function zb(){let e=W(!1),t=It();return t&&Yt(()=>{e.value=!0},t),e}function Bb(e){let t=zb();return Ot(()=>(t.value,!!e()))}function Vb(e,t={}){let{window:n=Ib}=t,r=Bb(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),i,a=W(!1),o=e=>{a.value=e.matches},s=()=>{i&&(`removeEventListener`in i?i.removeEventListener(`change`,o):i.removeListener(o))},c=jn(()=>{r.value&&(s(),i=n.matchMedia(wb(e)),`addEventListener`in i?i.addEventListener(`change`,o):i.addListener(o),a.value=i.matches)});return Cb(()=>{c(),s(),i=void 0}),a}function Hb(e,t,n={}){let{window:r=Ib,...i}=n,a,o=Bb(()=>r&&`ResizeObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=Ot(()=>{let t=wb(e);return Array.isArray(t)?t.map(e=>Lb(e)):[Lb(t)]}),l=K(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 Cb(u),{isSupported:o,stop:u}}function Ub(e,t={width:0,height:0},n={}){let{window:r=Ib,box:i=`content-box`}=n,a=Ot(()=>{var t,n;return(n=(t=Lb(e))?.namespaceURI)?.includes(`svg`)}),o=W(t.width),s=W(t.height),{stop:c}=Hb(e,([t])=>{let n=i===`border-box`?t.borderBoxSize:i===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(r&&a.value){let t=Lb(e);if(t){let e=t.getBoundingClientRect();o.value=e.width,s.value=e.height}}else if(n){let e=Array.isArray(n)?n:[n];o.value=e.reduce((e,{inlineSize:t})=>e+t,0),s.value=e.reduce((e,{blockSize:t})=>e+t,0)}else o.value=t.contentRect.width,s.value=t.contentRect.height},n);Fb(()=>{let n=Lb(e);n&&(o.value=`offsetWidth`in n?n.offsetWidth:t.width,s.value=`offsetHeight`in n?n.offsetHeight:t.height)});let l=K(()=>Lb(e),e=>{o.value=e?t.width:0,s.value=e?t.height:0});function u(){c(),l()}return{width:o,height:s,stop:u}}const Wb=1;function Gb(e,t={}){let{throttle:n=0,idle:r=200,onStop:i=Ob,onScroll:a=Ob,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0},behavior:c=`auto`,window:l=Ib,onError:u=e=>{console.error(e)}}=t,d=W(0),f=W(0),p=Ot({get(){return d.value},set(e){h(e,void 0)}}),m=Ot({get(){return f.value},set(e){h(void 0,e)}});function h(t,n){var r,i,a,o;if(!l)return;let s=wb(e);if(!s)return;(a=s instanceof Document?l.document.body:s)==null||a.scrollTo({top:(r=wb(n))??m.value,left:(i=wb(t))??p.value,behavior:wb(c)});let u=(o=s?.document)?.documentElement||s?.documentElement||s;p!=null&&(d.value=u.scrollLeft),m!=null&&(f.value=u.scrollTop)}let g=W(!1),_=$t({left:!0,right:!1,top:!0,bottom:!1}),v=$t({left:!1,right:!1,top:!1,bottom:!1}),y=e=>{g.value&&(g.value=!1,v.left=!1,v.right=!1,v.top=!1,v.bottom=!1,i(e))},b=Nb(y,n+r),x=e=>{var t;if(!l)return;let n=(t=e?.document)?.documentElement||e?.documentElement||Lb(e),{display:r,flexDirection:i}=getComputedStyle(n),a=n.scrollLeft;v.left=ad.value;let s=Math.abs(a)<=(o.left||0),c=Math.abs(a)+n.clientWidth>=n.scrollWidth-(o.right||0)-Wb;r===`flex`&&i===`row-reverse`?(_.left=c,_.right=s):(_.left=s,_.right=c),d.value=a;let u=n.scrollTop;e===l.document&&!u&&(u=l.document.body.scrollTop),v.top=uf.value;let p=Math.abs(u)<=(o.top||0),m=Math.abs(u)+n.clientHeight>=n.scrollHeight-(o.bottom||0)-Wb;r===`flex`&&i===`column-reverse`?(_.top=m,_.bottom=p):(_.top=p,_.bottom=m),f.value=u},S=e=>{var t;if(!l)return;let n=(t=e.target.documentElement)??e.target;x(n),g.value=!0,b(e),a(e)};return Rb(e,`scroll`,n?Pb(S,n,!0,!1):S,s),Fb(()=>{try{let t=wb(e);if(!t)return;x(t)}catch(e){u(e)}}),Rb(e,`scrollend`,y,s),{x:p,y:m,isScrolling:g,arrivedState:_,directions:v,measure(){let t=wb(e);l&&t&&x(t)}}}const Kb={ctrl:`control`,command:`meta`,cmd:`meta`,option:`alt`,up:`arrowup`,down:`arrowdown`,left:`arrowleft`,right:`arrowright`};function qb(e={}){let{reactive:t=!1,target:n=Ib,aliasMap:r=Kb,passive:i=!0,onEventFired:a=Ob}=e,o=$t(new Set),s={toJSON(){return{}},current:o},c=t?$t(s):s,l=new Set,u=new Set;function d(e,n){e in c&&(t?c[e]=n:c[e].value=n)}function f(){o.clear();for(let e of u)d(e,!1)}function p(e,t){var n,r;let i=(n=e.key)?.toLowerCase(),a=[(r=e.code)?.toLowerCase(),i].filter(Boolean);i&&(t?o.add(i):o.delete(i));for(let e of a)u.add(e),d(e,t);i===`meta`&&!t?(l.forEach(e=>{o.delete(e),d(e,!1)}),l.clear()):typeof e.getModifierState==`function`&&e.getModifierState(`Meta`)&&t&&[...o,...a].forEach(e=>l.add(e))}Rb(n,`keydown`,e=>(p(e,!0),a(e)),{passive:i}),Rb(n,`keyup`,e=>(p(e,!1),a(e)),{passive:i}),Rb(`blur`,f,{passive:!0}),Rb(`focus`,f,{passive:!0});let m=new Proxy(c,{get(e,n,i){if(typeof n!=`string`)return Reflect.get(e,n,i);if(n=n.toLowerCase(),n in r&&(n=r[n]),!(n in c))if(/[+_-]/.test(n)){let e=n.split(/[+_-]/g).map(e=>e.trim());c[n]=Ot(()=>e.every(e=>wb(m[e])))}else c[n]=W(!1);let a=Reflect.get(e,n,i);return t?wb(a):a}});return m}const Jb={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof Touch?null:[e.movementX,e.movementY]};function Yb(e={}){let{type:t=`page`,touch:n=!0,resetOnTouchEnds:r=!1,initialValue:i={x:0,y:0},window:a=Ib,target:o=a,scroll:s=!0,eventFilter:c}=e,l=null,u=0,d=0,f=W(i.x),p=W(i.y),m=W(null),h=typeof t==`function`?t:Jb[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};Rb(o,[`mousemove`,`dragover`],b,e),n&&t!==`movement`&&(Rb(o,[`touchstart`,`touchmove`],x,e),r&&Rb(o,`touchend`,y,e)),s&&t===`page`&&Rb(a,`scroll`,S,{passive:!0})}return{x:f,y:p,sourceType:m}}function Xb(e={}){let{window:t=Ib,behavior:n=`auto`}=e;if(!t)return{x:W(0),y:W(0)};let r=W(t.scrollX),i=W(t.scrollY),a=Ot({get(){return r.value},set(e){scrollTo({left:e,behavior:n})}}),o=Ot({get(){return i.value},set(e){scrollTo({top:e,behavior:n})}});return Rb(t,`scroll`,()=>{r.value=t.scrollX,i.value=t.scrollY},{capture:!1,passive:!0}),{x:a,y:o}}function Zb(e={}){let{window:t=Ib,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:i=!0,includeScrollbar:a=!0,type:o=`inner`}=e,s=W(n),c=W(r),l=()=>{t&&(o===`outer`?(s.value=t.outerWidth,c.value=t.outerHeight):a?(s.value=t.innerWidth,c.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,c.value=t.document.documentElement.clientHeight))};if(l(),Fb(l),Rb(`resize`,l,{passive:!0}),i){let e=Vb(`(orientation: portrait)`);K(e,()=>l())}return{width:s,height:c}}function Qb(e){let{resolution:t,renderer:n,scene:r,envMap:i,fog:a,near:o,far:s}=e;n??=cn().renderer,r??=cn().scene,jn(()=>{t=mn(e.resolution)??255,o=mn(e.near)??.1,s=mn(e.far)??1e3,i=mn(e.envMap)??void 0,a=mn(e.fog)??void 0,n=mn(e.renderer)??n,r=mn(e.scene)??r});let c=Ot(()=>new gt(mn(t)));c.value.texture.type=te,Cb(()=>{c.value.dispose()});let l=Ot(()=>new _(mn(o),mn(s),mn(c))),u=()=>{let e=mn(r),t=e.fog,o=e.background;e.background=mn(i)||o,e.fog=mn(a)||t,l.value.update(mn(n),e),e.fog=t,e.background=o};return jn(u),{fbo:c,camera:l,update:u}}const $b=[`object`],ex=H({__name:`component`,props:{frames:{default:1/0},resolution:{},near:{},far:{},envMap:{},fog:{},renderer:{},scene:{}},setup(e,{expose:t}){let n=e,r=sn(),{fbo:i,camera:a,update:o}=Qb(n),s=0;return zt().onBeforeRender(()=>{r.value&&(n.frames===1/0||s{`material`in e&&typeof e.material==`object`&&e.material&&`envMap`in e.material&&(e.material.envMap=i.value.texture)}),s++)}),t({instance:r,fbo:i,camera:a,update:o}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`groupRef`,ref:r},[B(`primitive`,{object:G(a)},null,8,$b),nn(e.$slots,`default`)],512))}}),tx=H({__name:`Billboard`,props:{autoUpdate:{type:Boolean,default:!0},lockX:{type:Boolean,default:!1},lockY:{type:Boolean,default:!1},lockZ:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,r=sn(new I),i=sn(new I),a=new Be,o=new k;function s(e){r.value&&(!e&&(e=cn().camera.value,!e)||(i.value.rotation.copy(o),r.value.updateMatrix(),r.value.updateWorldMatrix(!1,!1),r.value.getWorldQuaternion(a),e.getWorldQuaternion(i.value.quaternion).premultiply(a.invert()),n.lockX&&(i.value.rotation.x=o.x),n.lockY&&(i.value.rotation.y=o.y),n.lockZ&&(i.value.rotation.z=o.z)))}return zt().onBeforeRender(({camera:e})=>{n.autoUpdate&&s(e)}),t({instance:r,update:s}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`outerRef`,ref:r},[B(`TresGroup`,{ref_key:`innerRef`,ref:i},[nn(e.$slots,`default`)],512)],512))}}),nx=H({name:`GlobalAudio`,props:[`src`,`loop`,`volume`,`playbackRate`,`playTrigger`,`stopTrigger`],async setup(e,{expose:t,emit:n}){var r;let{camera:s,renderer:c}=Qt(),l=new a;(r=s.value)==null||r.add(l);let u=new i(l),d=new o;t({instance:u}),Zt(()=>{u&&u.disconnect()}),K(()=>[e.playbackRate],()=>u.setPlaybackRate(e.playbackRate??1),{immediate:!0}),K(()=>[e.volume],()=>u.setVolume(e.volume??.5),{immediate:!0}),K(()=>[e.loop],()=>u.setLoop(e.loop??!1),{immediate:!0}),K(()=>[e.src],async()=>{let t=await d.loadAsync(e.src);u.setBuffer(t)},{immediate:!0});let f=document.getElementById(e.playTrigger??``)||c.value.domElement;Rb(f,`click`,()=>{u.isPlaying?u.pause():u.play(),n(`isPlaying`,u.isPlaying)});let p=document.getElementById(e.stopTrigger??``);return p&&Rb(p,`click`,()=>{u.stop(),n(`isPlaying`,u.isPlaying)}),null}}),rx=[`color-space`,`args`,`attach`],ix=H({__name:`GradientTexture`,props:{stops:{},colors:{},attach:{default:`map`},height:{default:1024},width:{default:16},type:{default:`linear`},innerCircleRadius:{default:0},outerCircleRadius:{default:`auto`}},setup(e,{expose:t}){let n=e,r=sn(),i=document.createElement(`canvas`);function a(e){let t=e.getContext(`2d`);e.width=n.width,e.height=n.height;let i;if(n.type===`linear`)i=t.createLinearGradient(0,0,0,n.height);else{let r=e.width/2,a=e.height/2,o=n.outerCircleRadius===`auto`?Math.sqrt(r**2+a**2):Math.abs(Number(n.outerCircleRadius));i=t.createRadialGradient(r,a,Math.abs(n.innerCircleRadius),r,a,o)}let a=new h,o=n.stops.length;for(;o--;)i.addColorStop(n.stops[o],a.set(n.colors[o]).getStyle());t.save(),t.fillStyle=i,t.fillRect(0,0,n.width,n.height),t.restore(),r.value&&(r.value.needsUpdate=!0)}let o=cn().renderer;return K(()=>[n.colors,n.stops,n.height,n.width,n.type,n.innerCircleRadius,n.outerCircleRadius],()=>{a(i)},{immediate:!0}),Bt(n.colors)&&K(n.colors,()=>a(i)),Bt(n.stops)&&K(n.stops,()=>a(i)),t({instance:r}),(e,t)=>(U(),V(`TresCanvasTexture`,{ref_key:`textureRef`,ref:r,"color-space":G(o).outputColorSpace,args:[G(i)],attach:n.attach},null,8,rx))}});function ax(e,t,n,r){let i=class extends Xe{constructor(r={}){let i=Object.entries(e);super({uniforms:i.reduce((e,[t,n])=>{let r=ft.clone({[t]:{value:n}});return{...e,...r}},{}),vertexShader:t,fragmentShader:n}),Sb(this,`key`,``),i.forEach(([e])=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:t=>this.uniforms[e].value=t})),Object.assign(this,r)}};return i.key=_e.generateUUID(),i}const ox=ax({color:new h(`white`),scale:new pt(1,1),imageBounds:new pt(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` + varying vec2 vUv; + varying vec2 vPos; + void main() { + gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.); + vUv = uv; + vPos = position.xy; + } + `,` + // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44 + varying vec2 vUv; + varying vec2 vPos; + uniform vec2 scale; + uniform vec2 imageBounds; + uniform float resolution; + uniform vec3 color; + uniform sampler2D map; + uniform float radius; + uniform float zoom; + uniform float grayscale; + uniform float opacity; + const vec3 luma = vec3(.299, 0.587, 0.114); + vec4 toGrayscale(vec4 color, float intensity) { + return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a); + } + vec2 aspect(vec2 size) { + return size / min(size.x, size.y); + } + + const float PI = 3.14159265; + + // from https://iquilezles.org/articles/distfunctions + float udRoundBox( vec2 p, vec2 b, float r ) { + return length(max(abs(p)-b+r,0.0))-r; + } + + void main() { + vec2 s = aspect(scale); + vec2 i = aspect(imageBounds); + float rs = s.x / s.y; + float ri = i.x / i.y; + vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x); + vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new; + vec2 uv = vUv * s / new + offset; + vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5); + + vec2 res = vec2(scale * resolution); + vec2 halfRes = 0.5 * res; + float b = udRoundBox(vUv.xy * res - halfRes, halfRes, resolution * radius); + vec3 a = mix(vec3(1.0,0.0,0.0), vec3(0.0,0.0,0.0), smoothstep(0.0, 1.0, b)); + gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, opacity * a), grayscale); + + #include + #include + } + `),sx=H({__name:`ImageMaterial`,setup(e,{expose:t}){D({ImageMaterial:ox});let n=sn();return t({instance:n}),(e,t)=>(U(),V(`TresImageMaterial`,{ref_key:`materialRef`,ref:n},null,512))}}),cx=[`scale`],lx=[`args`],ux=H({__name:`component`,props:{segments:{default:1},scale:{default:1},color:{default:()=>new h(`white`)},zoom:{default:1},radius:{default:0},grayscale:{default:0},toneMapped:{type:Boolean,default:!0},transparent:{type:Boolean,default:!1},opacity:{default:1},side:{default:F},texture:{},url:{}},setup(e,{expose:t}){let n=e,r=sn(),i=sn(n.texture??null),a=cn().sizes,o=Ot(()=>Array.isArray(n.scale)?[n.scale[0],n.scale[1]]:[n.scale,n.scale]),s=Ot(()=>{var e,t;return[(e=i.value)?.image.width??0,(t=i.value)?.image.height??0]}),c=Ot(()=>Math.max(a.width.value,a.height.value));jn(()=>{n.texture?i.value=n.texture:Pt([n.url]).then(e=>i.value=e)});let l=Ot(()=>Array.isArray(n.scale)?[...n.scale,1]:n.scale);return t({instance:r}),(e,t)=>(U(),V(`TresMesh`,{ref_key:`imageRef`,ref:r,scale:l.value},[nn(e.$slots,`default`,{},()=>[B(`TresPlaneGeometry`,{args:[1,1,n.segments,n.segments]},null,8,lx)]),Mt(sx,{color:n.color,map:i.value,zoom:n.zoom,grayscale:n.grayscale,opacity:n.opacity,scale:o.value,imageBounds:s.value,resolution:c.value,radius:e.radius,toneMapped:e.toneMapped,transparent:e.transparent,side:e.side},null,8,[`color`,`map`,`zoom`,`grayscale`,`opacity`,`scale`,`imageBounds`,`resolution`,`radius`,`toneMapped`,`transparent`,`side`])],8,cx))}}),dx=parseInt(Ve.replace(/\D+/g,``)),fx=dx>=125?`uv1`:`uv2`;function px(e,t=Math.PI/3){let n=Math.cos(t),r=1.0000000001*100,i=[new z,new z,new z],a=new z,o=new z,s=new z,c=new z;function l(e){let t=~~(e.x*r),n=~~(e.y*r),i=~~(e.z*r);return`${t},${n},${i}`}let u=e.index?e.toNonIndexed():e,f=u.attributes.position,p={};for(let e=0,t=f.count/3;en&&c.add(t)}c.normalize(),h.setXYZ(t+e,c.x,c.y,c.z)}}return u.setAttribute(`normal`,h),u}var mx=Object.defineProperty,hx=(e,t,n)=>t in e?mx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gx=(e,t,n)=>(hx(e,t+``,n),n);async function _x(e){let t=await e.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(t)));return`data:${e.type||``};base64,${n}`}let vx,yx,bx,xx;function Sx(e,t=1/0,n=null){yx||=new Ie(2,2,1,1),bx||=new Xe({uniforms:{blitTexture:new ut(e)},vertexShader:` + varying vec2 vUv; + void main(){ + vUv = uv; + gl_Position = vec4(position.xy * 1.0,0.,.999999); + } + `,fragmentShader:` + uniform sampler2D blitTexture; + varying vec2 vUv; + + void main(){ + gl_FragColor = vec4(vUv.xy, 0, 1); + + #ifdef IS_SRGB + gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) ); + #else + gl_FragColor = texture2D( blitTexture, vUv); + #endif + } + `}),bx.uniforms.blitTexture.value=e,bx.defines.IS_SRGB=`colorSpace`in e?e.colorSpace===`srgb`:e.encoding===3001,bx.needsUpdate=!0,xx||(xx=new be(yx,bx),xx.frustrumCulled=!1);let r=new Pe,i=new Je;i.add(xx),n||=vx=new vt({antialias:!1}),n.setSize(Math.min(e.image.width,t),Math.min(e.image.height,t)),n.clear(),n.render(i,r);let a=new ot(n.domElement);return a.minFilter=e.minFilter,a.magFilter=e.magFilter,a.wrapS=e.wrapS,a.wrapT=e.wrapT,a.name=e.name,vx&&(vx.dispose(),vx=null),a}const Cx={POSITION:[`byte`,`byte normalized`,`unsigned byte`,`unsigned byte normalized`,`short`,`short normalized`,`unsigned short`,`unsigned short normalized`],NORMAL:[`byte normalized`,`short normalized`],TANGENT:[`byte normalized`,`short normalized`],TEXCOORD:[`byte`,`byte normalized`,`unsigned byte`,`short`,`short normalized`,`unsigned short`]};var wx=class{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Gx(e)}),this.register(function(e){return new Kx(e)}),this.register(function(e){return new Yx(e)}),this.register(function(e){return new Xx(e)}),this.register(function(e){return new Zx(e)}),this.register(function(e){return new Qx(e)}),this.register(function(e){return new qx(e)}),this.register(function(e){return new Jx(e)}),this.register(function(e){return new $x(e)}),this.register(function(e){return new eS(e)}),this.register(function(e){return new tS(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i=new Wx,a=[];for(let e=0,t=this.pluginCallbacks.length;ee.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<.001)return e.times.length-1;r[r.length-1]=t,r.set(e.times,0),i.set(e.values,0),i.set(a.evaluate(t),e.values.length),o=r.length-1}else for(let s=0;st){r.set(e.times.slice(0,s+1),0),r[s+1]=t,r.set(e.times.slice(s+1),s+2),i.set(e.values.slice(0,(s+1)*n),0),i.set(a.evaluate(t),(s+1)*n),i.set(e.values.slice((s+1)*n),(s+2)*n),o=s+1;break}}return e.times=r,e.values=i,o},mergeMorphTargetTracks:function(e,t){let n=[],r={},i=e.tracks;for(let e=0;e4?n=e.array[i*e.itemSize+t]:(t===0?n=e.getX(i):t===1?n=e.getY(i):t===2?n=e.getZ(i):t===3&&(n=e.getW(i)),e.normalized===!0&&(n=_e.normalize(n,e.array))),r.min[t]=Math.min(r.min[t],n),r.max[t]=Math.max(r.max[t],n)}return r}function Bx(e){return Math.ceil(e/4)*4}function Vx(e,t=0){let n=Bx(e.byteLength);if(n!==e.byteLength){let r=new Uint8Array(n);if(r.set(new Uint8Array(e)),t!==0)for(let i=e.byteLength;i`u`&&typeof OffscreenCanvas<`u`?new OffscreenCanvas(1,1):document.createElement(`canvas`)}function Ux(e,t){if(e.toBlob!==void 0)return new Promise(n=>e.toBlob(n,t));let n;return t===`image/jpeg`?n=.92:t===`image/webp`&&(n=.8),e.convertToBlob({type:t,quality:n})}var Wx=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:`2.0`,generator:`THREE.GLTFExporter`}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let r=this,i=r.buffers,a=r.json;n=r.options;let o=r.extensionsUsed,s=r.extensionsRequired,c=new Blob(i,{type:`application/octet-stream`}),l=Object.keys(o),u=Object.keys(s);l.length>0&&(a.extensionsUsed=l),u.length>0&&(a.extensionsRequired=u),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=c.size),n.binary===!0?c.arrayBuffer().then(e=>{let n=Vx(e),r=new DataView(new ArrayBuffer(Nx));r.setUint32(0,n.byteLength,!0),r.setUint32(4,Fx,!0);let i=Vx(Lx(JSON.stringify(a)),32),o=new DataView(new ArrayBuffer(Nx));o.setUint32(0,i.byteLength,!0),o.setUint32(4,Px,!0);let s=new ArrayBuffer(Ax),c=new DataView(s);c.setUint32(0,jx,!0),c.setUint32(4,Mx,!0);let l=Ax+o.byteLength+i.byteLength+r.byteLength+n.byteLength;c.setUint32(8,l,!0),new Blob([s,o,i,r,n],{type:`application/octet-stream`}).arrayBuffer().then(t)}):a.buffers&&a.buffers.length>0?_x(c).then(e=>{a.buffers[0].uri=e,t(a)}):t(a)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,r=this.extensionsUsed;try{let i=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){for(let e in t.extensions===void 0&&(t.extensions={}),i.gltfExtensions)t.extensions[e]=i.gltfExtensions[e],r[e]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(t){console.warn(`THREE.GLTFExporter: userData of '`+e.name+`' won't be serialized because of JSON.stringify error - `+t.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let t=new z;for(let n=0,r=e.count;n5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),r=new z;for(let e=0,t=n.count;e4?r=e.array[i*e.itemSize+n]:(n===0?r=e.getX(i):n===1?r=e.getY(i):n===2?r=e.getZ(i):n===3&&(r=e.getW(i)),e.normalized===!0&&(r=_e.normalize(r,e.array))),t===Tx.FLOAT?c.setFloat32(l,r,!0):t===Tx.INT?c.setInt32(l,r,!0):t===Tx.UNSIGNED_INT?c.setUint32(l,r,!0):t===Tx.SHORT?c.setInt16(l,r,!0):t===Tx.UNSIGNED_SHORT?c.setUint16(l,r,!0):t===Tx.BYTE?c.setInt8(l,r):t===Tx.UNSIGNED_BYTE&&c.setUint8(l,r),l+=o}let u={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:s};return i!==void 0&&(u.target=i),i===Tx.ARRAY_BUFFER&&(u.byteStride=e.itemSize*o),this.byteOffset+=s,a.bufferViews.push(u),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||=[],e.arrayBuffer().then(e=>{let r=Vx(e),i={buffer:t.processBuffer(r),byteOffset:t.byteOffset,byteLength:r.byteLength};return t.byteOffset+=r.byteLength,n.bufferViews.push(i)-1})}processAccessor(e,t,n,r){let i=this.json,a={1:`SCALAR`,2:`VEC2`,3:`VEC3`,4:`VEC4`,9:`MAT3`,16:`MAT4`},o;if(e.array.constructor===Float32Array)o=Tx.FLOAT;else if(e.array.constructor===Int32Array)o=Tx.INT;else if(e.array.constructor===Uint32Array)o=Tx.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=Tx.SHORT;else if(e.array.constructor===Uint16Array)o=Tx.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=Tx.BYTE;else if(e.array.constructor===Uint8Array)o=Tx.UNSIGNED_BYTE;else throw Error(`THREE.GLTFExporter: Unsupported bufferAttribute component type: `+e.array.constructor.name);if(n===void 0&&(n=0),r===void 0&&(r=e.count),r===0)return null;let s=zx(e,n,r),c;t!==void 0&&(c=e===t.index?Tx.ELEMENT_ARRAY_BUFFER:Tx.ARRAY_BUFFER);let l=this.processBufferView(e,o,n,r,c),u={bufferView:l.id,byteOffset:l.byteOffset,componentType:o,count:r,max:s.max,min:s.min,type:a[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),i.accessors||=[],i.accessors.push(u)-1}processImage(e,t,n,r=`image/png`){if(e!==null){let i=this,a=i.cache,o=i.json,s=i.options,c=i.pending;a.images.has(e)||a.images.set(e,{});let l=a.images.get(e),u=r+`:flipY/`+n.toString();if(l[u]!==void 0)return l[u];o.images||=[];let d={mimeType:r},f=Hx();f.width=Math.min(e.width,s.maxTextureSize),f.height=Math.min(e.height,s.maxTextureSize);let p=f.getContext(`2d`);if(n===!0&&(p.translate(0,f.height),p.scale(1,-1)),e.data!==void 0){t!==He&&console.error(`GLTFExporter: Only RGBAFormat is supported.`,t),(e.width>s.maxTextureSize||e.height>s.maxTextureSize)&&console.warn(`GLTFExporter: Image size is bigger than maxTextureSize`,e);let n=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;ti.processBufferViewImage(e)).then(e=>{d.bufferView=e})):f.toDataURL===void 0?c.push(Ux(f,r).then(_x).then(e=>{d.uri=e})):d.uri=f.toDataURL(r);let m=o.images.push(d)-1;return l[u]=m,m}else throw Error(`THREE.GLTFExporter: No valid image data found. Unable to process texture.`)}processSampler(e){let t=this.json;t.samplers||=[];let n={magFilter:Dx[e.magFilter],minFilter:Dx[e.minFilter],wrapS:Dx[e.wrapS],wrapT:Dx[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){let t=this.options,n=this.cache,r=this.json;if(n.textures.has(e))return n.textures.get(e);r.textures||=[],e instanceof g&&(e=Sx(e,t.maxTextureSize));let i=e.userData.mimeType;i===`image/webp`&&(i=`image/png`);let a={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,i)};e.name&&(a.name=e.name),this._invokeAll(function(t){t.writeTexture&&t.writeTexture(e,a)});let o=r.textures.push(a)-1;return n.textures.set(e,o),o}processMaterial(e){let t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn(`GLTFExporter: THREE.ShaderMaterial not supported.`),null;n.materials||=[];let r={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn(`GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.`);let i=e.color.toArray().concat([e.opacity]);if(Ix(i,[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(r.pbrMetallicRoughness.metallicFactor=e.metalness,r.pbrMetallicRoughness.roughnessFactor=e.roughness):(r.pbrMetallicRoughness.metallicFactor=.5,r.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),n={index:this.processTexture(t),channel:t.channel};this.applyTextureTransform(n,t),r.pbrMetallicRoughness.metallicRoughnessTexture=n}if(e.map){let t={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),r.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(r.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let t={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),r.emissiveTexture=t}}if(e.normalMap){let t={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),r.normalTexture=t}if(e.aoMap){let t={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),r.occlusionTexture=t}e.transparent?r.alphaMode=`BLEND`:e.alphaTest>0&&(r.alphaMode=`MASK`,r.alphaCutoff=e.alphaTest),e.side===T&&(r.doubleSided=!0),e.name!==``&&(r.name=e.name),this.serializeUserData(e,r),this._invokeAll(function(t){t.writeMaterial&&t.writeMaterial(e,r)});let a=n.materials.push(r)-1;return t.materials.set(e,a),a}processMesh(e){let t=this.cache,n=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,n=e.material.length;t=152?{uv:`TEXCOORD_0`,uv1:`TEXCOORD_1`,uv2:`TEXCOORD_2`,uv3:`TEXCOORD_3`}:{uv:`TEXCOORD_0`,uv2:`TEXCOORD_1`},color:`COLOR_0`,skinWeight:`WEIGHTS_0`,skinIndex:`JOINTS_0`},p=a.getAttribute(`normal`);p!==void 0&&!this.isNormalizedNormalAttribute(p)&&(console.warn(`THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one.`),a.setAttribute(`normal`,this.createNormalizedNormalAttribute(p)));let m=null;for(let e in a.attributes){if(e.slice(0,5)===`morph`)continue;let n=a.attributes[e];if(e=f[e]||e.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e=`_`+e),t.attributes.has(this.getUID(n))){c[e]=t.attributes.get(this.getUID(n));continue}m=null;let r=n.array;e===`JOINTS_0`&&!(r instanceof Uint16Array)&&!(r instanceof Uint8Array)&&(console.warn(`GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.`),m=new d(new Uint16Array(r),n.itemSize,n.normalized));let i=this.processAccessor(m||n,a);i!==null&&(e.startsWith(`_`)||this.detectMeshQuantization(e,n),c[e]=i,t.attributes.set(this.getUID(n),i))}if(p!==void 0&&a.setAttribute(`normal`,p),Object.keys(c).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let n=[],r=[],i={};if(e.morphTargetDictionary!==void 0)for(let t in e.morphTargetDictionary)i[e.morphTargetDictionary[t]]=t;for(let o=0;o0&&(s.extras={},s.extras.targetNames=r)}let h=Array.isArray(e.material);if(h&&a.groups.length===0)return null;let g=h?e.material:[e.material],_=h?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,n=_.length;e0&&(n.targets=u),a.index!==null){let r=this.getUID(a.index);(_[e].start!==void 0||_[e].count!==void 0)&&(r+=`:`+_[e].start+`:`+_[e].count),t.attributes.has(r)?n.indices=t.attributes.get(r):(n.indices=this.processAccessor(a.index,a,_[e].start,_[e].count),t.attributes.set(r,n.indices)),n.indices===null&&delete n.indices}let r=this.processMaterial(g[_[e].materialIndex]);r!==null&&(n.material=r),l.push(n)}s.primitives=l,n.meshes||=[],this._invokeAll(function(t){t.writeMesh&&t.writeMesh(e,s)});let v=n.meshes.push(s)-1;return t.meshes.set(i,v),v}detectMeshQuantization(e,t){if(this.extensionsUsed[Ex])return;let n;switch(t.array.constructor){case Int8Array:n=`byte`;break;case Uint8Array:n=`unsigned byte`;break;case Int16Array:n=`short`;break;case Uint16Array:n=`unsigned short`;break;default:return}t.normalized&&(n+=` normalized`);let r=e.split(`_`,1)[0];Cx[r]&&Cx[r].includes(n)&&(this.extensionsUsed[Ex]=!0,this.extensionsRequired[Ex]=!0)}processCamera(e){let t=this.json;t.cameras||=[];let n=e.isOrthographicCamera,r={type:n?`orthographic`:`perspective`};return n?r.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:_e.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==``&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){let n=this.json,r=this.nodeMap;n.animations||=[],e=wx.Utils.mergeMorphTargetTracks(e.clone(),t);let i=e.tracks,a=[],o=[];for(let e=0;e0){let t=[];for(let r=0,i=e.children.length;r0&&(i.children=t)}this._invokeAll(function(t){t.writeNode&&t.writeNode(e,i)});let a=t.nodes.push(i)-1;return r.set(e,a),a}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let r={};e.name!==``&&(r.name=e.name),t.scenes.push(r);let i=[];for(let t=0,r=e.children.length;t0&&(r.nodes=i),this.serializeUserData(e,r)}processObjects(e){let t=new Je;t.name=`AuxScene`;for(let n=0;n0&&this.processObjects(n);for(let e=0;e0&&(a.range=e.distance)):e.isSpotLight&&(a.type=`spot`,e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,a.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn(`THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2.`),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn(`THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1.`),i[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},i[this.name]=!0);let o=r.extensions[this.name].lights;o.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:o.length-1}}};let Kx=class{constructor(e){this.writer=e,this.name=`KHR_materials_unlit`}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},qx=class{constructor(e){this.writer=e,this.name=`KHR_materials_clearcoat`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:n.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(t,e.clearcoatMap),i.clearcoatTexture=t}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:n.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(t,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:n.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};n.applyTextureTransform(t,e.clearcoatNormalMap),i.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Jx=class{constructor(e){this.writer=e,this.name=`KHR_materials_iridescence`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:n.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(t,e.iridescenceMap),i.iridescenceTexture=t}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:n.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(t,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Yx=class{constructor(e){this.writer=e,this.name=`KHR_materials_transmission`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){let t={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(t,e.transmissionMap),i.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Xx=class{constructor(e){this.writer=e,this.name=`KHR_materials_volume`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){let t={index:n.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(t,e.thicknessMap),i.thicknessTexture=t}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Zx=class{constructor(e){this.writer=e,this.name=`KHR_materials_ior`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let n=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}},Qx=class{constructor(e){this.writer=e,this.name=`KHR_materials_specular`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(kx)&&!e.specularIntensityMap&&!e.specularColorTexture)return;let n=this.writer,r=n.extensionsUsed,i={};if(e.specularIntensityMap){let t={index:n.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(t,e.specularIntensityMap),i.specularTexture=t}if(e.specularColorMap){let t={index:n.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(t,e.specularColorMap),i.specularColorTexture=t}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},$x=class{constructor(e){this.writer=e,this.name=`KHR_materials_sheen`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,r=n.extensionsUsed,i={};if(e.sheenRoughnessMap){let t={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(t,e.sheenRoughnessMap),i.sheenRoughnessTexture=t}if(e.sheenColorMap){let t={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(t,e.sheenColorMap),i.sheenColorTexture=t}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},eS=class{constructor(e){this.writer=e,this.name=`KHR_materials_anisotropy`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let n=this.writer,r=n.extensionsUsed,i={};if(e.anisotropyMap){let t={index:n.processTexture(e.anisotropyMap)};n.applyTextureTransform(t,e.anisotropyMap),i.anisotropyTexture=t}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},tS=class{constructor(e){this.writer=e,this.name=`KHR_materials_emissive_strength`}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let n=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}};var nS=Uint8Array,rS=Uint16Array,iS=Uint32Array,aS=new nS([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),oS=new nS([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),sS=new nS([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cS=function(e,t){for(var n=new rS(31),r=0;r<31;++r)n[r]=t+=1<>>1|(hS&21845)<<1;gS=(gS&52428)>>>2|(gS&13107)<<2,gS=(gS&61680)>>>4|(gS&3855)<<4,mS[hS]=((gS&65280)>>>8|(gS&255)<<8)>>>1}for(var _S=function(e,t,n){for(var r=e.length,i=0,a=new rS(t);i>>c]=l}else for(s=new rS(r),i=0;i>>15-e[i]);return s},vS=new nS(288),hS=0;hS<144;++hS)vS[hS]=8;for(var hS=144;hS<256;++hS)vS[hS]=9;for(var hS=256;hS<280;++hS)vS[hS]=7;for(var hS=280;hS<288;++hS)vS[hS]=8;for(var yS=new nS(32),hS=0;hS<32;++hS)yS[hS]=5;var bS=_S(vS,9,1),xS=_S(yS,5,1),SS=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},CS=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},wS=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},TS=function(e){return(e/8|0)+(e&7&&1)},ES=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof rS?rS:e instanceof iS?iS:nS)(n-t);return r.set(e.subarray(t,n)),r},DS=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new nS(0);var i=!t||n,a=!n||n.i;n||={},t||=new nS(r*3);var o=function(e){var n=t.length;if(e>n){var r=new nS(Math.max(n*2,e));r.set(t),t=r}},s=n.f||0,c=n.p||0,l=n.b||0,u=n.l,d=n.d,f=n.m,p=n.n,m=r*8;do{if(!u){n.f=s=CS(e,c,1);var h=CS(e,c+1,3);if(c+=3,h)if(h==1)u=bS,d=xS,f=9,p=5;else if(h==2){var g=CS(e,c,31)+257,_=CS(e,c+10,15)+4,v=g+CS(e,c+5,31)+1;c+=14;for(var y=new nS(v),b=new nS(19),x=0;x<_;++x)b[sS[x]]=CS(e,c+x*3,7);c+=_*3;for(var S=SS(b),C=(1<>>4;if(E<16)y[x++]=E;else{var D=0,O=0;for(E==16?(O=3+CS(e,c,3),c+=2,D=y[x-1]):E==17?(O=3+CS(e,c,7),c+=3):E==18&&(O=11+CS(e,c,127),c+=7);O--;)y[x++]=D}}var k=y.subarray(0,g),A=y.subarray(g);f=SS(k),p=SS(A),u=_S(k,f,1),d=_S(A,p,1)}else throw`invalid block type`;else{var E=TS(c)+4,j=e[E-4]|e[E-3]<<8,M=E+j;if(M>r){if(a)throw`unexpected EOF`;break}i&&o(l+j),t.set(e.subarray(E,M),l),n.b=l+=j,n.p=c=M*8;continue}if(c>m){if(a)throw`unexpected EOF`;break}}i&&o(l+131072);for(var N=(1<>>4;if(c+=D&15,c>m){if(a)throw`unexpected EOF`;break}if(!D)throw`invalid length/literal`;if(F<256)t[l++]=F;else if(F==256){P=c,u=null;break}else{var I=F-254;if(F>264){var x=F-257,te=aS[x];I=CS(e,c,(1<>>4;if(!ne)throw`invalid distance`;c+=ne&15;var A=pS[L];if(L>3){var te=oS[L];A+=wS(e,c)&(1<m){if(a)throw`unexpected EOF`;break}i&&o(l+131072);for(var re=l+I;l>>4>7||(e[0]<<8|e[1])%31)throw`invalid zlib data`;if(e[1]&32)throw`invalid zlib data: preset dictionaries not supported`},AS=typeof TextDecoder<`u`&&new TextDecoder,jS=0;try{AS.decode(OS,{stream:!0}),jS=1}catch{}var MS=Object.defineProperty,NS=(e,t,n)=>t in e?MS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PS=(e,t,n)=>(NS(e,t+``,n),n);const FS=class extends be{constructor(e,t={}){super(e),this.isReflector=!0,this.type=`Reflector`,this.camera=new Pe;let n=this,r=t.color===void 0?new h(8355711):new h(t.color),i=t.textureWidth||512,a=t.textureHeight||512,o=t.clipBias||0,s=t.shader||FS.ReflectorShader,c=t.multisample===void 0?4:t.multisample,l=new Fe,u=new z,d=new z,f=new z,p=new ye,m=new z(0,0,-1),g=new mt,_=new z,v=new z,y=new mt,b=new ye,x=this.camera,S=new _t(i,a,{samples:c,type:te}),C=new Xe({uniforms:ft.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});C.uniforms.tDiffuse.value=S.texture,C.uniforms.color.value=r,C.uniforms.textureMatrix.value=b,this.material=C,this.onBeforeRender=function(e,t,r){if(d.setFromMatrixPosition(n.matrixWorld),f.setFromMatrixPosition(r.matrixWorld),p.extractRotation(n.matrixWorld),u.set(0,0,1),u.applyMatrix4(p),_.subVectors(d,f),_.dot(u)>0)return;_.reflect(u).negate(),_.add(d),p.extractRotation(r.matrixWorld),m.set(0,0,-1),m.applyMatrix4(p),m.add(f),v.subVectors(d,m),v.reflect(u).negate(),v.add(d),x.position.copy(_),x.up.set(0,1,0),x.up.applyMatrix4(p),x.up.reflect(u),x.lookAt(v),x.far=r.far,x.updateMatrixWorld(),x.projectionMatrix.copy(r.projectionMatrix),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(x.projectionMatrix),b.multiply(x.matrixWorldInverse),b.multiply(n.matrixWorld),l.setFromNormalAndCoplanarPoint(u,d),l.applyMatrix4(x.matrixWorldInverse),g.set(l.normal.x,l.normal.y,l.normal.z,l.constant);let i=x.projectionMatrix;y.x=(Math.sign(g.x)+i.elements[8])/i.elements[0],y.y=(Math.sign(g.y)+i.elements[9])/i.elements[5],y.z=-1,y.w=(1+i.elements[10])/i.elements[14],g.multiplyScalar(2/g.dot(y)),i.elements[2]=g.x,i.elements[6]=g.y,i.elements[10]=g.z+1-o,i.elements[14]=g.w,n.visible=!1;let a=e.getRenderTarget(),s=e.xr.enabled,c=e.shadowMap.autoUpdate,h=e.toneMapping,C=!1;C=`outputColorSpace`in e?e.outputColorSpace===`srgb`:e.outputEncoding===3001,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,`outputColorSpace`in e?e.outputColorSpace=`srgb-linear`:e.outputEncoding=3e3,e.toneMapping=ke,e.setRenderTarget(S),e.state.buffers.depth.setMask(!0),e.autoClear===!1&&e.clear(),e.render(t,x),e.xr.enabled=s,e.shadowMap.autoUpdate=c,e.toneMapping=h,`outputColorSpace`in e?e.outputColorSpace=C?`srgb`:`srgb-linear`:e.outputEncoding=C?3001:3e3,e.setRenderTarget(a);let w=r.viewport;w!==void 0&&e.state.viewport(w),n.visible=!0},this.getRenderTarget=function(){return S},this.dispose=function(){S.dispose(),n.material.dispose()}}};let IS=FS;PS(IS,`ReflectorShader`,{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` + uniform mat4 textureMatrix; + varying vec4 vUv; + + #include + #include + + void main() { + + vUv = textureMatrix * vec4( position, 1.0 ); + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + #include + + }`,fragmentShader:` + uniform vec3 color; + uniform sampler2D tDiffuse; + varying vec4 vUv; + + #include + + float blendOverlay( float base, float blend ) { + + return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) ); + + } + + vec3 blendOverlay( vec3 base, vec3 blend ) { + + return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) ); + + } + + void main() { + + #include + + vec4 base = texture2DProj( tDiffuse, vUv ); + gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 ); + + #include + #include <${dx>=154?`colorspace_fragment`:`encodings_fragment`}> + + }`});var LS=Object.defineProperty,RS=(e,t,n)=>t in e?LS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zS=(e,t,n)=>(RS(e,typeof t==`symbol`?t:t+``,n),n);const BS=new f,VS=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),HS=new R(VS,5);BS.setIndex([0,1,2,0,2,3]),BS.setAttribute(`position`,new ie(HS,3,0,!1)),BS.setAttribute(`uv`,new ie(HS,2,3,!1));const US=class extends be{constructor(){super(US.Geometry,new xe({opacity:0,transparent:!0})),this.isLensflare=!0,this.type=`Lensflare`,this.frustumCulled=!1,this.renderOrder=1/0;let e=new z,n=new z,r=new x(new Uint8Array(16*16*3),16,16,He);r.minFilter=Ee,r.magFilter=Ee,r.wrapS=m,r.wrapT=m;let i=new x(new Uint8Array(16*16*3),16,16,He);i.minFilter=Ee,i.magFilter=Ee,i.wrapS=m,i.wrapT=m;let a=US.Geometry,o=new Ue({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` + + precision highp float; + + uniform vec3 screenPosition; + uniform vec2 scale; + + attribute vec3 position; + + void main() { + + gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); + + }`,fragmentShader:` + + precision highp float; + + void main() { + + gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); + + }`,depthTest:!0,depthWrite:!1,transparent:!1}),s=new Ue({uniforms:{map:{value:r},scale:{value:null},screenPosition:{value:null}},vertexShader:` + + precision highp float; + + uniform vec3 screenPosition; + uniform vec2 scale; + + attribute vec3 position; + attribute vec2 uv; + + varying vec2 vUV; + + void main() { + + vUV = uv; + + gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); + + }`,fragmentShader:` + + precision highp float; + + uniform sampler2D map; + + varying vec2 vUV; + + void main() { + + gl_FragColor = texture2D( map, vUV ); + + }`,depthTest:!1,depthWrite:!1,transparent:!1}),l=new be(a,o),u=[],d=GS.Shader,f=new Ue({uniforms:{map:{value:null},occlusionMap:{value:i},color:{value:new h(16777215)},scale:{value:new pt},screenPosition:{value:new z}},vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:t,transparent:!0,depthWrite:!1}),p=new be(a,f);this.addElement=function(e){u.push(e)};let g=new pt,_=new pt,v=new c,y=new mt;this.onBeforeRender=function(t,c,d){t.getCurrentViewport(y);let m=y.w/y.z,h=y.z/2,b=y.w/2,x=16/y.w;if(g.set(x*m,x),v.min.set(y.x,y.y),v.max.set(y.x+(y.z-16),y.y+(y.w-16)),n.setFromMatrixPosition(this.matrixWorld),n.applyMatrix4(d.matrixWorldInverse),!(n.z>0)&&(e.copy(n).applyMatrix4(d.projectionMatrix),_.x=y.x+e.x*h+h-8,_.y=y.y+e.y*b+b-8,v.containsPoint(_))){t.copyFramebufferToTexture(_,r);let n=o.uniforms;n.scale.value=g,n.screenPosition.value=e,t.renderBufferDirect(d,null,a,o,l,null),t.copyFramebufferToTexture(_,i),n=s.uniforms,n.scale.value=g,n.screenPosition.value=e,t.renderBufferDirect(d,null,a,s,l,null);let c=-e.x*2,m=-e.y*2;for(let n=0,r=u.length;n + #include + #include + #include + + void main() { + mirrorCoord = modelMatrix * vec4( position, 1.0 ); + worldPosition = mirrorCoord.xyzw; + mirrorCoord = textureMatrix * mirrorCoord; + vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); + gl_Position = projectionMatrix * mvPosition; + + #include + #include + #include + #include + #include + }`,fragmentShader:` + uniform sampler2D mirrorSampler; + uniform float alpha; + uniform float time; + uniform float size; + uniform float distortionScale; + uniform sampler2D normalSampler; + uniform vec3 sunColor; + uniform vec3 sunDirection; + uniform vec3 eye; + uniform vec3 waterColor; + + varying vec4 mirrorCoord; + varying vec4 worldPosition; + + vec4 getNoise( vec2 uv ) { + vec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0); + vec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 ); + vec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 ); + vec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 ); + vec4 noise = texture2D( normalSampler, uv0 ) + + texture2D( normalSampler, uv1 ) + + texture2D( normalSampler, uv2 ) + + texture2D( normalSampler, uv3 ); + return noise * 0.5 - 1.0; + } + + void sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor ) { + vec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) ); + float direction = max( 0.0, dot( eyeDirection, reflection ) ); + specularColor += pow( direction, shiny ) * sunColor * spec; + diffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse; + } + + #include + #include + #include + #include + #include + #include + #include + #include + + void main() { + + #include + vec4 noise = getNoise( worldPosition.xz * size ); + vec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) ); + + vec3 diffuseLight = vec3(0.0); + vec3 specularLight = vec3(0.0); + + vec3 worldToEye = eye-worldPosition.xyz; + vec3 eyeDirection = normalize( worldToEye ); + sunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight ); + + float distance = length(worldToEye); + + vec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale; + vec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) ); + + float theta = max( dot( eyeDirection, surfaceNormal ), 0.0 ); + float rf0 = 0.3; + float reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 ); + vec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor; + vec3 albedo = mix( ( sunColor * diffuseLight * 0.3 + scatter ) * getShadowMask(), ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance); + vec3 outgoingLight = albedo; + gl_FragColor = vec4( outgoingLight, alpha ); + + #include + #include <${parseInt(Ve.replace(/\D+/g,``))>=154?`colorspace_fragment`:`encodings_fragment`}> + #include + }`},j=new Xe({fragmentShader:A.fragmentShader,vertexShader:A.vertexShader,uniforms:ft.clone(A.uniforms),lights:!0,side:m,fog:g});j.uniforms.mirrorSampler.value=k.texture,j.uniforms.textureMatrix.value=D,j.uniforms.alpha.value=o,j.uniforms.time.value=s,j.uniforms.normalSampler.value=c,j.uniforms.sunColor.value=u,j.uniforms.waterColor.value=d,j.uniforms.sunDirection.value=l,j.uniforms.distortionScale.value=p,j.uniforms.eye.value=f,n.material=j,n.onBeforeRender=function(e,t,r){if(y.setFromMatrixPosition(n.matrixWorld),b.setFromMatrixPosition(r.matrixWorld),x.extractRotation(n.matrixWorld),v.set(0,0,1),v.applyMatrix4(x),w.subVectors(y,b),w.dot(v)>0)return;w.reflect(v).negate(),w.add(y),x.extractRotation(r.matrixWorld),S.set(0,0,-1),S.applyMatrix4(x),S.add(b),T.subVectors(y,S),T.reflect(v).negate(),T.add(y),O.position.copy(w),O.up.set(0,1,0),O.up.applyMatrix4(x),O.up.reflect(v),O.lookAt(T),O.far=r.far,O.updateMatrixWorld(),O.projectionMatrix.copy(r.projectionMatrix),D.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),D.multiply(O.projectionMatrix),D.multiply(O.matrixWorldInverse),_.setFromNormalAndCoplanarPoint(v,y),_.applyMatrix4(O.matrixWorldInverse),C.set(_.normal.x,_.normal.y,_.normal.z,_.constant);let i=O.projectionMatrix;E.x=(Math.sign(C.x)+i.elements[8])/i.elements[0],E.y=(Math.sign(C.y)+i.elements[9])/i.elements[5],E.z=-1,E.w=(1+i.elements[10])/i.elements[14],C.multiplyScalar(2/C.dot(E)),i.elements[2]=C.x,i.elements[6]=C.y,i.elements[10]=C.z+1-a,i.elements[14]=C.w,f.setFromMatrixPosition(r.matrixWorld);let o=e.getRenderTarget(),s=e.xr.enabled,c=e.shadowMap.autoUpdate;n.visible=!1,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(k),e.state.buffers.depth.setMask(!0),e.autoClear===!1&&e.clear(),e.render(t,O),n.visible=!0,e.xr.enabled=s,e.shadowMap.autoUpdate=c,e.setRenderTarget(o);let l=r.viewport;l!==void 0&&e.state.viewport(l)}}},qS=Object.defineProperty,JS=(e,t,n)=>t in e?qS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YS=(e,t,n)=>(JS(e,typeof t==`symbol`?t:t+``,n),n);const XS={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new z},up:{value:new z(0,1,0)}},vertexShader:` + uniform vec3 sunPosition; + uniform float rayleigh; + uniform float turbidity; + uniform float mieCoefficient; + uniform vec3 up; + + varying vec3 vWorldPosition; + varying vec3 vSunDirection; + varying float vSunfade; + varying vec3 vBetaR; + varying vec3 vBetaM; + varying float vSunE; + + // constants for atmospheric scattering + const float e = 2.71828182845904523536028747135266249775724709369995957; + const float pi = 3.141592653589793238462643383279502884197169; + + // wavelength of used primaries, according to preetham + const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 ); + // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function: + // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) + const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 ); + + // mie stuff + // K coefficient for the primaries + const float v = 4.0; + const vec3 K = vec3( 0.686, 0.678, 0.666 ); + // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K + const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 ); + + // earth shadow hack + // cutoffAngle = pi / 1.95; + const float cutoffAngle = 1.6110731556870734; + const float steepness = 1.5; + const float EE = 1000.0; + + float sunIntensity( float zenithAngleCos ) { + zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 ); + return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) ); + } + + vec3 totalMie( float T ) { + float c = ( 0.2 * T ) * 10E-18; + return 0.434 * c * MieConst; + } + + void main() { + + vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); + vWorldPosition = worldPosition.xyz; + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + gl_Position.z = gl_Position.w; // set z to camera.far + + vSunDirection = normalize( sunPosition ); + + vSunE = sunIntensity( dot( vSunDirection, up ) ); + + vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 ); + + float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) ); + + // extinction (absorbtion + out scattering) + // rayleigh coefficients + vBetaR = totalRayleigh * rayleighCoefficient; + + // mie coefficients + vBetaM = totalMie( turbidity ) * mieCoefficient; + + } + `,fragmentShader:` + varying vec3 vWorldPosition; + varying vec3 vSunDirection; + varying float vSunfade; + varying vec3 vBetaR; + varying vec3 vBetaM; + varying float vSunE; + + uniform float mieDirectionalG; + uniform vec3 up; + + const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 ); + + // constants for atmospheric scattering + const float pi = 3.141592653589793238462643383279502884197169; + + const float n = 1.0003; // refractive index of air + const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius) + + // optical length at zenith for molecules + const float rayleighZenithLength = 8.4E3; + const float mieZenithLength = 1.25E3; + // 66 arc seconds -> degrees, and the cosine of that + const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324; + + // 3.0 / ( 16.0 * pi ) + const float THREE_OVER_SIXTEENPI = 0.05968310365946075; + // 1.0 / ( 4.0 * pi ) + const float ONE_OVER_FOURPI = 0.07957747154594767; + + float rayleighPhase( float cosTheta ) { + return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) ); + } + + float hgPhase( float cosTheta, float g ) { + float g2 = pow( g, 2.0 ); + float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 ); + return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse ); + } + + void main() { + + vec3 direction = normalize( vWorldPosition - cameraPos ); + + // optical length + // cutoff angle at 90 to avoid singularity in next formula. + float zenithAngle = acos( max( 0.0, dot( up, direction ) ) ); + float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) ); + float sR = rayleighZenithLength * inverse; + float sM = mieZenithLength * inverse; + + // combined extinction factor + vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) ); + + // in scattering + float cosTheta = dot( direction, vSunDirection ); + + float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 ); + vec3 betaRTheta = vBetaR * rPhase; + + float mPhase = hgPhase( cosTheta, mieDirectionalG ); + vec3 betaMTheta = vBetaM * mPhase; + + vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) ); + Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) ); + + // nightsky + float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2] + float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2] + vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 ); + vec3 L0 = vec3( 0.1 ) * Fex; + + // composition + solar disc + float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ); + L0 += ( vSunE * 19000.0 * Fex ) * sundisk; + + vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 ); + + vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) ); + + gl_FragColor = vec4( retColor, 1.0 ); + + #include + #include <${dx>=154?`colorspace_fragment`:`encodings_fragment`}> + + } + `},ZS=new Xe({name:`SkyShader`,fragmentShader:XS.fragmentShader,vertexShader:XS.vertexShader,uniforms:ft.clone(XS.uniforms),side:s,depthWrite:!1});var QS=class extends be{constructor(){super(new u(1,1,1),ZS)}};YS(QS,`SkyShader`,XS),YS(QS,`material`,ZS);const $S=new lt,eC=new z;var tC=class{constructor(e){let t=e.geometry;t.index&&(console.warn(`THREE.MeshSurfaceSampler: Converting geometry to non-indexed BufferGeometry.`),t=t.toNonIndexed()),this.geometry=t,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute(`position`),this.colorAttribute=this.geometry.getAttribute(`color`),this.weightAttribute=null,this.distribution=null}setWeightAttribute(e){return this.weightAttribute=e?this.geometry.getAttribute(e):null,this}build(){let e=this.positionAttribute,t=this.weightAttribute,n=new Float32Array(e.count/3);for(let r=0;re){i=a;break}else e1&&(i=1-i,a=1-a),$S.a.fromBufferAttribute(this.positionAttribute,e*3),$S.b.fromBufferAttribute(this.positionAttribute,e*3+1),$S.c.fromBufferAttribute(this.positionAttribute,e*3+2),t.set(0,0,0).addScaledVector($S.a,i).addScaledVector($S.b,a).addScaledVector($S.c,1-(i+a)),n!==void 0&&$S.getNormal(n),r!==void 0&&this.colorAttribute!==void 0&&($S.a.fromBufferAttribute(this.colorAttribute,e*3),$S.b.fromBufferAttribute(this.colorAttribute,e*3+1),$S.c.fromBufferAttribute(this.colorAttribute,e*3+2),eC.set(0,0,0).addScaledVector($S.a,i).addScaledVector($S.b,a).addScaledVector($S.c,1-(i+a)),r.r=eC.x,r.g=eC.y,r.b=eC.z),this}},nC=Object.defineProperty,rC=(e,t,n)=>t in e?nC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t,n)=>(rC(e,typeof t==`symbol`?t:t+``,n),n),iC=class extends Ae{constructor(e,t){super(),q(this,`isTransformControls`,!0),q(this,`visible`,!1),q(this,`domElement`),q(this,`raycaster`,new Ge),q(this,`gizmo`),q(this,`plane`),q(this,`tempVector`,new z),q(this,`tempVector2`,new z),q(this,`tempQuaternion`,new Be),q(this,`unit`,{X:new z(1,0,0),Y:new z(0,1,0),Z:new z(0,0,1)}),q(this,`pointStart`,new z),q(this,`pointEnd`,new z),q(this,`offset`,new z),q(this,`rotationAxis`,new z),q(this,`startNorm`,new z),q(this,`endNorm`,new z),q(this,`rotationAngle`,0),q(this,`cameraPosition`,new z),q(this,`cameraQuaternion`,new Be),q(this,`cameraScale`,new z),q(this,`parentPosition`,new z),q(this,`parentQuaternion`,new Be),q(this,`parentQuaternionInv`,new Be),q(this,`parentScale`,new z),q(this,`worldPositionStart`,new z),q(this,`worldQuaternionStart`,new Be),q(this,`worldScaleStart`,new z),q(this,`worldPosition`,new z),q(this,`worldQuaternion`,new Be),q(this,`worldQuaternionInv`,new Be),q(this,`worldScale`,new z),q(this,`eye`,new z),q(this,`positionStart`,new z),q(this,`quaternionStart`,new Be),q(this,`scaleStart`,new z),q(this,`camera`),q(this,`object`),q(this,`enabled`,!0),q(this,`axis`,null),q(this,`mode`,`translate`),q(this,`translationSnap`,null),q(this,`rotationSnap`,null),q(this,`scaleSnap`,null),q(this,`space`,`world`),q(this,`size`,1),q(this,`dragging`,!1),q(this,`showX`,!0),q(this,`showY`,!0),q(this,`showZ`,!0),q(this,`changeEvent`,{type:`change`}),q(this,`mouseDownEvent`,{type:`mouseDown`,mode:this.mode}),q(this,`mouseUpEvent`,{type:`mouseUp`,mode:this.mode}),q(this,`objectChangeEvent`,{type:`objectChange`}),q(this,`intersectObjectWithRay`,(e,t,n)=>{let r=t.intersectObject(e,!0);for(let e=0;e(this.object=e,this.visible=!0,this)),q(this,`detach`,()=>(this.object=void 0,this.visible=!1,this.axis=null,this)),q(this,`reset`,()=>(this.enabled&&this.dragging&&this.object!==void 0&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this)),q(this,`updateMatrixWorld`,()=>{this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()}),q(this,`pointerHover`,e=>{if(this.object===void 0||this.dragging===!0)return;this.raycaster.setFromCamera(e,this.camera);let t=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);t?this.axis=t.object.name:this.axis=null}),q(this,`pointerDown`,e=>{if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){this.raycaster.setFromCamera(e,this.camera);let t=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(t){let e=this.space;if(this.mode===`scale`?e=`local`:(this.axis===`E`||this.axis===`XYZE`||this.axis===`XYZ`)&&(e=`world`),e===`local`&&this.mode===`rotate`){let e=this.rotationSnap;this.axis===`X`&&e&&(this.object.rotation.x=Math.round(this.object.rotation.x/e)*e),this.axis===`Y`&&e&&(this.object.rotation.y=Math.round(this.object.rotation.y/e)*e),this.axis===`Z`&&e&&(this.object.rotation.z=Math.round(this.object.rotation.z/e)*e)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}}),q(this,`pointerMove`,e=>{let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e.button!==-1)return;this.raycaster.setFromCamera(e,this.camera);let a=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this.offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this.offset.applyQuaternion(this.worldQuaternionInv),t.indexOf(`X`)===-1&&(this.offset.x=0),t.indexOf(`Y`)===-1&&(this.offset.y=0),t.indexOf(`Z`)===-1&&(this.offset.z=0),i===`local`&&t!==`XYZ`?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),r.position.copy(this.offset).add(this.positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this.quaternionStart)),i===`world`&&(r.parent&&r.position.add(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld)),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld))));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),this.tempVector2.set(e,e,e)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),t.search(`X`)===-1&&(this.tempVector2.x=1),t.search(`Y`)===-1&&(this.tempVector2.y=1),t.search(`Z`)===-1&&(this.tempVector2.z=1);r.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(t.search(`X`)!==-1&&(this.object.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this.offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));t===`E`?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this.endNorm.cross(this.startNorm).dot(this.eye)<0?1:-1):t===`XYZE`?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(this.unit[t]),this.tempVector.copy(this.unit[t]),i===`local`&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this.quaternionStart),r.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),r.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}}),q(this,`pointerUp`,e=>{e.button===0&&(this.dragging&&this.axis!==null&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)}),q(this,`getPointer`,e=>{var t;if(this.domElement&&(t=this.domElement.ownerDocument)!=null&&t.pointerLockElement)return{x:0,y:0,button:e.button};{let t=e.changedTouches?e.changedTouches[0]:e,n=this.domElement.getBoundingClientRect();return{x:(t.clientX-n.left)/n.width*2-1,y:-(t.clientY-n.top)/n.height*2+1,button:e.button}}}),q(this,`onPointerHover`,e=>{if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this.getPointer(e));break}}),q(this,`onPointerDown`,e=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction=`none`,this.domElement.ownerDocument.addEventListener(`pointermove`,this.onPointerMove),this.pointerHover(this.getPointer(e)),this.pointerDown(this.getPointer(e)))}),q(this,`onPointerMove`,e=>{this.enabled&&this.pointerMove(this.getPointer(e))}),q(this,`onPointerUp`,e=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction=``,this.domElement.ownerDocument.removeEventListener(`pointermove`,this.onPointerMove),this.pointerUp(this.getPointer(e)))}),q(this,`getMode`,()=>this.mode),q(this,`setMode`,e=>{this.mode=e}),q(this,`setTranslationSnap`,e=>{this.translationSnap=e}),q(this,`setRotationSnap`,e=>{this.rotationSnap=e}),q(this,`setScaleSnap`,e=>{this.scaleSnap=e}),q(this,`setSize`,e=>{this.size=e}),q(this,`setSpace`,e=>{this.space=e}),q(this,`update`,()=>{console.warn(`THREE.TransformControls: update function has no more functionality and therefore has been deprecated.`)}),q(this,`connect`,e=>{e===document&&console.error(`THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.`),this.domElement=e,this.domElement.addEventListener(`pointerdown`,this.onPointerDown),this.domElement.addEventListener(`pointermove`,this.onPointerHover),this.domElement.ownerDocument.addEventListener(`pointerup`,this.onPointerUp)}),q(this,`dispose`,()=>{var e,t,n,r,i,a;(e=this.domElement)==null||e.removeEventListener(`pointerdown`,this.onPointerDown),(t=this.domElement)==null||t.removeEventListener(`pointermove`,this.onPointerHover),(r=(n=this.domElement)?.ownerDocument)==null||r.removeEventListener(`pointermove`,this.onPointerMove),(a=(i=this.domElement)?.ownerDocument)==null||a.removeEventListener(`pointerup`,this.onPointerUp),this.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}),this.domElement=t,this.camera=e,this.gizmo=new aC,this.add(this.gizmo),this.plane=new oC,this.add(this.plane);let n=(e,t)=>{let n=t;Object.defineProperty(this,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,this.plane[e]=t,this.gizmo[e]=t,this.dispatchEvent({type:e+`-changed`,value:t}),this.dispatchEvent(this.changeEvent))}}),this[e]=t,this.plane[e]=t,this.gizmo[e]=t};n(`camera`,this.camera),n(`object`,this.object),n(`enabled`,this.enabled),n(`axis`,this.axis),n(`mode`,this.mode),n(`translationSnap`,this.translationSnap),n(`rotationSnap`,this.rotationSnap),n(`scaleSnap`,this.scaleSnap),n(`space`,this.space),n(`size`,this.size),n(`dragging`,this.dragging),n(`showX`,this.showX),n(`showY`,this.showY),n(`showZ`,this.showZ),n(`worldPosition`,this.worldPosition),n(`worldPositionStart`,this.worldPositionStart),n(`worldQuaternion`,this.worldQuaternion),n(`worldQuaternionStart`,this.worldQuaternionStart),n(`cameraPosition`,this.cameraPosition),n(`cameraQuaternion`,this.cameraQuaternion),n(`pointStart`,this.pointStart),n(`pointEnd`,this.pointEnd),n(`rotationAxis`,this.rotationAxis),n(`rotationAngle`,this.rotationAngle),n(`eye`,this.eye),t!==void 0&&this.connect(t)}},aC=class extends Ae{constructor(){super(),q(this,`isTransformControlsGizmo`,!0),q(this,`type`,`TransformControlsGizmo`),q(this,`tempVector`,new z(0,0,0)),q(this,`tempEuler`,new k),q(this,`alignVector`,new z(0,1,0)),q(this,`zeroVector`,new z(0,0,0)),q(this,`lookAtMatrix`,new ye),q(this,`tempQuaternion`,new Be),q(this,`tempQuaternion2`,new Be),q(this,`identityQuaternion`,new Be),q(this,`unitX`,new z(1,0,0)),q(this,`unitY`,new z(0,1,0)),q(this,`unitZ`,new z(0,0,1)),q(this,`gizmo`),q(this,`picker`),q(this,`helper`),q(this,`rotationAxis`,new z),q(this,`cameraPosition`,new z),q(this,`worldPositionStart`,new z),q(this,`worldQuaternionStart`,new Be),q(this,`worldPosition`,new z),q(this,`worldQuaternion`,new Be),q(this,`eye`,new z),q(this,`camera`,null),q(this,`enabled`,!0),q(this,`axis`,null),q(this,`mode`,`translate`),q(this,`space`,`world`),q(this,`size`,1),q(this,`dragging`,!1),q(this,`showX`,!0),q(this,`showY`,!0),q(this,`showZ`,!0),q(this,`updateMatrixWorld`,()=>{let e=this.space;this.mode===`scale`&&(e=`local`);let t=e===`local`?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e.9&&(r.visible=!1)),this.axis===`Y`&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),r.quaternion.multiply(this.tempQuaternion),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(this.tempVector),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`?((r.name===`X`||r.name===`XYZX`)&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),(r.name===`Y`||r.name===`XYZY`)&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),(r.name===`Z`||r.name===`XYZZ`)&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name.search(`X`)!==-1&&(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye)<0?r.tag===`fwd`?r.visible=!1:r.scale.x*=-1:r.tag===`bwd`&&(r.visible=!1)),r.name.search(`Y`)!==-1&&(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye)<0?r.tag===`fwd`?r.visible=!1:r.scale.y*=-1:r.tag===`bwd`&&(r.visible=!1)),r.name.search(`Z`)!==-1&&(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye)<0?r.tag===`fwd`?r.visible=!1:r.scale.z*=-1:r.tag===`bwd`&&(r.visible=!1))):this.mode===`rotate`&&(this.tempQuaternion2.copy(t),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),r.name===`X`&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),r.quaternion.copy(this.tempQuaternion)),r.name===`Y`&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),r.quaternion.copy(this.tempQuaternion)),r.name===`Z`&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),r.quaternion.copy(this.tempQuaternion))),r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.material.tempOpacity=r.material.tempOpacity||r.material.opacity,r.material.tempColor=r.material.tempColor||r.material.color.clone(),r.material.color.copy(r.material.tempColor),r.material.opacity=r.material.tempOpacity,this.enabled?this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e})?(r.material.opacity=1,r.material.color.lerp(new h(1,1,1),.5)):(r.material.opacity*=.25,r.material.color.lerp(new h(1,1,1),.5))):(r.material.opacity*=.5,r.material.color.lerp(new h(1,1,1),.5))}super.updateMatrixWorld()});let e=new xe({depthTest:!1,depthWrite:!1,transparent:!0,side:T,fog:!1,toneMapped:!1}),t=new ue({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),n=e.clone();n.opacity=.15;let r=e.clone();r.opacity=.33;let i=e.clone();i.color.set(16711680);let a=e.clone();a.color.set(65280);let o=e.clone();o.color.set(255);let s=e.clone();s.opacity=.25;let c=s.clone();c.color.set(16776960);let l=s.clone();l.color.set(65535);let d=s.clone();d.color.set(16711935),e.clone().color.set(16776960);let p=t.clone();p.color.set(16711680);let m=t.clone();m.color.set(65280);let g=t.clone();g.color.set(255);let _=t.clone();_.color.set(65535);let v=t.clone();v.color.set(16711935);let y=t.clone();y.color.set(16776960);let x=t.clone();x.color.set(7895160);let S=y.clone();S.opacity=.25;let C=new b(0,.05,.2,12,1,!1),w=new u(.125,.125,.125),E=new f;E.setAttribute(`position`,new N([0,0,0,1,0,0],3));let D=(e,t)=>{let n=new f,r=[];for(let n=0;n<=64*t;++n)r.push(0,Math.cos(n/32*Math.PI)*e,Math.sin(n/32*Math.PI)*e);return n.setAttribute(`position`,new N(r,3)),n},O=()=>{let e=new f;return e.setAttribute(`position`,new N([0,0,0,1,1,1],3)),e},A={X:[[new be(C,i),[1,0,0],[0,0,-Math.PI/2],null,`fwd`],[new be(C,i),[1,0,0],[0,0,Math.PI/2],null,`bwd`],[new ce(E,p)]],Y:[[new be(C,a),[0,1,0],null,null,`fwd`],[new be(C,a),[0,1,0],[Math.PI,0,0],null,`bwd`],[new ce(E,m),null,[0,0,Math.PI/2]]],Z:[[new be(C,o),[0,0,1],[Math.PI/2,0,0],null,`fwd`],[new be(C,o),[0,0,1],[-Math.PI/2,0,0],null,`bwd`],[new ce(E,g),null,[0,-Math.PI/2,0]]],XYZ:[[new be(new je(.1,0),s.clone()),[0,0,0],[0,0,0]]],XY:[[new be(new Ie(.295,.295),c.clone()),[.15,.15,0]],[new ce(E,y),[.18,.3,0],null,[.125,1,1]],[new ce(E,y),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new be(new Ie(.295,.295),l.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new ce(E,_),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new ce(E,_),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new be(new Ie(.295,.295),d.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new ce(E,v),[.18,0,.3],null,[.125,1,1]],[new ce(E,v),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},j={X:[[new be(new b(.2,0,1,4,1,!1),n),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new be(new b(.2,0,1,4,1,!1),n),[0,.6,0]]],Z:[[new be(new b(.2,0,1,4,1,!1),n),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new be(new je(.2,0),n)]],XY:[[new be(new Ie(.4,.4),n),[.2,.2,0]]],YZ:[[new be(new Ie(.4,.4),n),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new be(new Ie(.4,.4),n),[.2,0,.2],[-Math.PI/2,0,0]]]},M={START:[[new be(new je(.01,2),r),null,null,null,`helper`]],END:[[new be(new je(.01,2),r),null,null,null,`helper`]],DELTA:[[new ce(O(),r),null,null,null,`helper`]],X:[[new ce(E,r.clone()),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new ce(E,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new ce(E,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},ee={X:[[new ce(D(1,.5),p)],[new be(new je(.04,0),i),[0,0,.99],null,[1,3,1]]],Y:[[new ce(D(1,.5),m),null,[0,0,-Math.PI/2]],[new be(new je(.04,0),a),[0,0,.99],null,[3,1,1]]],Z:[[new ce(D(1,.5),g),null,[0,Math.PI/2,0]],[new be(new je(.04,0),o),[.99,0,0],null,[1,3,1]]],E:[[new ce(D(1.25,1),S),null,[0,Math.PI/2,0]],[new be(new b(.03,0,.15,4,1,!1),S),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new be(new b(.03,0,.15,4,1,!1),S),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new be(new b(.03,0,.15,4,1,!1),S),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new be(new b(.03,0,.15,4,1,!1),S),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new ce(D(1,1),x),null,[0,Math.PI/2,0]]]},P={AXIS:[[new ce(E,r.clone()),[-1e3,0,0],null,[1e6,1,1],`helper`]]},F={X:[[new be(new ct(1,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new be(new ct(1,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new be(new ct(1,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new be(new ct(1.25,.1,2,24),n)]],XYZE:[[new be(new rt(.7,10,8),n)]]},I={X:[[new be(w,i),[.8,0,0],[0,0,-Math.PI/2]],[new ce(E,p),null,null,[.8,1,1]]],Y:[[new be(w,a),[0,.8,0]],[new ce(E,m),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new be(w,o),[0,0,.8],[Math.PI/2,0,0]],[new ce(E,g),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new be(w,c),[.85,.85,0],null,[2,2,.2]],[new ce(E,y),[.855,.98,0],null,[.125,1,1]],[new ce(E,y),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new be(w,l),[0,.85,.85],null,[.2,2,2]],[new ce(E,_),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new ce(E,_),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new be(w,d),[.85,0,.85],null,[2,.2,2]],[new ce(E,v),[.855,0,.98],null,[.125,1,1]],[new ce(E,v),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new be(new u(.125,.125,.125),s.clone()),[1.1,0,0]]],XYZY:[[new be(new u(.125,.125,.125),s.clone()),[0,1.1,0]]],XYZZ:[[new be(new u(.125,.125,.125),s.clone()),[0,0,1.1]]]},te={X:[[new be(new b(.2,0,.8,4,1,!1),n),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new be(new b(.2,0,.8,4,1,!1),n),[0,.5,0]]],Z:[[new be(new b(.2,0,.8,4,1,!1),n),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new be(w,n),[.85,.85,0],null,[3,3,.2]]],YZ:[[new be(w,n),[0,.85,.85],null,[.2,3,3]]],XZ:[[new be(w,n),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new be(new u(.2,.2,.2),n),[1.1,0,0]]],XYZY:[[new be(new u(.2,.2,.2),n),[0,1.1,0]]],XYZZ:[[new be(new u(.2,.2,.2),n),[0,0,1.1]]]},ne={X:[[new ce(E,r.clone()),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new ce(E,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new ce(E,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},L=e=>{let t=new Ae;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=L(A)),this.add(this.gizmo.rotate=L(ee)),this.add(this.gizmo.scale=L(I)),this.add(this.picker.translate=L(j)),this.add(this.picker.rotate=L(F)),this.add(this.picker.scale=L(te)),this.add(this.helper.translate=L(M)),this.add(this.helper.rotate=L(P)),this.add(this.helper.scale=L(ne)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}},oC=class extends be{constructor(){super(new Ie(1e5,1e5,2,2),new xe({visible:!1,wireframe:!0,side:T,transparent:!0,opacity:.1,toneMapped:!1})),q(this,`isTransformControlsPlane`,!0),q(this,`type`,`TransformControlsPlane`),q(this,`unitX`,new z(1,0,0)),q(this,`unitY`,new z(0,1,0)),q(this,`unitZ`,new z(0,0,1)),q(this,`tempVector`,new z),q(this,`dirVector`,new z),q(this,`alignVector`,new z),q(this,`tempMatrix`,new ye),q(this,`identityQuaternion`,new Be),q(this,`cameraQuaternion`,new Be),q(this,`worldPosition`,new z),q(this,`worldQuaternion`,new Be),q(this,`eye`,new z),q(this,`axis`,null),q(this,`mode`,`translate`),q(this,`space`,`world`),q(this,`updateMatrixWorld`,()=>{let e=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(e=`local`),this.unitX.set(1,0,0).applyQuaternion(e===`local`?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion(e===`local`?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion(e===`local`?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case`Y`:this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case`Z`:this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case`XY`:this.dirVector.copy(this.unitZ);break;case`YZ`:this.dirVector.copy(this.unitX);break;case`XZ`:this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case`XYZ`:case`E`:this.dirVector.set(0,0,0);break}break;case`rotate`:default:this.dirVector.set(0,0,0)}this.dirVector.length()===0?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()})}},sC=Object.defineProperty,cC=(e,t,n)=>t in e?sC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lC=(e,t,n)=>(cC(e,typeof t==`symbol`?t:t+``,n),n);const uC=new k(0,0,0,`YXZ`),dC=new z,fC={type:`change`},pC={type:`lock`},mC={type:`unlock`},hC=Math.PI/2;var gC=class extends A{constructor(e,t){super(),lC(this,`camera`),lC(this,`domElement`),lC(this,`isLocked`),lC(this,`minPolarAngle`),lC(this,`maxPolarAngle`),lC(this,`pointerSpeed`),lC(this,`onMouseMove`,e=>{if(!this.domElement||this.isLocked===!1)return;let t=e.movementX||e.mozMovementX||e.webkitMovementX||0,n=e.movementY||e.mozMovementY||e.webkitMovementY||0;uC.setFromQuaternion(this.camera.quaternion),uC.y-=t*.002*this.pointerSpeed,uC.x-=n*.002*this.pointerSpeed,uC.x=Math.max(hC-this.maxPolarAngle,Math.min(hC-this.minPolarAngle,uC.x)),this.camera.quaternion.setFromEuler(uC),this.dispatchEvent(fC)}),lC(this,`onPointerlockChange`,()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(pC),this.isLocked=!0):(this.dispatchEvent(mC),this.isLocked=!1))}),lC(this,`onPointerlockError`,()=>{console.error(`THREE.PointerLockControls: Unable to use Pointer Lock API`)}),lC(this,`connect`,e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener(`mousemove`,this.onMouseMove),this.domElement.ownerDocument.addEventListener(`pointerlockchange`,this.onPointerlockChange),this.domElement.ownerDocument.addEventListener(`pointerlockerror`,this.onPointerlockError))}),lC(this,`disconnect`,()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener(`mousemove`,this.onMouseMove),this.domElement.ownerDocument.removeEventListener(`pointerlockchange`,this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener(`pointerlockerror`,this.onPointerlockError))}),lC(this,`dispose`,()=>{this.disconnect()}),lC(this,`getObject`,()=>this.camera),lC(this,`direction`,new z(0,0,-1)),lC(this,`getDirection`,e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),lC(this,`moveForward`,e=>{dC.setFromMatrixColumn(this.camera.matrix,0),dC.crossVectors(this.camera.up,dC),this.camera.position.addScaledVector(dC,e)}),lC(this,`moveRight`,e=>{dC.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(dC,e)}),lC(this,`lock`,()=>{this.domElement&&this.domElement.requestPointerLock()}),lC(this,`unlock`,()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}},_C=Object.defineProperty,vC=(e,t,n)=>t in e?_C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yC=(e,t,n)=>(vC(e,typeof t==`symbol`?t:t+``,n),n);const bC=new We,xC=new Fe,SC=Math.cos(70*(Math.PI/180)),CC=(e,t)=>(e%t+t)%t;var wC=class extends A{constructor(e,t){super(),yC(this,`object`),yC(this,`domElement`),yC(this,`enabled`,!0),yC(this,`target`,new z),yC(this,`minDistance`,0),yC(this,`maxDistance`,1/0),yC(this,`minZoom`,0),yC(this,`maxZoom`,1/0),yC(this,`minPolarAngle`,0),yC(this,`maxPolarAngle`,Math.PI),yC(this,`minAzimuthAngle`,-1/0),yC(this,`maxAzimuthAngle`,1/0),yC(this,`enableDamping`,!1),yC(this,`dampingFactor`,.05),yC(this,`enableZoom`,!0),yC(this,`zoomSpeed`,1),yC(this,`enableRotate`,!0),yC(this,`rotateSpeed`,1),yC(this,`enablePan`,!0),yC(this,`panSpeed`,1),yC(this,`screenSpacePanning`,!0),yC(this,`keyPanSpeed`,7),yC(this,`zoomToCursor`,!1),yC(this,`autoRotate`,!1),yC(this,`autoRotateSpeed`,2),yC(this,`reverseOrbit`,!1),yC(this,`reverseHorizontalOrbit`,!1),yC(this,`reverseVerticalOrbit`,!1),yC(this,`keys`,{LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`}),yC(this,`mouseButtons`,{LEFT:he.ROTATE,MIDDLE:he.DOLLY,RIGHT:he.PAN}),yC(this,`touches`,{ONE:at.ROTATE,TWO:at.DOLLY_PAN}),yC(this,`target0`),yC(this,`position0`),yC(this,`zoom0`),yC(this,`_domElementKeyEvents`,null),yC(this,`getPolarAngle`),yC(this,`getAzimuthalAngle`),yC(this,`setPolarAngle`),yC(this,`setAzimuthalAngle`),yC(this,`getDistance`),yC(this,`getZoomScale`),yC(this,`listenToKeyEvents`),yC(this,`stopListenToKeyEvents`),yC(this,`saveState`),yC(this,`reset`),yC(this,`update`),yC(this,`connect`),yC(this,`dispose`),yC(this,`dollyIn`),yC(this,`dollyOut`),yC(this,`getScale`),yC(this,`setScale`),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>l.phi,this.getAzimuthalAngle=()=>l.theta,this.setPolarAngle=e=>{let t=CC(e,2*Math.PI),r=l.phi;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i{let t=CC(e,2*Math.PI),r=l.theta;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-in.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener(`keydown`,Te),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener(`keydown`,Te),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),s=o.NONE},this.update=(()=>{let t=new z,i=new z(0,1,0),a=new Be().setFromUnitVectors(e.up,i),p=a.clone().invert(),m=new z,h=new Be,g=2*Math.PI;return function(){let _=n.object.position;a.setFromUnitVectors(e.up,i),p.copy(a).invert(),t.copy(_).sub(n.target),t.applyQuaternion(a),l.setFromVector3(t),n.autoRotate&&s===o.NONE&&k(D()),n.enableDamping?(l.theta+=u.theta*n.dampingFactor,l.phi+=u.phi*n.dampingFactor):(l.theta+=u.theta,l.phi+=u.phi);let v=n.minAzimuthAngle,y=n.maxAzimuthAngle;isFinite(v)&&isFinite(y)&&(v<-Math.PI?v+=g:v>Math.PI&&(v-=g),y<-Math.PI?y+=g:y>Math.PI&&(y-=g),v<=y?l.theta=Math.max(v,Math.min(y,l.theta)):l.theta=l.theta>(v+y)/2?Math.max(v,l.theta):Math.min(y,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(f,n.dampingFactor):n.target.add(f),n.zoomToCursor&&w||n.object.isOrthographicCamera?l.radius=te(l.radius):l.radius=te(l.radius*d),t.setFromSpherical(l),t.applyQuaternion(p),_.copy(n.target).add(t),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,f.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),f.set(0,0,0));let b=!1;if(n.zoomToCursor&&w){let r=null;if(n.object instanceof Pe&&n.object.isPerspectiveCamera){let e=t.length();r=te(e*d);let i=e-r;n.object.position.addScaledVector(S,i),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let e=new z(C.x,C.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),b=!0;let i=new z(C.x,C.y,0);i.unproject(n.object),n.object.position.sub(i).add(e),n.object.updateMatrixWorld(),r=t.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),n.zoomToCursor=!1;r!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(bC.origin.copy(n.object.position),bC.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(bC.direction))c||8*(1-h.dot(n.object.quaternion))>c?(n.dispatchEvent(r),m.copy(n.object.position),h.copy(n.object.quaternion),b=!1,!0):!1}})(),this.connect=e=>{n.domElement=e,n.domElement.style.touchAction=`none`,n.domElement.addEventListener(`contextmenu`,Oe),n.domElement.addEventListener(`pointerdown`,ye),n.domElement.addEventListener(`pointercancel`,xe),n.domElement.addEventListener(`wheel`,we)},this.dispose=()=>{var e,t,r,i,a,o;n.domElement&&(n.domElement.style.touchAction=`auto`),(e=n.domElement)==null||e.removeEventListener(`contextmenu`,Oe),(t=n.domElement)==null||t.removeEventListener(`pointerdown`,ye),(r=n.domElement)==null||r.removeEventListener(`pointercancel`,xe),(i=n.domElement)==null||i.removeEventListener(`wheel`,we),(a=n.domElement)==null||a.ownerDocument.removeEventListener(`pointermove`,be),(o=n.domElement)==null||o.ownerDocument.removeEventListener(`pointerup`,xe),n._domElementKeyEvents!==null&&n._domElementKeyEvents.removeEventListener(`keydown`,Te)};let n=this,r={type:`change`},i={type:`start`},a={type:`end`},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},s=o.NONE,c=1e-6,l=new it,u=new it,d=1,f=new z,p=new pt,m=new pt,h=new pt,g=new pt,_=new pt,v=new pt,y=new pt,b=new pt,x=new pt,S=new z,C=new pt,w=!1,T=[],E={};function D(){return 2*Math.PI/60/60*n.autoRotateSpeed}function O(){return .95**n.zoomSpeed}function k(e){n.reverseOrbit||n.reverseHorizontalOrbit?u.theta+=e:u.theta-=e}function A(e){n.reverseOrbit||n.reverseVerticalOrbit?u.phi+=e:u.phi-=e}let j=(()=>{let e=new z;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),f.add(e)}})(),M=(()=>{let e=new z;return function(t,r){n.screenSpacePanning===!0?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),f.add(e)}})(),N=(()=>{let e=new z;return function(t,r){let i=n.domElement;if(i&&n.object instanceof Pe&&n.object.isPerspectiveCamera){let a=n.object.position;e.copy(a).sub(n.target);let o=e.length();o*=Math.tan(n.object.fov/2*Math.PI/180),j(2*t*o/i.clientHeight,n.object.matrix),M(2*r*o/i.clientHeight,n.object.matrix)}else i&&n.object instanceof Me&&n.object.isOrthographicCamera?(j(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),M(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),n.enablePan=!1)}})();function ee(e){n.object instanceof Pe&&n.object.isPerspectiveCamera||n.object instanceof Me&&n.object.isOrthographicCamera?d=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),n.enableZoom=!1)}function P(e){ee(d/e)}function F(e){ee(d*e)}function I(e){if(!n.zoomToCursor||!n.domElement)return;w=!0;let t=n.domElement.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top,a=t.width,o=t.height;C.x=r/a*2-1,C.y=-(i/o)*2+1,S.set(C.x,C.y,1).unproject(n.object).sub(n.object.position).normalize()}function te(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function ne(e){p.set(e.clientX,e.clientY)}function L(e){I(e),y.set(e.clientX,e.clientY)}function re(e){g.set(e.clientX,e.clientY)}function R(e){m.set(e.clientX,e.clientY),h.subVectors(m,p).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(k(2*Math.PI*h.x/t.clientHeight),A(2*Math.PI*h.y/t.clientHeight)),p.copy(m),n.update()}function ie(e){b.set(e.clientX,e.clientY),x.subVectors(b,y),x.y>0?P(O()):x.y<0&&F(O()),y.copy(b),n.update()}function ae(e){_.set(e.clientX,e.clientY),v.subVectors(_,g).multiplyScalar(n.panSpeed),N(v.x,v.y),g.copy(_),n.update()}function oe(e){I(e),e.deltaY<0?F(O()):e.deltaY>0&&P(O()),n.update()}function se(e){let t=!1;switch(e.code){case n.keys.UP:N(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:N(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:N(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:N(-n.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),n.update())}function ce(){if(T.length==1)p.set(T[0].pageX,T[0].pageY);else{let e=.5*(T[0].pageX+T[1].pageX),t=.5*(T[0].pageY+T[1].pageY);p.set(e,t)}}function le(){if(T.length==1)g.set(T[0].pageX,T[0].pageY);else{let e=.5*(T[0].pageX+T[1].pageX),t=.5*(T[0].pageY+T[1].pageY);g.set(e,t)}}function ue(){let e=T[0].pageX-T[1].pageX,t=T[0].pageY-T[1].pageY,n=Math.sqrt(e*e+t*t);y.set(0,n)}function de(){n.enableZoom&&ue(),n.enablePan&&le()}function fe(){n.enableZoom&&ue(),n.enableRotate&&ce()}function pe(e){if(T.length==1)m.set(e.pageX,e.pageY);else{let t=Ne(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);m.set(n,r)}h.subVectors(m,p).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(k(2*Math.PI*h.x/t.clientHeight),A(2*Math.PI*h.y/t.clientHeight)),p.copy(m)}function me(e){if(T.length==1)_.set(e.pageX,e.pageY);else{let t=Ne(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);_.set(n,r)}v.subVectors(_,g).multiplyScalar(n.panSpeed),N(v.x,v.y),g.copy(_)}function ge(e){let t=Ne(e),r=e.pageX-t.x,i=e.pageY-t.y,a=Math.sqrt(r*r+i*i);b.set(0,a),x.set(0,(b.y/y.y)**+n.zoomSpeed),P(x.y),y.copy(b)}function _e(e){n.enableZoom&&ge(e),n.enablePan&&me(e)}function ve(e){n.enableZoom&&ge(e),n.enableRotate&&pe(e)}function ye(e){var t,r;n.enabled!==!1&&(T.length===0&&((t=n.domElement)==null||t.ownerDocument.addEventListener(`pointermove`,be),(r=n.domElement)==null||r.ownerDocument.addEventListener(`pointerup`,xe)),ke(e),e.pointerType===`touch`?Ee(e):Se(e))}function be(e){n.enabled!==!1&&(e.pointerType===`touch`?De(e):Ce(e))}function xe(e){var t,r,i;Ae(e),T.length===0&&((t=n.domElement)==null||t.releasePointerCapture(e.pointerId),(r=n.domElement)==null||r.ownerDocument.removeEventListener(`pointermove`,be),(i=n.domElement)==null||i.ownerDocument.removeEventListener(`pointerup`,xe)),n.dispatchEvent(a),s=o.NONE}function Se(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case he.DOLLY:if(n.enableZoom===!1)return;L(e),s=o.DOLLY;break;case he.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(n.enablePan===!1)return;re(e),s=o.PAN}else{if(n.enableRotate===!1)return;ne(e),s=o.ROTATE}break;case he.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(n.enableRotate===!1)return;ne(e),s=o.ROTATE}else{if(n.enablePan===!1)return;re(e),s=o.PAN}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}function Ce(e){if(n.enabled!==!1)switch(s){case o.ROTATE:if(n.enableRotate===!1)return;R(e);break;case o.DOLLY:if(n.enableZoom===!1)return;ie(e);break;case o.PAN:if(n.enablePan===!1)return;ae(e);break}}function we(e){n.enabled===!1||n.enableZoom===!1||s!==o.NONE&&s!==o.ROTATE||(e.preventDefault(),n.dispatchEvent(i),oe(e),n.dispatchEvent(a))}function Te(e){n.enabled===!1||n.enablePan===!1||se(e)}function Ee(e){switch(je(e),T.length){case 1:switch(n.touches.ONE){case at.ROTATE:if(n.enableRotate===!1)return;ce(),s=o.TOUCH_ROTATE;break;case at.PAN:if(n.enablePan===!1)return;le(),s=o.TOUCH_PAN;break;default:s=o.NONE}break;case 2:switch(n.touches.TWO){case at.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;de(),s=o.TOUCH_DOLLY_PAN;break;case at.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;fe(),s=o.TOUCH_DOLLY_ROTATE;break;default:s=o.NONE}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}function De(e){switch(je(e),s){case o.TOUCH_ROTATE:if(n.enableRotate===!1)return;pe(e),n.update();break;case o.TOUCH_PAN:if(n.enablePan===!1)return;me(e),n.update();break;case o.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;_e(e),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ve(e),n.update();break;default:s=o.NONE}}function Oe(e){n.enabled!==!1&&e.preventDefault()}function ke(e){T.push(e)}function Ae(e){delete E[e.pointerId];for(let t=0;t{F(e),n.update()},this.dollyOut=(e=O())=>{P(e),n.update()},this.getScale=()=>d,this.setScale=e=>{ee(e),n.update()},this.getZoomScale=()=>O(),t!==void 0&&this.connect(t),this.update()}},TC=class extends wC{constructor(e,t){super(e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=he.PAN,this.mouseButtons.RIGHT=he.ROTATE,this.touches.ONE=at.PAN,this.touches.TWO=at.DOLLY_ROTATE}};const EC=new Be,DC={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},OC={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},kC={9728:Ee,9729:de,9984:Oe,9985:pe,9986:De,9987:fe},AC={33071:m,33648:we,10497:Ke},jC={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},MC={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,...dx>=152?{TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`}:{TEXCOORD_0:`uv`,TEXCOORD_1:`uv2`},COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},NC={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},PC={CUBICSPLINE:void 0,LINEAR:oe,STEP:ae},FC={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`},IC=new ye,LC=new z;function RC(e,t,n,r,i,a){let o=2*Math.PI*i/4,s=Math.max(a-2*i,0),c=Math.PI/4;LC.copy(t),LC[r]=0,LC.normalize();let l=.5*o/(o+s),u=1-LC.angleTo(e)/c;return Math.sign(LC[n])===1?u*l:s/(o+s)+l+l*(1-u)}var zC=class extends u{constructor(e=1,t=1,n=1,r=2,i=.1){if(r=r*2+1,i=Math.min(e/2,t/2,n/2,i),super(1,1,1,r,r,r),r===1)return;let a=this.toNonIndexed();this.index=null,this.attributes.position=a.attributes.position,this.attributes.normal=a.attributes.normal,this.attributes.uv=a.attributes.uv;let o=new z,s=new z,c=new z(e,t,n).divideScalar(2).subScalar(i),l=this.attributes.position.array,u=this.attributes.normal.array,d=this.attributes.uv.array,f=l.length/6,p=new z,m=.5/r;for(let r=0,a=0;rt in e?GC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qC=(e,t,n)=>(KC(e,typeof t==`symbol`?t:t+``,n),n),JC=class extends me{constructor(e){super(e)}load(e,t,n,r){let i=new M(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>{if(typeof e!=`string`)throw Error(`unsupported data type`);let n=JSON.parse(e),r=this.parse(n);t&&t(r)},n,r)}loadAsync(e,t){return super.loadAsync(e,t)}parse(e){return new YC(e)}},YC=class{constructor(e){qC(this,`data`),this.data=e}generateShapes(e,t=100,n){let r=[],i={letterSpacing:0,lineHeight:1,...n},a=XC(e,t,this.data,i);for(let e=0,t=a.length;e(a=c.indexOf(n))&&o=e.byteLength||!(l=r(e)))&&t(1,`no header found`),(u=l.match(n))||t(3,`bad initial token`),c.valid|=1,c.programtype=u[1],c.string+=l+` +`;l=r(e),l!==!1;){if(c.string+=l+` +`,l.charAt(0)===`#`){c.comments+=l+` +`;continue}if((u=l.match(i))&&(c.gamma=parseFloat(u[1])),(u=l.match(a))&&(c.exposure=parseFloat(u[1])),(u=l.match(o))&&(c.valid|=2,c.format=u[1]),(u=l.match(s))&&(c.valid|=4,c.height=parseInt(u[1],10),c.width=parseInt(u[2],10)),c.valid&2&&c.valid&4)break}return c.valid&2||t(3,`missing format specifier`),c.valid&4||t(3,`missing image size specifier`),c},a=function(e,n,r){let i=n;if(i<8||i>32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,`wrong scanline width`);let a=new Uint8Array(4*n*r);a.length||t(4,`unable to allocate buffer space`);let o=0,s=0,c=4*i,l=new Uint8Array(4),u=new Uint8Array(c),d=r;for(;d>0&&se.byteLength&&t(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],(l[0]!=2||l[1]!=2||(l[2]<<8|l[3])!=i)&&t(3,`bad rgbe scanline format`);let n=0,r;for(;n128;if(i&&(r-=128),(r===0||n+r>c)&&t(3,`bad scanline data`),i){let t=e[s++];for(let e=0;e0?F.copy(k[k.length-1]):F.identity())}function r(e){let t=new $e,n=new pt,r=new pt,i=new pt,o=!0,s=!1,c=e.getAttribute(`d`);if(c===``||c===`none`)return null;let l=c.match(/[a-df-z][^a-df-z]*/gi);for(let e=0,c=l.length;e0&&(n.copy(i),t.currentPath.currentPoint.copy(n),o=!0);break;default:console.warn(c)}s=!1}return t}function i(e){if(!(!e.sheet||!e.sheet.cssRules||!e.sheet.cssRules.length))for(let t=0;te.trim());for(let e=0;ee!==``));O[r[e]]=Object.assign(O[r[e]]||{},t)}}}function a(e,t,n,r,i,a,s,c){if(t==0||n==0){e.lineTo(c.x,c.y);return}r=r*Math.PI/180,t=Math.abs(t),n=Math.abs(n);let l=(s.x-c.x)/2,u=(s.y-c.y)/2,d=Math.cos(r)*l+Math.sin(r)*u,f=-Math.sin(r)*l+Math.cos(r)*u,p=t*t,m=n*n,h=d*d,g=f*f,_=h/p+g/m;if(_>1){let e=Math.sqrt(_);t=e*t,n=e*n,p=t*t,m=n*n}let v=p*g+m*h,y=(p*m-v)/v,b=Math.sqrt(Math.max(0,y));i===a&&(b=-b);let x=b*t*f/n,S=-b*n*d/t,C=Math.cos(r)*x-Math.sin(r)*S+(s.x+c.x)/2,w=Math.sin(r)*x+Math.cos(r)*S+(s.y+c.y)/2,T=o(1,0,(d-x)/t,(f-S)/n),E=o((d-x)/t,(f-S)/n,(-d-x)/t,(-f-S)/n)%(Math.PI*2);e.currentPath.absellipse(C,w,t,n,T,T+E,a===0,r)}function o(e,t,n,r){let i=e*n+t*r,a=Math.sqrt(e*e+t*t)*Math.sqrt(n*n+r*r),o=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*r-t*n<0&&(o=-o),o}function s(e){let t=v(e.getAttribute(`x`)||0),n=v(e.getAttribute(`y`)||0),r=v(e.getAttribute(`rx`)||e.getAttribute(`ry`)||0),i=v(e.getAttribute(`ry`)||e.getAttribute(`rx`)||0),a=v(e.getAttribute(`width`)),o=v(e.getAttribute(`height`)),s=.448084975506,c=new $e;return c.moveTo(t+r,n),c.lineTo(t+a-r,n),(r!==0||i!==0)&&c.bezierCurveTo(t+a-r*s,n,t+a,n+i*s,t+a,n+i),c.lineTo(t+a,n+o-i),(r!==0||i!==0)&&c.bezierCurveTo(t+a,n+o-i*s,t+a-r*s,n+o,t+a-r,n+o),c.lineTo(t+r,n+o),(r!==0||i!==0)&&c.bezierCurveTo(t+r*s,n+o,t,n+o-i*s,t,n+o-i),c.lineTo(t,n+i),(r!==0||i!==0)&&c.bezierCurveTo(t,n+i*s,t+r*s,n,t+r,n),c}function c(e){function t(e,t,n){let a=v(t),o=v(n);i===0?r.moveTo(a,o):r.lineTo(a,o),i++}let n=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new $e,i=0;return e.getAttribute(`points`).replace(n,t),r.currentPath.autoClose=!0,r}function l(e){function t(e,t,n){let a=v(t),o=v(n);i===0?r.moveTo(a,o):r.lineTo(a,o),i++}let n=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new $e,i=0;return e.getAttribute(`points`).replace(n,t),r.currentPath.autoClose=!1,r}function u(e){let t=v(e.getAttribute(`cx`)||0),n=v(e.getAttribute(`cy`)||0),r=v(e.getAttribute(`r`)||0),i=new Ne;i.absarc(t,n,r,0,Math.PI*2);let a=new $e;return a.subPaths.push(i),a}function d(e){let t=v(e.getAttribute(`cx`)||0),n=v(e.getAttribute(`cy`)||0),r=v(e.getAttribute(`rx`)||0),i=v(e.getAttribute(`ry`)||0),a=new Ne;a.absellipse(t,n,r,i,0,Math.PI*2);let o=new $e;return o.subPaths.push(a),o}function f(e){let t=v(e.getAttribute(`x1`)||0),n=v(e.getAttribute(`y1`)||0),r=v(e.getAttribute(`x2`)||0),i=v(e.getAttribute(`y2`)||0),a=new $e;return a.moveTo(t,n),a.lineTo(r,i),a.currentPath.autoClose=!1,a}function p(e,t){t=Object.assign({},t);let n={};if(e.hasAttribute(`class`)){let t=e.getAttribute(`class`).split(/\s/).filter(Boolean).map(e=>e.trim());for(let e=0;e0&&t.premultiply(k[k.length-1]),F.copy(t),k.push(t),t}function b(e){let t=new ve,n=A;if(e.nodeName===`use`&&(e.hasAttribute(`x`)||e.hasAttribute(`y`))){let n=v(e.getAttribute(`x`)),r=v(e.getAttribute(`y`));t.translate(n,r)}if(e.hasAttribute(`transform`)){let r=e.getAttribute(`transform`).split(`)`);for(let e=r.length-1;e>=0;e--){let i=r[e].trim();if(i===``)continue;let a=i.indexOf(`(`),o=i.length;if(a>0&&a=1){let e=t[0],r=0;t.length>=2&&(r=t[1]),n.translate(e,r)}break;case`rotate`:if(t.length>=1){let e=0,r=0,i=0;e=t[0]*Math.PI/180,t.length>=3&&(r=t[1],i=t[2]),j.makeTranslation(-r,-i),M.makeRotation(e),N.multiplyMatrices(M,j),j.makeTranslation(r,i),n.multiplyMatrices(j,N)}break;case`scale`:if(t.length>=1){let e=t[0],r=e;t.length>=2&&(r=t[1]),n.scale(e,r)}break;case`skewX`:t.length===1&&n.set(1,Math.tan(t[0]*Math.PI/180),0,0,1,0,0,0,1);break;case`skewY`:t.length===1&&n.set(1,0,0,Math.tan(t[0]*Math.PI/180),1,0,0,0,1);break;case`matrix`:t.length===6&&n.set(t[0],t[2],t[4],t[1],t[3],t[5],0,0,1);break}}t.premultiply(n)}}return t}function x(e,t){function n(e){P.set(e.x,e.y,1).applyMatrix3(t),e.set(P.x,P.y)}function r(e){let n=e.xRadius,r=e.yRadius,i=Math.cos(e.aRotation),a=Math.sin(e.aRotation),o=new z(n*i,n*a,0),s=new z(-r*a,r*i,0),c=o.applyMatrix3(t),l=s.applyMatrix3(t),u=A.set(c.x,l.x,0,c.y,l.y,0,0,0,1),d=j.copy(u).invert(),f=M.copy(d).transpose().multiply(d).elements,p=E(f[0],f[1],f[4]),m=Math.sqrt(p.rt1),h=Math.sqrt(p.rt2);if(e.xRadius=1/m,e.yRadius=1/h,e.aRotation=Math.atan2(p.sn,p.cs),!((e.aEndAngle-e.aStartAngle)%(2*Math.PI)<2**-52)){let n=j.set(m,0,0,0,h,0,0,0,1),r=M.set(p.cs,p.sn,0,-p.sn,p.cs,0,0,0,1),i=n.multiply(r).multiply(u),a=e=>{let{x:t,y:n}=new z(Math.cos(e),Math.sin(e),0).applyMatrix3(i);return Math.atan2(n,t)};e.aStartAngle=a(e.aStartAngle),e.aEndAngle=a(e.aEndAngle),S(t)&&(e.aClockwise=!e.aClockwise)}}function i(e){let n=w(t),r=T(t);e.xRadius*=n,e.yRadius*=r;let i=n>2**-52?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);e.aRotation+=i,S(t)&&(e.aStartAngle*=-1,e.aEndAngle*=-1,e.aClockwise=!e.aClockwise)}let a=e.subPaths;for(let e=0,o=a.length;e2**-52}function w(e){let t=e.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function T(e){let t=e.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function E(e,t,n){let r,i,a,o,s,c=e+n,l=e-n,u=Math.sqrt(l*l+4*t*t);return c>0?(r=.5*(c+u),s=1/r,i=e*s*n-t*s*t):c<0?i=.5*(c-u):(r=.5*u,i=-.5*u),a=l>0?l+u:l-u,Math.abs(a)>2*Math.abs(t)?(s=-2*t/a,o=1/Math.sqrt(1+s*s),a=s*o):Math.abs(t)===0?(a=1,o=0):(s=-.5*a/t,a=1/Math.sqrt(1+s*s),o=s*a),l>0&&(s=a,a=-o,o=s),{rt1:r,rt2:i,cs:a,sn:o}}let D=[],O={},k=[],A=new ve,j=new ve,M=new ve,N=new ve,ee=new pt,P=new z,F=new ve,I=new DOMParser().parseFromString(e,`image/svg+xml`);return n(I.documentElement,{fill:`#000`,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:`miter`,strokeLineCap:`butt`,strokeMiterLimit:4}),{paths:D,xml:I.documentElement}}static createShapes(e){let t={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},n={loc:t.ORIGIN,t:0};function r(e,r,a,o){let s=e.x,c=r.x,l=a.x,u=o.x,d=e.y,f=r.y,p=a.y,m=o.y,h=(u-l)*(d-p)-(m-p)*(s-l),g=(c-s)*(d-p)-(f-d)*(s-l),_=(m-p)*(c-s)-(u-l)*(f-d),v=h/_,y=g/_;if(_===0&&h!==0||v<=0||v>=1||y<0||y>1)return null;if(h===0&&_===0){for(let l=0;l<2;l++)if(i(l===0?a:o,e,r),n.loc==t.ORIGIN){let e=l===0?a:o;return{x:e.x,y:e.y,t:n.t}}else if(n.loc==t.BETWEEN){let e=+(s+n.t*(c-s)).toPrecision(10),t=+(d+n.t*(f-d)).toPrecision(10);return{x:e,y:t,t:n.t}}return null}else{for(let s=0;s<2;s++)if(i(s===0?a:o,e,r),n.loc==t.ORIGIN){let e=s===0?a:o;return{x:e.x,y:e.y,t:n.t}}let l=+(s+v*(c-s)).toPrecision(10),u=+(d+v*(f-d)).toPrecision(10);return{x:l,y:u,t:v}}}function i(e,r,i){let a=i.x-r.x,o=i.y-r.y,s=e.x-r.x,c=e.y-r.y,l=a*c-s*o;if(e.x===r.x&&e.y===r.y){n.loc=t.ORIGIN,n.t=0;return}if(e.x===i.x&&e.y===i.y){n.loc=t.DESTINATION,n.t=1;return}if(l<-(2**-52)){n.loc=t.LEFT;return}if(l>2**-52){n.loc=t.RIGHT;return}if(a*s<0||o*c<0){n.loc=t.BEHIND;return}if(Math.sqrt(a*a+o*o)e.t<=l.t+2**-52&&e.t>=l.t-2**-52)===void 0&&(n.push(l),i.push(new pt(l.x,l.y)))}}return i}function o(e,t,n){let r=new pt;t.getCenter(r);let i=[];return n.forEach(t=>{t.boundingBox.containsPoint(r)&&a(e,t.points).forEach(e=>{i.push({identifier:t.identifier,isCW:t.isCW,point:e})})}),i.sort((e,t)=>e.point.x-t.point.x),i}function s(e,t,n,r,i){(i==null||i===``)&&(i=`nonzero`);let a=new pt;e.boundingBox.getCenter(a);let s=[new pt(n,a.y),new pt(r,a.y)],c=o(s,e.boundingBox,t);c.sort((e,t)=>e.point.x-t.point.x);let l=[],u=[];c.forEach(t=>{t.identifier===e.identifier?l.push(t):u.push(t)});let d=l[0].point.x,f=[],p=0;for(;p0&&f[f.length-1]===u[p].identifier?f.pop():f.push(u[p].identifier),p++;if(f.push(e.identifier),i===`evenodd`){let t=f.length%2==0,n=f[f.length-2];return{identifier:e.identifier,isHole:t,for:n}}else if(i===`nonzero`){let n=!0,r=null,i=null;for(let e=0;e{let t=e.getPoints(),n=-999999999,r=999999999,i=-999999999,a=999999999;for(let e=0;en&&(n=o.y),o.yi&&(i=o.x),o.x=a&&(l=a-1),{curves:e.curves,points:t,isCW:et.isClockWise(t),identifier:-1,boundingBox:new c(new pt(a,r),new pt(i,n))}});d=d.filter(e=>e.points.length>1);for(let e=0;es(t,d,l,u,e.userData?e.userData.style.fillRule:void 0)),p=[];return d.forEach(e=>{if(!f[e.identifier].isHole){let t=new Ze;t.curves=e.curves,f.filter(t=>t.isHole&&t.for===e.identifier).forEach(e=>{let n=d[e.identifier],r=new Ne;r.curves=n.curves,t.holes.push(r)}),p.push(t)}}),p}static getStrokeStyle(e,t,n,r,i){return e=e===void 0?1:e,t=t===void 0?`#000`:t,n=n===void 0?`miter`:n,r=r===void 0?`butt`:r,i=i===void 0?4:i,{strokeColor:t,strokeWidth:e,strokeLineJoin:n,strokeLineCap:r,strokeMiterLimit:i}}static pointsToStroke(t,n,r,i){let a=[],o=[],s=[];if(e.pointsToStrokeWithBuffers(t,n,r,i,a,o,s)===0)return null;let c=new f;return c.setAttribute(`position`,new N(a,3)),c.setAttribute(`normal`,new N(o,3)),c.setAttribute(`uv`,new N(s,2)),c}static pointsToStrokeWithBuffers(e,t,n,r,i,a,o,s){let c=new pt,l=new pt,u=new pt,d=new pt,f=new pt,p=new pt,m=new pt,h=new pt,g=new pt,_=new pt,v=new pt,y=new pt,b=new pt,x=new pt,S=new pt,C=new pt,w=new pt;n=n===void 0?12:n,r=r===void 0?.001:r,s=s===void 0?0:s,e=le(e);let T=e.length;if(T<2)return 0;let E=e[0].equals(e[T-1]),D,O=e[0],k,A=t.strokeWidth/2,j=1/(T-1),M=0,N,ee,P,F,I=!1,te=0,ne=s*3,L=s*2;re(e[0],e[1],c).multiplyScalar(A),h.copy(e[0]).sub(c),g.copy(e[0]).add(c),_.copy(h),v.copy(g);for(let n=1;n2**-52){let n=A/e;u.multiplyScalar(-n),d.subVectors(D,O),f.copy(d).setLength(n).add(u),C.copy(f).negate();let r=f.length(),i=d.length();d.divideScalar(i),p.subVectors(k,D);let a=p.length();switch(p.divideScalar(a),d.dot(C)=r&&n.push(e[t]);return n.push(e[e.length-1]),n}}};const tw=new l,nw=new z;var rw=class extends ne{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type=`LineSegmentsGeometry`;let e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute(`position`,new N(e,3)),this.setAttribute(`uv`,new N(t,2))}applyMatrix4(e){let t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let n=new L(t,6,1);return this.setAttribute(`instanceStart`,new ie(n,3,0)),this.setAttribute(`instanceEnd`,new ie(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));let r=new L(n,t*2,1);return this.setAttribute(`instanceColorStart`,new ie(r,t,0)),this.setAttribute(`instanceColorEnd`,new ie(r,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new yt(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new l);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),tw.setFromBufferAttribute(t),this.boundingBox.union(tw))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new nt),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=e.count;i + #include + #include + #include + + uniform float linewidth; + uniform vec2 resolution; + + attribute vec3 instanceStart; + attribute vec3 instanceEnd; + + #ifdef USE_COLOR + #ifdef USE_LINE_COLOR_ALPHA + varying vec4 vLineColor; + attribute vec4 instanceColorStart; + attribute vec4 instanceColorEnd; + #else + varying vec3 vLineColor; + attribute vec3 instanceColorStart; + attribute vec3 instanceColorEnd; + #endif + #endif + + #ifdef WORLD_UNITS + + varying vec4 worldPos; + varying vec3 worldStart; + varying vec3 worldEnd; + + #ifdef USE_DASH + + varying vec2 vUv; + + #endif + + #else + + varying vec2 vUv; + + #endif + + #ifdef USE_DASH + + uniform float dashScale; + attribute float instanceDistanceStart; + attribute float instanceDistanceEnd; + varying float vLineDistance; + + #endif + + void trimSegment( const in vec4 start, inout vec4 end ) { + + // trim end segment so it terminates between the camera plane and the near plane + + // conservative estimate of the near plane + float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column + float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column + float nearEstimate = - 0.5 * b / a; + + float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); + + end.xyz = mix( start.xyz, end.xyz, alpha ); + + } + + void main() { + + #ifdef USE_COLOR + + vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; + + #endif + + #ifdef USE_DASH + + vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; + vUv = uv; + + #endif + + float aspect = resolution.x / resolution.y; + + // camera space + vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); + vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); + + #ifdef WORLD_UNITS + + worldStart = start.xyz; + worldEnd = end.xyz; + + #else + + vUv = uv; + + #endif + + // special case for perspective projection, and segments that terminate either in, or behind, the camera plane + // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space + // but we need to perform ndc-space calculations in the shader, so we must address this issue directly + // perhaps there is a more elegant solution -- WestLangley + + bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column + + if ( perspective ) { + + if ( start.z < 0.0 && end.z >= 0.0 ) { + + trimSegment( start, end ); + + } else if ( end.z < 0.0 && start.z >= 0.0 ) { + + trimSegment( end, start ); + + } + + } + + // clip space + vec4 clipStart = projectionMatrix * start; + vec4 clipEnd = projectionMatrix * end; + + // ndc space + vec3 ndcStart = clipStart.xyz / clipStart.w; + vec3 ndcEnd = clipEnd.xyz / clipEnd.w; + + // direction + vec2 dir = ndcEnd.xy - ndcStart.xy; + + // account for clip-space aspect ratio + dir.x *= aspect; + dir = normalize( dir ); + + #ifdef WORLD_UNITS + + // get the offset direction as perpendicular to the view vector + vec3 worldDir = normalize( end.xyz - start.xyz ); + vec3 offset; + if ( position.y < 0.5 ) { + + offset = normalize( cross( start.xyz, worldDir ) ); + + } else { + + offset = normalize( cross( end.xyz, worldDir ) ); + + } + + // sign flip + if ( position.x < 0.0 ) offset *= - 1.0; + + float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) ); + + // don't extend the line if we're rendering dashes because we + // won't be rendering the endcaps + #ifndef USE_DASH + + // extend the line bounds to encompass endcaps + start.xyz += - worldDir * linewidth * 0.5; + end.xyz += worldDir * linewidth * 0.5; + + // shift the position of the quad so it hugs the forward edge of the line + offset.xy -= dir * forwardOffset; + offset.z += 0.5; + + #endif + + // endcaps + if ( position.y > 1.0 || position.y < 0.0 ) { + + offset.xy += dir * 2.0 * forwardOffset; + + } + + // adjust for linewidth + offset *= linewidth * 0.5; + + // set the world position + worldPos = ( position.y < 0.5 ) ? start : end; + worldPos.xyz += offset; + + // project the worldpos + vec4 clip = projectionMatrix * worldPos; + + // shift the depth of the projected points so the line + // segments overlap neatly + vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; + clip.z = clipPose.z * clip.w; + + #else + + vec2 offset = vec2( dir.y, - dir.x ); + // undo aspect ratio adjustment + dir.x /= aspect; + offset.x /= aspect; + + // sign flip + if ( position.x < 0.0 ) offset *= - 1.0; + + // endcaps + if ( position.y < 0.0 ) { + + offset += - dir; + + } else if ( position.y > 1.0 ) { + + offset += dir; + + } + + // adjust for linewidth + offset *= linewidth; + + // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... + offset /= resolution.y; + + // select end + vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; + + // back to clip space + offset *= clip.w; + + clip.xy += offset; + + #endif + + gl_Position = clip; + + vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation + + #include + #include + #include + + } + `,fragmentShader:` + uniform vec3 diffuse; + uniform float opacity; + uniform float linewidth; + + #ifdef USE_DASH + + uniform float dashOffset; + uniform float dashSize; + uniform float gapSize; + + #endif + + varying float vLineDistance; + + #ifdef WORLD_UNITS + + varying vec4 worldPos; + varying vec3 worldStart; + varying vec3 worldEnd; + + #ifdef USE_DASH + + varying vec2 vUv; + + #endif + + #else + + varying vec2 vUv; + + #endif + + #include + #include + #include + #include + + #ifdef USE_COLOR + #ifdef USE_LINE_COLOR_ALPHA + varying vec4 vLineColor; + #else + varying vec3 vLineColor; + #endif + #endif + + vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { + + float mua; + float mub; + + vec3 p13 = p1 - p3; + vec3 p43 = p4 - p3; + + vec3 p21 = p2 - p1; + + float d1343 = dot( p13, p43 ); + float d4321 = dot( p43, p21 ); + float d1321 = dot( p13, p21 ); + float d4343 = dot( p43, p43 ); + float d2121 = dot( p21, p21 ); + + float denom = d2121 * d4343 - d4321 * d4321; + + float numer = d1343 * d4321 - d1321 * d4343; + + mua = numer / denom; + mua = clamp( mua, 0.0, 1.0 ); + mub = ( d1343 + d4321 * ( mua ) ) / d4343; + mub = clamp( mub, 0.0, 1.0 ); + + return vec2( mua, mub ); + + } + + void main() { + + #include + + #ifdef USE_DASH + + if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps + + if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX + + #endif + + float alpha = opacity; + + #ifdef WORLD_UNITS + + // Find the closest points on the view ray and the line segment + vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; + vec3 lineDir = worldEnd - worldStart; + vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); + + vec3 p1 = worldStart + lineDir * params.x; + vec3 p2 = rayEnd * params.y; + vec3 delta = p1 - p2; + float len = length( delta ); + float norm = len / linewidth; + + #ifndef USE_DASH + + #ifdef USE_ALPHA_TO_COVERAGE + + float dnorm = fwidth( norm ); + alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); + + #else + + if ( norm > 0.5 ) { + + discard; + + } + + #endif + + #endif + + #else + + #ifdef USE_ALPHA_TO_COVERAGE + + // artifacts appear on some hardware if a derivative is taken within a conditional + float a = vUv.x; + float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; + float len2 = a * a + b * b; + float dlen = fwidth( len2 ); + + if ( abs( vUv.y ) > 1.0 ) { + + alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); + + } + + #else + + if ( abs( vUv.y ) > 1.0 ) { + + float a = vUv.x; + float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; + float len2 = a * a + b * b; + + if ( len2 > 1.0 ) discard; + + } + + #endif + + #endif + + vec4 diffuseColor = vec4( diffuse, alpha ); + #ifdef USE_COLOR + #ifdef USE_LINE_COLOR_ALPHA + diffuseColor *= vLineColor; + #else + diffuseColor.rgb *= vLineColor; + #endif + #endif + + #include + + gl_FragColor = diffuseColor; + + #include + #include <${parseInt(Ve.replace(/\D+/g,``))>=154?`colorspace_fragment`:`encodings_fragment`}> + #include + #include + + } + `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA=`1`:delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return`WORLD_UNITS`in this.defines},set:function(e){e===!0?this.defines.WORLD_UNITS=``:delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return`USE_DASH`in this.defines},set(e){!!e!=`USE_DASH`in this.defines&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH=``:delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return`USE_ALPHA_TO_COVERAGE`in this.defines},set:function(e){!!e!=`USE_ALPHA_TO_COVERAGE`in this.defines&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE=``,this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}};const ow=new mt,sw=new z,cw=new z,lw=new mt,uw=new mt,dw=new mt,fw=new z,pw=new ye,mw=new le,hw=new z,gw=new l,_w=new nt,vw=new mt;let yw,bw;function xw(e,t,n){return vw.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),vw.multiplyScalar(1/vw.w),vw.x=bw/n.width,vw.y=bw/n.height,vw.applyMatrix4(e.projectionMatrixInverse),vw.multiplyScalar(1/vw.w),Math.abs(Math.max(vw.x,vw.y))}function Sw(e,t){let n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,o=Math.min(r.instanceCount,i.count);for(let r=0,s=o;ru&&uw.z>u)continue;if(lw.z>u){let e=lw.z-uw.z,t=(lw.z-u)/e;lw.lerp(uw,t)}else if(uw.z>u){let e=uw.z-lw.z,t=(uw.z-u)/e;uw.lerp(lw,t)}lw.applyMatrix4(r),uw.applyMatrix4(r),lw.multiplyScalar(1/lw.w),uw.multiplyScalar(1/uw.w),lw.x*=i.x/2,lw.y*=i.y/2,uw.x*=i.x/2,uw.y*=i.y/2,mw.start.copy(lw),mw.start.z=0,mw.end.copy(uw),mw.end.z=0;let o=mw.closestPointToPointParameter(fw,!0);mw.at(o,hw);let l=_e.lerp(lw.z,uw.z,o),d=l>=-1&&l<=1,f=fw.distanceTo(hw)t)),o=Math.min(e.length,i);return a.slice(0,o).sort().map(t=>e[t])}shuffle(e){return e.map(e=>({value:e,sort:this._getNext()})).sort((e,t)=>e.sort-t.sort).map(({value:e})=>e)}getMulberry32(e=0){return e>0&&e<1&&(e=Math.floor(e*2**16)),()=>{e+=1831565813;let t=e;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}};const eT=[Dw,Ow,kw,Aw,jw],tT=_e.lerp,nT=(e=0,t=Xw)=>{let n=new $w(e).choice(eT);return t.map((t,r)=>{let i=new $w(e*(r*7907+1)+(typeof t.seed==`number`?t.seed:0)),a=i.int(t.length[0],t.length[1]);return Array.from({length:a}).fill(0).map(()=>{let e=n(i.rand());return{texture:i.defaultChoice(t.texture,Zw.texture),size:tT(t.size[0],t.size[1],n(1-e)),distance:tT(t.distance[0],t.distance[1],e),color:i.defaultChoice(t.color,Zw.color)}})}).flat()},rT=(e,t,n=void 0,r=void 0,i=Zw)=>{if(e!==void 0&&e.length>0&&(typeof n==`number`||typeof r<`u`)){let a=nT(n??0,r??Xw),o=a.length,s=e.length;return o>=s?a.map((n,r)=>Object.assign(n,t,rObject.assign({},i,n0){let n=Object.assign({},i,t);return e.map(e=>Object.assign({},n,e))}let a=r===void 0||r.length===0?Xw:r;return nT(n??0,a).map(e=>Object.assign({},e,t))};function iT(e){return aT(e,(e,t)=>t in Zw&&e!==void 0)}function aT(e,t){let n={};return Object.keys(e).forEach(r=>{t(e[r],r)&&(n[r]=e[r])}),n}const oT=H({__name:`component`,props:{scale:{default:1},elements:{default:void 0},seed:{default:void 0},seedProps:{default:void 0},color:{default:void 0},distance:{default:void 0},size:{default:void 0},texture:{default:void 0}},setup(e,{expose:t}){let n=e,r=sn(),i=sn([]),a=sn(iT(n));t({instance:r});let o=new st,s=new WS,c=[],l=()=>{for(var e,t,n;c.length;)c.pop();(e=r.value)==null||e.children.forEach(e=>{`dispose`in e&&e.dispose()}),(t=r.value)==null||t.remove(...r.value.children),(n=r.value)==null||n.dispose()},u=e=>{if(typeof e.texture==`string`){let t=e.texture;e.texture=o.load(t),e.texture.name=t}return e.color=Te(e.color),e},d=()=>{for(let e=i.value.length-1;e{c[t].size=e.size*n.scale})},f=()=>{for(;i.value.length>c.length;){let e={...u(i.value[c.length])};c.push(e),s.addElement(e)}i.value.forEach((e,t)=>{let n=c[t],{texture:r,size:i,distance:a,color:s}=e;if(typeof r==`string`){if(n.texture.name!==r){n.texture.dispose();let e=r;n.texture=o.load(e),n.texture.name=e}}else n.texture!==r&&(n.texture.dispose(),n.texture=r);n.size=i,n.distance=a,n.color=Te(s)}),d()};return Zt(()=>{l()}),Yt(()=>{var e;(e=r.value)==null||e.add(s),i.value=rT(n.elements,a.value,n.seed,n.seedProps)}),K(()=>[n.color,n.distance,n.size,n.texture],()=>{a.value={color:n.color,distance:n.distance,size:n.size,texture:n.texture}}),K(()=>[a.value,n.elements,n.seed,n.seedProps],()=>{i.value=rT(n.elements,a.value,n.seed,n.seedProps)}),K(()=>n.scale,()=>{d()}),K(()=>i.value,()=>{f()}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`lensflareRef`,ref:r},null,512))}}),sT=H({__name:`Levioso`,props:{speed:{default:1},rotationFactor:{default:1},floatFactor:{default:1},range:{default:()=>[-.1,.1]}},setup(e,{expose:t}){let n=e,r=sn();t({instance:r});{let e=Math.random()*1e4,{onBeforeRender:t}=zt(),i=e;t(({delta:e,invalidate:t})=>{if(!r.value)return;i+=e*n.speed;let a=i*.25,o=r.value;o.rotation.x=Math.cos(a)*.125*n.rotationFactor,o.rotation.y=Math.sin(a)*.125*n.rotationFactor,o.rotation.z=Math.sin(a)*.05*n.rotationFactor,o.position.y=_e.mapLinear(Math.sin(a),-1,1,n.range[0],n.range[1])*n.floatFactor,t()})}return(e,t)=>(U(),V(`TresGroup`,Ut(e.$attrs,{ref_key:`groupRef`,ref:r}),[nn(e.$slots,`default`)],16))}}),cT=[`render-order`],lT=H({__name:`component`,props:{id:{default:1},colorWrite:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!1}},setup(e,{expose:t}){let r=e,i=sn();function a(){var e,t;let a=Array.isArray((e=i.value)?.material)?i.value.material[0]:(t=i.value)?.material;a&&(a.colorWrite=r.colorWrite,a.depthWrite=r.depthWrite,a.stencilWrite=!0,a.stencilRef=r.id,a.stencilFunc=n,a.stencilFail=qe,a.stencilZFail=qe,a.stencilZPass=qe)}return jn(a),t({instance:i}),(e,t)=>(U(),V(`TresMesh`,{ref_key:`meshRef`,ref:i,"render-order":-r.id},[nn(e.$slots,`default`)],8,cT))}}),uT=H({__name:`MouseParallax`,props:{disabled:{type:Boolean,default:!1},factor:{default:2.5},ease:{default:.1},local:{type:Boolean,default:!1}},setup(e){let t=e,{camera:n,renderer:r}=Qt(),{disabled:i,factor:a,ease:o,local:s}=pn(t),c={};s.value&&(c.target=r.value.domElement,c.type=`client`);let{x:l,y:u}=Yb(c),{width:d,height:f}=s.value?Ub(r.value.domElement):Zb(),p=sn(),m=W(),h=W();K([a,o],()=>{m.value=Array.isArray(a.value)?a.value:[a.value,a.value],h.value=Array.isArray(o.value)?o.value:[o.value,o.value]},{immediate:!0});let g=Ot(()=>(l.value/d.value-.5)*m.value[0]),_=Ot(()=>-(u.value/f.value-.5)*m.value[1]),{onBeforeRender:v}=zt();return v(({delta:e,invalidate:t})=>{i.value||!p.value||Number.isNaN(g.value)||Number.isNaN(_.value)||(p.value.position.x+=(g.value-p.value.position.x)*h.value[0]*e,p.value.position.y+=(_.value-p.value.position.y)*h.value[1]*e,t())}),K(()=>p.value,e=>e?.add(n.value)),(e,t)=>(U(),V(`TresGroup`,{ref_key:`cameraGroupRef`,ref:p},null,512))}}),dT=ax({screenspace:!1,color:new h(`black`),opacity:1,thickness:.05,size:new pt(1,1)},`#include + #include + #include + uniform float thickness; + uniform bool screenspace; + uniform vec2 size; + void main() { + #if defined (USE_SKINNING) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + vec4 tNormal = vec4(normal, 0.0); + vec4 tPosition = vec4(transformed, 1.0); + #ifdef USE_INSTANCING + tNormal = instanceMatrix * tNormal; + tPosition = instanceMatrix * tPosition; + #endif + if (screenspace) { + vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness; + gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0); + } else { + vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition; + vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal; + vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0; + clipPosition.xy += offset; + gl_Position = clipPosition; + } + }`,`uniform vec3 color; + uniform float opacity; + void main(){ + gl_FragColor = vec4(color, opacity); + #include + #include + }`),fT=H({__name:`component`,props:{color:{default:`black`},screenspace:{type:Boolean,default:!1},opacity:{default:1},transparent:{type:Boolean,default:!1},thickness:{default:.05},angle:{default:Math.PI},toneMapped:{type:Boolean,default:!0},polygonOffset:{type:Boolean,default:!1},polygonOffsetFactor:{default:0},renderOrder:{default:0}},setup(e,{expose:t}){let n=e,r=sn();t({instance:r});let i=new dT({...n}),a=new pt(1,1),o=0,c=null;function l(e){var t;let r=e.parent;if(!(!r||!r.geometry)&&(o!==n.angle||c!==r.geometry)){o=n.angle,c=r.geometry;let a=(t=e.children)?.[0];a&&(n.angle&&a.geometry.dispose(),e.remove(a)),r.skeleton?(a=new tt,a.material=i,a.bind(r.skeleton,r.bindMatrix),e.add(a)):r.isInstancedMesh?(a=new re(r.geometry,i,r.count),a.instanceMatrix=r.instanceMatrix,e.add(a)):(a=new be,a.material=i,e.add(a)),a.geometry=n.angle?px(r.geometry,n.angle):r.geometry}}function u(){i.side=s,i.transparent=n.transparent,i.thickness=n.thickness,i.color=Te(n.color),i.opacity=n.opacity,i.size=a,i.screenspace=n.screenspace,i.toneMapped=n.toneMapped,i.polygonOffset=n.polygonOffset,i.polygonOffsetFactor=n.polygonOffsetFactor}let d=cn().sizes;return K(()=>[d.width.value,d.height.value],([e,t])=>{a.set(e,t)}),K(()=>[n.angle],()=>{r.value&&l(r.value)}),K(()=>[n.transparent,n.thickness,n.color,n.opacity,a,n.screenspace,n.toneMapped,n.polygonOffset,n.polygonOffsetFactor],()=>u(),{immediate:!0}),Yt(()=>l(r.value)),Zt(()=>{var e;let t=(e=r.value)?.children[0];t&&(t.geometry.dispose(),i.dispose(),t.removeFromParent())}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`groupRef`,ref:r},null,512))}}),pT=[`args`],mT=H({__name:`PositionalAudio`,props:{ready:{type:Boolean,default:!1},url:{},distance:{default:2},helper:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},autoplay:{type:Boolean,default:!1},innerAngle:{default:360},outerAngle:{default:360},outerGain:{default:0}},emits:[`isPlaying`],async setup(e,{expose:t,emit:n}){let r,i,s=e,c=n,{ready:u,url:d,distance:f,helper:p,loop:m,autoplay:h,innerAngle:g,outerAngle:_,outerGain:v}=pn(s),{camera:y}=Qt(),b=sn(null),x=sn(null),S=sn(null),C=on(new a),w=()=>{var e,t,n;(e=b?.value)!=null&&e.isPlaying||((t=b?.value)==null||t.play(),c(`isPlaying`,(n=b?.value)?.isPlaying))},T=()=>{var e,t;(e=b?.value)!=null&&e.isPlaying&&(b.value.pause(),c(`isPlaying`,(t=b?.value)?.isPlaying))},E=()=>{var e;b.value&&(b.value.stop(),c(`isPlaying`,(e=b?.value)?.isPlaying))},D=()=>{if(!(b!=null&&b.value))return;E();let e=b.value;e.source&&e.disconnect()},O=()=>{var e,t;!(b!=null&&b.value)||!(x!=null&&x.value)||((e=x?.value)==null||e.dispose(),(t=b?.value)==null||t.remove(x?.value))},k=()=>{var e;if(b.value&&(b.value.setBuffer(S.value),b.value.setRefDistance(f.value),b.value.setLoop(m.value),b.value.setDirectionalCone(g.value,_.value,v.value),(e=x?.value)==null||e.update(),x!=null&&x.value)){let e=x.value.material[0];!e.visible&&_.value!==g.value&&(e.visible=!0)}},A=()=>{var e,t;k();let n=(e=b.value)?.parent,r=new l().setFromObject(n),i=(r.max.z-r.min.z)*2;x.value=new Ew(b.value,i,32,16),(t=b?.value)==null||t.add(x.value),x.value.update()},j=()=>{var e;(e=y?.value)==null||e.remove(C),D(),O()};return t({instance:b,play:w,stop:E,pause:T,dispose:j}),S.value=([r,i]=Mn(()=>se(o,d.value)),r=await r,i(),r),K(b,()=>{b!=null&&b.value&&(p.value&&A(),u.value&&h&&w())}),K(p,()=>{p.value?A():O()}),K(u,()=>{u.value&&k(),h.value&&u.value&&w(),!h.value&&u.value&&E()}),K([f,m,S,g,_,v,h],()=>{k()}),Yt(()=>{var e;(e=y?.value)==null||e.add(C)}),Jt(()=>{j()}),(e,t)=>(U(),V(`TresPositionalAudio`,Ut({ref_key:`positionalAudioRef`,ref:b,args:[G(C)]},e.$attrs),null,16,pT))}}),hT=[`args`,`material-uniforms-color-value`],gT=H({__name:`Reflector`,props:{color:{default:`#333`},textureWidth:{default:512},textureHeight:{default:512},clipBias:{default:0},multisample:{default:4},shader:{default:IS.ReflectorShader}},setup(e,{expose:t}){let n=e,{extend:r,invalidate:i}=Qt(),a=sn();r({Reflector:IS});let{color:o,textureWidth:s,textureHeight:c,clipBias:l,multisample:u,shader:d}=pn(n);return K(n,()=>i()),t({instance:a}),(e,t)=>(U(),V(`TresReflector`,{ref_key:`reflectorRef`,ref:a,args:[void 0,{textureWidth:G(s),textureHeight:G(c),clipBias:G(l),multisample:G(u),shader:G(d)}],"material-uniforms-color-value":G(o)},[nn(e.$slots,`default`,{},()=>[t[0]||=B(`TresPlaneGeometry`,{args:[5,5]},null,-1)])],8,hT))}}),_T=[`position-z`],vT=H({__name:`ScreenSpace`,props:{depth:{default:-1}},setup(e,{expose:t}){let n=sn();return zt().onBeforeRender(({camera:e})=>{n.value&&(n.value.quaternion.copy(e.quaternion),n.value.position.copy(e.position))}),t({instance:n}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`outerRef`,ref:n},[B(`TresGroup`,{"position-z":-e.depth},[nn(e.$slots,`default`)],8,_T)],512))}}),yT=[`args`,`center`],bT=H({__name:`Text3D`,props:{font:{},text:{},size:{default:.5},height:{default:.2},curveSegments:{default:5},bevelEnabled:{type:Boolean,default:!0},bevelThickness:{default:.05},bevelSize:{default:.02},bevelOffset:{default:0},bevelSegments:{default:4},center:{type:Boolean,default:!1},needUpdates:{type:Boolean,default:!1}},async setup(e,{expose:t}){let n,r,i=e,{center:a,font:o,text:s,needUpdates:c,size:l,height:u,curveSegments:d,bevelEnabled:f,bevelThickness:p,bevelSize:m,bevelOffset:h,bevelSegments:g}=pn(i),{extend:_,invalidate:v}=Qt();K(i,()=>v()),_({TextGeometry:BC});let y=new JC,b=wn(),x=Ot(()=>{var e;return s!=null&&s.value?s.value:b.default?(e=b.default()[0].children)?.trim():c.value?``:`TresJS`}),S=sn();t({instance:S});let C=([n,r]=Mn(()=>new Promise((e,t)=>{try{typeof o.value==`string`?y.load(o.value,t=>{e(t)}):e(o.value)}catch(e){t(console.error(`cientos`,e))}})),n=await n,r(),n),w=Ot(()=>({font:C,size:mn(l),height:mn(u),curveSegments:mn(d),bevelEnabled:mn(f),bevelThickness:mn(p),bevelSize:mn(m),bevelOffset:mn(h),bevelSegments:mn(g)}));return jn(()=>{S.value&&c.value&&(S.value.geometry.dispose(),S.value.geometry=new BC(x.value,w.value),a.value&&S.value.geometry.center())}),(e,t)=>G(o)?(U(),V(`TresMesh`,{key:0,ref_key:`text3DRef`,ref:S},[x.value?(U(),V(`TresTextGeometry`,{key:0,args:[x.value,w.value],center:G(a)},null,8,yT)):At(``,!0),nn(e.$slots,`default`)],512)):At(``,!0)}});function xT(e){let t=W(null),{height:n,width:r,settings:i,depth:a,autoRender:o=W(!0)}=Bt(e)?pn(e):pn($t(e)),{onBeforeRender:s}=zt(),{camera:c,renderer:l,scene:u,sizes:d,invalidate:f}=Qt();return K(()=>[r?.value,d.width.value,n?.value,d.height.value],()=>{var e;(e=t.value)==null||e.dispose(),t.value=new _t(r?.value||d.width.value,n?.value||d.height.value,{minFilter:de,magFilter:de,type:te,...i?.value}),a!=null&&a.value&&(t.value.depthTexture=new w(r?.value||d.width.value,n?.value||d.height.value,ee)),f()},{immediate:!0}),s(()=>{o.value&&(l.value.setRenderTarget(t.value),l.value.clear(),l.value.render(u.value,c.value),l.value.setRenderTarget(null))},1/0),Jt(()=>{var e;(e=t.value)==null||e.dispose()}),t}const ST=H({__name:`component`,props:{width:{},height:{},depth:{type:Boolean,default:!1},settings:{default:void 0},autoRender:{type:Boolean,default:!0}},setup(e,{expose:t}){let n=xT(e);return t({instance:n}),()=>{}}}),CT=(e,t=16,n,r,i)=>{let a=new Float32Array(t*16),o=W(new R(a,16));return(()=>{if(!e)return;let a=new tC(e);r&&a.setWeightAttribute(r),a.build();let s=new z,c=new z,l=new h,u=new Ae;e.updateMatrixWorld(!0);for(let r=0;ro()),jn(()=>{var e,t;i.value=n.instanceMesh??(e=r.value)?.children.find(e=>Object.prototype.hasOwnProperty.call(e,`instanceMatrix`)),a.value=n.mesh??(t=r.value)?.children.find(e=>e.type===`Mesh`),CT(a.value,n.count,i.value,n.weight,n.transform)}),t({samplerRef:r}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`samplerRef`,ref:r},[nn(e.$slots,`default`)],512))}}),TT=new z,ET=new z,DT=new z,OT=(e,t,n)=>{let r=n.width/2,i=n.height/2;t.updateMatrixWorld(!1);let a=e.project(t);return a.x=a.x*r+r,a.y=-(a.y*i)+i,a},kT=(e,t,n,r=1)=>{let i=TT.set(e.x/n.width*2-1,-(e.y/n.height)*2+1,r);return i.unproject(t),i},AT=(e,t,n,r)=>{let i=OT(DT.copy(e),n,r),a=0;for(let o=0;o<2;++o){let s=ET.copy(i).setComponent(o,i.getComponent(o)+t),c=kT(s,n,r,s.z);a=Math.max(a,e.distanceTo(c))}return a},jT=H({__name:`ScreenSizer`,setup(e,{expose:t}){let n=new z,r=sn(),i=sn(),a=cn().sizes,o=Ot(()=>({width:a.width.value,height:a.height.value}));return zt().onBeforeRender(({camera:e})=>{let t=i.value;if(!t)return;let r=AT(t.getWorldPosition(n),1,e,o.value);t.scale.setScalar(r)}),t({instance:r}),(e,t)=>(U(),V(`TresObject3D`,{ref_key:`outerRef`,ref:r},[B(`TresObject3D`,{ref_key:`innerRef`,ref:i},[nn(e.$slots,`default`)],512)],512))}}),MT=[`color`],NT=H({__name:`Edges`,props:{color:{default:`#ff0000`},threshold:{default:15}},setup(e,{expose:t}){let n=e,{color:r,threshold:i}=pn(n),a=sn(),o=W(null),s=W(1);return t({instance:a}),K(()=>[a.value,i.value],()=>{if(a.value){let e=a.value.parent;if(e&&`geometry`in e&&e.geometry instanceof f){let t=e.geometry;(t!==o.value||i.value!==s.value)&&(o.value=t,s.value=i.value,a.value.geometry=new E(t,i.value))}}}),(e,t)=>(U(),V(`TresLineSegments`,Ut({ref_key:`lineSegmentsRef`,ref:a},e.$attrs),[nn(e.$slots,`default`,{},()=>[B(`TresLineBasicMaterial`,{color:G(r)},null,8,MT)])],16))}}),PT={sunset:`venice/venice_sunset_1k.hdr`,studio:`studio/poly_haven_studio_1k.hdr`,city:`city/canary_wharf_1k.hdr`,umbrellas:`outdoor/outdoor_umbrellas_1k.hdr`,night:`outdoor/satara_night_1k.hdr`,forest:`outood/mossy_forest_1k.hdr`,snow:`outdoor/snowy_forest_path_01_1k.hdr`,dawn:`kiara/kiara_1_dawn_1k.hdr`,hangar:`indoor/small_hangar_01_1k.hdr`,urban:`indoor/abandoned_games_room_02_1k.hdr`,modern:`city/modern_buildings_2_1k.hdr`,shangai:`city/shanghai_bund_1k.hdr`},FT=`https://raw.githubusercontent.com/Tresjs/assets/main/textures/hdr/`;function IT(e){return e instanceof k?e:Array.isArray(e)?new k(e[0],e[1],e[2]):typeof e==`number`?new k(e,e,e):e instanceof z||typeof e==`object`&&`x`in e&&`y`in e&&`z`in e?new k(e.x,e.y,e.z):null}function LT(e){e.traverse(e=>{e instanceof be&&e.material&&(e.material.needsUpdate=!0)})}async function RT(e,t){let{scene:n,invalidate:r}=Qt(),{preset:i,blur:a,files:o=W([]),path:s=W(``),background:c,backgroundIntensity:l=W(1),environmentIntensity:u=W(1),backgroundRotation:d=W([0,0,0]),environmentRotation:f=W([0,0,0]),syncMaterials:p=W(!1)}=pn(e);K(e,()=>{r()});let m=W(null),h=Ot(()=>Array.isArray(o.value)),g=Ot(()=>h.value?y:QC);return K([o,s],async([e,t])=>{if(e&&e.length>0&&!(i!=null&&i.value)){try{let n=await se(g.value,h.value?[...G(e)]:G(e),e=>{t&&e.setPath(G(t))});m.value=Array.isArray(n)?n[0]:n}catch(e){throw Error(`Failed to load environment map: ${e}`)}m.value&&(m.value.mapping=h.value?v:O)}},{immediate:!0}),K(m,e=>{n.value&&e&&(n.value.environment=e)},{immediate:!0}),K([c,m],([e,r])=>{if(n.value){let i=t!=null&&t.value?t.value.texture:r;i&&(n.value.background=e?i:null)}},{immediate:!0}),K(()=>a?.value,e=>{n.value&&e&&(n.value.backgroundBlurriness=e)},{immediate:!0}),K(()=>l?.value,e=>{n.value&&(n.value.backgroundIntensity=e??1)},{immediate:!0}),K(()=>u?.value,e=>{n.value&&(n.value.environmentIntensity=e??1)},{immediate:!0}),K(()=>d?.value,e=>{if(n.value){let t=IT(e);t&&(n.value.backgroundRotation=t)}},{immediate:!0}),K(()=>f?.value,e=>{if(n.value&&!(p!=null&&p.value)){let t=IT(e);t&&(n.value.environmentRotation=t,LT(n.value))}},{immediate:!0}),K(()=>i?.value,async e=>{if(e&&e in PT){let t=FT,n=PT[e];try{let e=await se(QC,n,e=>{t&&e.setPath(t)});m.value=Array.isArray(e)?e[0]:e}catch(e){throw Error(`Failed to load environment map: ${e}`)}m.value&&(m.value.mapping=O),r()}else if(e&&!(e in PT))throw Error(`Preset must be one of: ${Object.keys(PT).join(`, `)}`)},{immediate:!0}),K([p,d],([e,t])=>{if(e&&n.value){let e=IT(t);e&&(n.value.environmentRotation=e,LT(n.value))}},{immediate:!0}),m} +/*! +* camera-controls +* https://github.com/yomotsu/camera-controls +* (c) 2017 @yomotsu +* Released under the MIT License. +*/ +const zT={LEFT:1,RIGHT:2,MIDDLE:4},J=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),BT={NONE:0,IN:1,OUT:-1};function VT(e){return e.isPerspectiveCamera}function HT(e){return e.isOrthographicCamera}const UT=Math.PI*2,WT=Math.PI/2,GT=1e-5,KT=Math.PI/180;function qT(e,t,n){return Math.max(t,Math.min(n,e))}function JT(e,t=GT){return Math.abs(e)0==p>u&&(p=u,n.value=(p-u)/a),p}function eE(e,t,n,r,i=1/0,a,o){r=Math.max(1e-4,r);let s=2/r,c=s*a,l=1/(1+c+.48*c*c+.235*c*c*c),u=t.x,d=t.y,f=t.z,p=e.x-u,m=e.y-d,h=e.z-f,g=u,_=d,v=f,y=i*r,b=y*y,x=p*p+m*m+h*h;if(x>b){let e=Math.sqrt(x);p=p/e*y,m=m/e*y,h=h/e*y}u=e.x-p,d=e.y-m,f=e.z-h;let S=(n.x+s*p)*a,C=(n.y+s*m)*a,w=(n.z+s*h)*a;n.x=(n.x-s*S)*l,n.y=(n.y-s*C)*l,n.z=(n.z-s*w)*l,o.x=u+(p+S)*l,o.y=d+(m+C)*l,o.z=f+(h+w)*l;let T=g-e.x,E=_-e.y,D=v-e.z,O=o.x-g,k=o.y-_,A=o.z-v;return T*O+E*k+D*A>0&&(o.x=g,o.y=_,o.z=v,n.x=(o.x-g)/a,n.y=(o.y-_)/a,n.z=(o.z-v)/a),o}function tE(e,t){t.set(0,0),e.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=e.length,t.y/=e.length}function nE(e,t){return HT(e)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}var rE=class{constructor(){this._listeners={}}addEventListener(e,t){let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners[e];if(n!==void 0){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){let t=this._listeners[e.type];if(t!==void 0){e.target=this;let n=t.slice(0);for(let t=0,r=n.length;t{},this._enabled=!0,this._state=J.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=BT.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new cE.Vector3,this._focalOffsetVelocity=new cE.Vector3,this._zoomVelocity={value:0},this._truckInternal=(e,t,n)=>{let r,i;if(VT(this._camera)){let n=pE.copy(this._camera.position).sub(this._target),a=this._camera.getEffectiveFOV()*KT,o=n.length()*Math.tan(a*.5);r=this.truckSpeed*e*o/this._elementRect.height,i=this.truckSpeed*t*o/this._elementRect.height}else if(HT(this._camera)){let n=this._camera;r=e*(n.right-n.left)/n.zoom/this._elementRect.width,i=t*(n.top-n.bottom)/n.zoom/this._elementRect.height}else return;this.verticalDragToForward?(n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(r,0,!0),this.forward(-i,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y+i,this._focalOffsetEnd.z,!0):this.truck(r,i,!0)},this._rotateInternal=(e,t)=>{let n=UT*this.azimuthRotateSpeed*e/this._elementRect.height,r=UT*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(n,r,!0)},this._dollyInternal=(e,t,n)=>{let r=.95**(-e*this.dollySpeed),i=this._sphericalEnd.radius,a=this._sphericalEnd.radius*r,o=qT(a,this.minDistance,this.maxDistance),s=o-a;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(a,!0):(this.infinityDolly&&!this.dollyToCursor&&this.dollyInFixed(s,!0),this._dollyToNoClamp(o,!0)),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?a:o)-i,this._dollyControlCoord.set(t,n)),this._lastDollyDirection=Math.sign(-e)},this._zoomInternal=(e,t,n)=>{let r=.95**(e*this.dollySpeed),i=this._zoom,a=this._zoom*r;this.zoomTo(a,!0),this.dollyToCursor&&(this._changedZoom+=a-i,this._dollyControlCoord.set(t,n))},typeof cE>`u`&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new cE.Quaternion().setFromUnitVectors(this._camera.up,uE),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=J.NONE,this._target=new cE.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new cE.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new cE.Spherical().setFromVector3(pE.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new cE.Vector3,new cE.Vector3,new cE.Vector3,new cE.Vector3],this._updateNearPlaneCorners(),this._boundary=new cE.Box3(new cE.Vector3(-1/0,-1/0,-1/0),new cE.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new cE.Vector2,this.mouseButtons={left:J.ROTATE,middle:J.DOLLY,right:J.TRUCK,wheel:VT(this._camera)?J.DOLLY:HT(this._camera)?J.ZOOM:J.NONE},this.touches={one:J.TOUCH_ROTATE,two:VT(this._camera)?J.TOUCH_DOLLY_TRUCK:HT(this._camera)?J.TOUCH_ZOOM_TRUCK:J.NONE,three:J.TOUCH_TRUCK};let r=new cE.Vector2,i=new cE.Vector2,a=new cE.Vector2,o=e=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){let t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(nthis._interactiveArea.right||rthis._interactiveArea.bottom)return}let t=e.pointerType===`mouse`?(e.buttons&zT.LEFT)===zT.LEFT?zT.LEFT:(e.buttons&zT.MIDDLE)===zT.MIDDLE?zT.MIDDLE:(e.buttons&zT.RIGHT)===zT.RIGHT?zT.RIGHT:null:null;if(t!==null){let e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}if((e.buttons&zT.LEFT)===zT.LEFT&&this._lockedPointer)return;let n={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:t};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.ownerDocument.addEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.addEventListener(`pointerup`,c),this._isDragging=!0,f(e)},s=e=>{e.cancelable&&e.preventDefault();let t=e.pointerId,n=this._lockedPointer||this._findPointerById(t);if(n){if(n.clientX=e.clientX,n.clientY=e.clientY,n.deltaX=e.movementX,n.deltaY=e.movementY,this._state=0,e.pointerType===`touch`)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else (!this._isDragging&&this._lockedPointer||this._isDragging&&(e.buttons&zT.LEFT)===zT.LEFT)&&(this._state|=this.mouseButtons.left),this._isDragging&&(e.buttons&zT.MIDDLE)===zT.MIDDLE&&(this._state|=this.mouseButtons.middle),this._isDragging&&(e.buttons&zT.RIGHT)===zT.RIGHT&&(this._state|=this.mouseButtons.right);p()}},c=e=>{let t=this._findPointerById(e.pointerId);if(!(t&&t===this._lockedPointer)){if(t&&this._disposePointer(t),e.pointerType===`touch`)switch(this._activePointers.length){case 0:this._state=J.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=J.NONE;m()}},l=-1,u=e=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===J.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){let t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(nthis._interactiveArea.right||rthis._interactiveArea.bottom)return}if(e.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===J.ROTATE||this.mouseButtons.wheel===J.TRUCK){let e=performance.now();l-e<1e3&&this._getClientRect(this._elementRect),l=e}let t=sE?-1:-3,n=e.deltaMode===1?e.deltaY/t:e.deltaY/(t*10),r=this.dollyToCursor?(e.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,i=this.dollyToCursor?(e.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case J.ROTATE:this._rotateInternal(e.deltaX,e.deltaY),this._isUserControllingRotate=!0;break;case J.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1),this._isUserControllingTruck=!0;break;case J.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0),this._isUserControllingOffset=!0;break;case J.DOLLY:this._dollyInternal(-n,r,i),this._isUserControllingDolly=!0;break;case J.ZOOM:this._zoomInternal(-n,r,i),this._isUserControllingZoom=!0;break}this.dispatchEvent({type:`control`})},d=t=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===e.ACTION.NONE){let e=t instanceof PointerEvent?t.pointerId:0,n=this._findPointerById(e);n&&this._disposePointer(n),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c);return}t.preventDefault()}},f=e=>{if(this._enabled){if(tE(this._activePointers,fE),this._getClientRect(this._elementRect),r.copy(fE),i.copy(fE),this._activePointers.length>=2){let e=fE.x-this._activePointers[1].clientX,t=fE.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t);a.set(0,n);let r=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,o=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(r,o)}if(this._state=0,!e)this._lockedPointer&&(this._state|=this.mouseButtons.left);else if(`pointerType`in e&&e.pointerType===`touch`)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else !this._lockedPointer&&(e.buttons&zT.LEFT)===zT.LEFT&&(this._state|=this.mouseButtons.left),(e.buttons&zT.MIDDLE)===zT.MIDDLE&&(this._state|=this.mouseButtons.middle),(e.buttons&zT.RIGHT)===zT.RIGHT&&(this._state|=this.mouseButtons.right);((this._state&J.ROTATE)===J.ROTATE||(this._state&J.TOUCH_ROTATE)===J.TOUCH_ROTATE||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&J.TRUCK)===J.TRUCK||(this._state&J.TOUCH_TRUCK)===J.TOUCH_TRUCK||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&J.DOLLY)===J.DOLLY||(this._state&J.TOUCH_DOLLY)===J.TOUCH_DOLLY||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&J.ZOOM)===J.ZOOM||(this._state&J.TOUCH_ZOOM)===J.TOUCH_ZOOM||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&J.OFFSET)===J.OFFSET||(this._state&J.TOUCH_OFFSET)===J.TOUCH_OFFSET||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:`controlstart`})}},p=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,tE(this._activePointers,fE);let e=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,t=e?-e.deltaX:i.x-fE.x,n=e?-e.deltaY:i.y-fE.y;if(i.copy(fE),((this._state&J.ROTATE)===J.ROTATE||(this._state&J.TOUCH_ROTATE)===J.TOUCH_ROTATE||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(t,n),this._isUserControllingRotate=!0),(this._state&J.DOLLY)===J.DOLLY||(this._state&J.ZOOM)===J.ZOOM){let e=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,t=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0,i=this.dollyDragInverted?-1:1;(this._state&J.DOLLY)===J.DOLLY?(this._dollyInternal(i*n*oE,e,t),this._isUserControllingDolly=!0):(this._zoomInternal(i*n*oE,e,t),this._isUserControllingZoom=!0)}if((this._state&J.TOUCH_DOLLY)===J.TOUCH_DOLLY||(this._state&J.TOUCH_ZOOM)===J.TOUCH_ZOOM||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE){let e=fE.x-this._activePointers[1].clientX,t=fE.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t),r=a.y-n;a.set(0,n);let o=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,s=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&J.TOUCH_DOLLY)===J.TOUCH_DOLLY||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET?(this._dollyInternal(r*oE,o,s),this._isUserControllingDolly=!0):(this._zoomInternal(r*oE,o,s),this._isUserControllingZoom=!0)}((this._state&J.TRUCK)===J.TRUCK||(this._state&J.TOUCH_TRUCK)===J.TOUCH_TRUCK||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(t,n,!1),this._isUserControllingTruck=!0),((this._state&J.OFFSET)===J.OFFSET||(this._state&J.TOUCH_OFFSET)===J.TOUCH_OFFSET||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(t,n,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:`control`})},m=()=>{tE(this._activePointers,fE),i.copy(fE),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this.dispatchEvent({type:`controlend`}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener(`pointerlockchange`,h),this._domElement.ownerDocument.addEventListener(`pointerlockerror`,g),this._domElement.ownerDocument.addEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.addEventListener(`pointerup`,c),f())},this.unlockPointer=()=>{var e,t,n;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(e=this._domElement)==null||e.ownerDocument.exitPointerLock(),(t=this._domElement)==null||t.ownerDocument.removeEventListener(`pointerlockchange`,h),(n=this._domElement)==null||n.ownerDocument.removeEventListener(`pointerlockerror`,g),this.cancel()};let h=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},g=()=>{this.unlockPointer()};this._addAllEventListeners=e=>{this._domElement=e,this._domElement.style.touchAction=`none`,this._domElement.style.userSelect=`none`,this._domElement.style.webkitUserSelect=`none`,this._domElement.addEventListener(`pointerdown`,o),this._domElement.addEventListener(`pointercancel`,c),this._domElement.addEventListener(`wheel`,u,{passive:!1}),this._domElement.addEventListener(`contextmenu`,d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction=``,this._domElement.style.userSelect=``,this._domElement.style.webkitUserSelect=``,this._domElement.removeEventListener(`pointerdown`,o),this._domElement.removeEventListener(`pointercancel`,c),this._domElement.removeEventListener(`wheel`,u,{passive:!1}),this._domElement.removeEventListener(`contextmenu`,d),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.ownerDocument.removeEventListener(`pointerlockchange`,h),this._domElement.ownerDocument.removeEventListener(`pointerlockerror`,g))},this.cancel=()=>{this._state!==J.NONE&&(this._state=J.NONE,this._activePointers.length=0,m())},n&&this.connect(n),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction=`none`,this._domElement.style.userSelect=`none`,this._domElement.style.webkitUserSelect=`none`):(this.cancel(),this._domElement.style.touchAction=``,this._domElement.style.userSelect=``,this._domElement.style.webkitUserSelect=``))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=qT(e.width,0,1),this._interactiveArea.height=qT(e.height,0,1),this._interactiveArea.x=qT(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=qT(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,n=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,n=!1){this._isUserControllingRotate=!1;let r=qT(e,this.minAzimuthAngle,this.maxAzimuthAngle),i=qT(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=i,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);let a=!n||YT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&YT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(a)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=BT.NONE,this._changedDolly=0,this._dollyToNoClamp(qT(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){let n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){let t=this._collisionTest(),r=YT(t,this._spherical.radius);if(!(n>e)&&r)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,t)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);let r=!t||YT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(gE).multiplyScalar(e)),t||this._target.copy(this._targetEnd);let n=!t||YT(this._target.x,this._targetEnd.x,this.restThreshold)&&YT(this._target.y,this._targetEnd.y,this.restThreshold)&&YT(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=qT(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);let n=!t||YT(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t,n=!1){this._camera.updateMatrix(),_E.setFromMatrixColumn(this._camera.matrix,0),vE.setFromMatrixColumn(this._camera.matrix,1),_E.multiplyScalar(e),vE.multiplyScalar(-t);let r=pE.copy(_E).add(vE),i=mE.copy(this._targetEnd).add(r);return this.moveTo(i.x,i.y,i.z,n)}forward(e,t=!1){pE.setFromMatrixColumn(this._camera.matrix,0),pE.crossVectors(this._camera.up,pE),pE.multiplyScalar(e);let n=mE.copy(this._targetEnd).add(pE);return this.moveTo(n.x,n.y,n.z,t)}elevate(e,t=!1){return pE.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+pE.x,this._targetEnd.y+pE.y,this._targetEnd.z+pE.z,t)}moveTo(e,t,n,r=!1){this._isUserControllingTruck=!1;let i=pE.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,i,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);let a=!r||YT(this._target.x,this._targetEnd.x,this.restThreshold)&&YT(this._target.y,this._targetEnd.y,this.restThreshold)&&YT(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}lookInDirectionOf(e,t,n,r=!1){let i=pE.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(i.x,i.y,i.z,r)}fitToBox(e,t,{cover:n=!1,paddingLeft:r=0,paddingRight:i=0,paddingBottom:a=0,paddingTop:o=0}={}){let s=[],c=e.isBox3?wE.copy(e):wE.setFromObject(e);c.isEmpty()&&(console.warn(`camera-controls: fitTo() cannot be used with an empty box. Aborting`),Promise.resolve());let l=XT(this._sphericalEnd.theta,WT),u=XT(this._sphericalEnd.phi,WT);s.push(this.rotateTo(l,u,t));let d=pE.setFromSpherical(this._sphericalEnd).normalize(),f=DE.setFromUnitVectors(d,dE),p=YT(Math.abs(d.y),1);p&&f.multiply(OE.setFromAxisAngle(uE,l)),f.multiply(this._yAxisUpSpaceInverse);let m=TE.makeEmpty();mE.copy(c.min).applyQuaternion(f),m.expandByPoint(mE),mE.copy(c.min).setX(c.max.x).applyQuaternion(f),m.expandByPoint(mE),mE.copy(c.min).setY(c.max.y).applyQuaternion(f),m.expandByPoint(mE),mE.copy(c.max).setZ(c.min.z).applyQuaternion(f),m.expandByPoint(mE),mE.copy(c.min).setZ(c.max.z).applyQuaternion(f),m.expandByPoint(mE),mE.copy(c.max).setY(c.min.y).applyQuaternion(f),m.expandByPoint(mE),mE.copy(c.max).setX(c.min.x).applyQuaternion(f),m.expandByPoint(mE),mE.copy(c.max).applyQuaternion(f),m.expandByPoint(mE),m.min.x-=r,m.min.y-=a,m.max.x+=i,m.max.y+=o,f.setFromUnitVectors(dE,d),p&&f.premultiply(OE.invert()),f.premultiply(this._yAxisUpSpace);let h=m.getSize(pE),g=m.getCenter(mE).applyQuaternion(f);if(VT(this._camera)){let e=this.getDistanceToFitBox(h.x,h.y,h.z,n);s.push(this.moveTo(g.x,g.y,g.z,t)),s.push(this.dollyTo(e,t)),s.push(this.setFocalOffset(0,0,0,t))}else if(HT(this._camera)){let e=this._camera,r=e.right-e.left,i=e.top-e.bottom,a=n?Math.max(r/h.x,i/h.y):Math.min(r/h.x,i/h.y);s.push(this.moveTo(g.x,g.y,g.z,t)),s.push(this.zoomTo(a,t)),s.push(this.setFocalOffset(0,0,0,t))}return Promise.all(s)}fitToSphere(t,n){let r=[],i=`isObject3D`in t?e.createBoundingSphere(t,EE):EE.copy(t);if(r.push(this.moveTo(i.center.x,i.center.y,i.center.z,n)),VT(this._camera)){let e=this.getDistanceToFitSphere(i.radius);r.push(this.dollyTo(e,n))}else if(HT(this._camera)){let e=this._camera.right-this._camera.left,t=this._camera.top-this._camera.bottom,a=2*i.radius,o=Math.min(e/a,t/a);r.push(this.zoomTo(o,n))}return r.push(this.setFocalOffset(0,0,0,n)),Promise.all(r)}setLookAt(e,t,n,r,i,a,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=BT.NONE,this._changedDolly=0;let s=mE.set(r,i,a),c=pE.set(e,t,n);this._targetEnd.copy(s),this._sphericalEnd.setFromVector3(c.sub(s).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let l=!o||YT(this._target.x,this._targetEnd.x,this.restThreshold)&&YT(this._target.y,this._targetEnd.y,this.restThreshold)&&YT(this._target.z,this._targetEnd.z,this.restThreshold)&&YT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&YT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&YT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(l)}lerpLookAt(e,t,n,r,i,a,o,s,c,l,u,d,f,p=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=BT.NONE,this._changedDolly=0;let m=pE.set(r,i,a),h=mE.set(e,t,n);SE.setFromVector3(h.sub(m).applyQuaternion(this._yAxisUpSpace));let g=hE.set(l,u,d),_=mE.set(o,s,c);CE.setFromVector3(_.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(m.lerp(g,f));let v=CE.theta-SE.theta,y=CE.phi-SE.phi,b=CE.radius-SE.radius;this._sphericalEnd.set(SE.radius+b*f,SE.phi+y*f,SE.theta+v*f),this.normalizeRotations(),this._needsUpdate=!0,p||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let x=!p||YT(this._target.x,this._targetEnd.x,this.restThreshold)&&YT(this._target.y,this._targetEnd.y,this.restThreshold)&&YT(this._target.z,this._targetEnd.z,this.restThreshold)&&YT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&YT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&YT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(x)}setPosition(e,t,n,r=!1){return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n,r=!1){let i=this.getPosition(pE),a=this.setLookAt(i.x,i.y,i.z,e,t,n,r);return this._sphericalEnd.phi=qT(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),a}setFocalOffset(e,t,n,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);let i=!r||YT(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&YT(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&YT(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),_E.setFromMatrixColumn(this._camera.matrixWorldInverse,0),vE.setFromMatrixColumn(this._camera.matrixWorldInverse,1),yE.setFromMatrixColumn(this._camera.matrixWorldInverse,2);let r=pE.set(e,t,n),i=r.distanceTo(this._camera.position),a=r.sub(this._camera.position);_E.multiplyScalar(a.x),vE.multiplyScalar(a.y),yE.multiplyScalar(a.z),pE.copy(_E).add(vE).add(yE),pE.z+=i,this.dollyTo(i,!1),this.setFocalOffset(-pE.x,pE.y,-pE.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new cE.Vector4,typeof e==`number`?this._viewport.set(e,t,n,r):this._viewport.copy(e)}getDistanceToFitBox(e,t,n,r=!1){if(nE(this._camera,`getDistanceToFitBox`))return this._spherical.radius;let i=e/t,a=this._camera.getEffectiveFOV()*KT,o=this._camera.aspect;return((r?i>o:it.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){let r=t.lengthSq();if(r===0)return e;let i=mE.copy(t).add(e),a=this._boundary.clampPoint(i,hE).sub(i),o=a.lengthSq();if(o===0)return e.add(t);if(o===r)return e;if(n===0)return e.add(t).add(a);{let r=1+n*o/t.dot(a);return e.add(mE.copy(t).multiplyScalar(r)).add(a.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(VT(this._camera)){let e=this._camera,t=e.near,n=e.getEffectiveFOV()*KT,r=Math.tan(n*.5)*t,i=r*e.aspect;this._nearPlaneCorners[0].set(-i,-r,0),this._nearPlaneCorners[1].set(i,-r,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(-i,r,0)}else if(HT(this._camera)){let e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,i=e.top*t,a=e.bottom*t;this._nearPlaneCorners[0].set(n,i,0),this._nearPlaneCorners[1].set(r,i,0),this._nearPlaneCorners[2].set(r,a,0),this._nearPlaneCorners[3].set(n,a,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||nE(this._camera,`_collisionTest`))return e;let t=this._getTargetDirection(gE);kE.lookAt(lE,t,this._camera.up);for(let n=0;n<4;n++){let r=mE.copy(this._nearPlaneCorners[n]);r.applyMatrix4(kE);let i=hE.addVectors(this._target,r);AE.set(i,t),AE.far=this._spherical.radius+1;let a=AE.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{let t=()=>{this.removeEventListener(`rest`,t),e()};this.addEventListener(`rest`,t)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(`.dampingFactor has been deprecated. use smoothTime (in seconds) instead.`),0}set dampingFactor(e){console.warn(`.dampingFactor has been deprecated. use smoothTime (in seconds) instead.`)}get draggingDampingFactor(){return console.warn(`.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.`),0}set draggingDampingFactor(e){console.warn(`.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.`)}static createBoundingSphere(e,t=new cE.Sphere){let n=t,r=n.center;wE.makeEmpty(),e.traverseVisible(e=>{e.isMesh&&wE.expandByObject(e)}),wE.getCenter(r);let i=0;return e.traverseVisible(e=>{if(!e.isMesh)return;let t=e,n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);let a=n.attributes.position;for(let e=0,t=a.count;e!!(e&&e.isPerspectiveCamera),NE=e=>!!(e&&e.isOrthographicCamera),PE=`min-polar-angle.max-polar-angle.min-azimuth-angle.max-azimuth-angle.distance.min-distance.max-distance.infinity-dolly.min-zoom.max-zoom.smooth-time.dragging-smooth-time.max-speed.azimuth-rotate-speed.polar-rotate-speed.dolly-speed.dolly-drag-inverted.truck-speed.dolly-to-cursor.drag-to-offset.vertical-drag-to-forward.boundary-friction.rest-threshold.collider-meshes.args.mouse-buttons.touches`.split(`.`),FE=(e,t)=>({left:jE.ACTION.ROTATE,middle:jE.ACTION.DOLLY,right:jE.ACTION.TRUCK,wheel:ME(e)?jE.ACTION.DOLLY:NE(e)?jE.ACTION.ZOOM:jE.ACTION.NONE,...t}),IE=(e,t)=>({one:jE.ACTION.TOUCH_ROTATE,two:ME(e)?jE.ACTION.TOUCH_DOLLY_TRUCK:NE(e)?jE.ACTION.TOUCH_ZOOM_TRUCK:jE.ACTION.NONE,three:jE.ACTION.TOUCH_TRUCK,...t}),LE=H({__name:`CameraControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},minPolarAngle:{default:0},maxPolarAngle:{default:Math.PI},minAzimuthAngle:{default:-1/0},maxAzimuthAngle:{default:1/0},distance:{default:()=>Qt().camera.value.position.z},minDistance:{default:2**-52},maxDistance:{default:1/0},infinityDolly:{type:Boolean,default:!1},minZoom:{default:.01},maxZoom:{default:1/0},smoothTime:{default:.25},draggingSmoothTime:{default:.125},maxSpeed:{default:1/0},azimuthRotateSpeed:{default:1},polarRotateSpeed:{default:1},dollySpeed:{default:1},dollyDragInverted:{type:Boolean,default:!1},truckSpeed:{default:2},dollyToCursor:{type:Boolean,default:!1},dragToOffset:{type:Boolean,default:!1},verticalDragToForward:{type:Boolean,default:!1},boundaryFriction:{default:0},restThreshold:{default:.01},colliderMeshes:{default:()=>[]},mouseButtons:{default:()=>FE(Qt().camera.value)},touches:{default:()=>IE(Qt().camera.value)}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,i=n,{makeDefault:a,minPolarAngle:o,maxPolarAngle:s,minAzimuthAngle:c,maxAzimuthAngle:u,distance:d,minDistance:f,maxDistance:p,infinityDolly:m,minZoom:h,maxZoom:g,smoothTime:_,draggingSmoothTime:v,maxSpeed:y,azimuthRotateSpeed:b,polarRotateSpeed:x,dollySpeed:S,dollyDragInverted:C,truckSpeed:w,dollyToCursor:T,dragToOffset:E,verticalDragToForward:D,boundaryFriction:O,restThreshold:k,colliderMeshes:A}=pn(r),j={Box3:l,MathUtils:{clamp:_e.clamp},Matrix4:ye,Quaternion:Be,Raycaster:Ge,Sphere:nt,Spherical:it,Vector2:pt,Vector3:z,Vector4:mt};jE.install({THREE:j});let{camera:M,renderer:N,extend:ee,controls:P,invalidate:F}=Qt();K(r,()=>{F()});let I=Ot(()=>FE(r.camera||M.value,r.mouseButtons)),te=Ot(()=>IE(r.camera||M.value,r.touches)),ne=sn(null);ee({CameraControls:jE}),jn(()=>{L(),ne.value&&a.value?P.value=ne.value:P.value=null});function L(){Rb(ne.value,`update`,()=>{i(`change`,ne.value),F()}),Rb(ne.value,`controlend`,()=>i(`end`,ne.value)),Rb(ne.value,`controlstart`,()=>i(`start`,ne.value))}let{onBeforeRender:re}=zt();return re(({delta:e,invalidate:t})=>{var n,r;(n=ne.value)!=null&&n.enabled&&((r=ne.value)==null||r.update(e),t())}),Zt(()=>{ne.value&&ne.value.disconnect()}),t({instance:ne}),(e,t)=>(e.camera||G(M))&&(e.domElement||G(N))?(U(),V(`TresCameraControls`,{key:0,ref_key:`controlsRef`,ref:ne,"min-polar-angle":G(o),"max-polar-angle":G(s),"min-azimuth-angle":G(c),"max-azimuth-angle":G(u),distance:G(d),"min-distance":G(f),"max-distance":G(p),"infinity-dolly":G(m),"min-zoom":G(h),"max-zoom":G(g),"smooth-time":G(_),"dragging-smooth-time":G(v),"max-speed":G(y),"azimuth-rotate-speed":G(b),"polar-rotate-speed":G(x),"dolly-speed":G(S),"dolly-drag-inverted":G(C),"truck-speed":G(w),"dolly-to-cursor":G(T),"drag-to-offset":G(E),"vertical-drag-to-forward":G(D),"boundary-friction":G(O),"rest-threshold":G(k),"collider-meshes":G(A),args:[e.camera||G(M),e.domElement||G(N).domElement],"mouse-buttons":I.value,touches:te.value},null,8,PE)):At(``,!0)}}),RE=H({__name:`KeyboardControls`,props:{makeDefault:{type:Boolean,default:!0},camera:{},domElement:{},moveSpeed:{default:.2},selector:{}},emits:[`isLock`,`change`],setup(e,{expose:t,emit:n}){let r=e,i=n,{moveSpeed:a}=pn(r),{camera:o,controls:s,renderer:c,invalidate:l}=Qt();K(r,()=>{l()});let u=W(0),d=W(0),{KeyW:f,KeyA:p,KeyS:m,KeyD:h,Up:g,Down:_,Left:v,Right:y}=qb();jn(()=>{p.value||v.value?u.value=-a.value:h.value||y.value?u.value=a.value:u.value=0,f.value||g.value?d.value=a.value:m.value||_.value?d.value=-a.value:d.value=0}),t({instance:s});let b=e=>i(`isLock`,e),x=e=>i(`change`,e),S=new z,C=new z,w=new Be,T=(e,t)=>{var n;if(!((n=o.value)!=null&&n.position)&&!S)return;let r=o.value,a=e*.001;r?.translateZ(-t),w.set(C.x*a,C.y*a,C.z*a,1).normalize(),r?.quaternion.multiply(w),(u.value||d.value)&&i(`change`,s.value)},{onBeforeRender:E}=zt();return E(({delta:e,invalidate:t})=>{var n;s.value instanceof gC&&(n=s.value)!=null&&n.isLocked&&(T(e,d.value),s.value.moveRight(u.value),t())}),(e,t)=>(U(),kt(G(WE),{selector:e.selector,"make-default":e.makeDefault,camera:e.camera||G(o),"dom-element":e.domElement||G(c).domElement,onIsLock:b,onChange:x},null,8,[`selector`,`make-default`,`camera`,`dom-element`]))}}),zE=[`args`,`auto-rotate`,`auto-rotate-speed`,`enable-damping`,`damping-factor`,`enable-pan`,`key-pan-speed`,`keys`,`max-azimuth-angle`,`min-azimuth-angle`,`max-polar-angle`,`min-polar-angle`,`min-distance`,`max-distance`,`min-zoom`,`max-zoom`,`enable-zoom`,`zoom-speed`,`enable-rotate`,`rotate-speed`],BE=H({__name:`MapControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:1/0},minAzimuthAngle:{default:-1/0},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:1/0},minZoom:{default:0},maxZoom:{default:1/0},touches:{},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,{autoRotate:i,autoRotateSpeed:a,enableDamping:o,dampingFactor:s,enablePan:c,keyPanSpeed:l,maxAzimuthAngle:u,minAzimuthAngle:d,maxPolarAngle:f,minPolarAngle:p,minDistance:m,maxDistance:h,minZoom:g,maxZoom:_,enableZoom:v,zoomSpeed:y,enableRotate:b,rotateSpeed:x}=pn(r),{camera:S,renderer:C,extend:w,controls:T,invalidate:E}=Qt();K(r,()=>{E()});let D=sn(null);w({MapControls:TC}),K(T,e=>{e&&r.makeDefault?T.value=e:T.value=null});let{onBeforeRender:O}=zt();return O(({invalidate:e})=>{D.value&&(o.value||i.value)&&(D.value.update(),e())}),Zt(()=>{D.value&&D.value.dispose()}),t({instance:D}),(e,t)=>(e.camera||G(S))&&(e.domElement||G(C))?(U(),V(`TresMapControls`,{key:0,ref_key:`controlsRef`,ref:D,args:[e.camera||G(S),e.domElement||G(C).domElement],"auto-rotate":G(i),"auto-rotate-speed":G(a),"enable-damping":G(o),"damping-factor":G(s),"enable-pan":G(c),"key-pan-speed":G(l),keys:e.keys,"max-azimuth-angle":G(u),"min-azimuth-angle":G(d),"max-polar-angle":G(f),"min-polar-angle":G(p),"min-distance":G(m),"max-distance":G(h),"min-zoom":G(g),"max-zoom":G(_),"enable-zoom":G(v),"zoom-speed":G(y),"enable-rotate":G(b),"rotate-speed":G(x)},null,8,zE)):At(``,!0)}}),VE=[`target`,`auto-rotate`,`auto-rotate-speed`,`enable-damping`,`damping-factor`,`enable-pan`,`key-pan-speed`,`keys`,`max-azimuth-angle`,`min-azimuth-angle`,`max-polar-angle`,`min-polar-angle`,`min-distance`,`max-distance`,`min-zoom`,`max-zoom`,`touches`,`enable-zoom`,`zoom-speed`,`enable-rotate`,`rotate-speed`,`mouse-buttons`,`args`],HE=H({__name:`OrbitControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:1/0},minAzimuthAngle:{default:-1/0},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:1/0},minZoom:{default:0},maxZoom:{default:1/0},touches:{default:()=>({ONE:at.ROTATE,TWO:at.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:he.ROTATE,MIDDLE:he.DOLLY,RIGHT:he.PAN})}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,i=n,{makeDefault:a,autoRotate:o,autoRotateSpeed:s,enableDamping:c,dampingFactor:l,enablePan:u,keyPanSpeed:d,maxAzimuthAngle:f,minAzimuthAngle:p,maxPolarAngle:m,minPolarAngle:h,minDistance:g,maxDistance:_,minZoom:v,maxZoom:y,enableZoom:b,zoomSpeed:x,enableRotate:S,touches:C,rotateSpeed:w,target:T,mouseButtons:E}=pn(r),{camera:D,renderer:O,extend:k,controls:A,invalidate:j}=Qt(),M=sn(null);k({OrbitControls:wC}),K(M,e=>{N(),e&&a.value?A.value=e:A.value=null});function N(){Rb(M.value,`change`,()=>{i(`change`,M.value),j()}),Rb(M.value,`start`,()=>i(`start`,M.value)),Rb(M.value,`end`,()=>i(`end`,M.value))}let{onBeforeRender:ee}=zt();return ee(({invalidate:e})=>{M.value&&(c.value||o.value)&&(M.value.update(),o.value&&e())}),Zt(()=>{M.value&&M.value.dispose()}),t({instance:M}),(e,t)=>(e.camera||G(D))&&(e.domElement||G(O))?(U(),V(`TresOrbitControls`,{key:0,ref_key:`controlsRef`,ref:M,target:G(T),"auto-rotate":G(o),"auto-rotate-speed":G(s),"enable-damping":G(c),"damping-factor":G(l),"enable-pan":G(u),"key-pan-speed":G(d),keys:e.keys,"max-azimuth-angle":G(f),"min-azimuth-angle":G(p),"max-polar-angle":G(m),"min-polar-angle":G(h),"min-distance":G(g),"max-distance":G(_),"min-zoom":G(v),"max-zoom":G(y),touches:G(C),"enable-zoom":G(b),"zoom-speed":G(x),"enable-rotate":G(S),"rotate-speed":G(w),"mouse-buttons":G(E),args:[e.camera||G(D),e.domElement||G(O).domElement]},null,8,VE)):At(``,!0)}}),UE=[`args`],WE=H({__name:`PointerLockControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},selector:{}},emits:[`isLock`,`change`],setup(e,{expose:t,emit:n}){let r=e,i=n,{camera:a,renderer:o,extend:s,controls:c,invalidate:l}=Qt();K(r,()=>{l()});let u=sn(null),d;s({PointerLockControls:gC});let f=e=>{i(`isLock`,e)};return K(u,e=>{e&&r.makeDefault?c.value=e:c.value=null,d=document.getElementById(r.selector||``)||o.value.domElement,Rb(d,`click`,()=>{u.value&&(u.value.lock(),u.value.addEventListener(`lock`,()=>f(!0)),u.value.addEventListener(`unlock`,()=>f(!1)),l())})}),Zt(()=>{let e=u.value;e&&(e.removeEventListener(`lock`,()=>f(!0)),e.removeEventListener(`unlock`,()=>f(!1)),e.dispose())}),t({instance:c}),(e,t)=>(e.camera||G(a))&&(e.domElement||G(o))?(U(),V(`TresPointerLockControls`,{key:0,ref_key:`controlsRef`,ref:u,args:[e.camera||G(a),e.domElement||G(o).domElement]},null,8,UE)):At(``,!0)}}),GE=H({__name:`ScrollControls`,props:{pages:{default:4},distance:{default:4},smoothScroll:{default:.1},horizontal:{type:Boolean,default:!1},htmlScroll:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,{logWarning:a}=Re();r.smoothScroll<0&&a(`SmoothControl must be greater than zero`),r.pages<0&&a(`Pages must be greater than zero`);let{camera:o,controls:s,renderer:c,invalidate:l}=Qt();K(r,()=>{l()});let u=sn(),d=document.createElement(`div`),{y:f}=Xb(),{x:p,y:m,isScrolling:h}=Gb(d),{height:g,width:_}=Zb(),v=0,y=W(!1),b=W(0),x=W(0),S=W(0),C=r.horizontal?`x`:`y`,w=K(o,e=>{if(y.value){w();return}v=r.horizontal?e?.position.x||0:e?.position.y||0,y.value=!0},{immediate:!0});K(h,e=>{s.value&&(s.value.enabled=!e)},{immediate:!0}),K(f,e=>{!h.value&&!r.htmlScroll||(x.value=e/g.value/(S.value/g.value-1),b.value=-1*x.value,i(`update:modelValue`,x.value))}),K(m,e=>{x.value=e/g.value/(S.value/g.value),b.value=-1*x.value,i(`update:modelValue`,x.value)}),K(p,e=>{x.value=e/_.value/(S.value/_.value-1),b.value=+x.value,i(`update:modelValue`,x.value)}),K(c,e=>{var t,n;let i=e?.domElement;if(r.htmlScroll&&e!=null&&e.domElement)i!=null&&i.style.width&&i!=null&&i.style.position&&i!=null&&i.style.top&&i!=null&&i.style.left&&(i.style.width=`100%`,i.style.position=`fixed`,i.style.zIndex=` -99999`,i.style.top=`0`,i.style.left=`0`),S.value=document.body.scrollHeight;else{let a=document.createElement(`div`),o=document.createElement(`div`);d.style[r.horizontal?`overflowX`:`overflowY`]=`auto`,d.style[r.horizontal?`overflowY`:`overflowX`]=`hidden`,d.style.position=`absolute`,d.style.width=`100%`,d.style.height=` 100%`,d.style.top=`0`,d.style.left=`0`,d.classList.add(`scrollContainer`),a.style.position=`sticky`,a.style.top=`0px`,a.style.left=`0px`,a.style.width=`100%`,a.style.height=`100%`,a.style.overflow=`hidden`,d.appendChild(a),o.style.height=r.horizontal?`100%`:`${g.value*r.pages}px`,o.style.width=r.horizontal?`${_.value*r.pages}px`:`100vw`,o.style.pointerEvents=`none`,i.style.position=`fixed`,i.style.zIndex=`0`,i!=null&&i.style.width&&(i.style.width=`100%`),d.appendChild(o),e!=null&&e.domElement.parentNode&&(e.domElement.parentNode.style.position=`relative`),(n=(t=e?.domElement)?.parentNode)==null||n.appendChild(d),S.value=r.horizontal?_.value*r.pages:g.value*r.pages}},{immediate:!0});let{onBeforeRender:T}=zt();return T(({invalidate:e})=>{var t;if((t=o.value)!=null&&t.position){let t=(b.value*r.distance-o.value.position[C]+v)*r.smoothScroll;o.value.position[C]+=t,u.value.children.length>0&&(u.value.position[C]+=t),e()}}),t({instance:u}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`wrapperRef`,ref:u},[nn(e.$slots,`default`)],512))}}),KE=[`object`,`args`,`mode`,`enabled`,`axis`,`translation-snap`,`rotation-snap`,`scale-snap`,`space`,`size`,`show-x`,`show-y`,`show-z`],qE=H({__name:`TransformControls`,props:{object:{},camera:{},mode:{default:`translate`},enabled:{type:Boolean,default:!0},axis:{default:`XYZ`},translationSnap:{},rotationSnap:{},scaleSnap:{},space:{default:`world`},size:{default:1},showX:{type:Boolean,default:!0},showY:{type:Boolean,default:!0},showZ:{type:Boolean,default:!0}},emits:[`dragging`,`change`,`mouseDown`,`mouseUp`,`objectChange`],setup(e,{expose:t,emit:n}){let r=e,i=n,{object:a,mode:o,enabled:s,axis:c,translationSnap:l,rotationSnap:u,scaleSnap:d,space:f,size:p,showX:m,showY:h,showZ:g}=pn(r),_=sn(null),{controls:v,camera:y,renderer:b,extend:x,invalidate:S}=Qt();K([a,o,s,c,l,u,d,f,p,m,h,g],()=>{S()}),x({TransformControls:iC});let C=()=>{S(),i(`change`)},w=e=>{v.value&&(v.value.enabled=!e.value),S(),i(`dragging`,e.value)},T=()=>{S(),i(`mouseDown`)},E=()=>{S(),i(`mouseDown`)},D=()=>{S(),i(`objectChange`)};function O(){Rb(_.value,`change`,C),Rb(_.value,`dragging-changed`,w),Rb(_.value,`mouseDown`,T),Rb(_.value,`mouseUp`,E),Rb(_.value,`objectChange`,D)}return K(_,e=>{e&&O()}),Zt(()=>{_.value&&_.value.dispose()}),t({instance:_}),(e,t)=>{var n;return(e.camera||G(y))&&G(b)?(U(),V(`TresTransformControls`,{ref_key:`controlsRef`,ref:_,key:(n=e.camera||G(y))?.uuid,object:G(a),args:[e.camera||G(y),G(b).domElement],mode:G(o),enabled:G(s),axis:G(c),"translation-snap":G(l),"rotation-snap":G(u),"scale-snap":G(d),space:G(f),size:G(p),"show-x":G(m),"show-y":G(h),"show-z":G(g),visible:!0},null,8,KE)):At(``,!0)}}}),JE=[`geometry`,`render-order`],YE=H({__name:`component`,props:{src:{},skipStrokes:{type:Boolean,default:!1},skipFills:{type:Boolean,default:!1},fillMaterial:{},strokeMaterial:{},fillMeshProps:{},strokeMeshProps:{},depth:{default:`renderOrder`}},setup(e,{expose:t}){let n=e;class r extends ew{load(e,t,n,r){let i=Array.isArray(e)?e[0]:e;super.load(i,t,n,r)}}let{src:i,skipStrokes:a,skipFills:o,fillMaterial:s,strokeMaterial:c,fillMeshProps:l,strokeMeshProps:u,depth:d}=pn(n),f=sn(),p=sn([]),m=sn([]);t({instance:f}),jn(async()=>h(i.value).then(e=>m.value=e.paths)),K([o,a,s,c,m],_);async function h(e){let t=e.startsWith(`e.geometry.dispose())}function _(){var e,t,r;g();let i=[],[s,c]=(()=>{let e={flat:!1,renderOrder:!1,offsetZ:!0},t={flat:0,renderOrder:0,offsetZ:.025},n=d.value;return typeof n==`number`?[!0,n]:[e[n],t[n]]})(),l=0;for(let u of m.value){let d=(e=u.userData)?.style??{},f=Object.assign({color:d.fill,opacity:d.fillOpacity,transparent:!0,side:T,depthWrite:s},n.fillMaterial);if(!o.value&&d.fill!==void 0&&d.fill!==`none`)for(let e of ew.createShapes(u)){let t=new Qe(e);t.scale(1,-1,1),c&&t.translate(0,0,l++*c),i.push({geometry:t,material:f,isStroke:!1})}if(!a.value&&d.stroke!==void 0&&d.stroke!==`none`){let e=Object.assign({color:(t=u.userData)?.style.stroke,opacity:(r=u.userData)?.style.strokeOpacity,transparent:!0,side:T,depthWrite:s},n.strokeMaterial);for(let t of u.subPaths){let n=t.getPoints().map(e=>new pt(e.x,-e.y)),r=ew.pointsToStroke(n,d||`none`);c&&r.translate(0,0,l++*c),i.push({geometry:r,material:e,isStroke:!0})}}}p.value=i}return(e,t)=>(U(),V(`TresGroup`,{ref_key:`svgRef`,ref:f},[(U(!0),V(P,null,tn(p.value,({geometry:e,material:t,isStroke:n},r)=>(U(),V(`TresMesh`,Ut({key:`${r}`,ref_for:!0},G(n?u:l),{geometry:e,"render-order":G(d)===`renderOrder`?r:0}),[B(`TresMeshBasicMaterial`,Ut({ref_for:!0},t),null,16)],16,JE))),128))],512))}});function XE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function ZE(e){throw Error(`Could not dynamically require "`+e+`". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.`)}var QE={exports:{}},$E;function eD(){return $E||($E=1,function(e,t){(function(t){e.exports=t()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof ZE==`function`&&ZE;if(!s&&c)return c(o,!0);if(a)return a(o,!0);throw Error(`Cannot find module '`+o+`'`)}s=n[o]={exports:{}},t[o][0].call(s.exports,function(e){var n=t[o][1][e];return i(n||e)},s,s.exports,e,t,n,r)}return n[o].exports}for(var a=typeof ZE==`function`&&ZE,o=0;o>16),c((65280&r)>>8),c(255&r);return i==2?c(255&(r=l(e.charAt(n))<<2|l(e.charAt(n+1))>>4)):i==1&&(c((r=l(e.charAt(n))<<10|l(e.charAt(n+1))<<4|l(e.charAt(n+2))>>2)>>8&255),c(255&r)),a},e.fromByteArray=function(e){var t,n,r,i,a=e.length%3,o=``;function s(e){return`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charAt(e)}for(t=0,r=e.length-a;t>18&63)+s(i>>12&63)+s(i>>6&63)+s(63&i);switch(a){case 1:o=(o+=s((n=e[e.length-1])>>2))+s(n<<4&63)+`==`;break;case 2:o=(o=(o+=s((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+s(n>>4&63))+s(n<<2&63)+`=`}return o}})(n===void 0?this.base64js={}:n)}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js`,`/node_modules/gulp-browserify/node_modules/base64-js/lib`)},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(t,r,i,a,o,s,c,l,u){var d=e(`base64-js`),f=e(`ieee754`);function i(e,t,n){if(!(this instanceof i))return new i(e,t,n);var r,a,o,s,c=typeof e;if(t===`base64`&&c==`string`)for(e=(s=e).trim?s.trim():s.replace(/^\s+|\s+$/g,``);e.length%4!=0;)e+=`=`;if(c==`number`)r=A(e);else if(c==`string`)r=i.byteLength(e,t);else{if(c!=`object`)throw Error(`First argument needs to be a number, array or string.`);r=A(e.length)}if(i._useTypedArrays?a=i._augment(new Uint8Array(r)):((a=this).length=r,a._isBuffer=!0),i._useTypedArrays&&typeof e.byteLength==`number`)a._set(e);else if(j(s=e)||i.isBuffer(s)||s&&typeof s==`object`&&typeof s.length==`number`)for(o=0;o>8,n%=256,r.push(n),r.push(t);return r}(t),e,n,r)}function h(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i>>0)):(t+1>>0),i}function v(e,t,n,r){if(r||(L(typeof n==`boolean`,`missing or invalid endian`),L(t!=null,`missing offset`),L(t+1>>8*(r?a:1-a)}function C(e,t,n,r,i){if(i||(L(t!=null,`missing value`),L(typeof r==`boolean`,`missing or invalid endian`),L(n!=null,`missing offset`),L(n+3>>8*(r?a:3-a)&255}function w(e,t,n,r,i){i||(L(t!=null,`missing value`),L(typeof r==`boolean`,`missing or invalid endian`),L(n!=null,`missing offset`),L(n+1this.length&&(r=this.length);var a=(r=e.length-t=this.length))return this[e]},i.prototype.readUInt16LE=function(e,t){return g(this,e,!0,t)},i.prototype.readUInt16BE=function(e,t){return g(this,e,!1,t)},i.prototype.readUInt32LE=function(e,t){return _(this,e,!0,t)},i.prototype.readUInt32BE=function(e,t){return _(this,e,!1,t)},i.prototype.readInt8=function(e,t){if(t||(L(e!=null,`missing offset`),L(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){return v(this,e,!0,t)},i.prototype.readInt16BE=function(e,t){return v(this,e,!1,t)},i.prototype.readInt32LE=function(e,t){return y(this,e,!0,t)},i.prototype.readInt32BE=function(e,t){return y(this,e,!1,t)},i.prototype.readFloatLE=function(e,t){return b(this,e,!0,t)},i.prototype.readFloatBE=function(e,t){return b(this,e,!1,t)},i.prototype.readDoubleLE=function(e,t){return x(this,e,!0,t)},i.prototype.readDoubleBE=function(e,t){return x(this,e,!1,t)},i.prototype.writeUInt8=function(e,t,n){n||(L(e!=null,`missing value`),L(t!=null,`missing offset`),L(t=this.length||(this[t]=e)},i.prototype.writeUInt16LE=function(e,t,n){S(this,e,t,!0,n)},i.prototype.writeUInt16BE=function(e,t,n){S(this,e,t,!1,n)},i.prototype.writeUInt32LE=function(e,t,n){C(this,e,t,!0,n)},i.prototype.writeUInt32BE=function(e,t,n){C(this,e,t,!1,n)},i.prototype.writeInt8=function(e,t,n){n||(L(e!=null,`missing value`),L(t!=null,`missing offset`),L(t=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},i.prototype.writeInt16LE=function(e,t,n){w(this,e,t,!0,n)},i.prototype.writeInt16BE=function(e,t,n){w(this,e,t,!1,n)},i.prototype.writeInt32LE=function(e,t,n){T(this,e,t,!0,n)},i.prototype.writeInt32BE=function(e,t,n){T(this,e,t,!1,n)},i.prototype.writeFloatLE=function(e,t,n){E(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){E(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){D(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){D(this,e,t,!1,n)},i.prototype.fill=function(e,t,n){if(t||=0,n||=this.length,L(typeof(e=typeof(e||=0)==`string`?e.charCodeAt(0):e)==`number`&&!isNaN(e),`value is not a number`),L(t<=n,`end < start`),n!==t&&this.length!==0){L(0<=t&&t`},i.prototype.toArrayBuffer=function(){if(typeof Uint8Array>`u`)throw Error(`Buffer.toArrayBuffer not supported in this browser`);if(i._useTypedArrays)return new i(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function F(e){try{return decodeURIComponent(e)}catch{return`�`}}function I(e,t){L(typeof e==`number`,`cannot write a non-number as a number`),L(0<=e,`specified a negative value for writing an unsigned value`),L(e<=t,`value is larger than maximum value for type`),L(Math.floor(e)===e,`value has a fractional component`)}function te(e,t,n){L(typeof e==`number`,`cannot write a non-number as a number`),L(e<=t,`value larger than maximum allowed value`),L(n<=e,`value smaller than minimum allowed value`),L(Math.floor(e)===e,`value has a fractional component`)}function ne(e,t,n){L(typeof e==`number`,`cannot write a non-number as a number`),L(e<=t,`value larger than maximum allowed value`),L(n<=e,`value smaller than minimum allowed value`)}function L(e,t){if(!e)throw Error(t||`Failed assertion`)}i._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=O.get,e.set=O.set,e.write=O.write,e.toString=O.toString,e.toLocaleString=O.toString,e.toJSON=O.toJSON,e.copy=O.copy,e.slice=O.slice,e.readUInt8=O.readUInt8,e.readUInt16LE=O.readUInt16LE,e.readUInt16BE=O.readUInt16BE,e.readUInt32LE=O.readUInt32LE,e.readUInt32BE=O.readUInt32BE,e.readInt8=O.readInt8,e.readInt16LE=O.readInt16LE,e.readInt16BE=O.readInt16BE,e.readInt32LE=O.readInt32LE,e.readInt32BE=O.readInt32BE,e.readFloatLE=O.readFloatLE,e.readFloatBE=O.readFloatBE,e.readDoubleLE=O.readDoubleLE,e.readDoubleBE=O.readDoubleBE,e.writeUInt8=O.writeUInt8,e.writeUInt16LE=O.writeUInt16LE,e.writeUInt16BE=O.writeUInt16BE,e.writeUInt32LE=O.writeUInt32LE,e.writeUInt32BE=O.writeUInt32BE,e.writeInt8=O.writeInt8,e.writeInt16LE=O.writeInt16LE,e.writeInt16BE=O.writeInt16BE,e.writeInt32LE=O.writeInt32LE,e.writeInt32BE=O.writeInt32BE,e.writeFloatLE=O.writeFloatLE,e.writeFloatBE=O.writeFloatBE,e.writeDoubleLE=O.writeDoubleLE,e.writeDoubleBE=O.writeDoubleBE,e.fill=O.fill,e.inspect=O.inspect,e.toArrayBuffer=O.toArrayBuffer,e}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/buffer/index.js`,`/node_modules/gulp-browserify/node_modules/buffer`)},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(e,t,n){(function(n,r,i,a,o,s,c,l,u){var i=e(`buffer`).Buffer,d=4,f=new i(d);f.fill(0),t.exports={hash:function(e,t,n,r){for(var a=t(function(e,t){e.length%d!=0&&(n=e.length+(d-e.length%d),e=i.concat([e,f],n));for(var n,r=[],a=t?e.readInt32BE:e.readInt32LE,o=0;oh?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,i=-1732584194,a=271733878,o=0;o>>32-i,n)}function m(e,t,n,r,i,a,o){return p(t&n|~t&r,e,t,i,a,o)}function h(e,t,n,r,i,a,o){return p(t&r|n&~r,e,t,i,a,o)}function g(e,t,n,r,i,a,o){return p(t^n^r,e,t,i,a,o)}function _(e,t,n,r,i,a,o){return p(n^(t|~r),e,t,i,a,o)}function v(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.exports=function(e){return d.hash(e,f,16)}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,t,n){(function(e,n,r,i,a,o,s,c,l){t.exports=function(e){for(var t,n=Array(e),r=0;r>>((3&r)<<3)&255;return n}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{buffer:3,lYpoI2:11}],8:[function(e,t,n){(function(n,r,i,a,o,s,c,l,u){var d=e(`./helpers`);function f(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r,i,a=Array(80),o=1732584193,s=-271733879,c=-1732584194,l=271733878,u=-1009589776,d=0;d>16)+(t>>16)+(n>>16)<<16|65535&n}function m(e,t){return e<>>32-t}t.exports=function(e){return d.hash(e,f,20,!0)}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(e,t,n){(function(n,r,i,a,o,s,c,l,u){function d(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function f(e,t){var n,r=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],i=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],a=Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var o,s,c=0;c>>t|e<<32-t},h=function(e,t){return e>>>t};t.exports=function(e){return p.hash(e,f,32,!0)}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,n){(function(e,t,r,i,a,o,s,c,l){n.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,c=(1<>1,u=-7,d=n?i-1:0,f=n?-1:1,i=e[t+d];for(d+=f,a=i&(1<<-u)-1,i>>=-u,u+=s;0>=-u,u+=r;0>1,d=i===23?2**-24-2**-77:0,f=r?0:a-1,p=r?1:-1,a=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(r=2**-o)<1&&(o--,r*=2),2<=(t+=1<=o+u?d/r:d*2**(1-u))*r&&(o++,r/=2),l<=o+u?(s=0,o=l):1<=o+u?(s=(t*r-1)*2**i,o+=u):(s=t*2**(u-1)*2**i,o=0));8<=i;e[n+f]=255&s,f+=p,s/=256,i-=8);for(o=o<>= ++ -- << >> <= >= == != && || += -= *= /= %= &= ^^ ^= |= ( ) [ ] . ! ~ * / % + - < > & ^ | ? : = , ; { }`.split(` `)),oD}var lD,uD;function dD(){return uD||(uD=1,lD=`abs.acos.all.any.asin.atan.ceil.clamp.cos.cross.dFdx.dFdy.degrees.distance.dot.equal.exp.exp2.faceforward.floor.fract.gl_BackColor.gl_BackLightModelProduct.gl_BackLightProduct.gl_BackMaterial.gl_BackSecondaryColor.gl_ClipPlane.gl_ClipVertex.gl_Color.gl_DepthRange.gl_DepthRangeParameters.gl_EyePlaneQ.gl_EyePlaneR.gl_EyePlaneS.gl_EyePlaneT.gl_Fog.gl_FogCoord.gl_FogFragCoord.gl_FogParameters.gl_FragColor.gl_FragCoord.gl_FragData.gl_FragDepth.gl_FragDepthEXT.gl_FrontColor.gl_FrontFacing.gl_FrontLightModelProduct.gl_FrontLightProduct.gl_FrontMaterial.gl_FrontSecondaryColor.gl_LightModel.gl_LightModelParameters.gl_LightModelProducts.gl_LightProducts.gl_LightSource.gl_LightSourceParameters.gl_MaterialParameters.gl_MaxClipPlanes.gl_MaxCombinedTextureImageUnits.gl_MaxDrawBuffers.gl_MaxFragmentUniformComponents.gl_MaxLights.gl_MaxTextureCoords.gl_MaxTextureImageUnits.gl_MaxTextureUnits.gl_MaxVaryingFloats.gl_MaxVertexAttribs.gl_MaxVertexTextureImageUnits.gl_MaxVertexUniformComponents.gl_ModelViewMatrix.gl_ModelViewMatrixInverse.gl_ModelViewMatrixInverseTranspose.gl_ModelViewMatrixTranspose.gl_ModelViewProjectionMatrix.gl_ModelViewProjectionMatrixInverse.gl_ModelViewProjectionMatrixInverseTranspose.gl_ModelViewProjectionMatrixTranspose.gl_MultiTexCoord0.gl_MultiTexCoord1.gl_MultiTexCoord2.gl_MultiTexCoord3.gl_MultiTexCoord4.gl_MultiTexCoord5.gl_MultiTexCoord6.gl_MultiTexCoord7.gl_Normal.gl_NormalMatrix.gl_NormalScale.gl_ObjectPlaneQ.gl_ObjectPlaneR.gl_ObjectPlaneS.gl_ObjectPlaneT.gl_Point.gl_PointCoord.gl_PointParameters.gl_PointSize.gl_Position.gl_ProjectionMatrix.gl_ProjectionMatrixInverse.gl_ProjectionMatrixInverseTranspose.gl_ProjectionMatrixTranspose.gl_SecondaryColor.gl_TexCoord.gl_TextureEnvColor.gl_TextureMatrix.gl_TextureMatrixInverse.gl_TextureMatrixInverseTranspose.gl_TextureMatrixTranspose.gl_Vertex.greaterThan.greaterThanEqual.inversesqrt.length.lessThan.lessThanEqual.log.log2.matrixCompMult.max.min.mix.mod.normalize.not.notEqual.pow.radians.reflect.refract.sign.sin.smoothstep.sqrt.step.tan.texture2D.texture2DLod.texture2DProj.texture2DProjLod.textureCube.textureCubeLod.texture2DLodEXT.texture2DProjLodEXT.textureCubeLodEXT.texture2DGradEXT.texture2DProjGradEXT.textureCubeGradEXT`.split(`.`)),lD}var fD,pD;function mD(){if(pD)return fD;pD=1;var e=aD();return fD=e.slice().concat(`layout.centroid.smooth.case.mat2x2.mat2x3.mat2x4.mat3x2.mat3x3.mat3x4.mat4x2.mat4x3.mat4x4.uvec2.uvec3.uvec4.samplerCubeShadow.sampler2DArray.sampler2DArrayShadow.isampler2D.isampler3D.isamplerCube.isampler2DArray.usampler2D.usampler3D.usamplerCube.usampler2DArray.coherent.restrict.readonly.writeonly.resource.atomic_uint.noperspective.patch.sample.subroutine.common.partition.active.filter.image1D.image2D.image3D.imageCube.iimage1D.iimage2D.iimage3D.iimageCube.uimage1D.uimage2D.uimage3D.uimageCube.image1DArray.image2DArray.iimage1DArray.iimage2DArray.uimage1DArray.uimage2DArray.image1DShadow.image2DShadow.image1DArrayShadow.image2DArrayShadow.imageBuffer.iimageBuffer.uimageBuffer.sampler1DArray.sampler1DArrayShadow.isampler1D.isampler1DArray.usampler1D.usampler1DArray.isampler2DRect.usampler2DRect.samplerBuffer.isamplerBuffer.usamplerBuffer.sampler2DMS.isampler2DMS.usampler2DMS.sampler2DMSArray.isampler2DMSArray.usampler2DMSArray`.split(`.`)),fD}var hD,gD;function _D(){if(gD)return hD;gD=1;var e=dD();return e=e.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),hD=e.concat(`gl_VertexID.gl_InstanceID.gl_Position.gl_PointSize.gl_FragCoord.gl_FrontFacing.gl_FragDepth.gl_PointCoord.gl_MaxVertexAttribs.gl_MaxVertexUniformVectors.gl_MaxVertexOutputVectors.gl_MaxFragmentInputVectors.gl_MaxVertexTextureImageUnits.gl_MaxCombinedTextureImageUnits.gl_MaxTextureImageUnits.gl_MaxFragmentUniformVectors.gl_MaxDrawBuffers.gl_MinProgramTexelOffset.gl_MaxProgramTexelOffset.gl_DepthRangeParameters.gl_DepthRange.trunc.round.roundEven.isnan.isinf.floatBitsToInt.floatBitsToUint.intBitsToFloat.uintBitsToFloat.packSnorm2x16.unpackSnorm2x16.packUnorm2x16.unpackUnorm2x16.packHalf2x16.unpackHalf2x16.outerProduct.transpose.determinant.inverse.texture.textureSize.textureProj.textureLod.textureOffset.texelFetch.texelFetchOffset.textureProjOffset.textureLodOffset.textureProjLod.textureProjLodOffset.textureGrad.textureGradOffset.textureProjGrad.textureProjGradOffset`.split(`.`)),hD}var vD,yD;function bD(){if(yD)return vD;yD=1,vD=b;var e=aD(),t=cD(),n=dD(),r=mD(),i=_D(),a=999,o=9999,s=0,c=1,l=2,u=3,d=4,f=5,p=6,m=7,h=8,g=9,_=10,v=11,y=[`block-comment`,`line-comment`,`preprocessor`,`operator`,`integer`,`float`,`ident`,`builtin`,`keyword`,`whitespace`,`eof`,`integer`];function b(b){var x=0,S=0,C=a,w,T,E=[],D=[],O=1,k=0,A=0,j=!1,M=!1,N=``,ee;b||={};var P=n,F=e;b.version===`300 es`&&(P=i,F=r);for(var I={},te={},x=0;x0)continue;i=e.slice(0,1).join(``)}return ne(i),A+=i.length,E=E.slice(i.length),E.length}while(!0)}function ue(){return/[^a-fA-F0-9]/.test(w)?(ne(E.join(``)),C=a,x):(E.push(w),T=w,x+1)}function de(){return w===`.`||/[eE]/.test(w)?(E.push(w),C=f,T=w,x+1):w===`x`&&E.length===1&&E[0]===`0`?(C=v,E.push(w),T=w,x+1):/[^\d]/.test(w)?(ne(E.join(``)),C=a,x):(E.push(w),T=w,x+1)}function fe(){return w===`f`&&(E.push(w),T=w,x+=1),/[eE]/.test(w)||(w===`-`||w===`+`)&&/[eE]/.test(T)?(E.push(w),T=w,x+1):/[^\d]/.test(w)?(ne(E.join(``)),C=a,x):(E.push(w),T=w,x+1)}function pe(){if(/[^\d\w_]/.test(w)){var e=E.join(``);return C=te[e]?h:I[e]?m:p,ne(E.join(``)),C=a,x}return E.push(w),T=w,x+1}}return vD}var xD,SD;function CD(){if(SD)return xD;SD=1;var e=bD();xD=t;function t(t,n){var r=e(n),i=[];return i=i.concat(r(t)),i=i.concat(r(null)),i}return xD}var wD=CD();const TD=XE(wD);var ED,DD;function OD(){if(DD)return ED;DD=1,ED=e;function e(e){for(var t=[],n=0;n=0;i--){if(n(e[i]))return i;if(r&&r(e[i]))return-1}return-1}}function t(e){return function(t){return t.type===`operator`&&(!e||t.data===e)}}function n(e){return e.type!==`whitespace`}return jD}var PD=ND();const FD=XE(PD);function ID(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}function LD(e){var t=ID(e,`string`);return typeof t==`symbol`?t:String(t)}function RD(e,t,n){return t=LD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BD(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function HD(e,t){if(e==null)return{};var n=VD(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UD(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function WD(e,t){for(var n=0;n`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ZD(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return KD(e)}function QD(e){var t=XD();return function(){var n=YD(e),r;if(t){var i=YD(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ZD(this,r)}}var $D={position:`csm_Position`,positionRaw:`csm_PositionRaw`,pointSize:`csm_PointSize`,fragColor:`csm_FragColor`,diffuseColor:`csm_DiffuseColor`,normal:`csm_Normal`,roughness:`csm_Roughness`,metalness:`csm_Metalness`,emissive:`csm_Emissive`,ao:`csm_AO`,bump:`csm_Bump`,depthAlpha:`csm_DepthAlpha`},eO,tO,nO=(eO={},RD(eO,`${$D.normal}`,{"#include ":` + vec3 objectNormal = ${$D.normal}; + #ifdef USE_TANGENT + vec3 objectTangent = vec3( tangent.xyz ); + #endif + `}),RD(eO,`${$D.position}`,{"#include ":` + vec3 transformed = ${$D.position}; + `}),RD(eO,`${$D.positionRaw}`,{"#include ":` + vec4 csm_internal_positionUnprojected = ${$D.positionRaw}; + mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix; + #ifdef USE_INSTANCING + csm_internal_unprojectMatrix = csm_internal_unprojectMatrix * instanceMatrix; + #endif + csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected; + vec3 transformed = csm_internal_positionUnprojected.xyz; + `}),RD(eO,`${$D.pointSize}`,{"gl_PointSize = size;":` + gl_PointSize = ${$D.pointSize}; + `}),RD(eO,`${$D.diffuseColor}`,{"#include ":` + #include + diffuseColor = ${$D.diffuseColor}; + `}),RD(eO,`${$D.fragColor}`,{"#include ":` + #include + gl_FragColor = ${$D.fragColor}; + `}),RD(eO,`${$D.emissive}`,{"vec3 totalEmissiveRadiance = emissive;":` + vec3 totalEmissiveRadiance = ${$D.emissive}; + `}),RD(eO,`${$D.roughness}`,{"#include ":` + #include + roughnessFactor = ${$D.roughness}; + `}),RD(eO,`${$D.metalness}`,{"#include ":` + #include + metalnessFactor = ${$D.metalness}; + `}),RD(eO,`${$D.ao}`,{"#include ":` + #include + reflectedLight.indirectDiffuse *= 1. - ${$D.ao}; + `}),RD(eO,`${$D.bump}`,{"#include ":` + #include + + vec3 csm_internal_orthogonal = ${$D.bump} - (dot(${$D.bump}, normal) * normal); + vec3 csm_internal_projectedbump = mat3(csm_internal_vModelViewMatrix) * csm_internal_orthogonal; + normal = normalize(normal - csm_internal_projectedbump); + `}),RD(eO,`${$D.depthAlpha}`,{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":` + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity * ${$D.depthAlpha} ); + `,"gl_FragColor = packDepthToRGBA( fragCoordZ );":` + gl_FragColor = packDepthToRGBA( fragCoordZ ); + gl_FragColor.a *= ${$D.depthAlpha}; + `}),eO),rO=(tO={},RD(tO,`${$D.position}`,{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` + gl_Position = projectionMatrix * modelViewMatrix * vec4( ${$D.position}, 1.0 ); + `}),RD(tO,`${$D.positionRaw}`,{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` + gl_Position = ${$D.position}; + `}),RD(tO,`${$D.diffuseColor}`,{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` + gl_FragColor = ${$D.diffuseColor}; + `}),RD(tO,`${$D.fragColor}`,{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` + gl_FragColor = ${$D.fragColor}; + `}),tO),iO=` + +#ifdef IS_VERTEX + // csm_Position & csm_PositionRaw + #ifdef IS_UNKNOWN + vec3 csm_Position = vec3(0.0); + vec4 csm_PositionRaw = vec4(0.0); + vec3 csm_Normal = vec3(0.0); + #else + vec3 csm_Position = position; + vec4 csm_PositionRaw = projectionMatrix * modelViewMatrix * vec4(position, 1.); + vec3 csm_Normal = normal; + #endif + + // csm_PointSize + #ifdef IS_POINTSMATERIAL + float csm_PointSize = size; + #endif +#else + // csm_DiffuseColor & csm_FragColor + #if defined IS_UNKNOWN || defined IS_SHADERMATERIAL || defined IS_MESHDEPTHMATERIAL || defined IS_MESHNORMALMATERIAL || defined IS_SHADOWMATERIAL + vec4 csm_DiffuseColor = vec4(1.0, 0.0, 1.0, 1.0); + vec4 csm_FragColor = vec4(1.0, 0.0, 1.0, 1.0); + #else + #ifdef USE_MAP + vec4 _csm_sampledDiffuseColor = texture2D(map, vMapUv); + + #ifdef DECODE_VIDEO_TEXTURE + // inline sRGB decode (TODO: Remove this code when https://crbug.com/1256340 is solved) + _csm_sampledDiffuseColor = vec4(mix(pow(_csm_sampledDiffuseColor.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), _csm_sampledDiffuseColor.rgb * 0.0773993808, vec3(lessThanEqual(_csm_sampledDiffuseColor.rgb, vec3(0.04045)))), _csm_sampledDiffuseColor.w); + #endif + + vec4 csm_DiffuseColor = vec4(diffuse, opacity) * _csm_sampledDiffuseColor; + vec4 csm_FragColor = vec4(diffuse, opacity) * _csm_sampledDiffuseColor; + #else + vec4 csm_DiffuseColor = vec4(diffuse, opacity); + vec4 csm_FragColor = vec4(diffuse, opacity); + #endif + #endif + + // csm_Emissive, csm_Roughness, csm_Metalness + #if defined IS_MESHSTANDARDMATERIAL || defined IS_MESHPHYSICALMATERIAL + vec3 csm_Emissive = emissive; + float csm_Roughness = roughness; + float csm_Metalness = metalness; + #endif + + // csm_AO + #if defined IS_MESHSTANDARDMATERIAL || defined IS_MESHPHYSICALMATERIAL || defined IS_MESHBASICMATERIAL || defined IS_MESHLAMBERTMATERIAL || defined IS_MESHPHONGMATERIAL || defined IS_MESHTOONMATERIAL + float csm_AO = 0.0; + #endif + + // csm_Bump + #if defined IS_MESHLAMBERTMATERIAL || defined IS_MESHMATCAPMATERIAL || defined IS_MESHNORMALMATERIAL || defined IS_MESHPHONGMATERIAL || defined IS_MESHPHYSICALMATERIAL || defined IS_MESHSTANDARDMATERIAL || defined IS_MESHTOONMATERIAL || defined IS_SHADOWMATERIAL + vec3 csm_Bump = vec3(0.0); + #endif + + float csm_DepthAlpha = 1.0; +#endif +`,aO=` + varying mat4 csm_internal_vModelViewMatrix; +`,oO=` + csm_internal_vModelViewMatrix = modelViewMatrix; +`,sO=` + varying mat4 csm_internal_vModelViewMatrix; +`,cO=` + +`,lO,uO=(lO={},RD(lO,`${$D.position}`,`*`),RD(lO,`${$D.positionRaw}`,`*`),RD(lO,`${$D.normal}`,`*`),RD(lO,`${$D.pointSize}`,[`PointsMaterial`]),RD(lO,`${$D.diffuseColor}`,`*`),RD(lO,`${$D.fragColor}`,`*`),RD(lO,`${$D.emissive}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`]),RD(lO,`${$D.roughness}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`]),RD(lO,`${$D.metalness}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`]),RD(lO,`${$D.ao}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`,`MeshBasicMaterial`,`MeshLambertMaterial`,`MeshPhongMaterial`,`MeshToonMaterial`]),RD(lO,`${$D.bump}`,[`MeshLambertMaterial`,`MeshMatcapMaterial`,`MeshNormalMaterial`,`MeshPhongMaterial`,`MeshPhysicalMaterial`,`MeshStandardMaterial`,`MeshToonMaterial`,`ShadowMaterial`]),RD(lO,`${$D.depthAlpha}`,`*`),lO),dO=[`baseMaterial`,`fragmentShader`,`vertexShader`,`uniforms`,`patchMap`,`cacheKey`,`silent`],fO=function(e,t,n){return e.split(t).join(n)},pO=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)},mO=function(e,t){return RegExp(`\\b${pO(t)}\\b`).test(e)};function hO(e){try{new e}catch(e){if(e.message.indexOf(`is not a constructor`)>=0)return!1}return!0}function gO(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Object.assign(e,t);var r=Object.getPrototypeOf(t);Object.entries(Object.getOwnPropertyDescriptors(r)).filter(function(e){var t=typeof e[1].get==`function`,n=typeof e[1].set==`function`,r=typeof e[1].value==`function`,i=e[0]===`constructor`;return(t||n||r)&&!i}).forEach(function(t){if(typeof e[t[0]]==`function`){n||console.warn(`Function ${t[0]} already exists on CSM, renaming to base_${t[0]}`);var r=`base_${t[0]}`;e[r]=t[1].value.bind(e);return}Object.defineProperty(e,t[0],t[1])})}function _O(e){var t=e.toString().trim(),n=t.substring(t.indexOf(`{`)+1,t.lastIndexOf(`}`));return n.trim().length===0}function vO(e){return e.replace(/\s/g,``)}function yO(e,t,n){var r=e.lastIndexOf(t);return r===-1?e:e.substring(0,r)+n+e.substring(r+t.length)}var bO=function(e){JD(n,e);var t=QD(n);function n(e){var r,i=e.baseMaterial,a=e.fragmentShader,o=e.vertexShader,s=e.uniforms,c=e.patchMap,l=e.cacheKey,u=e.silent,d=HD(e,dO);UD(this,n);var f;if(hO(i)?f=new i(d):(f=i,Object.assign(f,d)),f.type===`RawShaderMaterial`)throw Error(`CustomShaderMaterial does not support RawShaderMaterial`);r=t.call(this),gO(KD(r),f,u),r.__csm={patchMap:c||{},fragmentShader:a||``,vertexShader:o||``,cacheKey:l,baseMaterial:i,instanceID:_e.generateUUID(),type:f.type,isAlreadyExtended:!_O(f.onBeforeCompile),cacheHash:``,silent:u},r.uniforms=BD(BD({},r.uniforms||{}),s||{});var p=r.__csm,m=p.fragmentShader,h=p.vertexShader,g=r.uniforms;return r.__csm.cacheHash=r.getCacheHash(),r.generateMaterial(m,h,g),r}return GD(n,[{key:`update`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.uniforms=e.uniforms||this.uniforms,Object.assign(this.__csm,e);var t=this.__csm,n=t.fragmentShader,r=t.vertexShader,i=this.uniforms,a=this.getCacheHash();this.__csm.cacheHash=a,this.generateMaterial(n,r,i)}},{key:`clone`,value:function(){var e={baseMaterial:this.__csm.baseMaterial,fragmentShader:this.__csm.fragmentShader,vertexShader:this.__csm.vertexShader,uniforms:this.uniforms,silent:this.__csm.silent,patchMap:this.__csm.patchMap,cacheKey:this.__csm.cacheKey},t=new this.constructor(e);return Object.assign(this,t),t}},{key:`getCacheHash`,value:function(){var e=this.__csm,t=e.fragmentShader,n=e.vertexShader,r=this.uniforms,i=Object.values(r).reduce(function(e,t){var n=t.value;return e+JSON.stringify(n)},``),a=vO(t)+vO(n)+i;return a.trim().length>0?nD(a):this.customProgramCacheKey()}},{key:`generateMaterial`,value:function(e,t,n){var r=this,i=this.parseShader(e),a=this.parseShader(t);this.uniforms=n||{},this.customProgramCacheKey=function(){return r.__csm.cacheHash};var o=function(e){try{if(i){var t=r.patchShader(i,e.fragmentShader,!0);e.fragmentShader=r.getMaterialDefine()+t}if(a){var n=r.patchShader(a,e.vertexShader);e.vertexShader=`#define IS_VERTEX; +`+n,e.vertexShader=r.getMaterialDefine()+e.vertexShader}e.uniforms=BD(BD({},e.uniforms),r.uniforms),r.uniforms=e.uniforms}catch(e){console.error(e)}};if(this.__csm.isAlreadyExtended){var s=this.onBeforeCompile;this.onBeforeCompile=function(e,t){s(e,t),o(e)}}else this.onBeforeCompile=o;this.needsUpdate=!0}},{key:`patchShader`,value:function(e,t,n){var r=this,i=t,a=BD(BD({},this.getPatchMapForMaterial()),this.__csm.patchMap);Object.keys(a).forEach(function(t){Object.keys(a[t]).forEach(function(n){var o=uO[t],s=r.__csm.type;if(t===`*`||mO(e.main,t))if(!o||Array.isArray(o)&&o.includes(s)||o===`*`)i=fO(i,n,a[t][n]);else throw Error(`CSM: ${t} is not available in ${s}. Shader cannot compile.`)})}),i=i.replace(`void main() {`,` + #ifndef CSM_IS_HEAD_DEFAULTS_DEFINED + ${n?sO:aO} + #define CSM_IS_HEAD_DEFAULTS_DEFINED 1 + #endif + + ${e.header} + + void main() { + #ifndef CSM_IS_DEFAULTS_DEFINED + ${iO} + #define CSM_IS_DEFAULTS_DEFINED 1 + #endif + + #ifndef CSM_IS_MAIN_DEFAULTS_DEFINED + ${n?cO:oO} + #define CSM_IS_MAIN_DEFAULTS_DEFINED 1 + #endif + + // CSM_START + `);var o=this.__csm.isAlreadyExtended,s=i.includes(`// CSM_END`);return i=o&&s?yO(i,`// CSM_END`,` + // CSM_END + ${e.main} + // CSM_END + `):i.replace(`// CSM_START`,` + // CSM_START + ${e.main} + // CSM_END + `),i=e.defines+i,i}},{key:`parseShader`,value:function(e){if(e){var t=e.replace(/\/\*\*(.*?)\*\/|\/\/(.*?)\n/gm,``),n=TD(t),r=FD(n),i=r.map(function(e){return e.name}).indexOf(`main`),a=AD(n.slice(0,i>=0?r[i].outer[0]:void 0)),o=i>=0?this.getShaderFromIndex(n,r[i].body):``;return{defines:``,header:a,main:o}}}},{key:`getMaterialDefine`,value:function(){var e=this.__csm.type;return e?`#define IS_${e.toUpperCase()}; +`:`#define IS_UNKNOWN; +`}},{key:`getPatchMapForMaterial`,value:function(){switch(this.__csm.type){case`ShaderMaterial`:return rO;default:return nO}}},{key:`getShaderFromIndex`,value:function(e,t){return AD(e.slice(t[0],t[1]))}}]),n}(ge),xO=class extends Ce{constructor(e={}){super(e),Sb(this,`_time`),Sb(this,`_factor`),this.setValues(e),this._time={value:0},this._factor={value:1}}onBeforeCompile(e){e.uniforms||={},e.uniforms.time=this._time,e.uniforms.factor=this._factor,e.vertexShader=` + uniform float time; + uniform float factor; + ${e.vertexShader} + `,e.vertexShader=e.vertexShader.replace(`#include `,`float theta = sin( time + position.y ) / 2.0 * factor; + float c = cos( theta ); + float s = sin( theta ); + mat3 m = mat3( c, 0, s, 0, 1, 0, -s, 0, c ); + vec3 transformed = vec3( position ) * m; + vNormal = vNormal * m;`)}get time(){return this._time.value}set time(e){this._time.value=e}get factor(){return this._factor.value}set factor(e){this._factor.value=e}};const SO=[`factor`],CO=H({__name:`index`,props:{speed:{default:1},factor:{default:1}},setup(e,{expose:t}){let n=e,r=sn(),{extend:i,invalidate:a}=Qt();i({MeshWobbleMaterial:xO}),K(n,()=>a());let{onBeforeRender:o}=zt();return o(({elapsed:e,invalidate:t})=>{r.value&&(r.value.time=e*n?.speed,t())}),t({instance:r}),(e,t)=>(U(),V(`TresMeshWobbleMaterial`,Ut({ref_key:`materialRef`,ref:r,factor:e.factor},e.$attrs),null,16,SO))}}),wO=H({name:`BakeShadows`,setup(){let{renderer:e}=Qt();jn(()=>{e.value.shadowMap.autoUpdate=!1,e.value.shadowMap.needsUpdate=!0})}});var TO=`void main() { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +}`,EO=`#include + +void main() { + vec2 center = vec2(0., 1.); + float rotation = 0.0; + + + + float size = 0.03; + + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + + gl_Position = projectionMatrix * mvPosition; +}`;const DO=new z(0,0,0),OO=new z(0,0,0),kO=new z(0,0,0);function AO(e,t,n){let r=DO.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,a=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*a)+a,r.z]}function jO(e,t){let n=DO.setFromMatrixPosition(e.matrixWorld),r=OO.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),a=t.getWorldDirection(kO);return i.angleTo(a)>Math.PI/2}function MO(e,t,n,r){let i=DO.setFromMatrixPosition(e.matrixWorld),a=i.clone();a.project(t),n.setFromCamera(new pt(a.x,a.y),t);let o=n.intersectObjects(r,!0);if(o.length>0){let e=o[0].distance;return i.distanceTo(n.ray.origin)Math.abs(e)<1e-10?0:e;function IO(e,t,n=``){let r=`matrix3d(`;for(let n=0;n!==16;n++)r+=FO(t[n]*e.elements[n])+(n===15?`)`:`,`);return n+r}const LO=(e=>t=>IO(t,e))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),RO=(e=>(t,n)=>IO(t,e(n),`translate(-50%,-50%)`))(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1]),zO=[`geometry`,`material`],BO=H({__name:`HTML`,props:{geometry:{default:new Ie},material:{},as:{default:`div`},transform:{type:Boolean,default:!1},portal:{},wrapperClass:{},eps:{default:1e-4},distanceFactor:{},fullscreen:{type:Boolean},center:{type:Boolean},pointerEvents:{default:`auto`},sprite:{type:Boolean,default:!1},zIndexRange:{default:()=>[16777271,0]},occlude:{type:[Object,null,Array,Boolean,String]}},emits:[`onOcclude`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=wn(),o=hn(),s=W(),c=W(),{geometry:l,material:u,as:d,transform:f,portal:p,wrapperClass:m,eps:h,distanceFactor:g,fullscreen:_,center:v,pointerEvents:y,sprite:b,occlude:x,zIndexRange:S}=pn(r),{renderer:C,scene:w,camera:E,raycaster:D,sizes:O}=Qt(),k=Ot(()=>document.createElement(d.value)),A=W([0,0,0]),j=W(0),M=W(),N=Ot(()=>f.value?{position:`absolute`,top:0,left:0,width:`${O.width.value}px`,height:`${O.height.value}px`,transformStyle:`preserve-3d`,pointerEvents:`none`,zIndex:2}:{position:`absolute`,transform:v.value?`translate3d(-50%,-50%,0)`:`none`,..._.value&&{top:-O.height.value/2,left:-O.width.value/2,width:`${O.width.value}px`,height:`${O.height.value}px`},zIndex:2,...Object.assign({},o.style)}),ee=Ot(()=>({position:`absolute`,pointerEvents:y.value})),P=W(null),F=W(!1),I=Ot(()=>x?.value&&x?.value!==`blending`||Array.isArray(x?.value)&&x?.value.length&&Vt(x.value[0]));K(()=>x,({value:e})=>{e===`blending`?(k.value.style.zIndex=`${Math.floor(S.value[0]/2)}`,k.value.style.position=`absolute`,k.value.style.pointerEvents=`none`):(k.value.style.zIndex=null,k.value.style.position=null,k.value.style.pointerEvents=null)}),K(()=>{var e;return[s.value,C.value,O.width.value,O.height.value,(e=a.default)?.call(a)]},([e,t])=>{var n,r,i,s,l,u;if(e&&t){let d=p?.value||t.domElement;if((n=w.value)==null||n.updateMatrixWorld(),f.value)k.value.style.cssText=`position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;`;else{let t=AO(e,E.value,{width:O.width.value,height:O.height.value});k.value.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${t[0]}px,${t[1]}px,0);transform-origin:0 0;`}d&&!k.value.parentNode&&((r=d.parentNode)==null||r.appendChild(k.value)),f.value?M.value=Mt(`div`,{id:`outer`,style:N.value},[Mt(`div`,{id:`inner`,style:ee.value},[Mt(`div`,{key:(i=c.value)?.uuid,id:w?.value.uuid,class:o.class,style:o.style},(s=a.default)?.call(a))])]):M.value=Mt(`div`,{key:(l=c.value)?.uuid,id:w?.value.uuid,style:N.value},(u=a.default)?.call(a)),en(M.value,k.value)}}),jn(()=>{m!=null&&m.value&&(k.value.className=m.value)});let te=W(!0),{onBeforeRender:ne}=zt();ne(({invalidate:e})=>{var t,n,r,a,u,d,p;if(e(),s.value&&E.value&&C.value){(t=E.value)==null||t.updateMatrixWorld(),s.value.updateWorldMatrix(!0,!1);let e=f.value?A.value:AO(s.value,E.value,{width:O.width.value||0,height:O.height.value||0});if(f.value||Math.abs(j.value-E.value.zoom)>h.value||Math.abs(A.value[0]-e[0])>h.value||Math.abs(A.value[1]-e[1])>h.value||Math.abs(A.value[2]-e[2])>h.value){let t=jO(s.value,E.value),a=!1;I.value&&(Array.isArray(x?.value)?a=x?.value:x?.value!==`blending`&&(a=[w.value]));let o=te.value;if(a){let e=MO(s.value,E.value,D.value,a);te.value=e&&!t}else te.value=!t;o!==te.value&&(i(`onOcclude`,!te.value),k.value.style.display=te.value?`block`:`none`);let c=Math.floor(S.value[0]/2),l=x!=null&&x.value?I.value?[S.value[0],c]:[c-1,0]:S.value;if(k.value.style.zIndex=`${PO(s.value,E.value,l)}`,f.value){let[e,t]=[O.width.value/2,O.height.value/2],i=E.value.projectionMatrix.elements[5]*t,{isOrthographicCamera:a,top:o,left:c,bottom:l,right:u}=E.value,d=LO(E.value.matrixWorldInverse),f=a?`scale(${i})translate(${FO(-(u+c)/2)}px,${FO((o+l)/2)}px)`:`translateZ(${i}px)`,p=s.value.matrixWorld;if(b.value&&(p=E.value.matrixWorldInverse.clone().transpose().copyPosition(p).scale(s.value.scale),p.elements[3]=p.elements[7]=p.elements[11]=0,p.elements[15]=1),k.value.style.width=`${O.width.value}px`,k.value.style.height=`${O.height.value}px`,k.value.style.perspective=a?``:`${i}px`,(n=M.value)!=null&&n.el&&(r=M.value)!=null&&r.children&&Array.isArray(M.value.children)){M.value.el.style.transform=`${f}${d}translate(${e}px,${t}px)`;let n=M.value.children[0];n&&n.el&&(n.el.style.transform=RO(p,1/((g?.value||10)/400)))}}else{let t=g?.value===void 0?1:NO(s.value,E.value)*g?.value;k.value.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}}A.value=e,j.value=E.value.zoom}if(!I.value&&c.value&&!F.value)if(f.value){if((a=M.value)!=null&&a.el&&(u=M.value)!=null&&u.children){let e=((d=M.value)?.children)[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let{isOrthographicCamera:t}=E.value;if(t||l)o.scale&&(Array.isArray(o.scale)?o.scale instanceof z?c.value.scale.copy(o.scale.clone().divideScalar(1)):c.value.scale.set(1/o.scale[0],1/o.scale[1],1/o.scale[2]):c.value.scale.setScalar(1/o.scale));else{let t=(g?.value||10)/400,n=e.clientWidth*t,r=e.clientHeight*t;c.value.scale.set(n,r,1)}F.value=!0}}}else{let e=k.value.children[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let t=e.clientWidth*1,n=e.clientHeight*1;c.value.scale.set(t,n,1),F.value=!0}P.value.lookAt((p=E.value)?.position)}});let L=Ot(()=>({vertexShader:f.value?void 0:EO,fragmentShader:TO})),re=Ot(()=>{let e=L.value;return u.value||new Xe({vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,side:T})});return Zt(()=>{re.value&&re.value.dispose(),k.value.remove()}),t({instance:s}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`groupRef`,ref:s},[G(x)&&!I.value?(U(),V(`TresMesh`,{key:0,ref_key:`meshRef`,ref:c,geometry:G(l),material:re.value},null,8,zO)):At(``,!0)],512))}});var VO={exports:{}},HO=VO.exports,UO;function WO(){return UO||(UO=1,function(e,t){(function(t,n){e.exports=n()})(HO,function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;to+1e3&&(c.update(1e3*s/(e-o),100),o=e,s=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,c=48*o,l=3*o,u=2*o,d=3*o,f=15*o,p=74*o,m=30*o,h=document.createElement(`canvas`);h.width=s,h.height=c,h.style.cssText=`width:80px;height:48px`;var g=h.getContext(`2d`);return g.font=`bold `+9*o+`px Helvetica,Arial,sans-serif`,g.textBaseline=`top`,g.fillStyle=n,g.fillRect(0,0,s,c),g.fillStyle=t,g.fillText(e,l,u),g.fillRect(d,f,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:h,update:function(c,_){r=Math.min(r,c),i=Math.max(i,c),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(a(c)+` `+e+` (`+a(r)+`-`+a(i)+`)`,l,u),g.drawImage(h,d+o,f,p-o,m,d,f,p-o,m),g.fillRect(d+p-o,f,o,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-o,f,o,a((1-c/_)*m))}}},e})}(VO)),VO.exports}var GO=WO();const KO=XE(GO),qO=H({name:`Stats`,props:{showPanel:{type:Number,default:0}},setup(e,{expose:t}){let n=new KO;t({instance:n});let r=document.body;n.showPanel(e.showPanel||0),r?.appendChild(n.dom);let{onBeforeRender:i,onAfterRender:a}=zt();i(()=>n.begin(),-1/0),a(()=>n.end(),1/0),Zt(()=>{r?.removeChild(n.dom)})}});var JO=class{constructor(e,t,n){this.name=e,this.fg=t,this.bg=n,this.gradient=null,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement(`canvas`),this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width=`90px`,this.canvas.style.height=`48px`,this.canvas.style.position=`absolute`,this.canvas.style.cssText=`width:90px;height:48px`,this.context=this.canvas.getContext(`2d`),this.initializeCanvas()}createGradient(){if(!this.context)throw Error(`No context`);let e=this.context.createLinearGradient(0,this.GRAPH_Y,0,this.GRAPH_Y+this.GRAPH_HEIGHT),t,n=this.fg;switch(this.fg.toLowerCase()){case`#0ff`:t=`#006666`;break;case`#0f0`:t=`#006600`;break;case`#ff0`:t=`#666600`;break;case`#e1e1e1`:t=`#666666`;break;default:t=this.bg;break}return e.addColorStop(0,t),e.addColorStop(1,n),e}initializeCanvas(){this.context&&(this.context.font=`bold `+9*this.PR+`px Helvetica,Arial,sans-serif`,this.context.textBaseline=`top`,this.gradient=this.createGradient(),this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillStyle=this.fg,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(e,t,n,r,i=0){if(!this.context||!this.gradient)return;let a=Math.min(1/0,e),o=Math.max(n,e);r=Math.max(r,t),this.context.globalAlpha=1,this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(`${e.toFixed(i)} ${this.name} (${a.toFixed(i)}-${parseFloat(o.toFixed(i))})`,this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT);let s=this.GRAPH_HEIGHT-(1-t/r)*this.GRAPH_HEIGHT;s>0&&(this.context.globalAlpha=1,this.context.fillStyle=this.gradient,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y+this.GRAPH_HEIGHT-s,this.PR,s))}};const YO=class e{constructor({trackGPU:t=!1,logsPerSecond:n=30,samplesLog:r=60,samplesGraph:i=10,precision:a=2,minimal:o=!1,horizontal:s=!0,mode:c=0}={}){this.gl=null,this.ext=null,this.activeQuery=null,this.gpuQueries=[],this.threeRendererPatched=!1,this.frames=0,this.renderCount=0,this.isRunningCPUProfiling=!1,this.totalCpuDuration=0,this.totalGpuDuration=0,this.totalGpuDurationCompute=0,this.totalFps=0,this.gpuPanel=null,this.gpuPanelCompute=null,this.averageFps={logs:[],graph:[]},this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.averageGpuCompute={logs:[],graph:[]},this.handleClick=e=>{e.preventDefault(),this.showPanel(++this.mode%this.dom.children.length)},this.handleResize=()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2),this.gpuPanelCompute&&this.resizePanel(this.gpuPanelCompute,3)},this.mode=c,this.horizontal=s,this.minimal=o,this.trackGPU=t,this.samplesLog=r,this.samplesGraph=i,this.precision=a,this.logsPerSecond=n,this.dom=document.createElement(`div`),this.initializeDOM(),this.beginTime=performance.now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.fpsPanel=this.addPanel(new e.Panel(`FPS`,`#0ff`,`#002`),0),this.msPanel=this.addPanel(new e.Panel(`CPU`,`#0f0`,`#020`),1),this.setupEventListeners()}initializeDOM(){this.dom.style.cssText=` + position: fixed; + top: 0; + left: 0; + opacity: 0.9; + z-index: 10000; + ${this.minimal?`cursor: pointer;`:``} + `}setupEventListeners(){this.minimal?(this.dom.addEventListener(`click`,this.handleClick),this.showPanel(this.mode)):window.addEventListener(`resize`,this.handleResize)}async init(e){if(!e){console.error(`Stats: The "canvas" parameter is undefined.`);return}this.handleThreeRenderer(e)||await this.handleWebGPURenderer(e)||this.initializeWebGL(e)}handleThreeRenderer(e){return e.isWebGLRenderer&&!this.threeRendererPatched?(this.patchThreeRenderer(e),this.gl=e.getContext(),this.trackGPU&&this.initializeGPUTracking(),!0):!1}async handleWebGPURenderer(e){return e.isWebGPURenderer?(this.trackGPU&&(e.backend.trackTimestamp=!0,await e.hasFeatureAsync(`timestamp-query`)&&this.initializeWebGPUPanels()),this.info=e.info,!0):!1}initializeWebGPUPanels(){this.gpuPanel=this.addPanel(new e.Panel(`GPU`,`#ff0`,`#220`),2),this.gpuPanelCompute=this.addPanel(new e.Panel(`CPT`,`#e1e1e1`,`#212121`),3)}initializeWebGL(e){if(e instanceof WebGL2RenderingContext)this.gl=e;else if(e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas){if(this.gl=e.getContext(`webgl2`),!this.gl)return console.error(`Stats: Unable to obtain WebGL2 context.`),!1}else return console.error(`Stats: Invalid input type. Expected WebGL2RenderingContext, HTMLCanvasElement, or OffscreenCanvas.`),!1;return!0}initializeGPUTracking(){this.gl&&(this.ext=this.gl.getExtension(`EXT_disjoint_timer_query_webgl2`),this.ext&&(this.gpuPanel=this.addPanel(new e.Panel(`GPU`,`#ff0`,`#220`),2)))}begin(){this.isRunningCPUProfiling||this.beginProfiling(`cpu-started`),!(!this.gl||!this.ext)&&(this.activeQuery&&this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.activeQuery=this.gl.createQuery(),this.activeQuery&&this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.activeQuery))}end(){this.renderCount++,this.gl&&this.ext&&this.activeQuery&&(this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.gpuQueries.push({query:this.activeQuery}),this.activeQuery=null)}update(){this.info?this.processWebGPUTimestamps():this.processGpuQueries(),this.endProfiling(`cpu-started`,`cpu-finished`,`cpu-duration`),this.updateAverages(),this.resetCounters()}processWebGPUTimestamps(){this.totalGpuDuration=this.info.render.timestamp,this.totalGpuDurationCompute=this.info.compute.timestamp,this.addToAverage(this.totalGpuDurationCompute,this.averageGpuCompute)}updateAverages(){this.addToAverage(this.totalCpuDuration,this.averageCpu),this.addToAverage(this.totalGpuDuration,this.averageGpu)}resetCounters(){this.renderCount=0,this.totalCpuDuration===0&&this.beginProfiling(`cpu-started`),this.totalCpuDuration=0,this.totalFps=0,this.beginTime=this.endInternal()}resizePanel(e,t){e.canvas.style.position=`absolute`,this.minimal?e.canvas.style.display=`none`:(e.canvas.style.display=`block`,this.horizontal?(e.canvas.style.top=`0px`,e.canvas.style.left=t*e.WIDTH/e.PR+`px`):(e.canvas.style.left=`0px`,e.canvas.style.top=t*e.HEIGHT/e.PR+`px`))}addPanel(e,t){return e.canvas&&(this.dom.appendChild(e.canvas),this.resizePanel(e,t)),e}showPanel(e){for(let t=0;t{if(this.gl){let n=this.gl.getQueryParameter(e.query,this.gl.QUERY_RESULT_AVAILABLE),r=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT);if(n&&!r){let n=this.gl.getQueryParameter(e.query,this.gl.QUERY_RESULT)*1e-6;this.totalGpuDuration+=n,this.gl.deleteQuery(e.query),this.gpuQueries.splice(t,1)}}}))}endInternal(){this.frames++;let e=(performance||Date).now(),t=e-this.prevTime;if(e>=this.prevCpuTime+1e3/this.logsPerSecond){let n=Math.round(this.frames*1e3/t);this.addToAverage(n,this.averageFps),this.updatePanel(this.fpsPanel,this.averageFps,0),this.updatePanel(this.msPanel,this.averageCpu,this.precision),this.updatePanel(this.gpuPanel,this.averageGpu,this.precision),this.gpuPanelCompute&&this.updatePanel(this.gpuPanelCompute,this.averageGpuCompute),this.frames=0,this.prevCpuTime=e,this.prevTime=e}return e}addToAverage(e,t){t.logs.push(e),t.logs.length>this.samplesLog&&t.logs.shift(),t.graph.push(e),t.graph.length>this.samplesGraph&&t.graph.shift()}beginProfiling(e){window.performance&&(window.performance.mark(e),this.isRunningCPUProfiling=!0)}endProfiling(e,t,n){if(window.performance&&t&&this.isRunningCPUProfiling){window.performance.mark(t);let r=performance.measure(n,e,t);this.totalCpuDuration+=r.duration,this.isRunningCPUProfiling=!1}}updatePanel(e,t,n=2){if(t.logs.length>0){let r=0,i=.01;for(let e=0;ei&&(i=t.logs[e]);let a=0,o=.01;for(let e=0;eo&&(o=t.graph[e]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),a/Math.min(t.graph.length,this.samplesGraph),i,o,n)}}get domElement(){return this.dom}patchThreeRenderer(e){let t=e.render,n=this;e.render=function(e,r){n.begin(),t.call(this,e,r),n.end()},this.threeRendererPatched=!0}};YO.Panel=JO;let XO=YO;const ZO=H({name:`StatsGl`,props:[`logsPerSecond`,`samplesLog`,`samplesGraph`,`precision`,`horizontal`,`minimal`,`mode`],setup(e,{expose:t}){let n=new XO({logsPerSecond:e.logsPerSecond,samplesLog:e.samplesLog,samplesGraph:e.samplesGraph,precision:e.precision,horizontal:e.horizontal,minimal:e.minimal,mode:e.mode});t({instance:n});let r=document.body,i=n.dom||n.container;r?.appendChild(i);let{renderer:a}=Qt(),{onAfterRender:o}=zt();n.init(a.value),o(()=>n.update(),1/0),Zt(()=>{r?.removeChild(i)})}}),{logError:QO}=Re(),$O=[`args`],ek=[`color`],tk=H({__name:`Box`,props:{args:{default:()=>[1,1,1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{invalidate:r}=Qt(),{args:i,color:a}=pn(n);K(i,()=>r());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`boxRef`,ref:o},e.$attrs),[B(`TresBoxGeometry`,{args:G(i)},null,8,$O),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(a)},null,8,ek)])],16))}}),nk=[`object`],rk=H({__name:`Line2`,props:{points:{},vertexColors:{default:null},color:{default:`white`},lineWidth:{default:1},worldUnits:{type:Boolean,default:!1},alphaToCoverage:{type:Boolean,default:!1},dashed:{type:Boolean,default:!1},dashSize:{default:1},gapSize:{default:1},dashScale:{default:1},dashOffset:{default:0}},setup(e,{expose:t}){let n=e;function r(e,t){if(!e||e.length===0)return Array.from({length:t}).fill(Te(n.color));if(e.length===1)return Array.from({length:t}).fill(Te(e[0]));if(e.length===t)return e.map(Te);let r=t-1,i=e.map(Te);closed&&i.push(i[0].clone());let a=[i[0]],o=r/(i.length-1);for(let e=1;eArray.isArray(n.vertexColors));function u(e,t){e.color=Te(t.color),e.linewidth=t.lineWidth,e.alphaToCoverage=t.alphaToCoverage,e.worldUnits=t.worldUnits,e.vertexColors=Array.isArray(t.vertexColors),e.dashed=t.dashed,e.dashScale=t.dashScale,e.dashSize=t.dashSize,e.dashOffset=t.dashOffset,e.gapSize=t.gapSize,e.needsUpdate=!0}function d(e,t,n){let i=t.map(e=>e instanceof z?[e.x,e.y,e.z]:e instanceof pt?[e.x,e.y,0]:Array.isArray(e)&&e.length===2?[e[0],e[1],0]:e).flat();e.setPositions(i.flat());let a=r(n,t.length).map(e=>e.toArray()).flat();e.setColors(a),o.computeLineDistances()}u(i,n),d(a,n.points,n.vertexColors),o.computeLineDistances(),K(()=>[n.color,n.lineWidth,n.alphaToCoverage,n.worldUnits,l,n.dashed,n.dashScale,n.dashSize,n.dashOffset],()=>{u(i,n),c()}),K(()=>[n.points,n.vertexColors],()=>{d(a,n.points,n.vertexColors),c()}),K(()=>[s.height,s.width],()=>{i.resolution=new pt(s.width.value,s.height.value),c()}),Zt(()=>{a.dispose(),i.dispose()});let f=sn();return t({instance:f}),(e,t)=>(U(),V(`primitive`,{ref:f.value,object:G(o)},null,8,nk))}}),ik=H({__name:`CatmullRomCurve3`,props:{segments:{default:20},closed:{type:Boolean,default:!1},curveType:{default:`centripetal`},tension:{default:.5},points:{},vertexColors:{},color:{},lineWidth:{},alphaToCoverage:{type:Boolean},dashed:{type:Boolean},dashSize:{},dashScale:{},dashOffset:{},gapSize:{},worldUnits:{type:Boolean}},setup(e,{expose:t}){let n=e;function r(e,t,n,r){let i=e.map(e=>e instanceof z?e:new z(...e));return new p(i,t,n,r)}function i(e,t){return e.getPoints(t)}let a=Ot(()=>r(n.points,n.closed,n.curveType,n.tension)),o=Ot(()=>i(a.value,n.segments)),s=sn();return t({instance:s}),(e,t)=>(U(),kt(rk,{ref:s.value,points:o.value,"vertex-colors":n.vertexColors,color:n.color,"line-width":n.lineWidth,"alpha-to-coverage":n.alphaToCoverage,dashed:n.dashed,"dash-size":n.dashSize,"dash-scale":n.dashScale,"dash-offset":n.dashOffset,"gap-size":n.gapSize,"world-units":n.worldUnits},null,8,[`points`,`vertex-colors`,`color`,`line-width`,`alpha-to-coverage`,`dashed`,`dash-size`,`dash-scale`,`dash-offset`,`gap-size`,`world-units`]))}}),ak=[`args`],ok=[`color`],sk=H({__name:`Circle`,props:{args:{default:()=>[1,32,0,Math.PI*2]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`circleRef`,ref:o},e.$attrs),[B(`TresCircleGeometry`,{args:G(r)},null,8,ak),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,ok)])],16))}}),ck=[`args`],lk=[`color`],uk=H({__name:`Cone`,props:{args:{default:()=>[1,1,12,12,!1,0,Math.PI*2]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`coneRef`,ref:o},e.$attrs),[B(`TresConeGeometry`,{args:G(r)},null,8,ck),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,lk)])],16))}}),dk=[`args`],fk=[`color`],pk=H({__name:`Cylinder`,props:{args:{default:()=>[1,1,1,32,1,!1,0,Math.PI*2]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`cylinderRef`,ref:o},e.$attrs),[B(`TresCylinderGeometry`,{args:G(r)},null,8,dk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,fk)])],16))}}),mk=[`args`],hk=[`color`],gk=H({__name:`Dodecahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),a=sn(),{invalidate:o}=Qt();return K(r,()=>o()),t({instance:a}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`dodecahedronRef`,ref:a},e.$attrs),[B(`TresDodecahedronGeometry`,{args:G(r)},null,8,mk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,hk)])],16))}}),_k=[`args`],vk=[`color`],yk=H({__name:`Icosahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`icosahedronRef`,ref:o},e.$attrs),[B(`TresIcosahedronGeometry`,{args:G(r)},null,8,_k),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,vk)])],16))}}),bk=[`args`],xk=[`color`],Sk=H({__name:`Octahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`octahedronRef`,ref:o},e.$attrs),[B(`TresOctahedronGeometry`,{args:G(r)},null,8,bk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,xk)])],16))}}),Ck=[`rotation`],wk=[`args`],Tk=[`color`],Ek=H({__name:`Plane`,props:{args:{default:()=>[1,1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`planeRef`,ref:o,rotation:[-Math.PI/2,0,0]},e.$attrs),[B(`TresPlaneGeometry`,{args:G(r)},null,8,wk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,Tk)])],16,Ck))}}),Dk=[`args`],Ok=[`color`],kk=H({__name:`Ring`,props:{args:{default:()=>[.5,1,32]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`ringRef`,ref:o},e.$attrs),[B(`TresRingGeometry`,{args:G(r)},null,8,Dk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,Ok)])],16))}}),Ak=[`args`],jk=[`color`],Mk=H({__name:`RoundedBox`,props:{args:{default:()=>[1,1,1,2,.1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a,extend:o}=Qt();o({RoundedBoxGeometry:zC}),K(r,()=>a());let s=sn();return t({instance:s}),(e,t)=>(U(),V(`TresMesh`,{ref_key:`roundedBoxRef`,ref:s},[B(`TresRoundedBoxGeometry`,{args:G(r)},null,8,Ak),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,jk)])],512))}}),Nk=[`args`],Pk=[`color`],Fk=H({__name:`Sphere`,props:{args:{default:()=>[2,32,16]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`sphereRef`,ref:o},e.$attrs),[B(`TresSphereGeometry`,{args:G(r)},null,8,Nk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,Pk)])],16))}}),Ik=[`geometry`],Lk=[`color`],Rk=H({__name:`Superformula`,props:{widthSegments:{default:32},heightSegments:{default:32},numArmsA:{default:4},expA:{default:()=>[40,1.3,.9]},numArmsB:{default:4},expB:{default:()=>[40,1.3,.9]},color:{default:`white`}},setup(e,{expose:t}){let n=e,{invalidate:r}=Qt(),{cos:i,sin:a,abs:o}=Math,s=sn(),c=sn(n.color);function l(e,t){let n=new f,r=e*t,i=new Float32Array(Array.from({length:3*r}).fill(0)),a=new Float32Array(Array.from({length:3*r}).fill(0)),o=[];for(let n=0;nn.color,()=>c.value=n.color),K(()=>[n.widthSegments,n.heightSegments],()=>{s.value&&s.value.dispose(),s.value=l(n.widthSegments,n.heightSegments),r()},{immediate:!0}),K(()=>[n.numArmsA,n.expA[0],n.expA[1],n.expA[2],n.numArmsB,n.expB[0],n.expB[1],n.expB[2]],()=>{p(s.value,n.numArmsA,n.expA[0],n.expA[1],n.expA[2],n.numArmsB,n.expB[0],n.expB[1],n.expB[2],n.widthSegments,n.heightSegments),r()},{immediate:!0}),Zt(()=>{s.value&&s.value.dispose()});let m=sn();return t({instance:m}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`superformulaRef`,ref:m},e.$attrs,{geometry:s.value}),[nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:c.value},null,8,Lk)])],16,Ik))}}),zk=[`rotation`],Bk=[`args`],Vk=[`color`],Hk=H({__name:`Tetrahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),a=sn();return t({instance:a}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`tetrahedronRef`,ref:a,rotation:[-Math.PI/2,0,0]},e.$attrs),[B(`TresTetrahedronGeometry`,{args:G(r)},null,8,Bk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,Vk)])],16,zk))}}),Uk=[`args`],Wk=[`color`],Gk=H({__name:`Torus`,props:{args:{default:()=>[1,1,16,80]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`torusRef`,ref:o},e.$attrs),[B(`TresTorusGeometry`,{args:G(r)},null,8,Uk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,Wk)])],16))}}),Kk=[`args`],qk=[`color`],Jk=H({__name:`TorusKnot`,props:{args:{default:()=>[1,.4,64,8]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`torusKnotRef`,ref:o},e.$attrs),[B(`TresTorusKnotGeometry`,{args:G(r)},null,8,Kk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,qk)])],16))}}),Yk=[`args`],Xk=[`color`],Zk=H({__name:`Tube`,props:{args:{default:()=>[new ze(new z(-1,0,0),new z(0,1,0),new z(1,0,0)),20,.2,8,!1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=pn(n),{invalidate:a}=Qt();K(r,()=>a());let o=sn();return t({instance:o}),(e,t)=>(U(),V(`TresMesh`,Ut({ref_key:`tubeRef`,ref:o},e.$attrs),[B(`TresTubeGeometry`,{args:G(r)},null,8,Yk),nn(e.$slots,`default`,{},()=>[B(`TresMeshBasicMaterial`,{color:G(i)},null,8,Xk)])],16))}}),Qk=H({__name:`Align`,props:{top:{type:Boolean},right:{type:Boolean},bottom:{type:Boolean},left:{type:Boolean},front:{type:Boolean},back:{type:Boolean},disable:{type:Boolean},disableX:{type:Boolean},disableY:{type:Boolean},disableZ:{type:Boolean},precise:{type:Boolean,default:!0},onAlign:{},cacheKey:{default:void 0}},setup(e,{expose:t}){let n=e,r=sn(),i=sn(),a=sn(),o=new l,s=new z,c=new nt;function u(){if(!i.value||!a.value||!r.value)return;i.value.matrixWorld.identity(),o.setFromObject(a.value,n.precise);let e=o.max.x-o.min.x,t=o.max.y-o.min.y,l=o.max.z-o.min.z;o.getCenter(s),o.getBoundingSphere(c);let u=n.top?t/2:n.bottom?-t/2:0,d=n.left?-e/2:n.right?e/2:0,f=n.front?l/2:n.back?-l/2:0;i.value.position.set(n.disable||n.disableX?0:-s.x+d,n.disable||n.disableY?0:-s.y+u,n.disable||n.disableZ?0:-s.z+f),typeof n.onAlign<`u`&&n.onAlign({parent:r.value.parent,container:r.value,width:e,height:t,depth:l,boundingBox:o,boundingSphere:c,center:s,verticalAlignment:u,horizontalAlignment:d,depthAlignment:f})}let d=null,f=null,p=zt();return jn(()=>{d?.(),d=null;let e=mn(n.cacheKey);e===f&&f!=null||(f=e,n.cacheKey===null||n.cacheKey===void 0?d=p.onBeforeRender(()=>{u()}).off:u())}),t({instance:r,update:u}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`ref`,ref:r},[B(`TresGroup`,{ref_key:`outer`,ref:i},[B(`TresGroup`,{ref_key:`inner`,ref:a},[nn(e.$slots,`default`)],512)],512)],512))}}),$k=[`receive-shadow`,`rotation`],eA=[`args`],tA=H({__name:`Backdrop`,props:{floor:{default:.25},segments:{default:20},receiveShadow:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,r=e=>e===0?0:2**(10*e-10),{floor:i,segments:a,receiveShadow:o}=pn(n),s=W(null);K([a,i,s],([e,t,n])=>{if(!n||e===null)return;let i=0,a=e/e/2,o=n.attributes.position;for(let n=0;n(U(),V(`TresGroup`,Ut({ref_key:`backdropRef`,ref:c},e.$attrs),[B(`TresMesh`,{"receive-shadow":G(o),rotation:[-Math.PI/2,0,Math.PI/2]},[B(`TresPlaneGeometry`,{ref_key:`planeRef`,ref:s,args:[1,1,G(a),G(a)]},null,8,eA),nn(e.$slots,`default`,{},()=>[t[0]||=B(`TresMeshStandardMaterial`,{color:8421504,side:2},null,-1)])],8,$k)],16))}}),nA=[`object`],rA=H({__name:`ContactShadows`,props:{opacity:{default:1},blur:{default:1},color:{default:`#000000`},tint:{default:void 0},scale:{default:10},width:{default:1},height:{default:1},far:{default:10},smooth:{type:Boolean,default:!0},resolution:{default:512},frames:{default:1/0},depthWrite:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e;function r(e,t,n){n.blurPlane.visible=!0,n.blurPlane.material=n.horizontalBlurMaterial,n.horizontalBlurMaterial.uniforms.tDiffuse.value=n.renderTarget.texture,n.horizontalBlurMaterial.uniforms.h.value=e/256,t.setRenderTarget(n.renderTargetBlur),t.render(n.blurPlane,n.shadowCamera),n.blurPlane.material=n.verticalBlurMaterial,n.verticalBlurMaterial.uniforms.tDiffuse.value=n.renderTargetBlur.texture,n.verticalBlurMaterial.uniforms.v.value=e/256,t.setRenderTarget(n.renderTarget),t.render(n.blurPlane,n.shadowCamera),n.blurPlane.visible=!1}function i(e,t,n,i){let{renderTarget:a,shadowCamera:o,depthMaterial:s}=i,c=t.background;t.background=null,t.overrideMaterial=s;let l=n.getClearAlpha();n.setClearAlpha(0),n.setRenderTarget(a),n.render(t,o),t.overrideMaterial=null,r(e.blur,n,i),e.smooth&&r(e.blur*.4,n,i),n.setRenderTarget(null),n.setClearAlpha(l),t.background=c}function a(e){let t=new I,n=new _t(e.resolution,e.resolution);n.texture.generateMipmaps=!1;let r=new _t(e.resolution,e.resolution);r.texture.generateMipmaps=!1;let i=new Ie(e.width,e.height).rotateX(Math.PI/2),a=new xe({map:n.texture,opacity:e.opacity,transparent:!0,depthWrite:e.depthWrite,color:new h(e.color??`black`)}),o=new be(i,a);t.add(o),o.scale.y=-1;let s=new be(i);s.visible=!1,t.add(s);let c=new Me(-e.width/2,e.width/2,e.height/2,-e.height/2,0,.3);c.rotation.x=Math.PI/2,t.add(c);let l=new Se,u=new Xe(VC);u.depthTest=!1;let d=new Xe(HC);return d.depthTest=!1,{renderTarget:n,renderTargetBlur:r,shadowCamera:c,depthMaterial:l,horizontalBlurMaterial:u,verticalBlurMaterial:d,shadowGroup:t,plane:o,blurPlane:s}}function o(e,t){let n=t.shadowCamera;n.left=-e.width/2,n.right=e.width/2,n.top=e.height/2,n.bottom=-e.height/2,n.far=e.far;let r=e.width*(Array.isArray(e.scale)?e.scale[0]:e.scale||1),i=e.height*(Array.isArray(e.scale)?e.scale[1]:e.scale||1);t.shadowGroup.scale.set(r,e.far,i)}function s(e,t){t.renderTarget.dispose(),t.renderTargetBlur.dispose(),t.renderTarget=new _t(e,e),t.renderTarget.texture.generateMipmaps=!1,t.renderTargetBlur=new _t(e,e),t.renderTargetBlur.texture.generateMipmaps=!1,t.plane.material.map=t.renderTarget.texture}function c(e,t){t.plane.material.color=new h(e.color??`black`),t.depthMaterial.dispose(),t.depthMaterial=new Se,t.depthMaterial.onBeforeCompile=function(t){let n=e.tint?new h(e.tint):new h(`white`),{r,g:i,b:a}=n,o=t.fragmentShader.replace(`gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );`,`gl_FragColor = vec4( ${r}, ${i}, ${a}, ( 1.0 - fragCoordZ ) * opacity);`);t.fragmentShader=o}}let{onBeforeRender:l}=zt(),u=a(n),d=0,f=()=>d=d>=n.frames?n.frames-1:d;return l(({renderer:e,scene:t,invalidate:r})=>{d[n.opacity,n.depthWrite,n.blur,n.smooth],()=>{u.plane.material.opacity=n.opacity??1,u.plane.material.depthWrite=n.depthWrite??!1,f()},{immediate:!0}),K(()=>[n.color,n.tint],()=>{c(n,u),f()},{immediate:!0}),K(()=>[n.resolution],()=>{s(n.resolution,u),f()}),K(()=>[n.width,n.height,n.scale,n.far],()=>{o(n,u),f()},{immediate:!0}),Zt(()=>{for(let e of Object.values(u))e&&`dispose`in e&&typeof e.dispose==`function`&&e.dispose()}),t({instance:u.shadowGroup}),(e,t)=>(U(),V(`primitive`,{object:G(u).shadowGroup},null,8,nA))}}),iA=H({__name:`Fit`,props:{into:{default:()=>new l(new z(-.5,-.5,-.5),new z(.5,.5,.5))},precise:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,{invalidate:r}=Qt(),i=sn(new I),a=sn(new I);function o(e,t){if(i.value.position.set(0,0,0),i.value.updateMatrixWorld(),a.value.scale.set(1,1,1),a.value.updateMatrixWorld(),!a.value.children.length||e===null)return;let{box3:n,use:o}=s(e,t),c=new l;a.value.children.forEach(e=>c.expandByObject(e,t));let u=c.getSize(new z),d=n.getSize(new z),f=Math.min(d.x/u.x,d.y/u.y,d.z/u.z);a.value.scale.setScalar(f===1/0?1:f),a.value.updateMatrixWorld();let p=i.value.worldToLocal(c.getCenter(new z));if(o.position){let e=i.value.worldToLocal(n.getCenter(new z));i.value.position.copy(e.sub(p.multiplyScalar(f)))}else i.value.position.copy(p.sub(p.multiplyScalar(f)));r()}function s(e,t){return typeof e==`number`?e=new z(e,e,e):Array.isArray(e)&&(e=new z(...e)),e&&`isVector3`in e&&e.isVector3?{box3:new l(new z(0,0,0),e),use:{position:!1}}:e&&`isBox3`in e&&e.isBox3?{box3:e,use:{position:!0}}:e&&`isObject3D`in e&&e.isObject3D?{box3:new l().setFromObject(e,t??!1),use:{position:!0}}:{box3:new l(new z(-.5,-.5,-.5),new z(.5,.5,.5)),use:{position:!0}}}K(()=>[n.into,n.precise],()=>o(n.into,n.precise)),Yt(()=>{o(n.into,n.precise),Wt().then(()=>{o(n.into,n.precise)})});let c=sn();return t({instance:c,fit:(e=new l(new z(-.5,-.5,-.5),new z(.5,.5,.5)),t=!1)=>{o(e,t)},update:()=>o(n.into,n.precise)}),(e,t)=>(U(),V(`TresGroup`,{ref_key:`outer`,ref:c},[B(`TresGroup`,{ref_key:`middle`,ref:i},[B(`TresGroup`,{ref_key:`inner`,ref:a},[nn(e.$slots,`default`)],512)],512)],512))}}),aA=[`side`,`cell-size`,`section-size`,`cell-color`,`section-color`,`cell-thickness`,`section-thickness`,`fade-distance`,`fade-strength`,`fade-from`,`infinite-grid`,`follow-camera`],oA=[`args`],sA=H({__name:`Grid`,props:{cellSize:{default:.5},cellThickness:{default:.5},cellColor:{default:`#000000`},sectionSize:{default:1},sectionThickness:{default:1},sectionColor:{default:`#0000ff`},followCamera:{type:Boolean,default:!1},infiniteGrid:{type:Boolean,default:!1},fadeDistance:{default:100},fadeStrength:{default:1},fadeFrom:{default:1},side:{default:s},args:{}},setup(e){let t=e,n=ax({cellSize:.5,sectionSize:1,fadeDistance:100,fadeStrength:1,fadeFrom:1,cellThickness:.5,sectionThickness:1,cellColor:new h,sectionColor:new h,infiniteGrid:!1,followCamera:!1,worldCamProjPosition:new z,worldPlanePosition:new z},` + varying vec3 localPosition; + varying vec4 worldPosition; + + uniform vec3 worldCamProjPosition; + uniform vec3 worldPlanePosition; + uniform float fadeDistance; + uniform bool infiniteGrid; + uniform bool followCamera; + + void main() { + localPosition = position.xzy; + if (infiniteGrid) localPosition *= 1.0 + fadeDistance; + + worldPosition = modelMatrix * vec4(localPosition, 1.0); + if (followCamera) { + worldPosition.xyz += (worldCamProjPosition - worldPlanePosition); + localPosition = (inverse(modelMatrix) * worldPosition).xyz; + } + + gl_Position = projectionMatrix * viewMatrix * worldPosition; + } + `,` + varying vec3 localPosition; + varying vec4 worldPosition; + + uniform vec3 worldCamProjPosition; + uniform float cellSize; + uniform float sectionSize; + uniform vec3 cellColor; + uniform vec3 sectionColor; + uniform float fadeDistance; + uniform float fadeStrength; + uniform float fadeFrom; + uniform float cellThickness; + uniform float sectionThickness; + + float getGrid(float size, float thickness) { + vec2 r = localPosition.xz / size; + vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r); + float line = min(grid.x, grid.y) + 1.0 - thickness; + return 1.0 - min(line, 1.0); + } + + void main() { + float g1 = getGrid(cellSize, cellThickness); + float g2 = getGrid(sectionSize, sectionThickness); + + vec3 from = worldCamProjPosition*vec3(fadeFrom); + float dist = distance(from, worldPosition.xyz); + float d = 1.0 - min(dist / fadeDistance, 1.0); + vec3 color = mix(cellColor, sectionColor, min(1.0, sectionThickness * g2)); + + gl_FragColor = vec4(color, (g1 + g2) * pow(d, fadeStrength)); + gl_FragColor.a = mix(0.75 * gl_FragColor.a, gl_FragColor.a, g2); + if (gl_FragColor.a <= 0.0) discard; + + #include + #include + } + `);D({GridMaterial:n});let r=sn(new be),i=new Fe,a=new z(0,1,0),o=new z(0,0,0);return zt().onBeforeRender(e=>{i.setFromNormalAndCoplanarPoint(a,o).applyMatrix4(r.value.matrixWorld);let t=r.value.material,n=t.uniforms.worldCamProjPosition,s=t.uniforms.worldPlanePosition;i.projectPoint(e.camera.position,n.value),s.value.set(0,0,0).applyMatrix4(r.value.matrixWorld)}),(e,n)=>(U(),V(`TresMesh`,{ref_key:`ref`,ref:r,"frustum-culled":!1},[B(`TresGridMaterial`,{transparent:!0,"extensions-derivatives":!0,side:t.side,"cell-size":t.cellSize,"section-size":t.sectionSize,"cell-color":t.cellColor,"section-color":t.sectionColor,"cell-thickness":t.cellThickness,"section-thickness":t.sectionThickness,"fade-distance":t.fadeDistance,"fade-strength":t.fadeStrength,"fade-from":t.fadeFrom,"infinite-grid":t.infiniteGrid,"follow-camera":t.followCamera},null,8,aA),B(`TresPlaneGeometry`,{args:t.args},null,8,oA)],512))}}),cA=[`rotation-x`,`args`],lA=H({__name:`Ocean`,props:{textureWidth:{default:512},textureHeight:{default:512},waterNormals:{default:`https://raw.githubusercontent.com/Tresjs/assets/main/textures/water-normals/Water_1_M_Normal.jpg`},sunDirection:{default:()=>new z},sunColor:{default:16777215},waterColor:{default:7695},distortionScale:{default:3.7},size:{default:1},clipBias:{default:0},alpha:{default:1},side:{default:F}},async setup(e,{expose:t}){let n,r,i=e,{textureWidth:a,textureHeight:o,waterNormals:s,sunDirection:c,sunColor:l,waterColor:u,distortionScale:d,size:f,clipBias:p,alpha:m,side:h}=pn(i),{extend:g,scene:_}=Qt();g({Water:KS});let v=sn(),y=sn(),b=_.value.fog!==void 0;t({instance:v}),_.value.traverse(e=>{Object.prototype.hasOwnProperty.call(e,`isSky`)&&(y.value=e)}),Yt(async()=>{if(await Wt(),y.value){let e=y.value.material.uniforms.sunPosition.value;v.value.material.uniforms.sunDirection.value.copy(e)}});let{normalMap:x}=([n,r]=Mn(()=>Pt({normalMap:s.value})),n=await n,r(),n);x.wrapS=x.wrapT=Ke;let{onBeforeRender:S}=zt();return S(({delta:e,invalidate:t})=>{v.value.material.uniforms.time.value+=e,t()}),(e,t)=>(U(),V(`TresWater`,{ref_key:`waterRef`,ref:v,"rotation-x":-Math.PI/2,args:[void 0,{textureWidth:G(a),textureHeight:G(o),waterNormals:G(x),sunDirection:G(c),sunColor:G(l),waterColor:G(u),distortionScale:G(d),fog:b,size:G(f),clipBias:G(p),alpha:G(m),side:G(h)}]},[nn(e.$slots,`default`,{},()=>[t[0]||=B(`TresPlaneGeometry`,{args:[1e4,1e4]},null,-1)])],8,cA))}}),uA=[`size`,`color`,`alpha-map`,`map`,`opacity`,`alpha-test`,`depth-write`,`transparent`,`size-attenuation`],dA=[`position`,`velocity`],fA=H({__name:`Precipitation`,props:{size:{default:.1},area:{default:()=>[10,10,20]},color:{default:16777215},map:{},alphaMap:{},alphaTest:{default:.01},opacity:{default:.8},count:{default:5e3},speed:{default:.1},randomness:{default:.5},depthWrite:{type:Boolean,default:!1},transparent:{type:Boolean,default:!0},sizeAttenuation:{type:Boolean,default:!0}},setup(e,{expose:t}){let n=e,{size:r,area:i,color:a,alphaMap:o,map:s,opacity:c,alphaTest:l,depthWrite:u,transparent:d,sizeAttenuation:f,count:p,speed:m,randomness:h}=pn(n),g=sn(),_=[],v=[],y=()=>{_=new Float32Array(p.value*3);for(let e=0;e{v=new Float32Array(p.value*2);for(let e=0;e{b(),y()});let x=sn(null),S=sn(null);jn(async()=>{jn(async()=>{if(typeof o.value==`string`){let e=await Pt({alphaMap:o.value});x.value=e.alphaMap}else x.value=o.value??null;if(typeof s.value==`string`){let e=await Pt({map:s.value});S.value=e.map}else S.value=s.value??null})});let{onBeforeRender:C}=zt();C(({invalidate:e})=>{var t,n;if((t=g.value)!=null&&t.attributes.position.array&&(n=g.value)!=null&&n.attributes.position.count){let t=g.value.attributes.position.array;for(let e=0;e=i.value[0]/2)&&(t[e*3]=t[e*3]*-1),(t[e*3+1]<=-i.value[1]/2||t[e*3+1]>=i.value[1]/2)&&(t[e*3+1]=t[e*3+1]*-1)}g.value.attributes.position.needsUpdate=!0,e()}});let w=sn();return t({instance:w}),(e,t)=>(U(),V(`TresPoints`,{ref_key:`pointsRef`,ref:w},[B(`TresPointsMaterial`,{size:G(r),color:G(a),"alpha-map":x.value,map:S.value,opacity:G(c),"alpha-test":G(l),"depth-write":G(u),transparent:G(d),"size-attenuation":G(f)},null,8,uA),B(`TresBufferGeometry`,{ref_key:`geometryRef`,ref:g,position:[G(_),3],velocity:[G(v)]},null,8,dA)],512))}}),pA=[`object`,`material-uniforms-turbidity-value`,`material-uniforms-rayleigh-value`,`material-uniforms-mieCoefficient-value`,`material-uniforms-mieDirectionalG-value`,`material-uniforms-sunPosition-value`,`scale`],mA=H({__name:`Sky`,props:{turbidity:{default:3.4},rayleigh:{default:3},mieCoefficient:{default:.005},mieDirectionalG:{default:.7},elevation:{default:.6},azimuth:{default:180},distance:{default:45e4}},setup(e,{expose:t}){let n=e,{invalidate:r}=Qt();K(n,()=>r());let i=sn(),a=new QS,o=Ot(()=>s(n.azimuth,n.elevation));function s(e,t){let n=_e.degToRad(90-t),r=_e.degToRad(e);return new z().setFromSphericalCoords(1,n,r)}return t({instance:i,sunPosition:o.value}),(e,t)=>(U(),V(`primitive`,{ref_key:`skyRef`,ref:i,object:G(a),"material-uniforms-turbidity-value":n.turbidity,"material-uniforms-rayleigh-value":n.rayleigh,"material-uniforms-mieCoefficient-value":n.mieCoefficient,"material-uniforms-mieDirectionalG-value":n.mieDirectionalG,"material-uniforms-sunPosition-value":o.value,scale:n.distance},null,8,pA))}}),hA=[`position`],gA=[`position`],_A=[`scale`],vA=[`map`,`depth-test`,`color-space`,`color`,`opacity`],yA=H({__name:`Smoke`,props:{color:{default:`#ffffff`},opacity:{default:.5},speed:{default:.4},width:{default:10},depth:{default:1.5},segments:{default:20},texture:{default:`https://raw.githubusercontent.com/Tresjs/assets/main/textures/clouds/defaultCloud.png`},depthTest:{type:Boolean,default:!0}},async setup(e,{expose:t}){let n,r,i=e,{width:a,depth:o,segments:s,texture:c,color:l,depthTest:u,opacity:d,speed:f}=pn(i),p=sn(),m=sn();t({instance:p});let h=[s].map((e,t)=>({x:a.value/2-Math.random()*a.value,y:a.value/2-Math.random()*a.value,scale:.4+Math.sin((t+1)/s.value*Math.PI)*((.2+Math.random())*10),density:Math.max(.2,Math.random()),rotation:Math.max(.002,.005*Math.random())*f.value})),g=(e,t)=>e/6*t*d.value,{map:_}=([n,r]=Mn(()=>Pt({map:c.value})),n=await n,r(),n),{renderer:v,camera:y}=Qt(),b=Ot(()=>{var e;return(e=v.value)?.outputColorSpace}),{onBeforeRender:x}=zt();return x(({invalidate:e})=>{var t,n;p.value&&y.value&&m.value&&((t=m.value)==null||t.children.forEach((e,t)=>{e.rotation.z+=h[t].rotation}),p.value.lookAt((n=y.value)?.position),e())}),(e,t)=>(U(),V(`TresGroup`,Ut({ref_key:`smokeRef`,ref:p},e.$attrs),[B(`TresGroup`,{ref_key:`groupRef`,ref:m,position:[0,0,G(s)/2*G(o)]},[(U(!0),V(P,null,tn(G(h),({scale:e,x:t,y:n,density:r},i)=>(U(),V(`TresMesh`,{key:`${i}`,position:[t,n,-i*G(o)]},[B(`TresPlaneGeometry`,{scale:[e,e,e],rotation:[0,0,0]},null,8,_A),B(`TresMeshStandardMaterial`,{map:G(_),"depth-test":G(u),"color-space":b.value,color:G(l),"depth-write":!1,transparent:``,opacity:g(e,r)},null,8,vA)],8,gA))),128))],8,hA)],16))}}),bA=` +return PCSS( shadowMap, shadowCoord ); +`,xA=H({__name:`SoftShadows`,props:{size:{default:25},samples:{default:10},focus:{default:0}},setup(e){let t=e,n=({focus:e=0,size:t=25,samples:n=10}={})=>` +#define PENUMBRA_FILTER_SIZE float(${t}) +#define RGB_NOISE_FUNCTION(uv) (randRGB(uv)) +vec3 randRGB(vec2 uv) { + return vec3( + fract(sin(dot(uv, vec2(12.75613, 38.12123))) * 13234.76575), + fract(sin(dot(uv, vec2(19.45531, 58.46547))) * 43678.23431), + fract(sin(dot(uv, vec2(23.67817, 78.23121))) * 93567.23423) + ); +} + +vec3 lowPassRandRGB(vec2 uv) { + // 3x3 convolution (average) + // can be implemented as separable with an extra buffer for a total of 6 samples instead of 9 + vec3 result = vec3(0); + result += RGB_NOISE_FUNCTION(uv + vec2(-1.0, -1.0)); + result += RGB_NOISE_FUNCTION(uv + vec2(-1.0, 0.0)); + result += RGB_NOISE_FUNCTION(uv + vec2(-1.0, +1.0)); + result += RGB_NOISE_FUNCTION(uv + vec2( 0.0, -1.0)); + result += RGB_NOISE_FUNCTION(uv + vec2( 0.0, 0.0)); + result += RGB_NOISE_FUNCTION(uv + vec2( 0.0, +1.0)); + result += RGB_NOISE_FUNCTION(uv + vec2(+1.0, -1.0)); + result += RGB_NOISE_FUNCTION(uv + vec2(+1.0, 0.0)); + result += RGB_NOISE_FUNCTION(uv + vec2(+1.0, +1.0)); + result *= 0.111111111; // 1.0 / 9.0 + return result; +} +vec3 highPassRandRGB(vec2 uv) { + // by subtracting the low-pass signal from the original signal, we're being left with the high-pass signal + // hp(x) = x - lp(x) + return RGB_NOISE_FUNCTION(uv) - lowPassRandRGB(uv) + 0.5; +} + + +vec2 vogelDiskSample(int sampleIndex, int sampleCount, float angle) { + const float goldenAngle = 2.399963f; // radians + float r = sqrt(float(sampleIndex) + 0.5f) / sqrt(float(sampleCount)); + float theta = float(sampleIndex) * goldenAngle + angle; + float sine = sin(theta); + float cosine = cos(theta); + return vec2(cosine, sine) * r; +} +float penumbraSize( const in float zReceiver, const in float zBlocker ) { // Parallel plane estimation + return (zReceiver - zBlocker) / zBlocker; +} +float findBlocker(sampler2D shadowMap, vec2 uv, float compare, float angle) { + float texelSize = 1.0 / float(textureSize(shadowMap, 0).x); + float blockerDepthSum = float(${e}); + float blockers = 0.0; + + int j = 0; + vec2 offset = vec2(0.); + float depth = 0.; + + #pragma unroll_loop_start + for(int i = 0; i < ${n}; i ++) { + offset = (vogelDiskSample(j, ${n}, angle) * texelSize) * 2.0 * PENUMBRA_FILTER_SIZE; + depth = unpackRGBAToDepth( texture2D( shadowMap, uv + offset)); + if (depth < compare) { + blockerDepthSum += depth; + blockers++; + } + j++; + } + #pragma unroll_loop_end + + if (blockers > 0.0) { + return blockerDepthSum / blockers; + } + return -1.0; +} + + +float vogelFilter(sampler2D shadowMap, vec2 uv, float zReceiver, float filterRadius, float angle) { + float texelSize = 1.0 / float(textureSize(shadowMap, 0).x); + float shadow = 0.0f; + int j = 0; + vec2 vogelSample = vec2(0.0); + vec2 offset = vec2(0.0); + #pragma unroll_loop_start + for (int i = 0; i < ${n}; i++) { + vogelSample = vogelDiskSample(j, ${n}, angle) * texelSize; + offset = vogelSample * (1.0 + filterRadius * float(${t})); + shadow += step( zReceiver, unpackRGBAToDepth( texture2D( shadowMap, uv + offset ) ) ); + j++; + } + #pragma unroll_loop_end + return shadow * 1.0 / ${n}.0; +} + +float PCSS (sampler2D shadowMap, vec4 coords) { + vec2 uv = coords.xy; + float zReceiver = coords.z; // Assumed to be eye-space z in this code + float angle = highPassRandRGB(gl_FragCoord.xy).r * PI2; + float avgBlockerDepth = findBlocker(shadowMap, uv, zReceiver, angle); + if (avgBlockerDepth == -1.0) { + return 1.0; + } + float penumbraRatio = penumbraSize(zReceiver, avgBlockerDepth); + return vogelFilter(shadowMap, uv, zReceiver, 1.25 * penumbraRatio, angle); +}`,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-CIQGHXr-.js`).then(wt(1)),__vite__mapDeps([0,1,2]));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}var aX=(e=>(e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e))(aX||{});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-BsGi6f5u.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-TdRV4SdH.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]));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-QqZ6rd6v.js`);return{getImportUrlBundles:e}},__vite__mapDeps([4,5,6]))).getImportUrlBundles();case`node`:return await(await Et(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-node-DT7wRTjn.js`);return{getImportUrlBundles:e}},__vite__mapDeps([7,6]))).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-BsGi6f5u.js`);return{getBundles:e}},[])).getBundles();case`node`:return await(await Et(async()=>{let{getBundles:e}=await import(`./default-node-TdRV4SdH.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]))).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])}(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:[[` +\f\r &/=>`.split(``),` +\f\r "&'/=>\``.split(``)],[`\0 +\f\r "&'/<=>`.split(``),`\0 +\f\r "&'/<=>\``.split(``)]],unquoted:[[` +\f\r &>`.split(``),`\0 +\f\r "&'<=>\``.split(``)],[`\0 +\f\r "&'<=>\``.split(``),`\0 +\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function element$1(node$1,index$1,parent,state){let schema=state.schema,omit=schema.space===`svg`?!1:state.settings.omitOptionalTags,selfClosing=schema.space===`svg`?state.settings.closeEmptyElements:state.settings.voids.includes(node$1.tagName.toLowerCase()),parts=[],last;schema.space===`html`&&node$1.tagName===`svg`&&(state.schema=svg);let attributes=serializeAttributes(state,node$1.properties),content$2=state.all(schema.space===`html`&&node$1.tagName===`template`?node$1.content:node$1);return state.schema=schema,content$2&&(selfClosing=!1),(attributes||!omit||!opening(node$1,index$1,parent))&&(parts.push(`<`,node$1.tagName,attributes?` `+attributes:``),selfClosing&&(schema.space===`svg`||state.settings.closeSelfClosing)&&(last=attributes.charAt(attributes.length-1),(!state.settings.tightSelfClosing||last===`/`||last&&last!==`"`&&last!==`'`)&&parts.push(` `),parts.push(`/`)),parts.push(`>`)),parts.push(content$2),!selfClosing&&(!omit||!closing(node$1,index$1,parent))&&parts.push(``),parts.join(``)}function serializeAttributes(state,properties){let values=[],index$1=-1,key$1;if(properties){for(key$1 in properties)if(properties[key$1]!==null&&properties[key$1]!==void 0){let value=serializeAttribute(state,key$1,properties[key$1]);value&&values.push(value)}}for(;++index$1ccount(value,state.alternative)&&(quote=state.alternative),result=quote+stringifyEntities(value,Object.assign({},state.settings.characterReferences,{subset:(quote===`'`?constants.single:constants.double)[x][y],attribute:!0}))+quote),name$1+(result&&`=`+result))}const textEntitySubset=[`<`,`&`];function text$3(node$1,_,parent,state){return parent&&parent.type===`element`&&(parent.tagName===`script`||parent.tagName===`style`)?node$1.value:stringifyEntities(node$1.value,Object.assign({},state.settings.characterReferences,{subset:textEntitySubset}))}function raw(node$1,index$1,parent,state){return state.settings.allowDangerousHtml?node$1.value:text$3(node$1,index$1,parent,state)}function root$1(node$1,_1,_2,state){return state.all(node$1)}const handle=zwitch(`type`,{invalid,unknown,handlers:{comment,doctype,element:element$1,raw,root:root$1,text:text$3}});function invalid(node$1){throw Error("Expected node, not `"+node$1+"`")}function unknown(node_){let node$1=node_;throw Error("Cannot compile unknown node `"+node$1.type+"`")}const emptyOptions$2={},emptyCharacterReferences={},emptyChildren=[];function toHtml(tree,options){let options_=options||emptyOptions$2,quote=options_.quote||`"`,alternative=quote===`"`?`'`:`"`;if(quote!==`"`&"e!==`'`)throw Error("Invalid quote `"+quote+"`, expected `'` or `\"`");let state={one:one$1,all:all$1,settings:{omitOptionalTags:options_.omitOptionalTags||!1,allowParseErrors:options_.allowParseErrors||!1,allowDangerousCharacters:options_.allowDangerousCharacters||!1,quoteSmart:options_.quoteSmart||!1,preferUnquoted:options_.preferUnquoted||!1,tightAttributes:options_.tightAttributes||!1,upperDoctype:options_.upperDoctype||!1,tightDoctype:options_.tightDoctype||!1,bogusComments:options_.bogusComments||!1,tightCommaSeparatedLists:options_.tightCommaSeparatedLists||!1,tightSelfClosing:options_.tightSelfClosing||!1,collapseEmptyAttributes:options_.collapseEmptyAttributes||!1,allowDangerousHtml:options_.allowDangerousHtml||!1,voids:options_.voids||htmlVoidElements,characterReferences:options_.characterReferences||emptyCharacterReferences,closeSelfClosing:options_.closeSelfClosing||!1,closeEmptyElements:options_.closeEmptyElements||!1},schema:options_.space===`svg`?svg:html$1,quote,alternative};return state.one(Array.isArray(tree)?{type:`root`,children:tree}:tree,void 0,void 0)}function one$1(node$1,index$1,parent){return handle(node$1,index$1,parent,this)}function all$1(parent){let results=[],children=parent&&parent.children||emptyChildren,index$1=-1;for(;++index$1end?0:end+start:start>end?end:start,remove=remove>0?remove:0,items.length<1e4)parameters=Array.from(items),parameters.unshift(start,remove),list$2.splice(...parameters);else for(remove&&list$2.splice(start,remove);chunkStart0?(splice(list$2,list$2.length,0,items),list$2):items}const hasOwnProperty={}.hasOwnProperty;function combineExtensions(extensions){let all$2={},index$1=-1;for(;++index$113&&code$1<32||code$1>126&&code$1<160||code$1>55295&&code$1<57344||code$1>64975&&code$1<65008||(code$1&65535)==65535||(code$1&65535)==65534||code$1>1114111?`�`:String.fromCodePoint(code$1)}function normalizeIdentifier(value){return value.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(code$1){return code$1!==null&&(code$1<32||code$1===127)}const asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(code$1){return code$1!==null&&code$1<-2}function markdownLineEndingOrSpace(code$1){return code$1!==null&&(code$1<0||code$1===32)}function markdownSpace(code$1){return code$1===-2||code$1===-1||code$1===32}const unicodePunctuation=regexCheck(/\p{P}|\p{S}/u),unicodeWhitespace=regexCheck(/\s/);function regexCheck(regex){return check;function check(code$1){return code$1!==null&&code$1>-1&®ex.test(String.fromCharCode(code$1))}}function normalizeUri(value){let result=[],index$1=-1,start=0,skip=0;for(;++index$155295&&code$1<57344){let next=value.charCodeAt(index$1+1);code$1<56320&&next>56319&&next<57344?(replace=String.fromCharCode(code$1,next),skip=1):replace=`�`}else replace=String.fromCharCode(code$1);replace&&(result.push(value.slice(start,index$1),encodeURIComponent(replace)),start=index$1+skip+1,replace=``),skip&&(index$1+=skip,skip=0)}return result.join(``)+value.slice(start)}function factorySpace(effects,ok$2,type,max){let limit=max?max-1:1/0,size=0;return start;function start(code$1){return markdownSpace(code$1)?(effects.enter(type),prefix(code$1)):ok$2(code$1)}function prefix(code$1){return markdownSpace(code$1)&&size++lineStartOffset))return;let indexBeforeExits=self$1.events.length,indexBeforeFlow=indexBeforeExits,seen,point$3;for(;indexBeforeFlow--;)if(self$1.events[indexBeforeFlow][0]===`exit`&&self$1.events[indexBeforeFlow][1].type===`chunkFlow`){if(seen){point$3=self$1.events[indexBeforeFlow][1].end;break}seen=!0}for(exitContainers(continued),index$1=indexBeforeExits;index$1size;){let entry=stack[index$1];self$1.containerState=entry[1],entry[0].exit.call(self$1,effects)}stack.length=size}function closeFlow(){childFlow.write([null]),childToken=void 0,childFlow=void 0,self$1.containerState._closeFlow=void 0}}function tokenizeContainer(effects,ok$2,nok){return factorySpace(effects,effects.attempt(this.parser.constructs.document,ok$2,nok),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function classifyCharacter(code$1){if(code$1===null||markdownLineEndingOrSpace(code$1)||unicodeWhitespace(code$1))return 1;if(unicodePunctuation(code$1))return 2}function resolveAll(constructs$1,events,context){let called=[],index$1=-1;for(;++index$11&&events[index$1][1].end.offset-events[index$1][1].start.offset>1?2:1;let start={...events[open][1].end},end={...events[index$1][1].start};movePoint(start,-use),movePoint(end,use),openingSequence={type:use>1?`strongSequence`:`emphasisSequence`,start,end:{...events[open][1].end}},closingSequence={type:use>1?`strongSequence`:`emphasisSequence`,start:{...events[index$1][1].start},end},text$4={type:use>1?`strongText`:`emphasisText`,start:{...events[open][1].end},end:{...events[index$1][1].start}},group={type:use>1?`strong`:`emphasis`,start:{...openingSequence.start},end:{...closingSequence.end}},events[open][1].end={...openingSequence.start},events[index$1][1].start={...closingSequence.end},nextEvents=[],events[open][1].end.offset-events[open][1].start.offset&&(nextEvents=push(nextEvents,[[`enter`,events[open][1],context],[`exit`,events[open][1],context]])),nextEvents=push(nextEvents,[[`enter`,group,context],[`enter`,openingSequence,context],[`exit`,openingSequence,context],[`enter`,text$4,context]]),nextEvents=push(nextEvents,resolveAll(context.parser.constructs.insideSpan.null,events.slice(open+1,index$1),context)),nextEvents=push(nextEvents,[[`exit`,text$4,context],[`enter`,closingSequence,context],[`exit`,closingSequence,context],[`exit`,group,context]]),events[index$1][1].end.offset-events[index$1][1].start.offset?(offset=2,nextEvents=push(nextEvents,[[`enter`,events[index$1][1],context],[`exit`,events[index$1][1],context]])):offset=0,splice(events,open-1,index$1-open+3,nextEvents),index$1=open+nextEvents.length-offset-2;break}}for(index$1=-1;++index$10&&markdownSpace(code$1)?factorySpace(effects,beforeContentChunk,`linePrefix`,initialPrefix+1)(code$1):beforeContentChunk(code$1)}function beforeContentChunk(code$1){return code$1===null||markdownLineEnding(code$1)?effects.check(nonLazyContinuation,atNonLazyBreak,after)(code$1):(effects.enter(`codeFlowValue`),contentChunk(code$1))}function contentChunk(code$1){return code$1===null||markdownLineEnding(code$1)?(effects.exit(`codeFlowValue`),beforeContentChunk(code$1)):(effects.consume(code$1),contentChunk)}function after(code$1){return effects.exit(`codeFenced`),ok$2(code$1)}function tokenizeCloseStart(effects$1,ok$3,nok$1){let size=0;return startBefore;function startBefore(code$1){return effects$1.enter(`lineEnding`),effects$1.consume(code$1),effects$1.exit(`lineEnding`),start$1}function start$1(code$1){return effects$1.enter(`codeFencedFence`),markdownSpace(code$1)?factorySpace(effects$1,beforeSequenceClose,`linePrefix`,self$1.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(code$1):beforeSequenceClose(code$1)}function beforeSequenceClose(code$1){return code$1===marker?(effects$1.enter(`codeFencedFenceSequence`),sequenceClose(code$1)):nok$1(code$1)}function sequenceClose(code$1){return code$1===marker?(size++,effects$1.consume(code$1),sequenceClose):size>=sizeOpen?(effects$1.exit(`codeFencedFenceSequence`),markdownSpace(code$1)?factorySpace(effects$1,sequenceCloseAfter,`whitespace`)(code$1):sequenceCloseAfter(code$1)):nok$1(code$1)}function sequenceCloseAfter(code$1){return code$1===null||markdownLineEnding(code$1)?(effects$1.exit(`codeFencedFence`),ok$3(code$1)):nok$1(code$1)}}}function tokenizeNonLazyContinuation(effects,ok$2,nok){let self$1=this;return start;function start(code$1){return code$1===null?nok(code$1):(effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),lineStart)}function lineStart(code$1){return self$1.parser.lazy[self$1.now().line]?nok(code$1):ok$2(code$1)}}const codeIndented={name:`codeIndented`,tokenize:tokenizeCodeIndented},furtherStart={partial:!0,tokenize:tokenizeFurtherStart};function tokenizeCodeIndented(effects,ok$2,nok){let self$1=this;return start;function start(code$1){return effects.enter(`codeIndented`),factorySpace(effects,afterPrefix,`linePrefix`,5)(code$1)}function afterPrefix(code$1){let tail=self$1.events[self$1.events.length-1];return tail&&tail[1].type===`linePrefix`&&tail[2].sliceSerialize(tail[1],!0).length>=4?atBreak(code$1):nok(code$1)}function atBreak(code$1){return code$1===null?after(code$1):markdownLineEnding(code$1)?effects.attempt(furtherStart,atBreak,after)(code$1):(effects.enter(`codeFlowValue`),inside(code$1))}function inside(code$1){return code$1===null||markdownLineEnding(code$1)?(effects.exit(`codeFlowValue`),atBreak(code$1)):(effects.consume(code$1),inside)}function after(code$1){return effects.exit(`codeIndented`),ok$2(code$1)}}function tokenizeFurtherStart(effects,ok$2,nok){let self$1=this;return furtherStart$1;function furtherStart$1(code$1){return self$1.parser.lazy[self$1.now().line]?nok(code$1):markdownLineEnding(code$1)?(effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),furtherStart$1):factorySpace(effects,afterPrefix,`linePrefix`,5)(code$1)}function afterPrefix(code$1){let tail=self$1.events[self$1.events.length-1];return tail&&tail[1].type===`linePrefix`&&tail[2].sliceSerialize(tail[1],!0).length>=4?ok$2(code$1):markdownLineEnding(code$1)?furtherStart$1(code$1):nok(code$1)}}const codeText={name:`codeText`,previous,resolve:resolveCodeText,tokenize:tokenizeCodeText};function resolveCodeText(events){let tailExitIndex=events.length-4,headEnterIndex=3,index$1,enter;if((events[headEnterIndex][1].type===`lineEnding`||events[headEnterIndex][1].type===`space`)&&(events[tailExitIndex][1].type===`lineEnding`||events[tailExitIndex][1].type===`space`)){for(index$1=headEnterIndex;++index$1=this.left.length+this.right.length)throw RangeError("Cannot access index `"+index$1+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return index$1this.left.length)return this.right.slice(this.right.length-stop+this.left.length,this.right.length-start+this.left.length).reverse();let list$2=this.left.slice(start);return list$2.push(...this.right.slice(this.right.length-stop+this.left.length).reverse()),list$2}splice(start,deleteCount,items){let count=deleteCount||0;this.setCursor(Math.trunc(start));let removed=this.right.splice(this.right.length-count,1/0);return items&&chunkedPush(this.left,items),removed.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(item){this.setCursor(1/0),this.left.push(item)}pushMany(items){this.setCursor(1/0),chunkedPush(this.left,items)}unshift(item){this.setCursor(0),this.right.push(item)}unshiftMany(items){this.setCursor(0),chunkedPush(this.right,items.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?ok$2(code$1):effects.interrupt(self$1.parser.constructs.flow,nok,ok$2)(code$1)}}function factoryDestination(effects,ok$2,nok,type,literalType,literalMarkerType,rawType,stringType,max){let limit=max||1/0,balance=0;return start;function start(code$1){return code$1===60?(effects.enter(type),effects.enter(literalType),effects.enter(literalMarkerType),effects.consume(code$1),effects.exit(literalMarkerType),enclosedBefore):code$1===null||code$1===32||code$1===41||asciiControl(code$1)?nok(code$1):(effects.enter(type),effects.enter(rawType),effects.enter(stringType),effects.enter(`chunkString`,{contentType:`string`}),raw$1(code$1))}function enclosedBefore(code$1){return code$1===62?(effects.enter(literalMarkerType),effects.consume(code$1),effects.exit(literalMarkerType),effects.exit(literalType),effects.exit(type),ok$2):(effects.enter(stringType),effects.enter(`chunkString`,{contentType:`string`}),enclosed(code$1))}function enclosed(code$1){return code$1===62?(effects.exit(`chunkString`),effects.exit(stringType),enclosedBefore(code$1)):code$1===null||code$1===60||markdownLineEnding(code$1)?nok(code$1):(effects.consume(code$1),code$1===92?enclosedEscape:enclosed)}function enclosedEscape(code$1){return code$1===60||code$1===62||code$1===92?(effects.consume(code$1),enclosed):enclosed(code$1)}function raw$1(code$1){return!balance&&(code$1===null||code$1===41||markdownLineEndingOrSpace(code$1))?(effects.exit(`chunkString`),effects.exit(stringType),effects.exit(rawType),effects.exit(type),ok$2(code$1)):balance999||code$1===null||code$1===91||code$1===93&&!seen||code$1===94&&!size&&`_hiddenFootnoteSupport`in self$1.parser.constructs?nok(code$1):code$1===93?(effects.exit(stringType),effects.enter(markerType),effects.consume(code$1),effects.exit(markerType),effects.exit(type),ok$2):markdownLineEnding(code$1)?(effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),atBreak):(effects.enter(`chunkString`,{contentType:`string`}),labelInside(code$1))}function labelInside(code$1){return code$1===null||code$1===91||code$1===93||markdownLineEnding(code$1)||size++>999?(effects.exit(`chunkString`),atBreak(code$1)):(effects.consume(code$1),seen||=!markdownSpace(code$1),code$1===92?labelEscape:labelInside)}function labelEscape(code$1){return code$1===91||code$1===92||code$1===93?(effects.consume(code$1),size++,labelInside):labelInside(code$1)}}function factoryTitle(effects,ok$2,nok,type,markerType,stringType){let marker;return start;function start(code$1){return code$1===34||code$1===39||code$1===40?(effects.enter(type),effects.enter(markerType),effects.consume(code$1),effects.exit(markerType),marker=code$1===40?41:code$1,begin):nok(code$1)}function begin(code$1){return code$1===marker?(effects.enter(markerType),effects.consume(code$1),effects.exit(markerType),effects.exit(type),ok$2):(effects.enter(stringType),atBreak(code$1))}function atBreak(code$1){return code$1===marker?(effects.exit(stringType),begin(marker)):code$1===null?nok(code$1):markdownLineEnding(code$1)?(effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),factorySpace(effects,atBreak,`linePrefix`)):(effects.enter(`chunkString`,{contentType:`string`}),inside(code$1))}function inside(code$1){return code$1===marker||code$1===null||markdownLineEnding(code$1)?(effects.exit(`chunkString`),atBreak(code$1)):(effects.consume(code$1),code$1===92?escape:inside)}function escape(code$1){return code$1===marker||code$1===92?(effects.consume(code$1),inside):inside(code$1)}}function factoryWhitespace(effects,ok$2){let seen;return start;function start(code$1){return markdownLineEnding(code$1)?(effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),seen=!0,start):markdownSpace(code$1)?factorySpace(effects,start,seen?`linePrefix`:`lineSuffix`)(code$1):ok$2(code$1)}}const definition={name:`definition`,tokenize:tokenizeDefinition},titleBefore={partial:!0,tokenize:tokenizeTitleBefore};function tokenizeDefinition(effects,ok$2,nok){let self$1=this,identifier;return start;function start(code$1){return effects.enter(`definition`),before(code$1)}function before(code$1){return factoryLabel.call(self$1,effects,labelAfter,nok,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(code$1)}function labelAfter(code$1){return identifier=normalizeIdentifier(self$1.sliceSerialize(self$1.events[self$1.events.length-1][1]).slice(1,-1)),code$1===58?(effects.enter(`definitionMarker`),effects.consume(code$1),effects.exit(`definitionMarker`),markerAfter):nok(code$1)}function markerAfter(code$1){return markdownLineEndingOrSpace(code$1)?factoryWhitespace(effects,destinationBefore)(code$1):destinationBefore(code$1)}function destinationBefore(code$1){return factoryDestination(effects,destinationAfter,nok,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(code$1)}function destinationAfter(code$1){return effects.attempt(titleBefore,after,after)(code$1)}function after(code$1){return markdownSpace(code$1)?factorySpace(effects,afterWhitespace,`whitespace`)(code$1):afterWhitespace(code$1)}function afterWhitespace(code$1){return code$1===null||markdownLineEnding(code$1)?(effects.exit(`definition`),self$1.parser.defined.push(identifier),ok$2(code$1)):nok(code$1)}}function tokenizeTitleBefore(effects,ok$2,nok){return titleBefore$1;function titleBefore$1(code$1){return markdownLineEndingOrSpace(code$1)?factoryWhitespace(effects,beforeMarker)(code$1):nok(code$1)}function beforeMarker(code$1){return factoryTitle(effects,titleAfter,nok,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(code$1)}function titleAfter(code$1){return markdownSpace(code$1)?factorySpace(effects,titleAfterOptionalWhitespace,`whitespace`)(code$1):titleAfterOptionalWhitespace(code$1)}function titleAfterOptionalWhitespace(code$1){return code$1===null||markdownLineEnding(code$1)?ok$2(code$1):nok(code$1)}}const hardBreakEscape={name:`hardBreakEscape`,tokenize:tokenizeHardBreakEscape};function tokenizeHardBreakEscape(effects,ok$2,nok){return start;function start(code$1){return effects.enter(`hardBreakEscape`),effects.consume(code$1),after}function after(code$1){return markdownLineEnding(code$1)?(effects.exit(`hardBreakEscape`),ok$2(code$1)):nok(code$1)}}const headingAtx={name:`headingAtx`,resolve:resolveHeadingAtx,tokenize:tokenizeHeadingAtx};function resolveHeadingAtx(events,context){let contentEnd=events.length-2,contentStart=3,content$2,text$4;return events[contentStart][1].type===`whitespace`&&(contentStart+=2),contentEnd-2>contentStart&&events[contentEnd][1].type===`whitespace`&&(contentEnd-=2),events[contentEnd][1].type===`atxHeadingSequence`&&(contentStart===contentEnd-1||contentEnd-4>contentStart&&events[contentEnd-2][1].type===`whitespace`)&&(contentEnd-=contentStart+1===contentEnd?2:4),contentEnd>contentStart&&(content$2={type:`atxHeadingText`,start:events[contentStart][1].start,end:events[contentEnd][1].end},text$4={type:`chunkText`,start:events[contentStart][1].start,end:events[contentEnd][1].end,contentType:`text`},splice(events,contentStart,contentEnd-contentStart+1,[[`enter`,content$2,context],[`enter`,text$4,context],[`exit`,text$4,context],[`exit`,content$2,context]])),events}function tokenizeHeadingAtx(effects,ok$2,nok){let size=0;return start;function start(code$1){return effects.enter(`atxHeading`),before(code$1)}function before(code$1){return effects.enter(`atxHeadingSequence`),sequenceOpen(code$1)}function sequenceOpen(code$1){return code$1===35&&size++<6?(effects.consume(code$1),sequenceOpen):code$1===null||markdownLineEndingOrSpace(code$1)?(effects.exit(`atxHeadingSequence`),atBreak(code$1)):nok(code$1)}function atBreak(code$1){return code$1===35?(effects.enter(`atxHeadingSequence`),sequenceFurther(code$1)):code$1===null||markdownLineEnding(code$1)?(effects.exit(`atxHeading`),ok$2(code$1)):markdownSpace(code$1)?factorySpace(effects,atBreak,`whitespace`)(code$1):(effects.enter(`atxHeadingText`),data(code$1))}function sequenceFurther(code$1){return code$1===35?(effects.consume(code$1),sequenceFurther):(effects.exit(`atxHeadingSequence`),atBreak(code$1))}function data(code$1){return code$1===null||code$1===35||markdownLineEndingOrSpace(code$1)?(effects.exit(`atxHeadingText`),atBreak(code$1)):(effects.consume(code$1),data)}}const htmlBlockNames=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),htmlRawNames=[`pre`,`script`,`style`,`textarea`],htmlFlow={concrete:!0,name:`htmlFlow`,resolveTo:resolveToHtmlFlow,tokenize:tokenizeHtmlFlow},blankLineBefore={partial:!0,tokenize:tokenizeBlankLineBefore},nonLazyContinuationStart={partial:!0,tokenize:tokenizeNonLazyContinuationStart};function resolveToHtmlFlow(events){let index$1=events.length;for(;index$1--&&!(events[index$1][0]===`enter`&&events[index$1][1].type===`htmlFlow`););return index$1>1&&events[index$1-2][1].type===`linePrefix`&&(events[index$1][1].start=events[index$1-2][1].start,events[index$1+1][1].start=events[index$1-2][1].start,events.splice(index$1-2,2)),events}function tokenizeHtmlFlow(effects,ok$2,nok){let self$1=this,marker,closingTag,buffer,index$1,markerB;return start;function start(code$1){return before(code$1)}function before(code$1){return effects.enter(`htmlFlow`),effects.enter(`htmlFlowData`),effects.consume(code$1),open}function open(code$1){return code$1===33?(effects.consume(code$1),declarationOpen):code$1===47?(effects.consume(code$1),closingTag=!0,tagCloseStart):code$1===63?(effects.consume(code$1),marker=3,self$1.interrupt?ok$2:continuationDeclarationInside):asciiAlpha(code$1)?(effects.consume(code$1),buffer=String.fromCharCode(code$1),tagName):nok(code$1)}function declarationOpen(code$1){return code$1===45?(effects.consume(code$1),marker=2,commentOpenInside):code$1===91?(effects.consume(code$1),marker=5,index$1=0,cdataOpenInside):asciiAlpha(code$1)?(effects.consume(code$1),marker=4,self$1.interrupt?ok$2:continuationDeclarationInside):nok(code$1)}function commentOpenInside(code$1){return code$1===45?(effects.consume(code$1),self$1.interrupt?ok$2:continuationDeclarationInside):nok(code$1)}function cdataOpenInside(code$1){let value=`CDATA[`;return code$1===value.charCodeAt(index$1++)?(effects.consume(code$1),index$1===value.length?self$1.interrupt?ok$2:continuation:cdataOpenInside):nok(code$1)}function tagCloseStart(code$1){return asciiAlpha(code$1)?(effects.consume(code$1),buffer=String.fromCharCode(code$1),tagName):nok(code$1)}function tagName(code$1){if(code$1===null||code$1===47||code$1===62||markdownLineEndingOrSpace(code$1)){let slash=code$1===47,name$1=buffer.toLowerCase();return!slash&&!closingTag&&htmlRawNames.includes(name$1)?(marker=1,self$1.interrupt?ok$2(code$1):continuation(code$1)):htmlBlockNames.includes(buffer.toLowerCase())?(marker=6,slash?(effects.consume(code$1),basicSelfClosing):self$1.interrupt?ok$2(code$1):continuation(code$1)):(marker=7,self$1.interrupt&&!self$1.parser.lazy[self$1.now().line]?nok(code$1):closingTag?completeClosingTagAfter(code$1):completeAttributeNameBefore(code$1))}return code$1===45||asciiAlphanumeric(code$1)?(effects.consume(code$1),buffer+=String.fromCharCode(code$1),tagName):nok(code$1)}function basicSelfClosing(code$1){return code$1===62?(effects.consume(code$1),self$1.interrupt?ok$2:continuation):nok(code$1)}function completeClosingTagAfter(code$1){return markdownSpace(code$1)?(effects.consume(code$1),completeClosingTagAfter):completeEnd(code$1)}function completeAttributeNameBefore(code$1){return code$1===47?(effects.consume(code$1),completeEnd):code$1===58||code$1===95||asciiAlpha(code$1)?(effects.consume(code$1),completeAttributeName):markdownSpace(code$1)?(effects.consume(code$1),completeAttributeNameBefore):completeEnd(code$1)}function completeAttributeName(code$1){return code$1===45||code$1===46||code$1===58||code$1===95||asciiAlphanumeric(code$1)?(effects.consume(code$1),completeAttributeName):completeAttributeNameAfter(code$1)}function completeAttributeNameAfter(code$1){return code$1===61?(effects.consume(code$1),completeAttributeValueBefore):markdownSpace(code$1)?(effects.consume(code$1),completeAttributeNameAfter):completeAttributeNameBefore(code$1)}function completeAttributeValueBefore(code$1){return code$1===null||code$1===60||code$1===61||code$1===62||code$1===96?nok(code$1):code$1===34||code$1===39?(effects.consume(code$1),markerB=code$1,completeAttributeValueQuoted):markdownSpace(code$1)?(effects.consume(code$1),completeAttributeValueBefore):completeAttributeValueUnquoted(code$1)}function completeAttributeValueQuoted(code$1){return code$1===markerB?(effects.consume(code$1),markerB=null,completeAttributeValueQuotedAfter):code$1===null||markdownLineEnding(code$1)?nok(code$1):(effects.consume(code$1),completeAttributeValueQuoted)}function completeAttributeValueUnquoted(code$1){return code$1===null||code$1===34||code$1===39||code$1===47||code$1===60||code$1===61||code$1===62||code$1===96||markdownLineEndingOrSpace(code$1)?completeAttributeNameAfter(code$1):(effects.consume(code$1),completeAttributeValueUnquoted)}function completeAttributeValueQuotedAfter(code$1){return code$1===47||code$1===62||markdownSpace(code$1)?completeAttributeNameBefore(code$1):nok(code$1)}function completeEnd(code$1){return code$1===62?(effects.consume(code$1),completeAfter):nok(code$1)}function completeAfter(code$1){return code$1===null||markdownLineEnding(code$1)?continuation(code$1):markdownSpace(code$1)?(effects.consume(code$1),completeAfter):nok(code$1)}function continuation(code$1){return code$1===45&&marker===2?(effects.consume(code$1),continuationCommentInside):code$1===60&&marker===1?(effects.consume(code$1),continuationRawTagOpen):code$1===62&&marker===4?(effects.consume(code$1),continuationClose):code$1===63&&marker===3?(effects.consume(code$1),continuationDeclarationInside):code$1===93&&marker===5?(effects.consume(code$1),continuationCdataInside):markdownLineEnding(code$1)&&(marker===6||marker===7)?(effects.exit(`htmlFlowData`),effects.check(blankLineBefore,continuationAfter,continuationStart)(code$1)):code$1===null||markdownLineEnding(code$1)?(effects.exit(`htmlFlowData`),continuationStart(code$1)):(effects.consume(code$1),continuation)}function continuationStart(code$1){return effects.check(nonLazyContinuationStart,continuationStartNonLazy,continuationAfter)(code$1)}function continuationStartNonLazy(code$1){return effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),continuationBefore}function continuationBefore(code$1){return code$1===null||markdownLineEnding(code$1)?continuationStart(code$1):(effects.enter(`htmlFlowData`),continuation(code$1))}function continuationCommentInside(code$1){return code$1===45?(effects.consume(code$1),continuationDeclarationInside):continuation(code$1)}function continuationRawTagOpen(code$1){return code$1===47?(effects.consume(code$1),buffer=``,continuationRawEndTag):continuation(code$1)}function continuationRawEndTag(code$1){if(code$1===62){let name$1=buffer.toLowerCase();return htmlRawNames.includes(name$1)?(effects.consume(code$1),continuationClose):continuation(code$1)}return asciiAlpha(code$1)&&buffer.length<8?(effects.consume(code$1),buffer+=String.fromCharCode(code$1),continuationRawEndTag):continuation(code$1)}function continuationCdataInside(code$1){return code$1===93?(effects.consume(code$1),continuationDeclarationInside):continuation(code$1)}function continuationDeclarationInside(code$1){return code$1===62?(effects.consume(code$1),continuationClose):code$1===45&&marker===2?(effects.consume(code$1),continuationDeclarationInside):continuation(code$1)}function continuationClose(code$1){return code$1===null||markdownLineEnding(code$1)?(effects.exit(`htmlFlowData`),continuationAfter(code$1)):(effects.consume(code$1),continuationClose)}function continuationAfter(code$1){return effects.exit(`htmlFlow`),ok$2(code$1)}}function tokenizeNonLazyContinuationStart(effects,ok$2,nok){let self$1=this;return start;function start(code$1){return markdownLineEnding(code$1)?(effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),after):nok(code$1)}function after(code$1){return self$1.parser.lazy[self$1.now().line]?nok(code$1):ok$2(code$1)}}function tokenizeBlankLineBefore(effects,ok$2,nok){return start;function start(code$1){return effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),effects.attempt(blankLine,ok$2,nok)}}const htmlText={name:`htmlText`,tokenize:tokenizeHtmlText};function tokenizeHtmlText(effects,ok$2,nok){let self$1=this,marker,index$1,returnState;return start;function start(code$1){return effects.enter(`htmlText`),effects.enter(`htmlTextData`),effects.consume(code$1),open}function open(code$1){return code$1===33?(effects.consume(code$1),declarationOpen):code$1===47?(effects.consume(code$1),tagCloseStart):code$1===63?(effects.consume(code$1),instruction):asciiAlpha(code$1)?(effects.consume(code$1),tagOpen):nok(code$1)}function declarationOpen(code$1){return code$1===45?(effects.consume(code$1),commentOpenInside):code$1===91?(effects.consume(code$1),index$1=0,cdataOpenInside):asciiAlpha(code$1)?(effects.consume(code$1),declaration):nok(code$1)}function commentOpenInside(code$1){return code$1===45?(effects.consume(code$1),commentEnd):nok(code$1)}function comment$1(code$1){return code$1===null?nok(code$1):code$1===45?(effects.consume(code$1),commentClose):markdownLineEnding(code$1)?(returnState=comment$1,lineEndingBefore(code$1)):(effects.consume(code$1),comment$1)}function commentClose(code$1){return code$1===45?(effects.consume(code$1),commentEnd):comment$1(code$1)}function commentEnd(code$1){return code$1===62?end(code$1):code$1===45?commentClose(code$1):comment$1(code$1)}function cdataOpenInside(code$1){let value=`CDATA[`;return code$1===value.charCodeAt(index$1++)?(effects.consume(code$1),index$1===value.length?cdata:cdataOpenInside):nok(code$1)}function cdata(code$1){return code$1===null?nok(code$1):code$1===93?(effects.consume(code$1),cdataClose):markdownLineEnding(code$1)?(returnState=cdata,lineEndingBefore(code$1)):(effects.consume(code$1),cdata)}function cdataClose(code$1){return code$1===93?(effects.consume(code$1),cdataEnd):cdata(code$1)}function cdataEnd(code$1){return code$1===62?end(code$1):code$1===93?(effects.consume(code$1),cdataEnd):cdata(code$1)}function declaration(code$1){return code$1===null||code$1===62?end(code$1):markdownLineEnding(code$1)?(returnState=declaration,lineEndingBefore(code$1)):(effects.consume(code$1),declaration)}function instruction(code$1){return code$1===null?nok(code$1):code$1===63?(effects.consume(code$1),instructionClose):markdownLineEnding(code$1)?(returnState=instruction,lineEndingBefore(code$1)):(effects.consume(code$1),instruction)}function instructionClose(code$1){return code$1===62?end(code$1):instruction(code$1)}function tagCloseStart(code$1){return asciiAlpha(code$1)?(effects.consume(code$1),tagClose):nok(code$1)}function tagClose(code$1){return code$1===45||asciiAlphanumeric(code$1)?(effects.consume(code$1),tagClose):tagCloseBetween(code$1)}function tagCloseBetween(code$1){return markdownLineEnding(code$1)?(returnState=tagCloseBetween,lineEndingBefore(code$1)):markdownSpace(code$1)?(effects.consume(code$1),tagCloseBetween):end(code$1)}function tagOpen(code$1){return code$1===45||asciiAlphanumeric(code$1)?(effects.consume(code$1),tagOpen):code$1===47||code$1===62||markdownLineEndingOrSpace(code$1)?tagOpenBetween(code$1):nok(code$1)}function tagOpenBetween(code$1){return code$1===47?(effects.consume(code$1),end):code$1===58||code$1===95||asciiAlpha(code$1)?(effects.consume(code$1),tagOpenAttributeName):markdownLineEnding(code$1)?(returnState=tagOpenBetween,lineEndingBefore(code$1)):markdownSpace(code$1)?(effects.consume(code$1),tagOpenBetween):end(code$1)}function tagOpenAttributeName(code$1){return code$1===45||code$1===46||code$1===58||code$1===95||asciiAlphanumeric(code$1)?(effects.consume(code$1),tagOpenAttributeName):tagOpenAttributeNameAfter(code$1)}function tagOpenAttributeNameAfter(code$1){return code$1===61?(effects.consume(code$1),tagOpenAttributeValueBefore):markdownLineEnding(code$1)?(returnState=tagOpenAttributeNameAfter,lineEndingBefore(code$1)):markdownSpace(code$1)?(effects.consume(code$1),tagOpenAttributeNameAfter):tagOpenBetween(code$1)}function tagOpenAttributeValueBefore(code$1){return code$1===null||code$1===60||code$1===61||code$1===62||code$1===96?nok(code$1):code$1===34||code$1===39?(effects.consume(code$1),marker=code$1,tagOpenAttributeValueQuoted):markdownLineEnding(code$1)?(returnState=tagOpenAttributeValueBefore,lineEndingBefore(code$1)):markdownSpace(code$1)?(effects.consume(code$1),tagOpenAttributeValueBefore):(effects.consume(code$1),tagOpenAttributeValueUnquoted)}function tagOpenAttributeValueQuoted(code$1){return code$1===marker?(effects.consume(code$1),marker=void 0,tagOpenAttributeValueQuotedAfter):code$1===null?nok(code$1):markdownLineEnding(code$1)?(returnState=tagOpenAttributeValueQuoted,lineEndingBefore(code$1)):(effects.consume(code$1),tagOpenAttributeValueQuoted)}function tagOpenAttributeValueUnquoted(code$1){return code$1===null||code$1===34||code$1===39||code$1===60||code$1===61||code$1===96?nok(code$1):code$1===47||code$1===62||markdownLineEndingOrSpace(code$1)?tagOpenBetween(code$1):(effects.consume(code$1),tagOpenAttributeValueUnquoted)}function tagOpenAttributeValueQuotedAfter(code$1){return code$1===47||code$1===62||markdownLineEndingOrSpace(code$1)?tagOpenBetween(code$1):nok(code$1)}function end(code$1){return code$1===62?(effects.consume(code$1),effects.exit(`htmlTextData`),effects.exit(`htmlText`),ok$2):nok(code$1)}function lineEndingBefore(code$1){return effects.exit(`htmlTextData`),effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),lineEndingAfter}function lineEndingAfter(code$1){return markdownSpace(code$1)?factorySpace(effects,lineEndingAfterPrefix,`linePrefix`,self$1.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(code$1):lineEndingAfterPrefix(code$1)}function lineEndingAfterPrefix(code$1){return effects.enter(`htmlTextData`),returnState(code$1)}}const labelEnd={name:`labelEnd`,resolveAll:resolveAllLabelEnd,resolveTo:resolveToLabelEnd,tokenize:tokenizeLabelEnd},resourceConstruct={tokenize:tokenizeResource},referenceFullConstruct={tokenize:tokenizeReferenceFull},referenceCollapsedConstruct={tokenize:tokenizeReferenceCollapsed};function resolveAllLabelEnd(events){let index$1=-1,newEvents=[];for(;++index$1=3&&(code$1===null||markdownLineEnding(code$1))?(effects.exit(`thematicBreak`),ok$2(code$1)):nok(code$1)}function sequence(code$1){return code$1===marker?(effects.consume(code$1),size++,sequence):(effects.exit(`thematicBreakSequence`),markdownSpace(code$1)?factorySpace(effects,atBreak,`whitespace`)(code$1):atBreak(code$1))}}const list$1={continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd,name:`list`,tokenize:tokenizeListStart},listItemPrefixWhitespaceConstruct={partial:!0,tokenize:tokenizeListItemPrefixWhitespace},indentConstruct={partial:!0,tokenize:tokenizeIndent};function tokenizeListStart(effects,ok$2,nok){let self$1=this,tail=self$1.events[self$1.events.length-1],initialSize=tail&&tail[1].type===`linePrefix`?tail[2].sliceSerialize(tail[1],!0).length:0,size=0;return start;function start(code$1){let kind=self$1.containerState.type||(code$1===42||code$1===43||code$1===45?`listUnordered`:`listOrdered`);if(kind===`listUnordered`?!self$1.containerState.marker||code$1===self$1.containerState.marker:asciiDigit(code$1)){if(self$1.containerState.type||(self$1.containerState.type=kind,effects.enter(kind,{_container:!0})),kind===`listUnordered`)return effects.enter(`listItemPrefix`),code$1===42||code$1===45?effects.check(thematicBreak$1,nok,atMarker)(code$1):atMarker(code$1);if(!self$1.interrupt||code$1===49)return effects.enter(`listItemPrefix`),effects.enter(`listItemValue`),inside(code$1)}return nok(code$1)}function inside(code$1){return asciiDigit(code$1)&&++size<10?(effects.consume(code$1),inside):(!self$1.interrupt||size<2)&&(self$1.containerState.marker?code$1===self$1.containerState.marker:code$1===41||code$1===46)?(effects.exit(`listItemValue`),atMarker(code$1)):nok(code$1)}function atMarker(code$1){return effects.enter(`listItemMarker`),effects.consume(code$1),effects.exit(`listItemMarker`),self$1.containerState.marker=self$1.containerState.marker||code$1,effects.check(blankLine,self$1.interrupt?nok:onBlank,effects.attempt(listItemPrefixWhitespaceConstruct,endOfPrefix,otherPrefix))}function onBlank(code$1){return self$1.containerState.initialBlankLine=!0,initialSize++,endOfPrefix(code$1)}function otherPrefix(code$1){return markdownSpace(code$1)?(effects.enter(`listItemPrefixWhitespace`),effects.consume(code$1),effects.exit(`listItemPrefixWhitespace`),endOfPrefix):nok(code$1)}function endOfPrefix(code$1){return self$1.containerState.size=initialSize+self$1.sliceSerialize(effects.exit(`listItemPrefix`),!0).length,ok$2(code$1)}}function tokenizeListContinuation(effects,ok$2,nok){let self$1=this;return self$1.containerState._closeFlow=void 0,effects.check(blankLine,onBlank,notBlank);function onBlank(code$1){return self$1.containerState.furtherBlankLines=self$1.containerState.furtherBlankLines||self$1.containerState.initialBlankLine,factorySpace(effects,ok$2,`listItemIndent`,self$1.containerState.size+1)(code$1)}function notBlank(code$1){return self$1.containerState.furtherBlankLines||!markdownSpace(code$1)?(self$1.containerState.furtherBlankLines=void 0,self$1.containerState.initialBlankLine=void 0,notInCurrentItem(code$1)):(self$1.containerState.furtherBlankLines=void 0,self$1.containerState.initialBlankLine=void 0,effects.attempt(indentConstruct,ok$2,notInCurrentItem)(code$1))}function notInCurrentItem(code$1){return self$1.containerState._closeFlow=!0,self$1.interrupt=void 0,factorySpace(effects,effects.attempt(list$1,ok$2,nok),`linePrefix`,self$1.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(code$1)}}function tokenizeIndent(effects,ok$2,nok){let self$1=this;return factorySpace(effects,afterPrefix,`listItemIndent`,self$1.containerState.size+1);function afterPrefix(code$1){let tail=self$1.events[self$1.events.length-1];return tail&&tail[1].type===`listItemIndent`&&tail[2].sliceSerialize(tail[1],!0).length===self$1.containerState.size?ok$2(code$1):nok(code$1)}}function tokenizeListEnd(effects){effects.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(effects,ok$2,nok){let self$1=this;return factorySpace(effects,afterPrefix,`listItemPrefixWhitespace`,self$1.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function afterPrefix(code$1){let tail=self$1.events[self$1.events.length-1];return!markdownSpace(code$1)&&tail&&tail[1].type===`listItemPrefixWhitespace`?ok$2(code$1):nok(code$1)}}const setextUnderline={name:`setextUnderline`,resolveTo:resolveToSetextUnderline,tokenize:tokenizeSetextUnderline};function resolveToSetextUnderline(events,context){let index$1=events.length,content$2,text$4,definition$1;for(;index$1--;)if(events[index$1][0]===`enter`){if(events[index$1][1].type===`content`){content$2=index$1;break}events[index$1][1].type===`paragraph`&&(text$4=index$1)}else events[index$1][1].type===`content`&&events.splice(index$1,1),!definition$1&&events[index$1][1].type===`definition`&&(definition$1=index$1);let heading$1={type:`setextHeading`,start:{...events[text$4][1].start},end:{...events[events.length-1][1].end}};return events[text$4][1].type=`setextHeadingText`,definition$1?(events.splice(text$4,0,[`enter`,heading$1,context]),events.splice(definition$1+1,0,[`exit`,events[content$2][1],context]),events[content$2][1].end={...events[definition$1][1].end}):events[content$2][1]=heading$1,events.push([`exit`,heading$1,context]),events}function tokenizeSetextUnderline(effects,ok$2,nok){let self$1=this,marker;return start;function start(code$1){let index$1=self$1.events.length,paragraph$1;for(;index$1--;)if(self$1.events[index$1][1].type!==`lineEnding`&&self$1.events[index$1][1].type!==`linePrefix`&&self$1.events[index$1][1].type!==`content`){paragraph$1=self$1.events[index$1][1].type===`paragraph`;break}return!self$1.parser.lazy[self$1.now().line]&&(self$1.interrupt||paragraph$1)?(effects.enter(`setextHeadingLine`),marker=code$1,before(code$1)):nok(code$1)}function before(code$1){return effects.enter(`setextHeadingLineSequence`),inside(code$1)}function inside(code$1){return code$1===marker?(effects.consume(code$1),inside):(effects.exit(`setextHeadingLineSequence`),markdownSpace(code$1)?factorySpace(effects,after,`lineSuffix`)(code$1):after(code$1))}function after(code$1){return code$1===null||markdownLineEnding(code$1)?(effects.exit(`setextHeadingLine`),ok$2(code$1)):nok(code$1)}}const flow={tokenize:initializeFlow};function initializeFlow(effects){let self$1=this,initial=effects.attempt(blankLine,atBlankEnding,effects.attempt(this.parser.constructs.flowInitial,afterConstruct,factorySpace(effects,effects.attempt(this.parser.constructs.flow,afterConstruct,effects.attempt(content$1,afterConstruct)),`linePrefix`)));return initial;function atBlankEnding(code$1){if(code$1===null){effects.consume(code$1);return}return effects.enter(`lineEndingBlank`),effects.consume(code$1),effects.exit(`lineEndingBlank`),self$1.currentConstruct=void 0,initial}function afterConstruct(code$1){if(code$1===null){effects.consume(code$1);return}return effects.enter(`lineEnding`),effects.consume(code$1),effects.exit(`lineEnding`),self$1.currentConstruct=void 0,initial}}const resolver={resolveAll:createResolver()},string=initializeFactory(`string`),text$1=initializeFactory(`text`);function initializeFactory(field){return{resolveAll:createResolver(field===`text`?resolveAllLineSuffixes:void 0),tokenize:initializeText};function initializeText(effects){let self$1=this,constructs$1=this.parser.constructs[field],text$4=effects.attempt(constructs$1,start,notText);return start;function start(code$1){return atBreak(code$1)?text$4(code$1):notText(code$1)}function notText(code$1){if(code$1===null){effects.consume(code$1);return}return effects.enter(`data`),effects.consume(code$1),data}function data(code$1){return atBreak(code$1)?(effects.exit(`data`),text$4(code$1)):(effects.consume(code$1),data)}function atBreak(code$1){if(code$1===null)return!0;let list$2=constructs$1[code$1],index$1=-1;if(list$2)for(;++index$1attentionMarkers,contentInitial:()=>contentInitial,disable:()=>disable,document:()=>document$2,flow:()=>flow$1,flowInitial:()=>flowInitial,insideSpan:()=>insideSpan,string:()=>string$1,text:()=>text$2});const document$2={42:list$1,43:list$1,45:list$1,48:list$1,49:list$1,50:list$1,51:list$1,52:list$1,53:list$1,54:list$1,55:list$1,56:list$1,57:list$1,62:blockQuote},contentInitial={91:definition},flowInitial={[-2]:codeIndented,[-1]:codeIndented,32:codeIndented},flow$1={35:headingAtx,42:thematicBreak$1,45:[setextUnderline,thematicBreak$1],60:htmlFlow,61:setextUnderline,95:thematicBreak$1,96:codeFenced,126:codeFenced},string$1={38:characterReference,92:characterEscape},text$2={[-5]:lineEnding,[-4]:lineEnding,[-3]:lineEnding,33:labelStartImage,38:characterReference,42:attention,60:[autolink,htmlText],91:labelStartLink,92:[hardBreakEscape,characterEscape],93:labelEnd,95:attention,96:codeText},insideSpan={null:[attention,resolver]},attentionMarkers={null:[42,95]},disable={null:[]};function createTokenizer(parser,initialize,from){let point$3={_bufferIndex:-1,_index:0,line:from&&from.line||1,column:from&&from.column||1,offset:from&&from.offset||0},columnStart={},resolveAllConstructs=[],chunks=[],stack=[],consumed=!0,effects={attempt:constructFactory(onsuccessfulconstruct),check:constructFactory(onsuccessfulcheck),consume,enter,exit:exit$1,interrupt:constructFactory(onsuccessfulcheck,{interrupt:!0})},context={code:null,containerState:{},defineSkip,events:[],now,parser,previous:null,sliceSerialize,sliceStream,write},state=initialize.tokenize.call(context,effects),expectedCode;return initialize.resolveAll&&resolveAllConstructs.push(initialize),context;function write(slice){return chunks=push(chunks,slice),main(),chunks[chunks.length-1]===null?(addResult(initialize,0),context.events=resolveAll(resolveAllConstructs,context.events,context),context.events):[]}function sliceSerialize(token,expandTabs){return serializeChunks(sliceStream(token),expandTabs)}function sliceStream(token){return sliceChunks(chunks,token)}function now(){let{_bufferIndex,_index,line,column,offset}=point$3;return{_bufferIndex,_index,line,column,offset}}function defineSkip(value){columnStart[value.line]=value.column,accountForPotentialSkip()}function main(){let chunkIndex;for(;point$3._index-1){let head$1=view[0];typeof head$1==`string`?view[0]=head$1.slice(startBufferIndex):view.shift()}endBufferIndex>0&&view.push(chunks[endIndex].slice(0,endBufferIndex))}return view}function serializeChunks(chunks,expandTabs){let index$1=-1,result=[],atTab;for(;++index$10){let tail=context.tokenStack[context.tokenStack.length-1],handler=tail[1]||defaultOnError;handler.call(context,void 0,tail[0])}for(tree.position={start:point$1(events.length>0?events[0][1].start:{line:1,column:1,offset:0}),end:point$1(events.length>0?events[events.length-2][1].end:{line:1,column:1,offset:0})},index$1=-1;++index$11?`-`+reuseCounter:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(counter)}]};state.patch(node$1,link$1);let sup={type:`element`,tagName:`sup`,properties:{},children:[link$1]};return state.patch(node$1,sup),state.applyData(node$1,sup)}function heading(state,node$1){let result={type:`element`,tagName:`h`+node$1.depth,properties:{},children:state.all(node$1)};return state.patch(node$1,result),state.applyData(node$1,result)}function html(state,node$1){if(state.options.allowDangerousHtml){let result={type:`raw`,value:node$1.value};return state.patch(node$1,result),state.applyData(node$1,result)}}function revert(state,node$1){let subtype=node$1.referenceType,suffix=`]`;if(subtype===`collapsed`?suffix+=`[]`:subtype===`full`&&(suffix+=`[`+(node$1.label||node$1.identifier)+`]`),node$1.type===`imageReference`)return[{type:`text`,value:`![`+node$1.alt+suffix}];let contents=state.all(node$1),head$1=contents[0];head$1&&head$1.type===`text`?head$1.value=`[`+head$1.value:contents.unshift({type:`text`,value:`[`});let tail=contents[contents.length-1];return tail&&tail.type===`text`?tail.value+=suffix:contents.push({type:`text`,value:suffix}),contents}function imageReference(state,node$1){let id=String(node$1.identifier).toUpperCase(),definition$1=state.definitionById.get(id);if(!definition$1)return revert(state,node$1);let properties={src:normalizeUri(definition$1.url||``),alt:node$1.alt};definition$1.title!==null&&definition$1.title!==void 0&&(properties.title=definition$1.title);let result={type:`element`,tagName:`img`,properties,children:[]};return state.patch(node$1,result),state.applyData(node$1,result)}function image(state,node$1){let properties={src:normalizeUri(node$1.url)};node$1.alt!==null&&node$1.alt!==void 0&&(properties.alt=node$1.alt),node$1.title!==null&&node$1.title!==void 0&&(properties.title=node$1.title);let result={type:`element`,tagName:`img`,properties,children:[]};return state.patch(node$1,result),state.applyData(node$1,result)}function inlineCode(state,node$1){let text$4={type:`text`,value:node$1.value.replace(/\r?\n|\r/g,` `)};state.patch(node$1,text$4);let result={type:`element`,tagName:`code`,properties:{},children:[text$4]};return state.patch(node$1,result),state.applyData(node$1,result)}function linkReference(state,node$1){let id=String(node$1.identifier).toUpperCase(),definition$1=state.definitionById.get(id);if(!definition$1)return revert(state,node$1);let properties={href:normalizeUri(definition$1.url||``)};definition$1.title!==null&&definition$1.title!==void 0&&(properties.title=definition$1.title);let result={type:`element`,tagName:`a`,properties,children:state.all(node$1)};return state.patch(node$1,result),state.applyData(node$1,result)}function link(state,node$1){let properties={href:normalizeUri(node$1.url)};node$1.title!==null&&node$1.title!==void 0&&(properties.title=node$1.title);let result={type:`element`,tagName:`a`,properties,children:state.all(node$1)};return state.patch(node$1,result),state.applyData(node$1,result)}function listItem(state,node$1,parent){let results=state.all(node$1),loose=parent?listLoose(parent):listItemLoose(node$1),properties={},children=[];if(typeof node$1.checked==`boolean`){let head$1=results[0],paragraph$1;head$1&&head$1.type===`element`&&head$1.tagName===`p`?paragraph$1=head$1:(paragraph$1={type:`element`,tagName:`p`,properties:{},children:[]},results.unshift(paragraph$1)),paragraph$1.children.length>0&¶graph$1.children.unshift({type:`text`,value:` `}),paragraph$1.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:node$1.checked,disabled:!0},children:[]}),properties.className=[`task-list-item`]}let index$1=-1;for(;++index$11}function list(state,node$1){let properties={},results=state.all(node$1),index$1=-1;for(typeof node$1.start==`number`&&node$1.start!==1&&(properties.start=node$1.start);++index$10&&typeof point$4.column==`number`&&point$4.column>0)return{line:point$4.line,column:point$4.column,offset:typeof point$4.offset==`number`&&point$4.offset>-1?point$4.offset:void 0}}}function position(node$1){let start=pointStart(node$1),end=pointEnd(node$1);if(start&&end)return{start,end}}function table(state,node$1){let rows=state.all(node$1),firstRow=rows.shift(),tableContent=[];if(firstRow){let head$1={type:`element`,tagName:`thead`,properties:{},children:state.wrap([firstRow],!0)};state.patch(node$1.children[0],head$1),tableContent.push(head$1)}if(rows.length>0){let body$2={type:`element`,tagName:`tbody`,properties:{},children:state.wrap(rows,!0)},start=pointStart(node$1.children[1]),end=pointEnd(node$1.children[node$1.children.length-1]);start&&end&&(body$2.position={start,end}),tableContent.push(body$2)}let result={type:`element`,tagName:`table`,properties:{},children:state.wrap(tableContent,!0)};return state.patch(node$1,result),state.applyData(node$1,result)}function tableRow(state,node$1,parent){let siblings$1=parent?parent.children:void 0,rowIndex=siblings$1?siblings$1.indexOf(node$1):1,tagName=rowIndex===0?`th`:`td`,align=parent&&parent.type===`table`?parent.align:void 0,length=align?align.length:node$1.children.length,cellIndex=-1,cells$1=[];for(;++cellIndex0,!0),match[0]),last=match.index+match[0].length,match=search$1.exec(source);return lines.push(trimLine(source.slice(last),last>0,!1)),lines.join(``)}function trimLine(value,start,end){let startIndex=0,endIndex=value.length;if(start){let code$1=value.codePointAt(startIndex);for(;code$1===tab||code$1===space;)startIndex++,code$1=value.codePointAt(startIndex)}if(end){let code$1=value.codePointAt(endIndex-1);for(;code$1===tab||code$1===space;)endIndex--,code$1=value.codePointAt(endIndex-1)}return endIndex>startIndex?value.slice(startIndex,endIndex):``}function text(state,node$1){let result={type:`text`,value:trimLines(String(node$1.value))};return state.patch(node$1,result),state.applyData(node$1,result)}function thematicBreak(state,node$1){let result={type:`element`,tagName:`hr`,properties:{},children:[]};return state.patch(node$1,result),state.applyData(node$1,result)}const handlers={blockquote,break:hardBreak,code,delete:strikethrough,emphasis,footnoteReference,heading,html,imageReference,image,inlineCode,linkReference,link,listItem,list,paragraph,root,strong,table,tableCell,tableRow,text,thematicBreak,toml:ignore,yaml:ignore,definition:ignore,footnoteDefinition:ignore};function ignore(){}function ok(){}const VOID=-1,PRIMITIVE=0,ARRAY=1,OBJECT=2,DATE=3,REGEXP=4,MAP=5,SET=6,ERROR=7,BIGINT=8,env$1=typeof self==`object`?self:globalThis,deserializer=($,_)=>{let as=(out,index$1)=>($.set(index$1,out),out),unpair=index$1=>{if($.has(index$1))return $.get(index$1);let[type,value]=_[index$1];switch(type){case PRIMITIVE:case VOID:return as(value,index$1);case ARRAY:{let arr=as([],index$1);for(let index$2 of value)arr.push(unpair(index$2));return arr}case OBJECT:{let object=as({},index$1);for(let[key$1,index$2]of value)object[unpair(key$1)]=unpair(index$2);return object}case DATE:return as(new Date(value),index$1);case REGEXP:{let{source,flags}=value;return as(new RegExp(source,flags),index$1)}case MAP:{let map=as(new Map,index$1);for(let[key$1,index$2]of value)map.set(unpair(key$1),unpair(index$2));return map}case SET:{let set=as(new Set,index$1);for(let index$2 of value)set.add(unpair(index$2));return set}case ERROR:{let{name:name$1,message}=value;return as(new env$1[name$1](message),index$1)}case BIGINT:return as(BigInt(value),index$1);case`BigInt`:return as(Object(BigInt(value)),index$1)}return as(new env$1[type](value),index$1)};return unpair},deserialize=serialized=>deserializer(new Map,serialized)(0),EMPTY=``,{toString}={},{keys}=Object,typeOf=value=>{let type=typeof value;if(type!==`object`||!value)return[PRIMITIVE,type];let asString=toString.call(value).slice(8,-1);switch(asString){case`Array`:return[ARRAY,EMPTY];case`Object`:return[OBJECT,EMPTY];case`Date`:return[DATE,EMPTY];case`RegExp`:return[REGEXP,EMPTY];case`Map`:return[MAP,EMPTY];case`Set`:return[SET,EMPTY]}return asString.includes(`Array`)?[ARRAY,asString]:asString.includes(`Error`)?[ERROR,asString]:[OBJECT,asString]},shouldSkip=([TYPE,type])=>TYPE===PRIMITIVE&&(type===`function`||type===`symbol`),serializer=(strict,json,$,_)=>{let as=(out,value)=>{let index$1=_.push(out)-1;return $.set(value,index$1),index$1},pair=value=>{if($.has(value))return $.get(value);let[TYPE,type]=typeOf(value);switch(TYPE){case PRIMITIVE:{let entry=value;switch(type){case`bigint`:TYPE=BIGINT,entry=value.toString();break;case`function`:case`symbol`:if(strict)throw TypeError(`unable to serialize `+type);entry=null;break;case`undefined`:return as([VOID],value)}return as([TYPE,entry],value)}case ARRAY:{if(type)return as([type,[...value]],value);let arr=[],index$1=as([TYPE,arr],value);for(let entry of value)arr.push(pair(entry));return index$1}case OBJECT:{if(type)switch(type){case`BigInt`:return as([type,value.toString()],value);case`Boolean`:case`Number`:case`String`:return as([type,value.valueOf()],value)}if(json&&`toJSON`in value)return pair(value.toJSON());let entries=[],index$1=as([TYPE,entries],value);for(let key$1 of keys(value))(strict||!shouldSkip(typeOf(value[key$1])))&&entries.push([pair(key$1),pair(value[key$1])]);return index$1}case DATE:return as([TYPE,value.toISOString()],value);case REGEXP:{let{source,flags}=value;return as([TYPE,{source,flags}],value)}case MAP:{let entries=[],index$1=as([TYPE,entries],value);for(let[key$1,entry]of value)(strict||!(shouldSkip(typeOf(key$1))||shouldSkip(typeOf(entry))))&&entries.push([pair(key$1),pair(entry)]);return index$1}case SET:{let entries=[],index$1=as([TYPE,entries],value);for(let entry of value)(strict||!shouldSkip(typeOf(entry)))&&entries.push(pair(entry));return index$1}}let{message}=value;return as([TYPE,{name:type,message}],value)};return pair},serialize=(value,{json,lossy}={})=>{let _=[];return serializer(!(json||lossy),!!json,new Map,_)(value),_};var esm_default=typeof structuredClone==`function`?(any,options)=>options&&(`json`in options||`lossy`in options)?deserialize(serialize(any,options)):structuredClone(any):(any,options)=>deserialize(serialize(any,options));function defaultFootnoteBackContent(_,rereferenceIndex){let result=[{type:`text`,value:`↩`}];return rereferenceIndex>1&&result.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(rereferenceIndex)}]}),result}function defaultFootnoteBackLabel(referenceIndex,rereferenceIndex){return`Back to reference `+(referenceIndex+1)+(rereferenceIndex>1?`-`+rereferenceIndex:``)}function footer(state){let clobberPrefix=typeof state.options.clobberPrefix==`string`?state.options.clobberPrefix:`user-content-`,footnoteBackContent=state.options.footnoteBackContent||defaultFootnoteBackContent,footnoteBackLabel=state.options.footnoteBackLabel||defaultFootnoteBackLabel,footnoteLabel=state.options.footnoteLabel||`Footnotes`,footnoteLabelTagName=state.options.footnoteLabelTagName||`h2`,footnoteLabelProperties=state.options.footnoteLabelProperties||{className:[`sr-only`]},listItems=[],referenceIndex=-1;for(;++referenceIndex0&&backReferences.push({type:`text`,value:` `});let children=typeof footnoteBackContent==`string`?footnoteBackContent:footnoteBackContent(referenceIndex,rereferenceIndex);typeof children==`string`&&(children={type:`text`,value:children}),backReferences.push({type:`element`,tagName:`a`,properties:{href:`#`+clobberPrefix+`fnref-`+safeId+(rereferenceIndex>1?`-`+rereferenceIndex:``),dataFootnoteBackref:``,ariaLabel:typeof footnoteBackLabel==`string`?footnoteBackLabel:footnoteBackLabel(referenceIndex,rereferenceIndex),className:[`data-footnote-backref`]},children:Array.isArray(children)?children:[children]})}let tail=content$2[content$2.length-1];if(tail&&tail.type===`element`&&tail.tagName===`p`){let tailTail=tail.children[tail.children.length-1];tailTail&&tailTail.type===`text`?tailTail.value+=` `:tail.children.push({type:`text`,value:` `}),tail.children.push(...backReferences)}else content$2.push(...backReferences);let listItem$1={type:`element`,tagName:`li`,properties:{id:clobberPrefix+`fn-`+safeId},children:state.wrap(content$2,!0)};state.patch(definition$1,listItem$1),listItems.push(listItem$1)}if(listItems.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:footnoteLabelTagName,properties:{...esm_default(footnoteLabelProperties),id:`footnote-label`},children:[{type:`text`,value:footnoteLabel}]},{type:`text`,value:` +`},{type:`element`,tagName:`ol`,properties:{},children:state.wrap(listItems,!0)},{type:`text`,value:` +`}]}}const convert=function(test){if(test==null)return ok$1;if(typeof test==`function`)return castFactory(test);if(typeof test==`object`)return Array.isArray(test)?anyFactory(test):propsFactory(test);if(typeof test==`string`)return typeFactory(test);throw Error(`Expected function, string, or object as test`)};function anyFactory(tests){let checks$1=[],index$1=-1;for(;++index$1`:``))+`)`})}return visit$1;function visit$1(){let result=empty,subresult,offset,grandparents;if((!test||is(node$1,index$1,parents[parents.length-1]||void 0))&&(result=toResult(visitor(node$1,parents)),result[0]===EXIT))return result;if(`children`in node$1&&node$1.children){let nodeAsParent=node$1;if(nodeAsParent.children&&result[0]!==SKIP)for(offset=(reverse?nodeAsParent.children.length:-1)+step,grandparents=parents.concat(nodeAsParent);offset>-1&&offset0&&result.push({type:`text`,value:` +`}),result}function trimMarkdownSpaceStart(value){let index$1=0,code$1=value.charCodeAt(index$1);for(;code$1===9||code$1===32;)index$1++,code$1=value.charCodeAt(index$1);return value.slice(index$1)}function toHast(tree,options){let state=createState(tree,options),node$1=state.one(tree,void 0),foot=footer(state),result=Array.isArray(node$1)?{type:`root`,children:node$1}:node$1||{type:`root`,children:[]};return foot&&(ok(`children`in result),result.children.push({type:`text`,value:` +`},foot)),result}function remarkRehype(destination,options){return destination&&`run`in destination?async function(tree,file){let hastTree=toHast(tree,{file,...options});await destination.run(hastTree,file)}:function(tree,file){return toHast(tree,{file,...destination||options})}}function bail(error){if(error)throw error}var require_extend=__commonJSMin((exports,module)=>{var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray=function(arr){return typeof Array.isArray==`function`?Array.isArray(arr):toStr.call(arr)===`[object Array]`},isPlainObject$1=function(obj){if(!obj||toStr.call(obj)!==`[object Object]`)return!1;var hasOwnConstructor=hasOwn.call(obj,`constructor`),hasIsPrototypeOf=obj.constructor&&obj.constructor.prototype&&hasOwn.call(obj.constructor.prototype,`isPrototypeOf`);if(obj.constructor&&!hasOwnConstructor&&!hasIsPrototypeOf)return!1;for(var key$1 in obj);return key$1===void 0||hasOwn.call(obj,key$1)},setProperty=function(target,options){defineProperty&&options.name===`__proto__`?defineProperty(target,options.name,{enumerable:!0,configurable:!0,value:options.newValue,writable:!0}):target[options.name]=options.newValue},getProperty=function(obj,name$1){if(name$1===`__proto__`)if(hasOwn.call(obj,name$1)){if(gOPD)return gOPD(obj,name$1).value}else return;return obj[name$1]};module.exports=function extend$1(){var options,name$1,src,copy,copyIsArray,clone,target=arguments[0],i=1,length=arguments.length,deep=!1;for(typeof target==`boolean`&&(deep=target,target=arguments[1]||{},i=2),(target==null||typeof target!=`object`&&typeof target!=`function`)&&(target={});iparameters.length,result;fnExpectsCallback&¶meters.push(done);try{result=middleware.apply(this,parameters)}catch(error){let exception=error;if(fnExpectsCallback&&called)throw exception;return done(exception)}fnExpectsCallback||(result&&result.then&&typeof result.then==`function`?result.then(then,done):result instanceof Error?done(result):then(result))}function done(error,...output){called||(called=!0,callback(error,...output))}function then(value){done(null,value)}}var VFileMessage=class extends Error{constructor(causeOrReason,optionsOrParentOrPlace,origin){super(),typeof optionsOrParentOrPlace==`string`&&(origin=optionsOrParentOrPlace,optionsOrParentOrPlace=void 0);let reason=``,options={},legacyCause=!1;if(optionsOrParentOrPlace&&(options=`line`in optionsOrParentOrPlace&&`column`in optionsOrParentOrPlace||`start`in optionsOrParentOrPlace&&`end`in optionsOrParentOrPlace?{place:optionsOrParentOrPlace}:`type`in optionsOrParentOrPlace?{ancestors:[optionsOrParentOrPlace],place:optionsOrParentOrPlace.position}:{...optionsOrParentOrPlace}),typeof causeOrReason==`string`?reason=causeOrReason:!options.cause&&causeOrReason&&(legacyCause=!0,reason=causeOrReason.message,options.cause=causeOrReason),!options.ruleId&&!options.source&&typeof origin==`string`){let index$1=origin.indexOf(`:`);index$1===-1?options.ruleId=origin:(options.source=origin.slice(0,index$1),options.ruleId=origin.slice(index$1+1))}if(!options.place&&options.ancestors&&options.ancestors){let parent=options.ancestors[options.ancestors.length-1];parent&&(options.place=parent.position)}let start=options.place&&`start`in options.place?options.place.start:options.place;this.ancestors=options.ancestors||void 0,this.cause=options.cause||void 0,this.column=start?start.column:void 0,this.fatal=void 0,this.file,this.message=reason,this.line=start?start.line:void 0,this.name=stringifyPosition(options.place)||`1:1`,this.place=options.place||void 0,this.reason=this.message,this.ruleId=options.ruleId||void 0,this.source=options.source||void 0,this.stack=legacyCause&&options.cause&&typeof options.cause.stack==`string`?options.cause.stack:``,this.actual,this.expected,this.note,this.url}};VFileMessage.prototype.file=``,VFileMessage.prototype.name=``,VFileMessage.prototype.reason=``,VFileMessage.prototype.message=``,VFileMessage.prototype.stack=``,VFileMessage.prototype.column=void 0,VFileMessage.prototype.line=void 0,VFileMessage.prototype.ancestors=void 0,VFileMessage.prototype.cause=void 0,VFileMessage.prototype.fatal=void 0,VFileMessage.prototype.place=void 0,VFileMessage.prototype.ruleId=void 0,VFileMessage.prototype.source=void 0;const minpath={basename,dirname,extname,join,sep:`/`};function basename(path,extname$1){if(extname$1!==void 0&&typeof extname$1!=`string`)throw TypeError(`"ext" argument must be a string`);assertPath$1(path);let start=0,end=-1,index$1=path.length,seenNonSlash;if(extname$1===void 0||extname$1.length===0||extname$1.length>path.length){for(;index$1--;)if(path.codePointAt(index$1)===47){if(seenNonSlash){start=index$1+1;break}}else end<0&&(seenNonSlash=!0,end=index$1+1);return end<0?``:path.slice(start,end)}if(extname$1===path)return``;let firstNonSlashEnd=-1,extnameIndex=extname$1.length-1;for(;index$1--;)if(path.codePointAt(index$1)===47){if(seenNonSlash){start=index$1+1;break}}else firstNonSlashEnd<0&&(seenNonSlash=!0,firstNonSlashEnd=index$1+1),extnameIndex>-1&&(path.codePointAt(index$1)===extname$1.codePointAt(extnameIndex--)?extnameIndex<0&&(end=index$1):(extnameIndex=-1,end=firstNonSlashEnd));return start===end?end=firstNonSlashEnd:end<0&&(end=path.length),path.slice(start,end)}function dirname(path){if(assertPath$1(path),path.length===0)return`.`;let end=-1,index$1=path.length,unmatchedSlash;for(;--index$1;)if(path.codePointAt(index$1)===47){if(unmatchedSlash){end=index$1;break}}else unmatchedSlash||=!0;return end<0?path.codePointAt(0)===47?`/`:`.`:end===1&&path.codePointAt(0)===47?`//`:path.slice(0,end)}function extname(path){assertPath$1(path);let index$1=path.length,end=-1,startPart=0,startDot=-1,preDotState=0,unmatchedSlash;for(;index$1--;){let code$1=path.codePointAt(index$1);if(code$1===47){if(unmatchedSlash){startPart=index$1+1;break}continue}end<0&&(unmatchedSlash=!0,end=index$1+1),code$1===46?startDot<0?startDot=index$1:preDotState!==1&&(preDotState=1):startDot>-1&&(preDotState=-1)}return startDot<0||end<0||preDotState===0||preDotState===1&&startDot===end-1&&startDot===startPart+1?``:path.slice(startDot,end)}function join(...segments){let index$1=-1,joined;for(;++index$10&&path.codePointAt(path.length-1)===47&&(value+=`/`),absolute?`/`+value:value}function normalizeString(path,allowAboveRoot){let result=``,lastSegmentLength=0,lastSlash=-1,dots=0,index$1=-1,code$1,lastSlashIndex;for(;++index$1<=path.length;){if(index$12){if(lastSlashIndex=result.lastIndexOf(`/`),lastSlashIndex!==result.length-1){lastSlashIndex<0?(result=``,lastSegmentLength=0):(result=result.slice(0,lastSlashIndex),lastSegmentLength=result.length-1-result.lastIndexOf(`/`)),lastSlash=index$1,dots=0;continue}}else if(result.length>0){result=``,lastSegmentLength=0,lastSlash=index$1,dots=0;continue}}allowAboveRoot&&(result=result.length>0?result+`/..`:`..`,lastSegmentLength=2)}else result.length>0?result+=`/`+path.slice(lastSlash+1,index$1):result=path.slice(lastSlash+1,index$1),lastSegmentLength=index$1-lastSlash-1;lastSlash=index$1,dots=0}else code$1===46&&dots>-1?dots++:dots=-1}return result}function assertPath$1(path){if(typeof path!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(path))}const minproc={cwd};function cwd(){return`/`}function isUrl(fileUrlOrPath){return!!(typeof fileUrlOrPath==`object`&&fileUrlOrPath&&`href`in fileUrlOrPath&&fileUrlOrPath.href&&`protocol`in fileUrlOrPath&&fileUrlOrPath.protocol&&fileUrlOrPath.auth===void 0)}function urlToPath(path){if(typeof path==`string`)path=new URL(path);else if(!isUrl(path)){let error=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+path+"`");throw error.code=`ERR_INVALID_ARG_TYPE`,error}if(path.protocol!==`file:`){let error=TypeError(`The URL must be of scheme file`);throw error.code=`ERR_INVALID_URL_SCHEME`,error}return getPathFromURLPosix(path)}function getPathFromURLPosix(url){if(url.hostname!==``){let error=TypeError(`File URL host must be "localhost" or empty on darwin`);throw error.code=`ERR_INVALID_FILE_URL_HOST`,error}let pathname=url.pathname,index$1=-1;for(;++index$10){let[primary,...rest]=parameters$1,currentPrimary=attachers[entryIndex][1];isPlainObject(currentPrimary)&&isPlainObject(primary)&&(primary=(0,import_extend.default)(!0,currentPrimary,primary)),attachers[entryIndex]=[plugin,primary,...rest]}}}};const unified=new Processor().freeze();function assertParser(name$1,value){if(typeof value!=`function`)throw TypeError("Cannot `"+name$1+"` without `parser`")}function assertCompiler(name$1,value){if(typeof value!=`function`)throw TypeError("Cannot `"+name$1+"` without `compiler`")}function assertUnfrozen(name$1,frozen){if(frozen)throw Error("Cannot call `"+name$1+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function assertNode(node$1){if(!isPlainObject(node$1)||typeof node$1.type!=`string`)throw TypeError("Expected node, got `"+node$1+"`")}function assertDone(name$1,asyncName,complete){if(!complete)throw Error("`"+name$1+"` finished async. Use `"+asyncName+"` instead")}function vfile(value){return looksLikeAVFile(value)?value:new VFile(value)}function looksLikeAVFile(value){return!!(value&&typeof value==`object`&&`message`in value&&`messages`in value)}function looksLikeAValue(value){return typeof value==`string`||isUint8Array(value)}function isUint8Array(value){return!!(value&&typeof value==`object`&&`byteLength`in value&&`byteOffset`in value)}function useMarkdown(){let instance=unified().use(remarkParse).use(remarkRehype).use(rehypeStringify);return{process:markdown=>instance.processSync(markdown).toString()}}var require_asset_path=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.baseAssetPath=void 0;let isWeb=typeof window<`u`&&window.document!==void 0,currentScript=isWeb?window.document.currentScript:null,basePath=`/`;currentScript&&(basePath=currentScript.src.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)),exports.baseAssetPath=basePath}),require_default_model_fetcher=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.defaultModelFetcher=void 0;let defaultModelFetcher=path=>fetch(path).then(model=>model.arrayBuffer());exports.defaultModelFetcher=defaultModelFetcher}),require_logging=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.log=exports.LOG_PREFIX=void 0,exports.LOG_PREFIX=`[VAD]`;let levels=[`error`,`debug`,`warn`];function getLog(level){return(...args)=>{console[level](exports.LOG_PREFIX,...args)}}let _log=levels.reduce((acc,level)=>(acc[level]=getLog(level),acc),{});exports.log=_log}),require_messages=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Message=void 0;var Message;(function(Message$1){Message$1.AudioFrame=`AUDIO_FRAME`,Message$1.SpeechStart=`SPEECH_START`,Message$1.VADMisfire=`VAD_MISFIRE`,Message$1.SpeechEnd=`SPEECH_END`,Message$1.SpeechStop=`SPEECH_STOP`,Message$1.SpeechRealStart=`SPEECH_REAL_START`,Message$1.FrameProcessed=`FRAME_PROCESSED`})(Message||(exports.Message=Message={}))}),require_frame_processor=__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.FrameProcessor=exports.validateOptions=exports.defaultV5FrameProcessorOptions=exports.defaultLegacyFrameProcessorOptions=void 0;let logging_1$4=require_logging(),messages_1$3=require_messages(),RECOMMENDED_FRAME_SAMPLES=[512,1024,1536];exports.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},exports.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1};function validateOptions(options){RECOMMENDED_FRAME_SAMPLES.includes(options.frameSamples)||logging_1$4.log.warn(`You are using an unusual frame size`),(options.positiveSpeechThreshold<0||options.positiveSpeechThreshold>1)&&logging_1$4.log.error(`positiveSpeechThreshold should be a number between 0 and 1`),(options.negativeSpeechThreshold<0||options.negativeSpeechThreshold>options.positiveSpeechThreshold)&&logging_1$4.log.error(`negativeSpeechThreshold should be between 0 and positiveSpeechThreshold`),options.preSpeechPadFrames<0&&logging_1$4.log.error(`preSpeechPadFrames should be positive`),options.redemptionFrames<0&&logging_1$4.log.error(`redemptionFrames should be positive`)}exports.validateOptions=validateOptions;let concatArrays=arrays=>{let sizes=arrays.reduce((out,next)=>(out.push(out.at(-1)+next.length),out),[0]),outArray=new Float32Array(sizes.at(-1));return arrays.forEach((arr,index$1)=>{let place=sizes[index$1];outArray.set(arr,place)}),outArray};var FrameProcessor=class{constructor(modelProcessFunc,modelResetFunc,options){this.modelProcessFunc=modelProcessFunc,this.modelResetFunc=modelResetFunc,this.options=options,this.speaking=!1,this.redemptionCounter=0,this.speechFrameCount=0,this.active=!1,this.speechRealStartFired=!1,this.reset=()=>{this.speaking=!1,this.speechRealStartFired=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0,this.speechFrameCount=0},this.pause=handleEvent=>{this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment(handleEvent):this.reset()},this.resume=()=>{this.active=!0},this.endSegment=handleEvent=>{let audioBuffer=this.audioBuffer;this.audioBuffer=[];let speaking=this.speaking;if(this.reset(),speaking){let speechFrameCount=audioBuffer.reduce((acc,item)=>item.isSpeech?acc+1:acc,0);if(speechFrameCount>=this.options.minSpeechFrames){let audio=concatArrays(audioBuffer.map(item=>item.frame));handleEvent({msg:messages_1$3.Message.SpeechEnd,audio})}else handleEvent({msg:messages_1$3.Message.VADMisfire})}return{}},this.process=async(frame,handleEvent)=>{if(!this.active)return;let probs=await this.modelProcessFunc(frame),isSpeech=probs.isSpeech>=this.options.positiveSpeechThreshold;if(handleEvent({probs,msg:messages_1$3.Message.FrameProcessed,frame}),this.audioBuffer.push({frame,isSpeech}),isSpeech&&(this.speechFrameCount++,this.redemptionCounter=0),isSpeech&&!this.speaking&&(this.speaking=!0,handleEvent({msg:messages_1$3.Message.SpeechStart})),this.speaking&&this.speechFrameCount===this.options.minSpeechFrames&&!this.speechRealStartFired&&(this.speechRealStartFired=!0,handleEvent({msg:messages_1$3.Message.SpeechRealStart})),probs.isSpeech=this.options.redemptionFrames){this.redemptionCounter=0,this.speechFrameCount=0,this.speaking=!1,this.speechRealStartFired=!1;let audioBuffer=this.audioBuffer;this.audioBuffer=[];let speechFrameCount=audioBuffer.reduce((acc,item)=>item.isSpeech?acc+1:acc,0);if(speechFrameCount>=this.options.minSpeechFrames){let audio=concatArrays(audioBuffer.map(item=>item.frame));handleEvent({msg:messages_1$3.Message.SpeechEnd,audio})}else handleEvent({msg:messages_1$3.Message.VADMisfire})}if(!this.speaking){for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();this.speechFrameCount=0}},this.audioBuffer=[],this.reset()}};exports.FrameProcessor=FrameProcessor}),backends,backendsSortedByPriority,registerBackend,resolveBackend,init_backend_impl=__esmMin(()=>{backends={},backendsSortedByPriority=[],registerBackend=(name$1,backend,priority)=>{if(backend&&typeof backend.init==`function`&&typeof backend.createSessionHandler==`function`){let currentBackend=backends[name$1];if(currentBackend===void 0)backends[name$1]={backend,priority};else if(currentBackend.priority>priority)return;else if(currentBackend.priority===priority&¤tBackend.backend!==backend)throw Error(`cannot register backend "${name$1}" using priority ${priority}`);if(priority>=0){let i=backendsSortedByPriority.indexOf(name$1);i!==-1&&backendsSortedByPriority.splice(i,1);for(let i$1=0;i$1{let backendNames=backendHints.length===0?backendsSortedByPriority:backendHints,errors=[];for(let backendName of backendNames){let backendInfo=backends[backendName];if(backendInfo){if(backendInfo.initialized)return backendInfo.backend;if(backendInfo.aborted)continue;let isInitializing=!!backendInfo.initPromise;try{return isInitializing||(backendInfo.initPromise=backendInfo.backend.init()),await backendInfo.initPromise,backendInfo.initialized=!0,backendInfo.backend}catch(e){isInitializing||errors.push({name:backendName,err:e}),backendInfo.aborted=!0}finally{delete backendInfo.initPromise}}}throw Error(`no available backend found. ERR: ${errors.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`)}}),init_backend=__esmMin(()=>{init_backend_impl()}),EnvImpl,init_env_impl=__esmMin(()=>{EnvImpl=class{constructor(){this.wasm={},this.webgl={},this.logLevelInternal=`warning`}set logLevel(value){if(value!==void 0){if(typeof value!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(value)===-1)throw Error(`Unsupported logging level: ${value}`);this.logLevelInternal=value}}get logLevel(){return this.logLevelInternal}}}),env,init_env=__esmMin(()=>{init_env_impl(),env=new EnvImpl}),isBigInt64ArrayAvailable,isBigUint64ArrayAvailable,NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP,NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP,calculateSize,Tensor$1,init_tensor_impl=__esmMin(()=>{isBigInt64ArrayAvailable=typeof BigInt64Array<`u`&&typeof BigInt64Array.from==`function`,isBigUint64ArrayAvailable=typeof BigUint64Array<`u`&&typeof BigUint64Array.from==`function`,NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set(`int64`,BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,`int64`)),isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set(`uint64`,BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,`uint64`)),calculateSize=dims=>{let size=1;for(let i=0;i{let canvas=document.createElement(`canvas`),context=canvas.getContext(`2d`);if(!image$1||!context)return reject();let newImage=new Image;newImage.crossOrigin=`Anonymous`,newImage.src=image$1,newImage.onload=()=>{canvas.width=newImage.width,canvas.height=newImage.height,context.drawImage(newImage,0,0,canvas.width,canvas.height);let img=context.getImageData(0,0,canvas.width,canvas.height);if(options!==void 0){if(options.height!==void 0&&options.height!==canvas.height)throw Error(`Image input config height doesn't match ImageBitmap height`);if(tensorConfig.height=canvas.height,options.width!==void 0&&options.width!==canvas.width)throw Error(`Image input config width doesn't match ImageBitmap width`);tensorConfig.width=canvas.width}else tensorConfig.height=canvas.height,tensorConfig.width=canvas.width;resolve(Tensor$1.bufferToTensor(img.data,tensorConfig))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(data!==void 0)return Tensor$1.bufferToTensor(data,tensorConfig);throw Error(`Input data provided is not supported - aborted tensor creation`)}toImageData(options){var _a$2,_b;let pixels2DContext=document.createElement(`canvas`).getContext(`2d`),image$1;if(pixels2DContext!=null){let width=this.dims[3],height=this.dims[2],channels=this.dims[1],inputformat=options===void 0||options.format===void 0?`RGB`:options.format,normMean=options===void 0||(_a$2=options.norm)?.mean===void 0?255:options.norm.mean,normBias=options===void 0||(_b=options.norm)?.bias===void 0?0:options.norm.bias,offset=height*width;if(options!==void 0){if(options.height!==void 0&&options.height!==height)throw Error(`Image output config height doesn't match tensor height`);if(options.width!==void 0&&options.width!==width)throw Error(`Image output config width doesn't match tensor width`);if(options.format!==void 0&&channels===4&&options.format!==`RGBA`||channels===3&&options.format!==`RGB`&&options.format!==`BGR`)throw Error(`Tensor format doesn't match input tensor dims`)}let step=4,rImagePointer=0,gImagePointer=1,bImagePointer=2,aImagePointer=3,rTensorPointer=0,gTensorPointer=offset,bTensorPointer=offset*2,aTensorPointer=-1;inputformat===`RGBA`?(rTensorPointer=0,gTensorPointer=offset,bTensorPointer=offset*2,aTensorPointer=offset*3):inputformat===`RGB`?(rTensorPointer=0,gTensorPointer=offset,bTensorPointer=offset*2):inputformat===`RBG`&&(rTensorPointer=0,bTensorPointer=offset,gTensorPointer=offset*2),image$1=pixels2DContext.createImageData(width,height);for(let i=0;i{init_tensor_impl(),Tensor=Tensor$1}),InferenceSession,init_inference_session_impl=__esmMin(()=>{init_backend_impl(),init_tensor(),InferenceSession=class InferenceSession{constructor(handler){this.handler=handler}async run(feeds,arg1,arg2){let fetches={},options={};if(typeof feeds!=`object`||!feeds||feeds instanceof Tensor||Array.isArray(feeds))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let isFetchesEmpty=!0;if(typeof arg1==`object`){if(arg1===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(arg1 instanceof Tensor)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(arg1)){if(arg1.length===0)throw TypeError(`'fetches' cannot be an empty array.`);isFetchesEmpty=!1;for(let name$1 of arg1){if(typeof name$1!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(name$1)===-1)throw RangeError(`'fetches' contains invalid output name: ${name$1}.`);fetches[name$1]=null}if(typeof arg2==`object`&&arg2)options=arg2;else if(arg2!==void 0)throw TypeError(`'options' must be an object.`)}else{let isFetches=!1,arg1Keys=Object.getOwnPropertyNames(arg1);for(let name$1 of this.outputNames)if(arg1Keys.indexOf(name$1)!==-1){let v=arg1[name$1];(v===null||v instanceof Tensor)&&(isFetches=!0,isFetchesEmpty=!1,fetches[name$1]=v)}if(isFetches){if(typeof arg2==`object`&&arg2)options=arg2;else if(arg2!==void 0)throw TypeError(`'options' must be an object.`)}else options=arg1}}else if(arg1!==void 0)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let name$1 of this.inputNames)if(feeds[name$1]===void 0)throw Error(`input '${name$1}' is missing in 'feeds'.`);if(isFetchesEmpty)for(let name$1 of this.outputNames)fetches[name$1]=null;let results=await this.handler.run(feeds,fetches,options),returnValue={};for(let key$1 in results)Object.hasOwnProperty.call(results,key$1)&&(returnValue[key$1]=new Tensor(results[key$1].type,results[key$1].data,results[key$1].dims));return returnValue}static async create(arg0,arg1,arg2,arg3){let filePathOrUint8Array,options={};if(typeof arg0==`string`){if(filePathOrUint8Array=arg0,typeof arg1==`object`&&arg1)options=arg1;else if(arg1!==void 0)throw TypeError(`'options' must be an object.`)}else if(arg0 instanceof Uint8Array){if(filePathOrUint8Array=arg0,typeof arg1==`object`&&arg1)options=arg1;else if(arg1!==void 0)throw TypeError(`'options' must be an object.`)}else if(arg0 instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&arg0 instanceof SharedArrayBuffer){let buffer=arg0,byteOffset=0,byteLength=arg0.byteLength;if(typeof arg1==`object`&&arg1)options=arg1;else if(typeof arg1==`number`){if(byteOffset=arg1,!Number.isSafeInteger(byteOffset))throw RangeError(`'byteOffset' must be an integer.`);if(byteOffset<0||byteOffset>=buffer.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${buffer.byteLength}).`);if(byteLength=arg0.byteLength-byteOffset,typeof arg2==`number`){if(byteLength=arg2,!Number.isSafeInteger(byteLength))throw RangeError(`'byteLength' must be an integer.`);if(byteLength<=0||byteOffset+byteLength>buffer.byteLength)throw RangeError(`'byteLength' is out of range (0, ${buffer.byteLength-byteOffset}].`);if(typeof arg3==`object`&&arg3)options=arg3;else if(arg3!==void 0)throw TypeError(`'options' must be an object.`)}else if(arg2!==void 0)throw TypeError(`'byteLength' must be a number.`)}else if(arg1!==void 0)throw TypeError(`'options' must be an object.`);filePathOrUint8Array=new Uint8Array(buffer,byteOffset,byteLength)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let eps=options.executionProviders||[],backendHints=eps.map(i=>typeof i==`string`?i:i.name),backend=await resolveBackend(backendHints),handler=await backend.createSessionHandler(filePathOrUint8Array,options);return new InferenceSession(handler)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}}),InferenceSession$1,init_inference_session=__esmMin(()=>{init_inference_session_impl(),InferenceSession$1=InferenceSession}),init_onnx_value=__esmMin(()=>{}),lib_exports={};__export(lib_exports,{InferenceSession:()=>InferenceSession$1,Tensor:()=>Tensor,env:()=>env,registerBackend:()=>registerBackend});var init_lib=__esmMin(()=>{init_backend(),init_env(),init_inference_session(),init_tensor(),init_onnx_value()}),require_ort_web_min=__commonJSMin((exports,module)=>{ +/*! +* ONNX Runtime Web v1.14.0 +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. +*/ +(function(t,e){if(typeof exports==`object`&&typeof module==`object`)module.exports=e((init_lib(),__toCommonJS(lib_exports)));else if(typeof define==`function`&&define.amd)define([],e);else{var n=e(typeof exports==`object`?(init_lib(),__toCommonJS(lib_exports)):t.ort);for(var r in n)(typeof exports==`object`?exports:t)[r]=n[r]}})(self,__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir=typeof document<`u`&&document.currentScript?document.currentScript.src:void 0)||`/index.js`,function(t$1){function e$1(){return $.buffer!=C&&H($.buffer),F}function r$1(){return $.buffer!=C&&H($.buffer),N}function i(){return $.buffer!=C&&H($.buffer),L}function o(){return $.buffer!=C&&H($.buffer),R}function a(){return $.buffer!=C&&H($.buffer),j}var s,u,c;t$1||={},s||=t$1===void 0?{}:t$1,s.ready=new Promise(function(t$2,e$2){u=t$2,c=e$2});var l,p$1,f,d,h,g,b=Object.assign({},s),m=`./this.program`,y=(t$2,e$2)=>{throw e$2},_=typeof window==`object`,v=typeof importScripts==`function`,w=typeof process==`object`&&typeof process.versions==`object`&&typeof process.versions.node==`string`,x=s.ENVIRONMENT_IS_PTHREAD||!1,T=``;function S(t$2){return s.locateFile?s.locateFile(t$2,T):T+t$2}if(w){let e$2;T=v?n(908).dirname(T)+`/`:`//`,g=()=>{h||(d=n(1384),h=n(908))},l=function(t$2,e$3){return g(),t$2=h.normalize(t$2),d.readFileSync(t$2,e$3?void 0:`utf8`)},f=t$2=>((t$2=l(t$2,!0)).buffer||(t$2=new Uint8Array(t$2)),t$2),p$1=(t$2,e$3,n$1)=>{g(),t$2=h.normalize(t$2),d.readFile(t$2,function(t$3,r$2){t$3?n$1(t$3):e$3(r$2.buffer)})},1{if(J())throw process.exitCode=t$2,e$3;e$3 instanceof ut||P(`exiting due to exception: `+e$3),process.exit(t$2)},s.inspect=function(){return`[Emscripten Module object]`};try{e$2=n(9925)}catch(t$2){throw console.error(`The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?`),t$2}n.g.Worker=e$2.Worker}else (_||v)&&(v?T=self.location.href:typeof document<`u`&&document.currentScript&&(T=document.currentScript.src),_scriptDir&&(T=_scriptDir),T=T.indexOf(`blob:`)===0?``:T.substr(0,T.replace(/[?#].*/,``).lastIndexOf(`/`)+1),w||(l=t$2=>{var e$2=new XMLHttpRequest;return e$2.open(`GET`,t$2,!1),e$2.send(null),e$2.responseText},v&&(f=t$2=>{var e$2=new XMLHttpRequest;return e$2.open(`GET`,t$2,!1),e$2.responseType=`arraybuffer`,e$2.send(null),new Uint8Array(e$2.response)}),p$1=(t$2,e$2,n$1)=>{var r$2=new XMLHttpRequest;r$2.open(`GET`,t$2,!0),r$2.responseType=`arraybuffer`,r$2.onload=()=>{r$2.status==200||r$2.status==0&&r$2.response?e$2(r$2.response):n$1()},r$2.onerror=n$1,r$2.send(null)}));w&&typeof performance>`u`&&(n.g.performance=n(6953).performance);var O=console.log.bind(console),A=console.warn.bind(console);w&&(g(),O=t$2=>d.writeSync(1,t$2+` +`),A=t$2=>d.writeSync(2,t$2+` +`));var E,I=s.print||O,P=s.printErr||A;Object.assign(s,b),b=null,s.thisProgram&&(m=s.thisProgram),s.quit&&(y=s.quit),s.wasmBinary&&(E=s.wasmBinary);var D=s.noExitRuntime||!1;typeof WebAssembly!=`object`&&it(`no native wasm support detected`);var $,k,C,F,N,L,R,j,M=!1,U=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function V(t$2,e$2,n$1){var r$2=(e$2>>>=0)+n$1;for(n$1=e$2;t$2[n$1]&&!(n$1>=r$2);)++n$1;if(16(i$1=(240&i$1)==224?(15&i$1)<<12|o$1<<6|a$1:(7&i$1)<<18|o$1<<12|a$1<<6|63&t$2[e$2++])?r$2+=String.fromCharCode(i$1):(i$1-=65536,r$2+=String.fromCharCode(55296|i$1>>10,56320|1023&i$1))}}else r$2+=String.fromCharCode(i$1)}return r$2}function B(t$2,e$2){return(t$2>>>=0)?V(r$1(),t$2,e$2):``}function z(t$2,e$2,n$1,r$2){if(!(0>>=0;r$2=n$1+r$2-1;for(var o$1=0;o$1=a$1&&(a$1=65536+((1023&a$1)<<10)|1023&t$2.charCodeAt(++o$1)),127>=a$1){if(n$1>=r$2)break;e$2[n$1++>>>0]=a$1}else{if(2047>=a$1){if(n$1+1>=r$2)break;e$2[n$1++>>>0]=192|a$1>>6}else{if(65535>=a$1){if(n$1+2>=r$2)break;e$2[n$1++>>>0]=224|a$1>>12}else{if(n$1+3>=r$2)break;e$2[n$1++>>>0]=240|a$1>>18,e$2[n$1++>>>0]=128|a$1>>12&63}e$2[n$1++>>>0]=128|a$1>>6&63}e$2[n$1++>>>0]=128|63&a$1}}return e$2[n$1>>>0]=0,n$1-i$1}function G(t$2){for(var e$2=0,n$1=0;n$1=r$2?e$2++:2047>=r$2?e$2+=2:55296<=r$2&&57343>=r$2?(e$2+=4,++n$1):e$2+=3}return e$2}function H(t$2){C=t$2,s.HEAP8=F=new Int8Array(t$2),s.HEAP16=new Int16Array(t$2),s.HEAP32=L=new Int32Array(t$2),s.HEAPU8=N=new Uint8Array(t$2),s.HEAPU16=new Uint16Array(t$2),s.HEAPU32=R=new Uint32Array(t$2),s.HEAPF32=new Float32Array(t$2),s.HEAPF64=j=new Float64Array(t$2)}x&&(C=s.buffer);var W=s.INITIAL_MEMORY||16777216;if(x)$=s.wasmMemory,C=s.buffer;else if(s.wasmMemory)$=s.wasmMemory;else if(!(($=new WebAssembly.Memory({initial:W/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw P(`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`),w&&console.log(`(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)`),Error(`bad memory`);$&&(C=$.buffer),W=C.byteLength,H(C);var q,X=[],Y=[],K=[],Z=[];function J(){return D||!1}function Q(){var t$2=s.preRun.shift();X.unshift(t$2)}var tt,et=0,nt=null,rt=null;function it(t$2){throw x?postMessage({cmd:`onAbort`,arg:t$2}):s.onAbort&&s.onAbort(t$2),P(t$2=`Aborted(`+t$2+`)`),M=!0,t$2=new WebAssembly.RuntimeError(t$2+`. Build with -sASSERTIONS for more info.`),c(t$2),t$2}function ot(){return tt.startsWith(`data:application/octet-stream;base64,`)}function at(){var t$2=tt;try{if(t$2==tt&&E)return new Uint8Array(E);if(f)return f(t$2);throw`both async and sync fetching of the wasm failed`}catch(t$3){it(t$3)}}tt=`ort-wasm-threaded.wasm`,ot()||(tt=S(tt));var st={};function ut(t$2){this.name=`ExitStatus`,this.message=`Program terminated with exit(`+t$2+`)`,this.status=t$2}function ct(t$2){(t$2=dt$1.Vb[t$2])||it(),dt$1.mc(t$2)}function lt(t$2){var e$2=dt$1.Cc();if(!e$2)return 6;dt$1.ac.push(e$2),dt$1.Vb[t$2.Ub]=e$2,e$2.Ub=t$2.Ub;var n$1={cmd:`run`,start_routine:t$2.Ic,arg:t$2.zc,pthread_ptr:t$2.Ub};return e$2.$b=()=>{n$1.time=performance.now(),e$2.postMessage(n$1,t$2.Nc)},e$2.loaded&&(e$2.$b(),delete e$2.$b),0}function pt(t$2){if(x)return qt(1,1,t$2);J()||(dt$1.oc(),s.onExit&&s.onExit(t$2),M=!0),y(t$2,new ut(t$2))}function ft(t$2,e$2){if(!e$2&&x)throw bt(t$2),`unwind`;J()||x||(me(),ht(K),be(0),re$1[1].length&&ie(1,10),re$1[2].length&&ie(2,10),dt$1.oc()),pt(t$2)}var dt$1={Yb:[],ac:[],qc:[],Vb:{},fc:function(){x&&dt$1.Ec()},Pc:function(){},Ec:function(){dt$1.receiveObjectTransfer=dt$1.Gc,dt$1.threadInitTLS=dt$1.pc,dt$1.setExitStatus=dt$1.nc,D=!1},nc:function(){},oc:function(){for(var t$2 of Object.values(dt$1.Vb))dt$1.mc(t$2);for(t$2 of dt$1.Yb)t$2.terminate();dt$1.Yb=[]},mc:function(t$2){var e$2=t$2.Ub;delete dt$1.Vb[e$2],dt$1.Yb.push(t$2),dt$1.ac.splice(dt$1.ac.indexOf(t$2),1),t$2.Ub=0,xe(e$2)},Gc:function(){},pc:function(){dt$1.qc.forEach(t$2=>t$2())},Fc:function(t$2,e$2){t$2.onmessage=n$1=>{var r$2=(n$1=n$1.data).cmd;if(t$2.Ub&&(dt$1.Bc=t$2.Ub),n$1.targetThread&&n$1.targetThread!=de()){var i$1=dt$1.Vb[n$1.Qc];i$1?i$1.postMessage(n$1,n$1.transferList):P(`Internal error! Worker sent a message "`+r$2+`" to target pthread `+n$1.targetThread+`, but that thread no longer exists!`)}else r$2===`processProxyingQueue`?Vt(n$1.queue):r$2===`spawnThread`?lt(n$1):r$2===`cleanupThread`?ct(n$1.thread):r$2===`killThread`?(n$1=n$1.thread,r$2=dt$1.Vb[n$1],delete dt$1.Vb[n$1],r$2.terminate(),xe(n$1),dt$1.ac.splice(dt$1.ac.indexOf(r$2),1),r$2.Ub=0):r$2===`cancelThread`?dt$1.Vb[n$1.thread].postMessage({cmd:`cancel`}):r$2===`loaded`?(t$2.loaded=!0,e$2&&e$2(t$2),t$2.$b&&(t$2.$b(),delete t$2.$b)):r$2===`print`?I(`Thread `+n$1.threadId+`: `+n$1.text):r$2===`printErr`?P(`Thread `+n$1.threadId+`: `+n$1.text):r$2===`alert`?alert(`Thread `+n$1.threadId+`: `+n$1.text):n$1.target===`setimmediate`?t$2.postMessage(n$1):r$2===`onAbort`?s.onAbort&&s.onAbort(n$1.arg):r$2&&P(`worker sent an unknown command `+r$2);dt$1.Bc=void 0},t$2.onerror=t$3=>{throw P(`worker sent an error! `+t$3.filename+`:`+t$3.lineno+`: `+t$3.message),t$3},w&&(t$2.on(`message`,function(e$3){t$2.onmessage({data:e$3})}),t$2.on(`error`,function(e$3){t$2.onerror(e$3)}),t$2.on(`detachedExit`,function(){})),t$2.postMessage({cmd:`load`,urlOrBlob:s.mainScriptUrlOrBlob||_scriptDir,wasmMemory:$,wasmModule:k})},yc:function(){var t$2=S(`ort-wasm-threaded.worker.js`);dt$1.Yb.push(new Worker(t$2))},Cc:function(){return dt$1.Yb.length==0&&(dt$1.yc(),dt$1.Fc(dt$1.Yb[0])),dt$1.Yb.pop()}};function ht(t$2){for(;0>2>>>0];t$2=i()[t$2+48>>2>>>0],Oe(e$2,e$2-t$2),Ee(e$2)};var mt=[];function yt(t$2){var e$2=mt[t$2];return e$2||(t$2>=mt.length&&(mt.length=t$2+1),mt[t$2]=e$2=q.get(t$2)),e$2}s.invokeEntryPoint=function(t$2,e$2){t$2=yt(t$2)(e$2),J()?dt$1.nc(t$2):Te(t$2)};var _t,vt,wt=[],xt=0,Tt=0;function St(t$2){this.Zb=t$2,this.Sb=t$2-24,this.xc=function(t$3){o()[this.Sb+4>>2>>>0]=t$3},this.bc=function(){return o()[this.Sb+4>>2>>>0]},this.wc=function(t$3){o()[this.Sb+8>>2>>>0]=t$3},this.Dc=function(){return o()[this.Sb+8>>2>>>0]},this.rc=function(){i()[this.Sb>>2>>>0]=0},this.hc=function(t$3){t$3=t$3?1:0,e$1()[this.Sb+12>>0>>>0]=t$3},this.uc=function(){return e$1()[this.Sb+12>>0>>>0]!=0},this.ic=function(t$3){t$3=t$3?1:0,e$1()[this.Sb+13>>0>>>0]=t$3},this.kc=function(){return e$1()[this.Sb+13>>0>>>0]!=0},this.fc=function(t$3,e$2){this.cc(0),this.xc(t$3),this.wc(e$2),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(i(),this.Sb>>2,1)},this.Hc=function(){return Atomics.sub(i(),this.Sb>>2,1)===1},this.cc=function(t$3){o()[this.Sb+16>>2>>>0]=t$3},this.tc=function(){return o()[this.Sb+16>>2>>>0]},this.vc=function(){if(De(this.bc()))return o()[this.Zb>>2>>>0];var t$3=this.tc();return t$3===0?this.Zb:t$3}}function Ot(t$2){return ge(new St(t$2).Sb)}function At(t$2,e$2,n$1,r$2){return x?qt(3,1,t$2,e$2,n$1,r$2):Et(t$2,e$2,n$1,r$2)}function Et(t$2,e$2,n$1,r$2){if(typeof SharedArrayBuffer>`u`)return P(`Current environment does not support SharedArrayBuffer, pthreads are not available!`),6;var i$1=[];return x&&i$1.length===0?At(t$2,e$2,n$1,r$2):(t$2={Ic:n$1,Ub:t$2,zc:r$2,Nc:i$1},x?(t$2.Oc=`spawnThread`,postMessage(t$2,i$1),0):lt(t$2))}function It(t$2,e$2,n$1){return x?qt(4,1,t$2,e$2,n$1):0}function Pt(t$2,e$2){if(x)return qt(5,1,t$2,e$2)}function Dt(t$2,e$2){if(x)return qt(6,1,t$2,e$2)}function $t(t$2,e$2,n$1){if(x)return qt(7,1,t$2,e$2,n$1)}function kt(t$2,e$2,n$1){return x?qt(8,1,t$2,e$2,n$1):0}function Ct(t$2,e$2){if(x)return qt(9,1,t$2,e$2)}function Ft(t$2,e$2,n$1){if(x)return qt(10,1,t$2,e$2,n$1)}function Nt(t$2,e$2,n$1,r$2){if(x)return qt(11,1,t$2,e$2,n$1,r$2)}function Lt(t$2,e$2,n$1,r$2){if(x)return qt(12,1,t$2,e$2,n$1,r$2)}function Rt(t$2,e$2,n$1,r$2){if(x)return qt(13,1,t$2,e$2,n$1,r$2)}function jt(t$2){if(x)return qt(14,1,t$2)}function Mt(t$2,e$2){if(x)return qt(15,1,t$2,e$2)}function Ut(t$2,e$2,n$1){if(x)return qt(16,1,t$2,e$2,n$1)}function Vt(t$2){Atomics.store(i(),t$2>>2,1),de()&&we(t$2),Atomics.compareExchange(i(),t$2>>2,1,0)}function Bt(t$2){return o()[t$2>>>2]+4294967296*i()[t$2+4>>>2]}function zt(t$2,e$2,n$1,r$2,i$1,o$1){return x?qt(17,1,t$2,e$2,n$1,r$2,i$1,o$1):-52}function Gt(t$2,e$2,n$1,r$2,i$1,o$1){if(x)return qt(18,1,t$2,e$2,n$1,r$2,i$1,o$1)}function Ht(t$2){var n$1=G(t$2)+1,r$2=he(n$1);return r$2&&z(t$2,e$1(),r$2,n$1),r$2}function Wt(t$2,e$2,n$1){function r$2(t$3){return(t$3=t$3.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t$3[1]:`GMT`}if(x)return qt(19,1,t$2,e$2,n$1);var a$1=new Date().getFullYear(),s$1=new Date(a$1,0,1),u$1=new Date(a$1,6,1);a$1=s$1.getTimezoneOffset();var c$1=u$1.getTimezoneOffset(),l$1=Math.max(a$1,c$1);i()[t$2>>2>>>0]=60*l$1,i()[e$2>>2>>>0]=Number(a$1!=c$1),t$2=r$2(s$1),e$2=r$2(u$1),t$2=Ht(t$2),e$2=Ht(e$2),c$1>2>>>0]=t$2,o()[n$1+4>>2>>>0]=e$2):(o()[n$1>>2>>>0]=e$2,o()[n$1+4>>2>>>0]=t$2)}function qt(t$2,e$2){var n$1=arguments.length-2,r$2=arguments;return gt(()=>{for(var i$1=Ie(8*n$1),o$1=i$1>>3,s$1=0;s$1>>0]=u$1}return ve(t$2,n$1,i$1,e$2)})}s.executeNotifiedProxyingQueue=Vt,vt=w?()=>{var t$2=process.hrtime();return 1e3*t$2[0]+t$2[1]/1e6}:x?()=>performance.now()-s.__performance_now_clock_drift:()=>performance.now();var Xt,Yt=[],Kt={};function Zt(){if(!Xt){var t$2,e$2={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:m||`./this.program`};for(t$2 in Kt)Kt[t$2]===void 0?delete e$2[t$2]:e$2[t$2]=Kt[t$2];var n$1=[];for(t$2 in e$2)n$1.push(t$2+`=`+e$2[t$2]);Xt=n$1}return Xt}function Jt(t$2,n$1){if(x)return qt(20,1,t$2,n$1);var r$2=0;return Zt().forEach(function(i$1,a$1){var s$1=n$1+r$2;for(a$1=o()[t$2+4*a$1>>2>>>0]=s$1,s$1=0;s$1>0>>>0]=i$1.charCodeAt(s$1);e$1()[a$1>>0>>>0]=0,r$2+=i$1.length+1}),0}function Qt(t$2,e$2){if(x)return qt(21,1,t$2,e$2);var n$1=Zt();o()[t$2>>2>>>0]=n$1.length;var r$2=0;return n$1.forEach(function(t$3){r$2+=t$3.length+1}),o()[e$2>>2>>>0]=r$2,0}function te(t$2){return x?qt(22,1,t$2):52}function ee(t$2,e$2,n$1,r$2){return x?qt(23,1,t$2,e$2,n$1,r$2):52}function ne(t$2,e$2,n$1,r$2,i$1){return x?qt(24,1,t$2,e$2,n$1,r$2,i$1):70}var re$1=[null,[],[]];function ie(t$2,e$2){var n$1=re$1[t$2];e$2===0||e$2===10?((t$2===1?I:P)(V(n$1,0)),n$1.length=0):n$1.push(e$2)}function oe(t$2,e$2,n$1,i$1){if(x)return qt(25,1,t$2,e$2,n$1,i$1);for(var a$1=0,s$1=0;s$1>2>>>0],c$1=o()[e$2+4>>2>>>0];e$2+=8;for(var l$1=0;l$1>>0]);a$1+=c$1}return o()[i$1>>2>>>0]=a$1,0}var ae=0;function se(t$2){return t$2%4==0&&(t$2%100!=0||t$2%400==0)}var ue=[31,29,31,30,31,30,31,31,30,31,30,31],ce=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t$2,n$1,r$2,o$1){function a$1(t$3,e$2,n$2){for(t$3=typeof t$3==`number`?t$3.toString():t$3||``;t$3.lengtht$4?-1:0r$3-t$3.getDate())){t$3.setDate(t$3.getDate()+e$2);break}e$2-=r$3-t$3.getDate()+1,t$3.setDate(1),11>n$2?t$3.setMonth(n$2+1):(t$3.setMonth(0),t$3.setFullYear(t$3.getFullYear()+1))}return n$2=new Date(t$3.getFullYear()+1,0,4),e$2=c$1(new Date(t$3.getFullYear(),0,4)),n$2=c$1(n$2),0>=u$1(e$2,t$3)?0>=u$1(n$2,t$3)?t$3.getFullYear()+1:t$3.getFullYear():t$3.getFullYear()-1}var p$2=i()[o$1+40>>2>>>0];for(var f$1 in o$1={Lc:i()[o$1>>2>>>0],Kc:i()[o$1+4>>2>>>0],dc:i()[o$1+8>>2>>>0],jc:i()[o$1+12>>2>>>0],ec:i()[o$1+16>>2>>>0],Xb:i()[o$1+20>>2>>>0],Tb:i()[o$1+24>>2>>>0],Wb:i()[o$1+28>>2>>>0],Rc:i()[o$1+32>>2>>>0],Jc:i()[o$1+36>>2>>>0],Mc:p$2?B(p$2):``},r$2=B(r$2),p$2={"%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$2=r$2.replace(new RegExp(f$1,`g`),p$2[f$1]);var d$1=`Sunday Monday Tuesday Wednesday Thursday Friday Saturday`.split(` `),h$1=`January February March April May June July August September October November December`.split(` `);for(f$1 in p$2={"%a":function(t$3){return d$1[t$3.Tb].substring(0,3)},"%A":function(t$3){return d$1[t$3.Tb]},"%b":function(t$3){return h$1[t$3.ec].substring(0,3)},"%B":function(t$3){return h$1[t$3.ec]},"%C":function(t$3){return s$1((t$3.Xb+1900)/100|0,2)},"%d":function(t$3){return s$1(t$3.jc,2)},"%e":function(t$3){return a$1(t$3.jc,2,` `)},"%g":function(t$3){return l$1(t$3).toString().substring(2)},"%G":function(t$3){return l$1(t$3)},"%H":function(t$3){return s$1(t$3.dc,2)},"%I":function(t$3){return(t$3=t$3.dc)==0?t$3=12:12t$3.dc?`AM`:`PM`},"%S":function(t$3){return s$1(t$3.Lc,2)},"%t":function(){return` `},"%u":function(t$3){return t$3.Tb||7},"%U":function(t$3){return s$1(Math.floor((t$3.Wb+7-t$3.Tb)/7),2)},"%V":function(t$3){var e$2=Math.floor((t$3.Wb+7-(t$3.Tb+6)%7)/7);if(2>=(t$3.Tb+371-t$3.Wb-2)%7&&e$2++,e$2)e$2==53&&((n$2=(t$3.Tb+371-t$3.Wb)%7)==4||n$2==3&&se(t$3.Xb)||(e$2=1));else{e$2=52;var n$2=(t$3.Tb+7-t$3.Wb-1)%7;(n$2==4||n$2==5&&se(t$3.Xb%400-1))&&e$2++}return s$1(e$2,2)},"%w":function(t$3){return t$3.Tb},"%W":function(t$3){return s$1(Math.floor((t$3.Wb+7-(t$3.Tb+6)%7)/7),2)},"%y":function(t$3){return(t$3.Xb+1900).toString().substring(2)},"%Y":function(t$3){return t$3.Xb+1900},"%z":function(t$3){var e$2=0<=(t$3=t$3.Jc);return t$3=Math.abs(t$3)/60,(e$2?`+`:`-`)+String(`0000`+(t$3/60*100+t$3%60)).slice(-4)},"%Z":function(t$3){return t$3.Mc},"%%":function(){return`%`}},r$2=r$2.replace(/%%/g,`\0\0`),p$2)r$2.includes(f$1)&&(r$2=r$2.replace(new RegExp(f$1,`g`),p$2[f$1](o$1)));return f$1=function(t$3){var e$2=Array(G(t$3)+1);return z(t$3,e$2,0,e$2.length),e$2}(r$2=r$2.replace(/\0\0/g,`%`)),f$1.length>n$1?0:(function(t$3,n$2){e$1().set(t$3,n$2>>>0)}(f$1,t$2),f$1.length-1)}dt$1.fc();var pe=[null,pt,bt,At,It,Pt,Dt,$t,kt,Ct,Ft,Nt,Lt,Rt,jt,Mt,Ut,zt,Gt,Wt,Jt,Qt,te,ee,ne,oe],fe={b:function(t$2){return he(t$2+24)+24},n:function(t$2){return(t$2=new St(t$2)).uc()||(t$2.hc(!0),xt--),t$2.ic(!1),wt.push(t$2),t$2.sc(),t$2.vc()},ma:function(t$2){throw P(`Unexpected exception thrown, this is not properly supported - aborting`),M=!0,t$2},x:function(){Se(0);var t$2=wt.pop();if(t$2.Hc()&&!t$2.kc()){var e$2=t$2.Dc();e$2&&yt(e$2)(t$2.Zb),Ot(t$2.Zb)}Tt=0},e:function(){var t$2=Tt;if(!t$2)return ae=0;var e$2=new St(t$2);e$2.cc(t$2);var n$1=e$2.bc();if(!n$1)return ae=0,t$2;for(var r$2=Array.prototype.slice.call(arguments),i$1=0;i$1Vt(r$2));else if(x)postMessage({targetThread:t$2,cmd:`processProxyingQueue`,queue:r$2});else{if(!(t$2=dt$1.Vb[t$2]))return;t$2.postMessage({cmd:`processProxyingQueue`,queue:r$2})}return 1},Ea:function(){return-1},Pa:function(t$2,e$2){t$2=new Date(1e3*Bt(t$2)),i()[e$2>>2>>>0]=t$2.getUTCSeconds(),i()[e$2+4>>2>>>0]=t$2.getUTCMinutes(),i()[e$2+8>>2>>>0]=t$2.getUTCHours(),i()[e$2+12>>2>>>0]=t$2.getUTCDate(),i()[e$2+16>>2>>>0]=t$2.getUTCMonth(),i()[e$2+20>>2>>>0]=t$2.getUTCFullYear()-1900,i()[e$2+24>>2>>>0]=t$2.getUTCDay(),t$2=(t$2.getTime()-Date.UTC(t$2.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,i()[e$2+28>>2>>>0]=t$2},Qa:function(t$2,e$2){t$2=new Date(1e3*Bt(t$2)),i()[e$2>>2>>>0]=t$2.getSeconds(),i()[e$2+4>>2>>>0]=t$2.getMinutes(),i()[e$2+8>>2>>>0]=t$2.getHours(),i()[e$2+12>>2>>>0]=t$2.getDate(),i()[e$2+16>>2>>>0]=t$2.getMonth(),i()[e$2+20>>2>>>0]=t$2.getFullYear()-1900,i()[e$2+24>>2>>>0]=t$2.getDay();var n$1=new Date(t$2.getFullYear(),0,1),r$2=(t$2.getTime()-n$1.getTime())/864e5|0;i()[e$2+28>>2>>>0]=r$2,i()[e$2+36>>2>>>0]=-60*t$2.getTimezoneOffset(),r$2=new Date(t$2.getFullYear(),6,1).getTimezoneOffset(),t$2=0|(r$2!=(n$1=n$1.getTimezoneOffset())&&t$2.getTimezoneOffset()==Math.min(n$1,r$2)),i()[e$2+32>>2>>>0]=t$2},Ra:function(t$2){var e$2=new Date(i()[t$2+20>>2>>>0]+1900,i()[t$2+16>>2>>>0],i()[t$2+12>>2>>>0],i()[t$2+8>>2>>>0],i()[t$2+4>>2>>>0],i()[t$2>>2>>>0],0),n$1=i()[t$2+32>>2>>>0],r$2=e$2.getTimezoneOffset(),o$1=new Date(e$2.getFullYear(),0,1),a$1=new Date(e$2.getFullYear(),6,1).getTimezoneOffset(),s$1=o$1.getTimezoneOffset(),u$1=Math.min(s$1,a$1);return 0>n$1?i()[t$2+32>>2>>>0]=Number(a$1!=s$1&&u$1==r$2):0>2>>>0]=e$2.getDay(),n$1=(e$2.getTime()-o$1.getTime())/864e5|0,i()[t$2+28>>2>>>0]=n$1,i()[t$2>>2>>>0]=e$2.getSeconds(),i()[t$2+4>>2>>>0]=e$2.getMinutes(),i()[t$2+8>>2>>>0]=e$2.getHours(),i()[t$2+12>>2>>>0]=e$2.getDate(),i()[t$2+16>>2>>>0]=e$2.getMonth(),e$2.getTime()/1e3|0},Aa:zt,Ba:Gt,Sa:function t$2(e$2,n$1,r$2){t$2.Ac||(t$2.Ac=!0,Wt(e$2,n$1,r$2))},y:function(){it(``)},U:function(){if(!w&&!v){var t$2=`Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread`;_t||={},_t[t$2]||(_t[t$2]=1,w&&(t$2=`warning: `+t$2),P(t$2))}},ra:function(){return 4294901760},B:vt,Ia:function(t$2,e$2,n$1){r$1().copyWithin(t$2>>>0,e$2>>>0,e$2+n$1>>>0)},F:function(){return w?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(t$2,e$2,n$1){Yt.length=e$2,n$1>>=3;for(var r$2=0;r$2>>0];return(0>t$2?st[-t$2-1]:pe[t$2]).apply(null,Yt)},qa:function(t$2){var e$2=r$1().length;if((t$2>>>=0)<=e$2||4294901760=n$1;n$1*=2){var i$1=e$2*(1+.2/n$1);i$1=Math.min(i$1,t$2+100663296);var o$1=Math;i$1=Math.max(t$2,i$1),o$1=o$1.min.call(o$1,4294901760,i$1+(65536-i$1%65536)%65536);t:{try{$.grow(o$1-C.byteLength+65535>>>16),H($.buffer);var a$1=1;break t}catch{}a$1=void 0}if(a$1)return!0}return!1},Na:function(){throw`unwind`},Ga:Jt,Ha:Qt,J:ft,I:te,S:ee,ga:ne,R:oe,d:function(){return ae},na:function t$2(r$2,i$1){t$2.lc||=function(){if(typeof crypto==`object`&&typeof crypto.getRandomValues==`function`){var t$3=new Uint8Array(1);return()=>(crypto.getRandomValues(t$3),t$3[0])}if(w)try{var e$2=n(Object(function(){var t$4=Error(`Cannot find module 'crypto'`);throw t$4.code=`MODULE_NOT_FOUND`,t$4}()));return()=>e$2.randomBytes(1)[0]}catch{}return()=>it(`randomDevice`)}();for(var o$1=0;o$1>0>>>0]=t$2.lc();return 0},ia:function(t$2,e$2,n$1){var r$2=Ae();try{return yt(t$2)(e$2,n$1)}catch(t$3){if(Ee(r$2),t$3!==t$3+0)throw t$3;Se(1,0)}},ja:function(t$2,e$2,n$1){var r$2=Ae();try{return yt(t$2)(e$2,n$1)}catch(t$3){if(Ee(r$2),t$3!==t$3+0)throw t$3;Se(1,0)}},K:function(t$2){var e$2=Ae();try{return yt(t$2)()}catch(t$3){if(Ee(e$2),t$3!==t$3+0)throw t$3;Se(1,0)}},f:function(t$2,e$2){var n$1=Ae();try{return yt(t$2)(e$2)}catch(t$3){if(Ee(n$1),t$3!==t$3+0)throw t$3;Se(1,0)}},P:function(t$2,e$2,n$1){var r$2=Ae();try{return yt(t$2)(e$2,n$1)}catch(t$3){if(Ee(r$2),t$3!==t$3+0)throw t$3;Se(1,0)}},Q:function(t$2,e$2,n$1){var r$2=Ae();try{return yt(t$2)(e$2,n$1)}catch(t$3){if(Ee(r$2),t$3!==t$3+0)throw t$3;Se(1,0)}},k:function(t$2,e$2,n$1){var r$2=Ae();try{return yt(t$2)(e$2,n$1)}catch(t$3){if(Ee(r$2),t$3!==t$3+0)throw t$3;Se(1,0)}},p:function(t$2,e$2,n$1,r$2){var i$1=Ae();try{return yt(t$2)(e$2,n$1,r$2)}catch(t$3){if(Ee(i$1),t$3!==t$3+0)throw t$3;Se(1,0)}},q:function(t$2,e$2,n$1,r$2,i$1){var o$1=Ae();try{return yt(t$2)(e$2,n$1,r$2,i$1)}catch(t$3){if(Ee(o$1),t$3!==t$3+0)throw t$3;Se(1,0)}},N:function(t$2,e$2,n$1,r$2,i$1,o$1){var a$1=Ae();try{return yt(t$2)(e$2,n$1,r$2,i$1,o$1)}catch(t$3){if(Ee(a$1),t$3!==t$3+0)throw t$3;Se(1,0)}},s:function(t$2,e$2,n$1,r$2,i$1,o$1){var a$1=Ae();try{return yt(t$2)(e$2,n$1,r$2,i$1,o$1)}catch(t$3){if(Ee(a$1),t$3!==t$3+0)throw t$3;Se(1,0)}},w:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1){var s$1=Ae();try{return yt(t$2)(e$2,n$1,r$2,i$1,o$1,a$1)}catch(t$3){if(Ee(s$1),t$3!==t$3+0)throw t$3;Se(1,0)}},L:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1){var u$1=Ae();try{return yt(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1)}catch(t$3){if(Ee(u$1),t$3!==t$3+0)throw t$3;Se(1,0)}},E:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2){var f$1=Ae();try{return yt(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2)}catch(t$3){if(Ee(f$1),t$3!==t$3+0)throw t$3;Se(1,0)}},aa:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1){var u$1=Ae();try{return Me(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1)}catch(t$3){if(Ee(u$1),t$3!==t$3+0)throw t$3;Se(1,0)}},_:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1){var s$1=Ae();try{return ke(t$2,e$2,n$1,r$2,i$1,o$1,a$1)}catch(t$3){if(Ee(s$1),t$3!==t$3+0)throw t$3;Se(1,0)}},Z:function(t$2,e$2,n$1,r$2,i$1){var o$1=Ae();try{return Ue(t$2,e$2,n$1,r$2,i$1)}catch(t$3){if(Ee(o$1),t$3!==t$3+0)throw t$3;Se(1,0)}},ca:function(t$2,e$2,n$1,r$2){var i$1=Ae();try{return Re(t$2,e$2,n$1,r$2)}catch(t$3){if(Ee(i$1),t$3!==t$3+0)throw t$3;Se(1,0)}},$:function(t$2){var e$2=Ae();try{return $e(t$2)}catch(t$3){if(Ee(e$2),t$3!==t$3+0)throw t$3;Se(1,0)}},ba:function(t$2,e$2){var n$1=Ae();try{return je(t$2,e$2)}catch(t$3){if(Ee(n$1),t$3!==t$3+0)throw t$3;Se(1,0)}},Y:function(t$2,e$2,n$1){var r$2=Ae();try{return Ce(t$2,e$2,n$1)}catch(t$3){if(Ee(r$2),t$3!==t$3+0)throw t$3;Se(1,0)}},g:function(t$2){var e$2=Ae();try{yt(t$2)()}catch(t$3){if(Ee(e$2),t$3!==t$3+0)throw t$3;Se(1,0)}},r:function(t$2,e$2){var n$1=Ae();try{yt(t$2)(e$2)}catch(t$3){if(Ee(n$1),t$3!==t$3+0)throw t$3;Se(1,0)}},i:function(t$2,e$2,n$1){var r$2=Ae();try{yt(t$2)(e$2,n$1)}catch(t$3){if(Ee(r$2),t$3!==t$3+0)throw t$3;Se(1,0)}},ha:function(t$2,e$2,n$1,r$2){var i$1=Ae();try{yt(t$2)(e$2,n$1,r$2)}catch(t$3){if(Ee(i$1),t$3!==t$3+0)throw t$3;Se(1,0)}},m:function(t$2,e$2,n$1,r$2){var i$1=Ae();try{yt(t$2)(e$2,n$1,r$2)}catch(t$3){if(Ee(i$1),t$3!==t$3+0)throw t$3;Se(1,0)}},v:function(t$2,e$2,n$1,r$2,i$1){var o$1=Ae();try{yt(t$2)(e$2,n$1,r$2,i$1)}catch(t$3){if(Ee(o$1),t$3!==t$3+0)throw t$3;Se(1,0)}},u:function(t$2,e$2,n$1,r$2,i$1,o$1){var a$1=Ae();try{yt(t$2)(e$2,n$1,r$2,i$1,o$1)}catch(t$3){if(Ee(a$1),t$3!==t$3+0)throw t$3;Se(1,0)}},O:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1){var s$1=Ae();try{yt(t$2)(e$2,n$1,r$2,i$1,o$1,a$1)}catch(t$3){if(Ee(s$1),t$3!==t$3+0)throw t$3;Se(1,0)}},A:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1){var u$1=Ae();try{yt(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1)}catch(t$3){if(Ee(u$1),t$3!==t$3+0)throw t$3;Se(1,0)}},ka:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1){var c$1=Ae();try{yt(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1)}catch(t$3){if(Ee(c$1),t$3!==t$3+0)throw t$3;Se(1,0)}},C:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1){var p$2=Ae();try{yt(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1)}catch(t$3){if(Ee(p$2),t$3!==t$3+0)throw t$3;Se(1,0)}},D:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2,f$1,d$1,h$1,g$1){var b$1=Ae();try{yt(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2,f$1,d$1,h$1,g$1)}catch(t$3){if(Ee(b$1),t$3!==t$3+0)throw t$3;Se(1,0)}},fa:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1){var u$1=Ae();try{Fe(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1)}catch(t$3){if(Ee(u$1),t$3!==t$3+0)throw t$3;Se(1,0)}},da:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2){var f$1=Ae();try{Le(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2)}catch(t$3){if(Ee(f$1),t$3!==t$3+0)throw t$3;Se(1,0)}},ea:function(t$2,e$2,n$1,r$2,i$1,o$1){var a$1=Ae();try{Ne(t$2,e$2,n$1,r$2,i$1,o$1)}catch(t$3){if(Ee(a$1),t$3!==t$3+0)throw t$3;Se(1,0)}},o:function(t$2){return t$2},a:$||s.wasmMemory,G:function(t$2){ae=t$2},la:le,z:function(t$2,e$2,n$1,r$2){return le(t$2,e$2,n$1,r$2)}};(function(){function t$2(t$3,e$3){s.asm=t$3.exports,dt$1.qc.push(s.asm.sb),q=s.asm.ub,Y.unshift(s.asm.Va),k=e$3,x||(et--,s.monitorRunDependencies&&s.monitorRunDependencies(et),et==0&&(nt!==null&&(clearInterval(nt),nt=null),rt&&(t$3=rt,rt=null,t$3())))}function e$2(e$3){t$2(e$3.instance,e$3.module)}function n$1(t$3){return function(){if(!E&&(_||v)){if(typeof fetch==`function`&&!tt.startsWith(`file://`))return fetch(tt,{credentials:`same-origin`}).then(function(t$4){if(!t$4.ok)throw`failed to load wasm binary file at '`+tt+`'`;return t$4.arrayBuffer()}).catch(function(){return at()});if(p$1)return new Promise(function(t$4,e$3){p$1(tt,function(e$4){t$4(new Uint8Array(e$4))},e$3)})}return Promise.resolve().then(function(){return at()})}().then(function(t$4){return WebAssembly.instantiate(t$4,r$2)}).then(function(t$4){return t$4}).then(t$3,function(t$4){P(`failed to asynchronously prepare wasm: `+t$4),it(t$4)})}var r$2={a:fe};if(x||(et++,s.monitorRunDependencies&&s.monitorRunDependencies(et)),s.instantiateWasm)try{return s.instantiateWasm(r$2,t$2)}catch(t$3){return P(`Module.instantiateWasm callback failed with error: `+t$3),!1}(E||typeof WebAssembly.instantiateStreaming!=`function`||ot()||tt.startsWith(`file://`)||w||typeof fetch!=`function`?n$1(e$2):fetch(tt,{credentials:`same-origin`}).then(function(t$3){return WebAssembly.instantiateStreaming(t$3,r$2).then(e$2,function(t$4){return P(`wasm streaming compile failed: `+t$4),P(`falling back to ArrayBuffer instantiation`),n$1(e$2)})})).catch(c)})(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.Va).apply(null,arguments)},s._OrtInit=function(){return(s._OrtInit=s.asm.Wa).apply(null,arguments)},s._OrtCreateSessionOptions=function(){return(s._OrtCreateSessionOptions=s.asm.Xa).apply(null,arguments)},s._OrtAppendExecutionProvider=function(){return(s._OrtAppendExecutionProvider=s.asm.Ya).apply(null,arguments)},s._OrtAddSessionConfigEntry=function(){return(s._OrtAddSessionConfigEntry=s.asm.Za).apply(null,arguments)},s._OrtReleaseSessionOptions=function(){return(s._OrtReleaseSessionOptions=s.asm._a).apply(null,arguments)},s._OrtCreateSession=function(){return(s._OrtCreateSession=s.asm.$a).apply(null,arguments)},s._OrtReleaseSession=function(){return(s._OrtReleaseSession=s.asm.ab).apply(null,arguments)},s._OrtGetInputCount=function(){return(s._OrtGetInputCount=s.asm.bb).apply(null,arguments)},s._OrtGetOutputCount=function(){return(s._OrtGetOutputCount=s.asm.cb).apply(null,arguments)},s._OrtGetInputName=function(){return(s._OrtGetInputName=s.asm.db).apply(null,arguments)},s._OrtGetOutputName=function(){return(s._OrtGetOutputName=s.asm.eb).apply(null,arguments)},s._OrtFree=function(){return(s._OrtFree=s.asm.fb).apply(null,arguments)},s._OrtCreateTensor=function(){return(s._OrtCreateTensor=s.asm.gb).apply(null,arguments)},s._OrtGetTensorData=function(){return(s._OrtGetTensorData=s.asm.hb).apply(null,arguments)},s._OrtReleaseTensor=function(){return(s._OrtReleaseTensor=s.asm.ib).apply(null,arguments)},s._OrtCreateRunOptions=function(){return(s._OrtCreateRunOptions=s.asm.jb).apply(null,arguments)},s._OrtAddRunConfigEntry=function(){return(s._OrtAddRunConfigEntry=s.asm.kb).apply(null,arguments)},s._OrtReleaseRunOptions=function(){return(s._OrtReleaseRunOptions=s.asm.lb).apply(null,arguments)},s._OrtRun=function(){return(s._OrtRun=s.asm.mb).apply(null,arguments)},s._OrtEndProfiling=function(){return(s._OrtEndProfiling=s.asm.nb).apply(null,arguments)};var de=s._pthread_self=function(){return(de=s._pthread_self=s.asm.ob).apply(null,arguments)},he=s._malloc=function(){return(he=s._malloc=s.asm.pb).apply(null,arguments)},ge=s._free=function(){return(ge=s._free=s.asm.qb).apply(null,arguments)},be=s._fflush=function(){return(be=s._fflush=s.asm.rb).apply(null,arguments)};s.__emscripten_tls_init=function(){return(s.__emscripten_tls_init=s.asm.sb).apply(null,arguments)};var me=s.___funcs_on_exit=function(){return(me=s.___funcs_on_exit=s.asm.tb).apply(null,arguments)},ye=s.__emscripten_thread_init=function(){return(ye=s.__emscripten_thread_init=s.asm.vb).apply(null,arguments)};s.__emscripten_thread_crashed=function(){return(s.__emscripten_thread_crashed=s.asm.wb).apply(null,arguments)};var _e,ve=s._emscripten_run_in_main_runtime_thread_js=function(){return(ve=s._emscripten_run_in_main_runtime_thread_js=s.asm.xb).apply(null,arguments)},we=s.__emscripten_proxy_execute_task_queue=function(){return(we=s.__emscripten_proxy_execute_task_queue=s.asm.yb).apply(null,arguments)},xe=s.__emscripten_thread_free_data=function(){return(xe=s.__emscripten_thread_free_data=s.asm.zb).apply(null,arguments)},Te=s.__emscripten_thread_exit=function(){return(Te=s.__emscripten_thread_exit=s.asm.Ab).apply(null,arguments)},Se=s._setThrew=function(){return(Se=s._setThrew=s.asm.Bb).apply(null,arguments)},Oe=s._emscripten_stack_set_limits=function(){return(Oe=s._emscripten_stack_set_limits=s.asm.Cb).apply(null,arguments)},Ae=s.stackSave=function(){return(Ae=s.stackSave=s.asm.Db).apply(null,arguments)},Ee=s.stackRestore=function(){return(Ee=s.stackRestore=s.asm.Eb).apply(null,arguments)},Ie=s.stackAlloc=function(){return(Ie=s.stackAlloc=s.asm.Fb).apply(null,arguments)},Pe=s.___cxa_can_catch=function(){return(Pe=s.___cxa_can_catch=s.asm.Gb).apply(null,arguments)},De=s.___cxa_is_pointer_type=function(){return(De=s.___cxa_is_pointer_type=s.asm.Hb).apply(null,arguments)},$e=s.dynCall_j=function(){return($e=s.dynCall_j=s.asm.Ib).apply(null,arguments)},ke=s.dynCall_iiiiij=function(){return(ke=s.dynCall_iiiiij=s.asm.Jb).apply(null,arguments)},Ce=s.dynCall_jii=function(){return(Ce=s.dynCall_jii=s.asm.Kb).apply(null,arguments)},Fe=s.dynCall_viiiiij=function(){return(Fe=s.dynCall_viiiiij=s.asm.Lb).apply(null,arguments)},Ne=s.dynCall_vjji=function(){return(Ne=s.dynCall_vjji=s.asm.Mb).apply(null,arguments)},Le=s.dynCall_viiijjjii=function(){return(Le=s.dynCall_viiijjjii=s.asm.Nb).apply(null,arguments)},Re=s.dynCall_iij=function(){return(Re=s.dynCall_iij=s.asm.Ob).apply(null,arguments)},je=s.dynCall_ji=function(){return(je=s.dynCall_ji=s.asm.Pb).apply(null,arguments)},Me=s.dynCall_iiiiiij=function(){return(Me=s.dynCall_iiiiiij=s.asm.Qb).apply(null,arguments)},Ue=s.dynCall_iiij=function(){return(Ue=s.dynCall_iiij=s.asm.Rb).apply(null,arguments)};function Ve(){function t$2(){if(!_e&&(_e=!0,s.calledRun=!0,!M)&&(x||ht(Y),u(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),!x)){if(s.postRun)for(typeof s.postRun==`function`&&(s.postRun=[s.postRun]);s.postRun.length;){var t$3=s.postRun.shift();Z.unshift(t$3)}ht(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir=typeof document<`u`&&document.currentScript?document.currentScript.src:void 0)||`/index.js`,function(t$1){var e$1,r$1,i;t$1||={},e$1||=t$1===void 0?{}:t$1,e$1.ready=new Promise(function(t$2,e$2){r$1=t$2,i=e$2});var o,a,s,u,c,l,p$1=Object.assign({},e$1),f=`./this.program`,d=(t$2,e$2)=>{throw e$2},h=typeof window==`object`,g=typeof importScripts==`function`,b=typeof process==`object`&&typeof process.versions==`object`&&typeof process.versions.node==`string`,m=``;b?(m=g?n(908).dirname(m)+`/`:`//`,l=()=>{c||(u=n(1384),c=n(908))},o=function(t$2,e$2){return l(),t$2=c.normalize(t$2),u.readFileSync(t$2,e$2?void 0:`utf8`)},s=t$2=>((t$2=o(t$2,!0)).buffer||(t$2=new Uint8Array(t$2)),t$2),a=(t$2,e$2,n$1)=>{l(),t$2=c.normalize(t$2),u.readFile(t$2,function(t$3,r$2){t$3?n$1(t$3):e$2(r$2.buffer)})},1{if(w||0{var e$2=new XMLHttpRequest;return e$2.open(`GET`,t$2,!1),e$2.send(null),e$2.responseText},g&&(s=t$2=>{var e$2=new XMLHttpRequest;return e$2.open(`GET`,t$2,!1),e$2.responseType=`arraybuffer`,e$2.send(null),new Uint8Array(e$2.response)}),a=(t$2,e$2,n$1)=>{var r$2=new XMLHttpRequest;r$2.open(`GET`,t$2,!0),r$2.responseType=`arraybuffer`,r$2.onload=()=>{r$2.status==200||r$2.status==0&&r$2.response?e$2(r$2.response):n$1()},r$2.onerror=n$1,r$2.send(null)});var y,_=e$1.print||console.log.bind(console),v=e$1.printErr||console.warn.bind(console);Object.assign(e$1,p$1),p$1=null,e$1.thisProgram&&(f=e$1.thisProgram),e$1.quit&&(d=e$1.quit),e$1.wasmBinary&&(y=e$1.wasmBinary);var w=e$1.noExitRuntime||!1;typeof WebAssembly!=`object`&&W(`no native wasm support detected`);var x,T,S,O,A,E,I=!1,P=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function D(t$2,e$2,n$1){var r$2=(e$2>>>=0)+n$1;for(n$1=e$2;t$2[n$1]&&!(n$1>=r$2);)++n$1;if(16(i$1=(240&i$1)==224?(15&i$1)<<12|o$1<<6|a$1:(7&i$1)<<18|o$1<<12|a$1<<6|63&t$2[e$2++])?r$2+=String.fromCharCode(i$1):(i$1-=65536,r$2+=String.fromCharCode(55296|i$1>>10,56320|1023&i$1))}}else r$2+=String.fromCharCode(i$1)}return r$2}function $(t$2,e$2){return(t$2>>>=0)?D(O,t$2,e$2):``}function k(t$2,e$2,n$1,r$2){if(!(0>>=0;r$2=n$1+r$2-1;for(var o$1=0;o$1=a$1&&(a$1=65536+((1023&a$1)<<10)|1023&t$2.charCodeAt(++o$1)),127>=a$1){if(n$1>=r$2)break;e$2[n$1++>>>0]=a$1}else{if(2047>=a$1){if(n$1+1>=r$2)break;e$2[n$1++>>>0]=192|a$1>>6}else{if(65535>=a$1){if(n$1+2>=r$2)break;e$2[n$1++>>>0]=224|a$1>>12}else{if(n$1+3>=r$2)break;e$2[n$1++>>>0]=240|a$1>>18,e$2[n$1++>>>0]=128|a$1>>12&63}e$2[n$1++>>>0]=128|a$1>>6&63}e$2[n$1++>>>0]=128|63&a$1}}return e$2[n$1>>>0]=0,n$1-i$1}function C(t$2){for(var e$2=0,n$1=0;n$1=r$2?e$2++:2047>=r$2?e$2+=2:55296<=r$2&&57343>=r$2?(e$2+=4,++n$1):e$2+=3}return e$2}function F(){var t$2=x.buffer;T=t$2,e$1.HEAP8=S=new Int8Array(t$2),e$1.HEAP16=new Int16Array(t$2),e$1.HEAP32=A=new Int32Array(t$2),e$1.HEAPU8=O=new Uint8Array(t$2),e$1.HEAPU16=new Uint16Array(t$2),e$1.HEAPU32=E=new Uint32Array(t$2),e$1.HEAPF32=new Float32Array(t$2),e$1.HEAPF64=new Float64Array(t$2)}var N,L=[],R=[],j=[],M=[],U=0;function V(){var t$2=e$1.preRun.shift();L.unshift(t$2)}var B,z=0,G=null,H=null;function W(t$2){throw e$1.onAbort&&e$1.onAbort(t$2),v(t$2=`Aborted(`+t$2+`)`),I=!0,t$2=new WebAssembly.RuntimeError(t$2+`. Build with -sASSERTIONS for more info.`),i(t$2),t$2}function q(){return B.startsWith(`data:application/octet-stream;base64,`)}if(B=`ort-wasm.wasm`,!q()){var X=B;B=e$1.locateFile?e$1.locateFile(X,m):m+X}function Y(){var t$2=B;try{if(t$2==B&&y)return new Uint8Array(y);if(s)return s(t$2);throw`both async and sync fetching of the wasm failed`}catch(t$3){W(t$3)}}function K(t$2){this.name=`ExitStatus`,this.message=`Program terminated with exit(`+t$2+`)`,this.status=t$2}function Z(t$2){for(;0>2>>>0]=t$3},this.Eb=function(){return E[this.zb+4>>2>>>0]},this.Sb=function(t$3){E[this.zb+8>>2>>>0]=t$3},this.Wb=function(){return E[this.zb+8>>2>>>0]},this.Tb=function(){A[this.zb>>2>>>0]=0},this.Ib=function(t$3){S[this.zb+12>>0>>>0]=t$3?1:0},this.Pb=function(){return S[this.zb+12>>0>>>0]!=0},this.Jb=function(t$3){S[this.zb+13>>0>>>0]=t$3?1:0},this.Lb=function(){return S[this.zb+13>>0>>>0]!=0},this.Rb=function(t$3,e$2){this.Fb(0),this.Ub(t$3),this.Sb(e$2),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){A[this.zb>>2>>>0]+=1},this.Xb=function(){var t$3=A[this.zb>>2>>>0];return A[this.zb>>2>>>0]=t$3-1,t$3===1},this.Fb=function(t$3){E[this.zb+16>>2>>>0]=t$3},this.Ob=function(){return E[this.zb+16>>2>>>0]},this.Qb=function(){if(Et(this.Eb()))return E[this.Db>>2>>>0];var t$3=this.Ob();return t$3===0?this.Db:t$3}}function nt(t$2){return _t(new et(t$2).zb)}var rt=[];function it(t$2){var e$2=rt[t$2];return e$2||(t$2>=rt.length&&(rt.length=t$2+1),rt[t$2]=e$2=N.get(t$2)),e$2}function ot(t$2){var e$2=C(t$2)+1,n$1=yt(e$2);return n$1&&k(t$2,S,n$1,e$2),n$1}var at={};function st(){if(!ut){var t$2,e$2={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:f||`./this.program`};for(t$2 in at)at[t$2]===void 0?delete e$2[t$2]:e$2[t$2]=at[t$2];var n$1=[];for(t$2 in e$2)n$1.push(t$2+`=`+e$2[t$2]);ut=n$1}return ut}var ut,ct=[null,[],[]];function lt(t$2,e$2){var n$1=ct[t$2];e$2===0||e$2===10?((t$2===1?_:v)(D(n$1,0)),n$1.length=0):n$1.push(e$2)}var pt=0;function ft(t$2){return t$2%4==0&&(t$2%100!=0||t$2%400==0)}var dt$1=[31,29,31,30,31,30,31,31,30,31,30,31],ht=[31,28,31,30,31,30,31,31,30,31,30,31];function gt(t$2,e$2,n$1,r$2){function i$1(t$3,e$3,n$2){for(t$3=typeof t$3==`number`?t$3.toString():t$3||``;t$3.lengtht$4?-1:0r$3-t$3.getDate())){t$3.setDate(t$3.getDate()+e$3);break}e$3-=r$3-t$3.getDate()+1,t$3.setDate(1),11>n$2?t$3.setMonth(n$2+1):(t$3.setMonth(0),t$3.setFullYear(t$3.getFullYear()+1))}return n$2=new Date(t$3.getFullYear()+1,0,4),e$3=s$1(new Date(t$3.getFullYear(),0,4)),n$2=s$1(n$2),0>=a$1(e$3,t$3)?0>=a$1(n$2,t$3)?t$3.getFullYear()+1:t$3.getFullYear():t$3.getFullYear()-1}var c$1=A[r$2+40>>2>>>0];for(var l$1 in r$2={$b:A[r$2>>2>>>0],Zb:A[r$2+4>>2>>>0],Gb:A[r$2+8>>2>>>0],Kb:A[r$2+12>>2>>>0],Hb:A[r$2+16>>2>>>0],Cb:A[r$2+20>>2>>>0],Ab:A[r$2+24>>2>>>0],Bb:A[r$2+28>>2>>>0],bc:A[r$2+32>>2>>>0],Yb:A[r$2+36>>2>>>0],ac:c$1?$(c$1):``},n$1=$(n$1),c$1={"%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$1=n$1.replace(new RegExp(l$1,`g`),c$1[l$1]);var p$2=`Sunday Monday Tuesday Wednesday Thursday Friday Saturday`.split(` `),f$1=`January February March April May June July August September October November December`.split(` `);for(l$1 in c$1={"%a":function(t$3){return p$2[t$3.Ab].substring(0,3)},"%A":function(t$3){return p$2[t$3.Ab]},"%b":function(t$3){return f$1[t$3.Hb].substring(0,3)},"%B":function(t$3){return f$1[t$3.Hb]},"%C":function(t$3){return o$1((t$3.Cb+1900)/100|0,2)},"%d":function(t$3){return o$1(t$3.Kb,2)},"%e":function(t$3){return i$1(t$3.Kb,2,` `)},"%g":function(t$3){return u$1(t$3).toString().substring(2)},"%G":function(t$3){return u$1(t$3)},"%H":function(t$3){return o$1(t$3.Gb,2)},"%I":function(t$3){return(t$3=t$3.Gb)==0?t$3=12:12t$3.Gb?`AM`:`PM`},"%S":function(t$3){return o$1(t$3.$b,2)},"%t":function(){return` `},"%u":function(t$3){return t$3.Ab||7},"%U":function(t$3){return o$1(Math.floor((t$3.Bb+7-t$3.Ab)/7),2)},"%V":function(t$3){var e$3=Math.floor((t$3.Bb+7-(t$3.Ab+6)%7)/7);if(2>=(t$3.Ab+371-t$3.Bb-2)%7&&e$3++,e$3)e$3==53&&((n$2=(t$3.Ab+371-t$3.Bb)%7)==4||n$2==3&&ft(t$3.Cb)||(e$3=1));else{e$3=52;var n$2=(t$3.Ab+7-t$3.Bb-1)%7;(n$2==4||n$2==5&&ft(t$3.Cb%400-1))&&e$3++}return o$1(e$3,2)},"%w":function(t$3){return t$3.Ab},"%W":function(t$3){return o$1(Math.floor((t$3.Bb+7-(t$3.Ab+6)%7)/7),2)},"%y":function(t$3){return(t$3.Cb+1900).toString().substring(2)},"%Y":function(t$3){return t$3.Cb+1900},"%z":function(t$3){var e$3=0<=(t$3=t$3.Yb);return t$3=Math.abs(t$3)/60,(e$3?`+`:`-`)+String(`0000`+(t$3/60*100+t$3%60)).slice(-4)},"%Z":function(t$3){return t$3.ac},"%%":function(){return`%`}},n$1=n$1.replace(/%%/g,`\0\0`),c$1)n$1.includes(l$1)&&(n$1=n$1.replace(new RegExp(l$1,`g`),c$1[l$1](r$2)));return l$1=function(t$3){var e$3=Array(C(t$3)+1);return k(t$3,e$3,0,e$3.length),e$3}(n$1=n$1.replace(/\0\0/g,`%`)),l$1.length>e$2?0:(S.set(l$1,t$2>>>0),l$1.length-1)}var bt={a:function(t$2){return yt(t$2+24)+24},m:function(t$2){return(t$2=new et(t$2)).Pb()||(t$2.Ib(!0),Q--),t$2.Jb(!1),J.push(t$2),t$2.Nb(),t$2.Qb()},ia:function(t$2){throw v(`Unexpected exception thrown, this is not properly supported - aborting`),I=!0,t$2},w:function(){xt(0);var t$2=J.pop();if(t$2.Xb()&&!t$2.Lb()){var e$2=t$2.Wb();e$2&&it(e$2)(t$2.Db),nt(t$2.Db)}tt=0},d:function(){var t$2=tt;if(!t$2)return pt=0;var e$2=new et(t$2);e$2.Fb(t$2);var n$1=e$2.Eb();if(!n$1)return pt=0,t$2;for(var r$2=Array.prototype.slice.call(arguments),i$1=0;i$1>>2]+4294967296*A[t$2+4>>>2])),A[e$2>>2>>>0]=t$2.getUTCSeconds(),A[e$2+4>>2>>>0]=t$2.getUTCMinutes(),A[e$2+8>>2>>>0]=t$2.getUTCHours(),A[e$2+12>>2>>>0]=t$2.getUTCDate(),A[e$2+16>>2>>>0]=t$2.getUTCMonth(),A[e$2+20>>2>>>0]=t$2.getUTCFullYear()-1900,A[e$2+24>>2>>>0]=t$2.getUTCDay(),A[e$2+28>>2>>>0]=(t$2.getTime()-Date.UTC(t$2.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t$2,e$2){t$2=new Date(1e3*(E[t$2>>>2]+4294967296*A[t$2+4>>>2])),A[e$2>>2>>>0]=t$2.getSeconds(),A[e$2+4>>2>>>0]=t$2.getMinutes(),A[e$2+8>>2>>>0]=t$2.getHours(),A[e$2+12>>2>>>0]=t$2.getDate(),A[e$2+16>>2>>>0]=t$2.getMonth(),A[e$2+20>>2>>>0]=t$2.getFullYear()-1900,A[e$2+24>>2>>>0]=t$2.getDay();var n$1=new Date(t$2.getFullYear(),0,1);A[e$2+28>>2>>>0]=(t$2.getTime()-n$1.getTime())/864e5|0,A[e$2+36>>2>>>0]=-60*t$2.getTimezoneOffset();var r$2=new Date(t$2.getFullYear(),6,1).getTimezoneOffset();n$1=n$1.getTimezoneOffset(),A[e$2+32>>2>>>0]=0|(r$2!=n$1&&t$2.getTimezoneOffset()==Math.min(n$1,r$2))},Fa:function(t$2){var e$2=new Date(A[t$2+20>>2>>>0]+1900,A[t$2+16>>2>>>0],A[t$2+12>>2>>>0],A[t$2+8>>2>>>0],A[t$2+4>>2>>>0],A[t$2>>2>>>0],0),n$1=A[t$2+32>>2>>>0],r$2=e$2.getTimezoneOffset(),i$1=new Date(e$2.getFullYear(),0,1),o$1=new Date(e$2.getFullYear(),6,1).getTimezoneOffset(),a$1=i$1.getTimezoneOffset(),s$1=Math.min(a$1,o$1);return 0>n$1?A[t$2+32>>2>>>0]=Number(o$1!=a$1&&s$1==r$2):0>2>>>0]=e$2.getDay(),A[t$2+28>>2>>>0]=(e$2.getTime()-i$1.getTime())/864e5|0,A[t$2>>2>>>0]=e$2.getSeconds(),A[t$2+4>>2>>>0]=e$2.getMinutes(),A[t$2+8>>2>>>0]=e$2.getHours(),A[t$2+12>>2>>>0]=e$2.getDate(),A[t$2+16>>2>>>0]=e$2.getMonth(),e$2.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t$2(e$2,n$1,r$2){t$2.Vb||(t$2.Vb=!0,function(t$3,e$3,n$2){function r$3(t$4){return(t$4=t$4.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t$4[1]:`GMT`}var i$1=new Date().getFullYear(),o$1=new Date(i$1,0,1),a$1=new Date(i$1,6,1);i$1=o$1.getTimezoneOffset();var s$1=a$1.getTimezoneOffset();A[t$3>>2>>>0]=60*Math.max(i$1,s$1),A[e$3>>2>>>0]=Number(i$1!=s$1),t$3=r$3(o$1),e$3=r$3(a$1),t$3=ot(t$3),e$3=ot(e$3),s$1>2>>>0]=t$3,E[n$2+4>>2>>>0]=e$3):(E[n$2>>2>>>0]=e$3,E[n$2+4>>2>>>0]=t$3)}(e$2,n$1,r$2))},B:function(){W(``)},ma:function(){return 4294901760},I:b?()=>{var t$2=process.hrtime();return 1e3*t$2[0]+t$2[1]/1e6}:()=>performance.now(),xa:function(t$2,e$2,n$1){O.copyWithin(t$2>>>0,e$2>>>0,e$2+n$1>>>0)},G:function(t$2){var e$2=O.length;if(4294901760<(t$2>>>=0))return!1;for(var n$1=1;4>=n$1;n$1*=2){var r$2=e$2*(1+.2/n$1);r$2=Math.min(r$2,t$2+100663296);var i$1=Math;r$2=Math.max(t$2,r$2),i$1=i$1.min.call(i$1,4294901760,r$2+(65536-r$2%65536)%65536);t:{try{x.grow(i$1-T.byteLength+65535>>>16),F();var o$1=1;break t}catch{}o$1=void 0}if(o$1)return!0}return!1},va:function(t$2,e$2){var n$1=0;return st().forEach(function(r$2,i$1){var o$1=e$2+n$1;for(i$1=E[t$2+4*i$1>>2>>>0]=o$1,o$1=0;o$1>0>>>0]=r$2.charCodeAt(o$1);S[i$1>>0>>>0]=0,n$1+=r$2.length+1}),0},wa:function(t$2,e$2){var n$1=st();E[t$2>>2>>>0]=n$1.length;var r$2=0;return n$1.forEach(function(t$3){r$2+=t$3.length+1}),E[e$2>>2>>>0]=r$2,0},ba:function(t$2){w||0>2>>>0],s$1=E[e$2+4>>2>>>0];e$2+=8;for(var u$1=0;u$1>>0]);i$1+=s$1}return E[r$2>>2>>>0]=i$1,0},c:function(){return pt},ja:function t$2(e$2,r$2){t$2.Mb||=function(){if(typeof crypto==`object`&&typeof crypto.getRandomValues==`function`){var t$3=new Uint8Array(1);return()=>(crypto.getRandomValues(t$3),t$3[0])}if(b)try{var e$3=n(Object(function(){var t$4=Error(`Cannot find module 'crypto'`);throw t$4.code=`MODULE_NOT_FOUND`,t$4}()));return()=>e$3.randomBytes(1)[0]}catch{}return()=>W(`randomDevice`)}();for(var i$1=0;i$1>0>>>0]=t$2.Mb();return 0},ea:function(t$2,e$2,n$1){var r$2=Tt();try{return it(t$2)(e$2,n$1)}catch(t$3){if(St(r$2),t$3!==t$3+0)throw t$3;xt(1,0)}},fa:function(t$2,e$2,n$1){var r$2=Tt();try{return it(t$2)(e$2,n$1)}catch(t$3){if(St(r$2),t$3!==t$3+0)throw t$3;xt(1,0)}},J:function(t$2){var e$2=Tt();try{return it(t$2)()}catch(t$3){if(St(e$2),t$3!==t$3+0)throw t$3;xt(1,0)}},e:function(t$2,e$2){var n$1=Tt();try{return it(t$2)(e$2)}catch(t$3){if(St(n$1),t$3!==t$3+0)throw t$3;xt(1,0)}},N:function(t$2,e$2,n$1){var r$2=Tt();try{return it(t$2)(e$2,n$1)}catch(t$3){if(St(r$2),t$3!==t$3+0)throw t$3;xt(1,0)}},O:function(t$2,e$2,n$1){var r$2=Tt();try{return it(t$2)(e$2,n$1)}catch(t$3){if(St(r$2),t$3!==t$3+0)throw t$3;xt(1,0)}},j:function(t$2,e$2,n$1){var r$2=Tt();try{return it(t$2)(e$2,n$1)}catch(t$3){if(St(r$2),t$3!==t$3+0)throw t$3;xt(1,0)}},o:function(t$2,e$2,n$1,r$2){var i$1=Tt();try{return it(t$2)(e$2,n$1,r$2)}catch(t$3){if(St(i$1),t$3!==t$3+0)throw t$3;xt(1,0)}},p:function(t$2,e$2,n$1,r$2,i$1){var o$1=Tt();try{return it(t$2)(e$2,n$1,r$2,i$1)}catch(t$3){if(St(o$1),t$3!==t$3+0)throw t$3;xt(1,0)}},M:function(t$2,e$2,n$1,r$2,i$1,o$1){var a$1=Tt();try{return it(t$2)(e$2,n$1,r$2,i$1,o$1)}catch(t$3){if(St(a$1),t$3!==t$3+0)throw t$3;xt(1,0)}},r:function(t$2,e$2,n$1,r$2,i$1,o$1){var a$1=Tt();try{return it(t$2)(e$2,n$1,r$2,i$1,o$1)}catch(t$3){if(St(a$1),t$3!==t$3+0)throw t$3;xt(1,0)}},v:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1){var s$1=Tt();try{return it(t$2)(e$2,n$1,r$2,i$1,o$1,a$1)}catch(t$3){if(St(s$1),t$3!==t$3+0)throw t$3;xt(1,0)}},K:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1){var u$1=Tt();try{return it(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1)}catch(t$3){if(St(u$1),t$3!==t$3+0)throw t$3;xt(1,0)}},D:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2){var f$1=Tt();try{return it(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2)}catch(t$3){if(St(f$1),t$3!==t$3+0)throw t$3;xt(1,0)}},X:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1){var u$1=Tt();try{return Lt(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1)}catch(t$3){if(St(u$1),t$3!==t$3+0)throw t$3;xt(1,0)}},V:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1){var s$1=Tt();try{return Pt(t$2,e$2,n$1,r$2,i$1,o$1,a$1)}catch(t$3){if(St(s$1),t$3!==t$3+0)throw t$3;xt(1,0)}},U:function(t$2,e$2,n$1,r$2,i$1){var o$1=Tt();try{return Rt(t$2,e$2,n$1,r$2,i$1)}catch(t$3){if(St(o$1),t$3!==t$3+0)throw t$3;xt(1,0)}},Z:function(t$2,e$2,n$1,r$2){var i$1=Tt();try{return Ft(t$2,e$2,n$1,r$2)}catch(t$3){if(St(i$1),t$3!==t$3+0)throw t$3;xt(1,0)}},W:function(t$2){var e$2=Tt();try{return It(t$2)}catch(t$3){if(St(e$2),t$3!==t$3+0)throw t$3;xt(1,0)}},Y:function(t$2,e$2){var n$1=Tt();try{return Nt(t$2,e$2)}catch(t$3){if(St(n$1),t$3!==t$3+0)throw t$3;xt(1,0)}},T:function(t$2,e$2,n$1){var r$2=Tt();try{return Dt(t$2,e$2,n$1)}catch(t$3){if(St(r$2),t$3!==t$3+0)throw t$3;xt(1,0)}},f:function(t$2){var e$2=Tt();try{it(t$2)()}catch(t$3){if(St(e$2),t$3!==t$3+0)throw t$3;xt(1,0)}},q:function(t$2,e$2){var n$1=Tt();try{it(t$2)(e$2)}catch(t$3){if(St(n$1),t$3!==t$3+0)throw t$3;xt(1,0)}},h:function(t$2,e$2,n$1){var r$2=Tt();try{it(t$2)(e$2,n$1)}catch(t$3){if(St(r$2),t$3!==t$3+0)throw t$3;xt(1,0)}},da:function(t$2,e$2,n$1,r$2){var i$1=Tt();try{it(t$2)(e$2,n$1,r$2)}catch(t$3){if(St(i$1),t$3!==t$3+0)throw t$3;xt(1,0)}},l:function(t$2,e$2,n$1,r$2){var i$1=Tt();try{it(t$2)(e$2,n$1,r$2)}catch(t$3){if(St(i$1),t$3!==t$3+0)throw t$3;xt(1,0)}},t:function(t$2,e$2,n$1,r$2,i$1){var o$1=Tt();try{it(t$2)(e$2,n$1,r$2,i$1)}catch(t$3){if(St(o$1),t$3!==t$3+0)throw t$3;xt(1,0)}},u:function(t$2,e$2,n$1,r$2,i$1,o$1){var a$1=Tt();try{it(t$2)(e$2,n$1,r$2,i$1,o$1)}catch(t$3){if(St(a$1),t$3!==t$3+0)throw t$3;xt(1,0)}},x:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1){var s$1=Tt();try{it(t$2)(e$2,n$1,r$2,i$1,o$1,a$1)}catch(t$3){if(St(s$1),t$3!==t$3+0)throw t$3;xt(1,0)}},z:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1){var u$1=Tt();try{it(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1)}catch(t$3){if(St(u$1),t$3!==t$3+0)throw t$3;xt(1,0)}},ga:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1){var c$1=Tt();try{it(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1)}catch(t$3){if(St(c$1),t$3!==t$3+0)throw t$3;xt(1,0)}},A:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1){var p$2=Tt();try{it(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1)}catch(t$3){if(St(p$2),t$3!==t$3+0)throw t$3;xt(1,0)}},C:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2,f$1,d$1,h$1,g$1){var b$1=Tt();try{it(t$2)(e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2,f$1,d$1,h$1,g$1)}catch(t$3){if(St(b$1),t$3!==t$3+0)throw t$3;xt(1,0)}},aa:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1){var u$1=Tt();try{$t(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1)}catch(t$3){if(St(u$1),t$3!==t$3+0)throw t$3;xt(1,0)}},_:function(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2){var f$1=Tt();try{Ct(t$2,e$2,n$1,r$2,i$1,o$1,a$1,s$1,u$1,c$1,l$1,p$2)}catch(t$3){if(St(f$1),t$3!==t$3+0)throw t$3;xt(1,0)}},$:function(t$2,e$2,n$1,r$2,i$1,o$1){var a$1=Tt();try{kt(t$2,e$2,n$1,r$2,i$1,o$1)}catch(t$3){if(St(a$1),t$3!==t$3+0)throw t$3;xt(1,0)}},n:function(t$2){return t$2},F:function(t$2){pt=t$2},ha:gt,y:function(t$2,e$2,n$1,r$2){return gt(t$2,e$2,n$1,r$2)}};(function(){function t$2(t$3){e$1.asm=t$3.exports,x=e$1.asm.Ka,F(),N=e$1.asm.ib,R.unshift(e$1.asm.La),z--,e$1.monitorRunDependencies&&e$1.monitorRunDependencies(z),z==0&&(G!==null&&(clearInterval(G),G=null),H&&(t$3=H,H=null,t$3()))}function n$1(e$2){t$2(e$2.instance)}function r$2(t$3){return function(){if(!y&&(h||g)){if(typeof fetch==`function`&&!B.startsWith(`file://`))return fetch(B,{credentials:`same-origin`}).then(function(t$4){if(!t$4.ok)throw`failed to load wasm binary file at '`+B+`'`;return t$4.arrayBuffer()}).catch(function(){return Y()});if(a)return new Promise(function(t$4,e$2){a(B,function(e$3){t$4(new Uint8Array(e$3))},e$2)})}return Promise.resolve().then(function(){return Y()})}().then(function(t$4){return WebAssembly.instantiate(t$4,o$1)}).then(function(t$4){return t$4}).then(t$3,function(t$4){v(`failed to asynchronously prepare wasm: `+t$4),W(t$4)})}var o$1={a:bt};if(z++,e$1.monitorRunDependencies&&e$1.monitorRunDependencies(z),e$1.instantiateWasm)try{return e$1.instantiateWasm(o$1,t$2)}catch(t$3){return v(`Module.instantiateWasm callback failed with error: `+t$3),!1}(y||typeof WebAssembly.instantiateStreaming!=`function`||q()||B.startsWith(`file://`)||b||typeof fetch!=`function`?r$2(n$1):fetch(B,{credentials:`same-origin`}).then(function(t$3){return WebAssembly.instantiateStreaming(t$3,o$1).then(n$1,function(t$4){return v(`wasm streaming compile failed: `+t$4),v(`falling back to ArrayBuffer instantiation`),r$2(n$1)})})).catch(i)})(),e$1.___wasm_call_ctors=function(){return(e$1.___wasm_call_ctors=e$1.asm.La).apply(null,arguments)},e$1._OrtInit=function(){return(e$1._OrtInit=e$1.asm.Ma).apply(null,arguments)},e$1._OrtCreateSessionOptions=function(){return(e$1._OrtCreateSessionOptions=e$1.asm.Na).apply(null,arguments)},e$1._OrtAppendExecutionProvider=function(){return(e$1._OrtAppendExecutionProvider=e$1.asm.Oa).apply(null,arguments)},e$1._OrtAddSessionConfigEntry=function(){return(e$1._OrtAddSessionConfigEntry=e$1.asm.Pa).apply(null,arguments)},e$1._OrtReleaseSessionOptions=function(){return(e$1._OrtReleaseSessionOptions=e$1.asm.Qa).apply(null,arguments)},e$1._OrtCreateSession=function(){return(e$1._OrtCreateSession=e$1.asm.Ra).apply(null,arguments)},e$1._OrtReleaseSession=function(){return(e$1._OrtReleaseSession=e$1.asm.Sa).apply(null,arguments)},e$1._OrtGetInputCount=function(){return(e$1._OrtGetInputCount=e$1.asm.Ta).apply(null,arguments)},e$1._OrtGetOutputCount=function(){return(e$1._OrtGetOutputCount=e$1.asm.Ua).apply(null,arguments)},e$1._OrtGetInputName=function(){return(e$1._OrtGetInputName=e$1.asm.Va).apply(null,arguments)},e$1._OrtGetOutputName=function(){return(e$1._OrtGetOutputName=e$1.asm.Wa).apply(null,arguments)},e$1._OrtFree=function(){return(e$1._OrtFree=e$1.asm.Xa).apply(null,arguments)},e$1._OrtCreateTensor=function(){return(e$1._OrtCreateTensor=e$1.asm.Ya).apply(null,arguments)},e$1._OrtGetTensorData=function(){return(e$1._OrtGetTensorData=e$1.asm.Za).apply(null,arguments)},e$1._OrtReleaseTensor=function(){return(e$1._OrtReleaseTensor=e$1.asm._a).apply(null,arguments)},e$1._OrtCreateRunOptions=function(){return(e$1._OrtCreateRunOptions=e$1.asm.$a).apply(null,arguments)},e$1._OrtAddRunConfigEntry=function(){return(e$1._OrtAddRunConfigEntry=e$1.asm.ab).apply(null,arguments)},e$1._OrtReleaseRunOptions=function(){return(e$1._OrtReleaseRunOptions=e$1.asm.bb).apply(null,arguments)},e$1._OrtRun=function(){return(e$1._OrtRun=e$1.asm.cb).apply(null,arguments)},e$1._OrtEndProfiling=function(){return(e$1._OrtEndProfiling=e$1.asm.db).apply(null,arguments)};var mt,yt=e$1._malloc=function(){return(yt=e$1._malloc=e$1.asm.eb).apply(null,arguments)},_t=e$1._free=function(){return(_t=e$1._free=e$1.asm.fb).apply(null,arguments)},vt=e$1._fflush=function(){return(vt=e$1._fflush=e$1.asm.gb).apply(null,arguments)},wt=e$1.___funcs_on_exit=function(){return(wt=e$1.___funcs_on_exit=e$1.asm.hb).apply(null,arguments)},xt=e$1._setThrew=function(){return(xt=e$1._setThrew=e$1.asm.jb).apply(null,arguments)},Tt=e$1.stackSave=function(){return(Tt=e$1.stackSave=e$1.asm.kb).apply(null,arguments)},St=e$1.stackRestore=function(){return(St=e$1.stackRestore=e$1.asm.lb).apply(null,arguments)},Ot=e$1.stackAlloc=function(){return(Ot=e$1.stackAlloc=e$1.asm.mb).apply(null,arguments)},At=e$1.___cxa_can_catch=function(){return(At=e$1.___cxa_can_catch=e$1.asm.nb).apply(null,arguments)},Et=e$1.___cxa_is_pointer_type=function(){return(Et=e$1.___cxa_is_pointer_type=e$1.asm.ob).apply(null,arguments)},It=e$1.dynCall_j=function(){return(It=e$1.dynCall_j=e$1.asm.pb).apply(null,arguments)},Pt=e$1.dynCall_iiiiij=function(){return(Pt=e$1.dynCall_iiiiij=e$1.asm.qb).apply(null,arguments)},Dt=e$1.dynCall_jii=function(){return(Dt=e$1.dynCall_jii=e$1.asm.rb).apply(null,arguments)},$t=e$1.dynCall_viiiiij=function(){return($t=e$1.dynCall_viiiiij=e$1.asm.sb).apply(null,arguments)},kt=e$1.dynCall_vjji=function(){return(kt=e$1.dynCall_vjji=e$1.asm.tb).apply(null,arguments)},Ct=e$1.dynCall_viiijjjii=function(){return(Ct=e$1.dynCall_viiijjjii=e$1.asm.ub).apply(null,arguments)},Ft=e$1.dynCall_iij=function(){return(Ft=e$1.dynCall_iij=e$1.asm.vb).apply(null,arguments)},Nt=e$1.dynCall_ji=function(){return(Nt=e$1.dynCall_ji=e$1.asm.wb).apply(null,arguments)},Lt=e$1.dynCall_iiiiiij=function(){return(Lt=e$1.dynCall_iiiiiij=e$1.asm.xb).apply(null,arguments)},Rt=e$1.dynCall_iiij=function(){return(Rt=e$1.dynCall_iiij=e$1.asm.yb).apply(null,arguments)};function jt(){function t$2(){if(!mt&&(mt=!0,e$1.calledRun=!0,!I)){if(Z(R),r$1(e$1),e$1.onRuntimeInitialized&&e$1.onRuntimeInitialized(),e$1.postRun)for(typeof e$1.postRun==`function`&&(e$1.postRun=[e$1.postRun]);e$1.postRun.length;){var t$3=e$1.postRun.shift();M.unshift(t$3)}Z(M)}}if(!(0{"use strict";t.exports=function(t$1,e){for(var n=Array(arguments.length-1),r=0,i=2,o=!0;i{"use strict";var n=e;n.length=function(t$1){var e$1=t$1.length;if(!e$1)return 0;for(var n$1=0;--e$1%4>1&&t$1.charAt(e$1)===`=`;)++n$1;return Math.ceil(3*t$1.length)/4-n$1};for(var r=Array(64),i=Array(123),o=0;o<64;)i[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(t$1,e$1,n$1){for(var i$1,o$1=null,a$1=[],s=0,u=0;e$1>2],i$1=(3&c)<<4,u=1;break;case 1:a$1[s++]=r[i$1|c>>4],i$1=(15&c)<<2,u=2;break;case 2:a$1[s++]=r[i$1|c>>6],a$1[s++]=r[63&c],u=0}s>8191&&((o$1||=[]).push(String.fromCharCode.apply(String,a$1)),s=0)}return u&&(a$1[s++]=r[i$1],a$1[s++]=61,u===1&&(a$1[s++]=61)),o$1?(s&&o$1.push(String.fromCharCode.apply(String,a$1.slice(0,s))),o$1.join(``)):String.fromCharCode.apply(String,a$1.slice(0,s))};var a=`invalid encoding`;n.decode=function(t$1,e$1,n$1){for(var r$1,o$1=n$1,s=0,u=0;u1)break;if((c=i[c])===void 0)throw Error(a);switch(s){case 0:r$1=c,s=1;break;case 1:e$1[n$1++]=r$1<<2|(48&c)>>4,r$1=c,s=2;break;case 2:e$1[n$1++]=(15&r$1)<<4|(60&c)>>2,r$1=c,s=3;break;case 3:e$1[n$1++]=(3&r$1)<<6|c,s=0}}if(s===1)throw Error(a);return n$1-o$1},n.test=function(t$1){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t$1)}},9211:t=>{"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t$1,e$1,n){return(this._listeners[t$1]||(this._listeners[t$1]=[])).push({fn:e$1,ctx:n||this}),this},e.prototype.off=function(t$1,e$1){if(t$1===void 0)this._listeners={};else if(e$1===void 0)this._listeners[t$1]=[];else for(var n=this._listeners[t$1],r=0;r{"use strict";function e(t$1){return typeof Float32Array<`u`?function(){var e$1=new Float32Array([-0]),n$1=new Uint8Array(e$1.buffer),r$1=n$1[3]===128;function i$1(t$2,r$2,i$2){e$1[0]=t$2,r$2[i$2]=n$1[0],r$2[i$2+1]=n$1[1],r$2[i$2+2]=n$1[2],r$2[i$2+3]=n$1[3]}function o$1(t$2,r$2,i$2){e$1[0]=t$2,r$2[i$2]=n$1[3],r$2[i$2+1]=n$1[2],r$2[i$2+2]=n$1[1],r$2[i$2+3]=n$1[0]}function a(t$2,r$2){return n$1[0]=t$2[r$2],n$1[1]=t$2[r$2+1],n$1[2]=t$2[r$2+2],n$1[3]=t$2[r$2+3],e$1[0]}function s(t$2,r$2){return n$1[3]=t$2[r$2],n$1[2]=t$2[r$2+1],n$1[1]=t$2[r$2+2],n$1[0]=t$2[r$2+3],e$1[0]}t$1.writeFloatLE=r$1?i$1:o$1,t$1.writeFloatBE=r$1?o$1:i$1,t$1.readFloatLE=r$1?a:s,t$1.readFloatBE=r$1?s:a}():function(){function e$1(t$2,e$2,n$1,r$1){var i$1=e$2<0?1:0;if(i$1&&(e$2=-e$2),e$2===0)t$2(1/e$2>0?0:2147483648,n$1,r$1);else if(isNaN(e$2))t$2(2143289344,n$1,r$1);else if(e$2>34028234663852886e22)t$2((i$1<<31|2139095040)>>>0,n$1,r$1);else if(e$2<11754943508222875e-54)t$2((i$1<<31|Math.round(e$2/1401298464324817e-60))>>>0,n$1,r$1);else{var o$1=Math.floor(Math.log(e$2)/Math.LN2);t$2((i$1<<31|o$1+127<<23|8388607&Math.round(e$2*2**-o$1*8388608))>>>0,n$1,r$1)}}function a(t$2,e$2,n$1){var r$1=t$2(e$2,n$1),i$1=2*(r$1>>31)+1,o$1=r$1>>>23&255,a$1=8388607&r$1;return o$1===255?a$1?NaN:i$1*(1/0):o$1===0?1401298464324817e-60*i$1*a$1:i$1*2**(o$1-150)*(a$1+8388608)}t$1.writeFloatLE=e$1.bind(null,n),t$1.writeFloatBE=e$1.bind(null,r),t$1.readFloatLE=a.bind(null,i),t$1.readFloatBE=a.bind(null,o)}(),typeof Float64Array<`u`?function(){var e$1=new Float64Array([-0]),n$1=new Uint8Array(e$1.buffer),r$1=n$1[7]===128;function i$1(t$2,r$2,i$2){e$1[0]=t$2,r$2[i$2]=n$1[0],r$2[i$2+1]=n$1[1],r$2[i$2+2]=n$1[2],r$2[i$2+3]=n$1[3],r$2[i$2+4]=n$1[4],r$2[i$2+5]=n$1[5],r$2[i$2+6]=n$1[6],r$2[i$2+7]=n$1[7]}function o$1(t$2,r$2,i$2){e$1[0]=t$2,r$2[i$2]=n$1[7],r$2[i$2+1]=n$1[6],r$2[i$2+2]=n$1[5],r$2[i$2+3]=n$1[4],r$2[i$2+4]=n$1[3],r$2[i$2+5]=n$1[2],r$2[i$2+6]=n$1[1],r$2[i$2+7]=n$1[0]}function a(t$2,r$2){return n$1[0]=t$2[r$2],n$1[1]=t$2[r$2+1],n$1[2]=t$2[r$2+2],n$1[3]=t$2[r$2+3],n$1[4]=t$2[r$2+4],n$1[5]=t$2[r$2+5],n$1[6]=t$2[r$2+6],n$1[7]=t$2[r$2+7],e$1[0]}function s(t$2,r$2){return n$1[7]=t$2[r$2],n$1[6]=t$2[r$2+1],n$1[5]=t$2[r$2+2],n$1[4]=t$2[r$2+3],n$1[3]=t$2[r$2+4],n$1[2]=t$2[r$2+5],n$1[1]=t$2[r$2+6],n$1[0]=t$2[r$2+7],e$1[0]}t$1.writeDoubleLE=r$1?i$1:o$1,t$1.writeDoubleBE=r$1?o$1:i$1,t$1.readDoubleLE=r$1?a:s,t$1.readDoubleBE=r$1?s:a}():function(){function e$1(t$2,e$2,n$1,r$1,i$1,o$1){var a$1=r$1<0?1:0;if(a$1&&(r$1=-r$1),r$1===0)t$2(0,i$1,o$1+e$2),t$2(1/r$1>0?0:2147483648,i$1,o$1+n$1);else if(isNaN(r$1))t$2(0,i$1,o$1+e$2),t$2(2146959360,i$1,o$1+n$1);else if(r$1>17976931348623157e292)t$2(0,i$1,o$1+e$2),t$2((a$1<<31|2146435072)>>>0,i$1,o$1+n$1);else{var s;if(r$1<22250738585072014e-324)t$2((s=r$1/5e-324)>>>0,i$1,o$1+e$2),t$2((a$1<<31|s/4294967296)>>>0,i$1,o$1+n$1);else{var u=Math.floor(Math.log(r$1)/Math.LN2);u===1024&&(u=1023),t$2(4503599627370496*(s=r$1*2**-u)>>>0,i$1,o$1+e$2),t$2((a$1<<31|u+1023<<20|1048576*s&1048575)>>>0,i$1,o$1+n$1)}}}function a(t$2,e$2,n$1,r$1,i$1){var o$1=t$2(r$1,i$1+e$2),a$1=t$2(r$1,i$1+n$1),s=2*(a$1>>31)+1,u=a$1>>>20&2047,c=4294967296*(1048575&a$1)+o$1;return u===2047?c?NaN:s*(1/0):u===0?5e-324*s*c:s*2**(u-1075)*(c+4503599627370496)}t$1.writeDoubleLE=e$1.bind(null,n,0,4),t$1.writeDoubleBE=e$1.bind(null,r,4,0),t$1.readDoubleLE=a.bind(null,i,0,4),t$1.readDoubleBE=a.bind(null,o,4,0)}(),t$1}function n(t$1,e$1,n$1){e$1[n$1]=255&t$1,e$1[n$1+1]=t$1>>>8&255,e$1[n$1+2]=t$1>>>16&255,e$1[n$1+3]=t$1>>>24}function r(t$1,e$1,n$1){e$1[n$1]=t$1>>>24,e$1[n$1+1]=t$1>>>16&255,e$1[n$1+2]=t$1>>>8&255,e$1[n$1+3]=255&t$1}function i(t$1,e$1){return(t$1[e$1]|t$1[e$1+1]<<8|t$1[e$1+2]<<16|t$1[e$1+3]<<24)>>>0}function o(t$1,e$1){return(t$1[e$1]<<24|t$1[e$1+1]<<16|t$1[e$1+2]<<8|t$1[e$1+3])>>>0}t.exports=e(e)},7199:module$1=>{"use strict";function inquire(moduleName){try{var mod=eval(`quire`.replace(/^/,`re`))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch{}return null}module$1.exports=inquire},6662:t=>{"use strict";t.exports=function(t$1,e,n){var r=n||8192,i=r>>>1,o=null,a=r;return function(n$1){if(n$1<1||n$1>i)return t$1(n$1);a+n$1>r&&(o=t$1(r),a=0);var s=e.call(o,a,a+=n$1);return 7&a&&(a=1+(7|a)),s}}},4997:(t,e)=>{"use strict";var n=e;n.length=function(t$1){for(var e$1=0,n$1=0,r=0;r191&&r<224?o[a++]=(31&r)<<6|63&t$1[e$1++]:r>239&&r<365?(r=((7&r)<<18|(63&t$1[e$1++])<<12|(63&t$1[e$1++])<<6|63&t$1[e$1++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&t$1[e$1++])<<6|63&t$1[e$1++],a>8191&&((i||=[]).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join(``)):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(t$1,e$1,n$1){for(var r,i,o=n$1,a=0;a>6|192,e$1[n$1++]=63&r|128):(64512&r)==55296&&(64512&(i=t$1.charCodeAt(a+1)))==56320?(r=65536+((1023&r)<<10)+(1023&i),++a,e$1[n$1++]=r>>18|240,e$1[n$1++]=r>>12&63|128,e$1[n$1++]=r>>6&63|128,e$1[n$1++]=63&r|128):(e$1[n$1++]=r>>12|224,e$1[n$1++]=r>>6&63|128,e$1[n$1++]=63&r|128);return n$1-o}},3442:(t,e)=>{"use strict";e.__esModule=!0;var n=function(){function t$1(e$1){if(!e$1)throw TypeError("Invalid argument; `value` has no value.");this.value=t$1.EMPTY,e$1&&t$1.isGuid(e$1)&&(this.value=e$1)}return t$1.isGuid=function(e$1){var n$1=e$1.toString();return e$1&&(e$1 instanceof t$1||t$1.validator.test(n$1))},t$1.create=function(){return new t$1([t$1.gen(2),t$1.gen(1),t$1.gen(1),t$1.gen(1),t$1.gen(3)].join(`-`))},t$1.createEmpty=function(){return new t$1(`emptyguid`)},t$1.parse=function(e$1){return new t$1(e$1)},t$1.raw=function(){return[t$1.gen(2),t$1.gen(1),t$1.gen(1),t$1.gen(1),t$1.gen(3)].join(`-`)},t$1.gen=function(t$2){for(var e$1=``,n$1=0;n$1{t.exports=n;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function n(t$1,e$1,n$1){this.low=0|t$1,this.high=0|e$1,this.unsigned=!!n$1}function r(t$1){return!0===(t$1&&t$1.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,`__isLong__`,{value:!0}),n.isLong=r;var i={},o={};function a(t$1,e$1){var n$1,r$1,a$1;return e$1?(a$1=0<=(t$1>>>=0)&&t$1<256)&&(r$1=o[t$1])?r$1:(n$1=u(t$1,(0|t$1)<0?-1:0,!0),a$1&&(o[t$1]=n$1),n$1):(a$1=-128<=(t$1|=0)&&t$1<128)&&(r$1=i[t$1])?r$1:(n$1=u(t$1,t$1<0?-1:0,!1),a$1&&(i[t$1]=n$1),n$1)}function s(t$1,e$1){if(isNaN(t$1))return e$1?m:b;if(e$1){if(t$1<0)return m;if(t$1>=d)return x}else{if(t$1<=-h)return T;if(t$1+1>=h)return w}return t$1<0?s(-t$1,e$1).neg():u(t$1%f|0,t$1/f|0,e$1)}function u(t$1,e$1,r$1){return new n(t$1,e$1,r$1)}n.fromInt=a,n.fromNumber=s,n.fromBits=u;var c=Math.pow;function l(t$1,e$1,n$1){if(t$1.length===0)throw Error(`empty string`);if(t$1===`NaN`||t$1===`Infinity`||t$1===`+Infinity`||t$1===`-Infinity`)return b;if(typeof e$1==`number`?(n$1=e$1,e$1=!1):e$1=!!e$1,(n$1||=10)<2||360)throw Error(`interior hyphen`);if(r$1===0)return l(t$1.substring(1),e$1,n$1).neg();for(var i$1=s(c(n$1,8)),o$1=b,a$1=0;a$1>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},S.toString=function(t$1){if((t$1||=10)<2||36>>0).toString(t$1);if((o$1=u$1).isZero())return l$1+a$1;for(;l$1.length<6;)l$1=`0`+l$1;a$1=``+l$1+a$1}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var t$1=this.high==0?this.low:this.high,e$1=31;e$1>0&&!(t$1&1<=0},S.isOdd=function(){return(1&this.low)==1},S.isEven=function(){return(1&this.low)==0},S.equals=function(t$1){return r(t$1)||(t$1=p$1(t$1)),(this.unsigned===t$1.unsigned||this.high>>>31!=1||t$1.high>>>31!=1)&&this.high===t$1.high&&this.low===t$1.low},S.eq=S.equals,S.notEquals=function(t$1){return!this.eq(t$1)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(t$1){return this.comp(t$1)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(t$1){return this.comp(t$1)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(t$1){return this.comp(t$1)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(t$1){return this.comp(t$1)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(t$1){if(r(t$1)||(t$1=p$1(t$1)),this.eq(t$1))return 0;var e$1=this.isNegative(),n$1=t$1.isNegative();return e$1&&!n$1?-1:!e$1&&n$1?1:this.unsigned?t$1.high>>>0>this.high>>>0||t$1.high===this.high&&t$1.low>>>0>this.low>>>0?-1:1:this.sub(t$1).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(y)},S.neg=S.negate,S.add=function(t$1){r(t$1)||(t$1=p$1(t$1));var e$1=this.high>>>16,n$1=65535&this.high,i$1=this.low>>>16,o$1=65535&this.low,a$1=t$1.high>>>16,s$1=65535&t$1.high,c$1=t$1.low>>>16,l$1=0,f$1=0,d$1=0,h$1=0;return d$1+=(h$1+=o$1+(65535&t$1.low))>>>16,f$1+=(d$1+=i$1+c$1)>>>16,l$1+=(f$1+=n$1+s$1)>>>16,l$1+=e$1+a$1,u((d$1&=65535)<<16|(h$1&=65535),(l$1&=65535)<<16|(f$1&=65535),this.unsigned)},S.subtract=function(t$1){return r(t$1)||(t$1=p$1(t$1)),this.add(t$1.neg())},S.sub=S.subtract,S.multiply=function(t$1){if(this.isZero())return b;if(r(t$1)||(t$1=p$1(t$1)),e)return u(e.mul(this.low,this.high,t$1.low,t$1.high),e.get_high(),this.unsigned);if(t$1.isZero())return b;if(this.eq(T))return t$1.isOdd()?T:b;if(t$1.eq(T))return this.isOdd()?T:b;if(this.isNegative())return t$1.isNegative()?this.neg().mul(t$1.neg()):this.neg().mul(t$1).neg();if(t$1.isNegative())return this.mul(t$1.neg()).neg();if(this.lt(g)&&t$1.lt(g))return s(this.toNumber()*t$1.toNumber(),this.unsigned);var n$1=this.high>>>16,i$1=65535&this.high,o$1=this.low>>>16,a$1=65535&this.low,c$1=t$1.high>>>16,l$1=65535&t$1.high,f$1=t$1.low>>>16,d$1=65535&t$1.low,h$1=0,m$1=0,y$1=0,_$1=0;return y$1+=(_$1+=a$1*d$1)>>>16,m$1+=(y$1+=o$1*d$1)>>>16,y$1&=65535,m$1+=(y$1+=a$1*f$1)>>>16,h$1+=(m$1+=i$1*d$1)>>>16,m$1&=65535,h$1+=(m$1+=o$1*f$1)>>>16,m$1&=65535,h$1+=(m$1+=a$1*l$1)>>>16,h$1+=n$1*d$1+i$1*f$1+o$1*l$1+a$1*c$1,u((y$1&=65535)<<16|(_$1&=65535),(h$1&=65535)<<16|(m$1&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(t$1){if(r(t$1)||(t$1=p$1(t$1)),t$1.isZero())throw Error(`division by zero`);var n$1,i$1,o$1;if(e)return this.unsigned||this.high!==-2147483648||t$1.low!==-1||t$1.high!==-1?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t$1.low,t$1.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:b;if(this.unsigned){if(t$1.unsigned||(t$1=t$1.toUnsigned()),t$1.gt(this))return m;if(t$1.gt(this.shru(1)))return _;o$1=m}else{if(this.eq(T))return t$1.eq(y)||t$1.eq(v)?T:t$1.eq(T)?y:(n$1=this.shr(1).div(t$1).shl(1)).eq(b)?t$1.isNegative()?y:v:(i$1=this.sub(t$1.mul(n$1)),o$1=n$1.add(i$1.div(t$1)));if(t$1.eq(T))return this.unsigned?m:b;if(this.isNegative())return t$1.isNegative()?this.neg().div(t$1.neg()):this.neg().div(t$1).neg();if(t$1.isNegative())return this.div(t$1.neg()).neg();o$1=b}for(i$1=this;i$1.gte(t$1);){n$1=Math.max(1,Math.floor(i$1.toNumber()/t$1.toNumber()));for(var a$1=Math.ceil(Math.log(n$1)/Math.LN2),l$1=a$1<=48?1:c(2,a$1-48),f$1=s(n$1),d$1=f$1.mul(t$1);d$1.isNegative()||d$1.gt(i$1);)d$1=(f$1=s(n$1-=l$1,this.unsigned)).mul(t$1);f$1.isZero()&&(f$1=y),o$1=o$1.add(f$1),i$1=i$1.sub(d$1)}return o$1},S.div=S.divide,S.modulo=function(t$1){return r(t$1)||(t$1=p$1(t$1)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t$1.low,t$1.high),e.get_high(),this.unsigned):this.sub(this.div(t$1).mul(t$1))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(t$1){return r(t$1)||(t$1=p$1(t$1)),u(this.low&t$1.low,this.high&t$1.high,this.unsigned)},S.or=function(t$1){return r(t$1)||(t$1=p$1(t$1)),u(this.low|t$1.low,this.high|t$1.high,this.unsigned)},S.xor=function(t$1){return r(t$1)||(t$1=p$1(t$1)),u(this.low^t$1.low,this.high^t$1.high,this.unsigned)},S.shiftLeft=function(t$1){return r(t$1)&&(t$1=t$1.toInt()),(t$1&=63)==0?this:t$1<32?u(this.low<>>32-t$1,this.unsigned):u(0,this.low<>>t$1|this.high<<32-t$1,this.high>>t$1,this.unsigned):u(this.high>>t$1-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(t$1){if(r(t$1)&&(t$1=t$1.toInt()),(t$1&=63)==0)return this;var e$1=this.high;return t$1<32?u(this.low>>>t$1|e$1<<32-t$1,e$1>>>t$1,this.unsigned):u(t$1===32?e$1:e$1>>>t$1-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(t$1){return t$1?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var t$1=this.high,e$1=this.low;return[255&e$1,e$1>>>8&255,e$1>>>16&255,e$1>>>24,255&t$1,t$1>>>8&255,t$1>>>16&255,t$1>>>24]},S.toBytesBE=function(){var t$1=this.high,e$1=this.low;return[t$1>>>24,t$1>>>16&255,t$1>>>8&255,255&t$1,e$1>>>24,e$1>>>16&255,e$1>>>8&255,255&e$1]},n.fromBytes=function(t$1,e$1,r$1){return r$1?n.fromBytesLE(t$1,e$1):n.fromBytesBE(t$1,e$1)},n.fromBytesLE=function(t$1,e$1){return new n(t$1[0]|t$1[1]<<8|t$1[2]<<16|t$1[3]<<24,t$1[4]|t$1[5]<<8|t$1[6]<<16|t$1[7]<<24,e$1)},n.fromBytesBE=function(t$1,e$1){return new n(t$1[4]<<24|t$1[5]<<16|t$1[6]<<8|t$1[7],t$1[0]<<24|t$1[1]<<16|t$1[2]<<8|t$1[3],e$1)}},1446:(t,e,n)=>{"use strict";var r,i,o,a=n(2100),s=a.Reader,u=a.Writer,c=a.util,l=a.roots.default||(a.roots.default={});l.onnx=((o={}).Version=(r={},(i=Object.create(r))[r[0]=`_START_VERSION`]=0,i[r[1]=`IR_VERSION_2017_10_10`]=1,i[r[2]=`IR_VERSION_2017_10_30`]=2,i[r[3]=`IR_VERSION_2017_11_3`]=3,i[r[4]=`IR_VERSION_2019_1_22`]=4,i[r[5]=`IR_VERSION`]=5,i),o.AttributeProto=function(){function t$1(t$2){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],t$2)for(var e$1=Object.keys(t$2),n$1=0;n$1>>3){case 1:r$1.name=t$2.string();break;case 21:r$1.refAttrName=t$2.string();break;case 13:r$1.docString=t$2.string();break;case 20:r$1.type=t$2.int32();break;case 2:r$1.f=t$2.float();break;case 3:r$1.i=t$2.int64();break;case 4:r$1.s=t$2.bytes();break;case 5:r$1.t=l.onnx.TensorProto.decode(t$2,t$2.uint32());break;case 6:r$1.g=l.onnx.GraphProto.decode(t$2,t$2.uint32());break;case 7:if(r$1.floats&&r$1.floats.length||(r$1.floats=[]),(7&i$1)==2)for(var o$1=t$2.uint32()+t$2.pos;t$2.pos>>0,t$2.i.high>>>0).toNumber())),t$2.s!=null&&(typeof t$2.s==`string`?c.base64.decode(t$2.s,e$1.s=c.newBuffer(c.base64.length(t$2.s)),0):t$2.s.length&&(e$1.s=t$2.s)),t$2.t!=null){if(typeof t$2.t!=`object`)throw TypeError(`.onnx.AttributeProto.t: object expected`);e$1.t=l.onnx.TensorProto.fromObject(t$2.t)}if(t$2.g!=null){if(typeof t$2.g!=`object`)throw TypeError(`.onnx.AttributeProto.g: object expected`);e$1.g=l.onnx.GraphProto.fromObject(t$2.g)}if(t$2.floats){if(!Array.isArray(t$2.floats))throw TypeError(`.onnx.AttributeProto.floats: array expected`);e$1.floats=[];for(var n$1=0;n$1>>0,t$2.ints[n$1].high>>>0).toNumber())}if(t$2.strings){if(!Array.isArray(t$2.strings))throw TypeError(`.onnx.AttributeProto.strings: array expected`);for(e$1.strings=[],n$1=0;n$1>>0,t$2.i.high>>>0).toNumber():t$2.i),t$2.s!=null&&t$2.hasOwnProperty(`s`)&&(n$1.s=e$1.bytes===String?c.base64.encode(t$2.s,0,t$2.s.length):e$1.bytes===Array?Array.prototype.slice.call(t$2.s):t$2.s),t$2.t!=null&&t$2.hasOwnProperty(`t`)&&(n$1.t=l.onnx.TensorProto.toObject(t$2.t,e$1)),t$2.g!=null&&t$2.hasOwnProperty(`g`)&&(n$1.g=l.onnx.GraphProto.toObject(t$2.g,e$1)),t$2.floats&&t$2.floats.length){n$1.floats=[];for(var i$1=0;i$1>>0,t$2.ints[i$1].high>>>0).toNumber():t$2.ints[i$1];if(t$2.strings&&t$2.strings.length)for(n$1.strings=[],i$1=0;i$1>>3){case 1:r$1.name=t$2.string();break;case 2:r$1.type=l.onnx.TypeProto.decode(t$2,t$2.uint32());break;case 3:r$1.docString=t$2.string();break;default:t$2.skipType(7&i$1)}}return r$1},t$1.decodeDelimited=function(t$2){return t$2 instanceof s||(t$2=new s(t$2)),this.decode(t$2,t$2.uint32())},t$1.verify=function(t$2){if(typeof t$2!=`object`||!t$2)return`object expected`;if(t$2.name!=null&&t$2.hasOwnProperty(`name`)&&!c.isString(t$2.name))return`name: string expected`;if(t$2.type!=null&&t$2.hasOwnProperty(`type`)){var e$1=l.onnx.TypeProto.verify(t$2.type);if(e$1)return`type.`+e$1}return t$2.docString!=null&&t$2.hasOwnProperty(`docString`)&&!c.isString(t$2.docString)?`docString: string expected`:null},t$1.fromObject=function(t$2){if(t$2 instanceof l.onnx.ValueInfoProto)return t$2;var e$1=new l.onnx.ValueInfoProto;if(t$2.name!=null&&(e$1.name=String(t$2.name)),t$2.type!=null){if(typeof t$2.type!=`object`)throw TypeError(`.onnx.ValueInfoProto.type: object expected`);e$1.type=l.onnx.TypeProto.fromObject(t$2.type)}return t$2.docString!=null&&(e$1.docString=String(t$2.docString)),e$1},t$1.toObject=function(t$2,e$1){e$1||={};var n$1={};return e$1.defaults&&(n$1.name=``,n$1.type=null,n$1.docString=``),t$2.name!=null&&t$2.hasOwnProperty(`name`)&&(n$1.name=t$2.name),t$2.type!=null&&t$2.hasOwnProperty(`type`)&&(n$1.type=l.onnx.TypeProto.toObject(t$2.type,e$1)),t$2.docString!=null&&t$2.hasOwnProperty(`docString`)&&(n$1.docString=t$2.docString),n$1},t$1.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t$1}(),o.NodeProto=function(){function t$1(t$2){if(this.input=[],this.output=[],this.attribute=[],t$2)for(var e$1=Object.keys(t$2),n$1=0;n$1>>3){case 1:r$1.input&&r$1.input.length||(r$1.input=[]),r$1.input.push(t$2.string());break;case 2:r$1.output&&r$1.output.length||(r$1.output=[]),r$1.output.push(t$2.string());break;case 3:r$1.name=t$2.string();break;case 4:r$1.opType=t$2.string();break;case 7:r$1.domain=t$2.string();break;case 5:r$1.attribute&&r$1.attribute.length||(r$1.attribute=[]),r$1.attribute.push(l.onnx.AttributeProto.decode(t$2,t$2.uint32()));break;case 6:r$1.docString=t$2.string();break;default:t$2.skipType(7&i$1)}}return r$1},t$1.decodeDelimited=function(t$2){return t$2 instanceof s||(t$2=new s(t$2)),this.decode(t$2,t$2.uint32())},t$1.verify=function(t$2){if(typeof t$2!=`object`||!t$2)return`object expected`;if(t$2.input!=null&&t$2.hasOwnProperty(`input`)){if(!Array.isArray(t$2.input))return`input: array expected`;for(var e$1=0;e$1>>3){case 1:r$1.irVersion=t$2.int64();break;case 8:r$1.opsetImport&&r$1.opsetImport.length||(r$1.opsetImport=[]),r$1.opsetImport.push(l.onnx.OperatorSetIdProto.decode(t$2,t$2.uint32()));break;case 2:r$1.producerName=t$2.string();break;case 3:r$1.producerVersion=t$2.string();break;case 4:r$1.domain=t$2.string();break;case 5:r$1.modelVersion=t$2.int64();break;case 6:r$1.docString=t$2.string();break;case 7:r$1.graph=l.onnx.GraphProto.decode(t$2,t$2.uint32());break;case 14:r$1.metadataProps&&r$1.metadataProps.length||(r$1.metadataProps=[]),r$1.metadataProps.push(l.onnx.StringStringEntryProto.decode(t$2,t$2.uint32()));break;default:t$2.skipType(7&i$1)}}return r$1},t$1.decodeDelimited=function(t$2){return t$2 instanceof s||(t$2=new s(t$2)),this.decode(t$2,t$2.uint32())},t$1.verify=function(t$2){if(typeof t$2!=`object`||!t$2)return`object expected`;if(t$2.irVersion!=null&&t$2.hasOwnProperty(`irVersion`)&&!(c.isInteger(t$2.irVersion)||t$2.irVersion&&c.isInteger(t$2.irVersion.low)&&c.isInteger(t$2.irVersion.high)))return`irVersion: integer|Long expected`;if(t$2.opsetImport!=null&&t$2.hasOwnProperty(`opsetImport`)){if(!Array.isArray(t$2.opsetImport))return`opsetImport: array expected`;for(var e$1=0;e$1>>0,t$2.irVersion.high>>>0).toNumber())),t$2.opsetImport){if(!Array.isArray(t$2.opsetImport))throw TypeError(`.onnx.ModelProto.opsetImport: array expected`);e$1.opsetImport=[];for(var n$1=0;n$1>>0,t$2.modelVersion.high>>>0).toNumber())),t$2.docString!=null&&(e$1.docString=String(t$2.docString)),t$2.graph!=null){if(typeof t$2.graph!=`object`)throw TypeError(`.onnx.ModelProto.graph: object expected`);e$1.graph=l.onnx.GraphProto.fromObject(t$2.graph)}if(t$2.metadataProps){if(!Array.isArray(t$2.metadataProps))throw TypeError(`.onnx.ModelProto.metadataProps: array expected`);for(e$1.metadataProps=[],n$1=0;n$1>>0,t$2.irVersion.high>>>0).toNumber():t$2.irVersion),t$2.producerName!=null&&t$2.hasOwnProperty(`producerName`)&&(n$1.producerName=t$2.producerName),t$2.producerVersion!=null&&t$2.hasOwnProperty(`producerVersion`)&&(n$1.producerVersion=t$2.producerVersion),t$2.domain!=null&&t$2.hasOwnProperty(`domain`)&&(n$1.domain=t$2.domain),t$2.modelVersion!=null&&t$2.hasOwnProperty(`modelVersion`)&&(typeof t$2.modelVersion==`number`?n$1.modelVersion=e$1.longs===String?String(t$2.modelVersion):t$2.modelVersion:n$1.modelVersion=e$1.longs===String?c.Long.prototype.toString.call(t$2.modelVersion):e$1.longs===Number?new c.LongBits(t$2.modelVersion.low>>>0,t$2.modelVersion.high>>>0).toNumber():t$2.modelVersion),t$2.docString!=null&&t$2.hasOwnProperty(`docString`)&&(n$1.docString=t$2.docString),t$2.graph!=null&&t$2.hasOwnProperty(`graph`)&&(n$1.graph=l.onnx.GraphProto.toObject(t$2.graph,e$1)),t$2.opsetImport&&t$2.opsetImport.length){n$1.opsetImport=[];for(var i$1=0;i$1>>3){case 1:r$1.key=t$2.string();break;case 2:r$1.value=t$2.string();break;default:t$2.skipType(7&i$1)}}return r$1},t$1.decodeDelimited=function(t$2){return t$2 instanceof s||(t$2=new s(t$2)),this.decode(t$2,t$2.uint32())},t$1.verify=function(t$2){return typeof t$2!=`object`||!t$2?`object expected`:t$2.key!=null&&t$2.hasOwnProperty(`key`)&&!c.isString(t$2.key)?`key: string expected`:t$2.value!=null&&t$2.hasOwnProperty(`value`)&&!c.isString(t$2.value)?`value: string expected`:null},t$1.fromObject=function(t$2){if(t$2 instanceof l.onnx.StringStringEntryProto)return t$2;var e$1=new l.onnx.StringStringEntryProto;return t$2.key!=null&&(e$1.key=String(t$2.key)),t$2.value!=null&&(e$1.value=String(t$2.value)),e$1},t$1.toObject=function(t$2,e$1){e$1||={};var n$1={};return e$1.defaults&&(n$1.key=``,n$1.value=``),t$2.key!=null&&t$2.hasOwnProperty(`key`)&&(n$1.key=t$2.key),t$2.value!=null&&t$2.hasOwnProperty(`value`)&&(n$1.value=t$2.value),n$1},t$1.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t$1}(),o.TensorAnnotation=function(){function t$1(t$2){if(this.quantParameterTensorNames=[],t$2)for(var e$1=Object.keys(t$2),n$1=0;n$1>>3){case 1:r$1.tensorName=t$2.string();break;case 2:r$1.quantParameterTensorNames&&r$1.quantParameterTensorNames.length||(r$1.quantParameterTensorNames=[]),r$1.quantParameterTensorNames.push(l.onnx.StringStringEntryProto.decode(t$2,t$2.uint32()));break;default:t$2.skipType(7&i$1)}}return r$1},t$1.decodeDelimited=function(t$2){return t$2 instanceof s||(t$2=new s(t$2)),this.decode(t$2,t$2.uint32())},t$1.verify=function(t$2){if(typeof t$2!=`object`||!t$2)return`object expected`;if(t$2.tensorName!=null&&t$2.hasOwnProperty(`tensorName`)&&!c.isString(t$2.tensorName))return`tensorName: string expected`;if(t$2.quantParameterTensorNames!=null&&t$2.hasOwnProperty(`quantParameterTensorNames`)){if(!Array.isArray(t$2.quantParameterTensorNames))return`quantParameterTensorNames: array expected`;for(var e$1=0;e$1>>3){case 1:r$1.node&&r$1.node.length||(r$1.node=[]),r$1.node.push(l.onnx.NodeProto.decode(t$2,t$2.uint32()));break;case 2:r$1.name=t$2.string();break;case 5:r$1.initializer&&r$1.initializer.length||(r$1.initializer=[]),r$1.initializer.push(l.onnx.TensorProto.decode(t$2,t$2.uint32()));break;case 10:r$1.docString=t$2.string();break;case 11:r$1.input&&r$1.input.length||(r$1.input=[]),r$1.input.push(l.onnx.ValueInfoProto.decode(t$2,t$2.uint32()));break;case 12:r$1.output&&r$1.output.length||(r$1.output=[]),r$1.output.push(l.onnx.ValueInfoProto.decode(t$2,t$2.uint32()));break;case 13:r$1.valueInfo&&r$1.valueInfo.length||(r$1.valueInfo=[]),r$1.valueInfo.push(l.onnx.ValueInfoProto.decode(t$2,t$2.uint32()));break;case 14:r$1.quantizationAnnotation&&r$1.quantizationAnnotation.length||(r$1.quantizationAnnotation=[]),r$1.quantizationAnnotation.push(l.onnx.TensorAnnotation.decode(t$2,t$2.uint32()));break;default:t$2.skipType(7&i$1)}}return r$1},t$1.decodeDelimited=function(t$2){return t$2 instanceof s||(t$2=new s(t$2)),this.decode(t$2,t$2.uint32())},t$1.verify=function(t$2){if(typeof t$2!=`object`||!t$2)return`object expected`;if(t$2.node!=null&&t$2.hasOwnProperty(`node`)){if(!Array.isArray(t$2.node))return`node: array expected`;for(var e$1=0;e$1>>3){case 1:if(r$1.dims&&r$1.dims.length||(r$1.dims=[]),(7&i$1)==2)for(var o$1=t$2.uint32()+t$2.pos;t$2.pos>>0,t$2.dims[n$1].high>>>0).toNumber())}if(t$2.dataType!=null&&(e$1.dataType=0|t$2.dataType),t$2.segment!=null){if(typeof t$2.segment!=`object`)throw TypeError(`.onnx.TensorProto.segment: object expected`);e$1.segment=l.onnx.TensorProto.Segment.fromObject(t$2.segment)}if(t$2.floatData){if(!Array.isArray(t$2.floatData))throw TypeError(`.onnx.TensorProto.floatData: array expected`);for(e$1.floatData=[],n$1=0;n$1>>0,t$2.int64Data[n$1].high>>>0).toNumber())}if(t$2.name!=null&&(e$1.name=String(t$2.name)),t$2.docString!=null&&(e$1.docString=String(t$2.docString)),t$2.rawData!=null&&(typeof t$2.rawData==`string`?c.base64.decode(t$2.rawData,e$1.rawData=c.newBuffer(c.base64.length(t$2.rawData)),0):t$2.rawData.length&&(e$1.rawData=t$2.rawData)),t$2.externalData){if(!Array.isArray(t$2.externalData))throw TypeError(`.onnx.TensorProto.externalData: array expected`);for(e$1.externalData=[],n$1=0;n$1>>0,t$2.uint64Data[n$1].high>>>0).toNumber(!0))}return e$1},t$1.toObject=function(t$2,e$1){e$1||={};var n$1={};if((e$1.arrays||e$1.defaults)&&(n$1.dims=[],n$1.floatData=[],n$1.int32Data=[],n$1.stringData=[],n$1.int64Data=[],n$1.doubleData=[],n$1.uint64Data=[],n$1.externalData=[]),e$1.defaults&&(n$1.dataType=0,n$1.segment=null,n$1.name=``,e$1.bytes===String?n$1.rawData=``:(n$1.rawData=[],e$1.bytes!==Array&&(n$1.rawData=c.newBuffer(n$1.rawData))),n$1.docString=``,n$1.dataLocation=e$1.enums===String?`DEFAULT`:0),t$2.dims&&t$2.dims.length){n$1.dims=[];for(var r$1=0;r$1>>0,t$2.dims[r$1].high>>>0).toNumber():t$2.dims[r$1]}if(t$2.dataType!=null&&t$2.hasOwnProperty(`dataType`)&&(n$1.dataType=t$2.dataType),t$2.segment!=null&&t$2.hasOwnProperty(`segment`)&&(n$1.segment=l.onnx.TensorProto.Segment.toObject(t$2.segment,e$1)),t$2.floatData&&t$2.floatData.length)for(n$1.floatData=[],r$1=0;r$1>>0,t$2.int64Data[r$1].high>>>0).toNumber():t$2.int64Data[r$1];if(t$2.name!=null&&t$2.hasOwnProperty(`name`)&&(n$1.name=t$2.name),t$2.rawData!=null&&t$2.hasOwnProperty(`rawData`)&&(n$1.rawData=e$1.bytes===String?c.base64.encode(t$2.rawData,0,t$2.rawData.length):e$1.bytes===Array?Array.prototype.slice.call(t$2.rawData):t$2.rawData),t$2.doubleData&&t$2.doubleData.length)for(n$1.doubleData=[],r$1=0;r$1>>0,t$2.uint64Data[r$1].high>>>0).toNumber(!0):t$2.uint64Data[r$1];if(t$2.docString!=null&&t$2.hasOwnProperty(`docString`)&&(n$1.docString=t$2.docString),t$2.externalData&&t$2.externalData.length)for(n$1.externalData=[],r$1=0;r$1>>3){case 1:r$1.begin=t$3.int64();break;case 2:r$1.end=t$3.int64();break;default:t$3.skipType(7&i$1)}}return r$1},t$2.decodeDelimited=function(t$3){return t$3 instanceof s||(t$3=new s(t$3)),this.decode(t$3,t$3.uint32())},t$2.verify=function(t$3){return typeof t$3!=`object`||!t$3?`object expected`:t$3.begin!=null&&t$3.hasOwnProperty(`begin`)&&!(c.isInteger(t$3.begin)||t$3.begin&&c.isInteger(t$3.begin.low)&&c.isInteger(t$3.begin.high))?`begin: integer|Long expected`:t$3.end!=null&&t$3.hasOwnProperty(`end`)&&!(c.isInteger(t$3.end)||t$3.end&&c.isInteger(t$3.end.low)&&c.isInteger(t$3.end.high))?`end: integer|Long expected`:null},t$2.fromObject=function(t$3){if(t$3 instanceof l.onnx.TensorProto.Segment)return t$3;var e$1=new l.onnx.TensorProto.Segment;return t$3.begin!=null&&(c.Long?(e$1.begin=c.Long.fromValue(t$3.begin)).unsigned=!1:typeof t$3.begin==`string`?e$1.begin=parseInt(t$3.begin,10):typeof t$3.begin==`number`?e$1.begin=t$3.begin:typeof t$3.begin==`object`&&(e$1.begin=new c.LongBits(t$3.begin.low>>>0,t$3.begin.high>>>0).toNumber())),t$3.end!=null&&(c.Long?(e$1.end=c.Long.fromValue(t$3.end)).unsigned=!1:typeof t$3.end==`string`?e$1.end=parseInt(t$3.end,10):typeof t$3.end==`number`?e$1.end=t$3.end:typeof t$3.end==`object`&&(e$1.end=new c.LongBits(t$3.end.low>>>0,t$3.end.high>>>0).toNumber())),e$1},t$2.toObject=function(t$3,e$1){e$1||={};var n$1={};if(e$1.defaults){if(c.Long){var r$1=new c.Long(0,0,!1);n$1.begin=e$1.longs===String?r$1.toString():e$1.longs===Number?r$1.toNumber():r$1}else n$1.begin=e$1.longs===String?`0`:0;c.Long?(r$1=new c.Long(0,0,!1),n$1.end=e$1.longs===String?r$1.toString():e$1.longs===Number?r$1.toNumber():r$1):n$1.end=e$1.longs===String?`0`:0}return t$3.begin!=null&&t$3.hasOwnProperty(`begin`)&&(typeof t$3.begin==`number`?n$1.begin=e$1.longs===String?String(t$3.begin):t$3.begin:n$1.begin=e$1.longs===String?c.Long.prototype.toString.call(t$3.begin):e$1.longs===Number?new c.LongBits(t$3.begin.low>>>0,t$3.begin.high>>>0).toNumber():t$3.begin),t$3.end!=null&&t$3.hasOwnProperty(`end`)&&(typeof t$3.end==`number`?n$1.end=e$1.longs===String?String(t$3.end):t$3.end:n$1.end=e$1.longs===String?c.Long.prototype.toString.call(t$3.end):e$1.longs===Number?new c.LongBits(t$3.end.low>>>0,t$3.end.high>>>0).toNumber():t$3.end),n$1},t$2.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t$2}(),t$1.DataLocation=function(){var t$2={},e$1=Object.create(t$2);return e$1[t$2[0]=`DEFAULT`]=0,e$1[t$2[1]=`EXTERNAL`]=1,e$1}(),t$1}(),o.TensorShapeProto=function(){function t$1(t$2){if(this.dim=[],t$2)for(var e$1=Object.keys(t$2),n$1=0;n$1>>3==1?(r$1.dim&&r$1.dim.length||(r$1.dim=[]),r$1.dim.push(l.onnx.TensorShapeProto.Dimension.decode(t$2,t$2.uint32()))):t$2.skipType(7&i$1)}return r$1},t$1.decodeDelimited=function(t$2){return t$2 instanceof s||(t$2=new s(t$2)),this.decode(t$2,t$2.uint32())},t$1.verify=function(t$2){if(typeof t$2!=`object`||!t$2)return`object expected`;if(t$2.dim!=null&&t$2.hasOwnProperty(`dim`)){if(!Array.isArray(t$2.dim))return`dim: array expected`;for(var e$1=0;e$1>>3){case 1:r$1.dimValue=t$3.int64();break;case 2:r$1.dimParam=t$3.string();break;case 3:r$1.denotation=t$3.string();break;default:t$3.skipType(7&i$1)}}return r$1},t$2.decodeDelimited=function(t$3){return t$3 instanceof s||(t$3=new s(t$3)),this.decode(t$3,t$3.uint32())},t$2.verify=function(t$3){if(typeof t$3!=`object`||!t$3)return`object expected`;var e$2={};if(t$3.dimValue!=null&&t$3.hasOwnProperty(`dimValue`)&&(e$2.value=1,!(c.isInteger(t$3.dimValue)||t$3.dimValue&&c.isInteger(t$3.dimValue.low)&&c.isInteger(t$3.dimValue.high))))return`dimValue: integer|Long expected`;if(t$3.dimParam!=null&&t$3.hasOwnProperty(`dimParam`)){if(e$2.value===1)return`value: multiple values`;if(e$2.value=1,!c.isString(t$3.dimParam))return`dimParam: string expected`}return t$3.denotation!=null&&t$3.hasOwnProperty(`denotation`)&&!c.isString(t$3.denotation)?`denotation: string expected`:null},t$2.fromObject=function(t$3){if(t$3 instanceof l.onnx.TensorShapeProto.Dimension)return t$3;var e$2=new l.onnx.TensorShapeProto.Dimension;return t$3.dimValue!=null&&(c.Long?(e$2.dimValue=c.Long.fromValue(t$3.dimValue)).unsigned=!1:typeof t$3.dimValue==`string`?e$2.dimValue=parseInt(t$3.dimValue,10):typeof t$3.dimValue==`number`?e$2.dimValue=t$3.dimValue:typeof t$3.dimValue==`object`&&(e$2.dimValue=new c.LongBits(t$3.dimValue.low>>>0,t$3.dimValue.high>>>0).toNumber())),t$3.dimParam!=null&&(e$2.dimParam=String(t$3.dimParam)),t$3.denotation!=null&&(e$2.denotation=String(t$3.denotation)),e$2},t$2.toObject=function(t$3,e$2){e$2||={};var n$1={};return e$2.defaults&&(n$1.denotation=``),t$3.dimValue!=null&&t$3.hasOwnProperty(`dimValue`)&&(typeof t$3.dimValue==`number`?n$1.dimValue=e$2.longs===String?String(t$3.dimValue):t$3.dimValue:n$1.dimValue=e$2.longs===String?c.Long.prototype.toString.call(t$3.dimValue):e$2.longs===Number?new c.LongBits(t$3.dimValue.low>>>0,t$3.dimValue.high>>>0).toNumber():t$3.dimValue,e$2.oneofs&&(n$1.value=`dimValue`)),t$3.dimParam!=null&&t$3.hasOwnProperty(`dimParam`)&&(n$1.dimParam=t$3.dimParam,e$2.oneofs&&(n$1.value=`dimParam`)),t$3.denotation!=null&&t$3.hasOwnProperty(`denotation`)&&(n$1.denotation=t$3.denotation),n$1},t$2.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t$2}(),t$1}(),o.TypeProto=function(){function t$1(t$2){if(t$2)for(var e$2=Object.keys(t$2),n$1=0;n$1>>3){case 1:r$1.tensorType=l.onnx.TypeProto.Tensor.decode(t$2,t$2.uint32());break;case 6:r$1.denotation=t$2.string();break;default:t$2.skipType(7&i$1)}}return r$1},t$1.decodeDelimited=function(t$2){return t$2 instanceof s||(t$2=new s(t$2)),this.decode(t$2,t$2.uint32())},t$1.verify=function(t$2){if(typeof t$2!=`object`||!t$2)return`object expected`;if(t$2.tensorType!=null&&t$2.hasOwnProperty(`tensorType`)){var e$2=l.onnx.TypeProto.Tensor.verify(t$2.tensorType);if(e$2)return`tensorType.`+e$2}return t$2.denotation!=null&&t$2.hasOwnProperty(`denotation`)&&!c.isString(t$2.denotation)?`denotation: string expected`:null},t$1.fromObject=function(t$2){if(t$2 instanceof l.onnx.TypeProto)return t$2;var e$2=new l.onnx.TypeProto;if(t$2.tensorType!=null){if(typeof t$2.tensorType!=`object`)throw TypeError(`.onnx.TypeProto.tensorType: object expected`);e$2.tensorType=l.onnx.TypeProto.Tensor.fromObject(t$2.tensorType)}return t$2.denotation!=null&&(e$2.denotation=String(t$2.denotation)),e$2},t$1.toObject=function(t$2,e$2){e$2||={};var n$1={};return e$2.defaults&&(n$1.denotation=``),t$2.tensorType!=null&&t$2.hasOwnProperty(`tensorType`)&&(n$1.tensorType=l.onnx.TypeProto.Tensor.toObject(t$2.tensorType,e$2),e$2.oneofs&&(n$1.value=`tensorType`)),t$2.denotation!=null&&t$2.hasOwnProperty(`denotation`)&&(n$1.denotation=t$2.denotation),n$1},t$1.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t$1.Tensor=function(){function t$2(t$3){if(t$3)for(var e$2=Object.keys(t$3),n$1=0;n$1>>3){case 1:r$1.elemType=t$3.int32();break;case 2:r$1.shape=l.onnx.TensorShapeProto.decode(t$3,t$3.uint32());break;default:t$3.skipType(7&i$1)}}return r$1},t$2.decodeDelimited=function(t$3){return t$3 instanceof s||(t$3=new s(t$3)),this.decode(t$3,t$3.uint32())},t$2.verify=function(t$3){if(typeof t$3!=`object`||!t$3)return`object expected`;if(t$3.elemType!=null&&t$3.hasOwnProperty(`elemType`)&&!c.isInteger(t$3.elemType))return`elemType: integer expected`;if(t$3.shape!=null&&t$3.hasOwnProperty(`shape`)){var e$2=l.onnx.TensorShapeProto.verify(t$3.shape);if(e$2)return`shape.`+e$2}return null},t$2.fromObject=function(t$3){if(t$3 instanceof l.onnx.TypeProto.Tensor)return t$3;var e$2=new l.onnx.TypeProto.Tensor;if(t$3.elemType!=null&&(e$2.elemType=0|t$3.elemType),t$3.shape!=null){if(typeof t$3.shape!=`object`)throw TypeError(`.onnx.TypeProto.Tensor.shape: object expected`);e$2.shape=l.onnx.TensorShapeProto.fromObject(t$3.shape)}return e$2},t$2.toObject=function(t$3,e$2){e$2||={};var n$1={};return e$2.defaults&&(n$1.elemType=0,n$1.shape=null),t$3.elemType!=null&&t$3.hasOwnProperty(`elemType`)&&(n$1.elemType=t$3.elemType),t$3.shape!=null&&t$3.hasOwnProperty(`shape`)&&(n$1.shape=l.onnx.TensorShapeProto.toObject(t$3.shape,e$2)),n$1},t$2.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t$2}(),t$1}(),o.OperatorSetIdProto=function(){function t$1(t$2){if(t$2)for(var e$1=Object.keys(t$2),n$1=0;n$1>>3){case 1:r$1.domain=t$2.string();break;case 2:r$1.version=t$2.int64();break;default:t$2.skipType(7&i$1)}}return r$1},t$1.decodeDelimited=function(t$2){return t$2 instanceof s||(t$2=new s(t$2)),this.decode(t$2,t$2.uint32())},t$1.verify=function(t$2){return typeof t$2!=`object`||!t$2?`object expected`:t$2.domain!=null&&t$2.hasOwnProperty(`domain`)&&!c.isString(t$2.domain)?`domain: string expected`:t$2.version!=null&&t$2.hasOwnProperty(`version`)&&!(c.isInteger(t$2.version)||t$2.version&&c.isInteger(t$2.version.low)&&c.isInteger(t$2.version.high))?`version: integer|Long expected`:null},t$1.fromObject=function(t$2){if(t$2 instanceof l.onnx.OperatorSetIdProto)return t$2;var e$1=new l.onnx.OperatorSetIdProto;return t$2.domain!=null&&(e$1.domain=String(t$2.domain)),t$2.version!=null&&(c.Long?(e$1.version=c.Long.fromValue(t$2.version)).unsigned=!1:typeof t$2.version==`string`?e$1.version=parseInt(t$2.version,10):typeof t$2.version==`number`?e$1.version=t$2.version:typeof t$2.version==`object`&&(e$1.version=new c.LongBits(t$2.version.low>>>0,t$2.version.high>>>0).toNumber())),e$1},t$1.toObject=function(t$2,e$1){e$1||={};var n$1={};if(e$1.defaults)if(n$1.domain=``,c.Long){var r$1=new c.Long(0,0,!1);n$1.version=e$1.longs===String?r$1.toString():e$1.longs===Number?r$1.toNumber():r$1}else n$1.version=e$1.longs===String?`0`:0;return t$2.domain!=null&&t$2.hasOwnProperty(`domain`)&&(n$1.domain=t$2.domain),t$2.version!=null&&t$2.hasOwnProperty(`version`)&&(typeof t$2.version==`number`?n$1.version=e$1.longs===String?String(t$2.version):t$2.version:n$1.version=e$1.longs===String?c.Long.prototype.toString.call(t$2.version):e$1.longs===Number?new c.LongBits(t$2.version.low>>>0,t$2.version.high>>>0).toNumber():t$2.version),n$1},t$1.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t$1}(),o),t.exports=l},2100:(t,e,n)=>{"use strict";t.exports=n(9482)},9482:(t,e,n)=>{"use strict";var r=e;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build=`minimal`,r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=i,i()},1408:(t,e,n)=>{"use strict";t.exports=u;var r,i=n(9693),o=i.LongBits,a=i.utf8;function s(t$1,e$1){return RangeError(`index out of range: `+t$1.pos+` + `+(e$1||1)+` > `+t$1.len)}function u(t$1){this.buf=t$1,this.pos=0,this.len=t$1.length}var c,l=typeof Uint8Array<`u`?function(t$1){if(t$1 instanceof Uint8Array||Array.isArray(t$1))return new u(t$1);throw Error(`illegal buffer`)}:function(t$1){if(Array.isArray(t$1))return new u(t$1);throw Error(`illegal buffer`)},p$1=function(){return i.Buffer?function(t$1){return(u.create=function(t$2){return i.Buffer.isBuffer(t$2)?new r(t$2):l(t$2)})(t$1)}:l};function f(){var t$1=new o(0,0),e$1=0;if(!(this.len-this.pos>4)){for(;e$1<3;++e$1){if(this.pos>=this.len)throw s(this);if(t$1.lo=(t$1.lo|(127&this.buf[this.pos])<<7*e$1)>>>0,this.buf[this.pos++]<128)return t$1}return t$1.lo=(t$1.lo|(127&this.buf[this.pos++])<<7*e$1)>>>0,t$1}for(;e$1<4;++e$1)if(t$1.lo=(t$1.lo|(127&this.buf[this.pos])<<7*e$1)>>>0,this.buf[this.pos++]<128)return t$1;if(t$1.lo=(t$1.lo|(127&this.buf[this.pos])<<28)>>>0,t$1.hi=(t$1.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t$1;if(e$1=0,this.len-this.pos>4){for(;e$1<5;++e$1)if(t$1.hi=(t$1.hi|(127&this.buf[this.pos])<<7*e$1+3)>>>0,this.buf[this.pos++]<128)return t$1}else for(;e$1<5;++e$1){if(this.pos>=this.len)throw s(this);if(t$1.hi=(t$1.hi|(127&this.buf[this.pos])<<7*e$1+3)>>>0,this.buf[this.pos++]<128)return t$1}throw Error(`invalid varint encoding`)}function d(t$1,e$1){return(t$1[e$1-4]|t$1[e$1-3]<<8|t$1[e$1-2]<<16|t$1[e$1-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}u.create=p$1(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t$1=this.uint32();return t$1>>>1^-(1&t$1)|0},u.prototype.bool=function(){return this.uint32()!==0},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return d(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|d(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var t$1=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t$1},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var t$1=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t$1},u.prototype.bytes=function(){var t$1=this.uint32(),e$1=this.pos,n$1=this.pos+t$1;if(n$1>this.len)throw s(this,t$1);return this.pos+=t$1,Array.isArray(this.buf)?this.buf.slice(e$1,n$1):e$1===n$1?new this.buf.constructor(0):this._slice.call(this.buf,e$1,n$1)},u.prototype.string=function(){var t$1=this.bytes();return a.read(t$1,0,t$1.length)},u.prototype.skip=function(t$1){if(typeof t$1==`number`){if(this.pos+t$1>this.len)throw s(this,t$1);this.pos+=t$1}else do if(this.pos>=this.len)throw s(this);while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t$1){switch(t$1){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t$1=7&this.uint32())!=4;)this.skipType(t$1);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+t$1+` at offset `+this.pos)}return this},u._configure=function(t$1){r=t$1,u.create=p$1(),r._configure();var e$1=i.Long?`toLong`:`toNumber`;i.merge(u.prototype,{int64:function(){return f.call(this)[e$1](!1)},uint64:function(){return f.call(this)[e$1](!0)},sint64:function(){return f.call(this).zzDecode()[e$1](!1)},fixed64:function(){return h.call(this)[e$1](!0)},sfixed64:function(){return h.call(this)[e$1](!1)}})}},593:(t,e,n)=>{"use strict";t.exports=o;var r=n(1408);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(t$1){r.call(this,t$1)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var t$1=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t$1,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+t$1,this.len))},o._configure()},5054:t=>{"use strict";t.exports={}},5994:(t,e,n)=>{"use strict";e.Service=n(7948)},7948:(t,e,n)=>{"use strict";t.exports=i;var r=n(9693);function i(t$1,e$1,n$1){if(typeof t$1!=`function`)throw TypeError(`rpcImpl must be a function`);r.EventEmitter.call(this),this.rpcImpl=t$1,this.requestDelimited=!!e$1,this.responseDelimited=!!n$1}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function t$1(e$1,n$1,i$1,o,a){if(!o)throw TypeError(`request must be specified`);var s=this;if(!a)return r.asPromise(t$1,s,e$1,n$1,i$1,o);if(s.rpcImpl)try{return s.rpcImpl(e$1,n$1[s.requestDelimited?`encodeDelimited`:`encode`](o).finish(),function(t$2,n$2){if(t$2)return s.emit(`error`,t$2,e$1),a(t$2);if(n$2!==null){if(!(n$2 instanceof i$1))try{n$2=i$1[s.responseDelimited?`decodeDelimited`:`decode`](n$2)}catch(t$3){return s.emit(`error`,t$3,e$1),a(t$3)}return s.emit(`data`,n$2,e$1),a(null,n$2)}s.end(!0)})}catch(t$2){return s.emit(`error`,t$2,e$1),void setTimeout(function(){a(t$2)},0)}else setTimeout(function(){a(Error(`already ended`))},0)},i.prototype.end=function(t$1){return this.rpcImpl&&(t$1||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}},1945:(t,e,n)=>{"use strict";t.exports=i;var r=n(9693);function i(t$1,e$1){this.lo=t$1>>>0,this.hi=e$1>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash=`\0\0\0\0\0\0\0\0`;i.fromNumber=function(t$1){if(t$1===0)return o;var e$1=t$1<0;e$1&&(t$1=-t$1);var n$1=t$1>>>0,r$1=(t$1-n$1)/4294967296>>>0;return e$1&&(r$1=~r$1>>>0,n$1=~n$1>>>0,++n$1>4294967295&&(n$1=0,++r$1>4294967295&&(r$1=0))),new i(n$1,r$1)},i.from=function(t$1){if(typeof t$1==`number`)return i.fromNumber(t$1);if(r.isString(t$1)){if(!r.Long)return i.fromNumber(parseInt(t$1,10));t$1=r.Long.fromString(t$1)}return t$1.low||t$1.high?new i(t$1.low>>>0,t$1.high>>>0):o},i.prototype.toNumber=function(t$1){if(!t$1&&this.hi>>>31){var e$1=1+~this.lo>>>0,n$1=~this.hi>>>0;return e$1||(n$1=n$1+1>>>0),-(e$1+4294967296*n$1)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(t$1){return r.Long?new r.Long(0|this.lo,0|this.hi,!!t$1):{low:0|this.lo,high:0|this.hi,unsigned:!!t$1}};var s=String.prototype.charCodeAt;i.fromHash=function(t$1){return t$1===a?o:new i((s.call(t$1,0)|s.call(t$1,1)<<8|s.call(t$1,2)<<16|s.call(t$1,3)<<24)>>>0,(s.call(t$1,4)|s.call(t$1,5)<<8|s.call(t$1,6)<<16|s.call(t$1,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var t$1=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t$1)>>>0,this.lo=(this.lo<<1^t$1)>>>0,this},i.prototype.zzDecode=function(){var t$1=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t$1)>>>0,this.hi=(this.hi>>>1^t$1)>>>0,this},i.prototype.length=function(){var t$1=this.lo,e$1=(this.lo>>>28|this.hi<<4)>>>0,n$1=this.hi>>>24;return n$1===0?e$1===0?t$1<16384?t$1<128?1:2:t$1<2097152?3:4:e$1<16384?e$1<128?5:6:e$1<2097152?7:8:n$1<128?9:10}},9693:function(t,e,n){"use strict";var r=e;function i(t$1,e$1,n$1){for(var r$1=Object.keys(e$1),i$1=0;i$10)},r.Buffer=function(){try{var t$1=r.inquire(`buffer`).Buffer;return t$1.prototype.utf8Write?t$1:null}catch{return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t$1){return typeof t$1==`number`?r.Buffer?r._Buffer_allocUnsafe(t$1):new r.Array(t$1):r.Buffer?r._Buffer_from(t$1):typeof Uint8Array>`u`?t$1:new Uint8Array(t$1)},r.Array=typeof Uint8Array<`u`?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire(`long`),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t$1){return t$1?r.LongBits.from(t$1).toHash():r.LongBits.zeroHash},r.longFromHash=function(t$1,e$1){var n$1=r.LongBits.fromHash(t$1);return r.Long?r.Long.fromBits(n$1.lo,n$1.hi,e$1):n$1.toNumber(!!e$1)},r.merge=i,r.lcFirst=function(t$1){return t$1.charAt(0).toLowerCase()+t$1.substring(1)},r.newError=o,r.ProtocolError=o(`ProtocolError`),r.oneOfGetter=function(t$1){for(var e$1={},n$1=0;n$1-1;--n$2)if(e$1[t$2[n$2]]===1&&this[t$2[n$2]]!==void 0&&this[t$2[n$2]]!==null)return t$2[n$2]}},r.oneOfSetter=function(t$1){return function(e$1){for(var n$1=0;n$1{"use strict";t.exports=p$1;var r,i=n(9693),o=i.LongBits,a=i.base64,s=i.utf8;function u(t$1,e$1,n$1){this.fn=t$1,this.len=e$1,this.next=void 0,this.val=n$1}function c(){}function l(t$1){this.head=t$1.head,this.tail=t$1.tail,this.len=t$1.len,this.next=t$1.states}function p$1(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(p$1.create=function(){return new r})()}:function(){return new p$1}};function d(t$1,e$1,n$1){e$1[n$1]=255&t$1}function h(t$1,e$1){this.len=t$1,this.next=void 0,this.val=e$1}function g(t$1,e$1,n$1){for(;t$1.hi;)e$1[n$1++]=127&t$1.lo|128,t$1.lo=(t$1.lo>>>7|t$1.hi<<25)>>>0,t$1.hi>>>=7;for(;t$1.lo>127;)e$1[n$1++]=127&t$1.lo|128,t$1.lo>>>=7;e$1[n$1++]=t$1.lo}function b(t$1,e$1,n$1){e$1[n$1]=255&t$1,e$1[n$1+1]=t$1>>>8&255,e$1[n$1+2]=t$1>>>16&255,e$1[n$1+3]=t$1>>>24}p$1.create=f(),p$1.alloc=function(t$1){return new i.Array(t$1)},i.Array!==Array&&(p$1.alloc=i.pool(p$1.alloc,i.Array.prototype.subarray)),p$1.prototype._push=function(t$1,e$1,n$1){return this.tail=this.tail.next=new u(t$1,e$1,n$1),this.len+=e$1,this},h.prototype=Object.create(u.prototype),h.prototype.fn=function(t$1,e$1,n$1){for(;t$1>127;)e$1[n$1++]=127&t$1|128,t$1>>>=7;e$1[n$1]=t$1},p$1.prototype.uint32=function(t$1){return this.len+=(this.tail=this.tail.next=new h((t$1>>>=0)<128?1:t$1<16384?2:t$1<2097152?3:t$1<268435456?4:5,t$1)).len,this},p$1.prototype.int32=function(t$1){return t$1<0?this._push(g,10,o.fromNumber(t$1)):this.uint32(t$1)},p$1.prototype.sint32=function(t$1){return this.uint32((t$1<<1^t$1>>31)>>>0)},p$1.prototype.uint64=function(t$1){var e$1=o.from(t$1);return this._push(g,e$1.length(),e$1)},p$1.prototype.int64=p$1.prototype.uint64,p$1.prototype.sint64=function(t$1){var e$1=o.from(t$1).zzEncode();return this._push(g,e$1.length(),e$1)},p$1.prototype.bool=function(t$1){return this._push(d,1,t$1?1:0)},p$1.prototype.fixed32=function(t$1){return this._push(b,4,t$1>>>0)},p$1.prototype.sfixed32=p$1.prototype.fixed32,p$1.prototype.fixed64=function(t$1){var e$1=o.from(t$1);return this._push(b,4,e$1.lo)._push(b,4,e$1.hi)},p$1.prototype.sfixed64=p$1.prototype.fixed64,p$1.prototype.float=function(t$1){return this._push(i.float.writeFloatLE,4,t$1)},p$1.prototype.double=function(t$1){return this._push(i.float.writeDoubleLE,8,t$1)};var m=i.Array.prototype.set?function(t$1,e$1,n$1){e$1.set(t$1,n$1)}:function(t$1,e$1,n$1){for(var r$1=0;r$1>>0;if(!e$1)return this._push(d,1,0);if(i.isString(t$1)){var n$1=p$1.alloc(e$1=a.length(t$1));a.decode(t$1,n$1,0),t$1=n$1}return this.uint32(e$1)._push(m,e$1,t$1)},p$1.prototype.string=function(t$1){var e$1=s.length(t$1);return e$1?this.uint32(e$1)._push(s.write,e$1,t$1):this._push(d,1,0)},p$1.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},p$1.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},p$1.prototype.ldelim=function(){var t$1=this.head,e$1=this.tail,n$1=this.len;return this.reset().uint32(n$1),n$1&&(this.tail.next=t$1.next,this.tail=e$1,this.len+=n$1),this},p$1.prototype.finish=function(){for(var t$1=this.head.next,e$1=this.constructor.alloc(this.len),n$1=0;t$1;)t$1.fn(t$1.val,e$1,n$1),n$1+=t$1.len,t$1=t$1.next;return e$1},p$1._configure=function(t$1){r=t$1,p$1.create=f(),r._configure()}},3155:(t,e,n)=>{"use strict";t.exports=o;var r=n(1173);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(){r.call(this)}function a(t$1,e$1,n$1){t$1.length<40?i.utf8.write(t$1,e$1,n$1):e$1.utf8Write?e$1.utf8Write(t$1,n$1):e$1.write(t$1,n$1)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&i.Buffer.prototype.set.name===`set`?function(t$1,e$1,n$1){e$1.set(t$1,n$1)}:function(t$1,e$1,n$1){if(t$1.copy)t$1.copy(e$1,n$1,0,t$1.length);else for(var r$1=0;r$1>>0;return this.uint32(e$1),e$1&&this._push(o.writeBytesBuffer,e$1,t$1),this},o.prototype.string=function(t$1){var e$1=i.Buffer.byteLength(t$1);return this.uint32(e$1),e$1&&this._push(a,e$1,t$1),this},o._configure()},7714:(t,e,n)=>{"use strict";e.R=void 0;let r=n(6919),i=n(7448);e.R=new class{async init(){}async createSessionHandler(t$1,e$1){let n$1=new r.Session(e$1);return await n$1.loadModel(t$1),new i.OnnxjsSessionHandler(n$1)}}},4200:(t,e,n)=>{"use strict";e.c8=e.rX=void 0;let r=n(1670),i=n(5381),o=n(2157),a=n(2306);e.rX=()=>{if((typeof r.env.wasm.initTimeout!=`number`||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),typeof r.env.wasm.simd!=`boolean`&&(r.env.wasm.simd=!0),typeof r.env.wasm.proxy!=`boolean`&&(r.env.wasm.proxy=!1),typeof r.env.wasm.numThreads!=`number`||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){let t$1=typeof navigator>`u`?(0,i.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((t$1||1)/2))}},e.c8=new class{async init(){(0,e.rX)(),await(0,o.initWasm)()}async createSessionHandler(t$1,e$1){let n$1=new a.OnnxruntimeWebAssemblySessionHandler;return await n$1.loadModel(t$1,e$1),Promise.resolve(n$1)}}},6018: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.__exportStar||function(t$1,e$1){for(var n$1 in t$1)n$1===`default`||Object.prototype.hasOwnProperty.call(e$1,n$1)||r(e$1,t$1,n$1)};Object.defineProperty(e,`__esModule`,{value:!0}),i(n(1670),e);let o=n(1670);{let t$1=n(7714).R;(0,o.registerBackend)(`webgl`,t$1,-10)}{let t$1=n(4200).c8;(0,o.registerBackend)(`cpu`,t$1,10),(0,o.registerBackend)(`wasm`,t$1,10),(0,o.registerBackend)(`xnnpack`,t$1,9)}},246:(t,e)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createAttributeWithCacheKey=void 0;class n{constructor(t$1){Object.assign(this,t$1)}get cacheKey(){return this._cacheKey||=Object.getOwnPropertyNames(this).sort().map(t$1=>`${this[t$1]}`).join(`;`),this._cacheKey}}e.createAttributeWithCacheKey=t$1=>new n(t$1)},7778:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.Attribute=void 0;let r=n(1446),i=n(9395),o=n(9162),a=n(2517);var s=i.onnxruntime.experimental.fbs;class u{constructor(t$1){if(this._attributes=new Map,t$1!=null){for(let e$1 of t$1)e$1 instanceof r.onnx.AttributeProto?this._attributes.set(e$1.name,[u.getValue(e$1),u.getType(e$1)]):e$1 instanceof s.Attribute&&this._attributes.set(e$1.name(),[u.getValue(e$1),u.getType(e$1)]);if(this._attributes.sizeo.Tensor.fromProto(t$2));if(t$1 instanceof s.Attribute)return n$1.map(t$2=>o.Tensor.fromOrtTensor(t$2))}if(e$1===r.onnx.AttributeProto.AttributeType.STRING&&t$1 instanceof r.onnx.AttributeProto){let t$2=n$1;return(0,a.decodeUtf8String)(t$2)}return e$1===r.onnx.AttributeProto.AttributeType.STRINGS&&t$1 instanceof r.onnx.AttributeProto?n$1.map(a.decodeUtf8String):n$1}static getValueNoCheck(t$1){return t$1 instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(t$1):this.getValueNoCheckFromOrtFormat(t$1)}static getValueNoCheckFromOnnxFormat(t$1){switch(t$1.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return t$1.f;case r.onnx.AttributeProto.AttributeType.INT:return t$1.i;case r.onnx.AttributeProto.AttributeType.STRING:return t$1.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return t$1.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return t$1.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return t$1.floats;case r.onnx.AttributeProto.AttributeType.INTS:return t$1.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return t$1.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return t$1.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return t$1.graphs;default:throw Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[t$1.type]}`)}}static getValueNoCheckFromOrtFormat(t$1){switch(t$1.type()){case s.AttributeType.FLOAT:return t$1.f();case s.AttributeType.INT:return t$1.i();case s.AttributeType.STRING:return t$1.s();case s.AttributeType.TENSOR:return t$1.t();case s.AttributeType.GRAPH:return t$1.g();case s.AttributeType.FLOATS:return t$1.floatsArray();case s.AttributeType.INTS:{let e$1=[];for(let n$1=0;n$1{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveBackend=e.backend=void 0;let r=n(5038),i=new Map;async function o(t$1){let n$1=e.backend;if(n$1[t$1]!==void 0&&function(t$2){let e$1=t$2;return`initialize`in e$1&&typeof e$1.initialize==`function`&&`createSessionHandler`in e$1&&typeof e$1.createSessionHandler==`function`&&`dispose`in e$1&&typeof e$1.dispose==`function`}(n$1[t$1])){let e$1=n$1[t$1],r$1=e$1.initialize();if(typeof r$1==`object`&&`then`in r$1&&(r$1=await r$1),r$1)return i.set(t$1,e$1),e$1}}e.backend={webgl:new r.WebGLBackend},e.resolveBackend=async function t$1(e$1){if(!e$1)return t$1([`webgl`]);{let t$2=typeof e$1==`string`?[e$1]:e$1;for(let e$2 of t$2){let t$3=i.get(e$2);if(t$3)return t$3;let n$1=await o(e$2);if(n$1)return n$1}}throw Error(`no available backend to use`)}},5038:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.WebGLBackend=void 0;let r=n(1670),i=n(6231),o=n(6416),a=n(7305);e.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(t$1){r.env.webgl.contextId=t$1}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(t$1){r.env.webgl.matmulMaxBatchSize=t$1}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(t$1){r.env.webgl.textureCacheMode=t$1}get pack(){return r.env.webgl.pack}set pack(t$1){r.env.webgl.pack=t$1}get async(){return r.env.webgl.async}set async(t$1){r.env.webgl.async=t$1}initialize(){try{return this.glContext=(0,a.createWebGLContext)(this.contextId),typeof this.matmulMaxBatchSize!=`number`&&(this.matmulMaxBatchSize=16),typeof this.textureCacheMode!=`string`&&(this.textureCacheMode=`full`),typeof this.pack!=`boolean`&&(this.pack=!1),typeof this.async!=`boolean`&&(this.async=!1),i.Logger.setWithEnv(r.env),i.Logger.verbose(`WebGLBackend`,`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(t$1){return i.Logger.warning(`WebGLBackend`,`Unable to initialize WebGLBackend. ${t$1}`),!1}}createSessionHandler(t$1){return new o.WebGLSessionHandler(this,t$1)}dispose(){this.glContext.dispose()}}},5107:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.CoordsGlslLib=void 0;let r=n(2517),i=n(8520),o=n(5060),a=n(7859),s=n(9390);class u extends i.GlslLib{constructor(t$1){super(t$1)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new i.GlslLibRoutine(` + vec2 offsetToCoords(int offset, int width, int height) { + int t = offset / width; + int s = offset - t*width; + vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height); + return coords; + } + `)}}coordsToOffset(){return{coordsToOffset:new i.GlslLibRoutine(` + int coordsToOffset(vec2 coords, int width, int height) { + float s = coords.s * float(width); + float t = coords.t * float(height); + int offset = int(t) * width + int(s); + return offset; + } + `)}}getOutputSamplingSnippet(){let t$1=this.context.outputTextureLayout;return t$1.isPacked?this.getPackedOutputSamplingSnippet(t$1):this.getUnpackedOutputSamplingSnippet(t$1)}getPackedOutputSamplingSnippet(t$1){let e$1=t$1.unpackedShape,n$1=[t$1.width,t$1.height],r$1={},a$1=`getOutputCoords`;switch(e$1.length){case 0:r$1[a$1]=this.getOutputScalarCoords();break;case 1:r$1[a$1]=this.getOutputPacked1DCoords(e$1,n$1);break;case 2:r$1[a$1]=this.getOutputPacked2DCoords(e$1,n$1);break;case 3:r$1[a$1]=this.getOutputPacked3DCoords(e$1,n$1);break;default:r$1[a$1]=this.getOutputPackedNDCoords(e$1,n$1)}let s$1=`\n void setOutput(vec4 val) {\n ${(0,o.getGlsl)(this.context.glContext.version).output} = val;\n }\n `;return r$1.floatTextureSetRGBA=new i.GlslLibRoutine(s$1),r$1}getUnpackedOutputSamplingSnippet(t$1){let e$1=t$1.unpackedShape,n$1=[t$1.width,t$1.height],r$1={},a$1=`getOutputCoords`;switch(e$1.length){case 0:r$1[a$1]=this.getOutputScalarCoords();break;case 1:r$1[a$1]=this.getOutputUnpacked1DCoords(e$1,n$1);break;case 2:r$1[a$1]=this.getOutputUnpacked2DCoords(e$1,n$1);break;case 3:r$1[a$1]=this.getOutputUnpacked3DCoords(e$1,n$1);break;case 4:r$1[a$1]=this.getOutputUnpacked4DCoords(e$1,n$1);break;case 5:r$1[a$1]=this.getOutputUnpacked5DCoords(e$1,n$1);break;case 6:r$1[a$1]=this.getOutputUnpacked6DCoords(e$1,n$1);break;default:throw Error(`Unsupported output dimensionality: ${e$1.length}`)}let s$1=`\n void setOutput(float val) {\n ${(0,o.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\n }\n `;return r$1.floatTextureSetR=new i.GlslLibRoutine(s$1),r$1}getOutputScalarCoords(){return new i.GlslLibRoutine(` + int getOutputCoords() { + return 0; + } + `)}getOutputPacked1DCoords(t$1,e$1){let n$1=e$1,r$1=``;return n$1[0]===1?(r$1=`\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ${n$1[1]}.0);\n }\n `,new i.GlslLibRoutine(r$1)):n$1[1]===1?(r$1=`\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ${n$1[0]}.0);\n }\n `,new i.GlslLibRoutine(r$1)):(r$1=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n$1[0]}, ${n$1[1]}));\n return 2 * (resTexRC.y * ${n$1[0]} + resTexRC.x);\n }\n `,new i.GlslLibRoutine(r$1))}getOutputPacked2DCoords(t$1,e$1){let n$1=``;if(r.ArrayUtil.arraysEqual(t$1,e$1))return n$1=`\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(${e$1[0]}, ${e$1[1]}));\n }\n `,new i.GlslLibRoutine(n$1);let o$1=e$1,a$1=Math.ceil(t$1[1]/2);return n$1=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${o$1[0]}, ${o$1[1]}));\n\n int index = resTexRC.y * ${o$1[0]} + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ${a$1}) * 2;\n int c = 2 * (index / ${a$1});\n\n return ivec2(r, c);\n }\n `,new i.GlslLibRoutine(n$1)}getOutputPacked3DCoords(t$1,e$1){let n$1=[e$1[0],e$1[1]],r$1=Math.ceil(t$1[2]/2),o$1=r$1*Math.ceil(t$1[1]/2),a$1=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n$1[0]}, ${n$1[1]}));\n int index = resTexRC.y * ${n$1[0]} + resTexRC.x;\n\n int b = index / ${o$1};\n index -= b * ${o$1};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r$1}) * 2;\n int c = 2 * (index / ${r$1});\n\n return ivec3(b, r, c);\n }\n `;return new i.GlslLibRoutine(a$1)}getOutputPackedNDCoords(t$1,e$1){let n$1=[e$1[0],e$1[1]],r$1=Math.ceil(t$1[t$1.length-1]/2),o$1=r$1*Math.ceil(t$1[t$1.length-2]/2),a$1=o$1,s$1=``,u$1=`b, r, c`;for(let e$2=2;e$2=0;--e$2)o$1[e$2]=o$1[e$2+1]*t$1[e$2+1];let a$1=[`r`,`c`,`d`],s$1=o$1.map((t$2,e$2)=>`int ${a$1[e$2]} = index / ${t$2}; ${e$2===o$1.length-1?`int ${a$1[e$2+1]} = index - ${a$1[e$2]} * ${t$2}`:`index -= ${a$1[e$2]} * ${t$2}`};`).join(``);return n$1=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e$1[0]}, ${e$1[1]}));\n int index = resTexRC.y * ${e$1[0]} + resTexRC.x;\n ${s$1}\n return ivec3(r, c, d);\n }\n `,new i.GlslLibRoutine(n$1)}getOutputUnpacked4DCoords(t$1,e$1){let n$1=``,r$1=t$1.length,o$1=null;r$1<2&&(o$1=[]),o$1=Array(r$1-1),o$1[r$1-2]=t$1[r$1-1];for(let e$2=r$1-3;e$2>=0;--e$2)o$1[e$2]=o$1[e$2+1]*t$1[e$2+1];let a$1=[`r`,`c`,`d`,`d2`],s$1=o$1.map((t$2,e$2)=>`int ${a$1[e$2]} = index / ${t$2}; ${e$2===o$1.length-1?`int ${a$1[e$2+1]} = index - ${a$1[e$2]} * ${t$2}`:`index -= ${a$1[e$2]} * ${t$2}`};`).join(``);return n$1=`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e$1[0]}, ${e$1[1]}));\n int index = resTexRC.y * ${e$1[0]} + resTexRC.x;\n ${s$1}\n return ivec4(r, c, d, d2);\n }\n `,new i.GlslLibRoutine(n$1)}getOutputUnpacked5DCoords(t$1,e$1){let n$1=``,r$1=t$1.length,o$1=null;r$1<2&&(o$1=[]),o$1=Array(r$1-1),o$1[r$1-2]=t$1[r$1-1];for(let e$2=r$1-3;e$2>=0;--e$2)o$1[e$2]=o$1[e$2+1]*t$1[e$2+1];let a$1=[`r`,`c`,`d`,`d2`,`d3`],s$1=o$1.map((t$2,e$2)=>`int ${a$1[e$2]} = index / ${t$2}; ${e$2===o$1.length-1?`int ${a$1[e$2+1]} = index - ${a$1[e$2]} * ${t$2}`:`index -= ${a$1[e$2]} * ${t$2}`};`).join(``);return n$1=`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e$1[0]}, ${e$1[1]}));\n int index = resTexRC.y * ${e$1[0]} + resTexRC.x;\n ${s$1}\n return ivec5(r, c, d, d2, d3);\n }\n `,new i.GlslLibRoutine(n$1)}getOutputUnpacked6DCoords(t$1,e$1){let n$1=``,r$1=t$1.length,o$1=null;r$1<2&&(o$1=[]),o$1=Array(r$1-1),o$1[r$1-2]=t$1[r$1-1];for(let e$2=r$1-3;e$2>=0;--e$2)o$1[e$2]=o$1[e$2+1]*t$1[e$2+1];let a$1=[`r`,`c`,`d`,`d2`,`d3`,`d4`],s$1=o$1.map((t$2,e$2)=>`int ${a$1[e$2]} = index / ${t$2}; ${e$2===o$1.length-1?`int ${a$1[e$2+1]} = index - ${a$1[e$2]} * ${t$2}`:`index -= ${a$1[e$2]} * ${t$2}`};`).join(``);return n$1=`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${e$1[0]}, ${e$1[1]}));\n int index = resTexRC.y * ${e$1[0]} + resTexRC.x;\n ${s$1}\n return ivec6(r, c, d, d2, d3, d4);\n }\n `,new i.GlslLibRoutine(n$1)}getCommonUtilFuncs(){let t$1={},e$1=`uvFromFlat`;t$1[e$1]=new i.GlslLibRoutine(` + vec2 uvFromFlat(int texNumR, int texNumC, int index) { + int texC = index / texNumR; + int texR = index - texC * texNumR; + // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to + // v. + return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC); + } + `),e$1=`packedUVfrom1D`,t$1[e$1]=new i.GlslLibRoutine(` + vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { + int texelIndex = index / 2; + int texR = texelIndex / texNumC; + int texC = texelIndex - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); + } + `),e$1=`packedUVfrom2D`,t$1[e$1]=new i.GlslLibRoutine(` + vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) { + int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); + int texR = texelIndex / texNumC; + int texC = texelIndex - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); + } + `),e$1=`packedUVfrom3D`,t$1[e$1]=new i.GlslLibRoutine(` + vec2 packedUVfrom3D(int texNumR, int texNumC, + int texelsInBatch, int texelsInLogicalRow, int b, + int row, int col) { + int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); + int texR = index / texNumC; + int texC = index - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); + } + `),e$1=`sampleTexture`;let n$1=(0,o.getGlsl)(this.context.glContext.version);return t$1[e$1]=new i.GlslLibRoutine(`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${n$1.texture2D}(textureSampler, uv).r;\n }`),t$1}getInputsSamplingSnippets(){let t$1={},e$1=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((n$1,r$1)=>{let i$1=this.context.inputTextureLayouts[r$1],o$1=(0,s.generateShaderFuncNameFromInputSamplerName)(n$1);i$1.isPacked?t$1[o$1]=this.getPackedSamplerFromInput(o$1,n$1,i$1):t$1[o$1]=this.getUnpackedSamplerFromInput(o$1,n$1,i$1);let a$1=(0,s.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n$1);i$1.unpackedShape.length<=e$1.unpackedShape.length&&(i$1.isPacked?t$1[a$1]=this.getPackedSamplerAtOutputCoords(a$1,i$1,e$1,n$1):t$1[a$1]=this.getUnpackedSamplerAtOutputCoords(a$1,i$1,e$1,n$1))}),t$1}getPackedSamplerAtOutputCoords(t$1,e$1,n$1,o$1){let a$1=e$1.unpackedShape,u$1=n$1.unpackedShape,c=o$1,l=(0,s.generateShaderFuncNameFromInputSamplerName)(c),p$1=a$1.length,f=u$1.length,d=r.BroadcastUtil.getBroadcastDims(a$1,u$1),h=(0,s.getCoordsDataType)(f),g=f-p$1,b,m=(0,s.getGlChannels)();b=p$1===0?``:f<2&&d.length>=1?`coords = 0;`:d.map(t$2=>`coords.${m[t$2+g]} = 0;`).join(` +`);let y=``;y=f<2&&p$1>0?`coords`:a$1.map((t$2,e$2)=>`coords.${m[e$2+g]}`).join(`, `);let _=`return outputValue;`,v=r.ShapeUtil.size(a$1)===1,w=r.ShapeUtil.size(u$1)===1;if(p$1!==1||v||w){if(v&&!w)_=f===1?` + return vec4(outputValue.x, outputValue.x, 0., 0.); + `:` + return vec4(outputValue.x); + `;else if(d.length){let t$2=p$1-2,e$2=p$1-1;d.indexOf(t$2)>-1&&d.indexOf(e$2)>-1?_=`return vec4(outputValue.x);`:d.indexOf(t$2)>-1?_=`return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);`:d.indexOf(e$2)>-1&&(_=`return vec4(outputValue.xx, outputValue.zz);`)}}else _=` + return vec4(outputValue.xy, outputValue.xy); + `;let x=`\n vec4 ${t$1}() {\n ${h} coords = getOutputCoords();\n \n int lastDim = coords.${m[f-1]};\n coords.${m[f-1]} = coords.${m[f-2]};\n coords.${m[f-2]} = lastDim;\n \n ${b}\n vec4 outputValue = ${l}(${y});\n ${_}\n }\n `;return new i.GlslLibRoutine(x,[`coordinates.getOutputCoords`])}getUnpackedSamplerAtOutputCoords(t$1,e$1,n$1,o$1){let a$1=[n$1.width,n$1.height],u$1=[e$1.width,e$1.height],c=e$1.unpackedShape.length,l=n$1.unpackedShape.length,p$1=e$1.unpackedShape,f=n$1.unpackedShape,d=(0,s.generateShaderFuncNameFromInputSamplerName)(o$1);if(c===l&&r.ArrayUtil.arraysEqual(u$1,a$1)){let e$2=`\n float ${t$1}() {\n return sampleTexture(${o$1}, TexCoords);\n }\n `;return new i.GlslLibRoutine(e$2,[`coordinates.sampleTexture`])}let h=(0,s.getCoordsDataType)(l),g=r.BroadcastUtil.getBroadcastDims(p$1,f),b=l-c,m,y=(0,s.getGlChannels)();m=c===0?``:l<2&&g.length>=1?`coords = 0;`:g.map(t$2=>`coords.${y[t$2+b]} = 0;`).join(` +`);let _=``;_=l<2&&c>0?`coords`:e$1.unpackedShape.map((t$2,e$2)=>`coords.${y[e$2+b]}`).join(`, `);let v=`\n float ${t$1}() {\n ${h} coords = getOutputCoords();\n ${m}\n return ${d}(${_});\n }\n `;return new i.GlslLibRoutine(v,[`coordinates.getOutputCoords`])}getPackedSamplerFromInput(t$1,e$1,n$1){switch(n$1.unpackedShape.length){case 0:return this.getPackedSamplerScalar(t$1,e$1);case 1:return this.getPackedSampler1D(t$1,e$1,n$1);case 2:return this.getPackedSampler2D(t$1,e$1,n$1);case 3:return this.getPackedSampler3D(t$1,e$1,n$1);default:return this.getPackedSamplerND(t$1,e$1,n$1)}}getUnpackedSamplerFromInput(t$1,e$1,n$1){let r$1=n$1.unpackedShape;switch(r$1.length){case 0:return this.getUnpackedSamplerScalar(t$1,e$1,n$1);case 1:return this.getUnpackedSampler1D(t$1,e$1,n$1);case 2:return this.getUnpackedSampler2D(t$1,e$1,n$1);case 3:return this.getUnpackedSampler3D(t$1,e$1,n$1);case 4:return this.getUnpackedSampler4D(t$1,e$1,n$1);case 5:return this.getUnpackedSampler5D(t$1,e$1,n$1);case 6:return this.getUnpackedSampler6D(t$1,e$1,n$1);default:throw Error(`Unsupported dimension ${r$1.length}-D`)}}getPackedSamplerScalar(t$1,e$1){let n$1=`\n vec4 ${t$1}() {\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${e$1}, halfCR);\n }\n `;return new i.GlslLibRoutine(n$1)}getPackedSampler1D(t$1,e$1,n$1){let r$1=[n$1.width,n$1.height],a$1=[r$1[1],r$1[0]],s$1=(0,o.getGlsl)(this.context.glContext.version),u$1=`vec4 ${t$1}(int index) {\n vec2 uv = packedUVfrom1D(\n ${a$1[0]}, ${a$1[1]}, index);\n return ${s$1.texture2D}(${e$1}, uv);\n }`;return new i.GlslLibRoutine(u$1,[`coordinates.packedUVfrom1D`])}getPackedSampler2D(t$1,e$1,n$1){let a$1=n$1.unpackedShape,s$1=[n$1.width,n$1.height],u$1=(0,o.getGlsl)(this.context.glContext.version),c=s$1[0],l=s$1[1];if(s$1!=null&&r.ArrayUtil.arraysEqual(a$1,s$1)){let n$2=`vec4 ${t$1}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${l}.0, ${c}.0);\n return ${u$1.texture2D}(${e$1}, uv);\n }`;return new i.GlslLibRoutine(n$2)}let p$1=s$1,f=Math.ceil(a$1[1]/2),d=`vec4 ${t$1}(int row, int col) {\n vec2 uv = packedUVfrom2D(${p$1[1]}, ${p$1[0]}, ${f}, row, col);\n return ${u$1.texture2D}(${e$1}, uv);\n }`;return new i.GlslLibRoutine(d,[`coordinates.packedUVfrom2D`])}getPackedSampler3D(t$1,e$1,n$1){let r$1=n$1.unpackedShape,a$1=[n$1.width,n$1.height],u$1=[a$1[0],a$1[1]],c=(0,o.getGlsl)(this.context.glContext.version);if(r$1[0]===1){let o$1=r$1.slice(1),a$2=[1,2],u$2=(0,s.squeezeInputShape)(r$1,o$1),c$1=[`b`,`row`,`col`],l$1=JSON.parse(JSON.stringify(n$1));l$1.unpackedShape=u$2;let p$2=this.getPackedSamplerFromInput(t$1,e$1,l$1),f$1=`${p$2.routineBody}\n vec4 ${t$1}(int b, int row, int col) {\n return ${t$1}(${(0,s.getSqueezedParams)(c$1,a$2)});\n } `;return new i.GlslLibRoutine(f$1,p$2.dependencies)}let l=u$1[0],p$1=u$1[1],f=Math.ceil(r$1[2]/2),d=`vec4 ${t$1}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${p$1}, ${l}, ${f*Math.ceil(r$1[1]/2)}, ${f}, b, row, col);\n return ${c.texture2D}(${e$1}, uv);}`;return new i.GlslLibRoutine(d,[`coordinates.packedUVfrom3D`])}getPackedSamplerND(t$1,e$1,n$1){let r$1=n$1.unpackedShape,a$1=r$1.length,s$1=[n$1.width,n$1.height],u$1=(0,o.getGlsl)(this.context.glContext.version),c=[s$1[0],s$1[1]],l=c[1],p$1=c[0],f=Math.ceil(r$1[a$1-1]/2),d=f*Math.ceil(r$1[a$1-2]/2),h=`int b, int row, int col`,g=`b * ${d} + (row / 2) * ${f} + (col / 2)`;for(let t$2=2;t$2{let r$1=this.context.inputTextureLayouts[n$1],o$1=(r$1.unpackedShape.length>0?r$1.unpackedShape:r$1.shape).length,a$1=`_${e$1}`;t$1[a$1]=new i.GlslLibRoutine(this.getValueFromSingle(e$1,o$1,r$1.width,r$1.height,!1),[`shapeUtils.indicesToOffset${a$1}`,`coordinates.offsetToCoords`,`fragcolor.getColorAsFloat`]),a$1+=`_T`,t$1[a$1]=new i.GlslLibRoutine(this.getValueFromSingle(e$1,o$1,r$1.width,r$1.height,!0),[`shapeUtils.indicesToOffset${a$1}`,`coordinates.offsetToCoords`,`fragcolor.getColorAsFloat`])}),t$1}getValueFromSingle(t$1,e$1,n$1,r$1,i$1){let a$1=`_${t$1}`;return i$1&&(a$1+=`_T`),`\n float ${a$1}(int m[${e$1}]) {\n int offset = indicesToOffset${a$1}(m);\n vec2 coords = offsetToCoords(offset, ${n$1}, ${r$1});\n float value = getColorAsFloat(${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t$1}, coords));\n return value;\n }\n `}getPackedValueFrom(t$1,e$1,n$1,r$1,i$1){let a$1=`_${t$1}_Pack`;return i$1&&(a$1+=`_T`),`\n vec4 ${a$1}(int m[${e$1}]) {\n int offset = indicesToOffset_${t$1}(m);\n vec2 coords = offsetToCoords(offset, ${n$1}, ${r$1});\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t$1}, coords);\n }\n `}}e.CoordsGlslLib=u},8520:(t,e)=>{"use strict";var n;Object.defineProperty(e,`__esModule`,{value:!0}),e.TopologicalSortGlslRoutines=e.GlslLibRoutineNode=e.GlslLibRoutine=e.GlslLib=e.GlslContext=e.FunctionType=void 0,(n=e.FunctionType||={})[n.ValueBased=0]=`ValueBased`,n[n.Positional=1]=`Positional`,e.GlslContext=class{constructor(t$1,e$1,n$1,r){this.glContext=t$1,this.programInfo=e$1,this.inputTextureLayouts=n$1,this.outputTextureLayout=r}},e.GlslLib=class{constructor(t$1){this.context=t$1}},e.GlslLibRoutine=class{constructor(t$1,e$1){this.routineBody=t$1,this.dependencies=e$1}},e.GlslLibRoutineNode=class{constructor(t$1,e$1,n$1){this.name=t$1,this.dependencies=n$1||[],e$1&&(this.routineBody=e$1)}addDependency(t$1){t$1&&this.dependencies.push(t$1)}},e.TopologicalSortGlslRoutines=class{static returnOrderedNodes(t$1){if(!t$1||t$1.length===0)return[];if(t$1.length===1)return t$1;let e$1=new Set,n$1=new Set,r=[];return this.createOrderedNodes(t$1,e$1,n$1,r),r}static createOrderedNodes(t$1,e$1,n$1,r){for(let i=0;i0)for(let t$2=0;t$2{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.EncodingGlslLib=void 0;let r=n(8520);class i extends r.GlslLib{constructor(t$1){super(t$1)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine(`highp vec4 encode(highp float f) { + return vec4(f, 0.0, 0.0, 0.0); + } + `)}}decodeFloat32(){return{decode:new r.GlslLibRoutine(`highp float decode(highp vec4 rgba) { + return rgba.r; + } + `)}}encodeUint8(){let t$1=i.isLittleEndian()?`rgba.rgba=rgba.abgr;`:``;return{encode:new r.GlslLibRoutine(`\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ${t$1}\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n `)}}decodeUint8(){let t$1=i.isLittleEndian()?`rgba.rgba=rgba.abgr;`:``;return{decode:new r.GlslLibRoutine(`\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ${t$1}\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n `)}}static isLittleEndian(){let t$1=new ArrayBuffer(4),e$1=new Uint32Array(t$1),n$1=new Uint8Array(t$1);if(e$1[0]=3735928559,n$1[0]===239)return!0;if(n$1[0]===222)return!1;throw Error(`unknown endianness`)}}e.EncodingGlslLib=i},9894:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.FragColorGlslLib=void 0;let r=n(8520),i=n(5060);class o extends r.GlslLib{constructor(t$1){super(t$1)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){let t$1=(0,i.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\n void setFragColor(float value) {\n ${t$1.output} = encode(value);\n }\n `,[`encoding.encode`])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine(` + float getColorAsFloat(vec4 color) { + return decode(color); + } + `,[`encoding.decode`])}}}e.FragColorGlslLib=o},2848:(t,e)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.replaceInlines=void 0;let n=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;e.replaceInlines=function(t$1){let e$1={},r;for(;(r=n.exec(t$1))!==null;){let t$2=r[3].split(`,`).map(t$3=>{let e$2=t$3.trim().split(` `);return e$2&&e$2.length===2?{type:e$2[0],name:e$2[1]}:null}).filter(t$3=>t$3!==null);e$1[r[2]]={params:t$2,body:r[4]}}for(let n$1 in e$1){let i=`(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;`.replace(`__FUNC__`,n$1),o=new RegExp(i,`gm`);for(;(r=o.exec(t$1))!==null;){let i$1=r[1],o$1=r[2],a=r[3].split(`,`),s=i$1?`${i$1} ${o$1};`:``,u=e$1[n$1].body,c=``;e$1[n$1].params.forEach((t$2,e$2)=>{t$2&&(c+=`${t$2.type} ${t$2.name} = ${a[e$2]};\n`)}),u=`${c}\n ${u}`,u=u.replace(`return`,`${o$1} = `);let l=`\n ${s}\n {\n ${u}\n }\n `;t$1=t$1.replace(r[0],l)}}return t$1.replace(n,``)}},8879:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.GlslPreprocessor=void 0;let r=n(8520),i=n(2848),o=n(5483),a=n(5060);e.GlslPreprocessor=class{constructor(t$1,e$1,n$1,i$1){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(t$1,e$1,n$1,i$1),Object.keys(o.glslRegistry).forEach(t$2=>{let e$2=new o.glslRegistry[t$2](this.context);this.libs[t$2]=e$2});let a$1=this.glslLibRoutineDependencyGraph;for(let t$2 in this.libs){let e$2=this.libs[t$2].getFunctions();for(let n$2 in e$2){let i$2=t$2+`.`+n$2,o$1;a$1[i$2]?(o$1=a$1[i$2],o$1.routineBody=e$2[n$2].routineBody):(o$1=new r.GlslLibRoutineNode(i$2,e$2[n$2].routineBody),a$1[i$2]=o$1);let s=e$2[n$2].dependencies;if(s)for(let t$3=0;t$3{let r$1=n$1.split(`.`)[1];t$1.indexOf(r$1)!==-1&&e$1.push(this.glslLibRoutineDependencyGraph[n$1])}),r.TopologicalSortGlslRoutines.returnOrderedNodes(e$1)}getUniforms(t$1,e$1){let n$1=[];if(t$1)for(let e$2 of t$1)n$1.push(`uniform sampler2D ${e$2};`);if(e$1)for(let t$2 of e$1)n$1.push(`uniform ${t$2.type} ${t$2.name}${t$2.arrayLength?`[${t$2.arrayLength}]`:``};`);return n$1.join(` +`)}}},5483:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.glslRegistry=void 0;let r=n(5107),i=n(7341),o=n(9894),a=n(2655),s=n(3891);e.glslRegistry={encoding:i.EncodingGlslLib,fragcolor:o.FragColorGlslLib,vec:s.VecGlslLib,shapeUtils:a.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.ShapeUtilsGlslLib=void 0;let r=n(8520);class i extends r.GlslLib{constructor(t$1){super(t$1)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){let t$1=this.context.outputTextureLayout.shape.length,e$1={};return this.context.programInfo.inputNames.forEach((n$1,i$1)=>{let o=this.context.inputTextureLayouts[i$1].unpackedShape;if(o.length<=t$1){let i$2=o.length,a=t$1-i$2,s=`bcastIndices_${n$1}`,u=``;for(let t$2=0;t$2{let o=this.context.inputTextureLayouts[i$1].shape;if(!(o.length<2||o.length>t$1)){let i$2=o.length,a=t$1-i$2,s=`bcastMatmulIndices_${n$1}`,u=``;for(let t$2=0;t$2{let o=this.context.inputTextureLayouts[n$1].shape,a=this.context.inputTextureLayouts[n$1].strides,s=o.length,u=`indicesToOffset_${e$1}`;t$1[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,s,a)),u=`indicesToOffset_${e$1}_T`,t$1[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,s,a.slice().reverse()))}),t$1}static indexToOffsetSingle(t$1,e$1,n$1){let r$1=``;for(let t$2=e$1-1;t$2>=0;--t$2)r$1+=`\n offset += indices[${t$2}] * ${n$1[t$2]};\n `;return`\n int ${t$1}(int indices[${e$1}]) {\n int offset = 0;\n ${r$1}\n return offset;\n }\n `}offsetToIndices(){let t$1={};return this.context.programInfo.inputNames.forEach((e$1,n$1)=>{let o=this.context.inputTextureLayouts[n$1].shape,a=this.context.inputTextureLayouts[n$1].strides,s=o.length,u=`offsetToIndices_${e$1}`;t$1[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,s,a)),u=`offsetToIndices_${e$1}_T`,t$1[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,s,a.slice().reverse()))}),t$1}static offsetToIndicesSingle(t$1,e$1,n$1){let r$1=[];for(let t$2=0;t$2{let i$1=this.context.inputTextureLayouts[n$1].shape,o=i$1.length,a=`incrementIndices_${e$1}`,s=``;for(let t$2=0;t$2= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n `;t$1[a]=new r.GlslLibRoutine(u)}),t$1}}e.ShapeUtilsGlslLib=i},5060:(t,e)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.getDefaultFragShaderMain=e.getFragShaderPreamble=e.getVertexShaderSource=e.getGlsl=void 0;let n={version:``,attribute:`attribute`,varyingVertex:`varying`,varyingFrag:`varying`,texture2D:`texture2D`,output:`gl_FragColor`,outputDeclaration:``},r={version:`#version 300 es`,attribute:`in`,varyingVertex:`out`,varyingFrag:`in`,texture2D:`texture`,output:`outputColor`,outputDeclaration:`out vec4 outputColor;`};function i(t$1){return t$1===1?n:r}e.getGlsl=i,e.getVertexShaderSource=function(t$1){let e$1=i(t$1);return`${e$1.version}\n precision highp float;\n ${e$1.attribute} vec3 position;\n ${e$1.attribute} vec2 textureCoord;\n\n ${e$1.varyingVertex} vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }`},e.getFragShaderPreamble=function(t$1){let e$1=i(t$1);return`${e$1.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${e$1.varyingFrag} vec2 TexCoords;\n ${e$1.outputDeclaration}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n `},e.getDefaultFragShaderMain=function(t$1,e$1){return`\n void main() {\n int indices[${e$1}];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ${i(t$1).output} = result;\n }\n `}},3891:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.VecGlslLib=void 0;let r=n(8520);class i extends r.GlslLib{constructor(t$1){super(t$1)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){let t$1=this.context.outputTextureLayout.shape.length,e$1={add:`+=`,sub:`-=`,mul:`*=`,div:`/=`},n$1={};for(let i$1 in e$1){let o=`${i$1}Vec`,a=``;for(let n$2=0;n$2{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.WebGLInferenceHandler=void 0;let r=n(6231),i=n(9162),o=n(2517),a=n(2403),s=n(7019),u=n(8710),c=n(5611),l=n(4057),p$1=n(2039);e.WebGLInferenceHandler=class{constructor(t$1){this.session=t$1,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(t$1,e$1){return(0,l.calculateTextureWidthAndHeight)(this.session.layoutStrategy,t$1,e$1)}executeProgram(t$1,e$1){if(e$1.length{let n$2=e$2.map(t$3=>`${t$3.unpackedShape.join(`,`)};${t$3.width}x${t$3.height}`).join(`_`),r$2=t$2.name;return t$2.cacheHint&&(r$2+=`[`+t$2.cacheHint+`]`),r$2+=`:`+n$2,r$2})(t$1,n$1),i$1=this.session.programManager.getArtifact(r$1),o$1=i$1?i$1.programInfo:typeof t$1.get==`function`?t$1.get():t$1,a$1=(0,l.createTextureLayoutFromTextureType)(this.session.layoutStrategy,o$1.output.dims,o$1.output.textureType),s$1=this.createTextureData(a$1,o$1.output.type);return i$1||(i$1=this.session.programManager.build(o$1,n$1,s$1),this.session.programManager.setArtifact(r$1,i$1)),this.runProgram(i$1,n$1,s$1),s$1}run(t$1,e$1){return this.executeProgram(t$1,e$1).tensor}runProgram(t$1,e$1,n$1){for(let n$2=0;n$2this.readTexture(a$1),async t$2=>this.readTextureAsync(a$1),void 0,o$1),texture:n$1});return this.setTextureData(a$1.tensor.dataId,a$1,t$1.isPacked),a$1}getTextureData(t$1,e$1=!1){return this.session.isInitializer(t$1)?this.session.getTextureData(t$1,e$1):e$1?this.packedTextureDataCache.get(t$1):this.unpackedTextureDataCache.get(t$1)}setTextureData(t$1,e$1,n$1=!1){this.session.isInitializer(t$1)?this.session.setTextureData(t$1,e$1,n$1):(n$1?this.packedTextureDataCache:this.unpackedTextureDataCache).set(t$1,e$1)}isTextureLayoutCached(t$1,e$1=!1){return!!this.getTextureData(t$1.dataId,e$1)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(t$1=>this.session.textureManager.releaseTexture(t$1)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(t$1=>this.session.textureManager.releaseTexture(t$1)),this.unpackedTextureDataCache=new Map}readTexture(t$1){return t$1.isPacked?this.readTexture(this.unpack(t$1)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(t$1,t$1.tensor.type,t$1.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t$1))}async readTextureAsync(t$1){return t$1.isPacked?this.readTextureAsync(this.unpack(t$1)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(t$1,t$1.tensor.type,t$1.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,t$1))}pack(t$1){return this.executeProgram((0,a.createPackProgramInfoLoader)(this,t$1.tensor),[t$1.tensor])}unpack(t$1){return this.executeProgram((0,c.createUnpackProgramInfoLoader)(this,t$1.tensor),[t$1.tensor])}}},1640: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.WEBGL_OP_RESOLVE_RULES=void 0;let a=n(2898),s=o(n(7839)),u=n(4196),c=n(2069),l=n(8138),p$1=n(9663),f=n(5193),d=n(7992),h=n(1253),g=n(4776),b=n(6572),m=n(3346),y=n(5623),_=n(2870),v=n(2143),w=n(4939),x=n(718),T=n(2268),S=n(8117),O=n(2278),A=n(5524),E=n(5975),I=n(3933),P=n(6558),D=n(5723),$=n(3738),k=o(n(4909)),C=n(8428),F=n(9793);e.WEBGL_OP_RESOLVE_RULES=[[`Abs`,``,`6+`,k.abs],[`Acos`,``,`7+`,k.acos],[`Add`,``,`7+`,s.add],[`And`,``,`7+`,s.and],[`Asin`,``,`7+`,k.asin],[`Atan`,``,`7+`,k.atan],[`AveragePool`,``,`7+`,v.averagePool,v.parseAveragePoolAttributes],[`BatchNormalization`,``,`7+`,a.batchNormalization,a.parseBatchNormalizationAttributes],[`Cast`,``,`6+`,u.cast,u.parseCastAttributes],[`Ceil`,``,`6+`,k.ceil],[`Clip`,``,`6-10`,k.clip,k.parseClipAttributes],[`Clip`,``,`11+`,k.clipV11],[`Concat`,``,`4+`,c.concat,c.parseConcatAttributes],[`Conv`,``,`1+`,l.conv,l.parseConvAttributes],[`ConvTranspose`,``,`1+`,p$1.convTranspose,p$1.parseConvTransposeAttributes],[`Cos`,``,`7+`,k.cos],[`Div`,``,`7+`,s.div],[`Dropout`,``,`7+`,k.identity],[`DepthToSpace`,``,`1+`,f.depthToSpace,f.parseDepthToSpaceAttributes],[`Equal`,``,`7+`,s.equal],[`Elu`,``,`6+`,k.elu,k.parseEluAttributes],[`Exp`,``,`6+`,k.exp],[`Flatten`,``,`1+`,d.flatten,d.parseFlattenAttributes],[`Floor`,``,`6+`,k.floor],[`FusedConv`,`com.microsoft`,`1+`,l.conv,l.parseConvAttributes],[`Gather`,``,`1+`,h.gather,h.parseGatherAttributes],[`Gemm`,``,`7-10`,g.gemm,g.parseGemmAttributesV7],[`Gemm`,``,`11+`,g.gemm,g.parseGemmAttributesV11],[`GlobalAveragePool`,``,`1+`,v.globalAveragePool,v.parseGlobalAveragePoolAttributes],[`GlobalMaxPool`,``,`1+`,v.globalMaxPool],[`Greater`,``,`7+`,s.greater],[`Identity`,``,`1+`,k.identity],[`ImageScaler`,``,`1+`,b.imageScaler,b.parseImageScalerAttributes],[`InstanceNormalization`,``,`6+`,m.instanceNormalization,m.parseInstanceNormalizationAttributes],[`LeakyRelu`,``,`6+`,k.leakyRelu,k.parseLeakyReluAttributes],[`Less`,``,`7+`,s.less],[`Log`,``,`6+`,k.log],[`MatMul`,``,`1+`,y.matMul,y.parseMatMulAttributes],[`MaxPool`,``,`1+`,v.maxPool,v.parseMaxPoolAttributes],[`Mul`,``,`7+`,s.mul],[`Neg`,``,`6+`,k.neg],[`Not`,``,`1+`,k.not],[`Or`,``,`7+`,s.or],[`Pad`,``,`2-10`,_.padV2,_.parsePadAttributesV2],[`Pad`,``,`11+`,_.padV11,_.parsePadAttributesV11],[`Pow`,``,`7+`,s.pow],[`PRelu`,``,`7+`,s.pRelu],[`ReduceLogSum`,``,`1+`,w.reduceLogSum,w.parseReduceAttributes],[`ReduceMax`,``,`1+`,w.reduceMax,w.parseReduceAttributes],[`ReduceMean`,``,`1+`,w.reduceMean,w.parseReduceAttributes],[`ReduceMin`,``,`1+`,w.reduceMin,w.parseReduceAttributes],[`ReduceProd`,``,`1+`,w.reduceProd,w.parseReduceAttributes],[`ReduceSum`,``,`1-12`,w.reduceSum,w.parseReduceAttributes],[`ReduceSumSquare`,``,`1+`,w.reduceLogSumSquare,w.parseReduceAttributes],[`Relu`,``,`6+`,k.relu],[`Reshape`,``,`5+`,x.reshape],[`Resize`,``,`10`,T.resize,T.parseResizeAttributesV10],[`Resize`,``,`11+`,T.resize,T.parseResizeAttributesV11],[`Shape`,``,`1+`,S.shape],[`Sigmoid`,``,`6+`,k.sigmoid],[`Sin`,``,`7+`,k.sin],[`Slice`,``,`10+`,O.sliceV10],[`Slice`,``,`1-9`,O.slice,O.parseSliceAttributes],[`Softmax`,``,`1-12`,A.softmax,A.parseSoftmaxAttributes],[`Softmax`,``,`13+`,A.softmaxV13,A.parseSoftmaxAttributesV13],[`Split`,``,`2-12`,E.split,E.parseSplitAttributes],[`Sqrt`,``,`6+`,k.sqrt],[`Squeeze`,``,`1-12`,I.squeeze,I.parseSqueezeAttributes],[`Squeeze`,``,`13+`,I.squeezeV13],[`Sub`,``,`7+`,s.sub],[`Sum`,``,`6+`,P.sum],[`Tan`,``,`7+`,k.tan],[`Tanh`,``,`6+`,k.tanh],[`Tile`,``,`6+`,D.tile],[`Transpose`,``,`1+`,$.transpose,$.parseTransposeAttributes],[`Upsample`,``,`7-8`,F.upsample,F.parseUpsampleAttributesV7],[`Upsample`,``,`9`,F.upsample,F.parseUpsampleAttributesV9],[`Unsqueeze`,``,`1-12`,C.unsqueeze,C.parseUnsqueezeAttributes],[`Unsqueeze`,``,`13+`,C.unsqueezeV13],[`Xor`,``,`7+`,s.xor]]},2898:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseBatchNormalizationAttributes=e.batchNormalization=void 0;let r=n(246),i=n(5060),o=n(2039),a={name:`BatchNormalization`,inputNames:[`A`,`Scale`,`B`,`Mean`,`Variance`],inputTypes:[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]};e.batchNormalization=(t$1,e$1,n$1)=>(u(e$1),[t$1.run(Object.assign(Object.assign({},a),{cacheHint:n$1.cacheKey,get:()=>s(t$1,e$1,n$1)}),e$1)]),e.parseBatchNormalizationAttributes=t$1=>{let e$1=t$1.attributes.getFloat(`epsilon`,1e-5),n$1=t$1.attributes.getFloat(`momentum`,.9),i$1=t$1.attributes.getInt(`spatial`,1);return(0,r.createAttributeWithCacheKey)({epsilon:e$1,momentum:n$1,spatial:i$1})};let s=(t$1,e$1,n$1)=>{let r$1=(0,i.getGlsl)(t$1.session.backend.glContext.version),s$1=e$1[0].dims.length,[u$1,c]=t$1.calculateTextureWidthAndHeight(e$1[1].dims,o.TextureType.unpacked),l=`\n float process(int[${s$1}] indices) {\n vec2 position = offsetToCoords(indices[1], ${u$1}, ${c});\n float scale = getColorAsFloat(${r$1.texture2D}(Scale, position));\n float mean = getColorAsFloat(${r$1.texture2D}(Mean, position));\n float variance = getColorAsFloat(${r$1.texture2D}(Variance, position));\n float b = getColorAsFloat(${r$1.texture2D}(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n$1.epsilon})) ) + b;\n }`;return Object.assign(Object.assign({},a),{output:{dims:e$1[0].dims,type:e$1[0].type,textureType:o.TextureType.unpacked},shaderSource:l})},u=t$1=>{if(!t$1||t$1.length!==5)throw Error(`BatchNormalization requires 5 inputs.`);let e$1=t$1[0],n$1=t$1[1],r$1=t$1[2],i$1=t$1[3],o$1=t$1[4];if(e$1.dims.length<3||n$1.dims.length!==1||r$1.dims.length!==1||i$1.dims.length!==1||o$1.dims.length!==1||n$1.dims[0]!==e$1.dims[1]||r$1.dims[0]!==e$1.dims[1]||i$1.dims[0]!==e$1.dims[1]||o$1.dims[0]!==e$1.dims[1])throw Error(`invalid input shape.`);if(e$1.type!==`float32`&&e$1.type!==`float64`||n$1.type!==`float32`&&n$1.type!==`float64`||r$1.type!==`float32`&&r$1.type!==`float64`||i$1.type!==`float32`&&i$1.type!==`float64`||o$1.type!==`float32`&&o$1.type!==`float64`)throw Error(`invalid input tensor types.`)}},7839:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.xor=e.sub=e.pRelu=e.pow=e.or=e.mul=e.less=e.greater=e.equal=e.div=e.and=e.add=e.glslPRelu=e.glslPow=e.glslXor=e.glslOr=e.glslAnd=e.glslLess=e.glslGreater=e.glslEqual=e.glslSub=e.glslMul=e.glslDiv=e.glslAdd=void 0;let r=n(2517),i=n(8520),o=n(5060),a=n(2039);function s(){let t$1=`add_`;return{body:`\n float ${t$1}(float a, float b) {\n return a + b;\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function u(){let t$1=`div_`;return{body:`\n float ${t$1}(float a, float b) {\n return a / b;\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function c(){let t$1=`mul_`;return{body:`\n float ${t$1}(float a, float b) {\n return a * b;\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function l(){let t$1=`sub_`;return{body:`\n float ${t$1}(float a, float b) {\n return a - b;\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function p$1(){let t$1=`equal_`;return{body:`\n float ${t$1}(float a, float b) {\n return float(a == b);\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function f(){let t$1=`greater_`;return{body:`\n float ${t$1}(float a, float b) {\n return float(a > b);\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function d(){let t$1=`less_`;return{body:`\n float ${t$1}(float a, float b) {\n return float(a < b);\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function h(){let t$1=`and_`;return{body:`\n float ${t$1}(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function g(){let t$1=`or_`;return{body:`\n float ${t$1}(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function b(){let t$1=`xor_`;return{body:`\n float ${t$1}(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}function m(){return function(t$1){let e$1=`${t$1}_`;return{body:`\n float ${e$1}(float a, float b) {\n return ${t$1}(a, b);\n }\n vec4 ${e$1}(vec4 v1, vec4 v2) {\n return ${t$1}(v1, v2);\n }\n `,name:e$1,type:i.FunctionType.ValueBased}}(`pow`)}function y(){let t$1=`prelu_`;return{body:`\n float ${t$1}(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ${t$1}(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n `,name:t$1,type:i.FunctionType.ValueBased}}e.glslAdd=s,e.glslDiv=u,e.glslMul=c,e.glslSub=l,e.glslEqual=p$1,e.glslGreater=f,e.glslLess=d,e.glslAnd=h,e.glslOr=g,e.glslXor=b,e.glslPow=m,e.glslPRelu=y;let _=(t$1,e$1,n$1,r$1=e$1[0].type,i$1)=>{let o$1=t$1.session.pack?a.TextureType.packed:a.TextureType.unpacked;return{name:n$1.name,inputNames:[`A`,`B`],inputTypes:[o$1,o$1],cacheHint:i$1,get:()=>v(t$1,e$1,n$1,r$1)}},v=(t$1,e$1,n$1,i$1=e$1[0].type)=>{let s$1=t$1.session.pack?a.TextureType.packed:a.TextureType.unpacked,u$1=!r.ShapeUtil.areEqual(e$1[0].dims,e$1[1].dims),c$1=e$1[0].dims,l$1=t$1.session.pack;if(u$1){let a$1=r.BroadcastUtil.calcShape(e$1[0].dims,e$1[1].dims,!1);if(!a$1)throw Error(`Can't perform binary op on the given tensors`);c$1=a$1;let u$2=c$1.length,p$3=e$1[0].dims.length===0?1:e$1[0].dims.length,f$2=e$1[1].dims.length===0?1:e$1[1].dims.length,d$1=e$1[0].dims.length===0?`aindices[0] = 0;`:`bcastIndices_A(indices, aindices);`,h$1=e$1[1].dims.length===0?`bindices[0] = 0;`:`bcastIndices_B(indices, bindices);`,g$1=(0,o.getGlsl)(t$1.session.backend.glContext.version),b$1=l$1?`\n ${n$1.body}\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ${n$1.name}(a, b);\n ${g$1.output} = result;\n }`:`\n ${n$1.body}\n float process(int indices[${u$2}]) {\n int aindices[${p$3}];\n int bindices[${f$2}];\n ${d$1}\n ${h$1}\n return ${n$1.name}(_A(aindices), _B(bindices));\n }`;return{name:n$1.name,inputNames:[`A`,`B`],inputTypes:[s$1,s$1],output:{dims:c$1,type:i$1,textureType:s$1},shaderSource:b$1,hasMain:l$1}}let p$2=(0,o.getGlsl)(t$1.session.backend.glContext.version),f$1=`\n ${n$1.body}\n void main() {\n vec4 v1 = ${p$2.texture2D}(A, TexCoords);\n vec4 v2 = ${p$2.texture2D}(B, TexCoords);\n vec4 result = ${n$1.name}(v1, v2);\n ${p$2.output} = result;\n }\n `;return{name:n$1.name,inputNames:[`A`,`B`],inputTypes:[s$1,s$1],output:{dims:e$1[0].dims,type:i$1,textureType:s$1},shaderSource:f$1,hasMain:!0}};e.add=(t$1,e$1)=>[t$1.run(_(t$1,e$1,s()),e$1)],e.and=(t$1,e$1)=>[t$1.run(_(t$1,e$1,h(),`bool`),e$1)],e.div=(t$1,e$1)=>[t$1.run(_(t$1,e$1,u()),e$1)],e.equal=(t$1,e$1)=>[t$1.run(_(t$1,e$1,p$1(),`bool`),e$1)],e.greater=(t$1,e$1)=>[t$1.run(_(t$1,e$1,f(),`bool`),e$1)],e.less=(t$1,e$1)=>[t$1.run(_(t$1,e$1,d(),`bool`),e$1)],e.mul=(t$1,e$1)=>[t$1.run(_(t$1,e$1,c()),e$1)],e.or=(t$1,e$1)=>[t$1.run(_(t$1,e$1,g(),`bool`),e$1)],e.pow=(t$1,e$1)=>[t$1.run(_(t$1,e$1,m()),e$1)],e.pRelu=(t$1,e$1)=>[t$1.run(_(t$1,e$1,y()),e$1)],e.sub=(t$1,e$1)=>[t$1.run(_(t$1,e$1,l()),e$1)],e.xor=(t$1,e$1)=>[t$1.run(_(t$1,e$1,b(),`bool`),e$1)]},4196:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseCastAttributes=e.cast=void 0;let r=n(2517);e.cast=(t$1,e$1,n$1)=>(i(e$1),[t$1.cast(e$1[0],n$1)]),e.parseCastAttributes=t$1=>r.ProtoUtil.tensorDataTypeFromProto(t$1.attributes.getInt(`to`));let i=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Cast requires 1 input.`);if(t$1[0].type===`string`)throw Error(`Invalid input type.`)}},1163:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createPackedConcatProgramInfoLoader=void 0;let r=n(5060),i=n(2039),o=n(9390),a=n(2827);e.createPackedConcatProgramInfoLoader=(t$1,e$1,n$1)=>{let u=(c=e$1.length,l=n$1.cacheKey,{name:`Concat (packed)`,inputNames:Array.from({length:c},(t$2,e$2)=>`X${e$2}`),inputTypes:Array(c).fill(i.TextureType.packed),cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((t$2,e$2,n$2,u$1)=>{let c$1=n$2[0].dims.slice();if(u$1>=c$1.length||u$1<-1*c$1.length)throw Error(`axis specified for concat doesn't match input dimensionality`);u$1<0&&(u$1=c$1.length+u$1);let l$1=c$1.slice(0);for(let t$3=1;t$3t$3.dims),b=(0,o.getGlChannels)(p$1),m=Array(g.length-1);m[0]=g[0][u$1];for(let t$3=1;t$3= ${m[t$3-1]}) {\n return getChannel(\n getX${t$3}(${s(b,y,e$3)}),\n vec2(${s(_,y,e$3)}));\n }`}let x=m.length,T=m[m.length-1];w+=`\n return getChannel(\n getX${x}(${s(b,y,T)}),\n vec2(${s(_,y,T)}));`;let S=(0,r.getGlsl)(t$2.session.backend.glContext.version),O=`\n ${h}\n float getValue(${b.map(t$3=>`int `+t$3)}) {\n ${w}\n }\n\n void main() {\n ${d} coords = getOutputCoords();\n int lastDim = coords.${b[p$1-1]};\n coords.${b[p$1-1]} = coords.${b[p$1-2]};\n coords.${b[p$1-2]} = lastDim;\n\n vec4 result = vec4(getValue(${f}), 0., 0., 0.);\n\n ${f[p$1-1]} = ${f[p$1-1]} + 1;\n if (${f[p$1-1]} < ${l$1[p$1-1]}) {\n result.g = getValue(${f});\n }\n\n ${f[p$1-2]} = ${f[p$1-2]} + 1;\n if (${f[p$1-2]} < ${l$1[p$1-2]}) {\n result.a = getValue(${f});\n }\n\n ${f[p$1-1]} = ${f[p$1-1]} - 1;\n if (${f[p$1-2]} < ${l$1[p$1-2]} &&\n ${f[p$1-1]} < ${l$1[p$1-1]}) {\n result.b = getValue(${f});\n }\n ${S.output} = result;\n }\n `;return Object.assign(Object.assign({},e$2),{output:{dims:l$1,type:n$2[0].type,textureType:i.TextureType.packed},shaderSource:O,hasMain:!0})})(t$1,u,e$1,n$1.axis)})};let s=(t$1,e$1,n$1)=>{let r$1=t$1.indexOf(e$1);return t$1.map((t$2,e$2)=>e$2===r$1?`${t$2} - ${n$1}`:t$2).join()}},2069:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseConcatAttributes=e.concat=void 0;let r=n(246),i=n(2039),o=n(1163);e.concat=(t$1,e$1,n$1)=>(p$1(e$1),t$1.session.pack&&e$1[0].dims.length>1?[t$1.run((0,o.createPackedConcatProgramInfoLoader)(t$1,e$1,n$1),e$1)]:[t$1.run(a(t$1,e$1,n$1),e$1)]);let a=(t$1,e$1,n$1)=>{let r$1=(o$1=e$1.length,a$1=n$1.cacheKey,{name:`Concat`,inputNames:Array.from({length:o$1},(t$2,e$2)=>`X${e$2}`),inputTypes:Array(o$1).fill(i.TextureType.unpacked),cacheHint:a$1});var o$1,a$1;return Object.assign(Object.assign({},r$1),{get:()=>((t$2,e$2,n$2,r$2)=>{let o$2=n$2[0].dims.slice();if(r$2>=o$2.length||r$2<-1*o$2.length)throw Error(`axis specified for concat doesn't match input dimensionality`);r$2<0&&(r$2=o$2.length+r$2);let a$2=o$2.slice(0);for(let t$3=1;t$3`int getTextureWhereDataResides(int index) {\n ${t$1.map((t$2,e$1)=>`if(index<${t$2}) {return ${e$1};}\n`).join(``)}\n }`,u=t$1=>s(t$1),c=(t$1,e$1)=>{let n$1=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${e$1}]) {`];for(let e$2=0;e$2{let e$1=[`int getSizeInConcatAxisValueFromIndex(int index) {`];for(let n$1=0;n$1(0,r.createAttributeWithCacheKey)({axis:t$1.attributes.getInt(`axis`)});let p$1=t$1=>{if(!t$1||t$1.length<1)throw Error(`too few inputs`);let e$1=t$1[0].type,n$1=t$1[0].dims.length;if(e$1===`string`)throw Error(`string tensor is not supported yet`);for(let r$1 of t$1){if(r$1.type!==e$1)throw Error(`input tensors should be one type`);if(r$1.dims.length!==n$1)throw Error(`input tensors should have the same shape`)}}},4770:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createUnpackedGroupedConvProgramInfoLoader=void 0;let r=n(6231),i=n(5060),o=n(2039),a=n(8138),s=n(2823);e.createUnpackedGroupedConvProgramInfoLoader=(t$1,e$1,n$1)=>{let u=(c=e$1.length>2,l=n$1.cacheKey,{name:`GroupedConv`,inputNames:c?[`X`,`W`,`Bias`]:[`X`,`W`],inputTypes:c?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((t$2,e$2,n$2,u$1)=>{let c$1=e$2.length>2?`value += getBias(output_channel);`:``,l$1=e$2[0].dims.slice(),p$1=e$2[1].dims.slice(),f=p$1[0]/u$1.group;r.Logger.verbose(`GroupedConv`,`autpPad:${u$1.autoPad}, dilations:${u$1.dilations}, group:${u$1.group}, kernelShape:${u$1.kernelShape}, pads:${u$1.pads}, strides:${u$1.strides}`);let d=(0,a.calculateOutputShape)(l$1,p$1,u$1.dilations,u$1.pads,u$1.strides),h=(0,i.getGlsl)(t$2.session.backend.glContext.version),{activationFunction:g,applyActivation:b}=(0,s.getActivationSnippet)(u$1),m=`\n const ivec2 strides = ivec2(${u$1.strides[0]}, ${u$1.strides[1]});\n const ivec2 pads = ivec2(${u$1.pads[0]}, ${u$1.pads[1]});\n ${g}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ${f};\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ${p$1[1]}; wInChannel++) {\n int input_channel = group_id * ${p$1[1]} + wInChannel;\n for (int wHeight = 0; wHeight < ${p$1[2]}; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ${u$1.dilations[0]};\n\n if (xHeight < 0 || xHeight >= ${l$1[2]}) {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ${p$1[3]}; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ${u$1.dilations[1]};\n if (xWidth < 0 || xWidth >= ${l$1[3]}) {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ${c$1}\n ${b}\n ${h.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n$2),{output:{dims:d,type:e$2[0].type,textureType:o.TextureType.unpacked},shaderSource:m,hasMain:!0})})(t$1,e$1,u,n$1)})}},1386:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.conv2DPacked=e.conv2DPackedPointwise=void 0;let r=n(8138),i=n(8555),o=n(708);e.conv2DPackedPointwise=(t$1,e$1,n$1)=>{let i$1=e$1[0].dims,a=e$1[1].dims,s=(0,r.calculateOutputShape)(i$1,a,n$1.dilations,n$1.pads,n$1.strides),u=t$1.reshapePacked(e$1[0],[i$1[1],i$1[2]*i$1[3]]),c=t$1.reshapePacked(e$1[1],[a[0],a[1]]),l=e$1.length>2?[c,u,e$1[2]]:[c,u],p$1=t$1.run((0,o.createPackedMatmulProgramInfoLoader)(t$1,l,n$1),l);return t$1.reshapePacked(p$1,s)},e.conv2DPacked=(t$1,e$1,n$1)=>{let a=e$1[0].dims,s=e$1[1].dims,u=(0,r.calculateOutputShape)(a,s,n$1.dilations,n$1.pads,n$1.strides),c=t$1.run((0,i.createPackedIm2ColProgramInfoLoader)(t$1,e$1[0],e$1[1],u,n$1),[e$1[0]]),l=t$1.reshapePacked(e$1[1],[s[0],s[1]*s[2]*s[3]]),p$1=e$1.length===3?[l,c,e$1[2]]:[l,c],f=t$1.run((0,o.createPackedMatmulProgramInfoLoader)(t$1,p$1,n$1),p$1);return t$1.reshapePacked(f,u)}},9663:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseConvTransposeAttributes=e.convTranspose=void 0;let r=n(246),i=n(5060),o=n(2039),a=n(2823),s=(t$1,e$1,n$1,r$1,i$1,o$1)=>(t$1-1)*e$1+n$1+(r$1-1)*i$1+1-o$1,u=(t$1,e$1,n$1,r$1,i$1)=>{let o$1=Math.floor(t$1/2);e$1===`SAME_UPPER`?(n$1[r$1]=o$1,n$1[i$1]=t$1-o$1):e$1===`SAME_LOWER`&&(n$1[r$1]=t$1-o$1,n$1[i$1]=o$1)};e.convTranspose=(t$1,e$1,n$1)=>(f(e$1,n$1),c(t$1,e$1,n$1));let c=(t$1,e$1,n$1)=>{let r$1=p$1(n$1,e$1);return[l(t$1,e$1,r$1)]},l=(t$1,e$1,n$1)=>t$1.run(((t$2,e$2,n$2)=>{let r$1=(s$1=e$2.length>2,u$1=n$2.cacheKey,{name:`ConvTranspose`,inputNames:s$1?[`X`,`W`,`B`]:[`X`,`W`],inputTypes:s$1?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:u$1});var s$1,u$1;return Object.assign(Object.assign({},r$1),{get:()=>((t$3,e$3,n$3,r$2)=>{let s$2=e$3.length>2?`getB(output_channel)`:`0.0`,u$2=e$3[0].dims,c$1=e$3[1].dims,l$1=c$1[1],p$2=c$1[0]/r$2.group,f$1=[e$3[0].dims[0],e$3[1].dims[1]*r$2.group,...r$2.outputShape],d=(0,i.getGlsl)(t$3.session.backend.glContext.version),{activationFunction:h,applyActivation:g}=(0,a.getActivationSnippet)(r$2),b=`\n const ivec2 strides = ivec2(${r$2.strides[0]}, ${r$2.strides[1]});\n const ivec2 pads = ivec2(${r$2.pads[0]}, ${r$2.pads[1]});\n ${h}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ${l$1};\n int wOutChannel = output_channel - group_id * ${l$1};\n\n float value = ${s$2};\n for (int inChannelOffset = 0; inChannelOffset < ${p$2}; inChannelOffset++) {\n int input_channel = group_id * ${p$2} + inChannelOffset;\n for (int wWOff = 0; wWOff < ${c$1[2]}; wWOff++) {\n for (int wHOff = 0; wHOff < ${c$1[3]}; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ${r$2.dilations[0]}, wHOff * ${r$2.dilations[1]});\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ${u$2[2]} &&\n wLocIn.y >= 0 && wLocIn.y < ${u$2[3]}\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ${g}\n ${d.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n$3),{output:{dims:f$1,type:e$3[0].type,textureType:o.TextureType.unpacked},shaderSource:b,hasMain:!0})})(t$2,e$2,r$1,n$2)})})(t$1,e$1,n$1),e$1),p$1=(t$1,e$1)=>{let n$1=t$1.kernelShape.slice();if(t$1.kernelShape.length===0)for(let t$2=2;t$2{let l$1=t$2.length-2,p$2=c$1.length===0;for(let f$1=0;f$1{let e$1=t$1.attributes,n$1=(0,a.parseInternalActivationAttributes)(e$1),i$1=e$1.getString(`auto_pad`,`NOTSET`),o$1=e$1.getInts(`dilations`,[1,1]),s$1=e$1.getInt(`group`,1),u$1=e$1.getInts(`kernel_shape`,[]),c$1=e$1.getInts(`output_padding`,[0,0]),l$1=e$1.getInts(`output_shape`,[]),p$2=e$1.getInts(`pads`,[0,0,0,0]),f$1=e$1.getInts(`strides`,[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i$1,dilations:o$1,group:s$1,kernelShape:u$1,outputPadding:c$1,outputShape:l$1,pads:p$2,strides:f$1},n$1))};let f=(t$1,e$1)=>{if(!t$1||t$1.length!==2&&t$1.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(t$1[0].dims.length!==4||t$1[1].dims.length!==4)throw Error(`currently only support 2-dimensional conv`);if(t$1[0].dims[1]!==t$1[1].dims[0])throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);let n$1=t$1[1].dims[1]*e$1.group;if(t$1.length===3&&(t$1[2].dims.length!==1||t$1[2].dims[0]!==n$1))throw Error(`invalid bias`);let r$1=t$1[0].dims.length-2;if(e$1.dilations.length!==r$1)throw Error(`dilations should be ${r$1}D`);if(e$1.strides.length!==r$1)throw Error(`strides should be ${r$1}D`);if(e$1.pads.length!==2*r$1)throw Error(`pads should be ${2*r$1}D`);if(e$1.outputPadding.length!==r$1)throw Error(`output_padding should be ${r$1}D`);if(e$1.kernelShape.length!==0&&e$1.kernelShape.length!==t$1[1].dims.length-2)throw Error(`invalid kernel shape`);if(e$1.outputShape.length!==0&&e$1.outputShape.length!==t$1[0].dims.length-2)throw Error(`invalid output shape`);if(t$1[0].type!==`float32`||t$1[1].type!==`float32`)throw Error(`ConvTranspose input(X,W) should be float tensor`);if(t$1.length===3&&t$1[2].type!==`float32`)throw Error(`ConvTranspose input(bias) should be float tensor`)}},8138:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseConvAttributes=e.conv=e.calculateOutputShape=void 0;let r=n(246),i=n(2517),o=n(4770),a=n(1386),s=n(9828),u=n(2823),c=n(3248),l=n(5623);e.calculateOutputShape=(t$1,e$1,n$1,r$1,i$1)=>{let o$1=t$1[0],a$1=t$1.slice(2),s$1=a$1.length,u$1=e$1[0],c$1=e$1.slice(2).map((t$2,e$2)=>t$2+(t$2-1)*(n$1[e$2]-1)),l$1=a$1.map((t$2,e$2)=>t$2+r$1[e$2]+r$1[e$2+s$1]).map((t$2,e$2)=>Math.floor((t$2-c$1[e$2]+i$1[e$2])/i$1[e$2]));return[o$1,u$1].concat(...l$1)},e.conv=(t$1,e$1,n$1)=>(g(e$1,n$1),p$1(t$1,e$1,n$1));let p$1=(t$1,e$1,n$1)=>{let r$1=h(n$1,e$1),i$1=t$1.session.pack,s$1=r$1.kernelShape[0]===1&&r$1.kernelShape[1]===1;return r$1.group>1?[t$1.run((0,o.createUnpackedGroupedConvProgramInfoLoader)(t$1,e$1,r$1),e$1)]:s$1&&i$1?[f(t$1,e$1,r$1)]:i$1&&e$1[0].dims.length===4&&e$1[0].dims[0]===1&&!s$1?[(0,a.conv2DPacked)(t$1,e$1,r$1)]:[d(t$1,e$1,r$1)]},f=(t$1,n$1,r$1)=>{let i$1=n$1[0].dims,o$1=n$1[1].dims,a$1=(0,e.calculateOutputShape)(i$1,o$1,r$1.dilations,r$1.pads,r$1.strides),s$1=t$1.reshapeUnpacked(n$1[0],[i$1[1],i$1[2]*i$1[3]]),u$1=t$1.reshapeUnpacked(n$1[1],[o$1[0],o$1[1]]),c$1=n$1.length>2?[u$1,s$1,n$1[2]]:[u$1,s$1],p$2=t$1.run((0,l.createMatmulProgramInfoLoader)(c$1,r$1),c$1);return t$1.reshapeUnpacked(p$2,a$1)},d=(t$1,n$1,r$1)=>{let i$1=n$1[0].dims,o$1=n$1[1].dims,a$1=(0,e.calculateOutputShape)(i$1,o$1,r$1.dilations,r$1.pads,r$1.strides),u$1=t$1.run((0,c.createIm2ColProgramInfoLoader)(t$1,n$1[0],n$1[1],a$1,r$1),[n$1[0]]),l$1=n$1.length===3?[u$1,n$1[1],n$1[2]]:[u$1,n$1[1]];return t$1.run((0,s.createDotProductProgramInfoLoader)(t$1,n$1,a$1,r$1),l$1)},h=(t$1,e$1)=>{let n$1=t$1.kernelShape.slice();if(t$1.kernelShape.length===0)for(let t$2=2;t$2{let e$1=t$1.attributes,n$1=(0,u.parseInternalActivationAttributes)(e$1),i$1=e$1.getString(`auto_pad`,`NOTSET`),o$1=e$1.getInts(`dilations`,[1,1]),a$1=e$1.getInt(`group`,1),s$1=e$1.getInts(`kernel_shape`,[]),c$1=e$1.getInts(`pads`,[0,0,0,0]),l$1=e$1.getInts(`strides`,[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i$1,dilations:o$1,group:a$1,kernelShape:s$1,pads:c$1,strides:l$1},n$1))};let g=(t$1,e$1)=>{if(!t$1||t$1.length!==2&&t$1.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(t$1[0].dims.length!==4||t$1[1].dims.length!==4)throw Error(`currently only support 2-dimensional conv`);if(t$1[0].dims[1]!==t$1[1].dims[1]*e$1.group)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);if(t$1.length===3&&(t$1[2].dims.length!==1||t$1[1].dims[0]!==t$1[2].dims[0]))throw Error(`invalid bias`);let n$1=t$1[0].dims.length-2;if(e$1.dilations.length!==n$1)throw Error(`dilations should be ${n$1}D`);if(e$1.strides.length!==n$1)throw Error(`strides should be ${n$1}D`);if(e$1.pads.length!==2*n$1)throw Error(`pads should be ${2*n$1}D`);if(e$1.kernelShape.length!==0&&e$1.kernelShape.length!==t$1[1].dims.length-2)throw Error(`invalid kernel shape`);if(t$1[0].type!==`float32`||t$1[1].type!==`float32`)throw Error(`Conv input(X,W) should be float tensor`);if(t$1.length===3&&t$1[2].type!==`float32`)throw Error(`Conv input(bias) should be float tensor`)}},5193:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseDepthToSpaceAttributes=e.depthToSpace=void 0;let r=n(3738);e.depthToSpace=(t$1,e$1,n$1)=>{i(e$1);let o=n$1.blocksize,a=o*o,s=n$1.mode===`DCR`?[0,3,4,1,5,2]:[0,1,4,2,5,3],u=n$1.mode===`DCR`?[e$1[0].dims[0],o,o,e$1[0].dims[1]/a,e$1[0].dims[2],e$1[0].dims[3]]:[e$1[0].dims[0],e$1[0].dims[1]/a,o,o,e$1[0].dims[2],e$1[0].dims[3]],c=t$1.reshapeUnpacked(e$1[0],u),l={perm:s,cacheKey:`${s}`},[p$1]=(0,r.transpose)(t$1,[c],l),f=[e$1[0].dims[0],e$1[0].dims[1]/a,e$1[0].dims[2]*o,e$1[0].dims[3]*o];return[t$1.reshapeUnpacked(p$1,f)]},e.parseDepthToSpaceAttributes=t$1=>{let e$1=t$1.attributes.getInt(`blocksize`);if(e$1<1)throw Error(`blocksize must be >= 1, but got : ${e$1} for DepthToSpace`);let n$1=t$1.attributes.getString(`mode`,`DCR`);if(n$1!==`DCR`&&n$1!==`CRD`)throw Error(`unrecognized mode: ${n$1} for DepthToSpace`);return{mode:n$1,blocksize:e$1}};let i=t$1=>{if(t$1.length!==1)throw Error(`DepthToSpace expect 1 inputs, but got ${t$1.length}`);if(t$1[0].type===`string`||t$1[0].dims.length!==4)throw TypeError(`DepthToSpace input should be a 4-D numeric tensor`)}},9828:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createDotProductProgramInfoLoader=void 0;let r=n(2517),i=n(5060),o=n(2039),a=n(2823),s=n(3248);e.createDotProductProgramInfoLoader=(t$1,e$1,n$1,u)=>{let c=((t$2,e$2)=>({name:`ConvDotProduct`,inputNames:t$2?[`Im2Col`,`K`,`B`]:[`Im2Col`,`K`],inputTypes:t$2?[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.packedLastDimension],cacheKey:e$2.activationCacheKey}))(e$1.length>2,u);return Object.assign(Object.assign({},c),{get:()=>((t$2,e$2,n$2,u$1,c$1)=>{let l=n$2[0].dims,p$1=n$2[1].dims,f=[p$1[0],Math.ceil(l[1]*p$1[2]*p$1[3]/4)],d=(0,s.calculateIm2ColDims)(l,p$1,u$1),[h,g]=t$2.calculateTextureWidthAndHeight(f,o.TextureType.packedLastDimension),b=r.ShapeUtil.computeStrides(d),[m,y]=t$2.calculateTextureWidthAndHeight(d,o.TextureType.packedLastDimension),_=u$1.length,v=n$2.length<3?`0.0`:`_B(b)`,w=Math.ceil(l[1]*p$1[2]*p$1[3]/4),{activationFunction:x,applyActivation:T}=(0,a.getActivationSnippet)(c$1),S=(0,i.getGlsl)(t$2.session.backend.glContext.version),O=`\n${x}\nfloat process(int indices[${_}]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ${b[0]} + im2col[1] * ${b[1]} + im2col[2] * ${b[2]};\n int kernelOffset = indices[1] * ${f[1]};\n float value = ${v};\n for (int i = 0; i < ${w}; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${m}, ${y});\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${h}, ${g});\n value += dot(${S.texture2D}(Im2Col, im2colCoords), ${S.texture2D}(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ${T}\n return value;\n}`;return Object.assign(Object.assign({},e$2),{output:{dims:u$1,type:n$2[0].type,textureType:o.TextureType.unpacked},shaderSource:O})})(t$1,c,e$1,n$1,u)})}},7992:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseFlattenAttributes=e.flatten=void 0;let r=n(2517);e.flatten=(t$1,e$1,n$1)=>{i(e$1,n$1);let o=r.ShapeUtil.flattenShape(e$1[0].dims,n$1);return[t$1.reshapeUnpacked(e$1[0],o)]},e.parseFlattenAttributes=t$1=>t$1.attributes.getInt(`axis`,1);let i=(t$1,e$1)=>{if(!t$1||t$1.length!==1)throw Error(`Flatten requires 1 input.`);let n$1=t$1[0].dims.length;if(n$1===0)throw Error(`scalar tensor is not supported.`);if(e$1<-n$1||e$1>n$1)throw Error(`Invalid axis`);if(t$1[0].type===`string`)throw Error(`string tensor is not supported.`)}},2823:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseInternalActivationAttributes=e.getActivationSnippet=void 0;let r=n(2517),i=n(4909);e.getActivationSnippet=function(t$1){let e$1;switch(t$1.activation){case`Relu`:e$1=(0,i.glslRelu)();break;case`Sigmoid`:e$1=(0,i.glslSigmoid)();break;case`Clip`:e$1=(0,i.glslClip)(t$1.clipMin,t$1.clipMax);break;default:return{activationFunction:``,applyActivation:``}}let n$1=e$1.name;return{activationFunction:e$1.body,applyActivation:`value = ${n$1}_(value);`}},e.parseInternalActivationAttributes=t$1=>{let e$1=t$1.getString(`activation`,``);if(e$1===`Clip`){let[n$1,i$1]=t$1.getFloats(`activation_params`,[r.MIN_CLIP,r.MAX_CLIP]);return{activation:e$1,clipMax:i$1,clipMin:n$1,activationCacheKey:`${e$1}:${n$1},${i$1}`}}return{activation:e$1,activationCacheKey:e$1}}},1253:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseGatherAttributes=e.gather=void 0;let r=n(246),i=n(782),o=n(2517),a=n(2039);e.gather=(t$1,e$1,n$1)=>(c(e$1,n$1.axis),[t$1.run(u(t$1,e$1,n$1),e$1)]),e.parseGatherAttributes=t$1=>(0,r.createAttributeWithCacheKey)({axis:t$1.attributes.getInt(`axis`,0)});let s={name:`Gather`,inputNames:[`A`,`B`],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked]},u=(t$1,e$1,n$1)=>{let r$1=Object.assign(Object.assign({},s),{cacheHint:n$1.cacheKey});return Object.assign(Object.assign({},r$1),{get:()=>((t$2,e$2,n$2,r$2)=>{let i$1=n$2[0].dims.slice(),s$1=n$2[1].dims.slice(),u$1=Array(i$1.length+s$1.length-1);r$2=o.ShapeUtil.normalizeAxis(r$2,i$1.length);let c$1=[];for(let t$3=0;t$3{if(!t$1||t$1.length!==2)throw Error(`Gather requires 2 inputs.`);let n$1=t$1[0].dims.length;if(n$1<1)throw Error(`Invalid input shape.`);if(e$1<-n$1||e$1>n$1-1)throw Error(`Invalid axis.`);if(i.NUMBER_TYPES.indexOf(t$1[0].type)===-1||t$1[1].type!==`int32`&&t$1[1].type!==`int16`)throw Error(`Invaid input type.`)}},4776:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseGemmAttributesV11=e.parseGemmAttributesV7=e.gemm=void 0;let r=n(246),i=n(2517),o=n(2039);e.gemm=(t$1,e$1,n$1)=>(c(e$1,n$1),[t$1.run(s(e$1,n$1),e$1)]);let a=(t$1,e$1)=>{let n$1=t$1.attributes.getInt(`transA`,0)!==0,i$1=t$1.attributes.getInt(`transB`,0)!==0,o$1=t$1.attributes.getFloat(`alpha`,1),a$1=t$1.attributes.getFloat(`beta`,1);return(0,r.createAttributeWithCacheKey)({transA:n$1,transB:i$1,alpha:o$1,beta:a$1,isOptionalC:e$1})};e.parseGemmAttributesV7=t$1=>a(t$1,!1),e.parseGemmAttributesV11=t$1=>a(t$1,!0);let s=(t$1,e$1)=>{let n$1={name:`Gemm`,inputNames:t$1.length===3?[`A`,`B`,`C`]:[`A`,`B`],inputTypes:t$1.length===3?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],key:e$1.cacheKey};return Object.assign(Object.assign({},n$1),{get:()=>u(n$1,t$1,e$1)})},u=(t$1,e$1,n$1)=>{let r$1=e$1[0].dims.slice(),a$1=e$1[1].dims.slice(),[s$1,u$1]=i.GemmUtil.getShapeOfGemmResult(r$1,n$1.transA,a$1,n$1.transB,e$1.length===3?e$1[2].dims:void 0),c$1=[s$1,u$1];if(!c$1)throw Error(`Can't use gemm on the given tensors`);let l=r$1[r$1.length-1],p$1=``;n$1.transA&&(l=r$1[0]),n$1.transA&&n$1.transB?p$1=`value += _A_T(a) * _B_T(b);`:n$1.transA&&!n$1.transB?p$1=`value += _A_T(a) * _B(b);`:!n$1.transA&&n$1.transB?p$1=`value += _A(a) * _B_T(b);`:n$1.transA||n$1.transB||(p$1=`value += _A(a) * _B(b);`);let f=c$1.length,d=`\n float process(int indices[${f}]) {\n int a[${f}];\n int b[${f}];\n ${e$1.length===3?`int c[${e$1[2].dims.length}];`:``}\n\n copyVec(indices, a);\n copyVec(indices, b);\n ${e$1.length===3?`bcastIndices_C(indices, c);`:``}\n\n float value = 0.0;\n for (int k=0; k<${l}; ++k) {\n a[${f-1}] = k;\n b[${f-2}] = k;\n ${p$1}\n }\n\n value = value * alpha;\n ${e$1.length===3?`value += beta * _C(c);`:``}\n return value;\n }`;return Object.assign(Object.assign({},t$1),{output:{dims:c$1,type:e$1[0].type,textureType:o.TextureType.unpacked},variables:[{name:`alpha`,type:`float`,data:n$1.alpha},{name:`beta`,type:`float`,data:n$1.beta}],shaderSource:d})},c=(t$1,e$1)=>{if(!t$1)throw Error(`Input is missing`);if(e$1.isOptionalC&&(t$1.length<2||t$1.length>3))throw Error(`Invaid input shape.`);if(!e$1.isOptionalC&&t$1.length!==3)throw Error(`Gemm requires 3 inputs`);if(t$1.length===3&&t$1[2].dims.length!==1&&t$1[2].dims.length!==2)throw Error(`Invalid input shape of C`);if(t$1[0].type!==`float32`&&t$1[0].type!==`float64`||t$1[1].type!==`float32`&&t$1[1].type!==`float64`||t$1.length===3&&t$1[2].type!==`float32`&&t$1[2].type!==`float64`)throw Error(`Invalid input type.`);if(t$1[0].type!==t$1[1].type||t$1.length===3&&t$1[0].type!==t$1[2].type)throw Error(`Input types are mismatched`)}},8555:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createPackedIm2ColProgramInfoLoader=void 0;let r=n(5060),i=n(2039),o=n(2827);e.createPackedIm2ColProgramInfoLoader=(t$1,e$1,n$1,a,s)=>{let u=(c=s.cacheKey,{name:`Im2Col (packed)`,inputNames:[`A`],inputTypes:[i.TextureType.packed],cacheHint:c});var c;return Object.assign(Object.assign({},u),{get:()=>((t$2,e$2,n$2,a$1,s$1,u$1)=>{let c$1=n$2.dims,l=a$1.dims,p$1=s$1.length,f=[l[1]*l[2]*l[3],s$1[2]*s$1[3]],d=l[2]*l[3],h=(0,o.unpackFromChannel)(),g=(0,r.getGlsl)(t$2.session.backend.glContext.version),b=``;for(let t$3=0;t$3<=1;t$3++)for(let e$3=0;e$3<=1;e$3++)b+=`\n blockIndex = rc.x + ${e$3};\n pos = rc.y + ${t$3};\n\n if(blockIndex < ${f[1]} && pos < ${f[0]}) {\n offsetY = int(blockIndex / (${s$1[p$1-1]})) * ${u$1.strides[0]} -\n ${u$1.pads[0]};\n d0 = offsetY + ${u$1.dilations[0]} * (imod(pos, ${d}) / ${l[2]});\n\n if(d0 < ${c$1[2]} && d0 >= 0) {\n offsetX = imod(blockIndex, ${s$1[p$1-1]}) * ${u$1.strides[1]} -\n ${u$1.pads[1]};\n d1 = offsetX + ${u$1.dilations[1]} * imod(imod(pos, ${d}), ${l[2]});\n\n if(d1 < ${c$1[3]} && d1 >= 0) {\n\n ch = int(float(pos)/ ${d}.);\n innerDims = vec2(d0, d1);\n result[${2*t$3+e$3}] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n `;let m=`\n ${h}\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ${b}\n ${g.output} = result;\n }\n `;return Object.assign(Object.assign({},e$2),{output:{dims:f,type:n$2.type,textureType:i.TextureType.packed},shaderSource:m,hasMain:!0})})(t$1,u,e$1,n$1,a,s)})}},3248:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.calculateIm2ColDims=e.createIm2ColProgramInfoLoader=void 0;let r=n(2039);e.createIm2ColProgramInfoLoader=(t$1,n$1,i,o,a)=>{let s=(u=a.cacheKey,{name:`Im2Col`,inputNames:[`X`],inputTypes:[r.TextureType.unpacked],cacheHint:u});var u;return Object.assign(Object.assign({},s),{get:()=>((t$2,n$2,i$1,o$1,a$1,s$1)=>{let u$1=i$1.dims,c=o$1.dims,l=a$1.length,p$1=(0,e.calculateIm2ColDims)(u$1,c,a$1,4),f=`\n const int XC = ${u$1[1]};\n const int XH = ${u$1[2]};\n const int XW = ${u$1[3]};\n const int KH = ${s$1.kernelShape[0]};\n const int KW = ${s$1.kernelShape[1]};\n const int dilationH = ${s$1.dilations[0]};\n const int dilationW = ${s$1.dilations[1]};\n const int strideH = ${s$1.strides[0]};\n const int strideW = ${s$1.strides[1]};\n const int padH = ${s$1.pads[0]};\n const int padW = ${s$1.pads[1]};\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[${l}]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[${u$1.length}];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n `;return Object.assign(Object.assign({},n$2),{output:{dims:p$1,type:i$1.type,textureType:r.TextureType.packedLastDimension},shaderSource:f})})(0,s,n$1,i,o,a)})},e.calculateIm2ColDims=(t$1,e$1,n$1,r$1=4)=>[n$1[0],n$1[2],n$1[3],Math.ceil(t$1[1]*e$1[2]*e$1[3]/r$1)]},6572:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseImageScalerAttributes=e.imageScaler=void 0;let r=n(246),i=n(2039);e.imageScaler=(t$1,e$1,n$1)=>(u(e$1),[t$1.run(a(t$1,e$1,n$1),e$1)]),e.parseImageScalerAttributes=t$1=>{let e$1=t$1.attributes.getFloat(`scale`),n$1=t$1.attributes.getFloats(`bias`);return(0,r.createAttributeWithCacheKey)({scale:e$1,bias:n$1})};let o={name:`ImageScaler`,inputNames:[`X`],inputTypes:[i.TextureType.unpacked]},a=(t$1,e$1,n$1)=>{let r$1=Object.assign(Object.assign({},o),{cacheHint:n$1.cacheKey});return Object.assign(Object.assign({},r$1),{get:()=>((t$2,e$2,n$2,r$2)=>{let o$1=n$2[0].dims.slice(),a$1=o$1.length,u$1=`\n ${s(r$2.bias.length)}\n float process(int indices[${a$1}]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }`;return Object.assign(Object.assign({},e$2),{output:{dims:o$1,type:n$2[0].type,textureType:i.TextureType.unpacked},variables:[{name:`bias`,type:`float`,arrayLength:r$2.bias.length,data:r$2.bias},{name:`scale`,type:`float`,data:r$2.scale}],shaderSource:u$1})})(0,r$1,e$1,n$1)})},s=t$1=>{let e$1=[`float getBias(float bias[${t$1}], int channel) {`];for(let n$1=0;n$1{if(!t$1||t$1.length!==1)throw Error(`ImageScaler requires 1 input.`);if(t$1[0].dims.length!==4)throw Error(`Invalid input shape.`);if(t$1[0].type!==`float32`&&t$1[0].type!==`float64`)throw Error(`Invalid input type.`)}},3346:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseInstanceNormalizationAttributes=e.instanceNormalization=void 0;let r=n(5060),i=n(2039);e.instanceNormalization=(t$1,e$1,n$1)=>{c(e$1);let r$1=t$1.run(a(e$1[0]),e$1);return[t$1.run(u(t$1,e$1[0],n$1,r$1.dims),[e$1[0],r$1,e$1[1],e$1[2]])]},e.parseInstanceNormalizationAttributes=t$1=>t$1.attributes.getFloat(`epsilon`,1e-5);let o={name:`InstanceNormalization_MeanAndVariance`,inputNames:[`X`],inputTypes:[i.TextureType.unpacked]},a=t$1=>Object.assign(Object.assign({},o),{get:()=>((t$2,e$1)=>{let n$1=e$1.dims.slice(),r$1=n$1[1],o$1=n$1[2]*n$1[3],a$1=[n$1[0],r$1],s$1=`\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<${n$1[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n$1[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(${o$1});\n temp = 0.0;\n for(int a2=0; a2<${n$1[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n$1[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(${o$1});\n\n return v;\n }`;return Object.assign(Object.assign({},t$2),{output:{dims:a$1,type:e$1.type,textureType:i.TextureType.packedLastDimension},shaderSource:s$1})})(o,t$1)}),s={name:`InstanceNormalization_ComputeOutput`,inputNames:[`X`,`MeanAndVariance`,`Scale`,`B`],inputTypes:[i.TextureType.unpacked,i.TextureType.packedLastDimension,i.TextureType.unpacked,i.TextureType.unpacked]},u=(t$1,e$1,n$1,o$1)=>{let a$1=Object.assign(Object.assign({},s),{cacheHint:`${n$1}`});return Object.assign(Object.assign({},a$1),{get:()=>((t$2,e$2,n$2,o$2,a$2)=>{let s$1=(0,r.getGlsl)(t$2.session.backend.glContext.version),[u$1,c$1]=t$2.calculateTextureWidthAndHeight(a$2,i.TextureType.packedLastDimension),[l,p$1]=[u$1/4,c$1],f=`\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ${l}, ${p$1});\n return ${s$1.texture2D}(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }`;return Object.assign(Object.assign({},e$2),{output:{dims:n$2.dims,type:n$2.type,textureType:i.TextureType.unpacked},variables:[{name:`epsilon`,type:`float`,data:o$2}],shaderSource:f})})(t$1,a$1,e$1,n$1,o$1)})},c=t$1=>{if(!t$1||t$1.length!==3)throw Error(`InstanceNormalization requires 3 inputs.`);let e$1=t$1[0],n$1=t$1[1],r$1=t$1[2];if(e$1.dims.length<3||n$1.dims.length!==1||r$1.dims.length!==1)throw Error(`Invalid input shape.`);if(n$1.dims[0]!==e$1.dims[1]||r$1.dims[0]!==e$1.dims[1])throw Error(`Input shapes are mismatched.`);if(e$1.type!==`float32`&&e$1.type!==`float64`||n$1.type!==`float32`&&n$1.type!==`float64`||r$1.type!==`float32`&&r$1.type!==`float64`)throw Error(`Invalid input type.`);if(t$1[0].dims.length!==4)throw Error(`Only support 4-D input shape.`)}},708:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createPackedMatmulProgramInfoLoader=void 0;let r=n(2517),i=n(5060),o=n(2039),a=n(9390),s=n(2823),u=n(5623);e.createPackedMatmulProgramInfoLoader=(t$1,e$1,n$1)=>{let c=(l=e$1.length>2,p$1=n$1.activationCacheKey,{name:`MatMul (packed)`,inputNames:l?[`A`,`B`,`Bias`]:[`A`,`B`],inputTypes:l?[o.TextureType.packed,o.TextureType.packed,o.TextureType.packed]:[o.TextureType.packed,o.TextureType.packed],cacheHint:p$1});var l,p$1;return Object.assign(Object.assign({},c),{get:()=>((t$2,e$2,n$2,c$1)=>{let l$1=n$2.length>2,p$2=l$1?`value += getBiasForMatmul();`:``,f=n$2[0].dims,d=n$2[1].dims,h=r.BroadcastUtil.calcShape(f,d,!0),g=!r.ShapeUtil.areEqual(n$2[0].dims,n$2[1].dims);if(!h)throw Error(`Can't use matmul on the given tensors`);let b=f[f.length-1],m=Math.ceil(b/2),y=f.length,_=d.length,v=(0,i.getGlsl)(t$2.session.backend.glContext.version),w=(0,a.getCoordsDataType)(h.length),x=h.length,T=(0,a.getGlChannels)(),{activationFunction:S,applyActivation:O}=(0,s.getActivationSnippet)(c$1),A=l$1?`${(0,u.getBiasForMatmul)(w,T,n$2[2].dims,h,!0)}`:``,E=g?`${function(t$3,e$3,n$3,i$1){let o$1=[],a$1=[],s$1=n$3[0].dims,u$1=n$3[1].dims,c$2=s$1.length,l$2=u$1.length,p$3=i$1.length,f$1=p$3-c$2,d$1=p$3-l$2;o$1=s$1.map((t$4,n$4)=>`coords.${e$3[n$4+f$1]}`),o$1[c$2-1]=`i*2`,o$1.join(`, `),a$1=u$1.map((t$4,n$4)=>`coords.${e$3[n$4+d$1]}`),a$1[l$2-2]=`i*2`,a$1.join(`, `);let h$1=r.BroadcastUtil.getBroadcastDims(s$1,i$1),g$1=r.BroadcastUtil.getBroadcastDims(u$1,i$1),b$1=h$1.map(t$4=>`coords.${e$3[t$4+f$1]} = 0;`).join(` +`),m$1=g$1.map(t$4=>`coords.${e$3[t$4+d$1]} = 0;`).join(` +`),y$1=`int lastDim = coords.${e$3[p$3-1]};\n coords.${e$3[p$3-1]} = coords.${e$3[p$3-2]};\n coords.${e$3[p$3-2]} = lastDim;`;return`\nvec4 getAAtOutCoordsMatmul(int i) {\n ${t$3} coords = getOutputCoords();\n ${y$1}\n ${b$1}\n vec4 outputValue = getA(${o$1});\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ${t$3} coords = getOutputCoords();\n ${y$1}\n ${m$1}\n vec4 outputValue = getB(${a$1});\n return outputValue;\n}`}(w,T,n$2,h)}`:``,I=g?`getAAtOutCoordsMatmul(i)`:`getA(${function(t$3,e$3){let n$3=``;for(let r$1=0;r$1{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.getBiasForMatmul=e.createMatmulProgramInfoLoader=e.parseMatMulAttributes=e.matMul=void 0;let r=n(2517),i=n(2039),o=n(9390),a=n(2823),s=n(708);function u(t$1,e$1){let n$1=(s$1=t$1.length>2,u$1=e$1.activationCacheKey,{name:`MatMul`,inputNames:s$1?[`A`,`B`,`Bias`]:[`A`,`B`],inputTypes:s$1?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:u$1});var s$1,u$1;return Object.assign(Object.assign({},n$1),{get:()=>function(t$2,e$2,n$2){let s$2=e$2[0].dims,u$2=e$2[1].dims,c$1=r.BroadcastUtil.calcShape(s$2,u$2,!0);if(!c$1)throw Error(`Can't use matmul on the given tensors`);let p$1=(0,o.getCoordsDataType)(c$1.length),f=(0,o.getGlChannels)(),{activationFunction:d,applyActivation:h}=(0,a.getActivationSnippet)(n$2),g=e$2.length>2,b=g?`value += getBiasForMatmul();`:``,m=g?`${l(p$1,f,e$2[2].dims,c$1,!1)}`:``,y=c$1.length,_=s$2.length,v=u$2.length,w=`\n ${d}\n ${m}\n float process(int indices[${y}]) {\n int a[${_}];\n int b[${v}];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<${s$2[s$2.length-1]}; ++k) {\n a[${_-1}] = k;\n b[${v-2}] = k;\n value += _A(a) * _B(b);\n }\n ${b}\n ${h}\n return value;\n }`;return Object.assign(Object.assign({},t$2),{output:{dims:c$1,type:e$2[0].type,textureType:i.TextureType.unpacked},shaderSource:w})}(n$1,t$1,e$1)})}e.matMul=(t$1,e$1,n$1)=>(c(e$1),t$1.session.pack?[t$1.run((0,s.createPackedMatmulProgramInfoLoader)(t$1,e$1,n$1),e$1)]:[t$1.run(u(e$1,n$1),e$1)]),e.parseMatMulAttributes=t$1=>(0,a.parseInternalActivationAttributes)(t$1.attributes),e.createMatmulProgramInfoLoader=u;let c=t$1=>{if(!t$1||t$1.length!==2)throw Error(`MatMul requires 2 inputs.`);if(t$1[0].dims[t$1[0].dims.length-1]!==t$1[1].dims[t$1[1].dims.length-2])throw Error(`shared dimension does not match.`);if(t$1[0].type!==`float32`&&t$1[0].type!==`float64`||t$1[1].type!==`float32`&&t$1[1].type!==`float64`)throw Error(`inputs should be float type`);if(t$1[0].type!==t$1[1].type)throw Error(`inputs types should match`)};function l(t$1,e$1,n$1,i$1,o$1){let a$1=``,s$1=n$1.length,u$1=i$1.length,c$1=u$1-s$1;a$1=u$1<2&&s$1>0?`coords`:n$1.map((t$2,n$2)=>`coords.${e$1[n$2+c$1]}`).join(`, `);let l$1=r.BroadcastUtil.getBroadcastDims(n$1,i$1).map(t$2=>`coords.${e$1[t$2+c$1]} = 0;`).join(` +`),p$1=`vec4(outputValue.xx, outputValue.yy)`;return r.ShapeUtil.size(n$1)===1&&(p$1=`vec4(outputValue.x)`),o$1?`\nvec4 getBiasForMatmul() {\n ${t$1} coords = getOutputCoords();\n ${l$1}\n vec4 outputValue = getBias(${a$1});\n return ${p$1};\n}`:`\nfloat getBiasForMatmul() {\n ${t$1} coords = getOutputCoords();\n ${l$1}\n return getBias(coords.x);\n}`}e.getBiasForMatmul=l},2403:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.createPackProgramInfoLoader=void 0;let r=n(5060),i=n(2039),o=n(9390),a=n(2827),s={name:`pack`,inputNames:[`A`],inputTypes:[i.TextureType.unpackedReversed]};e.createPackProgramInfoLoader=(t$1,e$1)=>Object.assign(Object.assign({},s),{get:()=>((t$2,e$2)=>{let n$1=(0,r.getGlsl)(t$2.session.backend.glContext.version),u=e$2.dims,c=u.length,l=e$2.dims.length,p$1=(0,o.getCoordsDataType)(l),f=(0,a.getChannels)(`rc`,l),d=(h=l,g=f,b=u[u.length-2],m=u[u.length-1],h===0||h===1?``:`\n int r = ${g[h-2]};\n int c = ${g[h-1]};\n int rp1 = ${g[h-2]} + 1;\n int cp1 = ${g[h-1]} + 1;\n bool rEdge = rp1 >= ${m};\n bool cEdge = cp1 >= ${b};\n `);var h,g,b,m;let y;y=c===0?[1,1]:c===1?[u[0],1]:[u[l-1],u[l-2]];let _=function(t$3,e$3,n$2){if(t$3===0)return`false`;if(t$3===1)return`rc > ${e$3[0]}`;let r$1=``;for(let i$1=t$3-2;i$1= ${e$3[i$1-t$3+2]}`,i$1= ${t$3[0]} ? 0. : getA(rc + 1),\n 0, 0`;let r$1=``;if(n$2>2)for(let t$4=0;t$4{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.unpackFromChannel=e.getChannels=e.getVecChannels=void 0;let r=n(9390);function i(t$1,e$1){return(0,r.getGlChannels)(e$1).map(e$2=>`${t$1}.${e$2}`)}e.getVecChannels=i,e.getChannels=function(t$1,e$1){return e$1===1?[t$1]:i(t$1,e$1)},e.unpackFromChannel=function(){return` + float getChannel(vec4 frag, int dim) { + int modCoord = imod(dim, 2); + return modCoord == 0 ? frag.r : frag.g; + } + + float getChannel(vec4 frag, vec2 innerDims) { + vec2 modCoord = mod(innerDims, 2.); + return modCoord.x == 0. ? + (modCoord.y == 0. ? frag.r : frag.g) : + (modCoord.y == 0. ? frag.b : frag.a); + } + `}},2870:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parsePadAttributesV11=e.padV11=e.parsePadAttributesV2=e.padV2=void 0;let r=n(246),i=n(2517),o=n(5060),a=n(2039),s={name:`Pad`,inputNames:[`A`],inputTypes:[a.TextureType.unpacked]};e.padV2=(t$1,e$1,n$1)=>(l(e$1),[t$1.run(Object.assign(Object.assign({},s),{cacheHint:n$1.cacheKey,get:()=>c(t$1,e$1[0],n$1)}),e$1)]),e.parsePadAttributesV2=t$1=>{let e$1=t$1.attributes.getString(`mode`,`constant`),n$1=t$1.attributes.getFloat(`value`,0),i$1=t$1.attributes.getInts(`pads`);return(0,r.createAttributeWithCacheKey)({mode:e$1,value:n$1,pads:i$1})},e.padV11=(t$1,n$1,r$1)=>{p$1(n$1);let i$1=u(t$1,n$1,r$1);return(0,e.padV2)(t$1,[n$1[0]],i$1)},e.parsePadAttributesV11=t$1=>t$1.attributes.getString(`mode`,`constant`);let u=(t$1,e$1,n$1)=>{if(!t$1.session.isInitializer(e$1[1].dataId)||e$1.length>=3&&!t$1.session.isInitializer(e$1[2].dataId))throw Error(`dynamic pad attributes are not allowed`);let i$1=Array.from(e$1[1].integerData),o$1=e$1.length>=3?e$1[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n$1,pads:i$1,value:o$1})},c=(t$1,e$1,n$1)=>{let r$1=i.ShapeUtil.padShape(e$1.dims.slice(),n$1.pads),o$1=r$1.length,s$1=`\n ${f(t$1,e$1,n$1)}\n float process(int[${o$1}] indices) {\n return padA(indices);\n }`;return{name:`Pad`,inputNames:[`A`],inputTypes:[a.TextureType.unpacked],output:{dims:r$1,type:e$1.type,textureType:a.TextureType.unpacked},shaderSource:s$1}},l=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Pad requires 1 input`);if(t$1[0].type!==`float32`&&t$1[0].type!==`float64`)throw Error(`Invalid input type.`)},p$1=t$1=>{if(!t$1||t$1.length!==2&&t$1.length!==3)throw Error(`Pad requires 2 or 3 inputs`);if(t$1[1].type!==`int32`||t$1.length>=3&&t$1[2].type===`string`)throw Error(`Invalid input type.`)},f=(t$1,e$1,n$1)=>{let r$1=(0,o.getGlsl)(t$1.session.backend.glContext.version),[s$1,u$1]=t$1.calculateTextureWidthAndHeight(e$1.dims,a.TextureType.unpacked),c$1=i.ShapeUtil.computeStrides(e$1.dims);switch(n$1.mode){case`constant`:return d(r$1,e$1.dims,c$1,s$1,u$1,n$1.pads,n$1.value);case`reflect`:return h(r$1,e$1.dims,c$1,s$1,u$1,n$1.pads);case`edge`:return g(r$1,e$1.dims,c$1,s$1,u$1,n$1.pads);default:throw Error(`Invalid mode`)}},d=(t$1,e$1,n$1,r$1,i$1,o$1,a$1)=>{let s$1=e$1.length,u$1=``;for(let t$2=s$1-1;t$2>=0;--t$2)u$1+=`\n k = m[${t$2}] - ${o$1[t$2]};\n if (k < 0) return constant;\n if (k >= ${e$1[t$2]}) return constant;\n offset += k * ${n$1[t$2]};\n `;return`\n float padA(int m[${s$1}]) {\n const float constant = float(${a$1});\n int offset = 0;\n int k = 0;\n ${u$1}\n vec2 coords = offsetToCoords(offset, ${r$1}, ${i$1});\n float value = getColorAsFloat(${t$1.texture2D}(A, coords));\n return value;\n }\n `},h=(t$1,e$1,n$1,r$1,i$1,o$1)=>{let a$1=e$1.length,s$1=``;for(let t$2=a$1-1;t$2>=0;--t$2)s$1+=`\n k = m[${t$2}] - ${o$1[t$2]};\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ${2*(e$1[t$2]-1)};\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ${e$1[t$2]}) { k = _2n_1 - k; }\n }\n offset += k * ${n$1[t$2]};\n `;return`\n float padA(int m[${a$1}]) {\n int offset = 0;\n int k = 0;\n ${s$1}\n vec2 coords = offsetToCoords(offset, ${r$1}, ${i$1});\n float value = getColorAsFloat(${t$1.texture2D}(A, coords));\n return value;\n }\n `},g=(t$1,e$1,n$1,r$1,i$1,o$1)=>{let a$1=e$1.length,s$1=``;for(let t$2=a$1-1;t$2>=0;--t$2)s$1+=`\n k = m[${t$2}] - ${o$1[t$2]};\n if (k < 0) k = 0;\n if (k >= ${e$1[t$2]}) k = ${e$1[t$2]-1};\n offset += k * ${n$1[t$2]};\n `;return`\n float padA(int m[${a$1}]) {\n int offset = 0;\n int k = 0;\n ${s$1}\n vec2 coords = offsetToCoords(offset, ${r$1}, ${i$1});\n float value = getColorAsFloat(${t$1.texture2D}(A, coords));\n return value;\n }\n `}},2143:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.globalMaxPool=e.parseMaxPoolAttributes=e.maxPool=e.parseGlobalAveragePoolAttributes=e.globalAveragePool=e.parseAveragePoolAttributes=e.averagePool=void 0;let r=n(246),i=n(2517),o=n(2039);e.averagePool=(t$1,e$1,n$1)=>{p$1(e$1);let r$1={name:`AveragePool`,inputNames:[`X`],inputTypes:[o.TextureType.unpacked],cacheHint:n$1.cacheKey};return[t$1.run(Object.assign(Object.assign({},r$1),{get:()=>a(e$1,r$1,!1,n$1)}),e$1)]},e.parseAveragePoolAttributes=t$1=>{let e$1=t$1.attributes.getString(`auto_pad`,`NOTSET`),n$1=t$1.attributes.getInt(`ceil_mode`,0),i$1=t$1.attributes.getInt(`count_include_pad`,0)!==0,o$1=t$1.attributes.getInts(`kernel_shape`),a$1=t$1.attributes.getInts(`strides`,[]),s$1=t$1.attributes.getInts(`pads`,[]);if(n$1!==0)throw Error(`using ceil() in shape computation is not yet supported for AveragePool`);return(0,r.createAttributeWithCacheKey)({autoPad:e$1,ceilMode:n$1,countIncludePad:i$1,kernelShape:o$1,strides:a$1,pads:s$1})};let a=(t$1,e$1,n$1,r$1)=>{let[a$1,s$1]=u(t$1,r$1,n$1),c$1=i.ShapeUtil.size(a$1.kernelShape),l$1=``;a$1.countIncludePad?l$1+=`value /= float(${c$1});`:l$1+=`value /= float(${c$1} - pad);`;let p$2=`\n ${f(t$1[0].dims,a$1,`value += _X(x);`,l$1,`0.0`)}\n `;return Object.assign(Object.assign({},e$1),{output:{dims:s$1,type:t$1[0].type,textureType:o.TextureType.unpacked},shaderSource:p$2})};e.globalAveragePool=(t$1,e$1,n$1)=>{p$1(e$1);let r$1={name:`GlobalAveragePool`,inputNames:[`X`],inputTypes:[o.TextureType.unpacked],cacheHint:`${n$1.countIncludePad}`};return[t$1.run(Object.assign(Object.assign({},r$1),{get:()=>a(e$1,r$1,!0,n$1)}),e$1)]},e.parseGlobalAveragePoolAttributes=t$1=>{let e$1=t$1.attributes.getInt(`count_include_pad`,0)!==0;return(0,r.createAttributeWithCacheKey)({autoPad:``,ceilMode:0,countIncludePad:e$1,kernelShape:[],strides:[],pads:[]})},e.maxPool=(t$1,e$1,n$1)=>{p$1(e$1);let r$1={name:`MaxPool`,inputNames:[`X`],inputTypes:[o.TextureType.unpacked],cacheHint:n$1.cacheKey};return[t$1.run(Object.assign(Object.assign({},r$1),{get:()=>s(e$1,r$1,!1,n$1)}),e$1)]},e.parseMaxPoolAttributes=t$1=>{let e$1=t$1.attributes.getString(`auto_pad`,`NOTSET`),n$1=t$1.attributes.getInt(`ceil_mode`,0),i$1=t$1.attributes.getInts(`kernel_shape`),o$1=t$1.attributes.getInts(`strides`,[]),a$1=t$1.attributes.getInts(`pads`,[]),s$1=t$1.attributes.getInt(`storage_order`,0),u$1=t$1.attributes.getInts(`dilations`,[]);if(s$1!==0)throw Error(`column major storage order is not yet supported for MaxPool`);if(n$1!==0)throw Error(`using ceil() in shape computation is not yet supported for MaxPool`);return(0,r.createAttributeWithCacheKey)({autoPad:e$1,ceilMode:n$1,countIncludePad:!1,kernelShape:i$1,strides:o$1,pads:a$1,storageOrder:s$1,dilations:u$1})};let s=(t$1,e$1,n$1,r$1)=>{let[i$1,a$1]=u(t$1,r$1,n$1),s$1=`\n ${f(t$1[0].dims,i$1,` + value = max(_X(x), value); + `,``,`-1e5`)}\n `;return Object.assign(Object.assign({},e$1),{output:{dims:a$1,type:t$1[0].type,textureType:o.TextureType.unpacked},shaderSource:s$1})},u=(t$1,e$1,n$1)=>{let r$1=t$1[0].dims.slice(),o$1=Object.hasOwnProperty.call(e$1,`dilations`),a$1=e$1.kernelShape.slice(),s$1=e$1.strides.slice(),u$1=o$1?e$1.dilations.slice():[],c$1=e$1.pads.slice();i.PoolConvUtil.adjustPoolAttributes(n$1,r$1,a$1,s$1,u$1,c$1);let l$1=i.PoolConvUtil.computePoolOutputShape(n$1,r$1,s$1,u$1,a$1,c$1,e$1.autoPad),p$2=Object.assign({},e$1);return o$1?Object.assign(p$2,{kernelShape:a$1,strides:s$1,pads:c$1,dilations:u$1,cacheKey:e$1.cacheKey}):Object.assign(p$2,{kernelShape:a$1,strides:s$1,pads:c$1,cacheKey:e$1.cacheKey}),[p$2,l$1]},c={autoPad:``,ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:``},l={name:`GlobalMaxPool`,inputNames:[`X`],inputTypes:[o.TextureType.unpacked]};e.globalMaxPool=(t$1,e$1)=>(p$1(e$1),[t$1.run(Object.assign(Object.assign({},l),{get:()=>s(e$1,l,!0,c)}),e$1)]);let p$1=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Pool ops requires 1 input.`);if(t$1[0].type!==`float32`&&t$1[0].type!==`float64`)throw Error(`Invalid input type.`)},f=(t$1,e$1,n$1,r$1,o$1)=>{let a$1=t$1.length;if(e$1.kernelShape.length<=2){let i$1=e$1.kernelShape[e$1.kernelShape.length-1],s$1=e$1.strides[e$1.strides.length-1],u$1=e$1.pads[e$1.pads.length/2-1],c$1=e$1.pads[e$1.pads.length-1],l$1=t$1[a$1-1],p$2=``,f$1=``,d$1=``;if(p$2=u$1+c$1===0?`\n for (int i = 0; i < ${i$1}; i++) {\n x[${a$1} - 1] = indices[${a$1} - 1] * ${s$1} - ${u$1} + i;\n ${n$1}\n }`:`\n for (int i = 0; i < ${i$1}; i++) {\n x[${a$1} - 1] = indices[${a$1} - 1] * ${s$1} - ${u$1} + i;\n if (x[${a$1} - 1] < 0 || x[${a$1} - 1] >= ${l$1}) {\n pad++;\n continue;\n }\n ${n$1}\n }`,e$1.kernelShape.length===2){let n$2=e$1.kernelShape[e$1.kernelShape.length-2],r$2=e$1.strides[e$1.strides.length-2],o$2=e$1.pads[e$1.pads.length/2-2],s$2=e$1.pads[e$1.pads.length-2],u$2=t$1[a$1-2];f$1=o$2+s$2===0?`\n for (int j = 0; j < ${n$2}; j++) {\n x[${a$1} - 2] = indices[${a$1} - 2] * ${r$2} - ${o$2} + j;\n `:`\n for (int j = 0; j < ${n$2}; j++) {\n x[${a$1} - 2] = indices[${a$1} - 2] * ${r$2} - ${o$2} + j;\n if (x[${a$1} - 2] < 0 || x[${a$1} - 2] >= ${u$2}) {\n pad+= ${i$1};\n continue;\n }\n `,d$1=` + } + `}return`\n float process(int indices[${a$1}]) {\n int x[${a$1}];\n copyVec(indices, x);\n\n float value = ${o$1};\n int pad = 0;\n ${f$1}\n ${p$2}\n ${d$1}\n ${r$1}\n return value;\n }\n `}{let s$1=i.ShapeUtil.size(e$1.kernelShape),u$1=i.ShapeUtil.computeStrides(e$1.kernelShape),c$1=u$1.length,l$1=e$1.pads.length,p$2=h(c$1),f$1=d(t$1,`inputDims`),g=d(e$1.pads,`pads`),b=d(u$1,`kernelStrides`),m=d(e$1.strides,`strides`),y=``;return y=e$1.pads.reduce((t$2,e$2)=>t$2+e$2)?`\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ${n$1}\n }`:`\n }\n ${n$1}\n `,`\n ${p$2}\n float process(int indices[${a$1}]) {\n int x[${a$1}];\n copyVec(indices, x);\n int offset[${c$1}];\n int pads[${l$1}];\n int inputDims[${a$1}];\n int kernelStrides[${c$1}];\n int strides[${c$1}];\n ${g}\n ${f$1}\n ${m}\n ${b}\n\n float value = ${o$1};\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ${s$1}; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ${a$1} - ${c$1}; j < ${a$1}; j++) {\n x[j] = indices[j] * strides[j - ${a$1} + ${c$1}]\n + offset[j - ${a$1} + ${c$1}] - pads[j - 2];\n ${y}\n }\n ${r$1}\n\n return value;\n }\n `}},d=(t$1,e$1)=>{let n$1=``;for(let r$1=0;r$1`\n void offsetToIndices(int offset, int[${t$1}] strides, out int[${t$1}] indices) {\n if (${t$1} == 0) {\n return;\n }\n for (int i = 0; i < ${t$1} - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[${t$1} - 1] = offset;\n }`},4939:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.reduceLogSumSquare=e.reduceLogSum=e.reduceProd=e.reduceMin=e.reduceMax=e.reduceMean=e.reduceSum=e.parseReduceAttributes=void 0;let r=n(246),i=n(782),o=n(2517),a=n(2039),s=(t$1,e$1,n$1,r$1,i$1)=>{c(e$1);let o$1={name:r$1,inputNames:[`A`],inputTypes:[a.TextureType.unpacked]};return[t$1.run(Object.assign(Object.assign({},o$1),{cacheHint:n$1.cacheKey,get:()=>u(t$1,e$1,n$1,r$1,i$1,o$1)}),e$1)]};e.parseReduceAttributes=t$1=>{let e$1=t$1.attributes.getInts(`axes`,[]),n$1=t$1.attributes.getInt(`keepdims`,1)===1;return(0,r.createAttributeWithCacheKey)({axes:e$1,keepDims:n$1})};let u=(t$1,e$1,n$1,r$1,i$1,s$1)=>{let u$1=[],c$1=e$1[0].dims.length||1,l=[],p$1=o.ShapeUtil.normalizeAxes(n$1.axes,e$1[0].dims.length),f=i$1(e$1,p$1),d=f[1];for(let t$2=0;t$2=0||p$1.length===0?(n$1.keepDims&&u$1.push(1),d=`\n for(int j${t$2} = 0; j${t$2} < ${e$1[0].dims[t$2]}; j${t$2}++) {\n inputIdx[${t$2}] = j${t$2};\n ${d}\n }`):(l.push(`inputIdx[${t$2}] = outputIdx[${u$1.length}];`),u$1.push(e$1[0].dims[t$2]));let h=`\n float process(int outputIdx[${u$1.length||1}]) {\n float value; // final result\n int inputIdx[${c$1}]; // addressing input data\n ${l.join(` +`)}\n ${f[0]} // init ops for reduce max/min\n ${d}\n ${f[2]} // final computation for reduce mean\n return value;\n }`;return Object.assign(Object.assign({},s$1),{output:{dims:u$1,type:e$1[0].type,textureType:a.TextureType.unpacked},shaderSource:h})},c=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Reduce op requires 1 input.`);if(i.NUMBER_TYPES.indexOf(t$1[0].type)===-1)throw Error(`Invalid input type.`)};e.reduceSum=(t$1,e$1,n$1)=>s(t$1,e$1,n$1,`ReduceSum`,()=>[`value = 0.0;`,`value += _A(inputIdx);`,``]),e.reduceMean=(t$1,e$1,n$1)=>s(t$1,e$1,n$1,`ReduceMean`,(t$2,e$2)=>{let n$2=1;for(let r$1=0;r$1=0||e$2.length===0)&&(n$2*=t$2[0].dims[r$1]);return[`value = 0.0;`,`value += _A(inputIdx);`,`value /= ${n$2}.;`]}),e.reduceMax=(t$1,e$1,n$1)=>s(t$1,e$1,n$1,`ReduceMax`,(t$2,e$2)=>{let n$2=[];for(let r$1=0;r$1=0||e$2.length===0)&&n$2.push(`inputIdx[${r$1}] = 0;`);return[`${n$2.join(` +`)}\nvalue = _A(inputIdx);`,`value = max(value, _A(inputIdx));`,``]}),e.reduceMin=(t$1,e$1,n$1)=>s(t$1,e$1,n$1,`ReduceMin`,(t$2,e$2)=>{let n$2=[];for(let r$1=0;r$1=0||e$2.length===0)&&n$2.push(`inputIdx[${r$1}] = 0;`);return[`${n$2.join(` +`)}\nvalue = _A(inputIdx);`,`value = min(value, _A(inputIdx));`,``]}),e.reduceProd=(t$1,e$1,n$1)=>s(t$1,e$1,n$1,`ReduceProd`,()=>[`value = 1.0;`,`value *= _A(inputIdx);`,``]),e.reduceLogSum=(t$1,e$1,n$1)=>s(t$1,e$1,n$1,`ReduceLogSum`,()=>[`value = 0.0;`,`value += _A(inputIdx);`,`value = log(value);`]),e.reduceLogSumSquare=(t$1,e$1,n$1)=>s(t$1,e$1,n$1,`ReduceLogSumSquare`,()=>[`float t; value = 0.0;`,`t = _A(inputIdx); value += t * t;`,``])},7019:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.isReshapeCheap=e.processDims3D=e.createPackedReshape3DProgramInfoLoader=void 0;let r=n(2517),i=n(5060),o=n(2039),a=n(2827);e.createPackedReshape3DProgramInfoLoader=(t$1,e$1,n$1)=>{let s=(t$2=>({name:`Reshape (packed)`,inputTypes:[o.TextureType.packed],inputNames:[`A`],cacheHint:`${t$2}`}))(n$1);return Object.assign(Object.assign({},s),{get:()=>((t$2,e$2,n$2,s$1)=>{let u=e$2.dims,c=s$1,l=``;for(let t$3=0;t$3<4;t$3++){let e$3=``;switch(t$3){case 0:e$3=`outputCoords = rc;`;break;case 1:e$3=`outputCoords = ivec3(rc.x, rc.y+1, rc.z);`;break;case 2:e$3=`outputCoords = ivec3(rc.x, rc.y, rc.z+1);`;break;case 3:e$3=`outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);`;break;default:throw Error()}l+=`\n ${e$3}\n ${t$3>0?`if(outputCoords.y < rows && outputCoords.z < cols){`:``}\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${t$3}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ${t$3>0?`}`:``}\n `}let p$1=(0,i.getGlsl)(t$2.session.backend.glContext.version),f=`\n ${function(t$3){let e$3=r.ShapeUtil.computeStrides(t$3),n$3=[`b`,`r`,`c`],i$1=`index`;return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${e$3.map((t$4,r$1)=>`int ${n$3[r$1]} = ${i$1} / ${t$4}; ${r$1===e$3.length-1?`int ${n$3[r$1+1]} = ${i$1} - ${n$3[r$1]} * ${t$4}`:`index -= ${n$3[r$1]} * ${t$4}`};`).join(``)}\n return ivec3(b, r, c);\n }\n `}(u)}\n ${function(t$3){let e$3=r.ShapeUtil.computeStrides(t$3);return`\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ${e$3[0]} + coords.z * ${e$3[1]} + coords.y;\n }\n`}(c)}\n ${(0,a.unpackFromChannel)()}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ${c[2]};\n int cols = ${c[1]};\n\n ${l}\n ${p$1.output} = result;\n }\n `;return Object.assign(Object.assign({},n$2),{output:{dims:c,type:e$2.type,textureType:o.TextureType.packed},shaderSource:f,hasMain:!0})})(t$1,e$1,s,n$1)})},e.processDims3D=function(t$1){if(t$1.length===0)return[1,1,1];let e$1=1;for(let n$1=0;n$11?t$1[t$1.length-2]:1,t$1[t$1.length-1]]},e.isReshapeCheap=function(t$1,e$1){let n$1=!1;return n$1=t$1.length===0||e$1.length===0||(t$1.length<2||e$1.length<2?t$1[t$1.length-1]===e$1[e$1.length-1]:t$1[t$1.length-1]===e$1[e$1.length-1]&&t$1[t$1.length-2]===e$1[e$1.length-2]),n$1}},718:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.reshape=void 0;let r=n(2517);e.reshape=(t$1,e$1)=>{let n$1=r.ShapeUtil.calculateReshapedDims(e$1[0].dims,e$1[1].integerData);return t$1.session.pack?[t$1.reshapePacked(e$1[0],n$1)]:[t$1.reshapeUnpacked(e$1[0],n$1)]}},2268:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.parseResizeAttributesV11=e.parseResizeAttributesV10=e.resize=void 0;let r=n(5060),i=n(2039),o=n(9390),a=n(2827),s=n(9793),u={name:`Resize`,inputNames:[`A`],inputTypes:[i.TextureType.packed]};e.resize=(t$1,e$1,n$1)=>((0,s.validateInputs)(e$1,n$1),[t$1.run(Object.assign(Object.assign({},u),{cacheHint:n$1.cacheKey,get:()=>c(t$1,e$1,n$1)}),e$1)]),e.parseResizeAttributesV10=t$1=>(0,s.parseUpsampleAttributes)(t$1,10),e.parseResizeAttributesV11=t$1=>(0,s.parseUpsampleAttributes)(t$1,11);let c=(t$1,e$1,n$1)=>{let s$1=(0,r.getGlsl)(t$1.session.backend.glContext.version),[c$1,p$2]=l(e$1,n$1);if(c$1.every(t$2=>t$2===1)&&n$1.coordinateTransformMode!==`tf_crop_and_resize`)return Object.assign(Object.assign({},u),{output:{dims:p$2,type:e$1[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:`void main() {\n vec4 v = ${s$1.texture2D}(X, TexCoords);\n ${s$1.output} = v;\n }`});let f$1=p$2.length;if(f$1<2)throw Error(`output dimension should be at least 2, but got ${f$1}`);let d=p$2[f$1-2],h=p$2[f$1-1],g=e$1[0].dims;if(f$1!==g.length)throw Error(`output dimension should match input ${g.length}, but got ${f$1}`);let b=g[f$1-2],m=g[f$1-1],y=c$1[f$1-2],_=c$1[f$1-1],v=``;if(n$1.mode!==`linear`)throw Error(`resize (packed) does not support mode: '${n$1.mode}'`);switch(n$1.coordinateTransformMode){case`asymmetric`:v=` + vec4 getSourceFracIndex(ivec4 coords) { + return vec4(coords) / scaleWHWH; + } + `;break;case`half_pixel`:v=` + vec4 getSourceFracIndex(ivec4 coords) { + return (vec4(coords) + 0.5) / scaleWHWH - 0.5; + } + `;break;case`pytorch_half_pixel`:v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ${h}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ${d}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ${h}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ${d}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n `;break;case`align_corners`:v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(${h}.0 - 1.0, ${d}.0 - 1.0, ${h}.0 - 1.0,\n ${d}.0 - 1.0);\n vec4 original = vec4(${m}.0 - 1.0, ${b}.0 - 1.0, ${m}.0 - 1.0,\n ${b}.0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n `;break;default:throw Error(`resize (packed) does not support coordinateTransformMode: '${n$1.coordinateTransformMode}'`)}let w=(0,o.getCoordsDataType)(f$1),x=`\n const vec2 inputWH = vec2(${b}.0, ${m}.0);\n const vec4 scaleWHWH = vec4(float(${y}), float(${_}), float(${y}), float(${_}));\n ${(0,a.unpackFromChannel)()}\n ${v}\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ${w} rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ${d-1};\n bool hasNextCol = rc.z < ${h-1};\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ${s$1.output} = vec4(newValue);\n }\n `;return Object.assign(Object.assign({},u),{output:{dims:p$2,type:e$1[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:x})},l=(t$1,e$1)=>{let n$1=t$1[0].dims,r$1,i$1=e$1.scales;if(i$1.length===0){let o$2=t$1[e$1.scalesInputIdx];if(o$2&&o$2.size!==0){if(t$1[e$1.sizesInputIdx])throw Error(`Only one of scales or sizes must be provided as input.`);i$1=p$1(o$2,e$1.mode,e$1.isResize)}else{let o$3=t$1[e$1.sizesInputIdx];if(!o$3||o$3.size===0)throw Error(`Either scales or sizes MUST be provided as input.`);r$1=Array.from(o$3.integerData),i$1=f(r$1,n$1,e$1.mode,e$1.isResize)}}else if(t$1[e$1.sizesInputIdx])throw Error(`Only one of scales or sizes must be provided as input.`);let o$1=r$1||n$1.map((t$2,e$2)=>Math.floor(t$2*i$1[e$2]));return[i$1,o$1]},p$1=(t$1,e$1,n$1)=>{let r$1=Array.from(t$1.floatData);return(0,s.scalesValidation)(r$1,e$1,n$1),r$1},f=(t$1,e$1,n$1,r$1)=>{let i$1=e$1.length,o$1=Array(i$1);for(let n$2=0,r$2=i$1;n$2{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.shape=void 0;let r=n(9162);e.shape=(t$1,e$1)=>(i(e$1),[new r.Tensor([e$1[0].dims.length],`int32`,void 0,void 0,new Int32Array(e$1[0].dims))]);let i=t$1=>{if(!t$1||t$1.length!==1)throw Error(`Shape requires 1 input.`)}},2278:(t,e,n)=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.sliceV10=e.parseSliceAttributes=e.slice=void 0;let r=n(246),i=n(782),o=n(2517),a=n(2039),s={name:`Slice`,inputNames:[`A`],inputTypes:[a.TextureType.unpacked]};e.slice=(t$1,e$1,n$1)=>(c(e$1),[t$1.run(Object.assign(Object.assign({},s),{cacheHint:n$1.cacheKey,get:()=>u(t$1,e$1[0],n$1)}),e$1)]),e.parseSliceAttributes=t$1=>{let e$1=t$1.attributes.getInts(`starts`),n$1=t$1.attributes.getInts(`ends`),i$1=t$1.attributes.getInts(`axes`,[]);return(0,r.createAttributeWithCacheKey)({starts:e$1,ends:n$1,axes:i$1})};let u=(t$1,e$1,n$1)=>{let r$1=n$1.axes.length===0?e$1.dims.slice(0).map((t$2,e$2)=>e$2):n$1.axes,i$1=o.ShapeUtil.normalizeAxes(r$1,e$1.dims.length),u$1=n$1.starts.map((t$2,n$2)=>t$2>e$1.dims[i$1[n$2]]-1?e$1.dims[i$1[n$2]]:o.ShapeUtil.normalizeAxis(t$2,e$1.dims[i$1[n$2]])),c$1=n$1.ends.map((t$2,n$2)=>t$2>e$1.dims[i$1[n$2]]-1?e$1.dims[i$1[n$2]]:o.ShapeUtil.normalizeAxis(t$2,e$1.dims[i$1[n$2]])),l$1=e$1.dims.slice(),p$2=[];for(let t$2=0;t$20&&p$2.push(`outputIdx[${i$1[t$2]}] += ${u$1[t$2]};`);let f=`\n float process(int outputIdx[${l$1.length}]) {\n ${p$2.join(` + `)}\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()}}} +/*! +* @pixiv/three-vrm-animation v3.4.1 +* The implementation of VRM Animation +* +* Copyright (c) 2019-2025 pixiv Inc. +* @pixiv/three-vrm-animation is distributed under MIT License +* https://github.com/pixiv/three-vrm/blob/release/LICENSE +*/ +var __async$1=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),__async2$1=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),VRMExpression$1=class extends Object3D{constructor(expressionName){super(),this.weight=0,this.isBinary=!1,this.overrideBlink=`none`,this.overrideLookAt=`none`,this.overrideMouth=`none`,this._binds=[],this.name=`VRMExpression_${expressionName}`,this.expressionName=expressionName,this.type=`VRMExpression`,this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink===`block`?0.5?1:0:this.weight}addBind(bind){this._binds.push(bind)}deleteBind(bind){let index$1=this._binds.indexOf(bind);index$1>=0&&this._binds.splice(index$1,1)}applyWeight(options){var _a$2;let actualWeight=this.outputWeight;actualWeight*=(_a$2=options?.multiplier)??1,this.isBinary&&actualWeight<1&&(actualWeight=0),this._binds.forEach(bind=>bind.applyWeight(actualWeight))}clearAppliedWeight(){this._binds.forEach(bind=>bind.clearAppliedWeight())}};function extractPrimitivesInternal$1(gltf,nodeIndex,node$1){var _a$2,_b;let json=gltf.parser.json,schemaNode=(_a$2=json.nodes)?.[nodeIndex];if(schemaNode==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${nodeIndex}] of glTF but the node doesn't exist`),null;let meshIndex=schemaNode.mesh;if(meshIndex==null)return null;let schemaMesh=(_b=json.meshes)?.[meshIndex];if(schemaMesh==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${meshIndex}] of glTF but the mesh doesn't exist`),null;let primitiveCount=schemaMesh.primitives.length,primitives=[];return node$1.traverse(object=>{primitives.length{presetNameSet.has(name$1)&&(result[name$1]=expression)}),result}get customExpressionMap(){let result={},presetNameSet=new Set(Object.values(VRMExpressionPresetName$1));return Object.entries(this._expressionMap).forEach(([name$1,expression])=>{presetNameSet.has(name$1)||(result[name$1]=expression)}),result}copy(source){let expressions=this._expressions.concat();return expressions.forEach(expression=>{this.unregisterExpression(expression)}),source._expressions.forEach(expression=>{this.registerExpression(expression)}),this.blinkExpressionNames=source.blinkExpressionNames.concat(),this.lookAtExpressionNames=source.lookAtExpressionNames.concat(),this.mouthExpressionNames=source.mouthExpressionNames.concat(),this}clone(){return new _VRMExpressionManager().copy(this)}getExpression(name$1){var _a$2;return(_a$2=this._expressionMap[name$1])??null}registerExpression(expression){this._expressions.push(expression),this._expressionMap[expression.expressionName]=expression}unregisterExpression(expression){let index$1=this._expressions.indexOf(expression);index$1===-1&&console.warn(`VRMExpressionManager: The specified expressions is not registered`),this._expressions.splice(index$1,1),delete this._expressionMap[expression.expressionName]}getValue(name$1){var _a$2;let expression=this.getExpression(name$1);return(_a$2=expression?.weight)??null}setValue(name$1,weight){let expression=this.getExpression(name$1);expression&&(expression.weight=saturate$1(weight))}resetValues(){this._expressions.forEach(expression=>{expression.weight=0})}getExpressionTrackName(name$1){let expression=this.getExpression(name$1);return expression?`${expression.name}.weight`:null}update(){let weightMultipliers=this._calculateWeightMultipliers();this._expressions.forEach(expression=>{expression.clearAppliedWeight()}),this._expressions.forEach(expression=>{let multiplier=1,name$1=expression.expressionName;this.blinkExpressionNames.indexOf(name$1)!==-1&&(multiplier*=weightMultipliers.blink),this.lookAtExpressionNames.indexOf(name$1)!==-1&&(multiplier*=weightMultipliers.lookAt),this.mouthExpressionNames.indexOf(name$1)!==-1&&(multiplier*=weightMultipliers.mouth),expression.applyWeight({multiplier})})}_calculateWeightMultipliers(){let blink=1,lookAt=1,mouth=1;return this._expressions.forEach(expression=>{blink-=expression.overrideBlinkAmount,lookAt-=expression.overrideLookAtAmount,mouth-=expression.overrideMouthAmount}),blink=Math.max(0,blink),lookAt=Math.max(0,lookAt),mouth=Math.max(0,mouth),{blink,lookAt,mouth}}},VRMExpressionMaterialColorType$1={Color:`color`,EmissionColor:`emissionColor`,ShadeColor:`shadeColor`,MatcapColor:`matcapColor`,RimColor:`rimColor`,OutlineColor:`outlineColor`},v0ExpressionMaterialColorMap$1={_Color:VRMExpressionMaterialColorType$1.Color,_EmissionColor:VRMExpressionMaterialColorType$1.EmissionColor,_ShadeColor:VRMExpressionMaterialColorType$1.ShadeColor,_RimColor:VRMExpressionMaterialColorType$1.RimColor,_OutlineColor:VRMExpressionMaterialColorType$1.OutlineColor},_color$1=new Color,_VRMExpressionMaterialColorBind$1=class _VRMExpressionMaterialColorBind2{constructor({material,type,targetValue,targetAlpha}){this.material=material,this.type=type,this.targetValue=targetValue,this.targetAlpha=targetAlpha??1;let color$1=this._initColorBindState(),alpha=this._initAlphaBindState();this._state={color:color$1,alpha}}applyWeight(weight){let{color:color$1,alpha}=this._state;if(color$1!=null){let{propertyName,deltaValue}=color$1,target=this.material[propertyName];target?.add(_color$1.copy(deltaValue).multiplyScalar(weight))}if(alpha!=null){let{propertyName,deltaValue}=alpha,target=this.material[propertyName];target!=null&&(this.material[propertyName]+=deltaValue*weight)}}clearAppliedWeight(){let{color:color$1,alpha}=this._state;if(color$1!=null){let{propertyName,initialValue}=color$1,target=this.material[propertyName];target?.copy(initialValue)}if(alpha!=null){let{propertyName,initialValue}=alpha,target=this.material[propertyName];target!=null&&(this.material[propertyName]=initialValue)}}_initColorBindState(){var _a$2,_b,_c;let{material,type,targetValue}=this,propertyNameMap=this._getPropertyNameMap(),propertyName=(_b=(_a$2=propertyNameMap?.[type])?.[0])??null;if(propertyName==null)return console.warn(`Tried to add a material color bind to the material ${(_c=material.name)??`(no name)`}, the type ${type} but the material or the type is not supported.`),null;let target=material[propertyName],initialValue=target.clone(),deltaValue=new Color(targetValue.r-initialValue.r,targetValue.g-initialValue.g,targetValue.b-initialValue.b);return{propertyName,initialValue,deltaValue}}_initAlphaBindState(){var _a$2,_b,_c;let{material,type,targetAlpha}=this,propertyNameMap=this._getPropertyNameMap(),propertyName=(_b=(_a$2=propertyNameMap?.[type])?.[1])??null;if(propertyName==null&&targetAlpha!==1)return console.warn(`Tried to add a material alpha bind to the material ${(_c=material.name)??`(no name)`}, the type ${type} but the material or the type does not support alpha.`),null;if(propertyName==null)return null;let initialValue=material[propertyName],deltaValue=targetAlpha-initialValue;return{propertyName,initialValue,deltaValue}}_getPropertyNameMap(){var _a$2,_b;return(_b=(_a$2=Object.entries(_VRMExpressionMaterialColorBind2._propertyNameMapMap).find(([distinguisher])=>this.material[distinguisher]===!0))?.[1])??null}};_VRMExpressionMaterialColorBind$1._propertyNameMapMap={isMeshStandardMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null]},isMeshBasicMaterial:{color:[`color`,`opacity`]},isMToonMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null],outlineColor:[`outlineColorFactor`,null],matcapColor:[`matcapFactor`,null],rimColor:[`parametricRimColorFactor`,null],shadeColor:[`shadeColorFactor`,null]}};var VRMExpressionMaterialColorBind$1=_VRMExpressionMaterialColorBind$1,VRMExpressionMorphTargetBind$1=class{constructor({primitives,index:index$1,weight}){this.primitives=primitives,this.index=index$1,this.weight=weight}applyWeight(weight){this.primitives.forEach(mesh=>{var _a$2;(_a$2=mesh.morphTargetInfluences)?.[this.index]!=null&&(mesh.morphTargetInfluences[this.index]+=this.weight*weight)})}clearAppliedWeight(){this.primitives.forEach(mesh=>{var _a$2;(_a$2=mesh.morphTargetInfluences)?.[this.index]!=null&&(mesh.morphTargetInfluences[this.index]=0)})}},_v2$1=new Vector2,_VRMExpressionTextureTransformBind$1=class _VRMExpressionTextureTransformBind2{constructor({material,scale,offset}){var _a$2,_b;this.material=material,this.scale=scale,this.offset=offset;let propertyNames=(_a$2=Object.entries(_VRMExpressionTextureTransformBind2._propertyNamesMap).find(([distinguisher])=>material[distinguisher]===!0))?.[1];propertyNames==null?(console.warn(`Tried to add a texture transform bind to the material ${(_b=material.name)??`(no name)`} but the material is not supported.`),this._properties=[]):(this._properties=[],propertyNames.forEach(propertyName=>{var _a2;let texture=(_a2=material[propertyName])?.clone();if(!texture)return null;material[propertyName]=texture;let initialOffset=texture.offset.clone(),initialScale=texture.repeat.clone(),deltaOffset=offset.clone().sub(initialOffset),deltaScale=scale.clone().sub(initialScale);this._properties.push({name:propertyName,initialOffset,deltaOffset,initialScale,deltaScale})}))}applyWeight(weight){this._properties.forEach(property=>{let target=this.material[property.name];target!==void 0&&(target.offset.add(_v2$1.copy(property.deltaOffset).multiplyScalar(weight)),target.repeat.add(_v2$1.copy(property.deltaScale).multiplyScalar(weight)))})}clearAppliedWeight(){this._properties.forEach(property=>{let target=this.material[property.name];target!==void 0&&(target.offset.copy(property.initialOffset),target.repeat.copy(property.initialScale))})}};_VRMExpressionTextureTransformBind$1._propertyNamesMap={isMeshStandardMaterial:[`map`,`emissiveMap`,`bumpMap`,`normalMap`,`displacementMap`,`roughnessMap`,`metalnessMap`,`alphaMap`],isMeshBasicMaterial:[`map`,`specularMap`,`alphaMap`],isMToonMaterial:[`map`,`normalMap`,`emissiveMap`,`shadeMultiplyTexture`,`rimMultiplyTexture`,`outlineWidthMultiplyTexture`,`uvAnimationMaskTexture`]};var VRMExpressionTextureTransformBind$1=_VRMExpressionTextureTransformBind$1,POSSIBLE_SPEC_VERSIONS$1=new Set([`1.0`,`1.0-beta`]),_VRMExpressionLoaderPlugin$1=class _VRMExpressionLoaderPlugin2{get name(){return`VRMExpressionLoaderPlugin`}constructor(parser){this.parser=parser}afterRoot(gltf){return __async2$1(this,null,function*(){gltf.userData.vrmExpressionManager=yield this._import(gltf)})}_import(gltf){return __async2$1(this,null,function*(){let v1Result=yield this._v1Import(gltf);if(v1Result)return v1Result;let v0Result=yield this._v0Import(gltf);return v0Result||null})}_v1Import(gltf){return __async2$1(this,null,function*(){var _a$2,_b;let json=this.parser.json,isVRMUsed=(_a$2=json.extensionsUsed)?.indexOf(`VRMC_vrm`)!==-1;if(!isVRMUsed)return null;let extension$1=(_b=json.extensions)?.VRMC_vrm;if(!extension$1)return null;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS$1.has(specVersion))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${specVersion}"`),null;let schemaExpressions=extension$1.expressions;if(!schemaExpressions)return null;let presetNameSet=new Set(Object.values(VRMExpressionPresetName$1)),nameSchemaExpressionMap=new Map;schemaExpressions.preset!=null&&Object.entries(schemaExpressions.preset).forEach(([name$1,schemaExpression])=>{if(schemaExpression!=null){if(!presetNameSet.has(name$1)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${name$1}" detected. Ignoring the expression`);return}nameSchemaExpressionMap.set(name$1,schemaExpression)}}),schemaExpressions.custom!=null&&Object.entries(schemaExpressions.custom).forEach(([name$1,schemaExpression])=>{if(presetNameSet.has(name$1)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${name$1}". Ignoring the expression`);return}nameSchemaExpressionMap.set(name$1,schemaExpression)});let manager=new VRMExpressionManager$1;return yield Promise.all(Array.from(nameSchemaExpressionMap.entries()).map(_0=>__async2$1(this,[_0],function*([name$1,schemaExpression]){var _a2,_b2,_c,_d,_e,_f,_g;let expression=new VRMExpression$1(name$1);if(gltf.scene.add(expression),expression.isBinary=(_a2=schemaExpression.isBinary)??!1,expression.overrideBlink=(_b2=schemaExpression.overrideBlink)??`none`,expression.overrideLookAt=(_c=schemaExpression.overrideLookAt)??`none`,expression.overrideMouth=(_d=schemaExpression.overrideMouth)??`none`,(_e=schemaExpression.morphTargetBinds)==null||_e.forEach(bind=>__async2$1(this,null,function*(){var _a3;if(bind.node===void 0||bind.index===void 0)return;let primitives=yield gltfExtractPrimitivesFromNode$1(gltf,bind.node),morphTargetIndex=bind.index;if(!primitives.every(primitive=>Array.isArray(primitive.morphTargetInfluences)&&morphTargetIndex{let material=object.material;material&&(Array.isArray(material)?gltfMaterials.push(...material):gltfMaterials.push(material))}),(_f=schemaExpression.materialColorBinds)==null||_f.forEach(bind=>__async2$1(this,null,function*(){let materials=gltfMaterials.filter(material=>{var _a3;let materialIndex=(_a3=this.parser.associations.get(material))?.materials;return bind.material===materialIndex});materials.forEach(material=>{expression.addBind(new VRMExpressionMaterialColorBind$1({material,type:bind.type,targetValue:new Color().fromArray(bind.targetValue),targetAlpha:bind.targetValue[3]}))})})),(_g=schemaExpression.textureTransformBinds)==null||_g.forEach(bind=>__async2$1(this,null,function*(){let materials=gltfMaterials.filter(material=>{var _a3;let materialIndex=(_a3=this.parser.associations.get(material))?.materials;return bind.material===materialIndex});materials.forEach(material=>{var _a3,_b3;expression.addBind(new VRMExpressionTextureTransformBind$1({material,offset:new Vector2().fromArray((_a3=bind.offset)??[0,0]),scale:new Vector2().fromArray((_b3=bind.scale)??[1,1])}))})}))}manager.registerExpression(expression)}))),manager})}_v0Import(gltf){return __async2$1(this,null,function*(){var _a$2;let json=this.parser.json,vrmExt=(_a$2=json.extensions)?.VRM;if(!vrmExt)return null;let schemaBlendShape=vrmExt.blendShapeMaster;if(!schemaBlendShape)return null;let manager=new VRMExpressionManager$1,schemaBlendShapeGroups=schemaBlendShape.blendShapeGroups;if(!schemaBlendShapeGroups)return manager;let blendShapeNameSet=new Set;return yield Promise.all(schemaBlendShapeGroups.map(schemaGroup=>__async2$1(this,null,function*(){var _a2;let v0PresetName=schemaGroup.presetName,v1PresetName=v0PresetName!=null&&_VRMExpressionLoaderPlugin2.v0v1PresetNameMap[v0PresetName]||null,name$1=v1PresetName??schemaGroup.name;if(name$1==null){console.warn(`VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression`);return}if(blendShapeNameSet.has(name$1)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${v0PresetName} has duplicated entries. Ignoring the expression`);return}blendShapeNameSet.add(name$1);let expression=new VRMExpression$1(name$1);gltf.scene.add(expression),expression.isBinary=(_a2=schemaGroup.isBinary)??!1,schemaGroup.binds&&schemaGroup.binds.forEach(bind=>__async2$1(this,null,function*(){var _a3;if(bind.mesh===void 0||bind.index===void 0)return;let nodesUsingMesh=[];(_a3=json.nodes)==null||_a3.forEach((node$1,i)=>{node$1.mesh===bind.mesh&&nodesUsingMesh.push(i)});let morphTargetIndex=bind.index;yield Promise.all(nodesUsingMesh.map(nodeIndex=>__async2$1(this,null,function*(){var _a4;let primitives=yield gltfExtractPrimitivesFromNode$1(gltf,nodeIndex);if(!primitives.every(primitive=>Array.isArray(primitive.morphTargetInfluences)&&morphTargetIndex{if(materialValue.materialName===void 0||materialValue.propertyName===void 0||materialValue.targetValue===void 0)return;let materials=[];gltf.scene.traverse(object=>{if(object.material){let material=object.material;Array.isArray(material)?materials.push(...material.filter(mtl=>(mtl.name===materialValue.materialName||mtl.name===materialValue.materialName+` (Outline)`)&&materials.indexOf(mtl)===-1)):material.name===materialValue.materialName&&materials.indexOf(material)===-1&&materials.push(material)}});let materialPropertyName=materialValue.propertyName;materials.forEach(material=>{if(materialPropertyName===`_MainTex_ST`){let scale=new Vector2(materialValue.targetValue[0],materialValue.targetValue[1]),offset=new Vector2(materialValue.targetValue[2],materialValue.targetValue[3]);offset.y=1-offset.y-scale.y,expression.addBind(new VRMExpressionTextureTransformBind$1({material,scale,offset}));return}let materialColorType=v0ExpressionMaterialColorMap$1[materialPropertyName];if(materialColorType){expression.addBind(new VRMExpressionMaterialColorBind$1({material,type:materialColorType,targetValue:new Color().fromArray(materialValue.targetValue),targetAlpha:materialValue.targetValue[3]}));return}console.warn(materialPropertyName+` is not supported`)})}),manager.registerExpression(expression)}))),manager})}};_VRMExpressionLoaderPlugin$1.v0v1PresetNameMap={a:`aa`,e:`ee`,i:`ih`,o:`oh`,u:`ou`,blink:`blink`,joy:`happy`,angry:`angry`,sorrow:`sad`,fun:`relaxed`,lookup:`lookUp`,lookdown:`lookDown`,lookleft:`lookLeft`,lookright:`lookRight`,blink_l:`blinkLeft`,blink_r:`blinkRight`,neutral:`neutral`};var _VRMFirstPerson$1=class _VRMFirstPerson2{constructor(humanoid,meshAnnotations){this._firstPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=humanoid,this.meshAnnotations=meshAnnotations}copy(source){if(this.humanoid!==source.humanoid)throw Error(`VRMFirstPerson: humanoid must be same in order to copy`);return this.meshAnnotations=source.meshAnnotations.map(annotation=>({meshes:annotation.meshes.concat(),type:annotation.type})),this}clone(){return new _VRMFirstPerson2(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=firstPersonOnlyLayer,this._thirdPersonOnlyLayer=thirdPersonOnlyLayer,this.meshAnnotations.forEach(item=>{item.meshes.forEach(mesh=>{item.type===`firstPersonOnly`?(mesh.layers.set(this._firstPersonOnlyLayer),mesh.traverse(child=>child.layers.set(this._firstPersonOnlyLayer))):item.type===`thirdPersonOnly`?(mesh.layers.set(this._thirdPersonOnlyLayer),mesh.traverse(child=>child.layers.set(this._thirdPersonOnlyLayer))):item.type===`auto`&&this._createHeadlessModel(mesh)})}),this._initializedLayers=!0)}_excludeTriangles(triangles,bws,skinIndex,exclude){let count=0;if(bws!=null&&bws.length>0)for(let i=0;i0&&exclude.includes(skin0[0])||bw0[1]>0&&exclude.includes(skin0[1])||bw0[2]>0&&exclude.includes(skin0[2])||bw0[3]>0&&exclude.includes(skin0[3]))continue;let bw1=bws[b],skin1=skinIndex[b];if(bw1[0]>0&&exclude.includes(skin1[0])||bw1[1]>0&&exclude.includes(skin1[1])||bw1[2]>0&&exclude.includes(skin1[2])||bw1[3]>0&&exclude.includes(skin1[3]))continue;let bw2=bws[c],skin2=skinIndex[c];bw2[0]>0&&exclude.includes(skin2[0])||bw2[1]>0&&exclude.includes(skin2[1])||bw2[2]>0&&exclude.includes(skin2[2])||bw2[3]>0&&exclude.includes(skin2[3])||(triangles[count++]=a,triangles[count++]=b,triangles[count++]=c)}return count}_createErasedMesh(src,erasingBonesIndex){let dst=new SkinnedMesh(src.geometry.clone(),src.material);dst.name=`${src.name}(erase)`,dst.frustumCulled=src.frustumCulled,dst.layers.set(this._firstPersonOnlyLayer);let geometry=dst.geometry,skinIndexAttr=geometry.getAttribute(`skinIndex`),skinIndexAttrArray=skinIndexAttr instanceof GLBufferAttribute?[]:skinIndexAttr.array,skinIndex=[];for(let i=0;i{this._isEraseTarget(bone)&&eraseBoneIndexes.push(index$1)}),!eraseBoneIndexes.length){mesh.layers.enable(this._thirdPersonOnlyLayer),mesh.layers.enable(this._firstPersonOnlyLayer);return}mesh.layers.set(this._thirdPersonOnlyLayer);let newMesh=this._createErasedMesh(mesh,eraseBoneIndexes);parent.add(newMesh)}_createHeadlessModel(node$1){if(node$1.type===`Group`)if(node$1.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(node$1))node$1.traverse(child=>child.layers.set(this._thirdPersonOnlyLayer));else{let parent=new Group;parent.name=`_headless_${node$1.name}`,parent.layers.set(this._firstPersonOnlyLayer),node$1.parent.add(parent),node$1.children.filter(child=>child.type===`SkinnedMesh`).forEach(child=>{let skinnedMesh=child;this._createHeadlessModelForSkinnedMesh(parent,skinnedMesh)})}else if(node$1.type===`SkinnedMesh`){let skinnedMesh=node$1;this._createHeadlessModelForSkinnedMesh(node$1.parent,skinnedMesh)}else this._isEraseTarget(node$1)&&(node$1.layers.set(this._thirdPersonOnlyLayer),node$1.traverse(child=>child.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(bone){return bone===this.humanoid.getRawBoneNode(`head`)?!0:bone.parent?this._isEraseTarget(bone.parent):!1}};_VRMFirstPerson$1.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,_VRMFirstPerson$1.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var _v3A$1=new Vector3,_v3B$1=new Vector3,_quatA$1=new Quaternion,VRMHumanBoneParentMap$1={hips:null,spine:`hips`,chest:`spine`,upperChest:`chest`,neck:`upperChest`,head:`neck`,leftEye:`head`,rightEye:`head`,jaw:`head`,leftUpperLeg:`hips`,leftLowerLeg:`leftUpperLeg`,leftFoot:`leftLowerLeg`,leftToes:`leftFoot`,rightUpperLeg:`hips`,rightLowerLeg:`rightUpperLeg`,rightFoot:`rightLowerLeg`,rightToes:`rightFoot`,leftShoulder:`upperChest`,leftUpperArm:`leftShoulder`,leftLowerArm:`leftUpperArm`,leftHand:`leftLowerArm`,rightShoulder:`upperChest`,rightUpperArm:`rightShoulder`,rightLowerArm:`rightUpperArm`,rightHand:`rightLowerArm`,leftThumbMetacarpal:`leftHand`,leftThumbProximal:`leftThumbMetacarpal`,leftThumbDistal:`leftThumbProximal`,leftIndexProximal:`leftHand`,leftIndexIntermediate:`leftIndexProximal`,leftIndexDistal:`leftIndexIntermediate`,leftMiddleProximal:`leftHand`,leftMiddleIntermediate:`leftMiddleProximal`,leftMiddleDistal:`leftMiddleIntermediate`,leftRingProximal:`leftHand`,leftRingIntermediate:`leftRingProximal`,leftRingDistal:`leftRingIntermediate`,leftLittleProximal:`leftHand`,leftLittleIntermediate:`leftLittleProximal`,leftLittleDistal:`leftLittleIntermediate`,rightThumbMetacarpal:`rightHand`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbDistal:`rightThumbProximal`,rightIndexProximal:`rightHand`,rightIndexIntermediate:`rightIndexProximal`,rightIndexDistal:`rightIndexIntermediate`,rightMiddleProximal:`rightHand`,rightMiddleIntermediate:`rightMiddleProximal`,rightMiddleDistal:`rightMiddleIntermediate`,rightRingProximal:`rightHand`,rightRingIntermediate:`rightRingProximal`,rightRingDistal:`rightRingIntermediate`,rightLittleProximal:`rightHand`,rightLittleIntermediate:`rightLittleProximal`,rightLittleDistal:`rightLittleIntermediate`};function quatInvertCompat$1(target){return target.invert?target.invert():target.inverse(),target}var _v3A2$1=new Vector3,_quatA2$1=new Quaternion,_v3A3$1=new Vector3,_quatA3$1=new Quaternion,_boneWorldPos$1=new Vector3,_quatA4$1=new Quaternion,_quatB$1=new Quaternion,_v3A4$1=new Vector3,_v3B2$1=new Vector3,SQRT_2_OVER_2$1=Math.sqrt(2)/2,QUAT_XY_CW90$1=new Quaternion(0,0,-SQRT_2_OVER_2$1,SQRT_2_OVER_2$1),VEC3_POSITIVE_Y$1=new Vector3(0,1,0),_position$1=new Vector3,_scale$1=new Vector3;function getWorldQuaternionLite$1(object,out){return object.matrixWorld.decompose(_position$1,out,_scale$1),out}function calcAzimuthAltitude$1(vector){return[Math.atan2(-vector.z,vector.x),Math.atan2(vector.y,Math.sqrt(vector.x*vector.x+vector.z*vector.z))]}function sanitizeAngle$1(angle){let roundTurn=Math.round(angle/2/Math.PI);return angle-2*Math.PI*roundTurn}var VEC3_POSITIVE_Z$1=new Vector3(0,0,1),_v3A5$1=new Vector3,_v3B3$1=new Vector3,_v3C$1=new Vector3,_quatA5$1=new Quaternion,_quatB2$1=new Quaternion,_quatC$1=new Quaternion,_quatD$1=new Quaternion,_eulerA$1=new Euler,_VRMLookAt$1=class _VRMLookAt2{constructor(humanoid,applier){this.offsetFromHeadBone=new Vector3,this.autoUpdate=!0,this.faceFront=new Vector3(0,0,1),this.humanoid=humanoid,this.applier=applier,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new Quaternion)}get yaw(){return this._yaw}set yaw(value){this._yaw=value,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(value){this._pitch=value,this._needsUpdate=!0}get euler(){return console.warn(`VRMLookAt: euler is deprecated. use getEuler() instead.`),this.getEuler(new Euler)}getEuler(target){return target.set(MathUtils.DEG2RAD*this._pitch,MathUtils.DEG2RAD*this._yaw,0,`YXZ`)}copy(source){if(this.humanoid!==source.humanoid)throw Error(`VRMLookAt: humanoid must be same in order to copy`);return this.offsetFromHeadBone.copy(source.offsetFromHeadBone),this.applier=source.applier,this.autoUpdate=source.autoUpdate,this.target=source.target,this.faceFront.copy(source.faceFront),this}clone(){return new _VRMLookAt2(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(target){let head$1=this.humanoid.getRawBoneNode(`head`);return target.copy(this.offsetFromHeadBone).applyMatrix4(head$1.matrixWorld)}getLookAtWorldQuaternion(target){let head$1=this.humanoid.getRawBoneNode(`head`);return getWorldQuaternionLite$1(head$1,target)}getFaceFrontQuaternion(target){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z$1)<.01)return target.copy(this._restHeadWorldQuaternion).invert();let[faceFrontAzimuth,faceFrontAltitude]=calcAzimuthAltitude$1(this.faceFront);return _eulerA$1.set(0,.5*Math.PI+faceFrontAzimuth,faceFrontAltitude,`YZX`),target.setFromEuler(_eulerA$1).premultiply(_quatD$1.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(target){return this.getLookAtWorldQuaternion(_quatB2$1),this.getFaceFrontQuaternion(_quatC$1),target.copy(VEC3_POSITIVE_Z$1).applyQuaternion(_quatB2$1).applyQuaternion(_quatC$1).applyEuler(this.getEuler(_eulerA$1))}lookAt(position$2){let headRotDiffInv=_quatA5$1.copy(this._restHeadWorldQuaternion).multiply(quatInvertCompat$1(this.getLookAtWorldQuaternion(_quatB2$1))),headPos=this.getLookAtWorldPosition(_v3B3$1),lookAtDir=_v3C$1.copy(position$2).sub(headPos).applyQuaternion(headRotDiffInv).normalize(),[azimuthFrom,altitudeFrom]=calcAzimuthAltitude$1(this.faceFront),[azimuthTo,altitudeTo]=calcAzimuthAltitude$1(lookAtDir),yaw=sanitizeAngle$1(azimuthTo-azimuthFrom),pitch=sanitizeAngle$1(altitudeFrom-altitudeTo);this._yaw=MathUtils.RAD2DEG*yaw,this._pitch=MathUtils.RAD2DEG*pitch,this._needsUpdate=!0}update(delta){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_v3A5$1)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};_VRMLookAt$1.EULER_ORDER=`YXZ`;var VRMLookAt$1=_VRMLookAt$1,VEC3_POSITIVE_Z2$1=new Vector3(0,0,1),_quatA6$1=new Quaternion,_quatB3$1=new Quaternion,_eulerA2$1=new Euler(0,0,0,`YXZ`),VRMLookAtBoneApplier$1=class{constructor(humanoid,rangeMapHorizontalInner,rangeMapHorizontalOuter,rangeMapVerticalDown,rangeMapVerticalUp){this.humanoid=humanoid,this.rangeMapHorizontalInner=rangeMapHorizontalInner,this.rangeMapHorizontalOuter=rangeMapHorizontalOuter,this.rangeMapVerticalDown=rangeMapVerticalDown,this.rangeMapVerticalUp=rangeMapVerticalUp,this.faceFront=new Vector3(0,0,1),this._restQuatLeftEye=new Quaternion,this._restQuatRightEye=new Quaternion,this._restLeftEyeParentWorldQuat=new Quaternion,this._restRightEyeParentWorldQuat=new Quaternion;let leftEye=this.humanoid.getRawBoneNode(`leftEye`),rightEye=this.humanoid.getRawBoneNode(`rightEye`);leftEye&&(this._restQuatLeftEye.copy(leftEye.quaternion),getWorldQuaternionLite$1(leftEye.parent,this._restLeftEyeParentWorldQuat)),rightEye&&(this._restQuatRightEye.copy(rightEye.quaternion),getWorldQuaternionLite$1(rightEye.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(yaw,pitch){let leftEye=this.humanoid.getRawBoneNode(`leftEye`),rightEye=this.humanoid.getRawBoneNode(`rightEye`),leftEyeNormalized=this.humanoid.getNormalizedBoneNode(`leftEye`),rightEyeNormalized=this.humanoid.getNormalizedBoneNode(`rightEye`);leftEye&&(pitch<0?_eulerA2$1.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-pitch):_eulerA2$1.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(pitch),yaw<0?_eulerA2$1.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-yaw):_eulerA2$1.y=MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(yaw),_quatA6$1.setFromEuler(_eulerA2$1),this._getWorldFaceFrontQuat(_quatB3$1),leftEyeNormalized.quaternion.copy(_quatB3$1).multiply(_quatA6$1).multiply(_quatB3$1.invert()),_quatA6$1.copy(this._restLeftEyeParentWorldQuat),leftEye.quaternion.copy(leftEyeNormalized.quaternion).multiply(_quatA6$1).premultiply(_quatA6$1.invert()).multiply(this._restQuatLeftEye)),rightEye&&(pitch<0?_eulerA2$1.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-pitch):_eulerA2$1.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(pitch),yaw<0?_eulerA2$1.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-yaw):_eulerA2$1.y=MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(yaw),_quatA6$1.setFromEuler(_eulerA2$1),this._getWorldFaceFrontQuat(_quatB3$1),rightEyeNormalized.quaternion.copy(_quatB3$1).multiply(_quatA6$1).multiply(_quatB3$1.invert()),_quatA6$1.copy(this._restRightEyeParentWorldQuat),rightEye.quaternion.copy(rightEyeNormalized.quaternion).multiply(_quatA6$1).premultiply(_quatA6$1.invert()).multiply(this._restQuatRightEye))}lookAt(euler){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let yaw=MathUtils.RAD2DEG*euler.y,pitch=MathUtils.RAD2DEG*euler.x;this.applyYawPitch(yaw,pitch)}_getWorldFaceFrontQuat(target){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z2$1)<.01)return target.identity();let[faceFrontAzimuth,faceFrontAltitude]=calcAzimuthAltitude$1(this.faceFront);return _eulerA2$1.set(0,.5*Math.PI+faceFrontAzimuth,faceFrontAltitude,`YZX`),target.setFromEuler(_eulerA2$1)}};VRMLookAtBoneApplier$1.type=`bone`;var VRMLookAtExpressionApplier$1=class{constructor(expressions,rangeMapHorizontalInner,rangeMapHorizontalOuter,rangeMapVerticalDown,rangeMapVerticalUp){this.expressions=expressions,this.rangeMapHorizontalInner=rangeMapHorizontalInner,this.rangeMapHorizontalOuter=rangeMapHorizontalOuter,this.rangeMapVerticalDown=rangeMapVerticalDown,this.rangeMapVerticalUp=rangeMapVerticalUp}applyYawPitch(yaw,pitch){pitch<0?(this.expressions.setValue(`lookDown`,0),this.expressions.setValue(`lookUp`,this.rangeMapVerticalUp.map(-pitch))):(this.expressions.setValue(`lookUp`,0),this.expressions.setValue(`lookDown`,this.rangeMapVerticalDown.map(pitch))),yaw<0?(this.expressions.setValue(`lookLeft`,0),this.expressions.setValue(`lookRight`,this.rangeMapHorizontalOuter.map(-yaw))):(this.expressions.setValue(`lookRight`,0),this.expressions.setValue(`lookLeft`,this.rangeMapHorizontalOuter.map(yaw)))}lookAt(euler){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let yaw=MathUtils.RAD2DEG*euler.y,pitch=MathUtils.RAD2DEG*euler.x;this.applyYawPitch(yaw,pitch)}};VRMLookAtExpressionApplier$1.type=`expression`;var RAD2DEG=180/Math.PI,_eulerA3=new Euler,VRMLookAtQuaternionProxy=class extends Object3D{constructor(lookAt){super(),this.vrmLookAt=lookAt,this.type=`VRMLookAtQuaternionProxy`;let prevRotationOnChangeCallback=this.rotation._onChangeCallback;this.rotation._onChange(()=>{prevRotationOnChangeCallback(),this._applyToLookAt()});let prevQuaternionOnChangeCallback=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{prevQuaternionOnChangeCallback(),this._applyToLookAt()})}_applyToLookAt(){_eulerA3.setFromQuaternion(this.quaternion,VRMLookAt$1.EULER_ORDER),this.vrmLookAt.yaw=RAD2DEG*_eulerA3.y,this.vrmLookAt.pitch=RAD2DEG*_eulerA3.x}};function createVRMAnimationHumanoidTracks(vrmAnimation,humanoid,metaVersion){var _a$2,_b;let translation=new Map,rotation=new Map;for(let[name$1,origTrack]of vrmAnimation.humanoidTracks.rotation.entries()){let nodeName=(_a$2=humanoid.getNormalizedBoneNode(name$1))?.name;if(nodeName!=null){let track=new QuaternionKeyframeTrack(`${nodeName}.quaternion`,origTrack.times,origTrack.values.map((v,i)=>metaVersion===`0`&&i%2==0?-v:v));rotation.set(name$1,track)}}for(let[name$1,origTrack]of vrmAnimation.humanoidTracks.translation.entries()){let nodeName=(_b=humanoid.getNormalizedBoneNode(name$1))?.name;if(nodeName!=null){let animationY=vrmAnimation.restHipsPosition.y,humanoidY=humanoid.normalizedRestPose.hips.position[1],scale=humanoidY/animationY,track=origTrack.clone();track.values=track.values.map((v,i)=>(metaVersion===`0`&&i%3!=1?-v:v)*scale),track.name=`${nodeName}.position`,translation.set(name$1,track)}}return{translation,rotation}}function createVRMAnimationExpressionTracks(vrmAnimation,expressionManager){let preset=new Map,custom=new Map;for(let[name$1,origTrack]of vrmAnimation.expressionTracks.preset.entries()){let trackName=expressionManager.getExpressionTrackName(name$1);if(trackName!=null){let track=origTrack.clone();track.name=trackName,preset.set(name$1,track)}}for(let[name$1,origTrack]of vrmAnimation.expressionTracks.custom.entries()){let trackName=expressionManager.getExpressionTrackName(name$1);if(trackName!=null){let track=origTrack.clone();track.name=trackName,custom.set(name$1,track)}}return{preset,custom}}function createVRMAnimationLookAtTrack(vrmAnimation,trackName){if(vrmAnimation.lookAtTrack==null)return null;let track=vrmAnimation.lookAtTrack.clone();return track.name=trackName,track}function createVRMAnimationClip(vrmAnimation,vrm){let tracks=[],humanoidTracks=createVRMAnimationHumanoidTracks(vrmAnimation,vrm.humanoid,vrm.meta.metaVersion);if(tracks.push(...humanoidTracks.translation.values()),tracks.push(...humanoidTracks.rotation.values()),vrm.expressionManager!=null){let expressionTracks=createVRMAnimationExpressionTracks(vrmAnimation,vrm.expressionManager);tracks.push(...expressionTracks.preset.values()),tracks.push(...expressionTracks.custom.values())}if(vrm.lookAt!=null){let proxy=vrm.scene.children.find(obj=>obj instanceof VRMLookAtQuaternionProxy);proxy==null?(console.warn(`createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually`),proxy=new VRMLookAtQuaternionProxy(vrm.lookAt),proxy.name=`VRMLookAtQuaternionProxy`,vrm.scene.add(proxy)):proxy.name===``&&(console.warn(`createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually`),proxy.name=`VRMLookAtQuaternionProxy`);let track=createVRMAnimationLookAtTrack(vrmAnimation,`${proxy.name}.quaternion`);track!=null&&tracks.push(track)}return new AnimationClip(`Clip`,vrmAnimation.duration,tracks)}var VRMAnimation=class{constructor(){this.duration=0,this.restHipsPosition=new Vector3,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function arrayChunk(array,every){let N=array.length,ret=[],current=[],remaining=0;for(let i=0;i{let defAnimation=defGltf.animations[iAnimation],animation=this._parseAnimation(clip,defAnimation,nodeMap,worldMatrixMap);return animation.restHipsPosition=restHipsPosition,animation});gltf.userData.vrmAnimations=animations})}_createNodeMap(defExtension){var _a$2,_b,_c,_d,_e;let humanoidIndexToName=new Map,expressionsIndexToName=new Map,humanBones=(_a$2=defExtension.humanoid)?.humanBones;humanBones&&Object.entries(humanBones).forEach(([name$1,bone])=>{let node$1=bone?.node;node$1!=null&&humanoidIndexToName.set(node$1,name$1)});let preset=(_b=defExtension.expressions)?.preset;preset&&Object.entries(preset).forEach(([name$1,expression])=>{let node$1=expression?.node;node$1!=null&&expressionsIndexToName.set(node$1,name$1)});let custom=(_c=defExtension.expressions)?.custom;custom&&Object.entries(custom).forEach(([name$1,expression])=>{let{node:node$1}=expression;expressionsIndexToName.set(node$1,name$1)});let lookAtIndex=(_e=(_d=defExtension.lookAt)?.node)??null;return{humanoidIndexToName,expressionsIndexToName,lookAtIndex}}_createBoneWorldMatrixMap(gltf,defExtension){return __async$1(this,null,function*(){var _a$2,_b;gltf.scene.updateWorldMatrix(!1,!0);let threeNodes=yield gltf.parser.getDependencies(`node`),worldMatrixMap=new Map;if(defExtension.humanoid==null)return worldMatrixMap;for(let[boneName,humanBone]of Object.entries(defExtension.humanoid.humanBones)){let node$1=humanBone?.node;if(node$1!=null){let threeNode=threeNodes[node$1];worldMatrixMap.set(boneName,threeNode.matrixWorld),boneName===`hips`&&worldMatrixMap.set(`hipsParent`,(_b=(_a$2=threeNode.parent)?.matrixWorld)??MAT4_IDENTITY)}}return worldMatrixMap})}_parseAnimation(animationClip,defAnimation,nodeMap,worldMatrixMap){let tracks=animationClip.tracks,defChannels=defAnimation.channels,result=new VRMAnimation;return result.duration=animationClip.duration,defChannels.forEach((channel,iChannel)=>{let{node:node$1,path}=channel.target,origTrack=tracks[iChannel];if(node$1==null)return;let boneName=nodeMap.humanoidIndexToName.get(node$1);if(boneName!=null){let parentBoneName=VRMHumanBoneParentMap$1[boneName];for(;parentBoneName!=null&&worldMatrixMap.get(parentBoneName)==null;)parentBoneName=VRMHumanBoneParentMap$1[parentBoneName];if(parentBoneName??=`hipsParent`,path===`translation`)if(boneName!==`hips`)console.warn(`The loading animation contains a translation track for ${boneName}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{let hipsParentWorldMatrix=worldMatrixMap.get(`hipsParent`),trackValues=arrayChunk(origTrack.values,3).flatMap(v=>_v3A6$1.fromArray(v).applyMatrix4(hipsParentWorldMatrix).toArray()),track=origTrack.clone();track.values=new Float32Array(trackValues),result.humanoidTracks.translation.set(boneName,track)}else if(path===`rotation`){let worldMatrix=worldMatrixMap.get(boneName),parentWorldMatrix=worldMatrixMap.get(parentBoneName);worldMatrix.decompose(_v3A6$1,_quatA7$1,_v3A6$1),_quatA7$1.invert(),parentWorldMatrix.decompose(_v3A6$1,_quatB4$1,_v3A6$1);let trackValues=arrayChunk(origTrack.values,4).flatMap(q=>_quatC2$1.fromArray(q).premultiply(_quatB4$1).multiply(_quatA7$1).toArray()),track=origTrack.clone();track.values=new Float32Array(trackValues),result.humanoidTracks.rotation.set(boneName,track)}else throw Error(`Invalid path "${path}"`);return}let expressionName=nodeMap.expressionsIndexToName.get(node$1);if(expressionName!=null){if(path===`translation`){let times=origTrack.times,values=new Float32Array(origTrack.values.length/3);for(let i=0;inew Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),__async2=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),VRMExpression=class extends Object3D{constructor(expressionName){super(),this.weight=0,this.isBinary=!1,this.overrideBlink=`none`,this.overrideLookAt=`none`,this.overrideMouth=`none`,this._binds=[],this.name=`VRMExpression_${expressionName}`,this.expressionName=expressionName,this.type=`VRMExpression`,this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink===`block`?0.5?1:0:this.weight}addBind(bind){this._binds.push(bind)}deleteBind(bind){let index$1=this._binds.indexOf(bind);index$1>=0&&this._binds.splice(index$1,1)}applyWeight(options){var _a$2;let actualWeight=this.outputWeight;actualWeight*=(_a$2=options?.multiplier)??1,this.isBinary&&actualWeight<1&&(actualWeight=0),this._binds.forEach(bind=>bind.applyWeight(actualWeight))}clearAppliedWeight(){this._binds.forEach(bind=>bind.clearAppliedWeight())}};function extractPrimitivesInternal(gltf,nodeIndex,node$1){var _a$2,_b;let json=gltf.parser.json,schemaNode=(_a$2=json.nodes)?.[nodeIndex];if(schemaNode==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${nodeIndex}] of glTF but the node doesn't exist`),null;let meshIndex=schemaNode.mesh;if(meshIndex==null)return null;let schemaMesh=(_b=json.meshes)?.[meshIndex];if(schemaMesh==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${meshIndex}] of glTF but the mesh doesn't exist`),null;let primitiveCount=schemaMesh.primitives.length,primitives=[];return node$1.traverse(object=>{primitives.length{let result=extractPrimitivesInternal(gltf,index$1,node$1);result!=null&&map.set(index$1,result)}),map})}var VRMExpressionPresetName={Aa:`aa`,Ih:`ih`,Ou:`ou`,Ee:`ee`,Oh:`oh`,Blink:`blink`,Happy:`happy`,Angry:`angry`,Sad:`sad`,Relaxed:`relaxed`,LookUp:`lookUp`,Surprised:`surprised`,LookDown:`lookDown`,LookLeft:`lookLeft`,LookRight:`lookRight`,BlinkLeft:`blinkLeft`,BlinkRight:`blinkRight`,Neutral:`neutral`};function saturate(value){return Math.max(Math.min(value,1),0)}var VRMExpressionManager=class _VRMExpressionManager{constructor(){this.blinkExpressionNames=[`blink`,`blinkLeft`,`blinkRight`],this.lookAtExpressionNames=[`lookLeft`,`lookRight`,`lookUp`,`lookDown`],this.mouthExpressionNames=[`aa`,`ee`,`ih`,`oh`,`ou`],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let result={},presetNameSet=new Set(Object.values(VRMExpressionPresetName));return Object.entries(this._expressionMap).forEach(([name$1,expression])=>{presetNameSet.has(name$1)&&(result[name$1]=expression)}),result}get customExpressionMap(){let result={},presetNameSet=new Set(Object.values(VRMExpressionPresetName));return Object.entries(this._expressionMap).forEach(([name$1,expression])=>{presetNameSet.has(name$1)||(result[name$1]=expression)}),result}copy(source){let expressions=this._expressions.concat();return expressions.forEach(expression=>{this.unregisterExpression(expression)}),source._expressions.forEach(expression=>{this.registerExpression(expression)}),this.blinkExpressionNames=source.blinkExpressionNames.concat(),this.lookAtExpressionNames=source.lookAtExpressionNames.concat(),this.mouthExpressionNames=source.mouthExpressionNames.concat(),this}clone(){return new _VRMExpressionManager().copy(this)}getExpression(name$1){var _a$2;return(_a$2=this._expressionMap[name$1])??null}registerExpression(expression){this._expressions.push(expression),this._expressionMap[expression.expressionName]=expression}unregisterExpression(expression){let index$1=this._expressions.indexOf(expression);index$1===-1&&console.warn(`VRMExpressionManager: The specified expressions is not registered`),this._expressions.splice(index$1,1),delete this._expressionMap[expression.expressionName]}getValue(name$1){var _a$2;let expression=this.getExpression(name$1);return(_a$2=expression?.weight)??null}setValue(name$1,weight){let expression=this.getExpression(name$1);expression&&(expression.weight=saturate(weight))}resetValues(){this._expressions.forEach(expression=>{expression.weight=0})}getExpressionTrackName(name$1){let expression=this.getExpression(name$1);return expression?`${expression.name}.weight`:null}update(){let weightMultipliers=this._calculateWeightMultipliers();this._expressions.forEach(expression=>{expression.clearAppliedWeight()}),this._expressions.forEach(expression=>{let multiplier=1,name$1=expression.expressionName;this.blinkExpressionNames.indexOf(name$1)!==-1&&(multiplier*=weightMultipliers.blink),this.lookAtExpressionNames.indexOf(name$1)!==-1&&(multiplier*=weightMultipliers.lookAt),this.mouthExpressionNames.indexOf(name$1)!==-1&&(multiplier*=weightMultipliers.mouth),expression.applyWeight({multiplier})})}_calculateWeightMultipliers(){let blink=1,lookAt=1,mouth=1;return this._expressions.forEach(expression=>{blink-=expression.overrideBlinkAmount,lookAt-=expression.overrideLookAtAmount,mouth-=expression.overrideMouthAmount}),blink=Math.max(0,blink),lookAt=Math.max(0,lookAt),mouth=Math.max(0,mouth),{blink,lookAt,mouth}}},VRMExpressionMaterialColorType={Color:`color`,EmissionColor:`emissionColor`,ShadeColor:`shadeColor`,MatcapColor:`matcapColor`,RimColor:`rimColor`,OutlineColor:`outlineColor`},v0ExpressionMaterialColorMap={_Color:VRMExpressionMaterialColorType.Color,_EmissionColor:VRMExpressionMaterialColorType.EmissionColor,_ShadeColor:VRMExpressionMaterialColorType.ShadeColor,_RimColor:VRMExpressionMaterialColorType.RimColor,_OutlineColor:VRMExpressionMaterialColorType.OutlineColor},_color=new Color,_VRMExpressionMaterialColorBind=class _VRMExpressionMaterialColorBind2{constructor({material,type,targetValue,targetAlpha}){this.material=material,this.type=type,this.targetValue=targetValue,this.targetAlpha=targetAlpha??1;let color$1=this._initColorBindState(),alpha=this._initAlphaBindState();this._state={color:color$1,alpha}}applyWeight(weight){let{color:color$1,alpha}=this._state;if(color$1!=null){let{propertyName,deltaValue}=color$1,target=this.material[propertyName];target?.add(_color.copy(deltaValue).multiplyScalar(weight))}if(alpha!=null){let{propertyName,deltaValue}=alpha,target=this.material[propertyName];target!=null&&(this.material[propertyName]+=deltaValue*weight)}}clearAppliedWeight(){let{color:color$1,alpha}=this._state;if(color$1!=null){let{propertyName,initialValue}=color$1,target=this.material[propertyName];target?.copy(initialValue)}if(alpha!=null){let{propertyName,initialValue}=alpha,target=this.material[propertyName];target!=null&&(this.material[propertyName]=initialValue)}}_initColorBindState(){var _a$2,_b,_c;let{material,type,targetValue}=this,propertyNameMap=this._getPropertyNameMap(),propertyName=(_b=(_a$2=propertyNameMap?.[type])?.[0])??null;if(propertyName==null)return console.warn(`Tried to add a material color bind to the material ${(_c=material.name)??`(no name)`}, the type ${type} but the material or the type is not supported.`),null;let target=material[propertyName],initialValue=target.clone(),deltaValue=new Color(targetValue.r-initialValue.r,targetValue.g-initialValue.g,targetValue.b-initialValue.b);return{propertyName,initialValue,deltaValue}}_initAlphaBindState(){var _a$2,_b,_c;let{material,type,targetAlpha}=this,propertyNameMap=this._getPropertyNameMap(),propertyName=(_b=(_a$2=propertyNameMap?.[type])?.[1])??null;if(propertyName==null&&targetAlpha!==1)return console.warn(`Tried to add a material alpha bind to the material ${(_c=material.name)??`(no name)`}, the type ${type} but the material or the type does not support alpha.`),null;if(propertyName==null)return null;let initialValue=material[propertyName],deltaValue=targetAlpha-initialValue;return{propertyName,initialValue,deltaValue}}_getPropertyNameMap(){var _a$2,_b;return(_b=(_a$2=Object.entries(_VRMExpressionMaterialColorBind2._propertyNameMapMap).find(([distinguisher])=>this.material[distinguisher]===!0))?.[1])??null}};_VRMExpressionMaterialColorBind._propertyNameMapMap={isMeshStandardMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null]},isMeshBasicMaterial:{color:[`color`,`opacity`]},isMToonMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null],outlineColor:[`outlineColorFactor`,null],matcapColor:[`matcapFactor`,null],rimColor:[`parametricRimColorFactor`,null],shadeColor:[`shadeColorFactor`,null]}};var VRMExpressionMaterialColorBind=_VRMExpressionMaterialColorBind,VRMExpressionMorphTargetBind=class{constructor({primitives,index:index$1,weight}){this.primitives=primitives,this.index=index$1,this.weight=weight}applyWeight(weight){this.primitives.forEach(mesh=>{var _a$2;(_a$2=mesh.morphTargetInfluences)?.[this.index]!=null&&(mesh.morphTargetInfluences[this.index]+=this.weight*weight)})}clearAppliedWeight(){this.primitives.forEach(mesh=>{var _a$2;(_a$2=mesh.morphTargetInfluences)?.[this.index]!=null&&(mesh.morphTargetInfluences[this.index]=0)})}},_v2=new Vector2,_VRMExpressionTextureTransformBind=class _VRMExpressionTextureTransformBind2{constructor({material,scale,offset}){var _a$2,_b;this.material=material,this.scale=scale,this.offset=offset;let propertyNames=(_a$2=Object.entries(_VRMExpressionTextureTransformBind2._propertyNamesMap).find(([distinguisher])=>material[distinguisher]===!0))?.[1];propertyNames==null?(console.warn(`Tried to add a texture transform bind to the material ${(_b=material.name)??`(no name)`} but the material is not supported.`),this._properties=[]):(this._properties=[],propertyNames.forEach(propertyName=>{var _a2;let texture=(_a2=material[propertyName])?.clone();if(!texture)return null;material[propertyName]=texture;let initialOffset=texture.offset.clone(),initialScale=texture.repeat.clone(),deltaOffset=offset.clone().sub(initialOffset),deltaScale=scale.clone().sub(initialScale);this._properties.push({name:propertyName,initialOffset,deltaOffset,initialScale,deltaScale})}))}applyWeight(weight){this._properties.forEach(property=>{let target=this.material[property.name];target!==void 0&&(target.offset.add(_v2.copy(property.deltaOffset).multiplyScalar(weight)),target.repeat.add(_v2.copy(property.deltaScale).multiplyScalar(weight)))})}clearAppliedWeight(){this._properties.forEach(property=>{let target=this.material[property.name];target!==void 0&&(target.offset.copy(property.initialOffset),target.repeat.copy(property.initialScale))})}};_VRMExpressionTextureTransformBind._propertyNamesMap={isMeshStandardMaterial:[`map`,`emissiveMap`,`bumpMap`,`normalMap`,`displacementMap`,`roughnessMap`,`metalnessMap`,`alphaMap`],isMeshBasicMaterial:[`map`,`specularMap`,`alphaMap`],isMToonMaterial:[`map`,`normalMap`,`emissiveMap`,`shadeMultiplyTexture`,`rimMultiplyTexture`,`outlineWidthMultiplyTexture`,`uvAnimationMaskTexture`]};var VRMExpressionTextureTransformBind=_VRMExpressionTextureTransformBind,POSSIBLE_SPEC_VERSIONS=new Set([`1.0`,`1.0-beta`]),_VRMExpressionLoaderPlugin=class _VRMExpressionLoaderPlugin2{get name(){return`VRMExpressionLoaderPlugin`}constructor(parser){this.parser=parser}afterRoot(gltf){return __async2(this,null,function*(){gltf.userData.vrmExpressionManager=yield this._import(gltf)})}_import(gltf){return __async2(this,null,function*(){let v1Result=yield this._v1Import(gltf);if(v1Result)return v1Result;let v0Result=yield this._v0Import(gltf);return v0Result||null})}_v1Import(gltf){return __async2(this,null,function*(){var _a$2,_b;let json=this.parser.json,isVRMUsed=(_a$2=json.extensionsUsed)?.indexOf(`VRMC_vrm`)!==-1;if(!isVRMUsed)return null;let extension$1=(_b=json.extensions)?.VRMC_vrm;if(!extension$1)return null;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS.has(specVersion))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${specVersion}"`),null;let schemaExpressions=extension$1.expressions;if(!schemaExpressions)return null;let presetNameSet=new Set(Object.values(VRMExpressionPresetName)),nameSchemaExpressionMap=new Map;schemaExpressions.preset!=null&&Object.entries(schemaExpressions.preset).forEach(([name$1,schemaExpression])=>{if(schemaExpression!=null){if(!presetNameSet.has(name$1)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${name$1}" detected. Ignoring the expression`);return}nameSchemaExpressionMap.set(name$1,schemaExpression)}}),schemaExpressions.custom!=null&&Object.entries(schemaExpressions.custom).forEach(([name$1,schemaExpression])=>{if(presetNameSet.has(name$1)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${name$1}". Ignoring the expression`);return}nameSchemaExpressionMap.set(name$1,schemaExpression)});let manager=new VRMExpressionManager;return yield Promise.all(Array.from(nameSchemaExpressionMap.entries()).map(_0=>__async2(this,[_0],function*([name$1,schemaExpression]){var _a2,_b2,_c,_d,_e,_f,_g;let expression=new VRMExpression(name$1);if(gltf.scene.add(expression),expression.isBinary=(_a2=schemaExpression.isBinary)??!1,expression.overrideBlink=(_b2=schemaExpression.overrideBlink)??`none`,expression.overrideLookAt=(_c=schemaExpression.overrideLookAt)??`none`,expression.overrideMouth=(_d=schemaExpression.overrideMouth)??`none`,(_e=schemaExpression.morphTargetBinds)==null||_e.forEach(bind=>__async2(this,null,function*(){var _a3;if(bind.node===void 0||bind.index===void 0)return;let primitives=yield gltfExtractPrimitivesFromNode(gltf,bind.node),morphTargetIndex=bind.index;if(!primitives.every(primitive=>Array.isArray(primitive.morphTargetInfluences)&&morphTargetIndex{let material=object.material;material&&(Array.isArray(material)?gltfMaterials.push(...material):gltfMaterials.push(material))}),(_f=schemaExpression.materialColorBinds)==null||_f.forEach(bind=>__async2(this,null,function*(){let materials=gltfMaterials.filter(material=>{var _a3;let materialIndex=(_a3=this.parser.associations.get(material))?.materials;return bind.material===materialIndex});materials.forEach(material=>{expression.addBind(new VRMExpressionMaterialColorBind({material,type:bind.type,targetValue:new Color().fromArray(bind.targetValue),targetAlpha:bind.targetValue[3]}))})})),(_g=schemaExpression.textureTransformBinds)==null||_g.forEach(bind=>__async2(this,null,function*(){let materials=gltfMaterials.filter(material=>{var _a3;let materialIndex=(_a3=this.parser.associations.get(material))?.materials;return bind.material===materialIndex});materials.forEach(material=>{var _a3,_b3;expression.addBind(new VRMExpressionTextureTransformBind({material,offset:new Vector2().fromArray((_a3=bind.offset)??[0,0]),scale:new Vector2().fromArray((_b3=bind.scale)??[1,1])}))})}))}manager.registerExpression(expression)}))),manager})}_v0Import(gltf){return __async2(this,null,function*(){var _a$2;let json=this.parser.json,vrmExt=(_a$2=json.extensions)?.VRM;if(!vrmExt)return null;let schemaBlendShape=vrmExt.blendShapeMaster;if(!schemaBlendShape)return null;let manager=new VRMExpressionManager,schemaBlendShapeGroups=schemaBlendShape.blendShapeGroups;if(!schemaBlendShapeGroups)return manager;let blendShapeNameSet=new Set;return yield Promise.all(schemaBlendShapeGroups.map(schemaGroup=>__async2(this,null,function*(){var _a2;let v0PresetName=schemaGroup.presetName,v1PresetName=v0PresetName!=null&&_VRMExpressionLoaderPlugin2.v0v1PresetNameMap[v0PresetName]||null,name$1=v1PresetName??schemaGroup.name;if(name$1==null){console.warn(`VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression`);return}if(blendShapeNameSet.has(name$1)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${v0PresetName} has duplicated entries. Ignoring the expression`);return}blendShapeNameSet.add(name$1);let expression=new VRMExpression(name$1);gltf.scene.add(expression),expression.isBinary=(_a2=schemaGroup.isBinary)??!1,schemaGroup.binds&&schemaGroup.binds.forEach(bind=>__async2(this,null,function*(){var _a3;if(bind.mesh===void 0||bind.index===void 0)return;let nodesUsingMesh=[];(_a3=json.nodes)==null||_a3.forEach((node$1,i)=>{node$1.mesh===bind.mesh&&nodesUsingMesh.push(i)});let morphTargetIndex=bind.index;yield Promise.all(nodesUsingMesh.map(nodeIndex=>__async2(this,null,function*(){var _a4;let primitives=yield gltfExtractPrimitivesFromNode(gltf,nodeIndex);if(!primitives.every(primitive=>Array.isArray(primitive.morphTargetInfluences)&&morphTargetIndex{if(materialValue.materialName===void 0||materialValue.propertyName===void 0||materialValue.targetValue===void 0)return;let materials=[];gltf.scene.traverse(object=>{if(object.material){let material=object.material;Array.isArray(material)?materials.push(...material.filter(mtl=>(mtl.name===materialValue.materialName||mtl.name===materialValue.materialName+` (Outline)`)&&materials.indexOf(mtl)===-1)):material.name===materialValue.materialName&&materials.indexOf(material)===-1&&materials.push(material)}});let materialPropertyName=materialValue.propertyName;materials.forEach(material=>{if(materialPropertyName===`_MainTex_ST`){let scale=new Vector2(materialValue.targetValue[0],materialValue.targetValue[1]),offset=new Vector2(materialValue.targetValue[2],materialValue.targetValue[3]);offset.y=1-offset.y-scale.y,expression.addBind(new VRMExpressionTextureTransformBind({material,scale,offset}));return}let materialColorType=v0ExpressionMaterialColorMap[materialPropertyName];if(materialColorType){expression.addBind(new VRMExpressionMaterialColorBind({material,type:materialColorType,targetValue:new Color().fromArray(materialValue.targetValue),targetAlpha:materialValue.targetValue[3]}));return}console.warn(materialPropertyName+` is not supported`)})}),manager.registerExpression(expression)}))),manager})}};_VRMExpressionLoaderPlugin.v0v1PresetNameMap={a:`aa`,e:`ee`,i:`ih`,o:`oh`,u:`ou`,blink:`blink`,joy:`happy`,angry:`angry`,sorrow:`sad`,fun:`relaxed`,lookup:`lookUp`,lookdown:`lookDown`,lookleft:`lookLeft`,lookright:`lookRight`,blink_l:`blinkLeft`,blink_r:`blinkRight`,neutral:`neutral`};var VRMExpressionLoaderPlugin=_VRMExpressionLoaderPlugin,_VRMFirstPerson=class _VRMFirstPerson2{constructor(humanoid,meshAnnotations){this._firstPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=humanoid,this.meshAnnotations=meshAnnotations}copy(source){if(this.humanoid!==source.humanoid)throw Error(`VRMFirstPerson: humanoid must be same in order to copy`);return this.meshAnnotations=source.meshAnnotations.map(annotation=>({meshes:annotation.meshes.concat(),type:annotation.type})),this}clone(){return new _VRMFirstPerson2(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer=_VRMFirstPerson2.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=firstPersonOnlyLayer,this._thirdPersonOnlyLayer=thirdPersonOnlyLayer,this.meshAnnotations.forEach(item=>{item.meshes.forEach(mesh=>{item.type===`firstPersonOnly`?(mesh.layers.set(this._firstPersonOnlyLayer),mesh.traverse(child=>child.layers.set(this._firstPersonOnlyLayer))):item.type===`thirdPersonOnly`?(mesh.layers.set(this._thirdPersonOnlyLayer),mesh.traverse(child=>child.layers.set(this._thirdPersonOnlyLayer))):item.type===`auto`&&this._createHeadlessModel(mesh)})}),this._initializedLayers=!0)}_excludeTriangles(triangles,bws,skinIndex,exclude){let count=0;if(bws!=null&&bws.length>0)for(let i=0;i0&&exclude.includes(skin0[0])||bw0[1]>0&&exclude.includes(skin0[1])||bw0[2]>0&&exclude.includes(skin0[2])||bw0[3]>0&&exclude.includes(skin0[3]))continue;let bw1=bws[b],skin1=skinIndex[b];if(bw1[0]>0&&exclude.includes(skin1[0])||bw1[1]>0&&exclude.includes(skin1[1])||bw1[2]>0&&exclude.includes(skin1[2])||bw1[3]>0&&exclude.includes(skin1[3]))continue;let bw2=bws[c],skin2=skinIndex[c];bw2[0]>0&&exclude.includes(skin2[0])||bw2[1]>0&&exclude.includes(skin2[1])||bw2[2]>0&&exclude.includes(skin2[2])||bw2[3]>0&&exclude.includes(skin2[3])||(triangles[count++]=a,triangles[count++]=b,triangles[count++]=c)}return count}_createErasedMesh(src,erasingBonesIndex){let dst=new SkinnedMesh(src.geometry.clone(),src.material);dst.name=`${src.name}(erase)`,dst.frustumCulled=src.frustumCulled,dst.layers.set(this._firstPersonOnlyLayer);let geometry=dst.geometry,skinIndexAttr=geometry.getAttribute(`skinIndex`),skinIndexAttrArray=skinIndexAttr instanceof GLBufferAttribute?[]:skinIndexAttr.array,skinIndex=[];for(let i=0;i{this._isEraseTarget(bone)&&eraseBoneIndexes.push(index$1)}),!eraseBoneIndexes.length){mesh.layers.enable(this._thirdPersonOnlyLayer),mesh.layers.enable(this._firstPersonOnlyLayer);return}mesh.layers.set(this._thirdPersonOnlyLayer);let newMesh=this._createErasedMesh(mesh,eraseBoneIndexes);parent.add(newMesh)}_createHeadlessModel(node$1){if(node$1.type===`Group`)if(node$1.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(node$1))node$1.traverse(child=>child.layers.set(this._thirdPersonOnlyLayer));else{let parent=new Group;parent.name=`_headless_${node$1.name}`,parent.layers.set(this._firstPersonOnlyLayer),node$1.parent.add(parent),node$1.children.filter(child=>child.type===`SkinnedMesh`).forEach(child=>{let skinnedMesh=child;this._createHeadlessModelForSkinnedMesh(parent,skinnedMesh)})}else if(node$1.type===`SkinnedMesh`){let skinnedMesh=node$1;this._createHeadlessModelForSkinnedMesh(node$1.parent,skinnedMesh)}else this._isEraseTarget(node$1)&&(node$1.layers.set(this._thirdPersonOnlyLayer),node$1.traverse(child=>child.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(bone){return bone===this.humanoid.getRawBoneNode(`head`)?!0:bone.parent?this._isEraseTarget(bone.parent):!1}};_VRMFirstPerson.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,_VRMFirstPerson.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var VRMFirstPerson=_VRMFirstPerson,POSSIBLE_SPEC_VERSIONS2=new Set([`1.0`,`1.0-beta`]),VRMFirstPersonLoaderPlugin=class{get name(){return`VRMFirstPersonLoaderPlugin`}constructor(parser){this.parser=parser}afterRoot(gltf){return __async2(this,null,function*(){let vrmHumanoid=gltf.userData.vrmHumanoid;if(vrmHumanoid!==null){if(vrmHumanoid===void 0)throw Error(`VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first`);gltf.userData.vrmFirstPerson=yield this._import(gltf,vrmHumanoid)}})}_import(gltf,humanoid){return __async2(this,null,function*(){if(humanoid==null)return null;let v1Result=yield this._v1Import(gltf,humanoid);if(v1Result)return v1Result;let v0Result=yield this._v0Import(gltf,humanoid);return v0Result||null})}_v1Import(gltf,humanoid){return __async2(this,null,function*(){var _a$2,_b;let json=this.parser.json,isVRMUsed=(_a$2=json.extensionsUsed)?.indexOf(`VRMC_vrm`)!==-1;if(!isVRMUsed)return null;let extension$1=(_b=json.extensions)?.VRMC_vrm;if(!extension$1)return null;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS2.has(specVersion))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${specVersion}"`),null;let schemaFirstPerson=extension$1.firstPerson,meshAnnotations=[],nodePrimitivesMap=yield gltfExtractPrimitivesFromNodes(gltf);return Array.from(nodePrimitivesMap.entries()).forEach(([nodeIndex,primitives])=>{var _a2,_b2;let annotation=(_a2=schemaFirstPerson?.meshAnnotations)?.find(a=>a.node===nodeIndex);meshAnnotations.push({meshes:primitives,type:(_b2=annotation?.type)??`auto`})}),new VRMFirstPerson(humanoid,meshAnnotations)})}_v0Import(gltf,humanoid){return __async2(this,null,function*(){var _a$2;let json=this.parser.json,vrmExt=(_a$2=json.extensions)?.VRM;if(!vrmExt)return null;let schemaFirstPerson=vrmExt.firstPerson;if(!schemaFirstPerson)return null;let meshAnnotations=[],nodePrimitivesMap=yield gltfExtractPrimitivesFromNodes(gltf);return Array.from(nodePrimitivesMap.entries()).forEach(([nodeIndex,primitives])=>{let schemaNode=json.nodes[nodeIndex],flag=schemaFirstPerson.meshAnnotations?schemaFirstPerson.meshAnnotations.find(a=>a.mesh===schemaNode.mesh):void 0;meshAnnotations.push({meshes:primitives,type:this._convertV0FlagToV1Type(flag?.firstPersonFlag)})}),new VRMFirstPerson(humanoid,meshAnnotations)})}_convertV0FlagToV1Type(flag){return flag===`FirstPersonOnly`?`firstPersonOnly`:flag===`ThirdPersonOnly`?`thirdPersonOnly`:flag===`Both`?`both`:`auto`}},_v3A=new Vector3,_v3B=new Vector3,_quatA=new Quaternion,VRMHumanoidHelper=class extends Group{constructor(humanoid){super(),this.vrmHumanoid=humanoid,this._boneAxesMap=new Map,Object.values(humanoid.humanBones).forEach(bone=>{let helper=new AxesHelper(1);helper.matrixAutoUpdate=!1,helper.material.depthTest=!1,helper.material.depthWrite=!1,this.add(helper),this._boneAxesMap.set(bone,helper)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(axes=>{axes.geometry.dispose(),axes.material.dispose()})}updateMatrixWorld(force){Array.from(this._boneAxesMap.entries()).forEach(([bone,axes])=>{bone.node.updateWorldMatrix(!0,!1),bone.node.matrixWorld.decompose(_v3A,_quatA,_v3B);let scale=_v3A.set(.1,.1,.1).divide(_v3B);axes.matrix.copy(bone.node.matrixWorld).scale(scale)}),super.updateMatrixWorld(force)}},VRMHumanBoneList=`hips.spine.chest.upperChest.neck.head.leftEye.rightEye.jaw.leftUpperLeg.leftLowerLeg.leftFoot.leftToes.rightUpperLeg.rightLowerLeg.rightFoot.rightToes.leftShoulder.leftUpperArm.leftLowerArm.leftHand.rightShoulder.rightUpperArm.rightLowerArm.rightHand.leftThumbMetacarpal.leftThumbProximal.leftThumbDistal.leftIndexProximal.leftIndexIntermediate.leftIndexDistal.leftMiddleProximal.leftMiddleIntermediate.leftMiddleDistal.leftRingProximal.leftRingIntermediate.leftRingDistal.leftLittleProximal.leftLittleIntermediate.leftLittleDistal.rightThumbMetacarpal.rightThumbProximal.rightThumbDistal.rightIndexProximal.rightIndexIntermediate.rightIndexDistal.rightMiddleProximal.rightMiddleIntermediate.rightMiddleDistal.rightRingProximal.rightRingIntermediate.rightRingDistal.rightLittleProximal.rightLittleIntermediate.rightLittleDistal`.split(`.`),VRMHumanBoneParentMap={hips:null,spine:`hips`,chest:`spine`,upperChest:`chest`,neck:`upperChest`,head:`neck`,leftEye:`head`,rightEye:`head`,jaw:`head`,leftUpperLeg:`hips`,leftLowerLeg:`leftUpperLeg`,leftFoot:`leftLowerLeg`,leftToes:`leftFoot`,rightUpperLeg:`hips`,rightLowerLeg:`rightUpperLeg`,rightFoot:`rightLowerLeg`,rightToes:`rightFoot`,leftShoulder:`upperChest`,leftUpperArm:`leftShoulder`,leftLowerArm:`leftUpperArm`,leftHand:`leftLowerArm`,rightShoulder:`upperChest`,rightUpperArm:`rightShoulder`,rightLowerArm:`rightUpperArm`,rightHand:`rightLowerArm`,leftThumbMetacarpal:`leftHand`,leftThumbProximal:`leftThumbMetacarpal`,leftThumbDistal:`leftThumbProximal`,leftIndexProximal:`leftHand`,leftIndexIntermediate:`leftIndexProximal`,leftIndexDistal:`leftIndexIntermediate`,leftMiddleProximal:`leftHand`,leftMiddleIntermediate:`leftMiddleProximal`,leftMiddleDistal:`leftMiddleIntermediate`,leftRingProximal:`leftHand`,leftRingIntermediate:`leftRingProximal`,leftRingDistal:`leftRingIntermediate`,leftLittleProximal:`leftHand`,leftLittleIntermediate:`leftLittleProximal`,leftLittleDistal:`leftLittleIntermediate`,rightThumbMetacarpal:`rightHand`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbDistal:`rightThumbProximal`,rightIndexProximal:`rightHand`,rightIndexIntermediate:`rightIndexProximal`,rightIndexDistal:`rightIndexIntermediate`,rightMiddleProximal:`rightHand`,rightMiddleIntermediate:`rightMiddleProximal`,rightMiddleDistal:`rightMiddleIntermediate`,rightRingProximal:`rightHand`,rightRingIntermediate:`rightRingProximal`,rightRingDistal:`rightRingIntermediate`,rightLittleProximal:`rightHand`,rightLittleIntermediate:`rightLittleProximal`,rightLittleDistal:`rightLittleIntermediate`};function quatInvertCompat(target){return target.invert?target.invert():target.inverse(),target}var _v3A2=new Vector3,_quatA2=new Quaternion,VRMRig=class{constructor(humanBones){this.humanBones=humanBones,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let pose={};return Object.keys(this.humanBones).forEach(vrmBoneNameString=>{let vrmBoneName=vrmBoneNameString,node$1=this.getBoneNode(vrmBoneName);node$1&&(_v3A2.copy(node$1.position),_quatA2.copy(node$1.quaternion),pose[vrmBoneName]={position:_v3A2.toArray(),rotation:_quatA2.toArray()})}),pose}getPose(){let pose={};return Object.keys(this.humanBones).forEach(boneNameString=>{let boneName=boneNameString,node$1=this.getBoneNode(boneName);if(!node$1)return;_v3A2.set(0,0,0),_quatA2.identity();let restState=this.restPose[boneName];restState?.position&&_v3A2.fromArray(restState.position).negate(),restState?.rotation&&quatInvertCompat(_quatA2.fromArray(restState.rotation)),_v3A2.add(node$1.position),_quatA2.premultiply(node$1.quaternion),pose[boneName]={position:_v3A2.toArray(),rotation:_quatA2.toArray()}}),pose}setPose(poseObject){Object.entries(poseObject).forEach(([boneNameString,state])=>{let boneName=boneNameString,node$1=this.getBoneNode(boneName);if(!node$1)return;let restState=this.restPose[boneName];restState&&(state?.position&&(node$1.position.fromArray(state.position),restState.position&&node$1.position.add(_v3A2.fromArray(restState.position))),state?.rotation&&(node$1.quaternion.fromArray(state.rotation),restState.rotation&&node$1.quaternion.multiply(_quatA2.fromArray(restState.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([boneName,rest])=>{let node$1=this.getBoneNode(boneName);node$1&&(rest?.position&&node$1.position.fromArray(rest.position),rest?.rotation&&node$1.quaternion.fromArray(rest.rotation))})}getBone(name$1){var _a$2;return(_a$2=this.humanBones[name$1])??void 0}getBoneNode(name$1){var _a$2,_b;return(_b=(_a$2=this.humanBones[name$1])?.node)??null}},_v3A3=new Vector3,_quatA3=new Quaternion,_boneWorldPos=new Vector3,VRMHumanoidRig=class _VRMHumanoidRig extends VRMRig{static _setupTransforms(modelRig){let root$2=new Object3D;root$2.name=`VRMHumanoidRig`;let boneWorldPositions={},boneWorldRotations={},boneRotations={},parentWorldRotations={};VRMHumanBoneList.forEach(boneName=>{var _a$2;let boneNode=modelRig.getBoneNode(boneName);if(boneNode){let boneWorldPosition=new Vector3,boneWorldRotation=new Quaternion;boneNode.updateWorldMatrix(!0,!1),boneNode.matrixWorld.decompose(boneWorldPosition,boneWorldRotation,_v3A3),boneWorldPositions[boneName]=boneWorldPosition,boneWorldRotations[boneName]=boneWorldRotation,boneRotations[boneName]=boneNode.quaternion.clone();let parentWorldRotation=new Quaternion;(_a$2=boneNode.parent)==null||_a$2.matrixWorld.decompose(_v3A3,parentWorldRotation,_v3A3),parentWorldRotations[boneName]=parentWorldRotation}});let rigBones={};return VRMHumanBoneList.forEach(boneName=>{var _a$2;let boneNode=modelRig.getBoneNode(boneName);if(boneNode){let boneWorldPosition=boneWorldPositions[boneName],currentBoneName=boneName,parentBoneWorldPosition;for(;parentBoneWorldPosition==null&&(currentBoneName=VRMHumanBoneParentMap[currentBoneName],currentBoneName!=null);)parentBoneWorldPosition=boneWorldPositions[currentBoneName];let rigBoneNode=new Object3D;rigBoneNode.name=`Normalized_`+boneNode.name;let parentRigBoneNode=currentBoneName?(_a$2=rigBones[currentBoneName])?.node:root$2;parentRigBoneNode.add(rigBoneNode),rigBoneNode.position.copy(boneWorldPosition),parentBoneWorldPosition&&rigBoneNode.position.sub(parentBoneWorldPosition),rigBones[boneName]={node:rigBoneNode}}}),{rigBones,root:root$2,parentWorldRotations,boneRotations}}constructor(humanoid){let{rigBones,root:root$2,parentWorldRotations,boneRotations}=_VRMHumanoidRig._setupTransforms(humanoid);super(rigBones),this.original=humanoid,this.root=root$2,this._parentWorldRotations=parentWorldRotations,this._boneRotations=boneRotations}update(){VRMHumanBoneList.forEach(boneName=>{let boneNode=this.original.getBoneNode(boneName);if(boneNode!=null){let rigBoneNode=this.getBoneNode(boneName),parentWorldRotation=this._parentWorldRotations[boneName],invParentWorldRotation=_quatA3.copy(parentWorldRotation).invert(),boneRotation=this._boneRotations[boneName];if(boneNode.quaternion.copy(rigBoneNode.quaternion).multiply(parentWorldRotation).premultiply(invParentWorldRotation).multiply(boneRotation),boneName===`hips`){let boneWorldPosition=rigBoneNode.getWorldPosition(_boneWorldPos);boneNode.parent.updateWorldMatrix(!0,!1);let parentWorldMatrix=boneNode.parent.matrixWorld,localPosition=boneWorldPosition.applyMatrix4(parentWorldMatrix.invert());boneNode.position.copy(localPosition)}}})}},VRMHumanoid=class _VRMHumanoid{get restPose(){return console.warn(`VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead.`),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(humanBones,options){var _a$2;this.autoUpdateHumanBones=(_a$2=options?.autoUpdateHumanBones)??!0,this._rawHumanBones=new VRMRig(humanBones),this._normalizedHumanBones=new VRMHumanoidRig(this._rawHumanBones)}copy(source){return this.autoUpdateHumanBones=source.autoUpdateHumanBones,this._rawHumanBones=new VRMRig(source.humanBones),this._normalizedHumanBones=new VRMHumanoidRig(this._rawHumanBones),this}clone(){return new _VRMHumanoid(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn(`VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead.`),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn(`VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead.`),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(poseObject){return console.warn(`VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead.`),this.setRawPose(poseObject)}setRawPose(poseObject){return this._rawHumanBones.setPose(poseObject)}setNormalizedPose(poseObject){return this._normalizedHumanBones.setPose(poseObject)}resetPose(){return console.warn(`VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead.`),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(name$1){return console.warn(`VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead.`),this.getRawBone(name$1)}getRawBone(name$1){return this._rawHumanBones.getBone(name$1)}getNormalizedBone(name$1){return this._normalizedHumanBones.getBone(name$1)}getBoneNode(name$1){return console.warn(`VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead.`),this.getRawBoneNode(name$1)}getRawBoneNode(name$1){return this._rawHumanBones.getBoneNode(name$1)}getNormalizedBoneNode(name$1){return this._normalizedHumanBones.getBoneNode(name$1)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},VRMRequiredHumanBoneName={Hips:`hips`,Spine:`spine`,Head:`head`,LeftUpperLeg:`leftUpperLeg`,LeftLowerLeg:`leftLowerLeg`,LeftFoot:`leftFoot`,RightUpperLeg:`rightUpperLeg`,RightLowerLeg:`rightLowerLeg`,RightFoot:`rightFoot`,LeftUpperArm:`leftUpperArm`,LeftLowerArm:`leftLowerArm`,LeftHand:`leftHand`,RightUpperArm:`rightUpperArm`,RightLowerArm:`rightLowerArm`,RightHand:`rightHand`},POSSIBLE_SPEC_VERSIONS3=new Set([`1.0`,`1.0-beta`]),thumbBoneNameMap={leftThumbProximal:`leftThumbMetacarpal`,leftThumbIntermediate:`leftThumbProximal`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbIntermediate:`rightThumbProximal`},VRMHumanoidLoaderPlugin=class{get name(){return`VRMHumanoidLoaderPlugin`}constructor(parser,options){this.parser=parser,this.helperRoot=options?.helperRoot,this.autoUpdateHumanBones=options?.autoUpdateHumanBones}afterRoot(gltf){return __async2(this,null,function*(){gltf.userData.vrmHumanoid=yield this._import(gltf)})}_import(gltf){return __async2(this,null,function*(){let v1Result=yield this._v1Import(gltf);if(v1Result)return v1Result;let v0Result=yield this._v0Import(gltf);return v0Result||null})}_v1Import(gltf){return __async2(this,null,function*(){var _a$2,_b;let json=this.parser.json,isVRMUsed=(_a$2=json.extensionsUsed)?.indexOf(`VRMC_vrm`)!==-1;if(!isVRMUsed)return null;let extension$1=(_b=json.extensions)?.VRMC_vrm;if(!extension$1)return null;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS3.has(specVersion))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${specVersion}"`),null;let schemaHumanoid=extension$1.humanoid;if(!schemaHumanoid)return null;let existsPreviousThumbName=schemaHumanoid.humanBones.leftThumbIntermediate!=null||schemaHumanoid.humanBones.rightThumbIntermediate!=null,humanBones={};schemaHumanoid.humanBones!=null&&(yield Promise.all(Object.entries(schemaHumanoid.humanBones).map(_0=>__async2(this,[_0],function*([boneNameString,schemaHumanBone]){let boneName=boneNameString,index$1=schemaHumanBone.node;if(existsPreviousThumbName){let thumbBoneName=thumbBoneNameMap[boneName];thumbBoneName!=null&&(boneName=thumbBoneName)}let node$1=yield this.parser.getDependency(`node`,index$1);if(node$1==null){console.warn(`A glTF node bound to the humanoid bone ${boneName} (index = ${index$1}) does not exist`);return}humanBones[boneName]={node:node$1}}))));let humanoid=new VRMHumanoid(this._ensureRequiredBonesExist(humanBones),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(gltf.scene.add(humanoid.normalizedHumanBonesRoot),this.helperRoot){let helper=new VRMHumanoidHelper(humanoid);this.helperRoot.add(helper),helper.renderOrder=this.helperRoot.renderOrder}return humanoid})}_v0Import(gltf){return __async2(this,null,function*(){var _a$2;let json=this.parser.json,vrmExt=(_a$2=json.extensions)?.VRM;if(!vrmExt)return null;let schemaHumanoid=vrmExt.humanoid;if(!schemaHumanoid)return null;let humanBones={};schemaHumanoid.humanBones!=null&&(yield Promise.all(schemaHumanoid.humanBones.map(bone=>__async2(this,null,function*(){let boneName=bone.bone,index$1=bone.node;if(boneName==null||index$1==null)return;let node$1=yield this.parser.getDependency(`node`,index$1);if(node$1==null){console.warn(`A glTF node bound to the humanoid bone ${boneName} (index = ${index$1}) does not exist`);return}let thumbBoneName=thumbBoneNameMap[boneName],newBoneName=thumbBoneName??boneName;if(humanBones[newBoneName]!=null){console.warn(`Multiple bone entries for ${newBoneName} detected (index = ${index$1}), ignoring duplicated entries.`);return}humanBones[newBoneName]={node:node$1}}))));let humanoid=new VRMHumanoid(this._ensureRequiredBonesExist(humanBones),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(gltf.scene.add(humanoid.normalizedHumanBonesRoot),this.helperRoot){let helper=new VRMHumanoidHelper(humanoid);this.helperRoot.add(helper),helper.renderOrder=this.helperRoot.renderOrder}return humanoid})}_ensureRequiredBonesExist(humanBones){let missingRequiredBones=Object.values(VRMRequiredHumanBoneName).filter(requiredBoneName=>humanBones[requiredBoneName]==null);if(missingRequiredBones.length>0)throw Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${missingRequiredBones.join(`, `)}`);return humanBones}},FanBufferGeometry=class extends BufferGeometry{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new BufferAttribute(new Float32Array(65*3),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,shouldUpdateGeometry=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let i=0;i<64;i++){let t=i/63*this._currentTheta;this._attrPos.setXYZ(i+1,this._currentRadius*Math.sin(t),0,this._currentRadius*Math.cos(t))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let i=0;i<63;i++)this._attrIndex.setXYZ(i*3,0,i+1,i+2);this._attrIndex.needsUpdate=!0}},LineAndSphereBufferGeometry=class extends BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new Vector3,this._currentTail=new Vector3,this._attrPos=new BufferAttribute(new Float32Array(294),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,shouldUpdateGeometry=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){for(let i=0;i<32;i++){let t=i/16*Math.PI;this._attrPos.setXYZ(i,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+i,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+i,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let i=0;i<32;i++){let i1=(i+1)%32;this._attrIndex.setXY(i*2,i,i1),this._attrIndex.setXY(64+i*2,32+i,32+i1),this._attrIndex.setXY(128+i*2,64+i,64+i1)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},_quatA4=new Quaternion,_quatB=new Quaternion,_v3A4=new Vector3,_v3B2=new Vector3,SQRT_2_OVER_2=Math.sqrt(2)/2,QUAT_XY_CW90=new Quaternion(0,0,-SQRT_2_OVER_2,SQRT_2_OVER_2),VEC3_POSITIVE_Y=new Vector3(0,1,0),VRMLookAtHelper=class extends Group{constructor(lookAt){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=lookAt;{let geometry=new FanBufferGeometry;geometry.radius=.5;let material=new MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new Mesh(geometry,material),this.add(this._meshPitch)}{let geometry=new FanBufferGeometry;geometry.radius=.5;let material=new MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new Mesh(geometry,material),this.add(this._meshYaw)}{let geometry=new LineAndSphereBufferGeometry;geometry.radius=.1;let material=new LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new LineSegments(geometry,material),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(force){let yaw=MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=yaw,this._meshYaw.geometry.update();let pitch=MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=pitch,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(_v3A4),this.vrmLookAt.getLookAtWorldQuaternion(_quatA4),_quatA4.multiply(this.vrmLookAt.getFaceFrontQuaternion(_quatB)),this._meshYaw.position.copy(_v3A4),this._meshYaw.quaternion.copy(_quatA4),this._meshPitch.position.copy(_v3A4),this._meshPitch.quaternion.copy(_quatA4),this._meshPitch.quaternion.multiply(_quatB.setFromAxisAngle(VEC3_POSITIVE_Y,yaw)),this._meshPitch.quaternion.multiply(QUAT_XY_CW90);let{target,autoUpdate}=this.vrmLookAt;target!=null&&autoUpdate&&(target.getWorldPosition(_v3B2).sub(_v3A4),this._lineTarget.geometry.tail.copy(_v3B2),this._lineTarget.geometry.update(),this._lineTarget.position.copy(_v3A4)),super.updateMatrixWorld(force)}},_position=new Vector3,_scale=new Vector3;function getWorldQuaternionLite(object,out){return object.matrixWorld.decompose(_position,out,_scale),out}function calcAzimuthAltitude(vector){return[Math.atan2(-vector.z,vector.x),Math.atan2(vector.y,Math.sqrt(vector.x*vector.x+vector.z*vector.z))]}function sanitizeAngle(angle){let roundTurn=Math.round(angle/2/Math.PI);return angle-2*Math.PI*roundTurn}var VEC3_POSITIVE_Z=new Vector3(0,0,1),_v3A5=new Vector3,_v3B3=new Vector3,_v3C=new Vector3,_quatA5=new Quaternion,_quatB2=new Quaternion,_quatC=new Quaternion,_quatD=new Quaternion,_eulerA=new Euler,_VRMLookAt=class _VRMLookAt2{constructor(humanoid,applier){this.offsetFromHeadBone=new Vector3,this.autoUpdate=!0,this.faceFront=new Vector3(0,0,1),this.humanoid=humanoid,this.applier=applier,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new Quaternion)}get yaw(){return this._yaw}set yaw(value){this._yaw=value,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(value){this._pitch=value,this._needsUpdate=!0}get euler(){return console.warn(`VRMLookAt: euler is deprecated. use getEuler() instead.`),this.getEuler(new Euler)}getEuler(target){return target.set(MathUtils.DEG2RAD*this._pitch,MathUtils.DEG2RAD*this._yaw,0,`YXZ`)}copy(source){if(this.humanoid!==source.humanoid)throw Error(`VRMLookAt: humanoid must be same in order to copy`);return this.offsetFromHeadBone.copy(source.offsetFromHeadBone),this.applier=source.applier,this.autoUpdate=source.autoUpdate,this.target=source.target,this.faceFront.copy(source.faceFront),this}clone(){return new _VRMLookAt2(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(target){let head$1=this.humanoid.getRawBoneNode(`head`);return target.copy(this.offsetFromHeadBone).applyMatrix4(head$1.matrixWorld)}getLookAtWorldQuaternion(target){let head$1=this.humanoid.getRawBoneNode(`head`);return getWorldQuaternionLite(head$1,target)}getFaceFrontQuaternion(target){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z)<.01)return target.copy(this._restHeadWorldQuaternion).invert();let[faceFrontAzimuth,faceFrontAltitude]=calcAzimuthAltitude(this.faceFront);return _eulerA.set(0,.5*Math.PI+faceFrontAzimuth,faceFrontAltitude,`YZX`),target.setFromEuler(_eulerA).premultiply(_quatD.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(target){return this.getLookAtWorldQuaternion(_quatB2),this.getFaceFrontQuaternion(_quatC),target.copy(VEC3_POSITIVE_Z).applyQuaternion(_quatB2).applyQuaternion(_quatC).applyEuler(this.getEuler(_eulerA))}lookAt(position$2){let headRotDiffInv=_quatA5.copy(this._restHeadWorldQuaternion).multiply(quatInvertCompat(this.getLookAtWorldQuaternion(_quatB2))),headPos=this.getLookAtWorldPosition(_v3B3),lookAtDir=_v3C.copy(position$2).sub(headPos).applyQuaternion(headRotDiffInv).normalize(),[azimuthFrom,altitudeFrom]=calcAzimuthAltitude(this.faceFront),[azimuthTo,altitudeTo]=calcAzimuthAltitude(lookAtDir),yaw=sanitizeAngle(azimuthTo-azimuthFrom),pitch=sanitizeAngle(altitudeFrom-altitudeTo);this._yaw=MathUtils.RAD2DEG*yaw,this._pitch=MathUtils.RAD2DEG*pitch,this._needsUpdate=!0}update(delta){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_v3A5)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};_VRMLookAt.EULER_ORDER=`YXZ`;var VRMLookAt=_VRMLookAt,VEC3_POSITIVE_Z2=new Vector3(0,0,1),_quatA6=new Quaternion,_quatB3=new Quaternion,_eulerA2=new Euler(0,0,0,`YXZ`),VRMLookAtBoneApplier=class{constructor(humanoid,rangeMapHorizontalInner,rangeMapHorizontalOuter,rangeMapVerticalDown,rangeMapVerticalUp){this.humanoid=humanoid,this.rangeMapHorizontalInner=rangeMapHorizontalInner,this.rangeMapHorizontalOuter=rangeMapHorizontalOuter,this.rangeMapVerticalDown=rangeMapVerticalDown,this.rangeMapVerticalUp=rangeMapVerticalUp,this.faceFront=new Vector3(0,0,1),this._restQuatLeftEye=new Quaternion,this._restQuatRightEye=new Quaternion,this._restLeftEyeParentWorldQuat=new Quaternion,this._restRightEyeParentWorldQuat=new Quaternion;let leftEye=this.humanoid.getRawBoneNode(`leftEye`),rightEye=this.humanoid.getRawBoneNode(`rightEye`);leftEye&&(this._restQuatLeftEye.copy(leftEye.quaternion),getWorldQuaternionLite(leftEye.parent,this._restLeftEyeParentWorldQuat)),rightEye&&(this._restQuatRightEye.copy(rightEye.quaternion),getWorldQuaternionLite(rightEye.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(yaw,pitch){let leftEye=this.humanoid.getRawBoneNode(`leftEye`),rightEye=this.humanoid.getRawBoneNode(`rightEye`),leftEyeNormalized=this.humanoid.getNormalizedBoneNode(`leftEye`),rightEyeNormalized=this.humanoid.getNormalizedBoneNode(`rightEye`);leftEye&&(pitch<0?_eulerA2.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-pitch):_eulerA2.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(pitch),yaw<0?_eulerA2.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-yaw):_eulerA2.y=MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(yaw),_quatA6.setFromEuler(_eulerA2),this._getWorldFaceFrontQuat(_quatB3),leftEyeNormalized.quaternion.copy(_quatB3).multiply(_quatA6).multiply(_quatB3.invert()),_quatA6.copy(this._restLeftEyeParentWorldQuat),leftEye.quaternion.copy(leftEyeNormalized.quaternion).multiply(_quatA6).premultiply(_quatA6.invert()).multiply(this._restQuatLeftEye)),rightEye&&(pitch<0?_eulerA2.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-pitch):_eulerA2.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(pitch),yaw<0?_eulerA2.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-yaw):_eulerA2.y=MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(yaw),_quatA6.setFromEuler(_eulerA2),this._getWorldFaceFrontQuat(_quatB3),rightEyeNormalized.quaternion.copy(_quatB3).multiply(_quatA6).multiply(_quatB3.invert()),_quatA6.copy(this._restRightEyeParentWorldQuat),rightEye.quaternion.copy(rightEyeNormalized.quaternion).multiply(_quatA6).premultiply(_quatA6.invert()).multiply(this._restQuatRightEye))}lookAt(euler){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let yaw=MathUtils.RAD2DEG*euler.y,pitch=MathUtils.RAD2DEG*euler.x;this.applyYawPitch(yaw,pitch)}_getWorldFaceFrontQuat(target){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z2)<.01)return target.identity();let[faceFrontAzimuth,faceFrontAltitude]=calcAzimuthAltitude(this.faceFront);return _eulerA2.set(0,.5*Math.PI+faceFrontAzimuth,faceFrontAltitude,`YZX`),target.setFromEuler(_eulerA2)}};VRMLookAtBoneApplier.type=`bone`;var VRMLookAtExpressionApplier=class{constructor(expressions,rangeMapHorizontalInner,rangeMapHorizontalOuter,rangeMapVerticalDown,rangeMapVerticalUp){this.expressions=expressions,this.rangeMapHorizontalInner=rangeMapHorizontalInner,this.rangeMapHorizontalOuter=rangeMapHorizontalOuter,this.rangeMapVerticalDown=rangeMapVerticalDown,this.rangeMapVerticalUp=rangeMapVerticalUp}applyYawPitch(yaw,pitch){pitch<0?(this.expressions.setValue(`lookDown`,0),this.expressions.setValue(`lookUp`,this.rangeMapVerticalUp.map(-pitch))):(this.expressions.setValue(`lookUp`,0),this.expressions.setValue(`lookDown`,this.rangeMapVerticalDown.map(pitch))),yaw<0?(this.expressions.setValue(`lookLeft`,0),this.expressions.setValue(`lookRight`,this.rangeMapHorizontalOuter.map(-yaw))):(this.expressions.setValue(`lookRight`,0),this.expressions.setValue(`lookLeft`,this.rangeMapHorizontalOuter.map(yaw)))}lookAt(euler){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let yaw=MathUtils.RAD2DEG*euler.y,pitch=MathUtils.RAD2DEG*euler.x;this.applyYawPitch(yaw,pitch)}};VRMLookAtExpressionApplier.type=`expression`;var VRMLookAtRangeMap=class{constructor(inputMaxValue,outputScale){this.inputMaxValue=inputMaxValue,this.outputScale=outputScale}map(src){return this.outputScale*saturate(src/this.inputMaxValue)}},POSSIBLE_SPEC_VERSIONS4=new Set([`1.0`,`1.0-beta`]),INPUT_MAX_VALUE_MINIMUM=.01,VRMLookAtLoaderPlugin=class{get name(){return`VRMLookAtLoaderPlugin`}constructor(parser,options){this.parser=parser,this.helperRoot=options?.helperRoot}afterRoot(gltf){return __async2(this,null,function*(){let vrmHumanoid=gltf.userData.vrmHumanoid;if(vrmHumanoid===null)return;if(vrmHumanoid===void 0)throw Error(`VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first`);let vrmExpressionManager=gltf.userData.vrmExpressionManager;if(vrmExpressionManager!==null){if(vrmExpressionManager===void 0)throw Error(`VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first`);gltf.userData.vrmLookAt=yield this._import(gltf,vrmHumanoid,vrmExpressionManager)}})}_import(gltf,humanoid,expressions){return __async2(this,null,function*(){if(humanoid==null||expressions==null)return null;let v1Result=yield this._v1Import(gltf,humanoid,expressions);if(v1Result)return v1Result;let v0Result=yield this._v0Import(gltf,humanoid,expressions);return v0Result||null})}_v1Import(gltf,humanoid,expressions){return __async2(this,null,function*(){var _a$2,_b,_c;let json=this.parser.json,isVRMUsed=(_a$2=json.extensionsUsed)?.indexOf(`VRMC_vrm`)!==-1;if(!isVRMUsed)return null;let extension$1=(_b=json.extensions)?.VRMC_vrm;if(!extension$1)return null;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS4.has(specVersion))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${specVersion}"`),null;let schemaLookAt=extension$1.lookAt;if(!schemaLookAt)return null;let defaultOutputScale=schemaLookAt.type===`expression`?1:10,mapHI=this._v1ImportRangeMap(schemaLookAt.rangeMapHorizontalInner,defaultOutputScale),mapHO=this._v1ImportRangeMap(schemaLookAt.rangeMapHorizontalOuter,defaultOutputScale),mapVD=this._v1ImportRangeMap(schemaLookAt.rangeMapVerticalDown,defaultOutputScale),mapVU=this._v1ImportRangeMap(schemaLookAt.rangeMapVerticalUp,defaultOutputScale),applier;applier=schemaLookAt.type===`expression`?new VRMLookAtExpressionApplier(expressions,mapHI,mapHO,mapVD,mapVU):new VRMLookAtBoneApplier(humanoid,mapHI,mapHO,mapVD,mapVU);let lookAt=this._importLookAt(humanoid,applier);return lookAt.offsetFromHeadBone.fromArray((_c=schemaLookAt.offsetFromHeadBone)??[0,.06,0]),lookAt})}_v1ImportRangeMap(schemaRangeMap,defaultOutputScale){var _a$2,_b;let inputMaxValue=(_a$2=schemaRangeMap?.inputMaxValue)??90,outputScale=(_b=schemaRangeMap?.outputScale)??defaultOutputScale;return inputMaxValue(console.error(error),console.warn(`VRMMetaLoaderPlugin: Failed to load a thumbnail image`),null))})}},VRMCore=class{constructor(params){this.scene=params.scene,this.meta=params.meta,this.humanoid=params.humanoid,this.expressionManager=params.expressionManager,this.firstPerson=params.firstPerson,this.lookAt=params.lookAt}update(delta){this.humanoid.update(),this.lookAt&&this.lookAt.update(delta),this.expressionManager&&this.expressionManager.update()}},VRM=class extends VRMCore{constructor(params){super(params),this.materials=params.materials,this.springBoneManager=params.springBoneManager,this.nodeConstraintManager=params.nodeConstraintManager}update(delta){super.update(delta),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(delta),this.materials&&this.materials.forEach(material=>{material.update&&material.update(delta)})}},__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(obj,key$1,value)=>key$1 in obj?__defProp(obj,key$1,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key$1]=value,__spreadValues=(a,b)=>{for(var prop in b||={})__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__async3=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),colorSpaceEncodingMap={"":3e3,srgb:3001};function setTextureColorSpace(texture,colorSpace){parseInt(REVISION,10)>=152?texture.colorSpace=colorSpace:texture.encoding=colorSpaceEncodingMap[colorSpace]}var GLTFMToonMaterialParamsAssignHelper=class{get pending(){return Promise.all(this._pendings)}constructor(parser,materialParams){this._parser=parser,this._materialParams=materialParams,this._pendings=[]}assignPrimitive(key$1,value){value!=null&&(this._materialParams[key$1]=value)}assignColor(key$1,value,convertSRGBToLinear){value!=null&&(this._materialParams[key$1]=new Color().fromArray(value),convertSRGBToLinear&&this._materialParams[key$1].convertSRGBToLinear())}assignTexture(key$1,texture,isColorTexture){return __async3(this,null,function*(){let promise=(()=>__async3(this,null,function*(){texture!=null&&(yield this._parser.assignTexture(this._materialParams,key$1,texture),isColorTexture&&setTextureColorSpace(this._materialParams[key$1],`srgb`))}))();return this._pendings.push(promise),promise})}assignTextureByIndex(key$1,textureIndex,isColorTexture){return __async3(this,null,function*(){return this.assignTexture(key$1,textureIndex==null?void 0:{index:textureIndex},isColorTexture)})}},mtoon_default=`// #define PHONG + +varying vec3 vViewPosition; + +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif + +#include + +// #include +#ifdef MTOON_USE_UV + varying vec2 vUv; + + // COMPAT: pre-r151 uses a common uvTransform + #if THREE_VRM_THREE_REVISION < 151 + uniform mat3 uvTransform; + #endif +#endif + +// #include +// COMAPT: pre-r151 uses uv2 for lightMap and aoMap +#if THREE_VRM_THREE_REVISION < 151 + #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) + attribute vec2 uv2; + varying vec2 vUv2; + uniform mat3 uv2Transform; + #endif +#endif + +// #include +// #include +#include +#include +#include +#include +#include +#include +#include + +#ifdef USE_OUTLINEWIDTHMULTIPLYTEXTURE + uniform sampler2D outlineWidthMultiplyTexture; + uniform mat3 outlineWidthMultiplyTextureUvTransform; +#endif + +uniform float outlineWidthFactor; + +void main() { + + // #include + #ifdef MTOON_USE_UV + // COMPAT: pre-r151 uses a common uvTransform + #if THREE_VRM_THREE_REVISION >= 151 + vUv = uv; + #else + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #endif + + // #include + // COMAPT: pre-r151 uses uv2 for lightMap and aoMap + #if THREE_VRM_THREE_REVISION < 151 + #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) + vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; + #endif + #endif + + #include + + #include + #include + #include + #include + + // we need this to compute the outline properly + objectNormal = normalize( objectNormal ); + + #include + + #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED + vNormal = normalize( transformedNormal ); + #endif + + #include + + #include + #include + // #include + #include + #include + #include + + vViewPosition = - mvPosition.xyz; + + #ifdef OUTLINE + float worldNormalLength = length( transformedNormal ); + vec3 outlineOffset = outlineWidthFactor * worldNormalLength * objectNormal; + + #ifdef USE_OUTLINEWIDTHMULTIPLYTEXTURE + vec2 outlineWidthMultiplyTextureUv = ( outlineWidthMultiplyTextureUvTransform * vec3( vUv, 1 ) ).xy; + float outlineTex = texture2D( outlineWidthMultiplyTexture, outlineWidthMultiplyTextureUv ).g; + outlineOffset *= outlineTex; + #endif + + #ifdef OUTLINE_WIDTH_SCREEN + outlineOffset *= vViewPosition.z / projectionMatrix[ 1 ].y; + #endif + + gl_Position = projectionMatrix * modelViewMatrix * vec4( outlineOffset + transformed, 1.0 ); + + gl_Position.z += 1E-6 * gl_Position.w; // anti-artifact magic + #endif + + #include + // #include + #include + #include + +}`,mtoon_default2=`// #define PHONG + +uniform vec3 litFactor; + +uniform float opacity; + +uniform vec3 shadeColorFactor; +#ifdef USE_SHADEMULTIPLYTEXTURE + uniform sampler2D shadeMultiplyTexture; + uniform mat3 shadeMultiplyTextureUvTransform; +#endif + +uniform float shadingShiftFactor; +uniform float shadingToonyFactor; + +#ifdef USE_SHADINGSHIFTTEXTURE + uniform sampler2D shadingShiftTexture; + uniform mat3 shadingShiftTextureUvTransform; + uniform float shadingShiftTextureScale; +#endif + +uniform float giEqualizationFactor; + +uniform vec3 parametricRimColorFactor; +#ifdef USE_RIMMULTIPLYTEXTURE + uniform sampler2D rimMultiplyTexture; + uniform mat3 rimMultiplyTextureUvTransform; +#endif +uniform float rimLightingMixFactor; +uniform float parametricRimFresnelPowerFactor; +uniform float parametricRimLiftFactor; + +#ifdef USE_MATCAPTEXTURE + uniform vec3 matcapFactor; + uniform sampler2D matcapTexture; + uniform mat3 matcapTextureUvTransform; +#endif + +uniform vec3 emissive; +uniform float emissiveIntensity; + +uniform vec3 outlineColorFactor; +uniform float outlineLightingMixFactor; + +#ifdef USE_UVANIMATIONMASKTEXTURE + uniform sampler2D uvAnimationMaskTexture; + uniform mat3 uvAnimationMaskTextureUvTransform; +#endif + +uniform float uvAnimationScrollXOffset; +uniform float uvAnimationScrollYOffset; +uniform float uvAnimationRotationPhase; + +#include +#include +#include +#include + +// #include +#if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) + varying vec2 vUv; +#endif + +// #include +// COMAPT: pre-r151 uses uv2 for lightMap and aoMap +#if THREE_VRM_THREE_REVISION < 151 + #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) + varying vec2 vUv2; + #endif +#endif + +#include + +#ifdef USE_MAP + uniform mat3 mapUvTransform; +#endif + +// #include + +#include + +#include +// #include +#include + +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapUvTransform; +#endif + +// #include +// #include +// #include +#include + +// #include +// COMPAT: pre-r151 doesn't have BRDF_Lambert in +#if THREE_VRM_THREE_REVISION < 151 + vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; + } +#endif + +#include + +#include + +// #include +varying vec3 vViewPosition; + +struct MToonMaterial { + vec3 diffuseColor; + vec3 shadeColor; + float shadingShift; +}; + +float linearstep( float a, float b, float t ) { + return clamp( ( t - a ) / ( b - a ), 0.0, 1.0 ); +} + +/** + * Convert NdotL into toon shading factor using shadingShift and shadingToony + */ +float getShading( + const in float dotNL, + const in float shadow, + const in float shadingShift +) { + float shading = dotNL; + shading = shading + shadingShift; + shading = linearstep( -1.0 + shadingToonyFactor, 1.0 - shadingToonyFactor, shading ); + shading *= shadow; + return shading; +} + +/** + * Mix diffuseColor and shadeColor using shading factor and light color + */ +vec3 getDiffuse( + const in MToonMaterial material, + const in float shading, + in vec3 lightColor +) { + #ifdef DEBUG_LITSHADERATE + return vec3( BRDF_Lambert( shading * lightColor ) ); + #endif + + vec3 col = lightColor * BRDF_Lambert( mix( material.shadeColor, material.diffuseColor, shading ) ); + + // The "comment out if you want to PBR absolutely" line + #ifdef V0_COMPAT_SHADE + col = min( col, material.diffuseColor ); + #endif + + return col; +} + +// COMPAT: pre-r156 uses a struct GeometricContext +#if THREE_VRM_THREE_REVISION >= 157 + void RE_Direct_MToon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in MToonMaterial material, const in float shadow, inout ReflectedLight reflectedLight ) { + float dotNL = clamp( dot( geometryNormal, directLight.direction ), -1.0, 1.0 ); + vec3 irradiance = directLight.color; + + // directSpecular will be used for rim lighting, not an actual specular + reflectedLight.directSpecular += irradiance; + + irradiance *= dotNL; + + float shading = getShading( dotNL, shadow, material.shadingShift ); + + // toon shaded diffuse + reflectedLight.directDiffuse += getDiffuse( material, shading, directLight.color ); + } + + void RE_IndirectDiffuse_MToon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in MToonMaterial material, inout ReflectedLight reflectedLight ) { + // indirect diffuse will use diffuseColor, no shadeColor involved + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + + // directSpecular will be used for rim lighting, not an actual specular + reflectedLight.directSpecular += irradiance; + } +#else + void RE_Direct_MToon( const in IncidentLight directLight, const in GeometricContext geometry, const in MToonMaterial material, const in float shadow, inout ReflectedLight reflectedLight ) { + float dotNL = clamp( dot( geometry.normal, directLight.direction ), -1.0, 1.0 ); + vec3 irradiance = directLight.color; + + // directSpecular will be used for rim lighting, not an actual specular + reflectedLight.directSpecular += irradiance; + + irradiance *= dotNL; + + float shading = getShading( dotNL, shadow, material.shadingShift ); + + // toon shaded diffuse + reflectedLight.directDiffuse += getDiffuse( material, shading, directLight.color ); + } + + void RE_IndirectDiffuse_MToon( const in vec3 irradiance, const in GeometricContext geometry, const in MToonMaterial material, inout ReflectedLight reflectedLight ) { + // indirect diffuse will use diffuseColor, no shadeColor involved + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + + // directSpecular will be used for rim lighting, not an actual specular + reflectedLight.directSpecular += irradiance; + } +#endif + +#define RE_Direct RE_Direct_MToon +#define RE_IndirectDiffuse RE_IndirectDiffuse_MToon +#define Material_LightProbeLOD( material ) (0) + +#include +// #include + +// #include +#ifdef USE_NORMALMAP + + uniform sampler2D normalMap; + uniform mat3 normalMapUvTransform; + uniform vec2 normalScale; + +#endif + +// COMPAT: pre-r151 +// USE_NORMALMAP_OBJECTSPACE used to be OBJECTSPACE_NORMALMAP in pre-r151 +#if defined( USE_NORMALMAP_OBJECTSPACE ) || defined( OBJECTSPACE_NORMALMAP ) + + uniform mat3 normalMatrix; + +#endif + +// COMPAT: pre-r151 +// USE_NORMALMAP_TANGENTSPACE used to be TANGENTSPACE_NORMALMAP in pre-r151 +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( TANGENTSPACE_NORMALMAP ) ) + + // Per-Pixel Tangent Space Normal Mapping + // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html + + // three-vrm specific change: it requires \`uv\` as an input in order to support uv scrolls + + // Temporary compat against shader change @ Three.js r126, r151 + #if THREE_VRM_THREE_REVISION >= 151 + + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + + vec3 N = surf_norm; + + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + + return mat3( T * scale, B * scale, N ); + + } + + #else + + vec3 perturbNormal2Arb( vec2 uv, vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { + + vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); + vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + + vec3 N = normalize( surf_norm ); + + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + + // three-vrm specific change: Workaround for the issue that happens when delta of uv = 0.0 + // TODO: Is this still required? Or shall I make a PR about it? + if ( length( T ) == 0.0 || length( B ) == 0.0 ) { + return surf_norm; + } + + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); + + return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); + + } + + #endif + +#endif + +// #include +#include +#include + +// == post correction ========================================================== +void postCorrection() { + #include + #include + #include + #include + #include +} + +// == main procedure =========================================================== +void main() { + #include + + vec2 uv = vec2(0.5, 0.5); + + #if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) + uv = vUv; + + float uvAnimMask = 1.0; + #ifdef USE_UVANIMATIONMASKTEXTURE + vec2 uvAnimationMaskTextureUv = ( uvAnimationMaskTextureUvTransform * vec3( uv, 1 ) ).xy; + uvAnimMask = texture2D( uvAnimationMaskTexture, uvAnimationMaskTextureUv ).b; + #endif + + float uvRotCos = cos( uvAnimationRotationPhase * uvAnimMask ); + float uvRotSin = sin( uvAnimationRotationPhase * uvAnimMask ); + uv = mat2( uvRotCos, -uvRotSin, uvRotSin, uvRotCos ) * ( uv - 0.5 ) + 0.5; + uv = uv + vec2( uvAnimationScrollXOffset, uvAnimationScrollYOffset ) * uvAnimMask; + #endif + + #ifdef DEBUG_UV + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) + gl_FragColor = vec4( uv, 0.0, 1.0 ); + #endif + return; + #endif + + vec4 diffuseColor = vec4( litFactor, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive * emissiveIntensity; + + #include + + // #include + #ifdef USE_MAP + vec2 mapUv = ( mapUvTransform * vec3( uv, 1 ) ).xy; + vec4 sampledDiffuseColor = texture2D( map, mapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + #endif + diffuseColor *= sampledDiffuseColor; + #endif + + // #include + #if ( defined( USE_COLOR ) && !defined( IGNORE_VERTEX_COLOR ) ) + diffuseColor.rgb *= vColor; + #endif + + // #include + + #include + + // #include + + // #include + float faceDirection = gl_FrontFacing ? 1.0 : -1.0; + + #ifdef FLAT_SHADED + + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); + + #else + + vec3 normal = normalize( vNormal ); + + #ifdef DOUBLE_SIDED + + normal *= faceDirection; + + #endif + + #endif + + #ifdef USE_NORMALMAP + + vec2 normalMapUv = ( normalMapUvTransform * vec3( uv, 1 ) ).xy; + + #endif + + #ifdef USE_NORMALMAP_TANGENTSPACE + + #ifdef USE_TANGENT + + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + + #else + + mat3 tbn = getTangentFrame( - vViewPosition, normal, normalMapUv ); + + #endif + + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + + #endif + + #endif + + #ifdef USE_CLEARCOAT_NORMALMAP + + #ifdef USE_TANGENT + + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + + #else + + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + + #endif + + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + + #endif + + #endif + + // non perturbed normal for clearcoat among others + + vec3 nonPerturbedNormal = normal; + + #ifdef OUTLINE + normal *= -1.0; + #endif + + // #include + + // COMPAT: pre-r151 + // USE_NORMALMAP_OBJECTSPACE used to be OBJECTSPACE_NORMALMAP in pre-r151 + #if defined( USE_NORMALMAP_OBJECTSPACE ) || defined( OBJECTSPACE_NORMALMAP ) + + normal = texture2D( normalMap, normalMapUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals + + #ifdef FLIP_SIDED + + normal = - normal; + + #endif + + #ifdef DOUBLE_SIDED + + normal = normal * faceDirection; + + #endif + + normal = normalize( normalMatrix * normal ); + + // COMPAT: pre-r151 + // USE_NORMALMAP_TANGENTSPACE used to be TANGENTSPACE_NORMALMAP in pre-r151 + #elif defined( USE_NORMALMAP_TANGENTSPACE ) || defined( TANGENTSPACE_NORMALMAP ) + + vec3 mapN = texture2D( normalMap, normalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + + // COMPAT: pre-r151 + #if THREE_VRM_THREE_REVISION >= 151 || defined( USE_TANGENT ) + + normal = normalize( tbn * mapN ); + + #else + + normal = perturbNormal2Arb( uv, -vViewPosition, normal, mapN, faceDirection ); + + #endif + + #endif + + // #include + #ifdef USE_EMISSIVEMAP + vec2 emissiveMapUv = ( emissiveMapUvTransform * vec3( uv, 1 ) ).xy; + totalEmissiveRadiance *= texture2D( emissiveMap, emissiveMapUv ).rgb; + #endif + + #ifdef DEBUG_NORMAL + gl_FragColor = vec4( 0.5 + 0.5 * normal, 1.0 ); + return; + #endif + + // -- MToon: lighting -------------------------------------------------------- + // accumulation + // #include + MToonMaterial material; + + material.diffuseColor = diffuseColor.rgb; + + material.shadeColor = shadeColorFactor; + #ifdef USE_SHADEMULTIPLYTEXTURE + vec2 shadeMultiplyTextureUv = ( shadeMultiplyTextureUvTransform * vec3( uv, 1 ) ).xy; + material.shadeColor *= texture2D( shadeMultiplyTexture, shadeMultiplyTextureUv ).rgb; + #endif + + #if ( defined( USE_COLOR ) && !defined( IGNORE_VERTEX_COLOR ) ) + material.shadeColor.rgb *= vColor; + #endif + + material.shadingShift = shadingShiftFactor; + #ifdef USE_SHADINGSHIFTTEXTURE + vec2 shadingShiftTextureUv = ( shadingShiftTextureUvTransform * vec3( uv, 1 ) ).xy; + material.shadingShift += texture2D( shadingShiftTexture, shadingShiftTextureUv ).r * shadingShiftTextureScale; + #endif + + // #include + + // MToon Specific changes: + // Since we want to take shadows into account of shading instead of irradiance, + // we had to modify the codes that multiplies the results of shadowmap into color of direct lights. + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + vec3 geometryPosition = - vViewPosition; + vec3 geometryNormal = normal; + vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); + + vec3 geometryClearcoatNormal; + + #ifdef USE_CLEARCOAT + + geometryClearcoatNormal = clearcoatNormal; + + #endif + #else + GeometricContext geometry; + + geometry.position = - vViewPosition; + geometry.normal = normal; + geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); + + #ifdef USE_CLEARCOAT + + geometry.clearcoatNormal = clearcoatNormal; + + #endif + #endif + + IncidentLight directLight; + + // since these variables will be used in unrolled loop, we have to define in prior + float shadow; + + #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + + pointLight = pointLights[ i ]; + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + getPointLightInfo( pointLight, geometryPosition, directLight ); + #else + getPointLightInfo( pointLight, geometry, directLight ); + #endif + + shadow = 1.0; + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + // COMPAT: pre-r166 + // r166 introduced shadowIntensity + #if THREE_VRM_THREE_REVISION >= 166 + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #else + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + #endif + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); + #else + RE_Direct( directLight, geometry, material, shadow, reflectedLight ); + #endif + + } + #pragma unroll_loop_end + + #endif + + #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + + SpotLight spotLight; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + + spotLight = spotLights[ i ]; + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #else + getSpotLightInfo( spotLight, geometry, directLight ); + #endif + + shadow = 1.0; + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + // COMPAT: pre-r166 + // r166 introduced shadowIntensity + #if THREE_VRM_THREE_REVISION >= 166 + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; + #else + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; + #endif + #endif + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); + #else + RE_Direct( directLight, geometry, material, shadow, reflectedLight ); + #endif + + } + #pragma unroll_loop_end + + #endif + + #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + + directionalLight = directionalLights[ i ]; + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + getDirectionalLightInfo( directionalLight, directLight ); + #else + getDirectionalLightInfo( directionalLight, geometry, directLight ); + #endif + + shadow = 1.0; + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + // COMPAT: pre-r166 + // r166 introduced shadowIntensity + #if THREE_VRM_THREE_REVISION >= 166 + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #else + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + #endif + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); + #else + RE_Direct( directLight, geometry, material, shadow, reflectedLight ); + #endif + + } + #pragma unroll_loop_end + + #endif + + // #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + + // RectAreaLight rectAreaLight; + + // #pragma unroll_loop_start + // for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + + // rectAreaLight = rectAreaLights[ i ]; + // RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); + + // } + // #pragma unroll_loop_end + + // #endif + + #if defined( RE_IndirectDiffuse ) + + vec3 iblIrradiance = vec3( 0.0 ); + + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + + // COMPAT: pre-r156 uses a struct GeometricContext + // COMPAT: pre-r156 doesn't have a define USE_LIGHT_PROBES + #if THREE_VRM_THREE_REVISION >= 157 + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #else + irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); + #endif + + #if ( NUM_HEMI_LIGHTS > 0 ) + + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + #else + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); + #endif + + } + #pragma unroll_loop_end + + #endif + + #endif + + // #if defined( RE_IndirectSpecular ) + + // vec3 radiance = vec3( 0.0 ); + // vec3 clearcoatRadiance = vec3( 0.0 ); + + // #endif + + #include + #include + + // modulation + #include + + vec3 col = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + + #ifdef DEBUG_LITSHADERATE + gl_FragColor = vec4( col, diffuseColor.a ); + postCorrection(); + return; + #endif + + // -- MToon: rim lighting ----------------------------------------- + vec3 viewDir = normalize( vViewPosition ); + + #ifndef PHYSICALLY_CORRECT_LIGHTS + reflectedLight.directSpecular /= PI; + #endif + vec3 rimMix = mix( vec3( 1.0 ), reflectedLight.directSpecular, 1.0 ); + + vec3 rim = parametricRimColorFactor * pow( saturate( 1.0 - dot( viewDir, normal ) + parametricRimLiftFactor ), parametricRimFresnelPowerFactor ); + + #ifdef USE_MATCAPTEXTURE + { + vec3 x = normalize( vec3( viewDir.z, 0.0, -viewDir.x ) ); + vec3 y = cross( viewDir, x ); // guaranteed to be normalized + vec2 sphereUv = 0.5 + 0.5 * vec2( dot( x, normal ), -dot( y, normal ) ); + sphereUv = ( matcapTextureUvTransform * vec3( sphereUv, 1 ) ).xy; + vec3 matcap = texture2D( matcapTexture, sphereUv ).rgb; + rim += matcapFactor * matcap; + } + #endif + + #ifdef USE_RIMMULTIPLYTEXTURE + vec2 rimMultiplyTextureUv = ( rimMultiplyTextureUvTransform * vec3( uv, 1 ) ).xy; + rim *= texture2D( rimMultiplyTexture, rimMultiplyTextureUv ).rgb; + #endif + + col += rimMix * rim; + + // -- MToon: Emission -------------------------------------------------------- + col += totalEmissiveRadiance; + + // #include + + // -- Almost done! ----------------------------------------------------------- + #if defined( OUTLINE ) + col = outlineColorFactor.rgb * mix( vec3( 1.0 ), col, outlineLightingMixFactor ); + #endif + + #ifdef OPAQUE + diffuseColor.a = 1.0; + #endif + + gl_FragColor = vec4( col, diffuseColor.a ); + postCorrection(); +} +`,MToonMaterialDebugMode={None:`none`,Normal:`normal`,LitShadeRate:`litShadeRate`,UV:`uv`},MToonMaterialOutlineWidthMode={None:`none`,WorldCoordinates:`worldCoordinates`,ScreenCoordinates:`screenCoordinates`},encodingColorSpaceMap={3e3:``,3001:`srgb`};function getTextureColorSpace(texture){return parseInt(REVISION,10)>=152?texture.colorSpace:encodingColorSpaceMap[texture.encoding]}var MToonMaterial=class extends ShaderMaterial{constructor(parameters={}){var _a$2;super({vertexShader:mtoon_default,fragmentShader:mtoon_default2}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=TangentSpaceNormalMap,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=MToonMaterialDebugMode.None,this._outlineWidthMode=MToonMaterialOutlineWidthMode.None,this._isOutline=!1,parameters.transparentWithZWrite&&(parameters.depthWrite=!0),delete parameters.transparentWithZWrite,parameters.fog=!0,parameters.lights=!0,parameters.clipping=!0,this.uniforms=UniformsUtils.merge([UniformsLib.common,UniformsLib.normalmap,UniformsLib.emissivemap,UniformsLib.fog,UniformsLib.lights,{litFactor:{value:new Color(1,1,1)},mapUvTransform:{value:new Matrix3},colorAlpha:{value:1},normalMapUvTransform:{value:new Matrix3},shadeColorFactor:{value:new Color(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new Matrix3},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new Matrix3},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new Color(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new Matrix3},parametricRimColorFactor:{value:new Color(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new Matrix3},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new Color(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new Matrix3},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new Matrix3},outlineWidthFactor:{value:0},outlineColorFactor:{value:new Color(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new Matrix3},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(_a$2=parameters.uniforms)??{}]),this.setValues(parameters),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([token,macro])=>`${token}:${macro}`),this.matcapTexture?`matcapTextureColorSpace:${getTextureColorSpace(this.matcapTexture)}`:``,this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${getTextureColorSpace(this.shadeMultiplyTexture)}`:``,this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${getTextureColorSpace(this.rimMultiplyTexture)}`:``].join(`,`),this.onBeforeCompile=shader=>{let threeRevision=parseInt(REVISION,10),defines=Object.entries(__spreadValues(__spreadValues({},this._generateDefines()),this.defines)).filter(([token,macro])=>!!macro).map(([token,macro])=>`#define ${token} ${macro}`).join(` +`)+` +`;shader.vertexShader=defines+shader.vertexShader,shader.fragmentShader=defines+shader.fragmentShader,threeRevision<154&&(shader.fragmentShader=shader.fragmentShader.replace(`#include `,`#include `))}}get color(){return this.uniforms.litFactor.value}set color(value){this.uniforms.litFactor.value=value}get map(){return this.uniforms.map.value}set map(value){this.uniforms.map.value=value}get normalMap(){return this.uniforms.normalMap.value}set normalMap(value){this.uniforms.normalMap.value=value}get normalScale(){return this.uniforms.normalScale.value}set normalScale(value){this.uniforms.normalScale.value=value}get emissive(){return this.uniforms.emissive.value}set emissive(value){this.uniforms.emissive.value=value}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(value){this.uniforms.emissiveIntensity.value=value}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(value){this.uniforms.emissiveMap.value=value}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(value){this.uniforms.shadeColorFactor.value=value}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(value){this.uniforms.shadeMultiplyTexture.value=value}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(value){this.uniforms.shadingShiftFactor.value=value}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(value){this.uniforms.shadingShiftTexture.value=value}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(value){this.uniforms.shadingShiftTextureScale.value=value}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(value){this.uniforms.shadingToonyFactor.value=value}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(value){this.uniforms.giEqualizationFactor.value=value}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(value){this.uniforms.matcapFactor.value=value}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(value){this.uniforms.matcapTexture.value=value}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(value){this.uniforms.parametricRimColorFactor.value=value}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(value){this.uniforms.rimMultiplyTexture.value=value}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(value){this.uniforms.rimLightingMixFactor.value=value}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(value){this.uniforms.parametricRimFresnelPowerFactor.value=value}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(value){this.uniforms.parametricRimLiftFactor.value=value}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(value){this.uniforms.outlineWidthMultiplyTexture.value=value}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(value){this.uniforms.outlineWidthFactor.value=value}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(value){this.uniforms.outlineColorFactor.value=value}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(value){this.uniforms.outlineLightingMixFactor.value=value}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(value){this.uniforms.uvAnimationMaskTexture.value=value}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(value){this.uniforms.uvAnimationScrollXOffset.value=value}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(value){this.uniforms.uvAnimationScrollYOffset.value=value}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(value){this.uniforms.uvAnimationRotationPhase.value=value}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(value){this._ignoreVertexColor=value,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(v){this._v0CompatShade=v,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(m){this._debugMode=m,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(m){this._outlineWidthMode=m,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(b){this._isOutline=b,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(delta){this._uploadUniformsWorkaround(),this._updateUVAnimation(delta)}copy(source){return super.copy(source),this.map=source.map,this.normalMap=source.normalMap,this.emissiveMap=source.emissiveMap,this.shadeMultiplyTexture=source.shadeMultiplyTexture,this.shadingShiftTexture=source.shadingShiftTexture,this.matcapTexture=source.matcapTexture,this.rimMultiplyTexture=source.rimMultiplyTexture,this.outlineWidthMultiplyTexture=source.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=source.uvAnimationMaskTexture,this.normalMapType=source.normalMapType,this.uvAnimationScrollXSpeedFactor=source.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=source.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=source.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=source.ignoreVertexColor,this.v0CompatShade=source.v0CompatShade,this.debugMode=source.debugMode,this.outlineWidthMode=source.outlineWidthMode,this.isOutline=source.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(delta){this.uniforms.uvAnimationScrollXOffset.value+=delta*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=delta*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=delta*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){let threeRevision=parseInt(REVISION,10),useUvInVert=this.outlineWidthMultiplyTexture!==null,useUvInFrag=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:threeRevision,OUTLINE:this._isOutline,MTOON_USE_UV:useUvInVert||useUvInFrag,MTOON_UVS_VERTEX_ONLY:useUvInVert&&!useUvInFrag,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode===`normal`,DEBUG_LITSHADERATE:this._debugMode===`litShadeRate`,DEBUG_UV:this._debugMode===`uv`,OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===MToonMaterialOutlineWidthMode.ScreenCoordinates}}_updateTextureMatrix(src,dst){src.value&&(src.value.matrixAutoUpdate&&src.value.updateMatrix(),dst.value.copy(src.value.matrix))}},POSSIBLE_SPEC_VERSIONS6=new Set([`1.0`,`1.0-beta`]),_MToonMaterialLoaderPlugin=class _MToonMaterialLoaderPlugin2{get name(){return _MToonMaterialLoaderPlugin2.EXTENSION_NAME}constructor(parser,options={}){var _a$2,_b,_c,_d;this.parser=parser,this.materialType=(_a$2=options.materialType)??MToonMaterial,this.renderOrderOffset=(_b=options.renderOrderOffset)??0,this.v0CompatShade=(_c=options.v0CompatShade)??!1,this.debugMode=(_d=options.debugMode)??`none`,this._mToonMaterialSet=new Set}beforeRoot(){return __async3(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(gltf){return __async3(this,null,function*(){gltf.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(materialIndex){let v1Extension=this._getMToonExtension(materialIndex);return v1Extension?this.materialType:null}extendMaterialParams(materialIndex,materialParams){let extension$1=this._getMToonExtension(materialIndex);return extension$1?this._extendMaterialParams(extension$1,materialParams):null}loadMesh(meshIndex){return __async3(this,null,function*(){var _a$2;let parser=this.parser,json=parser.json,meshDef=(_a$2=json.meshes)?.[meshIndex];if(meshDef==null)throw Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${meshIndex}] of glTF but the mesh doesn't exist`);let primitivesDef=meshDef.primitives,meshOrGroup=yield parser.loadMesh(meshIndex);if(primitivesDef.length===1){let mesh=meshOrGroup,materialIndex=primitivesDef[0].material;materialIndex!=null&&this._setupPrimitive(mesh,materialIndex)}else{let group=meshOrGroup;for(let i=0;i{var _a$2;let extension$1=this._getMToonExtension(iMaterial);extension$1&&(_a$2=materialDef.extensions)?.KHR_materials_unlit&&delete materialDef.extensions.KHR_materials_unlit})}_getMToonExtension(materialIndex){var _a$2,_b;let parser=this.parser,json=parser.json,materialDef=(_a$2=json.materials)?.[materialIndex];if(materialDef==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${materialIndex}] of glTF but the material doesn't exist`);return}let extension$1=(_b=materialDef.extensions)?.[_MToonMaterialLoaderPlugin2.EXTENSION_NAME];if(extension$1==null)return;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS6.has(specVersion)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${_MToonMaterialLoaderPlugin2.EXTENSION_NAME} specVersion "${specVersion}"`);return}return extension$1}_extendMaterialParams(extension$1,materialParams){return __async3(this,null,function*(){var _a$2;delete materialParams.metalness,delete materialParams.roughness;let assignHelper=new GLTFMToonMaterialParamsAssignHelper(this.parser,materialParams);assignHelper.assignPrimitive(`transparentWithZWrite`,extension$1.transparentWithZWrite),assignHelper.assignColor(`shadeColorFactor`,extension$1.shadeColorFactor),assignHelper.assignTexture(`shadeMultiplyTexture`,extension$1.shadeMultiplyTexture,!0),assignHelper.assignPrimitive(`shadingShiftFactor`,extension$1.shadingShiftFactor),assignHelper.assignTexture(`shadingShiftTexture`,extension$1.shadingShiftTexture,!0),assignHelper.assignPrimitive(`shadingShiftTextureScale`,(_a$2=extension$1.shadingShiftTexture)?.scale),assignHelper.assignPrimitive(`shadingToonyFactor`,extension$1.shadingToonyFactor),assignHelper.assignPrimitive(`giEqualizationFactor`,extension$1.giEqualizationFactor),assignHelper.assignColor(`matcapFactor`,extension$1.matcapFactor),assignHelper.assignTexture(`matcapTexture`,extension$1.matcapTexture,!0),assignHelper.assignColor(`parametricRimColorFactor`,extension$1.parametricRimColorFactor),assignHelper.assignTexture(`rimMultiplyTexture`,extension$1.rimMultiplyTexture,!0),assignHelper.assignPrimitive(`rimLightingMixFactor`,extension$1.rimLightingMixFactor),assignHelper.assignPrimitive(`parametricRimFresnelPowerFactor`,extension$1.parametricRimFresnelPowerFactor),assignHelper.assignPrimitive(`parametricRimLiftFactor`,extension$1.parametricRimLiftFactor),assignHelper.assignPrimitive(`outlineWidthMode`,extension$1.outlineWidthMode),assignHelper.assignPrimitive(`outlineWidthFactor`,extension$1.outlineWidthFactor),assignHelper.assignTexture(`outlineWidthMultiplyTexture`,extension$1.outlineWidthMultiplyTexture,!1),assignHelper.assignColor(`outlineColorFactor`,extension$1.outlineColorFactor),assignHelper.assignPrimitive(`outlineLightingMixFactor`,extension$1.outlineLightingMixFactor),assignHelper.assignTexture(`uvAnimationMaskTexture`,extension$1.uvAnimationMaskTexture,!1),assignHelper.assignPrimitive(`uvAnimationScrollXSpeedFactor`,extension$1.uvAnimationScrollXSpeedFactor),assignHelper.assignPrimitive(`uvAnimationScrollYSpeedFactor`,extension$1.uvAnimationScrollYSpeedFactor),assignHelper.assignPrimitive(`uvAnimationRotationSpeedFactor`,extension$1.uvAnimationRotationSpeedFactor),assignHelper.assignPrimitive(`v0CompatShade`,this.v0CompatShade),assignHelper.assignPrimitive(`debugMode`,this.debugMode),yield assignHelper.pending})}_setupPrimitive(mesh,materialIndex){let extension$1=this._getMToonExtension(materialIndex);if(extension$1){let renderOrder=this._parseRenderOrder(extension$1);mesh.renderOrder=renderOrder+this.renderOrderOffset,this._generateOutline(mesh),this._addToMaterialSet(mesh);return}}_shouldGenerateOutline(surfaceMaterial){return typeof surfaceMaterial.outlineWidthMode==`string`&&surfaceMaterial.outlineWidthMode!==`none`&&typeof surfaceMaterial.outlineWidthFactor==`number`&&surfaceMaterial.outlineWidthFactor>0}_generateOutline(mesh){let surfaceMaterial=mesh.material;if(!(surfaceMaterial instanceof Material)||!this._shouldGenerateOutline(surfaceMaterial))return;mesh.material=[surfaceMaterial];let outlineMaterial=surfaceMaterial.clone();outlineMaterial.name+=` (Outline)`,outlineMaterial.isOutline=!0,outlineMaterial.side=BackSide,mesh.material.push(outlineMaterial);let geometry=mesh.geometry,primitiveVertices=geometry.index?geometry.index.count:geometry.attributes.position.count/3;geometry.addGroup(0,primitiveVertices,0),geometry.addGroup(0,primitiveVertices,1)}_addToMaterialSet(mesh){let materialOrMaterials=mesh.material,materialSet=new Set;Array.isArray(materialOrMaterials)?materialOrMaterials.forEach(material=>materialSet.add(material)):materialSet.add(materialOrMaterials);for(let material of materialSet)this._mToonMaterialSet.add(material)}_parseRenderOrder(extension$1){var _a$2;let enabledZWrite=extension$1.transparentWithZWrite;return(enabledZWrite?0:19)+((_a$2=extension$1.renderQueueOffsetNumber)??0)}};_MToonMaterialLoaderPlugin.EXTENSION_NAME=`VRMC_materials_mtoon`;var MToonMaterialLoaderPlugin=_MToonMaterialLoaderPlugin,__async4=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),_VRMMaterialsHDREmissiveMultiplierLoaderPlugin=class _VRMMaterialsHDREmissiveMultiplierLoaderPlugin2{get name(){return _VRMMaterialsHDREmissiveMultiplierLoaderPlugin2.EXTENSION_NAME}constructor(parser){this.parser=parser}extendMaterialParams(materialIndex,materialParams){return __async4(this,null,function*(){let extension$1=this._getHDREmissiveMultiplierExtension(materialIndex);if(extension$1==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");let emissiveMultiplier=extension$1.emissiveMultiplier;materialParams.emissiveIntensity=emissiveMultiplier})}_getHDREmissiveMultiplierExtension(materialIndex){var _a$2,_b;let parser=this.parser,json=parser.json,materialDef=(_a$2=json.materials)?.[materialIndex];if(materialDef==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${materialIndex}] of glTF but the material doesn't exist`);return}let extension$1=(_b=materialDef.extensions)?.[_VRMMaterialsHDREmissiveMultiplierLoaderPlugin2.EXTENSION_NAME];if(extension$1!=null)return extension$1}};_VRMMaterialsHDREmissiveMultiplierLoaderPlugin.EXTENSION_NAME=`VRMC_materials_hdr_emissiveMultiplier`;var VRMMaterialsHDREmissiveMultiplierLoaderPlugin=_VRMMaterialsHDREmissiveMultiplierLoaderPlugin,__defProp2=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols2=Object.getOwnPropertySymbols,__hasOwnProp2=Object.prototype.hasOwnProperty,__propIsEnum2=Object.prototype.propertyIsEnumerable,__defNormalProp2=(obj,key$1,value)=>key$1 in obj?__defProp2(obj,key$1,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key$1]=value,__spreadValues2=(a,b)=>{for(var prop in b||={})__hasOwnProp2.call(b,prop)&&__defNormalProp2(a,prop,b[prop]);if(__getOwnPropSymbols2)for(var prop of __getOwnPropSymbols2(b))__propIsEnum2.call(b,prop)&&__defNormalProp2(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__async5=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});function gammaEOTF(e){return e**2.2}var VRMMaterialsV0CompatPlugin=class{get name(){return`VRMMaterialsV0CompatPlugin`}constructor(parser){var _a$2;this.parser=parser,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;let json=this.parser.json;json.extensionsUsed=(_a$2=json.extensionsUsed)??[],json.extensionsUsed.indexOf(`KHR_texture_transform`)===-1&&json.extensionsUsed.push(`KHR_texture_transform`)}beforeRoot(){return __async5(this,null,function*(){var _a$2;let json=this.parser.json,v0VRMExtension=(_a$2=json.extensions)?.VRM,v0MaterialProperties=v0VRMExtension?.materialProperties;v0MaterialProperties&&(this._populateRenderQueueMap(v0MaterialProperties),v0MaterialProperties.forEach((materialProperties,materialIndex)=>{var _a2,_b;let materialDef=(_a2=json.materials)?.[materialIndex];if(materialDef==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${materialIndex}] of glTF but the material doesn't exist`);return}if(materialProperties.shader===`VRM/MToon`){let material=this._parseV0MToonProperties(materialProperties,materialDef);json.materials[materialIndex]=material}else if((_b=materialProperties.shader)?.startsWith(`VRM/Unlit`)){let material=this._parseV0UnlitProperties(materialProperties,materialDef);json.materials[materialIndex]=material}else materialProperties.shader===`VRM_USE_GLTFSHADER`||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${materialProperties.shader}`)}))})}_parseV0MToonProperties(materialProperties,schemaMaterial){var _a$2,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o,_p,_q,_r,_s,_t,_u,_v,_w,_x,_y,_z,_A,_B,_C,_D,_E,_F,_G,_H,_I,_J,_K,_L,_M,_N,_O,_P,_Q,_R,_S,_T,_U,_V,_W,_X,_Y,_Z,__,_$,_aa;let isTransparent=(_b=(_a$2=materialProperties.keywordMap)?._ALPHABLEND_ON)??!1,enabledZWrite=(_c=materialProperties.floatProperties)?._ZWrite===1,transparentWithZWrite=enabledZWrite&&isTransparent,renderQueueOffsetNumber=this._v0ParseRenderQueue(materialProperties),isCutoff=(_e=(_d=materialProperties.keywordMap)?._ALPHATEST_ON)??!1,alphaMode=isTransparent?`BLEND`:isCutoff?`MASK`:`OPAQUE`,alphaCutoff=isCutoff?(_g=(_f=materialProperties.floatProperties)?._Cutoff)??.5:void 0,cullMode=(_i=(_h=materialProperties.floatProperties)?._CullMode)??2,doubleSided=cullMode===0,textureTransformExt=this._portTextureTransform(materialProperties),baseColorFactor=((_k=(_j=materialProperties.vectorProperties)?._Color)??[1,1,1,1]).map((v,i)=>i===3?v:gammaEOTF(v)),baseColorTextureIndex=(_l=materialProperties.textureProperties)?._MainTex,baseColorTexture=baseColorTextureIndex==null?void 0:{index:baseColorTextureIndex,extensions:__spreadValues2({},textureTransformExt)},normalTextureScale=(_n=(_m=materialProperties.floatProperties)?._BumpScale)??1,normalTextureIndex=(_o=materialProperties.textureProperties)?._BumpMap,normalTexture=normalTextureIndex==null?void 0:{index:normalTextureIndex,scale:normalTextureScale,extensions:__spreadValues2({},textureTransformExt)},emissiveFactor=((_q=(_p=materialProperties.vectorProperties)?._EmissionColor)??[0,0,0,1]).map(gammaEOTF),emissiveTextureIndex=(_r=materialProperties.textureProperties)?._EmissionMap,emissiveTexture=emissiveTextureIndex==null?void 0:{index:emissiveTextureIndex,extensions:__spreadValues2({},textureTransformExt)},shadeColorFactor=((_t=(_s=materialProperties.vectorProperties)?._ShadeColor)??[.97,.81,.86,1]).map(gammaEOTF),shadeMultiplyTextureIndex=(_u=materialProperties.textureProperties)?._ShadeTexture,shadeMultiplyTexture=shadeMultiplyTextureIndex==null?void 0:{index:shadeMultiplyTextureIndex,extensions:__spreadValues2({},textureTransformExt)},shadingShiftFactor=(_w=(_v=materialProperties.floatProperties)?._ShadeShift)??0,shadingToonyFactor=(_y=(_x=materialProperties.floatProperties)?._ShadeToony)??.9;shadingToonyFactor=MathUtils.lerp(shadingToonyFactor,1,.5+.5*shadingShiftFactor),shadingShiftFactor=-shadingShiftFactor-(1-shadingToonyFactor);let giIntensityFactor=(_A=(_z=materialProperties.floatProperties)?._IndirectLightIntensity)??.1,giEqualizationFactor=giIntensityFactor?1-giIntensityFactor:void 0,matcapTextureIndex=(_B=materialProperties.textureProperties)?._SphereAdd,matcapFactor=matcapTextureIndex==null?void 0:[1,1,1],matcapTexture=matcapTextureIndex==null?void 0:{index:matcapTextureIndex},rimLightingMixFactor=(_D=(_C=materialProperties.floatProperties)?._RimLightingMix)??0,rimMultiplyTextureIndex=(_E=materialProperties.textureProperties)?._RimTexture,rimMultiplyTexture=rimMultiplyTextureIndex==null?void 0:{index:rimMultiplyTextureIndex,extensions:__spreadValues2({},textureTransformExt)},parametricRimColorFactor=((_G=(_F=materialProperties.vectorProperties)?._RimColor)??[0,0,0,1]).map(gammaEOTF),parametricRimFresnelPowerFactor=(_I=(_H=materialProperties.floatProperties)?._RimFresnelPower)??1,parametricRimLiftFactor=(_K=(_J=materialProperties.floatProperties)?._RimLift)??0,outlineWidthMode=[`none`,`worldCoordinates`,`screenCoordinates`][(_M=(_L=materialProperties.floatProperties)?._OutlineWidthMode)??0],outlineWidthFactor=(_O=(_N=materialProperties.floatProperties)?._OutlineWidth)??0;outlineWidthFactor=.01*outlineWidthFactor;let outlineWidthMultiplyTextureIndex=(_P=materialProperties.textureProperties)?._OutlineWidthTexture,outlineWidthMultiplyTexture=outlineWidthMultiplyTextureIndex==null?void 0:{index:outlineWidthMultiplyTextureIndex,extensions:__spreadValues2({},textureTransformExt)},outlineColorFactor=((_R=(_Q=materialProperties.vectorProperties)?._OutlineColor)??[0,0,0]).map(gammaEOTF),outlineColorMode=(_T=(_S=materialProperties.floatProperties)?._OutlineColorMode)??0,outlineLightingMixFactor=outlineColorMode===1?(_V=(_U=materialProperties.floatProperties)?._OutlineLightingMix)??1:0,uvAnimationMaskTextureIndex=(_W=materialProperties.textureProperties)?._UvAnimMaskTexture,uvAnimationMaskTexture=uvAnimationMaskTextureIndex==null?void 0:{index:uvAnimationMaskTextureIndex,extensions:__spreadValues2({},textureTransformExt)},uvAnimationScrollXSpeedFactor=(_Y=(_X=materialProperties.floatProperties)?._UvAnimScrollX)??0,uvAnimationScrollYSpeedFactor=(__=(_Z=materialProperties.floatProperties)?._UvAnimScrollY)??0;uvAnimationScrollYSpeedFactor!=null&&(uvAnimationScrollYSpeedFactor=-uvAnimationScrollYSpeedFactor);let uvAnimationRotationSpeedFactor=(_aa=(_$=materialProperties.floatProperties)?._UvAnimRotation)??0,mtoonExtension={specVersion:`1.0`,transparentWithZWrite,renderQueueOffsetNumber,shadeColorFactor,shadeMultiplyTexture,shadingShiftFactor,shadingToonyFactor,giEqualizationFactor,matcapFactor,matcapTexture,rimLightingMixFactor,rimMultiplyTexture,parametricRimColorFactor,parametricRimFresnelPowerFactor,parametricRimLiftFactor,outlineWidthMode,outlineWidthFactor,outlineWidthMultiplyTexture,outlineColorFactor,outlineLightingMixFactor,uvAnimationMaskTexture,uvAnimationScrollXSpeedFactor,uvAnimationScrollYSpeedFactor,uvAnimationRotationSpeedFactor};return __spreadProps(__spreadValues2({},schemaMaterial),{pbrMetallicRoughness:{baseColorFactor,baseColorTexture},normalTexture,emissiveTexture,emissiveFactor,alphaMode,alphaCutoff,doubleSided,extensions:{VRMC_materials_mtoon:mtoonExtension}})}_parseV0UnlitProperties(materialProperties,schemaMaterial){var _a$2,_b,_c,_d,_e;let isTransparentZWrite=materialProperties.shader===`VRM/UnlitTransparentZWrite`,isTransparent=materialProperties.shader===`VRM/UnlitTransparent`||isTransparentZWrite,renderQueueOffsetNumber=this._v0ParseRenderQueue(materialProperties),isCutoff=materialProperties.shader===`VRM/UnlitCutout`,alphaMode=isTransparent?`BLEND`:isCutoff?`MASK`:`OPAQUE`,alphaCutoff=isCutoff?(_b=(_a$2=materialProperties.floatProperties)?._Cutoff)??.5:void 0,textureTransformExt=this._portTextureTransform(materialProperties),baseColorFactor=((_d=(_c=materialProperties.vectorProperties)?._Color)??[1,1,1,1]).map(gammaEOTF),baseColorTextureIndex=(_e=materialProperties.textureProperties)?._MainTex,baseColorTexture=baseColorTextureIndex==null?void 0:{index:baseColorTextureIndex,extensions:__spreadValues2({},textureTransformExt)},mtoonExtension={specVersion:`1.0`,transparentWithZWrite:isTransparentZWrite,renderQueueOffsetNumber,shadeColorFactor:baseColorFactor,shadeMultiplyTexture:baseColorTexture};return __spreadProps(__spreadValues2({},schemaMaterial),{pbrMetallicRoughness:{baseColorFactor,baseColorTexture},alphaMode,alphaCutoff,extensions:{VRMC_materials_mtoon:mtoonExtension}})}_portTextureTransform(materialProperties){var _a$2,_b,_c,_d,_e;let textureTransform=(_a$2=materialProperties.vectorProperties)?._MainTex;if(textureTransform==null)return{};let offset=[(_b=textureTransform?.[0])??0,(_c=textureTransform?.[1])??0],scale=[(_d=textureTransform?.[2])??1,(_e=textureTransform?.[3])??1];return offset[1]=1-scale[1]-offset[1],{KHR_texture_transform:{offset,scale}}}_v0ParseRenderQueue(materialProperties){var _a$2,_b;let isTransparentZWrite=materialProperties.shader===`VRM/UnlitTransparentZWrite`,isTransparent=(_a$2=materialProperties.keywordMap)?._ALPHABLEND_ON!=null||materialProperties.shader===`VRM/UnlitTransparent`||isTransparentZWrite,enabledZWrite=(_b=materialProperties.floatProperties)?._ZWrite===1||isTransparentZWrite,offset=0;if(isTransparent){let v0Queue=materialProperties.renderQueue;v0Queue!=null&&(offset=enabledZWrite?this._renderQueueMapTransparentZWrite.get(v0Queue):this._renderQueueMapTransparent.get(v0Queue))}return offset}_populateRenderQueueMap(materialPropertiesList){let renderQueuesTransparent=new Set,renderQueuesTransparentZWrite=new Set;materialPropertiesList.forEach(materialProperties=>{var _a$2,_b;let isTransparentZWrite=materialProperties.shader===`VRM/UnlitTransparentZWrite`,isTransparent=(_a$2=materialProperties.keywordMap)?._ALPHABLEND_ON!=null||materialProperties.shader===`VRM/UnlitTransparent`||isTransparentZWrite,enabledZWrite=(_b=materialProperties.floatProperties)?._ZWrite===1||isTransparentZWrite;if(isTransparent){let v0Queue=materialProperties.renderQueue;v0Queue!=null&&(enabledZWrite?renderQueuesTransparentZWrite.add(v0Queue):renderQueuesTransparent.add(v0Queue))}}),renderQueuesTransparent.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${renderQueuesTransparent.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),renderQueuesTransparentZWrite.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${renderQueuesTransparentZWrite.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(renderQueuesTransparent).sort().forEach((queue,i)=>{let newQueueOffset=Math.min(Math.max(i-renderQueuesTransparent.size+1,-9),0);this._renderQueueMapTransparent.set(queue,newQueueOffset)}),Array.from(renderQueuesTransparentZWrite).sort().forEach((queue,i)=>{let newQueueOffset=Math.min(Math.max(i,0),9);this._renderQueueMapTransparentZWrite.set(queue,newQueueOffset)})}},__async6=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),_v3A6=new Vector3,VRMNodeConstraintHelper=class extends Group{constructor(constraint){super(),this._attrPosition=new BufferAttribute(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(DynamicDrawUsage);let geometry=new BufferGeometry;geometry.setAttribute(`position`,this._attrPosition);let material=new LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new Line(geometry,material),this.add(this._line),this.constraint=constraint}updateMatrixWorld(force){_v3A6.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,_v3A6.x,_v3A6.y,_v3A6.z),this.constraint.source&&_v3A6.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,_v3A6.x,_v3A6.y,_v3A6.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(force)}};function decomposePosition(matrix,target){return target.set(matrix.elements[12],matrix.elements[13],matrix.elements[14])}var _v3A22=new Vector3,_v3B4=new Vector3;function decomposeRotation(matrix,target){return matrix.decompose(_v3A22,target,_v3B4),target}function quatInvertCompat2(target){return target.invert?target.invert():target.inverse(),target}var VRMNodeConstraint=class{constructor(destination,source){this.destination=destination,this.source=source,this.weight=1}},_v3A32=new Vector3,_v3B22=new Vector3,_v3C2=new Vector3,_quatA7=new Quaternion,_quatB4=new Quaternion,_quatC2=new Quaternion,VRMAimConstraint=class extends VRMNodeConstraint{get aimAxis(){return this._aimAxis}set aimAxis(aimAxis){this._aimAxis=aimAxis,this._v3AimAxis.set(aimAxis===`PositiveX`?1:aimAxis===`NegativeX`?-1:0,aimAxis===`PositiveY`?1:aimAxis===`NegativeY`?-1:0,aimAxis===`PositiveZ`?1:aimAxis===`NegativeZ`?-1:0)}get dependencies(){let set=new Set([this.source]);return this.destination.parent&&set.add(this.destination.parent),set}constructor(destination,source){super(destination,source),this._aimAxis=`PositiveX`,this._v3AimAxis=new Vector3(1,0,0),this._dstRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let dstParentWorldQuat=_quatA7.identity(),invDstParentWorldQuat=_quatB4.identity();this.destination.parent&&(decomposeRotation(this.destination.parent.matrixWorld,dstParentWorldQuat),quatInvertCompat2(invDstParentWorldQuat.copy(dstParentWorldQuat)));let a0=_v3A32.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(dstParentWorldQuat),a1=decomposePosition(this.source.matrixWorld,_v3B22).sub(decomposePosition(this.destination.matrixWorld,_v3C2)).normalize(),targetQuat=_quatC2.setFromUnitVectors(a0,a1).premultiply(invDstParentWorldQuat).multiply(dstParentWorldQuat).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(targetQuat,this.weight)}};function traverseAncestorsFromRoot(object,callback){let ancestors=[object],head$1=object.parent;for(;head$1!==null;)ancestors.unshift(head$1),head$1=head$1.parent;ancestors.forEach(ancestor=>{callback(ancestor)})}var VRMNodeConstraintManager=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(constraint){this._constraints.add(constraint);let objectSet=this._objectConstraintsMap.get(constraint.destination);objectSet??(objectSet=new Set,this._objectConstraintsMap.set(constraint.destination,objectSet)),objectSet.add(constraint)}deleteConstraint(constraint){this._constraints.delete(constraint);let objectSet=this._objectConstraintsMap.get(constraint.destination);objectSet.delete(constraint)}setInitState(){let constraintsTried=new Set,constraintsDone=new Set;for(let constraint of this._constraints)this._processConstraint(constraint,constraintsTried,constraintsDone,constraint2=>constraint2.setInitState())}update(){let constraintsTried=new Set,constraintsDone=new Set;for(let constraint of this._constraints)this._processConstraint(constraint,constraintsTried,constraintsDone,constraint2=>constraint2.update())}_processConstraint(constraint,constraintsTried,constraintsDone,callback){if(constraintsDone.has(constraint))return;if(constraintsTried.has(constraint))throw Error(`VRMNodeConstraintManager: Circular dependency detected while updating constraints`);constraintsTried.add(constraint);let depObjects=constraint.dependencies;for(let depObject of depObjects)traverseAncestorsFromRoot(depObject,depObjectAncestor=>{let objectSet=this._objectConstraintsMap.get(depObjectAncestor);if(objectSet)for(let depConstraint of objectSet)this._processConstraint(depConstraint,constraintsTried,constraintsDone,callback)});callback(constraint),constraintsDone.add(constraint)}},_quatA22=new Quaternion,_quatB22=new Quaternion,VRMRotationConstraint=class extends VRMNodeConstraint{get dependencies(){return new Set([this.source])}constructor(destination,source){super(destination,source),this._dstRestQuat=new Quaternion,this._invSrcRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),quatInvertCompat2(this._invSrcRestQuat.copy(this.source.quaternion))}update(){let srcDeltaQuat=_quatA22.copy(this._invSrcRestQuat).multiply(this.source.quaternion),targetQuat=_quatB22.copy(this._dstRestQuat).multiply(srcDeltaQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(targetQuat,this.weight)}},_v3A42=new Vector3,_quatA32=new Quaternion,_quatB32=new Quaternion,VRMRollConstraint=class extends VRMNodeConstraint{get rollAxis(){return this._rollAxis}set rollAxis(rollAxis){this._rollAxis=rollAxis,this._v3RollAxis.set(rollAxis===`X`?1:0,rollAxis===`Y`?1:0,rollAxis===`Z`?1:0)}get dependencies(){return new Set([this.source])}constructor(destination,source){super(destination,source),this._rollAxis=`X`,this._v3RollAxis=new Vector3(1,0,0),this._dstRestQuat=new Quaternion,this._invDstRestQuat=new Quaternion,this._invSrcRestQuatMulDstRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),quatInvertCompat2(this._invDstRestQuat.copy(this._dstRestQuat)),quatInvertCompat2(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){let quatDelta=_quatA32.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),n1=_v3A42.copy(this._v3RollAxis).applyQuaternion(quatDelta),quatFromTo=_quatB32.setFromUnitVectors(n1,this._v3RollAxis),targetQuat=quatFromTo.premultiply(this._dstRestQuat).multiply(quatDelta);this.destination.quaternion.copy(this._dstRestQuat).slerp(targetQuat,this.weight)}},POSSIBLE_SPEC_VERSIONS7=new Set([`1.0`,`1.0-beta`]),_VRMNodeConstraintLoaderPlugin=class _VRMNodeConstraintLoaderPlugin2{get name(){return _VRMNodeConstraintLoaderPlugin2.EXTENSION_NAME}constructor(parser,options){this.parser=parser,this.helperRoot=options?.helperRoot}afterRoot(gltf){return __async6(this,null,function*(){gltf.userData.vrmNodeConstraintManager=yield this._import(gltf)})}_import(gltf){return __async6(this,null,function*(){var _a$2;let json=this.parser.json,isConstraintsUsed=(_a$2=json.extensionsUsed)?.indexOf(_VRMNodeConstraintLoaderPlugin2.EXTENSION_NAME)!==-1;if(!isConstraintsUsed)return null;let manager=new VRMNodeConstraintManager,threeNodes=yield this.parser.getDependencies(`node`);return threeNodes.forEach((node$1,nodeIndex)=>{var _a2;let schemaNode=json.nodes[nodeIndex],extension$1=(_a2=schemaNode?.extensions)?.[_VRMNodeConstraintLoaderPlugin2.EXTENSION_NAME];if(extension$1==null)return;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS7.has(specVersion)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${_VRMNodeConstraintLoaderPlugin2.EXTENSION_NAME} specVersion "${specVersion}"`);return}let constraintDef=extension$1.constraint;if(constraintDef.roll!=null){let constraint=this._importRollConstraint(node$1,threeNodes,constraintDef.roll);manager.addConstraint(constraint)}else if(constraintDef.aim!=null){let constraint=this._importAimConstraint(node$1,threeNodes,constraintDef.aim);manager.addConstraint(constraint)}else if(constraintDef.rotation!=null){let constraint=this._importRotationConstraint(node$1,threeNodes,constraintDef.rotation);manager.addConstraint(constraint)}}),gltf.scene.updateMatrixWorld(),manager.setInitState(),manager})}_importRollConstraint(destination,nodes,rollConstraintDef){let{source:sourceIndex,rollAxis,weight}=rollConstraintDef,source=nodes[sourceIndex],constraint=new VRMRollConstraint(destination,source);if(rollAxis!=null&&(constraint.rollAxis=rollAxis),weight!=null&&(constraint.weight=weight),this.helperRoot){let helper=new VRMNodeConstraintHelper(constraint);this.helperRoot.add(helper)}return constraint}_importAimConstraint(destination,nodes,aimConstraintDef){let{source:sourceIndex,aimAxis,weight}=aimConstraintDef,source=nodes[sourceIndex],constraint=new VRMAimConstraint(destination,source);if(aimAxis!=null&&(constraint.aimAxis=aimAxis),weight!=null&&(constraint.weight=weight),this.helperRoot){let helper=new VRMNodeConstraintHelper(constraint);this.helperRoot.add(helper)}return constraint}_importRotationConstraint(destination,nodes,rotationConstraintDef){let{source:sourceIndex,weight}=rotationConstraintDef,source=nodes[sourceIndex],constraint=new VRMRotationConstraint(destination,source);if(weight!=null&&(constraint.weight=weight),this.helperRoot){let helper=new VRMNodeConstraintHelper(constraint);this.helperRoot.add(helper)}return constraint}};_VRMNodeConstraintLoaderPlugin.EXTENSION_NAME=`VRMC_node_constraint`;var VRMNodeConstraintLoaderPlugin=_VRMNodeConstraintLoaderPlugin,__async7=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),VRMSpringBoneColliderShape=class{},_v3A7=new Vector3,_v3B5=new Vector3,VRMSpringBoneColliderShapeCapsule=class extends VRMSpringBoneColliderShape{get type(){return`capsule`}constructor(params){var _a$2,_b,_c,_d;super(),this.offset=(_a$2=params?.offset)??new Vector3(0,0,0),this.tail=(_b=params?.tail)??new Vector3(0,0,0),this.radius=(_c=params?.radius)??0,this.inside=(_d=params?.inside)??!1}calculateCollision(colliderMatrix,objectPosition,objectRadius,target){_v3A7.setFromMatrixPosition(colliderMatrix),_v3B5.subVectors(this.tail,this.offset).applyMatrix4(colliderMatrix),_v3B5.sub(_v3A7);let lengthSqCapsule=_v3B5.lengthSq();target.copy(objectPosition).sub(_v3A7);let dot=_v3B5.dot(target);dot<=0||(lengthSqCapsule<=dot||_v3B5.multiplyScalar(dot/lengthSqCapsule),target.sub(_v3B5));let length=target.length(),distance=this.inside?this.radius-objectRadius-length:length-objectRadius-this.radius;return distance<0&&(target.multiplyScalar(1/length),this.inside&&target.negate()),distance}},_v3A23=new Vector3,_mat3A=new Matrix3,VRMSpringBoneColliderShapePlane=class extends VRMSpringBoneColliderShape{get type(){return`plane`}constructor(params){var _a$2,_b;super(),this.offset=(_a$2=params?.offset)??new Vector3(0,0,0),this.normal=(_b=params?.normal)??new Vector3(0,0,1)}calculateCollision(colliderMatrix,objectPosition,objectRadius,target){target.setFromMatrixPosition(colliderMatrix),target.negate().add(objectPosition),_mat3A.getNormalMatrix(colliderMatrix),_v3A23.copy(this.normal).applyNormalMatrix(_mat3A).normalize();let distance=target.dot(_v3A23)-objectRadius;return target.copy(_v3A23),distance}},_v3A33=new Vector3,VRMSpringBoneColliderShapeSphere=class extends VRMSpringBoneColliderShape{get type(){return`sphere`}constructor(params){var _a$2,_b,_c;super(),this.offset=(_a$2=params?.offset)??new Vector3(0,0,0),this.radius=(_b=params?.radius)??0,this.inside=(_c=params?.inside)??!1}calculateCollision(colliderMatrix,objectPosition,objectRadius,target){target.subVectors(objectPosition,_v3A33.setFromMatrixPosition(colliderMatrix));let length=target.length(),distance=this.inside?this.radius-objectRadius-length:length-objectRadius-this.radius;return distance<0&&(target.multiplyScalar(1/length),this.inside&&target.negate()),distance}},_v3A43=new Vector3,ColliderShapeCapsuleBufferGeometry=class extends BufferGeometry{constructor(shape){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new Vector3,this._currentTail=new Vector3,this._shape=shape,this._attrPos=new BufferAttribute(new Float32Array(396),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1,radius=this._shape.radius/this.worldScale;this._currentRadius!==radius&&(this._currentRadius=radius,shouldUpdateGeometry=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),shouldUpdateGeometry=!0);let tail=_v3A43.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(tail)>1e-10&&(this._currentTail.copy(tail),shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){_v3A43.copy(this._currentTail).sub(this._currentOffset);let l=_v3A43.length()/this._currentRadius;for(let i=0;i<=16;i++){let t=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(t),-Math.cos(t),0),this._attrPos.setXYZ(17+i,l+Math.sin(t),Math.cos(t),0),this._attrPos.setXYZ(34+i,-Math.sin(t),0,-Math.cos(t)),this._attrPos.setXYZ(51+i,l+Math.sin(t),0,Math.cos(t))}for(let i=0;i<32;i++){let t=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(t),Math.cos(t)),this._attrPos.setXYZ(100+i,l,Math.sin(t),Math.cos(t))}let theta=Math.atan2(_v3A43.y,Math.sqrt(_v3A43.x*_v3A43.x+_v3A43.z*_v3A43.z)),phi=-Math.atan2(_v3A43.z,_v3A43.x);this.rotateZ(theta),this.rotateY(phi),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let i=0;i<34;i++){let i1=(i+1)%34;this._attrIndex.setXY(i*2,i,i1),this._attrIndex.setXY(68+i*2,34+i,34+i1)}for(let i=0;i<32;i++){let i1=(i+1)%32;this._attrIndex.setXY(136+i*2,68+i,68+i1),this._attrIndex.setXY(200+i*2,100+i,100+i1)}this._attrIndex.needsUpdate=!0}},ColliderShapePlaneBufferGeometry=class extends BufferGeometry{constructor(shape){super(),this.worldScale=1,this._currentOffset=new Vector3,this._currentNormal=new Vector3,this._shape=shape,this._attrPos=new BufferAttribute(new Float32Array(6*3),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),shouldUpdateGeometry=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},ColliderShapeSphereBufferGeometry=class extends BufferGeometry{constructor(shape){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new Vector3,this._shape=shape,this._attrPos=new BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1,radius=this._shape.radius/this.worldScale;this._currentRadius!==radius&&(this._currentRadius=radius,shouldUpdateGeometry=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){for(let i=0;i<32;i++){let t=i/16*Math.PI;this._attrPos.setXYZ(i,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+i,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+i,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let i=0;i<32;i++){let i1=(i+1)%32;this._attrIndex.setXY(i*2,i,i1),this._attrIndex.setXY(64+i*2,32+i,32+i1),this._attrIndex.setXY(128+i*2,64+i,64+i1)}this._attrIndex.needsUpdate=!0}},_v3A52=new Vector3,VRMSpringBoneColliderHelper=class extends Group{constructor(collider){if(super(),this.matrixAutoUpdate=!1,this.collider=collider,this.collider.shape instanceof VRMSpringBoneColliderShapeSphere)this._geometry=new ColliderShapeSphereBufferGeometry(this.collider.shape);else if(this.collider.shape instanceof VRMSpringBoneColliderShapeCapsule)this._geometry=new ColliderShapeCapsuleBufferGeometry(this.collider.shape);else if(this.collider.shape instanceof VRMSpringBoneColliderShapePlane)this._geometry=new ColliderShapePlaneBufferGeometry(this.collider.shape);else throw Error(`VRMSpringBoneColliderHelper: Unknown collider shape type detected`);let material=new LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new LineSegments(this._geometry,material),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(force){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let matrixWorldElements=this.matrix.elements;this._geometry.worldScale=_v3A52.set(matrixWorldElements[0],matrixWorldElements[1],matrixWorldElements[2]).length(),this._geometry.update(),super.updateMatrixWorld(force)}},SpringBoneBufferGeometry=class extends BufferGeometry{constructor(springBone){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new Vector3,this._springBone=springBone,this._attrPos=new BufferAttribute(new Float32Array(294),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let shouldUpdateGeometry=!1,radius=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==radius&&(this._currentRadius=radius,shouldUpdateGeometry=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),shouldUpdateGeometry=!0),shouldUpdateGeometry&&this._buildPosition()}_buildPosition(){for(let i=0;i<32;i++){let t=i/16*Math.PI;this._attrPos.setXYZ(i,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+i,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+i,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let i=0;i<32;i++){let i1=(i+1)%32;this._attrIndex.setXY(i*2,i,i1),this._attrIndex.setXY(64+i*2,32+i,32+i1),this._attrIndex.setXY(128+i*2,64+i,64+i1)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},_v3A62=new Vector3,VRMSpringBoneJointHelper=class extends Group{constructor(springBone){super(),this.matrixAutoUpdate=!1,this.springBone=springBone,this._geometry=new SpringBoneBufferGeometry(this.springBone);let material=new LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new LineSegments(this._geometry,material),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(force){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let matrixWorldElements=this.matrix.elements;this._geometry.worldScale=_v3A62.set(matrixWorldElements[0],matrixWorldElements[1],matrixWorldElements[2]).length(),this._geometry.update(),super.updateMatrixWorld(force)}},VRMSpringBoneCollider=class extends Object3D{constructor(shape){super(),this.colliderMatrix=new Matrix4,this.shape=shape}updateWorldMatrix(updateParents,updateChildren){super.updateWorldMatrix(updateParents,updateChildren),updateColliderMatrix(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function updateColliderMatrix(colliderMatrix,matrixWorld,offset){let me=matrixWorld.elements;colliderMatrix.copy(matrixWorld),offset&&(colliderMatrix.elements[12]=me[0]*offset.x+me[4]*offset.y+me[8]*offset.z+me[12],colliderMatrix.elements[13]=me[1]*offset.x+me[5]*offset.y+me[9]*offset.z+me[13],colliderMatrix.elements[14]=me[2]*offset.x+me[6]*offset.y+me[10]*offset.z+me[14])}var _matA=new Matrix4;function mat4InvertCompat(target){return target.invert?target.invert():target.getInverse(_matA.copy(target)),target}var Matrix4InverseCache=class{constructor(matrix){this._inverseCache=new Matrix4,this._shouldUpdateInverse=!0,this.matrix=matrix;let handler={set:(obj,prop,newVal)=>(this._shouldUpdateInverse=!0,obj[prop]=newVal,!0)};this._originalElements=matrix.elements,matrix.elements=new Proxy(matrix.elements,handler)}get inverse(){return this._shouldUpdateInverse&&(mat4InvertCompat(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},IDENTITY_MATRIX4=new Matrix4,_v3A72=new Vector3,_v3B23=new Vector3,_worldSpacePosition=new Vector3,_nextTail=new Vector3,_matA2=new Matrix4,VRMSpringBoneJoint=class{constructor(bone,child,settings={},colliderGroups=[]){this._currentTail=new Vector3,this._prevTail=new Vector3,this._boneAxis=new Vector3,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new Matrix4,this._initialLocalRotation=new Quaternion,this._initialLocalChildPosition=new Vector3;var _a$2,_b,_c,_d,_e,_f;this.bone=bone,this.bone.matrixAutoUpdate=!1,this.child=child,this.settings={hitRadius:(_a$2=settings.hitRadius)??0,stiffness:(_b=settings.stiffness)??1,gravityPower:(_c=settings.gravityPower)??0,gravityDir:(_e=(_d=settings.gravityDir)?.clone())??new Vector3(0,-1,0),dragForce:(_f=settings.dragForce)??.4},this.colliderGroups=colliderGroups}get dependencies(){let set=new Set,parent=this.bone.parent;parent&&set.add(parent);for(let cg=0;cg{callback(ancestor)})}function traverseChildrenUntilConditionMet(object,callback){object.children.forEach(child=>{let result=callback(child);result||traverseChildrenUntilConditionMet(child,callback)})}function lowestCommonAncestor(objects){var _a$2;let sharedAncestors=new Map;for(let object of objects){let current=object;do{let newValue=((_a$2=sharedAncestors.get(current))??0)+1;if(newValue===objects.size)return current;sharedAncestors.set(current,newValue),current=current.parent}while(current!==null)}return null}var VRMSpringBoneManager=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._isSortedJointsDirty=!1,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn(`VRMSpringBoneManager: springBones is deprecated. use joints instead.`),this._joints}get colliderGroups(){let set=new Set;return this._joints.forEach(springBone=>{springBone.colliderGroups.forEach(colliderGroup=>{set.add(colliderGroup)})}),Array.from(set)}get colliders(){let set=new Set;return this.colliderGroups.forEach(colliderGroup=>{colliderGroup.colliders.forEach(collider=>{set.add(collider)})}),Array.from(set)}addJoint(joint){this._joints.add(joint);let objectSet=this._objectSpringBonesMap.get(joint.bone);objectSet??(objectSet=new Set,this._objectSpringBonesMap.set(joint.bone,objectSet)),objectSet.add(joint),this._isSortedJointsDirty=!0}addSpringBone(joint){console.warn(`VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead.`),this.addJoint(joint)}deleteJoint(joint){this._joints.delete(joint);let objectSet=this._objectSpringBonesMap.get(joint.bone);objectSet.delete(joint),this._isSortedJointsDirty=!0}deleteSpringBone(joint){console.warn(`VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead.`),this.deleteJoint(joint)}setInitState(){this._sortJoints();for(let i=0;i{var _a$2,_b;return((_b=(_a$2=this._objectSpringBonesMap.get(object))?.size)??0)>0?!0:(this._ancestors.push(object),!1)})),this._isSortedJointsDirty=!1}_insertJointSort(springBone,springBonesTried,springBonesDone,springBoneOrder,ancestors){if(springBonesDone.has(springBone))return;if(springBonesTried.has(springBone)){this._hasWarnedCircularDependency||(console.warn(`VRMSpringBoneManager: Circular dependency detected`),this._hasWarnedCircularDependency=!0);return}springBonesTried.add(springBone);let depObjects=springBone.dependencies;for(let depObject of depObjects){let encounteredSpringBone=!1,ancestor=null;traverseAncestorsFromRoot2(depObject,depObjectAncestor=>{let objectSet=this._objectSpringBonesMap.get(depObjectAncestor);if(objectSet)for(let depSpringBone of objectSet)encounteredSpringBone=!0,this._insertJointSort(depSpringBone,springBonesTried,springBonesDone,springBoneOrder,ancestors);else encounteredSpringBone||(ancestor=depObjectAncestor)}),ancestor&&ancestors.add(ancestor)}springBoneOrder.push(springBone),springBonesDone.add(springBone)}_relevantChildrenUpdated(object){var _a$2,_b;return((_b=(_a$2=this._objectSpringBonesMap.get(object))?.size)??0)>0?!0:(object.updateWorldMatrix(!1,!1),!1)}},EXTENSION_NAME_EXTENDED_COLLIDER=`VRMC_springBone_extended_collider`,POSSIBLE_SPEC_VERSIONS8=new Set([`1.0`,`1.0-beta`]),POSSIBLE_SPEC_VERSIONS_EXTENDED_COLLIDERS=new Set([`1.0`]),_VRMSpringBoneLoaderPlugin=class _VRMSpringBoneLoaderPlugin2{get name(){return _VRMSpringBoneLoaderPlugin2.EXTENSION_NAME}constructor(parser,options){var _a$2;this.parser=parser,this.jointHelperRoot=options?.jointHelperRoot,this.colliderHelperRoot=options?.colliderHelperRoot,this.useExtendedColliders=(_a$2=options?.useExtendedColliders)??!0}afterRoot(gltf){return __async7(this,null,function*(){gltf.userData.vrmSpringBoneManager=yield this._import(gltf)})}_import(gltf){return __async7(this,null,function*(){let v1Result=yield this._v1Import(gltf);if(v1Result!=null)return v1Result;let v0Result=yield this._v0Import(gltf);return v0Result??null})}_v1Import(gltf){return __async7(this,null,function*(){var _a$2,_b,_c,_d,_e;let json=gltf.parser.json,isSpringBoneUsed=(_a$2=json.extensionsUsed)?.indexOf(_VRMSpringBoneLoaderPlugin2.EXTENSION_NAME)!==-1;if(!isSpringBoneUsed)return null;let manager=new VRMSpringBoneManager,threeNodes=yield gltf.parser.getDependencies(`node`),extension$1=(_b=json.extensions)?.[_VRMSpringBoneLoaderPlugin2.EXTENSION_NAME];if(!extension$1)return null;let specVersion=extension$1.specVersion;if(!POSSIBLE_SPEC_VERSIONS8.has(specVersion))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${_VRMSpringBoneLoaderPlugin2.EXTENSION_NAME} specVersion "${specVersion}"`),null;let colliders=(_c=extension$1.colliders)?.map((schemaCollider,iCollider)=>{var _a2,_b2,_c2,_d2,_e2,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o;let node$1=threeNodes[schemaCollider.node];if(node$1==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${iCollider} attempted to use the node #${schemaCollider.node} but not found`),null;let schemaShape=schemaCollider.shape,schemaExCollider=(_a2=schemaCollider.extensions)?.[EXTENSION_NAME_EXTENDED_COLLIDER];if(this.useExtendedColliders&&schemaExCollider!=null){let specVersionExCollider=schemaExCollider.specVersion;if(!POSSIBLE_SPEC_VERSIONS_EXTENDED_COLLIDERS.has(specVersionExCollider))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${EXTENSION_NAME_EXTENDED_COLLIDER} specVersion "${specVersionExCollider}". Fallbacking to the ${_VRMSpringBoneLoaderPlugin2.EXTENSION_NAME} definition`);else{let schemaExShape=schemaExCollider.shape;if(schemaExShape.sphere)return this._importSphereCollider(node$1,{offset:new Vector3().fromArray((_b2=schemaExShape.sphere.offset)??[0,0,0]),radius:(_c2=schemaExShape.sphere.radius)??0,inside:(_d2=schemaExShape.sphere.inside)??!1});if(schemaExShape.capsule)return this._importCapsuleCollider(node$1,{offset:new Vector3().fromArray((_e2=schemaExShape.capsule.offset)??[0,0,0]),radius:(_f=schemaExShape.capsule.radius)??0,tail:new Vector3().fromArray((_g=schemaExShape.capsule.tail)??[0,0,0]),inside:(_h=schemaExShape.capsule.inside)??!1});if(schemaExShape.plane)return this._importPlaneCollider(node$1,{offset:new Vector3().fromArray((_i=schemaExShape.plane.offset)??[0,0,0]),normal:new Vector3().fromArray((_j=schemaExShape.plane.normal)??[0,0,1])})}}if(schemaShape.sphere)return this._importSphereCollider(node$1,{offset:new Vector3().fromArray((_k=schemaShape.sphere.offset)??[0,0,0]),radius:(_l=schemaShape.sphere.radius)??0,inside:!1});if(schemaShape.capsule)return this._importCapsuleCollider(node$1,{offset:new Vector3().fromArray((_m=schemaShape.capsule.offset)??[0,0,0]),radius:(_n=schemaShape.capsule.radius)??0,tail:new Vector3().fromArray((_o=schemaShape.capsule.tail)??[0,0,0]),inside:!1});throw Error(`VRMSpringBoneLoaderPlugin: The collider #${iCollider} has no valid shape`)}),colliderGroups=(_d=extension$1.colliderGroups)?.map((schemaColliderGroup,iColliderGroup)=>{var _a2;let cols=((_a2=schemaColliderGroup.colliders)??[]).flatMap(iCollider=>{let col=colliders?.[iCollider];return col??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${iColliderGroup} attempted to use a collider #${iCollider} but not found`),[])});return{colliders:cols,name:schemaColliderGroup.name}});return(_e=extension$1.springs)==null||_e.forEach((schemaSpring,iSpring)=>{var _a2;let schemaJoints=schemaSpring.joints,colliderGroupsForSpring=(_a2=schemaSpring.colliderGroups)?.map(iColliderGroup=>{let group=colliderGroups?.[iColliderGroup];if(group==null)throw Error(`VRMSpringBoneLoaderPlugin: The spring #${iSpring} attempted to use a colliderGroup ${iColliderGroup} but not found`);return group}),center=schemaSpring.center==null?void 0:threeNodes[schemaSpring.center],prevSchemaJoint;schemaJoints.forEach(schemaJoint=>{if(prevSchemaJoint){let nodeIndex=prevSchemaJoint.node,node$1=threeNodes[nodeIndex],childIndex=schemaJoint.node,child=threeNodes[childIndex],setting={hitRadius:prevSchemaJoint.hitRadius,dragForce:prevSchemaJoint.dragForce,gravityPower:prevSchemaJoint.gravityPower,stiffness:prevSchemaJoint.stiffness,gravityDir:prevSchemaJoint.gravityDir==null?void 0:new Vector3().fromArray(prevSchemaJoint.gravityDir)},joint=this._importJoint(node$1,child,setting,colliderGroupsForSpring);center&&(joint.center=center),manager.addJoint(joint)}prevSchemaJoint=schemaJoint})}),manager.setInitState(),manager})}_v0Import(gltf){return __async7(this,null,function*(){var _a$2,_b,_c;let json=gltf.parser.json,isVRMUsed=(_a$2=json.extensionsUsed)?.indexOf(`VRM`)!==-1;if(!isVRMUsed)return null;let extension$1=(_b=json.extensions)?.VRM,schemaSecondaryAnimation=extension$1?.secondaryAnimation;if(!schemaSecondaryAnimation)return null;let schemaBoneGroups=schemaSecondaryAnimation?.boneGroups;if(!schemaBoneGroups)return null;let manager=new VRMSpringBoneManager,threeNodes=yield gltf.parser.getDependencies(`node`),colliderGroups=(_c=schemaSecondaryAnimation.colliderGroups)?.map(schemaColliderGroup=>{var _a2;let node$1=threeNodes[schemaColliderGroup.node],colliders=((_a2=schemaColliderGroup.colliders)??[]).map((schemaCollider,iCollider)=>{var _a3,_b2,_c2;let offset=new Vector3(0,0,0);return schemaCollider.offset&&offset.set((_a3=schemaCollider.offset.x)??0,(_b2=schemaCollider.offset.y)??0,schemaCollider.offset.z?-schemaCollider.offset.z:0),this._importSphereCollider(node$1,{offset,radius:(_c2=schemaCollider.radius)??0,inside:!1})});return{colliders}});return schemaBoneGroups?.forEach((schemaBoneGroup,iBoneGroup)=>{let rootIndices=schemaBoneGroup.bones;rootIndices&&rootIndices.forEach(rootIndex=>{var _a2,_b2,_c2,_d;let root$2=threeNodes[rootIndex],gravityDir=new Vector3;schemaBoneGroup.gravityDir?gravityDir.set((_a2=schemaBoneGroup.gravityDir.x)??0,(_b2=schemaBoneGroup.gravityDir.y)??0,(_c2=schemaBoneGroup.gravityDir.z)??0):gravityDir.set(0,-1,0);let center=schemaBoneGroup.center==null?void 0:threeNodes[schemaBoneGroup.center],setting={hitRadius:schemaBoneGroup.hitRadius,dragForce:schemaBoneGroup.dragForce,gravityPower:schemaBoneGroup.gravityPower,stiffness:schemaBoneGroup.stiffiness,gravityDir},colliderGroupsForSpring=(_d=schemaBoneGroup.colliderGroups)?.map(iColliderGroup=>{let group=colliderGroups?.[iColliderGroup];if(group==null)throw Error(`VRMSpringBoneLoaderPlugin: The spring #${iBoneGroup} attempted to use a colliderGroup ${iColliderGroup} but not found`);return group});root$2.traverse(node$1=>{var _a3;let child=(_a3=node$1.children[0])??null,joint=this._importJoint(node$1,child,setting,colliderGroupsForSpring);center&&(joint.center=center),manager.addJoint(joint)})})}),gltf.scene.updateMatrixWorld(),manager.setInitState(),manager})}_importJoint(node$1,child,setting,colliderGroupsForSpring){let springBone=new VRMSpringBoneJoint(node$1,child,setting,colliderGroupsForSpring);if(this.jointHelperRoot){let helper=new VRMSpringBoneJointHelper(springBone);this.jointHelperRoot.add(helper),helper.renderOrder=this.jointHelperRoot.renderOrder}return springBone}_importSphereCollider(destination,params){let shape=new VRMSpringBoneColliderShapeSphere(params),collider=new VRMSpringBoneCollider(shape);if(destination.add(collider),this.colliderHelperRoot){let helper=new VRMSpringBoneColliderHelper(collider);this.colliderHelperRoot.add(helper),helper.renderOrder=this.colliderHelperRoot.renderOrder}return collider}_importCapsuleCollider(destination,params){let shape=new VRMSpringBoneColliderShapeCapsule(params),collider=new VRMSpringBoneCollider(shape);if(destination.add(collider),this.colliderHelperRoot){let helper=new VRMSpringBoneColliderHelper(collider);this.colliderHelperRoot.add(helper),helper.renderOrder=this.colliderHelperRoot.renderOrder}return collider}_importPlaneCollider(destination,params){let shape=new VRMSpringBoneColliderShapePlane(params),collider=new VRMSpringBoneCollider(shape);if(destination.add(collider),this.colliderHelperRoot){let helper=new VRMSpringBoneColliderHelper(collider);this.colliderHelperRoot.add(helper),helper.renderOrder=this.colliderHelperRoot.renderOrder}return collider}};_VRMSpringBoneLoaderPlugin.EXTENSION_NAME=`VRMC_springBone`;var VRMSpringBoneLoaderPlugin=_VRMSpringBoneLoaderPlugin,VRMLoaderPlugin=class{get name(){return`VRMLoaderPlugin`}constructor(parser,options){var _a$2,_b,_c,_d,_e,_f,_g,_h,_i,_j;this.parser=parser;let helperRoot=options?.helperRoot,autoUpdateHumanBones=options?.autoUpdateHumanBones;this.expressionPlugin=(_a$2=options?.expressionPlugin)??new VRMExpressionLoaderPlugin(parser),this.firstPersonPlugin=(_b=options?.firstPersonPlugin)??new VRMFirstPersonLoaderPlugin(parser),this.humanoidPlugin=(_c=options?.humanoidPlugin)??new VRMHumanoidLoaderPlugin(parser,{helperRoot,autoUpdateHumanBones}),this.lookAtPlugin=(_d=options?.lookAtPlugin)??new VRMLookAtLoaderPlugin(parser,{helperRoot}),this.metaPlugin=(_e=options?.metaPlugin)??new VRMMetaLoaderPlugin(parser),this.mtoonMaterialPlugin=(_f=options?.mtoonMaterialPlugin)??new MToonMaterialLoaderPlugin(parser),this.materialsHDREmissiveMultiplierPlugin=(_g=options?.materialsHDREmissiveMultiplierPlugin)??new VRMMaterialsHDREmissiveMultiplierLoaderPlugin(parser),this.materialsV0CompatPlugin=(_h=options?.materialsV0CompatPlugin)??new VRMMaterialsV0CompatPlugin(parser),this.springBonePlugin=(_i=options?.springBonePlugin)??new VRMSpringBoneLoaderPlugin(parser,{colliderHelperRoot:helperRoot,jointHelperRoot:helperRoot}),this.nodeConstraintPlugin=(_j=options?.nodeConstraintPlugin)??new VRMNodeConstraintLoaderPlugin(parser,{helperRoot})}beforeRoot(){return __async(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(meshIndex){return __async(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(meshIndex)})}getMaterialType(materialIndex){let mtoonType=this.mtoonMaterialPlugin.getMaterialType(materialIndex);return mtoonType??null}extendMaterialParams(materialIndex,materialParams){return __async(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(materialIndex,materialParams),yield this.mtoonMaterialPlugin.extendMaterialParams(materialIndex,materialParams)})}afterRoot(gltf){return __async(this,null,function*(){yield this.metaPlugin.afterRoot(gltf),yield this.humanoidPlugin.afterRoot(gltf),yield this.expressionPlugin.afterRoot(gltf),yield this.lookAtPlugin.afterRoot(gltf),yield this.firstPersonPlugin.afterRoot(gltf),yield this.springBonePlugin.afterRoot(gltf),yield this.nodeConstraintPlugin.afterRoot(gltf),yield this.mtoonMaterialPlugin.afterRoot(gltf);let meta=gltf.userData.vrmMeta,humanoid=gltf.userData.vrmHumanoid;if(meta&&humanoid){let vrm=new VRM({scene:gltf.scene,expressionManager:gltf.userData.vrmExpressionManager,firstPerson:gltf.userData.vrmFirstPerson,humanoid,lookAt:gltf.userData.vrmLookAt,meta,materials:gltf.userData.vrmMToonMaterials,springBoneManager:gltf.userData.vrmSpringBoneManager,nodeConstraintManager:gltf.userData.vrmNodeConstraintManager});gltf.userData.vrm=vrm}})}};function collectMeshes(scene){let meshes=new Set;return scene.traverse(obj=>{if(!obj.isMesh)return;let mesh=obj;meshes.add(mesh)}),meshes}function combineMorph(positionAttributes,binds,morphTargetsRelative){if(binds.size===1){let bind=binds.values().next().value;if(bind.weight===1)return positionAttributes[bind.index]}let newArray=new Float32Array(positionAttributes[0].count*3),weightSum=0;if(morphTargetsRelative)weightSum=1;else for(let bind of binds)weightSum+=bind.weight;for(let bind of binds){let src=positionAttributes[bind.index],weight=bind.weight/weightSum;for(let i=0;iboneDispatcher.getOrCreate(bone)).join(`,`),key$1=`${skinIndexKey};${skeletonKey};${bonesKey}`,newSkinIndexAttr=cache.get(key$1);newSkinIndexAttr??(newSkinIndexAttr=skinIndexAttr.clone(),remapSkinIndexAttribute(newSkinIndexAttr,bones,newBones),cache.set(key$1,newSkinIndexAttr)),mesh.geometry.setAttribute(`skinIndex`,newSkinIndexAttr)}for(let mesh of meshes)mesh.bind(newSkeleton,new Matrix4)}}function collectSkinnedMeshes(scene){let skinnedMeshes=new Set;return scene.traverse(obj=>{if(!obj.isSkinnedMesh)return;let skinnedMesh=obj;skinnedMeshes.add(skinnedMesh)}),skinnedMeshes}function listUsedIndices(skinIndexAttr,skinWeightAttr){let usedIndices=new Set;for(let i=0;itolerance)return!1}return!0}var ObjectIndexDispatcher=class{constructor(){this._objectIndexMap=new Map,this._index=0}get(obj){return this._objectIndexMap.get(obj)}getOrCreate(obj){let index$1=this._objectIndexMap.get(obj);return index$1??(index$1=this._index,this._objectIndexMap.set(obj,index$1),this._index++),index$1}};function shallowCloneBufferGeometry(geometry){var _a$2,_b,_c,_d;let clone=new BufferGeometry;clone.name=geometry.name,clone.setIndex(geometry.index);for(let[name$1,attribute]of Object.entries(geometry.attributes))clone.setAttribute(name$1,attribute);for(let[key$1,morphAttributes]of Object.entries(geometry.morphAttributes)){let attributeName=key$1;clone.morphAttributes[attributeName]=morphAttributes.concat()}clone.morphTargetsRelative=geometry.morphTargetsRelative,clone.groups=[];for(let group of geometry.groups)clone.addGroup(group.start,group.count,group.materialIndex);return clone.boundingSphere=(_b=(_a$2=geometry.boundingSphere)?.clone())??null,clone.boundingBox=(_d=(_c=geometry.boundingBox)?.clone())??null,clone.drawRange.start=geometry.drawRange.start,clone.drawRange.count=geometry.drawRange.count,clone.userData=geometry.userData,clone}function disposeMaterial(material){if(Object.values(material).forEach(value=>{if(value?.isTexture){let texture=value;texture.dispose()}}),material.isShaderMaterial){let uniforms=material.uniforms;uniforms&&Object.values(uniforms).forEach(uniform=>{let value=uniform.value;if(value?.isTexture){let texture=value;texture.dispose()}})}material.dispose()}function dispose(object3D){let geometry=object3D.geometry;geometry&&geometry.dispose();let skeleton=object3D.skeleton;skeleton&&skeleton.dispose();let material=object3D.material;material&&(Array.isArray(material)?material.forEach(material2=>disposeMaterial(material2)):material&&disposeMaterial(material))}function deepDispose(object3D){object3D.traverse(dispose)}function removeUnnecessaryJoints(root$2,options){var _a$2,_b;console.warn(`VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.`);let experimentalSameBoneCounts=(_a$2=options?.experimentalSameBoneCounts)??!1,skinnedMeshes=[];root$2.traverse(obj=>{obj.type===`SkinnedMesh`&&skinnedMeshes.push(obj)});let attributeToBoneIndexMapMap=new Map,maxBones=0;for(let mesh of skinnedMeshes){let geometry=mesh.geometry,attribute=geometry.getAttribute(`skinIndex`);if(attributeToBoneIndexMapMap.has(attribute))continue;let oldToNew=new Map,newToOld=new Map;for(let i=0;i{var _a$2,_b,_c,_d;if(!obj.isMesh)return;let mesh=obj,geometry=mesh.geometry,originalIndex=geometry.index;if(originalIndex==null)return;let newGeometryAlreadyExisted=geometryMap.get(geometry);if(newGeometryAlreadyExisted!=null){mesh.geometry=newGeometryAlreadyExisted;return}let vertexCount=Object.values(geometry.attributes)[0].count,vertexInUse=Array(vertexCount),verticesUsed=0,originalIndexArray=originalIndex.array;for(let i=0;i{newGeometry.addGroup(group.start,group.count,group.materialIndex)}),newGeometry.boundingBox=(_b=(_a$2=geometry.boundingBox)?.clone())??null,newGeometry.boundingSphere=(_d=(_c=geometry.boundingSphere)?.clone())??null,newGeometry.setDrawRange(geometry.drawRange.start,geometry.drawRange.count),newGeometry.userData=geometry.userData,geometryMap.set(geometry,newGeometry);{let originalIndexArray2=originalIndex.array,newIndexArray=new originalIndexArray2.constructor(originalIndexArray2.length);for(let i=0;i{let originalAttribute=geometry.attributes[attributeName];if(originalAttribute.isInterleavedBufferAttribute)throw Error(`removeUnnecessaryVertices: InterleavedBufferAttribute is not supported`);let originalAttributeArray=originalAttribute.array,{itemSize,normalized}=originalAttribute,newAttributeArray=new originalAttributeArray.constructor(newIndexOriginalIndexMap.length*itemSize);newIndexOriginalIndexMap.forEach((originalIndex2,i)=>{for(let j=0;j{for(let j=0;jv===0),newGeometry.morphAttributes[attributeName][iMorph]=new BufferAttribute(newAttributeArray,itemSize,normalized)}}isNullMorph&&(newGeometry.morphAttributes={}),mesh.geometry=newGeometry}),Array.from(geometryMap.keys()).forEach(originalGeometry=>{originalGeometry.dispose()})}function rotateVRM0(vrm){var _a$2;(_a$2=vrm.meta)?.metaVersion===`0`&&(vrm.scene.rotation.y=Math.PI)}var VRMUtils=class{constructor(){}};VRMUtils.combineMorphs=combineMorphs,VRMUtils.combineSkeletons=combineSkeletons,VRMUtils.deepDispose=deepDispose,VRMUtils.removeUnnecessaryJoints=removeUnnecessaryJoints,VRMUtils.removeUnnecessaryVertices=removeUnnecessaryVertices,VRMUtils.rotateVRM0=rotateVRM0; +/*! +* @pixiv/three-vrm-core v3.4.1 +* The implementation of core features of VRM, for @pixiv/three-vrm +* +* Copyright (c) 2019-2025 pixiv Inc. +* @pixiv/three-vrm-core is distributed under MIT License +* https://github.com/pixiv/three-vrm/blob/release/LICENSE +*/ +/*! +* @pixiv/three-vrm-materials-mtoon v3.4.1 +* MToon (toon material) module for @pixiv/three-vrm +* +* Copyright (c) 2019-2025 pixiv Inc. +* @pixiv/three-vrm-materials-mtoon is distributed under MIT License +* https://github.com/pixiv/three-vrm/blob/release/LICENSE +*/ +/*! +* @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.4.1 +* Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm +* +* Copyright (c) 2019-2025 pixiv Inc. +* @pixiv/three-vrm-materials-hdr-emissive-multiplier is distributed under MIT License +* https://github.com/pixiv/three-vrm/blob/release/LICENSE +*/ +/*! +* @pixiv/three-vrm-materials-v0compat v3.4.1 +* VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm +* +* Copyright (c) 2019-2025 pixiv Inc. +* @pixiv/three-vrm-materials-v0compat is distributed under MIT License +* https://github.com/pixiv/three-vrm/blob/release/LICENSE +*/ +/*! +* @pixiv/three-vrm-node-constraint v3.4.1 +* Node constraint module for @pixiv/three-vrm +* +* Copyright (c) 2019-2025 pixiv Inc. +* @pixiv/three-vrm-node-constraint is distributed under MIT License +* https://github.com/pixiv/three-vrm/blob/release/LICENSE +*/ +/*! +* @pixiv/three-vrm-springbone v3.4.1 +* Spring bone module for @pixiv/three-vrm +* +* Copyright (c) 2019-2025 pixiv Inc. +* @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 diff --git a/assets/consciousness-BhjlN9bE.js b/assets/consciousness-BhjlN9bE.js new file mode 100644 index 0000000000000000000000000000000000000000..f7f3c3943f0a211513375f06e1d01459e8ff7282 --- /dev/null +++ b/assets/consciousness-BhjlN9bE.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useConsciousnessStore as oe,useProvidersStore as se}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import{RadioCardManySelect_default as ce,RadioCardSimple_default as le}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as m}from"./route-block-DNPbw0zT.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/consciousness-CXvMPML1.js b/assets/consciousness-CXvMPML1.js deleted file mode 100644 index aa8673ff164c8a88d2d0c25942f065a235ae4f42..0000000000000000000000000000000000000000 --- a/assets/consciousness-CXvMPML1.js +++ /dev/null @@ -1 +0,0 @@ -import{d as L,a0 as f,$ as R,T as U,c2 as z,c as r,o as l,a as s,bh as k,W as y,Y as i,u as e,c3 as M,c4 as B,b as D,bg as q,b$ as E,bf as w,bE as u,ca as T}from"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as j}from"./consciousness-CZ80YtY5.js";import{u as F}from"./providers-DepZj6_J.js";import{R as Q,a as $}from"./RadioCardSimple-B9zVtorf.js";import{b as V}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const A={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},I={flex:"~ col gap-4"},W={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},Y={text:"neutral-400 dark:neutral-400"},G={"max-w-full":""},H={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},J={key:1},K={key:0},O={flex:"~ col gap-4"},X={class:"text-lg md:text-2xl"},Z={text:"neutral-400 dark:neutral-400"},ee={key:0,class:"flex items-center justify-center py-4"},se={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"},te={class:"flex flex-col"},oe={class:"font-medium"},ie={class:"text-sm text-red-600 dark:text-red-400"},ne={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"},le={class:"flex flex-col"},re={class:"font-medium"},de={class:"text-sm text-amber-600 dark:text-amber-400"},ae={key:1},ce={flex:"~ col gap-4"},ue={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},pe={text:"neutral-400 dark:neutral-500"},me={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"},xe={class:"flex flex-col"},ge={class:"font-medium"},ve={class:"text-sm text-primary-600 dark:text-primary-400"},_e={class:"mt-2"},he={class:"mb-1 block text-sm font-medium"},be=["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":""},ke=L({__name:"consciousness",setup(ye){const C=F(),x=j(),{configuredChatProvidersMetadata:g}=f(C),{activeProvider:a,activeModel:d,customModelName:S,modelSearchQuery:c,supportsModelListing:v,providerModels:p,isLoadingActiveProviderModels:_,activeProviderModelError:h}=f(x),{t}=R();U(async()=>{await x.loadModelsForProvider(a.value)});function N(b){S.value=b}return(b,o)=>{const P=z("motion");return l(),r(M,null,[s("div",A,[s("div",null,[s("div",I,[s("div",null,[s("h2",W,i(e(t)("settings.pages.providers.title")),1),s("div",Y,[s("span",null,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),s("div",G,[e(g).length>0?(l(),r("fieldset",H,[(l(!0),r(M,null,B(e(g),n=>(l(),w(e($),{id:n.id,key:n.id,modelValue:e(a),"onUpdate:modelValue":o[0]||(o[0]=m=>u(a)?a.value=m:null),name:"provider",value:n.id,title:n.localizedName||"Unknown",description:n.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(l(),r("div",J,[D(e(E),{class:"flex items-center gap-3 rounded-lg p-4",border:"2 dashed neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-800",transition:"colors duration-200 ease-in-out",to:"/settings/providers"},{default:q(()=>o[4]||(o[4]=[s("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),s("div",{class:"flex flex-col"},[s("span",{class:"font-medium"},"No Providers Configured"),s("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your LLM providers")],-1),s("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1,__:[4]})]))])])]),e(a)&&e(v)?(l(),r("div",K,[s("div",O,[s("div",null,[s("h2",X,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),s("div",Z,[s("span",null,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e(_)?(l(),r("div",ee,[o[5]||(o[5]=s("div",{class:"mr-2 animate-spin"},[s("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),s("span",null,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):e(h)?(l(),r("div",se,[o[6]||(o[6]=s("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),s("div",te,[s("span",oe,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),s("span",ie,i(e(h)),1)])])):e(p).length===0&&!e(_)?(l(),r("div",ne,[o[7]||(o[7]=s("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),s("div",le,[s("span",re,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),s("span",de,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):e(p).length>0?(l(),w(e(Q),{key:3,modelValue:e(d),"onUpdate:modelValue":o[1]||(o[1]=n=>u(d)?d.value=n:null),"search-query":e(c),"onUpdate:searchQuery":o[2]||(o[2]=n=>u(c)?c.value=n:null),items:e(p).sort((n,m)=>n.id===e(d)?-1:m.id===e(d)?1:0),searchable:!0,"search-placeholder":e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:e(c)}),"search-results-text":e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":N},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):y("",!0)])])):e(a)&&!e(v)?(l(),r("div",ae,[s("div",ce,[s("div",null,[s("h2",ue,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),s("div",pe,[s("span",null,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s("div",me,[o[8]||(o[8]=s("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-primary-500 dark:text-primary-400"},null,-1)),s("div",xe,[s("span",ge,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),s("span",ve,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),s("div",_e,[s("label",he,i(e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),k(s("input",{"onUpdate:modelValue":o[3]||(o[3]=n=>u(d)?d.value=n: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:e(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,be),[[T,e(d)]])])])])):y("",!0)]),k((l(),r("div",fe,o[9]||(o[9]=[s("div",{text:"60","i-solar:ghost-bold-duotone":""},null,-1)]))),[[P]])],64)}}});typeof V=="function"&&V(ke);export{ke as default}; diff --git a/assets/consciousness-CZ80YtY5.js b/assets/consciousness-CZ80YtY5.js deleted file mode 100644 index bfa7971de8bda281704972176d993852160331d0..0000000000000000000000000000000000000000 --- a/assets/consciousness-CZ80YtY5.js +++ /dev/null @@ -1 +0,0 @@ -import{a4 as P,c9 as n,e as f,f as r,w as L}from"./index-D7HCX4VR.js";import{u as S}from"./providers-DepZj6_J.js";const C=P("consciousness",()=>{const o=S(),s=n("settings/consciousness/active-provider",""),c=n("settings/consciousness/active-model",""),d=n("settings/consciousness/active-custom-model",""),u=f({}),i=f(""),p=r(()=>{var e;return((e=o.getProviderMetadata(s.value))==null?void 0:e.capabilities.listModels)!==void 0}),l=r(()=>o.getModelsForProvider(s.value)),g=r(()=>o.isLoadingModels[s.value]||!1),m=r(()=>o.modelLoadError[s.value]||null),h=r(()=>{if(!i.value.trim())return l.value;const e=i.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 v(){c.value="",d.value="",u.value={},i.value=""}async function M(e){var t;e&&((t=o.getProviderMetadata(s.value))==null?void 0:t.capabilities.listModels)!==void 0&&o.getModelsForProvider(e).length===0&&await o.fetchModelsForProvider(e)}let a;return L(s,async e=>{await M(e),v(),e==="player2-api"?a=setInterval(()=>{console.log("Sending Player2 Health check if it is being used"),fetch("http://localhost:4315/v1/health").catch(()=>{})},6e4):(a&&clearInterval(a),a=void 0)}),{activeProvider:s,activeModel:c,customModelName:d,expandedDescriptions:u,modelSearchQuery:i,supportsModelListing:p,providerModels:l,isLoadingActiveProviderModels:g,activeProviderModelError:m,filteredModels:h,resetModelSelection:v,loadModelsForProvider:M}});export{C as u}; diff --git a/assets/core-BgPB2AlI.js b/assets/core-BgPB2AlI.js new file mode 100644 index 0000000000000000000000000000000000000000..7662434c98b1a4b22c95f4e974b0f41ad5ebf1b0 --- /dev/null +++ b/assets/core-BgPB2AlI.js @@ -0,0 +1,3 @@ +function e(e,t,n){function r(n,r){var i;for(let a in Object.defineProperty(n,`_zod`,{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),o.prototype)a in n||Object.defineProperty(n,a,{value:o.prototype[a].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>{var r;return n?.Parent&&t instanceof n.Parent?!0:t==null||(r=t._zod)==null||(r=r.traits)==null?void 0:r.has(e)}}),Object.defineProperty(o,`name`,{value:e}),o}const t=Symbol(`zod_brand`);var n=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const r={};function i(e){return e&&Object.assign(r,e),r}function a(e){let t=Object.values(e).filter(e=>typeof e==`number`),n=Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t);return n}function o(e,t){return typeof t==`bigint`?t.toString():t}function s(e){let t=!1;return{get value(){if(!t){let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}const c=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{},l=s(()=>{var e;if(typeof navigator<`u`&&!((e=navigator)==null||(e=e.userAgent)==null)&&e.includes(`Cloudflare`))return!1;try{let e=Function;return new e(``),!0}catch{return!1}}),u={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function d(e){return typeof e==`string`?e:e?.message}function f(e,t,n){let r={...e,path:e.path??[]};if(!e.message){var i,a,o,s,c;let l=d((i=e.inst)==null||(i=i._zod.def)==null||(a=i.error)==null?void 0:a.call(i,e))??d(t==null||(o=t.error)==null?void 0:o.call(t,e))??d((s=n.customError)?.call(n,e))??d((c=n.localeError)?.call(n,e))??`Invalid input`;r.message=l}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}const p=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),Object.defineProperty(e,`message`,{get(){return JSON.stringify(t,o,2)},enumerable:!0})},m=e(`$ZodError`,p),h=e(`$ZodError`,p,{Parent:Error}),g=e=>(t,r,a,o)=>{let s=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:r,issues:[]},s);if(l instanceof Promise)throw new n;if(l.issues.length){let t=new(o?.Err??e)(l.issues.map(e=>f(e,s,i())));throw c(t,o?.callee),t}return l.value},_=g(h),v=e=>async(t,n,r,a)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>f(e,o,i())));throw c(t,a?.callee),t}return s.value},y=v(h),b=e=>(t,r,a)=>{let o=a?{...a,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new n;return s.issues.length?{success:!1,error:new(e??m)(s.issues.map(e=>f(e,o,i())))}:{success:!0,data:s.value}},x=b(h),S=e=>async(t,n,r)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>f(e,a,i())))}:{success:!0,data:o.value}},C=S(h),w=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,T=RegExp(`^${w}$`),E=Symbol(`ZodOutput`),D=Symbol(`ZodInput`);var O=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function k(){return new O}const A=k();var j=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??A,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n,r,i;let o=e._zod.def,s={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},c=this.seen.get(e);if(c){c.count++;let n=t.schemaPath.includes(e);return n&&(c.cycle=t.path),c.schema}let l={schema:{},count:1,cycle:void 0};this.seen.set(e,l);let u=(n=(r=e._zod).toJSONSchema)?.call(r);if(u)l.schema=u;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},r=e._zod.parent;if(r)l.ref=r,this.process(r,n),this.seen.get(r).isParent=!0;else{let t=l.schema;switch(o.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:i,format:a,patterns:o,contentEncoding:c}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof i==`number`&&(n.maxLength=i),a&&(n.format=s[a]??a,n.format===``&&delete n.format),c&&(n.contentEncoding=c),o&&o.size>0){let e=[...o];e.length===1?n.pattern=e[0].source:e.length>1&&(l.schema.allOf=[...e.map(e=>({...this.target===`draft-7`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;typeof a==`string`&&a.includes(`int`)?n.type=`integer`:n.type=`number`,typeof c==`number`&&(n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`undefined`:{let e=t;e.type=`null`;break}case`null`:t.type=`null`;break;case`any`:break;case`unknown`:break;case`never`:t.not={};break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let r=t,{minimum:i,maximum:a}=e._zod.bag;typeof i==`number`&&(r.minItems=i),typeof a==`number`&&(r.maxItems=a),r.type=`array`,r.items=this.process(o.element,{...n,path:[...n.path,`items`]});break}case`object`:{var d;let e=t;e.type=`object`,e.properties={};let r=o.shape;for(let t in r)e.properties[t]=this.process(r[t],{...n,path:[...n.path,`properties`,t]});let i=new Set(Object.keys(r)),a=new Set([...i].filter(e=>{let t=o.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));a.size>0&&(e.required=Array.from(a)),(d=o.catchall)?._zod.def.type===`never`?e.additionalProperties=!1:o.catchall?o.catchall&&(e.additionalProperties=this.process(o.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t;e.anyOf=o.options.map((e,t)=>this.process(e,{...n,path:[...n.path,`anyOf`,t]}));break}case`intersection`:{let e=t,r=this.process(o.left,{...n,path:[...n.path,`allOf`,0]}),i=this.process(o.right,{...n,path:[...n.path,`allOf`,1]}),a=e=>`allOf`in e&&Object.keys(e).length===1,s=[...a(r)?r.allOf:[r],...a(i)?i.allOf:[i]];e.allOf=s;break}case`tuple`:{let r=t;r.type=`array`;let i=o.items.map((e,t)=>this.process(e,{...n,path:[...n.path,`prefixItems`,t]}));if(this.target===`draft-2020-12`?r.prefixItems=i:r.items=i,o.rest){let e=this.process(o.rest,{...n,path:[...n.path,`items`]});this.target===`draft-2020-12`?r.items=e:r.additionalItems=e}o.rest&&(r.items=this.process(o.rest,{...n,path:[...n.path,`items`]}));let{minimum:a,maximum:s}=e._zod.bag;typeof a==`number`&&(r.minItems=a),typeof s==`number`&&(r.maxItems=s);break}case`record`:{let e=t;e.type=`object`,e.propertyNames=this.process(o.keyType,{...n,path:[...n.path,`propertyNames`]}),e.additionalProperties=this.process(o.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=a(o.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of o.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0)if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n;break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>{let t={...r,contentMediaType:e};return t}):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:{let e=this.process(o.innerType,n);t.anyOf=[e,{type:`null`}];break}case`nonoptional`:this.process(o.innerType,n),l.ref=o.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(o.innerType,n),l.ref=o.innerType,t.default=JSON.parse(JSON.stringify(o.defaultValue));break;case`prefault`:this.process(o.innerType,n),l.ref=o.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break;case`catch`:{this.process(o.innerType,n),l.ref=o.innerType;let e;try{e=o.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?o.in._zod.def.type===`transform`?o.out:o.in:o.out;this.process(e,n),l.ref=e;break}case`readonly`:this.process(o.innerType,n),l.ref=o.innerType,t.readOnly=!0;break;case`promise`:this.process(o.innerType,n),l.ref=o.innerType;break;case`optional`:this.process(o.innerType,n),l.ref=o.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),l.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;default:}}}let f=this.metadataRegistry.get(e);f&&Object.assign(l.schema,f),this.io===`input`&&N(e)&&(delete l.schema.examples,delete l.schema.default),this.io===`input`&&l.schema._prefault&&((i=l.schema).default??(i.default=l.schema._prefault)),delete l.schema._prefault;let p=this.seen.get(e);return p.schema}emit(e,t){var n;let r={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},i=this.seen.get(e);if(!i)throw Error(`Unprocessed schema. This is a bug in Zod.`);let a=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(r.external){var n;let i=(n=r.external.registry.get(e[0]))?.id;if(i)return{ref:r.external.uri(i)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${r.external.uri(`__shared`)}#/${t}/${a}`}}if(e[1]===i)return{ref:`#`};let a=`#`,o=`${a}/${t}/`,s=e[1].schema.id??`__schema${this.counter++}`;return{defId:s,ref:o+s}},o=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=a(e);t.def={...t.schema},r&&(t.defId=r);let i=t.schema;for(let e in i)delete i[e];i.$ref=n};for(let t of this.seen.entries()){var s;let n=t[1];if(e===t[0]){o(t);continue}if(r.external){var c;let n=(c=r.external.registry.get(t[0]))?.id;if(e!==t[0]&&n){o(t);continue}}let i=(s=this.metadataRegistry.get(t[0]))?.id;if(i){o(t);continue}if(n.cycle){var l;if(r.cycles===`throw`)throw Error(`Cycle detected: #/${(l=n.cycle)?.join(`/`)}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);r.cycles===`ref`&&o(t);continue}if(n.count>1&&r.reused===`ref`){o(t);continue}}let u=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){u(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r})};for(let e of[...this.seen.entries()].reverse())u(e[0],{target:this.target});let d={};this.target===`draft-2020-12`?d.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?d.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),Object.assign(d,i.def);let f=(n=r.external)?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(f[t.defId]=t.def)}!r.external&&Object.keys(f).length>0&&(this.target===`draft-2020-12`?d.$defs=f:d.definitions=f);try{return JSON.parse(JSON.stringify(d))}catch{throw Error(`Error converting schema to JSON.`)}}};function M(e,t){if(e instanceof O){let n=new j(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri||(e=>e),defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}if(Object.keys(r).length>0){let e=n.target===`draft-2020-12`?`$defs`:`definitions`;i.__shared={[e]:r}}return{schemas:i}}let n=new j(t);return n.process(e),n.emit(e,t)}function N(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e,i=r._zod.def;switch(i.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return N(i.element,n);case`object`:for(let e in i.shape)if(N(i.shape[e],n))return!0;return!1;case`union`:for(let e of i.options)if(N(e,n))return!0;return!1;case`intersection`:return N(i.left,n)||N(i.right,n);case`tuple`:for(let e of i.items)if(N(e,n))return!0;return!!(i.rest&&N(i.rest,n));case`record`:return N(i.keyType,n)||N(i.valueType,n);case`map`:return N(i.keyType,n)||N(i.valueType,n);case`set`:return N(i.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return N(i.innerType,n);case`lazy`:return N(i.getter(),n);case`default`:return N(i.innerType,n);case`prefault`:return N(i.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return N(i.in,n)||N(i.out,n);case`success`:return!1;case`catch`:return!1;default:}throw Error(`Unknown schema type: ${i.type}`)}export{M as toJSONSchema}; \ No newline at end of file diff --git a/assets/deepseek-BnTqc4-0.js b/assets/deepseek-BnTqc4-0.js deleted file mode 100644 index 632eb58844306f3efd2c2f0fcb9c864534ba2cf8..0000000000000000000000000000000000000000 --- a/assets/deepseek-BnTqc4-0.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as V,$ as U,V as $,a0 as y,f as c,T as K,w as h,bf as w,o as x,bg as m,b as l,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{_ as C}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as P}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const o="deepseek",B=V({__name:"deepseek",setup(I){const{t:u}=U(),b=$(),d=z(),{providers:a}=y(d),n=c(()=>d.getProviderMetadata(o)),i=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),s=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});K(()=>{var e,r;d.initializeProvider(o),i.value=((e=a.value[o])==null?void 0:e.apiKey)||"",s.value=((r=a.value[o])==null?void 0:r.baseUrl)||""}),h([i,s],()=>{a.value[o]={...a.value[o],apiKey:i.value,baseUrl:s.value||""}});function g(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:m(()=>[l(t(R),null,{default:m(()=>[l(t(P),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(M),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=k=>i.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/deepseek-zvlAqj6K.js b/assets/deepseek-zvlAqj6K.js new file mode 100644 index 0000000000000000000000000000000000000000..8647da9c5b3f3e75da823fa347d8f822a9c4bb07 --- /dev/null +++ b/assets/deepseek-zvlAqj6K.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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-DlKZnvUP.js b/assets/default-DlKZnvUP.js deleted file mode 100644 index 32eda4e107c1955040aef11a9960d972d1f1864f..0000000000000000000000000000000000000000 --- a/assets/default-DlKZnvUP.js +++ /dev/null @@ -1 +0,0 @@ -import{d as t,c as s,a as e,b as a,u as o,R as n,o as p}from"./index-D7HCX4VR.js";import{H as d}from"./HeaderLink-BKV8TZb8.js";const r={style:{paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingTop:"env(safe-area-inset-top, 0px)",paddingRight:"env(safe-area-inset-right, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)"}},i={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},c={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},u=t({__name:"default",setup(m){return(f,l)=>(p(),s("div",r,[e("div",i,[a(d)]),e("div",c,[a(o(n))])]))}});export{u as default}; diff --git a/assets/default-browser-BrgSDbLD.js b/assets/default-browser-BrgSDbLD.js deleted file mode 100644 index 0f985d73699ea69b2c609d3d911e81d2e2998324..0000000000000000000000000000000000000000 --- a/assets/default-browser-BrgSDbLD.js +++ /dev/null @@ -1 +0,0 @@ -function r(){return{mvp:{mainModule:"./duckdb-mvp.wasm",mainWorker:"./duckdb-browser-mvp.worker.js"},eh:{mainModule:"./duckdb-eh.wasm",mainWorker:"./duckdb-browser-eh.worker.js"},coi:{mainModule:"./duckdb-coi.wasm",mainWorker:"./duckdb-browser-coi.worker.js",pthreadWorker:"./duckdb-browser-coi.pthread.worker.js"}}}export{r as getBundles}; diff --git a/assets/default-browser-BsGi6f5u.js b/assets/default-browser-BsGi6f5u.js new file mode 100644 index 0000000000000000000000000000000000000000..f1a33eb93862d3eef03f7bfdcd8392851d0b09a7 --- /dev/null +++ b/assets/default-browser-BsGi6f5u.js @@ -0,0 +1 @@ +function e(){return{mvp:{mainModule:`./duckdb-mvp.wasm`,mainWorker:`./duckdb-browser-mvp.worker.js`},eh:{mainModule:`./duckdb-eh.wasm`,mainWorker:`./duckdb-browser-eh.worker.js`},coi:{mainModule:`./duckdb-coi.wasm`,mainWorker:`./duckdb-browser-coi.worker.js`,pthreadWorker:`./duckdb-browser-coi.pthread.worker.js`}}}export{e as getBundles}; \ No newline at end of file diff --git a/assets/default-node-CNYmsmAm.js b/assets/default-node-CNYmsmAm.js deleted file mode 100644 index 1225cae20f7af0dba6f7a247dc20cd9fc7245ff4..0000000000000000000000000000000000000000 --- a/assets/default-node-CNYmsmAm.js +++ /dev/null @@ -1 +0,0 @@ -import{cT as t}from"./index-D7HCX4VR.js";async function s(){const{createRequire:a}=await t(async()=>{const{createRequire:o}=await import("./__vite-browser-external-FmFgRqLi.js");return{createRequire:o}},[]),{dirname:n,resolve:e}=await t(async()=>{const{dirname:o,resolve:c}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:c}},[]),d=a(import.meta.url),r=n(d.resolve("@duckdb/duckdb-wasm"));return{mvp:{mainModule:e(r,"./duckdb-mvp.wasm"),mainWorker:e(r,"./duckdb-node-mvp.worker.cjs")},eh:{mainModule:e(r,"./duckdb-eh.wasm"),mainWorker:e(r,"./duckdb-node-eh.worker.cjs")}}}export{s as getBundles}; diff --git a/assets/default-node-TdRV4SdH.js b/assets/default-node-TdRV4SdH.js new file mode 100644 index 0000000000000000000000000000000000000000..15dd0e05bcae1218af4c72a0738d7e9415e6b660 --- /dev/null +++ b/assets/default-node-TdRV4SdH.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-CIQGHXr-.js","assets/index-BtAisBe9.js","assets/index-D4gBs-70.css"])))=>i.map(i=>d[i]); +import{__toDynamicImportESM as e,__vitePreload as t}from"./index-BtAisBe9.js";async function n(){let{createRequire:n}=await t(async()=>{let{createRequire:t}=await import(`./__vite-browser-external-CIQGHXr-.js`).then(e(1));return{createRequire:t}},__vite__mapDeps([0,1,2])),{dirname:r,resolve:i}=await t(async()=>{let{dirname:t,resolve:n}=await import(`./__vite-browser-external-CIQGHXr-.js`).then(e(1));return{dirname:t,resolve:n}},__vite__mapDeps([0,1,2])),a=n(import.meta.url),o=r(a.resolve(`@duckdb/duckdb-wasm`));return{mvp:{mainModule:i(o,`./duckdb-mvp.wasm`),mainWorker:i(o,`./duckdb-node-mvp.worker.cjs`)},eh:{mainModule:i(o,`./duckdb-eh.wasm`),mainWorker:i(o,`./duckdb-node-eh.worker.cjs`)}}}export{n as getBundles}; \ No newline at end of file diff --git a/assets/default-t1McW1fh.js b/assets/default-t1McW1fh.js new file mode 100644 index 0000000000000000000000000000000000000000..c5ac412ce83b6fe8503820ef0472687cf92a542d --- /dev/null +++ b/assets/default-t1McW1fh.js @@ -0,0 +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-BtAisBe9.js";import{HeaderLink_default as s}from"./HeaderLink-zGlOe2Jb.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-Bn4Zuwfk.js b/assets/delays-Bn4Zuwfk.js new file mode 100644 index 0000000000000000000000000000000000000000..0a3bc8921ce77f528097b2961bd8ecf361d53e66 --- /dev/null +++ b/assets/delays-Bn4Zuwfk.js @@ -0,0 +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-BtAisBe9.js";import"./src-bHDRqBSs.js";import"./Basic-BA5ubWIJ.js";import{Textarea_default as u}from"./Textarea-C0dnrt_L.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import{llmInferenceEndToken as d,useDelayMessageQueue as f}from"./queues-U6a2FwNq.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/delays-C9dF-WFD.js b/assets/delays-C9dF-WFD.js deleted file mode 100644 index 9f4ab284ebce4f7684facba6648f21666076d4c3..0000000000000000000000000000000000000000 --- a/assets/delays-C9dF-WFD.js +++ /dev/null @@ -1 +0,0 @@ -import"./three-vrm.module-DiGxQJqt.js";import{b as g,l as _}from"./queues-CIntookp.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{_ as k}from"./Textarea.vue_vue_type_script_setup_true_lang-l_0OEYvy.js";import{d as b,e as r,c as n,o as t,a as e,b as y,u as x,Y as i,c3 as f,c4 as m}from"./index-D7HCX4VR.js";import"./emotions-DWNSb738.js";import"./queue-31IhYt_K.js";import"./Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},h={flex:"","flex-row":"","gap-2":""},M={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},E={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},L=b({__name:"delays",setup(B){const s=r(""),c=r([]),p=r([]),u=r(!1),d=g();d.onHandlerEvent("delay",a=>{p.value.push(a)});function v(){u.value=!0;const a=s.value.split("");for(const o of a)d.add(o);d.add(_),s.value="",u.value=!1}return(a,o)=>(t(),n("div",w,[e("div",h,[y(x(k),{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=l=>s.value=l),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",M,i(u.value?"Processing...":"Send"),1)]),e("div",V,[e("div",E,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(t(!0),n(f,null,m(c.value,l=>(t(),n("div",{key:l},[e("div",null,i(l),1)]))),128))]),e("div",S,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(t(!0),n(f,null,m(p.value,l=>(t(),n("div",{key:l},[e("div",null,i(l)+"s",1)]))),128))])])]))}});export{L as default}; diff --git a/assets/developer-C6qOrZzG.js b/assets/developer-C6qOrZzG.js new file mode 100644 index 0000000000000000000000000000000000000000..1bb9019ef157c1c1b7df7e544a10ac694b245766 --- /dev/null +++ b/assets/developer-C6qOrZzG.js @@ -0,0 +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-BtAisBe9.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as u}from"./route-block-DNPbw0zT.js";import{CheckBar_default as d}from"./CheckBar-B-SKUaUP.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/developer-Cz9wfxb0.js b/assets/developer-Cz9wfxb0.js deleted file mode 100644 index 9bb62ebec99e9cddbbade099b9fd83faa4c5ac4e..0000000000000000000000000000000000000000 --- a/assets/developer-Cz9wfxb0.js +++ /dev/null @@ -1 +0,0 @@ -import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{d as p,be as c,c2 as m,c as s,o as r,bh as a,b as l,u as i,a as f,c3 as b}from"./index-D7HCX4VR.js";import{_ as d}from"./CheckBar.vue_vue_type_script_setup_true_lang-By8B4nPO.js";import{b as u}from"./route-block-B_A1xBdJ.js";const y={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[65dvh]","right--15":"","z--1":"",initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:"","items-center":"","justify-center":""},g=p({__name:"developer",setup(v){const t=c();return(_,e)=>{const o=m("motion");return r(),s(b,null,[a(l(d,{modelValue:i(t).disableTransitions,"onUpdate:modelValue":e[0]||(e[0]=n=>i(t).disableTransitions=n),"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:250+19*10,delay:19*50,transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[o]]),a(l(d,{modelValue:i(t).usePageSpecificTransitions,"onUpdate:modelValue":e[1]||(e[1]=n=>i(t).usePageSpecificTransitions=n),disabled:i(t).disableTransitions,"icon-on":"i-solar:running-2-line-duotone","icon-off":"i-solar:people-nearby-bold-duotone",text:"settings.animations.use-page-specific-transitions.title",description:"settings.animations.use-page-specific-transitions.description",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+20*10,delay:20*50,transition:"all ease-in-out duration-250"},null,8,["modelValue","disabled"]),[[o]]),a((r(),s("div",y,e[2]||(e[2]=[f("div",{text:"60","i-solar:code-bold-duotone":""},null,-1)]))),[[o]])],64)}}});typeof u=="function"&&u(g);export{g as default}; diff --git a/assets/dist-CONIs07P.js b/assets/dist-CONIs07P.js new file mode 100644 index 0000000000000000000000000000000000000000..dd315c7fcbb65543a64d560032a798756f605a43 --- /dev/null +++ b/assets/dist-CONIs07P.js @@ -0,0 +1 @@ +function e(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function t(e,t){switch(t?.errorMode){case`ignore`:break;case`warn`:console.warn(e);break;default:throw Error(e)}}function n(e,n,r){switch(n.type){case`base64`:e.contentEncoding=`base64`;break;case`bic`:case`cuid2`:case`decimal`:case`digits`:case`emoji`:case`hexadecimal`:case`hex_color`:case`nanoid`:case`octal`:case`ulid`:e.pattern=n.requirement.source;break;case`description`:e.description=n.description;break;case`email`:e.format=`email`;break;case`empty`:e.type===`array`?e.maxItems=0:(e.type!==`string`&&t(`The "${n.type}" action is not supported on type "${e.type}".`,r),e.maxLength=0);break;case`integer`:e.type=`integer`;break;case`ipv4`:e.format=`ipv4`;break;case`ipv6`:e.format=`ipv6`;break;case`iso_date`:e.format=`date`;break;case`iso_date_time`:case`iso_timestamp`:e.format=`date-time`;break;case`iso_time`:e.format=`time`;break;case`length`:e.type===`array`?(e.minItems=n.requirement,e.maxItems=n.requirement):(e.type!==`string`&&t(`The "${n.type}" action is not supported on type "${e.type}".`,r),e.minLength=n.requirement,e.maxLength=n.requirement);break;case`max_length`:e.type===`array`?e.maxItems=n.requirement:(e.type!==`string`&&t(`The "${n.type}" action is not supported on type "${e.type}".`,r),e.maxLength=n.requirement);break;case`max_value`:e.type!==`number`&&t(`The "max_value" action is not supported on type "${e.type}".`,r),e.maximum=n.requirement;break;case`min_length`:e.type===`array`?e.minItems=n.requirement:(e.type!==`string`&&t(`The "${n.type}" action is not supported on type "${e.type}".`,r),e.minLength=n.requirement);break;case`min_value`:e.type!==`number`&&t(`The "min_value" action is not supported on type "${e.type}".`,r),e.minimum=n.requirement;break;case`multiple_of`:e.multipleOf=n.requirement;break;case`non_empty`:e.type===`array`?e.minItems=1:(e.type!==`string`&&t(`The "${n.type}" action is not supported on type "${e.type}".`,r),e.minLength=1);break;case`regex`:n.requirement.flags&&t(`RegExp flags are not supported by JSON Schema.`,r),e.pattern=n.requirement.source;break;case`title`:e.title=n.title;break;case`url`:e.format=`uri`;break;case`uuid`:e.format=`uuid`;break;case`value`:e.const=n.requirement;break;default:t(`The "${n.type}" action cannot be converted to JSON Schema.`,r)}return e}var r=0;function i(a,o,s,c){let l=c.referenceMap.get(o);if(l&&l in c.definitions)return a.$ref=`#/$defs/${l}`,a;if(`pipe`in o){for(let e=0;e0&&t(`A "pipe" with multiple schemas cannot be converted to JSON Schema.`,s);let n=i({},r,s,c);if(n.$ref){let e=n.$ref.split(`/`)[2];Object.assign(a,c.definitions[e])}else Object.assign(a,n)}else a=n(a,r,s)}return a}switch(o.type){case`boolean`:a.type=`boolean`;break;case`null`:a.type=`null`;break;case`number`:a.type=`number`;break;case`string`:a.type=`string`;break;case`array`:a.type=`array`,a.items=i({},o.item,s,c);break;case`tuple`:case`tuple_with_rest`:case`loose_tuple`:case`strict_tuple`:a.type=`array`,a.items=[];for(let e of o.items)a.items.push(i({},e,s,c));o.type===`tuple_with_rest`?a.additionalItems=i({},o.rest,s,c):a.additionalItems=o.type===`loose_tuple`;break;case`object`:case`object_with_rest`:case`loose_object`:case`strict_object`:for(let e in a.type=`object`,a.properties={},a.required=[],o.entries){let t=o.entries[e];a.properties[e]=i({},t,s,c),t.type!==`nullish`&&t.type!==`optional`&&a.required.push(e)}o.type===`object_with_rest`?a.additionalProperties=i({},o.rest,s,c):o.type===`strict_object`&&(a.additionalProperties=!1);break;case`record`:`pipe`in o.key&&t(`The "record" schema with a schema for the key that contains a "pipe" cannot be converted to JSON Schema.`,s),o.key.type!==`string`&&t(`The "record" schema with the "${o.key.type}" schema for the key cannot be converted to JSON Schema.`,s),a.type=`object`,a.additionalProperties=i({},o.value,s,c);break;case`any`:case`unknown`:break;case`nullable`:case`nullish`:a.anyOf=[i({},o.wrapped,s,c),{type:`null`}],o.default!==void 0&&(a.default=e(o));break;case`exact_optional`:case`optional`:case`undefinedable`:a=i(a,o.wrapped,s,c),o.default!==void 0&&(a.default=e(o));break;case`literal`:typeof o.literal!=`boolean`&&typeof o.literal!=`number`&&typeof o.literal!=`string`&&t(`The value of the "literal" schema is not JSON compatible.`,s),a.const=o.literal;break;case`enum`:a.enum=o.options;break;case`picklist`:o.options.some(e=>typeof e!=`number`&&typeof e!=`string`)&&t(`An option of the "picklist" schema is not JSON compatible.`,s),a.enum=o.options;break;case`union`:case`variant`:a.anyOf=o.options.map(e=>i({},e,s,c));break;case`intersect`:a.allOf=o.options.map(e=>i({},e,s,c));break;case`lazy`:{let e=c.getterMap.get(o.getter);e||(e=o.getter(void 0),c.getterMap.set(o.getter,e));let t=c.referenceMap.get(e);t||(t=`${r++}`,c.referenceMap.set(e,t),c.definitions[t]=i({},e,s,c)),a.$ref=`#/$defs/${t}`;break}default:t(`The "${o.type}" schema cannot be converted to JSON Schema.`,s)}return a}function a(e,t){let n={definitions:{},referenceMap:new Map,getterMap:new Map};if(t?.definitions){for(let e in t.definitions)n.referenceMap.set(t.definitions[e],e);for(let e in t.definitions)n.definitions[e]=i({},t.definitions[e],t,n)}let r=i({$schema:`http://json-schema.org/draft-07/schema#`},e,t,n);return n.referenceMap.size&&(r.$defs=n.definitions),r}export{a as toJsonSchema}; \ No newline at end of file diff --git a/assets/dist-DQi82Mjd.js b/assets/dist-DQi82Mjd.js new file mode 100644 index 0000000000000000000000000000000000000000..1ed21fd4029b54cf409906deb2db7c8f22b6b1ac --- /dev/null +++ b/assets/dist-DQi82Mjd.js @@ -0,0 +1,2 @@ +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=class extends Error{constructor(t,n){super(t),e.defineProperty(this,`response`,void 0),this.name=`XSAIError`,this.response=n}};const n=e=>e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`),r=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[n(e),t])),i=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),a=e=>JSON.stringify(r(i({...e,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),o=(e,t)=>i({Authorization:t===void 0?void 0:`Bearer ${t}`,...e}),s=(e,t)=>{let n=t.toString();return new URL(e,n.endsWith(`/`)?n:`${n}/`)},c=async e=>{if(!e.ok)throw new t(`Remote sent ${e.status} response: ${await e.text()}`,e);if(!e.body)throw new t(`Response body is empty from remote server`,e);if(!(e.body instanceof ReadableStream))throw new t(`Expected Response body to be a ReadableStream, but got ${String(e.body)}; Content Type is ${e.headers.get(`Content-Type`)}`,e);return e},l=async e=>c(e).then(async e=>{let t=await e.text();try{return JSON.parse(t)}catch{throw Error(`Failed to parse response, response body: ${t}`)}}),u=async e=>{var t;return(e.fetch??globalThis.fetch)(s(`chat/completions`,e.baseURL),{body:a({...e,tools:(t=e.tools)?.map(e=>({function:i({...e.function,returns:void 0}),type:`function`}))}),headers:o({"Content-Type":`application/json`,...e.headers},e.apiKey),method:`POST`,signal:e.abortSignal}).then(c)},d=({finishReason:e,maxSteps:t,stepsLength:n,toolCallsLength:r})=>{if(n===0)return`initial`;if(n0&&e===`tool_calls`)return`tool-result`;if(![`error`,`length`].includes(e))return`continue`}return`done`},f=e=>typeof e==`string`||Array.isArray(e)&&e.every(e=>!!(typeof e==`object`&&`type`in e&&[`audio`,`image`,`text`].includes(e.type)))?e:JSON.stringify(e),p=async({abortSignal:e,messages:t,toolCall:n,tools:r})=>{let i=r?.find(e=>e.function.name===n.function.name);if(!i){let e=r?.map(e=>e.function.name),t=e==null||e.length===0?`No tools are available.`:`Available tools: ${e.join(`, `)}.`;throw Error(`Model tried to call unavailable tool '${n.function.name}. ${t}.`)}let a=JSON.parse(n.function.arguments),o=f(await i.execute(a,{abortSignal:e,messages:t,toolCallId:n.id}));return{parsedArgs:a,result:o,toolName:n.function.name}};var m=class extends Error{constructor(t,n){super(t),e.defineProperty(this,`response`,void 0),this.name=`XSAIError`,this.response=n}};const h=e=>e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`),g=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[h(e),t])),_=`data:`,v=e=>{if(!e||!e.startsWith(_))return[void 0,!1];let t=e.slice(_.length),n=t.startsWith(` `)?t.slice(1):t;if(n===`[DONE]`)return[void 0,!0];if(n.startsWith(`{`)&&n.includes(`"error":`))throw Error(`Error from server: ${n}`);let r=JSON.parse(n);return[r,!1]},y=async e=>{let t,n,r,i=new ReadableStream({start(e){t=e}}),a=new ReadableStream({start(e){n=e}}),o=new ReadableStream({start(e){r=e}}),s=e.maxSteps??1,c=new TextDecoder,l=[],f=async e=>{var i,a,o,h;let _={choices:[],finishReason:`error`,messages:structuredClone(e.messages),stepType:`initial`,toolCalls:[],toolResults:[]},y={},b=``,x,S,C=!0,w=(e,t)=>{e.endedToolCallIndex.has(t)||(e.endedToolCallIndex.add(t),e.currentToolIndex=null)};if(await u({...e,maxSteps:void 0,stream:!0,streamOptions:e.streamOptions==null?void 0:g(e.streamOptions)}).then(async i=>i.body.pipeThrough(new TransformStream({transform:async(e,t)=>{let n=c.decode(e,{stream:!0});b+=n;let r=b.split(` +`);b=r.pop()??``;for(let e of r)try{let[n,r]=v(e);if(r)break;n&&t.enqueue(n)}catch(e){t.error(e)}}})).pipeTo(new WritableStream({abort:e=>{t.error(e),n.error(e),r.error(e)},close:()=>{var t;(t=e.onEvent)?.call(e,{finishReason:x,type:`finish`,usage:S})},write:async n=>{var i,a;if((i=e.onChunk)?.call(e,n),t.enqueue(n),S=n.usage,n.choices==null||n.choices.length===0)return;let o=n.choices[0];o.delta.tool_calls&&(C=!1);let{delta:s,finish_reason:c,index:l,...u}=o,d=(a=_.choices)[l]??(a[l]={finishReason:c,index:l,message:{role:`assistant`}});if(c!==void 0){if(x=c,_.finishReason=c,d.finishReason=c,c===`length`)throw new m(`length exceeded`);if(c===`content_filter`)throw new m(`content filter`)}Object.assign(d,u);let{content:f,refusal:p,tool_calls:h,...g}=s,v=d.message;if(Object.assign(v,g),p!==void 0){var b;v.refusal=(v.refusal||``)+(p||``),(b=e.onEvent)?.call(e,{refusal:v.refusal,type:`refusal`})}if(f!==void 0){var T;v.content=(v.content||``)+(f||``),C&&r?.enqueue(f),(T=e.onEvent)?.call(e,{text:f,type:`text-delta`})}for(let t of h||[]){var E,D;(E=e.onEvent)?.call(e,{toolCall:t,type:`tool-call-delta`});let{function:n,id:r,index:i,type:a}=t;v.toolCalls??={};let o=(D=v.toolCalls)[i]??(D[i]={function:{arguments:``,name:n.name,parsedArguments:{}},id:r,index:i,type:a});o.function.arguments+=n.arguments}let O=y[l]??(y[l]={calledToolCallIndex:new Set,currentToolIndex:null,endedToolCallIndex:new Set,index:l,toolCallErrors:{},toolCallResults:{}});c&&O.currentToolIndex!==null&&w(O,O.currentToolIndex);for(let e of s.tool_calls||[])O.currentToolIndex!==e.index&&O.currentToolIndex!==null&&w(O,O.currentToolIndex),O.calledToolCallIndex.add(e.index),O.currentToolIndex=e.index}}))),_.messages.push({content:(i=_.choices[0])?.message.content??``,refusal:(a=_.choices[0])?.message.refusal,role:`assistant`,tool_calls:Object.values((o=_.choices[0])?.message.toolCalls??{}).map(e=>({function:{arguments:e.function.arguments,name:e.function.name},id:e.id,index:e.index,type:e.type}))}),await Promise.allSettled(_.choices.map(async t=>{let n=y[t.index];return Promise.allSettled([...n.endedToolCallIndex].map(async r=>{var i;let a=t.message.toolCalls[r];if(_.toolCalls.push({args:a.function.arguments,toolCallId:a.id,toolCallType:`function`,toolName:a.function.name}),!n.toolCallResults[a.id]){(i=e.onEvent)?.call(e,{toolCall:a,type:`tool-call`});try{var o;let{parsedArgs:t,result:r,toolName:i}=await p({abortSignal:e.abortSignal,messages:e.messages,toolCall:a,tools:e.tools});a.function.parsedArguments=t,n.toolCallResults[a.id]=r,_.messages.push({content:r,role:`tool`,tool_call_id:a.id}),_.toolResults.push({args:t,result:r,toolCallId:a.id,toolName:i}),(o=e.onEvent)?.call(e,{id:a.id,result:r,type:`tool-call-result`})}catch(e){n.toolCallErrors[r]=e}}}))})),_.stepType=d({finishReason:_.finishReason,maxSteps:s,stepsLength:l.length,toolCallsLength:_.toolCalls.length}),l.push(_),n.enqueue(_),(h=e.onStepFinish)?.call(e,_),!C)return async()=>f({...e,messages:_.messages})},h=async()=>{var i;let a=await f(e);for(;typeof a==`function`&&l.length{t.error(e),n.error(e),r.error(e)}),Promise.resolve({chunkStream:i,stepStream:a,textStream:o})};export{r as objCamelToSnake,a as requestBody,o as requestHeaders,s as requestURL,c as responseCatch,l as responseJSON,y as streamText}; \ No newline at end of file diff --git a/assets/dist-DzeHt4xm.js b/assets/dist-DzeHt4xm.js new file mode 100644 index 0000000000000000000000000000000000000000..5a5f5385c358f05786a644bd8d1edefd882a1237 --- /dev/null +++ b/assets/dist-DzeHt4xm.js @@ -0,0 +1,16 @@ +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-BtAisBe9.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-bHDRqBSs.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===dn())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=xn(e,t),c=vn(n,r,i,a,o,s,0);return c-Math.floor(e/1e3)*1e3}const bn=new Map;function xn(e,t){let n=bn.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`}),bn.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 Sn=864e5;function Cn(e,t,n,r){let i=n===r?[n]:[n,r];return i.filter(n=>wn(e,t,n))}function wn(e,t,n){let r=xn(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 Tn(e,t,n=`compatible`){let r=kn(e);if(t===`UTC`)return _n(r);if(t===dn()&&n===`compatible`){r=An(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=_n(r),a=yn(i-Sn,t),o=yn(i+Sn,t),s=Cn(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 En(e,t,n=`compatible`){return new Date(Tn(e,t,n))}function Dn(e,t){let n=yn(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 _r(i<1?`BC`:`AD`,i<1?-i+1:i,a,o,t,n,s,c,l,u)}function On(e){return new pr(e.calendar,e.era,e.year,e.month,e.day)}function kn(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 hr(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function An(e,t){if(e.calendar.identifier===t.identifier)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,Bn(r),r}function jn(e,t,n){if(e instanceof _r)return e.timeZone===t?e:Nn(e,t);let r=Tn(e,t,n);return Dn(r,t)}function Mn(e){let t=_n(e)-e.offset;return new Date(t)}function Nn(e,t){let n=_n(e)-e.offset;return An(Dn(n,t),e.calendar)}const Pn=36e5;function Fn(e,t){let n=e.copy(),r=`hour`in n?Jn(n,t):0;In(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Ln(n),zn(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,Rn(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 In(e,t){var n,r;(n=(r=e.calendar).isInverseEra)?.call(r,e)&&(t=-t),e.year+=t}function Ln(e){for(;e.month<1;)In(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,In(e,1)}function Rn(e){for(;e.day<1;)e.month--,Ln(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Ln(e)}function zn(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 Bn(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),zn(e)}function Vn(e){let t={};for(let n in e)typeof e[n]==`number`&&(t[n]=-e[n]);return t}function Hn(e,t){return Fn(e,Vn(t))}function Un(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),Bn(n),n}function Wn(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),Kn(n),n}function Gn(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=qn(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=qn(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=qn(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=qn(e.hour,24),t}function Kn(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 qn(e,t){let n=e%t;return n<0&&(n+=t),n}function Jn(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,Gn(e)}function Yn(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=Zn(a,n,0,t.length-1,r?.round),i.era=t[a],Bn(i);break}case`year`:var a,o;(a=(o=i.calendar).isInverseEra)?.call(o,i)&&(n=-n),i.year=Zn(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=Zn(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case`day`:i.day=Zn(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),Bn(i),i}function Xn(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=Zn(t,n,a,o,r?.round);break}case`minute`:i.minute=Zn(e.minute,n,0,59,r?.round);break;case`second`:i.second=Zn(e.second,n,0,59,r?.round);break;case`millisecond`:i.millisecond=Zn(e.millisecond,n,0,999,r?.round);break;default:throw Error(`Unsupported field `+t)}return i}function Zn(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 Qn(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=Fn(kn(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Tn(r,e.timeZone)}else n=_n(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=Dn(n,e.timeZone);return An(r,e.calendar)}function $n(e,t){return Qn(e,Vn(t))}function er(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=kn(e),o=An(Wn(a,{hour:t}),new Xt),s=[Tn(o,e.timeZone,`earlier`),Tn(o,e.timeZone,`later`)].filter(t=>Dn(t,e.timeZone).day===o.day)[0],c=An(Wn(a,{hour:i}),new Xt),l=[Tn(c,e.timeZone,`earlier`),Tn(c,e.timeZone,`later`)].filter(t=>Dn(t,e.timeZone).day===c.day).pop(),u=_n(e)-e.offset,d=Math.floor(u/Pn),f=u%Pn;return u=Zn(d,n,Math.floor(s/Pn),Math.floor(l/Pn),r?.round)*Pn+f,An(Dn(u,e.timeZone),e.calendar)}case`minute`:case`second`:case`millisecond`:return Xn(e,t,n,r);case`era`:case`year`:case`month`:case`day`:{let i=Yn(kn(e),t,n,r),a=Tn(i,e.timeZone);return An(Dn(a,e.timeZone),e.calendar)}default:throw Error(`Unsupported field `+t)}}function tr(e,t,n){let r=kn(e),i=Wn(Un(r,t),t);if(i.compare(r)===0)return e;let a=Tn(i,e.timeZone,n);return An(Dn(a,e.timeZone),e.calendar)}const nr=[`hours`,`minutes`,`seconds`],rr=[`years`,`months`,`weeks`,`days`,...nr];function ir(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 ar(e){let t=An(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 or(e){return`${ar(e)}T${ir(e)}`}function sr(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 cr(e){return`${or(e)}${sr(e.offset)}[${e.timeZone}]`}function lr(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function ur(e,t,n){lr(e,t),t.set(e,n)}function dr(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 fr=new WeakMap,pr=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 Fn(this,e)}subtract(e){return Hn(this,e)}set(e){return Un(this,e)}cycle(e,t,n){return Yn(this,e,t,n)}toDate(e){return En(this,e)}toString(){return ar(this)}compare(e){return sn(this,e)}constructor(...e){ur(this,fr,{writable:!0,value:void 0});let[t,n,r,i,a]=dr(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,Bn(this)}},mr=new WeakMap,hr=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 Fn(this,e)}subtract(e){return Hn(this,e)}set(e){return Un(Wn(this,e),e)}cycle(e,t,n){switch(e){case`era`:case`year`:case`month`:case`day`:return Yn(this,e,t,n);default:return Xn(this,e,t,n)}}toDate(e,t){return En(this,e,t)}toString(){return or(this)}compare(e){let t=sn(this,e);return t===0?cn(this,kn(e)):t}constructor(...e){ur(this,mr,{writable:!0,value:void 0});let[t,n,r,i,a]=dr(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,Bn(this)}},gr=new WeakMap,_r=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 Qn(this,e)}subtract(e){return $n(this,e)}set(e,t){return tr(this,e,t)}cycle(e,t,n){return er(this,e,t,n)}toDate(){return Mn(this)}toString(){return cr(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-jn(e,this.timeZone).toDate().getTime()}constructor(...e){ur(this,gr,{writable:!0,value:void 0});let[t,n,r,i,a]=dr(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,Bn(this)}};const vr=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],yr=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],br=[1867,1911,1925,1988,2018],xr=[`meiji`,`taisho`,`showa`,`heisei`,`reiwa`];function Sr(e){let t=vr.findIndex(([t,n,r])=>e.year=0){let[,n,r]=vr[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return xr}getYearsInEra(e){let t=xr.indexOf(e.era),n=vr[t],r=vr[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 Mr=class extends Xt{fromJulianDay(e){let t=super.fromJulianDay(e),n=qt(t.era,t.year),[r,i]=jr(n);return new pr(this,r,i,t.month,t.day)}toJulianDay(e){return super.toJulianDay(Nr(e))}getEras(){return[`before_minguo`,`minguo`]}balanceDate(e){let[t,n]=jr(Ar(e));e.era=t,e.year=n}isInverseEra(e){return e.era===`before_minguo`}getDaysInMonth(e){return super.getDaysInMonth(Nr(e))}getYearsInEra(e){return e.era===`before_minguo`?9999:9999-kr}constructor(...e){super(...e),this.identifier=`roc`}};function Nr(e){let[t,n]=Jt(Ar(e));return new pr(t,n,e.month,e.day)}const Pr=1948320,Fr=[0,31,62,93,124,155,186,216,246,276,306,336];var Ir=class{fromJulianDay(e){let t=e-Pr,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-Fr[a]+1;return new pr(this,n,a+1,o)}toJulianDay(e){let t=Pr-1+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=Fr[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 Lr=78,Rr=80;var zr=class extends Xt{fromJulianDay(e){let t=super.fromJulianDay(e),n=t.year-Lr,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+Lr)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return[`saka`]}balanceDate(){}constructor(...e){super(...e),this.identifier=`indian`}};const Br=1948440,Vr=1948439,Hr=1300,Ur=1600,Wr=460322;function Gr(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function Kr(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),i=Math.min(12,Math.ceil((n-(29+Gr(t,r,1,1)))/29.5)+1),a=n-Gr(t,r,i,1)+1;return new pr(e,r,i,a)}function qr(e){return(14+11*e)%30<11}var Jr=class{fromJulianDay(e){return Kr(this,Br,e)}toJulianDay(e){return Gr(Br,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return e.month===12&&qr(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return qr(e.year)?355:354}getYearsInEra(){return 9665}getEras(){return[`AH`]}constructor(){this.identifier=`islamic-civil`}},Yr=class extends Jr{fromJulianDay(e){return Kr(this,Vr,e)}toJulianDay(e){return Gr(Vr,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier=`islamic-tbla`}};const Xr=`qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=`;let Zr,Qr;function $r(e){return Wr+Qr[e-Hr]}function ei(e,t){let n=e-Hr,r=1<<11-(t-1);return(Zr[n]&r)===0?29:30}function ti(e,t){let n=$r(e);for(let r=1;rr)return super.fromJulianDay(e);{let e=Hr-1,n=1,r=1;for(;r>0;){e++,r=t-$r(e)+1;let i=ni(e);if(r===i){n=12;break}else if(rt;)r-=t,n++,t=ei(e,n);break}}return new pr(this,e,n,t-ti(e,n)+1)}}toJulianDay(e){return e.yearUr?super.toJulianDay(e):Br+ti(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.yearUr?super.getDaysInMonth(e):ei(e.year,e.month)}getDaysInYear(e){return e.yearUr?super.getDaysInYear(e):ni(e.year)}constructor(){if(super(),this.identifier=`islamic-umalqura`,Zr||=new Uint16Array(Uint8Array.from(atob(Xr),e=>e.charCodeAt(0)).buffer),!Qr){Qr=new Uint32Array(Ur-Hr+1);let e=0;for(let t=Hr;t<=Ur;t++){Qr[t-Hr]=e;for(let n=1;n<=12;n++)e+=ei(t,n)}}}};const ii=347997,ai=1080,oi=24*ai,si=29,ci=12*ai+793,li=si*oi+ci;function ui(e){return Ut(e*7+1,19)<7}function di(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 fi(e){let t=di(e-1),n=di(e),r=di(e+1);return r-n===356?2:n-t===382?1:0}function pi(e){return di(e)+fi(e)}function mi(e){return pi(e+1)-pi(e)}function hi(e){let t=mi(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function gi(e,t){if(t>=6&&!ui(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=hi(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?ui(e)?30:0:30}var _i=class{fromJulianDay(e){let t=e-ii,n=t*oi/li,r=Math.floor((19*n+234)/235)+1,i=pi(r),a=Math.floor(t-i);for(;a<1;)r--,i=pi(r),a=Math.floor(t-i);let o=1,s=0;for(;s6?e.month--:!ui(t.year)&&ui(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier=`hebrew`}};const vi=1723856,yi=1824665,bi=5500;function xi(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function Si(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-xi(e,n,1,1))/30),i=t+1-xi(e,n,r,1);return[n,r,i]}function Ci(e){return Math.floor(e%4/3)}function wi(e,t){return t%13==0?Ci(e)+5:30}var Ti=class{fromJulianDay(e){let[t,n,r]=Si(vi,e),i=`AM`;return t<=0&&(i=`AA`,t+=bi),new pr(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`AA`&&(t-=bi),xi(vi,t,e.month,e.day)}getDaysInMonth(e){return wi(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+Ci(e.year)}getYearsInEra(e){return e.era===`AA`?9999:9991}getEras(){return[`AA`,`AM`]}constructor(){this.identifier=`ethiopic`}},Ei=class extends Ti{fromJulianDay(e){let[t,n,r]=Si(vi,e);return t+=bi,new pr(this,`AA`,t,n,r)}getEras(){return[`AA`]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier=`ethioaa`}},Di=class extends Ti{fromJulianDay(e){let[t,n,r]=Si(yi,e),i=`CE`;return t<=0&&(i=`BCE`,t=1-t),new pr(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`BCE`&&(t=1-t),xi(yi,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return e.era===`BCE`&&(t=1-t),wi(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 Oi(e){switch(e){case`buddhist`:return new Dr;case`ethiopic`:return new Ti;case`ethioaa`:return new Ei;case`coptic`:return new Di;case`hebrew`:return new _i;case`indian`:return new zr;case`islamic-civil`:return new Jr;case`islamic-tbla`:return new Yr;case`islamic-umalqura`:return new ri;case`japanese`:return new wr;case`persian`:return new Ir;case`roc`:return new Mr;case`gregory`:default:return new Xt}}let ki=new Map;var Ai=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 Ii()&&(this.resolvedHourCycle||=Li(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=Mi(e,t),this.options=t}};const ji={true:{ja:`h11`},false:{}};function Mi(e,t={}){if(typeof t.hour12==`boolean`&&Pi()){t={...t};let n=ji[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 Ri=new Map,zi=!1;try{zi=new Intl.NumberFormat(`de-DE`,{signDisplay:`exceptZero`}).resolvedOptions().signDisplay===`exceptZero`}catch{}let Bi=!1;try{Bi=new Intl.NumberFormat(`de-DE`,{style:`unit`,unit:`degree`}).resolvedOptions().style===`unit`}catch{}const Vi={degree:{narrow:{default:`°`,"ja-JP":` 度`,"zh-TW":`度`,"sl-SI":` °`}}};var Hi=class{format(e){let t=``;if(t=!zi&&this.options.signDisplay!=null?Wi(this.numberFormatter,this.options.signDisplay,e):this.numberFormatter.format(e),this.options.style===`unit`&&!Bi){var n;let{unit:e,unitDisplay:r=`short`,locale:i}=this.resolvedOptions();if(!e)return t;let a=(n=Vi[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!zi&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!Bi&&this.options.style===`unit`&&(e={...e,style:`unit`,unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=Ui(e,t),this.options=t}};function Ui(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes(`-nu-`)&&(e.includes(`-u-`)||(e+=`-u-`),e+=`-nu-${n}`),t.style===`unit`&&!Bi){var r;let{unit:e,unitDisplay:n=`short`}=t;if(!e)throw Error(`unit option must be provided with style: "unit"`);if(!(r=Vi[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 Gi=RegExp(`^.*\\(.*\\).*$`),Ki=[`latn`,`arab`,`hanidec`,`deva`,`beng`];var qi=class{parse(e){return Yi(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,n){return Yi(this.locale,this.options,e).isValidPartialNumber(e,t,n)}getNumberingSystem(e){return Yi(this.locale,this.options,e).options.numberingSystem}constructor(e,t={}){this.locale=e,this.options=t}};const Ji=new Map;function Yi(e,t,n){let r=Xi(e,t);if(!e.includes(`-nu-`)&&!r.isValidPartialNumber(n)){for(let i of Ki)if(i!==r.options.numberingSystem){let r=Xi(e+(e.includes(`-u-`)?`-nu-`:`-u-nu-`)+i,t);if(r.isValidPartialNumber(n))return r}}return r}function Xi(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 qi(this.locale,e).parse(new Hi(this.locale,e).format(n))}return this.options.currencySign===`accounting`&&Gi.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=ta(e,`.`,this.symbols.group))),this.options.locale===`fr-FR`&&(e=ta(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=ta(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=ea(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 Qi=new Set([`decimal`,`fraction`,`integer`,`minusSign`,`plusSign`,`group`]),$i=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function ea(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=$i.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=>!Qi.has(e.type)).map(e=>na(e.value)),y=d.flatMap(e=>e.filter(e=>!Qi.has(e.type)).map(e=>na(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 ta(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function na(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ra(e,t){let n=[];for(let r=0;r0}function da(e,t){return e.compare(t)<=0}function fa(e,t){return e.compare(t)>=0}function pa(e,t,n){return fa(e,t)&&da(e,n)}function ma(e,t,n){return ua(e,t)&&la(e,n)}function ha(e,t,n){let r=rn(e,n);return t>r?e.subtract({days:r+7-t}):t===r?e:e.subtract({days:r-t})}function ga(e,t,n){let r=rn(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 _a(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 va(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 ya(e){let{dateObj:t,weekStartsOn:n,fixedWeeks:r,locale:i}=e,a=ca(t),o=Array.from({length:a},(e,n)=>t.set({day:n+1})),s=fn(t),c=pn(t),l=ha(s,n,i),u=ga(c,n,i),d=va(l.subtract({days:1}),s),f=va(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||=pn(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=ra(m,7);return{value:t,cells:m,rows:h}}function ba(e){let{numberOfMonths:t,dateObj:n,...r}=e,i=[];if(!t||t===1)return i.push(ya({...r,dateObj:n})),i;i.push(ya({...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 xa(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 Sa(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function Ca(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 wa(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=Ca(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(Ca(n/r,r))*r):an&&(a=t+Math.floor(Ca((n-t)/r,r))*r),a=Ca(a,r),a}function Ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Ea=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 Da=Ta(Ea);function Oa(e,t){if(e.length!==t.length)return!1;for(let n=0;nDa(e,t)),i=e.findIndex(e=>Da(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 Aa=typeof document<`u`;function ja(e){return e==null}function Ma(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 Ai(i),d=Oi(u.resolvedOptions().calendar);return l.includes(r??`day`)?An(new hr(o,s,c,0,0,0),d):An(new pr(o,s,c),d)}const Na=`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(`.`),Pa=[`year`,`month`,`day`],Fa={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 Ia(e){if(Ra(e))return Fa[e];{let t=Ha(e);return Ra(t)?Fa[t]:Fa.en}}function La(e,t,n){return za(e)?Ia(n)[e]:Va(e)?t:Ba(e)?`––`:``}function Ra(e){return Na.includes(e)}function za(e){return Pa.includes(e)}function Ba(e){return e===`hour`||e===`minute`||e===`second`}function Va(e){return e===`era`||e===`dayPeriod`}function Ha(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}const Ua=[`day`,`month`,`year`],Wa=[`hour`,`minute`,`second`,`dayPeriod`],Ga=[...Ua,...Wa];function Ka(e){return Ua.includes(e)}function qa(e){return Ga.includes(e)}function Ja(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 Ya(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 Xa(e,t){var n;let r=ie();return H(()=>{r.value=e()},{...t,flush:(n=void 0,`sync`)}),ee(r)}function Za(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 Qa(e){return g()?(j(e),!0):!1}function $a(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return Qa(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t)))}}function eo(e){let t=!1,n,r=m(!0);return(...i)=>(t||(n=r.run(()=>e(...i)),t=!0),n)}function to(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))),Qa(i),n)}function no(e){return typeof e==`function`?e():B(e)}function ro(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 io(e){return ro(a(e))}const ao=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;const oo=e=>typeof e<`u`,so=e=>e!=null,co=Object.prototype.toString,lo=e=>co.call(e)===`[object Object]`,uo=()=>{},fo=po();function po(){var e,t;return ao&&(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 mo(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 ho(e,t={}){let n,r,i=uo,a=e=>{clearTimeout(e),i(),i=uo};return o=>{let s=no(e),c=no(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 go(e){return h()}function _o(e,t=1e4){return f((n,r)=>{let i=no(e),a,o=()=>setTimeout(()=>{i=no(e),r()},no(t));return Qa(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function vo(e,t=200,n={}){return mo(ho(t,n),e)}function yo(e,t){go()&&O(e,t)}function bo(e,t=!0,n){go()?A(e,n):t?e():w(e)}function xo(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)},no(t))}return r&&(i.value=!0,ao&&c()),Qa(s),{isPending:ee(i),start:c,stop:s}}function So(e=1e3,t={}){let{controls:n=!1,callback:r}=t,i=xo(r??uo,e,t),o=a(()=>!i.isPending.value);return n?{ready:o,...i}:o}function Co(e,t,n){let r=V(e,(...e)=>(w(()=>r()),t(...e)),n);return r}function wo(e){var t;let n=no(e);return(t=n?.$el)??n}const To=ao?window:void 0;function Eo(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=To):[t,n,r,i]=e,!t)return uo;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(()=>[wo(t),no(i)],([e,t])=>{if(o(),!e)return;let i=lo(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return Qa(l),l}function Do(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Oo(...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=To,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=Do(t);return Eo(i,a,e=>{e.repeat&&no(s)||c(e)&&n(e)},o)}function ko(){let e=L(!1),t=h();return t&&A(()=>{e.value=!0},t),e}function Ao(e){let t=ko();return a(()=>(t.value,!!e()))}function jo(e,t,n={}){let{window:r=To,...i}=n,o,s=Ao(()=>r&&`MutationObserver`in r),c=()=>{o&&(o.disconnect(),o=void 0)},l=a(()=>{let t=no(e),n=(Array.isArray(t)?t:[t]).map(wo).filter(so);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 Qa(f),{isSupported:s,stop:f,takeRecords:d}}function Mo(e={}){var t;let{window:n=To,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&&(Eo(n,`blur`,e=>{e.relatedTarget===null&&c()},!0),Eo(n,`focus`,c,!0)),i&&jo(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 No(e,t={}){let{immediate:n=!0,fpsLimit:r=void 0,window:i=To}=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 Io(e,t,n={}){let{window:r=To,...i}=n,o,s=Ao(()=>r&&`ResizeObserver`in r),c=()=>{o&&(o.disconnect(),o=void 0)},l=a(()=>Array.isArray(e)?e.map(e=>wo(e)):[wo(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 Qa(d),{isSupported:s,stop:d}}function Lo(e,t={}){let n=Mo(t),r=a(()=>wo(e));return{focused:a(()=>r.value&&n.value?r.value.contains(n.value):!1)}}function Ro(e=Fo()){let t=ie(),n=()=>{let n=wo(e);n&&(t.value=n.parentElement)};return bo(n),V(()=>no(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):Po(e):e,y=()=>oo(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 zo(e){return e?e.flatMap(e=>e.type===t?zo(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 Bo=[`INPUT`,`TEXTAREA`];function Vo(e,t,n,r={}){if(!t||r.enableIgnoredElement&&Bo.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=Ho(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 Ho(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`?Ho(e,s,n,r):s:null}function Uo(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 Wo(e,t,n=`.`,r){if(!Uo(t))return Wo(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]]:Uo(a)&&Uo(i[t])?i[t]=Wo(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function Go(e){return(...t)=>t.reduce((t,n)=>Wo(t,n,``,e),{})}const Ko=Go(),[qo,Jo]=K(`ConfigProvider`),Yo=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 Jo({dir:n,scrollBody:r,nonce:i,useId:t.useId}),(e,t)=>R(e.$slots,`default`)}});let Xo=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Zo=(e=21)=>{let t=``,n=e;for(;n--;)t+=Xo[Math.random()*64|0];return t};const Qo=to(()=>{let e=L(new Map),t=L(),n=a(()=>{for(let t of e.value.values())if(t)return!0;return!1}),r=qo({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??``,fo&&i?.(),t.value=void 0};return V(n,(e,n)=>{var a;if(!ao)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`?Ko({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`),fo&&(i=Eo(document,`touchmove`,e=>ts(e),{passive:!1})),w(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})},{immediate:!0,flush:`sync`}),e});function $o(e){let t=Zo(6),n=Qo();n.value.set(t,e??!1);let r=a({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return yo(()=>{n.value.delete(t)}),r}function es(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 ns=`data-radix-vue-collection-item`;function rs(e,t=ns){let n=e??Symbol();return{createCollection:e=>{let r=L([]);function i(){let n=wo(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 os(e){let t=L(e);function n(){return t.value}function r(e){t.value=e}function i(e,n){return new Ai(t.value,n).format(e)}function a(e,t=!0){return sa(e)&&t?i(ia(e),{dateStyle:`long`,timeStyle:`long`}):i(ia(e),{dateStyle:`long`})}function o(e,n={}){return new Ai(t.value,{month:`long`,year:`numeric`,...n}).format(e)}function s(e,n={}){return new Ai(t.value,{month:`long`,...n}).format(e)}function c(){let e=on(dn());return[1,2,3,4,5,6,7,8,9,10,11,12].map(t=>({label:s(ia(e.set({month:t}))),value:t}))}function l(e,n={}){return new Ai(t.value,{year:`numeric`,...n}).format(e)}function u(e,n){return oa(e)?new Ai(t.value,{...n,timeZone:e.timeZone}).formatToParts(ia(e)):new Ai(t.value,n).formatToParts(ia(e))}function d(e,n=`narrow`){return new Ai(t.value,{weekday:n}).format(e)}function f(e){var n;return(n=new Ai(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=qo({dir:L(`ltr`)});return a(()=>{var n;return e?.value||(n=t.dir)?.value||`ltr`})}function ss(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 cs=0;function ls(){H(e=>{if(!ao)return;let t=document.querySelectorAll(`[data-radix-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??us()),document.body.insertAdjacentElement(`beforeend`,t[1]??us()),cs++,e(()=>{cs===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),cs--})})}function us(){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 ds(e){return a(()=>{var t;return no(e)?!!((t=wo(e))!=null&&t.closest(`form`)):!0})}function fs(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 ps(e,t){let n=fs(e),r=t?ss(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:wo(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 ms(e,t){let n=_o(!1,300),r=L(null),i=$a();function a(){r.value=null,n.value=!1}function o(e,t){let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=hs(a,i.getBoundingClientRect()),s=gs(a,o),c=_s(t.getBoundingClientRect()),l=ys([...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=!vs(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 hs(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 gs(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 _s(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 vs(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 ys(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y?1:0),bs(t)}function bs(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 xs=function(e){if(typeof document>`u`)return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ss=new WeakMap,Cs=new WeakMap,ws={},Ts=0,Es=function(e){return e&&(e.host||Es(e.parentNode))},Ds=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Es(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})},Os=function(e,t,n,r){var i=Ds(t,Array.isArray(e)?e:[e]);ws[n]||(ws[n]=new WeakMap);var a=ws[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=(Ss.get(e)||0)+1,l=(a.get(e)||0)+1;Ss.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Cs.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(),Ts++,function(){o.forEach(function(e){var t=Ss.get(e)-1,i=a.get(e)-1;Ss.set(e,t),a.set(e,i),t||(Cs.has(e)||e.removeAttribute(r),Cs.delete(e)),i||e.removeAttribute(n)}),Ts--,Ts||(Ss=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,ws={})}},ks=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=xs(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live]`))),Os(r,i,n,`aria-hidden`)):function(){return null}};function As(e){let t;V(()=>wo(e),e=>{e?t=ks(e):t&&t()}),M(()=>{t&&t()})}let js=0;function Z(e,t=`radix`){if(e)return e;let n=qo({useId:void 0});return de?`${t}-${de()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++js}`}function Ms(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=ka(o,n.value,c);break;case`first`:l=ka(o,n.value,o?.[0]);break;case`last`:l=ka(o,n.value,o?.[o.length-1]);break}e.value=l}return{firstValue:n,onSelectItem:r,handleMultipleReplace:i}}function Ns(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=wo(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 Ps(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 Fs=`data-item-text`;function Is(e){let t=_o(``,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(`[${Fs}]`)??e).textContent)?.trim()??``}}),s=o.find(e=>e.ref===a),c=o.map(e=>e.textValue),l=Rs(c,t.value,s?.textValue),u=o.find(e=>e.textValue===l);return u&&u.ref.focus(),u?.ref},resetTypeahead:()=>{t.value=``}}}function Ls(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Rs(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=Ls(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 zs(){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 Bs=p({name:`PrimitiveSlot`,inheritAttrs:!1,setup(t,{attrs:n,slots:r}){return()=>{var t,a;if(!r.default)return null;let o=zo(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(Bs,t,{default:n.default}):()=>v(e.as,t,{default:n.default})}});function Vs(){let e=L(),t=a(()=>{var t,n;return[`#text`,`#comment`].includes((t=e.value)?.$el.nodeName)?(n=e.value)?.$el.nextElementSibling:wo(e)});return{primitiveElement:e,currentElement:t}}const[Hs,Us]=K(`CollapsibleRoot`),Ws=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 Us({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`]))}}),Gs=p({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=Hs();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 Ks(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??To,{state:u,dispatch:d}=Ps(s,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),f=e=>{var n;if(ao){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=qs(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=qs(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=qs(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=qs(t.value);i.value=u.value===`mounted`?e:`none`});return M(()=>{h(),g()}),{isPresent:a(()=>[`mounted`,`unmountSuspended`].includes(u.value))}}function qs(e){return e&&getComputedStyle(e).animationName||`none`}const Js=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}=Ks(i,o);n({present:s});let c=t.default({present:s});c=zo(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=wo(e);return typeof t?.hasAttribute>`u`||(t!=null&&t.hasAttribute(`data-radix-popper-content-wrapper`)?o.value=t.firstElementChild:o.value=t),t}}):null}}),Ys=p({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=Hs();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(Js),{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 Xs({type:e,defaultValue:t,modelValue:n}){let r=n||t;if(ja(e)&&ja(n)&&ja(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 +- an array of strings`} + - \`undefined\``);let i=n!==void 0||t!==void 0;if(e&&i){let r=Array.isArray(n)||Array.isArray(t),i=n===void 0?`defaultValue`:`modelValue`,a=i===`modelValue`?typeof n:typeof t;if(e===`single`&&r)return console.error(`Invalid prop \`${i}\` of type ${a} supplied with type \`single\`. The \`modelValue\` prop must be a string or \`undefined\`. + You can remove the \`type\` prop to let the component infer the type from the ${i} prop.`),`multiple`;if(e===`multiple`&&!r)return console.error(`Invalid prop \`${i}\` of type ${a} supplied with type \`multiple\`. The \`modelValue\` prop must be an array of strings or \`undefined\`. + You can remove the \`type\` prop to let the component infer the type from the ${i} prop.`),`single`}return i?Array.isArray(r)?`multiple`:`single`:e}function Zs({type:e,defaultValue:t,modelValue:n}){return e||Xs({type:e,defaultValue:t,modelValue:n})}function Qs({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function $s(e,t){let n=L(Zs(e)),r=q(e,`modelValue`,t,{defaultValue:Qs(e),passive:e.modelValue===void 0,deep:!0});V(()=>[e.type,e.modelValue,e.defaultValue],()=>{let t=Xs(e);n.value!==t&&(n.value=t)},{immediate:!0});function i(e){if(n.value===`single`)r.value=e===r.value?void 0:e;else{let t=[...r.value||[]];if(t.includes(e)){let n=t.findIndex(t=>t===e);t.splice(n,1)}else t.push(e);r.value=t}}let o=a(()=>n.value===`single`);return{modelValue:r,type:n,changeModelValue:i,isSingle:o}}const[ec,tc]=K(`AccordionRoot`),nc=p({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dir:{},orientation:{default:`vertical`},asChild:{type:Boolean},as:{},type:{},modelValue:{},defaultValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{dir:i,disabled:a}=z(n),o=Y(i),{modelValue:c,changeModelValue:l,isSingle:u}=$s(n,r),{forwardRef:d,currentElement:f}=X();return tc({disabled:a,direction:o,orientation:n.orientation,parentElement:f,isSingle:u,collapsible:n.collapsible,modelValue:c,changeModelValue:l}),(e,t)=>(P(),s(B(Q),{ref:B(d),"as-child":e.asChild,as:e.as},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(c)})]),_:3},8,[`as-child`,`as`]))}}),[rc,ic]=K(`AccordionItem`),ac=p({__name:`AccordionItem`,props:{disabled:{type:Boolean},value:{},asChild:{type:Boolean},as:{}},setup(e,{expose:t}){let n=e,r=ec(),i=a(()=>r.isSingle.value?n.value===r.modelValue.value:Array.isArray(r.modelValue.value)&&r.modelValue.value.includes(n.value)),o=a(()=>r.disabled.value||n.disabled),c=a(()=>o.value?``:void 0),l=a(()=>i.value?`open`:`closed`);t({open:i,dataDisabled:c});let{currentRef:u,currentElement:d}=X();ic({open:i,dataState:l,disabled:o,dataDisabled:c,triggerId:``,currentRef:u,currentElement:d,value:a(()=>n.value)});function f(e){var t;let n=e.target;if(Array.from((t=r.parentElement.value)?.querySelectorAll(`[data-radix-vue-collection-item]`)??[]).findIndex(e=>e===n)===-1)return null;Vo(e,d.value,r.parentElement.value,{arrowKeyOptions:r.orientation,dir:r.direction.value,focus:!0})}return(e,t)=>(P(),s(B(Ws),{"data-orientation":B(r).orientation,"data-disabled":c.value,"data-state":l.value,disabled:o.value,open:i.value,as:n.as,"as-child":n.asChild,onKeydown:W(f,[`up`,`down`,`left`,`right`,`home`,`end`])},{default:U(()=>[R(e.$slots,`default`,{open:i.value})]),_:3},8,[`data-orientation`,`data-disabled`,`data-state`,`disabled`,`open`,`as`,`as-child`]))}}),oc=p({__name:`AccordionContent`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=ec(),r=rc();return X(),(e,i)=>(P(),s(B(Ys),{role:`region`,hidden:!B(r).open.value,"as-child":t.asChild,"force-mount":t.forceMount,"aria-labelledby":B(r).triggerId,"data-state":B(r).dataState.value,"data-disabled":B(r).dataDisabled.value,"data-orientation":B(n).orientation,style:{"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`}},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`hidden`,`as-child`,`force-mount`,`aria-labelledby`,`data-state`,`data-disabled`,`data-orientation`]))}}),sc=p({__name:`AccordionHeader`,props:{asChild:{type:Boolean},as:{default:`h3`}},setup(e){let t=e,n=ec(),r=rc();return X(),(e,i)=>(P(),s(B(Q),{as:t.as,"as-child":t.asChild,"data-orientation":B(n).orientation,"data-state":B(r).dataState.value,"data-disabled":B(r).dataDisabled.value},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-orientation`,`data-state`,`data-disabled`]))}}),cc=p({__name:`AccordionTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=ec(),r=rc();r.triggerId||=Z(void 0,`radix-vue-accordion-trigger`);function i(){let e=n.isSingle.value&&r.open.value&&!n.collapsible;r.disabled.value||e||n.changeModelValue(r.value.value)}return(e,a)=>(P(),s(B(Gs),{id:B(r).triggerId,ref:B(r).currentRef,"data-radix-vue-collection-item":``,as:t.as,"as-child":t.asChild,"aria-disabled":B(r).disabled.value||void 0,"aria-expanded":B(r).open.value||!1,"data-disabled":B(r).dataDisabled.value,"data-orientation":B(n).orientation,"data-state":B(r).dataState.value,disabled:B(r).disabled.value,onClick:i},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`aria-disabled`,`aria-expanded`,`data-disabled`,`data-orientation`,`data-state`,`disabled`]))}}),[lc,uc]=K(`DialogRoot`),dc=p({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=q(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=L(),a=L(),{modal:o}=z(n);return uc({open:r,modal:o,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>R(e.$slots,`default`,{open:B(r)})}}),fc=p({__name:`DialogTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=lc(),{forwardRef:r,currentElement:i}=X();return n.contentId||=Z(void 0,`radix-vue-dialog-content`),A(()=>{n.triggerElement.value=i.value}),(e,i)=>(P(),s(B(Q),C(t,{ref:B(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":B(n).open.value||!1,"aria-controls":B(n).open.value?B(n).contentId:void 0,"data-state":B(n).open.value?`open`:`closed`,onClick:B(n).onOpenToggle}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),pc=p({__name:`Teleport`,props:{to:{default:`body`},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=ko();return(e,r)=>B(t)||e.forceMount?(P(),s(n,{key:0,to:e.to,disabled:e.disabled},[R(e.$slots,`default`)],8,[`to`,`disabled`])):c(``,!0)}}),mc=p({__name:`DialogPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(pc),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),hc=`dismissableLayer.pointerDownOutside`,gc=`dismissableLayer.focusOutside`;function _c(e,t){let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&r===n||i.indexOf(r){});return H(n=>{if(!ao)return;let o=async n=>{let o=n.target;if(t!=null&&t.value){if(_c(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t=function(){xa(hc,e,i)},i={originalEvent:n};n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=t,r.addEventListener(`click`,a.value,{once:!0})):t()}else r.removeEventListener(`click`,a.value);i.value=!1}},s=window.setTimeout(()=>{r.addEventListener(`pointerdown`,o)},0);n(()=>{window.clearTimeout(s),r.removeEventListener(`pointerdown`,o),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>i.value=!0}}function yc(e,t){var n;let r=(n=t?.value)?.ownerDocument??(globalThis==null?void 0:globalThis.document),i=L(!1);return H(n=>{if(!ao)return;let a=async n=>{t!=null&&t.value&&(await w(),!(!t.value||_c(t.value,n.target))&&n.target&&!i.value&&xa(gc,e,{originalEvent:n}))};r.addEventListener(`focusin`,a),n(()=>r.removeEventListener(`focusin`,a))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const bc=I({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xc=p({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:o}=X(),c=a(()=>{var e;return(e=o.value)?.ownerDocument??globalThis.document}),l=a(()=>bc.layersRoot),u=a(()=>o.value?Array.from(l.value).indexOf(o.value):-1),d=a(()=>bc.layersWithOutsidePointerEventsDisabled.size>0),f=a(()=>{let e=Array.from(l.value),[t]=[...bc.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return u.value>=n}),p=vc(async e=>{let t=[...bc.branches].some(t=>t?.contains(e.target));!f.value||t||(r(`pointerDownOutside`,e),r(`interactOutside`,e),await w(),e.defaultPrevented||r(`dismiss`))},o),m=yc(e=>{[...bc.branches].some(t=>t?.contains(e.target))||(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},o);Oo(`Escape`,e=>{u.value===l.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))});let h;return H(e=>{o.value&&(n.disableOutsidePointerEvents&&(bc.layersWithOutsidePointerEventsDisabled.size===0&&(h=c.value.body.style.pointerEvents,c.value.body.style.pointerEvents=`none`),bc.layersWithOutsidePointerEventsDisabled.add(o.value)),l.value.add(o.value),e(()=>{n.disableOutsidePointerEvents&&bc.layersWithOutsidePointerEventsDisabled.size===1&&(c.value.body.style.pointerEvents=h)}))}),H(e=>{e(()=>{o.value&&(l.value.delete(o.value),bc.layersWithOutsidePointerEventsDisabled.delete(o.value))})}),(e,t)=>(P(),s(B(Q),{ref:B(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:E({pointerEvents:d.value?f.value?`auto`:`none`:void 0}),onFocusCapture:B(m).onFocusCapture,onBlurCapture:B(m).onBlurCapture,onPointerdownCapture:B(p).onPointerDownCapture},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),Sc=p({__name:`DismissableLayerBranch`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,{forwardRef:n,currentElement:r}=X();return A(()=>{bc.branches.add(r.value)}),M(()=>{bc.branches.delete(r.value)}),(e,r)=>(P(),s(B(Q),C({ref:B(n)},t),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Cc=`focusScope.autoFocusOnMount`,wc=`focusScope.autoFocusOnUnmount`,Tc={bubbles:!1,cancelable:!0};function Ec(e,{select:t=!1}={}){let n=J();for(let r of e)if(Mc(r,{select:t}),J()!==n)return!0}function Dc(e){let t=Oc(e),n=kc(t,e),r=kc(t.reverse(),e);return[n,r]}function Oc(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function kc(e,t){for(let n of e)if(!Ac(n,{upTo:t}))return n}function Ac(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function jc(e){return e instanceof HTMLInputElement&&`select`in e}function Mc(e,{select:t=!1}={}){if(e&&e.focus){let n=J();e.focus({preventScroll:!0}),e!==n&&jc(e)&&t&&e.select()}}const Nc=eo(()=>L([]));function Pc(){let e=Nc();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=Fc(e.value,t),e.value.unshift(t)},remove(t){var n;e.value=Fc(e.value,t),(n=e.value[0])==null||n.resume()}}}function Fc(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ic(e){return e.filter(e=>e.tagName!==`A`)}const Lc=p({__name:`FocusScope`,props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(e,{emit:t}){let n=e,r=t,{currentRef:i,currentElement:a}=X(),o=L(null),c=Pc(),l=I({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});H(e=>{if(!ao)return;let t=a.value;if(!n.trapped)return;function r(e){if(l.paused||!t)return;let n=e.target;t.contains(n)?o.value=n:Mc(o.value,{select:!0})}function i(e){if(l.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||Mc(o.value,{select:!0}))}function s(e){t.contains(o.value)||Mc(t)}document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,i);let c=new MutationObserver(s);t&&c.observe(t,{childList:!0,subtree:!0}),e(()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,i),c.disconnect()})}),H(async e=>{let t=a.value;if(await w(),!t)return;c.add(l);let n=J();if(!t.contains(n)){let e=new CustomEvent(Cc,Tc);t.addEventListener(Cc,e=>r(`mountAutoFocus`,e)),t.dispatchEvent(e),e.defaultPrevented||(Ec(Ic(Oc(t)),{select:!0}),J()===n&&Mc(t))}e(()=>{t.removeEventListener(Cc,e=>r(`mountAutoFocus`,e));let e=new CustomEvent(wc,Tc),i=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(wc,i),t.dispatchEvent(e),setTimeout(()=>{e.defaultPrevented||Mc(n??document.body,{select:!0}),t.removeEventListener(wc,i),c.remove(l)},0)})});function u(e){if(!n.loop&&!n.trapped||l.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=J();if(t&&r){let t=e.currentTarget,[i,a]=Dc(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&Mc(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&Mc(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(P(),s(B(Q),{ref_key:`currentRef`,ref:i,tabindex:`-1`,"as-child":e.asChild,as:e.as,onKeydown:u},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),Rc=`menu.itemSelect`,zc=[`Enter`,` `],Bc=[`ArrowDown`,`PageUp`,`Home`],Vc=[`ArrowUp`,`PageDown`,`End`],Hc=[...Bc,...Vc],Uc={ltr:[...zc,`ArrowRight`],rtl:[...zc,`ArrowLeft`]},Wc={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]};function Gc(e){return e?`open`:`closed`}function Kc(e){return e===`indeterminate`}function qc(e){return Kc(e)?`indeterminate`:e?`checked`:`unchecked`}function Jc(e){let t=J();for(let n of e)if(n===t||(n.focus(),J()!==t))return}function Yc(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 Xc(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return Yc(n,t)}function Zc(e){return e.pointerType===`mouse`}const Qc=p({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=lc(),{forwardRef:a,currentElement:o}=X();return i.titleId||=Z(void 0,`radix-vue-dialog-title`),i.descriptionId||=Z(void 0,`radix-vue-dialog-description`),A(()=>{i.contentElement=o,J()!==document.body&&(i.triggerElement.value=J())}),(e,t)=>(P(),s(B(Lc),{"as-child":``,loop:``,trapped:n.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:U(()=>[d(B(xc),C({id:B(i).contentId,ref:B(a),as:e.as,"as-child":e.asChild,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":B(i).descriptionId,"aria-labelledby":B(i).titleId,"data-state":B(Gc)(B(i).open.value)},e.$attrs,{onDismiss:t[0]||=e=>B(i).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>r(`focusOutside`,e),onInteractOutside:t[3]||=e=>r(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>r(`pointerDownOutside`,e)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`]))}}),$c=p({__name:`DialogContentModal`,props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=lc(),a=ss(r),{forwardRef:o,currentElement:c}=X();return As(c),(e,t)=>(P(),s(Qc,C({...n,...B(a)},{ref:B(o),"trap-focus":B(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:t[0]||=e=>{var t;e.defaultPrevented||(e.preventDefault(),(t=B(i).triggerElement.value)==null||t.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),el=p({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=ss(t);X();let i=lc(),a=L(!1),o=L(!1);return(e,t)=>(P(),s(Qc,C({...n,...B(r)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{var t;e.defaultPrevented||(a.value||(t=B(i).triggerElement.value)==null||t.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{var t;e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let n=e.target;(t=B(i).triggerElement.value)!=null&&t.contains(n)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),tl=p({__name:`DialogContent`,props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=lc(),a=ss(r),{forwardRef:o}=X();return(e,t)=>(P(),s(B(Js),{present:e.forceMount||B(i).open.value},{default:U(()=>[B(i).modal.value?(P(),s($c,C({key:0,ref:B(o)},{...n,...B(a),...e.$attrs}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):(P(),s(el,C({key:1,ref:B(o)},{...n,...B(a),...e.$attrs}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),nl=p({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=lc();return $o(!0),X(),(e,n)=>(P(),s(B(Q),{as:e.as,"as-child":e.asChild,"data-state":B(t).open.value?`open`:`closed`,style:{"pointer-events":`auto`}},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),rl=p({__name:`DialogOverlay`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=lc(),{forwardRef:n}=X();return(e,r)=>{var i;return(i=B(t))!=null&&i.modal.value?(P(),s(B(Js),{key:0,present:e.forceMount||B(t).open.value},{default:U(()=>[d(nl,C(e.$attrs,{ref:B(n),as:e.as,"as-child":e.asChild}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`])]),_:3},8,[`present`])):c(``,!0)}}}),il=p({__name:`DialogClose`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=lc();return(e,r)=>(P(),s(B(Q),C(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>B(n).onOpenChange(!1)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`type`]))}}),al=p({__name:`DialogTitle`,props:{asChild:{type:Boolean},as:{default:`h2`}},setup(e){let t=e,n=lc();return X(),(e,r)=>(P(),s(B(Q),C(t,{id:B(n).titleId}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),ol=p({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{default:`p`}},setup(e){let t=e;X();let n=lc();return(e,r)=>(P(),s(B(Q),C(t,{id:B(n).descriptionId}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),sl=p({__name:`AlertDialogRoot`,props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=ps(e,t);return X(),(e,t)=>(P(),s(B(dc),C(B(n),{modal:!0}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),cl=p({__name:`AlertDialogTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(fc),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),ll=p({__name:`AlertDialogPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(pc),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),[ul,dl]=K(`AlertDialogContent`),fl=p({__name:`AlertDialogContent`,props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=ss(t);X();let i=L();return dl({onCancelElementChange:e=>{i.value=e}}),(e,t)=>(P(),s(B(tl),C({...n,...B(r)},{role:`alertdialog`,onPointerDownOutside:t[0]||=G(()=>{},[`prevent`]),onInteractOutside:t[1]||=G(()=>{},[`prevent`]),onOpenAutoFocus:t[2]||=()=>{w(()=>{var e;(e=i.value)==null||e.focus({preventScroll:!0})})}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),pl=p({__name:`AlertDialogOverlay`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(rl),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),ml=p({__name:`AlertDialogCancel`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=ul(),{forwardRef:r,currentElement:i}=X();return A(()=>{n.onCancelElementChange(i.value)}),(e,n)=>(P(),s(B(il),C(t,{ref:B(r)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),hl=p({__name:`AlertDialogTitle`,props:{asChild:{type:Boolean},as:{default:`h2`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(al),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),gl=p({__name:`AlertDialogDescription`,props:{asChild:{type:Boolean},as:{default:`p`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(ol),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),_l=p({__name:`AlertDialogAction`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(il),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),vl=p({inheritAttrs:!1,__name:`AspectRatio`,props:{ratio:{default:1},asChild:{type:Boolean},as:{}},setup(e){let t=e,{forwardRef:n}=X(),r=a(()=>1/t.ratio*100);return(e,t)=>(P(),l(`div`,{style:E(`position: relative; width: 100%; padding-bottom: ${r.value}%`),"data-radix-aspect-ratio-wrapper":``},[d(B(Q),C({ref:B(n),"as-child":e.asChild,as:e.as,style:{position:`absolute`,inset:`0px`}},e.$attrs),{default:U(()=>[R(e.$slots,`default`,{aspect:r.value})]),_:3},16,[`as-child`,`as`])],4))}}),[yl,bl]=K(`AvatarRoot`),xl=p({__name:`AvatarRoot`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){return X(),bl({imageLoadingStatus:L(`loading`)}),(e,t)=>(P(),s(B(Q),{"as-child":e.asChild,as:e.as},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}});function Sl(e){function t(t){return Array.isArray(e.date.value)?e.date.value.some(e=>Qt(e,t)):e.date.value?Qt(e.date.value,t):!1}let n=a(()=>{var t,n,r,i;if(Array.isArray(e.date.value)){if(!e.date.value.length)return!1;for(let r of e.date.value)if((t=e.isDateDisabled)!=null&&t.call(e,r)||(n=e.isDateUnavailable)!=null&&n.call(e,r))return!0}else{if(!e.date.value)return!1;if((r=e.isDateDisabled)!=null&&r.call(e,e.date.value)||(i=e.isDateUnavailable)!=null&&i.call(e,e.date.value))return!0}return!1});return{isDateSelected:t,isInvalid:n}}function Cl(e,t){let n=t(e),r=n.compare(e),i={};return r>=7&&(i.day=1),r>=ca(e)&&(i.month=1),n.set({...i})}function wl(e,t){let n=t(e),r=e.compare(n),i={};return r>=7&&(i.day=35),r>=ca(e)&&(i.month=13),n.set({...i})}function Tl(e,t){return t(e)}function El(e,t){return t(e)}function Dl(e){let t=os(e.locale.value),n=a(()=>{let t={calendar:e.placeholder.value.calendar.identifier};return e.placeholder.value.calendar.identifier===`gregory`&&e.placeholder.value.era===`BC`&&(t.era=`short`),t}),r=L(ba({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})),i=a(()=>r.value.map(e=>e.value));function o(e){return!i.value.some(t=>tn(e,t))}let s=(t=`month`,n)=>{if(!e.maxValue.value||!r.value.length)return!1;if(e.disabled.value)return!0;let i=r.value[r.value.length-1].value;if(n||e.nextPage.value){let t=Cl(i,n||e.nextPage.value);return ua(t,e.maxValue.value)}if(t===`year`){let t=i.add({years:1}).set({day:1,month:1});return ua(t,e.maxValue.value)}let a=i.add({months:1}).set({day:1});return ua(a,e.maxValue.value)},c=(t=`month`,n)=>{if(!e.minValue.value||!r.value.length)return!1;if(e.disabled.value)return!0;let i=r.value[0].value;if(n||e.prevPage.value){let t=wl(i,n||e.prevPage.value);return la(t,e.minValue.value)}if(t===`year`){let t=i.subtract({years:1}).set({day:35,month:13});return la(t,e.minValue.value)}let a=i.subtract({months:1}).set({day:35});return la(a,e.minValue.value)};function l(t){var n;return!!((n=e.isDateDisabled)!=null&&n.call(e,t)||e.disabled.value||e.maxValue.value&&ua(t,e.maxValue.value)||e.minValue.value&&la(t,e.minValue.value))}let u=t=>{var n;return!!((n=e.isDateUnavailable)!=null&&n.call(e,t))},d=a(()=>r.value.length?r.value[0].rows[0].map(n=>t.dayOfWeek(ia(n),e.weekdayFormat.value)):[]),f=(t=`month`,n)=>{let i=r.value[0].value;if(n||e.nextPage.value){let t=Tl(i,n||e.nextPage.value),a=ba({dateObj:t,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=a;let o={};if(!n){let e=a[0].value.compare(i);e>=ca(i)&&(o.day=1),e>=365&&(o.month=1)}e.placeholder.value=a[0].value.set({...o});return}let a=t===`month`?i.add({months:e.pagedNavigation.value?e.numberOfMonths.value:1}):i.add({years:1}),o=ba({dateObj:a,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=o,e.placeholder.value=o[0].value.set({day:1})},p=(t=`month`,n)=>{let i=r.value[0].value;if(n||e.prevPage.value){let t=El(i,n||e.prevPage.value),a=ba({dateObj:t,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=a;let o={};if(!n){let e=i.compare(a[0].value);e>=ca(i)&&(o.day=1),e>=365&&(o.month=1)}e.placeholder.value=a[0].value.set({...o});return}let a=t===`month`?i.subtract({months:e.pagedNavigation.value?e.numberOfMonths.value:1}):i.subtract({years:1}),o=ba({dateObj:a,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=o,e.placeholder.value=o[0].value.set({day:1})};V(e.placeholder,t=>{i.value.some(e=>tn(e,t))||(r.value=ba({dateObj:t,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value}))}),V([e.locale,e.weekStartsOn,e.fixedWeeks,e.numberOfMonths],()=>{r.value=ba({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})});let m=a(()=>{if(!r.value.length)return``;if(e.locale.value!==t.getLocale()&&t.setLocale(e.locale.value),r.value.length===1){let e=r.value[0].value;return`${t.fullMonthAndYear(ia(e),n.value)}`}let i=ia(r.value[0].value),a=ia(r.value[r.value.length-1].value),o=t.fullMonth(i,n.value),s=t.fullMonth(a,n.value),c=t.fullYear(i,n.value),l=t.fullYear(a,n.value);return c===l?`${o} - ${s} ${l}`:`${o} ${c} - ${s} ${l}`}),h=a(()=>`${e.calendarLabel.value??`Event Date`}, ${m.value}`);return{isDateDisabled:l,isDateUnavailable:u,isNextButtonDisabled:s,isPrevButtonDisabled:c,grid:r,weekdays:d,visibleView:i,isOutsideVisibleView:o,formatter:t,nextPage:f,prevPage:p,headingValue:m,fullCalendarLabel:h}}const Ol={style:{border:`0px`,clip:`rect(0px, 0px, 0px, 0px)`,"clip-path":`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0px`,position:`absolute`,"white-space":`nowrap`,width:`1px`}},kl={role:`heading`,"aria-level":`2`},[Al,jl]=K(`CalendarRoot`),Ml=p({__name:`CalendarRoot`,props:{modelValue:{},multiple:{type:Boolean,default:!1},defaultValue:{default:void 0},defaultPlaceholder:{},placeholder:{default:void 0},pagedNavigation:{type:Boolean,default:!1},preventDeselect:{type:Boolean,default:!1},weekStartsOn:{default:0},weekdayFormat:{default:`narrow`},calendarLabel:{},fixedWeeks:{type:Boolean,default:!1},maxValue:{},minValue:{},locale:{default:`en`},numberOfMonths:{default:1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},initialFocus:{type:Boolean,default:!1},isDateDisabled:{type:Function,default:void 0},isDateUnavailable:{type:Function,default:void 0},dir:{},nextPage:{},prevPage:{},asChild:{type:Boolean},as:{default:`div`}},emits:[`update:modelValue`,`update:placeholder`],setup(e,{emit:t}){let n=e,r=t,{locale:i,disabled:a,readonly:c,initialFocus:l,pagedNavigation:u,weekStartsOn:d,weekdayFormat:f,fixedWeeks:p,multiple:m,minValue:h,maxValue:g,numberOfMonths:_,preventDeselect:v,isDateDisabled:y,isDateUnavailable:b,calendarLabel:x,defaultValue:S,nextPage:C,prevPage:w,dir:T}=z(n),{primitiveElement:E,currentElement:D}=Vs(),O=Y(T),k=q(n,`modelValue`,r,{defaultValue:S.value,passive:n.modelValue===void 0}),j=Ma({defaultPlaceholder:n.placeholder,defaultValue:k.value,locale:n.locale}),M=q(n,`placeholder`,r,{defaultValue:n.defaultPlaceholder??j.copy(),passive:n.placeholder===void 0});function N(e){M.value=e.copy()}let{fullCalendarLabel:F,headingValue:I,isDateDisabled:ee,isDateUnavailable:L,isNextButtonDisabled:te,isPrevButtonDisabled:ne,weekdays:re,isOutsideVisibleView:ie,nextPage:oe,prevPage:se,formatter:ce,grid:le}=Dl({locale:i,placeholder:M,weekStartsOn:d,fixedWeeks:p,numberOfMonths:_,minValue:h,maxValue:g,disabled:a,weekdayFormat:f,pagedNavigation:u,isDateDisabled:y.value,isDateUnavailable:b.value,calendarLabel:x,nextPage:C,prevPage:w}),{isInvalid:ue,isDateSelected:de}=Sl({date:k,isDateDisabled:ee,isDateUnavailable:L});V(k,e=>{if(Array.isArray(e)&&e.length){let t=e[e.length-1];t&&!en(M.value,t)&&N(t)}else !Array.isArray(e)&&e&&!en(M.value,e)&&N(e)});function fe(e){if(m.value){if(!k.value)k.value=[e.copy()];else if(Array.isArray(k.value)){if(k.value.findIndex(t=>Qt(t,e))===-1)k.value=[...k.value,e];else if(!v.value){let t=k.value.filter(t=>!Qt(t,e));if(!t.length){M.value=e.copy(),k.value=void 0;return}k.value=t.map(e=>e.copy())}}}else{if(!k.value){k.value=e.copy();return}!v.value&&en(k.value,e)?(M.value=e.copy(),k.value=void 0):k.value=e.copy()}}return A(()=>{l.value&&Ya(D.value)}),jl({isDateUnavailable:L,dir:O,isDateDisabled:ee,locale:i,formatter:ce,modelValue:k,placeholder:M,disabled:a,initialFocus:l,pagedNavigation:u,weekStartsOn:d,weekdayFormat:f,fixedWeeks:p,multiple:m,numberOfMonths:_,readonly:c,preventDeselect:v,fullCalendarLabel:F,headingValue:I,isInvalid:ue,isDateSelected:de,isNextButtonDisabled:te,isPrevButtonDisabled:ne,isOutsideVisibleView:ie,nextPage:oe,prevPage:se,parentElement:D,onPlaceholderChange:N,onDateChange:fe}),(e,t)=>(P(),s(B(Q),{ref_key:`primitiveElement`,ref:E,as:e.as,"as-child":e.asChild,role:`application`,"aria-label":B(F),"data-readonly":B(c)?``:void 0,"data-disabled":B(a)?``:void 0,"data-invalid":B(ue)?``:void 0,dir:B(O)},{default:U(()=>[R(e.$slots,`default`,{date:B(M),grid:B(le),weekDays:B(re),weekStartsOn:B(d),locale:B(i),fixedWeeks:B(p)}),o(`div`,Ol,[o(`div`,kl,ae(B(F)),1)])]),_:3},8,[`as`,`as-child`,`aria-label`,`data-readonly`,`data-disabled`,`data-invalid`,`dir`]))}}),Nl=p({__name:`CalendarHeader`,props:{asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Pl=p({__name:`CalendarHeading`,props:{asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e,n=Al();return(e,r)=>(P(),s(B(Q),C(t,{"data-disabled":B(n).disabled.value?``:void 0}),{default:U(()=>[R(e.$slots,`default`,{headingValue:B(n).headingValue.value},()=>[u(ae(B(n).headingValue.value),1)])]),_:3},16,[`data-disabled`]))}}),Fl=p({__name:`CalendarGrid`,props:{asChild:{type:Boolean},as:{default:`table`}},setup(e){let t=e,n=Al(),r=a(()=>n.disabled.value?!0:void 0),i=a(()=>n.readonly.value?!0:void 0);return(e,n)=>(P(),s(B(Q),C(t,{tabindex:`-1`,role:`grid`,"aria-readonly":i.value,"aria-disabled":r.value,"data-readonly":i.value&&``,"data-disabled":r.value&&``}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-readonly`,`aria-disabled`,`data-readonly`,`data-disabled`]))}}),Il=p({__name:`CalendarCell`,props:{date:{},asChild:{type:Boolean},as:{default:`td`}},setup(e){let t=Al();return(e,n)=>{var r,i;return P(),s(B(Q),{as:e.as,"as-child":e.asChild,role:`gridcell`,"aria-selected":B(t).isDateSelected(e.date)?!0:void 0,"aria-disabled":B(t).isDateDisabled(e.date)||(i=(r=B(t)).isDateUnavailable)?.call(r,e.date),"data-disabled":B(t).isDateDisabled(e.date)?``:void 0},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-selected`,`aria-disabled`,`data-disabled`])}}}),Ll=p({__name:`CalendarHeadCell`,props:{asChild:{type:Boolean},as:{default:`th`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Rl=p({__name:`CalendarNext`,props:{step:{default:`month`},nextPage:{},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=a(()=>r.disabled.value||r.isNextButtonDisabled(t.step,t.nextPage)),r=Al();return(e,i)=>(P(),s(B(Q),{as:t.as,"as-child":t.asChild,"aria-label":`Next page`,type:e.as===`button`?`button`:void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:i[0]||=e=>B(r).nextPage(t.step,t.nextPage)},{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Next page`)])]),_:3},8,[`as`,`as-child`,`type`,`aria-disabled`,`data-disabled`,`disabled`]))}}),zl=p({__name:`CalendarPrev`,props:{step:{default:`month`},prevPage:{},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=a(()=>r.disabled.value||r.isPrevButtonDisabled(t.step,t.prevPage)),r=Al();return(e,i)=>(P(),s(B(Q),{"aria-label":`Previous page`,as:t.as,"as-child":t.asChild,type:e.as===`button`?`button`:void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:i[0]||=e=>B(r).prevPage(t.step,t.prevPage)},{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Prev page`)])]),_:3},8,[`as`,`as-child`,`type`,`aria-disabled`,`data-disabled`,`disabled`]))}}),Bl=p({__name:`CalendarGridHead`,props:{asChild:{type:Boolean},as:{default:`thead`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),C(t,{"aria-hidden":`true`}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Vl=p({__name:`CalendarGridBody`,props:{asChild:{type:Boolean},as:{default:`tbody`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Hl=p({__name:`CalendarGridRow`,props:{asChild:{type:Boolean},as:{default:`tr`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Ul=p({__name:`CalendarCellTrigger`,props:{day:{},month:{},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e,n=zs(),r=Al(),{primitiveElement:i,currentElement:o}=Vs(),c=a(()=>t.day.day.toLocaleString(r.locale.value)),l=a(()=>r.formatter.custom(ia(t.day),{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`})),d=a(()=>r.isDateDisabled(t.day)),f=a(()=>{var e;return(e=r.isDateUnavailable)?.call(r,t.day)}),p=a(()=>nn(t.day,dn())),m=a(()=>!$t(t.day,t.month)),h=a(()=>r.isOutsideVisibleView(t.day)),g=a(()=>!r.disabled.value&&Qt(t.day,r.placeholder.value)),_=a(()=>r.isDateSelected(t.day)),v=`[data-radix-vue-calendar-cell-trigger]:not([data-disabled]):not([data-outside-view]):not([data-outside-visible-view])`;function y(e){var t;r.readonly.value||r.isDateDisabled(e)||(t=r.isDateUnavailable)!=null&&t.call(r,e)||r.onDateChange(e)}function b(){y(t.day)}function x(e){e.preventDefault(),e.stopPropagation();let i=r.parentElement.value,a=i?Array.from(i.querySelectorAll(v)):[],s=a.indexOf(o.value),c=7,l=r.dir.value===`rtl`?-1:1;switch(e.code){case n.ARROW_RIGHT:s+=l;break;case n.ARROW_LEFT:s-=l;break;case n.ARROW_UP:s-=c;break;case n.ARROW_DOWN:s+=c;break;case n.ENTER:case n.SPACE_CODE:y(t.day);return;default:return}if(s>=0&&s{let e=i?Array.from(i.querySelectorAll(v)):[];if(!r.pagedNavigation.value){let t=ca(r.placeholder.value);e[t-Math.abs(s)].focus();return}e[e.length-Math.abs(s)].focus()});return}if(s>=a.length){if(r.isNextButtonDisabled(`month`))return;r.nextPage(),w(()=>{let e=i?Array.from(i.querySelectorAll(v)):[];if(!r.pagedNavigation.value){let t=ca(r.placeholder.value.add({months:r.numberOfMonths.value-1}));e[e.length-t+s-a.length].focus();return}e[s-a.length].focus()})}}return(e,n)=>(P(),s(B(Q),C({ref_key:`primitiveElement`,ref:i},t,{role:`button`,"aria-label":l.value,"data-radix-vue-calendar-cell-trigger":``,"aria-disabled":d.value||f.value?!0:void 0,"data-selected":_.value?!0:void 0,"data-value":e.day.toString(),"data-disabled":d.value?``:void 0,"data-unavailable":f.value?``:void 0,"data-today":p.value?``:void 0,"data-outside-view":m.value?``:void 0,"data-outside-visible-view":h.value?``:void 0,"data-focused":g.value?``:void 0,tabindex:g.value?0:m.value||d.value?void 0:-1,onClick:b,onKeydown:[W(x,[`up`,`down`,`left`,`right`,`space`,`enter`]),n[0]||=W(G(()=>{},[`prevent`]),[`enter`])]}),{default:U(()=>[R(e.$slots,`default`,{dayValue:c.value},()=>[u(ae(c.value),1)])]),_:3},16,[`aria-label`,`aria-disabled`,`data-selected`,`data-value`,`data-disabled`,`data-unavailable`,`data-today`,`data-outside-view`,`data-outside-visible-view`,`data-focused`,`tabindex`]))}});function Wl(e){return e===`indeterminate`}function Gl(e){return Wl(e)?`indeterminate`:e?`checked`:`unchecked`}const Kl=[`value`,`checked`,`name`,`disabled`,`required`],[ql,Jl]=K(`CheckboxRoot`),Yl=p({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultChecked:{type:Boolean},checked:{type:[Boolean,String],default:void 0},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{default:`on`},id:{},asChild:{type:Boolean},as:{default:`button`}},emits:[`update:checked`],setup(e,{emit:n}){let r=e,i=n,{disabled:o}=z(r),s=q(r,`checked`,i,{defaultValue:r.defaultChecked,passive:r.checked===void 0}),{forwardRef:u,currentElement:f}=X(),p=ds(f),m=a(()=>{var e;return r.id&&f.value?(e=document.querySelector(`[for="${r.id}"]`))?.innerText:void 0});return Jl({disabled:o,state:s}),(e,n)=>(P(),l(t,null,[d(B(Q),C(e.$attrs,{id:e.id,ref:B(u),role:`checkbox`,"as-child":r.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":B(Wl)(B(s))?`mixed`:B(s),"aria-required":r.required,"aria-label":e.$attrs[`aria-label`]||m.value,"data-state":B(Gl)(B(s)),"data-disabled":B(o)?``:void 0,disabled:B(o),onKeydown:W(G(()=>{},[`prevent`]),[`enter`]),onClick:n[0]||=e=>s.value=B(Wl)(B(s))?!0:!B(s)}),{default:U(()=>[R(e.$slots,`default`,{checked:B(s)})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`onKeydown`]),B(p)?(P(),l(`input`,{key:0,type:`checkbox`,tabindex:`-1`,"aria-hidden":`true`,value:e.value,checked:!!B(s),name:r.name,disabled:r.disabled,required:r.required,style:{transform:`translateX(-100%)`,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}},null,8,Kl)):c(``,!0)],64))}}),Xl=p({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{default:`span`}},setup(e){let{forwardRef:t}=X(),n=ql();return(e,r)=>(P(),s(B(Js),{present:e.forceMount||B(Wl)(B(n).state.value)||B(n).state.value===!0},{default:U(()=>[d(B(Q),C({ref:B(t),"data-state":B(Gl)(B(n).state.value),"data-disabled":B(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),[Zl,Ql]=K(`PopperRoot`),$l=p({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=L();return Ql({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>R(e.$slots,`default`)}}),eu=p({__name:`PopperAnchor`,props:{element:{},asChild:{type:Boolean},as:{}},setup(e){let t=e,{forwardRef:n,currentElement:r}=X(),i=Zl();return H(()=>{i.onAnchorChange(t.element??r.value)}),(e,t)=>(P(),s(B(Q),{ref:B(n),as:e.as,"as-child":e.asChild},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function tu(e){return e!==null}function nu(e){return{name:`transformOrigin`,options:e,fn(t){var n,r,i;let{placement:a,rects:o,middlewareData:s}=t,c=(n=s.arrow)?.centerOffset!==0,l=c?0:e.arrowWidth,u=c?0:e.arrowHeight,[d,f]=ru(a),p={start:`0%`,center:`50%`,end:`100%`}[f],m=((r=s.arrow)?.x??0)+l/2,h=((i=s.arrow)?.y??0)+u/2,g=``,_=``;return d===`bottom`?(g=c?p:`${m}px`,_=`${-u}px`):d===`top`?(g=c?p:`${m}px`,_=`${o.floating.height+u}px`):d===`right`?(g=`${-u}px`,_=c?p:`${h}px`):d===`left`&&(g=`${o.floating.width+u}px`,_=c?p:`${h}px`),{data:{x:g,y:_}}}}}function ru(e){let[t,n=`center`]=e.split(`-`);return[t,n]}const iu={side:`bottom`,sideOffset:0,align:`center`,alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,updatePositionStrategy:`optimized`,prioritizePosition:!1},[au,ou]=K(`PopperContent`),su=p({inheritAttrs:!1,__name:`PopperContent`,props:S({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...iu}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=Zl(),{forwardRef:o,currentElement:s}=X(),c=L(),u=L(),{width:f,height:p}=Ns(u),m=a(()=>n.side+(n.align===`center`?``:`-${n.align}`)),h=a(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),g=a(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),_=a(()=>({padding:h.value,boundary:g.value.filter(tu),altBoundary:g.value.length>0})),v=Xa(()=>[Ot({mainAxis:n.sideOffset+p.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&At({..._.value}),n.avoidCollisions&&kt({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?Pt():void 0,..._.value}),!n.prioritizePosition&&n.avoidCollisions&&At({..._.value}),jt({..._.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),u.value&&zt({element:u.value,padding:n.arrowPadding}),nu({arrowWidth:f.value,arrowHeight:p.value}),n.hideWhenDetached&&Mt({strategy:`referenceHidden`,..._.value})]),{floatingStyles:y,placement:b,isPositioned:x,middlewareData:S}=Ht(i.anchor,c,{strategy:`fixed`,placement:m,whileElementsMounted:(...e)=>Dt(...e,{animationFrame:n.updatePositionStrategy===`always`}),middleware:v}),w=a(()=>ru(b.value)[0]),T=a(()=>ru(b.value)[1]);he(()=>{x.value&&r(`placed`)});let D=a(()=>{var e;return(e=S.value.arrow)?.centerOffset!==0}),O=L(``);H(()=>{s.value&&(O.value=window.getComputedStyle(s.value).zIndex)});let k=a(()=>{var e;return(e=S.value.arrow)?.x??0}),A=a(()=>{var e;return(e=S.value.arrow)?.y??0});return ou({placedSide:w,onArrowChange:e=>u.value=e,arrowX:k,arrowY:A,shouldHideArrow:D}),(e,t)=>{var r,i,a;return P(),l(`div`,{ref_key:`floatingRef`,ref:c,"data-radix-popper-content-wrapper":``,style:E({...B(y),transform:B(x)?B(y).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:O.value,"--radix-popper-transform-origin":[(r=B(S).transformOrigin)?.x,(i=B(S).transformOrigin)?.y].join(` `),...(a=B(S).hide)?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[d(B(Q),C({ref:B(o)},e.$attrs,{"as-child":n.asChild,as:e.as,"data-side":w.value,"data-align":T.value,style:{animation:B(x)?void 0:`none`}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])],4)}}}),cu=o(`polygon`,{points:`0,0 30,0 15,10`},null,-1),lu=p({__name:`Arrow`,props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:`svg`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Q),C(t,{width:e.width,height:e.height,viewBox:e.asChild?void 0:`0 0 30 10`,preserveAspectRatio:e.asChild?void 0:`none`}),{default:U(()=>[R(e.$slots,`default`,{},()=>[cu])]),_:3},16,[`width`,`height`,`viewBox`,`preserveAspectRatio`]))}}),uu={top:`bottom`,right:`left`,bottom:`top`,left:`right`},du=p({inheritAttrs:!1,__name:`PopperArrow`,props:{width:{},height:{},asChild:{type:Boolean},as:{default:`svg`}},setup(e){let{forwardRef:t}=X(),n=au(),r=a(()=>uu[n.placedSide.value]);return(e,i)=>{var a,o,s,c;return P(),l(`span`,{ref:e=>{B(n).onArrowChange(e)},style:E({position:`absolute`,left:(a=B(n).arrowX)!=null&&a.value?`${(o=B(n).arrowX)?.value}px`:void 0,top:(s=B(n).arrowY)!=null&&s.value?`${(c=B(n).arrowY)?.value}px`:void 0,[r.value]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[B(n).placedSide.value],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[B(n).placedSide.value],visibility:B(n).shouldHideArrow.value?`hidden`:void 0})},[d(lu,C(e.$attrs,{ref:B(t),style:{display:`block`},as:e.as,"as-child":e.asChild,width:e.width,height:e.height}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`width`,`height`])],4)}}}),fu=p({__name:`VisuallyHidden`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){return X(),(e,t)=>(P(),s(B(Q),{as:e.as,"as-child":e.asChild,style:{position:`absolute`,border:0,width:`1px`,display:`inline-block`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}}),pu=p({__name:`VisuallyHiddenInput`,props:{name:{},value:{},required:{type:Boolean},disabled:{type:Boolean}},setup(e){let n=e,r=a(()=>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:`[${t}][${n.name}][${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,n)=>(P(!0),l(t,null,te(r.value,t=>(P(),s(fu,{key:t.name,as:`input`,type:`hidden`,hidden:``,readonly:``,name:t.name,value:t.value,required:e.required,disabled:e.disabled},null,8,[`name`,`value`,`required`,`disabled`]))),128))}}),mu=`data-radix-vue-collection-item`,[hu,gu]=K(`CollectionProvider`);function _u(e=mu){let t=L(new Map),n=L(),r=gu({collectionRef:n,itemMap:t,attrName:e}),{getItems:i}=bu(r),o=a(()=>Array.from(r.itemMap.value.values())),s=a(()=>r.itemMap.value.size);return{getItems:i,reactiveItems:o,itemMapSize:s}}const vu=p({name:`CollectionSlot`,setup(e,{slots:t}){let n=hu(),{primitiveElement:r,currentElement:i}=Vs();return V(i,()=>{n.collectionRef.value=i.value}),()=>v(Bs,{ref:r},t)}}),yu=p({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let r=hu(),{primitiveElement:i,currentElement:a}=Vs();return H(t=>{if(a.value){let n=x(a.value);r.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>r.itemMap.value.delete(n))}}),()=>v(Bs,{...n,[r.attrName]:``,ref:i},t)}});function bu(e){let t=e??hu();return{getItems:()=>{let e=t.collectionRef.value;if(!e)return[];let n=Array.from(e.querySelectorAll(`[${t.attrName}]`));return Array.from(t.itemMap.value.values()).sort((e,t)=>n.indexOf(e.ref)-n.indexOf(t.ref))}}}const[xu,Su]=K(`ComboboxRoot`),Cu=p({__name:`ComboboxRoot`,props:{modelValue:{},defaultValue:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean},searchTerm:{},selectedValue:{},multiple:{type:Boolean},disabled:{type:Boolean},name:{},dir:{},filterFunction:{},displayValue:{},resetSearchTermOnBlur:{type:Boolean,default:!0},resetSearchTermOnSelect:{type:Boolean,default:!0},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`,`update:open`,`update:searchTerm`,`update:selectedValue`],setup(e,{emit:t}){let n=e,r=t,{multiple:i,disabled:o,dir:l}=z(n),u=Y(l),f=q(n,`searchTerm`,r,{defaultValue:``,passive:n.searchTerm===void 0}),p=q(n,`modelValue`,r,{defaultValue:n.defaultValue??i.value?[]:void 0,passive:n.modelValue===void 0,deep:!0}),m=q(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),h=q(n,`selectedValue`,r,{defaultValue:void 0,passive:n.selectedValue===void 0});async function g(e){var t,r;m.value=e,await w(),e?(p.value&&(Array.isArray(p.value)&&i.value?h.value=(t=T().find(e=>{var t,n;return(n=(t=e.ref)?.dataset)?.state===`checked`}))?.value:h.value=p.value),await w(),(r=y.value)==null||r.focus(),I()):(v.value=!1,n.resetSearchTermOnBlur&&A(`blur`))}function _(e){if(Array.isArray(p.value)&&i.value){let t=p.value.findIndex(t=>Da(t,e)),n=[...p.value];t===-1?n.push(e):n.splice(t,1),p.value=n}else p.value=e,g(!1)}let v=L(!1),y=L(),b=L(),{forwardRef:x,currentElement:S}=X(),{getItems:T,reactiveItems:E,itemMapSize:D}=_u(`data-radix-vue-combobox-item`),O=L([]);V(()=>D.value,()=>{O.value=T().map(e=>e.value)},{immediate:!0,flush:`post`});let k=a(()=>{if(v.value){if(n.filterFunction)return n.filterFunction(O.value,f.value);let e=O.value.filter(e=>typeof e==`string`);if(e.length)return e.filter(e=>{var t;return e.toLowerCase().includes((t=f.value)?.toLowerCase())})}return O.value});function A(e){let t=e===`blur`||e===`select`&&n.resetSearchTermOnSelect;!i.value&&p.value&&!Array.isArray(p.value)?n.displayValue?f.value=n.displayValue(p.value):typeof p.value==`object`?t&&(f.value=``):f.value=p.value.toString():t&&(f.value=``)}let j=a(()=>k.value.findIndex(e=>Da(e,h.value))),M=a(()=>{var e;return(e=E.value.find(e=>Da(e.value,h.value)))?.ref}),N=a(()=>JSON.stringify(p.value));V(N,async()=>{await w(),await w(),A(`select`)},{immediate:!n.searchTerm}),V(()=>[k.value.length,f.value.length],async([e,t],[n,r])=>{await w(),await w(),e&&(r>t||j.value===-1)&&(h.value=k.value[0])});let F=ds(S);function I(){var e;M.value instanceof Element&&((e=M.value)==null||e.scrollIntoView({block:`nearest`}))}function ee(){M.value instanceof Element&&M.value.focus&&M.value.focus()}let te=L(!1);function ne(){te.value=!0}function re(){requestAnimationFrame(()=>{te.value=!1})}async function ie(e){var t;k.value.length&&h.value&&M.value instanceof Element&&(e.preventDefault(),e.stopPropagation(),te.value||(t=M.value)==null||t.click())}return Su({searchTerm:f,modelValue:p,onValueChange:_,isUserInputted:v,multiple:i,disabled:o,open:m,onOpenChange:g,filteredOptions:k,contentId:``,inputElement:y,selectedElement:M,onInputElementChange:e=>y.value=e,onInputNavigation:async e=>{let t=j.value;t===0&&e===`up`||t===k.value.length-1&&e===`down`||(t===-1&&k.value.length||e===`home`?h.value=k.value[0]:e===`end`?h.value=k.value[k.value.length-1]:h.value=k.value[e===`up`?t-1:t+1],await w(),I(),ee(),w(()=>{var e;return(e=y.value)?.focus({preventScroll:!0})}))},onInputEnter:ie,onCompositionEnd:re,onCompositionStart:ne,selectedValue:h,onSelectedValueChange:e=>h.value=e,parentElement:S,contentElement:b,onContentElementChange:e=>b.value=e}),(e,t)=>(P(),s(B($l),null,{default:U(()=>[d(B(Q),C({ref:B(x),style:{pointerEvents:B(m)?`auto`:void 0},as:e.as,"as-child":e.asChild,dir:B(u)},e.$attrs),{default:U(()=>[R(e.$slots,`default`,{open:B(m),modelValue:B(p)}),B(F)&&n.name?(P(),s(B(pu),{key:0,name:n.name,value:B(p)},null,8,[`name`,`value`])):c(``,!0)]),_:3},16,[`style`,`as`,`as-child`,`dir`])]),_:3}))}}),wu=p({__name:`ComboboxInput`,props:{type:{default:`text`},disabled:{type:Boolean},autoFocus:{type:Boolean},asChild:{type:Boolean},as:{default:`input`}},setup(e){let t=e,n=xu(),{forwardRef:r,currentElement:i}=X();A(()=>{let e=i.value.nodeName===`INPUT`?i.value:i.value.querySelector(`input`);e&&(n.onInputElementChange(e),setTimeout(()=>{t.autoFocus&&e?.focus()},1))});let o=a(()=>t.disabled||n.disabled.value||!1),c=L();ge(()=>{var e;return c.value=(e=n.selectedElement.value)?.id});function l(e){n.open.value?n.onInputNavigation(e.key===`ArrowUp`?`up`:`down`):n.onOpenChange(!0)}function u(e){n.open.value&&n.onInputNavigation(e.key===`Home`?`home`:`end`)}function d(e){var t;n.searchTerm.value=(t=e.target)?.value,n.open.value||n.onOpenChange(!0),n.isUserInputted.value=!0}return(e,t)=>(P(),s(B(Q),{ref:B(r),as:e.as,"as-child":e.asChild,type:e.type,disabled:o.value,value:B(n).searchTerm.value,"aria-expanded":B(n).open.value,"aria-controls":B(n).contentId,"aria-disabled":o.value??void 0,"aria-activedescendant":c.value,"aria-autocomplete":`list`,role:`combobox`,autocomplete:`false`,onInput:d,onKeydown:[W(G(l,[`prevent`]),[`down`,`up`]),W(B(n).onInputEnter,[`enter`]),W(G(u,[`prevent`]),[`home`,`end`])],onCompositionstart:B(n).onCompositionStart,onCompositionend:B(n).onCompositionEnd},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`type`,`disabled`,`value`,`aria-expanded`,`aria-controls`,`aria-disabled`,`aria-activedescendant`,`onKeydown`,`onCompositionstart`,`onCompositionend`]))}}),Tu=p({__name:`ComboboxAnchor`,props:{asChild:{type:Boolean},as:{}},setup(e){let{forwardRef:t}=X();return(e,n)=>(P(),s(B(eu),{"as-child":``},{default:U(()=>[d(B(Q),C({ref:B(t),"as-child":e.asChild,as:e.as},e.$attrs),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as-child`,`as`])]),_:3}))}}),Eu=p({__name:`ComboboxTrigger`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=xu(),r=a(()=>t.disabled||n.disabled.value||!1);return(e,i)=>(P(),s(B(Q),C(t,{type:e.as===`button`?`button`:void 0,tabindex:`-1`,"aria-label":`Show popup`,"aria-haspopup":`listbox`,"aria-expanded":B(n).open.value,"aria-controls":B(n).contentId,"data-state":B(n).open.value?`open`:`closed`,disabled:r.value,"data-disabled":r.value?``:void 0,"aria-disabled":r.value??void 0,onClick:i[0]||=e=>B(n).onOpenChange(!B(n).open.value)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`aria-disabled`]))}}),Du=p({__name:`ComboboxCancel`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=xu();function r(){var e;n.searchTerm.value=``,(e=n.inputElement.value)==null||e.focus()}return(e,n)=>(P(),s(B(Q),C({type:e.as===`button`?`button`:void 0},t,{tabindex:`-1`,onClick:r}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`type`]))}}),[Ou,ku]=K(`ComboboxGroup`),Au=p({__name:`ComboboxGroup`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,{currentRef:n,currentElement:r}=X(),i=Z(void 0,`radix-vue-combobox-group`),a=xu(),o=L(!1);function c(){if(!r.value)return;let e=r.value.querySelectorAll(`[data-radix-vue-combobox-item]:not([data-hidden])`);o.value=!!e.length}return jo(r,()=>{w(()=>{c()})},{childList:!0}),V(()=>a.searchTerm.value,()=>{w(()=>{c()})},{immediate:!0}),ku({id:i}),(e,r)=>_e((P(),s(B(Q),C(t,{ref_key:`currentRef`,ref:n,role:`group`,"aria-labelledby":B(i)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-labelledby`])),[[me,o.value]])}}),ju=p({__name:`ComboboxLabel`,props:{for:{},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;X();let n=Ou({id:``});return(e,r)=>(P(),s(B(Q),C(t,{id:B(n).id}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),[Mu,Nu]=K(`ComboboxContent`),Pu=p({__name:`ComboboxContentImpl`,props:{position:{default:`inline`},bodyLock:{type:Boolean},dismissable:{type:Boolean,default:!0},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(e,{emit:t}){let n=e,r=t,{position:i}=z(n),o=xu();$o(n.bodyLock);let{forwardRef:c,currentElement:l}=X();As(o.parentElement);let u=a(()=>n.position===`popper`?n:{}),d=fs(u.value);function f(e){o.onSelectedValueChange(``)}A(()=>{o.onContentElementChange(l.value)});let p={boxSizing:`border-box`,"--radix-combobox-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-combobox-content-available-width":`var(--radix-popper-available-width)`,"--radix-combobox-content-available-height":`var(--radix-popper-available-height)`,"--radix-combobox-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-combobox-trigger-height":`var(--radix-popper-anchor-height)`};return Nu({position:i}),(e,t)=>(P(),s(B(vu),null,{default:U(()=>[e.dismissable?(P(),s(B(xc),{key:0,"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onDismiss:t[0]||=e=>B(o).onOpenChange(!1),onFocusOutside:t[1]||=e=>{var t;(t=B(o).parentElement.value)!=null&&t.contains(e.target)&&e.preventDefault(),r(`focusOutside`,e)},onInteractOutside:t[2]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[3]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[4]||=e=>{var t;(t=B(o).parentElement.value)!=null&&t.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)}},{default:U(()=>[(P(),s(ne(B(i)===`popper`?B(su):B(Q)),C({...e.$attrs,...B(d)},{id:B(o).contentId,ref:B(c),role:`listbox`,"data-state":B(o).open.value?`open`:`closed`,style:{display:`flex`,flexDirection:`column`,outline:`none`,...B(i)===`popper`?p:{}},onPointerleave:f}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`style`]))]),_:3},8,[`disable-outside-pointer-events`])):(P(),s(ne(B(i)===`popper`?B(su):B(Q)),C({key:1},{...e.$attrs,...u.value},{id:B(o).contentId,ref:B(c),role:`listbox`,"data-state":B(o).open.value?`open`:`closed`,style:{display:`flex`,flexDirection:`column`,outline:`none`,...B(i)===`popper`?p:{}},onPointerleave:f}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`style`]))]),_:3}))}}),Fu=p({__name:`ComboboxContent`,props:{forceMount:{type:Boolean},position:{},bodyLock:{type:Boolean},dismissable:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(e,{emit:t}){let n=ps(e,t),{forwardRef:r}=X(),i=xu();return i.contentId||=Z(void 0,`radix-vue-combobox-content`),(e,t)=>(P(),s(B(Js),{present:e.forceMount||B(i).open.value},{default:U(()=>[d(Pu,C({...B(n),...e.$attrs},{ref:B(r)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`]))}}),Iu=p({__name:`ComboboxEmpty`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;X();let n=xu(),r=a(()=>n.filteredOptions.value.length===0);return(e,n)=>r.value?(P(),s(B(Q),T(C({key:0},t)),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`No options`)])]),_:3},16)):c(``,!0)}});function Lu(e){let t=qo({nonce:L()});return a(()=>{var n;return e?.value||(n=t.nonce)?.value})}const Ru=p({__name:`ComboboxViewport`,props:{nonce:{},asChild:{type:Boolean},as:{}},setup(e){let n=e,{forwardRef:r}=X(),{nonce:i}=z(n),a=Lu(i);return(e,i)=>(P(),l(t,null,[d(B(Q),C({...e.$attrs,...n},{ref:B(r),"data-radix-combobox-viewport":``,role:`presentation`,style:{position:`relative`,flex:1,overflow:`auto`}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16),d(B(Q),{as:`style`,nonce:B(a)},{default:U(()=>[u(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-radix-combobox-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-radix-combobox-viewport]::-webkit-scrollbar { display: none; } `)]),_:1},8,[`nonce`])],64))}}),[zu,Bu]=K(`ComboboxItem`),Vu=`combobox.select`,Hu=p({__name:`ComboboxItem`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=z(n),o=xu();Ou({id:``,options:L([])});let{forwardRef:c}=X(),l=a(()=>{var e,t;return o.multiple.value&&Array.isArray(o.modelValue.value)?(e=o.modelValue.value)?.some(e=>Da(e,n.value)):Da((t=o.modelValue)?.value,n.value)}),f=a(()=>Da(o.selectedValue.value,n.value)),p=Z(void 0,`radix-vue-combobox-item`),m=Z(void 0,`radix-vue-combobox-option`),h=a(()=>o.isUserInputted.value?o.searchTerm.value===``||!!o.filteredOptions.value.find(e=>Da(e,n.value)):!0);async function g(e){r(`select`,e),!(e!=null&&e.defaultPrevented)&&!i.value&&e&&o.onValueChange(n.value)}function _(e){if(!e)return;let t={originalEvent:e,value:n.value};xa(Vu,g,t)}async function v(e){await w(),!e.defaultPrevented&&o.onSelectedValueChange(n.value)}if(n.value===``)throw Error(`A must have a value prop that is not an empty string. This is because the Combobox value can be set to an empty string to clear the selection and show the placeholder.`);return Bu({isSelected:l}),(e,t)=>(P(),s(B(yu),{value:e.value},{default:U(()=>[_e(d(B(Q),{id:B(m),ref:B(c),role:`option`,tabindex:`-1`,"aria-labelledby":B(p),"data-highlighted":f.value?``:void 0,"aria-selected":l.value,"data-state":l.value?`checked`:`unchecked`,"aria-disabled":B(i)||void 0,"data-disabled":B(i)?``:void 0,as:e.as,"as-child":e.asChild,"data-hidden":h.value?void 0:!0,onClick:_,onPointermove:v},{default:U(()=>[R(e.$slots,`default`,{},()=>[u(ae(e.value),1)])]),_:3},8,[`id`,`aria-labelledby`,`data-highlighted`,`aria-selected`,`data-state`,`aria-disabled`,`data-disabled`,`as`,`as-child`,`data-hidden`]),[[me,h.value]])]),_:3},8,[`value`]))}}),Uu=p({__name:`ComboboxItemIndicator`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=e;X();let n=zu();return(e,r)=>B(n).isSelected.value?(P(),s(B(Q),C({key:0,"aria-hidden":`true`},t),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):c(``,!0)}}),Wu=p({__name:`ComboboxSeparator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Q),C(t,{"aria-hidden":`true`}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Gu=p({__name:`ComboboxArrow`,props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:`svg`}},setup(e){let t=e,n=xu(),r=Mu();return X(),(e,i)=>B(n).open.value&&B(r).position.value===`popper`?(P(),s(B(du),T(C({key:0},t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):c(``,!0)}}),Ku=p({__name:`ComboboxPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(pc),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),qu=p({__name:`MenuAnchor`,props:{element:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(eu),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Ju=p({__name:`MenuArrow`,props:{width:{},height:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(du),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}});function Yu(){let e=L(!1);return A(()=>{Eo(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),Eo([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}const Xu=to(Yu),[Zu,Qu]=K([`MenuRoot`,`MenuSub`],`MenuContext`),[$u,ed]=K(`MenuRoot`),td=p({__name:`MenuRoot`,props:{open:{type:Boolean,default:!1},dir:{},modal:{type:Boolean,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i,dir:a}=z(n),o=Y(a),c=q(n,`open`,r),l=L(),u=Xu();return Qu({open:c,onOpenChange:e=>{c.value=e},content:l,onContentChange:e=>{l.value=e}}),ed({onClose:()=>{c.value=!1},isUsingKeyboardRef:u,dir:o,modal:i}),(e,t)=>(P(),s(B($l),null,{default:U(()=>[R(e.$slots,`default`)]),_:3}))}}),nd=`rovingFocusGroup.onEntryFocus`,rd={bubbles:!1,cancelable:!0},id={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ad(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function od(e,t,n){let r=ad(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return id[r]}function sd(e,t=!1){let n=J();for(let r of e)if(r===n||(r.focus({preventScroll:t}),J()!==n))return}function cd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const[ld,ud]=K(`RovingFocusGroup`),dd=p({__name:`RovingFocusGroup`,props:{orientation:{default:void 0},dir:{},loop:{type:Boolean,default:!1},currentTabStopId:{},defaultCurrentTabStopId:{},preventScrollOnEntryFocus:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:[`entryFocus`,`update:currentTabStopId`],setup(e,{expose:t,emit:n}){let r=e,i=n,{loop:a,orientation:o,dir:c}=z(r),l=Y(c),u=q(r,`currentTabStopId`,i,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),f=L(!1),p=L(!1),m=L(0),{getItems:h}=_u();function g(e){let t=!p.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!f.value){let t=new CustomEvent(nd,rd);if(e.currentTarget.dispatchEvent(t),i(`entryFocus`,t),!t.defaultPrevented){let e=h().map(e=>e.ref).filter(e=>e.dataset.disabled!==``),t=e.find(e=>e.getAttribute(`data-active`)===`true`),n=e.find(e=>e.id===u.value),i=[t,n,...e].filter(Boolean);sd(i,r.preventScrollOnEntryFocus)}}p.value=!1}function _(){setTimeout(()=>{p.value=!1},1)}return t({getItems:h}),ud({loop:a,dir:l,orientation:o,currentTabStopId:u,onItemFocus:e=>{u.value=e},onItemShiftTab:()=>{f.value=!0},onFocusableItemAdd:()=>{m.value++},onFocusableItemRemove:()=>{m.value--}}),(e,t)=>(P(),s(B(vu),null,{default:U(()=>[d(B(Q),{tabindex:f.value||m.value===0?-1:0,"data-orientation":B(o),as:e.as,"as-child":e.asChild,dir:B(l),style:{outline:`none`},onMousedown:t[0]||=e=>p.value=!0,onMouseup:_,onFocus:g,onBlur:t[1]||=e=>f.value=!1},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`as`,`as-child`,`dir`])]),_:3}))}}),fd=p({__name:`RovingFocusItem`,props:{tabStopId:{},focusable:{type:Boolean,default:!0},active:{type:Boolean,default:!0},allowShiftKey:{type:Boolean},asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=e,n=ld(),r=a(()=>t.tabStopId||Z()),i=a(()=>n.currentTabStopId.value===r.value),{getItems:o}=bu();A(()=>{t.focusable&&n.onFocusableItemAdd()}),M(()=>{t.focusable&&n.onFocusableItemRemove()});function c(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=od(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...o().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?cd(i,t+1):i.slice(t+1)}w(()=>sd(i))}}return(e,t)=>(P(),s(B(yu),null,{default:U(()=>[d(B(Q),{tabindex:i.value?0:-1,"data-orientation":B(n).orientation.value,"data-active":e.active,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?B(n).onItemFocus(r.value):t.preventDefault()},onFocus:t[1]||=e=>B(n).onItemFocus(r.value),onKeydown:c},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[pd,md]=K(`MenuContent`),hd=p({__name:`MenuContentImpl`,props:S({loop:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},disableOutsideScroll:{type:Boolean},trapFocus:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...iu}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,i=Zu(),a=$u(),{trapFocus:o,disableOutsidePointerEvents:c,loop:l}=z(n);ls(),$o(c.value);let u=L(``),f=L(0),p=L(0),m=L(null),h=L(`right`),g=L(0),_=L(null),{createCollection:v}=rs(),{forwardRef:y,currentElement:b}=X(),x=v(b);V(b,e=>{i.onContentChange(e)});let{handleTypeaheadSearch:S}=Is(x);M(()=>{window.clearTimeout(f.value)});function C(e){var t,n;return h.value===(t=m.value)?.side&&Xc(e,(n=m.value)?.area)}async function w(e){var t;r(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),(t=b.value)==null||t.focus({preventScroll:!0}))}function T(e){if(e.defaultPrevented)return;let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1,i=Vo(e,J(),b.value,{loop:l.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!0,attributeName:`[data-radix-vue-collection-item]:not([data-disabled])`});if(i)return i?.focus();if(e.code===`Space`||(t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&S(e.key)),e.target!==b.value)||!Hc.includes(e.key))return;e.preventDefault();let o=x.value;Vc.includes(e.key)&&o.reverse(),Jc(o)}function E(e){var t,n;(n=(t=e?.currentTarget)?.contains)!=null&&n.call(t,e.target)||(window.clearTimeout(f.value),u.value=``)}function D(e){var t;if(!Zc(e))return;let n=e.target,r=g.value!==e.clientX;if((t=e?.currentTarget)!=null&&t.contains(n)&&r){let t=e.clientX>g.value?`right`:`left`;h.value=t,g.value=e.clientX}}return md({onItemEnter:e=>!!C(e),onItemLeave:e=>{var t;C(e)||((t=b.value)==null||t.focus(),_.value=null)},onTriggerLeave:e=>!!C(e),searchRef:u,pointerGraceTimerRef:p,onPointerGraceIntentChange:e=>{m.value=e}}),(e,t)=>(P(),s(B(Lc),{"as-child":``,trapped:B(o),onMountAutoFocus:w,onUnmountAutoFocus:t[7]||=e=>r(`closeAutoFocus`,e)},{default:U(()=>[d(B(xc),{"as-child":``,"disable-outside-pointer-events":B(c),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>r(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>r(`focusOutside`,e),onInteractOutside:t[5]||=e=>r(`interactOutside`,e),onDismiss:t[6]||=e=>r(`dismiss`)},{default:U(()=>[d(B(dd),{"current-tab-stop-id":_.value,"onUpdate:currentTabStopId":t[0]||=e=>_.value=e,"as-child":``,orientation:`vertical`,dir:B(a).dir.value,loop:B(l),onEntryFocus:t[1]||=e=>{r(`entryFocus`,e),B(a).isUsingKeyboardRef.value||e.preventDefault()}},{default:U(()=>[d(B(su),{ref:B(y),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-radix-menu-content":``,"data-state":B(Gc)(B(i).open.value),dir:B(a).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,onKeydown:T,onBlur:E,onPointermove:D},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`sticky`,`hide-when-detached`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),gd=p({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=pd(),{forwardRef:r}=X(),i=L(!1);async function a(e){if(!e.defaultPrevented&&Zc(e)){if(t.disabled)n.onItemLeave(e);else if(!n.onItemEnter(e)){let t=e.currentTarget;t?.focus({preventScroll:!0})}}}async function o(e){await w(),!e.defaultPrevented&&Zc(e)&&n.onItemLeave(e)}return(e,t)=>(P(),s(B(yu),{value:{textValue:e.textValue}},{default:U(()=>[d(B(Q),C({ref:B(r),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"data-radix-vue-collection-item":``,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":i.value?``:void 0,onPointermove:a,onPointerleave:o,onFocus:t[0]||=async t=>{await w(),!(t.defaultPrevented||e.disabled)&&(i.value=!0)},onBlur:t[1]||=async e=>{await w(),!e.defaultPrevented&&(i.value=!1)}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),_d=p({__name:`MenuItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=X(),o=$u(),c=pd(),l=L(!1);async function u(){let e=a.value;if(!n.disabled&&e){let e=new CustomEvent(Rc,{bubbles:!0,cancelable:!0});r(`select`,e),await w(),e.defaultPrevented?l.value=!1:o.onClose()}}return(e,t)=>(P(),s(gd,C(n,{ref:B(i),onClick:u,onPointerdown:t[0]||=()=>{l.value=!0},onPointerup:t[1]||=async e=>{var t;await w(),!e.defaultPrevented&&(l.value||(t=e.currentTarget)==null||t.click())},onKeydown:t[2]||=async t=>{let n=B(c).searchRef.value!==``;e.disabled||n&&t.key===` `||B(zc).includes(t.key)&&(t.currentTarget.click(),t.preventDefault())}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),[vd,yd]=K([`MenuCheckboxItem`,`MenuRadioItem`],`MenuItemIndicatorContext`),bd=p({__name:`MenuItemIndicator`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=vd({checked:L(!1)});return(e,n)=>(P(),s(B(Js),{present:e.forceMount||B(Kc)(B(t).checked.value)||B(t).checked.value===!0},{default:U(()=>[d(B(Q),{as:e.as,"as-child":e.asChild,"data-state":B(qc)(B(t).checked.value)},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`])]),_:3},8,[`present`]))}}),xd=p({__name:`MenuCheckboxItem`,props:{checked:{type:[Boolean,String],default:!1},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`,`update:checked`],setup(e,{emit:t}){let n=e,r=t,i=q(n,`checked`,r);return yd({checked:i}),(e,t)=>(P(),s(_d,C({role:`menuitemcheckbox`},n,{"aria-checked":B(Kc)(B(i))?`mixed`:B(i),"data-state":B(qc)(B(i)),onSelect:t[0]||=async e=>{r(`select`,e),B(Kc)(B(i))?i.value=!0:i.value=!B(i)}}),{default:U(()=>[R(e.$slots,`default`,{checked:B(i)})]),_:3},16,[`aria-checked`,`data-state`]))}}),Sd=p({__name:`MenuRootContentModal`,props:{loop:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=ps(n,r),a=Zu(),{forwardRef:o,currentElement:c}=X();return As(c),(e,t)=>(P(),s(hd,C(B(i),{ref:B(o),"trap-focus":B(a).open.value,"disable-outside-pointer-events":B(a).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>B(a).onOpenChange(!1),onFocusOutside:t[1]||=G(e=>r(`focusOutside`,e),[`prevent`])}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),Cd=p({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t),r=Zu();return(e,t)=>(P(),s(hd,C(B(n),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>B(r).onOpenChange(!1)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),wd=p({__name:`MenuContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t),r=Zu(),i=$u();return(e,t)=>(P(),s(B(Js),{present:e.forceMount||B(r).open.value},{default:U(()=>[B(i).modal.value?(P(),s(Sd,T(C({key:0},{...e.$attrs,...B(n)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):(P(),s(Cd,T(C({key:1},{...e.$attrs,...B(n)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Td=p({__name:`MenuGroup`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),C({role:`group`},t),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Ed=p({__name:`MenuLabel`,props:{asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Dd=p({__name:`MenuPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(pc),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),[Od,kd]=K(`MenuRadioGroup`),Ad=p({__name:`MenuRadioGroup`,props:{modelValue:{default:``},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=q(n,`modelValue`,t);return kd({modelValue:r,onValueChange:e=>{r.value=e}}),(e,t)=>(P(),s(Td,T(_(n)),{default:U(()=>[R(e.$slots,`default`,{modelValue:B(r)})]),_:3},16))}}),jd=p({__name:`MenuRadioItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{value:i}=z(n),o=Od(),c=a(()=>o.modelValue.value===i?.value);return yd({checked:c}),(e,t)=>(P(),s(_d,C({role:`menuitemradio`},n,{"aria-checked":c.value,"data-state":B(qc)(c.value),onSelect:t[0]||=async e=>{r(`select`,e),B(o).onValueChange(B(i))}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-checked`,`data-state`]))}}),Md=p({__name:`MenuSeparator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),C(t,{role:`separator`,"aria-orientation":`horizontal`}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),[Nd,Pd]=K(`MenuSub`),Fd=p({__name:`MenuSub`,props:{open:{type:Boolean,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=q(n,`open`,t,{defaultValue:!1,passive:n.open===void 0}),i=Zu(),a=L(),o=L();return H(e=>{i?.open.value===!1&&(r.value=!1),e(()=>r.value=!1)}),Qu({open:r,onOpenChange:e=>{r.value=e},content:o,onContentChange:e=>{o.value=e}}),Pd({triggerId:``,contentId:``,trigger:a,onTriggerChange:e=>{a.value=e}}),(e,t)=>(P(),s(B($l),null,{default:U(()=>[R(e.$slots,`default`)]),_:3}))}}),Id=p({__name:`MenuSubContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},sideOffset:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean,default:!0},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t),r=Zu(),i=$u(),a=Nd(),{forwardRef:o,currentElement:c}=X();return a.contentId||=Z(void 0,`radix-vue-menu-sub-content`),(e,t)=>(P(),s(B(Js),{present:e.forceMount||B(r).open.value},{default:U(()=>[d(hd,C(B(n),{id:B(a).contentId,ref:B(o),"aria-labelledby":B(a).triggerId,align:`start`,side:B(i).dir.value===`rtl`?`left`:`right`,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,"trap-focus":!1,onOpenAutoFocus:t[0]||=G(e=>{var t;B(i).isUsingKeyboardRef.value&&((t=B(c))==null||t.focus())},[`prevent`]),onCloseAutoFocus:t[1]||=G(()=>{},[`prevent`]),onFocusOutside:t[2]||=e=>{e.defaultPrevented||e.target!==B(a).trigger.value&&B(r).onOpenChange(!1)},onEscapeKeyDown:t[3]||=e=>{B(i).onClose(),e.preventDefault()},onKeydown:t[4]||=e=>{var t,n;let o=(t=e.currentTarget)?.contains(e.target),s=B(Wc)[B(i).dir.value].includes(e.key);o&&s&&(B(r).onOpenChange(!1),(n=B(a).trigger.value)==null||n.focus(),e.preventDefault())}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`,`side`])]),_:3},8,[`present`]))}}),Ld=p({__name:`MenuSubTrigger`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=Zu(),r=$u(),i=Nd(),a=pd(),o=L(null);i.triggerId||=Z(void 0,`radix-vue-menu-sub-trigger`);function c(){o.value&&window.clearTimeout(o.value),o.value=null}M(()=>{c()});function l(e){!Zc(e)||a.onItemEnter(e)||!t.disabled&&!n.open.value&&!o.value&&(a.onPointerGraceIntentChange(null),o.value=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))}async function u(e){var t,r;if(!Zc(e))return;c();let i=(t=n.content.value)?.getBoundingClientRect();if(i!=null&&i.width){let t=(r=n.content.value)?.dataset.side,o=t===`right`,s=o?-5:5,c=i[o?`left`:`right`],l=i[o?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:c,y:i.top},{x:l,y:i.top},{x:l,y:i.bottom},{x:c,y:i.bottom}],side:t}),window.clearTimeout(a.pointerGraceTimerRef.value),a.pointerGraceTimerRef.value=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e))return;a.onPointerGraceIntentChange(null)}}async function f(e){var i;let o=a.searchRef.value!==``;t.disabled||o&&e.key===` `||Uc[r.dir.value].includes(e.key)&&(n.onOpenChange(!0),await w(),(i=n.content.value)==null||i.focus(),e.preventDefault())}return(e,r)=>(P(),s(qu,{"as-child":``},{default:U(()=>[d(gd,C(t,{id:B(i).triggerId,ref:e=>{var t;(t=B(i))==null||t.onTriggerChange(e?.$el)},"aria-haspopup":`menu`,"aria-expanded":B(n).open.value,"aria-controls":B(i).contentId,"data-state":B(Gc)(B(n).open.value),onClick:r[0]||=async e=>{t.disabled||e.defaultPrevented||(e.currentTarget.focus(),B(n).open.value||B(n).onOpenChange(!0))},onPointermove:l,onPointerleave:u,onKeydown:f}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`aria-expanded`,`aria-controls`,`data-state`])]),_:3}))}}),[Rd,zd]=K(`ContextMenuRoot`),Bd=p({inheritAttrs:!1,__name:`ContextMenuRoot`,props:{dir:{},modal:{type:Boolean,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{dir:i,modal:a}=z(n);X();let o=Y(i),c=L(!1);return zd({open:c,onOpenChange:e=>{c.value=e},dir:o,modal:a}),V(c,e=>{r(`update:open`,e)}),(e,t)=>(P(),s(B(td),{open:c.value,"onUpdate:open":t[0]||=e=>c.value=e,dir:B(o),modal:B(a)},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`open`,`dir`,`modal`]))}});function Vd(e){return e.pointerType!==`mouse`}const Hd=p({inheritAttrs:!1,__name:`ContextMenuTrigger`,props:{disabled:{type:Boolean,default:!1},asChild:{type:Boolean},as:{default:`span`}},setup(e){let n=e,{disabled:r}=z(n),{forwardRef:i}=X(),o=Rd(),s=L({x:0,y:0}),c=a(()=>({getBoundingClientRect:()=>({width:0,height:0,left:s.value.x,right:s.value.x,top:s.value.y,bottom:s.value.y,...s.value})})),u=L(0);function f(){window.clearTimeout(u.value)}function p(e){s.value={x:e.clientX,y:e.clientY},o.onOpenChange(!0)}async function m(e){r.value||(await w(),e.defaultPrevented||(f(),p(e),e.preventDefault()))}async function h(e){r.value||(await w(),Vd(e)&&!e.defaultPrevented&&(f(),u.value=window.setTimeout(()=>p(e),700)))}async function g(e){r.value||(await w(),Vd(e)&&!e.defaultPrevented&&f())}return(e,n)=>(P(),l(t,null,[d(B(qu),{as:`template`,element:c.value},null,8,[`element`]),d(B(Q),C({ref:B(i),as:e.as,"as-child":e.asChild,"data-state":B(o).open.value?`open`:`closed`,"data-disabled":B(r)?``:void 0,style:{WebkitTouchCallout:`none`}},e.$attrs,{onContextmenu:m,onPointerdown:h,onPointermove:g,onPointercancel:g,onPointerup:g}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-state`,`data-disabled`])],64))}}),Ud=p({__name:`ContextMenuPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(Dd),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Wd=p({__name:`ContextMenuContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},alignOffset:{default:0},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},sticky:{default:`partial`},hideWhenDetached:{type:Boolean,default:!1},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t);X();let r=Rd(),i=L(!1);return(e,t)=>(P(),s(B(wd),C(B(n),{side:`right`,"side-offset":2,align:`start`,style:{"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`},onCloseAutoFocus:t[0]||=e=>{!e.defaultPrevented&&i.value&&e.preventDefault(),i.value=!1},onInteractOutside:t[1]||=e=>{!e.defaultPrevented&&!B(r).modal.value&&(i.value=!0)}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Gd=p({__name:`ContextMenuArrow`,props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:`svg`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Ju),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Kd=p({__name:`ContextMenuItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(_d),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),qd=p({__name:`ContextMenuGroup`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Td),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Jd=p({__name:`ContextMenuSeparator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Md),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Yd=p({__name:`ContextMenuCheckboxItem`,props:{checked:{type:[Boolean,String]},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`,`update:checked`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(xd),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Xd=p({__name:`ContextMenuItemIndicator`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(bd),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Zd=p({__name:`ContextMenuLabel`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Ed),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Qd=p({__name:`ContextMenuRadioGroup`,props:{modelValue:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(Ad),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),$d=p({__name:`ContextMenuRadioItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(jd),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),ef=p({__name:`ContextMenuSub`,props:{defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;X();let i=q(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return(e,t)=>(P(),s(B(Fd),{open:B(i),"onUpdate:open":t[0]||=e=>b(i)?i.value=e:null},{default:U(()=>[R(e.$slots,`default`,{open:B(i)})]),_:3},8,[`open`]))}}),tf=p({__name:`ContextMenuSubContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},sideOffset:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t);return X(),(e,t)=>(P(),s(B(Id),C(B(n),{style:{"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),nf=p({__name:`ContextMenuSubTrigger`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Ld),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),rf=[`hour`,`minute`,`second`];function af(e){let{formatter:t}=e,n=Ua.map(t=>[t,e.value[t]]);if(`hour`in e.value){let r=Wa.map(n=>n===`dayPeriod`?[n,t.dayPeriod(ia(e.value))]:[n,e.value[n]]),i=[...n,...r];return Object.fromEntries(i)}return Object.fromEntries(n)}function sf(e){let t=Ga.map(e=>e===`dayPeriod`?[e,`AM`]:[e,null]).filter(([t])=>t===`literal`||t===null||e===`minute`&&t===`second`||e===`hour`&&(t===`second`||t===`minute`)?!1:e===`day`?!rf.includes(t)&&t!==`dayPeriod`:!0);return Object.fromEntries(t)}function cf(e){let{segmentValues:t,formatter:n,locale:r}=e;function i(i){if(`hour`in t){let a=t[i];return a===null?La(i,``,r.value):i===`day`&&t.month!==null?n.part(e.dateRef.set({[i]:a,month:t.month}),i,{hourCycle:e.hourCycle===24?`h24`:void 0}):n.part(e.dateRef.set({[i]:a}),i,{hourCycle:e.hourCycle===24?`h24`:void 0})}else{if(Ka(i)){let a=t[i];return a===null?La(i,``,r.value):i===`day`&&t.month!==null?n.part(e.dateRef.set({[i]:a,month:t.month}),i):n.part(e.dateRef.set({[i]:a}),i)}return``}}return Object.keys(t).reduce((e,n)=>{if(!qa(n))return e;if(`hour`in t&&n===`dayPeriod`){let i=t[n];i===null?e[n]=La(n,`AM`,r.value):e[n]=i}else e[n]=i(n);return e},{})}function lf(e){let{granularity:t,formatter:n,contentObj:r,hideTimeZone:i,hourCycle:a}=e;return n.toParts(e.dateRef,Ja(t,a)).map(e=>[`literal`,`timeZoneName`,null].includes(e.type)||!qa(e.type)?{part:e.type,value:e.value}:{part:e.type,value:r[e.type]}).filter(t=>!(t.part===null||t.value===null||t.part===`timeZoneName`&&(!oa(e.dateRef)||i)))}function uf(e){let t=cf(e),n=lf({contentObj:t,...e});return{obj:t,arr:n}}function df(e){let t=zs();return e===t.ARROW_RIGHT||e===t.ARROW_LEFT}function ff(e){return!Number.isNaN(Number.parseInt(e))}function pf(e){let t=zs();return!!([t.ENTER,t.ARROW_UP,t.ARROW_DOWN,t.ARROW_LEFT,t.ARROW_RIGHT,t.BACKSPACE,t.SPACE,`a`,`A`,`p`,`P`].includes(e)||ff(e))}function mf(e){return Array.from(e.querySelectorAll(`[data-radix-vue-date-field-segment]`)).filter(e=>e.getAttribute(`data-radix-vue-date-field-segment`)!==`literal`)}const hf=[`id`,`value`,`name`,`disabled`,`required`],[gf,_f]=K(`DateFieldRoot`),vf=p({inheritAttrs:!1,__name:`DateFieldRoot`,props:{defaultValue:{default:void 0},defaultPlaceholder:{},placeholder:{default:void 0},modelValue:{},hourCycle:{},granularity:{},hideTimeZone:{type:Boolean},maxValue:{},minValue:{},locale:{default:`en`},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},isDateUnavailable:{type:Function,default:void 0},name:{},required:{type:Boolean},id:{},dir:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`,`update:placeholder`],setup(e,{expose:n,emit:r}){let i=e,s=r,{locale:c,disabled:u,readonly:f,isDateUnavailable:p,granularity:m,defaultValue:h,dir:g}=z(i),_=os(i.locale),v=Y(g),{primitiveElement:y,currentElement:b}=Vs(),x=L(new Set);A(()=>{mf(b.value).forEach(e=>x.value.add(e))});let S=q(i,`modelValue`,s,{defaultValue:h.value,passive:i.modelValue===void 0}),T=Ma({defaultPlaceholder:i.placeholder,granularity:m.value,defaultValue:S.value,locale:i.locale}),E=q(i,`placeholder`,s,{defaultValue:i.defaultPlaceholder??T.copy(),passive:i.placeholder===void 0}),D=a(()=>i.granularity?sa(E.value)?i.granularity:`day`:sa(E.value)?`minute`:`day`),O=a(()=>{var e;return S.value?!!((e=p.value)!=null&&e.call(p,S.value)||i.minValue&&la(S.value,i.minValue)||i.maxValue&&la(i.maxValue,S.value)):!1}),k=sf(D.value),j=L(S.value?{...af({value:S.value,formatter:_})}:{...k}),M=a(()=>uf({granularity:D.value,dateRef:E.value,formatter:_,hideTimeZone:i.hideTimeZone,hourCycle:i.hourCycle,segmentValues:j.value,locale:c})),N=a(()=>M.value.arr),F=a(()=>N.value.filter(({part:e})=>e!==`literal`));V(c,e=>{_.getLocale()!==e&&(_.setLocale(e),w(()=>{x.value.clear(),mf(b.value).forEach(e=>x.value.add(e))}))}),V(S,e=>{!ja(e)&&E.value.compare(e)!==0&&(E.value=e.copy())}),V([S,c],([e])=>{ja(e)?Object.values(j.value).every(e=>e!==null)&&e===void 0&&(j.value={...k}):j.value={...af({value:e,formatter:_})}});let I=L(null),ee=a(()=>Array.from(x.value).findIndex(e=>{var t;return e.getAttribute(`data-radix-vue-date-field-segment`)===(t=I.value)?.getAttribute(`data-radix-vue-date-field-segment`)})),te=a(()=>{let e=v.value===`rtl`?-1:1;return(e<0?ee.value<0:ee.value>x.value.size-1)?null:Array.from(x.value)[ee.value+e]}),ne=a(()=>{let e=v.value===`rtl`?-1:1;return(e>0?ee.value<0:ee.value>x.value.size-1)?null:Array.from(x.value)[ee.value-e]}),re=zs();function ie(e){var t,n;df(e.key)&&(e.key===re.ARROW_LEFT&&((t=ne.value)==null||t.focus()),e.key===re.ARROW_RIGHT&&((n=te.value)==null||n.focus()))}function ae(e){I.value=e}return _f({isDateUnavailable:p.value,locale:c,modelValue:S,placeholder:E,disabled:u,formatter:_,hourCycle:i.hourCycle,readonly:f,segmentValues:j,isInvalid:O,segmentContents:F,elements:x,setFocusedElement:ae,focusNext(){var e;(e=te.value)==null||e.focus()}}),n({setFocusedElement:ae}),(e,n)=>(P(),l(t,null,[d(B(Q),C(e.$attrs,{ref_key:`primitiveElement`,ref:y,role:`group`,"aria-disabled":B(u)?!0:void 0,"data-disabled":B(u)?``:void 0,"data-readonly":B(f)?``:void 0,"data-invalid":O.value?``:void 0,dir:B(v),onKeydown:W(ie,[`left`,`right`])}),{default:U(()=>[R(e.$slots,`default`,{modelValue:B(S),segments:N.value,isInvalid:O.value})]),_:3},16,[`aria-disabled`,`data-disabled`,`data-readonly`,`data-invalid`,`dir`]),o(`input`,{id:e.id,type:`text`,tabindex:`-1`,"aria-hidden":`true`,value:B(S)?B(S).toString():``,name:e.name,disabled:B(u),required:e.required,style:{transform:`translateX(-100%)`,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0},onFocus:n[0]||=e=>{var t,n;return(n=(t=Array.from(x.value))?.[0])?.focus()}},null,40,hf)],64))}});function yf(e){return{role:`spinbutton`,contenteditable:!0,tabindex:e.disabled?void 0:0,spellcheck:!1,inputmode:`numeric`,autocorrect:`off`,enterkeyhint:`next`,style:`caret-color: transparent;`}}function bf(e){let{segmentValues:t,placeholder:n}=e,r=t.day===null,i=t.day?n.set({day:t.day}):n,a=i.day,o=1,s=ca(i),c=r?`Empty`:`${a}`;return{...yf(e),"aria-label":`day,`,"aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":a,"aria-valuetext":c,"data-placeholder":r?``:void 0}}function xf(e){let{segmentValues:t,placeholder:n,formatter:r}=e,i=t.month===null,a=t.month?n.set({month:t.month}):n,o=a.month,s=1,c=12,l=i?`Empty`:`${o} - ${r.fullMonth(ia(a))}`;return{...yf(e),"aria-label":`month, `,contenteditable:!0,"aria-valuemin":s,"aria-valuemax":c,"aria-valuenow":o,"aria-valuetext":l,"data-placeholder":i?``:void 0}}function Sf(e){let{segmentValues:t,placeholder:n}=e,r=t.year===null,i=t.year?n.set({year:t.year}):n,a=1,o=9999,s=i.year,c=r?`Empty`:`${s}`;return{...yf(e),"aria-label":`year, `,"aria-valuemin":a,"aria-valuemax":o,"aria-valuenow":s,"aria-valuetext":c,"data-placeholder":r?``:void 0}}function Cf(e){let{segmentValues:t,hourCycle:n,placeholder:r}=e;if(!(`hour`in t)||!(`hour`in r))return{};let i=t.hour===null,a=t.hour?r.set({hour:t.hour}):r,o=n===12?1:0,s=n===12?12:23,c=a.hour,l=i?`Empty`:`${c} ${t.dayPeriod??``}`;return{...yf(e),"aria-label":`hour, `,"aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":c,"aria-valuetext":l,"data-placeholder":i?``:void 0}}function wf(e){let{segmentValues:t,placeholder:n}=e;if(!(`minute`in t)||!(`minute`in n))return{};let r=t.minute===null,i=(t.minute?n.set({minute:t.minute}):n).minute,a=0,o=59,s=r?`Empty`:`${i}`;return{...yf(e),"aria-label":`minute, `,"aria-valuemin":a,"aria-valuemax":o,"aria-valuenow":i,"aria-valuetext":s,"data-placeholder":r?``:void 0}}function Tf(e){let{segmentValues:t,placeholder:n}=e;if(!(`second`in t)||!(`second`in n))return{};let r=t.second===null,i=(t.second?n.set({second:t.second}):n).second,a=0,o=59,s=r?`Empty`:`${i}`;return{...yf(e),"aria-label":`second, `,"aria-valuemin":a,"aria-valuemax":o,"aria-valuenow":i,"aria-valuetext":s,"data-placeholder":r?``:void 0}}function Ef(e){let{segmentValues:t}=e;if(!(`dayPeriod`in t))return{};let n=0,r=12,i=t.hour?t.hour>12?t.hour-12:t.hour:0,a=t.dayPeriod??`AM`;return{...yf(e),inputmode:`text`,"aria-label":`AM/PM`,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":i,"aria-valuetext":a}}function Df(e){return{"aria-hidden":!0,"data-segment":`literal`}}function Of(e){return{role:`textbox`,"aria-label":`timezone, `,"data-readonly":!0,"data-segment":`timeZoneName`,tabindex:e.disabled?void 0:0,style:`caret-color: transparent;`}}function kf(e){let{segmentValues:t,placeholder:n}=e,r=0,i=0,a=0,o=`era`in t?t.era:n.era;return{...yf(e),"aria-label":`era`,"aria-valuemin":r,"aria-valuemax":i,"aria-valuenow":a,"aria-valuetext":o}}const Af={day:{attrs:bf},month:{attrs:xf},year:{attrs:Sf},hour:{attrs:Cf},minute:{attrs:wf},second:{attrs:Tf},dayPeriod:{attrs:Ef},literal:{attrs:Df},timeZoneName:{attrs:Of},era:{attrs:kf}};function jf(e){let t=zs();function n({e,part:n,dateRef:r,prevValue:i}){let a=e.key===t.ARROW_UP?1:-1,o=0,s=59;if(i===null)return a>0?o:s;let c=[n,a];return r.set({[n]:i}).cycle(...c)[n]}function r(t){if(e.hasLeftFocus.value=!1,t===null)return t;let n=t.toString();return n.length===1?(e.modelValue.value=void 0,null):Number.parseInt(n.slice(0,-1))}function i({e:n,part:r,dateRef:i,prevValue:a,hourCycle:o}){let s=n.key===t.ARROW_UP?1:-1;if(a===null)return i[r];if(r===`hour`&&`hour`in i){let e=[r,s,{hourCycle:o}];return i.set({[r]:a}).cycle(...e)[r]}let c=[r,s];return r===`day`&&e.segmentValues.value.month!==null?i.set({[r]:a,month:e.segmentValues.value.month}).cycle(...c)[r]:i.set({[r]:a}).cycle(...c)[r]}function o(t,n,r){let i=!1,a=Math.floor(t/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,r=null),r===null)return n===0?(e.lastKeyZero.value=!0,{value:null,moveToNext:i}):((e.lastKeyZero.value||n>a)&&(i=!0),e.lastKeyZero.value=!1,{value:n,moveToNext:i});let o=r.toString().length,s=Number.parseInt(r.toString()+n.toString());return o===2||s>t?((n>a||s>t)&&(i=!0),{value:n,moveToNext:i}):(i=!0,{value:s,moveToNext:i})}function s(t,n){let r=!1,i=5;if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,n=null),n===null)return t===0?(e.lastKeyZero.value=!0,{value:0,moveToNext:r}):((e.lastKeyZero.value||t>i)&&(r=!0),e.lastKeyZero.value=!1,{value:t,moveToNext:r});let a=n.toString().length,o=Number.parseInt(n.toString()+t.toString());return a===2||o>59?(t>i&&(r=!0),{value:t,moveToNext:r}):(r=!0,{value:o,moveToNext:r})}function c(t,n){let r=!1,i=2;if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,n=null),n===null)return t===0?(e.lastKeyZero.value=!0,{value:0,moveToNext:r}):((e.lastKeyZero.value||t>i)&&(r=!0),e.lastKeyZero.value=!1,{value:t,moveToNext:r});let a=n.toString().length,o=Number.parseInt(n.toString()+t.toString());return a===2||o>24?(t>i&&(r=!0),{value:t,moveToNext:r}):(r=!0,{value:o,moveToNext:r})}function l(t,n){let r=!1;if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,n=null),n===null)return{value:t===0?1:t,moveToNext:r};let i=n.toString()+t.toString();return i.length>4?{value:t===0?1:t,moveToNext:r}:(i.length===4&&(r=!0),{value:Number.parseInt(i),moveToNext:r})}let u=a(()=>{var t;return(t=Af[e.part])?.attrs({disabled:e.disabled.value,placeholder:e.placeholder.value,hourCycle:e.hourCycle,segmentValues:e.segmentValues.value,formatter:e.formatter})??{}});function d(n){if(!pf(n.key)||df(n.key))return;let a=e.segmentValues.value.day;if(n.key===t.ARROW_DOWN||n.key===t.ARROW_UP){e.segmentValues.value.day=i({e:n,part:`day`,dateRef:e.placeholder.value,prevValue:a});return}if(ff(n.key)){let t=Number.parseInt(n.key),r=e.segmentValues.value.month,i=ca(r?e.placeholder.value.set({month:r}):e.placeholder.value),{value:s,moveToNext:c}=o(i,t,a);e.segmentValues.value.day=s,c&&e.focusNext()}n.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.day=r(a))}function f(n){if(!pf(n.key)||df(n.key))return;let a=e.segmentValues.value.month;if(n.key===t.ARROW_DOWN||n.key===t.ARROW_UP){e.segmentValues.value.month=i({e:n,part:`month`,dateRef:e.placeholder.value,prevValue:a});return}if(ff(n.key)){let t=Number.parseInt(n.key),{value:r,moveToNext:i}=o(12,t,a);e.segmentValues.value.month=r,i&&e.focusNext()}n.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.month=r(a))}function p(n){if(!pf(n.key)||df(n.key))return;let a=e.segmentValues.value.year;if(n.key===t.ARROW_DOWN||n.key===t.ARROW_UP){e.segmentValues.value.year=i({e:n,part:`year`,dateRef:e.placeholder.value,prevValue:a});return}if(ff(n.key)){let t=Number.parseInt(n.key),{value:r,moveToNext:i}=l(t,a);e.segmentValues.value.year=r,i&&e.focusNext()}n.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.year=r(a))}function m(n){let a=e.placeholder.value;if(!pf(n.key)||df(n.key)||!(`hour`in a)||!(`hour`in e.segmentValues.value))return;let o=e.segmentValues.value.hour,s=e.hourCycle;if(n.key===t.ARROW_UP||n.key===t.ARROW_DOWN){e.segmentValues.value.hour=i({e:n,part:`hour`,dateRef:e.placeholder.value,prevValue:o,hourCycle:s}),`dayPeriod`in e.segmentValues.value&&(e.segmentValues.value.hour<12?e.segmentValues.value.dayPeriod=`AM`:e.segmentValues.value.hour&&(e.segmentValues.value.dayPeriod=`PM`));return}if(ff(n.key)){let t=Number.parseInt(n.key),{value:r,moveToNext:i}=c(t,o);`dayPeriod`in e.segmentValues.value&&r&&r>12?e.segmentValues.value.dayPeriod=`PM`:`dayPeriod`in e.segmentValues.value&&r&&(e.segmentValues.value.dayPeriod=`AM`),e.segmentValues.value.hour=r,i&&e.focusNext()}n.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.hour=r(o))}function h(i){let a=e.placeholder.value;if(!pf(i.key)||df(i.key)||!(`minute`in a)||!(`minute`in e.segmentValues.value))return;let o=e.segmentValues.value.minute;if(e.segmentValues.value.minute=n({e:i,part:`minute`,dateRef:e.placeholder.value,prevValue:o}),ff(i.key)){let t=Number.parseInt(i.key),{value:n,moveToNext:r}=s(t,o);e.segmentValues.value.minute=n,r&&e.focusNext()}i.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.minute=r(o))}function g(i){let a=e.placeholder.value;if(!pf(i.key)||df(i.key)||!(`second`in a)||!(`second`in e.segmentValues.value))return;let o=e.segmentValues.value.second;if(e.segmentValues.value.second=n({e:i,part:`second`,dateRef:e.placeholder.value,prevValue:o}),ff(i.key)){let t=Number.parseInt(i.key),{value:n,moveToNext:r}=s(t,o);e.segmentValues.value.second=n,r&&e.focusNext()}i.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.second=r(o))}function _(n){if(!((!pf(n.key)||df(n.key))&&n.key!==`a`&&n.key!==`p`||!(`hour`in e.placeholder.value)||!(`dayPeriod`in e.segmentValues.value))){if(n.key===t.ARROW_UP||n.key===t.ARROW_DOWN){if(e.segmentValues.value.dayPeriod===`AM`){e.segmentValues.value.dayPeriod=`PM`,e.segmentValues.value.hour=e.segmentValues.value.hour+12;return}e.segmentValues.value.dayPeriod=`AM`,e.segmentValues.value.hour=e.segmentValues.value.hour-12;return}if([`a`,`A`].includes(n.key)&&e.segmentValues.value.dayPeriod!==`AM`){e.segmentValues.value.dayPeriod=`AM`,e.segmentValues.value.hour=e.segmentValues.value.hour-12;return}[`p`,`P`].includes(n.key)&&e.segmentValues.value.dayPeriod!==`PM`&&(e.segmentValues.value.dayPeriod=`PM`,e.segmentValues.value.hour=e.segmentValues.value.hour+12)}}function v(t){e.disabled.value&&t.preventDefault()}function y(n){let r=e.disabled.value,i=e.readonly.value;if(n.key!==t.TAB&&n.preventDefault(),!(r||i)&&({day:d,month:f,year:p,hour:m,minute:h,second:g,dayPeriod:_,timeZoneName:()=>{}}[e.part](n),![t.ARROW_LEFT,t.ARROW_RIGHT].includes(n.key)&&n.key!==t.TAB&&n.key!==t.SHIFT&&pf(n.key)&&Object.values(e.segmentValues.value).every(e=>e!==null))){let t={...e.segmentValues.value},n=e.placeholder.value.copy();Object.keys(t).forEach(e=>{let r=t[e];n=n.set({[e]:r})}),e.modelValue.value=n.copy()}}return{handleSegmentClick:v,handleSegmentKeydown:y,attributes:u}}const Mf=p({__name:`DateFieldInput`,props:{part:{},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=gf(),r=L(!0),i=L(!1),{handleSegmentClick:o,handleSegmentKeydown:c,attributes:l}=jf({hasLeftFocus:r,lastKeyZero:i,placeholder:n.placeholder,hourCycle:n.hourCycle,segmentValues:n.segmentValues,formatter:n.formatter,part:t.part,disabled:n.disabled,readonly:n.readonly,focusNext:n.focusNext,modelValue:n.modelValue}),u=a(()=>n.disabled.value),d=a(()=>n.readonly.value),f=a(()=>n.isInvalid.value);return(e,t)=>(P(),s(B(Q),C({as:e.as,"as-child":e.asChild},B(l),{contenteditable:u.value||d.value?!1:e.part!==`literal`,"data-radix-vue-date-field-segment":e.part,"aria-disabled":u.value?!0:void 0,"aria-readonly":d.value?!0:void 0,"data-disabled":u.value?``:void 0,"data-invalid":f.value?``:void 0,"aria-invalid":f.value?!0:void 0},se(e.part===`literal`?{}:{mousedown:B(o),keydown:B(c),focusout:()=>{r.value=!0},focusin:e=>{B(n).setFocusedElement(e.target)}})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`contenteditable`,`data-radix-vue-date-field-segment`,`aria-disabled`,`aria-readonly`,`data-disabled`,`data-invalid`,`aria-invalid`]))}}),Nf=p({__name:`DatePickerHeader`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Nl),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Pf=p({__name:`DatePickerHeading`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Pl),T(_(t)),{default:U(({headingValue:t})=>[R(e.$slots,`default`,{headingValue:t},()=>[u(ae(t),1)])]),_:3},16))}}),Ff=p({__name:`DatePickerGrid`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Fl),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),If=p({__name:`DatePickerCell`,props:{date:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Il),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Lf=p({__name:`DatePickerHeadCell`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Ll),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Rf=p({__name:`DatePickerNext`,props:{step:{},nextPage:{type:Function},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Rl),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),zf=p({__name:`DatePickerPrev`,props:{step:{},prevPage:{type:Function},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(zl),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Bf=p({__name:`DatePickerGridHead`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Bl),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Vf=p({__name:`DatePickerGridBody`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Vl),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Hf=p({__name:`DatePickerGridRow`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Hl),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Uf=p({__name:`DatePickerCellTrigger`,props:{day:{},month:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Ul),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Wf=p({__name:`DatePickerInput`,props:{part:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Mf),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),[Gf,Kf]=K(`DatePickerRoot`),qf=p({inheritAttrs:!1,__name:`DatePickerRoot`,props:{defaultValue:{default:void 0},defaultPlaceholder:{},placeholder:{default:void 0},modelValue:{},hourCycle:{},granularity:{},hideTimeZone:{type:Boolean},maxValue:{},minValue:{},locale:{default:`en`},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},isDateUnavailable:{type:Function,default:void 0},name:{},required:{type:Boolean},id:{},dir:{},asChild:{type:Boolean},as:{},defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},modal:{type:Boolean,default:!1},isDateDisabled:{type:Function,default:void 0},pagedNavigation:{type:Boolean,default:!1},weekStartsOn:{default:0},weekdayFormat:{default:`narrow`},fixedWeeks:{type:Boolean,default:!1},numberOfMonths:{default:1},preventDeselect:{type:Boolean,default:!1}},emits:[`update:modelValue`,`update:placeholder`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{locale:i,disabled:o,readonly:c,pagedNavigation:l,weekStartsOn:u,weekdayFormat:d,fixedWeeks:f,numberOfMonths:p,preventDeselect:m,isDateDisabled:h,isDateUnavailable:g,defaultOpen:_,modal:v,id:y,name:x,required:S,minValue:C,maxValue:w,granularity:T,hideTimeZone:E,hourCycle:D,defaultValue:O,dir:k}=z(n),A=Y(k),j=q(n,`modelValue`,r,{defaultValue:O.value,passive:n.modelValue===void 0}),M=a(()=>Ma({defaultPlaceholder:n.placeholder,granularity:n.granularity,defaultValue:j.value,locale:n.locale})),N=q(n,`placeholder`,r,{defaultValue:n.defaultPlaceholder??M.value.copy(),passive:n.placeholder===void 0}),F=q(n,`open`,r,{defaultValue:_.value,passive:n.open===void 0}),I=L();return V(j,e=>{e&&e.compare(N.value)!==0&&(N.value=e.copy())}),Kf({isDateUnavailable:g.value,isDateDisabled:h.value,locale:i,disabled:o,pagedNavigation:l,weekStartsOn:u,weekdayFormat:d,fixedWeeks:f,numberOfMonths:p,readonly:c,preventDeselect:m,modelValue:j,placeholder:N,defaultOpen:_,modal:v,open:F,id:y,name:x,required:S,minValue:C,maxValue:w,granularity:T,hideTimeZone:E,hourCycle:D,dateFieldRef:I,dir:A,onDateChange(e){!e||!j.value?j.value=e?.copy()??void 0:!m.value&&e&&j.value.compare(e)===0?j.value=void 0:j.value=e.copy()},onPlaceholderChange(e){N.value=e.copy()}}),(e,t)=>(P(),s(B(lg),{open:B(F),"onUpdate:open":t[0]||=e=>b(F)?F.value=e:null,"default-open":B(_),modal:B(v)},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`open`,`default-open`,`modal`]))}}),Jf=p({__name:`DatePickerCalendar`,setup(e){let t=Gf();return(e,n)=>(P(),s(B(Ml),C({isDateDisabled:B(t).isDateDisabled,isDateUnavailable:B(t).isDateUnavailable,minValue:B(t).minValue.value,maxValue:B(t).maxValue.value,locale:B(t).locale.value,disabled:B(t).disabled.value,pagedNavigation:B(t).pagedNavigation.value,weekStartsOn:B(t).weekStartsOn.value,weekdayFormat:B(t).weekdayFormat.value,fixedWeeks:B(t).fixedWeeks.value,numberOfMonths:B(t).numberOfMonths.value,readonly:B(t).readonly.value,preventDeselect:B(t).preventDeselect.value,dir:B(t).dir.value},{"model-value":B(t).modelValue.value,placeholder:B(t).placeholder.value,"initial-focus":``,multiple:!1,"onUpdate:modelValue":n[0]||=e=>{e&&B(t).modelValue.value&&B(en)(e,B(t).modelValue.value)||B(t).onDateChange(e)},"onUpdate:placeholder":n[1]||=e=>{B(en)(e,B(t).placeholder.value)||B(t).onPlaceholderChange(e)}}),{default:U(({weekDays:t,grid:n,date:r,weekStartsOn:i,locale:a,fixedWeeks:o})=>[R(e.$slots,`default`,{date:r,grid:n,weekDays:t,weekStartsOn:i,locale:a,fixedWeeks:o})]),_:3},16,[`model-value`,`placeholder`]))}}),Yf=p({__name:`DatePickerField`,setup(e){let t=Gf();return(e,n)=>(P(),s(B(vf),C({ref:B(t).dateFieldRef,"model-value":B(t).modelValue.value,placeholder:B(t).placeholder.value},{id:B(t).id.value,name:B(t).name.value,disabled:B(t).disabled.value,minValue:B(t).minValue.value,maxValue:B(t).maxValue.value,readonly:B(t).readonly.value,hourCycle:B(t).hourCycle.value,granularity:B(t).granularity.value,hideTimeZone:B(t).hideTimeZone.value,locale:B(t).locale.value,isDateUnavailable:B(t).isDateUnavailable,required:B(t).required.value,dir:B(t).dir.value},{"onUpdate:modelValue":n[0]||=e=>{e&&B(t).modelValue.value&&e.compare(B(t).modelValue.value)===0||B(t).onDateChange(e)},"onUpdate:placeholder":n[1]||=e=>{e.compare(B(t).placeholder.value)!==0&&B(t).onPlaceholderChange(e)}}),{default:U(({segments:t,modelValue:n})=>[R(e.$slots,`default`,{segments:t,modelValue:n})]),_:3},16,[`model-value`,`placeholder`]))}}),Xf=p({__name:`DatePickerAnchor`,props:{element:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(vg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Zf=p({__name:`DatePickerArrow`,props:{width:{},height:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(gg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Qf=p({__name:`DatePickerClose`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(_g),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),$f=p({__name:`DatePickerTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=Gf();return(e,r)=>(P(),s(B(ug),C({"data-radix-vue-date-field-segment":`trigger`},t,{disabled:B(n).disabled.value,onFocusin:r[0]||=e=>{var t;(t=B(n).dateFieldRef.value)==null||t.setFocusedElement(e.target)}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`disabled`]))}}),ep=p({__name:`DatePickerContent`,props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t);return(e,t)=>(P(),s(B(dg),null,{default:U(()=>[d(B(hg),T(_({...B(n),...e.$attrs})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)]),_:3}))}}),tp=p({__name:`DateRangePickerHeader`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Hg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),np=p({__name:`DateRangePickerHeading`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Ug),T(_(t)),{default:U(({headingValue:t})=>[R(e.$slots,`default`,{headingValue:t},()=>[u(ae(t),1)])]),_:3},16))}}),rp=p({__name:`DateRangePickerGrid`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Wg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),ip=p({__name:`DateRangePickerCell`,props:{date:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Gg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),ap=p({__name:`DateRangePickerHeadCell`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Kg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),op=p({__name:`DateRangePickerNext`,props:{step:{},nextPage:{type:Function},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(qg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),sp=p({__name:`DateRangePickerPrev`,props:{step:{},prevPage:{type:Function},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Jg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),cp=p({__name:`DateRangePickerGridHead`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Yg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),lp=p({__name:`DateRangePickerGridBody`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Xg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),up=p({__name:`DateRangePickerGridRow`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Zg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),dp=p({__name:`DateRangePickerCellTrigger`,props:{day:{},month:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Qg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),fp=p({__name:`DateRangePickerInput`,props:{part:{},type:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Dp),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),[pp,mp]=K(`DateRangePickerRoot`),hp=p({inheritAttrs:!1,__name:`DateRangePickerRoot`,props:{defaultValue:{default:()=>({start:void 0,end:void 0})},defaultPlaceholder:{},placeholder:{default:void 0},modelValue:{},hourCycle:{},granularity:{},hideTimeZone:{type:Boolean},maxValue:{},minValue:{},locale:{default:`en`},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},isDateUnavailable:{type:Function,default:void 0},name:{},required:{type:Boolean},id:{},dir:{},asChild:{type:Boolean},as:{},defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},modal:{type:Boolean,default:!1},isDateDisabled:{type:Function,default:void 0},pagedNavigation:{type:Boolean,default:!1},weekStartsOn:{default:0},weekdayFormat:{default:`narrow`},fixedWeeks:{type:Boolean,default:!1},numberOfMonths:{default:1},preventDeselect:{type:Boolean,default:!1}},emits:[`update:modelValue`,`update:placeholder`,`update:startValue`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{locale:i,disabled:a,readonly:o,pagedNavigation:c,weekStartsOn:l,weekdayFormat:u,fixedWeeks:d,numberOfMonths:f,preventDeselect:p,isDateDisabled:m,isDateUnavailable:h,defaultOpen:g,modal:_,id:v,name:y,required:x,minValue:S,maxValue:C,granularity:w,hideTimeZone:T,hourCycle:E,dir:D}=z(n),O=Y(D),k=q(n,`modelValue`,r,{defaultValue:n.defaultValue??{start:void 0,end:void 0},passive:n.modelValue===void 0}),A=Ma({defaultPlaceholder:n.placeholder,granularity:n.granularity,defaultValue:k.value.start,locale:n.locale}),j=q(n,`placeholder`,r,{defaultValue:n.defaultPlaceholder??A.copy(),passive:n.placeholder===void 0}),M=q(n,`open`,r,{defaultValue:g.value,passive:n.open===void 0}),N=L();return V(k,e=>{e.start&&e.start.compare(j.value)!==0&&(j.value=e.start.copy())}),mp({isDateUnavailable:h.value,isDateDisabled:m.value,locale:i,disabled:a,pagedNavigation:c,weekStartsOn:l,weekdayFormat:u,fixedWeeks:d,numberOfMonths:f,readonly:o,preventDeselect:p,modelValue:k,placeholder:j,defaultOpen:g,modal:_,open:M,id:v,name:y,required:x,minValue:S,maxValue:C,granularity:w,hideTimeZone:T,hourCycle:E,dateFieldRef:N,dir:O,onStartValueChange(e){r(`update:startValue`,e)},onDateChange(e){var t,n;k.value={start:(t=e.start)?.copy(),end:(n=e.end)?.copy()}},onPlaceholderChange(e){j.value=e.copy()}}),(e,t)=>(P(),s(B(lg),{open:B(M),"onUpdate:open":t[0]||=e=>b(M)?M.value=e:null,"default-open":B(g),modal:B(_)},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`open`,`default-open`,`modal`]))}}),gp=p({__name:`DateRangePickerCalendar`,setup(e){let t=pp();return(e,n)=>(P(),s(B(Vg),C({isDateDisabled:B(t).isDateDisabled,isDateUnavailable:B(t).isDateUnavailable,locale:B(t).locale.value,disabled:B(t).disabled.value,pagedNavigation:B(t).pagedNavigation.value,weekStartsOn:B(t).weekStartsOn.value,weekdayFormat:B(t).weekdayFormat.value,fixedWeeks:B(t).fixedWeeks.value,numberOfMonths:B(t).numberOfMonths.value,readonly:B(t).readonly.value,preventDeselect:B(t).preventDeselect.value,minValue:B(t).minValue.value,maxValue:B(t).maxValue.value,dir:B(t).dir.value},{"initial-focus":``,"model-value":B(t).modelValue.value,placeholder:B(t).placeholder.value,"onUpdate:startValue":n[0]||=e=>{B(t).onStartValueChange(e)},"onUpdate:modelValue":n[1]||=e=>{e.start&&B(t).modelValue.value.start&&e.end&&B(t).modelValue.value.end&&B(en)(e.start,B(t).modelValue.value.start)&&B(en)(e.end,B(t).modelValue.value.end)||B(t).onDateChange(e)},"onUpdate:placeholder":n[2]||=e=>{B(en)(e,B(t).placeholder.value)||B(t).onPlaceholderChange(e)}}),{default:U(({weekDays:t,grid:n,date:r,weekStartsOn:i,locale:a,fixedWeeks:o})=>[R(e.$slots,`default`,{date:r,grid:n,weekDays:t,weekStartsOn:i,locale:a,fixedWeeks:o})]),_:3},16,[`model-value`,`placeholder`]))}}),_p=p({__name:`DateRangePickerField`,setup(e){let t=pp();return(e,n)=>(P(),s(B(Ep),C({ref:B(t).dateFieldRef,"model-value":B(t).modelValue.value,placeholder:B(t).placeholder.value},{id:B(t).id.value,name:B(t).name.value,disabled:B(t).disabled.value,minValue:B(t).minValue.value,maxValue:B(t).maxValue.value,readonly:B(t).readonly.value,hourCycle:B(t).hourCycle.value,granularity:B(t).granularity.value,hideTimeZone:B(t).hideTimeZone.value,locale:B(t).locale.value,isDateUnavailable:B(t).isDateUnavailable,required:B(t).required.value,dir:B(t).dir.value},{"onUpdate:modelValue":n[0]||=e=>{e.start&&B(t).modelValue.value.start&&e.end&&B(t).modelValue.value.end&&e.start.compare(B(t).modelValue.value.start)===0&&e.end.compare(B(t).modelValue.value.end)===0||B(t).onDateChange(e)},"onUpdate:placeholder":n[1]||=e=>{B(en)(e,B(t).placeholder.value)&&e.compare(B(t).placeholder.value)===0||B(t).onPlaceholderChange(e)}}),{default:U(({segments:t,modelValue:n})=>[R(e.$slots,`default`,{segments:t,modelValue:n})]),_:3},16,[`model-value`,`placeholder`]))}}),vp=p({__name:`DateRangePickerAnchor`,props:{element:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(vg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),yp=p({__name:`DateRangePickerArrow`,props:{width:{},height:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(gg),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),bp=p({__name:`DateRangePickerClose`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(_g),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),xp=p({__name:`DateRangePickerTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=pp();return(e,r)=>(P(),s(B(ug),C({"data-radix-vue-date-field-segment":`trigger`},t,{disabled:B(n).disabled.value,onFocusin:r[0]||=e=>{var t;(t=B(n).dateFieldRef.value)==null||t.setFocusedElement(e.target)}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`disabled`]))}}),Sp=p({__name:`DateRangePickerContent`,props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t);return(e,t)=>(P(),s(B(dg),null,{default:U(()=>[d(B(hg),T(_({...B(n),...e.$attrs})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)]),_:3}))}}),Cp=[`id`,`value`,`name`,`disabled`,`required`],[wp,Tp]=K(`DateRangeFieldRoot`),Ep=p({inheritAttrs:!1,__name:`DateRangeFieldRoot`,props:{defaultValue:{default:void 0},defaultPlaceholder:{},placeholder:{default:void 0},modelValue:{},hourCycle:{},granularity:{},hideTimeZone:{type:Boolean},maxValue:{},minValue:{},locale:{default:`en`},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},isDateUnavailable:{type:Function,default:void 0},name:{},required:{type:Boolean},id:{},dir:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`,`update:placeholder`],setup(e,{expose:n,emit:r}){var i,s;let c=e,u=r,{locale:f,disabled:p,readonly:m,isDateUnavailable:h,dir:g}=z(c),_=os(c.locale),{primitiveElement:v,currentElement:y}=Vs(),b=L(new Set),x=Y(g);A(()=>{mf(y.value).forEach(e=>b.value.add(e))});let S=q(c,`modelValue`,u,{defaultValue:c.defaultValue??{start:void 0,end:void 0},passive:c.modelValue===void 0}),T=Ma({defaultPlaceholder:c.placeholder,granularity:c.granularity,defaultValue:S.value.start,locale:c.locale}),E=q(c,`placeholder`,u,{defaultValue:c.defaultPlaceholder??T.copy(),passive:c.placeholder===void 0}),D=a(()=>c.granularity?sa(E.value)?c.granularity:`day`:sa(E.value)?`minute`:`day`),O=a(()=>{var e;return S.value.start?!!((e=h.value)!=null&&e.call(h,S.value.start)||c.minValue&&la(S.value.start,c.minValue)||c.maxValue&&la(c.maxValue,S.value.start)):!1}),k=a(()=>{var e;return S.value.end?!!((e=h.value)!=null&&e.call(h,S.value.end)||c.minValue&&la(S.value.end,c.minValue)||c.maxValue&&la(c.maxValue,S.value.end)):!1}),j=a(()=>O.value||k.value?!0:!S.value.start||!S.value.end?!1:!da(S.value.start,S.value.end)||h.value!==void 0&&!_a(S.value.start,S.value.end,h.value,void 0)),M=sf(D.value),N=L(S.value.start?{...af({value:S.value.start,formatter:_})}:{...M}),F=L(S.value.end?{...af({value:S.value.end,formatter:_})}:{...M}),I=a(()=>uf({granularity:D.value,dateRef:E.value,formatter:_,hideTimeZone:c.hideTimeZone,hourCycle:c.hourCycle,segmentValues:N.value,locale:f})),ee=a(()=>uf({granularity:D.value,dateRef:E.value,formatter:_,hideTimeZone:c.hideTimeZone,hourCycle:c.hourCycle,segmentValues:F.value,locale:f})),te=a(()=>({start:I.value.arr,end:ee.value.arr})),ne=a(()=>({start:te.value.start.filter(({part:e})=>e!==`literal`),end:te.value.end.filter(({part:e})=>e!==`literal`)})),re=L((i=S.value.start)?.copy()),ie=L((s=S.value.end)?.copy());V([re,ie],([e,t])=>{S.value={start:e?.copy(),end:t?.copy()}}),V(S,e=>{e.start&&e.end&&((!re.value||e.start.compare(re.value)!==0)&&(re.value=e.start.copy()),(!ie.value||e.end.compare(ie.value)!==0)&&(ie.value=e.end.copy()))}),V([re,f],([e])=>{e===void 0?Object.values(N.value).every(e=>e!==null)&&e===void 0&&(N.value={...M}):N.value={...af({value:e,formatter:_})}}),V(f,e=>{_.getLocale()!==e&&(_.setLocale(e),w(()=>{b.value.clear(),mf(y.value).forEach(e=>b.value.add(e))}))}),V(S,e=>{e.start!==void 0&&E.value.compare(e.start)!==0&&(E.value=e.start.copy())}),V([ie,f],([e])=>{e===void 0?Object.values(F.value).every(e=>e!==null)&&e===void 0&&(F.value={...M}):F.value={...af({value:e,formatter:_})}});let ae=L(null),oe=a(()=>Array.from(b.value).findIndex(e=>{var t,n;return e.getAttribute(`data-radix-vue-date-field-segment`)===(t=ae.value)?.getAttribute(`data-radix-vue-date-field-segment`)&&e.getAttribute(`data-radix-vue-date-range-field-segment-type`)===(n=ae.value)?.getAttribute(`data-radix-vue-date-range-field-segment-type`)})),se=a(()=>{let e=x.value===`rtl`?-1:1;return(e<0?oe.value<0:oe.value>b.value.size-1)?null:Array.from(b.value)[oe.value+e]}),ce=a(()=>{let e=x.value===`rtl`?-1:1;return(e>0?oe.value<0:oe.value>b.value.size-1)?null:Array.from(b.value)[oe.value-e]}),le=zs();function ue(e){var t,n;df(e.key)&&(e.key===le.ARROW_LEFT&&((t=ce.value)==null||t.focus()),e.key===le.ARROW_RIGHT&&((n=se.value)==null||n.focus()))}function de(e){ae.value=e}return Tp({isDateUnavailable:h.value,locale:f,startValue:re,endValue:ie,placeholder:E,disabled:p,formatter:_,hourCycle:c.hourCycle,readonly:m,segmentValues:{start:N,end:F},isInvalid:j,segmentContents:ne,elements:b,setFocusedElement:de,focusNext(){var e;(e=se.value)==null||e.focus()}}),n({setFocusedElement:de}),(e,n)=>{var r,i;return P(),l(t,null,[d(B(Q),C(e.$attrs,{ref_key:`primitiveElement`,ref:v,role:`group`,"aria-disabled":B(p)?!0:void 0,"data-disabled":B(p)?``:void 0,"data-readonly":B(m)?``:void 0,"data-invalid":j.value?``:void 0,dir:B(x),onKeydown:W(ue,[`left`,`right`])}),{default:U(()=>[R(e.$slots,`default`,{modelValue:B(S),segments:te.value})]),_:3},16,[`aria-disabled`,`data-disabled`,`data-readonly`,`data-invalid`,`dir`]),o(`input`,{id:e.id,type:`text`,tabindex:`-1`,"aria-hidden":`true`,value:`${(r=B(S).start)?.toString()} - ${(i=B(S).end)?.toString()}`,name:e.name,disabled:B(p),required:e.required,style:{transform:`translateX(-100%)`,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0},onFocus:n[0]||=e=>{var t,n;return(n=(t=Array.from(b.value))?.[0])?.focus()}},null,40,Cp)],64)}}}),Dp=p({__name:`DateRangeFieldInput`,props:{part:{},type:{},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=wp(),r=L(!0),i=L(!1),{handleSegmentClick:o,handleSegmentKeydown:c,attributes:l}=jf({hasLeftFocus:r,lastKeyZero:i,placeholder:n.placeholder,hourCycle:n.hourCycle,segmentValues:n.segmentValues[t.type],formatter:n.formatter,part:t.part,disabled:n.disabled,readonly:n.readonly,focusNext:n.focusNext,modelValue:t.type===`start`?n.startValue:n.endValue}),u=a(()=>n.disabled.value),d=a(()=>n.readonly.value),f=a(()=>n.isInvalid.value);return(e,t)=>(P(),s(B(Q),C({as:e.as,"as-child":e.asChild},B(l),{contenteditable:u.value||d.value?!1:e.part!==`literal`,"data-radix-vue-date-field-segment":e.part,"aria-disabled":u.value?!0:void 0,"aria-readonly":d.value?!0:void 0,"data-disabled":u.value?``:void 0,"data-radix-vue-date-range-field-segment-type":e.type,"data-invalid":f.value?``:void 0,"aria-invalid":f.value?!0:void 0},se(e.part===`literal`?{}:{mousedown:B(o),keydown:B(c),focusout:()=>{r.value=!0},focusin:e=>{B(n).setFocusedElement(e.target)}})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`contenteditable`,`data-radix-vue-date-field-segment`,`aria-disabled`,`aria-readonly`,`data-disabled`,`data-radix-vue-date-range-field-segment-type`,`data-invalid`,`aria-invalid`]))}}),[Op,kp]=K(`DropdownMenuRoot`),Ap=p({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0},dir:{},modal:{type:Boolean,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;X();let i=q(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=L(),{modal:o,dir:c}=z(n),l=Y(c);return kp({open:i,onOpenChange:e=>{i.value=e},onOpenToggle:()=>{i.value=!i.value},triggerId:``,triggerElement:a,contentId:``,modal:o,dir:l}),(e,t)=>(P(),s(B(td),{open:B(i),"onUpdate:open":t[0]||=e=>b(i)?i.value=e:null,dir:B(l),modal:B(o)},{default:U(()=>[R(e.$slots,`default`,{open:B(i)})]),_:3},8,[`open`,`dir`,`modal`]))}}),jp=p({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=Op(),{forwardRef:r,currentElement:i}=X();return A(()=>{n.triggerElement=i}),n.triggerId||=Z(void 0,`radix-vue-dropdown-menu-trigger`),(e,i)=>(P(),s(B(qu),{"as-child":``},{default:U(()=>[d(B(Q),{id:B(n).triggerId,ref:B(r),type:e.as===`button`?`button`:void 0,"as-child":t.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":B(n).open.value,"aria-controls":B(n).open.value?B(n).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":B(n).open.value?`open`:`closed`,onClick:i[0]||=async t=>{var r;!e.disabled&&t.button===0&&t.ctrlKey===!1&&((r=B(n))==null||r.onOpenToggle(),await w(),B(n).open.value&&t.preventDefault())},onKeydown:i[1]||=W(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&B(n).onOpenToggle(),t.key===`ArrowDown`&&B(n).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),Mp=p({__name:`DropdownMenuPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(Dd),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Np=p({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t);X();let r=Op(),i=L(!1);function a(e){e.defaultPrevented||(i.value||setTimeout(()=>{var e;(e=r.triggerElement.value)==null||e.focus()},0),i.value=!1,e.preventDefault())}return r.contentId||=Z(void 0,`radix-vue-dropdown-menu-content`),(e,t)=>{var o;return P(),s(B(wd),C(B(n),{id:B(r).contentId,"aria-labelledby":(o=B(r))?.triggerId,style:{"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`},onCloseAutoFocus:a,onInteractOutside:t[0]||=e=>{var t;if(e.defaultPrevented)return;let n=e.detail.originalEvent,a=n.button===0&&n.ctrlKey===!0,o=n.button===2||a;(!B(r).modal.value||o)&&(i.value=!0),(t=B(r).triggerElement.value)!=null&&t.contains(e.target)&&e.preventDefault()}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`])}}}),Pp=p({__name:`DropdownMenuArrow`,props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:`svg`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Ju),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Fp=p({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(_d),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Ip=p({__name:`DropdownMenuGroup`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Td),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Lp=p({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Md),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Rp=p({__name:`DropdownMenuCheckboxItem`,props:{checked:{type:[Boolean,String]},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`,`update:checked`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(xd),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),zp=p({__name:`DropdownMenuItemIndicator`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(bd),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Bp=p({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Ed),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Vp=p({__name:`DropdownMenuRadioGroup`,props:{modelValue:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(Ad),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Hp=p({__name:`DropdownMenuRadioItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`],setup(e,{emit:t}){let n=ps(e,t);return X(),(e,t)=>(P(),s(B(jd),T(_(B(n))),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Up=p({__name:`DropdownMenuSub`,props:{defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=q(n,`open`,t,{passive:n.open===void 0,defaultValue:n.defaultOpen??!1});return X(),(e,t)=>(P(),s(B(Fd),{open:B(r),"onUpdate:open":t[0]||=e=>b(r)?r.value=e:null},{default:U(()=>[R(e.$slots,`default`,{open:B(r)})]),_:3},8,[`open`]))}}),Wp=p({__name:`DropdownMenuSubContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},sideOffset:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t);return X(),(e,t)=>(P(),s(B(Id),C(B(n),{style:{"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Gp=p({__name:`DropdownMenuSubTrigger`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Ld),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Kp=[`value`,`name`,`disabled`,`required`],[qp,Jp]=K(`EditableRoot`),Yp=p({inheritAttrs:!1,__name:`EditableRoot`,props:{defaultValue:{},modelValue:{},placeholder:{default:`Enter text...`},dir:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean},activationMode:{default:`focus`},selectOnFocus:{type:Boolean,default:!1},submitMode:{default:`blur`},startWithEditMode:{type:Boolean},maxLength:{},autoResize:{type:Boolean,default:!1},id:{},name:{},required:{type:Boolean,default:!1},asChild:{type:Boolean},as:{default:`div`}},emits:[`update:modelValue`,`submit`,`update:state`],setup(e,{expose:n,emit:r}){let i=e,o=r,{id:s,name:u,defaultValue:f,startWithEditMode:p,placeholder:m,maxLength:h,disabled:g,dir:_,submitMode:v,activationMode:y,selectOnFocus:b,readonly:x,autoResize:S,required:w}=z(i),T=L(),E=Y(_),D=L(p.value??!1),O=q(i,`modelValue`,o,{defaultValue:f.value??``,passive:i.modelValue===void 0}),{primitiveElement:k,currentElement:A}=Vs(),j=ds(A),M=a(()=>typeof m.value==`string`?{edit:m.value,preview:m.value}:m.value),N=L(O.value);V(()=>O.value,()=>{N.value=O.value},{immediate:!0,deep:!0});function F(){D.value=!1,o(`update:state`,`cancel`)}function I(){D.value=!0,N.value=O.value,o(`update:state`,`edit`)}function ee(){O.value=N.value,D.value=!1,o(`update:state`,`submit`),o(`submit`,O.value)}function te(){D.value&&(v.value===`blur`||v.value===`both`?ee():F())}let ne=vc(()=>te(),A),re=yc(()=>te(),A),ie=a(()=>O.value===``);return n({submit:ee,cancel:F,edit:I}),Jp({id:s,name:u,disabled:g,isEditing:D,maxLength:h,modelValue:O,inputValue:N,placeholder:M,edit:I,cancel:F,submit:ee,activationMode:y,submitMode:v,selectOnFocus:b,inputRef:T,startWithEditMode:p,isEmpty:ie,readonly:x,autoResize:S}),(e,n)=>(P(),l(t,null,[d(B(Q),C(e.$attrs,{ref_key:`primitiveElement`,ref:k,as:e.as,"as-child":e.asChild,dir:B(E),"data-dismissable-layer":``,onFocusCapture:B(re).onFocusCapture,onBlurCapture:B(re).onBlurCapture,onPointerdownCapture:B(ne).onPointerDownCapture}),{default:U(()=>[R(e.$slots,`default`,{modelValue:B(O),isEditing:D.value,isEmpty:ie.value,submit:ee,cancel:F,edit:I})]),_:3},16,[`as`,`as-child`,`dir`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]),B(j)?(P(),l(`input`,{key:0,type:`text`,tabindex:`-1`,"aria-hidden":`true`,value:B(O),name:B(u),disabled:B(g),required:B(w),style:{transform:`translateX(-100%)`,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}},null,8,Kp)):c(``,!0)],64))}}),Xp=p({__name:`EditableArea`,props:{asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e,n=qp();return(e,r)=>(P(),s(B(Q),C(t,{"data-placeholder-shown":B(n).isEditing.value?void 0:``,"data-focus":B(n).isEditing.value?``:void 0,"data-focused":B(n).isEditing.value?``:void 0,"data-empty":B(n).isEmpty.value?``:void 0,"data-readonly":B(n).readonly.value?``:void 0,"data-disabled":B(n).disabled.value?``:void 0,style:B(n).autoResize.value?{display:`inline-grid`}:void 0}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`data-placeholder-shown`,`data-focus`,`data-focused`,`data-empty`,`data-readonly`,`data-disabled`,`style`]))}}),Zp=p({__name:`EditableInput`,props:{asChild:{type:Boolean},as:{default:`input`}},setup(e){let t=e,n=zs(),r=qp(),i=a(()=>r.disabled.value),o=a(()=>{var e;return(e=r.placeholder.value)?.edit}),{primitiveElement:c,currentElement:l}=Vs();A(()=>{var e,t;r.inputRef.value=l.value,r.startWithEditMode.value&&((e=r.inputRef.value)==null||e.focus({preventScroll:!0}),r.selectOnFocus.value&&((t=r.inputRef.value)==null||t.select()))}),V(r.isEditing,e=>{e&&w(()=>{var e,t;(e=r.inputRef.value)==null||e.focus({preventScroll:!0}),r.selectOnFocus.value&&((t=r.inputRef.value)==null||t.select())})});function u(e){(r.submitMode.value===`enter`||r.submitMode.value===`both`)&&e.key===n.ENTER&&!e.shiftKey&&!e.metaKey&&r.submit()}return(e,n)=>(P(),s(B(Q),C({ref_key:`primitiveElement`,ref:c},t,{value:B(r).inputValue.value,placeholder:o.value,disabled:i.value,maxlength:B(r).maxLength.value,"data-disabled":i.value?``:void 0,"data-readonly":B(r).readonly.value?``:void 0,readonly:B(r).readonly.value,"aria-label":`editable input`,hidden:B(r).autoResize.value?void 0:!B(r).isEditing.value,style:B(r).autoResize.value?{all:`unset`,gridArea:`1 / 1 / auto / auto`,visibility:B(r).isEditing.value?void 0:`hidden`}:void 0,onInput:n[0]||=e=>B(r).inputValue.value=e.target.value,onKeydown:[W(u,[`enter`,`space`]),W(B(r).cancel,[`esc`])]}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`value`,`placeholder`,`disabled`,`maxlength`,`data-disabled`,`data-readonly`,`readonly`,`hidden`,`style`,`onKeydown`]))}}),Qp=p({__name:`EditablePreview`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=e,n=qp(),r=a(()=>{var e;return(e=n.placeholder.value)?.preview});function i(){n.activationMode.value===`focus`&&n.edit()}function o(){n.activationMode.value===`dblclick`&&n.edit()}return(e,a)=>(P(),s(B(Q),C(t,{tabindex:`0`,"data-placeholder-shown":B(n).isEditing.value?void 0:``,hidden:B(n).autoResize.value?void 0:B(n).isEditing.value,style:B(n).autoResize.value?{whiteSpace:`pre`,userSelect:`none`,gridArea:`1 / 1 / auto / auto`,visibility:B(n).isEditing.value?`hidden`:void 0,overflow:`hidden`,textOverflow:`ellipsis`}:void 0,onFocusin:i,onDblclick:o}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(ae(B(n).modelValue.value||r.value),1)])]),_:3},16,[`data-placeholder-shown`,`hidden`,`style`]))}}),$p=p({__name:`EditableSubmitTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=qp();return(e,r)=>(P(),s(B(Q),C(t,{"aria-label":`submit`,"aria-disabled":B(n).disabled.value?``:void 0,"data-disabled":B(n).disabled.value?``:void 0,disabled:B(n).disabled.value,type:e.as===`button`?`button`:void 0,hidden:B(n).isEditing.value?void 0:``,onClick:B(n).submit}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Submit`)])]),_:3},16,[`aria-disabled`,`data-disabled`,`disabled`,`type`,`hidden`,`onClick`]))}}),em=p({__name:`EditableCancelTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=qp();return(e,r)=>(P(),s(B(Q),C(t,{"aria-label":`cancel`,"aria-disabled":B(n).disabled.value?``:void 0,"data-disabled":B(n).disabled.value?``:void 0,disabled:B(n).disabled.value,type:e.as===`button`?`button`:void 0,hidden:B(n).isEditing.value?void 0:``,onClick:B(n).cancel}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Cancel`)])]),_:3},16,[`aria-disabled`,`data-disabled`,`disabled`,`type`,`hidden`,`onClick`]))}}),tm=p({__name:`EditableEditTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=qp();return(e,r)=>(P(),s(B(Q),C(t,{"aria-label":`edit`,"aria-disabled":B(n).disabled.value?``:void 0,"data-disabled":B(n).disabled.value?``:void 0,disabled:B(n).disabled.value,type:e.as===`button`?`button`:void 0,hidden:B(n).isEditing.value?``:void 0,onClick:B(n).edit}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Edit`)])]),_:3},16,[`aria-disabled`,`data-disabled`,`disabled`,`type`,`hidden`,`onClick`]))}}),[nm,rm]=K(`HoverCardRoot`),im=p({__name:`HoverCardRoot`,props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},openDelay:{default:700},closeDelay:{default:300}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{openDelay:i,closeDelay:a}=z(n);X();let o=q(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),c=L(0),l=L(0),u=L(!1),d=L(!1),f=L(!1),p=L();function m(){clearTimeout(l.value),c.value=window.setTimeout(()=>o.value=!0,i.value)}function h(){clearTimeout(c.value),!u.value&&!d.value&&(l.value=window.setTimeout(()=>o.value=!1,a.value))}function g(){o.value=!1}return rm({open:o,onOpenChange(e){o.value=e},onOpen:m,onClose:h,onDismiss:g,hasSelectionRef:u,isPointerDownOnContentRef:d,isPointerInTransitRef:f,triggerElement:p}),(e,t)=>(P(),s(B($l),null,{default:U(()=>[R(e.$slots,`default`,{open:B(o)})]),_:3}))}});function am(e){return e?.querySelector(`[data-state=checked]`)}function om(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>sm(e,t,n)):sm(e,t,n)}function sm(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:Da(e,t)}const[cm,lm]=K(`ListboxRoot`),um=p({__name:`ListboxRoot`,props:{modelValue:{},defaultValue:{},multiple:{type:Boolean},orientation:{default:`vertical`},dir:{},disabled:{type:Boolean},selectionBehavior:{default:`toggle`},highlightOnHover:{type:Boolean},by:{},name:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`,`highlight`,`entryFocus`,`leave`],setup(e,{emit:t}){let n=e,r=t,{multiple:i,highlightOnHover:a,orientation:o,disabled:l,selectionBehavior:u,dir:d}=z(n),{getItems:f}=_u(),{handleTypeaheadSearch:p}=Is(),{primitiveElement:m,currentElement:h}=Vs(),g=zs(),_=Y(d),v=ds(h),y=L(),b=L(!1),x=L(!0),S=q(n,`modelValue`,r,{defaultValue:n.defaultValue??(i.value?[]:void 0),passive:n.modelValue===void 0,deep:!0});function C(e){if(b.value=!0,Array.isArray(S.value)){let t=S.value.findIndex(t=>sm(t,e,n.by));if(n.selectionBehavior===`toggle`){let n=[...S.value];t===-1?n.push(e):n.splice(t,1),S.value=n}else S.value=[e],y.value=e}else n.selectionBehavior===`toggle`&&sm(S.value,e,n.by)?S.value=void 0:S.value=e;setTimeout(()=>{b.value=!1},1)}let T=L(null),E=L(null),D=L(!1),O=$a(),k=$a();function A(){return f().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)}function j(e){if(!e)return;T.value=e,T.value.focus(),T.value.scrollIntoView({block:`nearest`});let t=f().find(t=>t.ref===e);r(`highlight`,t)}function M(e){T.value&&T.value.click()}function N(e){if(b.value=!0,D.value)k.trigger(e);else{let t=e.altKey||e.ctrlKey||e.metaKey;if(t&&e.key===`a`&&i.value){let t=f(),n=t.map(e=>e.value);S.value=[...n],e.preventDefault(),j(t[t.length-1].ref)}else if(!t){let t=p(e.key,A());t&&j(t)}}setTimeout(()=>{b.value=!1},1)}function F(e){let t=T.value;t!=null&&t.isConnected&&(E.value=t),T.value=null,r(`leave`,e)}function I(e){var t,n;let i=new CustomEvent(`listbox.entryFocus`,{bubbles:!1,cancelable:!0});if((t=e.currentTarget)==null||t.dispatchEvent(i),r(`entryFocus`,i),!i.defaultPrevented)if(E.value)j(E.value);else{let e=(n=A())?.[0];j(e)}}function ee(e){let t=od(e,o.value,_.value);if(!t)return;let n=A();if(T.value){if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let e=n.indexOf(T.value);n=n.slice(e+1)}te(e,n[0])}if(n.length){let e=!T.value&&t===`prev`?n.length-1:0;j(n[e])}if(D.value)return k.trigger(e)}function te(e,t){var r;if(!(D.value||n.selectionBehavior!==`replace`||!i.value||!Array.isArray(S.value)||(e.altKey||e.ctrlKey||e.metaKey)&&!e.shiftKey)&&e.shiftKey){let n=f().filter(e=>e.ref.dataset.disabled!==``),i=(r=n.find(e=>e.ref===t))?.value;if(e.key===g.END?i=n[n.length-1].value:e.key===g.HOME&&(i=n[0].value),!i||!y.value)return;let a=ka(n.map(e=>e.value),y.value,i);S.value=a}}async function ne(e){if(D.value)O.trigger(e);else{await w();let e=A().find(e=>e.dataset.state===`checked`);e&&j(e)}}return V(S,()=>{b.value||w(()=>{ne()})},{immediate:!0,deep:!0}),lm({modelValue:S,onValueChange:C,multiple:i,orientation:o,dir:_,disabled:l,highlightOnHover:a,highlightedElement:T,isVirtual:D,virtualFocusHook:O,virtualKeydownHook:k,by:n.by,firstValue:y,selectionBehavior:u,focusable:x,onLeave:F,onEnter:I,onChangeHighlight:j,onKeydownEnter:M,onKeydownNavigation:ee,onKeydownTypeAhead:N}),(e,t)=>(P(),s(B(Q),{ref_key:`primitiveElement`,ref:m,as:e.as,"as-child":e.asChild,dir:B(_),"data-disabled":B(l)?``:void 0,onPointerleave:F,onFocusout:t[0]||=async e=>{let t=e.relatedTarget||e.target;await w(),T.value&&B(h)&&!B(h).contains(t)&&F(e)}},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(S)}),B(v)&&n.name?(P(),s(B(pu),{key:0,name:n.name,value:B(S)},null,8,[`name`,`value`])):c(``,!0)]),_:3},8,[`as`,`as-child`,`dir`,`data-disabled`]))}}),dm=p({__name:`ListboxContent`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=cm(),n=_o(!1,10);return(e,r)=>(P(),s(B(vu),null,{default:U(()=>[d(B(Q),{role:`listbox`,as:e.as,"as-child":e.asChild,tabindex:B(t).focusable.value?B(t).highlightedElement.value?`-1`:`0`:void 0,"aria-orientation":B(t).orientation.value,"aria-multiselectable":!!B(t).multiple.value,"data-orientation":B(t).orientation.value,onMousedown:r[0]||=G(e=>n.value=!0,[`left`]),onFocus:r[1]||=e=>{B(n)||B(t).onEnter(e)},onKeydown:[r[2]||=W(G(e=>{B(t).focusable.value&&B(t).onKeydownNavigation(e)},[`prevent`]),[`down`,`up`,`left`,`right`,`home`,`end`]),W(B(t).onKeydownEnter,[`enter`]),B(t).onKeydownTypeAhead]},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`tabindex`,`aria-orientation`,`aria-multiselectable`,`data-orientation`,`onKeydown`])]),_:3}))}}),fm=p({__name:`ListboxFilter`,props:{modelValue:{},autoFocus:{type:Boolean},asChild:{type:Boolean},as:{default:`input`}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=q(n,`modelValue`,t,{defaultValue:``,passive:n.modelValue===void 0}),i=cm();i.focusable.value=!1;let{primitiveElement:a,currentElement:o}=Vs();return A(()=>{setTimeout(()=>{var e;n.autoFocus&&((e=o.value)==null||e.focus())},1)}),(e,t)=>(P(),s(B(Q),{ref_key:`primitiveElement`,ref:a,as:e.as,"as-child":e.asChild,value:B(r),disabled:B(i).disabled.value?``:void 0,"data-disabled":B(i).disabled.value?``:void 0,type:`text`,onKeydown:[W(G(B(i).onKeydownNavigation,[`prevent`]),[`down`,`up`,`home`,`end`]),W(B(i).onKeydownEnter,[`enter`])],onInput:t[0]||=e=>{r.value=e.target.value}},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(r)})]),_:3},8,[`as`,`as-child`,`value`,`disabled`,`data-disabled`,`onKeydown`]))}}),pm=`listbox.select`,[mm,hm]=K(`ListboxItem`),gm=p({__name:`ListboxItem`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`div`}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:o}=X(),c=Z(void 0,`radix-vue-listbox-item`),l=cm(),u=a(()=>o.value===l.highlightedElement.value),f=a(()=>om(l.modelValue.value,n.value,l.by)),p=a(()=>l.disabled.value||n.disabled);async function m(e){r(`select`,e),!(e!=null&&e.defaultPrevented)&&!p.value&&e&&(l.onValueChange(n.value),l.onChangeHighlight(e.target))}function h(e){let t={originalEvent:e,value:n.value};xa(pm,m,t)}return hm({isSelected:f}),(e,t)=>(P(),s(B(yu),{value:e.value},{default:U(()=>[d(B(Q),{id:B(c),ref:B(i),role:`option`,tabindex:B(l).focusable.value?u.value?`0`:`-1`:void 0,"aria-selected":f.value,as:e.as,"as-child":e.asChild,disabled:p.value?``:void 0,"data-disabled":p.value?``:void 0,"data-highlighted":u.value?``:void 0,"data-state":f.value?`checked`:`unchecked`,onClick:h,onKeydown:W(G(h,[`prevent`]),[`space`]),onPointermove:t[0]||=e=>{B(l).highlightOnHover.value?B(l).onChangeHighlight(B(o)):B(l).focusable.value||B(l).onChangeHighlight(B(o))}},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`tabindex`,`aria-selected`,`as`,`as-child`,`disabled`,`data-disabled`,`data-highlighted`,`data-state`,`onKeydown`])]),_:3},8,[`value`]))}}),_m=p({__name:`ListboxItemIndicator`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=e;X();let n=mm();return(e,r)=>B(n).isSelected.value?(P(),s(B(Q),C({key:0,"aria-hidden":`true`},t),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):c(``,!0)}});function vm(e,t,n){let r=n.initialDeps??[],i;return()=>{var a,o,s,c;let l;n.key&&(a=n.debug)!=null&&a.call(n)&&(l=Date.now());let u=e();if(!(u.length!==r.length||u.some((e,t)=>r[t]!==e)))return i;r=u;let d;if(n.key&&(o=n.debug)!=null&&o.call(n)&&(d=Date.now()),i=t(...u),n.key&&(s=n.debug)!=null&&s.call(n)){let e=Math.round((Date.now()-l)*100)/100,t=Math.round((Date.now()-d)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.lengthMath.abs(e-t)<1,xm=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Sm=e=>e,Cm=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},wm=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(e=>{let t=e[0];if(t!=null&&t.borderBoxSize){let e=t.borderBoxSize[0];if(e){i({width:e.inlineSize,height:e.blockSize});return}}i(n.getBoundingClientRect())});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Tm={passive:!0},Em=typeof window>`u`?!0:`onscrollend`in window,Dm=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=Em?()=>{}:xm(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{i=n[e.options.horizontal?`scrollLeft`:`scrollTop`],a(),t(i,r)},s=o(!0),c=o(!1);return c(),n.addEventListener(`scroll`,s,Tm),n.addEventListener(`scrollend`,c,Tm),()=>{n.removeEventListener(`scroll`,s),n.removeEventListener(`scrollend`,c)}},Om=(e,t,n)=>{if(t!=null&&t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?`width`:`height`])},km=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})};var Am=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}));return{disconnect:()=>{var e;return(e=t())?.disconnect()},observe:e=>{var n;return(n=t())?.observe(e,{box:`border-box`})},unobserve:e=>{var n;return(n=t())?.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{typeof n>`u`&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Sm,rangeExtractor:Cm,onChange:()=>{},measureElement:Om,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...e}},this.notify=(e,t)=>{var n,r;let{startIndex:i,endIndex:a}=this.range??{startIndex:void 0,endIndex:void 0},o=this.calculateRange();(e||i!==o?.startIndex||a!==o?.endIndex)&&((r=(n=this.options).onChange)==null||r.call(n,this,t))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t){this.notify(!1,!1);return}this.scrollElement=t,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(e=this.scrollElement)?.window??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.ende.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=vm(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,t,n,r,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i}),{key:!1}),this.getMeasurements=vm(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i},a)=>{var o;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let s=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];let c=this.measurementsCache.slice(0,s);for(let i=s;i{let t=r(i),n=this.elementsCache.get(t);if(!e){n&&(this.observer.unobserve(n),this.elementsCache.delete(t));return}n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.elementsCache.set(t,e)),e.isConnected&&this.resizeItem(i,this.options.measureElement(e,void 0,this))};let s=r(i),l=this.options.lanes===1?c[i-1]:this.getFurthestMeasurement(c,i),u=l?l.end+this.options.gap:t+n,d=a.get(s),f=typeof d==`number`?d:this.options.estimateSize(i),p=u+f,m=l?l.lane:i%this.options.lanes;c[i]={index:i,start:u,size:f,end:p,key:s,lane:m,measureElement:e}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=vm(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(e,t,n)=>this.range=e.length>0&&t>0?Mm({measurements:e,outerSize:t,scrollOffset:n}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=vm(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(e,t,n,r)=>t===null?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:n,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{let n=this.indexFromElement(e),r=this.getMeasurements()[n];if(!r||!e.isConnected){this.elementsCache.forEach((t,n)=>{t===e&&(this.observer.unobserve(e),this.elementsCache.delete(n))});return}let i=this.elementsCache.get(r.key);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(r.key,e)),this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{let n=this.getMeasurements()[e];if(!n)return;let r=this.itemSizeCache.get(n.key)??n.size,i=t-r;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start{e&&this._measureElement(e,void 0)},this.getVirtualItems=vm(()=>[this.getIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;rthis.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return ym(t[jm(0,t.length-1,e=>ym(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>{let n=this.getSize(),r=this.getScrollOffset();t===`auto`&&(t=e<=r?`start`:e>=r+n?`end`:`start`),t===`start`?e=e:t===`end`?e-=n:t===`center`&&(e-=n/2);let i=this.options.horizontal?`scrollWidth`:`scrollHeight`,a=(this.scrollElement?`document`in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-n;return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getMeasurements()[e];if(!n)return;let r=this.getSize(),i=this.getScrollOffset();if(t===`auto`)if(n.end>=i+r-this.options.scrollPaddingEnd)t=`end`;else if(n.start<=i+this.options.scrollPaddingStart)t=`start`;else return[i,t];let a=t===`end`?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t=`start`,behavior:n}={})=>{this.cancelScrollToIndex(),n===`smooth`&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t=`auto`,behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),n===`smooth`&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r;this._scrollToOffset(i,{adjustments:void 0,behavior:n}),n!==`smooth`&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(e))){let[t]=ym(this.getOffsetForIndex(e,a));bm(t,this.getScrollOffset())||this.scrollToIndex(e,{align:a,behavior:n})}else this.scrollToIndex(e,{align:a,behavior:n})}))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),t===`smooth`&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;let t=this.getMeasurements(),n;return n=t.length===0?this.options.paddingStart:this.options.lanes===1?(e=t[t.length-1])?.end??0:Math.max(...t.slice(-this.options.lanes).map(e=>e.end)),n-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{var e,t;this.itemSizeCache=new Map,(t=(e=this.options).onChange)==null||t.call(e,this,!1)},this.setOptions(e)}};const jm=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(ar)t=i-1;else return i}return e>0?e-1:0};function Mm({measurements:e,outerSize:t,scrollOffset:n}){let r=e.length-1,i=jm(0,r,t=>e[t].start,n),a=i;for(;aB(e).getScrollElement(),e=>{e&&t._willUpdate()},{immediate:!0}),V(()=>B(e),e=>{t.setOptions({...e,onChange:(t,r)=>{var i;ue(n),(i=e.onChange)==null||i.call(e,t,r)}}),t._willUpdate(),ue(n)},{immediate:!0}),j(r),n}function Pm(e){return Nm(a(()=>({observeElementRect:wm,observeElementOffset:Dm,scrollToFn:km,...B(e)})))}const Fm=p({__name:`ListboxVirtualizer`,props:{options:{},estimateSize:{},textContent:{type:Function}},setup(e){let n=e,r=fe(),o=cm(),c=Ro(),{getItems:u}=bu();o.isVirtual.value=!0;let d=a(()=>{let e=c.value;if(e){let t=window.getComputedStyle(e);return{start:Number.parseFloat(t.paddingBlockStart||t.paddingTop),end:Number.parseFloat(t.paddingBlockEnd||t.paddingBottom)}}else return{start:0,end:0}}),f=Pm({get scrollPaddingStart(){return d.value.start},get scrollPaddingEnd(){return d.value.end},get count(){return n.options.length},get horizontal(){return o.orientation.value===`horizontal`},estimateSize(){return n.estimateSize??28},getScrollElement(){return c.value},overscan:12}),p=a(()=>f.value.getVirtualItems().map(e=>({item:e,is:i(r.default({option:n.options[e.index],virtualizer:f.value,virtualItem:e})[0],{key:`${e.key}`,"data-index":e.index,"aria-setsize":n.options.length,"aria-posinset":e.index+1,style:{position:`absolute`,top:0,left:0,transform:`translateY(${e.start}px)`,overflowAnchor:`none`}})})));o.virtualFocusHook.on(e=>{let t=n.options.findIndex(e=>Array.isArray(o.modelValue.value)?sm(e,o.modelValue.value[0],o.by):sm(e,o.modelValue.value,o.by));t!==-1&&(e?.preventDefault(),f.value.scrollToIndex(t,{align:`start`}),requestAnimationFrame(()=>{let t=am(c.value);t&&e&&t?.focus()}))});let m=_o(``,1e3),h=a(()=>{let e=e=>n.textContent?n.textContent(e):e.toString().toLowerCase();return n.options.map((t,n)=>({index:n,textContent:e(t)}))});function g(e,t){var r,i,a,s;if(!((r=o.firstValue)!=null&&r.value)||!o.multiple.value||!Array.isArray(o.modelValue.value))return;let c=(i=u().filter(e=>e.ref.dataset.disabled!==``).find(e=>e.ref===o.highlightedElement.value))?.value;if(!c)return;let l=null;switch(t){case`prev`:case`next`:l=ka(n.options,o.firstValue.value,c);break;case`first`:l=ka(n.options,o.firstValue.value,(a=n.options)?.[0]);break;case`last`:l=ka(n.options,o.firstValue.value,(s=n.options)?.[n.options.length-1]);break}o.modelValue.value=l}return o.virtualKeydownHook.on(e=>{var t;let r=e.altKey||e.ctrlKey||e.metaKey;if(e.key===`Tab`&&!r)return;let i=id[e.key];if(r&&e.key===`a`&&o.multiple.value?(e.preventDefault(),o.modelValue.value=[...n.options],i=`last`):e.shiftKey&&i&&g(e,i),[`first`,`last`].includes(i)){e.preventDefault();let t=i===`first`?0:n.options.length-1;f.value.scrollToIndex(t),requestAnimationFrame(()=>{let e=u(),t=i===`first`?e[0]:e[e.length-1];o.onChangeHighlight(t.ref)})}else if(!i&&!r){m.value+=e.key;let n=Number((t=J())?.getAttribute(`data-index`)),r=h.value[n].textContent,i=h.value.map(e=>e.textContent),a=Rs(i,m.value,r),s=h.value.find(e=>e.textContent===a);s&&(f.value.scrollToIndex(s.index,{align:`start`}),requestAnimationFrame(()=>{let e=c.value.querySelector(`[data-index="${s.index}"]`);e instanceof HTMLElement&&o.onChangeHighlight(e)}))}}),(e,n)=>(P(),l(`div`,{"data-radix-vue-virtualizer":``,style:E({position:`relative`,width:`100%`,height:`${B(f).getTotalSize()}px`})},[(P(!0),l(t,null,te(p.value,({is:e,item:t})=>(P(),s(ne(e),{key:t.index}))),128))],4))}}),[Im,Lm]=K(`ListboxGroup`),Rm=p({__name:`ListboxGroup`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=Z(void 0,`radix-vue-listbox-group`);return Lm({id:n}),(e,r)=>(P(),s(B(Q),C({role:`group`},t,{"aria-labelledby":B(n)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-labelledby`]))}}),zm=p({__name:`ListboxGroupLabel`,props:{for:{},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e,n=Im({id:``});return(e,r)=>(P(),s(B(Q),C(t,{id:B(n).id}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),[Bm,Vm]=K(`MenubarRoot`),Hm=p({__name:`MenubarRoot`,props:{modelValue:{},defaultValue:{},dir:{},loop:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=X(),{createCollection:o}=rs(`menubar`);o(a);let c=q(n,`modelValue`,r,{defaultValue:n.defaultValue??``,passive:n.modelValue===void 0}),l=L(null),{dir:u,loop:f}=z(n),p=Y(u);return Vm({modelValue:c,dir:p,loop:f,onMenuOpen:e=>{c.value=e,l.value=e},onMenuClose:()=>{c.value=``},onMenuToggle:e=>{c.value=c.value?``:e,l.value=e}}),(e,t)=>(P(),s(B(dd),{"current-tab-stop-id":l.value,"onUpdate:currentTabStopId":t[0]||=e=>l.value=e,orientation:`horizontal`,loop:B(f),dir:B(p),"as-child":``},{default:U(()=>[d(B(Q),{ref:B(i),role:`menubar`},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(c)})]),_:3},512)]),_:3},8,[`current-tab-stop-id`,`loop`,`dir`]))}}),[Um,Wm]=K(`MenubarMenu`),Gm=p({__name:`MenubarMenu`,props:{value:{}},setup(e){let t=Z(e.value),n=Bm();X();let r=L(),i=L(!1),o=a(()=>n.modelValue.value===t);return V(o,()=>{o.value||(i.value=!1)}),Wm({value:t,triggerElement:r,triggerId:t,contentId:``,wasKeyboardTriggerOpenRef:i}),(e,t)=>(P(),s(B(td),{open:o.value,modal:!1,dir:B(n).dir.value,"onUpdate:open":t[0]||=e=>{e||B(n).onMenuClose()}},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`open`,`dir`]))}}),Km=p({__name:`MenubarTrigger`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=Bm(),n=Um(),{forwardRef:r,currentElement:i}=X(),o=L(!1),c=a(()=>t.modelValue.value===n.value);return A(()=>{n.triggerElement=i}),(e,a)=>(P(),s(B(fd),{"as-child":``,focusable:!e.disabled,"tab-stop-id":B(n).value},{default:U(()=>[d(B(qu),{"as-child":``},{default:U(()=>[d(B(Q),{id:B(n).triggerId,ref:B(r),as:e.as,type:e.as===`button`?`button`:void 0,role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":c.value,"aria-controls":c.value?B(n).contentId:void 0,"data-highlighted":o.value?``:void 0,"data-state":c.value?`open`:`closed`,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-value":B(n).value,"data-radix-vue-collection-item":``,onPointerdown:a[0]||=r=>{!e.disabled&&r.button===0&&r.ctrlKey===!1&&(B(t).onMenuOpen(B(n).value),c.value||r.preventDefault())},onPointerenter:a[1]||=()=>{var e;B(t).modelValue.value&&!c.value&&(B(t).onMenuOpen(B(n).value),(e=B(i))==null||e.focus())},onKeydown:a[2]||=W(r=>{e.disabled||([`Enter`,` `].includes(r.key)&&B(t).onMenuToggle(B(n).value),r.key===`ArrowDown`&&B(t).onMenuOpen(B(n).value),[`Enter`,` `,`ArrowDown`].includes(r.key)&&(B(n).wasKeyboardTriggerOpenRef.value=!0,r.preventDefault()))},[`enter`,`space`,`arrow-down`]),onFocus:a[3]||=e=>o.value=!0,onBlur:a[4]||=e=>o.value=!1},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`as`,`type`,`aria-expanded`,`aria-controls`,`data-highlighted`,`data-state`,`data-disabled`,`disabled`,`data-value`])]),_:3})]),_:3},8,[`focusable`,`tab-stop-id`]))}}),qm=p({__name:`MenubarPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(Dd),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Jm=p({__name:`MenubarContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{},align:{default:`start`},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t);X();let r=Bm(),i=Um();i.contentId||=Z(void 0,`radix-vue-menubar-content`);let{injectCollection:a}=rs(`menubar`),o=a(),c=L(!1);function l(e){let t=e.target.hasAttribute(`data-radix-menubar-subtrigger`),n=(r.dir.value===`rtl`?`ArrowRight`:`ArrowLeft`)===e.key;if(!n&&t)return;let a=o.value.map(e=>e.dataset.value);n&&a.reverse();let s=a.indexOf(i.value);a=r.loop.value?Ls(a,s+1):a.slice(s+1);let[c]=a;c&&r.onMenuOpen(c)}return(e,t)=>(P(),s(B(wd),C(B(n),{id:B(i).contentId,"data-radix-menubar-content":``,"aria-labelledby":B(i).triggerId,style:{"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`},onCloseAutoFocus:t[0]||=e=>{var t;!B(r).modelValue.value&&!c.value&&((t=B(i).triggerElement.value)==null||t.focus()),c.value=!1,e.preventDefault()},onFocusOutside:t[1]||=e=>{let t=e.target;B(o).some(e=>e.contains(t))&&e.preventDefault()},onInteractOutside:t[2]||=e=>{c.value=!0},onEntryFocus:t[3]||=e=>{B(i).wasKeyboardTriggerOpenRef.value||e.preventDefault()},onKeydown:W(l,[`arrow-right`,`arrow-left`])}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),Ym=p({__name:`MenubarArrow`,props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:`svg`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Ju),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Xm=p({__name:`MenubarItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(_d),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Zm=p({__name:`MenubarGroup`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Td),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Qm=p({__name:`MenubarSeparator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Md),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),$m=p({__name:`MenubarCheckboxItem`,props:{checked:{type:[Boolean,String]},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`,`update:checked`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(xd),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),eh=p({__name:`MenubarItemIndicator`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(bd),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),th=p({__name:`MenubarLabel`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Ed),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),nh=p({__name:`MenubarRadioGroup`,props:{modelValue:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=ss(t);return X(),(e,t)=>(P(),s(B(Ad),T(_({...n,...B(r)})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),rh=p({__name:`MenubarRadioItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},emits:[`select`],setup(e,{emit:t}){let n=ps(e,t);return X(),(e,t)=>(P(),s(B(jd),T(_(B(n))),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),ih=p({__name:`MenubarSub`,props:{defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;X();let i=q(n,`open`,r,{defaultValue:n.defaultOpen??!1,passive:n.open===void 0});return(e,t)=>(P(),s(B(Fd),{open:B(i),"onUpdate:open":t[0]||=e=>b(i)?i.value=e:null},{default:U(()=>[R(e.$slots,`default`,{open:B(i)})]),_:3},8,[`open`]))}}),ah=p({__name:`MenubarSubContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},sideOffset:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ps(e,t);X();let{injectCollection:r}=rs(`menubar`),i=Bm(),a=Um(),o=r();function c(e){if(e.target.hasAttribute(`data-radix-menubar-subtrigger`))return;let t=o.value.map(e=>e.dataset.value),n=t.indexOf(a.value);t=i.loop.value?Ls(t,n+1):t.slice(n+1);let[r]=t;r&&i.onMenuOpen(r)}return(e,t)=>(P(),s(B(Id),C(B(n),{"data-radix-menubar-content":``,style:{"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`},onKeydown:W(c,[`arrow-right`])}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),oh=p({__name:`MenubarSubTrigger`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Ld),C(t,{"data-radix-menubar-subtrigger":``}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),[sh,ch]=K([`NavigationMenuRoot`,`NavigationMenuSub`],`NavigationMenuContext`),lh=p({__name:`NavigationMenuRoot`,props:{modelValue:{default:void 0},defaultValue:{},dir:{},orientation:{default:`horizontal`},delayDuration:{default:200},skipDelayDuration:{default:300},disableClickTrigger:{type:Boolean,default:!1},disableHoverTrigger:{type:Boolean,default:!1},asChild:{type:Boolean},as:{default:`nav`}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=q(n,`modelValue`,t,{defaultValue:n.defaultValue??``,passive:n.modelValue===void 0}),i=L(``),{forwardRef:o,currentElement:c}=X(),l=L(),u=L(),{createCollection:d}=rs(`nav`);d(l);let{delayDuration:f,skipDelayDuration:p,dir:m,disableClickTrigger:h,disableHoverTrigger:g}=z(n),_=Y(m),v=_o(!1,p),y=a(()=>r.value!==``||v.value?150:f.value),b=vo(e=>{typeof e==`string`&&(i.value=r.value,r.value=e)},y);return ch({isRootMenu:!0,modelValue:r,previousValue:i,baseId:Z(void 0,`radix-navigation-menu`),disableClickTrigger:h,disableHoverTrigger:g,dir:_,orientation:n.orientation,rootNavigationMenu:c,indicatorTrack:l,onIndicatorTrackChange:e=>{l.value=e},viewport:u,onViewportChange:e=>{u.value=e},onTriggerEnter:e=>{b(e)},onTriggerLeave:()=>{v.value=!0,b(``)},onContentEnter:()=>{b()},onContentLeave:()=>{b(``)},onItemSelect:e=>{i.value=r.value,r.value=e},onItemDismiss:()=>{i.value=r.value,r.value=``}}),(e,t)=>(P(),s(B(Q),{ref:B(o),"aria-label":`Main`,as:e.as,"as-child":e.asChild,"data-orientation":e.orientation,dir:B(_),"data-radix-navigation-menu":``},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(r)})]),_:3},8,[`as`,`as-child`,`data-orientation`,`dir`]))}});function uh(e){return e?`open`:`closed`}function dh(e,t){return`${e}-trigger-${t}`}function fh(e,t){return`${e}-content-${t}`}const ph=`navigationMenu.linkSelect`,mh=`navigationMenu.rootContentDismiss`;function hh(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gh(e){let t=J();return e.some(e=>e===t?!0:(e.focus(),J()!==t))}function _h(e){return e.forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)}),()=>{e.forEach(e=>{let t=e.dataset.tabindex;e.setAttribute(`tabindex`,t)})}}function vh(e){return t=>t.pointerType===`mouse`?e(t):void 0}const[yh,bh]=K(`NavigationMenuItem`),xh=p({__name:`NavigationMenuItem`,props:{value:{},asChild:{type:Boolean},as:{default:`li`}},setup(e){let t=e;X();let{injectCollection:n}=rs(`nav`),r=n(),i=sh(),a=Z(t.value),o=L(),c=L(),l=fh(i.baseId,a),u=()=>({}),d=L(!1);async function f(e=`start`){let t=document.getElementById(l);if(t){u();let n=hh(t);n.length&&gh(e===`start`?n:n.reverse())}}function p(){let e=document.getElementById(l);if(e){let t=hh(e);t.length&&(u=_h(t))}}bh({value:a,contentId:l,triggerRef:o,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onContentFocusOutside:p,onRootContentClose:p});function m(){var e;i.onItemDismiss(),(e=o.value)==null||e.focus()}function h(e){let t=J();if(e.keyCode===32||e.key===`Enter`)if(i.modelValue.value===a){m(),e.preventDefault();return}else{e.target.click(),e.preventDefault();return}let n=r.value.filter(e=>{var t;return(t=e.parentElement)?.hasAttribute(`data-menu-item`)});if(!n.includes(t))return;let o=Vo(e,t,void 0,{itemsArray:n,loop:!1});o&&o?.focus(),e.preventDefault(),e.stopPropagation()}return(e,t)=>(P(),s(B(Q),{"as-child":e.asChild,as:e.as,"data-menu-item":``,onKeydown:W(h,[`up`,`down`,`left`,`right`,`home`,`end`,`space`])},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),Sh=p({__name:`NavigationMenuContentImpl`,props:{disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(e,{emit:t}){let n=e,r=t,{injectCollection:i}=rs(`nav`),o=i(),{forwardRef:c,currentElement:l}=X(),u=sh(),d=yh(),f=dh(u.baseId,d.value),p=fh(u.baseId,d.value),m=L(null),h=a(()=>{let e=o.value.map(e=>e.id.split(`trigger-`)[1]);u.dir.value===`rtl`&&e.reverse();let t=e.indexOf(u.modelValue.value),n=e.indexOf(u.previousValue.value),r=d.value===u.modelValue.value,i=n===e.indexOf(d.value);if(!r&&!i)return m.value;let a=(()=>{if(t!==n){if(r&&n!==-1)return t>n?`from-end`:`from-start`;if(i&&t!==-1)return t>n?`to-start`:`to-end`}return null})();return m.value=a,a});function g(e){var t,n;if(r(`focusOutside`,e),r(`interactOutside`,e),!e.defaultPrevented){d.onContentFocusOutside();let r=e.target;(n=(t=u.rootNavigationMenu)?.value)!=null&&n.contains(r)&&e.preventDefault()}}function _(e){var t;if(r(`pointerDownOutside`,e),!e.defaultPrevented){let n=e.target,r=o.value.some(e=>e.contains(n)),i=u.isRootMenu&&(t=u.viewport.value)?.contains(n);(r||i||!u.isRootMenu)&&e.preventDefault()}}H(e=>{let t=l.value;if(u.isRootMenu&&t){let n=()=>{var e;u.onItemDismiss(),d.onRootContentClose(),t.contains(J())&&((e=d.triggerRef.value)==null||e.focus())};t.addEventListener(mh,n),e(()=>t.removeEventListener(mh,n))}});function v(e){var t,n;r(`escapeKeyDown`,e),e.defaultPrevented||(u.onItemDismiss(),(n=(t=d.triggerRef)?.value)==null||n.focus(),d.wasEscapeCloseRef.value=!0)}function y(e){var t;if(e.target.closest(`[data-radix-navigation-menu]`)!==u.rootNavigationMenu.value)return;let n=e.altKey||e.ctrlKey||e.metaKey,r=e.key===`Tab`&&!n,i=hh(e.currentTarget);if(r){let n=J(),r=i.findIndex(e=>e===n),a=e.shiftKey?i.slice(0,r).reverse():i.slice(r+1,i.length);if(gh(a))e.preventDefault();else{(t=d.focusProxyRef.value)==null||t.focus();return}}let a=Vo(e,J(),void 0,{itemsArray:i,loop:!1,enableIgnoredElement:!0});a?.focus()}function b(){var e;let t=new Event(mh,{bubbles:!0,cancelable:!0});(e=l.value)==null||e.dispatchEvent(t)}return(e,t)=>(P(),s(B(xc),C({id:B(p),ref:B(c),"aria-labelledby":B(f),"data-motion":h.value,"data-state":B(uh)(B(u).modelValue.value===B(d).value),"data-orientation":B(u).orientation},n,{onKeydown:y,onEscapeKeyDown:v,onPointerDownOutside:_,onFocusOutside:g,onDismiss:b}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`,`data-motion`,`data-state`,`data-orientation`]))}}),Ch=p({inheritAttrs:!1,__name:`NavigationMenuContent`,props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(e,{emit:t}){let r=e,i=t,o=ss(i),{forwardRef:l}=X(),u=ko(),f=sh(),p=yh(),m=a(()=>p.value===f.modelValue.value),h=a(()=>f.viewport.value&&!f.modelValue.value&&f.previousValue.value?f.previousValue.value===p.value:!1);return(e,t)=>B(u)?(P(),s(n,{key:0,to:B(f).viewport.value,disabled:!B(f).viewport.value},[d(B(Js),{present:e.forceMount||m.value||h.value},{default:U(()=>[d(Sh,C({ref:B(l),"data-state":B(uh)(m.value),style:{pointerEvents:!m.value&&B(f).isRootMenu?`none`:void 0}},{...e.$attrs,...r,...B(o)},{onPointerenter:t[0]||=e=>B(f).onContentEnter(B(p).value),onPointerleave:t[1]||=e=>B(vh)(()=>B(f).onContentLeave())(e),onPointerDownOutside:t[2]||=e=>i(`pointerDownOutside`,e),onFocusOutside:t[3]||=e=>i(`focusOutside`,e),onInteractOutside:t[4]||=e=>i(`interactOutside`,e)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`,`style`])]),_:3},8,[`present`])],8,[`to`,`disabled`])):c(``,!0)}}),wh=p({inheritAttrs:!1,__name:`NavigationMenuIndicator`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,{forwardRef:r}=X(),{injectCollection:i}=rs(`nav`),o=i(),l=sh(),u=L(),f=a(()=>l.orientation===`horizontal`),p=a(()=>!!l.modelValue.value),m=L();function h(){m.value&&(u.value={size:f.value?m.value.offsetWidth:m.value.offsetHeight,offset:f.value?m.value.offsetLeft:m.value.offsetTop})}return H(()=>{if(!l.modelValue.value){u.value=void 0;return}let e=o.value;m.value=e.find(e=>e.id.includes(l.modelValue.value)),h()}),Io(m,h),Io(l.indicatorTrack,h),(e,i)=>B(l).indicatorTrack.value?(P(),s(n,{key:0,to:B(l).indicatorTrack.value},[d(B(Js),{present:e.forceMount||p.value},{default:U(()=>{var n,i,a,o;return[d(B(Q),C({ref:B(r),"aria-hidden":`true`,"data-state":p.value?`visible`:`hidden`,"data-orientation":B(l).orientation,"as-child":t.asChild,as:e.as,style:{position:`absolute`,...f.value?{left:0,width:`${(n=u.value)?.size}px`,transform:`translateX(${(i=u.value)?.offset}px)`}:{top:0,height:`${(a=u.value)?.size}px`,transform:`translateY(${(o=u.value)?.offset}px)`}}},e.$attrs),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`,`data-orientation`,`as-child`,`as`,`style`])]}),_:3},8,[`present`])],8,[`to`])):c(``,!0)}}),Th=p({__name:`NavigationMenuLink`,props:{active:{type:Boolean},asChild:{type:Boolean},as:{default:`a`}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t;X();async function i(e){var t;let n=new CustomEvent(ph,{bubbles:!0,cancelable:!0,detail:{originalEvent:e}});if(r(`select`,n),!n.defaultPrevented&&!e.metaKey){let n=new CustomEvent(mh,{bubbles:!0,cancelable:!0});(t=e.target)==null||t.dispatchEvent(n)}}return(e,t)=>(P(),s(B(Q),{as:e.as,"data-active":e.active?``:void 0,"aria-current":e.active?`page`:void 0,"as-child":n.asChild,"data-radix-vue-collection-item":``,onClick:i},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`data-active`,`aria-current`,`as-child`]))}}),Eh=p({inheritAttrs:!1,__name:`NavigationMenuList`,props:{asChild:{type:Boolean},as:{default:`ul`}},setup(e){let t=e,n=sh(),{forwardRef:r,currentElement:i}=X();return A(()=>{n.onIndicatorTrackChange(i.value)}),(e,i)=>(P(),s(B(Q),{ref:B(r),style:{position:`relative`}},{default:U(()=>[d(B(Q),C(e.$attrs,{"as-child":t.asChild,as:e.as,"data-orientation":B(n).orientation}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-orientation`])]),_:3},512))}}),Dh=p({__name:`NavigationMenuSub`,props:{modelValue:{},defaultValue:{},orientation:{default:`horizontal`},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=q(n,`modelValue`,t,{defaultValue:n.defaultValue??``,passive:n.modelValue===void 0}),i=L(``),a=sh(),{forwardRef:o,currentElement:c}=X(),l=L(),u=L(),{createCollection:d}=rs(`nav`);return d(l),ch({...a,isRootMenu:!1,modelValue:r,previousValue:i,orientation:n.orientation,rootNavigationMenu:c,indicatorTrack:l,onIndicatorTrackChange:e=>{l.value=e},viewport:u,onViewportChange:e=>{u.value=e},onTriggerEnter:e=>{r.value=e},onTriggerLeave:()=>{},onContentEnter:()=>{},onContentLeave:()=>{},onItemSelect:e=>{r.value=e},onItemDismiss:()=>{r.value=``}}),(e,t)=>(P(),s(B(Q),{ref:B(o),"data-orientation":e.orientation,"as-child":n.asChild,as:e.as,"data-radix-navigation-menu":``},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(r)})]),_:3},8,[`data-orientation`,`as-child`,`as`]))}}),Oh=[`aria-owns`],kh=p({inheritAttrs:!1,__name:`NavigationMenuTrigger`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`button`}},setup(e){let n=e,r=sh(),i=yh(),{forwardRef:o,currentElement:s}=X(),u=L(``),f=L(``),p=_o(!1,300),m=L(!1),h=a(()=>i.value===r.modelValue.value);A(()=>{i.triggerRef=s,u.value=dh(r.baseId,i.value),f.value=fh(r.baseId,i.value)});function g(){r.disableHoverTrigger.value||(m.value=!1,i.wasEscapeCloseRef.value=!1)}function _(e){if(!r.disableHoverTrigger.value&&e.pointerType===`mouse`){if(n.disabled||m.value||i.wasEscapeCloseRef.value||p.value)return;r.onTriggerEnter(i.value),p.value=!0}}function v(e){if(!r.disableHoverTrigger.value&&e.pointerType===`mouse`){if(n.disabled)return;r.onTriggerLeave(),p.value=!1}}function y(e){e.pointerType===`mouse`&&r.disableClickTrigger.value||p.value||(h.value?r.onItemSelect(``):r.onItemSelect(i.value),m.value=h.value)}function b(e){let t={horizontal:`ArrowDown`,vertical:r.dir.value===`rtl`?`ArrowLeft`:`ArrowRight`}[r.orientation];h.value&&e.key===t&&(i.onEntryKeyDown(),e.preventDefault(),e.stopPropagation())}function x(e){i.focusProxyRef.value=wo(e)}function S(e){let t=document.getElementById(i.contentId),n=e.relatedTarget,r=n===s.value,a=t?.contains(n);(r||!a)&&i.onFocusProxyEnter(r?`start`:`end`)}return(e,i)=>(P(),l(t,null,[d(B(Q),C({id:u.value,ref:B(o),disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-state":B(uh)(h.value),"aria-expanded":h.value,"aria-controls":f.value,"as-child":n.asChild,as:e.as},e.$attrs,{"data-radix-vue-collection-item":``,onPointerenter:g,onPointermove:_,onPointerleave:v,onClick:y,onKeydown:b}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`disabled`,`data-disabled`,`data-state`,`aria-expanded`,`aria-controls`,`as-child`,`as`]),h.value?(P(),l(t,{key:0},[d(B(fu),{ref:x,"aria-hidden":`true`,tabindex:0,onFocus:S}),B(r).viewport?(P(),l(`span`,{key:0,"aria-owns":f.value},null,8,Oh)):c(``,!0)],64)):c(``,!0)],64))}}),Ah=p({inheritAttrs:!1,__name:`NavigationMenuViewport`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let{forwardRef:t,currentElement:n}=X(),r=sh(),i=L(),o=a(()=>!!r.modelValue.value),c=a(()=>r.modelValue.value);V(n,()=>{n.value&&r.onViewportChange(n.value)});let l=L();return V([c,o],async()=>{var e,t;if(await w(),!n.value)return;let r=(t=(e=n.value.querySelector(`[data-state=open]`))?.children)?.[0];l.value=r},{immediate:!0}),Io(l,()=>{l.value&&(i.value={width:l.value.offsetWidth,height:l.value.offsetHeight})}),(e,n)=>(P(),s(B(Js),{present:e.forceMount||o.value},{default:U(()=>{var a,s;return[d(B(Q),C(e.$attrs,{ref:B(t),as:e.as,"as-child":e.asChild,"data-state":B(uh)(o.value),"data-orientation":B(r).orientation,style:{pointerEvents:!o.value&&B(r).isRootMenu?`none`:void 0,"--radix-navigation-menu-viewport-width":i.value?`${(a=i.value)?.width}px`:void 0,"--radix-navigation-menu-viewport-height":i.value?`${(s=i.value)?.height}px`:void 0},onPointerenter:n[0]||=e=>B(r).onContentEnter(B(r).modelValue.value),onPointerleave:n[1]||=e=>B(vh)(()=>B(r).onContentLeave())(e)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-state`,`data-orientation`,`style`])]}),_:3},8,[`present`]))}});function jh(e){let{disabled:t}=e,n=L(),r=$a(),i=()=>window.clearTimeout(n.value),o=e=>{i(),!t.value&&(r.trigger(),n.value=window.setTimeout(()=>{o(60)},e))},s=()=>{o(400)},c=()=>{i()},l=L(!1),u=a(()=>wo(e.target)),d=e=>{e.button!==0||l.value||(e.preventDefault(),l.value=!0,s())},f=()=>{l.value=!1,c()};return ao&&(Eo(u||window,`pointerdown`,d),Eo(window,`pointerup`,f),Eo(window,`pointercancel`,f)),{isPressed:l,onTrigger:r.on}}function Mh(e,t=L({})){return io(()=>new Hi(e.value,t.value))}function Nh(e,t=L({})){return io(()=>new qi(e.value,t.value))}function Ph(e,t,n){let r=e===`+`?t+n:t-n;if(t%1!=0||n%1!=0){let i=t.toString().split(`.`),a=n.toString().split(`.`),o=i[1]&&i[1].length||0,s=a[1]&&a[1].length||0,c=10**Math.max(o,s);t=Math.round(t*c),n=Math.round(n*c),r=e===`+`?t+n:t-n,r/=c}return r}const Fh=[`value`,`name`,`disabled`,`required`],[Ih,Lh]=K(`NumberFieldRoot`),Rh=p({inheritAttrs:!1,__name:`NumberFieldRoot`,props:{defaultValue:{default:void 0},modelValue:{},min:{},max:{},step:{default:1},formatOptions:{},locale:{default:`en-US`},disabled:{type:Boolean},required:{type:Boolean},name:{},id:{},asChild:{type:Boolean},as:{default:`div`}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,{disabled:o,min:s,max:u,step:f,locale:p,formatOptions:m,id:h}=z(r),g=q(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),{primitiveElement:_,currentElement:v}=Vs(),y=ds(v),b=L(),x=a(()=>I(g.value)===s.value||(s.value&&!isNaN(g.value)?Ph(`-`,g.value,f.value)I(g.value)===u.value||(u.value&&!isNaN(g.value)?Ph(`+`,g.value,f.value)>u.value:!1));function w(e,t=1){var n;let i=k.parse((n=b.value)?.value??``);r.disabled||(isNaN(i)?g.value=s.value??0:e===`increase`?g.value=I(i+(f.value??1)*t):g.value=I(i-(f.value??1)*t))}function T(e=1){w(`increase`,e)}function E(e=1){w(`decrease`,e)}function D(e){e===`min`&&s.value!==void 0?g.value=I(s.value):e===`max`&&u.value!==void 0&&(g.value=I(u.value))}let O=Mh(p,m),k=Nh(p,m),A=a(()=>O.resolvedOptions().maximumFractionDigits>0?`decimal`:`numeric`),j=Mh(p,m),M=a(()=>isNaN(g.value)?``:j.format(g.value));function N(e){return k.isValidPartialNumber(e,s.value,u.value)}function F(e){b.value&&(b.value.value=e)}function I(e){let t;return t=f.value===void 0||isNaN(f.value)?Sa(e,s.value,u.value):wa(e,s.value,u.value,f.value),t=k.parse(O.format(t)),t}function ee(e){let t=k.parse(e);return g.value=I(t),e.length?(isNaN(t),F(M.value)):F(e)}return Lh({modelValue:g,handleDecrease:E,handleIncrease:T,handleMinMaxValue:D,inputMode:A,inputEl:b,onInputElement:e=>b.value=e,textValue:M,validate:N,applyInputValue:ee,disabled:o,max:u,min:s,isDecreaseDisabled:x,isIncreaseDisabled:S,id:h}),(e,n)=>(P(),l(t,null,[d(B(Q),C(e.$attrs,{ref_key:`primitiveElement`,ref:_,role:`group`,as:e.as,"as-child":e.asChild,"data-disabled":B(o)?``:void 0}),{default:U(()=>[R(e.$slots,`default`,{modelValue:B(g),textValue:M.value})]),_:3},16,[`as`,`as-child`,`data-disabled`]),B(y)?(P(),l(`input`,{key:0,type:`text`,tabindex:`-1`,"aria-hidden":`true`,value:B(g),name:r.name,disabled:r.disabled,required:r.required,style:{transform:`translateX(-100%)`,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}},null,8,Fh)):c(``,!0)],64))}}),zh=p({__name:`NumberFieldInput`,props:{asChild:{type:Boolean},as:{default:`input`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=Vs(),i=Ih();function a(e){e.target===J()&&(Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),e.deltaY>0?i.handleIncrease():e.deltaY<0&&i.handleDecrease()))}A(()=>{i.onInputElement(r.value)});let o=L(i.textValue.value);V(()=>i.textValue.value,()=>{o.value=i.textValue.value},{immediate:!0,deep:!0});function c(){requestAnimationFrame(()=>{o.value=i.textValue.value})}return(e,r)=>(P(),s(B(Q),C(t,{id:B(i).id.value,ref_key:`primitiveElement`,ref:n,value:o.value,role:`spinbutton`,type:`text`,tabindex:`0`,inputmode:B(i).inputMode.value,disabled:B(i).disabled.value?``:void 0,"data-disabled":B(i).disabled.value?``:void 0,autocomplete:`off`,autocorrect:`off`,spellcheck:`false`,"aria-roledescription":`Number field`,"aria-valuenow":B(i).modelValue.value,"aria-valuemin":B(i).min.value,"aria-valuemax":B(i).max.value,onKeydown:[r[0]||=W(G(e=>B(i).handleIncrease(),[`prevent`]),[`up`]),r[1]||=W(G(e=>B(i).handleDecrease(),[`prevent`]),[`down`]),r[2]||=W(G(e=>B(i).handleIncrease(10),[`prevent`]),[`page-up`]),r[3]||=W(G(e=>B(i).handleDecrease(10),[`prevent`]),[`page-down`]),r[4]||=W(G(e=>B(i).handleMinMaxValue(`min`),[`prevent`]),[`home`]),r[5]||=W(G(e=>B(i).handleMinMaxValue(`max`),[`prevent`]),[`end`]),r[8]||=W(e=>{var t;return B(i).applyInputValue((t=e.target)?.value)},[`enter`])],onWheel:a,onBeforeinput:r[6]||=e=>{let t=e.target,n=t.value.slice(0,t.selectionStart??void 0)+(e.data??``)+t.value.slice(t.selectionEnd??void 0);B(i).validate(n)||e.preventDefault()},onInput:r[7]||=e=>{let t=e.target;o.value=t.value},onChange:c,onBlur:r[9]||=e=>{var t;return B(i).applyInputValue((t=e.target)?.value)}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`value`,`inputmode`,`disabled`,`data-disabled`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`]))}}),Bh=p({__name:`NumberFieldIncrement`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=Ih(),r=a(()=>{var e;return(e=n.disabled)?.value||t.disabled||n.isIncreaseDisabled.value}),{primitiveElement:i,currentElement:o}=Vs(),{isPressed:c,onTrigger:l}=jh({target:o,disabled:r});return l(()=>{n.handleIncrease()}),(e,n)=>(P(),s(B(Q),C(t,{ref_key:`primitiveElement`,ref:i,tabindex:`-1`,"aria-label":`Increase`,type:e.as===`button`?`button`:void 0,style:{userSelect:B(c)?`none`:void 0},disabled:r.value?``:void 0,"data-disabled":r.value?``:void 0,"data-pressed":B(c)?`true`:void 0,onContextmenu:n[0]||=G(()=>{},[`prevent`])}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),Vh=p({__name:`NumberFieldDecrement`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=Ih(),r=a(()=>{var e;return(e=n.disabled)?.value||t.disabled||n.isDecreaseDisabled.value}),{primitiveElement:i,currentElement:o}=Vs(),{isPressed:c,onTrigger:l}=jh({target:o,disabled:r});return l(()=>{n.handleDecrease()}),(e,n)=>(P(),s(B(Q),C(t,{ref_key:`primitiveElement`,ref:i,tabindex:`-1`,"aria-label":`Decrease`,type:e.as===`button`?`button`:void 0,style:{userSelect:B(c)?`none`:void 0},disabled:r.value?``:void 0,"data-disabled":r.value?``:void 0,"data-pressed":B(c)?`true`:void 0,onContextmenu:n[0]||=G(()=>{},[`prevent`])}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),[Hh,Uh]=K(`PaginationRoot`),Wh=p({__name:`PaginationRoot`,props:{page:{},defaultPage:{default:1},itemsPerPage:{default:10},total:{default:0},siblingCount:{default:2},disabled:{type:Boolean},showEdges:{type:Boolean,default:!1},asChild:{type:Boolean},as:{default:`nav`}},emits:[`update:page`],setup(e,{emit:t}){let n=e,r=t,{siblingCount:i,disabled:o,showEdges:c}=z(n);X();let l=q(n,`page`,r,{defaultValue:n.defaultPage,passive:n.page===void 0}),u=a(()=>Math.max(1,Math.ceil(n.total/n.itemsPerPage)));return Uh({page:l,onPageChange(e){l.value=e},pageCount:u,siblingCount:i,disabled:o,showEdges:c}),(e,t)=>(P(),s(B(Q),{as:e.as,"as-child":e.asChild},{default:U(()=>[R(e.$slots,`default`,{page:B(l),pageCount:u.value})]),_:3},8,[`as`,`as-child`]))}}),Gh=p({__name:`PaginationEllipsis`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Q),C(t,{"data-type":`ellipsis`}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`…`)])]),_:3},16))}}),Kh=p({__name:`PaginationFirst`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=Hh();X();let r=a(()=>n.page.value===1||n.disabled.value);return(e,i)=>(P(),s(B(Q),C(t,{"aria-label":`First Page`,type:e.as===`button`?`button`:void 0,disabled:r.value,onClick:i[0]||=e=>!r.value&&B(n).onPageChange(1)}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`First page`)])]),_:3},16,[`type`,`disabled`]))}}),qh=p({__name:`PaginationLast`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=Hh();X();let r=a(()=>n.page.value===n.pageCount.value||n.disabled.value);return(e,i)=>(P(),s(B(Q),C(t,{"aria-label":`Last Page`,type:e.as===`button`?`button`:void 0,disabled:r.value,onClick:i[0]||=e=>!r.value&&B(n).onPageChange(B(n).pageCount.value)}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Last page`)])]),_:3},16,[`type`,`disabled`]))}});function Jh(e,t){let n=t-e+1;return Array.from({length:n},(t,n)=>n+e)}function Yh(e){return e.map(e=>typeof e==`number`?{type:`page`,value:e}:{type:`ellipsis`})}const Xh=`ellipsis`;function Zh(e,t,n,r){let i=t,a=Math.max(e-n,1),o=Math.min(e+n,i);if(r){let e=Math.min(2*n+5,t)-2,r=a>3&&Math.abs(i-e-1+1)>2&&Math.abs(a-1)>2,s=o2&&Math.abs(i-o)>2;if(!r&&s)return[...Jh(1,e),Xh,i];if(r&&!s){let t=Jh(i-e+1,i);return[1,Xh,...t]}if(r&&s){let e=Jh(a,o);return[1,Xh,...e,Xh,i]}return Jh(1,i)}else{let r=n*2+1;return tYh(Zh(n.page.value,n.pageCount.value,n.siblingCount.value,n.showEdges.value)));return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`,{items:r.value})]),_:3},16))}}),$h=p({__name:`PaginationListItem`,props:{value:{},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=Hh(),r=a(()=>n.page.value===t.value),i=a(()=>n.disabled.value);return(e,a)=>(P(),s(B(Q),C(t,{"data-type":`page`,"aria-label":`Page ${e.value}`,"aria-current":r.value?`page`:void 0,"data-selected":r.value?`true`:void 0,disabled:i.value,type:e.as===`button`?`button`:void 0,onClick:a[0]||=t=>!i.value&&B(n).onPageChange(e.value)}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(ae(e.value),1)])]),_:3},16,[`aria-label`,`aria-current`,`data-selected`,`disabled`,`type`]))}}),eg=p({__name:`PaginationNext`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=Hh(),r=a(()=>n.page.value===n.pageCount.value||n.disabled.value);return(e,i)=>(P(),s(B(Q),C(t,{"aria-label":`Next Page`,type:e.as===`button`?`button`:void 0,disabled:r.value,onClick:i[0]||=e=>!r.value&&B(n).onPageChange(B(n).page.value+1)}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Next page`)])]),_:3},16,[`type`,`disabled`]))}}),tg=p({__name:`PaginationPrev`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=Hh(),r=a(()=>n.page.value===1||n.disabled.value);return(e,i)=>(P(),s(B(Q),C(t,{"aria-label":`Previous Page`,type:e.as===`button`?`button`:void 0,disabled:r.value,onClick:i[0]||=e=>!r.value&&B(n).onPageChange(B(n).page.value-1)}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Prev page`)])]),_:3},16,[`type`,`disabled`]))}}),ng=[`id`,`value`,`name`,`disabled`,`required`],[rg,ig]=K(`PinInputRoot`),ag=p({inheritAttrs:!1,__name:`PinInputRoot`,props:{modelValue:{},defaultValue:{},placeholder:{default:``},mask:{type:Boolean},otp:{type:Boolean},type:{default:`text`},dir:{},name:{},disabled:{type:Boolean},required:{type:Boolean},id:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`,`complete`],setup(e,{emit:n}){let r=e,i=n,{mask:s,otp:c,placeholder:u,type:f,disabled:p,dir:m}=z(r),{forwardRef:h}=X(),g=Y(m),_=q(r,`modelValue`,i,{defaultValue:r.defaultValue??[],passive:r.modelValue===void 0}),v=L(new Set);function y(e){v.value.add(e)}let b=a(()=>_.value.filter(e=>!!e).length===v.value.size);return V(_,()=>{b.value&&i(`complete`,_.value)},{deep:!0}),ig({modelValue:_,mask:s,otp:c,placeholder:u,type:f,dir:g,disabled:p,isCompleted:b,inputElements:v,onInputElementChange:y}),(e,n)=>(P(),l(t,null,[d(B(Q),C(e.$attrs,{ref:B(h),dir:B(g),"data-complete":b.value?``:void 0,"data-disabled":B(p)?``:void 0}),{default:U(()=>[R(e.$slots,`default`,{modelValue:B(_)})]),_:3},16,[`dir`,`data-complete`,`data-disabled`]),o(`input`,{id:e.id,type:`text`,tabindex:`-1`,"aria-hidden":`true`,value:B(_).join(``),name:e.name,disabled:B(p),required:e.required,style:{transform:`translateX(-100%)`,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0},onFocus:n[0]||=e=>{var t,n;return(n=(t=Array.from(v.value))?.[0])?.focus()}},null,40,ng)],64))}}),og=p({__name:`PinInputInput`,props:{index:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`input`}},setup(e){let t=e,n=rg(),r=a(()=>Array.from(n.inputElements.value)),i=a(()=>n.modelValue.value[t.index]),o=a(()=>t.disabled||n.disabled.value),c=a(()=>n.otp.value),l=a(()=>n.type.value===`number`),u=a(()=>n.mask.value),{primitiveElement:d,currentElement:f}=Vs();function p(e){var n;let i=e.target;if(((n=e.data)?.length??0)>1){x(i.value);return}if(l.value&&!/^\d*$/.test(i.value)){i.value=i.value.replace(/\D/g,``);return}i.value=i.value.slice(-1),C(t.index,i.value);let a=r.value[t.index+1];a&&a.focus()}function m(){let e=f.value;w(()=>{e&&!e.value&&(e.placeholder=n.placeholder.value)})}function h(e){Vo(e,J(),void 0,{itemsArray:r.value,focus:!0,loop:!1,arrowKeyOptions:`horizontal`,dir:n.dir.value})}function g(e){if(e.preventDefault(),e.target.value)C(t.index,``);else{let e=r.value[t.index-1];e&&(e.focus(),C(t.index-1,``))}}function _(e){e.key===`Delete`&&(e.preventDefault(),C(t.index,``))}function v(e){let t=e.target;t.setSelectionRange(1,1),t.value||(t.placeholder=``)}function y(e){m()}function b(e){e.preventDefault();let t=e.clipboardData;if(!t)return;let n=t.getData(`text`);x(n)}function x(e){var i;let a=[...n.modelValue.value],o=e.length>=r.value.length?0:t.index,s=Math.min(o+e.length,r.value.length);for(let t=o;t=0&&e[t]===``;)e.pop(),t--;return e}function C(e,t){let r=[...n.modelValue.value];r[e]=t,n.modelValue.value=S(r)}return V(i,()=>{i.value||m()}),A(()=>{n.onInputElementChange(f.value)}),M(()=>{var e;(e=n.inputElements)==null||e.value.delete(f.value)}),(e,t)=>(P(),s(B(Q),{ref_key:`primitiveElement`,ref:d,autocapitalize:`none`,as:e.as,"as-child":e.asChild,autocomplete:c.value?`one-time-code`:`false`,type:u.value?`password`:`text`,inputmode:l.value?`numeric`:`text`,pattern:l.value?`[0-9]*`:void 0,placeholder:B(n).placeholder.value,value:i.value,disabled:o.value,"data-disabled":o.value?``:void 0,"data-complete":B(n).isCompleted.value?``:void 0,"aria-label":`pin input ${e.index+1} of ${r.value.length}`,onInput:t[0]||=e=>p(e),onKeydown:[W(h,[`left`,`right`,`up`,`down`,`home`,`end`]),W(g,[`backspace`]),W(_,[`delete`])],onFocus:v,onBlur:y,onPaste:b},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`autocomplete`,`type`,`inputmode`,`pattern`,`placeholder`,`value`,`disabled`,`data-disabled`,`data-complete`,`aria-label`]))}}),[sg,cg]=K(`PopoverRoot`),lg=p({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},modal:{type:Boolean,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i}=z(n),a=q(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),o=L(),c=L(!1);return cg({contentId:``,modal:i,open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerElement:o,hasCustomAnchor:c}),(e,t)=>(P(),s(B($l),null,{default:U(()=>[R(e.$slots,`default`,{open:B(a)})]),_:3}))}}),ug=p({__name:`PopoverTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=sg(),{forwardRef:r,currentElement:i}=X();return A(()=>{n.triggerElement.value=i.value}),(e,i)=>(P(),s(ne(B(n).hasCustomAnchor.value?B(Q):B(eu)),{"as-child":``},{default:U(()=>[d(B(Q),{ref:B(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":B(n).open.value,"aria-controls":B(n).contentId,"data-state":B(n).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:B(n).onOpenToggle},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),dg=p({__name:`PopoverPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(pc),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),fg=p({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=fs(n),{forwardRef:a}=X(),o=sg();return ls(),(e,t)=>(P(),s(B(Lc),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:U(()=>[d(B(xc),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:t[0]||=e=>r(`pointerDownOutside`,e),onInteractOutside:t[1]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[3]||=e=>r(`focusOutside`,e),onDismiss:t[4]||=e=>B(o).onOpenChange(!1)},{default:U(()=>[d(B(su),C(B(i),{id:B(o).contentId,ref:B(a),"data-state":B(o).open.value?`open`:`closed`,role:`dialog`,style:{"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`data-state`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),pg=p({__name:`PopoverContentModal`,props:{trapFocus:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=sg(),a=L(!1);$o(!0);let o=ps(n,r),{forwardRef:c,currentElement:l}=X();return As(l),(e,t)=>(P(),s(fg,C(B(o),{ref:B(c),"trap-focus":B(i).open.value,"disable-outside-pointer-events":``,onCloseAutoFocus:t[0]||=G(e=>{var t;r(`closeAutoFocus`,e),a.value||(t=B(i).triggerElement.value)==null||t.focus()},[`prevent`]),onPointerDownOutside:t[1]||=e=>{r(`pointerDownOutside`,e);let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,i=t.button===2||n;a.value=i},onFocusOutside:t[2]||=G(()=>{},[`prevent`])}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),mg=p({__name:`PopoverContentNonModal`,props:{trapFocus:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=sg(),a=L(!1),o=L(!1),c=ps(n,r);return(e,t)=>(P(),s(fg,C(B(c),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{var t;r(`closeAutoFocus`,e),e.defaultPrevented||(a.value||(t=B(i).triggerElement.value)==null||t.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=async e=>{var t;r(`interactOutside`,e),e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let n=e.target;(t=B(i).triggerElement.value)!=null&&t.contains(n)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),hg=p({__name:`PopoverContent`,props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=sg(),a=ps(n,r),{forwardRef:o}=X();return i.contentId||=Z(void 0,`radix-vue-popover-content`),(e,t)=>(P(),s(B(Js),{present:e.forceMount||B(i).open.value},{default:U(()=>[B(i).modal.value?(P(),s(pg,C({key:0},B(a),{ref:B(o)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):(P(),s(mg,C({key:1},B(a),{ref:B(o)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),gg=p({__name:`PopoverArrow`,props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:`svg`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(du),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),_g=p({__name:`PopoverClose`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=sg();return(e,r)=>(P(),s(B(Q),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,onClick:r[0]||=e=>B(n).onOpenChange(!1)},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`]))}}),vg=p({__name:`PopoverAnchor`,props:{element:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;X();let n=sg();return D(()=>{n.hasCustomAnchor.value=!0}),M(()=>{n.hasCustomAnchor.value=!1}),(e,n)=>(P(),s(B(eu),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),yg=100,[bg,xg]=K(`ProgressRoot`),Sg=e=>typeof e==`number`;function Cg(e,t){return ja(e)||Sg(e)&&!Number.isNaN(e)&&e<=t&&e>=0?e:(console.error(`Invalid prop \`value\` of value \`${e}\` supplied to \`ProgressRoot\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${yg} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`),null)}function wg(e){return Sg(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${yg}\`.`),yg)}const Tg=p({__name:`ProgressRoot`,props:{modelValue:{},max:{default:yg},getValueLabel:{type:Function,default:(e,t)=>`${Math.round(e/t*yg)}%`},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;X();let i=q(n,`modelValue`,r,{passive:n.modelValue===void 0}),o=q(n,`max`,r,{passive:n.max===void 0});V(()=>i.value,async e=>{let t=Cg(e,n.max);t!==e&&(await w(),i.value=t)},{immediate:!0}),V(()=>n.max,e=>{let t=wg(n.max);t!==e&&(o.value=t)},{immediate:!0});let c=a(()=>ja(i.value)?`indeterminate`:i.value===o.value?`complete`:`loading`);return xg({modelValue:i,max:o,progressState:c}),(e,t)=>(P(),s(B(Q),{"as-child":e.asChild,as:e.as,"aria-valuemax":B(o),"aria-valuemin":0,"aria-valuenow":Sg(B(i))?B(i):void 0,"aria-valuetext":e.getValueLabel(B(i),B(o)),"aria-label":e.getValueLabel(B(i),B(o)),role:`progressbar`,"data-state":c.value,"data-value":B(i)??void 0,"data-max":B(o)},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),Eg=p({__name:`ProgressIndicator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=bg();return X(),(e,r)=>{var i;return P(),s(B(Q),C(t,{"data-state":B(n).progressState.value,"data-value":(i=B(n).modelValue)?.value??void 0,"data-max":B(n).max.value}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`])}}}),[Dg,Og]=K(`RadioGroupRoot`),kg=p({__name:`RadioGroupRoot`,props:{modelValue:{},defaultValue:{},disabled:{type:Boolean,default:!1},name:{},required:{type:Boolean,default:!1},orientation:{default:void 0},dir:{},loop:{type:Boolean,default:!0},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i}=X(),a=q(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:o,loop:c,orientation:l,name:u,required:f,dir:p}=z(n),m=Y(p);return Og({modelValue:a,changeModelValue:e=>{a.value=e},disabled:o,loop:c,orientation:l,name:u?.value,required:f}),(e,t)=>(P(),s(B(dd),{"as-child":``,orientation:B(l),dir:B(m),loop:B(c)},{default:U(()=>[d(B(Q),{ref:B(i),role:`radiogroup`,"data-disabled":B(o)?``:void 0,"as-child":e.asChild,as:e.as,required:B(f),"aria-orientation":B(l),"aria-required":B(f),dir:B(m),name:B(u)},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(a)})]),_:3},8,[`data-disabled`,`as-child`,`as`,`required`,`aria-orientation`,`aria-required`,`dir`,`name`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),Ag=[`value`,`checked`,`name`,`disabled`,`required`],jg=p({__name:`Radio`,props:{id:{},value:{},disabled:{type:Boolean,default:!1},required:{type:Boolean},checked:{type:Boolean,default:void 0},name:{},asChild:{type:Boolean},as:{default:`button`}},emits:[`update:checked`],setup(e,{emit:t}){let n=e,r=q(n,`checked`,t,{passive:n.checked===void 0}),{value:i}=z(n),{forwardRef:o,currentElement:u}=X(),d=ds(u),f=a(()=>{var e;return n.id&&u.value?(e=document.querySelector(`[for="${n.id}"]`))?.innerText??n.value:void 0});function p(e){r.value=!0,d.value&&e.stopPropagation()}return(e,t)=>(P(),s(B(Q),C(e.$attrs,{id:e.id,ref:B(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":B(r),"aria-label":f.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":B(r)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:B(i),required:e.required,name:e.name,onClick:G(p,[`stop`])}),{default:U(()=>[R(e.$slots,`default`,{checked:B(r)}),B(d)?(P(),l(`input`,{key:0,type:`radio`,tabindex:`-1`,"aria-hidden":`true`,value:B(i),checked:!!B(r),name:e.name,disabled:e.disabled,required:e.required,style:{transform:`translateX(-100%)`,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}},null,8,Ag)):c(``,!0)]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]))}}),[Mg,Ng]=K(`RadioGroupItem`),Pg=p({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{},value:{},disabled:{type:Boolean,default:!1},required:{type:Boolean},name:{},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,{forwardRef:n,currentElement:r}=X(),i=Dg(),o=a(()=>i.disabled.value||t.disabled),c=a(()=>i.required.value||t.required),l=a(()=>{var e;return(e=i.modelValue)?.value===t.value});Ng({disabled:o,checked:l});let u=L(!1),f=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`];Eo(`keydown`,e=>{f.includes(e.key)&&(u.value=!0)}),Eo(`keyup`,()=>{u.value=!1});function p(){setTimeout(()=>{var e;u.value&&((e=r.value)==null||e.click())},0)}return(e,r)=>(P(),s(B(fd),{checked:l.value,disabled:o.value,"as-child":``,focusable:!o.value,active:l.value},{default:U(()=>[d(jg,C({...e.$attrs,...t},{ref:B(n),checked:l.value,required:c.value,disabled:o.value,"onUpdate:checked":r[0]||=t=>B(i).changeModelValue(e.value),onKeydown:r[1]||=W(G(()=>{},[`prevent`]),[`enter`]),onFocus:p}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`checked`,`required`,`disabled`])]),_:3},8,[`checked`,`disabled`,`focusable`,`active`]))}}),Fg=p({__name:`RadioGroupIndicator`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{default:`span`}},setup(e){let{forwardRef:t}=X(),n=Mg();return(e,r)=>(P(),s(B(Js),{present:e.forceMount||B(n).checked.value},{default:U(()=>[d(B(Q),C({ref:B(t),"data-state":B(n).checked.value?`checked`:`unchecked`,"data-disabled":B(n).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},e.$attrs),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}});function Ig(e){let t=a(()=>e.start.value?!!e.isDateDisabled(e.start.value):!1),n=a(()=>e.end.value?!!e.isDateDisabled(e.end.value):!1),r=a(()=>t.value||n.value?!1:!!(e.start.value&&e.end.value&&la(e.end.value,e.start.value))),i=t=>e.start.value?Qt(e.start.value,t):!1,o=t=>e.end.value?Qt(e.end.value,t):!1,s=t=>e.start.value&&Qt(e.start.value,t)||e.end.value&&Qt(e.end.value,t)?!0:e.end.value&&e.start.value?ma(t,e.start.value,e.end.value):!1,c=a(()=>{if(e.start.value&&e.end.value||!e.start.value||!e.focusedValue.value)return null;let t=la(e.start.value,e.focusedValue.value),n=t?e.start.value:e.focusedValue.value,r=t?e.focusedValue.value:e.start.value;return Qt(n,r)||_a(n,r,e.isDateUnavailable,e.isDateDisabled)?{start:n,end:r}:null});return{isInvalid:r,isSelected:s,highlightedRange:c,isSelectionStart:i,isSelectionEnd:o,isHighlightedStart:e=>!c.value||!c.value.start?!1:Qt(c.value.start,e),isHighlightedEnd:e=>!c.value||!c.value.end?!1:Qt(c.value.end,e)}}const Lg={style:{border:`0px`,clip:`rect(0px, 0px, 0px, 0px)`,"clip-path":`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0px`,position:`absolute`,"white-space":`nowrap`,width:`1px`}},Rg={role:`heading`,"aria-level":`2`},[zg,Bg]=K(`RangeCalendarRoot`),Vg=p({__name:`RangeCalendarRoot`,props:{defaultPlaceholder:{},defaultValue:{default:()=>({start:void 0,end:void 0})},modelValue:{},placeholder:{default:void 0},pagedNavigation:{type:Boolean,default:!1},preventDeselect:{type:Boolean,default:!1},weekStartsOn:{default:0},weekdayFormat:{default:`narrow`},calendarLabel:{},fixedWeeks:{type:Boolean,default:!1},maxValue:{},minValue:{},locale:{default:`en`},numberOfMonths:{default:1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},initialFocus:{type:Boolean,default:!1},isDateDisabled:{type:Function,default:void 0},isDateUnavailable:{type:Function,default:void 0},dir:{},nextPage:{},prevPage:{},asChild:{type:Boolean},as:{default:`div`}},emits:[`update:modelValue`,`update:placeholder`,`update:startValue`],setup(e,{emit:t}){let n=e,r=t,{disabled:i,readonly:a,initialFocus:c,pagedNavigation:l,weekStartsOn:u,weekdayFormat:d,fixedWeeks:f,numberOfMonths:p,preventDeselect:m,isDateUnavailable:h,isDateDisabled:g,calendarLabel:_,maxValue:v,minValue:y,locale:b,dir:x,nextPage:S,prevPage:C}=z(n),{primitiveElement:w,currentElement:T}=Vs(),E=Y(x),D=L(),O=L(),k=q(n,`modelValue`,r,{defaultValue:n.defaultValue??{start:void 0,end:void 0},passive:n.modelValue===void 0}),j=Ma({defaultPlaceholder:n.placeholder,defaultValue:k.value.start,locale:n.locale}),M=L(k.value.start),N=L(k.value.end),F=q(n,`placeholder`,r,{defaultValue:n.defaultPlaceholder??j.copy(),passive:n.placeholder===void 0});function I(e){F.value=e.copy()}let{fullCalendarLabel:ee,headingValue:te,isDateDisabled:ne,isDateUnavailable:re,isNextButtonDisabled:ie,isPrevButtonDisabled:oe,grid:se,weekdays:ce,isOutsideVisibleView:le,nextPage:ue,prevPage:de,formatter:fe}=Dl({locale:b,placeholder:F,weekStartsOn:u,fixedWeeks:f,numberOfMonths:p,minValue:y,maxValue:v,disabled:i,weekdayFormat:d,pagedNavigation:l,isDateDisabled:g.value,isDateUnavailable:h.value,calendarLabel:_,nextPage:S,prevPage:C}),{isInvalid:pe,isSelected:me,highlightedRange:H,isSelectionStart:he,isSelectionEnd:ge,isHighlightedStart:_e,isHighlightedEnd:W}=Ig({start:M,end:N,isDateDisabled:ne,isDateUnavailable:re,focusedValue:O});return V(k,e=>{var t,n,r,i;(!e||!e.start||M.value&&!en(e.start,M.value))&&(M.value=(n=(t=e?.start)?.copy)?.call(t)),(!e||!e.end||N.value&&!en(e.end,N.value))&&(N.value=(i=(r=e?.end)?.copy)?.call(r))}),V(M,e=>{e&&!en(e,F.value)&&I(e),r(`update:startValue`,e)}),V([M,N],([e,t])=>{let n=k.value;if(!(n&&n.start&&n.end&&e&&t&&en(n.start,e)&&en(n.end,t)))if(e&&t){if(n.start&&n.end&&en(n.start,e)&&en(n.end,t))return;la(t,e)?k.value={start:t.copy(),end:e.copy()}:k.value={start:e.copy(),end:t.copy()}}else n.start&&n.end&&(k.value={start:e?.copy(),end:void 0})}),Bg({isDateUnavailable:re,startValue:M,endValue:N,formatter:fe,modelValue:k,placeholder:F,disabled:i,initialFocus:c,pagedNavigation:l,weekStartsOn:u,weekdayFormat:d,fixedWeeks:f,numberOfMonths:p,readonly:a,preventDeselect:m,fullCalendarLabel:ee,headingValue:te,isInvalid:pe,isDateDisabled:ne,highlightedRange:H,focusedValue:O,lastPressedDateValue:D,isSelected:me,isSelectionEnd:ge,isSelectionStart:he,isNextButtonDisabled:ie,isPrevButtonDisabled:oe,isOutsideVisibleView:le,nextPage:ue,prevPage:de,parentElement:T,onPlaceholderChange:I,locale:b,dir:E,isHighlightedStart:_e,isHighlightedEnd:W}),A(()=>{c.value&&Ya(T.value)}),(e,t)=>(P(),s(B(Q),{ref_key:`primitiveElement`,ref:w,as:e.as,"as-child":e.asChild,role:`application`,"aria-label":B(ee),"data-readonly":B(a)?``:void 0,"data-disabled":B(i)?``:void 0,"data-invalid":B(pe)?``:void 0,dir:B(E)},{default:U(()=>[o(`div`,Lg,[o(`div`,Rg,ae(B(ee)),1)]),R(e.$slots,`default`,{date:B(F),grid:B(se),weekDays:B(ce),weekStartsOn:B(u),locale:B(b),fixedWeeks:B(f)})]),_:3},8,[`as`,`as-child`,`aria-label`,`data-readonly`,`data-disabled`,`data-invalid`,`dir`]))}}),Hg=p({__name:`RangeCalendarHeader`,props:{asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Ug=p({__name:`RangeCalendarHeading`,props:{asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e,n=zg();return(e,r)=>(P(),s(B(Q),C(t,{"data-disabled":B(n).disabled.value?``:void 0}),{default:U(()=>[R(e.$slots,`default`,{headingValue:B(n).headingValue.value},()=>[u(ae(B(n).headingValue.value),1)])]),_:3},16,[`data-disabled`]))}}),Wg=p({__name:`RangeCalendarGrid`,props:{asChild:{type:Boolean},as:{default:`table`}},setup(e){let t=e,n=zg(),r=a(()=>n.disabled.value?!0:void 0),i=a(()=>n.readonly.value?!0:void 0);return(e,n)=>(P(),s(B(Q),C(t,{tabindex:`-1`,role:`grid`,"aria-readonly":i.value,"aria-disabled":r.value,"data-readonly":i.value&&``,"data-disabled":r.value&&``}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-readonly`,`aria-disabled`,`data-readonly`,`data-disabled`]))}}),Gg=p({__name:`RangeCalendarCell`,props:{date:{},asChild:{type:Boolean},as:{default:`td`}},setup(e){let t=zg();return(e,n)=>{var r,i;return P(),s(B(Q),{as:e.as,"as-child":e.asChild,role:`gridcell`,"aria-selected":B(t).isSelected(e.date)?!0:void 0,"aria-disabled":B(t).isDateDisabled(e.date)||(i=(r=B(t)).isDateUnavailable)?.call(r,e.date),"data-disabled":B(t).isDateDisabled(e.date)?``:void 0},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-selected`,`aria-disabled`,`data-disabled`])}}}),Kg=p({__name:`RangeCalendarHeadCell`,props:{asChild:{type:Boolean},as:{default:`th`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),qg=p({__name:`RangeCalendarNext`,props:{step:{},nextPage:{},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=a(()=>r.disabled.value||r.isNextButtonDisabled(t.step,t.nextPage)),r=zg();return(e,i)=>(P(),s(B(Q),C(t,{"aria-label":`Next page`,type:e.as===`button`?`button`:void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:i[0]||=e=>B(r).nextPage(t.step,t.nextPage)}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Next page`)])]),_:3},16,[`type`,`aria-disabled`,`data-disabled`,`disabled`]))}}),Jg=p({__name:`RangeCalendarPrev`,props:{step:{},prevPage:{},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=a(()=>r.disabled.value||r.isPrevButtonDisabled(t.step,t.prevPage)),r=zg();return(e,i)=>(P(),s(B(Q),C(t,{"aria-label":`Previous page`,type:e.as===`button`?`button`:void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:i[0]||=e=>B(r).prevPage(t.step,t.prevPage)}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`Prev page`)])]),_:3},16,[`type`,`aria-disabled`,`data-disabled`,`disabled`]))}}),Yg=p({__name:`RangeCalendarGridHead`,props:{asChild:{type:Boolean},as:{default:`thead`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),C(t,{"aria-hidden":`true`}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Xg=p({__name:`RangeCalendarGridBody`,props:{asChild:{type:Boolean},as:{default:`tbody`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Zg=p({__name:`RangeCalendarGridRow`,props:{asChild:{type:Boolean},as:{default:`tr`}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Qg=p({__name:`RangeCalendarCellTrigger`,props:{day:{},month:{},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e,n=zg(),r=zs(),{primitiveElement:i,currentElement:o}=Vs(),c=a(()=>n.formatter.custom(ia(t.day),{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`})),l=a(()=>n.isDateDisabled(t.day)),d=a(()=>{var e;return(e=n.isDateUnavailable)?.call(n,t.day)}),f=a(()=>n.isSelected(t.day)),p=a(()=>n.isSelectionStart(t.day)),m=a(()=>n.isSelectionEnd(t.day)),h=a(()=>n.isHighlightedStart(t.day)),g=a(()=>n.isHighlightedEnd(t.day)),_=a(()=>n.highlightedRange.value?pa(t.day,n.highlightedRange.value.start,n.highlightedRange.value.end):!1),v=`[data-radix-vue-calendar-cell-trigger]:not([data-disabled]):not([data-outside-view]):not([data-outside-visible-view])`,y=a(()=>nn(t.day,dn())),b=a(()=>!$t(t.day,t.month)),x=a(()=>n.isOutsideVisibleView(t.day)),S=a(()=>t.day.day.toLocaleString(n.locale.value)),T=a(()=>!n.disabled.value&&Qt(t.day,n.placeholder.value));function E(e,t){var r;if(!n.readonly.value&&!(n.isDateDisabled(t)||(r=n.isDateUnavailable)!=null&&r.call(n,t))){if(n.lastPressedDateValue.value=t.copy(),n.startValue.value&&n.highlightedRange.value===null){if(Qt(t,n.startValue.value)&&!n.preventDeselect.value&&!n.endValue.value){n.startValue.value=void 0,n.onPlaceholderChange(t);return}else if(!n.endValue.value){e.preventDefault(),n.lastPressedDateValue.value&&Qt(n.lastPressedDateValue.value,t)&&(n.startValue.value=t.copy());return}}if(n.startValue.value&&n.endValue.value&&Qt(n.endValue.value,t)&&!n.preventDeselect.value){n.startValue.value=void 0,n.endValue.value=void 0,n.onPlaceholderChange(t);return}n.startValue.value?n.endValue.value?n.endValue.value&&n.startValue.value&&(n.endValue.value=void 0,n.startValue.value=t.copy()):n.endValue.value=t.copy():n.startValue.value=t.copy()}}function D(e){E(e,t.day)}function O(){var e;n.isDateDisabled(t.day)||(e=n.isDateUnavailable)!=null&&e.call(n,t.day)||(n.focusedValue.value=t.day.copy())}function k(e){e.preventDefault(),e.stopPropagation();let i=n.parentElement.value,a=i?Array.from(i.querySelectorAll(v)):[],s=a.indexOf(o.value),c=7,l=n.dir.value===`rtl`?-1:1;switch(e.code){case r.ARROW_RIGHT:s+=l;break;case r.ARROW_LEFT:s-=l;break;case r.ARROW_UP:s-=c;break;case r.ARROW_DOWN:s+=c;break;case r.ENTER:case r.SPACE_CODE:E(e,t.day);return;default:return}if(s>=0&&s{let e=i?Array.from(i.querySelectorAll(v)):[];if(!n.pagedNavigation.value){let t=ca(n.placeholder.value);e[t-Math.abs(s)].focus();return}e[e.length-Math.abs(s)].focus()});return}if(s>=a.length){if(n.isNextButtonDisabled(`month`))return;n.nextPage(),w(()=>{let e=i?Array.from(i.querySelectorAll(v)):[];if(!n.pagedNavigation.value){let t=ca(n.placeholder.value.add({months:n.numberOfMonths.value-1}));e[e.length-t+s-a.length].focus();return}e[s-a.length].focus()})}}return(e,n)=>(P(),s(B(Q),C({ref_key:`primitiveElement`,ref:i},t,{role:`button`,"aria-label":c.value,"data-radix-vue-calendar-cell-trigger":``,"aria-selected":f.value?!0:void 0,"aria-disabled":l.value||d.value?!0:void 0,"data-highlighted":_.value?``:void 0,"data-selection-start":p.value?!0:void 0,"data-selection-end":m.value?!0:void 0,"data-highlighted-start":h.value?!0:void 0,"data-highlighted-end":g.value?!0:void 0,"data-selected":f.value?!0:void 0,"data-outside-visible-view":x.value?``:void 0,"data-value":e.day.toString(),"data-disabled":l.value?``:void 0,"data-unavailable":d.value?``:void 0,"data-today":y.value?``:void 0,"data-outside-view":b.value?``:void 0,"data-focused":T.value?``:void 0,tabindex:T.value?0:b.value||l.value?void 0:-1,onClick:D,onFocusin:O,onMouseenter:O,onKeydown:W(k,[`up`,`down`,`left`,`right`,`enter`,`space`])}),{default:U(()=>[R(e.$slots,`default`,{dayValue:S.value},()=>[u(ae(S.value),1)])]),_:3},16,[`aria-label`,`aria-selected`,`aria-disabled`,`data-highlighted`,`data-selection-start`,`data-selection-end`,`data-highlighted-start`,`data-highlighted-end`,`data-selected`,`data-outside-visible-view`,`data-value`,`data-disabled`,`data-unavailable`,`data-today`,`data-outside-view`,`data-focused`,`tabindex`]))}}),[$g,e_]=K(`ScrollAreaRoot`),t_=p({__name:`ScrollAreaRoot`,props:{type:{default:`hover`},dir:{},scrollHideDelay:{default:600},asChild:{type:Boolean},as:{}},setup(e,{expose:t}){let n=e,r=L(0),i=L(0),a=L(),o=L(),c=L(),l=L(),u=L(!1),d=L(!1),{type:f,dir:p,scrollHideDelay:m}=z(n),h=Y(p);function g(){var e;(e=a.value)==null||e.scrollTo({top:0})}function _(){var e;(e=a.value)==null||e.scrollTo({top:0,left:0})}t({viewport:a,scrollTop:g,scrollTopLeft:_});let{forwardRef:v,currentElement:y}=X();return e_({type:f,dir:h,scrollHideDelay:m,scrollArea:y,viewport:a,onViewportChange:e=>{a.value=e||void 0},content:o,onContentChange:e=>{o.value=e},scrollbarX:c,scrollbarXEnabled:u,scrollbarY:l,scrollbarYEnabled:d,onScrollbarXChange:e=>{c.value=e||void 0},onScrollbarYChange:e=>{l.value=e||void 0},onScrollbarXEnabledChange:e=>{u.value=e},onScrollbarYEnabledChange:e=>{d.value=e},onCornerWidthChange:e=>{r.value=e},onCornerHeightChange:e=>{i.value=e}}),(e,t)=>(P(),s(B(Q),{ref:B(v),"as-child":n.asChild,as:e.as,dir:B(h),style:E({position:`relative`,"--radix-scroll-area-corner-width":`${r.value}px`,"--radix-scroll-area-corner-height":`${i.value}px`})},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`dir`,`style`]))}}),n_=p({inheritAttrs:!1,__name:`ScrollAreaViewport`,props:{nonce:{},asChild:{type:Boolean},as:{}},setup(e,{expose:n}){let r=e,{nonce:i}=z(r),a=Lu(i),s=$g(),c=L();A(()=>{s.onViewportChange(c.value),s.onContentChange(p.value)}),n({viewportElement:c});let{forwardRef:f,currentElement:p}=X();return(e,n)=>(P(),l(t,null,[o(`div`,C({ref_key:`viewportElement`,ref:c,"data-radix-scroll-area-viewport":``,style:{overflowX:B(s).scrollbarXEnabled.value?`scroll`:`hidden`,overflowY:B(s).scrollbarYEnabled.value?`scroll`:`hidden`}},e.$attrs,{tabindex:0}),[d(B(Q),{ref:B(f),style:E({minWidth:B(s).scrollbarXEnabled.value?`fit-content`:void 0}),"as-child":r.asChild,as:e.as},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`style`,`as-child`,`as`])],16),d(B(Q),{as:`style`,nonce:B(a)},{default:U(()=>[u(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-radix-scroll-area-viewport] { scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; } [data-radix-scroll-area-viewport]::-webkit-scrollbar { display:none; } `)]),_:1},8,[`nonce`])],64))}});function r_(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function i_(e){let t=a_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function a_(e,t){let n=e/t;return Number.isNaN(n)?0:n}function o_(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)}function s_(e,t,n=`ltr`){let r=i_(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=Sa(e,c[0],c[1]);return r_([0,o],[0,s])(l)}function c_(e){return e?Number.parseInt(e,10):0}function l_(e,t,n,r=`ltr`){let i=i_(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return r_([c,l],d)(e)}function u_(e,t){return e>0&&e{document.addEventListener(`wheel`,g,{passive:!1})}),M(()=>{document.removeEventListener(`wheel`,g)});function _(){var e,t,r,o,s;l.value&&(n.isHorizontal?a.handleSizeChange({content:(e=i.viewport.value)?.scrollWidth??0,viewport:(t=i.viewport.value)?.offsetWidth??0,scrollbar:{size:l.value.clientWidth??0,paddingStart:c_(getComputedStyle(l.value).paddingLeft),paddingEnd:c_(getComputedStyle(l.value).paddingRight)}}):a.handleSizeChange({content:(r=i.viewport.value)?.scrollHeight??0,viewport:(o=i.viewport.value)?.offsetHeight??0,scrollbar:{size:(s=l.value)?.clientHeight??0,paddingStart:c_(getComputedStyle(l.value).paddingLeft),paddingEnd:c_(getComputedStyle(l.value).paddingRight)}}))}return Io(l,_),Io(i.content,_),(e,t)=>(P(),s(B(Q),{ref:B(c),style:{position:`absolute`},"data-scrollbarimpl":``,as:B(o).as.value,"as-child":B(o).asChild.value,onPointerdown:p,onPointermove:m,onPointerup:h},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}}),f_=p({__name:`ScrollAreaScrollbarX`,setup(e){let t=$g(),n=m_(),{forwardRef:r,currentElement:i}=X();A(()=>{i.value&&t.onScrollbarXChange(i.value)});let o=a(()=>n.sizes.value);return(e,i)=>(P(),s(d_,{ref:B(r),"is-horizontal":!0,"data-orientation":`horizontal`,style:E({bottom:0,left:B(t).dir.value===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:B(t).dir.value===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":o.value?`${B(i_)(o.value)}px`:void 0}),onOnDragScroll:i[0]||=e=>B(n).onDragScroll(e.x)},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`style`]))}}),p_=p({__name:`ScrollAreaScrollbarY`,setup(e){let t=$g(),n=m_(),{forwardRef:r,currentElement:i}=X();A(()=>{i.value&&t.onScrollbarYChange(i.value)});let o=a(()=>n.sizes.value);return(e,i)=>(P(),s(d_,{ref:B(r),"is-horizontal":!1,"data-orientation":`vertical`,style:E({top:0,right:B(t).dir.value===`ltr`?0:void 0,left:B(t).dir.value===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":o.value?`${B(i_)(o.value)}px`:void 0}),onOnDragScroll:i[0]||=e=>B(n).onDragScroll(e.y)},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`style`]))}}),[m_,h_]=K(`ScrollAreaScrollbarVisible`),g_=p({__name:`ScrollAreaScrollbarVisible`,setup(e){let t=$g(),n=b_(),{forwardRef:r}=X(),i=L({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),o=a(()=>{let e=a_(i.value.viewport,i.value.content);return e>0&&e<1}),c=L(),l=L(0);function u(e,n){if(h.value){let r=t.viewport.value.scrollLeft+e.deltaY;t.viewport.value.scrollLeft=r,u_(r,n)&&e.preventDefault()}else{let r=t.viewport.value.scrollTop+e.deltaY;t.viewport.value.scrollTop=r,u_(r,n)&&e.preventDefault()}}function d(e,t){h.value?l.value=t.x:l.value=t.y}function f(e){l.value=0}function p(e){i.value=e}function m(e,t){return l_(e,l.value,i.value,t)}let h=a(()=>n.isHorizontal.value);function g(e){h.value?t.viewport.value.scrollLeft=m(e,t.dir.value):t.viewport.value.scrollTop=m(e)}function _(){if(h.value){if(t.viewport.value&&c.value){let e=t.viewport.value.scrollLeft,n=s_(e,i.value,t.dir.value);c.value.style.transform=`translate3d(${n}px, 0, 0)`}}else if(t.viewport.value&&c.value){let e=t.viewport.value.scrollTop,n=s_(e,i.value);c.value.style.transform=`translate3d(0, ${n}px, 0)`}}function v(e){c.value=e}return h_({sizes:i,hasThumb:o,handleWheelScroll:u,handleThumbDown:d,handleThumbUp:f,handleSizeChange:p,onThumbPositionChange:_,onThumbChange:v,onDragScroll:g}),(e,t)=>h.value?(P(),s(f_,C({key:0},e.$attrs,{ref:B(r)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):(P(),s(p_,C({key:1},e.$attrs,{ref:B(r)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),__=p({__name:`ScrollAreaScrollbarAuto`,props:{forceMount:{type:Boolean}},setup(e){let t=$g(),n=b_(),{forwardRef:r}=X(),i=L(!1),a=vo(()=>{if(t.viewport.value){let e=t.viewport.value.offsetWidtha()),Io(t.viewport,a),Io(t.content,a),(e,t)=>(P(),s(B(Js),{present:e.forceMount||i.value},{default:U(()=>[d(g_,C(e.$attrs,{ref:B(r),"data-state":i.value?`visible`:`hidden`}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`])]),_:3},8,[`present`]))}}),v_=p({inheritAttrs:!1,__name:`ScrollAreaScrollbarHover`,props:{forceMount:{type:Boolean}},setup(e){let t=$g(),{forwardRef:n}=X(),r,i=L(!1);function a(){window.clearTimeout(r),i.value=!0}function o(){r=window.setTimeout(()=>{i.value=!1},t.scrollHideDelay.value)}return A(()=>{let e=t.scrollArea.value;e&&(e.addEventListener(`pointerenter`,a),e.addEventListener(`pointerleave`,o))}),M(()=>{let e=t.scrollArea.value;e&&(window.clearTimeout(r),e.removeEventListener(`pointerenter`,a),e.removeEventListener(`pointerleave`,o))}),(e,t)=>(P(),s(B(Js),{present:e.forceMount||i.value},{default:U(()=>[d(__,C(e.$attrs,{ref:B(n),"data-state":i.value?`visible`:`hidden`}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`])]),_:3},8,[`present`]))}}),y_=p({__name:`ScrollAreaScrollbarScroll`,props:{forceMount:{type:Boolean}},setup(e){let t=$g(),n=b_(),{forwardRef:r}=X(),{state:i,dispatch:a}=Ps(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});H(e=>{if(i.value===`idle`){let n=window.setTimeout(()=>a(`HIDE`),t.scrollHideDelay.value);e(()=>{window.clearTimeout(n)})}});let o=vo(()=>a(`SCROLL_END`),100);return H(e=>{let r=t.viewport.value,i=n.isHorizontal.value?`scrollLeft`:`scrollTop`;if(r){let t=r[i],n=()=>{let e=r[i];t!==e&&(a(`SCROLL`),o()),t=e};r.addEventListener(`scroll`,n),e(()=>{r.removeEventListener(`scroll`,n)})}}),(e,t)=>(P(),s(B(Js),{present:e.forceMount||B(i)!==`hidden`},{default:U(()=>[d(g_,C(e.$attrs,{ref:B(r)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`]))}}),[b_,x_]=K(`ScrollAreaScrollbar`),S_=p({inheritAttrs:!1,__name:`ScrollAreaScrollbar`,props:{orientation:{default:`vertical`},forceMount:{type:Boolean},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e,{forwardRef:n}=X(),r=$g(),i=a(()=>t.orientation===`horizontal`);V(i,()=>{i.value?r.onScrollbarXEnabledChange(!0):r.onScrollbarYEnabledChange(!0)},{immediate:!0}),M(()=>{r.onScrollbarXEnabledChange(!1),r.onScrollbarYEnabledChange(!1)});let{orientation:o,forceMount:l,asChild:u,as:d}=z(t);return x_({orientation:o,forceMount:l,isHorizontal:i,as:d,asChild:u}),(e,t)=>B(r).type.value===`hover`?(P(),s(v_,C({key:0},e.$attrs,{ref:B(n),"force-mount":B(l)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`force-mount`])):B(r).type.value===`scroll`?(P(),s(y_,C({key:1},e.$attrs,{ref:B(n),"force-mount":B(l)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`force-mount`])):B(r).type.value===`auto`?(P(),s(__,C({key:2},e.$attrs,{ref:B(n),"force-mount":B(l)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`force-mount`])):B(r).type.value===`always`?(P(),s(g_,C({key:3},e.$attrs,{ref:B(n),"data-state":`visible`}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):c(``,!0)}}),C_=p({__name:`ScrollAreaThumb`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=$g(),r=m_();function i(e){let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,i=e.clientY-t.top;r.handleThumbDown(e,{x:n,y:i})}function o(e){r.handleThumbUp(e)}let{forwardRef:c,currentElement:l}=X(),u=L(),d=a(()=>n.viewport.value);function f(){if(!u.value){let e=o_(d.value,r.onThumbPositionChange);u.value=e,r.onThumbPositionChange()}}let p=a(()=>r.sizes.value);return Co(p,()=>{r.onThumbChange(l.value),d.value&&(r.onThumbPositionChange(),d.value.addEventListener(`scroll`,f))}),M(()=>{var e;d.value.removeEventListener(`scroll`,f),(e=n.viewport.value)==null||e.removeEventListener(`scroll`,f)}),(e,n)=>(P(),s(B(Q),{ref:B(c),"data-state":B(r).hasThumb?`visible`:`hidden`,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`},"as-child":t.asChild,as:e.as,onPointerdown:i,onPointerup:o},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`data-state`,`as-child`,`as`]))}}),w_=p({__name:`ScrollAreaCornerImpl`,setup(e){let t=$g(),n=L(0),r=L(0),i=a(()=>!!n.value&&!!r.value);function o(){var e;let n=(e=t.scrollbarX.value)?.offsetHeight||0;t.onCornerHeightChange(n),r.value=n}function l(){var e;let r=(e=t.scrollbarY.value)?.offsetWidth||0;t.onCornerWidthChange(r),n.value=r}return Io(t.scrollbarX.value,o),Io(t.scrollbarY.value,l),V(()=>t.scrollbarX.value,o),V(()=>t.scrollbarY.value,l),(e,a)=>{var o;return i.value?(P(),s(B(Q),C({key:0,style:{width:`${n.value}px`,height:`${r.value}px`,position:`absolute`,right:B(t).dir.value===`ltr`?0:void 0,left:B(t).dir.value===`rtl`?0:void 0,bottom:0}},(o=e.$parent)?.$props),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`style`])):c(``,!0)}}}),T_=p({__name:`ScrollAreaCorner`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,{forwardRef:n}=X(),r=$g(),i=a(()=>!!r.scrollbarX.value&&!!r.scrollbarY.value),o=a(()=>r.type.value!==`scroll`&&i.value);return(e,r)=>o.value?(P(),s(w_,C({key:0},t,{ref:B(n)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):c(``,!0)}}),E_=[`default-value`],D_=p({__name:`BubbleSelect`,props:{autocomplete:{},autofocus:{type:Boolean},disabled:{type:Boolean},form:{},multiple:{type:Boolean},name:{},required:{type:Boolean},size:{},value:{}},setup(e){let t=e,{value:n}=z(t),r=L();return(e,i)=>(P(),s(B(fu),{"as-child":``},{default:U(()=>[_e(o(`select`,C({ref_key:`selectElement`,ref:r},t,{"onUpdate:modelValue":i[0]||=e=>b(n)?n.value=e:null,"default-value":B(n)}),[R(e.$slots,`default`)],16,E_),[[pe,B(n)]])]),_:3}))}}),O_={key:0,value:``},[k_,A_]=K(`SelectRoot`),[j_,M_]=K(`SelectRoot`),N_=p({__name:`SelectRoot`,props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean},defaultValue:{default:``},modelValue:{default:void 0},dir:{},name:{},autocomplete:{},disabled:{type:Boolean},required:{type:Boolean}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:n}){let r=e,i=n,o=q(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),u=q(r,`open`,i,{defaultValue:r.defaultOpen,passive:r.open===void 0}),d=L(),f=L(),p=L({x:0,y:0}),m=L(!1),{required:h,disabled:g,dir:_}=z(r),v=Y(_);A_({triggerElement:d,onTriggerChange:e=>{d.value=e},valueElement:f,onValueElementChange:e=>{f.value=e},valueElementHasChildren:m,onValueElementHasChildrenChange:e=>{m.value=e},contentId:``,modelValue:o,onValueChange:e=>{o.value=e},open:u,required:h,onOpenChange:e=>{u.value=e},dir:v,triggerPointerDownPosRef:p,disabled:g});let y=ds(d),b=L(new Set),x=a(()=>Array.from(b.value).map(e=>{var t;return(t=e.props)?.value}).join(`;`));return M_({onNativeOptionAdd:e=>{b.value.add(e)},onNativeOptionRemove:e=>{b.value.delete(e)}}),(e,n)=>(P(),s(B($l),null,{default:U(()=>[R(e.$slots,`default`,{modelValue:B(o),open:B(u)}),B(y)?(P(),s(D_,C({key:x.value},e.$attrs,{"aria-hidden":`true`,tabindex:`-1`,required:B(h),name:e.name,autocomplete:e.autocomplete,disabled:B(g),value:B(o),onChange:n[0]||=e=>o.value=e.target.value}),{default:U(()=>[B(o)===void 0?(P(),l(`option`,O_)):c(``,!0),(P(!0),l(t,null,te(Array.from(b.value),e=>(P(),s(ne(e),C({ref_for:!0},e.props,{key:e.key??``}),null,16))),128))]),_:1},16,[`required`,`name`,`autocomplete`,`disabled`,`value`])):c(``,!0)]),_:3}))}}),P_=[` `,`Enter`,`ArrowUp`,`ArrowDown`],F_=[` `,`Enter`],I_=10;function L_(e){return e===``||ja(e)}const R_=p({__name:`SelectTrigger`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=k_(),r=a(()=>{var e;return(e=n.disabled)?.value||t.disabled}),{forwardRef:i,currentElement:o}=X();n.contentId||=Z(void 0,`radix-vue-select-content`),A(()=>{n.triggerElement=o});let{injectCollection:c}=rs(),l=c(),{search:u,handleTypeaheadSearch:f,resetTypeahead:p}=Is(l);function m(){r.value||(n.onOpenChange(!0),p())}function h(e){m(),n.triggerPointerDownPosRef.value={x:Math.round(e.pageX),y:Math.round(e.pageY)}}return(e,t)=>(P(),s(B(eu),{"as-child":``},{default:U(()=>{var a,o,s,c;return[d(B(Q),{ref:B(i),role:`combobox`,type:e.as===`button`?`button`:void 0,"aria-controls":B(n).contentId,"aria-expanded":B(n).open.value||!1,"aria-required":(a=B(n).required)?.value,"aria-autocomplete":`none`,disabled:r.value,dir:(o=B(n))?.dir.value,"data-state":(s=B(n))!=null&&s.open.value?`open`:`closed`,"data-disabled":r.value?``:void 0,"data-placeholder":B(L_)((c=B(n).modelValue)?.value)?``:void 0,"as-child":e.asChild,as:e.as,onClick:t[0]||=e=>{var t;(t=e?.currentTarget)==null||t.focus()},onPointerdown:t[1]||=e=>{if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&(h(e),e.preventDefault())},onPointerup:t[2]||=G(e=>{e.pointerType===`touch`&&h(e)},[`prevent`]),onKeydown:t[3]||=e=>{let t=B(u)!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&t&&e.key===` `||(B(f)(e.key),B(P_).includes(e.key)&&(m(),e.preventDefault()))}},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`type`,`aria-controls`,`aria-expanded`,`aria-required`,`disabled`,`dir`,`data-state`,`data-disabled`,`data-placeholder`,`as-child`,`as`])]}),_:3}))}}),z_=p({__name:`SelectPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(pc),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),[B_,V_]=K(`SelectItemAlignedPosition`),H_=p({inheritAttrs:!1,__name:`SelectItemAlignedPosition`,props:{asChild:{type:Boolean},as:{}},emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,{injectCollection:i}=rs(),a=k_(),o=G_(),s=i(),c=L(!1),u=L(!0),f=L(),{forwardRef:p,currentElement:m}=X(),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o;function y(){if(a.triggerElement.value&&a.valueElement.value&&f.value&&m.value&&h!=null&&h.value&&g!=null&&g.value&&_!=null&&_.value){let e=a.triggerElement.value.getBoundingClientRect(),t=m.value.getBoundingClientRect(),n=a.valueElement.value.getBoundingClientRect(),i=_.value.getBoundingClientRect();if(a.dir.value!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,c=Math.max(s,t.width),l=window.innerWidth-I_,u=Sa(a,I_,Math.max(I_,l-c));f.value.style.minWidth=`${s}px`,f.value.style.left=`${u}px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,c=Math.max(s,t.width),l=window.innerWidth-I_,u=Sa(a,I_,Math.max(I_,l-c));f.value.style.minWidth=`${s}px`,f.value.style.right=`${u}px`}let o=s.value,l=window.innerHeight-I_*2,u=h.value.scrollHeight,d=window.getComputedStyle(m.value),p=Number.parseInt(d.borderTopWidth,10),v=Number.parseInt(d.paddingTop,10),y=Number.parseInt(d.borderBottomWidth,10),b=Number.parseInt(d.paddingBottom,10),x=p+v+u+b+y,S=Math.min(g.value.offsetHeight*5,x),C=window.getComputedStyle(h.value),w=Number.parseInt(C.paddingTop,10),T=Number.parseInt(C.paddingBottom,10),E=e.top+e.height/2-I_,D=l-E,O=g.value.offsetHeight/2,k=g.value.offsetTop+O,A=p+v+k,j=x-A;if(A<=E){let e=g.value===o[o.length-1];f.value.style.bottom=`0px`;let t=m.value.clientHeight-h.value.offsetTop-h.value.offsetHeight,n=Math.max(D,O+(e?T:0)+t+y),r=A+n;f.value.style.height=`${r}px`}else{let e=g.value===o[0];f.value.style.top=`0px`;let t=Math.max(E,p+h.value.offsetTop+(e?w:0)+O)+j;f.value.style.height=`${t}px`,h.value.scrollTop=A-E+h.value.offsetTop}f.value.style.margin=`${I_}px 0`,f.value.style.minHeight=`${S}px`,f.value.style.maxHeight=`${l}px`,r(`placed`),requestAnimationFrame(()=>c.value=!0)}}let b=L(``);A(async()=>{await w(),y(),m.value&&(b.value=window.getComputedStyle(m.value).zIndex)});function x(e){e&&u.value===!0&&(y(),v?.(),u.value=!1)}return V_({contentWrapper:f,shouldExpandOnScrollRef:c,onScrollButtonChange:x}),(e,t)=>(P(),l(`div`,{ref_key:`contentWrapperElement`,ref:f,style:E({display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b.value})},[d(B(Q),C({ref:B(p),style:{boxSizing:`border-box`,maxHeight:`100%`}},{...e.$attrs,...n}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)],4))}}),U_=p({__name:`SelectPopperPosition`,props:{side:{},sideOffset:{},align:{default:`start`},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{default:I_},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=fs(e);return(e,n)=>(P(),s(B(su),C(B(t),{style:{boxSizing:`border-box`,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),W_={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[G_,K_]=K(`SelectContent`),q_=p({__name:`SelectContentImpl`,props:{position:{default:`item-aligned`},bodyLock:{type:Boolean,default:!0},side:{},sideOffset:{},align:{default:`start`},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=k_();ls(),$o(n.bodyLock);let{createCollection:o}=rs(),c=L();As(c);let l=o(c),{search:u,handleTypeaheadSearch:f}=Is(l),p=L(),m=L(),h=L(),g=L(!1),_=L(!1);function v(){m.value&&c.value&&Jc([m.value,c.value])}V(g,()=>{v()});let{onOpenChange:y,triggerPointerDownPosRef:b}=i;H(e=>{if(!c.value)return;let t={x:0,y:0},n=e=>{var n,r;t={x:Math.abs(Math.round(e.pageX)-((n=b.value)?.x??0)),y:Math.abs(Math.round(e.pageY)-((r=b.value)?.y??0))}},r=e=>{var r;e.pointerType!==`touch`&&(t.x<=10&&t.y<=10?e.preventDefault():(r=c.value)!=null&&r.contains(e.target)||y(!1),document.removeEventListener(`pointermove`,n),b.value=null)};b.value!==null&&(document.addEventListener(`pointermove`,n),document.addEventListener(`pointerup`,r,{capture:!0,once:!0})),e(()=>{document.removeEventListener(`pointermove`,n),document.removeEventListener(`pointerup`,r,{capture:!0})})});function x(e){let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&f(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=l.value;if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>Jc(t)),e.preventDefault()}}let S=a(()=>n.position===`popper`?n:{}),w=fs(S.value);return K_({content:c,viewport:p,onViewportChange:e=>{p.value=e},itemRefCallback:(e,t,n)=>{var r,a;let o=!_.value&&!n;((r=i.modelValue)?.value!==void 0&&(a=i.modelValue)?.value===t||o)&&(m.value=e,o&&(_.value=!0))},selectedItem:m,selectedItemText:h,onItemLeave:()=>{var e;(e=c.value)==null||e.focus()},itemTextRefCallback:(e,t,n)=>{var r,a;let o=!_.value&&!n;((r=i.modelValue)?.value!==void 0&&(a=i.modelValue)?.value===t||o)&&(h.value=e)},focusSelectedItem:v,position:n.position,isPositioned:g,searchRef:u}),(e,t)=>(P(),s(B(Lc),{"as-child":``,onMountAutoFocus:t[6]||=G(()=>{},[`prevent`]),onUnmountAutoFocus:t[7]||=e=>{var t;r(`closeAutoFocus`,e),!e.defaultPrevented&&((t=B(i).triggerElement.value)==null||t.focus({preventScroll:!0}),e.preventDefault())}},{default:U(()=>[d(B(xc),{"as-child":``,"disable-outside-pointer-events":``,onFocusOutside:t[2]||=G(()=>{},[`prevent`]),onDismiss:t[3]||=e=>B(i).onOpenChange(!1),onEscapeKeyDown:t[4]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[5]||=e=>r(`pointerDownOutside`,e)},{default:U(()=>[(P(),s(ne(e.position===`popper`?U_:H_),C({...e.$attrs,...B(w)},{id:B(i).contentId,ref:e=>{c.value=B(wo)(e)},role:`listbox`,"data-state":B(i).open.value?`open`:`closed`,dir:B(i).dir.value,style:{display:`flex`,flexDirection:`column`,outline:`none`},onContextmenu:t[0]||=G(()=>{},[`prevent`]),onPlaced:t[1]||=e=>g.value=!0,onKeydown:x}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`onKeydown`]))]),_:3})]),_:3}))}}),J_=p({inheritAttrs:!1,__name:`SelectProvider`,props:{context:{}},setup(e){return A_(e.context),(e,t)=>R(e.$slots,`default`)}}),Y_={key:1},X_=p({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean},position:{},bodyLock:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let r=e,i=ps(r,t),o=k_(),u=L();A(()=>{u.value=new DocumentFragment});let f=L(),p=a(()=>r.forceMount||o.open.value);return(e,t)=>{var r;return p.value?(P(),s(B(Js),{key:0,ref_key:`presenceRef`,ref:f,present:!0},{default:U(()=>[d(q_,T(_({...B(i),...e.$attrs})),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)]),_:3},512)):!((r=f.value)!=null&&r.present)&&u.value?(P(),l(`div`,Y_,[(P(),s(n,{to:u.value},[d(J_,{context:B(o)},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`context`])],8,[`to`]))])):c(``,!0)}}}),Z_=p({__name:`SelectArrow`,props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:`svg`}},setup(e){let t=e,n=k_(),r=G_(W_);return(e,i)=>B(n).open.value&&B(r).position===`popper`?(P(),s(B(du),T(C({key:0},t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):c(``,!0)}}),Q_=p({__name:`SelectSeparator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(B(Q),C({"aria-hidden":`true`},t),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),[$_,ev]=K(`SelectItem`),tv=p({__name:`SelectItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},setup(e){let t=e,{disabled:n}=z(t),r=k_(),i=G_(W_),{forwardRef:o,currentElement:c}=X(),l=a(()=>{var e;return(e=r.modelValue)?.value===t.value}),u=L(!1),d=L(t.textValue??``),f=Z(void 0,`radix-vue-select-item-text`);async function p(e){await w(),!(e!=null&&e.defaultPrevented)&&(n.value||(r.onValueChange(t.value),r.onOpenChange(!1)))}async function m(e){var t;await w(),!e.defaultPrevented&&(n.value?(t=i.onItemLeave)==null||t.call(i):e.currentTarget.focus({preventScroll:!0}))}async function h(e){var t;await w(),!e.defaultPrevented&&e.currentTarget===J()&&((t=i.onItemLeave)==null||t.call(i))}async function g(e){var t;await w(),!(e.defaultPrevented||(t=i.searchRef)?.value!==``&&e.key===` `)&&(F_.includes(e.key)&&p(),e.key===` `&&e.preventDefault())}if(t.value===``)throw Error(`A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return A(()=>{c.value&&i.itemRefCallback(c.value,t.value,t.disabled)}),ev({value:t.value,disabled:n,textId:f,isSelected:l,onItemTextChange:e=>{d.value=((d.value||e?.textContent)??``).trim()}}),(e,t)=>(P(),s(B(Q),{ref:B(o),role:`option`,"data-radix-vue-collection-item":``,"aria-labelledby":B(f),"data-highlighted":u.value?``:void 0,"aria-selected":l.value,"data-state":l.value?`checked`:`unchecked`,"aria-disabled":B(n)||void 0,"data-disabled":B(n)?``:void 0,tabindex:B(n)?void 0:-1,as:e.as,"as-child":e.asChild,onFocus:t[0]||=e=>u.value=!0,onBlur:t[1]||=e=>u.value=!1,onPointerup:p,onPointerdown:t[2]||=e=>{e.currentTarget.focus({preventScroll:!0})},onTouchend:t[3]||=G(()=>{},[`prevent`,`stop`]),onPointermove:m,onPointerleave:h,onKeydown:g},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`aria-labelledby`,`data-highlighted`,`aria-selected`,`data-state`,`aria-disabled`,`data-disabled`,`tabindex`,`as`,`as-child`]))}}),nv=p({__name:`SelectItemIndicator`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=e,n=$_();return(e,r)=>B(n).isSelected.value?(P(),s(B(Q),C({key:0,"aria-hidden":`true`},t),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)):c(``,!0)}}),[rv,iv]=K(`SelectGroup`),av=p({__name:`SelectGroup`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=Z(void 0,`radix-vue-select-group`);return iv({id:n}),(e,r)=>(P(),s(B(Q),C({role:`group`},t,{"aria-labelledby":B(n)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-labelledby`]))}}),ov=p({__name:`SelectLabel`,props:{for:{},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e,n=rv({id:``});return(e,r)=>(P(),s(B(Q),C(t,{id:B(n).id}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),sv=p({inheritAttrs:!1,__name:`SelectItemText`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let r=e,i=k_(),o=G_(W_),u=j_(),f=$_(),{forwardRef:p,currentElement:m}=X(),h=a(()=>{var e;return v(`option`,{key:f.value,value:f.value,disabled:f.disabled.value,textContent:(e=m.value)?.textContent})});return A(()=>{m.value&&(f.onItemTextChange(m.value),o.itemTextRefCallback(m.value,f.value,f.disabled.value),u.onNativeOptionAdd(h.value))}),O(()=>{u.onNativeOptionRemove(h.value)}),(e,a)=>(P(),l(t,null,[d(B(Q),C({id:B(f).textId,ref:B(p)},{...r,...e.$attrs},{"data-item-text":``}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]),B(f).isSelected.value&&B(i).valueElement.value&&!B(i).valueElementHasChildren.value?(P(),s(n,{key:0,to:B(i).valueElement.value},[R(e.$slots,`default`)],8,[`to`])):c(``,!0)],64))}}),cv=p({__name:`SelectViewport`,props:{nonce:{},asChild:{type:Boolean},as:{}},setup(e){let n=e,{nonce:r}=z(n),i=Lu(r),a=G_(W_),o=a.position===`item-aligned`?B_():void 0,{forwardRef:s,currentElement:c}=X();A(()=>{a?.onViewportChange(c.value)});let f=L(0);function p(e){let t=e.currentTarget,{shouldExpandOnScrollRef:n,contentWrapper:r}=o??{};if(n!=null&&n.value&&r!=null&&r.value){let e=Math.abs(f.value-t.scrollTop);if(e>0){let n=window.innerHeight-I_*2,i=Number.parseFloat(r.value.style.minHeight),a=Number.parseFloat(r.value.style.height),o=Math.max(i,a);if(o0?s:0,r.value.style.justifyContent=`flex-end`)}}}f.value=t.scrollTop}return(e,r)=>(P(),l(t,null,[d(B(Q),C({ref:B(s),"data-radix-select-viewport":``,role:`presentation`},{...e.$attrs,...n},{style:{position:`relative`,flex:1,overflow:`hidden auto`},onScroll:p}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16),d(B(Q),{as:`style`,nonce:B(i)},{default:U(()=>[u(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-radix-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-radix-select-viewport]::-webkit-scrollbar { display: none; } `)]),_:1},8,[`nonce`])],64))}}),lv=p({__name:`SelectScrollButtonImpl`,emits:[`autoScroll`],setup(e,{emit:t}){let n=t,{injectCollection:r}=rs(),i=r(),a=G_(W_),o=L(null);function c(){o.value!==null&&(window.clearInterval(o.value),o.value=null)}H(()=>{let e=i.value.find(e=>e===J());e?.scrollIntoView({block:`nearest`})});function l(){o.value===null&&(o.value=window.setInterval(()=>{n(`autoScroll`)},50))}function u(){var e;(e=a.onItemLeave)==null||e.call(a),o.value===null&&(o.value=window.setInterval(()=>{n(`autoScroll`)},50))}return O(()=>c()),(e,t)=>{var n;return P(),s(B(Q),C({"aria-hidden":`true`,style:{flexShrink:0}},(n=e.$parent)?.$props,{onPointerdown:l,onPointermove:u,onPointerleave:t[0]||=()=>{c()}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)}}}),uv=p({__name:`SelectScrollUpButton`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=G_(W_),n=t.position===`item-aligned`?B_():void 0,{forwardRef:r,currentElement:i}=X(),a=L(!1);return H(e=>{var n,r;if((n=t.viewport)!=null&&n.value&&(r=t.isPositioned)!=null&&r.value){let n=function(){a.value=r.scrollTop>0},r=t.viewport.value;n(),r.addEventListener(`scroll`,n),e(()=>r.removeEventListener(`scroll`,n))}}),V(i,()=>{i.value&&n?.onScrollButtonChange(i.value)}),(e,n)=>a.value?(P(),s(lv,{key:0,ref:B(r),onAutoScroll:n[0]||=()=>{let{viewport:e,selectedItem:n}=B(t);e!=null&&e.value&&n!=null&&n.value&&(e.value.scrollTop=e.value.scrollTop-n.value.offsetHeight)}},{default:U(()=>[R(e.$slots,`default`)]),_:3},512)):c(``,!0)}}),dv=p({__name:`SelectScrollDownButton`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=G_(W_),n=t.position===`item-aligned`?B_():void 0,{forwardRef:r,currentElement:i}=X(),a=L(!1);return H(e=>{var n,r;if((n=t.viewport)!=null&&n.value&&(r=t.isPositioned)!=null&&r.value){let n=function(){let e=r.scrollHeight-r.clientHeight;a.value=Math.ceil(r.scrollTop)r.removeEventListener(`scroll`,n))}}),V(i,()=>{i.value&&n?.onScrollButtonChange(i.value)}),(e,n)=>a.value?(P(),s(lv,{key:0,ref:B(r),onAutoScroll:n[0]||=()=>{let{viewport:e,selectedItem:n}=B(t);e!=null&&e.value&&n!=null&&n.value&&(e.value.scrollTop=e.value.scrollTop+n.value.offsetHeight)}},{default:U(()=>[R(e.$slots,`default`)]),_:3},512)):c(``,!0)}}),fv=p({__name:`SelectValue`,props:{placeholder:{default:``},asChild:{type:Boolean},as:{default:`span`}},setup(e){let{forwardRef:n,currentElement:r}=X(),i=k_(),a=fe();return D(()=>{var e;let t=!!zo((e=a?.default)?.call(a)).length;i.onValueElementHasChildrenChange(t)}),A(()=>{i.valueElement=r}),(e,r)=>(P(),s(B(Q),{ref:B(n),as:e.as,"as-child":e.asChild,style:{pointerEvents:`none`}},{default:U(()=>{var n;return[B(L_)((n=B(i).modelValue)?.value)?(P(),l(t,{key:0},[u(ae(e.placeholder),1)],64)):R(e.$slots,`default`,{key:1})]}),_:3},8,[`as`,`as-child`]))}}),pv=p({__name:`SelectIcon`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){return(e,t)=>(P(),s(B(Q),{"aria-hidden":`true`,as:e.as,"as-child":e.asChild},{default:U(()=>[R(e.$slots,`default`,{},()=>[u(`▼`)])]),_:3},8,[`as`,`as-child`]))}}),mv=p({__name:`BaseSeparator`,props:{orientation:{default:`horizontal`},decorative:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=[`horizontal`,`vertical`];function r(e){return n.includes(e)}let i=a(()=>r(t.orientation)?t.orientation:`horizontal`),o=a(()=>i.value===`vertical`?t.orientation:void 0),c=a(()=>t.decorative?{role:`none`}:{"aria-orientation":o.value,role:`separator`});return(e,t)=>(P(),s(B(Q),C({as:e.as,"as-child":e.asChild,"data-orientation":i.value},c.value),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-orientation`]))}}),hv=p({__name:`Separator`,props:{orientation:{default:`horizontal`},decorative:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(P(),s(mv,T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}});function gv(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function _v(e,t,n){let r=100/(n-t)*(e-t);return Sa(r,0,100)}function vv(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?[`Minimum`,`Maximum`][e]:void 0}function yv(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function bv(e,t,n){let r=e/2,i=Cv([0,50],[0,r]);return(r-i(t)*n)*n}function xv(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Sv(e,t){if(t>0){let n=xv(e);return Math.min(...n)>=t}return!0}function Cv(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function wv(e){return(String(e).split(`.`)[1]||``).length}function Tv(e,t){let n=10**t;return Math.round(e*n)/n}const Ev=[`PageUp`,`PageDown`],Dv=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Ov={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},[kv,Av]=K([`SliderVertical`,`SliderHorizontal`]),jv=p({__name:`SliderImpl`,props:{asChild:{type:Boolean},as:{default:`span`}},emits:[`slideStart`,`slideMove`,`slideEnd`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,i=Fv();return(e,t)=>(P(),s(B(Q),C({"data-slider-impl":``},n,{onKeydown:t[0]||=e=>{e.key===`Home`?(r(`homeKeyDown`,e),e.preventDefault()):e.key===`End`?(r(`endKeyDown`,e),e.preventDefault()):B(Ev).concat(B(Dv)).includes(e.key)&&(r(`stepKeyDown`,e),e.preventDefault())},onPointerdown:t[1]||=e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),B(i).thumbElements.value.includes(t)?t.focus():r(`slideStart`,e)},onPointermove:t[2]||=e=>{e.target.hasPointerCapture(e.pointerId)&&r(`slideMove`,e)},onPointerup:t[3]||=e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),r(`slideEnd`,e))}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Mv=p({__name:`SliderHorizontal`,props:{dir:{},min:{},max:{},inverted:{type:Boolean}},emits:[`slideEnd`,`slideStart`,`slideMove`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,{max:i,min:o,dir:c,inverted:l}=z(n),{forwardRef:u,currentElement:d}=X(),f=L(),p=a(()=>c?.value===`ltr`&&!l.value||c?.value!==`ltr`&&l.value);function m(e){let t=f.value||d.value.getBoundingClientRect(),n=[0,t.width],r=p.value?[o.value,i.value]:[i.value,o.value],a=Cv(n,r);return f.value=t,a(e-t.left)}return Av({startEdge:p.value?`left`:`right`,endEdge:p.value?`right`:`left`,direction:p.value?1:-1,size:`width`}),(e,t)=>(P(),s(jv,{ref:B(u),dir:B(c),"data-orientation":`horizontal`,style:{"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:t[0]||=e=>{let t=m(e.clientX);r(`slideStart`,t)},onSlideMove:t[1]||=e=>{let t=m(e.clientX);r(`slideMove`,t)},onSlideEnd:t[2]||=()=>{f.value=void 0,r(`slideEnd`)},onStepKeyDown:t[3]||=e=>{let t=p.value?`from-left`:`from-right`,n=B(Ov)[t].includes(e.key);r(`stepKeyDown`,e,n?-1:1)},onEndKeyDown:t[4]||=e=>r(`endKeyDown`,e),onHomeKeyDown:t[5]||=e=>r(`homeKeyDown`,e)},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`dir`]))}}),Nv=p({__name:`SliderVertical`,props:{min:{},max:{},inverted:{type:Boolean}},emits:[`slideEnd`,`slideStart`,`slideMove`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,{max:i,min:o,inverted:c}=z(n),{forwardRef:l,currentElement:u}=X(),d=L(),f=a(()=>!c.value);function p(e){let t=d.value||u.value.getBoundingClientRect(),n=[0,t.height],r=f.value?[i.value,o.value]:[o.value,i.value],a=Cv(n,r);return d.value=t,a(e-t.top)}return Av({startEdge:f.value?`bottom`:`top`,endEdge:f.value?`top`:`bottom`,size:`height`,direction:f.value?1:-1}),(e,t)=>(P(),s(jv,{ref:B(l),"data-orientation":`vertical`,style:{"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:t[0]||=e=>{let t=p(e.clientY);r(`slideStart`,t)},onSlideMove:t[1]||=e=>{let t=p(e.clientY);r(`slideMove`,t)},onSlideEnd:t[2]||=()=>{d.value=void 0,r(`slideEnd`)},onStepKeyDown:t[3]||=e=>{let t=f.value?`from-bottom`:`from-top`,n=B(Ov)[t].includes(e.key);r(`stepKeyDown`,e,n?-1:1)},onEndKeyDown:t[4]||=e=>r(`endKeyDown`,e),onHomeKeyDown:t[5]||=e=>r(`homeKeyDown`,e)},{default:U(()=>[R(e.$slots,`default`)]),_:3},512))}}),Pv=[`value`,`name`,`disabled`,`step`],[Fv,Iv]=K(`SliderRoot`),Lv=p({inheritAttrs:!1,__name:`SliderRoot`,props:{name:{},defaultValue:{default:()=>[0]},modelValue:{},disabled:{type:Boolean,default:!1},orientation:{default:`horizontal`},dir:{},inverted:{type:Boolean,default:!1},min:{default:0},max:{default:100},step:{default:1},minStepsBetweenThumbs:{default:0},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`,`valueCommit`],setup(e,{emit:n}){let r=e,i=n,{min:a,max:o,step:u,minStepsBetweenThumbs:f,orientation:p,disabled:m,dir:h}=z(r),g=Y(h),{forwardRef:_,currentElement:v}=X(),y=ds(v);_u();let b=q(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),x=L(0),S=L(b.value);function w(e){let t=yv(b.value,e);D(e,t)}function T(e){D(e,x.value)}function E(){let e=S.value[x.value];b.value[x.value]!==e&&i(`valueCommit`,ce(b.value))}function D(e,t,{commit:n}={commit:!1}){var r;let s=wv(u.value),c=Tv(Math.round((e-a.value)/u.value)*u.value+a.value,s),l=Sa(c,a.value,o.value),d=gv(b.value,l,t);if(Sv(d,f.value*u.value)){x.value=d.indexOf(l);let e=String(d)!==String(b.value);e&&n&&i(`valueCommit`,d),e&&((r=O.value[x.value])==null||r.focus(),b.value=d)}}let O=L([]);return Iv({modelValue:b,valueIndexToChangeRef:x,thumbElements:O,orientation:p,min:a,max:o,disabled:m}),(e,n)=>(P(),l(t,null,[d(B(vu),null,{default:U(()=>[(P(),s(ne(B(p)===`horizontal`?Mv:Nv),C(e.$attrs,{ref:B(_),"as-child":e.asChild,as:e.as,min:B(a),max:B(o),dir:B(g),inverted:e.inverted,"aria-disabled":B(m),"data-disabled":B(m)?``:void 0,onPointerdown:n[0]||=()=>{B(m)||(S.value=B(b))},onSlideStart:n[1]||=e=>!B(m)&&w(e),onSlideMove:n[2]||=e=>!B(m)&&T(e),onSlideEnd:n[3]||=e=>!B(m)&&E(),onHomeKeyDown:n[4]||=e=>!B(m)&&D(B(a),0,{commit:!0}),onEndKeyDown:n[5]||=e=>!B(m)&&D(B(o),B(b).length-1,{commit:!0}),onStepKeyDown:n[6]||=(e,t)=>{if(!B(m)){let n=B(Ev).includes(e.key)||e.shiftKey&&B(Dv).includes(e.key)?10:1,r=x.value,i=B(b)[r],a=B(u)*n*t;D(i+a,r,{commit:!0})}}}),{default:U(()=>[R(e.$slots,`default`,{modelValue:B(b)})]),_:3},16,[`as-child`,`as`,`min`,`max`,`dir`,`inverted`,`aria-disabled`,`data-disabled`]))]),_:3}),B(y)?(P(!0),l(t,{key:0},te(B(b),(t,n)=>(P(),l(`input`,{key:n,value:t,type:`number`,style:{display:`none`},name:e.name?e.name+(B(b).length>1?`[]`:``):void 0,disabled:B(m),step:B(u)},null,8,Pv))),128)):c(``,!0)],64))}}),Rv=p({inheritAttrs:!1,__name:`SliderThumbImpl`,props:{index:{},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=Fv(),r=kv(),{forwardRef:i,currentElement:o}=X(),c=a(()=>{var e,r;return(r=(e=n.modelValue)?.value)?.[t.index]}),l=a(()=>c.value===void 0?0:_v(c.value,n.min.value??0,n.max.value??100)),u=a(()=>{var e,r;return vv(t.index,(r=(e=n.modelValue)?.value)?.length??0)}),f=Ns(o),p=a(()=>f[r.size].value),m=a(()=>p.value?bv(p.value,l.value,r.direction):0),h=ko();return A(()=>{n.thumbElements.value.push(o.value)}),M(()=>{let e=n.thumbElements.value.findIndex(e=>e===o.value)??-1;n.thumbElements.value.splice(e,1)}),(e,t)=>(P(),s(B(yu),null,{default:U(()=>[d(B(Q),C(e.$attrs,{ref:B(i),role:`slider`,"data-radix-vue-collection-item":``,tabindex:B(n).disabled.value?void 0:0,"aria-label":e.$attrs[`aria-label`]||u.value,"data-disabled":B(n).disabled.value?``:void 0,"data-orientation":B(n).orientation.value,"aria-valuenow":c.value,"aria-valuemin":B(n).min.value,"aria-valuemax":B(n).max.value,"aria-orientation":B(n).orientation.value,"as-child":e.asChild,as:e.as,style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[B(r).startEdge]:`calc(${l.value}% + ${m.value}px)`,display:!B(h)&&c.value===void 0?`none`:void 0},onFocus:t[0]||=()=>{B(n).valueIndexToChangeRef.value=e.index}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`tabindex`,`aria-label`,`data-disabled`,`data-orientation`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`aria-orientation`,`as-child`,`as`,`style`])]),_:3}))}}),zv=p({__name:`SliderThumb`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,{getItems:n}=bu(),{forwardRef:r,currentElement:i}=X(),o=a(()=>i.value?n().findIndex(e=>e.ref===i.value):-1);return(e,n)=>(P(),s(Rv,C({ref:B(r)},t,{index:o.value}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`index`]))}}),Bv=p({__name:`SliderTrack`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=Fv();return X(),(e,n)=>(P(),s(B(Q),{"as-child":e.asChild,as:e.as,"data-disabled":B(t).disabled.value?``:void 0,"data-orientation":B(t).orientation.value},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`data-disabled`,`data-orientation`]))}}),Vv=p({__name:`SliderRange`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=Fv(),n=kv();X();let r=a(()=>{var e,n;return(n=(e=t.modelValue)?.value)?.map(e=>_v(e,t.min.value,t.max.value))}),i=a(()=>t.modelValue.value.length>1?Math.min(...r.value):0),o=a(()=>100-Math.max(...r.value));return(e,r)=>(P(),s(B(Q),{"data-disabled":B(t).disabled.value?``:void 0,"data-orientation":B(t).orientation.value,"as-child":e.asChild,as:e.as,style:E({[B(n).startEdge]:`${i.value}%`,[B(n).endEdge]:`${o.value}%`})},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`data-disabled`,`data-orientation`,`as-child`,`as`,`style`]))}});let Hv=null,Uv=null;function Wv(e,t){if(t){let e=(t&cy)!==0,n=(t&ly)!==0,r=(t&uy)!==0,i=(t&dy)!==0;if(e)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}switch(e){case`horizontal`:return`ew-resize`;case`intersection`:return`move`;case`vertical`:return`ns-resize`}}function Gv(){Uv!==null&&(document.head.removeChild(Uv),Hv=null,Uv=null)}function Kv(e,t){let n=Wv(e,t);Hv!==n&&(Hv=n,Uv===null&&(Uv=document.createElement(`style`),document.head.appendChild(Uv)),Uv.innerHTML=`*{cursor: ${n}!important;}`)}function qv({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e===void 0?`1`:e.toPrecision(a):r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function Jv(e){return e.type===`keydown`}function Yv(e){return e.type.startsWith(`mouse`)}function Xv(e){return e.type.startsWith(`touch`)}function Zv(e){if(Yv(e))return{x:e.clientX,y:e.clientY};if(Xv(e)){let t=e.touches[0];if(t&&t.clientX&&t.clientY)return{x:t.clientX,y:t.clientY}}return{x:1/0,y:1/0}}function Qv(e,t){let n=e===`horizontal`,{x:r,y:i}=Zv(t);return n?r:i}function $v(e,t,n){return e.xt.x&&e.yt.y}function $(e,t=`Assertion failed!`){if(!e)throw console.error(t),Error(t)}function ey(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:oy(e),b:oy(t)},r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;$(r);let i={a:ay(iy(n.a)),b:ay(iy(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}const ty=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function ny(e){let t=getComputedStyle(sy(e)).display;return t===`flex`||t===`inline-flex`}function ry(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||ny(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||ty.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function iy(e){let t=e.length;for(;t--;){let n=e[t];if($(n),ry(n))return n}return null}function ay(e){return e&&Number(getComputedStyle(e).zIndex)||0}function oy(e){let t=[];for(;e;)t.push(e),e=sy(e);return t}function sy(e){var t;return e.parentNode instanceof DocumentFragment&&(t=e.parentNode)?.host||e.parentNode}const cy=1,ly=2,uy=4,dy=8;function fy(){if(typeof matchMedia==`function`)return matchMedia(`(pointer:coarse)`).matches?`coarse`:`fine`}const py=fy()===`coarse`,my=[];let hy=!1;const gy=new Map,_y=new Map,vy=new Set;function yy(e,t,n,r,i){let{ownerDocument:a}=t,o={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},s=gy.get(a)??0;return gy.set(a,s+1),vy.add(o),Ey(),function(){_y.delete(e),vy.delete(o);let t=gy.get(a)??1;gy.set(a,t-1),Ey(),Gv(),t===1&&gy.delete(a)}}function by(e){let{target:t}=e,{x:n,y:r}=Zv(e);hy=!0,Cy({target:t,x:n,y:r}),Ey(),my.length>0&&(Dy(`down`,e),e.preventDefault())}function xy(e){let{x:t,y:n}=Zv(e);if(!hy){let{target:r}=e;Cy({target:r,x:t,y:n})}Dy(`move`,e),Ty(),my.length>0&&e.preventDefault()}function Sy(e){let{target:t}=e,{x:n,y:r}=Zv(e);_y.clear(),hy=!1,my.length>0&&e.preventDefault(),Dy(`up`,e),Cy({target:t,x:n,y:r}),Ty(),Ey()}function Cy({target:e,x:t,y:n}){my.splice(0);let r=null;e instanceof HTMLElement&&(r=e),vy.forEach(e=>{let{element:i,hitAreaMargins:a}=e,o=i.getBoundingClientRect(),{bottom:s,left:c,right:l,top:u}=o,d=py?a.coarse:a.fine;if(t>=c-d&&t<=l+d&&n>=u-d&&n<=s+d){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&ey(r,i)>0){let e=r,t=!1;for(;e&&!e.contains(i);){if($v(e.getBoundingClientRect(),o)){t=!0;break}e=e.parentElement}if(t)return}my.push(e)}})}function wy(e,t){_y.set(e,t)}function Ty(){let e=!1,t=!1;my.forEach(n=>{let{direction:r}=n;r.value===`horizontal`?e=!0:t=!0});let n=0;_y.forEach(e=>{n|=e}),e&&t?Kv(`intersection`,n):e?Kv(`horizontal`,n):t?Kv(`vertical`,n):Gv()}function Ey(){gy.forEach((e,t)=>{let{body:n}=t;n.removeEventListener(`contextmenu`,Sy),n.removeEventListener(`mousedown`,by),n.removeEventListener(`mouseleave`,xy),n.removeEventListener(`mousemove`,xy),n.removeEventListener(`touchmove`,xy),n.removeEventListener(`touchstart`,by)}),window.removeEventListener(`mouseup`,Sy),window.removeEventListener(`touchcancel`,Sy),window.removeEventListener(`touchend`,Sy),vy.size>0&&(hy?(my.length>0&&gy.forEach((e,t)=>{let{body:n}=t;e>0&&(n.addEventListener(`contextmenu`,Sy),n.addEventListener(`mouseleave`,xy),n.addEventListener(`mousemove`,xy),n.addEventListener(`touchmove`,xy,{passive:!1}))}),window.addEventListener(`mouseup`,Sy),window.addEventListener(`touchcancel`,Sy),window.addEventListener(`touchend`,Sy)):gy.forEach((e,t)=>{let{body:n}=t;e>0&&(n.addEventListener(`mousedown`,by),n.addEventListener(`mousemove`,xy),n.addEventListener(`touchmove`,xy,{passive:!1}),n.addEventListener(`touchstart`,by))}))}function Dy(e,t){vy.forEach(n=>{let{setResizeHandlerState:r}=n,i=my.includes(n);r(e,i,t)})}const Oy=10;function ky(e,t,n=Oy){e=Number.parseFloat(e.toFixed(n)),t=Number.parseFloat(t.toFixed(n));let r=e-t;return r===0?0:r>0?1:-1}function Ay(e,t,n){return ky(e,t,n)===0}function jy({panelConstraints:e,panelIndex:t,size:n}){let r=e[t];$(r!=null);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r;if(ky(n,s)<0)if(a){let e=(i+s)/2;n=ky(n,e)<0?i:s}else n=s;return n=Math.min(o,n),n=Number.parseFloat(n.toFixed(Oy)),n}function My(e,t){if(e.length!==t.length)return!1;for(let n=0;n0&&(e=e<0?0-t:t)}}}{let r=e<0?o:s,i=n[r];$(i);let{collapsible:a}=i;if(a){let i=t[r];$(i!=null);let a=n[r];$(a);let{collapsedSize:o=0,minSize:s=0}=a;if(Ay(i,s)){let t=i-o;ky(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?s:o,a=0;for(;;){let e=t[i];$(e!=null);let o=jy({panelConstraints:n,panelIndex:i,size:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let c=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-c:c}{let r=e<0?o:s;for(;r>=0&&r=0))break;e<0?r--:r++}}if(Ay(c,0))return t;{let r=e<0?s:o,i=t[r];$(i!=null);let l=i+c,u=jy({panelConstraints:n,panelIndex:r,size:l});if(a[r]=u,!Ay(u,l)){let t=l-u,r=e<0?s:o;for(;r>=0&&r0?r--:r++}}}let l=a.reduce((e,t)=>t+e,0);return Ay(l,100)?a:t}function Py(e,t=document){var n;if(!Aa)return null;if(t instanceof HTMLElement&&(n=t?.dataset)?.panelGroupId===e)return t;let r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Fy(e,t=document){if(!Aa)return null;let n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function Iy(e,t,n=document){return Aa?Ly(e,n).findIndex(e=>e.getAttribute(`data-panel-resize-handle-id`)===t)??null:null}function Ly(e,t=document){return Aa?Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`)):[]}function Ry(e,t,n,r=document){var i,a;let o=Fy(t,r),s=Ly(e,r),c=o?s.indexOf(o):-1,l=(i=n[c])?.id??null,u=(a=n[c+1])?.id??null;return[l,u]}function zy(e,t,n,r,i){let a=n===`horizontal`,o=Fy(t,i);$(o);let s=o.getAttribute(`data-panel-group-id`);$(s);let{initialCursorPosition:c}=r,l=Qv(n,e),u=Py(s,i);$(u);let d=u.getBoundingClientRect(),f=a?d.width:d.height;return(l-c)/f*100}function By(e,t,n,r,i,a){if(Jv(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100;break}return a}else return r==null?0:zy(e,t,n,r,a)}function Vy({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];$(s!=null),t.forEach((e,t)=>{let{constraints:n}=e,{maxSize:c=100,minSize:l=0}=n;t===s?(r=l,i=c):(a+=l,o+=c)});let c=Math.min(i,100-a),l=Math.max(r,100-o),u=e[s];return{valueMax:c,valueMin:l,valueNow:u}}function Hy({panelDataArray:e}){let t=Array(e.length),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a{let i=e[r];$(i);let{callbacks:a,constraints:o,id:s}=i,{collapsedSize:c=0,collapsible:l}=o,u=n[s];if(u==null||t!==u){n[s]=t;let{onCollapse:e,onExpand:r,onResize:i}=a;i&&i(t,u),l&&(e||r)&&(r&&(u==null||u===c)&&t!==c&&r(),e&&(u==null||u!==c)&&t===c&&e())}})}function Wy(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function Gy(e,t,n){let r=Iy(e,t,n);return r==null?[-1,-1]:[r,r+1]}function Ky({layout:e,panelConstraints:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!Ay(r,100)){console.warn(`WARNING: Invalid layout total size: ${n.map(e=>`${e}%`).join(`, `)}. Layout normalization will be applied.`);for(let e=0;elocalStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw TypeError(`localStorage not supported in this environment`)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function Jy(e){return`radix-vue:${e}`}function Yy(e){return e.map(e=>{let{constraints:t,id:n,idIsFromProps:r,order:i}=e;return r?n:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(`,`)}function Xy(e,t){try{let n=Jy(e),r=t.getItem(n);if(r){let e=JSON.parse(r);if(typeof e==`object`&&e)return e}}catch{}return null}function Zy(e,t,n){let r=Xy(e,n)??{},i=Yy(t);return r[i]??null}function Qy(e,t,n,r,i){let a=Jy(e),o=Yy(t),s=Xy(e,i)??{};s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}function $y({eagerValuesRef:e,groupId:t,layout:n,panelDataArray:r,panelGroupElement:i,setLayout:a}){H(e=>{let a=i.value;if(!a)return;let o=Ly(t,a);for(let e=0;e{o.forEach(e=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)})})}),H(r=>{let o=i.value;if(!o)return;let s=e.value;$(s);let{panelDataArray:c}=s,l=Py(t,o);$(l!=null,`No group found for id "${t}"`);let u=Ly(t,o);$(u);let d=u.map(e=>{let r=e.getAttribute(`data-panel-resize-handle-id`);$(r);let[i,s]=Ry(t,r,c,o);if(i==null||s==null)return()=>{};let l=e=>{if(!e.defaultPrevented)switch(e.key){case`Enter`:{e.preventDefault();let s=c.findIndex(e=>e.id===i);if(s>=0){let e=c[s];$(e);let i=n.value[s],{collapsedSize:l=0,collapsible:u,minSize:d=0}=e.constraints;if(i!=null&&u){let e=Ny({delta:Ay(i,l)?d-l:l-i,layout:n.value,panelConstraints:c.map(e=>e.constraints),pivotIndices:Gy(t,r,o),trigger:`keyboard`});n.value!==e&&a(e)}}break}}};return e.addEventListener(`keydown`,l),()=>{e.removeEventListener(`keydown`,l)}});r(()=>{d.forEach(e=>e())})})}const eb=100,tb={getItem:e=>(qy(tb),tb.getItem(e)),setItem:(e,t)=>{qy(tb),tb.setItem(e,t)}},[nb,rb]=K(`PanelGroup`),ib=p({__name:`SplitterGroup`,props:{id:{},autoSaveId:{default:null},direction:{},keyboardResizeBy:{default:10},storage:{default:()=>tb},asChild:{type:Boolean},as:{}},emits:[`layout`],setup(e,{emit:t}){let n=e,r=t,i={},{direction:o}=z(n),c=Z(n.id,`radix-vue-splitter-group`),l=Y(),{forwardRef:u,currentElement:d}=X(),f=L(null),p=L([]),m=L({}),h=L(new Map),g=L(0),_=a(()=>({autoSaveId:n.autoSaveId,direction:n.direction,dragState:f.value,id:c,keyboardResizeBy:n.keyboardResizeBy,storage:n.storage})),v=L({layout:p.value,panelDataArray:[],panelDataArrayChanged:!1}),y=e=>p.value=e;$y({eagerValuesRef:v,groupId:c,layout:p,panelDataArray:v.value.panelDataArray,setLayout:y,panelGroupElement:d}),H(()=>{let{panelDataArray:e}=v.value,{autoSaveId:t}=n;if(t){if(p.value.length===0||p.value.length!==e.length)return;let r=i[t];r||(r=Wy(Qy,eb),i[t]=r);let a=[...e],o=new Map(h.value);r(t,a,o,p.value,n.storage)}});function b(e,t){let{panelDataArray:n}=v.value,r=F(n,e);return qv({defaultSize:t,dragState:f.value,layout:p.value,panelData:n,panelIndex:r})}function x(e){let{panelDataArray:t}=v.value;t.push(e),t.sort((e,t)=>{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),v.value.panelDataArrayChanged=!0}V(()=>v.value.panelDataArrayChanged,()=>{if(v.value.panelDataArrayChanged){v.value.panelDataArrayChanged=!1;let{autoSaveId:e,storage:t}=_.value,{layout:n,panelDataArray:i}=v.value,a=null;if(e){let n=Zy(e,i,t);n&&(h.value=new Map(Object.entries(n.expandToSizes)),a=n.layout)}a===null&&(a=Hy({panelDataArray:i}));let o=Ky({layout:a,panelConstraints:i.map(e=>e.constraints)});Oa(n,o)||(y(o),v.value.layout=o,r(`layout`,o),Uy(i,o,m.value))}});function S(e){return function(t){t.preventDefault();let n=d.value;if(!n)return()=>null;let{direction:i,dragState:a,id:o,keyboardResizeBy:s}=_.value,{layout:c,panelDataArray:u}=v.value,{initialLayout:f}=a??{},p=Gy(o,e,n),h=By(t,e,i,a,s,n);if(h===0)return;let b=i===`horizontal`;l.value===`rtl`&&b&&(h=-h);let x=u.map(e=>e.constraints),S=Ny({delta:h,layout:f??c,panelConstraints:x,pivotIndices:p,trigger:Jv(t)?`keyboard`:`mouse-or-touch`}),C=!My(c,S);(Yv(t)||Xv(t))&&g.value!==h&&(g.value=h,C?wy(e,0):b?wy(e,h<0?cy:ly):wy(e,h<0?uy:dy)),C&&(y(S),v.value.layout=S,r(`layout`,S),Uy(u,S,m.value))}}function C(e,t){let{layout:n,panelDataArray:i}=v.value,a=i.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=I(i,e,n);$(o!=null);let c=F(i,e)===i.length-1?o-t:t-o,l=Ny({delta:c,layout:n,panelConstraints:a,pivotIndices:s,trigger:`imperative-api`});My(n,l)||(y(l),v.value.layout=l,r(`layout`,l),Uy(i,l,m.value))}function w(e,t){let{layout:n,panelDataArray:r}=v.value,i=F(r,e);r[i]=e,v.value.panelDataArrayChanged=!0;let{collapsedSize:a=0,collapsible:o}=t,{collapsedSize:s=0,collapsible:c,maxSize:l=100,minSize:u=0}=e.constraints,{panelSize:d}=I(r,e,n);d!==null&&(o&&c&&d===a?a!==s&&C(e,s):dl&&C(e,l))}function T(e,t){let{direction:n}=_.value,{layout:r}=v.value;if(!d.value)return;let i=Fy(e,d.value);$(i);let a=Qv(n,t);f.value={dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r}}function D(){f.value=null}function O(e){let{panelDataArray:t}=v.value,n=F(t,e);n>=0&&(t.splice(n,1),delete m.value[e.id],v.value.panelDataArrayChanged=!0)}function k(e){let{layout:t,panelDataArray:n}=v.value;if(e.constraints.collapsible){let i=n.map(e=>e.constraints),{collapsedSize:a=0,panelSize:o,pivotIndices:s}=I(n,e,t);if($(o!=null,`Panel size not found for panel "${e.id}"`),o!==a){h.value.set(e.id,o);let c=F(n,e)===n.length-1?o-a:a-o,l=Ny({delta:c,layout:t,panelConstraints:i,pivotIndices:s,trigger:`imperative-api`});My(t,l)||(y(l),v.value.layout=l,r(`layout`,l),Uy(n,l,m.value))}}}function A(e){let{layout:t,panelDataArray:n}=v.value;if(e.constraints.collapsible){let i=n.map(e=>e.constraints),{collapsedSize:a=0,panelSize:o,minSize:s=0,pivotIndices:c}=I(n,e,t);if(o===a){let a=h.value.get(e.id),l=a!=null&&a>=s?a:s,u=F(n,e)===n.length-1?o-l:l-o,d=Ny({delta:u,layout:t,panelConstraints:i,pivotIndices:c,trigger:`imperative-api`});My(t,d)||(y(d),v.value.layout=d,r(`layout`,d),Uy(n,d,m.value))}}}function j(e){let{layout:t,panelDataArray:n}=v.value,{panelSize:r}=I(n,e,t);return $(r!=null,`Panel size not found for panel "${e.id}"`),r}function M(e){let{layout:t,panelDataArray:n}=v.value,{collapsedSize:r=0,collapsible:i,panelSize:a}=I(n,e,t);return i?a===void 0?e.constraints.defaultSize===e.constraints.collapsedSize:a===r:!1}function N(e){let{layout:t,panelDataArray:n}=v.value,{collapsedSize:r=0,collapsible:i,panelSize:a}=I(n,e,t);return $(a!=null,`Panel size not found for panel "${e.id}"`),!i||a>r}rb({direction:o,dragState:f.value,groupId:c,reevaluatePanelConstraints:w,registerPanel:x,registerResizeHandle:S,resizePanel:C,startDragging:T,stopDragging:D,unregisterPanel:O,panelGroupElement:d,collapsePanel:k,expandPanel:A,isPanelCollapsed:M,isPanelExpanded:N,getPanelSize:j,getPanelStyle:b});function F(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function I(e,t,n){let r=F(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}return(e,t)=>(P(),s(B(Q),{ref:B(u),as:e.as,"as-child":e.asChild,style:E({display:`flex`,flexDirection:B(o)===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`}),"data-panel-group":``,"data-orientation":B(o),"data-panel-group-id":B(c)},{default:U(()=>[R(e.$slots,`default`,{layout:p.value})]),_:3},8,[`as`,`as-child`,`style`,`data-orientation`,`data-panel-group-id`]))}}),ab=p({__name:`SplitterPanel`,props:{collapsedSize:{},collapsible:{type:Boolean},defaultSize:{},id:{},maxSize:{},minSize:{},order:{},asChild:{type:Boolean},as:{}},emits:[`collapse`,`expand`,`resize`],setup(e,{expose:t,emit:n}){let r=e,i=n,o=nb();if(o===null)throw Error(`SplitterPanel components must be rendered within a SplitterGroup container`);let{collapsePanel:c,expandPanel:l,getPanelSize:u,getPanelStyle:d,isPanelCollapsed:f,resizePanel:p,groupId:m,reevaluatePanelConstraints:h,registerPanel:g,unregisterPanel:_}=o,v=Z(r.id,`radix-vue-splitter-panel`),y=a(()=>({callbacks:{onCollapse:()=>i(`collapse`),onExpand:()=>i(`expand`),onResize:(...e)=>i(`resize`,...e)},constraints:{collapsedSize:r.collapsedSize&&Number.parseFloat(r.collapsedSize.toFixed(Oy)),collapsible:r.collapsible,defaultSize:r.defaultSize,maxSize:r.maxSize,minSize:r.minSize},id:v,idIsFromProps:r.id!==void 0,order:r.order}));V(()=>y.value.constraints,(e,t)=>{(t.collapsedSize!==e.collapsedSize||t.collapsible!==e.collapsible||t.maxSize!==e.maxSize||t.minSize!==e.minSize)&&h(y.value,t)},{deep:!0}),A(()=>{let e=y.value;g(e),M(()=>{_(e)})});let b=a(()=>d(y.value,r.defaultSize)),x=a(()=>f(y.value)),S=a(()=>!x.value);return t({collapse:()=>{c(y.value)},expand:()=>{l(y.value)},getSize(){return u(y.value)},resize:e=>{p(y.value,e)},isCollapsed:x,isExpanded:S}),(e,t)=>(P(),s(B(Q),{id:B(v),style:E(b.value),as:e.as,"as-child":e.asChild,"data-panel":``,"data-panel-collapsible":e.collapsible||void 0,"data-panel-group-id":B(m),"data-panel-id":B(v),"data-panel-size":Number.parseFloat(`${b.value.flexGrow}`).toFixed(1),"data-state":e.collapsible?x.value?`collapsed`:`expanded`:void 0},{default:U(()=>[R(e.$slots,`default`,{isCollapsed:x.value,isExpanded:S.value})]),_:3},8,[`id`,`style`,`as`,`as-child`,`data-panel-collapsible`,`data-panel-group-id`,`data-panel-id`,`data-panel-size`,`data-state`]))}});function ob({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){H(i=>{let a=r.value;if(e.value||n.value===null||a===null)return;let o=Fy(t,a);if(o==null)return;let s=e=>{var r;if(!e.defaultPrevented)switch(e.key){case`ArrowDown`:case`ArrowLeft`:case`ArrowRight`:case`ArrowUp`:case`End`:case`Home`:e.preventDefault(),(r=n.value)==null||r.call(n,e);break;case`F6`:{e.preventDefault();let n=o.getAttribute(`data-panel-group-id`);$(n);let r=Ly(n,a),i=Iy(n,t,a);$(i!==null);let s=e.shiftKey?i>0?i-1:r.length-1:i+1{o.removeEventListener(`keydown`,s)})})}const sb=p({__name:`SplitterResizeHandle`,props:{id:{},hitAreaMargins:{},tabindex:{default:0},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`dragging`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=X(),{disabled:o}=z(n),c=nb();if(c===null)throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);let{direction:l,groupId:u,registerResizeHandle:d,startDragging:f,stopDragging:p,panelGroupElement:m}=c,h=Z(n.id,`radix-vue-splitter-resize-handle`),g=L(`inactive`),_=L(!1),v=L(null);return V(o,()=>{Aa&&(o.value?v.value=null:v.value=d(h))},{immediate:!0}),H(e=>{var t,i;if(o.value||v.value===null)return;let s=a.value;if(!s)return;$(s);let c=(e,t,n)=>{var i;if(t)switch(e){case`down`:g.value=`drag`,f(h,n),r(`dragging`,!0);break;case`move`:g.value!==`drag`&&(g.value=`hover`),(i=v.value)==null||i.call(v,n);break;case`up`:g.value=`hover`,p(),r(`dragging`,!1);break}else g.value=`inactive`};e(yy(h,s,l,{coarse:(t=n.hitAreaMargins)?.coarse??15,fine:(i=n.hitAreaMargins)?.fine??5},c))}),ob({disabled:o,resizeHandler:v,handleId:h,panelGroupElement:m}),(e,t)=>(P(),s(B(Q),{id:B(h),ref:B(i),style:{touchAction:`none`,userSelect:`none`},as:e.as,"as-child":e.asChild,role:`separator`,"data-resize-handle":``,tabindex:e.tabindex,"data-state":g.value,"data-disabled":B(o)?``:void 0,"data-orientation":B(l),"data-panel-group-id":B(u),"data-resize-handle-active":g.value===`drag`?`pointer`:_.value?`keyboard`:void 0,"data-resize-handle-state":g.value,"data-panel-resize-handle-enabled":!B(o),"data-panel-resize-handle-id":B(h),onBlur:t[0]||=e=>_.value=!1,onFocus:t[1]||=e=>_.value=!1},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`tabindex`,`data-state`,`data-disabled`,`data-orientation`,`data-panel-group-id`,`data-resize-handle-active`,`data-resize-handle-state`,`data-panel-resize-handle-enabled`,`data-panel-resize-handle-id`]))}}),cb={"aria-live":`polite`,"aria-atomic":`true`,role:`status`,style:{transform:`translateX(-100%)`,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}},[lb,ub]=K(`StepperRoot`),db=p({__name:`StepperRoot`,props:{defaultValue:{default:1},orientation:{default:`horizontal`},dir:{},modelValue:{},linear:{type:Boolean,default:!0},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{dir:i,orientation:c,linear:l}=z(n),u=Y(i);X();let d=L(new Set),f=q(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),p=a(()=>Array.from(d.value)),m=a(()=>f.value===1),h=a(()=>f.value===p.value.length),g=a(()=>d.value.size);function _(e){e>g.value||e<1||d.value.size&&p.value[e]&&p.value[e].getAttribute(`disabled`)||l.value&&e>(f.value??1)+1||(f.value=e)}let v=L(null),y=L(null),b=a(()=>v.value?v.value.getAttribute(`disabled`)===``:!0),x=a(()=>y.value?y.value.getAttribute(`disabled`)===``:!0);return V(f,async()=>{await w(()=>{v.value=p.value.length&&f.value1?p.value[f.value-2]:null})}),V(p,async()=>{await w(()=>{v.value=p.value.length&&f.value1?p.value[f.value-2]:null})}),ub({modelValue:f,changeModelValue:e=>{f.value=e},orientation:c,dir:u,linear:l,totalStepperItems:d}),(e,t)=>(P(),s(B(Q),{role:`group`,"aria-label":`progress`,as:e.as,"as-child":e.asChild,"data-linear":B(l)?``:void 0,"data-orientation":e.orientation},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(f),totalSteps:d.value.size,isNextDisabled:b.value,isPrevDisabled:x.value,isFirstStep:m.value,isLastStep:h.value,goToStep:_,nextStep:()=>_((B(f)??1)+1),prevStep:()=>_((B(f)??1)-1)}),o(`div`,cb,` Step `+ae(B(f))+` of `+ae(d.value.size),1)]),_:3},8,[`as`,`as-child`,`data-linear`,`data-orientation`]))}}),[fb,pb]=K(`StepperItem`),mb=p({__name:`StepperItem`,props:{step:{},disabled:{type:Boolean,default:!1},completed:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},setup(e){let t=e,{disabled:n,step:r,completed:i}=z(t),{forwardRef:o}=X(),c=lb(),l=Z(void 0,`radix-vue-stepper-item-title`),u=Z(void 0,`radix-vue-stepper-item-description`),d=a(()=>i.value?`completed`:c.modelValue.value===r.value?`active`:c.modelValue.value>r.value?`completed`:`inactive`),f=a(()=>n.value?!1:c.linear.value?r.value<=c.modelValue.value||r.value===c.modelValue.value+1:!0);return pb({titleId:l,descriptionId:u,state:d,disabled:n,step:r,isFocusable:f}),(e,t)=>(P(),s(B(Q),{ref:B(o),as:e.as,"as-child":e.asChild,"aria-current":d.value===`active`?`true`:void 0,"data-state":d.value,disabled:B(n)||!f.value?``:void 0,"data-disabled":B(n)||!f.value?``:void 0,"data-orientation":B(c).orientation.value},{default:U(()=>[R(e.$slots,`default`,{state:d.value})]),_:3},8,[`as`,`as-child`,`aria-current`,`data-state`,`disabled`,`data-disabled`,`data-orientation`]))}}),hb=p({__name:`StepperTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=lb(),n=fb(),r=zs(),i=a(()=>Array.from(t.totalStepperItems.value));function o(e){if(!n.disabled.value){if(t.linear.value){if((n.step.value<=t.modelValue.value||n.step.value===t.modelValue.value+1)&&e.ctrlKey===!1){t.changeModelValue(n.step.value);return}}else if(e.ctrlKey===!1){t.changeModelValue(n.step.value);return}e.preventDefault()}}function c(e){e.preventDefault(),!n.disabled.value&&((e.key===r.ENTER||e.key===r.SPACE)&&!e.ctrlKey&&!e.shiftKey&&t.changeModelValue(n.step.value),[r.ARROW_LEFT,r.ARROW_RIGHT,r.ARROW_UP,r.ARROW_DOWN].includes(e.key)&&Vo(e,J(),void 0,{itemsArray:i.value,focus:!0,loop:!1,arrowKeyOptions:t.orientation.value,dir:t.dir.value}))}let{forwardRef:l,currentElement:u}=X();return A(()=>{t.totalStepperItems.value.add(u.value)}),M(()=>{t.totalStepperItems.value.delete(u.value)}),(e,r)=>(P(),s(B(Q),{ref:B(l),type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"data-state":B(n).state.value,disabled:B(n).disabled.value||!B(n).isFocusable.value?``:void 0,"data-disabled":B(n).disabled.value||!B(n).isFocusable.value?``:void 0,"data-orientation":B(t).orientation.value,tabindex:B(n).isFocusable.value?0:-1,"aria-describedby":B(n).descriptionId,"aria-labelledby":B(n).titleId,onMousedown:G(o,[`left`]),onKeydown:W(c,[`enter`,`space`,`left`,`right`,`up`,`down`])},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`data-state`,`disabled`,`data-disabled`,`data-orientation`,`tabindex`,`aria-describedby`,`aria-labelledby`]))}}),gb=p({__name:`StepperDescription`,props:{asChild:{type:Boolean},as:{default:`p`}},setup(e){let t=e;X();let n=fb();return(e,r)=>(P(),s(B(Q),C(t,{id:B(n).descriptionId}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),_b=p({__name:`StepperTitle`,props:{asChild:{type:Boolean},as:{default:`h4`}},setup(e){let t=e,n=fb();return X(),(e,r)=>(P(),s(B(Q),C(t,{id:B(n).titleId}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),vb=p({__name:`StepperIndicator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=fb();return X(),(e,r)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(` Step `+ae(B(n).step.value),1)])]),_:3},16))}}),yb=p({__name:`StepperSeparator`,props:{orientation:{},decorative:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,n=lb(),r=fb();return X(),(e,i)=>(P(),s(B(hv),C(t,{decorative:``,orientation:B(n).orientation.value,"data-state":B(r).state.value}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`orientation`,`data-state`]))}}),bb=[`name`,`disabled`,`required`,`value`,`checked`,`data-state`,`data-disabled`],[xb,Sb]=K(`SwitchRoot`),Cb=p({__name:`SwitchRoot`,props:{defaultChecked:{type:Boolean},checked:{type:Boolean,default:void 0},disabled:{type:Boolean},required:{type:Boolean},name:{},id:{},value:{default:`on`},asChild:{type:Boolean},as:{default:`button`}},emits:[`update:checked`],setup(e,{emit:n}){let r=e,i=n,{disabled:o}=z(r),s=q(r,`checked`,i,{defaultValue:r.defaultChecked,passive:r.checked===void 0});function u(){o.value||(s.value=!s.value)}let{forwardRef:f,currentElement:p}=X(),m=ds(p),h=a(()=>{var e;return r.id&&p.value?(e=document.querySelector(`[for="${r.id}"]`))?.innerText:void 0});return Sb({checked:s,toggleCheck:u,disabled:o}),(e,n)=>(P(),l(t,null,[d(B(Q),C(e.$attrs,{id:e.id,ref:B(f),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||h.value,"aria-checked":B(s),"aria-required":e.required,"data-state":B(s)?`checked`:`unchecked`,"data-disabled":B(o)?``:void 0,"as-child":e.asChild,as:e.as,disabled:B(o),onClick:u,onKeydown:W(G(u,[`prevent`]),[`enter`])}),{default:U(()=>[R(e.$slots,`default`,{checked:B(s)})]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]),B(m)?(P(),l(`input`,{key:0,type:`checkbox`,name:e.name,tabindex:`-1`,"aria-hidden":`true`,disabled:B(o),required:e.required,value:e.value,checked:!!B(s),"data-state":B(s)?`checked`:`unchecked`,"data-disabled":B(o)?``:void 0,style:{transform:`translateX(-100%)`,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}},null,8,bb)):c(``,!0)],64))}}),wb=p({__name:`SwitchThumb`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=xb();return X(),(e,n)=>{var r;return P(),s(B(Q),{"data-state":(r=B(t).checked)!=null&&r.value?`checked`:`unchecked`,"data-disabled":B(t).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`])}}}),[Tb,Eb]=K(`TabsRoot`),Db=p({__name:`TabsRoot`,props:{defaultValue:{},orientation:{default:`horizontal`},dir:{},activationMode:{default:`automatic`},modelValue:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{orientation:i,dir:a}=z(n),o=Y(a);X();let c=q(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),l=L();return Eb({modelValue:c,changeModelValue:e=>{c.value=e},orientation:i,dir:o,activationMode:n.activationMode,baseId:Z(void 0,`radix-vue-tabs`),tabsList:l}),(e,t)=>(P(),s(B(Q),{dir:B(o),"data-orientation":B(i),"as-child":e.asChild,as:e.as},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(c)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}}),Ob=p({__name:`TabsList`,props:{loop:{type:Boolean,default:!0},asChild:{type:Boolean},as:{}},setup(e){let t=e,{loop:n}=z(t),{forwardRef:r,currentElement:i}=X(),a=Tb();return a.tabsList=i,(e,t)=>(P(),s(B(dd),{"as-child":``,orientation:B(a).orientation.value,dir:B(a).dir.value,loop:B(n)},{default:U(()=>[d(B(Q),{ref:B(r),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":B(a).orientation.value},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}});function kb(e,t){return`${e}-trigger-${t}`}function Ab(e,t){return`${e}-content-${t}`}const jb=p({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,{forwardRef:n}=X(),r=Tb(),i=a(()=>kb(r.baseId,t.value)),o=a(()=>Ab(r.baseId,t.value)),l=a(()=>t.value===r.modelValue.value),u=L(l.value);return A(()=>{requestAnimationFrame(()=>{u.value=!1})}),(e,t)=>(P(),s(B(Js),{present:l.value,"force-mount":``},{default:U(({present:t})=>[d(B(Q),{id:o.value,ref:B(n),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":l.value?`active`:`inactive`,"data-orientation":B(r).orientation.value,"aria-labelledby":i.value,hidden:!t.value,tabindex:`0`,style:E({animationDuration:u.value?`0s`:void 0})},{default:U(()=>[e.forceMount||l.value?R(e.$slots,`default`,{key:0}):c(``,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),Mb=p({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean,default:!1},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,{forwardRef:n}=X(),r=Tb(),i=a(()=>kb(r.baseId,t.value)),o=a(()=>Ab(r.baseId,t.value)),c=a(()=>t.value===r.modelValue.value);return(e,t)=>(P(),s(B(fd),{"as-child":``,focusable:!e.disabled,active:c.value},{default:U(()=>[d(B(Q),{id:i.value,ref:B(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":c.value?`true`:`false`,"aria-controls":o.value,"data-state":c.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":B(r).orientation.value,onMousedown:t[0]||=G(t=>{!e.disabled&&t.ctrlKey===!1?B(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=W(t=>B(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=B(r).activationMode!==`manual`;!c.value&&!e.disabled&&t&&B(r).changeModelValue(e.value)}},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),Nb=p({__name:`TabsIndicator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=Tb();X();let r=L(),i=L({size:null,position:null});V(()=>[n.modelValue.value,n?.dir.value],async()=>{await w(),a()},{immediate:!0}),Io([n.tabsList,r],a);function a(){var e;r.value=(e=n.tabsList.value)?.querySelector(`[role="tab"][data-state="active"]`),r.value&&(n.orientation.value===`horizontal`?i.value={size:r.value.offsetWidth,position:r.value.offsetLeft}:i.value={size:r.value.offsetHeight,position:r.value.offsetTop})}return(e,n)=>typeof i.value.size==`number`?(P(),s(B(Q),C({key:0},t,{style:{"--radix-tabs-indicator-size":`${i.value.size}px`,"--radix-tabs-indicator-position":`${i.value.position}px`}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`style`])):c(``,!0)}}),[Pb,Fb]=K(`TagsInputRoot`),Ib=p({__name:`TagsInputRoot`,props:{modelValue:{},defaultValue:{default:()=>[]},addOnPaste:{type:Boolean},addOnTab:{type:Boolean},addOnBlur:{type:Boolean},duplicate:{type:Boolean},disabled:{type:Boolean},delimiter:{default:`,`},dir:{},max:{default:0},required:{type:Boolean},name:{},id:{},convertValue:{},displayValue:{type:Function,default:e=>e.toString()},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`,`invalid`],setup(e,{emit:t}){let n=e,r=t,{addOnPaste:i,disabled:a,delimiter:o,max:l,id:u,dir:f,addOnBlur:p,addOnTab:m}=z(n),h=Y(f),g=q(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:!0,deep:!0}),{forwardRef:_,currentElement:v}=X(),{focused:y}=Lo(v),b=ds(v),{getItems:x}=_u(),S=L(),C=L(!1);return Fb({modelValue:g,onAddValue:e=>{let t=g.value.length>0&&typeof g.value[0]==`object`,i=g.value.length>0&&typeof n.defaultValue[0]==`object`;if((t||i)&&typeof n.convertValue!=`function`)throw Error("You must provide a `convertValue` function when using objects as values.");let a=n.convertValue?n.convertValue(e):e;if(g.value.length>=l.value&&l.value)return r(`invalid`,a),!1;if(n.duplicate)return g.value=[...g.value,a],!0;if(g.value.includes(a))C.value=!0;else return g.value=[...g.value,a],!0;return r(`invalid`,a),!1},onRemoveValue:e=>{e!==-1&&(g.value=g.value.filter((t,n)=>n!==e))},onInputKeydown:e=>{let t=e.target,n=x().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);if(!n.length)return;let r=n.at(-1);switch(e.key){case`Delete`:case`Backspace`:if(t.selectionStart!==0||t.selectionEnd!==0)break;if(S.value){let t=n.findIndex(e=>e===S.value);g.value=g.value.filter((e,n)=>n!==t),S.value=S.value===r?n.at(t-1):n.at(t+1),e.preventDefault()}else e.key===`Backspace`&&(S.value=r,e.preventDefault());break;case`Home`:case`End`:case`ArrowRight`:case`ArrowLeft`:{let i=e.key===`ArrowRight`&&h.value===`ltr`||e.key===`ArrowLeft`&&h.value===`rtl`,a=!i;if(t.selectionStart!==0||t.selectionEnd!==0)break;if(a&&!S.value)S.value=r,e.preventDefault();else if(i&&r&&S.value===r)S.value=void 0,e.preventDefault();else if(S.value){let t=Vo(e,S.value,void 0,{itemsArray:n,loop:!1,dir:h.value});t&&(S.value=t),e.preventDefault()}break}case`ArrowUp`:case`ArrowDown`:S.value&&e.preventDefault();break;default:S.value=void 0}},selectedElement:S,isInvalidInput:C,addOnPaste:i,addOnBlur:p,addOnTab:m,dir:h,disabled:a,delimiter:o,max:l,id:u,displayValue:n.displayValue}),(e,t)=>(P(),s(B(vu),null,{default:U(()=>[d(B(Q),{ref:B(_),dir:B(h),as:e.as,"as-child":e.asChild,"data-invalid":C.value?``:void 0,"data-disabled":B(a)?``:void 0,"data-focused":B(y)?``:void 0},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(g)}),B(b)&&e.name?(P(),s(B(pu),{key:0,name:e.name,value:B(g),required:e.required,disabled:B(a)},null,8,[`name`,`value`,`required`,`disabled`])):c(``,!0)]),_:3},8,[`dir`,`as`,`as-child`,`data-invalid`,`data-disabled`,`data-focused`])]),_:3}))}}),Lb=p({__name:`TagsInputInput`,props:{placeholder:{},autoFocus:{type:Boolean},maxLength:{},asChild:{type:Boolean},as:{default:`input`}},setup(e){let t=e,n=Pb(),{forwardRef:r,currentElement:i}=X();function a(e){if(!n.addOnBlur.value)return;let t=e.target;t.value&&n.onAddValue(t.value)&&(t.value=``)}function o(e){n.addOnTab.value&&d(e)}let c=L(!1);function l(){c.value=!0}function u(){requestAnimationFrame(()=>{c.value=!1})}async function d(e){if(c.value||(await w(),e.defaultPrevented))return;let t=e.target;t.value&&(n.onAddValue(t.value)&&(t.value=``),e.preventDefault())}function f(e){n.isInvalidInput.value=!1;let t=n.delimiter.value;if(t===e.data){let r=e.target;r.value=r.value.replaceAll(t,``),n.onAddValue(r.value)&&(r.value=``)}}function p(e){if(n.addOnPaste.value){e.preventDefault();let t=e.clipboardData;if(!t)return;let r=t.getData(`text`);n.delimiter.value?r.split(n.delimiter.value).forEach(e=>{n.onAddValue(e)}):n.onAddValue(r)}}return A(()=>{let e=i.value.nodeName===`INPUT`?i.value:i.value.querySelector(`input`);e&&setTimeout(()=>{t.autoFocus&&e?.focus()},1)}),(e,t)=>{var i;return P(),s(B(Q),{id:(i=B(n).id)?.value,ref:B(r),type:`text`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,as:e.as,"as-child":e.asChild,maxlength:e.maxLength,placeholder:e.placeholder,disabled:B(n).disabled.value,"data-invalid":B(n).isInvalidInput.value?``:void 0,onInput:f,onKeydown:[W(d,[`enter`]),W(o,[`tab`]),B(n).onInputKeydown],onBlur:a,onCompositionstart:l,onCompositionend:u,onPaste:p},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`maxlength`,`placeholder`,`disabled`,`data-invalid`,`onKeydown`])}}}),[Rb,zb]=K(`TagsInputItem`),Bb=p({__name:`TagsInputItem`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,{value:n}=z(t),r=Pb(),{forwardRef:i,currentElement:o}=X(),c=a(()=>r.selectedElement.value===o.value),l=a(()=>t.disabled||r.disabled.value),u=zb({value:n,isSelected:c,disabled:l,textId:``,displayValue:a(()=>r.displayValue(n.value))});return(e,t)=>(P(),s(B(yu),null,{default:U(()=>[d(B(Q),{ref:B(i),as:e.as,"as-child":e.asChild,"aria-labelledby":B(u).textId,"aria-current":c.value,"data-disabled":l.value?``:void 0,"data-state":c.value?`active`:`inactive`},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-labelledby`,`aria-current`,`data-disabled`,`data-state`])]),_:3}))}}),Vb=p({__name:`TagsInputItemText`,props:{asChild:{type:Boolean},as:{default:`span`}},setup(e){let t=e,n=Rb();return X(),n.textId||=Z(void 0,`radix-vue-tags-input-item-text`),(e,r)=>(P(),s(B(Q),C(t,{id:B(n).textId}),{default:U(()=>[R(e.$slots,`default`,{},()=>[u(ae(B(n).displayValue.value),1)])]),_:3},16,[`id`]))}}),Hb=p({__name:`TagsInputItemDelete`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=Pb(),r=Rb(),i=a(()=>{var e;return(e=r.disabled)?.value||n.disabled.value});function o(){if(i.value)return;let e=n.modelValue.value.findIndex(e=>e===r.value.value);n.onRemoveValue(e)}return(e,n)=>(P(),s(B(Q),C({tabindex:`-1`},t,{"aria-labelledby":B(r).textId,"aria-current":B(r).isSelected.value,"data-state":B(r).isSelected.value?`active`:`inactive`,"data-disabled":i.value?``:void 0,type:e.as===`button`?`button`:void 0,onClick:o}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-labelledby`,`aria-current`,`data-state`,`data-disabled`,`type`]))}}),Ub=p({__name:`TagsInputClear`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;X();let n=Pb();function r(){n.disabled.value||(n.modelValue.value=[])}return(e,i)=>(P(),s(B(Q),C(t,{type:e.as===`button`?`button`:void 0,"data-disabled":B(n).disabled.value?``:void 0,onClick:r}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`type`,`data-disabled`]))}}),[Wb,Gb]=K(`ToastProvider`),Kb=p({inheritAttrs:!1,__name:`ToastProvider`,props:{label:{default:`Notification`},duration:{default:5e3},swipeDirection:{default:`right`},swipeThreshold:{default:50}},setup(e){let t=e,{label:n,duration:r,swipeDirection:i,swipeThreshold:a}=z(t),o=L(),s=L(0),c=L(!1),l=L(!1);if(t.label&&typeof t.label==`string`&&!t.label.trim()){let e="Invalid prop `label` supplied to `ToastProvider`. Expected non-empty `string`.";throw Error(e)}return Gb({label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:s,viewport:o,onViewportChange(e){o.value=e},onToastAdd(){s.value++},onToastRemove(){s.value--},isFocusedToastEscapeKeyDownRef:c,isClosePausedRef:l}),(e,t)=>R(e.$slots,`default`)}}),qb=`toast.swipeStart`,Jb=`toast.swipeMove`,Yb=`toast.swipeCancel`,Xb=`toast.swipeEnd`,Zb=`toast.viewportPause`,Qb=`toast.viewportResume`;function $b(e,t,n){let r=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function ex(e,t,n=0){let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n}function tx(e){return e.nodeType===e.ELEMENT_NODE}function nx(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),tx(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...nx(e))}}),t}const rx=p({__name:`ToastAnnounce`,setup(e){let t=Wb(),n=So(1e3),r=L(!1);return No(()=>{r.value=!0}),(e,i)=>B(n)||r.value?(P(),s(B(fu),{key:0},{default:U(()=>[u(ae(B(t).label.value)+` `,1),R(e.$slots,`default`)]),_:3})):c(``,!0)}}),[ix,ax]=K(`ToastRoot`),ox=p({inheritAttrs:!1,__name:`ToastRootImpl`,props:{type:{},open:{type:Boolean,default:!1},duration:{},asChild:{type:Boolean},as:{default:`li`}},emits:[`close`,`escapeKeyDown`,`pause`,`resume`,`swipeStart`,`swipeMove`,`swipeCancel`,`swipeEnd`],setup(e,{emit:r}){let i=e,o=r,{forwardRef:f,currentElement:p}=X(),m=Wb(),h=L(null),g=L(null),_=a(()=>typeof i.duration==`number`?i.duration:m.duration.value),v=L(0),y=L(_.value),b=L(0),x=L(_.value),S=No(()=>{let e=new Date().getTime()-v.value;x.value=Math.max(y.value-e,0)},{fpsLimit:60});function w(e){e<=0||e===1/0||ao&&(window.clearTimeout(b.value),v.value=new Date().getTime(),b.value=window.setTimeout(T,e))}function T(){var e,t;(e=p.value)!=null&&e.contains(J())&&((t=m.viewport.value)==null||t.focus()),m.isClosePausedRef.value=!1,o(`close`)}let E=a(()=>p.value?nx(p.value):null);if(i.type&&![`foreground`,`background`].includes(i.type)){let e="Invalid prop `type` supplied to `Toast`. Expected `foreground | background`.";throw Error(e)}return H(e=>{let t=m.viewport.value;if(t){let e=()=>{w(y.value),S.resume(),o(`resume`)},n=()=>{let e=new Date().getTime()-v.value;y.value-=e,window.clearTimeout(b.value),S.pause(),o(`pause`)};return t.addEventListener(Zb,n),t.addEventListener(Qb,e),()=>{t.removeEventListener(Zb,n),t.removeEventListener(Qb,e)}}}),V(()=>[i.open,_.value],()=>{y.value=_.value,i.open&&!m.isClosePausedRef.value&&w(_.value)},{immediate:!0}),Oo(`Escape`,e=>{o(`escapeKeyDown`,e),e.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.value=!0,T())}),A(()=>{m.onToastAdd()}),M(()=>{m.onToastRemove()}),ax({onClose:T}),(e,r)=>(P(),l(t,null,[E.value?(P(),s(rx,{key:0,role:`alert`,"aria-live":e.type===`foreground`?`assertive`:`polite`,"aria-atomic":`true`},{default:U(()=>[u(ae(E.value),1)]),_:1},8,[`aria-live`])):c(``,!0),B(m).viewport.value?(P(),s(n,{key:1,to:B(m).viewport.value},[d(B(Q),C({ref:B(f),role:`alert`,"aria-live":`off`,"aria-atomic":`true`,tabindex:`0`,"data-radix-vue-collection-item":``},e.$attrs,{as:e.as,"as-child":e.asChild,"data-state":e.open?`open`:`closed`,"data-swipe-direction":B(m).swipeDirection.value,style:{userSelect:`none`,touchAction:`none`},onPointerdown:r[0]||=G(e=>{h.value={x:e.clientX,y:e.clientY}},[`left`]),onPointermove:r[1]||=e=>{if(!h.value)return;let t=e.clientX-h.value.x,n=e.clientY-h.value.y,r=!!g.value,i=[`left`,`right`].includes(B(m).swipeDirection.value),a=[`left`,`up`].includes(B(m).swipeDirection.value)?Math.min:Math.max,s=i?a(0,t):0,c=i?0:a(0,n),l=e.pointerType===`touch`?10:2,u={x:s,y:c},d={originalEvent:e,delta:u};r?(g.value=u,B($b)(B(Jb),e=>o(`swipeMove`,e),d)):B(ex)(u,B(m).swipeDirection.value,l)?(g.value=u,B($b)(B(qb),e=>o(`swipeStart`,e),d),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>l||Math.abs(n)>l)&&(h.value=null)},onPointerup:r[2]||=e=>{let t=g.value,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),g.value=null,h.value=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};B(ex)(t,B(m).swipeDirection.value,B(m).swipeThreshold.value)?B($b)(B(Xb),e=>o(`swipeEnd`,e),r):B($b)(B(Yb),e=>o(`swipeCancel`,e),r),n?.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}}}),{default:U(()=>[R(e.$slots,`default`,{remaining:x.value,duration:_.value})]),_:3},16,[`as`,`as-child`,`data-state`,`data-swipe-direction`])],8,[`to`])):c(``,!0)],64))}}),sx=p({__name:`ToastRoot`,props:{defaultOpen:{type:Boolean,default:!0},forceMount:{type:Boolean},type:{default:`foreground`},open:{type:Boolean,default:void 0},duration:{},asChild:{type:Boolean},as:{default:`li`}},emits:[`escapeKeyDown`,`pause`,`resume`,`swipeStart`,`swipeMove`,`swipeCancel`,`swipeEnd`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i}=X(),a=q(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return(e,t)=>(P(),s(B(Js),{present:e.forceMount||B(a)},{default:U(()=>[d(ox,C({ref:B(i),open:B(a),type:e.type,as:e.as,"as-child":e.asChild,duration:e.duration},e.$attrs,{onClose:t[0]||=e=>a.value=!1,onPause:t[1]||=e=>r(`pause`),onResume:t[2]||=e=>r(`resume`),onEscapeKeyDown:t[3]||=e=>r(`escapeKeyDown`,e),onSwipeStart:t[4]||=e=>{r(`swipeStart`,e),e.currentTarget.setAttribute(`data-swipe`,`start`)},onSwipeMove:t[5]||=e=>{let{x:t,y:n}=e.detail.delta,r=e.currentTarget;r.setAttribute(`data-swipe`,`move`),r.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),r.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)},onSwipeCancel:t[6]||=e=>{let t=e.currentTarget;t.setAttribute(`data-swipe`,`cancel`),t.style.removeProperty(`--radix-toast-swipe-move-x`),t.style.removeProperty(`--radix-toast-swipe-move-y`),t.style.removeProperty(`--radix-toast-swipe-end-x`),t.style.removeProperty(`--radix-toast-swipe-end-y`)},onSwipeEnd:t[7]||=e=>{let{x:t,y:n}=e.detail.delta,r=e.currentTarget;r.setAttribute(`data-swipe`,`end`),r.style.removeProperty(`--radix-toast-swipe-move-x`),r.style.removeProperty(`--radix-toast-swipe-move-y`),r.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),r.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),a.value=!1}}),{default:U(({remaining:t,duration:n})=>[R(e.$slots,`default`,{remaining:t,duration:n,open:B(a)})]),_:3},16,[`open`,`type`,`as`,`as-child`,`duration`])]),_:3},8,[`present`]))}}),cx=p({__name:`ToastPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(pc),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),lx=p({__name:`ToastAnnounceExclude`,props:{altText:{},asChild:{type:Boolean},as:{}},setup(e){return(e,t)=>(P(),s(B(Q),{as:e.as,"as-child":e.asChild,"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":e.altText||void 0},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-radix-toast-announce-alt`]))}}),ux=p({__name:`ToastClose`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=ix(),{forwardRef:r}=X();return(e,i)=>(P(),s(lx,{"as-child":``},{default:U(()=>[d(B(Q),C(t,{ref:B(r),type:e.as===`button`?`button`:void 0,onClick:i[0]||=e=>B(n).onClose()}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`type`])]),_:3}))}}),dx=p({__name:`ToastAction`,props:{altText:{},asChild:{type:Boolean},as:{}},setup(e){if(!e.altText)throw Error("Missing prop `altText` expected on `ToastAction`");let{forwardRef:t}=X();return(e,n)=>e.altText?(P(),s(lx,{key:0,"alt-text":e.altText,"as-child":``},{default:U(()=>[d(ux,{ref:B(t),as:e.as,"as-child":e.asChild},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`])]),_:3},8,[`alt-text`])):c(``,!0)}}),fx=p({__name:`FocusProxy`,emits:[`focusFromOutsideViewport`],setup(e,{emit:t}){let n=t,r=Wb();return(e,t)=>(P(),s(B(fu),{"aria-hidden":`true`,tabindex:`0`,style:{position:`fixed`},onFocus:t[0]||=e=>{var t;let i=e.relatedTarget;!((t=B(r).viewport.value)!=null&&t.contains(i))&&n(`focusFromOutsideViewport`)}},{default:U(()=>[R(e.$slots,`default`)]),_:3}))}}),px=p({inheritAttrs:!1,__name:`ToastViewport`,props:{hotkey:{default:()=>[`F8`]},label:{type:[String,Function],default:`Notifications ({hotkey})`},asChild:{type:Boolean},as:{default:`ol`}},setup(e){let t=e,{hotkey:n,label:r}=z(t),{forwardRef:i,currentElement:o}=X(),{createCollection:l}=rs(),u=l(o),f=Wb(),p=a(()=>f.toastCount.value>0),m=L(),h=L(),g=a(()=>n.value.join(`+`).replace(/Key/g,``).replace(/Digit/g,``));Oo(n.value,()=>{o.value.focus()}),A(()=>{f.onViewportChange(o.value)}),H(e=>{let t=o.value;if(p.value&&t){let n=()=>{if(!f.isClosePausedRef.value){let e=new CustomEvent(Zb);t.dispatchEvent(e),f.isClosePausedRef.value=!0}},r=()=>{if(f.isClosePausedRef.value){let e=new CustomEvent(Qb);t.dispatchEvent(e),f.isClosePausedRef.value=!1}},i=e=>{!t.contains(e.relatedTarget)&&r()},a=()=>{t.contains(J())||r()},o=e=>{var n,r,i;let a=e.altKey||e.ctrlKey||e.metaKey;if(e.key===`Tab`&&!a){let a=J(),o=e.shiftKey;if(e.target===t&&o){(n=m.value)==null||n.focus();return}let s=_({tabbingDirection:o?`backwards`:`forwards`}),c=s.findIndex(e=>e===a);Ec(s.slice(c+1))?e.preventDefault():o?(r=m.value)==null||r.focus():(i=h.value)==null||i.focus()}};t.addEventListener(`focusin`,n),t.addEventListener(`focusout`,i),t.addEventListener(`pointermove`,n),t.addEventListener(`pointerleave`,a),t.addEventListener(`keydown`,o),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),e(()=>{t.removeEventListener(`focusin`,n),t.removeEventListener(`focusout`,i),t.removeEventListener(`pointermove`,n),t.removeEventListener(`pointerleave`,a),t.removeEventListener(`keydown`,o),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)})}});function _({tabbingDirection:e}){let t=u.value.map(t=>{let n=[t,...Oc(t)];return e===`forwards`?n:n.reverse()});return(e===`forwards`?t.reverse():t).flat()}return(e,t)=>(P(),s(B(Sc),{role:`region`,"aria-label":typeof B(r)==`string`?B(r).replace(`{hotkey}`,g.value):B(r)(g.value),tabindex:`-1`,style:E({pointerEvents:p.value?void 0:`none`})},{default:U(()=>[p.value?(P(),s(fx,{key:0,ref:e=>{m.value=B(wo)(e)},onFocusFromOutsideViewport:t[0]||=()=>{let e=_({tabbingDirection:`forwards`});B(Ec)(e)}},null,512)):c(``,!0),d(B(Q),C({ref:B(i),tabindex:`-1`,as:e.as,"as-child":e.asChild},e.$attrs),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`]),p.value?(P(),s(fx,{key:1,ref:e=>{h.value=B(wo)(e)},onFocusFromOutsideViewport:t[1]||=()=>{let e=_({tabbingDirection:`backwards`});B(Ec)(e)}},null,512)):c(``,!0)]),_:3},8,[`aria-label`,`style`]))}}),mx=p({__name:`ToastTitle`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),hx=p({__name:`ToastDescription`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(Q),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),gx=p({__name:`Toggle`,props:{defaultValue:{type:Boolean},pressed:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},asChild:{type:Boolean},as:{default:`button`}},emits:[`update:pressed`],setup(e,{emit:t}){let n=e,r=t;X();let i=q(n,`pressed`,r,{defaultValue:n.defaultValue,passive:n.pressed===void 0});function o(){i.value=!i.value}let c=a(()=>i.value?`on`:`off`);return(e,t)=>(P(),s(B(Q),{type:e.as===`button`?`button`:void 0,"as-child":n.asChild,as:e.as,"aria-pressed":B(i),"data-state":c.value,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,onClick:o},{default:U(()=>[R(e.$slots,`default`,{pressed:B(i)})]),_:3},8,[`type`,`as-child`,`as`,`aria-pressed`,`data-state`,`data-disabled`,`disabled`]))}}),[_x,vx]=K(`ToggleGroupRoot`),yx=p({__name:`ToggleGroupRoot`,props:{rovingFocus:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},orientation:{},dir:{},loop:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},type:{},modelValue:{},defaultValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{loop:i,rovingFocus:a,disabled:o,dir:c}=z(n),l=Y(c),{forwardRef:u}=X(),{modelValue:f,changeModelValue:p,isSingle:m}=$s(n,r);return vx({isSingle:m,modelValue:f,changeModelValue:p,dir:l,orientation:n.orientation,loop:i,rovingFocus:a,disabled:o}),(e,t)=>(P(),s(ne(B(a)?B(dd):B(Q)),{"as-child":``,orientation:B(a)?e.orientation:void 0,dir:B(l),loop:B(a)?B(i):void 0},{default:U(()=>[d(B(Q),{ref:B(u),role:`group`,"as-child":e.asChild,as:e.as},{default:U(()=>[R(e.$slots,`default`,{modelValue:B(f)})]),_:3},8,[`as-child`,`as`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),bx=p({__name:`ToggleGroupItem`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=_x(),r=a(()=>{var e;return(e=n.disabled)?.value||t.disabled}),i=a(()=>{var e;return(e=n.modelValue.value)?.includes(t.value)}),o=a(()=>{var e;return n.isSingle.value?n.modelValue.value===t.value:(e=n.modelValue.value)?.includes(t.value)}),{forwardRef:c}=X();return(e,a)=>(P(),s(ne(B(n).rovingFocus.value?B(fd):B(Q)),{"as-child":``,focusable:!r.value,active:i.value},{default:U(()=>[d(B(gx),C(t,{ref:B(c),disabled:r.value,pressed:o.value,"onUpdate:pressed":a[0]||=t=>B(n).changeModelValue(e.value)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`disabled`,`pressed`])]),_:3},8,[`focusable`,`active`]))}}),[xx,Sx]=K(`ToolbarRoot`),Cx=p({__name:`ToolbarRoot`,props:{orientation:{default:`horizontal`},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,{orientation:n,dir:r}=z(t),i=Y(r),{forwardRef:a}=X();return Sx({orientation:n,dir:i}),(e,t)=>(P(),s(B(dd),{"as-child":``,orientation:B(n),dir:B(i),loop:e.loop},{default:U(()=>[d(B(Q),{ref:B(a),role:`toolbar`,"aria-orientation":B(n),"as-child":e.asChild,as:e.as},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`aria-orientation`,`as-child`,`as`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),wx=p({__name:`ToolbarButton`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,{forwardRef:n}=X();return(e,r)=>(P(),s(B(fd),{"as-child":``,focusable:!e.disabled},{default:U(()=>[d(B(Q),C({ref:B(n),type:e.as===`button`?`button`:void 0},t),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`type`])]),_:3},8,[`focusable`]))}}),Tx=p({__name:`ToolbarLink`,props:{asChild:{type:Boolean},as:{default:`a`}},setup(e){let t=e,{forwardRef:n}=X();return(e,r)=>(P(),s(B(fd),{"as-child":``,focusable:``},{default:U(()=>[d(B(Q),C(t,{ref:B(n),onKeydown:r[0]||=e=>{var t;e.key===` `&&((t=e.currentTarget)==null||t.click())}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)]),_:3}))}}),Ex=p({__name:`ToolbarToggleGroup`,props:{rovingFocus:{type:Boolean},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},type:{},modelValue:{},defaultValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=xx(),a=ss(r);return X(),(e,t)=>(P(),s(B(yx),C({...n,...B(a)},{"data-orientation":B(i).orientation.value,dir:B(i).dir.value,"roving-focus":!1}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`data-orientation`,`dir`]))}}),Dx=p({__name:`ToolbarToggleItem`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=e,{forwardRef:n}=X();return(e,r)=>(P(),s(wx,{"as-child":``},{default:U(()=>[d(B(bx),C(t,{ref:B(n)}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16)]),_:3}))}}),Ox=p({__name:`ToolbarSeparator`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e,n=xx();return X(),(e,r)=>(P(),s(mv,{orientation:B(n).orientation.value,"as-child":t.asChild,as:e.as},{default:U(()=>[R(e.$slots,`default`)]),_:3},8,[`orientation`,`as-child`,`as`]))}}),kx=`tooltip.open`,[Ax,jx]=K(`TooltipProvider`),Mx=p({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{default:700},skipDelayDuration:{default:300},disableHoverableContent:{type:Boolean,default:!1},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean,default:!1}},setup(e){let t=e,{delayDuration:n,skipDelayDuration:r,disableHoverableContent:i,disableClosingTrigger:a,ignoreNonKeyboardFocus:o,disabled:s}=z(t);X();let c=L(!0),l=L(!1),{start:u,stop:d}=xo(()=>{c.value=!0},r,{immediate:!1});return jx({isOpenDelayed:c,delayDuration:n,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:i,disableClosingTrigger:a,disabled:s,ignoreNonKeyboardFocus:o}),(e,t)=>R(e.$slots,`default`)}}),[Nx,Px]=K(`TooltipRoot`),Fx=p({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},delayDuration:{default:void 0},disableHoverableContent:{type:Boolean,default:void 0},disableClosingTrigger:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;X();let i=Ax(),o=a(()=>n.disableHoverableContent??i.disableHoverableContent.value),c=a(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),l=a(()=>n.disabled??i.disabled.value),u=a(()=>n.delayDuration??i.delayDuration.value),d=a(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),f=q(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});V(f,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(kx))):i.onClose())});let p=L(!1),m=L(),h=a(()=>f.value?p.value?`delayed-open`:`instant-open`:`closed`),{start:g,stop:_}=xo(()=>{p.value=!0,f.value=!0},u,{immediate:!1});function v(){_(),p.value=!1,f.value=!0}function y(){_(),f.value=!1}function b(){g()}return Px({contentId:``,open:f,stateAttribute:h,trigger:m,onTriggerChange(e){m.value=e},onTriggerEnter(){i.isOpenDelayed.value?b():v()},onTriggerLeave(){o.value?y():_()},onOpen:v,onClose:y,disableHoverableContent:o,disableClosingTrigger:c,disabled:l,ignoreNonKeyboardFocus:d}),(e,t)=>(P(),s(B($l),null,{default:U(()=>[R(e.$slots,`default`,{open:B(f)})]),_:3}))}}),Ix=p({__name:`TooltipTrigger`,props:{asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,n=Nx(),r=Ax();n.contentId||=Z(void 0,`radix-vue-tooltip-content`);let{forwardRef:i,currentElement:o}=X(),c=L(!1),l=L(!1),u=a(()=>n.disabled.value?{}:{click:v,focus:g,pointermove:m,pointerleave:h,pointerdown:p,blur:_});A(()=>{n.onTriggerChange(o.value)});function f(){setTimeout(()=>{c.value=!1},1)}function p(){c.value=!0,document.addEventListener(`pointerup`,f,{once:!0})}function m(e){e.pointerType!==`touch`&&!l.value&&!r.isPointerInTransitRef.value&&(n.onTriggerEnter(),l.value=!0)}function h(){n.onTriggerLeave(),l.value=!1}function g(e){var t,r;c.value||n.ignoreNonKeyboardFocus.value&&!((r=(t=e.target).matches)!=null&&r.call(t,`:focus-visible`))||n.onOpen()}function _(){n.onClose()}function v(){n.disableClosingTrigger.value||n.onClose()}return(e,r)=>(P(),s(B(eu),{"as-child":``},{default:U(()=>[d(B(Q),C({ref:B(i),"aria-describedby":B(n).open.value?B(n).contentId:void 0,"data-state":B(n).stateAttribute.value,as:e.as,"as-child":t.asChild,"data-grace-area-trigger":``},se(u.value)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3}))}}),Lx=p({__name:`TooltipContentImpl`,props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:`top`},sideOffset:{default:0},align:{default:`center`},alignOffset:{},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},sticky:{default:`partial`},hideWhenDetached:{type:Boolean,default:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(t,{emit:n}){let r=t,i=n,o=Nx(),{forwardRef:c}=X(),l=fe(),f=a(()=>{var e;return(e=l.default)?.call(l)}),p=a(()=>{var t;if(r.ariaLabel)return r.ariaLabel;let n=``;function i(t){typeof t.children==`string`&&t.type!==e?n+=t.children:Array.isArray(t.children)&&t.children.forEach(e=>i(e))}return(t=f.value)==null||t.forEach(e=>i(e)),n}),m=a(()=>{let{ariaLabel:e,...t}=r;return t});return A(()=>{Eo(window,`scroll`,e=>{let t=e.target;t!=null&&t.contains(o.trigger.value)&&o.onClose()}),Eo(window,kx,o.onClose)}),(e,t)=>(P(),s(B(xc),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>i(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{var t;B(o).disableClosingTrigger.value&&(t=B(o).trigger.value)!=null&&t.contains(e.target)&&e.preventDefault(),i(`pointerDownOutside`,e)},onFocusOutside:t[2]||=G(()=>{},[`prevent`]),onDismiss:t[3]||=e=>B(o).onClose()},{default:U(()=>[d(B(su),C({ref:B(c),"data-state":B(o).stateAttribute.value},{...e.$attrs,...m.value},{style:{"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`}}),{default:U(()=>[R(e.$slots,`default`),d(B(fu),{id:B(o).contentId,role:`tooltip`},{default:U(()=>[u(ae(p.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),Rx=p({__name:`TooltipContentHoverable`,props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},setup(e){let t=fs(e),{forwardRef:n,currentElement:r}=X(),{trigger:i,onClose:a}=Nx(),o=Ax(),{isPointerInTransit:c,onPointerExit:l}=ms(i,r);return o.isPointerInTransitRef=c,l(()=>{a()}),(e,r)=>(P(),s(Lx,C({ref:B(n)},B(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),zx=p({__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:`top`},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Nx(),a=ps(n,r),{forwardRef:o}=X();return(e,t)=>(P(),s(B(Js),{present:e.forceMount||B(i).open.value},{default:U(()=>[(P(),s(ne(B(i).disableHoverableContent.value?Lx:Rx),C({ref:B(o)},B(a)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Bx=p({__name:`TooltipArrow`,props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:`svg`}},setup(e){let t=e;return X(),(e,n)=>(P(),s(B(du),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}}),Vx=p({__name:`TooltipPortal`,props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){let t=e;return(e,n)=>(P(),s(B(pc),T(_(t)),{default:U(()=>[R(e.$slots,`default`)]),_:3},16))}});function Hx(e){return e.reduce((e,t)=>(e.push(t),t.children&&e.push(...Hx(t.children)),e),[])}const[Ux,Wx]=K(`TreeRoot`),Gx=p({__name:`TreeRoot`,props:{modelValue:{},defaultValue:{},items:{},expanded:{},defaultExpanded:{},getKey:{},getChildren:{type:Function,default:e=>e.children},selectionBehavior:{default:`toggle`},multiple:{type:Boolean},dir:{},disabled:{type:Boolean},propagateSelect:{type:Boolean},asChild:{type:Boolean},as:{default:`ul`}},emits:[`update:modelValue`,`update:expanded`],setup(e,{emit:t}){let n=e,r=t,{items:i,multiple:o,disabled:c,propagateSelect:l,dir:u}=z(n),{handleTypeaheadSearch:f}=Is(),p=Y(u),m=L(),h=L(!1),g=$a(),_=q(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),v=q(n,`expanded`,r,{defaultValue:n.defaultExpanded??[],passive:n.expanded===void 0,deep:!0}),{onSelectItem:y,handleMultipleReplace:b}=Ms(_,n),x=a(()=>o.value&&Array.isArray(_.value)?_.value.map(e=>n.getKey(e)):[n.getKey(_.value??{})]);function S(e,t=1,r){return e.reduce((i,a,o)=>{let s=n.getKey(a),c=n.getChildren(a),l=v.value.includes(s),u={_id:s,value:a,index:o,level:t,parentItem:r,hasChildren:!!c,bind:{value:a,level:t,"aria-setsize":e.length,"aria-posinset":o+1}};return i.push(u),c&&l&&i.push(...S(c,t+1,a)),i},[])}let C=a(()=>{let e=n.items;return v.value.map(e=>e),S(e??[])});function T(e){var t;if(h.value)g.trigger(e);else{let n=(t=m.value)?.getItems().map(e=>e.ref);f(e.key,n)}}function E(e){if(h.value)return;let t=id[e.key];w(()=>{var e;b(t,J(),(e=m.value)?.getItems,C.value.map(e=>e.value))})}return Wx({modelValue:_,selectedKeys:x,onSelect:e=>{var t;let r=t=>n.getKey(t??{})===n.getKey(e),i=n.multiple&&Array.isArray(_.value)?(t=_.value)?.findIndex(r)!==-1:void 0;if(y(e,r),n.propagateSelect&&n.multiple&&Array.isArray(_.value)){let t=Hx(n.getChildren(e)??[]);i?_.value=[..._.value].filter(e=>!t.some(t=>n.getKey(e??{})===n.getKey(t))):_.value=[..._.value,...t]}},expanded:v,onToggle(e){if(!(e&&n.getChildren(e)))return;let t=n.getKey(e)??e;v.value.includes(t)?v.value=v.value.filter(e=>e!==t):v.value.push(t)},getKey:n.getKey,getChildren:n.getChildren,items:i,expandedItems:C,disabled:c,multiple:o,dir:p,propagateSelect:l,isVirtual:h,virtualKeydownHook:g,handleMultipleReplace:b}),(e,t)=>(P(),s(B(dd),{ref_key:`rovingFocusGroupRef`,ref:m,"as-child":``,orientation:`vertical`,dir:B(p)},{default:U(()=>[d(B(Q),{role:`tree`,as:e.as,"as-child":e.asChild,"aria-multiselectable":B(o)?!0:void 0,onKeydown:[T,W(G(E,[`shift`]),[`up`,`down`])]},{default:U(()=>[R(e.$slots,`default`,{flattenItems:C.value,modelValue:B(_),expanded:B(v)})]),_:3},8,[`as`,`as-child`,`aria-multiselectable`,`onKeydown`])]),_:3},8,[`dir`]))}}),Kx=`tree.select`,qx=`tree.toggle`,Jx=p({inheritAttrs:!1,__name:`TreeItem`,props:{value:{},level:{},asChild:{type:Boolean},as:{default:`li`}},emits:[`select`,`toggle`],setup(e,{expose:t,emit:n}){let r=e,i=n,o=Ux(),{getItems:c}=bu(),l=a(()=>!!o.getChildren(r.value)),u=a(()=>{let e=o.getKey(r.value);return o.expanded.value.includes(e)}),f=a(()=>{let e=o.getKey(r.value);return o.selectedKeys.value.includes(e)}),p=a(()=>{if(o.propagateSelect.value&&f.value&&l.value&&Array.isArray(o.modelValue.value))return!Hx(o.getChildren(r.value)||[]).every(e=>o.modelValue.value.find(t=>o.getKey(t)===o.getKey(e)))});function m(e){if(l.value)if(u.value){let e=c().map(e=>e.ref),t=J(),n=e.indexOf(t),i=[...e].slice(n).find(e=>Number(e.getAttribute(`data-indent`))===r.level+1);i&&i.focus()}else y(e)}function h(e){if(u.value)y(e);else{let e=c().map(e=>e.ref),t=J(),n=e.indexOf(t),i=[...e].slice(0,n).reverse().find(e=>Number(e.getAttribute(`data-indent`))===r.level-1);i&&i.focus()}}async function g(e){i(`select`,e),!(e!=null&&e.defaultPrevented)&&o.onSelect(r.value)}async function _(e){i(`toggle`,e),!(e!=null&&e.defaultPrevented)&&o.onToggle(r.value)}async function v(e){if(!e)return;let t={originalEvent:e,value:r.value,isExpanded:u.value,isSelected:f.value};xa(Kx,g,t)}async function y(e){if(!e)return;let t={originalEvent:e,value:r.value,isExpanded:u.value,isSelected:f.value};xa(qx,_,t)}return t({isExpanded:u,isSelected:f,isIndeterminate:p,handleToggle:()=>o.onToggle(r.value),handleSelect:()=>o.onSelect(r.value)}),(e,t)=>(P(),s(B(fd),{"as-child":``,value:e.value,"allow-shift-key":``},{default:U(()=>[d(B(Q),C(e.$attrs,{role:`treeitem`,as:e.as,"as-child":e.asChild,"aria-selected":f.value,"aria-expanded":l.value?u.value:void 0,"aria-level":e.level,"data-indent":e.level,"data-selected":f.value?``:void 0,"data-expanded":u.value?``:void 0,onKeydown:[W(G(v,[`self`,`prevent`]),[`enter`,`space`]),t[0]||=W(G(e=>B(o).dir.value===`ltr`?m(e):h(e),[`prevent`]),[`right`]),t[1]||=W(G(e=>B(o).dir.value===`ltr`?h(e):m(e),[`prevent`]),[`left`])],onClick:t[2]||=G(e=>{v(e),y(e)},[`stop`])}),{default:U(()=>[R(e.$slots,`default`,{isExpanded:u.value,isSelected:f.value,isIndeterminate:p.value,handleSelect:()=>B(o).onSelect(e.value),handleToggle:()=>B(o).onToggle(e.value)})]),_:3},16,[`as`,`as-child`,`aria-selected`,`aria-expanded`,`aria-level`,`data-indent`,`data-selected`,`data-expanded`,`onKeydown`])]),_:3},8,[`value`]))}}),Yx=p({__name:`TreeVirtualizer`,props:{estimateSize:{},textContent:{type:Function}},setup(e){let n=e,r=fe(),o=Ux(),c=Ro(),{getItems:u}=bu(),d=_o(``,1e3),f=a(()=>{let e=e=>n.textContent?n.textContent(e):e.toString().toLowerCase();return o.expandedItems.value.map((t,n)=>({index:n,textContent:e(t.value)}))});o.isVirtual.value=!0;let p=a(()=>{let e=c.value;if(e){let t=window.getComputedStyle(e);return{start:Number.parseFloat(t.paddingBlockStart||t.paddingTop),end:Number.parseFloat(t.paddingBlockEnd||t.paddingBottom)}}else return{start:0,end:0}}),m=Pm({get scrollPaddingStart(){return p.value.start},get scrollPaddingEnd(){return p.value.end},get count(){return o.expandedItems.value.length??0},get horizontal(){return!1},getItemKey(e){return e+o.getKey(o.expandedItems.value[e].value)},estimateSize(){return n.estimateSize??28},getScrollElement(){return c.value},overscan:12}),h=a(()=>m.value.getVirtualItems().map(e=>({item:e,is:i(r.default({item:o.expandedItems.value[e.index],virtualizer:m.value,virtualItem:e})[0],{"data-index":e.index,style:{position:`absolute`,top:0,left:0,transform:`translateY(${e.start}px)`,overflowAnchor:`none`}})})));function g(e){m.value.scrollToIndex(e,{align:`start`}),requestAnimationFrame(()=>{let t=c.value.querySelector(`[data-index="${e}"]`);t instanceof HTMLElement&&t.focus()})}return o.virtualKeydownHook.on(e=>{var t;let n=e.altKey||e.ctrlKey||e.metaKey;if(e.key===`Tab`&&!n)return;let r=id[e.key];if([`first`,`last`].includes(r)){e.preventDefault();let t=r===`first`?0:o.expandedItems.value.length-1;m.value.scrollToIndex(t),requestAnimationFrame(()=>{let e=u();(r===`first`?e[0]:e[e.length-1]).ref.focus()})}else if(r===`prev`&&e.key!==`ArrowUp`){let e=J(),t=Number(e.getAttribute(`data-index`)),n=Number(e.getAttribute(`data-indent`)),r=o.expandedItems.value.slice(0,t).map((e,t)=>({...e,index:t})).reverse().find(e=>e.level===n-1);r&&g(r.index)}else if(!r&&!n){d.value+=e.key;let n=Number((t=J())?.getAttribute(`data-index`)),r=f.value[n].textContent,i=f.value.map(e=>e.textContent),a=Rs(i,d.value,r),o=f.value.find(e=>e.textContent===a);o&&g(o.index)}w(()=>{e.shiftKey&&r&&o.handleMultipleReplace(r,J(),u,o.expandedItems.value.map(e=>e.value))})}),(e,n)=>(P(),l(`div`,{"data-radix-vue-virtualizer":``,style:E({position:`relative`,width:`100%`,height:`${B(m).getTotalSize()}px`})},[(P(!0),l(t,null,te(h.value,({is:e,item:t})=>(P(),s(ne(e),{key:t.key}))),128))],4))}}),Xx=p({__name:`Viewport`,props:{nonce:{},asChild:{type:Boolean},as:{}},setup(e){let n=e,{forwardRef:r}=X(),{nonce:i}=z(n),a=Lu(i);return(e,i)=>(P(),l(t,null,[d(B(Q),C({...e.$attrs,...n},{ref:B(r),"data-radix-viewport":``,role:`presentation`,style:{position:`relative`,flex:1,overflow:`auto`}}),{default:U(()=>[R(e.$slots,`default`)]),_:3},16),d(B(Q),{as:`style`,nonce:B(a)},{default:U(()=>[u(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-radix-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-radix-viewport]::-webkit-scrollbar { display: none; } `)]),_:1},8,[`nonce`])],64))}});export{rl as $u,ll as Av,al as Bu,gl as Fv,Bx as Gg,Mx as Hg,mc as Iv,ml as Mv,_l as Nv,fl as Ov,tl as Pu,sl as Tv,zx as Ug,hl as Vv,Fx as Wg,Ix as jg,pl as kv,dc as nu,Vx as qg}; \ No newline at end of file diff --git a/assets/duckdb-mvp-C3i5IjU8.js b/assets/duckdb-mvp-C3i5IjU8.js new file mode 100644 index 0000000000000000000000000000000000000000..149c3b85e53fd0f3fe3ea5162a6a26d8e815eaea --- /dev/null +++ b/assets/duckdb-mvp-C3i5IjU8.js @@ -0,0 +1 @@ +var e=`/assets/duckdb-eh-BJOC5S4x.wasm`,t=`/assets/duckdb-mvp-8HYqhb4i.wasm`;export{e as duckdb_eh_default,t as duckdb_mvp_default}; \ No newline at end of file diff --git a/assets/duckdb-mvp-CaaD-olE.js b/assets/duckdb-mvp-CaaD-olE.js deleted file mode 100644 index 2769d2ff309bb34373ba55a83b79eefc5a4e435b..0000000000000000000000000000000000000000 --- a/assets/duckdb-mvp-CaaD-olE.js +++ /dev/null @@ -1 +0,0 @@ -const s="/assets/duckdb-eh-BJOC5S4x.wasm",a="/assets/duckdb-mvp-8HYqhb4i.wasm";export{s as e,a as m}; diff --git a/assets/effect-WSjEuzC9-BECQ6RtH.js b/assets/effect-WSjEuzC9-BECQ6RtH.js new file mode 100644 index 0000000000000000000000000000000000000000..d3503f6b0f878bc038f280bd8964f7217b69d1f1 --- /dev/null +++ b/assets/effect-WSjEuzC9-BECQ6RtH.js @@ -0,0 +1 @@ +import{__vitePreload as e}from"./index-BtAisBe9.js";import{tryImport as t}from"./index-CISmcbXk-s07e23Qe.js";const n=async()=>{let{JSONSchema:n}=await t(e(()=>import(`./__vite-optional-peer-dep_effect_xsschema-DJmQZR04.js`),[]),`effect`);return e=>n.make(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/effect-WSjEuzC9-BvZw3OJz.js b/assets/effect-WSjEuzC9-BvZw3OJz.js deleted file mode 100644 index a29ca38ac57a5c8d6ffa93a228fedd3aa75eb39c..0000000000000000000000000000000000000000 --- a/assets/effect-WSjEuzC9-BvZw3OJz.js +++ /dev/null @@ -1 +0,0 @@ -import{cT as r}from"./index-D7HCX4VR.js";import{t as e}from"./mcp-DgU0tpf-.js";const c=async()=>{const{JSONSchema:t}=await e(r(()=>import("./__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js"),[]),"effect");return o=>t.make(o)};export{c as getToJsonSchemaFn}; diff --git a/assets/elevenlabs-BU89BpOX.js b/assets/elevenlabs-BU89BpOX.js new file mode 100644 index 0000000000000000000000000000000000000000..8986c47a22cbb4c903fe9e037d52a8478f0bb789 --- /dev/null +++ b/assets/elevenlabs-BU89BpOX.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import{FieldCheckbox_default as h,FieldRange_default as g}from"./src-bHDRqBSs.js";import{SpeechPlayground_default as _,SpeechProviderSettings_default as v}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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/elevenlabs-L8B8Z16V.js b/assets/elevenlabs-L8B8Z16V.js deleted file mode 100644 index 3317be82d76b8f3dda37fd81a3c246dcf1e257ed..0000000000000000000000000000000000000000 --- a/assets/elevenlabs-L8B8Z16V.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as p,a as h}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as F,e as n,a0 as I,$ as T,f as x,T as E,w as a,bf as K,o as L,bg as k,b as d,u as o,a as N}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{u as G}from"./speech-D8cCufg2.js";import{_ as H,a as R}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-Cn-PwtFl.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";const j={flex:"~ col gap-4"},t="elevenlabs",_="eleven_multilingual_v2",q=F({__name:"elevenlabs",setup(A){const V={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},v=n(0),m=n(1),u=n(0),f=n(0),c=n(.5),g=n(.75),b=n(!1),y=G(),l=z(),{providers:C}=I(l),{t:r}=T(),B=x(()=>{var e;return!!((e=C.value[t])!=null&&e.apiKey)}),M=x(()=>y.availableVoices[t]||[]);async function U(e,i,s){const P=l.getProviderInstance(t);if(!P)throw new Error("Failed to initialize speech provider");const S=l.getProviderConfig(t),$=S.model||_;return await y.speech(P,$,e,i,{...S,...V})}return E(async()=>{const e=l.getProviderConfig(t);await l.getProviderMetadata(t).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(t):console.error("Failed to validate provider config",e)}),a(v,async()=>{const e=l.getProviderConfig(t);e.pitch=v.value}),a(m,async()=>{const e=l.getProviderConfig(t);e.speed=m.value}),a(u,async()=>{const e=l.getProviderConfig(t);e.volume=u.value}),a(f,async()=>{const e=l.getProviderConfig(t);e.style=f.value}),a(c,async()=>{const e=l.getProviderConfig(t);e.stability=c.value}),a(g,async()=>{const e=l.getProviderConfig(t);e.similarityBoost=g.value}),a(b,async()=>{const e=l.getProviderConfig(t);e.useSpeakerBoost=b.value}),a(C,async()=>{const e=l.getProviderConfig(t);await l.getProviderMetadata(t).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(t):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(L(),K(o(R),{"provider-id":t,"default-model":_,"additional-settings":V},{"voice-settings":k(()=>[N("div",j,[d(o(p),{modelValue:v.value,"onUpdate:modelValue":i[0]||(i[0]=s=>v.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=s=>m.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:u.value,"onUpdate:modelValue":i[2]||(i[2]=s=>u.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:f.value,"onUpdate:modelValue":i[3]||(i[3]=s=>f.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:c.value,"onUpdate:modelValue":i[4]||(i[4]=s=>c.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:g.value,"onUpdate:modelValue":i[5]||(i[5]=s=>g.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(h),{modelValue:b.value,"onUpdate:modelValue":i[6]||(i[6]=s=>b.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])])]),playground:k(()=>[d(o(H),{"available-voices":M.value,"generate-speech":U,"api-key-configured":B.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof w=="function"&&w(q);export{q as default}; diff --git a/assets/emotions-CgTIAVzL.js b/assets/emotions-CgTIAVzL.js deleted file mode 100644 index ea6223ec5e1af76c7421fa2c80a0c6dbb8f4d0ed..0000000000000000000000000000000000000000 --- a/assets/emotions-CgTIAVzL.js +++ /dev/null @@ -1 +0,0 @@ -import{u as _}from"./queue-31IhYt_K.js";import{a as k,l as b}from"./queues-CIntookp.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{_ as x}from"./Textarea.vue_vue_type_script_setup_true_lang-l_0OEYvy.js";import{d as h,e as u,c as s,o as t,a as e,b as w,u as M,Y as d,c3 as f,c4 as p}from"./index-D7HCX4VR.js";import"./emotions-DWNSb738.js";import"./Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js";const V={flex:"","flex-col":"","gap-2":"","p-2":""},y={flex:"","flex-row":"","gap-2":""},E={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},Q={"w-full":"",flex:"","flex-row":"","gap-4":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},B={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},U=h({__name:"emotions",setup(P){const l=u(""),c=u([]),i=u([]),r=u(!1),g=_({handlers:[async a=>{i.value.push(a.data)}]}),m=k(g);function v(){r.value=!0;const a=l.value.split("");for(const o of a)m.add(o);m.add(b),l.value="",r.value=!1}return(a,o)=>(t(),s("div",V,[e("div",y,[w(M(x),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",E,d(r.value?"Processing...":"Send"),1)]),e("div",Q,[e("div",S,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(f,null,p(c.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))]),e("div",B,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(f,null,p(i.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))])])]))}});export{U as default}; diff --git a/assets/emotions-DWNSb738.js b/assets/emotions-DWNSb738.js deleted file mode 100644 index 9d809be491b9aefd082ec7efb557479304d34059..0000000000000000000000000000000000000000 --- a/assets/emotions-DWNSb738.js +++ /dev/null @@ -1 +0,0 @@ -var o=(E=>(E.Idle="<|EMOTE_NEUTRAL|>",E.Happy="<|EMOTE_HAPPY|>",E.Sad="<|EMOTE_SAD|>",E.Angry="<|EMOTE_ANGRY|>",E.Think="<|EMOTE_THINK|>",E.Surprise="<|EMOTE_SURPRISE|>",E.Awkward="<|EMOTE_AWKWARD|>",E.Question="<|EMOTE_QUESTION|>",E))(o||{});const e=Object.values(o),T="Happy",M="Sad",a="Angry",n="Awkward",O="Think",s="Surprise",t="Question",_="Idle",i={"<|EMOTE_HAPPY|>":T,"<|EMOTE_SAD|>":M,"<|EMOTE_ANGRY|>":a,"<|EMOTE_THINK|>":O,"<|EMOTE_SURPRISE|>":s,"<|EMOTE_AWKWARD|>":n,"<|EMOTE_QUESTION|>":t,"<|EMOTE_NEUTRAL|>":_},N={"<|EMOTE_HAPPY|>":"happy","<|EMOTE_SAD|>":"sad","<|EMOTE_ANGRY|>":"angry","<|EMOTE_THINK|>":void 0,"<|EMOTE_SURPRISE|>":"surprised","<|EMOTE_AWKWARD|>":void 0,"<|EMOTE_QUESTION|>":void 0,"<|EMOTE_NEUTRAL|>":void 0};export{O as E,N as a,i as b,e as c,o as d,_ as e}; diff --git a/assets/emotions-ctaIpmZy.js b/assets/emotions-ctaIpmZy.js new file mode 100644 index 0000000000000000000000000000000000000000..1f4863b6a2b12385f824252262cb5b8ee357d4a0 --- /dev/null +++ b/assets/emotions-ctaIpmZy.js @@ -0,0 +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-BtAisBe9.js";import"./src-bHDRqBSs.js";import"./Basic-BA5ubWIJ.js";import{Textarea_default as u}from"./Textarea-C0dnrt_L.js";import{useQueue as d}from"./queue-BZUURX31.js";import{llmInferenceEndToken as f,useEmotionsMessageQueue as p}from"./queues-U6a2FwNq.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/esm-BZ0D1sPT.js b/assets/esm-BZ0D1sPT.js new file mode 100644 index 0000000000000000000000000000000000000000..46920243f49760a1fb5dc968a68d038efe2cd792 --- /dev/null +++ b/assets/esm-BZ0D1sPT.js @@ -0,0 +1,3 @@ +import{ZodFirstPartyTypeKind as e,ZodOptional as t}from"./types-D50Xq0so.js";const n=Symbol(`Let zodToJsonSchema decide on which parser to use`),r={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,target:`jsonSchema7`,strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`},i=e=>typeof e==`string`?{...r,name:e}:{...r,...e},a=e=>{let t=i(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};function o(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function s(e,t,n,r,i){e[t]=n,o(e,t,r,i)}function c(){return{}}function l(t,n){var r,i;let a={type:`array`};return(r=t.type)?._def&&((i=t.type)==null||(i=i._def)==null?void 0:i.typeName)!==e.ZodAny&&(a.items=Q(t.type._def,{...n,currentPath:[...n.currentPath,`items`]})),t.minLength&&s(a,`minItems`,t.minLength.value,t.minLength.message,n),t.maxLength&&s(a,`maxItems`,t.maxLength.value,t.maxLength.message,n),t.exactLength&&(s(a,`minItems`,t.exactLength.value,t.exactLength.message,n),s(a,`maxItems`,t.exactLength.value,t.exactLength.message,n)),a}function u(e,t){let n={type:`integer`,format:`int64`};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case`min`:t.target===`jsonSchema7`?r.inclusive?s(n,`minimum`,r.value,r.message,t):s(n,`exclusiveMinimum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),s(n,`minimum`,r.value,r.message,t));break;case`max`:t.target===`jsonSchema7`?r.inclusive?s(n,`maximum`,r.value,r.message,t):s(n,`exclusiveMaximum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),s(n,`maximum`,r.value,r.message,t));break;case`multipleOf`:s(n,`multipleOf`,r.value,r.message,t);break}return n}function d(){return{type:`boolean`}}function f(e,t){return Q(e.type._def,t)}const p=(e,t)=>Q(e.innerType._def,t);function m(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>m(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return h(e,t)}}const h=(e,t)=>{let n={type:`integer`,format:`unix-time`};if(t.target===`openApi3`)return n;for(let r of e.checks)switch(r.kind){case`min`:s(n,`minimum`,r.value,r.message,t);break;case`max`:s(n,`maximum`,r.value,r.message,t);break}return n};function g(e,t){return{...Q(e.innerType._def,t),default:e.defaultValue()}}function _(e,t){return t.effectStrategy===`input`?Q(e.schema._def,t):{}}function v(e){return{type:`string`,enum:Array.from(e.values)}}const y=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function b(e,t){let n=[Q(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),Q(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=t.target===`jsonSchema2019-09`?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(e=>{if(y(e))i.push(...e.allOf),e.unevaluatedProperties===void 0&&(r=void 0);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}else r=void 0;i.push(t)}}),i.length?{allOf:i,...r}:void 0}function x(e,t){let n=typeof e.value;return n!==`bigint`&&n!==`number`&&n!==`boolean`&&n!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:t.target===`openApi3`?{type:n===`bigint`?`integer`:n,enum:[e.value]}:{type:n===`bigint`?`integer`:n,const:e.value}}let S;const C={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(S===void 0&&(S=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),S),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function w(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:s(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t);break;case`max`:s(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`email`:switch(t.emailStrategy){case`format:email`:O(n,`email`,r.message,t);break;case`format:idn-email`:O(n,`idn-email`,r.message,t);break;case`pattern:zod`:k(n,C.email,r.message,t);break}break;case`url`:O(n,`uri`,r.message,t);break;case`uuid`:O(n,`uuid`,r.message,t);break;case`regex`:k(n,r.regex,r.message,t);break;case`cuid`:k(n,C.cuid,r.message,t);break;case`cuid2`:k(n,C.cuid2,r.message,t);break;case`startsWith`:k(n,RegExp(`^${T(r.value,t)}`),r.message,t);break;case`endsWith`:k(n,RegExp(`${T(r.value,t)}$`),r.message,t);break;case`datetime`:O(n,`date-time`,r.message,t);break;case`date`:O(n,`date`,r.message,t);break;case`time`:O(n,`time`,r.message,t);break;case`duration`:O(n,`duration`,r.message,t);break;case`length`:s(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t),s(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`includes`:k(n,RegExp(T(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&O(n,`ipv4`,r.message,t),r.version!==`v4`&&O(n,`ipv6`,r.message,t);break;case`base64url`:k(n,C.base64url,r.message,t);break;case`jwt`:k(n,C.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&k(n,C.ipv4Cidr,r.message,t),r.version!==`v4`&&k(n,C.ipv6Cidr,r.message,t);break;case`emoji`:k(n,C.emoji(),r.message,t);break;case`ulid`:k(n,C.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:O(n,`binary`,r.message,t);break;case`contentEncoding:base64`:s(n,`contentEncoding`,`base64`,r.message,t);break;case`pattern:zod`:k(n,C.base64,r.message,t);break}break;case`nanoid`:k(n,C.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:(e=>{})(r)}return n}function T(e,t){return t.patternStrategy===`escape`?D(e):e}const E=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function D(e){let t=``;for(let n=0;ne.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):s(e,`format`,t,n,r)}function k(e,t,n,r){var i;e.pattern||(i=e.allOf)?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:A(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):s(e,`pattern`,A(t,r),n,r)}function A(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e({...e,[r]:Q(t.valueType._def,{...n,currentPath:[...n.currentPath,`properties`,r]})??{}}),{}),additionalProperties:n.rejectedAdditionalProperties};let l={type:`object`,additionalProperties:Q(t.valueType._def,{...n,currentPath:[...n.currentPath,`additionalProperties`]})??n.allowedAdditionalProperties};if(n.target===`openApi3`)return l;if((i=t.keyType)?._def.typeName===e.ZodString&&(a=t.keyType._def.checks)?.length){let{type:e,...r}=w(t.keyType._def,n);return{...l,propertyNames:r}}else if((o=t.keyType)?._def.typeName===e.ZodEnum)return{...l,propertyNames:{enum:t.keyType._def.values}};else if((s=t.keyType)?._def.typeName===e.ZodBranded&&t.keyType._def.type._def.typeName===e.ZodString&&(c=t.keyType._def.type._def.checks)?.length){let{type:e,...r}=f(t.keyType._def,n);return{...l,propertyNames:r}}return l}function M(e,t){if(t.mapStrategy===`record`)return j(e,t);let n=Q(e.keyType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`0`]})||{},r=Q(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`1`]})||{};return{type:`array`,maxItems:125,items:{type:`array`,items:[n,r],minItems:2,maxItems:2}}}function N(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`),r=n.map(e=>t[e]),i=Array.from(new Set(r.map(e=>typeof e)));return{type:i.length===1?i[0]===`string`?`string`:`number`:[`string`,`number`],enum:r}}function P(){return{not:{}}}function F(e){return e.target===`openApi3`?{enum:[`null`],nullable:!0}:{type:`null`}}const I={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function L(e,t){if(t.target===`openApi3`)return R(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in I&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=I[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}else if(n.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];case`symbol`:case`undefined`:case`function`:default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return R(e,t)}const R=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>Q(e._def,{...t,currentPath:[...t.currentPath,`anyOf`,`${n}`]})).filter(e=>!!e&&(!t.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function z(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target===`openApi3`?{type:I[e.innerType._def.typeName],nullable:!0}:{type:[I[e.innerType._def.typeName],`null`]};if(t.target===`openApi3`){let n=Q(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&`$ref`in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let n=Q(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`0`]});return n&&{anyOf:[n,{type:`null`}]}}function ee(e,t){let n={type:`number`};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case`int`:n.type=`integer`,o(n,`type`,r.message,t);break;case`min`:t.target===`jsonSchema7`?r.inclusive?s(n,`minimum`,r.value,r.message,t):s(n,`exclusiveMinimum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),s(n,`minimum`,r.value,r.message,t));break;case`max`:t.target===`jsonSchema7`?r.inclusive?s(n,`maximum`,r.value,r.message,t):s(n,`exclusiveMaximum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),s(n,`maximum`,r.value,r.message,t));break;case`multipleOf`:s(n,`multipleOf`,r.value,r.message,t);break}return n}function B(e,n){let r=n.target===`openAi`,i={type:`object`,properties:{}},a=[],o=e.shape();for(let e in o){let s=o[e];if(s===void 0||s._def===void 0)continue;let c=H(s);c&&r&&(s instanceof t&&(s=s._def.innerType),s.isNullable()||(s=s.nullable()),c=!1);let l=Q(s._def,{...n,currentPath:[...n.currentPath,`properties`,e],propertyPath:[...n.currentPath,`properties`,e]});if(l===void 0)continue;i.properties[e]=l,c||a.push(e)}a.length&&(i.required=a);let s=V(e,n);return s!==void 0&&(i.additionalProperties=s),i}function V(e,t){if(e.catchall._def.typeName!==`ZodNever`)return Q(e.catchall._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]});switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function H(e){try{return e.isOptional()}catch{return!0}}const U=(e,t)=>{var n;if(t.currentPath.toString()===(n=t.propertyPath)?.toString())return Q(e.innerType._def,t);let r=Q(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`1`]});return r?{anyOf:[{not:{}},r]}:{}},W=(e,t)=>{if(t.pipeStrategy===`input`)return Q(e.in._def,t);if(t.pipeStrategy===`output`)return Q(e.out._def,t);let n=Q(e.in._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),r=Q(e.out._def,{...t,currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]});return{allOf:[n,r].filter(e=>e!==void 0)}};function G(e,t){return Q(e.type._def,t)}function K(e,t){let n=Q(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`]}),r={type:`array`,uniqueItems:!0,items:n};return e.minSize&&s(r,`minItems`,e.minSize.value,e.minSize.message,t),e.maxSize&&s(r,`maxItems`,e.maxSize.value,e.maxSize.message,t),r}function q(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>Q(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:Q(e.rest._def,{...t,currentPath:[...t.currentPath,`additionalItems`]})}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>Q(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function J(){return{not:{}}}function Y(){return{}}const X=(e,t)=>Q(e.innerType._def,t),Z=(t,n,r)=>{switch(n){case e.ZodString:return w(t,r);case e.ZodNumber:return ee(t,r);case e.ZodObject:return B(t,r);case e.ZodBigInt:return u(t,r);case e.ZodBoolean:return d();case e.ZodDate:return m(t,r);case e.ZodUndefined:return J();case e.ZodNull:return F(r);case e.ZodArray:return l(t,r);case e.ZodUnion:case e.ZodDiscriminatedUnion:return L(t,r);case e.ZodIntersection:return b(t,r);case e.ZodTuple:return q(t,r);case e.ZodRecord:return j(t,r);case e.ZodLiteral:return x(t,r);case e.ZodEnum:return v(t);case e.ZodNativeEnum:return N(t);case e.ZodNullable:return z(t,r);case e.ZodOptional:return U(t,r);case e.ZodMap:return M(t,r);case e.ZodSet:return K(t,r);case e.ZodLazy:return()=>t.getter()._def;case e.ZodPromise:return G(t,r);case e.ZodNaN:case e.ZodNever:return P();case e.ZodEffects:return _(t,r);case e.ZodAny:return c();case e.ZodUnknown:return Y();case e.ZodDefault:return g(t,r);case e.ZodBranded:return f(t,r);case e.ZodReadonly:return X(t,r);case e.ZodCatch:return p(t,r);case e.ZodPipeline:return W(t,r);case e.ZodFunction:case e.ZodVoid:case e.ZodSymbol:return;default:return(e=>void 0)(n)}};function Q(e,t,r=!1){let i=t.seen.get(e);if(t.override){var a;let o=(a=t.override)?.call(t,e,t,i,r);if(o!==n)return o}if(i&&!r){let e=$(i,t);if(e!==void 0)return e}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let s=Z(e,e.typeName,t),c=typeof s==`function`?Q(s(),t):s;if(c&&ne(e,t,c),t.postProcess){let n=t.postProcess(c,e,t);return o.jsonSchema=c,n}return o.jsonSchema=c,c}const $=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:te(t.currentPath,e.path)};case`none`:case`seen`:return e.path.lengtht.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),{}):t.$refStrategy===`seen`?{}:void 0}},te=(e,t)=>{let n=0;for(;n(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),re=(e,t)=>{let n=a(t),r=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:Q(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??{}}),{}):void 0,i=typeof t==`string`?t:t?.nameStrategy===`title`?void 0:t?.name,o=Q(e._def,i===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,i]},!1)??{},s=typeof t==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;s!==void 0&&(o.title=s);let c=i===void 0?r?{...o,[n.definitionPath]:r}:o:{$ref:[...n.$refStrategy===`relative`?[]:n.basePath,n.definitionPath,i].join(`/`),[n.definitionPath]:{...r,[i]:o}};return n.target===`jsonSchema7`?c.$schema=`http://json-schema.org/draft-07/schema#`:(n.target===`jsonSchema2019-09`||n.target===`openAi`)&&(c.$schema=`https://json-schema.org/draft/2019-09/schema#`),n.target===`openAi`&&(`anyOf`in c||`oneOf`in c||`allOf`in c||`type`in c&&Array.isArray(c.type))&&console.warn(`Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.`),c};export{re as zodToJsonSchema}; \ No newline at end of file diff --git a/assets/featherless-ai-CDy5zWmD.js b/assets/featherless-ai-CDy5zWmD.js deleted file mode 100644 index a51fa9def78d76f7cc1d9c50a9edaf6feb7f50bb..0000000000000000000000000000000000000000 --- a/assets/featherless-ai-CDy5zWmD.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as U,$,V as h,a0 as k,f as v,T as y,w as K,bf as w,o as x,bg as m,b as l,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{_ as M}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as P}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as R}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const a="featherless-ai",C=U({__name:"featherless-ai",setup(I){const{t:u}=$(),b=h(),d=z(),{providers:o}=k(d),n=v(()=>d.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:m(()=>[l(t(S),null,{default:m(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(P),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/featherless-ai-CHBNNQNM.js b/assets/featherless-ai-CHBNNQNM.js new file mode 100644 index 0000000000000000000000000000000000000000..80ae1093180d3f3cf60780755ea5307841fc9984 --- /dev/null +++ b/assets/featherless-ai-CHBNNQNM.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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-BjGEk5iK.js b/assets/filter-message-BjGEk5iK.js new file mode 100644 index 0000000000000000000000000000000000000000..34ceac3ab81eb42ebbc6955d0ecad8130a6eb7e4 --- /dev/null +++ b/assets/filter-message-BjGEk5iK.js @@ -0,0 +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-BtAisBe9.js";import"./src-bHDRqBSs.js";import"./Basic-BA5ubWIJ.js";import{Textarea_default as c}from"./Textarea-C0dnrt_L.js";const l={flex:``,"flex-col":``,"gap-2":``,"p-2":``},u={flex:``,"flex-row":``,"gap-2":``},d={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},f={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var p=r({__name:`filter-message`,setup(r){let p=a(``),m=a(!1),h=a({content:``});async function g(e){return new Promise(t=>setTimeout(t,e))}async function _(){m.value=!0;let e=p.value.split(``),t=function(e){return e.Literal=`literal`,e.Special=`special`,e}({}),n=t.Literal,r=``;for(let i of e){await g(50);let e=n;i===`<`?e=t.Special:i===`>`&&(e=t.Literal),n===t.Literal&&e===t.Special&&(h.value.content+=r,r=``),n===t.Special&&e===t.Literal&&(r=``),n===t.Literal&&e===t.Literal&&(h.value.content+=i,r=``),n=e}r&&(h.value.content+=r),p.value=``,m.value=!1}return(r,a)=>(i(),t(`div`,l,[e(`div`,u,[n(s(c),{modelValue:p.value,"onUpdate:modelValue":a[0]||=e=>p.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:_},null,8,[`modelValue`]),e(`button`,d,o(m.value?`Processing...`:`Send`),1)]),e(`div`,f,[a[1]||=e(`h3`,{"font-semibold":``},` Streaming Message `,-1),e(`div`,null,o(h.value.content),1)])]))}}),m=p;export{m as default}; \ No newline at end of file diff --git a/assets/filter-message-CHaQD-n_.js b/assets/filter-message-CHaQD-n_.js deleted file mode 100644 index 27ca742ec9f088b8c0be2ec836289f45481c3c51..0000000000000000000000000000000000000000 --- a/assets/filter-message-CHaQD-n_.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{_ as m}from"./Textarea.vue_vue_type_script_setup_true_lang-l_0OEYvy.js";import{d as g,e as c,c as v,o as _,a as s,b,u as x,Y as d}from"./index-D7HCX4VR.js";import"./Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},k={flex:"","flex-row":"","gap-2":""},w={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},N=g({__name:"filter-message",setup(M){const o=c(""),u=c(!1),r=c({content:""});async function f(i){return new Promise(e=>setTimeout(e,i))}async function p(){u.value=!0;const i=o.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let t="literal",l="";for(const a of i){await f(50);let n=t;a==="<"?n="special":a===">"&&(n="literal"),t==="literal"&&n==="special"&&(r.value.content+=l,l=""),t==="special"&&n==="literal"&&(l=""),t==="literal"&&n==="literal"&&(r.value.content+=a,l=""),t=n}l&&(r.value.content+=l),o.value="",u.value=!1}return(i,e)=>(_(),v("div",S,[s("div",k,[b(x(m),{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),s("button",w,d(u.value?"Processing...":"Send"),1)]),s("div",V,[e[1]||(e[1]=s("h3",{"font-semibold":""}," Streaming Message ",-1)),s("div",null,d(r.value.content),1)])]))}});export{N as default}; diff --git a/assets/fireworks-ai-BeQmtYw-.js b/assets/fireworks-ai-BeQmtYw-.js new file mode 100644 index 0000000000000000000000000000000000000000..71e99227a675229355a2d54e0684f923188e8051 --- /dev/null +++ b/assets/fireworks-ai-BeQmtYw-.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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/fireworks-ai-C_DF5qcs.js b/assets/fireworks-ai-C_DF5qcs.js deleted file mode 100644 index afce70d42fa23d5c86e5131bd922c8d5741c7a8b..0000000000000000000000000000000000000000 --- a/assets/fireworks-ai-C_DF5qcs.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as V,$ as w,V as U,a0 as $,f as c,T as y,w as K,bf as h,o as x,bg as m,b as l,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{_ as M}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as P}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as R}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const a="fireworks-ai",C=V({__name:"fireworks-ai",setup(I){const{t:u}=w(),b=U(),d=z(),{providers:o}=$(d),n=c(()=>d.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),h(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:m(()=>[l(t(S),null,{default:m(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(P),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/general-Bv6Tg-7n.js b/assets/general-Bv6Tg-7n.js deleted file mode 100644 index ac5940f7400ad90b1aa08c038866ae2725f3f72d..0000000000000000000000000000000000000000 --- a/assets/general-Bv6Tg-7n.js +++ /dev/null @@ -1 +0,0 @@ -import{d as g,be as m,c7 as f,c2 as y,c as l,o as r,bh as t,b,u,bE as v,ci as _,Y as d,a as n,cc as h,c3 as x}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{_ as k}from"./CheckBar.vue_vue_type_script_setup_true_lang-By8B4nPO.js";import{b as p}from"./route-block-B_A1xBdJ.js";const V={class:"w-full flex items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out",bg:"neutral-50 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+3*10,delay:3*50,transition:"all ease-in-out duration-250"},D={value:"en-US"},N={value:"zh-CN"},S={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[65dvh]","right--15":"","z--1":"",initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:"","items-center":"","justify-center":""},$=g({__name:"general",setup(j){const c=m(),o=f();return(a,e)=>{const i=y("motion");return r(),l(x,null,[t(b(k,{modelValue:u(o),"onUpdate:modelValue":e[0]||(e[0]=s=>v(o)?o.value=s:null),"mb-2":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+2*10,delay:2*50,"icon-on":"i-solar:moon-stars-bold-duotone","icon-off":"i-solar:sun-fog-bold-duotone",text:"settings.theme",transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[i]]),t((r(),l("div",V,[_(d(a.$t("settings.language.title"))+" ",1),t(n("select",{"onUpdate:modelValue":e[1]||(e[1]=s=>u(c).language=s),transition:"all ease-in-out duration-250","cursor-pointer":"","bg-transparent":"","text-right":"","outline-none":""},[n("option",D,d(a.$t("settings.language.english")),1),n("option",N,d(a.$t("settings.language.chinese")),1)],512),[[h,u(c).language]])])),[[i]]),t((r(),l("div",S,e[2]||(e[2]=[n("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[i]])],64)}}});typeof p=="function"&&p($);export{$ as default}; diff --git a/assets/general-D5ryEaZ2.js b/assets/general-D5ryEaZ2.js new file mode 100644 index 0000000000000000000000000000000000000000..5bda42c5a62af35c4b58cf135be6c9692f4c2e66 --- /dev/null +++ b/assets/general-D5ryEaZ2.js @@ -0,0 +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-BtAisBe9.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as h}from"./route-block-DNPbw0zT.js";import{CheckBar_default as g}from"./CheckBar-B-SKUaUP.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-CH9TwHBd.js b/assets/google-generative-ai-CH9TwHBd.js deleted file mode 100644 index bdbf953d4849af103a307e68cb7cc64d9a8d2454..0000000000000000000000000000000000000000 --- a/assets/google-generative-ai-CH9TwHBd.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as U,$ as V,V as $,a0 as k,f as v,T as y,w as K,bf as I,o as G,bg as p,b as l,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as M}from"./providers-DepZj6_J.js";import{_ as N}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as w}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as x}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as P}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as f}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const e="google-generative-ai",z=U({__name:"google-generative-ai",setup(B){const{t:m}=V(),_=$(),c=M(),{providers:a}=k(c),u=v(()=>c.getProviderMetadata(e)),r=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),r.value=((o=a.value[e])==null?void 0:o.apiKey)||"",s.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"}),K([r,s],()=>{a.value[e]={...a.value[e],apiKey:r.value,baseUrl:s.value||"https://generativelanguage.googleapis.com/v1beta/openai/"}});function b(){a.value[e]={baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"}}return(o,i)=>{var d,g;return G(),I(t(S),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"Google | Gemini","provider-icon":(g=u.value)==null?void 0:g.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[l(t(P),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[l(t(w),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=h=>r.value=h),"provider-name":((n=u.value)==null?void 0:n.localizedName)||"Google",placeholder:"GEMINI_API_KEY"},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(N),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(x),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=n=>s.value=n),placeholder:"https://generativelanguage.googleapis.com/v1beta/openai/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof f=="function"&&f(z);export{z as default}; diff --git a/assets/google-generative-ai-vTI86k1V.js b/assets/google-generative-ai-vTI86k1V.js new file mode 100644 index 0000000000000000000000000000000000000000..dfaefa4c1f5f99129ffe94dba8a0c208faf01e67 --- /dev/null +++ b/assets/google-generative-ai-vTI86k1V.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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/image-D-LGEUbE.js b/assets/image-D-LGEUbE.js new file mode 100644 index 0000000000000000000000000000000000000000..1a30ce7a1ba2762840345b325f15492025eda4b0 --- /dev/null +++ b/assets/image-D-LGEUbE.js @@ -0,0 +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-BtAisBe9.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/image-orS7rPI7.js b/assets/image-orS7rPI7.js deleted file mode 100644 index 84a9ff121bb19236eabc72906ea994d59c9cb3e4..0000000000000000000000000000000000000000 --- a/assets/image-orS7rPI7.js +++ /dev/null @@ -1,2 +0,0 @@ -import{d as _,e as c,cb as y,c as d,o as u,a,W as x,Y as b,u as v,b_ as w}from"./index-D7HCX4VR.js";const h={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},C={key:0},U=["src"],R={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},k=_({__name:"image",setup(D){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(r){return new Promise((e,o)=>{const t=new FileReader;t.onload=s=>{var l,i;e(((i=(l=s.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=s=>{o(s)},t.readAsDataURL(r)})}async function f(r){var t;const o=(t=r.target.files)==null?void 0:t[0];if(o){p.value=o;const s=await m(o);n.value=s}}return(r,e)=>(u(),d("div",null,[a("label",h,[a("input",{type:"file",accept:"image/*",hidden:"",onChange:f},null,32),e[1]||(e[1]=a("span",null,"Upload Image",-1))]),n.value?(u(),d("div",C,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,U),a("pre",R," "+b(n.value)+` - `,1),a("button",{bg:"primary-500",text:"white","mt-4":"","rounded-lg":"","px-4":"","py-2":"",onClick:e[0]||(e[0]=()=>v(g)())}," Copy Data URL ")])):x("",!0)]))}}),B=w(k,[["__scopeId","data-v-7edd53e6"]]);export{B as default}; diff --git a/assets/import-url-browser-BvZvAmFy.js b/assets/import-url-browser-BvZvAmFy.js new file mode 100644 index 0000000000000000000000000000000000000000..5552e3370002a398651197d17d538c7d9d57f212 --- /dev/null +++ b/assets/import-url-browser-BvZvAmFy.js @@ -0,0 +1 @@ +import{duckdb_eh_default as e,duckdb_mvp_default as t}from"./duckdb-mvp-C3i5IjU8.js";var n=`/assets/duckdb-browser-eh.worker-B2xnDV1H.js`,r=`/assets/duckdb-browser-mvp.worker-DCs3_EjR.js`,i=`/assets/duckdb-coi-CSr8FQO4.wasm`,a=`/assets/duckdb-browser-coi.worker-Ji2I_m5s.js`,o=`/assets/duckdb-browser-coi.pthread.worker-WD1J30pV.js`;function s(){return{mvp:{mainModule:t,mainWorker:r},eh:{mainModule:e,mainWorker:n},coi:{mainModule:i,mainWorker:a,pthreadWorker:o}}}export{s as getImportUrlBundles}; \ No newline at end of file diff --git a/assets/import-url-browser-CPN8ipMD.js b/assets/import-url-browser-CPN8ipMD.js deleted file mode 100644 index 89744c23c3246c9de769976a49d1e0c615c9ecd7..0000000000000000000000000000000000000000 --- a/assets/import-url-browser-CPN8ipMD.js +++ /dev/null @@ -1 +0,0 @@ -import{e as r,m as e}from"./duckdb-mvp-CaaD-olE.js";const o="/assets/duckdb-browser-eh.worker-B2xnDV1H.js",s="/assets/duckdb-browser-mvp.worker-DCs3_EjR.js",a="/assets/duckdb-coi-CSr8FQO4.wasm",i="/assets/duckdb-browser-coi.worker-Ji2I_m5s.js",n="/assets/duckdb-browser-coi.pthread.worker-WD1J30pV.js";function t(){return{mvp:{mainModule:e,mainWorker:s},eh:{mainModule:r,mainWorker:o},coi:{mainModule:a,mainWorker:i,pthreadWorker:n}}}export{t as getImportUrlBundles}; diff --git a/assets/import-url-browser-QqZ6rd6v.js b/assets/import-url-browser-QqZ6rd6v.js new file mode 100644 index 0000000000000000000000000000000000000000..76fd71570f7ef2d2a28164294c25fc0f6d7d4ee5 --- /dev/null +++ b/assets/import-url-browser-QqZ6rd6v.js @@ -0,0 +1 @@ +import{getImportUrlBundles as e}from"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";export{e as getImportUrlBundles}; \ No newline at end of file diff --git a/assets/import-url-node-BfNoxhRr.js b/assets/import-url-node-BfNoxhRr.js deleted file mode 100644 index c1fb7c46e9e5e38480bda2bb6a32d3bbc1ca5339..0000000000000000000000000000000000000000 --- a/assets/import-url-node-BfNoxhRr.js +++ /dev/null @@ -1 +0,0 @@ -import{e as n,m as o}from"./duckdb-mvp-CaaD-olE.js";const s="/assets/duckdb-node-eh.worker-JckteRwc.cjs",t="/assets/duckdb-node-mvp.worker-GMEh9yNX.cjs";function e(r){return r.startsWith("/@fs/")?r.replace("/@fs/","file://"):r}async function i(){return{mvp:{mainModule:e(o),mainWorker:e(t)},eh:{mainModule:e(n),mainWorker:e(s)}}}export{i as getImportUrlBundles}; diff --git a/assets/import-url-node-DT7wRTjn.js b/assets/import-url-node-DT7wRTjn.js new file mode 100644 index 0000000000000000000000000000000000000000..6048b035e071d14acda91d62bb6b553e299f0490 --- /dev/null +++ b/assets/import-url-node-DT7wRTjn.js @@ -0,0 +1 @@ +import{duckdb_eh_default as e,duckdb_mvp_default as t}from"./duckdb-mvp-C3i5IjU8.js";var n=`/assets/duckdb-node-eh.worker-JckteRwc.cjs`,r=`/assets/duckdb-node-mvp.worker-GMEh9yNX.cjs`;function i(e){return e.startsWith(`/@fs/`)?e.replace(`/@fs/`,`file://`):e}async function a(){return{mvp:{mainModule:i(t),mainWorker:i(r)},eh:{mainModule:i(e),mainWorker:i(n)}}}export{a as getImportUrlBundles}; \ No newline at end of file diff --git a/assets/index-1wQNw9gK.js b/assets/index-1wQNw9gK.js deleted file mode 100644 index 44fc4fc00ec50ab6afbeeb709a7aef8bfcb77390..0000000000000000000000000000000000000000 --- a/assets/index-1wQNw9gK.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as m}from"./IconAnimation.vue_vue_type_script_setup_true_lang-z-t1ytxo.js";import{u as d}from"./useIconAnimation-1wS_J1WT.js";import{d as u,c2 as p,c as i,o as e,a as n,bf as f,bh as v,u as o,c3 as x}from"./index-D7HCX4VR.js";import{b as r}from"./route-block-B_A1xBdJ.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";const _={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":""},k=u({__name:"index",setup(y){const{iconAnimationStarted:a,showIconAnimation:s,animationIcon:c}=d("i-solar:armchair-2-bold-duotone");return(b,t)=>{const l=p("motion");return e(),i(x,null,[t[1]||(t[1]=n("div",null," Scene ",-1)),o(s)?(e(),f(m,{key:0,"z-index":-1,icon:o(c),"icon-size":12,duration:1e3,started:o(a),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):v((e(),i("div",_,t[0]||(t[0]=[n("div",{text:"60","i-solar:armchair-2-bold-duotone":""},null,-1)]))),[[l]])],64)}}});typeof r=="function"&&r(k);export{k as default}; diff --git a/assets/index-2U0R-op1.css b/assets/index-2U0R-op1.css deleted file mode 100644 index 0a4e6ab62499f8c1cd4f1da984c526d48c8c3a72..0000000000000000000000000000000000000000 --- a/assets/index-2U0R-op1.css +++ /dev/null @@ -1 +0,0 @@ -.cross-background-container[data-v-455eb62c]{background-color:#fff;--cross-color: oklch(.85 calc(var(--chromatic-chroma) * .3) var(--chromatic-hue) / .2);background:radial-gradient(circle,transparent 20%,#ffffff 20%,#ffffff 80%,transparent 80%,transparent),radial-gradient(circle,transparent 20%,#ffffff 20%,#ffffff 80%,transparent 80%,transparent) 25px 25px,linear-gradient(var(--cross-color) 2px,transparent 2px) 0 -1px,linear-gradient(90deg,var(--cross-color) 2px,#ffffff 2px) -1px 0;background-size:50px 50px,50px 50px,25px 25px,25px 25px}.dark .cross-background-container[data-v-455eb62c]{background-color:#121212;--cross-color: oklch(.2 calc(var(--chromatic-chroma) * .3) var(--chromatic-hue));background:radial-gradient(circle,transparent 20%,#121212 20%,#121212 80%,transparent 80%,transparent),radial-gradient(circle,transparent 20%,#121212 20%,#121212 80%,transparent 80%,transparent) 25px 25px,linear-gradient(var(--cross-color) 2px,transparent 2px) 0 -1px,linear-gradient(90deg,var(--cross-color) 2px,#121212 2px) -1px 0;background-size:50px 50px,50px 50px,25px 25px,25px 25px}.animate-stripe[data-v-5b585ca8]{background-image:repeating-linear-gradient(-45deg,#a16207,#a16207 25px,#eab308 25px,#eab308 50px);background-size:175% 100%}.animate-stripe[data-v-5b585ca8]:hover{animation:progress-5b585ca8 2s linear infinite}@-webkit-keyframes progress-5b585ca8{0%{background-position:0 0}to{background-position:-75px 0px}}@-moz-keyframes progress-5b585ca8{0%{background-position:0 0}to{background-position:-75px 0px}}@-ms-keyframes progress-5b585ca8{0%{background-position:0 0}to{background-position:-75px 0px}}@keyframes progress-5b585ca8{0%{background-position:0 0}to{background-position:-70px 0px}}.chat-history[data-v-e0c4b6fe]{--gradient: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1));-webkit-mask-image:var(--gradient);mask-image:var(--gradient);-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:bottom;mask-position:bottom}@keyframes wave-animation-f58b462e{0%{transform:translate(0)}to{transform:translate(var(--wave-translate, -250px))}}.wave[data-v-f58b462e]{width:200vw;mask-repeat:repeat-x;-webkit-mask-repeat:repeat-x;will-change:transform;animation:wave-animation-f58b462e var(--animation-duration, 5s) linear infinite} diff --git a/assets/index-BNZmqEMM.js b/assets/index-BNZmqEMM.js deleted file mode 100644 index cef7a29c81754ca7d6cbe08cae99f428f4ebdeeb..0000000000000000000000000000000000000000 --- a/assets/index-BNZmqEMM.js +++ /dev/null @@ -1,5 +0,0 @@ -import{Z as s,b as x}from"./mcp-DgU0tpf-.js";import"./index-D7HCX4VR.js";const M=Symbol("Let zodToJsonSchema decide on which parser to use"),P={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},D=t=>typeof t=="string"?{...P,name:t}:{...P,...t},T=t=>{const e=D(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};function _(t,e,a,n){n!=null&&n.errorMessages&&a&&(t.errorMessage={...t.errorMessage,[e]:a})}function l(t,e,a,n,r){t[e]=a,_(t,e,n,r)}function N(){return{}}function $(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==s.ZodAny&&(a.items=c(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&l(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&l(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(l(a,"minItems",t.exactLength.value,t.exactLength.message,e),l(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}function w(t,e){const a={type:"integer",format:"int64"};if(!t.checks)return a;for(const n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?l(a,"minimum",n.value,n.message,e):l(a,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(a.exclusiveMinimum=!0),l(a,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?l(a,"maximum",n.value,n.message,e):l(a,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(a.exclusiveMaximum=!0),l(a,"maximum",n.value,n.message,e));break;case"multipleOf":l(a,"multipleOf",n.value,n.message,e);break}return a}function z(){return{type:"boolean"}}function Z(t,e){return c(t.type._def,e)}const L=(t,e)=>c(t.innerType._def,e);function S(t,e,a){const n=a??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,i)=>S(t,e,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return F(t,e)}}const F=(t,e)=>{const a={type:"integer",format:"unix-time"};if(e.target==="openApi3")return a;for(const n of t.checks)switch(n.kind){case"min":l(a,"minimum",n.value,n.message,e);break;case"max":l(a,"maximum",n.value,n.message,e);break}return a};function I(t,e){return{...c(t.innerType._def,e),default:t.defaultValue()}}function E(t,e){return e.effectStrategy==="input"?c(t.schema._def,e):{}}function R(t){return{type:"string",enum:Array.from(t.values)}}const C=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function U(t,e){const a=[c(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),c(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i);let n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return a.forEach(i=>{if(C(i))r.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let o=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:m,...p}=i;o=p}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function B(t,e){const a=typeof t.value;return a!=="bigint"&&a!=="number"&&a!=="boolean"&&a!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:a==="bigint"?"integer":a,enum:[t.value]}:{type:a==="bigint"?"integer":a,const:t.value}}let b;const f={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(b===void 0&&(b=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),b),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function O(t,e){const a={type:"string"};if(t.checks)for(const n of t.checks)switch(n.kind){case"min":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e);break;case"max":l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":y(a,"email",n.message,e);break;case"format:idn-email":y(a,"idn-email",n.message,e);break;case"pattern:zod":d(a,f.email,n.message,e);break}break;case"url":y(a,"uri",n.message,e);break;case"uuid":y(a,"uuid",n.message,e);break;case"regex":d(a,n.regex,n.message,e);break;case"cuid":d(a,f.cuid,n.message,e);break;case"cuid2":d(a,f.cuid2,n.message,e);break;case"startsWith":d(a,RegExp(`^${v(n.value,e)}`),n.message,e);break;case"endsWith":d(a,RegExp(`${v(n.value,e)}$`),n.message,e);break;case"datetime":y(a,"date-time",n.message,e);break;case"date":y(a,"date",n.message,e);break;case"time":y(a,"time",n.message,e);break;case"duration":y(a,"duration",n.message,e);break;case"length":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e),l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"includes":{d(a,RegExp(v(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&y(a,"ipv4",n.message,e),n.version!=="v4"&&y(a,"ipv6",n.message,e);break}case"base64url":d(a,f.base64url,n.message,e);break;case"jwt":d(a,f.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&d(a,f.ipv4Cidr,n.message,e),n.version!=="v4"&&d(a,f.ipv6Cidr,n.message,e);break}case"emoji":d(a,f.emoji(),n.message,e);break;case"ulid":{d(a,f.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{y(a,"binary",n.message,e);break}case"contentEncoding:base64":{l(a,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{d(a,f.base64,n.message,e);break}}break}case"nanoid":d(a,f.nanoid,n.message,e)}return a}function v(t,e){return e.patternStrategy==="escape"?q(t):t}const V=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function q(t){let e="";for(let a=0;ai.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...a&&n.errorMessages&&{errorMessage:{format:a}}})):l(t,"format",e,a,n)}function d(t,e,a,n){var r;t.pattern||(r=t.allOf)!=null&&r.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:k(e,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):l(t,"pattern",k(e,n),a,n)}function k(t,e){var p;if(!e.applyRegexFlags||!t.flags)return t.source;const a={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=a.i?t.source.toLowerCase():t.source;let r="",i=!1,o=!1,m=!1;for(let u=0;u({...u,[g]:c(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",g]})??{}}),{}),additionalProperties:e.rejectedAdditionalProperties};const a={type:"object",additionalProperties:c(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return a;if(((r=t.keyType)==null?void 0:r._def.typeName)===s.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:u,...g}=O(t.keyType._def,e);return{...a,propertyNames:g}}else{if(((o=t.keyType)==null?void 0:o._def.typeName)===s.ZodEnum)return{...a,propertyNames:{enum:t.keyType._def.values}};if(((m=t.keyType)==null?void 0:m._def.typeName)===s.ZodBranded&&t.keyType._def.type._def.typeName===s.ZodString&&((p=t.keyType._def.type._def.checks)!=null&&p.length)){const{type:u,...g}=Z(t.keyType._def,e);return{...a,propertyNames:g}}}return a}function K(t,e){if(e.mapStrategy==="record")return j(t,e);const a=c(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||{},n=c(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function J(t){const e=t.values,n=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),r=Array.from(new Set(n.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}function W(){return{not:{}}}function G(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const h={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function H(t,e){if(e.target==="openApi3")return A(t,e);const a=t.options instanceof Map?Array.from(t.options.values()):t.options;if(a.every(n=>n._def.typeName in h&&(!n._def.checks||!n._def.checks.length))){const n=a.reduce((r,i)=>{const o=h[i._def.typeName];return o&&!r.includes(o)?[...r,o]:r},[]);return{type:n.length>1?n:n[0]}}else if(a.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=a.reduce((r,i)=>{const o=typeof i._def.value;switch(o){case"string":case"number":case"boolean":return[...r,o];case"bigint":return[...r,"integer"];case"object":if(i._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(n.length===a.length){const r=n.filter((i,o,m)=>m.indexOf(i)===o);return{type:r.length>1?r:r[0],enum:a.reduce((i,o)=>i.includes(o._def.value)?i:[...i,o._def.value],[])}}}else if(a.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((n,r)=>[...n,...r._def.values.filter(i=>!n.includes(i))],[])};return A(t,e)}const A=(t,e)=>{const a=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,r)=>c(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return a.length?{anyOf:a}:void 0};function Q(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:h[t.innerType._def.typeName],nullable:!0}:{type:[h[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){const n=c(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}const a=c(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function X(t,e){const a={type:"number"};if(!t.checks)return a;for(const n of t.checks)switch(n.kind){case"int":a.type="integer",_(a,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?l(a,"minimum",n.value,n.message,e):l(a,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(a.exclusiveMinimum=!0),l(a,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?l(a,"maximum",n.value,n.message,e):l(a,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(a.exclusiveMaximum=!0),l(a,"maximum",n.value,n.message,e));break;case"multipleOf":l(a,"multipleOf",n.value,n.message,e);break}return a}function Y(t,e){const a=e.target==="openAi",n={type:"object",properties:{}},r=[],i=t.shape();for(const m in i){let p=i[m];if(p===void 0||p._def===void 0)continue;let u=te(p);u&&a&&(p instanceof x&&(p=p._def.innerType),p.isNullable()||(p=p.nullable()),u=!1);const g=c(p._def,{...e,currentPath:[...e.currentPath,"properties",m],propertyPath:[...e.currentPath,"properties",m]});g!==void 0&&(n.properties[m]=g,u||r.push(m))}r.length&&(n.required=r);const o=ee(t,e);return o!==void 0&&(n.additionalProperties=o),n}function ee(t,e){if(t.catchall._def.typeName!=="ZodNever")return c(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function te(t){try{return t.isOptional()}catch{return!0}}const ne=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return c(t.innerType._def,e);const a=c(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return a?{anyOf:[{not:{}},a]}:{}},ae=(t,e)=>{if(e.pipeStrategy==="input")return c(t.in._def,e);if(e.pipeStrategy==="output")return c(t.out._def,e);const a=c(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=c(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function re(t,e){return c(t.type._def,e)}function ie(t,e){const n={type:"array",uniqueItems:!0,items:c(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&l(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&l(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}function se(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((a,n)=>c(a._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:c(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((a,n)=>c(a._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function oe(){return{not:{}}}function ue(){return{}}const ce=(t,e)=>c(t.innerType._def,e),le=(t,e,a)=>{switch(e){case s.ZodString:return O(t,a);case s.ZodNumber:return X(t,a);case s.ZodObject:return Y(t,a);case s.ZodBigInt:return w(t,a);case s.ZodBoolean:return z();case s.ZodDate:return S(t,a);case s.ZodUndefined:return oe();case s.ZodNull:return G(a);case s.ZodArray:return $(t,a);case s.ZodUnion:case s.ZodDiscriminatedUnion:return H(t,a);case s.ZodIntersection:return U(t,a);case s.ZodTuple:return se(t,a);case s.ZodRecord:return j(t,a);case s.ZodLiteral:return B(t,a);case s.ZodEnum:return R(t);case s.ZodNativeEnum:return J(t);case s.ZodNullable:return Q(t,a);case s.ZodOptional:return ne(t,a);case s.ZodMap:return K(t,a);case s.ZodSet:return ie(t,a);case s.ZodLazy:return()=>t.getter()._def;case s.ZodPromise:return re(t,a);case s.ZodNaN:case s.ZodNever:return W();case s.ZodEffects:return E(t,a);case s.ZodAny:return N();case s.ZodUnknown:return ue();case s.ZodDefault:return I(t,a);case s.ZodBranded:return Z(t,a);case s.ZodReadonly:return ce(t,a);case s.ZodCatch:return L(t,a);case s.ZodPipeline:return ae(t,a);case s.ZodFunction:case s.ZodVoid:case s.ZodSymbol:return;default:return(n=>{})()}};function c(t,e,a=!1){var m;const n=e.seen.get(t);if(e.override){const p=(m=e.override)==null?void 0:m.call(e,t,e,n,a);if(p!==M)return p}if(n&&!a){const p=pe(n,e);if(p!==void 0)return p}const r={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,r);const i=le(t,t.typeName,e),o=typeof i=="function"?c(i(),e):i;if(o&&de(t,e,o),e.postProcess){const p=e.postProcess(o,t,e);return r.jsonSchema=o,p}return r.jsonSchema=o,o}const pe=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:me(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===a)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},me=(t,e)=>{let a=0;for(;a(t.description&&(a.description=t.description,e.markdownDescription&&(a.markdownDescription=t.description)),a),ye=(t,e)=>{const a=T(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((p,[u,g])=>({...p,[u]:c(g._def,{...a,currentPath:[...a.basePath,a.definitionPath,u]},!0)??{}}),{}):void 0,r=typeof e=="string"?e:(e==null?void 0:e.nameStrategy)==="title"||e==null?void 0:e.name,i=c(t._def,r===void 0?a:{...a,currentPath:[...a.basePath,a.definitionPath,r]},!1)??{},o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(i.title=o);const m=r===void 0?n?{...i,[a.definitionPath]:n}:i:{$ref:[...a.$refStrategy==="relative"?[]:a.basePath,a.definitionPath,r].join("/"),[a.definitionPath]:{...n,[r]:i}};return a.target==="jsonSchema7"?m.$schema="http://json-schema.org/draft-07/schema#":(a.target==="jsonSchema2019-09"||a.target==="openAi")&&(m.$schema="https://json-schema.org/draft/2019-09/schema#"),a.target==="openAi"&&("anyOf"in m||"oneOf"in m||"allOf"in m||"type"in m&&Array.isArray(m.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),m};export{_ as addErrorMessage,ye as default,P as defaultOptions,D as getDefaultOptions,T as getRefs,M as ignoreOverride,N as parseAnyDef,$ as parseArrayDef,w as parseBigintDef,z as parseBooleanDef,Z as parseBrandedDef,L as parseCatchDef,S as parseDateDef,c as parseDef,I as parseDefaultDef,E as parseEffectsDef,R as parseEnumDef,U as parseIntersectionDef,B as parseLiteralDef,K as parseMapDef,J as parseNativeEnumDef,W as parseNeverDef,G as parseNullDef,Q as parseNullableDef,X as parseNumberDef,Y as parseObjectDef,ne as parseOptionalDef,ae as parsePipelineDef,re as parsePromiseDef,ce as parseReadonlyDef,j as parseRecordDef,ie as parseSetDef,O as parseStringDef,se as parseTupleDef,oe as parseUndefinedDef,H as parseUnionDef,ue as parseUnknownDef,h as primitiveMappings,le as selectParser,l as setResponseValueAndErrors,f as zodPatterns,ye as zodToJsonSchema}; diff --git a/assets/index-BiKOctgh.js b/assets/index-BiKOctgh.js deleted file mode 100644 index 14d5bcdef0933b4d0f43e28a0d7c8b6ad954649c..0000000000000000000000000000000000000000 --- a/assets/index-BiKOctgh.js +++ /dev/null @@ -1 +0,0 @@ -import{d as T,cg as G,ch as H,f as V,bf as E,o as i,bg as z,a,X as F,bA as K,ci as Z,Y as u,c,c3 as N,c4 as I,cj as ee,u as r,$ as te,a0 as ae,e as p,w as le,c2 as re,b,bh as M,ca as oe,W as A}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as se}from"./airi-card-xdAfH1PV.js";import{k as ne}from"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{_ as ie}from"./InputFile.vue_vue_type_script_setup_true_lang-M88MYfAL.js";import{_ as de}from"./CardCreate.vue_vue_type_script_setup_true_lang-cT8qsPWn.js";import ue from"./CardCreationDialog-BD9l8__M.js";import{_ as ce}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-C37wIVyz.js";import{_ as me}from"./CardListItem.vue_vue_type_script_setup_true_lang-B7Q5Wxio.js";import{_ as pe}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C4u0-iKE.js";import{b as q}from"./route-block-B_A1xBdJ.js";import"./consciousness-CZ80YtY5.js";import"./providers-DepZj6_J.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./speech-D8cCufg2.js";import"./Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";import"./index-Cynu-bMx.js";const fe={class:"flex-1 truncate"},ve={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"},xe=["onClick"],ge=T({__name:"Select",props:G({options:null,placeholder:null,disabled:{type:Boolean},title:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup($){const o=$,f=H($,"modelValue"),C=V(()=>{const n=o.options.find(v=>v.value===f.value);return n?n.label:o.placeholder});function D(n){f.value=n}return(n,v)=>(i(),E(r(ne),{"auto-size":"","auto-boundary-max-size":""},{popper:z(({hide:g})=>[a("div",ve,[(i(!0),c(N,null,I(o.options,d=>(i(),c("div",ee({ref_for:!0},{...n.$attrs,class:null,style:null},{key:d.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":f.value===d.value}],onClick:w=>{D(d.value),g()}}),u(d.label),17,xe))),128))])]),default:z(()=>[a("div",{class:F(["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":o.disabled}])},[a("div",fe,[K(n.$slots,"default",{label:C.value},()=>[Z(u(C.value),1)])]),v[0]||(v[0]=a("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}))}}),be={"rounded-xl":"","p-4":"",flex:"~ col gap-4"},_e={flex:"~ row","flex-wrap":"","items-center":"","justify-between":"","gap-4":""},ke={class:"relative min-w-[200px] flex-1","inline-flex":"~","w-full":"","items-center":""},ye=["placeholder"],Ce={class:"relative flex flex-row justify-start gap-2 lg:flex-col"},we={class:"top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400"},he={key:0,flex:"","flex-col":"","items-center":""},Ve={"font-medium":"",text:"neutral-600 dark:neutral-300"},$e={text:"neutral-500 dark:neutral-400","mt-2":"","text-sm":""},De={key:1,flex:"","flex-col":"","items-center":""},Se={"font-medium":"",text:"primary-600 dark:primary-300"},Ae={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"},ze={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"},Ne={class:"flex flex-col"},je={class:"font-medium"},Oe={class:"text-sm text-amber-600 dark:text-amber-400"},Ue={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Be=T({__name:"index",setup($){const{t:o}=te(),f=se(),{addCard:C,removeCard:D}=f,{cards:n,activeCardId:v}=ae(f),g=p(""),d=p(!1),w=p(!1),_=p(""),k=p("nameAsc"),S=p([]);le(S,async l=>{const e=l[0];if(e)try{const s=await e.text(),m=JSON.parse(s);g.value=C(m),d.value=!0}catch(s){console.error("Error processing card file:",s)}});const j=V(()=>Array.from(n.value.entries()).map(([l,e])=>({id:l,name:e.name,description:e.description}))),J=V(()=>{if(!_.value)return j.value;const l=_.value.toLowerCase();return j.value.filter(e=>e.name.toLowerCase().includes(l)||e.description&&e.description.toLowerCase().includes(l))}),O=V(()=>{const l=[...J.value];return k.value==="nameAsc"?l.sort((e,s)=>e.name.localeCompare(s.name)):k.value==="nameDesc"?l.sort((e,s)=>s.name.localeCompare(e.name)):k.value==="recent"?l.sort((e,s)=>s.id.localeCompare(e.id)):l}),h=p(!1),x=p(null);function P(){x.value&&(D(x.value),x.value=null,h.value=!1)}function Q(l){x.value=l,h.value=!0}function R(l){g.value=l,d.value=!0}function W(){w.value=!0}function X(l){v.value=l}function Y(l){const e=n.value.get(l);return(e==null?void 0:e.version)||"1.0.0"}function U(l,e){var t,y,B,L;const s=n.value.get(l);if(!s||!((y=(t=s.extensions)==null?void 0:t.airi)!=null&&y.modules))return"default";const m=s.extensions.airi.modules;return e==="consciousness"?(B=m.consciousness)!=null&&B.model&&m.consciousness.model.split("-").pop()||"default":e==="voice"&&((L=m.speech)==null?void 0:L.voice_id)||"default"}return(l,e)=>{var m;const s=re("motion");return i(),c(N,null,[a("div",be,[a("div",_e,[a("div",ke,[e[7]||(e[7]=a("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[a("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),M(a("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>_.value=t),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:r(o)("settings.pages.card.search")},null,8,ye),[[oe,_.value]])]),a("div",Ce,[a("div",we,u(r(o)("settings.pages.card.sort_by"))+": ",1),b(r(ge),{modelValue:k.value,"onUpdate:modelValue":e[1]||(e[1]=t=>k.value=t),options:[{value:"nameAsc",label:r(o)("settings.pages.card.name_asc")},{value:"nameDesc",label:r(o)("settings.pages.card.name_desc")},{value:"recent",label:r(o)("settings.pages.card.recent")}],placeholder:"Select sort option",class:"min-w-[150px]"},null,8,["modelValue","options"])])]),a("div",{class:F(["mt-4",{"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 grid-auto-rows-[minmax(min-content,max-content)] grid-auto-flow-dense sm:grid-cols-[repeat(auto-fill,minmax(240px,1fr))] sm:gap-5 md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] lg:grid-cols-[repeat(auto-fill,minmax(250px,1fr))]":r(n).size>0}])},[b(r(ie),{modelValue:S.value,"onUpdate:modelValue":e[2]||(e[2]=t=>S.value=t),accept:"*.json"},{default:z(({isDragging:t})=>[t?(i(),c("div",De,[e[9]||(e[9]=a("div",{"i-solar:upload-minimalistic-bold":"",class:"mb-2 text-5xl text-primary-500 dark:text-primary-400"},null,-1)),a("p",Se,u(r(o)("settings.pages.card.drop_here")),1)])):(i(),c("div",he,[e[8]||(e[8]=a("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),a("p",Ve,u(r(o)("settings.pages.card.upload")),1),a("p",$e,u(r(o)("settings.pages.card.upload_desc")),1)]))]),_:1},8,["modelValue"]),b(de,{onClick:W}),r(n).size>0?(i(!0),c(N,{key:0},I(O.value,t=>(i(),E(me,{id:t.id,key:t.id,name:t.name,description:t.description,"is-active":t.id===r(v),"is-selected":t.id===g.value&&d.value,version:Y(t.id),"consciousness-model":U(t.id,"consciousness"),"voice-model":U(t.id,"voice"),onSelect:y=>R(t.id),onActivate:y=>X(t.id),onDelete:y=>Q(t.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):A("",!0),r(n).size===0?(i(),c("div",Ae,[e[10]||(e[10]=a("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),a("p",null,u(r(o)("settings.pages.card.no_cards")),1)])):A("",!0),_.value&&O.value.length===0?(i(),c("div",ze,[e[11]||(e[11]=a("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),a("div",Ne,[a("span",je,u(r(o)("settings.pages.card.no_results")),1),a("span",Oe,u(r(o)("settings.pages.card.try_different_search")),1)])])):A("",!0)],2)]),b(pe,{modelValue:h.value,"onUpdate:modelValue":e[3]||(e[3]=t=>h.value=t),"card-name":x.value?(m=r(f).getCard(x.value))==null?void 0:m.name:"",onConfirm:P,onCancel:e[4]||(e[4]=t=>x.value=null)},null,8,["modelValue","card-name"]),b(ce,{modelValue:d.value,"onUpdate:modelValue":e[5]||(e[5]=t=>d.value=t),"card-id":g.value},null,8,["modelValue","card-id"]),b(ue,{modelValue:w.value,"onUpdate:modelValue":e[6]||(e[6]=t=>w.value=t)},null,8,["modelValue"]),M((i(),c("div",Ue,e[12]||(e[12]=[a("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof q=="function"&&q(Be);export{Be as default}; diff --git a/assets/index-BtAisBe9.js b/assets/index-BtAisBe9.js new file mode 100644 index 0000000000000000000000000000000000000000..04222d8052c167fd4ff677f4024f19bdfab709ce --- /dev/null +++ b/assets/index-BtAisBe9.js @@ -0,0 +1,3875 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-t1McW1fh.js","assets/HeaderLink-zGlOe2Jb.js","assets/HeaderLink-CI1dOuDM.css","assets/settings-BPFawjNr.js","assets/components-B-QNW1cA.js","assets/import-url-browser-BvZvAmFy.js","assets/duckdb-mvp-C3i5IjU8.js","assets/src-bHDRqBSs.js","assets/src-B8Pazang.css","assets/composables-DnqWi3UL.js","assets/stores-mOXXrrXB.js","assets/dist-DQi82Mjd.js","assets/webgpu-Cnn5XZ2r.js","assets/index-CISmcbXk-s07e23Qe.js","assets/types-D50Xq0so.js","assets/queue-BZUURX31.js","assets/queues-U6a2FwNq.js","assets/Button-BUWHo0FI.js","assets/Button-D6PjaMaR.css","assets/components-CXqNLZbx.css","assets/pages-CzrQCDZR.js","assets/route-block-DNPbw0zT.js","assets/Basic-BA5ubWIJ.js","assets/pages-DPSvNNh_.css","assets/background-remove-CI-N-inF.js","assets/InputFile-B1bjga7G.js","assets/chat-Cm78FyKU.js","assets/image-D-LGEUbE.js","assets/image-BhuwcwI9.css","assets/polaroid-Ce3gxIqN.js","assets/vibrant-DyoV7uOq.js","assets/browser-C4moGI0I.js","assets/queue-DEVr27WI.js","assets/settings-CGigMZFM.js","assets/IconAnimation-B5sfLFsA.js","assets/airi-card-bXvDq1QK.js","assets/CardCreate-qkn1QwRd.js","assets/CardCreationDialog-C00zclL1.js","assets/dist-DzeHt4xm.js","assets/CardCreationDialog-Ic9YpxxK.css","assets/CardDetailDialog-CJ7VvCcd.js","assets/DeleteCardDialog-DA24n-jV.js","assets/CardListItem-gxbvoHYe.js","assets/CardCreate-s77DpRUP.js","assets/CardCreationDialog-DbUZj3zx.js","assets/CardDetailDialog-BUqu9VuB.js","assets/CardListItem-Cwi08F8K.js","assets/DeleteCardDialog-WqtMeAWd.js","assets/appearance-mPITRDqf.js","assets/color-scheme-DHCqV_sd.js","assets/ColorPalette-DaCdckPj.js","assets/color-scheme-CHJXy8qz.css","assets/developer-C6qOrZzG.js","assets/CheckBar-B-SKUaUP.js","assets/general-D5ryEaZ2.js","assets/memory-0dYqsS07.js","assets/models-TOMYe-dc.js","assets/useIconAnimation-C_Mu172C.js","assets/models-BR8YPV_e.css","assets/modules-Brjd2BIv.js","assets/consciousness-BhjlN9bE.js","assets/memory-long-term-C61DZWTO.js","assets/memory-short-term-CzuHUda_.js","assets/speech-DzfbHcH_.js","assets/Textarea-C0dnrt_L.js","assets/providers-C5vrVlHa.js","assets/alibaba-cloud-model-studio-Di5kaCjv.js","assets/anthropic-DUmlJu_t.js","assets/cloudflare-workers-ai-CUVYqqAF.js","assets/deepseek-zvlAqj6K.js","assets/elevenlabs-BU89BpOX.js","assets/featherless-ai-CHBNNQNM.js","assets/fireworks-ai-BeQmtYw-.js","assets/google-generative-ai-vTI86k1V.js","assets/microsoft-speech-DsX1wfDy.js","assets/mistral-ai-DsX_I4X6.js","assets/moonshot-ai-BL1GQpdJ.js","assets/novita-ai-hF2aUTGC.js","assets/ollama-AxPkEHcT.js","assets/openai-CtCB0lo5.js","assets/openai-audio-speech-DLCLQ0xM.js","assets/openai-audio-transcription-BO8z1O_F.js","assets/openrouter-ai-Cf4Rx59R.js","assets/player2-api-D6m6cKGN.js","assets/together-ai-BvvRfg0N.js","assets/volcengine-QjDAu2Dw.js","assets/xai-BTOkQ787.js","assets/scene-Lh08I5GV.js","assets/filter-message-BjGEk5iK.js","assets/delays-Bn4Zuwfk.js","assets/emotions-ctaIpmZy.js","assets/messages-DDZstpir.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.16 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +/*! #__NO_SIDE_EFFECTS__ */ +function h(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}const g={},_=[],v=()=>{},y=()=>!1,b=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),x=e=>e.startsWith(`onUpdate:`),S=Object.assign,C=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},w=Object.prototype.hasOwnProperty,T=(e,t)=>w.call(e,t),E=Array.isArray,D=e=>P(e)===`[object Map]`,O=e=>P(e)===`[object Set]`,k=e=>P(e)===`[object Date]`,A=e=>typeof e==`function`,j=e=>typeof e==`string`,M=e=>typeof e==`symbol`,N=e=>typeof e==`object`&&!!e,ee=e=>(N(e)||A(e))&&A(e.then)&&A(e.catch),te=Object.prototype.toString,P=e=>te.call(e),ne=e=>P(e).slice(8,-1),re=e=>P(e)===`[object Object]`,ie=e=>j(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ae=h(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),oe=e=>{let t=Object.create(null);return n=>{let r=t[n];return r||(t[n]=e(n))}},se=/-(\w)/g,ce=oe(e=>e.replace(se,(e,t)=>t?t.toUpperCase():``)),le=/\B([A-Z])/g,ue=oe(e=>e.replace(le,`-$1`).toLowerCase()),de=oe(e=>e.charAt(0).toUpperCase()+e.slice(1)),fe=oe(e=>{let t=e?`on${de(e)}`:``;return t}),pe=(e,t)=>!Object.is(e,t),F=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},he=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ge=e=>{let t=j(e)?Number(e):NaN;return isNaN(t)?e:t};let I;const _e=()=>I||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function L(e){if(E(e)){let t={};for(let n=0;n{if(e){let n=e.split(ye);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Se(e){let t=``;if(j(e))t=e;else if(E(e))for(let n=0;nke(e,t))}const je=e=>!!(e&&e.__v_isRef===!0),Me=e=>j(e)?e:e==null?``:E(e)||N(e)&&(e.toString===te||!A(e.toString))?je(e)?Me(e.value):JSON.stringify(e,Ne,2):String(e),Ne=(e,t)=>je(t)?Ne(e,t.value):D(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Pe(t,r)+` =>`]=n,e),{})}:O(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Pe(e))}:M(t)?Pe(t):N(t)&&!E(t)&&!re(t)?String(t):t,Pe=(e,t=``)=>{var n;return M(e)?`Symbol(${(n=e.description)??t})`:e};function Fe(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Ie;var Le=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Ie,!e&&Ie&&(this.index=(Ie.scopes||=[]).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0&&--this._on===0&&(Ie=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t0)return;if(Ke){let e=Ke;for(Ke=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ge;){let t=Ge;for(Ge=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Xe(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ze(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),et(r),tt(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Qe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&($e(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function $e(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===st)||(e.globalVersion=st,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Qe(e))))return;e.flags|=2;let t=e.dep,n=Ve,r=nt;Ve=e,nt=!0;try{Xe(e);let n=e.fn(e._value);(t.version===0||pe(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Ve=n,nt=r,Ze(e),e.flags&=-3}}function et(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)et(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function tt(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let nt=!0;const rt=[];function it(){rt.push(nt),nt=!1}function at(){let e=rt.pop();nt=e===void 0?!0:e}function ot(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Ve;Ve=void 0;try{t()}finally{Ve=e}}}let st=0;var ct=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},lt=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Ve||!nt||Ve===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Ve)t=this.activeLink=new ct(Ve,this),Ve.deps?(t.prevDep=Ve.depsTail,Ve.depsTail.nextDep=t,Ve.depsTail=t):Ve.deps=Ve.depsTail=t,ut(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Ve.depsTail,t.nextDep=void 0,Ve.depsTail.nextDep=t,Ve.depsTail=t,Ve.deps===t&&(Ve.deps=e)}return t}trigger(e){this.version++,st++,this.notify(e)}notify(e){Je();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Ye()}}};function ut(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)ut(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const dt=new WeakMap,ft=Symbol(``),pt=Symbol(``),mt=Symbol(``);function ht(e,t,n){if(nt&&Ve){let t=dt.get(e);t||dt.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new lt),r.map=t,r.key=n),r.track()}}function gt(e,t,n,r,i,a){let o=dt.get(e);if(!o){st++;return}let s=e=>{e&&e.trigger()};if(Je(),t===`clear`)o.forEach(s);else{let i=E(e),a=i&&ie(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===mt||!M(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(mt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(ft)),D(e)&&s(o.get(pt)));break;case`delete`:i||(s(o.get(ft)),D(e)&&s(o.get(pt)));break;case`set`:D(e)&&s(o.get(ft));break}}Ye()}function _t(e,t){let n=dt.get(e);return n&&n.get(t)}function vt(e){let t=ln(e);return t===e?t:(ht(t,`iterate`,mt),sn(e)?t:t.map(dn))}function yt(e){return ht(e=ln(e),`iterate`,mt),e}const bt={__proto__:null,[Symbol.iterator](){return xt(this,Symbol.iterator,dn)},concat(...e){return vt(this).concat(...e.map(e=>E(e)?vt(e):e))},entries(){return xt(this,`entries`,e=>(e[1]=dn(e[1]),e))},every(e,t){return Ct(this,`every`,e,t,void 0,arguments)},filter(e,t){return Ct(this,`filter`,e,t,e=>e.map(dn),arguments)},find(e,t){return Ct(this,`find`,e,t,dn,arguments)},findIndex(e,t){return Ct(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Ct(this,`findLast`,e,t,dn,arguments)},findLastIndex(e,t){return Ct(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Ct(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Tt(this,`includes`,e)},indexOf(...e){return Tt(this,`indexOf`,e)},join(e){return vt(this).join(e)},lastIndexOf(...e){return Tt(this,`lastIndexOf`,e)},map(e,t){return Ct(this,`map`,e,t,void 0,arguments)},pop(){return Et(this,`pop`)},push(...e){return Et(this,`push`,e)},reduce(e,...t){return wt(this,`reduce`,e,t)},reduceRight(e,...t){return wt(this,`reduceRight`,e,t)},shift(){return Et(this,`shift`)},some(e,t){return Ct(this,`some`,e,t,void 0,arguments)},splice(...e){return Et(this,`splice`,e)},toReversed(){return vt(this).toReversed()},toSorted(e){return vt(this).toSorted(e)},toSpliced(...e){return vt(this).toSpliced(...e)},unshift(...e){return Et(this,`unshift`,e)},values(){return xt(this,`values`,dn)}};function xt(e,t,n){let r=yt(e),i=r[t]();return r!==e&&!sn(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.value&&=n(e.value),e}),i}const St=Array.prototype;function Ct(e,t,n,r,i,a){let o=yt(e),s=o!==e&&!sn(e),c=o[t];if(c!==St[t]){let t=c.apply(e,a);return s?dn(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,dn(t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function wt(e,t,n,r){let i=yt(e),a=n;return i!==e&&(sn(e)?n.length>3&&(a=function(t,r,i){return n.call(this,t,r,i,e)}):a=function(t,r,i){return n.call(this,t,dn(r),i,e)}),i[t](a,...r)}function Tt(e,t,n){let r=ln(e);ht(r,`iterate`,mt);let i=r[t](...n);return(i===-1||i===!1)&&cn(n[0])?(n[0]=ln(n[0]),r[t](...n)):i}function Et(e,t,n=[]){it(),Je();let r=ln(e)[t].apply(e,n);return Ye(),at(),r}const Dt=h(`__proto__,__v_isRef,__isVue`),Ot=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(M));function kt(e){M(e)||(e=String(e));let t=ln(this);return ht(t,`has`,e),t.hasOwnProperty(e)}var At=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Xt:Yt:i?Jt:qt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=E(e);if(!r){let e;if(a&&(e=bt[t]))return e;if(t===`hasOwnProperty`)return kt}let o=Reflect.get(e,t,pn(e)?e:n);return(M(t)?Ot.has(t):Dt(t))||(r||ht(e,`get`,t),i)?o:pn(o)?a&&ie(t)?o:o.value:N(o)?r?tn(o):$t(o):o}},jt=class extends At{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t];if(!this._isShallow){let t=on(i);if(!sn(n)&&!on(n)&&(i=ln(i),n=ln(n)),!E(e)&&pn(i)&&!pn(n))return t?!1:(i.value=n,!0)}let a=E(e)&&ie(t)?Number(t)e,Rt=e=>Reflect.getPrototypeOf(e);function zt(e,t,n){return function(...r){let i=this.__v_raw,a=ln(i),o=D(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Lt:t?fn:dn;return!t&&ht(a,`iterate`,c?pt:ft),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function Bt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Vt(e,t){let n={get(n){let r=this.__v_raw,i=ln(r),a=ln(n);e||(pe(n,a)&&ht(i,`get`,n),ht(i,`get`,a));let{has:o}=Rt(i),s=t?Lt:e?fn:dn;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&ht(ln(t),`iterate`,ft),Reflect.get(t,`size`,t)},has(t){let n=this.__v_raw,r=ln(n),i=ln(t);return e||(pe(t,i)&&ht(r,`has`,t),ht(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=ln(a),s=t?Lt:e?fn:dn;return!e&&ht(o,`iterate`,ft),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};S(n,e?{add:Bt(`add`),set:Bt(`set`),delete:Bt(`delete`),clear:Bt(`clear`)}:{add(e){!t&&!sn(e)&&!on(e)&&(e=ln(e));let n=ln(this),r=Rt(n),i=r.has.call(n,e);return i||(n.add(e),gt(n,`add`,e,e)),this},set(e,n){!t&&!sn(n)&&!on(n)&&(n=ln(n));let r=ln(this),{has:i,get:a}=Rt(r),o=i.call(r,e);o||(e=ln(e),o=i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?pe(n,s)&>(r,`set`,e,n,s):gt(r,`add`,e,n),this},delete(e){let t=ln(this),{has:n,get:r}=Rt(t),i=n.call(t,e);i||(e=ln(e),i=n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&>(t,`delete`,e,void 0,a),o},clear(){let e=ln(this),t=e.size!==0,n,r=e.clear();return t&>(e,`clear`,void 0,void 0,n),r}});let r=[`keys`,`values`,`entries`,Symbol.iterator];return r.forEach(r=>{n[r]=zt(r,e,t)}),n}function Ht(e,t){let n=Vt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(T(n,r)&&r in t?n:t,r,i)}const Ut={get:Ht(!1,!1)},Wt={get:Ht(!1,!0)},Gt={get:Ht(!0,!1)},Kt={get:Ht(!0,!0)},qt=new WeakMap,Jt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap;function Zt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Qt(e){return e.__v_skip||!Object.isExtensible(e)?0:Zt(ne(e))}function $t(e){return on(e)?e:rn(e,!1,Nt,Ut,qt)}function en(e){return rn(e,!1,Ft,Wt,Jt)}function tn(e){return rn(e,!0,Pt,Gt,Yt)}function nn(e){return rn(e,!0,It,Kt,Xt)}function rn(e,t,n,r,i){if(!N(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let a=Qt(e);if(a===0)return e;let o=i.get(e);if(o)return o;let s=new Proxy(e,a===2?r:n);return i.set(e,s),s}function an(e){return on(e)?an(e.__v_raw):!!(e&&e.__v_isReactive)}function on(e){return!!(e&&e.__v_isReadonly)}function sn(e){return!!(e&&e.__v_isShallow)}function cn(e){return e?!!e.__v_raw:!1}function ln(e){let t=e&&e.__v_raw;return t?ln(t):e}function un(e){return!T(e,`__v_skip`)&&Object.isExtensible(e)&&me(e,`__v_skip`,!0),e}const dn=e=>N(e)?$t(e):e,fn=e=>N(e)?tn(e):e;function pn(e){return e?e.__v_isRef===!0:!1}function R(e){return mn(e,!1)}function z(e){return mn(e,!0)}function mn(e,t){return pn(e)?e:new hn(e,t)}var hn=class{constructor(e,t){this.dep=new lt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ln(e),this._value=t?e:dn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||sn(e)||on(e);e=n?e:ln(e),pe(e,t)&&(this._rawValue=e,this._value=n?e:dn(e),this.dep.trigger())}};function gn(e){e.dep&&e.dep.trigger()}function _n(e){return pn(e)?e.value:e}function vn(e){return A(e)?e():_n(e)}const yn={get:(e,t,n)=>t===`__v_raw`?e:_n(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return pn(i)&&!pn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function bn(e){return an(e)?e:new Proxy(e,yn)}var xn=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new lt,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function Sn(e){return new xn(e)}function Cn(e){let t=E(e)?Array(e.length):{};for(let n in e)t[n]=Dn(e,n);return t}var wn=class{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return _t(ln(this._object),this._key)}},Tn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function En(e,t,n){return pn(e)?e:A(e)?new Tn(e):N(e)&&arguments.length>1?Dn(e,t,n):R(e)}function Dn(e,t,n){let r=e[t];return pn(r)?r:new wn(e,t,n)}var On=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new lt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=st-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Ve!==this)return qe(this,!0),!0}get value(){let e=this.dep.track();return $e(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function kn(e,t,n=!1){let r,i;A(e)?r=e:(r=e.get,i=e.set);let a=new On(r,i,n);return a}const An={},jn=new WeakMap;let Mn;function Nn(e,t=!1,n=Mn){if(n){let t=jn.get(n);t||jn.set(n,t=[]),t.push(e)}}function Pn(e,t,n=g){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>{(n.onWarn||Fe)(`Invalid watch source: `,e,`A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`)},u=e=>i?e:sn(e)||i===!1||i===0?Fn(e,1):Fn(e),d,f,p,m,h=!1,_=!1;if(pn(e)?(f=()=>e.value,h=sn(e)):an(e)?(f=()=>u(e),h=!0):E(e)?(_=!0,h=e.some(e=>an(e)||sn(e)),f=()=>e.map(e=>{if(pn(e))return e.value;if(an(e))return u(e);if(A(e))return c?c(e,2):e()})):f=A(e)?t?c?()=>c(e,2):e:()=>{if(p){it();try{p()}finally{at()}}let t=Mn;Mn=d;try{return c?c(e,3,[m]):e(m)}finally{Mn=t}}:v,t&&i){let e=f,t=i===!0?1/0:i;f=()=>Fn(e(),t)}let y=ze(),b=()=>{d.stop(),y&&y.active&&C(y.effects,d)};if(a&&t){let e=t;t=(...t)=>{e(...t),b()}}let x=_?Array(e.length).fill(An):An,S=e=>{if(!(!(d.flags&1)||!d.dirty&&!e))if(t){let e=d.run();if(i||h||(_?e.some((e,t)=>pe(e,x[t])):pe(e,x))){p&&p();let n=Mn;Mn=d;try{let n=[e,x===An?void 0:_&&x[0]===An?[]:x,m];x=e,c?c(t,3,n):t(...n)}finally{Mn=n}}}else d.run()};return s&&s(S),d=new Ue(f),d.scheduler=o?()=>o(S,!1):S,m=e=>Nn(e,!1,d),p=d.onStop=()=>{let e=jn.get(d);if(e){if(c)c(e,4);else for(let t of e)t();jn.delete(d)}},t?r?S(!0):x=d.run():o?o(S.bind(null,!0),!0):d.run(),b.pause=d.pause.bind(d),b.resume=d.resume.bind(d),b.stop=b,b}function Fn(e,t=1/0,n){if(t<=0||!N(e)||e.__v_skip||(n||=new Set,n.has(e)))return e;if(n.add(e),t--,pn(e))Fn(e.value,t,n);else if(E(e))for(let r=0;r{Fn(e,t,n)});else if(re(e)){for(let r in e)Fn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Fn(e[r],t,n)}return e}function In(e,t,n,r){try{return r?e(...r):e()}catch(e){Rn(e,t,n)}}function Ln(e,t,n,r){if(A(e)){let i=In(e,t,n,r);return i&&ee(i)&&i.catch(e=>{Rn(e,t,n)}),i}if(E(e)){let i=[];for(let a=0;a>>1,i=Bn[r],a=er(i);a=er(n)?Bn.push(e):Bn.splice(Jn(t),0,e),e.flags|=1,Xn()}}function Xn(){Kn||=Gn.then(tr)}function Zn(e){E(e)?Hn.push(...e):Un&&e.id===-1?Un.splice(Wn+1,0,e):e.flags&1||(Hn.push(e),e.flags|=1),Xn()}function Qn(e,t,n=Vn+1){for(;ner(e)-er(t));if(Hn.length=0,Un){Un.push(...e);return}for(Un=e,Wn=0;Wne.id==null?e.flags&2?-1:1/0:e.id;function tr(e){let t=v;try{for(Vn=0;Vncr;function cr(e,t=nr,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&ao(-1);let i=ir(t),a;try{a=e(...n)}finally{ir(i),r._d&&ao(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function lr(e,t){if(nr===null)return e;let n=Ko(nr),r=e.dirs||=[];for(let e=0;ee.__isTeleport,pr=e=>e&&(e.disabled||e.disabled===``),mr=e=>e&&(e.defer||e.defer===``),hr=e=>typeof SVGElement<`u`&&e instanceof SVGElement,gr=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,_r=(e,t)=>{let n=e&&e.to;if(j(n))if(t){let e=t(n);return e}else return null;else return n},vr={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g}}=l,_=pr(t.props),{shapeFlag:v,children:y,dynamicChildren:b}=t;if(e==null){let e=t.el=h(``),l=t.anchor=h(``);p(e,n,r),p(l,n,r);let d=(e,t)=>{v&16&&(i&&i.isCE&&(i.ce._teleportTarget=e),u(y,e,t,i,a,o,s,c))},f=()=>{let e=t.target=_r(t.props,m),n=Cr(e,t,h,p);e&&(o!==`svg`&&hr(e)?o=`svg`:o!==`mathml`&&gr(e)&&(o=`mathml`),_||(d(e,n),Sr(t,!1)))};_&&(d(n,l),Sr(t,!0)),mr(t.props)?(t.el.__isMounted=!1,ya(()=>{f(),delete t.el.__isMounted},a)):f()}else{if(mr(t.props)&&e.el.__isMounted===!1){ya(()=>{vr.process(e,t,n,r,i,a,o,s,c,l)},a);return}t.el=e.el,t.targetStart=e.targetStart;let u=t.anchor=e.anchor,p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=pr(e.props),v=g?n:p,y=g?u:h;if(o===`svg`||hr(p)?o=`svg`:(o===`mathml`||gr(p))&&(o=`mathml`),b?(f(e.dynamicChildren,b,v,i,a,o,s),Ta(e,t,!0)):c||d(e,t,v,y,i,a,o,s,!1),_)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):yr(t,n,u,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=_r(t.props,m);e&&yr(t,e,null,l,0)}else g&&yr(t,p,h,l,1);Sr(t,_)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e;if(d&&(i(l),i(u)),a&&i(c),o&16){let e=a||!pr(f);for(let i=0;i{e.isMounted=!0}),ri(()=>{e.isUnmounting=!0}),e}const Dr=[Function,Array],Or={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Dr,onEnter:Dr,onAfterEnter:Dr,onEnterCancelled:Dr,onBeforeLeave:Dr,onLeave:Dr,onAfterLeave:Dr,onLeaveCancelled:Dr,onBeforeAppear:Dr,onAppear:Dr,onAfterAppear:Dr,onAppearCancelled:Dr},kr=e=>{let t=e.subTree;return t.component?kr(t.component):t},Ar={name:`BaseTransition`,props:Or,setup(e,{slots:t}){let n=jo(),r=Er();return()=>{let i=t.default&&Rr(t.default(),!0);if(!i||!i.length)return;let a=jr(i),o=ln(e),{mode:s}=o;if(r.isLeaving)return Fr(a);let c=Ir(a);if(!c)return Fr(a);let l=Pr(c,o,r,n,e=>l=e);c.type!==Qa&&Lr(c,l);let u=n.subTree&&Ir(n.subTree);if(u&&u.type!==Qa&&!uo(c,u)&&kr(n).type!==Qa){let e=Pr(u,o,r,n);if(Lr(u,e),s===`out-in`&&c.type!==Qa)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},Fr(a);s===`in-out`&&c.type!==Qa?e.delayLeave=(e,t,n)=>{let i=Nr(r,u);i[String(u.key)]=u,e[wr]=()=>{t(),e[wr]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function jr(e){let t=e[0];if(e.length>1){let n=!1;for(let r of e)if(r.type!==Qa){t=r,n=!0;break}}return t}const Mr=Ar;function Nr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Pr(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:g,onAppear:_,onAfterAppear:v,onAppearCancelled:y}=t,b=String(e.key),x=Nr(n,e),S=(e,t)=>{e&&Ln(e,r,9,t)},C=(e,t)=>{let n=t[1];S(e,t),E(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=g||c;else return;t[wr]&&t[wr](!0);let i=x[b];i&&uo(e,i)&&i.el[wr]&&i.el[wr](),S(r,[t])},enter(e){let t=l,r=u,i=d;if(!n.isMounted)if(a)t=_||l,r=v||u,i=y||d;else return;let o=!1,s=e[Tr]=t=>{o||(o=!0,S(t?i:r,[e]),w.delayedLeave&&w.delayedLeave(),e[Tr]=void 0)};t?C(t,[e,s]):s()},leave(t,r){let i=String(e.key);if(t[Tr]&&t[Tr](!0),n.isUnmounting)return r();S(f,[t]);let a=!1,o=t[wr]=n=>{a||(a=!0,r(),S(n?h:m,[t]),t[wr]=void 0,x[i]===e&&delete x[i])};x[i]=e,p?C(p,[t,o]):o()},clone(e){let a=Pr(e,t,n,r,i);return i&&i(a),a}};return w}function Fr(e){if(Kr(e))return e=vo(e),e.children=null,e}function Ir(e){if(!Kr(e))return fr(e.type)&&e.children?jr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&A(n.default))return n.default()}}function Lr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Lr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Rr(e,t=!1,n){let r=[],i=0;for(let a=0;a1)for(let e=0;eS({name:e.name},t,{setup:e}))():e}function Br(){let e=jo();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+ e.ids[1]++:``}function Vr(e){e.ids=[e.ids[0]+ e.ids[2]+++`-`,0,0]}function Hr(e,t,n,r,i=!1){if(E(e)){e.forEach((e,a)=>Hr(e,t&&(E(t)?t[a]:t),n,r,i));return}if(Gr(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Hr(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Ko(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===g?s.refs={}:s.refs,d=s.setupState,f=ln(d),p=d===g?()=>!1:e=>T(f,e);if(l!=null&&l!==c&&(j(l)?(u[l]=null,p(l)&&(d[l]=null)):pn(l)&&(l.value=null)),A(c))In(c,s,12,[o,u]);else{let t=j(c),r=pn(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:c.value;i?E(n)&&C(n,a):E(n)?n.includes(a)||n.push(a):t?(u[c]=[a],p(c)&&(d[c]=u[c])):(c.value=[a],e.k&&(u[e.k]=c.value))}else t?(u[c]=o,p(c)&&(d[c]=o)):r&&(c.value=o,e.k&&(u[e.k]=o))};o?(s.id=-1,ya(s,n)):s()}}}const Ur=_e().requestIdleCallback||(e=>setTimeout(e,1)),Wr=_e().cancelIdleCallback||(e=>clearTimeout(e)),Gr=e=>!!e.type.__asyncLoader,Kr=e=>e.type.__isKeepAlive;function qr(e,t){Yr(e,`a`,t)}function Jr(e,t){Yr(e,`da`,t)}function Yr(e,t,n=Ao){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Zr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Kr(e.parent.vnode)&&Xr(r,t,n,e),e=e.parent}}function Xr(e,t,n,r){let i=Zr(t,e,r,!0);ii(()=>{C(r[t],i)},n)}function Zr(e,t,n=Ao,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{it();let i=Po(n),a=Ln(t,n,e,r);return i(),at(),a};return r?i.unshift(a):i.push(a),a}}const Qr=e=>(t,n=Ao)=>{(!Lo||e===`sp`)&&Zr(e,(...e)=>t(...e),n)},$r=Qr(`bm`),ei=Qr(`m`),ti=Qr(`bu`),ni=Qr(`u`),ri=Qr(`bum`),ii=Qr(`um`),ai=Qr(`sp`),oi=Qr(`rtg`),si=Qr(`rtc`);function ci(e,t=Ao){Zr(`ec`,e,t)}const li=`components`,ui=`directives`;function di(e,t){return hi(li,e,!0,t)||e}const fi=Symbol.for(`v-ndc`);function pi(e){return j(e)?hi(li,e,!1)||e:e||fi}function mi(e){return hi(ui,e)}function hi(e,t,n=!0,r=!1){let i=nr||Ao;if(i){let n=i.type;if(e===li){let e=qo(n,!1);if(e&&(e===t||e===ce(t)||e===de(ce(t))))return n}let a=gi(i[e]||n[e],t)||gi(i.appContext[e],t);return!a&&r?n:a}}function gi(e,t){return e&&(e[t]||e[ce(t)]||e[de(ce(t))])}function _i(e,t,n,r){let i,a=n&&n[r],o=E(e);if(o||j(e)){let n=o&&an(e),r=!1,s=!1;n&&(r=!sn(e),s=on(e),e=yt(e)),i=Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;rlo(e)?!(e.type===Qa||e.type===Xa&&!yi(e.children)):!0)?e:null}function bi(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:fe(r)]=e[r];return n}const xi=e=>e?Io(e)?Ko(e):xi(e.parent):null,Si=S(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>xi(e.parent),$root:e=>xi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Li(e),$forceUpdate:e=>e.f||=()=>{Yn(e.update)},$nextTick:e=>e.n||=qn.bind(e.proxy),$watch:e=>Fa.bind(e)}),Ci=(e,t)=>e!==g&&!e.__isScriptSetup&&T(e,t),wi={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e,l;if(t[0]!==`$`){let s=o[t];if(s!==void 0)switch(s){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Ci(r,t))return o[t]=1,r[t];else if(i!==g&&T(i,t))return o[t]=2,i[t];else if((l=e.propsOptions[0])&&T(l,t))return o[t]=3,a[t];else if(n!==g&&T(n,t))return o[t]=4,n[t];else Mi&&(o[t]=0)}let u=Si[t],d,f;if(u)return t===`$attrs`&&ht(e.attrs,`get`,``),u(e);if((d=s.__cssModules)&&(d=d[t]))return d;if(n!==g&&T(n,t))return o[t]=4,n[t];if(f=c.config.globalProperties,T(f,t))return f[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Ci(i,t)?(i[t]=n,!0):r!==g&&T(r,t)?(r[t]=n,!0):T(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:a}},o){let s;return!!n[o]||e!==g&&T(e,o)||Ci(t,o)||(s=a[0])&&T(s,o)||T(r,o)||T(Si,o)||T(i.config.globalProperties,o)},defineProperty(e,t,n){return n.get==null?T(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function Ti(){return Di().slots}function Ei(){return Di().attrs}function Di(){let e=jo();return e.setupContext||=Go(e)}function Oi(e){return E(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function ki(e,t){let n=Oi(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?E(r)||A(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function Ai(e,t){return!e||!t?e||t:E(e)&&E(t)?e.concat(t):S({},Oi(e),Oi(t))}function ji(e){let t=jo(),n=e();return Fo(),ee(n)&&(n=n.catch(e=>{throw Po(t),e})),[n,()=>Po(t)]}let Mi=!0;function Ni(e){let t=Li(e),n=e.proxy,r=e.ctx;Mi=!1,t.beforeCreate&&Fi(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:m,activated:h,deactivated:g,beforeDestroy:_,beforeUnmount:y,destroyed:b,unmounted:x,render:S,renderTracked:C,renderTriggered:w,errorCaptured:T,serverPrefetch:D,expose:O,inheritAttrs:k,components:j,directives:M,filters:ee}=t,te=null;if(l&&Pi(l,r,te),o)for(let e in o){let t=o[e];A(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);N(t)&&(e.data=$t(t))}if(Mi=!0,a)for(let e in a){let t=a[e],i=A(t)?t.bind(n,n):A(t.get)?t.get.bind(n,n):v,o=!A(t)&&A(t.set)?t.set.bind(n):v,s=V({get:i,set:o});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(s)for(let e in s)Ii(s[e],r,n,e);if(c){let e=A(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{Zi(t,e[t])})}u&&Fi(u,e,`c`);function P(e,t){E(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(P($r,d),P(ei,f),P(ti,p),P(ni,m),P(qr,h),P(Jr,g),P(ci,T),P(si,C),P(oi,w),P(ri,y),P(ii,x),P(ai,D),E(O))if(O.length){let t=e.exposed||={};O.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||={};S&&e.render===v&&(e.render=S),k!=null&&(e.inheritAttrs=k),j&&(e.components=j),M&&(e.directives=M),D&&Vr(e)}function Pi(e,t,n=v){for(let n in E(e)&&(e=Hi(e)),e){let r=e[n],i;i=N(r)?`default`in r?Qi(r.from||n,r.default,!0):Qi(r.from||n):Qi(r),pn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Fi(e,t,n){Ln(E(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ii(e,t,n,r){let i=r.includes(`.`)?Ia(n,r):()=>n[r];if(j(e)){let n=t[e];A(n)&&B(i,n)}else if(A(e))B(i,e.bind(n));else if(N(e))if(E(e))e.forEach(e=>Ii(e,t,n,r));else{let r=A(e.handler)?e.handler.bind(n):t[e.handler];A(r)&&B(i,r,e)}}function Li(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Ri(c,e,o,!0)),Ri(c,t,o)),N(t)&&a.set(t,c),c}function Ri(e,t,n,r=!1){let{mixins:i,extends:a}=t;for(let o in a&&Ri(e,a,n,!0),i&&i.forEach(t=>Ri(e,t,n,!0)),t)if(!(r&&o===`expose`)){let r=zi[o]||n&&n[o];e[o]=r?r(e[o],t[o]):t[o]}return e}const zi={data:Bi,props:Gi,emits:Gi,methods:Wi,computed:Wi,beforeCreate:Ui,created:Ui,beforeMount:Ui,mounted:Ui,beforeUpdate:Ui,updated:Ui,beforeDestroy:Ui,beforeUnmount:Ui,destroyed:Ui,unmounted:Ui,activated:Ui,deactivated:Ui,errorCaptured:Ui,serverPrefetch:Ui,components:Wi,directives:Wi,watch:Ki,provide:Bi,inject:Vi};function Bi(e,t){return t?e?function(){return S(A(e)?e.call(this,this):e,A(t)?t.call(this,this):t)}:t:e}function Vi(e,t){return Wi(Hi(e),Hi(t))}function Hi(e){if(E(e)){let t={};for(let n=0;n1)return n&&A(t)?t.call(r&&r.proxy):t}}function $i(){return!!(Ao||nr||Xi)}const ea={},ta=()=>Object.create(ea),na=e=>Object.getPrototypeOf(e)===ea;function ra(e,t,n,r=!1){let i={},a=ta();for(let n in e.propsDefaults=Object.create(null),aa(e,t,i,a),e.propsOptions[0])n in i||(i[n]=void 0);n?e.props=r?i:en(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function ia(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=ln(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{c=!0;let[n,r]=ca(e,t,!0);S(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return N(e)&&r.set(e,_),_;if(E(a))for(let e=0;ee[0]===`_`||e===`$stable`,da=e=>E(e)?e.map(So):[So(e)],fa=(e,t,n)=>{if(t._n)return t;let r=cr((...e)=>da(t(...e)),n);return r._c=!1,r},pa=(e,t,n)=>{let r=e._ctx;for(let n in e){if(ua(n))continue;let i=e[n];if(A(i))t[n]=fa(n,i,r);else if(i!=null){let e=da(i);t[n]=()=>e}}},ma=(e,t)=>{let n=da(t);e.slots.default=()=>n},ha=(e,t,n)=>{for(let r in t)(n||!ua(r))&&(e[r]=t[r])},ga=(e,t,n)=>{let r=e.slots=ta();if(e.vnode.shapeFlag&32){let e=t._;e?(ha(r,t,n),n&&me(r,`_`,e,!0)):pa(t,r)}else t&&ma(e,t)},_a=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=g;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:ha(i,t,n):(a=!t.$stable,pa(t,i)),o=t}else t&&(ma(e,t),o={default:1});if(a)for(let e in i)!ua(e)&&o[e]==null&&delete i[e]};function va(){let e=[]}const ya=Ya;function ba(e){return xa(e)}function xa(e,t){va();let n=_e();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=v,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!uo(e,t)&&(r=me(e),le(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Za:y(e,t,n,r);break;case Qa:b(e,t,n,r);break;case $a:e??x(t,n,r,o);break;case Xa:N(e,t,n,r,i,a,o,s,c);break;default:d&1?T(e,t,n,r,i,a,o,s,c):d&6?ee(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,I)}u!=null&&i&&Hr(u,e&&e.ref,a,t||e,!t)},y=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},S=(e,t,n,r)=>{if(t.children!==e.children){let i=f(e.anchor);w(e),[t.el,t.anchor]=m(t.children,n,i,r)}else t.el=e.el,t.anchor=e.anchor},C=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},w=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},T=(e,t,n,r,i,a,o,s,c)=>{t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null?D(t,n,r,i,a,o,s,c):A(e,t,i,a,o,s,c)},D=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&k(e.children,f,null,i,s,Sa(e,c),l,d),_&&ur(e,null,i,`created`),O(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!ae(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&Eo(p,i,e)}_&&ur(e,null,i,`beforeMount`);let v=wa(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&ya(()=>{p&&Eo(p,i,e),v&&g.enter(f),_&&ur(e,null,i,`mounted`)},s)},O=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t{for(let l=c;l{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||g,m=t.props||g,h;if(n&&Ca(n,!1),(h=m.onVnodeBeforeUpdate)&&Eo(h,n,t,e),f&&ur(t,e,n,`beforeUpdate`),n&&Ca(n,!0),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?j(e.dynamicChildren,d,c,n,r,Sa(t,i),o):s||ie(e,t,c,null,n,r,Sa(t,i),o,!1),l>0){if(l&16)M(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t{h&&Eo(h,n,t,e),f&&ur(t,e,n,`updated`)},r)},j=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(t!==n){if(t!==g)for(let o in t)!ae(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(ae(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},N=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),k(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren?(j(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Ta(e,t,!0)):ie(e,t,n,f,a,o,c,l,u)},ee=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):te(t,n,r,i,a,o,c):P(e,t,c)},te=(e,t,n,r,i,a,o)=>{let s=e.component=ko(e,r,i);if(Kr(e)&&(s.ctx.renderer=I),Ro(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,ne,o),!e.el){let e=s.subTree=ho(Qa);b(null,e,t,n)}}else ne(s,e,t,n,i,a,o)},P=(e,t,n)=>{let r=t.component=e.component;if(Ga(e,t,n))if(r.asyncDep&&!r.asyncResolved){re(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},ne=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:c,vnode:l}=e;{let n=Da(e);if(n){t&&(t.el=l.el,re(e,t,o)),n.asyncDep.then(()=>{e.isUnmounted||s()});return}}let u=t,f;Ca(e,!1),t?(t.el=l.el,re(e,t,o)):t=l,n&&F(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&Eo(f,c,t,l),Ca(e,!0);let p=Ha(e),m=e.subTree;e.subTree=p,h(m,p,d(m.el),me(m),e,i,a),t.el=p.el,u===null&&qa(e,p.el),r&&ya(r,i),(f=t.props&&t.props.onVnodeUpdated)&&ya(()=>Eo(f,c,t,l),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Gr(t);if(Ca(e,!1),l&&F(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Eo(o,d,t),Ca(e,!0),s&&ve){let t=()=>{e.subTree=Ha(e),ve(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._injectChildStyle(p);let o=e.subTree=Ha(e);h(null,o,n,r,e,i,a),t.el=o.el}if(u&&ya(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;ya(()=>Eo(o,d,e),i)}(t.shapeFlag&256||d&&Gr(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&ya(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Ue(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Yn(u),Ca(e,!0),l()},re=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,ia(e,t.props,r,n),_a(e,t.children,n),it(),Qn(e),at()},ie=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){se(l,f,n,r,i,a,o,s,c);return}else if(p&256){oe(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&pe(l,i,a),f!==l&&u(n,f)):d&16?m&16?se(l,f,n,r,i,a,o,s,c):pe(l,i,a,!0):(d&8&&u(n,``),m&16&&k(f,n,r,i,a,o,s,c))},oe=(e,t,n,r,i,a,o,s,c)=>{e||=_,t||=_;let l=e.length,u=t.length,d=Math.min(l,u),f;for(f=0;fu?pe(e,i,a,!0,!1,d):k(t,n,r,i,a,o,s,c,d)},se=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?Co(t[l]):So(t[l]);if(uo(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?Co(t[f]):So(t[f]);if(uo(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=ef)for(;l<=d;)le(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?Co(t[l]):So(t[l]);e.key!=null&&g.set(e.key,l)}let v,y=0,b=f-m+1,x=!1,S=0,C=Array(b);for(l=0;l=b){le(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(v=m;v<=f;v++)if(C[v-m]===0&&uo(r,t[v])){u=v;break}u===void 0?le(r,i,a,!0):(C[u-m]=l+1,u>=S?S=u:x=!0,h(r,t[u],n,null,i,a,o,s,c),y++)}let w=x?Ea(C):_;for(v=w.length-1,l=b-1;l>=0;l--){let e=m+l,d=t[e],f=e+1{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){ce(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,I);return}if(c===Xa){r(s,t,n);for(let e=0;el.enter(s),o);else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}else r(s,t,n)},le=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p}=e;if(d===-2&&(i=!1),s!=null&&(it(),Hr(s,null,n,e,!0),at()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let m=u&1&&f,h=!Gr(e),g;if(h&&(g=o&&o.onVnodeBeforeUnmount)&&Eo(g,t,e),u&6)fe(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}m&&ur(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,I,r):l&&!l.hasOnce&&(a!==Xa||d>0&&d&64)?pe(l,t,n,!1,!0):(a===Xa&&d&384||!i&&u&16)&&pe(c,t,n),r&&ue(e)}(h&&(g=o&&o.onVnodeUnmounted)||m)&&ya(()=>{g&&Eo(g,t,e),m&&ur(e,null,t,`unmounted`)},n)},ue=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===Xa){de(n,r);return}if(t===$a){w(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},de=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},fe=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l,parent:u,slots:{__:d}}=e;Oa(c),Oa(l),r&&F(r),u&&E(d)&&d.forEach(e=>{u.renderCache[e]=void 0}),i.stop(),a&&(a.flags|=8,le(o,e,t,n)),s&&ya(s,t),ya(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,t.deps===0&&t.resolve())},pe=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return me(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[dr];return n?f(n):t},he=!1,ge=(e,t,n)=>{e==null?t._vnode&&le(t._vnode,null,null,!0):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e,he||(he=!0,Qn(),$n(),he=!1)},I={p:h,um:le,m:ce,r:ue,mt:te,mc:k,pc:ie,pbc:j,n:me,o:e},L,ve;return t&&([L,ve]=t(I)),{render:ge,hydrate:L,createApp:Yi(ge,L)}}function Sa({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Ca({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function wa(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ta(e,t,n=!1){let r=e.children,i=t.children;if(E(r)&&E(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-- >0;)n[a]=o,o=t[o];return n}function Da(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Da(t)}function Oa(e){if(e)for(let t=0;t{{let e=Qi(ka);return e}};function ja(e,t){return Pa(e,null,t)}function Ma(e,t){return Pa(e,null,{flush:`post`})}function Na(e,t){return Pa(e,null,{flush:`sync`})}function B(e,t,n){return Pa(e,t,n)}function Pa(e,t,n=g){let{immediate:r,deep:i,flush:a,once:o}=n,s=S({},n),c=t&&r||!t&&a!==`post`,l;if(Lo){if(a===`sync`){let e=Aa();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=v,e.resume=v,e.pause=v,e}}let u=Ao;s.call=(e,t,n)=>Ln(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{ya(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():Yn(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=Pn(e,t,s);return Lo&&(l?l.push(f):c&&f()),f}function Fa(e,t,n){let r=this.proxy,i=j(e)?e.includes(`.`)?Ia(r,e):()=>r[e]:e.bind(r,r),a;A(t)?a=t:(a=t.handler,n=t);let o=Po(this),s=Pa(i,a.bind(r),n);return o(),s}function Ia(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e{let c,l=g,u;return Na(()=>{let t=e[i];pe(c,t)&&(c=t,s())}),{get(){return o(),n.get?n.get(c):c},set(e){let o=n.set?n.set(e):e;if(!pe(o,c)&&!(l!==g&&pe(e,l)))return;let d=r.vnode.props;d&&(t in d||i in d||a in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${a}`in d)||(c=e,s()),r.emit(`update:${t}`,o),pe(e,o)&&pe(e,l)&&!pe(o,u)&&s(),l=e,u=o}}});return s[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?o||g:s,done:!1}:{done:!0}}}},s}const Ra=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${ce(t)}Modifiers`]||e[`${ue(t)}Modifiers`];function za(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||g,i=n,a=t.startsWith(`update:`),o=a&&Ra(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>j(e)?e.trim():e)),o.number&&(i=n.map(he)));let s,c=r[s=fe(t)]||r[s=fe(ce(t))];!c&&a&&(c=r[s=fe(ue(t))]),c&&Ln(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Ln(l,e,6,i)}}function Ba(e,t,n=!1){let r=t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!A(e)){let r=e=>{let n=Ba(e,t,!0);n&&(s=!0,S(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(N(e)&&r.set(e,null),null):(E(a)?a.forEach(e=>o[e]=null):S(o,a),N(e)&&r.set(e,o),o)}function Va(e,t){return!e||!b(t)?!1:(t=t.slice(2).replace(/Once$/,``),T(e,t[0].toLowerCase()+t.slice(1))||T(e,ue(t))||T(e,t))}function Ha(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=ir(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=So(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=So(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:Ua(s)}}catch(t){eo.length=0,Rn(t,e,1),_=ho(Qa)}let y=_,b;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some(x)&&(v=Wa(v,a)),y=vo(y,v,!1,!0))}return n.dirs&&(y=vo(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Lr(y,n.transition),_=y,ir(g),_}const Ua=e=>{let t;for(let n in e)(n===`class`||n===`style`||b(n))&&((t||={})[n]=e[n]);return t},Wa=(e,t)=>{let n={};for(let r in e)(!x(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ga(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Ka(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;te.__isSuspense;function Ya(e,t){t&&t.pendingBranch?E(e)?t.effects.push(...e):t.effects.push(e):Zn(e)}const Xa=Symbol.for(`v-fgt`),Za=Symbol.for(`v-txt`),Qa=Symbol.for(`v-cmt`),$a=Symbol.for(`v-stc`),eo=[];let to=null;function no(e=!1){eo.push(to=e?null:[])}function ro(){eo.pop(),to=eo[eo.length-1]||null}let io=1;function ao(e,t=!1){io+=e,e<0&&to&&t&&(to.hasOnce=!0)}function oo(e){return e.dynamicChildren=io>0?to||_:null,ro(),io>0&&to&&to.push(e),e}function so(e,t,n,r,i,a){return oo(mo(e,t,n,r,i,a,!0))}function co(e,t,n,r,i){return oo(ho(e,t,n,r,i,!0))}function lo(e){return e?e.__v_isVNode===!0:!1}function uo(e,t){return e.type===t.type&&e.key===t.key}const fo=({key:e})=>e??null,po=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:j(e)||pn(e)||A(e)?{i:nr,r:e,k:t,f:!!n}:e);function mo(e,t=null,n=null,r=0,i=null,a=e===Xa?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&fo(t),ref:t&&po(t),scopeId:rr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:nr};return s?(wo(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=j(n)?8:16),io>0&&!o&&to&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&to.push(c),c}const ho=go;function go(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===fi)&&(e=Qa),lo(e)){let r=vo(e,t,!0);return n&&wo(r,n),io>0&&!a&&to&&(r.shapeFlag&6?to[to.indexOf(e)]=r:to.push(r)),r.patchFlag=-2,r}if(Jo(e)&&(e=e.__vccOpts),t){t=_o(t);let{class:e,style:n}=t;e&&!j(e)&&(t.class=Se(e)),N(n)&&(cn(n)&&!E(n)&&(n=S({},n)),t.style=L(n))}let o=j(e)?1:Ja(e)?128:fr(e)?64:N(e)?4:A(e)?2:0;return mo(e,t,n,r,i,o,a,!0)}function _o(e){return e?cn(e)||na(e)?S({},e):e:null}function vo(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?To(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&fo(l),ref:t&&t.ref?n&&a?E(a)?a.concat(po(t)):[a,po(t)]:po(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Xa?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&vo(e.ssContent),ssFallback:e.ssFallback&&vo(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Lr(u,c.clone(u)),u}function yo(e=` `,t=0){return ho(Za,null,e,t)}function bo(e,t){let n=ho($a,null,e);return n.staticCount=t,n}function xo(e=``,t=!1){return t?(no(),co(Qa,null,e)):ho(Qa,null,e)}function So(e){return e==null||typeof e==`boolean`?ho(Qa):E(e)?ho(Xa,null,e.slice()):lo(e)?Co(e):ho(Za,null,String(e))}function Co(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:vo(e)}function wo(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(E(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),wo(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!na(t)?t._ctx=nr:r===3&&nr&&(nr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else A(t)?(t={default:t,_ctx:nr},n=32):(t=String(t),r&64?(n=16,t=[yo(t)]):n=8);e.children=t,e.shapeFlag|=n}function To(...e){let t={};for(let n=0;nAo||nr;let Mo,No;{let e=_e(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Mo=t(`__VUE_INSTANCE_SETTERS__`,e=>Ao=e),No=t(`__VUE_SSR_SETTERS__`,e=>Lo=e)}const Po=e=>{let t=Ao;return Mo(e),e.scope.on(),()=>{e.scope.off(),Mo(t)}},Fo=()=>{Ao&&Ao.scope.off(),Mo(null)};function Io(e){return e.vnode.shapeFlag&4}let Lo=!1;function Ro(e,t=!1,n=!1){t&&No(t);let{props:r,children:i}=e.vnode,a=Io(e);ra(e,r,a,t),ga(e,i,n||t);let o=a?zo(e,t):void 0;return t&&No(!1),o}function zo(e,t){var n;let r=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wi);let{setup:i}=r;if(i){it();let n=e.setupContext=i.length>1?Go(e):null,r=Po(e),a=In(i,e,0,[e.props,n]),o=ee(a);if(at(),r(),(o||e.sp)&&!Gr(e)&&Vr(e),o){if(a.then(Fo,Fo),t)return a.then(n=>{Bo(e,n,t)}).catch(t=>{Rn(t,e,0)});e.asyncDep=a}else Bo(e,a,t)}else Uo(e,t)}function Bo(e,t,n){A(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:N(t)&&(e.setupState=bn(t)),Uo(e,n)}let Vo,Ho;function Uo(e,t,n){let r=e.type;if(!e.render){if(!t&&Vo&&!r.render){let t=r.template||Li(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r,s=S(S({isCustomElement:n,delimiters:a},i),o);r.render=Vo(t,s)}}e.render=r.render||v,Ho&&Ho(e)}{let t=Po(e);it();try{Ni(e)}finally{at(),t()}}}const Wo={get(e,t){return ht(e,`get`,``),e[t]}};function Go(e){let t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,Wo),slots:e.slots,emit:e.emit,expose:t}}function Ko(e){return e.exposed?e.exposeProxy||=new Proxy(bn(un(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Si)return Si[n](e)},has(e,t){return t in e||t in Si}}):e.proxy}function qo(e,t=!0){return A(e)?e.displayName||e.name:e.name||t&&e.__name}function Jo(e){return A(e)&&`__vccOpts`in e}const V=(e,t)=>{let n=kn(e,t,Lo);return n};function Yo(e,t,n){let r=arguments.length;return r===2?N(t)&&!E(t)?lo(t)?ho(e,null,[t]):ho(e,t):ho(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&lo(n)&&(n=[n]),ho(e,t,n))}const Xo=`3.5.16`;let Zo;const Qo=typeof window<`u`&&window.trustedTypes;if(Qo)try{Zo=Qo.createPolicy(`vue`,{createHTML:e=>e})}catch{}const $o=Zo?e=>Zo.createHTML(e):e=>e,es=`http://www.w3.org/2000/svg`,ts=`http://www.w3.org/1998/Math/MathML`,ns=typeof document<`u`?document:null,rs=ns&&ns.createElement(`template`),os={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?ns.createElementNS(es,e):t===`mathml`?ns.createElementNS(ts,e):n?ns.createElement(e,{is:n}):ns.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>ns.createTextNode(e),createComment:e=>ns.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ns.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{rs.innerHTML=$o(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=rs.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ss=`transition`,cs=`animation`,ls=Symbol(`_vtc`),us={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ds=S({},Or,us),fs=e=>(e.displayName=`Transition`,e.props=ds,e),ps=fs((e,{slots:t})=>Yo(Mr,gs(e),t)),ms=(e,t=[])=>{E(e)?e.forEach(e=>e(...t)):e&&e(...t)},hs=e=>e?E(e)?e.some(e=>e.length>1):e.length>1:!1;function gs(e){let t={};for(let n in e)n in us||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=_s(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:y,onLeave:b,onLeaveCancelled:x,onBeforeAppear:C=_,onAppear:w=v,onAppearCancelled:T=y}=t,E=(e,t,n,r)=>{e._enterCancelled=r,bs(e,t?u:s),bs(e,t?l:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,bs(e,d),bs(e,p),bs(e,f),t&&t()},O=e=>(t,n)=>{let i=e?w:v,o=()=>E(t,e,n);ms(i,[t,o]),xs(()=>{bs(t,e?c:a),ys(t,e?u:s),hs(i)||Cs(t,r,h,o)})};return S(t,{onBeforeEnter(e){ms(_,[e]),ys(e,a),ys(e,o)},onBeforeAppear(e){ms(C,[e]),ys(e,c),ys(e,l)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);ys(e,d),e._enterCancelled?(ys(e,f),Ds()):(Ds(),ys(e,f)),xs(()=>{e._isLeaving&&(bs(e,d),ys(e,p),hs(b)||Cs(e,r,g,n))}),ms(b,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),ms(y,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),ms(T,[e])},onLeaveCancelled(e){D(e),ms(x,[e])}})}function _s(e){if(e==null)return null;if(N(e))return[vs(e.enter),vs(e.leave)];{let t=vs(e);return[t,t]}}function vs(e){let t=ge(e);return t}function ys(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[ls]||(e[ls]=new Set)).add(t)}function bs(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[ls];n&&(n.delete(t),n.size||(e[ls]=void 0))}function xs(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Ss=0;function Cs(e,t,n,r){let i=e._endId=++Ss,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=ws(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${ss}Delay`),a=r(`${ss}Duration`),o=Ts(i,a),s=r(`${cs}Delay`),c=r(`${cs}Duration`),l=Ts(s,c),u=null,d=0,f=0;t===ss?o>0&&(u=ss,d=o,f=a.length):t===cs?l>0&&(u=cs,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?ss:cs:null,f=u?u===ss?a.length:c.length:0);let p=u===ss&&/\b(transform|all)(,|$)/.test(r(`${ss}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Ts(e,t){for(;e.lengthEs(t)+Es(e[n])))}function Es(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Ds(){return document.body.offsetHeight}function Os(e,t,n){let r=e[ls];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}const ks=Symbol(`_vod`),As=Symbol(`_vsh`),js={beforeMount(e,{value:t},{transition:n}){e[ks]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Ms(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Ms(e,!0),r.enter(e)):r.leave(e,()=>{Ms(e,!1)}):Ms(e,t))},beforeUnmount(e,{value:t}){Ms(e,t)}};function Ms(e,t){e.style.display=t?e[ks]:`none`,e[As]=!t}const Ns=Symbol(``),Ps=/(^|;)\s*display\s*:/;function Fs(e,t,n){let r=e.style,i=j(n),a=!1;if(n&&!i){if(t)if(j(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Ls(r,t,``)}else for(let e in t)n[e]??Ls(r,e,``);for(let e in n)e===`display`&&(a=!0),Ls(r,e,n[e])}else if(i){if(t!==n){let e=r[Ns];e&&(n+=`;`+e),r.cssText=n,a=Ps.test(n)}}else t&&e.removeAttribute(`style`);ks in e&&(e[ks]=a?r.display:``,e[As]&&(r.display=`none`))}const Is=/\s*!important$/;function Ls(e,t,n){if(E(n))n.forEach(n=>Ls(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Bs(e,t);Is.test(n)?e.setProperty(ue(r),n.replace(Is,``),`important`):e[r]=n}}const Rs=[`Webkit`,`Moz`,`ms`],zs={};function Bs(e,t){let n=zs[t];if(n)return n;let r=ce(t);if(r!==`filter`&&r in e)return zs[t]=r;r=de(r);for(let n=0;nXs||(Zs.then(()=>Xs=0),Xs=Date.now());function $s(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;Ln(ec(e,n.value),t,5,[e])};return n.value=e,n.attached=Qs(),n}function ec(e,t){if(E(t)){let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}else return t}const tc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,nc=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Os(e,r,o):t===`style`?Fs(e,n,r):b(t)?x(t)||qs(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):rc(e,t,r,o))?(Us(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Hs(e,t,r,o,a,t!==`value`)):e._isVueCE&&(/[A-Z]/.test(t)||!j(r))?Us(e,ce(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Hs(e,t,r,o))};function rc(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&tc(t)&&A(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return tc(t)&&j(n)?!1:t in e}const ic=Symbol(`_moveCb`),ac=Symbol(`_enterCb`),oc=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return E(t)?e=>F(t,e):t};function sc(e){e.target.composing=!0}function cc(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}const lc=Symbol(`_assign`),uc={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[lc]=oc(i);let a=r||i.props&&i.props.type===`number`;Ws(e,t?`change`:`input`,t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),a&&(r=he(r)),e[lc](r)}),n&&Ws(e,`change`,()=>{e.value=e.value.trim()}),t||(Ws(e,`compositionstart`,sc),Ws(e,`compositionend`,cc),Ws(e,`change`,cc))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[lc]=oc(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?he(e.value):e.value,c=t??``;s!==c&&(document.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c))}},dc={deep:!0,created(e,t,n){e[lc]=oc(n),Ws(e,`change`,()=>{let t=e._modelValue,n=gc(e),r=e.checked,i=e[lc];if(E(t)){let e=Ae(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(O(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(_c(e,r))})},mounted:fc,beforeUpdate(e,t,n){e[lc]=oc(n),fc(e,t,n)}};function fc(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(E(t))i=Ae(t,r.props.value)>-1;else if(O(t))i=t.has(r.props.value);else{if(t===n)return;i=ke(t,_c(e,!0))}e.checked!==i&&(e.checked=i)}const pc={created(e,{value:t},n){e.checked=ke(t,n.props.value),e[lc]=oc(n),Ws(e,`change`,()=>{e[lc](gc(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[lc]=oc(r),t!==n&&(e.checked=ke(t,r.props.value))}},mc={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=O(t);Ws(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?he(gc(e)):gc(e));e[lc](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,qn(()=>{e._assigning=!1})}),e[lc]=oc(r)},mounted(e,{value:t}){hc(e,t)},beforeUpdate(e,t,n){e[lc]=oc(n)},updated(e,{value:t}){e._assigning||hc(e,t)}};function hc(e,t){let n=e.multiple,r=E(t);if(!(n&&!r&&!O(t))){for(let i=0,a=e.options.length;iString(e)===String(o)):a.selected=Ae(t,o)>-1}else a.selected=t.has(o);else if(ke(gc(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function gc(e){return`_value`in e?e._value:e.value}function _c(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}const vc={created(e,t,n){bc(e,t,n,null,`created`)},mounted(e,t,n){bc(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){bc(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){bc(e,t,n,r,`updated`)}};function yc(e,t){switch(e){case`SELECT`:return mc;case`TEXTAREA`:return uc;default:switch(t){case`checkbox`:return dc;case`radio`:return pc;default:return uc}}}function bc(e,t,n,r,i){let a=yc(e.tagName,n.props&&n.props.type),o=a[i];o&&o(e,t,n,r)}const xc=[`ctrl`,`shift`,`alt`,`meta`],Sc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>xc.some(n=>e[`${n}Key`]&&!t.includes(n))},Cc=(e,t)=>{let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=(n,...r)=>{for(let e=0;e{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=n=>{if(!(`key`in n))return;let r=ue(n.key);if(t.some(e=>e===r||wc[e]===r))return e(n)})},Ec=S({patchProp:nc},os);let Dc;function Oc(){return Dc||=ba(Ec)}const kc=(...e)=>{Oc().render(...e)},Ac=(...e)=>{let t=Oc().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Mc(e);if(!r)return;let i=t._component;!A(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,jc(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t};function jc(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Mc(e){if(j(e)){let t=document.querySelector(e);return t}return e}const Nc=new Set,Pc=new WeakMap,Fc=new WeakMap,Ic=new WeakMap,Lc=new WeakMap,Rc=new WeakMap,zc=new WeakMap,Bc=new WeakMap,Vc=new WeakSet;let Hc,Uc=0,Wc=0;const Gc=`__aa_tgt`,Kc=`__aa_del`,qc=`__aa_new`,Jc=e=>{let t=il(e);t&&t.forEach(e=>ol(e))},Yc=e=>{e.forEach(e=>{e.target===Hc&&Qc(),Pc.has(e.target)&&Zc(e.target)})};function Xc(e){let t=Lc.get(e);t?.disconnect();let n=Pc.get(e),r=0,i=5;n||(n=ll(e),Pc.set(e,n));let{offsetWidth:a,offsetHeight:o}=Hc,s=[n.top-i,a-(n.left+i+n.width),o-(n.top+i+n.height),n.left-i],c=s.map(e=>`${-1*Math.floor(e)}px`).join(` `),l=new IntersectionObserver(()=>{++r>1&&Zc(e)},{root:Hc,threshold:1,rootMargin:c});l.observe(e),Lc.set(e,l)}function Zc(e){clearTimeout(Bc.get(e));let t=dl(e),n=gl(t)?500:t.duration;Bc.set(e,setTimeout(async()=>{let t=Ic.get(e);try{await t?.finished,Pc.set(e,ll(e)),Xc(e)}catch{}},n))}function Qc(){clearTimeout(Bc.get(Hc)),Bc.set(Hc,setTimeout(()=>{Nc.forEach(e=>ml(e,e=>el(()=>Zc(e))))},100))}function $c(e){setTimeout(()=>{Rc.set(e,setInterval(()=>el(Zc.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function el(e){typeof requestIdleCallback==`function`?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let tl,nl;const rl=typeof window<`u`&&`ResizeObserver`in window;rl&&(Hc=document.documentElement,tl=new MutationObserver(Jc),nl=new ResizeObserver(Yc),window.addEventListener(`scroll`,()=>{Wc=window.scrollY,Uc=window.scrollX}),nl.observe(Hc));function il(e){let t=e.reduce((e,t)=>[...e,...Array.from(t.addedNodes),...Array.from(t.removedNodes)],[]),n=t.every(e=>e.nodeName===`#comment`);return n?!1:e.reduce((e,t)=>{if(e===!1)return!1;if(t.target instanceof Element){if(al(t.target),!e.has(t.target)){e.add(t.target);for(let n=0;nt(e,zc.has(e)));for(let n=0;ne(r,zc.has(r)))}}function hl(e){return Array.isArray(e)?e:[e]}function gl(e){return typeof e==`function`}function _l(e){let t=Pc.get(e),n=ll(e);if(!pl(e))return Pc.set(e,n);let r;if(!t)return;let i=dl(e);if(typeof i!=`function`){let a=t.left-n.left,o=t.top-n.top,[s,c,l,u]=ul(e,t,n),d={transform:`translate(${a}px, ${o}px)`},f={transform:`translate(0, 0)`};s!==c&&(d.width=`${s}px`,f.width=`${c}px`),l!==u&&(d.height=`${l}px`,f.height=`${u}px`),r=e.animate([d,f],{duration:i.duration,easing:i.easing})}else{let[a]=hl(i(e,`remain`,t,n));r=new Animation(a),r.play()}Ic.set(e,r),Pc.set(e,n),r.addEventListener(`finish`,Zc.bind(null,e))}function vl(e){qc in e&&delete e[qc];let t=ll(e);Pc.set(e,t);let n=dl(e);if(!pl(e))return;let r;if(typeof n!=`function`)r=e.animate([{transform:`scale(.98)`,opacity:0},{transform:`scale(0.98)`,opacity:0,offset:.5},{transform:`scale(1)`,opacity:1}],{duration:n.duration*1.5,easing:`ease-in`});else{let[i]=hl(n(e,`add`,t));r=new Animation(i),r.play()}Ic.set(e,r),r.addEventListener(`finish`,Zc.bind(null,e))}function yl(e,t){var n;e.remove(),Pc.delete(e),Fc.delete(e),Ic.delete(e),(n=Lc.get(e))==null||n.disconnect(),setTimeout(()=>{if(Kc in e&&delete e[Kc],Object.defineProperty(e,qc,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(let n in t)e.style[n]=``},0)}function bl(e){var t;if(!Fc.has(e)||!Pc.has(e))return;let[n,r]=Fc.get(e);Object.defineProperty(e,Kc,{value:!0,configurable:!0});let i=window.scrollX,a=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=fl(e))==null||t.appendChild(e),!pl(e))return yl(e);let[o,s,c,l]=Sl(e),u=dl(e),d=Pc.get(e);(i!==Uc||a!==Wc)&&xl(e,i,a,u);let f,p={position:`absolute`,top:`${o}px`,left:`${s}px`,width:`${c}px`,height:`${l}px`,margin:`0`,pointerEvents:`none`,transformOrigin:`center`,zIndex:`100`};if(!gl(u))Object.assign(e.style,p),f=e.animate([{transform:`scale(1)`,opacity:1},{transform:`scale(.98)`,opacity:0}],{duration:u.duration,easing:`ease-out`});else{let[t,n]=hl(u(e,`remove`,d));n?.styleReset!==!1&&(p=n?.styleReset||p,Object.assign(e.style,p)),f=new Animation(t),f.play()}Ic.set(e,f),f.addEventListener(`finish`,yl.bind(null,e,p))}function xl(e,t,n,r){let i=Uc-t,a=Wc-n,o=document.documentElement.style.scrollBehavior,s=getComputedStyle(Hc).scrollBehavior;if(s===`smooth`&&(document.documentElement.style.scrollBehavior=`auto`),window.scrollTo(window.scrollX+i,window.scrollY+a),!e.parentElement)return;let c=e.parentElement,l=c.clientHeight,u=c.clientWidth,d=performance.now();function f(){requestAnimationFrame(()=>{if(!gl(r)){let e=l-c.clientHeight,t=u-c.clientWidth;d+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-t,top:window.scrollY-e}),l=c.clientHeight,u=c.clientWidth,f()):document.documentElement.style.scrollBehavior=o}})}f()}function Sl(e){let t=Pc.get(e),[n,,r]=ul(e,t,ll(e)),i=e.parentElement;for(;i&&(getComputedStyle(i).position===`static`||i instanceof HTMLBodyElement);)i=i.parentElement;i||=document.body;let a=getComputedStyle(i),o=Pc.get(i)||ll(i),s=Math.round(t.top-o.top)-sl(a.borderTopWidth),c=Math.round(t.left-o.left)-sl(a.borderLeftWidth);return[s,c,n,r]}function Cl(e,t={}){if(tl&&nl){let n=window.matchMedia(`(prefers-reduced-motion: reduce)`),r=n.matches&&!gl(t)&&!t.disrespectUserMotionPreference;r||(Vc.add(e),getComputedStyle(e).position===`static`&&Object.assign(e.style,{position:`relative`}),ml(e,Zc,$c,e=>nl?.observe(e)),gl(t)?zc.set(e,t):zc.set(e,{duration:250,easing:`ease-in-out`,...t}),tl.observe(e,{childList:!0}),Nc.add(e))}return Object.freeze({parent:e,enable:()=>{Vc.add(e)},disable:()=>{Vc.delete(e)},isEnabled:()=>Vc.has(e)})}const wl={mounted:(e,t)=>{Cl(e,t.value||{})},getSSRProps:()=>({})},Tl=wl,El={install(e){e.directive(`auto-animate`,Tl)}},Dl=`177`,Ol={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},kl={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Al=0,jl=1,Ml=2,Nl=3,Pl=0,Fl=1,Il=2,Ll=3,Rl=0,zl=1,Bl=2,Vl=0,Hl=1,Ul=2,Wl=3,Gl=4,Kl=5,ql=100,Jl=101,Yl=102,Xl=103,Zl=104,Ql=200,$l=201,eu=202,tu=203,nu=204,ru=205,iu=206,au=207,ou=208,su=209,cu=210,lu=211,uu=212,du=213,fu=214,pu=0,mu=1,hu=2,gu=3,_u=4,vu=5,yu=6,bu=7,xu=0,Su=1,Cu=2,wu=0,Tu=1,Eu=2,Du=3,Ou=4,ku=5,Au=6,ju=7,Mu=`attached`,Nu=`detached`,Pu=300,Fu=301,Iu=302,Lu=303,Ru=304,zu=306,Bu=1e3,Vu=1001,Hu=1002,Uu=1003,Wu=1004,Gu=1004,Ku=1005,qu=1005,Ju=1006,Yu=1007,Xu=1007,Zu=1008,Qu=1008,$u=1009,ed=1010,td=1011,nd=1012,rd=1013,id=1014,ad=1015,od=1016,sd=1017,cd=1018,ld=1020,ud=35902,dd=1021,fd=1022,pd=1023,md=1026,hd=1027,gd=1028,_d=1029,vd=1030,yd=1031,bd=1032,xd=1033,Sd=33776,Cd=33777,wd=33778,Td=33779,Ed=35840,Dd=35841,Od=35842,kd=35843,Ad=36196,jd=37492,Md=37496,Nd=37808,Pd=37809,Fd=37810,Id=37811,Ld=37812,Rd=37813,zd=37814,Bd=37815,Vd=37816,Hd=37817,Ud=37818,Wd=37819,Gd=37820,Kd=37821,qd=36492,Jd=36494,Yd=36495,Xd=36283,Zd=36284,Qd=36285,$d=36286,ef=2200,tf=2201,nf=2202,rf=2300,af=2301,sf=2302,cf=2400,lf=2401,uf=2402,df=2500,ff=2501,pf=0,mf=1,hf=2,gf=3200,_f=3201,vf=3202,yf=3203,bf=0,xf=1,Sf=``,Cf=`srgb`,wf=`srgb-linear`,Tf=`linear`,Ef=`srgb`,Df=0,Of=7680,kf=7681,Af=7682,jf=7683,Mf=34055,Nf=34056,Pf=5386,Ff=512,If=513,Lf=514,Rf=515,zf=516,Bf=517,Vf=518,Hf=519,Uf=512,Wf=513,Gf=514,Kf=515,qf=516,Jf=517,Yf=518,Xf=519,Zf=35044,Qf=35048,$f=35040,ep=35045,tp=35049,np=35041,rp=35046,ip=35050,ap=35042,op=`100`,sp=`300 es`,cp=2e3,lp=2001,up={COMPUTE:`compute`,RENDER:`render`},dp={PERSPECTIVE:`perspective`,LINEAR:`linear`,FLAT:`flat`},fp={NORMAL:`normal`,CENTROID:`centroid`,SAMPLE:`sample`,FLAT_FIRST:`flat first`,FLAT_EITHER:`flat either`};var pp=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+mp[e>>16&255]+mp[e>>24&255]+`-`+mp[t&255]+mp[t>>8&255]+`-`+mp[t>>16&15|64]+mp[t>>24&255]+`-`+mp[n&63|128]+mp[n>>8&255]+`-`+mp[n>>16&255]+mp[n>>24&255]+mp[r&255]+mp[r>>8&255]+mp[r>>16&255]+mp[r>>24&255];return i.toLowerCase()}function yp(e,t,n){return Math.max(t,Math.min(n,e))}function bp(e,t){return(e%t+t)%t}function xp(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function Sp(e,t,n){return e===t?0:(n-e)/(t-e)}function Cp(e,t,n){return(1-n)*e+n*t}function wp(e,t,n,r){return Cp(e,t,1-Math.exp(-n*r))}function Tp(e,t=1){return t-Math.abs(bp(e,t*2)-t)}function Ep(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Dp(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Op(e,t){return e+Math.floor(Math.random()*(t-e+1))}function kp(e,t){return e+Math.random()*(t-e)}function Ap(e){return e*(.5-Math.random())}function jp(e){e!==void 0&&(hp=e);let t=hp+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Mp(e){return e*gp}function Np(e){return e*_p}function Pp(e){return(e&e-1)==0&&e!==0}function Fp(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Ip(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function Lp(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:console.warn(`THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function Rp(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function zp(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}const Bp={DEG2RAD:gp,RAD2DEG:_p,generateUUID:vp,clamp:yp,euclideanModulo:bp,mapLinear:xp,inverseLerp:Sp,lerp:Cp,damp:wp,pingpong:Tp,smoothstep:Ep,smootherstep:Dp,randInt:Op,randFloat:kp,randFloatSpread:Ap,seededRandom:jp,degToRad:Mp,radToDeg:Np,isPowerOfTwo:Pp,ceilPowerOfTwo:Fp,floorPowerOfTwo:Ip,setQuaternionFromProperEuler:Lp,normalize:zp,denormalize:Rp};var H=class e{constructor(t=0,n=0){e.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=yp(this.x,e.x,t.x),this.y=yp(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=yp(this.x,e,t),this.y=yp(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(yp(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){let e=Math.atan2(-this.y,-this.x)+Math.PI;return e}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(yp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Vp=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(o===0){e[t+0]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u;return}if(o===1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=m;return}if(u!==m||s!==d||c!==f||l!==p){let e=1-o,t=s*d+c*f+l*p+u*m,n=t>=0?1:-1,r=1-t*t;if(r>2**-52){let i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,o=Math.sin(o*a)/i}let i=o*n;if(s=s*e+d*i,c=c*e+f*i,l=l*e+p*i,u=u*e+m*i,e===1-o){let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:console.warn(`THREE.Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<2**-52?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(yp(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;let s=1-o*o;if(s<=2**-52){let e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}let c=Math.sqrt(s),l=Math.atan2(c,o),u=Math.sin((1-t)*l)/c,d=Math.sin(t*l)/c;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=r*u+this._y*d,this._z=i*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},U=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Up.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Up.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=yp(this.x,e.x,t.x),this.y=yp(this.y,e.y,t.y),this.z=yp(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=yp(this.x,e,t),this.y=yp(this.y,e,t),this.z=yp(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(yp(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Hp.copy(this).projectOnVector(e),this.sub(Hp)}reflect(e){return this.sub(Hp.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(yp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const Hp=new U,Up=new Vp;var Wp=class e{constructor(t,n,r,i,a,o,s,c,l){e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Gp.makeScale(e,t)),this}rotate(e){return this.premultiply(Gp.makeRotation(-e)),this}translate(e,t){return this.premultiply(Gp.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};const Gp=new Wp;function Kp(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}const qp={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Jp(e,t){return new qp[e](t)}function Yp(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function Xp(){let e=Yp(`canvas`);return e.style.display=`block`,e}const Zp={};function Qp(e){e in Zp||(Zp[e]=!0,console.warn(e))}function $p(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}function em(e){let t=e.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function tm(e){let t=e.elements,n=t[11]===-1;n?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const nm=new Wp().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),rm=new Wp().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function im(){let e={enabled:!0,workingColorSpace:wf,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===Ef&&(e.r=om(e.r),e.g=om(e.g),e.b=om(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===Ef&&(e.r=sm(e.r),e.g=sm(e.g),e.b=sm(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===Sf?Tf:this.spaces[e].transfer},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return Qp(`THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return Qp(`THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[wf]:{primaries:t,whitePoint:r,transfer:Tf,toXYZ:nm,fromXYZ:rm,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Cf},outputColorSpaceConfig:{drawingBufferColorSpace:Cf}},[Cf]:{primaries:t,whitePoint:r,transfer:Ef,toXYZ:nm,fromXYZ:rm,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Cf}}}),e}const am=im();function om(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function sm(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}let cm;var lm=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{cm===void 0&&(cm=Yp(`canvas`)),cm.width=e.width,cm.height=e.height;let t=cm.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=cm}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=Yp(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1),this.pmremVersion=0}get width(){return this.source.getSize(mm).x}get height(){return this.source.getSize(mm).y}get depth(){return this.source.getSize(mm).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==Pu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Bu:e.x-=Math.floor(e.x);break;case Vu:e.x=e.x<0?0:1;break;case Hu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Bu:e.y-=Math.floor(e.y);break;case Vu:e.y=e.y<0?0:1;break;case Hu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};hm.DEFAULT_IMAGE=null,hm.DEFAULT_MAPPING=Pu,hm.DEFAULT_ANISOTROPY=1;var gm=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)s&&e>_?e_?s1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Tm),Tm.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Nm),Pm.subVectors(this.max,Nm),Dm.subVectors(e.a,Nm),Om.subVectors(e.b,Nm),km.subVectors(e.c,Nm),Am.subVectors(Om,Dm),jm.subVectors(km,Om),Mm.subVectors(Dm,km);let t=[0,-Am.z,Am.y,0,-jm.z,jm.y,0,-Mm.z,Mm.y,Am.z,0,-Am.x,jm.z,0,-jm.x,Mm.z,0,-Mm.x,-Am.y,Am.x,0,-jm.y,jm.x,0,-Mm.y,Mm.x,0];return!Lm(t,Dm,Om,km,Pm)||(t=[1,0,0,0,1,0,0,0,1],!Lm(t,Dm,Om,km,Pm))?!1:(Fm.crossVectors(Am,jm),t=[Fm.x,Fm.y,Fm.z],Lm(t,Dm,Om,km,Pm))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Tm).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Tm).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(wm[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),wm[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),wm[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),wm[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),wm[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),wm[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),wm[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),wm[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(wm),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}};const wm=[new U,new U,new U,new U,new U,new U,new U,new U],Tm=new U,Em=new Cm,Dm=new U,Om=new U,km=new U,Am=new U,jm=new U,Mm=new U,Nm=new U,Pm=new U,Fm=new U,Im=new U;function Lm(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Im.fromArray(e,a);let o=i.x*Math.abs(Im.x)+i.y*Math.abs(Im.y)+i.z*Math.abs(Im.z),s=t.dot(Im),c=n.dot(Im),l=r.dot(Im);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}const Rm=new Cm,zm=new U,Bm=new U;var Vm=class{constructor(e=new U,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Rm.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;zm.subVectors(e,this.center);let t=zm.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(zm,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Bm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(zm.copy(e.center).add(Bm)),this.expandByPoint(zm.copy(e.center).sub(Bm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}};const Hm=new U,Um=new U,Wm=new U,Gm=new U,Km=new U,qm=new U,Jm=new U;var Ym=class{constructor(e=new U,t=new U(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Hm)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Hm.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Hm.copy(this.origin).addScaledVector(this.direction,t),Hm.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Um.copy(e).add(t).multiplyScalar(.5),Wm.copy(t).sub(e).normalize(),Gm.copy(this.origin).sub(Um);let i=e.distanceTo(t)*.5,a=-this.direction.dot(Wm),o=Gm.dot(this.direction),s=-Gm.dot(Wm),c=Gm.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Um).addScaledVector(Wm,d),f}intersectSphere(e,t){Hm.subVectors(e.center,this.origin);let n=Hm.dot(this.direction),r=Hm.dot(Hm)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);if(t===0)return!0;let n=e.normal.dot(this.direction);return n*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Hm)!==null}intersectTriangle(e,t,n,r,i){Km.subVectors(t,e),qm.subVectors(n,e),Jm.crossVectors(Km,qm);let a=this.direction.dot(Jm),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Gm.subVectors(this.origin,e);let s=o*this.direction.dot(qm.crossVectors(Gm,qm));if(s<0)return null;let c=o*this.direction.dot(Km.cross(Gm));if(c<0||s+c>a)return null;let l=-o*Gm.dot(Jm);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},W=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,r=1/Xm.setFromMatrixColumn(e,0).length(),i=1/Xm.setFromMatrixColumn(e,1).length(),a=1/Xm.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Qm,e,$m)}lookAt(e,t,n){let r=this.elements;return nh.subVectors(e,t),nh.lengthSq()===0&&(nh.z=1),nh.normalize(),eh.crossVectors(n,nh),eh.lengthSq()===0&&(Math.abs(n.z)===1?nh.x+=1e-4:nh.z+=1e-4,nh.normalize(),eh.crossVectors(n,nh)),eh.normalize(),th.crossVectors(nh,eh),r[0]=eh.x,r[4]=th.x,r[8]=nh.x,r[1]=eh.y,r[5]=th.y,r[9]=nh.y,r[2]=eh.z,r[6]=th.z,r[10]=nh.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],M=r[14],N=r[3],ee=r[7],te=r[11],P=r[15];return i[0]=a*x+o*T+s*k+c*N,i[4]=a*S+o*E+s*A+c*ee,i[8]=a*C+o*D+s*j+c*te,i[12]=a*w+o*O+s*M+c*P,i[1]=l*x+u*T+d*k+f*N,i[5]=l*S+u*E+d*A+f*ee,i[9]=l*C+u*D+d*j+f*te,i[13]=l*w+u*O+d*M+f*P,i[2]=p*x+m*T+h*k+g*N,i[6]=p*S+m*E+h*A+g*ee,i[10]=p*C+m*D+h*j+g*te,i[14]=p*w+m*O+h*M+g*P,i[3]=_*x+v*T+y*k+b*N,i[7]=_*S+v*E+y*A+b*ee,i[11]=_*C+v*D+y*j+b*te,i[15]=_*w+v*O+y*M+b*P,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15];return p*(+i*s*u-r*c*u-i*o*d+n*c*d+r*o*f-n*s*f)+m*(+t*s*f-t*c*d+i*a*d-r*a*f+r*c*l-i*s*l)+h*(+t*c*u-t*o*f-i*a*u+n*a*f+i*o*l-n*c*l)+g*(-r*o*l-t*s*u+t*o*d+r*a*u-n*a*d+n*s*l)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=u*h*c-m*d*c+m*s*f-o*h*f-u*s*g+o*d*g,v=p*d*c-l*h*c-p*s*f+a*h*f+l*s*g-a*d*g,y=l*m*c-p*u*c+p*o*f-a*m*f-l*o*g+a*u*g,b=p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h,x=t*_+n*v+r*y+i*b;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=_*S,e[1]=(m*d*i-u*h*i-m*r*f+n*h*f+u*r*g-n*d*g)*S,e[2]=(o*h*i-m*s*i+m*r*c-n*h*c-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*c+n*d*c+o*r*f-n*s*f)*S,e[4]=v*S,e[5]=(l*h*i-p*d*i+p*r*f-t*h*f-l*r*g+t*d*g)*S,e[6]=(p*s*i-a*h*i-p*r*c+t*h*c+a*r*g-t*s*g)*S,e[7]=(a*d*i-l*s*i+l*r*c-t*d*c-a*r*f+t*s*f)*S,e[8]=y*S,e[9]=(p*u*i-l*m*i-p*n*f+t*m*f+l*n*g-t*u*g)*S,e[10]=(a*m*i-p*o*i+p*n*c-t*m*c-a*n*g+t*o*g)*S,e[11]=(l*o*i-a*u*i-l*n*c+t*u*c+a*n*f-t*o*f)*S,e[12]=b*S,e[13]=(l*m*r-p*u*r+p*n*d-t*m*d-l*n*h+t*u*h)*S,e[14]=(p*o*r-a*m*r-p*n*s+t*m*s+a*n*h-t*o*h)*S,e[15]=(a*u*r-l*o*r+l*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements,i=Xm.set(r[0],r[1],r[2]).length(),a=Xm.set(r[4],r[5],r[6]).length(),o=Xm.set(r[8],r[9],r[10]).length(),s=this.determinant();s<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Zm.copy(this);let c=1/i,l=1/a,u=1/o;return Zm.elements[0]*=c,Zm.elements[1]*=c,Zm.elements[2]*=c,Zm.elements[4]*=l,Zm.elements[5]*=l,Zm.elements[6]*=l,Zm.elements[8]*=u,Zm.elements[9]*=u,Zm.elements[10]*=u,t.setFromRotationMatrix(Zm),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=cp){let s=this.elements,c=2*i/(t-e),l=2*i/(n-r),u=(t+e)/(t-e),d=(n+r)/(n-r),f,p;if(o===cp)f=-(a+i)/(a-i),p=-2*a*i/(a-i);else if(o===lp)f=-a/(a-i),p=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return s[0]=c,s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=l,s[9]=d,s[13]=0,s[2]=0,s[6]=0,s[10]=f,s[14]=p,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=cp){let s=this.elements,c=1/(t-e),l=1/(n-r),u=1/(a-i),d=(t+e)*c,f=(n+r)*l,p,m;if(o===cp)p=(a+i)*u,m=-2*u;else if(o===lp)p=i*u,m=-1*u;else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return s[0]=2*c,s[4]=0,s[8]=0,s[12]=-d,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-f,s[2]=0,s[6]=0,s[10]=m,s[14]=-p,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};const Xm=new U,Zm=new W,Qm=new U(0,0,0),$m=new U(1,1,1),eh=new U,th=new U,nh=new U,rh=new W,ih=new Vp;var ah=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(yp(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-yp(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(yp(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-yp(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(yp(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-yp(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:console.warn(`THREE.Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return rh.makeRotationFromQuaternion(e),this.setFromRotationMatrix(rh,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ih.setFromEuler(this),this.setFromQuaternion(ih,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};ah.DEFAULT_ORDER=`XYZ`;var oh=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Ch.subVectors(r,t),wh.subVectors(n,t),Th.subVectors(e,t);let a=Ch.dot(Ch),o=Ch.dot(wh),s=Ch.dot(Th),c=wh.dot(wh),l=wh.dot(Th),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Eh)===null?!1:Eh.x>=0&&Eh.y>=0&&Eh.x+Eh.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Eh)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Eh.x),s.addScaledVector(a,Eh.y),s.addScaledVector(o,Eh.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return Nh.setScalar(0),Ph.setScalar(0),Fh.setScalar(0),Nh.fromBufferAttribute(e,t),Ph.fromBufferAttribute(e,n),Fh.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Nh,i.x),a.addScaledVector(Ph,i.y),a.addScaledVector(Fh,i.z),a}static isFrontFacing(e,t,n,r){return Ch.subVectors(n,t),wh.subVectors(e,t),Ch.cross(wh).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ch.subVectors(this.c,this.b),wh.subVectors(this.a,this.b),Ch.cross(wh).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Dh.subVectors(r,n),Oh.subVectors(i,n),Ah.subVectors(e,n);let s=Dh.dot(Ah),c=Oh.dot(Ah);if(s<=0&&c<=0)return t.copy(n);jh.subVectors(e,r);let l=Dh.dot(jh),u=Oh.dot(jh);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Dh,a);Mh.subVectors(e,i);let f=Dh.dot(Mh),p=Oh.dot(Mh);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Oh,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return kh.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(kh,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Dh,a).addScaledVector(Oh,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};const Lh={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},Rh={h:0,s:0,l:0},zh={h:0,s:0,l:0};function Bh(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var G=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Cf){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,am.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=am.workingColorSpace){return this.r=e,this.g=t,this.b=n,am.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=am.workingColorSpace){if(e=bp(e,1),t=yp(t,0,1),n=yp(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Bh(i,r,e+1/3),this.g=Bh(i,r,e),this.b=Bh(i,r,e-1/3)}return am.colorSpaceToWorking(this,r),this}setStyle(e,t=Cf){function n(t){t!==void 0&&parseFloat(t)<1&&console.warn(`THREE.Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn(`THREE.Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);console.warn(`THREE.Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Cf){let n=Lh[e.toLowerCase()];return n===void 0?console.warn(`THREE.Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=om(e.r),this.g=om(e.g),this.b=om(e.b),this}copyLinearToSRGB(e){return this.r=sm(e.r),this.g=sm(e.g),this.b=sm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Cf){return am.workingToColorSpace(Vh.copy(this),e),Math.round(yp(Vh.r*255,0,255))*65536+Math.round(yp(Vh.g*255,0,255))*256+Math.round(yp(Vh.b*255,0,255))}getHexString(e=Cf){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=am.workingColorSpace){am.workingToColorSpace(Vh.copy(this),t);let n=Vh.r,r=Vh.g,i=Vh.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Hl&&(n.blending=this.blending),this.side!==Rl&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==nu&&(n.blendSrc=this.blendSrc),this.blendDst!==ru&&(n.blendDst=this.blendDst),this.blendEquation!==ql&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==gu&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Hf&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Of&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Of&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Of&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},Wh=class extends Uh{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new G(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ah,this.combine=xu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}};const Gh=Kh();function Kh(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function qh(e){Math.abs(e)>65504&&console.warn(`THREE.DataUtils.toHalfFloat(): Value out of range.`),e=yp(e,-65504,65504),Gh.floatView[0]=e;let t=Gh.uint32View[0],n=t>>23&511;return Gh.baseTable[n]+((t&8388607)>>Gh.shiftTable[n])}function Jh(e){let t=e>>10;return Gh.uint32View[0]=Gh.mantissaTable[Gh.offsetTable[t]+(e&1023)]+Gh.exponentTable[t],Gh.floatView[0]}var Yh=class{static toHalfFloat(e){return qh(e)}static fromHalfFloat(e){return Jh(e)}};const Xh=new U,Zh=new H;let Qh=0;var $h=class{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,`id`,{value:Qh++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=Zf,this.updateRanges=[],this.gpuType=ad,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;rt.count&&console.warn(`THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Cm);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error(`THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e0){let e=t[n[0]];if(e!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t(e.far-e.near)**2))&&(gg.copy(i).invert(),_g.copy(e.ray).applyMatrix4(gg),!(n.boundingBox!==null&&_g.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,_g)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;in.far?null:{distance:l,point:Eg.clone(),object:e}}function kg(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,bg),e.getVertexPosition(c,xg),e.getVertexPosition(l,Sg);let u=Og(e,t,n,r,bg,xg,Sg,Tg);if(u){let e=new U;Ih.getBarycoord(Tg,bg,xg,Sg,e),i&&(u.uv=Ih.getInterpolatedAttribute(i,s,c,l,e,new H)),a&&(u.uv1=Ih.getInterpolatedAttribute(a,s,c,l,e,new H)),o&&(u.normal=Ih.getInterpolatedAttribute(o,s,c,l,e,new U),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new U,materialIndex:0};Ih.getNormal(bg,xg,Sg,t.normal),u.face=t,u.barycoord=e}return u}var Ag=class e extends hg{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new K(c,3)),this.setAttribute(`normal`,new K(l,3)),this.setAttribute(`uv`,new K(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new U;for(let a=0;a0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},zg=class extends Sh{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new W,this.projectionMatrix=new W,this.projectionMatrixInverse=new W,this.coordinateSystem=cp}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};const Bg=new U,Vg=new H,Hg=new H;var Ug=class extends zg{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=_p*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(gp*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return _p*2*Math.atan(Math.tan(gp*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Bg.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Bg.x,Bg.y).multiplyScalar(-e/Bg.z),Bg.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Bg.x,Bg.y).multiplyScalar(-e/Bg.z)}getViewSize(e,t){return this.getViewBounds(e,Vg,Hg),t.subVectors(Hg,Vg)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(gp*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const Wg=-90,Gg=1;var Kg=class extends Sh{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new Ug(Wg,Gg,e,t);r.layers=this.layers,this.add(r);let i=new Ug(Wg,Gg,e,t);i.layers=this.layers,this.add(i);let a=new Ug(Wg,Gg,e,t);a.layers=this.layers,this.add(a);let o=new Ug(Wg,Gg,e,t);o.layers=this.layers,this.add(o);let s=new Ug(Wg,Gg,e,t);s.layers=this.layers,this.add(s);let c=new Ug(Wg,Gg,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===cp)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===lp)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,o),e.setRenderTarget(n,3,r),e.render(t,s),e.setRenderTarget(n,4,r),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},qg=class extends hm{constructor(e=[],t=Fu,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},Jg=class extends vm{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new qg(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},r=new Ag(5,5,5),i=new Rg({name:`CubemapFromEquirect`,uniforms:jg(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:zl,blending:Vl});i.uniforms.tEquirect.value=t;let a=new Dg(r,i),o=t.minFilter;t.minFilter===Zu&&(t.minFilter=Ju);let s=new Kg(1,10,this);return s.update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}},Yg=class extends Sh{constructor(){super(),this.isGroup=!0,this.type=`Group`}};const Xg={type:`move`};var Zg=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Yg,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Yg,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Yg,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:`connected`,data:e}),this}disconnect(e){return this.dispatchEvent({type:`disconnected`,data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position),s=.02,l=.005;c.inputState.pinching&&o>s+l?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=s-l&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Xg)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new Yg;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},Qg=class e{constructor(e,t=25e-5){this.isFogExp2=!0,this.name=``,this.color=new G(e),this.density=t}clone(){return new e(this.color,this.density)}toJSON(){return{type:`FogExp2`,name:this.name,color:this.color.getHex(),density:this.density}}},$g=class e{constructor(e,t=1,n=1e3){this.isFog=!0,this.name=``,this.color=new G(e),this.near=t,this.far=n}clone(){return new e(this.color,this.near,this.far)}toJSON(){return{type:`Fog`,name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},e_=class extends Sh{constructor(){super(),this.isScene=!0,this.type=`Scene`,this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ah,this.environmentIntensity=1,this.environmentRotation=new ah,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},t_=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=Zf,this.updateRanges=[],this.version=0,this.uuid=vp()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;re.far||t.push({distance:s,point:o_.clone(),uv:Ih.getInterpolation(o_,f_,p_,m_,h_,g_,__,new H),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};function y_(e,t,n,r,i,a){l_.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?u_.copy(l_):(u_.x=a*l_.x-i*l_.y,u_.y=i*l_.x+a*l_.y),e.copy(t),e.x+=u_.x,e.y+=u_.y,e.applyMatrix4(d_)}const b_=new U,x_=new U;var S_=class extends Sh{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type=`LOD`,Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e0){let n,r;for(n=1,r=t.length;n0){b_.setFromMatrixPosition(this.matrixWorld);let n=e.ray.origin.distanceTo(b_);this.getObjectForDistance(n).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){b_.setFromMatrixPosition(e.matrixWorld),x_.setFromMatrixPosition(this.matrixWorld);let n=b_.distanceTo(x_)/e.zoom;t[0].object.visible=!0;let r,i;for(r=1,i=t.length;r=e)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||Y_.getNormalMatrix(e),r=this.coplanarPoint(q_).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const Z_=new Vm,Q_=new U;var $_=class{constructor(e=new X_,t=new X_,n=new X_,r=new X_,i=new X_,a=new X_){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=cp){let n=this.planes,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],d=r[7],f=r[8],p=r[9],m=r[10],h=r[11],g=r[12],_=r[13],v=r[14],y=r[15];if(n[0].setComponents(s-i,d-c,h-f,y-g).normalize(),n[1].setComponents(s+i,d+c,h+f,y+g).normalize(),n[2].setComponents(s+a,d+l,h+p,y+_).normalize(),n[3].setComponents(s-a,d-l,h-p,y-_).normalize(),n[4].setComponents(s-o,d-u,h-m,y-v).normalize(),t===cp)n[5].setComponents(s+o,d+u,h+m,y+v).normalize();else if(t===lp)n[5].setComponents(o,u,m,v).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Z_.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Z_.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Z_)}intersectsSprite(e){return Z_.center.set(0,0,0),Z_.radius=.7071067811865476,Z_.applyMatrix4(e.matrixWorld),this.intersectsSphere(Z_)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++){let i=t[e].distanceToPoint(n);if(i0?e.max.x:e.min.x,Q_.y=r.normal.y>0?e.max.y:e.min.y,Q_.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Q_)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};const ev=new W,tv=new $_;var nv=class e{constructor(){this.coordinateSystem=cp}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});let o=i[this.index];a.push(o),this.index++,o.start=e,o.count=t,o.z=n,o.index=r}reset(){this.list.length=0,this.index=0}};const sv=new W,cv=new G(1,1,1),lv=new $_,uv=new nv,dv=new Cm,fv=new Vm,pv=new U,mv=new U,hv=new U,gv=new ov,_v=new Dg,vv=[];function yv(e,t,n=0){let r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let i=e.count;for(let a=0;a65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new $h(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error(`THREE.BatchedMesh: All geometries must consistently have "index".`);for(let n in t.attributes){if(!e.hasAttribute(n))throw Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);let r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw Error(`THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.`)}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Cm);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n=this.maxInstanceCount;if(t&&this._availableInstanceIds.length===0)throw Error(`THREE.BatchedMesh: Maximum item count reached.`);let n={visible:!0,active:!0,geometryIndex:e},r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(rv),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=n):(r=this._instanceInfo.length,this._instanceInfo.push(n));let i=this._matricesTexture;sv.identity().toArray(i.image.data,r*16),i.needsUpdate=!0;let a=this._colorsTexture;return a&&(cv.toArray(a.image.data,r*4),a.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},i=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute(`position`).count:t;let a=e.getIndex(),o=a!==null;if(o&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=n===-1?a.count:n),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw Error(`THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.`);let s;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(rv),s=this._availableGeometryIds.shift(),i[s]=r):(s=this._geometryCount,this._geometryCount++,i.push(r)),this.setGeometryAt(s,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,s}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error(`THREE.BatchedMesh: Maximum geometry count reached.`);this._validateGeometry(t);let n=this.geometry,r=n.getIndex()!==null,i=n.getIndex(),a=t.getIndex(),o=this._geometryInfo[e];if(r&&a.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw Error(`THREE.BatchedMesh: Reserved space not large enough for provided geometry.`);let s=o.vertexStart,c=o.reservedVertexCount;for(let e in o.vertexCount=t.getAttribute(`position`).count,n.attributes){let r=t.getAttribute(e),i=n.getAttribute(e);yv(r,i,s);let a=r.itemSize;for(let e=r.count,t=c;e=t.length||t[e].active===!1)return this;let n=this._instanceInfo;for(let t=0,r=n.length;tt).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),i=this.geometry;for(let a=0,o=n.length;a=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){let e=new Cm,t=n.index,i=n.attributes.position;for(let n=r.start,a=r.start+r.count;n=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){let t=new Vm;this.getBoundingBoxAt(e,dv),dv.getCenter(t.center);let i=n.index,a=n.attributes.position,o=0;for(let e=r.start,n=r.start+r.count;ee.active),r=Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount));if(r>e)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index){let e=Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount));if(e>t)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`)}let i=this.geometry;i.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new hg,this._initializeGeometry(i));let a=this.geometry;for(let e in i.index&&bv(i.index.array,a.index.array),i.attributes)bv(i.attributes[e].array,a.attributes[e].array)}raycast(e,t){let n=this._instanceInfo,r=this._geometryInfo,i=this.matrixWorld,a=this.geometry;_v.material=this.material,_v.geometry.index=a.index,_v.geometry.attributes=a.attributes,_v.geometry.boundingBox===null&&(_v.geometry.boundingBox=new Cm),_v.geometry.boundingSphere===null&&(_v.geometry.boundingSphere=new Vm);for(let a=0,o=n.length;a({...e,boundingBox:e.boundingBox===null?null:e.boundingBox.clone(),boundingSphere:e.boundingSphere===null?null:e.boundingSphere.clone()})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,r,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let a=r.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,s=this._instanceInfo,c=this._multiDrawStarts,l=this._multiDrawCounts,u=this._geometryInfo,d=this.perObjectFrustumCulled,f=this._indirectTexture,p=f.image.data,m=n.isArrayCamera?uv:lv;d&&!n.isArrayCamera&&(sv.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),lv.setFromProjectionMatrix(sv,e.coordinateSystem));let h=0;if(this.sortObjects){sv.copy(this.matrixWorld).invert(),pv.setFromMatrixPosition(n.matrixWorld).applyMatrix4(sv),mv.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(sv);for(let e=0,t=s.length;e0){let e=t[n[0]];if(e!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;tr)return;Ov.applyMatrix4(e.matrixWorld);let l=t.ray.origin.distanceTo(Ov);if(!(lt.far))return{distance:l,point:kv.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}const Mv=new U,Nv=new U;var Pv=class extends Av{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e0){let e=t[n[0]];if(e!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;ti.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var Uv=class extends hm{constructor(e,t,n,r,i=Ju,a=Ju,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isVideoTexture=!0,this.generateMipmaps=!1;let l=this;function u(){l.needsUpdate=!0,e.requestVideoFrameCallback(u)}`requestVideoFrameCallback`in e&&e.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image,t=`requestVideoFrameCallback`in e;t===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},Wv=class extends Uv{constructor(e,t,n,r,i,a,o,s){super({},e,t,n,r,i,a,o,s),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}},Gv=class extends hm{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Uu,this.minFilter=Uu,this.generateMipmaps=!1,this.needsUpdate=!0}},Kv=class extends hm{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},qv=class extends Kv{constructor(e,t,n,r,i,a){super(e,t,n,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Vu,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},Jv=class extends Kv{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Fu),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},Yv=class extends hm{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},Xv=class extends hm{constructor(e,t,n=id,r,i,a,o=Uu,s=Uu,c,l=md,u=1){if(l!==md&&l!==hd)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);let d={width:e,height:t,depth:u};super(d,r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new dm(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Zv=class e extends hg{constructor(e=1,t=1,n=4,r=8,i=1){super(),this.type=`CapsuleGeometry`,this.parameters={radius:e,height:t,capSegments:n,radialSegments:r,heightSegments:i},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),r=Math.max(3,Math.floor(r)),i=Math.max(1,Math.floor(i));let a=[],o=[],s=[],c=[],l=t/2,u=Math.PI/2*e,d=t,f=2*u+d,p=n*2+i,m=r+1,h=new U,g=new U;for(let _=0;_<=p;_++){let v=0,y=0,b=0,x=0;if(_<=n){let t=_/n,r=t*Math.PI/2;y=-l-e*Math.cos(r),b=e*Math.sin(r),x=-e*Math.cos(r),v=t*u}else if(_<=n+i){let r=(_-n)/i;y=-l+r*t,b=e,x=0,v=u+r*d}else{let t=(_-n-i)/n,r=t*Math.PI/2;y=l+e*Math.sin(r),b=e*Math.cos(r),x=e*Math.sin(r),v=u+d+t*u}let S=Math.max(0,Math.min(1,v/f)),C=0;_===0?C=.5/r:_===p&&(C=-.5/r);for(let e=0;e<=r;e++){let t=e/r,n=t*Math.PI*2,i=Math.sin(n),a=Math.cos(n);g.x=-b*a,g.y=y,g.z=b*i,o.push(g.x,g.y,g.z),h.set(-b*a,x,b*i),h.normalize(),s.push(h.x,h.y,h.z),c.push(t+C,S)}if(_>0){let e=(_-1)*m;for(let t=0;t0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new K(u,3)),this.setAttribute(`normal`,new K(d,3)),this.setAttribute(`uv`,new K(f,2));function _(){let a=new U,_=new U,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new H,m=new U,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r,n=t*s+o,i=Math.cos(n),c=Math.sin(n);m.x=v*c,m.y=h*y,m.z=v*i,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=i*.5+.5,a.y=c*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){let r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){let e=new U,t=new U,n=new U,r=new U,o=new H,s=new H,c=new H;for(let l=0,u=0;l0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);let l=n[r],u=n[r+1],d=u-l,f=(a-l)/d,p=(r+f)/(i-1);return p}getTangent(e,t){let n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);let a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new H:new U);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new U,r=[],i=[],a=[],o=new U,s=new W;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new U)}i[0]=new U,a[0]=new U;let c=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);l<=c&&(c=l,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>2**-52){o.normalize();let e=Math.acos(yp(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(t===!0){let t=Math.acos(yp(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:`Curve`,generator:`Curve.toJSON`}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},ly=class extends cy{constructor(e=0,t=0,n=1,r=1,i=0,a=Math.PI*2,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type=`EllipseCurve`,this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t=new H){let n=t,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<2**-52;for(;i<0;)i+=r;for(;i>r;)i-=r;i<2**-52&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r:i-=r);let o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*e-r*t+this.aX,c=n*t+r*e+this.aY}return n.set(s,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},uy=class extends ly{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type=`ArcCurve`}};function dy(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;c*=o,l*=o,i(t,n,c,l)},calc:function(i){let a=i*i,o=a*i;return e+t*i+n*a+r*o}}}const fy=new U,py=new dy,my=new dy,hy=new dy;var gy=class extends cy{constructor(e=[],t=!1,n=`centripetal`,r=.5){super(),this.isCatmullRomCurve3=!0,this.type=`CatmullRomCurve3`,this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new U){let n=t,r=this.points,i=r.length,a=(i-(this.closed?0:1))*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);let c,l;this.closed||o>0?c=r[(o-1)%i]:(fy.subVectors(r[0],r[1]).add(r[0]),c=fy);let u=r[o%i],d=r[(o+1)%i];if(this.closed||o+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(_y(o,s.x,c.x,l.x,u.x),_y(o,s.y,c.y,l.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){let e=r[i]-n,a=this.curves[i],o=a.getLength(),s=o===0?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=c.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},Ly=class extends Iy{constructor(e){super(e),this.uuid=vp(),this.type=`Shape`,this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n80*n){s=1/0,c=1/0;let t=-1/0,r=-1/0;for(let a=n;at&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return Vy(a,o,n,s,c,l,0),o}function zy(e,t,n,r,i){let a;if(i===gb(e,t,n,r)>0)for(let i=t;i=t;i-=r)a=pb(i/r|0,e[i],e[i+1],a);return a&&ab(a,a.next)&&(mb(a),a=a.next),a}function By(e,t){if(!e)return e;t||=e;let n=e,r;do if(r=!1,!n.steiner&&(ab(n,n.next)||ib(n.prev,n,n.next)===0)){if(mb(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function Vy(e,t,n,r,i,a,o){if(!e)return;!o&&a&&Zy(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?Uy(e,r,i,a):Hy(e)){t.push(c.i,e.i,l.i),mb(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=Wy(By(e),t),Vy(e,t,n,r,i,a,2)):o===2&&Gy(e,t,n,r,i,a):Vy(By(e),t,n,r,i,a,1);break}}}function Hy(e){let t=e.prev,n=e,r=e.next;if(ib(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&nb(i,s,a,c,o,l,m.x,m.y)&&ib(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Uy(e,t,n,r){let i=e.prev,a=e,o=e.next;if(ib(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=$y(p,m,t,n,r),v=$y(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&nb(s,u,c,d,l,f,y.x,y.y)&&ib(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&nb(s,u,c,d,l,f,b.x,b.y)&&ib(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&nb(s,u,c,d,l,f,y.x,y.y)&&ib(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&nb(s,u,c,d,l,f,b.x,b.y)&&ib(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Wy(e,t){let n=e;do{let r=n.prev,i=n.next.next;!ab(r,i)&&ob(r,n,n.next,i)&&ub(r,i)&&ub(i,r)&&(t.push(r.i,n.i,i.i),mb(n),mb(n.next),n=e=i),n=n.next}while(n!==e);return By(n)}function Gy(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&rb(o,e)){let s=fb(o,e);o=By(o,o.next),s=By(s,s.next),Vy(o,t,n,r,i,a,0),Vy(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function Ky(e,t,n,r){let i=[];for(let n=0,a=t.length;n=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x=n.x&&n.x>=c&&r!==n.x&&tb(io.x||n.x===o.x&&Xy(o,n)))&&(o=n,u=t)}n=n.next}while(n!==s);return o}function Xy(e,t){return ib(e.prev,e,t.prev)<0&&ib(t.next,e,e.next)<0}function Zy(e,t,n,r){let i=e;do i.z===0&&(i.z=$y(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,Qy(i)}function Qy(e){let t,n=1;do{let r=e,i;e=null;let a=null;for(t=0;r;){t++;let o=r,s=0;for(let e=0;e0||c>0&&o;)s!==0&&(c===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,s--):(i=o,o=o.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=o}a.nextZ=null,n*=2}while(t>1);return e}function $y(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 eb(e){let 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 nb(e,t,n,r,i,a,o,s){return!(e===o&&t===s)&&tb(e,t,n,r,i,a,o,s)}function rb(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!lb(e,t)&&(ub(e,t)&&ub(t,e)&&db(e,t)&&(ib(e.prev,e,t.prev)||ib(e,t.prev,t))||ab(e,t)&&ib(e.prev,e,e.next)>0&&ib(t.prev,t,t.next)>0)}function ib(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ab(e,t){return e.x===t.x&&e.y===t.y}function ob(e,t,n,r){let i=cb(ib(e,t,n)),a=cb(ib(e,t,r)),o=cb(ib(n,r,e)),s=cb(ib(n,r,t));return!!(i!==a&&o!==s||i===0&&sb(e,n,t)||a===0&&sb(e,r,t)||o===0&&sb(n,e,r)||s===0&&sb(n,t,r))}function sb(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 cb(e){return e>0?1:e<0?-1:0}function lb(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ob(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function ub(e,t){return ib(e.prev,e,e.next)<0?ib(e,t,e.next)>=0&&ib(e,e.prev,t)>=0:ib(e,t,e.prev)<0||ib(e,e.next,t)<0}function db(e,t){let 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 fb(e,t){let n=hb(e.i,e.x,e.y),r=hb(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 pb(e,t,n,r){let i=hb(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 mb(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 hb(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function gb(e,t,n,r){let i=0;for(let a=t,o=n-r;a2&&e[t-1].equals(e[0])&&e.pop()}function bb(e,t){for(let n=0;n2**-52){let d=Math.sqrt(u),f=Math.sqrt(c*c+l*l),p=t.x-s/d,m=t.y+o/d,h=n.x-l/f,g=n.y+c/f,_=((h-p)*l-(g-m)*c)/(o*l-s*c);r=p+o*_-e.x,i=m+s*_-e.y;let v=r*r+i*i;if(v<=2)return new H(r,i);a=Math.sqrt(v/2)}else{let e=!1;o>2**-52?c>2**-52&&(e=!0):o<-(2**-52)?c<-(2**-52)&&(e=!0):Math.sign(s)===Math.sign(l)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new H(r/a,i/a)}let M=[];for(let e=0,t=O.length,n=t-1,r=e+1;e=0;e--){let t=e/p,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+f;for(let e=0,t=O.length;e=0;){let r=n,i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+p*2;e0)&&f.push(t,i,c),(e!==n-1||s0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},Ub=class extends Uh{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type=`MeshPhongMaterial`,this.color=new G(16777215),this.specular=new G(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new G(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bf,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ah,this.combine=xu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},Wb=class extends Uh{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:``},this.type=`MeshToonMaterial`,this.color=new G(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new G(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bf,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},Gb=class extends Uh{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type=`MeshNormalMaterial`,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bf,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}},Kb=class extends Uh{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type=`MeshLambertMaterial`,this.color=new G(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new G(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bf,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ah,this.combine=xu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},qb=class extends Uh{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=gf,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},Jb=class extends Uh{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type=`MeshDistanceMaterial`,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},Yb=class extends Uh{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:``},this.type=`MeshMatcapMaterial`,this.color=new G(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bf,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:``},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}},Xb=class extends Sv{constructor(e){super(),this.isLineDashedMaterial=!0,this.type=`LineDashedMaterial`,this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};function Zb(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}function Qb(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $b(e){function t(t,n){return e[t]-e[n]}let n=e.length,r=Array(n);for(let e=0;e!==n;++e)r[e]=e;return r.sort(t),r}function ex(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function tx(e,t,n,r){let i=1,a=e[0];for(;a!==void 0&&a[r]===void 0;)a=e[i++];if(a===void 0)return;let o=a[r];if(o!==void 0)if(Array.isArray(o))do o=a[r],o!==void 0&&(t.push(a.time),n.push(...o)),a=e[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[r],o!==void 0&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(a!==void 0);else do o=a[r],o!==void 0&&(t.push(a.time),n.push(o)),a=e[i++];while(a!==void 0)}function nx(e,t,n,r,i=30){let a=e.clone();a.name=t;let o=[];for(let e=0;e=r)){c.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(s=a.tracks[e].times[0]);for(let e=0;e=r.times[d]){let e=d*c+s,t=e+c-s;f=r.values.slice(e,t)}else{let e=r.createInterpolant(),t=s,n=c-s;e.evaluate(a),f=e.resultBuffer.slice(t,n)}if(i===`quaternion`){let e=new Vp().fromArray(f).normalize().conjugate();e.toArray(f)}let p=o.times.length;for(let e=0;e=i)){let o=t[1];e=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n>>1;et;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error(`THREE.KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(console.error(`THREE.KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){console.error(`THREE.KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){console.error(`THREE.KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&Qb(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){console.error(`THREE.KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===sf,i=e.length-1,a=1;for(let o=1;o0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};lx.prototype.ValueTypeName=``,lx.prototype.TimeBufferType=Float32Array,lx.prototype.ValueBufferType=Float32Array,lx.prototype.DefaultInterpolation=af;var ux=class extends lx{constructor(e,t,n){super(e,t,n)}};ux.prototype.ValueTypeName=`bool`,ux.prototype.ValueBufferType=Array,ux.prototype.DefaultInterpolation=rf,ux.prototype.InterpolantFactoryMethodLinear=void 0,ux.prototype.InterpolantFactoryMethodSmooth=void 0;var dx=class extends lx{constructor(e,t,n,r){super(e,t,n,r)}};dx.prototype.ValueTypeName=`color`;var fx=class extends lx{constructor(e,t,n,r){super(e,t,n,r)}};fx.prototype.ValueTypeName=`number`;var px=class extends ax{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;c+=4)Vp.slerpFlat(i,0,a,c-o,a,c,s);return i}},mx=class extends lx{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new px(this.times,this.values,this.getValueSize(),e)}};mx.prototype.ValueTypeName=`quaternion`,mx.prototype.InterpolantFactoryMethodSmooth=void 0;var hx=class extends lx{constructor(e,t,n){super(e,t,n)}};hx.prototype.ValueTypeName=`string`,hx.prototype.ValueBufferType=Array,hx.prototype.DefaultInterpolation=rf,hx.prototype.InterpolantFactoryMethodLinear=void 0,hx.prototype.InterpolantFactoryMethodSmooth=void 0;var gx=class extends lx{constructor(e,t,n,r){super(e,t,n,r)}};gx.prototype.ValueTypeName=`vector`;var _x=class{constructor(e=``,t=-1,n=[],r=df){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=vp(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(yx(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(lx.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}static parseAnimation(e,t){if(console.warn(`THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185`),!e)return console.error(`THREE.AnimationClip: No animation in JSONLoader data.`),null;let n=function(e,t,n,r,i){if(n.length!==0){let a=[],o=[];tx(n,a,o,r),a.length!==0&&i.push(new e(t,a,o))}},r=[],i=e.name||`default`,a=e.fps||30,o=e.blendMode,s=e.length||-1,c=e.hierarchy||[];for(let e=0;e{t&&t(i),this.manager.itemEnd(e)},0),i;if(wx[e]!==void 0){wx[e].push({onLoad:t,onProgress:n,onError:r});return}wx[e]=[],wx[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&console.warn(`THREE.FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=wx[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e{e.error(t)})}}});return new Response(c)}else throw new Tx(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>{let t=new DOMParser;return t.parseFromString(e,o)});case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i,n=t.exec(o),r=n&&n[1]?n[1].toLowerCase():void 0,i=new TextDecoder(r);return e.arrayBuffer().then(e=>i.decode(e))}}}).then(t=>{bx.add(e,t);let n=wx[e];delete wx[e];for(let e=0,r=n.length;e{let n=wx[e];if(n===void 0)throw this.manager.itemError(e),t;delete wx[e];for(let e=0,r=n.length;e{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},Dx=class extends Cx{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new Ex(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e){let t=[];for(let n=0;n0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let t in e.uniforms){let i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case`t`:r.uniforms[t].value=n(i.value);break;case`c`:r.uniforms[t].value=new G().setHex(i.value);break;case`v2`:r.uniforms[t].value=new H().fromArray(i.value);break;case`v3`:r.uniforms[t].value=new U().fromArray(i.value);break;case`v4`:r.uniforms[t].value=new gm().fromArray(i.value);break;case`m3`:r.uniforms[t].value=new Wp().fromArray(i.value);break;case`m4`:r.uniforms[t].value=new W().fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(let t in e.extensions)r.extensions[t]=e.extensions[t];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),r.normalScale=new H().fromArray(t)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new H().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(t){return e.createMaterialFromType(t)}static createMaterialFromType(e){let t={ShadowMaterial:zb,SpriteMaterial:i_,RawShaderMaterial:Bb,ShaderMaterial:Rg,PointsMaterial:Iv,MeshPhysicalMaterial:Hb,MeshStandardMaterial:Vb,MeshPhongMaterial:Ub,MeshToonMaterial:Wb,MeshNormalMaterial:Gb,MeshLambertMaterial:Kb,MeshDepthMaterial:qb,MeshDistanceMaterial:Jb,MeshBasicMaterial:Wh,MeshMatcapMaterial:Yb,LineDashedMaterial:Xb,LineBasicMaterial:Sv,Material:Uh};return new t[e]}},eS=class{static extractUrlBase(e){let t=e.lastIndexOf(`/`);return t===-1?`./`:e.slice(0,t+1)}static resolveURL(e,t){return typeof e!=`string`||e===``?``:(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,`$1`)),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},tS=class extends hg{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type=`InstancedBufferGeometry`,this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}},nS=class extends Cx{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new Ex(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e){let t={},n={};function r(e,n){if(t[n]!==void 0)return t[n];let r=e.interleavedBuffers,a=r[n],o=i(e,a.buffer),s=Jp(a.type,o),c=new t_(s,a.stride);return c.uuid=a.uuid,t[n]=c,c}function i(e,t){if(n[t]!==void 0)return n[t];let r=e.arrayBuffers,i=r[t],a=new Uint32Array(i).buffer;return n[t]=a,a}let a=e.isInstancedBufferGeometry?new tS:new hg,o=e.data.index;if(o!==void 0){let e=Jp(o.type,o.array);a.setIndex(new $h(e,1))}let s=e.data.attributes;for(let t in s){let n=s[t],i;if(n.isInterleavedBufferAttribute){let t=r(e.data,n.data);i=new r_(t,n.itemSize,n.offset,n.normalized)}else{let e=Jp(n.type,n.array),t=n.isInstancedBufferAttribute?R_:$h;i=new t(e,n.itemSize,n.normalized)}n.name!==void 0&&(i.name=n.name),n.usage!==void 0&&i.setUsage(n.usage),a.setAttribute(t,i)}let c=e.data.morphAttributes;if(c)for(let t in c){let n=c[t],i=[];for(let t=0,a=n.length;t0){let n=new xx(t);i=new kx(n),i.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t0){r=new kx(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t{let t=null,n=null;return e.boundingBox!==void 0&&(t=new Cm().fromJSON(e.boundingBox)),e.boundingSphere!==void 0&&(n=new Vm().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:n}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(a._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(a.boundingSphere=new Vm().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(a.boundingBox=new Cm().fromJSON(e.boundingBox));break;case`LOD`:a=new S_;break;case`Line`:a=new Av(o(e.geometry),s(e.material));break;case`LineLoop`:a=new Fv(o(e.geometry),s(e.material));break;case`LineSegments`:a=new Pv(o(e.geometry),s(e.material));break;case`PointCloud`:case`Points`:a=new Vv(o(e.geometry),s(e.material));break;case`Sprite`:a=new v_(s(e.material));break;case`Group`:a=new Yg;break;case`Bone`:a=new N_;break;default:a=new Sh}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix===void 0?(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)):(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(a.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){let o=e.children;for(let e=0;e`u`&&console.warn(`THREE.ImageBitmapLoader: createImageBitmap() not supported.`),typeof fetch>`u`&&console.warn(`THREE.ImageBitmapLoader: fetch() not supported.`),this.options={premultiplyAlpha:`none`}}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=bx.get(e);if(a!==void 0){if(i.manager.itemStart(e),a.then){a.then(n=>{if(sS.has(a)===!0)r&&r(sS.get(a)),i.manager.itemError(e),i.manager.itemEnd(e);else return t&&t(n),i.manager.itemEnd(e),n});return}return setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a}let o={};o.credentials=this.crossOrigin===`anonymous`?`same-origin`:`include`,o.headers=this.requestHeader;let s=fetch(e,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:`none`}))}).then(function(n){return bx.add(e,n),t&&t(n),i.manager.itemEnd(e),n}).catch(function(t){r&&r(t),sS.set(s,t),bx.remove(e),i.manager.itemError(e),i.manager.itemEnd(e)});bx.add(e,s),i.manager.itemStart(e)}};let lS;var uS=class{static getContext(){return lS===void 0&&(lS=new(window.AudioContext||window.webkitAudioContext)),lS}static setContext(e){lS=e}},dS=class extends Cx{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new Ex(this.manager);a.setResponseType(`arraybuffer`),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(e){try{let n=e.slice(0),r=uS.getContext();r.decodeAudioData(n,function(e){t(e)}).catch(o)}catch(e){o(e)}},n,r);function o(t){r?r(t):console.error(t),i.manager.itemError(e)}}};const fS=new W,pS=new W,mS=new W;var hS=class{constructor(){this.type=`StereoCamera`,this.aspect=1,this.eyeSep=.064,this.cameraL=new Ug,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ug,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){let t=this._cache,n=t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep;if(n){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,mS.copy(e.projectionMatrix);let n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan(gp*t.fov*.5)/t.zoom,a,o;pS.elements[12]=-n,fS.elements[12]=n,a=-i*t.aspect+r,o=i*t.aspect+r,mS.elements[0]=2*t.near/(o-a),mS.elements[8]=(o+a)/(o-a),this.cameraL.projectionMatrix.copy(mS),a=-i*t.aspect-r,o=i*t.aspect-r,mS.elements[0]=2*t.near/(o-a),mS.elements[8]=(o+a)/(o-a),this.cameraR.projectionMatrix.copy(mS)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(pS),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(fS)}},gS=class extends Ug{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},_S=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=vS(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=vS();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function vS(){return performance.now()}const yS=new U,bS=new Vp,xS=new U,SS=new U,CS=new U;var wS=class extends Sh{constructor(){super(),this.type=`AudioListener`,this.context=uS.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new _S}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter===null?this.gain.disconnect(this.context.destination):(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(yS,bS,xS),SS.set(0,0,-1).applyQuaternion(bS),CS.set(0,1,0).applyQuaternion(bS),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(yS.x,e),t.positionY.linearRampToValueAtTime(yS.y,e),t.positionZ.linearRampToValueAtTime(yS.z,e),t.forwardX.linearRampToValueAtTime(SS.x,e),t.forwardY.linearRampToValueAtTime(SS.y,e),t.forwardZ.linearRampToValueAtTime(SS.z,e),t.upX.linearRampToValueAtTime(CS.x,e),t.upY.linearRampToValueAtTime(CS.y,e),t.upZ.linearRampToValueAtTime(CS.z,e)}else t.setPosition(yS.x,yS.y,yS.z),t.setOrientation(SS.x,SS.y,SS.z,CS.x,CS.y,CS.z)}},TS=class extends Sh{constructor(e){super(),this.type=`Audio`,this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType=`empty`,this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType=`audioNode`,this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaNode`,this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaStreamNode`,this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType=`buffer`,this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn(`THREE.Audio: Audio is already playing.`);return}if(this.hasPlaybackControl===!1){console.warn(`THREE.Audio: this Audio has no playback control.`);return}this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn(`THREE.Audio: this Audio has no playback control.`);return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress%=this.duration||this.buffer.duration),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn(`THREE.Audio: this Audio has no playback control.`);return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){Vp.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){let a=this._workIndex*i;Vp.multiplyQuaternionsFlat(e,a,e,t,e,n),Vp.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){let a=1-r;for(let o=0;o!==i;++o){let i=t+o;e[i]=e[i]*a+e[n+o]*r}}_lerpAdditive(e,t,n,r,i){for(let a=0;a!==i;++a){let i=t+a;e[i]=e[i]+e[n+a]*r}}};const NS=`\\[\\]\\.:\\/`,PS=RegExp(`[`+NS+`]`,`g`),FS=`[^`+NS+`]`,IS=`[^`+NS.replace(`\\.`,``)+`]`,LS=/((?:WC+[\/:])*)/.source.replace(`WC`,FS),RS=/(WCOD+)?/.source.replace(`WCOD`,IS),zS=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace(`WC`,FS),BS=/\.(WC+)(?:\[(.+)\])?/.source.replace(`WC`,FS),VS=RegExp(`^`+LS+RS+zS+BS+`$`),HS=[`material`,`materials`,`bones`,`map`];var US=class{constructor(e,t,n){let r=n||WS.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},WS=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(PS,``)}static parseTrackName(e){let t=VS.exec(e);if(t===null)throw Error(`PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);HS.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r=i){let a=i++,l=e[a];t[l.uuid]=c,e[c]=l,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){let t=n[e],r=t[a],i=t[c];t[c]=r,t[a]=i}}}this.nCachedObjects_=i}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){let s=arguments[o],c=s.uuid,l=t[c];if(l!==void 0)if(delete t[c],l0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=r;e!==t;++e){let t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){let n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(r!==void 0)return i[r];let a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(let n=l,r=s.length;n!==r;++n){let r=s[n];u[n]=new WS(r,e,t)}return u}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=e[o];t[c]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}},KS=class{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;let i=t.tracks,a=i.length,o=Array(a),s={endingStart:cf,endingEnd:cf};for(let e=0;e!==a;++e){let t=i[e].createInterpolant(null);o[e]=t,t.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=tf,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){let n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let r=this._mixer,i=r.time,a=this.timeScale,o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);let s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/a,c[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled){this._updateWeight(e);return}let i=this._startTime;if(i!==null){let r=(e-i)*n;r<0||n===0?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);let a=this._updateTime(t),o=this._updateWeight(e);if(o>0){let e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case ff:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);break;case df:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=n===nf;if(e===0)return i===-1?r:a&&(i&1)==1?t-r:r;if(n===ef){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break handle_stop}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e<0?-1:1})}}else{if(i===-1&&(e>=0?(i=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=t||r<0){let n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);let o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e>0?1:-1});else{if(o===1){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:`loop`,action:this,loopDelta:n})}}else this.time=r;if(a&&(i&1)==1)return t-r}return r}_setEndings(e,t,n){let r=this._interpolantSettings;n?(r.endingStart=lf,r.endingEnd=lf):(e?r.endingStart=this.zeroSlopeAtStart?lf:cf:r.endingStart=uf,t?r.endingEnd=this.zeroSlopeAtEnd?lf:cf:r.endingEnd=uf)}_scheduleFading(e,t,n){let r=this._mixer,i=r.time,a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);let o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}};const qS=new Float32Array(1);var JS=class extends pp{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];l===void 0&&(l={},c[s]=l);for(let e=0;e!==i;++e){let i=r[e],c=i.name,u=l[c];if(u!==void 0)++u.referenceCount,a[e]=u;else{if(u=a[e],u!==void 0){u._cacheIndex===null&&(++u.referenceCount,this._addInactiveBinding(u,s,c));continue}let r=t&&t._propertyBindings[e].binding.parsedPath;u=new MS(WS.create(n,c,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,s,c),a[e]=u}o[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];n.useCount++===0&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];--n.useCount===0&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==n;++o){let n=t[o];n._update(r,e,i,a)}let o=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)o[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,cC).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};const uC=new U,dC=new U;var fC=class{constructor(e=new U,t=new U){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){uC.subVectors(e,this.start),dC.subVectors(this.end,this.start);let n=dC.dot(dC),r=dC.dot(uC),i=r/n;return t&&(i=yp(i,0,1)),i}closestPointToPoint(e,t,n){let r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}};const pC=new U;var mC=class extends Sh{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type=`SpotLightHelper`;let n=new hg,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,n=32;e1)for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{zC.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(zC,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},UC=class extends Pv{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new hg;r.setAttribute(`position`,new K(t,3)),r.setAttribute(`color`,new K(n,3));let i=new Sv({vertexColors:!0,toneMapped:!1});super(r,i),this.type=`AxesHelper`}setColors(e,t,n){let r=new G,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},WC=class{constructor(){this.type=`ShapePath`,this.color=new G,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Iy,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e){let t=[];for(let n=0,r=e.length;n2**-52){if(c<0&&(n=t[a],s=-s,o=t[i],c=-c),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=c*(e.x-n.x)-s*(e.y-n.y);if(t===0)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}let r=vb.isClockWise,i=this.subPaths;if(i.length===0)return[];let a,o,s,c=[];if(i.length===1)return o=i[0],s=new Ly,s.curves=o.curves,c.push(s),c;let l=!r(i[0].getPoints());l=e?!l:l;let u=[],d=[],f=[],p=0,m;d[p]=void 0,f[p]=[];for(let t=0,n=i.length;t1){let e=!1,t=0;for(let e=0,t=d.length;e0&&e===!1&&(f=u)}let h;for(let e=0,t=d.length;et?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}function qC(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}function JC(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}function YC(e,t,n,r){let i=XC(r);switch(n){case dd:return e*t;case gd:return e*t/i.components*i.byteLength;case _d:return e*t/i.components*i.byteLength;case vd:return e*t*2/i.components*i.byteLength;case yd:return e*t*2/i.components*i.byteLength;case fd:return e*t*3/i.components*i.byteLength;case pd:return e*t*4/i.components*i.byteLength;case xd:return e*t*4/i.components*i.byteLength;case Sd:case Cd:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case wd:case Td:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Dd:case kd:return Math.max(e,16)*Math.max(t,8)/4;case Ed:case Od:return Math.max(e,8)*Math.max(t,8)/2;case Ad:case jd:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Md:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Nd:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Pd:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case Fd:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case Id:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case Ld:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case Rd:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case zd:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case Bd:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case Vd:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case Hd:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case Ud:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case Wd:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case Gd:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case Kd:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case qd:case Jd:case Yd:return Math.ceil(e/4)*Math.ceil(t/4)*16;case Xd:case Zd:return Math.ceil(e/4)*Math.ceil(t/4)*8;case Qd:case $d:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error(`Unable to determine texture byte length for ${n} format.`)}function XC(e){switch(e){case $u:case ed:return{byteLength:1,components:1};case nd:case td:case od:return{byteLength:2,components:1};case sd:case cd:return{byteLength:2,components:4};case id:case rd:case ad:return{byteLength:4,components:1};case ud:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${e}.`)}var ZC=class{static contain(e,t){return KC(e,t)}static cover(e,t){return qC(e,t)}static fill(e){return JC(e)}static getByteLength(e,t,n,r){return YC(e,t,n,r)}};typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:Dl}})),typeof window<`u`&&(window.__THREE__?console.warn(`WARNING: Multiple instances of Three.js being imported.`):window.__THREE__=Dl);var QC={};l(QC,{ACESFilmicToneMapping:()=>Ou,AddEquation:()=>ql,AddOperation:()=>Cu,AdditiveAnimationBlendMode:()=>ff,AdditiveBlending:()=>Ul,AgXToneMapping:()=>Au,AlphaFormat:()=>dd,AlwaysCompare:()=>Xf,AlwaysDepth:()=>mu,AlwaysStencilFunc:()=>Hf,AmbientLight:()=>Yx,AnimationAction:()=>KS,AnimationClip:()=>_x,AnimationLoader:()=>Dx,AnimationMixer:()=>JS,AnimationObjectGroup:()=>GS,AnimationUtils:()=>ix,ArcCurve:()=>uy,ArrayCamera:()=>gS,ArrowHelper:()=>HC,AttachedBindMode:()=>Mu,Audio:()=>TS,AudioAnalyser:()=>jS,AudioContext:()=>uS,AudioListener:()=>wS,AudioLoader:()=>dS,AxesHelper:()=>UC,BackSide:()=>zl,BasicDepthPacking:()=>gf,BasicShadowMap:()=>Pl,BatchedMesh:()=>xv,Bone:()=>N_,BooleanKeyframeTrack:()=>ux,Box2:()=>lC,Box3:()=>Cm,Box3Helper:()=>LC,BoxGeometry:()=>Ag,BoxHelper:()=>IC,BufferAttribute:()=>$h,BufferGeometry:()=>hg,BufferGeometryLoader:()=>nS,ByteType:()=>ed,Cache:()=>bx,Camera:()=>zg,CameraHelper:()=>NC,CanvasTexture:()=>Yv,CapsuleGeometry:()=>Zv,CatmullRomCurve3:()=>gy,CineonToneMapping:()=>Du,CircleGeometry:()=>Qv,ClampToEdgeWrapping:()=>Vu,Clock:()=>_S,Color:()=>G,ColorKeyframeTrack:()=>dx,ColorManagement:()=>am,CompressedArrayTexture:()=>qv,CompressedCubeTexture:()=>Jv,CompressedTexture:()=>Kv,CompressedTextureLoader:()=>Ox,ConeGeometry:()=>ey,ConstantAlphaFactor:()=>du,ConstantColorFactor:()=>lu,Controls:()=>GC,CubeCamera:()=>Kg,CubeReflectionMapping:()=>Fu,CubeRefractionMapping:()=>Iu,CubeTexture:()=>qg,CubeTextureLoader:()=>Ax,CubeUVReflectionMapping:()=>zu,CubicBezierCurve:()=>Dy,CubicBezierCurve3:()=>Oy,CubicInterpolant:()=>ox,CullFaceBack:()=>jl,CullFaceFront:()=>Ml,CullFaceFrontBack:()=>Nl,CullFaceNone:()=>Al,Curve:()=>cy,CurvePath:()=>Fy,CustomBlending:()=>Kl,CustomToneMapping:()=>ku,CylinderGeometry:()=>$v,Cylindrical:()=>oC,Data3DTexture:()=>xm,DataArrayTexture:()=>ym,DataTexture:()=>P_,DataTextureLoader:()=>jx,DataUtils:()=>Yh,DecrementStencilOp:()=>jf,DecrementWrapStencilOp:()=>Nf,DefaultLoadingManager:()=>Sx,DepthFormat:()=>md,DepthStencilFormat:()=>hd,DepthTexture:()=>Xv,DetachedBindMode:()=>Nu,DirectionalLight:()=>Jx,DirectionalLightHelper:()=>AC,DiscreteInterpolant:()=>cx,DodecahedronGeometry:()=>ny,DoubleSide:()=>Bl,DstAlphaFactor:()=>iu,DstColorFactor:()=>ou,DynamicCopyUsage:()=>ip,DynamicDrawUsage:()=>Qf,DynamicReadUsage:()=>tp,EdgesGeometry:()=>sy,EllipseCurve:()=>ly,EqualCompare:()=>Gf,EqualDepth:()=>_u,EqualStencilFunc:()=>Lf,EquirectangularReflectionMapping:()=>Lu,EquirectangularRefractionMapping:()=>Ru,Euler:()=>ah,EventDispatcher:()=>pp,ExtrudeGeometry:()=>xb,FileLoader:()=>Ex,Float16BufferAttribute:()=>sg,Float32BufferAttribute:()=>K,FloatType:()=>ad,Fog:()=>$g,FogExp2:()=>Qg,FramebufferTexture:()=>Gv,FrontSide:()=>Rl,Frustum:()=>$_,FrustumArray:()=>nv,GLBufferAttribute:()=>eC,GLSL1:()=>op,GLSL3:()=>sp,GreaterCompare:()=>qf,GreaterDepth:()=>yu,GreaterEqualCompare:()=>Yf,GreaterEqualDepth:()=>vu,GreaterEqualStencilFunc:()=>Vf,GreaterStencilFunc:()=>zf,GridHelper:()=>TC,Group:()=>Yg,HalfFloatType:()=>od,HemisphereLight:()=>Px,HemisphereLightHelper:()=>wC,IcosahedronGeometry:()=>wb,ImageBitmapLoader:()=>cS,ImageLoader:()=>kx,ImageUtils:()=>lm,IncrementStencilOp:()=>Af,IncrementWrapStencilOp:()=>Mf,InstancedBufferAttribute:()=>R_,InstancedBufferGeometry:()=>tS,InstancedInterleavedBuffer:()=>$S,InstancedMesh:()=>K_,Int16BufferAttribute:()=>rg,Int32BufferAttribute:()=>ag,Int8BufferAttribute:()=>eg,IntType:()=>rd,InterleavedBuffer:()=>t_,InterleavedBufferAttribute:()=>r_,Interpolant:()=>ax,InterpolateDiscrete:()=>rf,InterpolateLinear:()=>af,InterpolateSmooth:()=>sf,InterpolationSamplingMode:()=>fp,InterpolationSamplingType:()=>dp,InvertStencilOp:()=>Pf,KeepStencilOp:()=>Of,KeyframeTrack:()=>lx,LOD:()=>S_,LatheGeometry:()=>Tb,Layers:()=>oh,LessCompare:()=>Wf,LessDepth:()=>hu,LessEqualCompare:()=>Kf,LessEqualDepth:()=>gu,LessEqualStencilFunc:()=>Rf,LessStencilFunc:()=>If,Light:()=>Nx,LightProbe:()=>Qx,Line:()=>Av,Line3:()=>fC,LineBasicMaterial:()=>Sv,LineCurve:()=>ky,LineCurve3:()=>Ay,LineDashedMaterial:()=>Xb,LineLoop:()=>Fv,LineSegments:()=>Pv,LinearFilter:()=>Ju,LinearInterpolant:()=>sx,LinearMipMapLinearFilter:()=>Qu,LinearMipMapNearestFilter:()=>Xu,LinearMipmapLinearFilter:()=>Zu,LinearMipmapNearestFilter:()=>Yu,LinearSRGBColorSpace:()=>wf,LinearToneMapping:()=>Tu,LinearTransfer:()=>Tf,Loader:()=>Cx,LoaderUtils:()=>eS,LoadingManager:()=>xx,LoopOnce:()=>ef,LoopPingPong:()=>nf,LoopRepeat:()=>tf,MOUSE:()=>Ol,Material:()=>Uh,MaterialLoader:()=>$x,MathUtils:()=>Bp,Matrix2:()=>sC,Matrix3:()=>Wp,Matrix4:()=>W,MaxEquation:()=>Zl,Mesh:()=>Dg,MeshBasicMaterial:()=>Wh,MeshDepthMaterial:()=>qb,MeshDistanceMaterial:()=>Jb,MeshLambertMaterial:()=>Kb,MeshMatcapMaterial:()=>Yb,MeshNormalMaterial:()=>Gb,MeshPhongMaterial:()=>Ub,MeshPhysicalMaterial:()=>Hb,MeshStandardMaterial:()=>Vb,MeshToonMaterial:()=>Wb,MinEquation:()=>Xl,MirroredRepeatWrapping:()=>Hu,MixOperation:()=>Su,MultiplyBlending:()=>Gl,MultiplyOperation:()=>xu,NearestFilter:()=>Uu,NearestMipMapLinearFilter:()=>qu,NearestMipMapNearestFilter:()=>Gu,NearestMipmapLinearFilter:()=>Ku,NearestMipmapNearestFilter:()=>Wu,NeutralToneMapping:()=>ju,NeverCompare:()=>Uf,NeverDepth:()=>pu,NeverStencilFunc:()=>Ff,NoBlending:()=>Vl,NoColorSpace:()=>Sf,NoToneMapping:()=>wu,NormalAnimationBlendMode:()=>df,NormalBlending:()=>Hl,NotEqualCompare:()=>Jf,NotEqualDepth:()=>bu,NotEqualStencilFunc:()=>Bf,NumberKeyframeTrack:()=>fx,Object3D:()=>Sh,ObjectLoader:()=>rS,ObjectSpaceNormalMap:()=>xf,OctahedronGeometry:()=>Eb,OneFactor:()=>$l,OneMinusConstantAlphaFactor:()=>fu,OneMinusConstantColorFactor:()=>uu,OneMinusDstAlphaFactor:()=>au,OneMinusDstColorFactor:()=>su,OneMinusSrcAlphaFactor:()=>ru,OneMinusSrcColorFactor:()=>tu,OrthographicCamera:()=>Kx,PCFShadowMap:()=>Fl,PCFSoftShadowMap:()=>Il,PMREMGenerator:()=>iD,Path:()=>Iy,PerspectiveCamera:()=>Ug,Plane:()=>X_,PlaneGeometry:()=>Db,PlaneHelper:()=>RC,PointLight:()=>Gx,PointLightHelper:()=>bC,Points:()=>Vv,PointsMaterial:()=>Iv,PolarGridHelper:()=>EC,PolyhedronGeometry:()=>ty,PositionalAudio:()=>AS,PropertyBinding:()=>WS,PropertyMixer:()=>MS,QuadraticBezierCurve:()=>jy,QuadraticBezierCurve3:()=>My,Quaternion:()=>Vp,QuaternionKeyframeTrack:()=>mx,QuaternionLinearInterpolant:()=>px,RED_GREEN_RGTC2_Format:()=>Qd,RED_RGTC1_Format:()=>Xd,REVISION:()=>Dl,RGBADepthPacking:()=>_f,RGBAFormat:()=>pd,RGBAIntegerFormat:()=>xd,RGBA_ASTC_10x10_Format:()=>Wd,RGBA_ASTC_10x5_Format:()=>Vd,RGBA_ASTC_10x6_Format:()=>Hd,RGBA_ASTC_10x8_Format:()=>Ud,RGBA_ASTC_12x10_Format:()=>Gd,RGBA_ASTC_12x12_Format:()=>Kd,RGBA_ASTC_4x4_Format:()=>Nd,RGBA_ASTC_5x4_Format:()=>Pd,RGBA_ASTC_5x5_Format:()=>Fd,RGBA_ASTC_6x5_Format:()=>Id,RGBA_ASTC_6x6_Format:()=>Ld,RGBA_ASTC_8x5_Format:()=>Rd,RGBA_ASTC_8x6_Format:()=>zd,RGBA_ASTC_8x8_Format:()=>Bd,RGBA_BPTC_Format:()=>qd,RGBA_ETC2_EAC_Format:()=>Md,RGBA_PVRTC_2BPPV1_Format:()=>kd,RGBA_PVRTC_4BPPV1_Format:()=>Od,RGBA_S3TC_DXT1_Format:()=>Cd,RGBA_S3TC_DXT3_Format:()=>wd,RGBA_S3TC_DXT5_Format:()=>Td,RGBDepthPacking:()=>vf,RGBFormat:()=>fd,RGBIntegerFormat:()=>bd,RGB_BPTC_SIGNED_Format:()=>Jd,RGB_BPTC_UNSIGNED_Format:()=>Yd,RGB_ETC1_Format:()=>Ad,RGB_ETC2_Format:()=>jd,RGB_PVRTC_2BPPV1_Format:()=>Dd,RGB_PVRTC_4BPPV1_Format:()=>Ed,RGB_S3TC_DXT1_Format:()=>Sd,RGDepthPacking:()=>yf,RGFormat:()=>vd,RGIntegerFormat:()=>yd,RawShaderMaterial:()=>Bb,Ray:()=>Ym,Raycaster:()=>nC,RectAreaLight:()=>Xx,RedFormat:()=>gd,RedIntegerFormat:()=>_d,ReinhardToneMapping:()=>Eu,RenderTarget:()=>_m,RenderTarget3D:()=>YS,RepeatWrapping:()=>Bu,ReplaceStencilOp:()=>kf,ReverseSubtractEquation:()=>Yl,RingGeometry:()=>Ob,SIGNED_RED_GREEN_RGTC2_Format:()=>$d,SIGNED_RED_RGTC1_Format:()=>Zd,SRGBColorSpace:()=>Cf,SRGBTransfer:()=>Ef,Scene:()=>e_,ShaderChunk:()=>PE,ShaderLib:()=>FE,ShaderMaterial:()=>Rg,ShadowMaterial:()=>zb,Shape:()=>Ly,ShapeGeometry:()=>kb,ShapePath:()=>WC,ShapeUtils:()=>vb,ShortType:()=>td,Skeleton:()=>L_,SkeletonHelper:()=>vC,SkinnedMesh:()=>M_,Source:()=>dm,Sphere:()=>Vm,SphereGeometry:()=>jb,Spherical:()=>aC,SphericalHarmonics3:()=>Zx,SplineCurve:()=>Ny,SpotLight:()=>Bx,SpotLightHelper:()=>mC,Sprite:()=>v_,SpriteMaterial:()=>i_,SrcAlphaFactor:()=>nu,SrcAlphaSaturateFactor:()=>cu,SrcColorFactor:()=>eu,StaticCopyUsage:()=>rp,StaticDrawUsage:()=>Zf,StaticReadUsage:()=>ep,StereoCamera:()=>hS,StreamCopyUsage:()=>ap,StreamDrawUsage:()=>$f,StreamReadUsage:()=>np,StringKeyframeTrack:()=>hx,SubtractEquation:()=>Jl,SubtractiveBlending:()=>Wl,TOUCH:()=>kl,TangentSpaceNormalMap:()=>bf,TetrahedronGeometry:()=>Mb,Texture:()=>hm,TextureLoader:()=>Mx,TextureUtils:()=>ZC,TimestampQuery:()=>up,TorusGeometry:()=>Nb,TorusKnotGeometry:()=>Pb,Triangle:()=>Ih,TriangleFanDrawMode:()=>hf,TriangleStripDrawMode:()=>mf,TrianglesDrawMode:()=>pf,TubeGeometry:()=>Fb,UVMapping:()=>Pu,Uint16BufferAttribute:()=>ig,Uint32BufferAttribute:()=>og,Uint8BufferAttribute:()=>tg,Uint8ClampedBufferAttribute:()=>ng,Uniform:()=>XS,UniformsGroup:()=>QS,UniformsLib:()=>q,UniformsUtils:()=>Fg,UnsignedByteType:()=>$u,UnsignedInt248Type:()=>ld,UnsignedInt5999Type:()=>ud,UnsignedIntType:()=>id,UnsignedShort4444Type:()=>sd,UnsignedShort5551Type:()=>cd,UnsignedShortType:()=>nd,VSMShadowMap:()=>Ll,Vector2:()=>H,Vector3:()=>U,Vector4:()=>gm,VectorKeyframeTrack:()=>gx,VideoFrameTexture:()=>Wv,VideoTexture:()=>Uv,WebGL3DRenderTarget:()=>Sm,WebGLArrayRenderTarget:()=>bm,WebGLCoordinateSystem:()=>cp,WebGLCubeRenderTarget:()=>Jg,WebGLRenderTarget:()=>vm,WebGLRenderer:()=>Pk,WebGLUtils:()=>Tk,WebGPUCoordinateSystem:()=>lp,WebXRController:()=>Zg,WireframeGeometry:()=>Ib,WrapAroundEnding:()=>uf,ZeroCurvatureEnding:()=>cf,ZeroFactor:()=>Ql,ZeroSlopeEnding:()=>lf,ZeroStencilOp:()=>Df,createCanvasElement:()=>Xp});function $C(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function ew(e){let t=new WeakMap;function n(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function r(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,_w=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,vw=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,yw=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,bw=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,xw=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Sw=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Cw=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,ww=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,Tw=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,Ew=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,Dw=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Ow=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,kw=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,Aw=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,jw=`gl_FragColor = linearToOutputTexel( gl_FragColor );`,Mw=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,Nw=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,Pw=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Fw=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,Iw=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,Lw=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Rw=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,zw=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Bw=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,Vw=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,Hw=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,Uw=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,Ww=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,Gw=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Kw=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,qw=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,Jw=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Yw=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Xw=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,Zw=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Qw=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,$w=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,eT=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,tT=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,nT=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,rT=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,iT=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,aT=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,oT=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,sT=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,cT=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,lT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,uT=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,dT=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,fT=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,pT=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,mT=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,hT=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,gT=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,_T=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,vT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,yT=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,bT=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,xT=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,ST=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,CT=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,wT=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,TT=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,ET=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,DT=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,OT=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,kT=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,AT=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,jT=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,MT=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,NT=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,PT=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,FT=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,IT=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,LT=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,RT=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,zT=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,BT=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,VT=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,HT=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,UT=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,WT=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,GT=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,KT=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,qT=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,JT=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,YT=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,XT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,ZT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,QT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,$T=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const eE=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,tE=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,nE=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,rE=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,iE=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,aE=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,oE=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,sE=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,cE=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,lE=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,uE=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,dE=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,fE=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,pE=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,mE=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,hE=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,gE=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,_E=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,vE=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,yE=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,bE=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,xE=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,SE=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,CE=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,wE=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,TE=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,EE=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,DE=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,OE=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,kE=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,AE=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,jE=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,ME=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,NE=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,PE={alphahash_fragment:tw,alphahash_pars_fragment:nw,alphamap_fragment:rw,alphamap_pars_fragment:iw,alphatest_fragment:aw,alphatest_pars_fragment:ow,aomap_fragment:sw,aomap_pars_fragment:cw,batching_pars_vertex:lw,batching_vertex:uw,begin_vertex:dw,beginnormal_vertex:fw,bsdfs:pw,iridescence_fragment:mw,bumpmap_pars_fragment:hw,clipping_planes_fragment:gw,clipping_planes_pars_fragment:_w,clipping_planes_pars_vertex:vw,clipping_planes_vertex:yw,color_fragment:bw,color_pars_fragment:xw,color_pars_vertex:Sw,color_vertex:Cw,common:ww,cube_uv_reflection_fragment:Tw,defaultnormal_vertex:Ew,displacementmap_pars_vertex:Dw,displacementmap_vertex:Ow,emissivemap_fragment:kw,emissivemap_pars_fragment:Aw,colorspace_fragment:jw,colorspace_pars_fragment:Mw,envmap_fragment:Nw,envmap_common_pars_fragment:Pw,envmap_pars_fragment:Fw,envmap_pars_vertex:Iw,envmap_physical_pars_fragment:qw,envmap_vertex:Lw,fog_vertex:Rw,fog_pars_vertex:zw,fog_fragment:Bw,fog_pars_fragment:Vw,gradientmap_pars_fragment:Hw,lightmap_pars_fragment:Uw,lights_lambert_fragment:Ww,lights_lambert_pars_fragment:Gw,lights_pars_begin:Kw,lights_toon_fragment:Jw,lights_toon_pars_fragment:Yw,lights_phong_fragment:Xw,lights_phong_pars_fragment:Zw,lights_physical_fragment:Qw,lights_physical_pars_fragment:$w,lights_fragment_begin:eT,lights_fragment_maps:tT,lights_fragment_end:nT,logdepthbuf_fragment:rT,logdepthbuf_pars_fragment:iT,logdepthbuf_pars_vertex:aT,logdepthbuf_vertex:oT,map_fragment:sT,map_pars_fragment:cT,map_particle_fragment:lT,map_particle_pars_fragment:uT,metalnessmap_fragment:dT,metalnessmap_pars_fragment:fT,morphinstance_vertex:pT,morphcolor_vertex:mT,morphnormal_vertex:hT,morphtarget_pars_vertex:gT,morphtarget_vertex:_T,normal_fragment_begin:vT,normal_fragment_maps:yT,normal_pars_fragment:bT,normal_pars_vertex:xT,normal_vertex:ST,normalmap_pars_fragment:CT,clearcoat_normal_fragment_begin:wT,clearcoat_normal_fragment_maps:TT,clearcoat_pars_fragment:ET,iridescence_pars_fragment:DT,opaque_fragment:OT,packing:kT,premultiplied_alpha_fragment:AT,project_vertex:jT,dithering_fragment:MT,dithering_pars_fragment:NT,roughnessmap_fragment:PT,roughnessmap_pars_fragment:FT,shadowmap_pars_fragment:IT,shadowmap_pars_vertex:LT,shadowmap_vertex:RT,shadowmask_pars_fragment:zT,skinbase_vertex:BT,skinning_pars_vertex:VT,skinning_vertex:HT,skinnormal_vertex:UT,specularmap_fragment:WT,specularmap_pars_fragment:GT,tonemapping_fragment:KT,tonemapping_pars_fragment:qT,transmission_fragment:JT,transmission_pars_fragment:YT,uv_pars_fragment:XT,uv_pars_vertex:ZT,uv_vertex:QT,worldpos_vertex:$T,background_vert:eE,background_frag:tE,backgroundCube_vert:nE,backgroundCube_frag:rE,cube_vert:iE,cube_frag:aE,depth_vert:oE,depth_frag:sE,distanceRGBA_vert:cE,distanceRGBA_frag:lE,equirect_vert:uE,equirect_frag:dE,linedashed_vert:fE,linedashed_frag:pE,meshbasic_vert:mE,meshbasic_frag:hE,meshlambert_vert:gE,meshlambert_frag:_E,meshmatcap_vert:vE,meshmatcap_frag:yE,meshnormal_vert:bE,meshnormal_frag:xE,meshphong_vert:SE,meshphong_frag:CE,meshphysical_vert:wE,meshphysical_frag:TE,meshtoon_vert:EE,meshtoon_frag:DE,points_vert:OE,points_frag:kE,shadow_vert:AE,shadow_frag:jE,sprite_vert:ME,sprite_frag:NE},q={common:{diffuse:{value:new G(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Wp},alphaMap:{value:null},alphaMapTransform:{value:new Wp},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Wp}},envmap:{envMap:{value:null},envMapRotation:{value:new Wp},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Wp}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Wp}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Wp},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Wp},normalScale:{value:new H(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Wp},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Wp}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Wp}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Wp}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new G(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new G(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Wp},alphaTest:{value:0},uvTransform:{value:new Wp}},sprite:{diffuse:{value:new G(16777215)},opacity:{value:1},center:{value:new H(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Wp},alphaMap:{value:null},alphaMapTransform:{value:new Wp},alphaTest:{value:0}}},FE={basic:{uniforms:Mg([q.common,q.specularmap,q.envmap,q.aomap,q.lightmap,q.fog]),vertexShader:PE.meshbasic_vert,fragmentShader:PE.meshbasic_frag},lambert:{uniforms:Mg([q.common,q.specularmap,q.envmap,q.aomap,q.lightmap,q.emissivemap,q.bumpmap,q.normalmap,q.displacementmap,q.fog,q.lights,{emissive:{value:new G(0)}}]),vertexShader:PE.meshlambert_vert,fragmentShader:PE.meshlambert_frag},phong:{uniforms:Mg([q.common,q.specularmap,q.envmap,q.aomap,q.lightmap,q.emissivemap,q.bumpmap,q.normalmap,q.displacementmap,q.fog,q.lights,{emissive:{value:new G(0)},specular:{value:new G(1118481)},shininess:{value:30}}]),vertexShader:PE.meshphong_vert,fragmentShader:PE.meshphong_frag},standard:{uniforms:Mg([q.common,q.envmap,q.aomap,q.lightmap,q.emissivemap,q.bumpmap,q.normalmap,q.displacementmap,q.roughnessmap,q.metalnessmap,q.fog,q.lights,{emissive:{value:new G(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:PE.meshphysical_vert,fragmentShader:PE.meshphysical_frag},toon:{uniforms:Mg([q.common,q.aomap,q.lightmap,q.emissivemap,q.bumpmap,q.normalmap,q.displacementmap,q.gradientmap,q.fog,q.lights,{emissive:{value:new G(0)}}]),vertexShader:PE.meshtoon_vert,fragmentShader:PE.meshtoon_frag},matcap:{uniforms:Mg([q.common,q.bumpmap,q.normalmap,q.displacementmap,q.fog,{matcap:{value:null}}]),vertexShader:PE.meshmatcap_vert,fragmentShader:PE.meshmatcap_frag},points:{uniforms:Mg([q.points,q.fog]),vertexShader:PE.points_vert,fragmentShader:PE.points_frag},dashed:{uniforms:Mg([q.common,q.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:PE.linedashed_vert,fragmentShader:PE.linedashed_frag},depth:{uniforms:Mg([q.common,q.displacementmap]),vertexShader:PE.depth_vert,fragmentShader:PE.depth_frag},normal:{uniforms:Mg([q.common,q.bumpmap,q.normalmap,q.displacementmap,{opacity:{value:1}}]),vertexShader:PE.meshnormal_vert,fragmentShader:PE.meshnormal_frag},sprite:{uniforms:Mg([q.sprite,q.fog]),vertexShader:PE.sprite_vert,fragmentShader:PE.sprite_frag},background:{uniforms:{uvTransform:{value:new Wp},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:PE.background_vert,fragmentShader:PE.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Wp}},vertexShader:PE.backgroundCube_vert,fragmentShader:PE.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:PE.cube_vert,fragmentShader:PE.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:PE.equirect_vert,fragmentShader:PE.equirect_frag},distanceRGBA:{uniforms:Mg([q.common,q.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:PE.distanceRGBA_vert,fragmentShader:PE.distanceRGBA_frag},shadow:{uniforms:Mg([q.lights,q.fog,{color:{value:new G(0)},opacity:{value:1}}]),vertexShader:PE.shadow_vert,fragmentShader:PE.shadow_frag}};FE.physical={uniforms:Mg([FE.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Wp},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Wp},clearcoatNormalScale:{value:new H(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Wp},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Wp},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Wp},sheen:{value:0},sheenColor:{value:new G(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Wp},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Wp},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Wp},transmissionSamplerSize:{value:new H},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Wp},attenuationDistance:{value:0},attenuationColor:{value:new G(0)},specularColor:{value:new G(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Wp},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Wp},anisotropyVector:{value:new H},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Wp}}]),vertexShader:PE.meshphysical_vert,fragmentShader:PE.meshphysical_frag};const IE={r:0,b:0,g:0},LE=new ah,RE=new W;function zE(e,t,n,r,i,a,o){let s=new G(0),c=a===!0?0:1,l,u,d=null,f=0,p=null;function m(e){let r=e.isScene===!0?e.background:null;if(r&&r.isTexture){let i=e.backgroundBlurriness>0;r=(i?n:t).get(r)}return r}function h(t){let n=!1,i=m(t);i===null?_(s,c):i&&i.isColor&&(_(i,1),n=!0);let a=e.xr.getEnvironmentBlendMode();a===`additive`?r.buffers.color.setClear(0,0,0,1,o):a===`alpha-blend`&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function g(t,n){let r=m(n);r&&(r.isCubeTexture||r.mapping===zu)?(u===void 0&&(u=new Dg(new Ag(1,1,1),new Rg({name:`BackgroundCubeMaterial`,uniforms:jg(FE.backgroundCube.uniforms),vertexShader:FE.backgroundCube.vertexShader,fragmentShader:FE.backgroundCube.fragmentShader,side:zl,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute(`normal`),u.geometry.deleteAttribute(`uv`),u.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,`envMap`,{get:function(){return this.uniforms.envMap.value}}),i.update(u)),LE.copy(n.backgroundRotation),LE.x*=-1,LE.y*=-1,LE.z*=-1,r.isCubeTexture&&r.isRenderTargetTexture===!1&&(LE.y*=-1,LE.z*=-1),u.material.uniforms.envMap.value=r,u.material.uniforms.flipEnvMap.value=r.isCubeTexture&&r.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(RE.makeRotationFromEuler(LE)),u.material.toneMapped=am.getTransfer(r.colorSpace)!==Ef,(d!==r||f!==r.version||p!==e.toneMapping)&&(u.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),u.layers.enableAll(),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(l===void 0&&(l=new Dg(new Db(2,2),new Rg({name:`BackgroundMaterial`,uniforms:jg(FE.background.uniforms),vertexShader:FE.background.vertexShader,fragmentShader:FE.background.fragmentShader,side:Rl,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),Object.defineProperty(l.material,`map`,{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=r,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=am.getTransfer(r.colorSpace)!==Ef,r.matrixAutoUpdate===!0&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),(d!==r||f!==r.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}function _(t,n){t.getRGB(IE,Pg(e)),r.buffers.color.setClear(IE.r,IE.g,IE.b,n,o)}function v(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),c=t,_(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,_(s,c)},render:h,addToRenderList:g,dispose:v}}function BE(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n){let i=n.wireframe===!0,a=r[e.id];a===void 0&&(a={},r[e.id]=a);let o=a[t.id];o===void 0&&(o={},a[t.id]=o);let s=o[i];return s===void 0&&(s=f(c()),o[i]=s),s}function f(e){let t=[],r=[],i=[];for(let e=0;e=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c){let n=c[t];if(n.location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===rd;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(console.warn(`THREE.WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let d=n.logarithmicDepthBuffer===!0,f=n.reverseDepthBuffer===!0&&t.has(`EXT_clip_control`),p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),m=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),g=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),_=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),b=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=m>0,S=e.getParameter(e.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:b,vertexTextures:x,maxSamples:S}}function UE(e){let t=this,n=null,r=0,i=!1,a=!1,o=new X_,s=new Wp,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length0){let o=new Jg(a.height);return o.fromEquirectangularTexture(e,r),t.set(r,o),r.addEventListener(`dispose`,i),n(o.texture,r.mapping)}else return null}}return r}function i(e){let n=e.target;n.removeEventListener(`dispose`,i);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function a(){t=new WeakMap}return{get:r,dispose:a}}const GE=4,KE=[.125,.215,.35,.446,.526,.582],qE=20,JE=new Kx,YE=new G;let XE=null,ZE=0,QE=0,$E=!1;const eD=(1+Math.sqrt(5))/2,tD=1/eD,nD=[new U(-eD,tD,0),new U(eD,tD,0),new U(-tD,0,eD),new U(tD,0,eD),new U(0,eD,-tD),new U(0,eD,tD),new U(-1,1,-1),new U(1,1,-1),new U(-1,1,1),new U(1,1,1)],rD=new U;var iD=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=rD}=i;XE=this._renderer.getRenderTarget(),ZE=this._renderer.getActiveCubeFace(),QE=this._renderer.getActiveMipmapLevel(),$E=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=uD(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=lD(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?a:0,a,a),u.setRenderTarget(r),h&&u.render(m,s),u.render(e,s)}m.geometry.dispose(),m.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=g}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===Fu||e.mapping===Iu;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=uD()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=lD());let i=r?this._cubemapMaterial:this._equirectMaterial,a=new Dg(this._lodPlanes[0],i),o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;sD(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,JE)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodPlanes.length;for(let t=1;tqE&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${h} samples when the maximum is set to ${qE}`);let g=[],_=0;for(let e=0;ev-GE?r-v+GE:0),x=4*(this._cubeSize-y);sD(t,b,x,3*y,2*y),s.setRenderTarget(t),s.render(u,JE)}};function aD(e){let t=[],n=[],r=[],i=e,a=e-GE+1+KE.length;for(let o=0;oe-GE?s=KE[o-e+GE-1]:o===0&&(s=0),r.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=6,p=6,m=3,h=2,g=1,_=new Float32Array(m*p*f),v=new Float32Array(h*p*f),y=new Float32Array(g*p*f);for(let e=0;e2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];_.set(r,m*p*e),v.set(d,h*p*e);let i=[e,e,e,e,e,e];y.set(i,g*p*e)}let b=new hg;b.setAttribute(`position`,new $h(_,m)),b.setAttribute(`uv`,new $h(v,h)),b.setAttribute(`faceIndex`,new $h(y,g)),t.push(b),i>GE&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}function oD(e,t,n){let r=new vm(e,t,n);return r.texture.mapping=zu,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function sD(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function cD(e,t,n){let r=new Float32Array(qE),i=new U(0,1,0),a=new Rg({name:`SphericalGaussianBlur`,defines:{n:qE,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:dD(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Vl,depthTest:!1,depthWrite:!1});return a}function lD(){return new Rg({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:dD(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Vl,depthTest:!1,depthWrite:!1})}function uD(){return new Rg({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:dD(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Vl,depthTest:!1,depthWrite:!1})}function dD(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function fD(e){let t=new WeakMap,n=null;function r(r){if(r&&r.isTexture){let o=r.mapping,s=o===Lu||o===Ru,c=o===Fu||o===Iu;if(s||c){let o=t.get(r),l=o===void 0?0:o.texture.pmremVersion;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return n===null&&(n=new iD(e)),o=s?n.fromEquirectangular(r,o):n.fromCubemap(r,o),o.texture.pmremVersion=r.pmremVersion,t.set(r,o),o.texture;if(o!==void 0)return o.texture;{let l=r.image;return s&&l&&l.height>0||c&&l&&i(l)?(n===null&&(n=new iD(e)),o=s?n.fromEquirectangular(r):n.fromCubemap(r),o.texture.pmremVersion=r.pmremVersion,t.set(r,o),r.addEventListener(`dispose`,a),o.texture):null}}}return r}function i(e){let t=0,n=6;for(let r=0;rt.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new ym(h,p,m,u);g.type=ad,g.needsUpdate=!0;let _=f*4;for(let t=0;t0)return e;let i=t*n,a=wD[i];if(a===void 0&&(a=new Float32Array(i),wD[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function AD(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n`:` `} ${i}: ${n[e]}`)}return r.join(` +`)}const AO=new Wp;function jO(e){am._getMatrix(AO,am.workingColorSpace,e);let t=`mat3( ${AO.elements.map(e=>e.toFixed(4))} )`;switch(am.getTransfer(e)){case Tf:return[t,`LinearTransferOETF`];case Ef:return[t,`sRGBTransferOETF`];default:return console.warn(`THREE.WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function MO(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+` + +`+i+` + +`+kO(e.getShaderSource(t),r)}else return i}function NO(e,t){let n=jO(t);return[`vec4 ${e}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(` +`)}function PO(e,t){let n;switch(t){case Tu:n=`Linear`;break;case Eu:n=`Reinhard`;break;case Du:n=`Cineon`;break;case Ou:n=`ACESFilmic`;break;case Au:n=`AgX`;break;case ju:n=`Neutral`;break;case ku:n=`Custom`;break;default:console.warn(`THREE.WebGLProgram: Unsupported toneMapping:`,t),n=`Linear`}return`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}const FO=new U;function IO(){am.getLuminanceCoefficients(FO);let e=FO.x.toFixed(4),t=FO.y.toFixed(4),n=FO.z.toFixed(4);return[`float luminance( const in vec3 rgb ) {`,` const vec3 weights = vec3( ${e}, ${t}, ${n} );`,` return dot( weights, rgb );`,`}`].join(` +`)}function LO(e){let t=[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``];return t.filter(BO).join(` +`)}function RO(e){let t=[];for(let n in e){let r=e[n];if(r===!1)continue;t.push(`#define `+n+` `+r)}return t.join(` +`)}function zO(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function WO(e){return e.replace(UO,KO)}const GO=new Map;function KO(e,t){let n=PE[t];if(n===void 0){let e=GO.get(t);if(e!==void 0)n=PE[e],console.warn(`THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`Can not resolve #include <`+t+`>`)}return WO(n)}const qO=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function JO(e){return e.replace(qO,YO)}function YO(e,t,n,r){let i=``;for(let e=parseInt(t);e0&&(g+=` +`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(BO).join(` +`),_.length>0&&(_+=` +`)):(g=[XO(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGDEPTHBUF`:``,n.reverseDepthBuffer?`#define USE_REVERSEDEPTHBUF`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,` attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,` attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,` uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,` attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,` attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,` attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,` attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,` attribute vec4 color;`,`#elif defined( USE_COLOR )`,` attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,` attribute vec4 skinIndex;`,` attribute vec4 skinWeight;`,`#endif`,` +`].filter(BO).join(` +`),_=[XO(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matcap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor||n.batchingColor?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGDEPTHBUF`:``,n.reverseDepthBuffer?`#define USE_REVERSEDEPTHBUF`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===wu?``:`#define TONE_MAPPING`,n.toneMapping===wu?``:PE.tonemapping_pars_fragment,n.toneMapping===wu?``:PO(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,PE.colorspace_pars_fragment,NO(`linearToOutputTexel`,n.outputColorSpace),IO(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,` +`].filter(BO).join(` +`)),o=WO(o),o=VO(o,n),o=HO(o,n),s=WO(s),s=VO(s,n),s=HO(s,n),o=JO(o),s=JO(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es +`,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(` +`)+` +`+g,_=[`#define varying in`,n.glslVersion===sp?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===sp?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(` +`)+` +`+_);let y=v+g+o,b=v+_+s,x=EO(i,i.VERTEX_SHADER,y),S=EO(i,i.FRAGMENT_SHADER,b);i.attachShader(h,x),i.attachShader(h,S),n.index0AttributeName===void 0?n.morphTargets===!0&&i.bindAttribLocation(h,0,`position`):i.bindAttribLocation(h,0,n.index0AttributeName),i.linkProgram(h);function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h).trim(),r=i.getShaderInfoLog(x).trim(),a=i.getShaderInfoLog(S).trim(),o=!0,s=!0;if(i.getProgramParameter(h,i.LINK_STATUS)===!1)if(o=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=MO(i,x,`vertex`),r=MO(i,S,`fragment`);console.error(`THREE.WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+` + +Material Name: `+t.name+` +Material Type: `+t.type+` + +Program Info Log: `+n+` +`+e+` +`+r)}else n===``?(r===``||a===``)&&(s=!1):console.warn(`THREE.WebGLProgram: Program Info Log:`,n);s&&(t.diagnostics={runnable:o,programLog:n,vertexShader:{log:r,prefix:g},fragmentShader:{log:a,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new TO(i,h),T=zO(i,h)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let T;this.getAttributes=function(){return T===void 0&&C(this),T};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(h,DO)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=OO++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}let rk=0;var ik=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(i)===!1&&(a.add(i),i.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new ak(e),t.set(e,n)),n}},ak=class{constructor(e){this.id=rk++,this.code=e,this.usedTimes=0}};function ok(e,t,n,r,i,a,o){let s=new oh,c=new ik,l=new Set,u=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures,p=i.precision,m={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distanceRGBA`,MeshNormalMaterial:`normal`,MeshBasicMaterial:`basic`,MeshLambertMaterial:`lambert`,MeshPhongMaterial:`phong`,MeshToonMaterial:`toon`,MeshStandardMaterial:`physical`,MeshPhysicalMaterial:`physical`,MeshMatcapMaterial:`matcap`,LineBasicMaterial:`basic`,LineDashedMaterial:`dashed`,PointsMaterial:`points`,ShadowMaterial:`shadow`,SpriteMaterial:`sprite`};function h(e){return l.add(e),e===0?`uv`:`uv${e}`}function g(a,s,u,g,_){let v=g.fog,y=_.geometry,b=a.isMeshStandardMaterial?g.environment:null,x=(a.isMeshStandardMaterial?n:t).get(a.envMap||b),S=x&&x.mapping===zu?x.image.height:null,C=m[a.type];a.precision!==null&&(p=i.getMaxPrecision(a.precision),p!==a.precision&&console.warn(`THREE.WebGLProgram.getParameters:`,a.precision,`not supported, using`,p,`instead.`));let w=y.morphAttributes.position||y.morphAttributes.normal||y.morphAttributes.color,T=w===void 0?0:w.length,E=0;y.morphAttributes.position!==void 0&&(E=1),y.morphAttributes.normal!==void 0&&(E=2),y.morphAttributes.color!==void 0&&(E=3);let D,O,k,A;if(C){let e=FE[C];D=e.vertexShader,O=e.fragmentShader}else D=a.vertexShader,O=a.fragmentShader,c.update(a),k=c.getVertexShaderID(a),A=c.getFragmentShaderID(a);let j=e.getRenderTarget(),M=e.state.buffers.depth.getReversed(),N=_.isInstancedMesh===!0,ee=_.isBatchedMesh===!0,te=!!a.map,P=!!a.matcap,ne=!!x,re=!!a.aoMap,ie=!!a.lightMap,ae=!!a.bumpMap,oe=!!a.normalMap,se=!!a.displacementMap,ce=!!a.emissiveMap,le=!!a.metalnessMap,ue=!!a.roughnessMap,de=a.anisotropy>0,fe=a.clearcoat>0,pe=a.dispersion>0,F=a.iridescence>0,me=a.sheen>0,he=a.transmission>0,ge=de&&!!a.anisotropyMap,I=fe&&!!a.clearcoatMap,_e=fe&&!!a.clearcoatNormalMap,L=fe&&!!a.clearcoatRoughnessMap,ve=F&&!!a.iridescenceMap,ye=F&&!!a.iridescenceThicknessMap,be=me&&!!a.sheenColorMap,xe=me&&!!a.sheenRoughnessMap,Se=!!a.specularMap,Ce=!!a.specularColorMap,we=!!a.specularIntensityMap,Te=he&&!!a.transmissionMap,Ee=he&&!!a.thicknessMap,De=!!a.gradientMap,Oe=!!a.alphaMap,ke=a.alphaTest>0,Ae=!!a.alphaHash,je=!!a.extensions,Me=wu;a.toneMapped&&(j===null||j.isXRRenderTarget===!0)&&(Me=e.toneMapping);let Ne={shaderID:C,shaderType:a.type,shaderName:a.name,vertexShader:D,fragmentShader:O,defines:a.defines,customVertexShaderID:k,customFragmentShaderID:A,isRawShaderMaterial:a.isRawShaderMaterial===!0,glslVersion:a.glslVersion,precision:p,batching:ee,batchingColor:ee&&_._colorsTexture!==null,instancing:N,instancingColor:N&&_.instanceColor!==null,instancingMorph:N&&_.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:j===null?e.outputColorSpace:j.isXRRenderTarget===!0?j.texture.colorSpace:wf,alphaToCoverage:!!a.alphaToCoverage,map:te,matcap:P,envMap:ne,envMapMode:ne&&x.mapping,envMapCubeUVHeight:S,aoMap:re,lightMap:ie,bumpMap:ae,normalMap:oe,displacementMap:f&&se,emissiveMap:ce,normalMapObjectSpace:oe&&a.normalMapType===xf,normalMapTangentSpace:oe&&a.normalMapType===bf,metalnessMap:le,roughnessMap:ue,anisotropy:de,anisotropyMap:ge,clearcoat:fe,clearcoatMap:I,clearcoatNormalMap:_e,clearcoatRoughnessMap:L,dispersion:pe,iridescence:F,iridescenceMap:ve,iridescenceThicknessMap:ye,sheen:me,sheenColorMap:be,sheenRoughnessMap:xe,specularMap:Se,specularColorMap:Ce,specularIntensityMap:we,transmission:he,transmissionMap:Te,thicknessMap:Ee,gradientMap:De,opaque:a.transparent===!1&&a.blending===Hl&&a.alphaToCoverage===!1,alphaMap:Oe,alphaTest:ke,alphaHash:Ae,combine:a.combine,mapUv:te&&h(a.map.channel),aoMapUv:re&&h(a.aoMap.channel),lightMapUv:ie&&h(a.lightMap.channel),bumpMapUv:ae&&h(a.bumpMap.channel),normalMapUv:oe&&h(a.normalMap.channel),displacementMapUv:se&&h(a.displacementMap.channel),emissiveMapUv:ce&&h(a.emissiveMap.channel),metalnessMapUv:le&&h(a.metalnessMap.channel),roughnessMapUv:ue&&h(a.roughnessMap.channel),anisotropyMapUv:ge&&h(a.anisotropyMap.channel),clearcoatMapUv:I&&h(a.clearcoatMap.channel),clearcoatNormalMapUv:_e&&h(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:L&&h(a.clearcoatRoughnessMap.channel),iridescenceMapUv:ve&&h(a.iridescenceMap.channel),iridescenceThicknessMapUv:ye&&h(a.iridescenceThicknessMap.channel),sheenColorMapUv:be&&h(a.sheenColorMap.channel),sheenRoughnessMapUv:xe&&h(a.sheenRoughnessMap.channel),specularMapUv:Se&&h(a.specularMap.channel),specularColorMapUv:Ce&&h(a.specularColorMap.channel),specularIntensityMapUv:we&&h(a.specularIntensityMap.channel),transmissionMapUv:Te&&h(a.transmissionMap.channel),thicknessMapUv:Ee&&h(a.thicknessMap.channel),alphaMapUv:Oe&&h(a.alphaMap.channel),vertexTangents:!!y.attributes.tangent&&(oe||de),vertexColors:a.vertexColors,vertexAlphas:a.vertexColors===!0&&!!y.attributes.color&&y.attributes.color.itemSize===4,pointsUvs:_.isPoints===!0&&!!y.attributes.uv&&(te||Oe),fog:!!v,useFog:a.fog===!0,fogExp2:!!v&&v.isFogExp2,flatShading:a.flatShading===!0,sizeAttenuation:a.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:M,skinning:_.isSkinnedMesh===!0,morphTargets:y.morphAttributes.position!==void 0,morphNormals:y.morphAttributes.normal!==void 0,morphColors:y.morphAttributes.color!==void 0,morphTargetsCount:T,morphTextureStride:E,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:Me,decodeVideoTexture:te&&a.map.isVideoTexture===!0&&am.getTransfer(a.map.colorSpace)===Ef,decodeVideoTextureEmissive:ce&&a.emissiveMap.isVideoTexture===!0&&am.getTransfer(a.emissiveMap.colorSpace)===Ef,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===Bl,flipSided:a.side===zl,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:je&&a.extensions.clipCullDistance===!0&&r.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(je&&a.extensions.multiDraw===!0||ee)&&r.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:r.has(`KHR_parallel_shader_compile`),customProgramCacheKey:a.customProgramCacheKey()};return Ne.vertexUv1s=l.has(1),Ne.vertexUv2s=l.has(2),Ne.vertexUv3s=l.has(3),l.clear(),Ne}function _(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(v(n,t),y(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function v(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function y(e,t){s.disableAll(),t.supportsVertexTextures&&s.enable(0),t.instancing&&s.enable(1),t.instancingColor&&s.enable(2),t.instancingMorph&&s.enable(3),t.matcap&&s.enable(4),t.envMap&&s.enable(5),t.normalMapObjectSpace&&s.enable(6),t.normalMapTangentSpace&&s.enable(7),t.clearcoat&&s.enable(8),t.iridescence&&s.enable(9),t.alphaTest&&s.enable(10),t.vertexColors&&s.enable(11),t.vertexAlphas&&s.enable(12),t.vertexUv1s&&s.enable(13),t.vertexUv2s&&s.enable(14),t.vertexUv3s&&s.enable(15),t.vertexTangents&&s.enable(16),t.anisotropy&&s.enable(17),t.alphaHash&&s.enable(18),t.batching&&s.enable(19),t.dispersion&&s.enable(20),t.batchingColor&&s.enable(21),e.push(s.mask),s.disableAll(),t.fog&&s.enable(0),t.useFog&&s.enable(1),t.flatShading&&s.enable(2),t.logarithmicDepthBuffer&&s.enable(3),t.reverseDepthBuffer&&s.enable(4),t.skinning&&s.enable(5),t.morphTargets&&s.enable(6),t.morphNormals&&s.enable(7),t.morphColors&&s.enable(8),t.premultipliedAlpha&&s.enable(9),t.shadowMapEnabled&&s.enable(10),t.doubleSided&&s.enable(11),t.flipSided&&s.enable(12),t.useDepthPacking&&s.enable(13),t.dithering&&s.enable(14),t.transmission&&s.enable(15),t.sheen&&s.enable(16),t.opaque&&s.enable(17),t.pointsUvs&&s.enable(18),t.decodeVideoTexture&&s.enable(19),t.decodeVideoTextureEmissive&&s.enable(20),t.alphaToCoverage&&s.enable(21),e.push(s.mask)}function b(e){let t=m[e.type],n;if(t){let e=FE[t];n=Fg.clone(e.uniforms)}else n=e.uniforms;return n}function x(t,n){let r;for(let e=0,t=u.length;e0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function c(e,t,a,s,c,l){let u=o(e,t,a,s,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function l(e,t){n.length>1&&n.sort(e||ck),r.length>1&&r.sort(t||lk),i.length>1&&i.sort(t||lk)}function u(){for(let n=t,r=e.length;n=r.length?(i=new uk,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function fk(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new U,color:new G};break;case`SpotLight`:n={position:new U,direction:new U,color:new G,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new U,color:new G,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new U,skyColor:new G,groundColor:new G};break;case`RectAreaLight`:n={color:new G,position:new U,halfWidth:new U,halfHeight:new U};break}return e[t.id]=n,n}}}function pk(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}let mk=0;function hk(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function gk(e){let t=new fk,n=pk(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new U);let i=new U,a=new W,o=new W;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(hk);for(let e=0,y=i.length;e0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=q.LTC_FLOAT_1,r.rectAreaLTC2=q.LTC_FLOAT_2):(r.rectAreaLTC1=q.LTC_HALF_1,r.rectAreaLTC2=q.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=mk++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t=i.length?(a=new _k(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}const yk=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,bk=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function xk(e,t,n){let r=new $_,i=new H,a=new H,o=new gm,s=new qb({depthPacking:_f}),c=new Jb,l={},u=n.maxTextureSize,d={[Rl]:zl,[zl]:Rl,[Bl]:Bl},f=new Rg({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new H},radius:{value:4}},vertexShader:yk,fragmentShader:bk}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new hg;m.setAttribute(`position`,new $h(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new Dg(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Fl;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(Vl),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==Ll&&this.type===Ll,m=_===Ll&&this.type!==Ll;for(let c=0,l=t.length;cu||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/h.x),i.x=a.x*h.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/h.y),i.y=a.y*h.y,d.mapSize.y=a.y)),d.map===null||p===!0||m===!0){let e=this.type===Ll?{}:{minFilter:Uu,magFilter:Uu};d.map!==null&&d.map.dispose(),d.map=new vm(i.x,i.y,e),d.map.texture.name=l.name+`.shadowMap`,d.camera.updateProjectionMatrix()}e.setRenderTarget(d.map),e.clear();let g=d.getViewportCount();for(let e=0;e0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===Ll?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function b(n,i,a,o,s){if(n.visible===!1)return;let c=n.layers.test(i.layers);if(c&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===Ll)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l=2):(N=parseFloat(/^WebGL (\d)/.exec(ee)[1]),M=N>=1);let te=null,P={},ne=e.getParameter(e.SCISSOR_BOX),re=e.getParameter(e.VIEWPORT),ie=new gm().fromArray(ne),ae=new gm().fromArray(re);function oe(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new H,u=new WeakMap,d,f=new WeakMap,p=!1;try{p=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function m(e,t){return p?new OffscreenCanvas(e,t):Yp(`canvas`)}function h(e,t,n){let r=1,i=be(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1)if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);d===void 0&&(d=m(n,a));let o=t?m(n,a):d;o.width=n,o.height=a;let s=o.getContext(`2d`);return s.drawImage(e,0,0,n,a),console.warn(`THREE.WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}else return`data`in e&&console.warn(`THREE.WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e;return e}function g(e){return e.generateMipmaps}function _(t){e.generateMipmap(t)}function v(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function y(n,r,i,a,o=!1){if(n!==null){if(e[n]!==void 0)return e[n];console.warn(`THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let s=r;if(r===e.RED&&(i===e.FLOAT&&(s=e.R32F),i===e.HALF_FLOAT&&(s=e.R16F),i===e.UNSIGNED_BYTE&&(s=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.R8UI),i===e.UNSIGNED_SHORT&&(s=e.R16UI),i===e.UNSIGNED_INT&&(s=e.R32UI),i===e.BYTE&&(s=e.R8I),i===e.SHORT&&(s=e.R16I),i===e.INT&&(s=e.R32I)),r===e.RG&&(i===e.FLOAT&&(s=e.RG32F),i===e.HALF_FLOAT&&(s=e.RG16F),i===e.UNSIGNED_BYTE&&(s=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RG8UI),i===e.UNSIGNED_SHORT&&(s=e.RG16UI),i===e.UNSIGNED_INT&&(s=e.RG32UI),i===e.BYTE&&(s=e.RG8I),i===e.SHORT&&(s=e.RG16I),i===e.INT&&(s=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGB8UI),i===e.UNSIGNED_SHORT&&(s=e.RGB16UI),i===e.UNSIGNED_INT&&(s=e.RGB32UI),i===e.BYTE&&(s=e.RGB8I),i===e.SHORT&&(s=e.RGB16I),i===e.INT&&(s=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(s=e.RGBA16UI),i===e.UNSIGNED_INT&&(s=e.RGBA32UI),i===e.BYTE&&(s=e.RGBA8I),i===e.SHORT&&(s=e.RGBA16I),i===e.INT&&(s=e.RGBA32I)),r===e.RGB&&i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),r===e.RGBA){let t=o?Tf:am.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=t===Ef?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return(s===e.R16F||s===e.R32F||s===e.RG16F||s===e.RG32F||s===e.RGBA16F||s===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),s}function b(t,n){let r;return t?n===null||n===id||n===ld?r=e.DEPTH24_STENCIL8:n===ad?r=e.DEPTH32F_STENCIL8:n===nd&&(r=e.DEPTH24_STENCIL8,console.warn(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===id||n===ld?r=e.DEPTH_COMPONENT24:n===ad?r=e.DEPTH_COMPONENT32F:n===nd&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return g(e)===!0||e.isFramebufferTexture&&e.minFilter!==Uu&&e.minFilter!==Ju?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){let t=e.target;t.removeEventListener(`dispose`,S),w(t),t.isVideoTexture&&u.delete(t)}function C(e){let t=e.target;t.removeEventListener(`dispose`,C),E(t)}function w(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=f.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&T(e),Object.keys(i).length===0&&f.delete(n)}r.remove(e)}function T(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=f.get(i);delete a[n.__cacheKey],o.memory.textures--}function E(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r=i.maxTextures&&console.warn(`THREE.WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),D+=1,e}function A(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function j(t,i){let a=r.get(t);if(t.isVideoTexture&&ve(t),t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)console.warn(`THREE.WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)console.warn(`THREE.WebGLRenderer: Texture marked for update but image is incomplete`);else{se(a,t,i);return}}n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function M(t,i){let a=r.get(t);if(t.version>0&&a.__version!==t.version){se(a,t,i);return}n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function N(t,i){let a=r.get(t);if(t.version>0&&a.__version!==t.version){se(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function ee(t,i){let a=r.get(t);if(t.version>0&&a.__version!==t.version){ce(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let te={[Bu]:e.REPEAT,[Vu]:e.CLAMP_TO_EDGE,[Hu]:e.MIRRORED_REPEAT},P={[Uu]:e.NEAREST,[Wu]:e.NEAREST_MIPMAP_NEAREST,[Ku]:e.NEAREST_MIPMAP_LINEAR,[Ju]:e.LINEAR,[Yu]:e.LINEAR_MIPMAP_NEAREST,[Zu]:e.LINEAR_MIPMAP_LINEAR},ne={[Uf]:e.NEVER,[Xf]:e.ALWAYS,[Wf]:e.LESS,[Kf]:e.LEQUAL,[Gf]:e.EQUAL,[Yf]:e.GEQUAL,[qf]:e.GREATER,[Jf]:e.NOTEQUAL};function re(n,a){if(a.type===ad&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===Ju||a.magFilter===Yu||a.magFilter===Ku||a.magFilter===Zu||a.minFilter===Ju||a.minFilter===Yu||a.minFilter===Ku||a.minFilter===Zu)&&console.warn(`THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,te[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,te[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,te[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,P[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,P[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,ne[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===Uu||a.minFilter!==Ku&&a.minFilter!==Zu||a.type===ad&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function ie(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,S));let i=n.source,a=f.get(i);a===void 0&&(a={},f.set(i,a));let s=A(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&T(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function ae(e,t,n){return Math.floor(Math.floor(e/n)/t)}function oe(t,r,i,a){let o=4,s=t.updateRanges;if(s.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{s.sort((e,t)=>e.start-t.start);let c=0;for(let e=1;e0){T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t0){let r=YC(C.width,C.height,o.format,o.type);for(let i of o.layerUpdates){let a=C.data.subarray(i*r/C.data.BYTES_PER_ELEMENT,(i+1)*r/C.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,C.width,C.height,1,m,a)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,C.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,C.data,0,0);else console.warn(`THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`);else T?D&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,v,C.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,m,v,C.data)}else{T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t0){let t=YC(p.width,p.height,o.format,o.type);for(let r of o.layerUpdates){let i=p.data.subarray(r*t/p.data.BYTES_PER_ELEMENT,(r+1)*t/p.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,p.width,p.height,1,m,v,i)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,S,p.width,p.height,p.depth,0,m,v,p.data);else if(o.isData3DTexture)T?(E&&n.texStorage3D(e.TEXTURE_3D,O,S,p.width,p.height,p.depth),D&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)):n.texImage3D(e.TEXTURE_3D,0,S,p.width,p.height,p.depth,0,m,v,p.data);else if(o.isFramebufferTexture){if(E)if(T)n.texStorage2D(e.TEXTURE_2D,O,S,p.width,p.height);else{let t=p.width,r=p.height;for(let i=0;i>=1,r>>=1}}else if(w.length>0){if(T&&E){let t=be(w[0]);n.texStorage2D(e.TEXTURE_2D,O,S,t.width,t.height)}for(let t=0,r=w.length;t0&&D++;let t=be(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,b,S,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,b,S,m[t].data);for(let r=0;r>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),L(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,_e(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function ue(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=b(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,l=_e(n),u=L(n);u?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,l,o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,l,o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw Error(`target.depthTexture not supported in Cube render targets`);let e=t.texture.mipmaps;e&&e.length>0?de(i.__webglFramebuffer[0],t):de(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),ue(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),ue(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function pe(t,n,i){let a=r.get(t);n!==void 0&&le(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&fe(t)}function F(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,C);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n0){s.__webglFramebuffer=[];for(let t=0;t0&&L(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0){if(L(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function ve(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function ye(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==wf&&n!==Sf&&(am.getTransfer(n)===Ef?(r!==pd||i!==$u)&&console.warn(`THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):console.error(`THREE.WebGLTextures: Unsupported texture color space:`,n)),t}function be(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=k,this.resetTextureUnits=O,this.setTexture2D=j,this.setTexture2DArray=M,this.setTexture3D=N,this.setTextureCube=ee,this.rebindTextures=pe,this.setupRenderTarget=F,this.updateRenderTargetMipmap=me,this.updateMultisampleRenderTarget=I,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=le,this.useMultisampledRTT=L}function Tk(e,t){function n(n,r=Sf){let i,a=am.getTransfer(r);if(n===$u)return e.UNSIGNED_BYTE;if(n===sd)return e.UNSIGNED_SHORT_4_4_4_4;if(n===cd)return e.UNSIGNED_SHORT_5_5_5_1;if(n===ud)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===ed)return e.BYTE;if(n===td)return e.SHORT;if(n===nd)return e.UNSIGNED_SHORT;if(n===rd)return e.INT;if(n===id)return e.UNSIGNED_INT;if(n===ad)return e.FLOAT;if(n===od)return e.HALF_FLOAT;if(n===dd)return e.ALPHA;if(n===fd)return e.RGB;if(n===pd)return e.RGBA;if(n===md)return e.DEPTH_COMPONENT;if(n===hd)return e.DEPTH_STENCIL;if(n===gd)return e.RED;if(n===_d)return e.RED_INTEGER;if(n===vd)return e.RG;if(n===yd)return e.RG_INTEGER;if(n===xd)return e.RGBA_INTEGER;if(n===Sd||n===Cd||n===wd||n===Td)if(a===Ef)if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===Sd)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Cd)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===wd)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Td)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===Sd)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Cd)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===wd)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Td)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Ed||n===Dd||n===Od||n===kd)if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===Ed)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Dd)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Od)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===kd)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Ad||n===jd||n===Md)if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===Ad||n===jd)return a===Ef?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===Md)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Nd||n===Pd||n===Fd||n===Id||n===Ld||n===Rd||n===zd||n===Bd||n===Vd||n===Hd||n===Ud||n===Wd||n===Gd||n===Kd)if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===Nd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Pd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Fd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Id)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Ld)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Rd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===zd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Bd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Vd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Hd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Ud)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Wd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Gd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Kd)return a===Ef?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===qd||n===Jd||n===Yd)if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===qd)return a===Ef?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Jd)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Yd)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Xd||n===Zd||n===Qd||n===$d)if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===qd)return i.COMPRESSED_RED_RGTC1_EXT;if(n===Zd)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Qd)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===$d)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===ld?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}const Ek=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,Dk=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;var Ok=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 hm,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 Rg({vertexShader:Ek,fragmentShader:Dk,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Dg(new Db(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},kk=class extends pp{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 Ok,h=t.getContextAttributes(),g=null,_=null,v=[],y=[],b=new H,x=null,S=new Ug;S.viewport=new gm;let C=new Ug;C.viewport=new gm;let w=[S,C],T=new gS,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 Zg,v[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=v[e];return t===void 0&&(t=new Zg,v[e]=t),t.getGripSpace()},this.getHand=function(e){let t=v[e];return t===void 0&&(t=new Zg,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 U,M=new U;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,Ak.copy(o),Ak.x*=-1,Ak.y*=-1,Ak.z*=-1,a.isCubeTexture&&a.isRenderTargetTexture===!1&&(Ak.y*=-1,Ak.z*=-1),e.envMapRotation.value.setFromMatrix4(jk.makeRotationFromEuler(Ak)),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===zl&&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 Nk(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 Pk=class{constructor(e={}){let{canvas:t=Xp(),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=wu,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let y=this,b=!1;this._outputColorSpace=Cf;let x=0,S=0,C=null,w=-1,T=null,E=new gm,D=new gm,O=null,k=new G(0),A=0,j=t.width,M=t.height,N=1,ee=null,te=null,P=new gm(0,0,j,M),ne=new gm(0,0,j,M),re=!1,ie=new $_,ae=!1,oe=!1,se=new W,ce=new W,le=new U,ue=new gm,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${Dl}`),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 pD(F),he.init(),Pe=new Tk(F,he),ge=new HE(F,he,e,Pe),I=new Ck(F,he),ge.reverseDepthBuffer&&d&&I.buffers.depth.setReversed(!0),_e=new gD(F),L=new sk,ve=new wk(F,he,I,L,ge,Pe,_e),ye=new WE(y),be=new fD(y),xe=new ew(F),Fe=new BE(F,xe),Se=new mD(F,xe,_e,Fe),Ce=new vD(F,Se,xe,_e),je=new _D(F,ge,ve),Oe=new UE(L),we=new ok(y,ye,be,he,ge,Fe,Oe),Te=new Mk(y,L),Ee=new dk,De=new vk(he),Ae=new zE(y,ye,be,I,Ce,f,s),ke=new xk(y,Ce,ge),Ie=new Nk(F,_e,ge,I),Me=new VE(F,he,_e),Ne=new hD(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 kk(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===xd||t===yd||t===_d}if(e){let e=C.texture.type,t=e===$u||e===id||e===nd||e===ld||e===sd||e===cd,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)Qp(`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 $C;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 vm(1,1,{generateMipmaps:!0,type:he.has(`EXT_color_buffer_half_float`)||he.has(`EXT_color_buffer_float`)?od:$u,minFilter:Zu,samples:4,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:am.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=wu;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=wu;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),em(se),tm(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]),TO.upload(F,rt(v),A,ve)),r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(TO.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 $p(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:(Qp(`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 Fk(r),{off:r}},i=(...t)=>Promise.all(Array.from(e).map(e=>e(...t)));return{on:r,off:t,trigger:i,clear:n}}const Lk=new WeakMap,Rk=(...e)=>{var t;let n=e[0],r=(t=jo())?.proxy;if(r==null&&!$i())throw Error(`injectLocal must be called in setup`);return r&&Lk.has(r)&&n in Lk.get(r)?Lk.get(r)[n]:Qi(...e)},zk=typeof window<`u`&&typeof document<`u`,Bk=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,Vk=e=>e!==void 0,Hk=e=>e!=null,Uk=Object.prototype.toString,Wk=e=>Uk.call(e)===`[object Object]`,Gk=()=>{};function Kk(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 qk(e,t={}){let n,r,i=Gk,a=e=>{clearTimeout(e),i(),i=Gk},o,s=s=>{let c=vn(e),l=vn(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 Jk(e){let t=Object.create(null);return n=>{let r=t[n];return r||(t[n]=e(n))}}const Yk=/\B([A-Z])/g,Xk=Jk(e=>e.replace(Yk,`-$1`).toLowerCase()),Zk=/-(\w)/g,Qk=Jk(e=>e.replace(Zk,(e,t)=>t?t.toUpperCase():``));function $k(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function eA(e,t,n=!1){return t.reduce((t,r)=>(r in e&&(!n||e[r]!==void 0)&&(t[r]=e[r]),t),{})}function tA(e){return e||jo()}function nA(e){return Array.isArray(e)?e:[e]}function rA(e,t=200,n={}){return Kk(qk(t,n),e)}function iA(e,t=200,n={}){let r=R(e.value),i=rA(()=>{r.value=e.value},t,n);return B(e,()=>i()),r}function aA(e,t={}){if(!pn(e))return Cn(e);let n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let r in e.value)n[r]=Sn(()=>({get(){return e.value[r]},set(n){var i;let a=(i=vn(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 oA=vn;function sA(e,t=!0,n){let r=tA();r?ei(e,n):t?e():qn(e)}function cA(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=vn(t);n<=0||(o.value=!0,i&&e(),s(),o.value&&(a=setInterval(e,n)))}if(r&&zk&&l(),pn(t)||typeof t==`function`){let e=B(t,()=>{o.value&&zk&&l()});Fk(e)}return Fk(c),{isActive:o,pause:c,resume:l}}function lA(e,t,n){return B(e,t,{...n,immediate:!0})}const uA=zk?window:void 0,dA=zk?window.document:void 0,fA=zk?window.navigator:void 0,pA=zk?window.location:void 0;function mA(e){var t;let n=vn(e);return(t=n?.$el)??n}function hA(...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=V(()=>{let t=nA(vn(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=lA(()=>{var t,n;return[(n=(t=i.value)?.map(e=>mA(e)))??[uA].filter(e=>e!=null),nA(vn(i.value?e[1]:e[0])),nA(_n(i.value?e[2]:e[1])),vn(i.value?e[3]:e[2])]},([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=Wk(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 Fk(n),o}function gA(){let e=z(!1),t=jo();return t&&ei(()=>{e.value=!0},t),e}function _A(e){let t=gA();return V(()=>(t.value,!!e()))}function vA(e,t,n={}){let{window:r=uA,...i}=n,a,o=_A(()=>r&&`MutationObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=V(()=>{let t=vn(e),n=nA(t).map(mA).filter(Hk);return new Set(n)}),l=B(()=>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 Fk(d),{isSupported:o,stop:d,takeRecords:u}}function yA(e,t={}){let{immediate:n=!0,fpsLimit:r=void 0,window:i=uA,once:a=!1}=t,o=z(!1),s=V(()=>r?1e3/vn(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 ja(()=>{if(a.value){a.value=!i.value;let t=vn(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>=$k(n[1])),i&&a&&(a=r<=$k(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(vn(e)),s.value=o.value.matches)}),hA(o,`change`,c,{passive:!0}),V(()=>s.value)}function CA(e){return JSON.parse(JSON.stringify(e))}function wA(e={}){let{window:t=uA}=e,n=z(1),r=SA(()=>`(resolution: ${n.value}dppx)`,e),i=Gk;return t&&(i=lA(r,()=>n.value=t.devicePixelRatio)),{pixelRatio:tn(n),stop:i}}function TA(e,t,n={}){let{window:r=uA,...i}=n,a,o=_A(()=>r&&`ResizeObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=V(()=>{let t=vn(e);return Array.isArray(t)?t.map(e=>mA(e)):[mA(t)]}),l=B(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 Fk(u),{isSupported:o,stop:u}}function EA(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=mA(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 TA(e,g),B(()=>mA(e),e=>!e&&g()),vA(e,g,{attributeFilter:[`style`,`class`]}),i&&hA(`scroll`,g,{capture:!0,passive:!0}),r&&hA(`resize`,g,{passive:!0}),sA(()=>{a&&g()}),{height:s,bottom:c,left:l,right:u,top:d,width:f,x:p,y:m,update:g}}function DA(e,t={width:0,height:0},n={}){let{window:r=uA,box:i=`content-box`}=n,a=V(()=>{var t,n;return(n=(t=mA(e))?.namespaceURI)?.includes(`svg`)}),o=z(t.width),s=z(t.height),{stop:c}=TA(e,([t])=>{let n=i===`border-box`?t.borderBoxSize:i===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(r&&a.value){let t=mA(e);if(t){let e=t.getBoundingClientRect();o.value=e.width,s.value=e.height}}else if(n){let e=nA(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);sA(()=>{let n=mA(e);n&&(o.value=`offsetWidth`in n?n.offsetWidth:t.width,s.value=`offsetHeight`in n?n.offsetHeight:t.height)});let l=B(()=>mA(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 OA(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 yA(()=>{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 kA(e={}){let t=R(),n=_A(()=>typeof performance<`u`&&`memory`in performance);if(n.value){let{interval:n=1e3}=e;cA(()=>{t.value=performance.memory},n,{immediate:e.immediate,immediateCallback:e.immediateCallback})}return{isSupported:n,memory:t}}const AA={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},jA=Object.keys(AA);function MA(e={}){let{target:t=uA}=e,n=z(!1),r=R(e.initialValue||{});Object.assign(r.value,AA,r.value);let i=t=>{n.value=!0,!(e.pointerTypes&&!e.pointerTypes.includes(t.pointerType))&&(r.value=eA(t,jA,!1))};if(t){let e={passive:!0};hA(t,[`pointerdown`,`pointermove`,`pointerup`],i,e),hA(t,`pointerleave`,()=>n.value=!1,e)}return{...aA(r),isInside:n}}const NA=[{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 PA(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=jo(),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):CA(e):e,_=()=>Vk(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 B(()=>e[t],e=>{i||(i=!0,r.value=g(e),qn(()=>i=!1))}),B(r,n=>{!i&&(n!==e[t]||u)&&v(n)},{deep:u}),r}else return V({get(){return _()},set(e){v(e)}})}function FA(e={}){let{window:t=uA,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(),sA(l);let u={passive:!0};if(hA(`resize`,l,u),t&&o===`visual`&&t.visualViewport&&hA(t.visualViewport,`resize`,l,u),i){let e=SA(`(orientation: portrait)`);B(e,()=>l())}return{width:s,height:c}}var IA=Object.defineProperty,LA=(e,t,n)=>t in e?IA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RA=(e,t,n)=>LA(e,typeof t==`symbol`?t:t+``,n);const zA=`@tresjs/core`,BA=`module`,VA=`4.3.6`,HA=`pnpm@10.6.3`,UA=`Declarative ThreeJS using Vue Components`,WA=`Alvaro Saburido (https://github.com/alvarosabu/)`,GA=`MIT`,KA={type:`git`,url:`git+https://github.com/Tresjs/tres.git`},qA=[`vue`,`3d`,`threejs`,`three`,`threejs-vue`],JA=!1,YA={".":{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`},"./*":`./*`},XA=`./dist/tres.js`,ZA=`./dist/tres.js`,QA=`./dist/index.d.ts`,$A=[`*.d.ts`,`dist`],ej={access:`public`},tj={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`},nj={three:`>=0.133`,vue:`>=3.4`},rj={"@alvarosabu/utils":`^3.2.0`,"@vue/devtools-api":`^6.6.3`,"@vueuse/core":`^12.5.0`},ij={"@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`},aj={name:zA,type:BA,version:VA,packageManager:HA,description:UA,author:WA,license:GA,repository:KA,keywords:qA,sideEffects:JA,exports:YA,main:XA,module:ZA,types:QA,files:$A,publishConfig:ej,scripts:tj,peerDependencies:nj,dependencies:rj,devDependencies:ij};function oj(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 sj(e,t,n,r,i){let{logError:a}=gM(),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,oj(n.scene)),e(n)},r,e=>{a(`[useLoader] - Failed to load resource`,e),n(e)})})}var cj=class extends Dg{constructor(...e){super(...e),RA(this,`type`,`HightlightMesh`),RA(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 lj(e){return typeof e>`u`}function uj(e){return Array.isArray(e)}function dj(e){return typeof e==`number`}function fj(e){return typeof e==`string`}function pj(e){return typeof e==`function`}function mj(e){return e===Object(e)&&!uj(e)&&!pj(e)}function hj(e){return mj(e)&&!!e.isObject3D}function gj(e){return mj(e)&&!!e.isColor}function _j(e){return e!=null&&(typeof e==`string`||typeof e==`number`||gj(e))}function vj(e){return typeof e==`object`&&!!e&&`set`in e&&typeof e.set==`function`}function yj(e){return vj(e)&&`copy`in e&&typeof e.copy==`function`}function bj(e){return!!(e!=null&&e.constructor)}function xj(e){return e instanceof oh}function Sj(e){return mj(e)&&!!e.isCamera}function Cj(e){return mj(e)&&!!e.isBufferGeometry}function wj(e){return mj(e)&&!!e.isMaterial}function Tj(e){return mj(e)&&!!e.isLight}function Ej(e){return mj(e)&&!!e.isFog}function Dj(e){return mj(e)&&!!e.isScene}function Oj(e){return hj(e)||Cj(e)||wj(e)||Ej(e)}function kj(e){return mj(e)&&!!e.isPrimitive}const Aj=(e,t)=>{for(let n of Object.keys(t))t[n]instanceof Object&&Object.assign(t[n],Aj(e[n],t[n]));return Object.assign(e||{},t),e},jj=`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`,Mj=Lj(jj);function Nj(e){return e&&e.nodeType===1}function Pj(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const Fj=/\B([A-Z])/g;function Ij(e){return e.replace(Fj,`-$1`).toLowerCase()}function Lj(e,t){let n=Object.create(null),r=e.split(`,`);for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}const Rj=(e,t)=>{if(!t)return;let n=Array.isArray(t)?t:t.match(/([^[.\]])+/g);return n?.reduce((e,t)=>e&&e[t],e)},zj=(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 Bj(e,t){if(Nj(e)&&Nj(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)||!Bj(e[i],t[i]))return!1;return!0}function Vj(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;eqj(e)),!(e instanceof e_)){let t=e;e&&((n=e.dispose)==null||n.call(e)),t.geometry&&t.geometry.dispose(),Array.isArray(t.material)?t.material.forEach(e=>Kj(e)):t.material&&Kj(t.material)}}function Jj(e,t){let n=0;for(let r=0;rt===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(``)}const Zj=/-\d+$/;function Qj(e,t,n){if(fj(n)){if(Zj.test(n)){let t=n.replace(Zj,``),{target:r,key:i}=Yj(e,t);if(!Array.isArray(r[i])){let e=r[i],t=[];t.__tresDetach=()=>{t.every(e=>lj(e))&&(r[i]=e)},r[i]=t}}let{target:r,key:i}=Yj(e,n);t.__tres.previousAttach=r[i],r[i]=iM(t)}else t.__tres.previousAttach=n(e,t)}function $j(e,t,n){var r,i,a;if(fj(n)){let{target:r,key:i}=Yj(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 eM(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 tM(e){var t;let n=(t=e?.__tres)?.root;n&&n.render&&n.render.canBeInvalidated.value&&n.invalidate()}function nM(e,t,n){var r;if(!pj(e.setPixelRatio))return;let i=0;if(n&&uj(n)&&n.length>=2){let[e,r]=n;i=Bp.clamp(t,e,r)}else i=dj(n)?n:t;i!==(r=e.getPixelRatio)?.call(e)&&e.setPixelRatio(i)}function rM(e,t,n,r,i){let a=[...t.__tres.objects],o=iM(t);if(e=iM(e),o===e)return!0;let s=eM(e,t.__tres??{},i),c=t.parent??t.__tres.parent??null,l={...t.__tres.memoizedProps};delete l.object;for(let e of a)aM(e,i),oM(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 iM(e){return kj(e)?(e.object.__tres=e.__tres,e.object):e}function aM(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&&Jj(o.__tres.objects,t=>t!==e),(r=e.__tres)!=null&&r.attach?$j(o,e,e.__tres.attach):((a=(i=e.parent)?.remove)==null||a.call(i,iM(e)),e.parent=null)}function oM(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),tM(e)}async function sM(e,t){let n=new Mx(t),r=e=>new Promise((t,r)=>{n.load(e,e=>t(e),()=>null,()=>{r(Error(`[useTextures] - Failed to load texture`))})});if(Hj(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 cM=zr({__name:`component`,props:{map:{},displacementMap:{},normalMap:{},roughnessMap:{},metalnessMap:{},aoMap:{},alphaMap:{},matcap:{}},async setup(e){let t,n,r=e,i=([t,n]=ji(()=>$t(sM(r))),t=await t,n(),t);return(e,t)=>vi(e.$slots,`default`,{textures:_n(i)})}}),lM=({sizes:e})=>{let t=R([]),n=V(()=>t.value[0]),r=e=>{let n=e instanceof zg?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(Sj(e)){let i=e;if(t.value.some(({uuid:e})=>e===i.uuid))return;n?r(i):t.value.push(i)}},a=e=>{if(Sj(e)){let n=e;t.value=t.value.filter(({uuid:e})=>e!==n.uuid)}};return ja(()=>{e.aspectRatio.value&&t.value.forEach(t=>{!t.manual&&(t instanceof Ug||uM(t))&&(t instanceof Ug?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())})}),ii(()=>{t.value=[]}),{camera:n,cameras:t,registerCamera:i,deregisterCamera:a,setCameraActive:r}};function uM(e){return e.hasOwnProperty(`isOrthographicCamera`)&&e.isOrthographicCamera}const dM=!0,fM=`[TresJS ▲ ■ ●] `;function pM(...e){typeof e[0]==`string`?e[0]=fM+e[0]:e.unshift(fM),console.error(...e)}function mM(...e){typeof e[0]==`string`?e[0]=fM+e[0]:e.unshift(fM),console.warn(...e)}function hM(e,t){}function gM(){return{logError:pM,logWarning:mM,logMessage:hM}}const _M=R({}),vM=e=>Object.assign(_M.value,e);function yM(){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 Fk(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 bM(){let e=!0,t=!0,n=!1,r=new _S(!1),i=R(r.running),a=R(!1),o,s=Bp.generateUUID(),c=null,l=yM(),u=yM(),d=yM();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 xM(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 SM(e){return(e/1024).toFixed(2)}const CM=Number.parseInt(Dl.replace(`dev`,``));function wM(e){return e instanceof G?e:Array.isArray(e)?new G(...e):new G(e)}const TM={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:Cf,toneMapping:Ou,toneMappingExposure:3,shadowMap:{enabled:!0,type:Il}},flat:{toneMapping:wu,toneMappingExposure:1}};function EM({canvas:e,options:t,contextParts:{sizes:n,render:r,invalidate:i,advance:a}}){let o=V(()=>({alpha:oA(t.alpha)??!0,depth:oA(t.depth),canvas:mA(e),context:oA(t.context),stencil:oA(t.stencil),antialias:oA(t.antialias)??!0,precision:oA(t.precision),powerPreference:oA(t.powerPreference),premultipliedAlpha:oA(t.premultipliedAlpha),preserveDrawingBuffer:oA(t.preserveDrawingBuffer),logarithmicDepthBuffer:oA(t.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:oA(t.failIfMajorPerformanceCaveat)})),s=z(new Pk(o.value));function c(){t.renderMode===`on-demand`&&i()}B(o,()=>{s.value.dispose(),s.value=new Pk(o.value),c()}),B([n.width,n.height],()=>{s.value.setSize(n.width.value,n.height.value),c()},{immediate:!0}),B(()=>t.clearColor,c);let{pixelRatio:l}=wA(),{logError:u}=gM(),d=(()=>{let e=new Pk,t={shadowMap:{enabled:e.shadowMap.enabled,type:e.shadowMap.type},toneMapping:e.toneMapping,toneMappingExposure:e.toneMappingExposure,outputColorSpace:e.outputColorSpace};return e.dispose(),t})(),f=oA(t.renderMode);return f===`on-demand`&&i(),f===`manual`&&setTimeout(()=>{a()},100),ja(()=>{let e=oA(t.preset);e&&(e in TM||u(`Renderer Preset must be one of these: ${Object.keys(TM).join(`, `)}`),Aj(s.value,TM[e])),nM(s.value,l.value,oA(t.dpr)),f===`always`&&(r.frames.value=Math.max(1,r.frames.value));let n=(t,n)=>{let r=oA(t),i=()=>{if(e)return Rj(TM[e],n)};if(r!==void 0)return r;let a=i();return a===void 0?Rj(d,n):a},i=(e,t)=>zj(s.value,t,n(e,t));i(t.shadows,`shadowMap.enabled`),i(t.toneMapping??Ou,`toneMapping`),i(t.shadowMapType,`shadowMap.type`),CM<150&&i(!t.useLegacyLights,`physicallyCorrectLights`),i(t.outputColorSpace,`outputColorSpace`),i(t.toneMappingExposure,`toneMappingExposure`);let a=n(t.clearColor,`clearColor`);a&&s.value.setClearColor(a?wM(a):new G(0))}),ii(()=>{s.value.dispose(),s.value.forceContextLoss()}),{renderer:s}}function DM(e,t,n=10){let r=oA(e)?FA():DA(V(()=>oA(t).parentElement)),i=tn(iA(r.width,n)),a=tn(iA(r.height,n)),o=V(()=>i.value/a.value);return{height:a,width:i,aspectRatio:o}}const OM=(e,t)=>{let n=V(()=>t.renderer.value.domElement),r=z([]),{x:i,y:a}=MA({target:n}),o=0,{width:s,height:c,top:l,left:u}=EA(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 H(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=Ik(),h=Ik(),g=Ik(),_=Ik(),v=Ik(),y=Ik(),b=Ik(),x=Ik();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 U(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 H(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 H(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),ii(()=>{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 kM(e,t){if(Array.isArray(e))for(let n of e)n(t);typeof e==`function`&&e(t)}function AM(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,kM(a[e],t),r.push(a);let o=a.parent;for(;o!==null&&!t.stopPropagating&&!r.includes(o);)t.eventObject=o,kM(o[e],t),r.push(o),o=o.parent;let s=Ij(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}=OM(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,kM(t.onPointerMissed,e))}),n(`pointer-missed`,{event:e})});function x(e){Oj(e)&&hj(e)&&c.value.push(e)}function S(e){if(Oj(e)&&hj(e)){let t=c.value.indexOf(e);t>-1&&c.value.splice(t,1)}}function C(e){Oj(e)&&hj(e)&&e.onPointerMissed&&b.push(e)}function w(e){if(Oj(e)&&hj(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 jM(e,t,n=100){n=n<=0?100:n;let r=Ik(),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 MM=new WeakMap;function NM(e){if(e||=FM(),MM.has(e))return MM.get(e);let t=100,n=Date.now(),r=jM(()=>{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 MM.set(e,r),r}function PM({scene:e,canvas:t,windowSize:n,rendererOptions:r,emit:i}){let a=z(e),o=DM(n,t),{camera:s,cameras:c,registerCamera:l,deregisterCamera:u,setCameraActive:d}=lM({sizes:o}),f={mode:R(r.renderMode||`always`),priority:R(0),frames:R(0),maxFrames:60,canBeInvalidated:V(()=>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}=EM({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 nC),controls:R(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:f,advance:m,extend:vM,invalidate:p,registerCamera:l,setCameraActive:d,deregisterCamera:u,loop:bM()};Zi(`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}=NM(g);g.loop.setReady(!1),g.loop.start(),_(()=>{i(`ready`,g),g.loop.setReady(!0),AM(e,g,i)}),ii(()=>{v(),g.loop.stop()});let y=100,b=OA({every:y}),{isSupported:x,memory:S}=kA({interval:y}),C=160,w=performance.now(),T=({timestamp:e})=>{g.scene.value&&(g.perf.memory.allocatedMem=xM(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}=yA(({delta:e})=>{window.__TRES__DEVTOOLS__&&(T({timestamp:performance.now()}),E+=e,E>=D&&(window.__TRES__DEVTOOLS__.cb(g),E=0))},{immediate:!0});return ii(()=>{O()}),g}function FM(){let e=Qi(`useTres`);if(!e)throw Error(`useTresContext must be used together with useTresContextProvider`);return e}const IM=FM;function LM(){let{camera:e,scene:t,renderer:n,loop:r,raycaster:i,controls:a,invalidate:o,advance:s}=FM();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 RM=Ik(),zM=Ik(),BM=Ik(),VM=new _S;let HM=0,UM=0;const{pause:WM,resume:GM,isActive:KM}=yA(()=>{RM.trigger({delta:HM,elapsed:UM,clock:VM}),zM.trigger({delta:HM,elapsed:UM,clock:VM}),BM.trigger({delta:HM,elapsed:UM,clock:VM})},{immediate:!1});BM.on(()=>{HM=VM.getDelta(),UM=VM.getElapsedTime()});function qM(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:JM}=gM(),YM=[`onClick`,`onContextMenu`,`onPointerMove`,`onPointerEnter`,`onPointerLeave`,`onPointerOver`,`onPointerOut`,`onDoubleClick`,`onPointerDown`,`onPointerUp`,`onPointerCancel`,`onPointerMissed`,`onLostPointerCapture`,`onWheel`],XM=e=>{let t=e.scene.value;function n(t,n,o,s){if(s||={},s.args||=[],t===`template`||Mj(t))return null;let c=t.replace(`Tres`,``),l;if(t===`primitive`){(!mj(s.object)||pn(s.object))&&JM(`Tres primitives need an 'object' prop, whose value is an object or shallowRef`),c=s.object.type;let t={};l=qM(s.object,{object:e=>e,isPrimitive:()=>!0,__tres:()=>t},{object:(t,n,o,s)=>{rM(t,o,s,{patchProp:a,remove:i,insert:r},e)},__tres:e=>{Object.assign(t,e)}})}else{let e=_M.value[c];e||JM(`${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=eM(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:eM(n,{},e),c=r.__tres?r:eM(r,{},e);n=iM(s),r=iM(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?Qj(c,s,s.__tres.attach):hj(n)&&hj(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=lj(n)?`default`:n;let c=(o=t.__tres)?.dispose;lj(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)),aM(t,e),oM(t,e),u&&!Dj(t)){if(pj(n))n(t);else if(pj(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),eM(t,{attach:o},e),n&&r(t,n);return}if(n===`dispose`){t.__tres||(t=eM(t,{},e)),t.__tres.dispose=o;return}if(hj(t)&&u===`blocks-pointer-events`){o||o===``?t[u]=o:delete t[u];return}YM.includes(n)&&t.__tres&&(t.__tres.eventCount+=1);let d=Pj(u),f=l?.[d];if(u===`args`){let e=t,n=a??[],r=o??[],i=(c=t.__tres)?.type||t.type;i&&n.length&&!Vj(n,r)&&(l=Object.assign(e,new _M.value[i](...o)));return}if(l.type===`BufferGeometry`){if(u===`args`)return;l.setAttribute(Pj(u),new $h(...o));return}if(u.includes(`-`)&&f===void 0){f=l;for(let e of u.split(`-`))d=u=Pj(e),l=f,f=f?.[u]}let p=o;if(p===``&&(p=!0),pj(f)){YM.includes(n)||(uj(p)?t[d](...p):t[d](p)),d.startsWith(`on`)&&pj(p)&&(l[d]=p);return}xj(f)&&xj(p)?f.mask=p.mask:gj(f)&&_j(p)?f.set(p):yj(f)&&bj(p)&&f.constructor===p.constructor?f.copy(p):vj(f)&&Array.isArray(p)?`fromArray`in f&&typeof f.fromArray==`function`?f.fromArray(p):f.set(...p):vj(f)&&typeof p==`number`?`setScalar`in f&&typeof f.setScalar==`function`?f.setScalar(p):f.set(p):l[d]=p,tM(t)}function o(e){var t;return(t=e?.__tres)?.parent||null}function s(t){let n=eM(new Sh,{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 ZM(){return QM().__VUE_DEVTOOLS_GLOBAL_HOOK__}function QM(){return typeof navigator<`u`&&typeof window<`u`?window:typeof globalThis<`u`?globalThis:{}}const $M=typeof Proxy==`function`,eN=`devtools-plugin:setup`,tN=`plugin:settings:set`;let nN,rN;function iN(){var e;return nN!==void 0||(typeof window<`u`&&window.performance?(nN=!0,rN=window.performance):typeof globalThis<`u`&&(e=globalThis.perf_hooks)!=null&&e.performance?(nN=!0,rN=globalThis.perf_hooks.performance):nN=!1),nN}function aN(){return iN()?rN.now():Date.now()}var oN=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 aN()}},t&&t.on(tN,(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 sN(e,t){let n=e,r=QM(),i=ZM(),a=$M&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))i.emit(eN,e,t);else{let e=a?new oN(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:e}),e&&t(e.proxiedTarget)}}function cN(e,t){let n=`▲ ■ ●${e}`;typeof lN==`function`?lN(n,t):console.log(n)}function lN(e,t){throw Error(e+t)}const uN=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=xM(e);return n>0&&t.tags.push({label:`${SM(n)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:`Memory usage`}),e.type.includes(`Light`)&&(Tj(e)&&t.tags.push({label:`${e.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:`Intensity`}),t.tags.push({label:`#${new G(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 dN(e,t,n=``){e.children.forEach(e=>{if(e.type===`HightlightMesh`||n&&!e.type.includes(n)&&!e.name.includes(n))return;let r=uN(e);t.children.push(r),dN(e,r,n)})}const fN=[],pN=`tres:inspector`,mN=$t({sceneGraph:null});function hN(e,t){sN({id:`dev.esm.tres`,label:`TresJS 🪐`,logo:`https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg`,packageName:`tresjs`,homepage:`https://tresjs.org`,componentStateTypes:fN,app:e},e=>{typeof e.now!=`function`&&cN(`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:pN,label:`TresJS 🪐`,icon:`account_tree`,treeFilterPlaceholder:`Search instances`}),setInterval(()=>{e.sendInspectorTree(pN)},1e3),setInterval(()=>{e.notifyComponentUpdate()},5e3),e.on.getInspectorTree(e=>{if(e.inspectorId===pN){let n=uN(t.scene.value);dN(t.scene.value,n,e.filter),mN.sceneGraph=n,e.rootNodes=[n]}});let n=null,r=null;e.on.getInspectorState(e=>{var i;if(e.inspectorId===pN){let[a]=t.scene.value.getObjectsByProperty(`uuid`,e.nodeId);if(!a)return;if(r&&n&&n.parent&&r.remove(n),a.isMesh){let e=Wj(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:xM(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===pN&&Uj(t.scene.value,e.nodeId,e.path,e.state.value)})})}const gN=[`data-scene`,`data-tres`],_N=zr({__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=Ti(),o=R(),s=z(new e_),c=jo();vM(QC);let l=(e,t=!1)=>zr({setup(){var n;let i=(n=jo())?.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=>{Zi(e,o[e])})),Zi(`useTres`,e),Zi(`extend`,vM),typeof window<`u`&&hN(i?.app,e),()=>Yo(Xa,null,t?[]:a.default())}}),u=(e,t=!1)=>{let n=l(e,t),{render:r}=ba(XM(e));r(Yo(n),s.value)},d=(e,t=!1)=>{qj(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 ei(()=>{let e=o;f.value=PM({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 Ug(45,window.innerWidth/window.innerHeight,.1,1e3);e.position.set(3,3,3),e.lookAt(0,0,0),t(e);let n=ja(()=>{a.value.length>=2&&(e.removeFromParent(),c(e),n?.())})};B(()=>r.camera,(e,n)=>{e&&t(e),n&&(n.removeFromParent(),c(n))},{immediate:!0}),n.value||l()}),ii(p),(e,t)=>(no(),so(`canvas`,{ref_key:`canvas`,ref:o,"data-scene":s.value.uuid,class:Se(e.$attrs.class),"data-tres":`tresjs ${_n(aj).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,gN))}}),vN=[`TresCanvas`,`TresLeches`,`TresScene`],yN={template:{compilerOptions:{isCustomElement:e=>e.startsWith(`Tres`)&&!vN.includes(e)||e===`primitive`}}},{logWarning:bN}=gM();var xN=class extends Av{constructor(e,t){let n=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new hg;r.setAttribute(`position`,new K(n,3)),r.computeBoundingSphere();let i=new Sv({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 hg;o.setAttribute(`position`,new K(a,3)),o.computeBoundingSphere(),this.add(new Dg(o,new Wh({side:zl,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:SN}=gM();let CN,wN;const TN={DirectionalLight:AC,PointLight:bC,SpotLight:mC,HemisphereLight:wC,RectAreaLight:xN},EN={mounted:e=>{if(!e.isLight){SN(`${e.type} is not a light`);return}CN=TN[e.type],e.parent.add(new CN(e,1,e.color.getHex()))},updated:e=>{wN=e.parent.children.find(e=>e instanceof CN),!(wN instanceof xN)&&wN.update()},unmounted:e=>{if(!e.isLight){SN(`${e.type} is not a light`);return}wN=e.parent.children.find(e=>e instanceof CN),wN&&wN.dispose&&wN.dispose(),e.parent&&e.parent.remove(wN)}},DN={mounted:(e,t)=>{if(t.arg){console.log(`v-log:${t.arg}`,e[t.arg]);return}console.log(`v-log`,e)}},ON={install(e){e.component(`TresCanvas`,_N)}};function kN(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 AN(e,t,n=`.`,r){if(!kN(t))return AN(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]]:kN(a)&&kN(i[t])?i[t]=AN(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a}return i}function jN(e){return(...t)=>t.reduce((t,n)=>AN(t,n,``,e),{})}const MN=jN(),NN=jN((e,t,n)=>{if(e[t]!==void 0&&typeof n==`function`)return e[t]=n(e[t]),!0}),PN=jN((e,t,n)=>{if(Array.isArray(e[t])&&typeof n==`function`)return e[t]=n(e[t]),!0});function FN(e){return ze()?(Be(e),!0):!1}function IN(){let e=new Set,t=t=>{e.delete(t)},n=()=>{e.clear()},r=n=>{e.add(n);let r=()=>t(n);return FN(r),{off:r}},i=(...t)=>Promise.all(Array.from(e).map(e=>e(...t)));return{on:r,off:t,trigger:i,clear:n}}const LN=new WeakMap,RN=(...e)=>{var t;let n=e[0],r=(t=jo())?.proxy;if(r==null&&!$i())throw Error(`injectLocal must be called in setup`);return r&&LN.has(r)&&n in LN.get(r)?LN.get(r)[n]:Qi(...e)},zN=typeof window<`u`&&typeof document<`u`,BN=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,VN=e=>e!=null,HN=Object.prototype.toString,UN=e=>HN.call(e)===`[object Object]`,WN=()=>{},GN=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function KN(...e){if(e.length!==1)return En(...e);let t=e[0];return typeof t==`function`?tn(Sn(()=>({get:t,set:WN}))):R(t)}function qN(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 JN=e=>e();function YN(e,t={}){let n,r,i=WN,a=e=>{clearTimeout(e),i(),i=WN},o,s=s=>{let c=vn(e),l=vn(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 XN(...e){let t=0,n,r=!0,i=WN,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=WN)},d=e=>{let d=vn(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 ZN(e=JN,t={}){let{initialState:n=`active`}=t,r=KN(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 QN(e){let t;function n(){return t||=e(),t}return n.reset=async()=>{let e=t;t=void 0,e&&await e},n}function $N(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 eP(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function tP(e){return Array.isArray(e)?e:[e]}function nP(e){let t=Object.create(null);return n=>{let r=t[n];return r||(t[n]=e(n))}}const rP=/\B([A-Z])/g,iP=nP(e=>e.replace(rP,`-$1`).toLowerCase()),aP=/-(\w)/g,oP=nP(e=>e.replace(aP,(e,t)=>t?t.toUpperCase():``));function sP(e){return e||jo()}function cP(e,t=200,n={}){return qN(YN(t,n),e)}function lP(e,t=200,n={}){let r=R(vn(e)),i=cP(()=>{r.value=e.value},t,n);return B(e,()=>i()),nn(r)}function uP(e,t=200,n=!1,r=!0,i=!1){return qN(XN(t,n,r,i),e)}function dP(e,t,n={}){let{eventFilter:r=JN,...i}=n;return B(e,qN(r,t),i)}function fP(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=ZN(r,{initialState:i}),u=dP(e,t,{...a,eventFilter:o});return{stop:u,pause:s,resume:c,isActive:l}}function pP(e,t=!0,n){let r=sP(n);r?ei(e,n):t?e():qn(e)}function mP(e,t){let n=sP(t);n&&ii(e,t)}function hP(e,t,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=z(!1),o=null;function s(){o&&(clearTimeout(o),o=null)}function c(){a.value=!1,s()}function l(...n){i&&e(),s(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=null,e(...n)},vn(t))}return r&&(a.value=!0,zN&&l()),FN(c),{isPending:nn(a),start:l,stop:c}}function gP(e,t,n={}){let{debounce:r=0,maxWait:i=void 0,...a}=n;return dP(e,t,{...a,eventFilter:YN(r,{maxWait:i})})}function _P(e,t,n){return B(e,t,{...n,immediate:!0})}function vP(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=WN}=r,l=z(!i),u=s?z(t):R(t),d=0;return ja(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?V(()=>(l.value=!0,u.value)):u}const yP=zN?window:void 0,bP=zN?window.document:void 0,xP=zN?window.navigator:void 0,SP=zN?window.location:void 0;function CP(e){var t;let n=vn(e);return(t=n?.$el)??n}function wP(...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=V(()=>{let t=tP(vn(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=_P(()=>{var t,n;return[(n=(t=i.value)?.map(e=>CP(e)))??[yP].filter(e=>e!=null),tP(vn(i.value?e[1]:e[0])),tP(_n(i.value?e[2]:e[1])),vn(i.value?e[3]:e[2])]},([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=UN(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 FN(n),o}function TP(){let e=z(!1),t=jo();return t&&ei(()=>{e.value=!0},t),e}function EP(e){let t=TP();return V(()=>(t.value,!!e()))}function DP(e,t,n={}){let{window:r=yP,...i}=n,a,o=EP(()=>r&&`MutationObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=V(()=>{let t=vn(e),n=tP(t).map(CP).filter(VN);return new Set(n)}),l=B(()=>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 FN(d),{isSupported:o,stop:d,takeRecords:u}}const OP=Symbol(`vueuse-ssr-width`);function kP(){let e=$i()?RN(OP,null):null;return typeof e==`number`?e:void 0}function AP(e,t={}){let{window:n=yP,ssrWidth:r=kP()}=t,i=EP(()=>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 ja(()=>{if(a.value){a.value=!i.value;let t=vn(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>=eP(n[1])),i&&a&&(a=r<=eP(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(vn(e)),s.value=o.value.matches)}),wP(o,`change`,c,{passive:!0}),V(()=>s.value)}const jP={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function MP(e,t={}){function n(t,n){let r=vn(e[vn(t)]);return n!=null&&(r=$N(r,n)),typeof r==`number`&&(r=`${r}px`),r}let{window:r=yP,strategy:i=`min-width`,ssrWidth:a=kP()}=t,o=typeof a==`number`,s=o?z(!1):{value:!0};o&&pP(()=>s.value=!!r);function c(e,t){return!s.value&&o?e===`min`?a>=eP(t):a<=eP(t):r?r.matchMedia(`(${e}-width: ${t})`).matches:!1}let l=e=>AP(()=>`(min-width: ${n(e)})`,t),u=e=>AP(()=>`(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],eP(n(e))]).sort((e,t)=>e[2]-t[2]);return V(()=>t.filter(([,e])=>e.value).map(([e])=>e))}return Object.assign(d,{greaterOrEqual:l,smallerOrEqual:u,greater(e){return AP(()=>`(min-width: ${n(e,.1)})`,t)},smaller(e){return AP(()=>`(max-width: ${n(e,-.1)})`,t)},between(e,r){return AP(()=>`(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 V(()=>e.value.length===0?``:e.value.at(i===`min-width`?-1:0))}})}function NP(e,t={}){let{controls:n=!1,navigator:r=xP}=t,i=EP(()=>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`};wP(a,`change`,c,{passive:!0});let l=QN(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 PP(e={}){let{navigator:t=xP,read:n=!1,source:r,copiedDuring:i=1500,legacy:a=!1}=e,o=EP(()=>t&&`clipboard`in t),s=NP(`clipboard-read`),c=NP(`clipboard-write`),l=V(()=>o.value||a),u=z(``),d=z(!1),f=hP(()=>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&&wP([`copy`,`cut`],p,{passive:!0});async function m(e=vn(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 FP=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},IP=`__vueuse_ssr_handlers__`,LP=RP();function RP(){return IP in FP||(FP[IP]=FP[IP]||{}),FP[IP]}function zP(e,t){return LP[e]||t}function BP(e){return AP(`(prefers-color-scheme: dark)`,e)}function VP(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 HP={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()}},UP=`vueuse-storage`;function WP(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=yP,eventFilter:f,onError:p=e=>{console.error(e)},initOnMounted:m}=r,h=(u?z:R)(typeof t==`function`?t():t),g=V(()=>vn(e));if(!n)try{n=zP(`getDefaultStorage`,()=>{var e;return(e=yP)?.localStorage})()}catch(e){p(e)}if(!n)return h;let _=vn(t),v=VP(_),y=(i=r.serializer)??HP[v],{pause:b,resume:x}=fP(h,()=>E(h.value),{flush:a,deep:o,eventFilter:f});B(g,()=>O(),{flush:a});let S=!1,C=e=>{m&&!S||O(e)},w=e=>{m&&!S||k(e)};d&&s&&(n instanceof Storage?wP(d,`storage`,C,{passive:!0}):wP(d,UP,w)),m?pP(()=>{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(UP,{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?qn(x):x()}}}}function k(e){O(e.detail)}return h}const GP=`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function KP(e={}){let{selector:t=`html`,attribute:n=`class`,initialValue:r=`auto`,window:i=yP,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=BP({window:i}),p=V(()=>f.value?`dark`:`light`),m=c||(o==null?KN(r):WP(o,r,a,{window:i,listenToStorageChanges:s})),h=V(()=>m.value===`auto`?p.value:m.value),g=zP(`updateHTMLAttrs`,(e,t,n)=>{let r=typeof e==`string`?i?.document.querySelector(e):CP(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(GP)),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)}B(h,v,{flush:`post`,immediate:!0}),pP(()=>v(h.value));let y=V({get(){return l?m.value:h.value},set(e){m.value=e}});return Object.assign(y,{store:m,system:p,state:h})}function qP(e,t,n={}){let{window:r=yP,initialValue:i,observe:a=!1}=n,o=z(i),s=V(()=>{var e;return CP(t)||(e=r?.document)?.documentElement});function c(){var t;let n=vn(e),a=vn(s);if(a&&r&&n){let e=(t=r.getComputedStyle(a).getPropertyValue(n))?.trim();o.value=e||o.value||i}}return a&&DP(s,c,{attributeFilter:[`style`,`class`],window:r}),B([s,()=>vn(e)],(e,t)=>{t[0]&&t[1]&&t[0].style.removeProperty(t[1]),c()},{immediate:!0}),B([o,s],([t,n])=>{let r=vn(e);n?.style&&r&&(t==null?n.style.removeProperty(r):n.style.setProperty(r,t))},{immediate:!0}),o}function JP(e={}){let{valueDark:t=`dark`,valueLight:n=``}=e,r=KP({...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=V(()=>r.system.value),a=V({get(){return r.value===`dark`},set(e){let t=e?`dark`:`light`;i.value===t?r.value=`auto`:r.value=t}});return a}function YP(e={}){let{navigator:t=xP,requestPermissions:n=!1,constraints:r={audio:!0,video:!0},onUpdated:i}=e,a=R([]),o=V(()=>a.value.filter(e=>e.kind===`videoinput`)),s=V(()=>a.value.filter(e=>e.kind===`audioinput`)),c=V(()=>a.value.filter(e=>e.kind===`audiooutput`)),l=EP(()=>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}=NP(e,{controls:!0});if(await i(),n.value!==`granted`){let e=!0;try{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(),wP(t.mediaDevices,`devicechange`,f,{passive:!0}),f()),{devices:a,ensurePermissions:p,permissionGranted:u,videoInputs:o,audioInputs:s,audioOutputs:c,isSupported:l}}function XP(e,t,n={}){let{window:r=yP,...i}=n,a,o=EP(()=>r&&`ResizeObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=V(()=>{let t=vn(e);return Array.isArray(t)?t.map(e=>CP(e)):[CP(t)]}),l=B(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 FN(u),{isSupported:o,stop:u}}function ZP(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=CP(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 XP(e,g),B(()=>CP(e),e=>!e&&g()),DP(e,g,{attributeFilter:[`style`,`class`]}),i&&wP(`scroll`,g,{capture:!0,passive:!0}),r&&wP(`resize`,g,{passive:!0}),pP(()=>{a&&g()}),{height:s,bottom:c,left:l,right:u,top:d,width:f,x:p,y:m,update:g}}function QP(e,t,n={}){let{root:r,rootMargin:i=`0px`,threshold:a=0,window:o=yP,immediate:s=!0}=n,c=EP(()=>o&&`IntersectionObserver`in o),l=V(()=>{let t=vn(e);return tP(t).map(CP).filter(VN)}),u=WN,d=z(s),f=c.value?B(()=>[l.value,CP(r),d.value],([e,n])=>{if(u(),!d.value||!e.length)return;let r=new IntersectionObserver(t,{root:CP(n),rootMargin:i,threshold:a});e.forEach(e=>e&&r.observe(e)),u=()=>{r.disconnect(),u=WN}},{immediate:s,flush:`post`}):WN,p=()=>{u(),f(),d.value=!1};return FN(p),{isSupported:c,isActive:d,pause(){u(),d.value=!1},resume(){d.value=!0},stop:p}}const $P={multiple:!0,accept:`*`,reset:!1,directory:!1};function eF(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 tF(e={}){let{document:t=bP}=e,n=R(eF(e.initialFiles)),{on:r,trigger:i}=IN(),{on:a,trigger:o}=IN(),s;t&&(s=CP(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={...$P,...e,...t};s.multiple=n.multiple,s.accept=n.accept,s.webkitdirectory=n.directory,GN(n,`capture`)&&(s.capture=n.capture),n.reset&&c(),s.click()};return{files:tn(n),open:l,reset:c,onCancel:a,onChange:r}}const nF=1;function rF(e,t={}){let{throttle:n=0,idle:r=200,onStop:i=WN,onScroll:a=WN,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0},behavior:c=`auto`,window:l=yP,onError:u=e=>{console.error(e)}}=t,d=z(0),f=z(0),p=V({get(){return d.value},set(e){h(e,void 0)}}),m=V({get(){return f.value},set(e){h(void 0,e)}});function h(t,n){var r,i,a,o;if(!l)return;let s=vn(e);if(!s)return;(a=s instanceof Document?l.document.body:s)==null||a.scrollTo({top:(r=vn(n))??m.value,left:(i=vn(t))??p.value,behavior:vn(c)});let u=(o=s?.document)?.documentElement||s?.documentElement||s;p!=null&&(d.value=u.scrollLeft),m!=null&&(f.value=u.scrollTop)}let g=z(!1),_=$t({left:!0,right:!1,top:!0,bottom:!1}),v=$t({left:!1,right:!1,top:!1,bottom:!1}),y=e=>{g.value&&(g.value=!1,v.left=!1,v.right=!1,v.top=!1,v.bottom=!1,i(e))},b=cP(y,n+r),x=e=>{var t;if(!l)return;let n=(t=e?.document)?.documentElement||e?.documentElement||CP(e),{display:r,flexDirection:i,direction:a}=getComputedStyle(n),s=a===`rtl`?-1:1,c=n.scrollLeft;v.left=cd.value;let u=Math.abs(c*s)<=(o.left||0),p=Math.abs(c*s)+n.clientWidth>=n.scrollWidth-(o.right||0)-nF;r===`flex`&&i===`row-reverse`?(_.left=p,_.right=u):(_.left=u,_.right=p),d.value=c;let m=n.scrollTop;e===l.document&&!m&&(m=l.document.body.scrollTop),v.top=mf.value;let h=Math.abs(m)<=(o.top||0),g=Math.abs(m)+n.clientHeight>=n.scrollHeight-(o.bottom||0)-nF;r===`flex`&&i===`column-reverse`?(_.top=g,_.bottom=h):(_.top=h,_.bottom=g),f.value=m},S=e=>{var t;if(!l)return;let n=(t=e.target.documentElement)??e.target;x(n),g.value=!0,b(e),a(e)};return wP(e,`scroll`,n?uP(S,n,!0,!1):S,s),pP(()=>{try{let t=vn(e);if(!t)return;x(t)}catch(e){u(e)}}),wP(e,`scrollend`,y,s),{x:p,y:m,isScrolling:g,arrivedState:_,directions:v,measure(){let t=vn(e);l&&t&&x(t)}}}function iF(e,t,n={}){let{window:r=yP}=n;return WP(e,t,r?.localStorage,n)}const aF={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 oF(e={}){let{type:t=`page`,touch:n=!0,resetOnTouchEnds:r=!1,initialValue:i={x:0,y:0},window:a=yP,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:aF[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};wP(o,[`mousemove`,`dragover`],b,e),n&&t!==`movement`&&(wP(o,[`touchstart`,`touchmove`],x,e),r&&wP(o,`touchend`,y,e)),s&&t===`page`&&wP(a,`scroll`,S,e)}return{x:f,y:p,sourceType:m}}function sF(e){let t=z(),n=()=>{t.value&&URL.revokeObjectURL(t.value),t.value=void 0};return B(()=>vn(e),e=>{n(),e&&(t.value=URL.createObjectURL(e))},{immediate:!0}),FN(n),tn(t)}const cF=`--vueuse-safe-area-top`,lF=`--vueuse-safe-area-right`,uF=`--vueuse-safe-area-bottom`,dF=`--vueuse-safe-area-left`;function fF(){let e=z(``),t=z(``),n=z(``),r=z(``);if(zN){let e=qP(cF),t=qP(lF),n=qP(uF),r=qP(dF);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)`,i(),wP(`resize`,cP(i),{passive:!0})}function i(){e.value=pF(cF),t.value=pF(lF),n.value=pF(uF),r.value=pF(dF)}return{top:e,right:t,bottom:n,left:r,update:i}}function pF(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const mF=[{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 hF(e,t,n){let{window:r=yP}=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},FN(()=>{a.value&&a.value.terminate()})),{data:i,post:o,terminate:s,worker:a}}function gF(e={}){let{window:t=yP,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(),pP(l);let u={passive:!0};if(wP(`resize`,l,u),t&&o===`visual`&&t.visualViewport&&wP(t.visualViewport,`resize`,l,u),i){let e=AP(`(orientation: portrait)`);B(e,()=>l())}return{width:s,height:c}}const _F=1/60*1e3,vF=typeof performance<`u`?()=>performance.now():()=>Date.now(),yF=typeof window<`u`?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(vF()),_F);function bF(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]=bF(()=>CF=!0),e),{}),OF=EF.reduce((e,t)=>{let n=DF[t];return e[t]=(e,t=!1,r=!1)=>(CF||NF(),n.schedule(e,t,r)),e},{}),kF=EF.reduce((e,t)=>(e[t]=DF[t].cancel,e),{}),AF=EF.reduce((e,t)=>(e[t]=()=>DF[t].process(TF),e),{}),jF=e=>DF[e].process(TF),MF=e=>{CF=!1,TF.delta=SF?_F:Math.max(Math.min(e-TF.timestamp,xF),1),TF.timestamp=e,wF=!0,EF.forEach(jF),wF=!1,CF&&(SF=!1,yF(MF))},NF=()=>{CF=!0,SF=!0,wF||yF(MF)},PF=()=>TF;var FF=OF;function IF(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),BF=.001,VF=.01,HF=10,UF=.05,WF=1;function GF({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a;LF(e<=HF*1e3,`Spring duration must be 10 seconds or less`);let o=1-t;o=zF(UF,WF,o),e=zF(VF,HF,e/1e3),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=JF(t,o),c=Math.exp(-i);return BF-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=JF(t**2,o),d=-i(t)+BF>0?-1:1;return d*((s-c)*l)/u}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-BF+r*i},a=t=>{let r=Math.exp(-t*e),i=(n-t)*(e*e);return r*i});let s=5/e,c=qF(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 KF=12;function qF(e,t,n){let r=n;for(let n=1;ne[t]!==void 0)}function QF(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!ZF(e,XF)&&ZF(e,YF)){let n=GF(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function $F(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,a=IF(e,[`from`,`to`,`restSpeed`,`restDelta`]);let o={done:!1,value:t},{stiffness:s,damping:c,mass:l,velocity:u,duration:d,isResolvedFromDuration:f}=QF(a),p=eI,m=eI;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=JF(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()}}}$F.needsInterpolation=(e,t)=>typeof e==`string`||typeof t==`string`;const eI=e=>0,tI=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},nI=(e,t,n)=>-n*e+n*t+e,rI=(e,t)=>n=>Math.max(Math.min(n,t),e),iI=e=>e%1?Number(e.toFixed(5)):e,aI=/(-)?([\d]*\.?[\d])+/g,oI=/(#[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,sI=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function cI(e){return typeof e==`string`}const lI={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},uI=Object.assign(Object.assign({},lI),{transform:rI(0,1)}),dI=Object.assign(Object.assign({},lI),{default:1}),fI=e=>({test:t=>cI(t)&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),pI=fI(`deg`),mI=fI(`%`),hI=fI(`px`),gI=fI(`vh`),_I=fI(`vw`),vI=Object.assign(Object.assign({},mI),{parse:e=>mI.parse(e)/100,transform:e=>mI.transform(e*100)}),yI=(e,t)=>n=>!!(cI(n)&&sI.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),bI=(e,t,n)=>r=>{if(!cI(r))return r;let[i,a,o,s]=r.match(aI);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},xI={test:yI(`hsl`,`hue`),parse:bI(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+mI.transform(iI(t))+`, `+mI.transform(iI(n))+`, `+iI(uI.transform(r))+`)`},SI=rI(0,255),CI=Object.assign(Object.assign({},lI),{transform:e=>Math.round(SI(e))}),wI={test:yI(`rgb`,`red`),parse:bI(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+CI.transform(e)+`, `+CI.transform(t)+`, `+CI.transform(n)+`, `+iI(uI.transform(r))+`)`};function TI(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 EI={test:yI(`#`),parse:TI,transform:wI.transform},DI={test:e=>wI.test(e)||EI.test(e)||xI.test(e),parse:e=>wI.test(e)?wI.parse(e):xI.test(e)?xI.parse(e):EI.parse(e),transform:e=>cI(e)?e:e.hasOwnProperty(`red`)?wI.transform(e):xI.transform(e)},OI="${c}",kI="${n}";function AI(e){var t,n,r,i;return isNaN(e)&&cI(e)&&((n=(t=e.match(aI))?.length)??0)+((i=(r=e.match(oI))?.length)??0)>0}function jI(e){typeof e==`number`&&(e=`${e}`);let t=[],n=0,r=e.match(oI);r&&(n=r.length,e=e.replace(oI,OI),t.push(...r.map(DI.parse)));let i=e.match(aI);return i&&(e=e.replace(aI,kI),t.push(...i.map(lI.parse))),{values:t,numColors:n,tokenised:e}}function MI(e){return jI(e).values}function NI(e){let{values:t,numColors:n,tokenised:r}=jI(e),i=t.length;return e=>{let t=r;for(let r=0;rtypeof e==`number`?0:e;function FI(e){let t=MI(e),n=NI(e);return n(t.map(PI))}const II={test:AI,parse:MI,createTransformer:NI,getAnimatableNone:FI},LI=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function RI(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(aI)||[];if(!r)return e;let i=n.replace(r,``),a=LI.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}const zI=/([a-z-]*)\(.*?\)/g,BI=Object.assign(Object.assign({},II),{getAnimatableNone:e=>{let t=e.match(zI);return t?t.map(RI).join(` `):e}});function VI(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 HI({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=VI(s,r,e+1/3),a=VI(s,r,e),o=VI(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}const UI=(e,t,n)=>{let r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},WI=[EI,wI,xI],GI=e=>WI.find(t=>t.test(e)),KI=e=>`'${e}' is not an animatable color. Use the equivalent color code instead.`,qI=(e,t)=>{let n=GI(e),r=GI(t);RF(!!n,KI(e)),RF(!!r,KI(t));let i=n.parse(e),a=r.parse(t);n===xI&&(i=HI(i),n=wI),r===xI&&(a=HI(a),r=wI);let o=Object.assign({},i);return e=>{for(let t in o)t!==`alpha`&&(o[t]=UI(i[t],a[t],e));return o.alpha=nI(i.alpha,a.alpha,e),n.transform(o)}},JI=e=>typeof e==`number`,YI=(e,t)=>n=>t(e(n)),XI=(...e)=>e.reduce(YI);function ZI(e,t){return JI(e)?n=>nI(e,t,n):DI.test(e)?qI(e,t):tL(e,t)}const QI=(e,t)=>{let n=[...e],r=n.length,i=e.map((e,n)=>ZI(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]=ZI(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}};function eL(e){let t=II.parse(e),n=t.length,r=0,i=0,a=0;for(let e=0;e{let n=II.createTransformer(t),r=eL(e),i=eL(t),a=r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers;return a?XI(QI(r.parsed,i.parsed),n):(LF(!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}`)},nL=(e,t)=>n=>nI(e,t,n);function rL(e){if(typeof e==`number`)return nL;if(typeof e==`string`)return DI.test(e)?qI:tL;if(Array.isArray(e))return QI;if(typeof e==`object`)return $I}function iL(e,t,n){let r=[],i=n||rL(e[0]),a=e.length-1;for(let n=0;nn(tI(e,t,r))}function oL(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=tI(e[a],e[a+1],i);return t[a](s)}}function sL(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;RF(a===t.length,`Both input and output ranges must be the same length`),RF(!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=iL(t,r,i),s=a===2?aL(e,o):oL(e,o);return n?t=>s(zF(e[0],e[a-1],t)):s}const cL=e=>t=>1-e(1-t),lL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,uL=e=>t=>t**+e,dL=e=>t=>t*t*((e+1)*t-e),fL=e=>{let t=dL(e);return e=>(e*=2)<1?.5*t(e):.5*(2-2**(-10*(e-1)))},pL=1.525,mL=4/11,hL=8/11,gL=9/10,_L=e=>e,vL=uL(2),yL=cL(vL),bL=lL(vL),xL=e=>1-Math.sin(Math.acos(e)),SL=cL(xL),CL=lL(SL),wL=dL(pL),TL=cL(wL),EL=lL(wL),DL=fL(pL),OL=4356/361,kL=35442/1805,AL=16061/1805,jL=e=>{if(e===1||e===0)return e;let t=e*e;return ee<.5?.5*(1-jL(1-e*2)):.5*jL(e*2-1)+.5;function PL(e,t){return e.map(()=>t||bL).splice(0,e.length-1)}function FL(e){let t=e.length;return e.map((e,n)=>n===0?0:n/(t-1))}function IL(e,t){return e.map(e=>e*t)}function LL({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=IL(r&&r.length===o.length?r:FL(o),i);function c(){return sL(s,o,{ease:Array.isArray(n)?n:PL(o,n)})}let l=c();return{next:e=>(a.value=l(e),a.done=e>=i,a),flipTarget:()=>{o.reverse(),l=c()}}}function RL({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 zL={keyframes:LL,spring:$F,decay:RL};function BL(e){if(Array.isArray(e.to))return LL;if(zL[e.type])return zL[e.type];let t=new Set(Object.keys(e));return t.has(`ease`)||t.has(`duration`)&&!t.has(`dampingRatio`)?LL:t.has(`dampingRatio`)||t.has(`stiffness`)||t.has(`mass`)||t.has(`damping`)||t.has(`restSpeed`)||t.has(`restDelta`)?$F:LL}function VL(e,t,n=0){return e-t-n}function HL(e,t,n=0,r=!0){return r?VL(t+-e,t,n):t-(e-t)+n}function UL(e,t,n,r){return r?e>=t+n:e<=-n}const WL=e=>{let t=({delta:t})=>e(t);return{start:()=>FF.update(t,!0),stop:()=>kF.update(t)}};function GL(e){var t,n,{from:r,autoplay:i=!0,driver:a=WL,elapsed:o=0,repeat:s=0,repeatType:c=`loop`,repeatDelay:l=0,onPlay:u,onStop:d,onComplete:f,onRepeat:p,onUpdate:m}=e,h=IF(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=BL(h);(n=(t=w).needsInterpolation)?.call(t,r,g)&&(C=sL([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=HL(o,y,l,S)):(o=VL(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 KL(e,t){return t?e*(1e3/t):0}function qL({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=KL(e-u,PF().delta),(s===1&&e>o||s===-1&&em?.stop()}}const JL=(e,t)=>1-3*t+3*e,YL=(e,t)=>3*t-6*e,XL=e=>3*e,ZL=(e,t,n)=>((JL(t,n)*e+YL(t,n))*e+XL(t))*e,QL=(e,t,n)=>3*JL(t,n)*e*e+2*YL(t,n)*e+XL(t),$L=1e-7,eR=10;function tR(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=ZL(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>$L&&++s=rR?iR(t,c,e,n):l===0?c:tR(t,r,r+oR,e,n)}return e=>e===0||e===1?e:ZL(a(e),t,r)}const cR={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_TARGET_HUGGINGFACE_SPACE:`true`},lR={};var uR=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 dR(e){return!Number.isNaN(Number.parseFloat(e))}var fR=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 uR),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}=PF();this.lastUpdated!==n&&(this.timeDelta=t,this.lastUpdated=n),FF.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)}),e.defineProperty(this,`scheduleVelocityCheck`,()=>FF.postRender(this.velocityCheck)),e.defineProperty(this,`velocityCheck`,({timestamp:e})=>{this.canTrackVelocity||=dR(this.current),e!==this.lastUpdated&&(this.prev=this.current)}),this.prev=this.current=t,this.canTrackVelocity=dR(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?KL(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 pR(e){return new fR(e)}const{isArray:mR}=Array;function hR(){let e=R({}),t=t=>{let n=t=>{e.value[t]&&(e.value[t].stop(),e.value[t].destroy(),delete e.value[t])};t?mR(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=pR(n);return i.onChange(e=>r[t]=e),e.value[t]=i,i};return mP(t),{motionValues:e,get:n,stop:t}}function gR(e){return Array.isArray(e)}function _R(){return{type:`spring`,stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function vR(e){return{type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function yR(e){return{type:`spring`,stiffness:550,damping:e===0?100:30,restDelta:.01,restSpeed:10}}function bR(){return{type:`keyframes`,ease:`linear`,duration:300}}function xR(e){return{type:`keyframes`,duration:800,values:e}}const SR={default:yR,x:_R,y:_R,z:_R,rotate:_R,rotateX:_R,rotateY:_R,rotateZ:_R,scaleX:vR,scaleY:vR,scale:vR,backgroundColor:bR,color:bR,opacity:bR};function CR(e,t){let n;return n=gR(t)?xR:SR[e]||SR.default,{to:t,...n(t)}}const wR={...lI,transform:Math.round},TR={color:DI,backgroundColor:DI,outlineColor:DI,fill:DI,stroke:DI,borderColor:DI,borderTopColor:DI,borderRightColor:DI,borderBottomColor:DI,borderLeftColor:DI,borderWidth:hI,borderTopWidth:hI,borderRightWidth:hI,borderBottomWidth:hI,borderLeftWidth:hI,borderRadius:hI,radius:hI,borderTopLeftRadius:hI,borderTopRightRadius:hI,borderBottomRightRadius:hI,borderBottomLeftRadius:hI,width:hI,maxWidth:hI,height:hI,maxHeight:hI,size:hI,top:hI,right:hI,bottom:hI,left:hI,padding:hI,paddingTop:hI,paddingRight:hI,paddingBottom:hI,paddingLeft:hI,margin:hI,marginTop:hI,marginRight:hI,marginBottom:hI,marginLeft:hI,rotate:pI,rotateX:pI,rotateY:pI,rotateZ:pI,scale:dI,scaleX:dI,scaleY:dI,scaleZ:dI,skew:pI,skewX:pI,skewY:pI,distance:hI,translateX:hI,translateY:hI,translateZ:hI,x:hI,y:hI,z:hI,perspective:hI,transformPerspective:hI,opacity:uI,originX:vI,originY:vI,originZ:hI,zIndex:wR,filter:BI,WebkitFilter:BI,fillOpacity:uI,strokeOpacity:uI,numOctaves:wR},ER=e=>TR[e];function DR(e,t){return t&&typeof e==`number`&&t.transform?t.transform(e):e}function OR(e,t){let n=ER(e);return n!==BI&&(n=II),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const kR={linear:_L,easeIn:vL,easeInOut:bL,easeOut:yL,circIn:xL,circInOut:CL,circOut:SL,backIn:wL,backInOut:EL,backOut:TL,anticipate:DL,bounceIn:ML,bounceInOut:NL,bounceOut:jL};function AR(e){if(Array.isArray(e)){let[t,n,r,i]=e;return sR(t,n,r,i)}else if(typeof e==`string`)return kR[e];return e}function jR(e){return Array.isArray(e)&&typeof e[0]!=`number`}function MR(e,t){return e===`zIndex`?!1:!!(typeof t==`number`||Array.isArray(t)||typeof t==`string`&&II.test(t)&&!t.startsWith(`url(`))}function NR(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function PR({ease:e,times:t,delay:n,...r}){let i={...r};return t&&(i.offset=t),e&&(i.ease=jR(e)?e.map(AR):AR(e)),n&&(i.elapsed=-n),i}function FR(e,t,n){return Array.isArray(t.to)&&(e.duration||=800),NR(t),IR(e)||(e={...e,...CR(n,t.to)}),{...t,...PR(e)}}function IR({delay:e,repeat:t,repeatType:n,repeatDelay:r,from:i,...a}){return!!Object.keys(a).length}function LR(e,t){return e[t]||e.default||e}function RR(e,t,n,r,i){let a=LR(r,e),o=a.from===null||a.from===void 0?t.get():a.from,s=MR(e,n);o===`none`&&s&&typeof n==`string`&&(o=OR(e,n));let c=MR(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`?qL({...c,...a}):GL({...FR(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 zR(){let{motionValues:e,stop:t,get:n}=hR(),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=RR(e,s,t,i,a);s.start(c)};return{motionValues:e,stop:t,push:r}}function BR(e,t={},{motionValues:n,push:r,stop:i}=zR()){let a=_n(t),o=R(!1);B(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||CR(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=UN(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 VR=typeof window<`u`,HR=()=>VR&&(window.onpointerdown===null||cR?.TEST),UR=()=>VR&&(window.ontouchstart===null||cR?.TEST),WR=()=>VR&&(window.onmousedown===null||cR?.TEST);function GR({target:e,state:t,variants:n,apply:r}){let i=_n(n),a=R(!1),o=R(!1),s=R(!1),c=V(()=>{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=V(()=>{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&&(wP(e,`mouseenter`,()=>a.value=!0),wP(e,`mouseleave`,()=>{a.value=!1,o.value=!1})),i.tapped&&(WR()&&(wP(e,`mousedown`,()=>o.value=!0),wP(e,`mouseup`,()=>o.value=!1)),HR()&&(wP(e,`pointerdown`,()=>o.value=!0),wP(e,`pointerup`,()=>o.value=!1)),UR()&&(wP(e,`touchstart`,()=>o.value=!0),wP(e,`touchend`,()=>o.value=!1))),i.focused&&(wP(e,`focus`,()=>s.value=!0),wP(e,`blur`,()=>s.value=!1)),B([a,o,s],()=>{r(l.value)})}function KR({set:e,target:t,variants:n,variant:r}){let i=_n(n);B(()=>t,()=>{i&&(i.initial&&(e(`initial`),r.value=`initial`),i.enter&&(r.value=`enter`))},{immediate:!0,flush:`pre`})}function qR({state:e,apply:t}){B(e,e=>{e&&t(e)},{immediate:!0})}function JR({target:e,variants:t,variant:n}){let r=_n(t);r&&(r.visible||r.visibleOnce)&&QP(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 YR(e,t={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){t.lifeCycleHooks&&KR(e),t.syncVariants&&qR(e),t.visibilityHooks&&JR(e),t.eventListeners&&GR(e)}function XR(e={}){let t=$t({...e}),n=R({});return B(t,()=>{let e={};for(let[n,r]of Object.entries(t)){let t=ER(n),i=DR(r,t);e[n]=i}n.value=e},{immediate:!0,deep:!0}),{state:t,style:n}}function ZR(e,t){B(()=>CP(e),e=>{e&&t(e)},{immediate:!0})}const QR={x:`translateX`,y:`translateY`,z:`translateZ`};function $R(e={},t=!0){let n=$t({...e}),r=R(``);return B(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=>DR(e,hI)).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=ER(r),a=DR(i,e);n+=`${QR[r]||r}(${a}) `}t&&!i&&(n+=`translateZ(0px) `),r.value=n.trim()},{immediate:!0,deep:!0}),{state:n,transform:r}}const ez=[``,`X`,`Y`,`Z`],tz=[`perspective`,`translate`,`scale`,`rotate`,`skew`],nz=[`transformPerspective`,`x`,`y`,`z`];tz.forEach(e=>{ez.forEach(t=>{let n=e+t;nz.push(n)})});const rz=new Set(nz);function iz(e){return rz.has(e)}const az=new Set([`originX`,`originY`,`originZ`]);function oz(e){return az.has(e)}function sz(e){let t={},n={};return Object.entries(e).forEach(([e,r])=>{iz(e)||oz(e)?t[e]=r:n[e]=r}),{transform:t,style:n}}function cz(e){let{transform:t,style:n}=sz(e),{transform:r}=$R(t),{style:i}=XR(n);return r.value&&(i.value.transform=r.value),i.value}function lz(e,t){let n,r,{state:i,style:a}=XR();return ZR(e,e=>{r=e;for(let t of Object.keys(TR)){if(e.style[t]===null||e.style[t]===``||iz(t)||oz(t))continue;i[t]=e.style[t]}n&&Object.entries(n).forEach(([t,n])=>e.style[t]=n),t&&t(i)}),B(a,e=>{if(!r){n=e;return}for(let t in e)r.style[t]=e[t]},{immediate:!0}),{style:i}}function uz(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 dz(e,t){Object.entries(uz(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 fz(e,t){let n,r,{state:i,transform:a}=$R();return ZR(e,e=>{r=e,e.style.transform&&dz(i,e.style.transform),n&&(e.style.transform=n),t&&t(i)}),B(a,e=>{if(!r){n=e;return}r.style.transform=e},{immediate:!0}),{transform:i}}function pz(e){return Object.entries(e)}function mz(e,t){let n=$t({}),r=e=>Object.entries(e).forEach(([e,t])=>n[e]=t),{style:i}=lz(e,r),{transform:a}=fz(e,r);return B(n,e=>{pz(e).forEach(([e,t])=>{let n=iz(e)?a:i;n[e]&&n[e]===t||(n[e]=t)})},{immediate:!0,deep:!0}),ZR(e,()=>t&&r(t)),{motionProperties:n,style:i,transform:a}}function hz(e={}){let t=_n(e),n=R(),r=V(()=>{if(n.value)return t[n.value]});return{state:r,variant:n}}function gz(e,t={},n){let{motionProperties:r}=mz(e),{variant:i,state:a}=hz(t),o=BR(r,t),s={target:e,variant:i,variants:t,state:a,motionProperties:r,...o};return YR(s,n),s}const _z=[`delay`,`duration`],vz=[`initial`,`enter`,`leave`,`visible`,`visible-once`,`visibleOnce`,`hovered`,`tapped`,`focused`,..._z];function yz(e){return _z.includes(e)}function bz(e,t){let n=e.props?e.props:e.data&&e.data.attrs?e.data.attrs:{};if(n){n.variants&&UN(n.variants)&&(t.value={...t.value,...n.variants});for(let e of vz){if(!n||!n[e])continue;if(yz(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(UN(n[e])){let r=n[e];e===`visible-once`&&(e=`visibleOnce`),t.value[e]=r}}}}function xz(e,t=!1){let n=(n,r,i)=>{let a=r.value&&typeof r.value==`string`?r.value:i.key;a&&lR[a]&&lR[a].stop();let o=t?structuredClone(ln(e)||{}):e||{},s=R(o);typeof r.value==`object`&&(s.value=r.value),bz(i,s);let c={eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1},l=gz(n,s,c);n.motionInstance=l,a&&(lR[a]=l)},r=(e,t,n)=>{e.motionInstance&&JR(e.motionInstance)};return{created:n,mounted:r,getSSRProps(t,n){let{initial:r}=t.value||n&&n?.props||{};r=_n(r);let i=MN({},e?.initial||{},r||{});if(!i||Object.keys(i).length===0)return;let a=cz(i);return{style:a}}}}const Sz={initial:{opacity:0},enter:{opacity:1}},Cz={initial:{opacity:0},visible:{opacity:1}},wz={initial:{opacity:0},visibleOnce:{opacity:1}},Tz={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},Ez={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},Dz={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},Oz={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},kz={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},Az={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},jz={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},Mz={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},Nz={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},Pz={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},Fz={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Iz={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},Lz={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},Rz={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},zz={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},Bz={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},Vz={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},Hz={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},Uz={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Wz={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},Gz={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},Kz={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},qz={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},Jz={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},Yz={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},Xz={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},Zz={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Qz={__proto__:null,fade:Sz,fadeVisible:Cz,fadeVisibleOnce:wz,pop:Tz,popVisible:Ez,popVisibleOnce:Dz,rollBottom:Lz,rollLeft:Oz,rollRight:jz,rollTop:Pz,rollVisibleBottom:Rz,rollVisibleLeft:kz,rollVisibleOnceBottom:zz,rollVisibleOnceLeft:Az,rollVisibleOnceRight:Nz,rollVisibleOnceTop:Iz,rollVisibleRight:Mz,rollVisibleTop:Fz,slideBottom:Yz,slideLeft:Bz,slideRight:Uz,slideTop:Kz,slideVisibleBottom:Xz,slideVisibleLeft:Vz,slideVisibleOnceBottom:Zz,slideVisibleOnceLeft:Hz,slideVisibleOnceRight:Gz,slideVisibleOnceTop:Jz,slideVisibleRight:Wz,slideVisibleTop:qz};function $z(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 eB=Symbol(``),tB={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 nB(e){return Object.prototype.toString.call(e)===`[object Object]`}function rB(e){if(Array.isArray(e))return e.map(rB);if(nB(e)){let t={};for(let n in e)t[n]=rB(e[n]);return t}return e}function iB(e){let t=$t({}),n=Qi(eB,{}),r=V(()=>e.preset==null?{}:n!=null&&e.preset in n?structuredClone(ln(n)[e.preset]):e.preset in Qz?structuredClone(Qz[e.preset]):{}),i=V(()=>({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=V(()=>{let t=MN({},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(rB(o.value),e.props);return e.props.onVnodeMounted=({el:e})=>{t[n]=gz(e,s)},e.props.onVnodeUpdated=({el:e})=>{let r=cz(t[n].state);for(let[t,n]of Object.entries(r))e.style[t]=n},e}return{motionConfig:o,setNodeInstance:s}}const aB=zr({name:`Motion`,props:{...tB,is:{type:[String,Object],default:`div`}},setup(e){let t=Ti(),{motionConfig:n,setNodeInstance:r}=iB(e);return()=>{let i=cz(n.value.initial||{}),a=Yo(e.is,void 0,t);return r(a,0,i),a}}}),oB=zr({name:`MotionGroup`,props:{...tB,is:{type:[String,Object],required:!1}},setup(e){let t=Ti(),{motionConfig:n,setNodeInstance:r}=iB(e);return()=>{var i;let a=cz(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 lB;const uB=e=>lB=e,dB=Symbol();function fB(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var pB;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(pB||={});const mB=typeof window<`u`,hB=(()=>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 gB(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 _B(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){SB(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function vB(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function yB(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 bB=typeof navigator==`object`?navigator:{userAgent:``},xB=(()=>/Macintosh/.test(bB.userAgent)&&/AppleWebKit/.test(bB.userAgent)&&!/Safari/.test(bB.userAgent))(),SB=mB?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!xB?CB:`msSaveOrOpenBlob`in bB?wB:TB:()=>{};function CB(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?yB(r):vB(r.href)?_B(e,t,n):(r.target=`_blank`,yB(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){yB(r)},0))}function wB(e,t=`download`,n){if(typeof e==`string`)if(vB(e))_B(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){yB(t)})}else navigator.msSaveOrOpenBlob(gB(e,n),t)}function TB(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return _B(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(hB.HTMLElement))||`safari`in hB,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||xB)&&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:EB}=Object;function DB(){let e=Re(!0),t=e.run(()=>R({})),n=[],r=[],i=un({install(e){uB(i),i._a=e,e.provide(dB,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 OB=()=>{};function kB(e,t,n,r=OB){e.push(t);let i=()=>{let n=e.indexOf(t);n>-1&&(e.splice(n,1),r())};return!n&&ze()&&Be(i),i}function AB(e,...t){e.slice().forEach(e=>{e(...t)})}const jB=e=>e(),MB=Symbol(),NB=Symbol();function PB(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];fB(i)&&fB(r)&&e.hasOwnProperty(n)&&!pn(r)&&!an(r)?e[n]=PB(i,r):e[n]=r}return e}const FB=Symbol();function IB(e){return!fB(e)||!Object.prototype.hasOwnProperty.call(e,FB)}const{assign:LB}=Object;function RB(e){return!!(pn(e)&&e.effect)}function zB(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=Cn(n.state.value[e]);return LB(t,a,Object.keys(o||{}).reduce((t,r)=>(t[r]=un(V(()=>{uB(n);let t=n._s.get(e);return o[r].call(t,t)})),t),{}))}return c=BB(e,l,t,n,r,!0),c}function BB(e,t,n={},r,i,a){let o,s=LB({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:pB.patchFunction,storeId:e,events:p}):(PB(r.state.value[e],t),n={type:pB.patchObject,payload:t,storeId:e,events:p});let i=g=Symbol();qn().then(()=>{g===i&&(l=!0)}),u=!0,AB(d,n,r.state.value[e])}let v=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{LB(e,t)})}:OB;function y(){o.stop(),d=[],f=[],r._s.delete(e)}let b=(t,n=``)=>{if(MB in t)return t[NB]=n,t;let i=function(){uB(r);let n=Array.from(arguments),a=[],o=[];function s(e){a.push(e)}function c(e){o.push(e)}AB(f,{args:n,name:i[NB],store:C,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:C,n)}catch(e){throw AB(o,e),e}return l instanceof Promise?l.then(e=>(AB(a,e),e)).catch(e=>(AB(o,e),Promise.reject(e))):(AB(a,l),l)};return i[MB]=!0,i[NB]=n,i},x=un({actions:{},getters:{},state:[],hotState:h}),S={_p:r,$id:e,$onAction:kB.bind(null,f),$patch:_,$reset:v,$subscribe(t,n={}){let i=kB(d,t,n.detached,()=>a()),a=o.run(()=>B(()=>r.state.value[e],r=>{(n.flush===`sync`?u:l)&&t({storeId:e,type:pB.direct,events:p},r)},LB({},c,n)));return i},$dispose:y},C=$t(S);r._s.set(e,C);let w=r._a&&r._a.runWithContext||jB,T=w(()=>r._e.run(()=>(o=Re()).run(()=>t({action:b}))));for(let t in T){let n=T[t];if(pn(n)&&!RB(n)||an(n))a||(m&&IB(n)&&(pn(n)?n.value=m[t]:PB(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 LB(C,T),LB(ln(C),T),Object.defineProperty(C,`$state`,{get:()=>r.state.value[e],set:e=>{_(t=>{LB(t,e)})}}),r._p.forEach(e=>{LB(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 VB(e,t,n){let r,i=typeof t==`function`;r=i?n:t;function a(n,a){let o=$i();n||=o?Qi(dB,null):null,n&&uB(n),n=lB,n._s.has(e)||(i?BB(e,t,r,n):zB(e,r,n));let s=n._s.get(e);return s}return a.$id=e,a}function HB(e){let t=ln(e),n={};for(let r in t){let i=t[r];i.effect?n[r]=V({get:()=>e[r],set(t){e[r]=t}}):(pn(i)||an(i))&&(n[r]=En(e,r))}return n}const UB=`modulepreload`,WB=function(e){return`/`+e},GB={},J=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=WB(e,n),e in GB)return;GB[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`:UB,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)})},KB=e=>{let t={},n=Object.assign({"/src/layouts/default.vue":()=>J(()=>import(`./default-t1McW1fh.js`),__vite__mapDeps([0,1,2])),"/src/layouts/settings.vue":()=>J(()=>import(`./settings-BPFawjNr.js`),__vite__mapDeps([3,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),"/src/layouts/stage.vue":()=>J(()=>import(`./stage-PXC-MtyN.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)},qB=typeof document<`u`;function JB(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function YB(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&JB(e.default)}const XB=Object.assign;function ZB(e,t){let n={};for(let r in t){let i=t[r];n[r]=$B(i)?i.map(e):e(i)}return n}const QB=()=>{},$B=Array.isArray,eV=/#/g,tV=/&/g,nV=/\//g,rV=/=/g,iV=/\?/g,aV=/\+/g,oV=/%5B/g,sV=/%5D/g,cV=/%5E/g,lV=/%60/g,uV=/%7B/g,dV=/%7C/g,fV=/%7D/g,pV=/%20/g;function mV(e){return encodeURI(``+e).replace(dV,`|`).replace(oV,`[`).replace(sV,`]`)}function hV(e){return mV(e).replace(uV,`{`).replace(fV,`}`).replace(cV,`^`)}function gV(e){return mV(e).replace(aV,`%2B`).replace(pV,`+`).replace(eV,`%23`).replace(tV,`%26`).replace(lV,"`").replace(uV,`{`).replace(fV,`}`).replace(cV,`^`)}function _V(e){return gV(e).replace(rV,`%3D`)}function vV(e){return mV(e).replace(eV,`%23`).replace(iV,`%3F`)}function yV(e){return e==null?``:vV(e).replace(nV,`%2F`)}function bV(e){try{return decodeURIComponent(``+e)}catch{}return``+e}const xV=/\/$/,SV=e=>e.replace(xV,``);function CV(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=jV(r??t,n),{fullPath:r+(a&&`?`)+a+o,path:r,query:i,hash:bV(o)}}function wV(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function TV(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function EV(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&DV(t.matched[r],n.matched[i])&&OV(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function DV(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function OV(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!kV(e[n],t[n]))return!1;return!0}function kV(e,t){return $B(e)?AV(e,t):$B(t)?AV(t,e):e===t}function AV(e,t){return $B(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function jV(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 MV={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};var NV;(function(e){e.pop=`pop`,e.push=`push`})(NV||={});var PV;(function(e){e.back=`back`,e.forward=`forward`,e.unknown=``})(PV||={});function FV(e){if(!e)if(qB){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),SV(e)}const IV=/^[^#]+#/;function LV(e,t){return e.replace(IV,`#`)+t}function RV(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 zV=()=>({left:window.scrollX,top:window.scrollY});function BV(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=RV(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 VV(e,t){let n=history.state?history.state.position-t:-1;return n+e}const HV=new Map;function UV(e,t){HV.set(e,t)}function WV(e){let t=HV.get(e);return HV.delete(e),t}let GV=()=>location.protocol+`//`+location.host;function KV(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),TV(n,``)}let o=TV(n,e);return o+r+i}function qV(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=KV(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:NV.pop,direction:u?u>0?PV.forward:PV.back:PV.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(XB({},e.state,{scroll:zV()}),``)}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 JV(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?zV():null}}function YV(e){let{history:t,location:n}=window,r={value:KV(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:GV()+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=XB({},t.state,JV(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=XB({},i.value,t.state,{forward:e,scroll:zV()});a(o.current,o,!0);let s=XB({},JV(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 XV(e){e=FV(e);let t=YV(e),n=qV(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=XB({location:``,base:e,go:r,createHref:LV.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 ZV(e){return e=location.host?e||location.pathname+location.search:``,e.includes(`#`)||(e+=`#`),XV(e)}function QV(e){return typeof e==`string`||e&&typeof e==`object`}function $V(e){return typeof e==`string`||typeof e==`symbol`}const eH=Symbol(``);var tH;(function(e){e[e.aborted=4]=`aborted`,e[e.cancelled=8]=`cancelled`,e[e.duplicated=16]=`duplicated`})(tH||={});function nH(e,t){return XB(Error(),{type:e,[eH]:!0},t)}function rH(e,t){return e instanceof Error&&eH in e&&(t==null||!!(e.type&t))}const iH=`[^/]+?`,aH={sensitive:!1,strict:!1,start:!0,end:!0},oH=/[.+*?^${}()[\]/\\]/g;function sH(e,t){let n=XB({},aH,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 lH(e,t){let n=0,r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}const dH={type:0,value:``},fH=/[a-zA-Z0-9_]/;function pH(e){if(!e)return[[]];if(e===`/`)return[[dH]];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)}:QB}function o(e){if($V(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=SH(e,n);n.splice(t,0,e),e.record.name&&!yH(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 nH(1,{location:e});s=i.record.name,a=XB(gH(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&gH(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 nH(1,{location:e,currentLocation:t});s=i.record.name,a=XB({},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:bH(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 gH(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function _H(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:vH(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 vH(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 yH(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function bH(e){return e.reduce((e,t)=>XB(e,t.meta),{})}function xH(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}function SH(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1,a=lH(e,t[i]);a<0?r=i:n=i+1}let i=CH(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function CH(e){let t=e;for(;t=t.parent;)if(wH(t)&&lH(e,t)===0)return t}function wH({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function TH(e){let t={};if(e===``||e===`?`)return t;let n=e[0]===`?`,r=(n?e.slice(1):e).split(`&`);for(let e=0;ee&&gV(e)):[r&&gV(r)];i.forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function DH(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=$B(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}const OH=Symbol(``),kH=Symbol(``),AH=Symbol(``),jH=Symbol(``),MH=Symbol(``);function NH(){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 PH(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(nH(4,{from:n,to:t})):e instanceof Error?c(e):QV(e)?c(nH(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 FH(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(JB(s)){let c=s.__vccOpts||s,l=c[t];l&&a.push(PH(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=YB(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=s.__vccOpts||s,l=c[t];return l&&PH(l,n,r,o,e,i)()}))}}return a}function IH(e){let t=Qi(AH),n=Qi(jH),r=!1,i=null,a=V(()=>{let n=_n(e.to);return t.resolve(n)}),o=V(()=>{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(DV.bind(null,r));if(o>-1)return o;let s=HH(e[t-2]);return t>1&&HH(r)===s&&i[i.length-1].path!==s?i.findIndex(DV.bind(null,e[t-2])):o}),s=V(()=>o.value>-1&&VH(n.params,a.value.params)),c=V(()=>o.value>-1&&o.value===n.matched.length-1&&OV(n.params,a.value.params));function l(n={}){if(BH(n)){let n=t[_n(e.replace)?`replace`:`push`](_n(e.to)).catch(QB);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:a,href:V(()=>a.value.href),isActive:s,isExactActive:c,navigate:l}}function LH(e){return e.length===1?e[0]:e}const RH=zr({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:IH,setup(e,{slots:t}){let n=$t(IH(e)),{options:r}=Qi(AH),i=V(()=>({[UH(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[UH(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&LH(t.default(n));return e.custom?r:Yo(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}}),zH=RH;function BH(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 VH(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(!$B(i)||i.length!==r.length||r.some((e,t)=>e!==i[t]))return!1}return!0}function HH(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}const UH=(e,t,n)=>e??t??n,WH=zr({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=Qi(MH),i=V(()=>e.route||r.value),a=Qi(kH,0),o=V(()=>{let e=_n(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),s=V(()=>i.value.matched[o.value]);Zi(kH,V(()=>o.value+1)),Zi(OH,s),Zi(MH,i);let c=R();return B(()=>[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||!DV(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 GH(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=Yo(l,XB({},d,t,{onVnodeUnmounted:f,ref:c}));return GH(n.default,{Component:p,route:r})||p}}});function GH(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}const KH=WH;function qH(e){let t=hH(e.routes,e),n=e.parseQuery||TH,r=e.stringifyQuery||EH,i=e.history,a=NH(),o=NH(),s=NH(),c=z(MV),l=MV;qB&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let u=ZB.bind(null,e=>``+e),d=ZB.bind(null,yV),f=ZB.bind(null,bV);function p(e,n){let r,i;return $V(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=XB({},a||c.value),typeof e==`string`){let r=CV(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return XB(r,o,{params:f(o.params),hash:bV(r.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=XB({},e,{path:CV(n,e.path,a.path).path});else{let t=XB({},e.params);for(let e in t)t[e]??delete t[e];o=XB({},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=wV(r,XB({},e,{hash:hV(l),path:s.path})),m=i.createHref(p);return XB({fullPath:p,hash:l,query:r===EH?DH(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function v(e){return typeof e==`string`?CV(n,e,c.value.path):XB({},e)}function y(e,t){if(l!==e)return nH(8,{from:t,to:e})}function b(e){return C(e)}function x(e){return b(XB(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={}),XB({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(XB(v(u),{state:typeof u==`object`?XB({},a,u.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&EV(r,i,n)&&(f=nH(16,{to:d,from:i}),ne(i,i,!0,!1)),(f?Promise.resolve(f):E(d,i)).catch(e=>rH(e)?rH(e,2)?e:P(e):ee(e,d,i)).then(e=>{if(e){if(rH(e,2))return C(XB({replace:s},v(e.to),{state:typeof e.to==`object`?XB({},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]=JH(e,t);n=FH(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(PH(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(PH(r,e,t));return n.push(c),se(n)}).then(()=>{n=FH(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(PH(r,e,t))});return n.push(c),se(n)}).then(()=>{n=[];for(let r of s)if(r.beforeEnter)if($B(r.beforeEnter))for(let i of r.beforeEnter)n.push(PH(i,e,t));else n.push(PH(r.beforeEnter,e,t));return n.push(c),se(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=FH(s,`beforeRouteEnter`,e,t,T),n.push(c),se(n))).then(()=>{n=[];for(let r of o.list())n.push(PH(r,e,t));return n.push(c),se(n)}).catch(e=>rH(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===MV,l=qB?history.state:{};n&&(r||s?i.replace(e.fullPath,XB({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(XB(a,{replace:!0,force:!0}),r).catch(QB);return}l=r;let o=c.value;qB&&UV(VV(o.fullPath,n.delta),zV()),E(r,o).catch(e=>rH(e,12)?e:rH(e,2)?(C(XB(v(e.to),{force:!0}),r).then(e=>{rH(e,20)&&!n.delta&&n.type===NV.pop&&i.go(-1,!1)}).catch(QB),Promise.reject()):(n.delta&&i.go(-n.delta,!1),ee(e,r,o))).then(e=>{e||=O(r,o,!1),e&&(n.delta&&!rH(e,8)?i.go(-n.delta,!1):n.type===NV.pop&&rH(e,20)&&i.go(-1,!1)),D(r,o,e)}).catch(QB)})}let j=NH(),M=NH(),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!==MV?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(!qB||!a)return Promise.resolve();let o=!r&&WV(VV(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return qn().then(()=>a(t,n,o)).then(e=>e&&BV(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`,zH),e.component(`RouterView`,KH),e.config.globalProperties.$router=t,Object.defineProperty(e.config.globalProperties,`$route`,{enumerable:!0,get:()=>_n(c)}),qB&&!ie&&c.value===MV&&(ie=!0,b(i.location).catch(e=>{}));let n={};for(let e in MV)Object.defineProperty(n,e,{get:()=>c.value[e],enumerable:!0});e.provide(AH,t),e.provide(jH,en(n)),e.provide(MH,c);let r=e.unmount;ae.add(e),e.unmount=function(){ae.delete(e),ae.size<1&&(l=MV,k&&k(),k=null,c.value=MV,ie=!1,N=!1),r()}}};function se(e){return e.reduce((e,t)=>e.then(()=>T(t)),Promise.resolve())}return oe}function JH(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;oDV(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>DV(e,s))||i.push(s))}return[n,r,i]}function YH(){return Qi(AH)}function XH(e){return Qi(jH)}const ZH=[{path:`/`,name:`/`,component:()=>J(()=>import(`./pages-CzrQCDZR.js`),__vite__mapDeps([20,21,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,22,23])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}},{path:`/:all(.*)`,name:`/[...all]`,component:()=>J(()=>import(`./_...all_-BUlXblH9.js`),[])},{path:`/audio`,name:`/audio`,component:()=>J(()=>import(`./audio-DwTx1Y8I.js`),[])},{path:`/devtools`,children:[{path:`background-remove`,name:`/devtools/background-remove`,component:()=>J(()=>import(`./background-remove-CI-N-inF.js`),__vite__mapDeps([24,7,8,12,25]))},{path:`chat`,name:`/devtools/chat`,component:()=>J(()=>import(`./chat-Cm78FyKU.js`),__vite__mapDeps([26,11]))},{path:`image`,name:`/devtools/image`,component:()=>J(()=>import(`./image-D-LGEUbE.js`),__vite__mapDeps([27,28]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>J(()=>import(`./polaroid-Ce3gxIqN.js`),__vite__mapDeps([29,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>J(()=>import(`./vibrant-DyoV7uOq.js`),__vite__mapDeps([30,7,8,31,25]))}]},{path:`/queue`,name:`/queue`,component:()=>J(()=>import(`./queue-DEVr27WI.js`),__vite__mapDeps([32,15]))},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>J(()=>import(`./settings-CGigMZFM.js`),__vite__mapDeps([33,21,34,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>J(()=>import(`./airi-card-bXvDq1QK.js`),__vite__mapDeps([35,21,36,37,7,8,38,10,9,11,12,13,14,15,16,17,18,39,40,41,42,4,5,6,19,25])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>J(()=>import(`./CardCreate-s77DpRUP.js`),__vite__mapDeps([43,36]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>J(()=>import(`./CardCreationDialog-DbUZj3zx.js`),__vite__mapDeps([44,37,7,8,38,10,9,11,12,13,14,15,16,17,18,39,4,5,6,19]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>J(()=>import(`./CardDetailDialog-BUqu9VuB.js`),__vite__mapDeps([45,40,41,38,7,8,17,18,10,9,11,12,13,14,15,16,4,5,6,19]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>J(()=>import(`./CardListItem-Cwi08F8K.js`),__vite__mapDeps([46,42,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>J(()=>import(`./DeleteCardDialog-WqtMeAWd.js`),__vite__mapDeps([47,41,38,7,8,17,18]))}]}]},{path:`appearance`,children:[{path:``,name:`/settings/appearance/`,component:()=>J(()=>import(`./appearance-mPITRDqf.js`),__vite__mapDeps([48,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/appearance/color-scheme`,component:()=>J(()=>import(`./color-scheme-DHCqV_sd.js`),__vite__mapDeps([49,21,50,38,7,8,4,5,6,9,10,11,12,13,14,15,16,17,18,19,51])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/appearance/developer`,component:()=>J(()=>import(`./developer-C6qOrZzG.js`),__vite__mapDeps([52,21,53,9,10,11,12,13,14,15,16])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/appearance/general`,component:()=>J(()=>import(`./general-D5ryEaZ2.js`),__vite__mapDeps([54,21,53,9,10,11,12,13,14,15,16])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>J(()=>import(`./memory-0dYqsS07.js`),__vite__mapDeps([55,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>J(()=>import(`./models-TOMYe-dc.js`),__vite__mapDeps([56,21,34,50,38,7,8,57,4,5,6,9,10,11,12,13,14,15,16,17,18,19,31,58])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>J(()=>import(`./modules-Brjd2BIv.js`),__vite__mapDeps([59,21,34,57,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>J(()=>import(`./consciousness-BhjlN9bE.js`),__vite__mapDeps([60,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>J(()=>import(`./memory-long-term-C61DZWTO.js`),__vite__mapDeps([61,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>J(()=>import(`./memory-short-term-CzuHUda_.js`),__vite__mapDeps([62,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>J(()=>import(`./speech-DzfbHcH_.js`),__vite__mapDeps([63,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,22,64])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>J(()=>import(`./providers-C5vrVlHa.js`),__vite__mapDeps([65,21,34,57,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`alibaba-cloud-model-studio`,name:`/settings/providers/alibaba-cloud-model-studio`,component:()=>J(()=>import(`./alibaba-cloud-model-studio-Di5kaCjv.js`),__vite__mapDeps([66,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`anthropic`,name:`/settings/providers/anthropic`,component:()=>J(()=>import(`./anthropic-DUmlJu_t.js`),__vite__mapDeps([67,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/cloudflare-workers-ai`,component:()=>J(()=>import(`./cloudflare-workers-ai-CUVYqqAF.js`),__vite__mapDeps([68,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`deepseek`,name:`/settings/providers/deepseek`,component:()=>J(()=>import(`./deepseek-zvlAqj6K.js`),__vite__mapDeps([69,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/elevenlabs`,component:()=>J(()=>import(`./elevenlabs-BU89BpOX.js`),__vite__mapDeps([70,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`featherless-ai`,name:`/settings/providers/featherless-ai`,component:()=>J(()=>import(`./featherless-ai-CHBNNQNM.js`),__vite__mapDeps([71,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`fireworks-ai`,name:`/settings/providers/fireworks-ai`,component:()=>J(()=>import(`./fireworks-ai-BeQmtYw-.js`),__vite__mapDeps([72,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`google-generative-ai`,name:`/settings/providers/google-generative-ai`,component:()=>J(()=>import(`./google-generative-ai-vTI86k1V.js`),__vite__mapDeps([73,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/microsoft-speech`,component:()=>J(()=>import(`./microsoft-speech-DsX1wfDy.js`),__vite__mapDeps([74,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`mistral-ai`,name:`/settings/providers/mistral-ai`,component:()=>J(()=>import(`./mistral-ai-DsX_I4X6.js`),__vite__mapDeps([75,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`moonshot-ai`,name:`/settings/providers/moonshot-ai`,component:()=>J(()=>import(`./moonshot-ai-BL1GQpdJ.js`),__vite__mapDeps([76,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`novita-ai`,name:`/settings/providers/novita-ai`,component:()=>J(()=>import(`./novita-ai-hF2aUTGC.js`),__vite__mapDeps([77,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/ollama`,component:()=>J(()=>import(`./ollama-AxPkEHcT.js`),__vite__mapDeps([78,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai`,name:`/settings/providers/openai`,component:()=>J(()=>import(`./openai-CtCB0lo5.js`),__vite__mapDeps([79,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/openai-audio-speech`,component:()=>J(()=>import(`./openai-audio-speech-DLCLQ0xM.js`),__vite__mapDeps([80,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/openai-audio-transcription`,component:()=>J(()=>import(`./openai-audio-transcription-BO8z1O_F.js`),__vite__mapDeps([81,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openrouter-ai`,name:`/settings/providers/openrouter-ai`,component:()=>J(()=>import(`./openrouter-ai-Cf4Rx59R.js`),__vite__mapDeps([82,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-api`,name:`/settings/providers/player2-api`,component:()=>J(()=>import(`./player2-api-D6m6cKGN.js`),__vite__mapDeps([83,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`together-ai`,name:`/settings/providers/together-ai`,component:()=>J(()=>import(`./together-ai-BvvRfg0N.js`),__vite__mapDeps([84,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/volcengine`,component:()=>J(()=>import(`./volcengine-QjDAu2Dw.js`),__vite__mapDeps([85,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`xai`,name:`/settings/providers/xai`,component:()=>J(()=>import(`./xai-BTOkQ787.js`),__vite__mapDeps([86,21,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>J(()=>import(`./scene-Lh08I5GV.js`),__vite__mapDeps([87,21,34,57,9,10,11,12,13,14,15,16])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]}]},{path:`/test`,children:[{path:`filter-message`,name:`/test/filter-message`,component:()=>J(()=>import(`./filter-message-BjGEk5iK.js`),__vite__mapDeps([88,7,8,22,64]))},{path:`queues`,children:[{path:`delays`,name:`/test/queues/delays`,component:()=>J(()=>import(`./delays-Bn4Zuwfk.js`),__vite__mapDeps([89,7,8,9,15,16,22,64]))},{path:`emotions`,name:`/test/queues/emotions`,component:()=>J(()=>import(`./emotions-ctaIpmZy.js`),__vite__mapDeps([90,7,8,15,16,22,64]))},{path:`messages`,name:`/test/queues/messages`,component:()=>J(()=>import(`./messages-DDZstpir.js`),__vite__mapDeps([91,7,8,15,16,22,64]))}]}]}],QH=(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 $H=QH;const eU={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 tU=eU;const nU=e=>$H(tU[e.toLowerCase()],6);var rU=nU;const iU=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,aU=e=>{let t;return(t=e.match(iU))?$H(parseInt(t[1],16),t[1].length):void 0};var oU=aU;const sU=`([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)`,cU=`(?:${sU}|none)`,lU=`${sU}%`,uU=`(?:${sU}%|none)`,dU=`(?:${sU}%|${sU})`,fU=`(?:${sU}%|${sU}|none)`,pU=`(?:${sU}(deg|grad|rad|turn)|${sU})`,mU=`(?:${sU}(deg|grad|rad|turn)|${sU}|none)`,hU=`\\s*,\\s*`,gU=RegExp(`^`+fU+`$`),_U=RegExp(`^rgba?\\(\\s*${sU}${hU}${sU}${hU}${sU}\\s*(?:,\\s*${dU}\\s*)?\\)$`),vU=RegExp(`^rgba?\\(\\s*${lU}${hU}${lU}${hU}${lU}\\s*(?:,\\s*${dU}\\s*)?\\)$`),yU=e=>{let t={mode:`rgb`},n;if(n=e.match(_U))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(vU))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 bU=yU;const xU=(e,t)=>e===void 0?void 0:typeof e==`object`?e.mode===void 0?t?{...e,mode:t}:void 0:e:qU(e);var SU=xU;const CU=(e=`rgb`)=>t=>(t=SU(t,e))===void 0?void 0:t.mode===e?t:TU[t.mode][e]?TU[t.mode][e](t):e===`rgb`?TU[t.mode].rgb(t):TU.rgb[e](TU[t.mode].rgb(t));var wU=CU;const TU={},EU={},DU=[],OU={},kU=e=>e,AU=e=>(TU[e.mode]={...TU[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{TU[t]||(TU[t]={}),TU[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=kU)}),EU[e.mode]=e,(e.parse||[]).forEach(t=>{MU(t,e.mode)}),wU(e.mode)),jU=e=>EU[e],MU=(e,t)=>{if(typeof e==`string`){if(!t)throw Error(`'mode' required when 'parser' is a string`);OU[e]=t}else typeof e==`function`&&DU.indexOf(e)<0&&DU.push(e)},NU=/[^\x00-\x7F]|[a-zA-Z_]/,PU=/[^\x00-\x7F]|[-\w]/,Y={Function:`function`,Ident:`ident`,Number:`number`,Percentage:`percentage`,ParenClose:`)`,None:`none`,Hue:`hue`,Alpha:`alpha`};let X=0;function FU(e){let t=e[X],n=e[X+1];return t===`-`||t===`+`?/\d/.test(n)||n===`.`&&/\d/.test(e[X+2]):t===`.`?/\d/.test(n):/\d/.test(t)}function IU(e){if(X>=e.length)return!1;let t=e[X];if(NU.test(t))return!0;if(t===`-`){if(e.length-X<2)return!1;let t=e[X+1];return!!(t===`-`||NU.test(t))}return!1}const LU={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function RU(e){let t=``;if((e[X]===`-`||e[X]===`+`)&&(t+=e[X++]),t+=zU(e),e[X]===`.`&&/\d/.test(e[X+1])&&(t+=e[X++]+zU(e)),(e[X]===`e`||e[X]===`E`)&&((e[X+1]===`-`||e[X+1]===`+`)&&/\d/.test(e[X+2])?t+=e[X++]+e[X++]+zU(e):/\d/.test(e[X+1])&&(t+=e[X++]+zU(e))),IU(e)){let n=BU(e);return n===`deg`||n===`rad`||n===`turn`||n===`grad`?{type:Y.Hue,value:t*LU[n]}:void 0}return e[X]===`%`?(X++,{type:Y.Percentage,value:+t}):{type:Y.Number,value:+t}}function zU(e){let t=``;for(;/\d/.test(e[X]);)t+=e[X++];return t}function BU(e){let t=``;for(;X4)){if(n.length===4){if(n[3].type!==Y.Alpha)return;n[3]=n[3].value}return n.length===3&&n.push({type:Y.None,value:void 0}),n.every(e=>e.type!==Y.Alpha)?n:void 0}}function GU(e,t){e._i=0;let n=e[e._i++];if(!n||n.type!==Y.Function)return;let r=WU(e,t);if(r)return r.unshift(n.value),r}const KU=e=>{if(typeof e!=`string`)return;let t=HU(e),n=t?GU(t,!0):void 0,r,i=0,a=DU.length;for(;ie===`transparent`?{mode:`rgb`,r:0,g:0,b:0,alpha:0}:void 0;var ZU=XU;const QU=(e,t,n)=>e+n*(t-e),$U=e=>{let t=[];for(let n=0;nt=>{let n=$U(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)}},Z=eW(QU),tW=e=>{let t=!1,n=e.map(e=>e===void 0?1:(t=!0,e));return t?n:e},nW={mode:`rgb`,channels:[`r`,`g`,`b`,`alpha`],parse:[YU,oU,bU,rU,ZU,`srgb`],serialize:`srgb`,interpolate:{r:Z,g:Z,b:Z,alpha:{use:Z,fixup:tW}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}};var rW=nW;const iW=(e=0)=>Math.abs(e)**(563/256)*Math.sign(e),aW=e=>{let t=iW(e.r),n=iW(e.g),r=iW(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 oW=aW;const sW=e=>Math.abs(e)**(256/563)*Math.sign(e),cW=({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:sW(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*n),g:sW(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*n),b:sW(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*n)};return r!==void 0&&(i.alpha=r),i};var lW=cW;const uW=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*((t+.055)/1.055)**2.4},dW=({r:e,g:t,b:n,alpha:r})=>{let i={mode:`lrgb`,r:uW(e),g:uW(t),b:uW(n)};return r!==void 0&&(i.alpha=r),i};var fW=dW;const pW=e=>{let{r:t,g:n,b:r,alpha:i}=fW(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 mW=pW;const hW=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*t**(1/2.4)-.055):e*12.92},gW=({r:e,g:t,b:n,alpha:r},i=`rgb`)=>{let a={mode:i,r:hW(e),g:hW(t),b:hW(n)};return r!==void 0&&(a.alpha=r),a};var _W=gW;const vW=({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=_W({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 yW=vW;const bW={...rW,mode:`a98`,parse:[`a98-rgb`],serialize:`a98-rgb`,fromMode:{rgb:e=>lW(mW(e)),xyz65:lW},toMode:{rgb:e=>yW(oW(e)),xyz65:oW}};var xW=bW;const SW=e=>(e%=360)<0?e+360:e;var CW=SW;const wW=(e,t)=>e.map((n,r,i)=>{if(n===void 0)return n;let a=CW(n);return r===0||e[r-1]===void 0?a:t(a-CW(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),[]),TW=e=>wW(e,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),EW=[-.14861,1.78277,-.29227,-.90649,1.97294,0],DW=Math.PI/180,OW=180/Math.PI;let kW=EW[3]*EW[4],AW=EW[1]*EW[4],jW=EW[1]*EW[2]-EW[0]*EW[3];const MW=({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=(jW*n+e*kW-t*AW)/(jW+kW-AW),a=n-i,o=(EW[4]*(t-i)-EW[2]*a)/EW[3],s={mode:`cubehelix`,l:i,s:i===0||i===1?void 0:Math.sqrt(a*a+o*o)/(EW[4]*i*(1-i))};return s.s&&(s.h=Math.atan2(o,a)*OW-120),r!==void 0&&(s.alpha=r),s};var NW=MW;const PW=({h:e,s:t,l:n,alpha:r})=>{let i={mode:`rgb`};e=(e===void 0?0:e+120)*DW,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*(EW[0]*o+EW[1]*s),i.g=n+a*(EW[2]*o+EW[3]*s),i.b=n+a*(EW[4]*o+EW[5]*s),r!==void 0&&(i.alpha=r),i};var FW=PW;const IW=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let n=CW(e.h),r=CW(t.h),i=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*i},LW=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let n=CW(e.h),r=CW(t.h);return Math.abs(r-n)>180?n-(r-360*Math.sign(r-n)):r-n},RW=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let n=CW(e.h),r=CW(t.h),i=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*i},zW=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},BW={mode:`cubehelix`,channels:[`h`,`s`,`l`,`alpha`],parse:[`--cubehelix`],serialize:`--cubehelix`,ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:NW},toMode:{rgb:FW},interpolate:{h:{use:Z,fixup:TW},s:Z,l:Z,alpha:{use:Z,fixup:tW}},difference:{h:IW},average:{h:zW}};var VW=BW;const HW=({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=CW(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(o.alpha=r),o};var UW=HW;const WW=({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 GW=WW;const KW=29**3/3**3,qW=6**3/29**3,JW={X:.3457/.3585,Y:1,Z:.2958/.3585},YW={X:.3127/.329,Y:1,Z:.3583/.329},XW=29**3/3**3,ZW=6**3/29**3;let QW=e=>e**3>qW?e**3:(116*e-16)/KW;const $W=({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:QW(a)*YW.X,y:QW(i)*YW.Y,z:QW(o)*YW.Z};return r!==void 0&&(s.alpha=r),s};var eG=$W;const tG=e=>yW(eG(e));var nG=tG;const rG=e=>e>qW?Math.cbrt(e):(KW*e+16)/116,iG=({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=rG(e/YW.X),a=rG(t/YW.Y),o=rG(n/YW.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 aG=iG;const oG=e=>{let t=aG(mW(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};var sG=oG;const cG=1,lG=1,uG=26/180*Math.PI,dG=Math.cos(uG),fG=Math.sin(uG),pG=100/Math.log(139/100),mG=({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*cG/pG)-1)/.0039},a=(Math.exp(.0435*t*lG*cG)-1)/.075,o=a*Math.cos(n/180*Math.PI-uG),s=a*Math.sin(n/180*Math.PI-uG);return i.a=o*dG-s/.83*fG,i.b=o*fG+s/.83*dG,r!==void 0&&(i.alpha=r),i};var hG=mG;const gG=({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*dG+n*fG,a=.83*(n*dG-t*fG),o=Math.sqrt(i*i+a*a),s={mode:`dlch`,l:pG/cG*Math.log(1+.0039*e),c:Math.log(1+.075*o)/(.0435*lG*cG)};return s.c&&(s.h=CW((Math.atan2(a,i)+uG)/Math.PI*180)),r!==void 0&&(s.alpha=r),s};var _G=gG;const vG=e=>hG(UW(e,`dlch`)),yG=e=>GW(_G(e),`dlab`),bG={mode:`dlab`,parse:[`--din99o-lab`],serialize:`--din99o-lab`,toMode:{lab65:vG,rgb:e=>nG(vG(e))},fromMode:{lab65:yG,rgb:e=>yG(sG(e))},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:Z,a:Z,b:Z,alpha:{use:Z,fixup:tW}}};var xG=bG;const SG={mode:`dlch`,parse:[`--din99o-lch`],serialize:`--din99o-lch`,toMode:{lab65:hG,dlab:e=>GW(e,`dlab`),rgb:e=>nG(hG(e))},fromMode:{lab65:_G,dlab:e=>UW(e,`dlch`),rgb:e=>_G(sG(e))},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:Z,c:Z,h:{use:Z,fixup:TW},alpha:{use:Z,fixup:tW}},difference:{h:RW},average:{h:zW}};var CG=SG;function wG({h:e,s:t,i:n,alpha:r}){e=CW(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 TG({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 jG=AG;const MG=RegExp(`^hsla?\\(\\s*${pU}${hU}${lU}${hU}${lU}\\s*(?:,\\s*${dU}\\s*)?\\)$`),NG=e=>{let t=e.match(MG);if(!t)return;let n={mode:`hsl`};return t[3]===void 0?t[1]!==void 0&&t[2]!==void 0&&(n.h=jG(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 PG=NG;function FG(e,t){if(!t||t[0]!==`hsl`&&t[0]!==`hsla`)return;let n={mode:`hsl`},[,r,i,a,o]=t;if(r.type!==Y.None){if(r.type===Y.Percentage)return;n.h=r.value}if(i.type!==Y.None){if(i.type===Y.Hue)return;n.s=i.value/100}if(a.type!==Y.None){if(a.type===Y.Hue)return;n.l=a.value/100}return o.type!==Y.None&&(n.alpha=Math.min(1,Math.max(0,o.type===Y.Number?o.value:o.value/100))),n}var IG=FG;const LG={mode:`hsl`,toMode:{rgb:OG},fromMode:{rgb:kG},channels:[`h`,`s`,`l`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[IG,PG],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:Z,fixup:TW},s:Z,l:Z,alpha:{use:Z,fixup:tW}},difference:{h:IW},average:{h:zW}};var RG=LG;function zG({h:e,s:t,v:n,alpha:r}){e=CW(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 BG({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 zG({h:e,s:n===1?1:1-t/(1-n),v:1-n,alpha:r})}function WG(e){let t=BG(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 GG(e,t){if(!t||t[0]!==`hwb`)return;let n={mode:`hwb`},[,r,i,a,o]=t;if(r.type!==Y.None){if(r.type===Y.Percentage)return;n.h=r.value}if(i.type!==Y.None){if(i.type===Y.Hue)return;n.w=i.value/100}if(a.type!==Y.None){if(a.type===Y.Hue)return;n.b=a.value/100}return o.type!==Y.None&&(n.alpha=Math.min(1,Math.max(0,o.type===Y.Number?o.value:o.value/100))),n}var KG=GG;const qG={mode:`hwb`,toMode:{rgb:UG},fromMode:{rgb:WG},channels:[`h`,`w`,`b`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[KG],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:Z,fixup:TW},w:Z,b:Z,alpha:{use:Z,fixup:tW}},difference:{h:LW},average:{h:zW}};var JG=qG;const YG=203,XG=.1593017578125,ZG=78.84375,QG=.8359375,$G=18.8515625,eK=18.6875;function tK(e){if(e<0)return 0;let t=e**(1/ZG);return 1e4*(Math.max(0,t-QG)/($G-eK*t))**(1/XG)}function nK(e){if(e<0)return 0;let t=(e/1e4)**XG;return((QG+$G*t)/(1+eK*t))**+ZG}const rK=e=>Math.max(e/YG,0),iK=({i:e,t,p:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=tK(e+.008609037037932761*t+.11102962500302593*n),a=tK(e-.00860903703793275*t-.11102962500302599*n),o=tK(e+.5600313357106791*t-.32062717498731885*n),s={mode:`xyz65`,x:rK(2.070152218389422*i-1.3263473389671556*a+.2066510476294051*o),y:rK(.3647385209748074*i+.680566024947227*a-.0453045459220346*o),z:rK(-.049747207535812*i-.0492609666966138*a+1.1880659249923042*o)};return r!==void 0&&(s.alpha=r),s};var aK=iK;const oK=(e=0)=>Math.max(e*YG,0),sK=({x:e,y:t,z:n,alpha:r})=>{let i=oK(e),a=oK(t),o=oK(n),s=nK(.3592832590121217*i+.6976051147779502*a-.0358915932320289*o),c=nK(-.1920808463704995*i+1.1004767970374323*a+.0753748658519118*o),l=nK(.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 cK=sK;const lK={mode:`itp`,channels:[`i`,`t`,`p`,`alpha`],parse:[`--ictcp`],serialize:`--ictcp`,toMode:{xyz65:aK,rgb:e=>yW(aK(e))},fromMode:{xyz65:cK,rgb:e=>cK(mW(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:Z,t:Z,p:Z,alpha:{use:Z,fixup:tW}}};var uK=lK;const dK=134.03437499999998,fK=16295499532821565e-27,pK=e=>{if(e<0)return 0;let t=(e/1e4)**XG;return((QG+$G*t)/(1+eK*t))**+dK},mK=(e=0)=>Math.max(e*203,0),hK=({x:e,y:t,z:n,alpha:r})=>{e=mK(e),t=mK(t),n=mK(n);let i=1.15*e-.15*n,a=.66*t+.34*e,o=pK(.41478972*i+.579999*a+.014648*n),s=pK(-.20151*i+1.120649*a+.0531008*n),c=pK(-.0166008*i+.2648*a+.6684799*n),l=(o+s)/2,u={mode:`jab`,j:.44*l/(1-.56*l)-fK,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 gK=hK;const _K=134.03437499999998,vK=16295499532821565e-27,yK=e=>{if(e<0)return 0;let t=e**(1/_K);return 1e4*((QG-t)/(eK*t-$G))**(1/XG)},bK=e=>e/203,xK=({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+vK)/(.44+.56*(e+vK)),a=yK(i+.13860504*t+.058047316*n),o=yK(i-.13860504*t-.058047316*n),s=yK(i-.096019242*t-.8118919*n),c={mode:`xyz65`,x:bK(1.661373024652174*a-.914523081304348*o+.23136208173913045*s),y:bK(-.3250758611844533*a+1.571847026732543*o-.21825383453227928*s),z:bK(-.090982811*a-.31272829*o+1.5227666*s)};return r!==void 0&&(c.alpha=r),c};var SK=xK;const CK=e=>{let t=gK(mW(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};var wK=CK;const TK=e=>yW(SK(e));var EK=TK;const DK={mode:`jab`,channels:[`j`,`a`,`b`,`alpha`],parse:[`--jzazbz`],serialize:`--jzazbz`,fromMode:{rgb:wK,xyz65:gK},toMode:{rgb:EK,xyz65:SK},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:Z,a:Z,b:Z,alpha:{use:Z,fixup:tW}}};var OK=DK;const kK=({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=CW(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(a.alpha=r),a};var AK=kK;const jK=({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 MK=jK;const NK={mode:`jch`,parse:[`--jzczhz`],serialize:`--jzczhz`,toMode:{jab:MK,rgb:e=>EK(MK(e))},fromMode:{rgb:e=>AK(wK(e)),jab:AK},channels:[`j`,`c`,`h`,`alpha`],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:Z,fixup:TW},c:Z,j:Z,alpha:{use:Z,fixup:tW}},difference:{h:RW},average:{h:zW}};var PK=NK;const FK=29**3/3**3,IK=6**3/29**3;let LK=e=>e**3>IK?e**3:(116*e-16)/FK;const RK=({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:LK(a)*JW.X,y:LK(i)*JW.Y,z:LK(o)*JW.Z};return r!==void 0&&(s.alpha=r),s};var zK=RK;const BK=({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=_W({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 VK=BK;const HK=e=>VK(zK(e));var UK=HK;const WK=e=>{let{r:t,g:n,b:r,alpha:i}=fW(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 GK=WK;const KK=e=>e>IK?Math.cbrt(e):(FK*e+16)/116,qK=({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=KK(e/JW.X),a=KK(t/JW.Y),o=KK(n/JW.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 JK=qK;const YK=e=>{let t=JK(GK(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};var XK=YK;function ZK(e,t){if(!t||t[0]!==`lab`)return;let n={mode:`lab`},[,r,i,a,o]=t;if(!(r.type===Y.Hue||i.type===Y.Hue||a.type===Y.Hue))return r.type!==Y.None&&(n.l=Math.min(Math.max(0,r.value),100)),i.type!==Y.None&&(n.a=i.type===Y.Number?i.value:i.value*125/100),a.type!==Y.None&&(n.b=a.type===Y.Number?a.value:a.value*125/100),o.type!==Y.None&&(n.alpha=Math.min(1,Math.max(0,o.type===Y.Number?o.value:o.value/100))),n}var QK=ZK;const $K={mode:`lab`,toMode:{xyz50:zK,rgb:UK},fromMode:{xyz50:JK,rgb:XK},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[QK],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:Z,a:Z,b:Z,alpha:{use:Z,fixup:tW}}};var eq=$K;const tq={...eq,mode:`lab65`,parse:[`--lab-d65`],serialize:`--lab-d65`,toMode:{xyz65:eG,rgb:nG},fromMode:{xyz65:aG,rgb:sG},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};var nq=tq;function rq(e,t){if(!t||t[0]!==`lch`)return;let n={mode:`lch`},[,r,i,a,o]=t;if(r.type!==Y.None){if(r.type===Y.Hue)return;n.l=Math.min(Math.max(0,r.value),100)}if(i.type!==Y.None&&(n.c=Math.max(0,i.type===Y.Number?i.value:i.value*150/100)),a.type!==Y.None){if(a.type===Y.Percentage)return;n.h=a.value}return o.type!==Y.None&&(n.alpha=Math.min(1,Math.max(0,o.type===Y.Number?o.value:o.value/100))),n}var iq=rq;const aq={mode:`lch`,toMode:{lab:GW,rgb:e=>UK(GW(e))},fromMode:{rgb:e=>UW(XK(e)),lab:UW},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[iq],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:Z,fixup:TW},c:Z,l:Z,alpha:{use:Z,fixup:tW}},difference:{h:RW},average:{h:zW}};var oq=aq;const sq={...oq,mode:`lch65`,parse:[`--lch-d65`],serialize:`--lch-d65`,toMode:{lab65:e=>GW(e,`lab65`),rgb:e=>nG(GW(e,`lab65`))},fromMode:{rgb:e=>UW(sG(e),`lch65`),lab65:e=>UW(e,`lch65`)},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}};var cq=sq;const lq=({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=CW(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(a.alpha=r),a};var uq=lq;const dq=({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 fq=dq;const pq=(e,t,n)=>4*e/(e+15*t+3*n),mq=(e,t,n)=>9*t/(e+15*t+3*n),hq=pq(JW.X,JW.Y,JW.Z),gq=mq(JW.X,JW.Y,JW.Z),_q=e=>e<=IK?FK*e:116*Math.cbrt(e)-16,vq=({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=_q(t/JW.Y),a=pq(e,t,n),o=mq(e,t,n);!isFinite(a)||!isFinite(o)?i=a=o=0:(a=13*i*(a-hq),o=13*i*(o-gq));let s={mode:`luv`,l:i,u:a,v:o};return r!==void 0&&(s.alpha=r),s};var yq=vq;const bq=(e,t,n)=>4*e/(e+15*t+3*n),xq=(e,t,n)=>9*t/(e+15*t+3*n),Sq=bq(JW.X,JW.Y,JW.Z),Cq=xq(JW.X,JW.Y,JW.Z),wq=({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)+Sq,a=n/(13*e)+Cq,o=JW.Y*(e<=8?e/FK:((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 Tq=wq;const Eq=e=>uq(yq(GK(e))),Dq=e=>VK(Tq(fq(e))),Oq={mode:`lchuv`,toMode:{luv:fq,rgb:Dq},fromMode:{rgb:Eq,luv:uq},channels:[`l`,`c`,`h`,`alpha`],parse:[`--lchuv`],serialize:`--lchuv`,ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:Z,fixup:TW},c:Z,l:Z,alpha:{use:Z,fixup:tW}},difference:{h:RW},average:{h:zW}};var kq=Oq;const Aq={...rW,mode:`lrgb`,toMode:{rgb:_W},fromMode:{rgb:fW},parse:[`srgb-linear`],serialize:`srgb-linear`};var jq=Aq;const Mq={mode:`luv`,toMode:{xyz50:Tq,rgb:e=>VK(Tq(e))},fromMode:{xyz50:yq,rgb:e=>yq(GK(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:Z,u:Z,v:Z,alpha:{use:Z,fixup:tW}}};var Nq=Mq;const Pq=({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 Fq=Pq;const Iq=e=>{let t=Fq(fW(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};var Lq=Iq;const Rq=({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 zq=Rq;const Bq=e=>_W(zq(e));var Vq=Bq;function Hq(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 Uq(e){let t=.206,n=.03,r=(1+t)/(1+n);return(e*e+t*e)/(r*(e+n))}function Wq(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 Gq(e,t){let n=Wq(e,t),r=zq({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 Kq(e,t,n,r,i,a=null){a||=Gq(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 qq(e,t,n=null){n||=Gq(e,t);let r=n[0],i=n[1];return[i/r,i/(1-r)]}function Jq(e,t,n){let r=Gq(t,n),i=Kq(t,n,e,1,e,r),a=qq(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 Yq(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:Hq(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]=Jq(t,n/a,r/a),l;if(aYq(Lq(e))},toMode:{oklab:Xq,rgb:e=>Vq(Xq(e))}};var Qq=Zq;function $q(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]=qq(a,o),l=.5,u=1-l/s,d=c/(i+t*c),f=d*t,p=d*i,m=Uq(f),h=p*m/f,g=zq({l:m,a:a*h,b:o*h}),_=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));t/=_,i=i/_*Hq(t)/t,t=Hq(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=CW(Math.atan2(r,n)*180/Math.PI)),e.alpha!==void 0&&(v.alpha=e.alpha),v}function eJ(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]=qq(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=Uq(d),m=f*p/d,h=zq({l:p,a:a*m,b:o*m}),g=Math.cbrt(1/Math.max(h.r,h.g,h.b,0)),_=Uq(i*d),v=f*_/d;return t.l=_*g,t.a=v*a*g,t.b=v*o*g,t}const tJ={...HG,mode:`okhsv`,channels:[`h`,`s`,`v`,`alpha`],parse:[`--okhsv`],serialize:`--okhsv`,fromMode:{oklab:$q,rgb:e=>$q(Lq(e))},toMode:{oklab:eJ,rgb:e=>Vq(eJ(e))}};var nJ=tJ;function rJ(e,t){if(!t||t[0]!==`oklab`)return;let n={mode:`oklab`},[,r,i,a,o]=t;if(!(r.type===Y.Hue||i.type===Y.Hue||a.type===Y.Hue))return r.type!==Y.None&&(n.l=Math.min(Math.max(0,r.type===Y.Number?r.value:r.value/100),1)),i.type!==Y.None&&(n.a=i.type===Y.Number?i.value:i.value*.4/100),a.type!==Y.None&&(n.b=a.type===Y.Number?a.value:a.value*.4/100),o.type!==Y.None&&(n.alpha=Math.min(1,Math.max(0,o.type===Y.Number?o.value:o.value/100))),n}var iJ=rJ;const aJ={...eq,mode:`oklab`,toMode:{lrgb:zq,rgb:Vq},fromMode:{lrgb:Fq,rgb:Lq},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[iJ],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 oJ=aJ;function sJ(e,t){if(!t||t[0]!==`oklch`)return;let n={mode:`oklch`},[,r,i,a,o]=t;if(r.type!==Y.None){if(r.type===Y.Hue)return;n.l=Math.min(Math.max(0,r.type===Y.Number?r.value:r.value/100),1)}if(i.type!==Y.None&&(n.c=Math.max(0,i.type===Y.Number?i.value:i.value*.4/100)),a.type!==Y.None){if(a.type===Y.Percentage)return;n.h=a.value}return o.type!==Y.None&&(n.alpha=Math.min(1,Math.max(0,o.type===Y.Number?o.value:o.value/100))),n}var cJ=sJ;const lJ={...oq,mode:`oklch`,toMode:{oklab:e=>GW(e,`oklab`),rgb:e=>Vq(GW(e,`oklab`))},fromMode:{rgb:e=>UW(Lq(e),`oklch`),oklab:e=>UW(e,`oklch`)},parse:[cJ],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 uJ=lJ;const dJ=e=>{let{r:t,g:n,b:r,alpha:i}=fW(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 fJ=dJ;const pJ=({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=_W({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 mJ=pJ;const hJ={...rW,mode:`p3`,parse:[`display-p3`],serialize:`display-p3`,fromMode:{rgb:e=>mJ(mW(e)),xyz65:mJ},toMode:{rgb:e=>yW(fJ(e)),xyz65:fJ}};var gJ=hJ;const _J=e=>{let t=Math.abs(e);return t>=1/512?Math.sign(e)*t**(1/1.8):16*e},vJ=({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:_J(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*n),g:_J(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*n),b:_J(e*0+t*0+1.2119675456389452*n)};return r!==void 0&&(i.alpha=r),i};var yJ=vJ;const bJ=(e=0)=>{let t=Math.abs(e);return t>=16/512?Math.sign(e)*t**1.8:e/16},xJ=e=>{let t=bJ(e.r),n=bJ(e.g),r=bJ(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 SJ=xJ;const CJ={...rW,mode:`prophoto`,parse:[`prophoto-rgb`],serialize:`prophoto-rgb`,fromMode:{xyz50:yJ,rgb:e=>yJ(GK(e))},toMode:{xyz50:SJ,rgb:e=>VK(SJ(e))}};var wJ=CJ;const TJ=1.09929682680944,EJ=.018053968510807,DJ=e=>{let t=Math.abs(e);return t>EJ?(Math.sign(e)||1)*(TJ*t**.45-(TJ-1)):4.5*e},OJ=({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:DJ(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*n),g:DJ(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*n),b:DJ(e*.0176398574453108-t*.0427706132578085+.9421031212354739*n)};return r!==void 0&&(i.alpha=r),i};var kJ=OJ;const AJ=1.09929682680944,jJ=.018053968510807,MJ=(e=0)=>{let t=Math.abs(e);return t{let t=MJ(e.r),n=MJ(e.g),r=MJ(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 PJ=NJ;const FJ={...rW,mode:`rec2020`,fromMode:{xyz65:kJ,rgb:e=>kJ(mW(e))},toMode:{xyz65:PJ,rgb:e=>yW(PJ(e))},parse:[`rec2020`],serialize:`rec2020`};var IJ=FJ;const LJ=.0037930732552754493,RJ=Math.cbrt(LJ),zJ=e=>Math.cbrt(e)-RJ,BJ=e=>{let{r:t,g:n,b:r,alpha:i}=fW(e),a=zJ(.3*t+.622*n+.078*r+LJ),o=zJ(.23*t+.692*n+.078*r+LJ),s=zJ(.2434226892454782*t+.2047674442449682*n+.5518098665095535*r+LJ),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 VJ=BJ;const HJ=e=>(e+RJ)**3,UJ=({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=HJ(e+t)-LJ,a=HJ(t-e)-LJ,o=HJ(n+t)-LJ,s=_W({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 WJ=UJ;const GJ={mode:`xyb`,channels:[`x`,`y`,`b`,`alpha`],parse:[`--xyb`],serialize:`--xyb`,toMode:{rgb:WJ},fromMode:{rgb:VJ},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:Z,y:Z,b:Z,alpha:{use:Z,fixup:tW}}};var KJ=GJ;const qJ={mode:`xyz50`,parse:[`xyz-d50`],serialize:`xyz-d50`,toMode:{rgb:VK,lab:JK},fromMode:{rgb:GK,lab:zK},channels:[`x`,`y`,`z`,`alpha`],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:Z,y:Z,z:Z,alpha:{use:Z,fixup:tW}}};var JJ=qJ;const YJ=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 XJ=YJ;const ZJ=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 QJ=ZJ;const $J={mode:`xyz65`,toMode:{rgb:yW,xyz50:XJ},fromMode:{rgb:mW,xyz50:QJ},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:Z,y:Z,z:Z,alpha:{use:Z,fixup:tW}}};var eY=$J;const tY=({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 nY=tY;const rY=({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 iY=rY;const aY={mode:`yiq`,toMode:{rgb:iY},fromMode:{rgb:nY},channels:[`y`,`i`,`q`,`alpha`],parse:[`--yiq`],serialize:`--yiq`,ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:Z,i:Z,q:Z,alpha:{use:Z,fixup:tW}}};var oY=aY;const sY=(e,t)=>Math.round(e*(t=10**t))/t,cY=(e=4)=>t=>typeof t==`number`?sY(t,e):t;var lY=cY;let uY=lY(2);const dY=e=>Math.max(0,Math.min(1,e||0)),fY=e=>Math.round(dY(e)*255),pY=wU(`rgb`),mY=wU(`hsl`),hY=e=>{if(e===void 0)return;let t=fY(e.r),n=fY(e.g),r=fY(e.b);return`#`+(1<<24|t<<16|n<<8|r).toString(16).slice(1)},gY=e=>hY(pY(e)),_Y=AU(xW),vY=AU(VW),yY=AU(xG),bY=AU(CG),xY=AU(DG),SY=AU(RG),CY=AU(HG),wY=AU(JG),TY=AU(uK),EY=AU(OK),DY=AU(PK),OY=AU(eq),kY=AU(nq),AY=AU(oq),jY=AU(cq),MY=AU(kq),NY=AU(jq),PY=AU(Nq),FY=AU(Qq),IY=AU(nJ),LY=AU(oJ),RY=AU(uJ),zY=AU(gJ),BY=AU(wJ),VY=AU(IJ),HY=AU(rW),UY=AU(KJ),WY=AU(JJ),GY=AU(eY),KY=AU(oY),qY=220.44,JY=wU(`oklch`),YY=e=>{var t;return e?(t=JY(e))?.h:qY},XY=VB(`settings`,()=>{let e=R(),t=iF(`settings/language`,`en-US`),n=iF(`settings/stage/view/model-renderer`,`2d`),r=iF(`settings/audio/input`,`false`),i=V(()=>{var t;return(t=e.value)?.deviceId}),{audioInputs:a,ensurePermissions:o}=YP({constraints:{audio:!0}}),s=R(),c=R(`/assets/live2d/models/hiyori_pro_zh.zip`),l=R(`url`),u=R(!1),d=iF(`settings/live2d/position`,{x:0,y:0}),f=R({group:`Idle`,index:0}),p=R([]),m=iF(`settings/live2d/motion-map`,{}),h=iF(`settings/disable-transitions`,!0),g=iF(`settings/use-page-specific-transitions`,!0),_=iF(`settings/theme/colors/hue`,qY),v=iF(`settings/theme/colors/hue-dynamic`,!1);function y(e=qY){_.value=e,v.value=!1}function b(e){y(YY(e))}function x(e){if(v.value)return!1;let t=YY(e);if(!t)return!1;let n=Math.abs(t-_.value);return n<.01||n>359.99}return B(r,t=>{t===`false`&&(e.value=void 0),t===`true`&&o().then(()=>{e.value=a.value[0]})}),B(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,setThemeColorsHue:y,applyPrimaryColorFrom:b,isColorSelectedForPrimary:x}});var ZY=zr({__name:`ArrowTransition`,props:{stageTransition:{default:()=>({primaryColor:`#666`,secondaryColor:`#ccc`})}},setup(e){let t=e,n=V(()=>t.stageTransition),r=V(()=>n.value.primaryColor||`#666`),i=V(()=>n.value.secondaryColor||`#ccc`);return ei(()=>{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)=>(no(),so(`div`,{class:`stage-transition-3`,style:L({zIndex:n.value.zIndex||100})},null,4))}}),QY=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},$Y=QY(ZY,[[`__scopeId`,`data-v-df576df0`]]),eX=zr({__name:`BubbleWaveOutTransition`,props:{stageTransition:null},setup(e){let t=e,n=V(()=>{var e;return(e=t.stageTransition)?.colors||[`#eee`,`#ebcb8b`,`#c56370`,`#3f3b52`]});return ei(()=>{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 no(),so(`div`,{class:`circle-expansion-transition`,style:L({zIndex:(i=e.stageTransition)?.zIndex||100})},[(no(!0),so(Xa,null,_i(n.value,(e,t)=>(no(),so(`div`,{key:t}))),128))],4)}}}),tX=QY(eX,[[`__scopeId`,`data-v-0c29056c`]]),nX=zr({__name:`FantasyFallTransition`,props:{stageTransition:null},setup(e){let t=e,n=V(()=>{var e;return(e=t.stageTransition)?.direction||`up`}),r=V(()=>`fantasy-fall-${n.value}`);return ei(()=>{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 no(),so(`div`,{class:Se([`fantasy-fall-transition`,r.value]),style:L({zIndex:(i=e.stageTransition)?.zIndex??100})},null,6)}}}),rX=QY(nX,[[`__scopeId`,`data-v-e62bf496`]]),iX=zr({__name:`MultipleBlocksRevealTransition`,props:{stageTransition:null},setup(e){let t=e,n=V(()=>t.stageTransition),r=V(()=>{var e;return(e=n.value)?.primaryColor||`#666`}),i=V(()=>{var e;return(e=n.value)?.secondaryColor||`#ccc`});return ei(()=>{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 no(),so(`div`,{class:`stage-transition-4`,style:L({zIndex:(r=n.value)?.zIndex??100})},t[0]||=[bo(`
`,5)],4)}}}),aX=QY(iX,[[`__scopeId`,`data-v-6d1179fc`]]),oX=zr({__name:`SlideTransition`,props:{stageTransition:null},setup(e){let t=e,n=V(()=>t.stageTransition),r=V(()=>{var e;return(e=n.value)?.primaryColor||`#666`}),i=V(()=>{var e;return(e=n.value)?.secondaryColor||`#ccc`});return B([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)}),ei(()=>{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 no(),so(`div`,{class:`stage-transition-1`,style:L({zIndex:(r=n.value)?.zIndex??100})},null,4)}}}),sX=QY(oX,[[`__scopeId`,`data-v-bf1d1566`]]),cX=zr({__name:`SlopeSlideTransition`,props:{stageTransition:null},setup(e){let t=e,n=V(()=>t.stageTransition),r=V(()=>{var e;return(e=n.value)?.primaryColor??`#666`}),i=V(()=>{var e;return(e=n.value)?.secondaryColor??`#ccc`});return ei(()=>{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 no(),so(`div`,{class:`stage-transition-2`,style:L({zIndex:(r=n.value)?.zIndex??100})},null,4)}}}),lX=QY(cX,[[`__scopeId`,`data-v-8ff7120f`]]),uX=zr({__name:`RectanglesRotateTransition`,props:{stageTransition:null},setup(e){let t=e;return ei(()=>{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 no(),so(`div`,{class:`rectangle-rotate-transition`,style:L({zIndex:(r=e.stageTransition)?.zIndex??100})},n[0]||=[mo(`div`,{class:`rectangle rectangle-rotate-1`},[mo(`div`)],-1),mo(`div`,{class:`rectangle rectangle-rotate-2`},[mo(`div`)],-1),mo(`div`,{class:`rectangle rectangle-rotate-3`},[mo(`div`)],-1)],4)}}}),dX=QY(uX,[[`__scopeId`,`data-v-f4b1dc64`]]),fX=zr({__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=YH(),r=R(!1),i=R(),a=R(``),o=R(),s=z({slide:{component:sX,duration:2700},"slope-slide":{component:lX,duration:2700},arrow:{component:$Y,duration:2700},"multiple-blocks-reveal":{component:aX,duration:2800},"fantasy-fall":{component:rX,duration:2700},"rectangles-rotate":{component:dX,duration:2700},"bubble-wave-out":{component:tX,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)=>(no(),so(Xa,null,[vi(e.$slots,`default`),r.value?(no(),so(Xa,{key:0},[s.value[a.value]?(no(),co(pi(s.value[a.value].component),{key:0,"stage-transition":o.value},null,8,[`stage-transition`])):xo(``,!0)],64)):xo(``,!0)],64))}}),pX=fX; +/*! +* shared v11.1.5 +* (c) 2025 kazuya kawaguchi +* Released under the MIT License. +*/ +const mX=typeof window<`u`,hX=(e,t=!1)=>t?Symbol.for(e):Symbol(e),gX=(e,t,n)=>_X({l:e,k:t,s:n}),_X=e=>JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),vX=e=>typeof e==`number`&&isFinite(e),yX=e=>IX(e)===`[object Date]`,bX=e=>IX(e)===`[object RegExp]`,xX=e=>LX(e)&&Object.keys(e).length===0,SX=Object.assign,CX=Object.create,wX=(e=null)=>CX(e);let TX;const EX=()=>TX||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:wX();function DX(e){return e.replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}const OX=Object.prototype.hasOwnProperty;function kX(e,t){return OX.call(e,t)}const AX=Array.isArray,jX=e=>typeof e==`function`,Q=e=>typeof e==`string`,MX=e=>typeof e==`boolean`,NX=e=>typeof e==`object`&&!!e,PX=e=>NX(e)&&jX(e.then)&&jX(e.catch),FX=Object.prototype.toString,IX=e=>FX.call(e),LX=e=>IX(e)===`[object Object]`,RX=e=>e==null?``:AX(e)||LX(e)&&e.toString===FX?JSON.stringify(e,null,2):String(e);function zX(e,t=``){return e.reduce((e,n,r)=>r===0?e+n:e+t+n,``)}function BX(e,t){typeof console<`u`&&(console.warn(`[intlify] `+e),t&&console.warn(t.stack))}const VX=e=>!NX(e)||AX(e);function HX(e,t){if(VX(e)||VX(t))throw Error(`Invalid value`);let n=[{src:e,des:t}];for(;n.length;){let{src:e,des:t}=n.pop();Object.keys(e).forEach(r=>{r!==`__proto__`&&(NX(e[r])&&!NX(t[r])&&(t[r]=Array.isArray(e[r])?[]:wX()),VX(t[r])||VX(e[r])?t[r]=e[r]:n.push({src:e[r],des:t[r]}))})}}function UX(e,t,n){return{line:e,column:t,offset:n}}function WX(e,t,n){let r={start:e,end:t};return n!=null&&(r.source=n),r}const $={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},GX=17,KX={[$.EXPECTED_TOKEN]:`Expected token: '{0}'`,[$.INVALID_TOKEN_IN_PLACEHOLDER]:`Invalid token in placeholder: '{0}'`,[$.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:`Unterminated single quote in placeholder`,[$.UNKNOWN_ESCAPE_SEQUENCE]:`Unknown escape sequence: \\{0}`,[$.INVALID_UNICODE_ESCAPE_SEQUENCE]:`Invalid unicode escape sequence: {0}`,[$.UNBALANCED_CLOSING_BRACE]:`Unbalanced closing brace`,[$.UNTERMINATED_CLOSING_BRACE]:`Unterminated closing brace`,[$.EMPTY_PLACEHOLDER]:`Empty placeholder`,[$.NOT_ALLOW_NEST_PLACEHOLDER]:`Not allowed nest placeholder`,[$.INVALID_LINKED_FORMAT]:`Invalid linked format`,[$.MUST_HAVE_MESSAGES_IN_PLURAL]:`Plural must have messages`,[$.UNEXPECTED_EMPTY_LINKED_MODIFIER]:`Unexpected empty linked modifier`,[$.UNEXPECTED_EMPTY_LINKED_KEY]:`Unexpected empty linked key`,[$.UNEXPECTED_LEXICAL_ANALYSIS]:`Unexpected lexical analysis in token: '{0}'`,[$.UNHANDLED_CODEGEN_NODE_TYPE]:`unhandled codegen node type: '{0}'`,[$.UNHANDLED_MINIFIER_NODE_TYPE]:`unhandled mimifier node type: '{0}'`};function qX(e,t,n={}){let{domain:r,messages:i,args:a}=n,o=e,s=SyntaxError(String(o));return s.code=e,t&&(s.location=t),s.domain=r,s}function JX(e){throw e}const YX=` `,XX=`\r`,ZX=` +`,QX=`\u2028`,$X=`\u2029`;function eZ(e){let t=e,n=0,r=1,i=1,a=0,o=e=>t[e]===XX&&t[e+1]===ZX,s=e=>t[e]===ZX,c=e=>t[e]===$X,l=e=>t[e]===QX,u=e=>o(e)||s(e)||c(e)||l(e),d=()=>n,f=()=>r,p=()=>i,m=()=>a,h=e=>o(e)||c(e)||l(e)?ZX:t[e],g=()=>h(n),_=()=>h(n+a);function v(){return a=0,u(n)&&(r++,i=0),o(n)&&n++,n++,i++,t[n]}function y(){return o(n+a)&&a++,a++,t[n+a]}function b(){n=0,r=1,i=1,a=0}function x(e=0){a=e}function S(){let e=n+a;for(;e!==n;)v();a=0}return{index:d,line:f,column:p,peekOffset:m,charAt:h,currentChar:g,currentPeek:_,next:v,peek:y,reset:b,resetPeek:x,skipToPeek:S}}const tZ=void 0,nZ=`.`,rZ=`'`,iZ=`tokenizer`;function aZ(e,t={}){let n=t.location!==!1,r=eZ(e),i=()=>r.index(),a=()=>UX(r.line(),r.column(),r.index()),o=a(),s=i(),c={currentType:13,offset:s,startLoc:o,endLoc:o,lastType:13,lastOffset:s,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:``},l=()=>c,{onError:u}=t;function d(e,t,r,...i){let a=l();if(t.column+=r,t.offset+=r,u){let r=n?WX(a.startLoc,t):null,o=qX(e,r,{domain:iZ,args:i});u(o)}}function f(e,t,r){e.endLoc=a(),e.currentType=t;let i={type:t};return n&&(i.loc=WX(e.startLoc,e.endLoc)),r!=null&&(i.value=r),i}let p=e=>f(e,13);function m(e,t){return e.currentChar()===t?(e.next(),t):(d($.EXPECTED_TOKEN,a(),0,t),``)}function h(e){let t=``;for(;e.currentPeek()===YX||e.currentPeek()===ZX;)t+=e.currentPeek(),e.peek();return t}function g(e){let t=h(e);return e.skipToPeek(),t}function _(e){if(e===tZ)return!1;let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t===95}function v(e){if(e===tZ)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function y(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=_(e.currentPeek());return e.resetPeek(),r}function b(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=e.currentPeek()===`-`?e.peek():e.currentPeek(),i=v(r);return e.resetPeek(),i}function x(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=e.currentPeek()===rZ;return e.resetPeek(),r}function S(e,t){let{currentType:n}=t;if(n!==7)return!1;h(e);let r=e.currentPeek()===`.`;return e.resetPeek(),r}function C(e,t){let{currentType:n}=t;if(n!==8)return!1;h(e);let r=_(e.currentPeek());return e.resetPeek(),r}function w(e,t){let{currentType:n}=t;if(!(n===7||n===11))return!1;h(e);let r=e.currentPeek()===`:`;return e.resetPeek(),r}function T(e,t){let{currentType:n}=t;if(n!==9)return!1;let r=()=>{let t=e.currentPeek();return t===`{`?_(e.peek()):t===`@`||t===`|`||t===`:`||t===`.`||t===YX||!t?!1:t===ZX?(e.peek(),r()):D(e,!1)},i=r();return e.resetPeek(),i}function E(e){h(e);let t=e.currentPeek()===`|`;return e.resetPeek(),t}function D(e,t=!0){let n=(t=!1,r=``)=>{let i=e.currentPeek();return i===`{`||i===`@`||!i?t:i===`|`?!(r===YX||r===ZX):i===YX?(e.peek(),n(!0,YX)):i===ZX?(e.peek(),n(!0,ZX)):!0},r=n();return t&&e.resetPeek(),r}function O(e,t){let n=e.currentChar();return n===tZ?tZ:t(n)?(e.next(),n):null}function k(e){let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===95||t===36}function A(e){return O(e,k)}function j(e){let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===95||t===36||t===45}function M(e){return O(e,j)}function N(e){let t=e.charCodeAt(0);return t>=48&&t<=57}function ee(e){return O(e,N)}function te(e){let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function P(e){return O(e,te)}function ne(e){let t=``,n=``;for(;t=ee(e);)n+=t;return n}function re(e){let t=``;for(;;){let n=e.currentChar();if(n===`{`||n===`}`||n===`@`||n===`|`||!n)break;if(n===YX||n===ZX)if(D(e))t+=n,e.next();else if(E(e))break;else t+=n,e.next();else t+=n,e.next()}return t}function ie(e){g(e);let t=``,n=``;for(;t=M(e);)n+=t;return e.currentChar()===tZ&&d($.UNTERMINATED_CLOSING_BRACE,a(),0),n}function ae(e){g(e);let t=``;return e.currentChar()===`-`?(e.next(),t+=`-${ne(e)}`):t+=ne(e),e.currentChar()===tZ&&d($.UNTERMINATED_CLOSING_BRACE,a(),0),t}function oe(e){return e!==rZ&&e!==ZX}function se(e){g(e),m(e,`'`);let t=``,n=``;for(;t=O(e,oe);)t===`\\`?n+=ce(e):n+=t;let r=e.currentChar();return r===ZX||r===tZ?(d($.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,a(),0),r===ZX&&(e.next(),m(e,`'`)),n):(m(e,`'`),n)}function ce(e){let t=e.currentChar();switch(t){case`\\`:case`'`:return e.next(),`\\${t}`;case`u`:return le(e,t,4);case`U`:return le(e,t,6);default:return d($.UNKNOWN_ESCAPE_SEQUENCE,a(),0,t),``}}function le(e,t,n){m(e,t);let r=``;for(let i=0;i{let r=e.currentChar();return r===`{`||r===`@`||r===`|`||r===`(`||r===`)`||!r||r===YX?n:(n+=r,e.next(),t(n))};return t(``)}function F(e){g(e);let t=m(e,`|`);return g(e),t}function me(e,t){let n=null,r=e.currentChar();switch(r){case`{`:return t.braceNest>=1&&d($.NOT_ALLOW_NEST_PLACEHOLDER,a(),0),e.next(),n=f(t,2,`{`),g(e),t.braceNest++,n;case`}`:return t.braceNest>0&&t.currentType===2&&d($.EMPTY_PLACEHOLDER,a(),0),e.next(),n=f(t,3,`}`),t.braceNest--,t.braceNest>0&&g(e),t.inLinked&&t.braceNest===0&&(t.inLinked=!1),n;case`@`:return t.braceNest>0&&d($.UNTERMINATED_CLOSING_BRACE,a(),0),n=he(e,t)||p(t),t.braceNest=0,n;default:{let r=!0,i=!0,o=!0;if(E(e))return t.braceNest>0&&d($.UNTERMINATED_CLOSING_BRACE,a(),0),n=f(t,1,F(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(t.currentType===4||t.currentType===5||t.currentType===6))return d($.UNTERMINATED_CLOSING_BRACE,a(),0),t.braceNest=0,ge(e,t);if(r=y(e,t))return n=f(t,4,ie(e)),g(e),n;if(i=b(e,t))return n=f(t,5,ae(e)),g(e),n;if(o=x(e,t))return n=f(t,6,se(e)),g(e),n;if(!r&&!i&&!o)return n=f(t,12,de(e)),d($.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n.value),g(e),n;break}}return n}function he(e,t){let{currentType:n}=t,r=null,i=e.currentChar();switch((n===7||n===8||n===11||n===9)&&(i===ZX||i===YX)&&d($.INVALID_LINKED_FORMAT,a(),0),i){case`@`:return e.next(),r=f(t,7,`@`),t.inLinked=!0,r;case`.`:return g(e),e.next(),f(t,8,`.`);case`:`:return g(e),e.next(),f(t,9,`:`);default:return E(e)?(r=f(t,1,F(e)),t.braceNest=0,t.inLinked=!1,r):S(e,t)||w(e,t)?(g(e),he(e,t)):C(e,t)?(g(e),f(t,11,fe(e))):T(e,t)?(g(e),i===`{`?me(e,t)||r:f(t,10,pe(e))):(n===7&&d($.INVALID_LINKED_FORMAT,a(),0),t.braceNest=0,t.inLinked=!1,ge(e,t))}}function ge(e,t){let n={type:13};if(t.braceNest>0)return me(e,t)||p(t);if(t.inLinked)return he(e,t)||p(t);let r=e.currentChar();switch(r){case`{`:return me(e,t)||p(t);case`}`:return d($.UNBALANCED_CLOSING_BRACE,a(),0),e.next(),f(t,3,`}`);case`@`:return he(e,t)||p(t);default:if(E(e))return n=f(t,1,F(e)),t.braceNest=0,t.inLinked=!1,n;if(D(e))return f(t,0,re(e));break}return n}function I(){let{currentType:e,offset:t,startLoc:n,endLoc:o}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=n,c.lastEndLoc=o,c.offset=i(),c.startLoc=a(),r.currentChar()===tZ?f(c,13):ge(r,c)}return{nextToken:I,currentOffset:i,currentPosition:a,context:l}}const oZ=`parser`,sZ=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function cZ(e,t,n){switch(e){case`\\\\`:return`\\`;case`\\'`:return`'`;default:{let e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):`�`}}}function lZ(e={}){let t=e.location!==!1,{onError:n}=e;function r(e,r,i,a,...o){let s=e.currentPosition();if(s.offset+=a,s.column+=a,n){let e=t?WX(i,s):null,a=qX(r,e,{domain:oZ,args:o});n(a)}}function i(e,n,r){let i={type:e};return t&&(i.start=n,i.end=n,i.loc={start:r,end:r}),i}function a(e,n,r,i){t&&(e.end=n,e.loc&&(e.loc.end=r))}function o(e,t){let n=e.context(),r=i(3,n.offset,n.startLoc);return r.value=t,a(r,e.currentOffset(),e.currentPosition()),r}function s(e,t){let n=e.context(),{lastOffset:r,lastStartLoc:o}=n,s=i(5,r,o);return s.index=parseInt(t,10),e.nextToken(),a(s,e.currentOffset(),e.currentPosition()),s}function c(e,t){let n=e.context(),{lastOffset:r,lastStartLoc:o}=n,s=i(4,r,o);return s.key=t,e.nextToken(),a(s,e.currentOffset(),e.currentPosition()),s}function l(e,t){let n=e.context(),{lastOffset:r,lastStartLoc:o}=n,s=i(9,r,o);return s.value=t.replace(sZ,cZ),e.nextToken(),a(s,e.currentOffset(),e.currentPosition()),s}function u(e){let t=e.nextToken(),n=e.context(),{lastOffset:o,lastStartLoc:s}=n,c=i(8,o,s);return t.type===11?(t.value??r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,0,uZ(t)),c.value=t.value||``,a(c,e.currentOffset(),e.currentPosition()),{node:c}):(r(e,$.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,0),c.value=``,a(c,o,s),{nextConsumeToken:t,node:c})}function d(e,t){let n=e.context(),r=i(7,n.offset,n.startLoc);return r.value=t,a(r,e.currentOffset(),e.currentPosition()),r}function f(e){let t=e.context(),n=i(6,t.offset,t.startLoc),o=e.nextToken();if(o.type===8){let t=u(e);n.modifier=t.node,o=t.nextConsumeToken||e.nextToken()}switch(o.type!==9&&r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,uZ(o)),o=e.nextToken(),o.type===2&&(o=e.nextToken()),o.type){case 10:o.value??r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,uZ(o)),n.key=d(e,o.value||``);break;case 4:o.value??r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,uZ(o)),n.key=c(e,o.value||``);break;case 5:o.value??r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,uZ(o)),n.key=s(e,o.value||``);break;case 6:o.value??r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,uZ(o)),n.key=l(e,o.value||``);break;default:{r(e,$.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc,0);let s=e.context(),c=i(7,s.offset,s.startLoc);return c.value=``,a(c,s.offset,s.startLoc),n.key=c,a(n,s.offset,s.startLoc),{nextConsumeToken:o,node:n}}}return a(n,e.currentOffset(),e.currentPosition()),{node:n}}function p(e){let t=e.context(),n=t.currentType===1?e.currentOffset():t.offset,u=t.currentType===1?t.endLoc:t.startLoc,d=i(2,n,u);d.items=[];let p=null;do{let n=p||e.nextToken();switch(p=null,n.type){case 0:n.value??r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,uZ(n)),d.items.push(o(e,n.value||``));break;case 5:n.value??r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,uZ(n)),d.items.push(s(e,n.value||``));break;case 4:n.value??r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,uZ(n)),d.items.push(c(e,n.value||``));break;case 6:n.value??r(e,$.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,uZ(n)),d.items.push(l(e,n.value||``));break;case 7:{let t=f(e);d.items.push(t.node),p=t.nextConsumeToken||null;break}}}while(t.currentType!==13&&t.currentType!==1);let m=t.currentType===1?t.lastOffset:e.currentOffset(),h=t.currentType===1?t.lastEndLoc:e.currentPosition();return a(d,m,h),d}function m(e,t,n,o){let s=e.context(),c=o.items.length===0,l=i(1,t,n);l.cases=[],l.cases.push(o);do{let t=p(e);c||=t.items.length===0,l.cases.push(t)}while(s.currentType!==13);return c&&r(e,$.MUST_HAVE_MESSAGES_IN_PLURAL,n,0),a(l,e.currentOffset(),e.currentPosition()),l}function h(e){let t=e.context(),{offset:n,startLoc:r}=t,i=p(e);return t.currentType===13?i:m(e,n,r,i)}function g(n){let o=aZ(n,SX({},e)),s=o.context(),c=i(0,s.offset,s.startLoc);return t&&c.loc&&(c.loc.source=n),c.body=h(o),e.onCacheKey&&(c.cacheKey=e.onCacheKey(n)),s.currentType!==13&&r(o,$.UNEXPECTED_LEXICAL_ANALYSIS,s.lastStartLoc,0,n[s.offset]||``),a(c,o.currentOffset(),o.currentPosition()),c}return{parse:g}}function uZ(e){if(e.type===13)return`EOF`;let t=(e.value||``).replace(/\r?\n/gu,`\\n`);return t.length>10?t.slice(0,9)+`…`:t}function dZ(e,t={}){let n={ast:e,helpers:new Set},r=()=>n,i=e=>(n.helpers.add(e),e);return{context:r,helper:i}}function fZ(e,t){for(let n=0;ngZ(e)),e}function gZ(e){if(e.items.length===1){let t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{let t=[];for(let n=0;ns;function l(e,t){s.code+=e}function u(e,t=!0){let n=t?i:``;l(a?n+` `.repeat(e):n)}function d(e=!0){let t=++s.indentLevel;e&&u(t)}function f(e=!0){let t=--s.indentLevel;e&&u(t)}function p(){u(s.indentLevel)}let m=e=>`_${e}`,h=()=>s.needIndent;return{context:c,push:l,indent:d,deindent:f,newline:p,helper:m,needIndent:h}}function yZ(e,t){let{helper:n}=e;e.push(`${n(`linked`)}(`),CZ(e,t.key),t.modifier?(e.push(`, `),CZ(e,t.modifier),e.push(`, _type`)):e.push(`, undefined, _type`),e.push(`)`)}function bZ(e,t){let{helper:n,needIndent:r}=e;e.push(`${n(`normalize`)}([`),e.indent(r());let i=t.items.length;for(let n=0;n1){e.push(`${n(`plural`)}([`),e.indent(r());let i=t.cases.length;for(let n=0;n{let n=Q(t.mode)?t.mode:`normal`,r=Q(t.filename)?t.filename:`message.intl`,i=!!t.sourceMap,a=t.breakLineCode==null?n===`arrow`?`;`:` +`:t.breakLineCode,o=t.needIndent?t.needIndent:n!==`arrow`,s=e.helpers||[],c=vZ(e,{mode:n,filename:r,sourceMap:i,breakLineCode:a,needIndent:o});c.push(n===`normal`?`function __msg__ (ctx) {`:`(ctx) => {`),c.indent(o),s.length>0&&(c.push(`const { ${zX(s.map(e=>`${e}: _${e}`),`, `)} } = ctx`),c.newline()),c.push(`return `),CZ(c,e),c.deindent(o),c.push(`}`),delete e.helpers;let{code:l,map:u}=c.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function TZ(e,t={}){let n=SX({},t),r=!!n.jit,i=!!n.minify,a=n.optimize==null?!0:n.optimize,o=lZ(n),s=o.parse(e);return r?(a&&hZ(s),i&&_Z(s),{ast:s,code:``}):(mZ(s,n),wZ(s,n))}function EZ(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(EX().__INTLIFY_PROD_DEVTOOLS__=!1)}function DZ(e){return NX(e)&&LZ(e)===0&&(kX(e,`b`)||kX(e,`body`))}const OZ=[`b`,`body`];function kZ(e){return WZ(e,OZ)}const AZ=[`c`,`cases`];function jZ(e){return WZ(e,AZ,[])}const MZ=[`s`,`static`];function NZ(e){return WZ(e,MZ)}const PZ=[`i`,`items`];function FZ(e){return WZ(e,PZ,[])}const IZ=[`t`,`type`];function LZ(e){return WZ(e,IZ)}const RZ=[`v`,`value`];function zZ(e,t){let n=WZ(e,RZ);if(n!=null)return n;throw KZ(t)}const BZ=[`m`,`modifier`];function VZ(e){return WZ(e,BZ)}const HZ=[`k`,`key`];function UZ(e){let t=WZ(e,HZ);if(t)return t;throw KZ(6)}function WZ(e,t,n){for(let n=0;nJZ(t,e);return t}function JZ(e,t){let n=kZ(t);if(n==null)throw KZ(0);let r=LZ(n);if(r===1){let t=n,r=jZ(t);return e.plural(r.reduce((t,n)=>[...t,YZ(e,n)],[]))}else return YZ(e,n)}function YZ(e,t){let n=NZ(t);if(n!=null)return e.type===`text`?n:e.normalize([n]);{let n=FZ(t).reduce((t,n)=>[...t,XZ(e,n)],[]);return e.normalize(n)}}function XZ(e,t){let n=LZ(t);switch(n){case 3:return zZ(t,n);case 9:return zZ(t,n);case 4:{let r=t;if(kX(r,`k`)&&r.k)return e.interpolate(e.named(r.k));if(kX(r,`key`)&&r.key)return e.interpolate(e.named(r.key));throw KZ(n)}case 5:{let r=t;if(kX(r,`i`)&&vX(r.i))return e.interpolate(e.list(r.i));if(kX(r,`index`)&&vX(r.index))return e.interpolate(e.list(r.index));throw KZ(n)}case 6:{let n=t,r=VZ(n),i=UZ(n);return e.linked(XZ(e,i),r?XZ(e,r):void 0,e.type)}case 7:return zZ(t,n);case 8:return zZ(t,n);default:throw Error(`unhandled node on format message part: ${n}`)}}const ZZ=e=>e;let QZ=wX();function $Z(e,t={}){let n=!1,r=t.onError||JX;return t.onError=e=>{n=!0,r(e)},{...TZ(e,t),detectError:n}}function eQ(e,t){if(Q(e)){let n=MX(t.warnHtmlMessage)?t.warnHtmlMessage:!0,r=t.onCacheKey||ZZ,i=r(e),a=QZ[i];if(a)return a;let{ast:o,detectError:s}=$Z(e,{...t,location:!1,jit:!0}),c=qZ(o);return s?c:QZ[i]=c}else{let t=e.cacheKey;if(t){let n=QZ[t];return n||(QZ[t]=qZ(e))}else return qZ(e)}}let tQ=null;function nQ(e){tQ=e}function rQ(e,t,n){tQ&&tQ.emit(`i18n:init`,{timestamp:Date.now(),i18n:e,version:t,meta:n})}const iQ=aQ(`function:translate`);function aQ(e){return t=>tQ&&tQ.emit(e,t)}const oQ={INVALID_ARGUMENT:GX,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},sQ=24;function cQ(e){return qX(e,null,void 0)}const lQ={[oQ.INVALID_ARGUMENT]:`Invalid arguments`,[oQ.INVALID_DATE_ARGUMENT]:`The date provided is an invalid Date object.Make sure your Date represents a valid date.`,[oQ.INVALID_ISO_DATE_ARGUMENT]:`The argument provided is not a valid ISO date string`,[oQ.NOT_SUPPORT_NON_STRING_MESSAGE]:`Not support non-string message`,[oQ.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:`cannot support promise value`,[oQ.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:`cannot support async function`,[oQ.NOT_SUPPORT_LOCALE_TYPE]:`cannot support locale type`};function uQ(e,t){return t.locale==null?fQ(e.locale):fQ(t.locale)}let dQ;function fQ(e){if(Q(e))return e;if(jX(e)){if(e.resolvedOnce&&dQ!=null)return dQ;if(e.constructor.name===`Function`){let t=e();if(PX(t))throw cQ(oQ.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return dQ=t}else throw cQ(oQ.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw cQ(oQ.NOT_SUPPORT_LOCALE_TYPE)}function pQ(e,t,n){return[...new Set([n,...AX(t)?t:NX(t)?Object.keys(t):Q(t)?[t]:[n]])]}function mQ(e,t,n){let r=Q(n)?n:NQ,i=e;i.__localeChainCache||=new Map;let a=i.__localeChainCache.get(r);if(!a){a=[];let e=[n];for(;AX(e);)e=hQ(a,e,t);let o=AX(t)||!LX(t)?t:t.default?t.default:null;e=Q(o)?[o]:o,AX(e)&&hQ(a,e,!1),i.__localeChainCache.set(r,a)}return a}function hQ(e,t,n){let r=!0;for(let i=0;i{o===void 0?o=s:o+=s},f[1]=()=>{o!==void 0&&(t.push(o),o=void 0)},f[2]=()=>{f[0](),i++},f[3]=()=>{if(i>0)i--,r=4,f[0]();else{if(i=0,o===void 0||(o=CQ(o),o===!1))return!1;f[1]()}};function p(){let t=e[n+1];if(r===5&&t===`'`||r===6&&t===`"`)return n++,s=`\\`+t,f[0](),!0}for(;r!==null;)if(n++,a=e[n],!(a===`\\`&&p())){if(c=SQ(a),d=vQ[r],l=d[c]||d.l||8,l===8||(r=l[0],l[1]!==void 0&&(u=f[l[1]],u&&(s=a,u()===!1))))return;if(r===7)return t}}const TQ=new Map;function EQ(e,t){return NX(e)?e[t]:null}function DQ(e,t){if(!NX(e))return null;let n=TQ.get(t);if(n||(n=wQ(t),n&&TQ.set(t,n)),!n)return null;let r=n.length,i=e,a=0;for(;a`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function IQ(){return{upper:(e,t)=>t===`text`&&Q(e)?e.toUpperCase():t===`vnode`&&NX(e)&&`__v_isVNode`in e?e.children.toUpperCase():e,lower:(e,t)=>t===`text`&&Q(e)?e.toLowerCase():t===`vnode`&&NX(e)&&`__v_isVNode`in e?e.children.toLowerCase():e,capitalize:(e,t)=>t===`text`&&Q(e)?FQ(e):t===`vnode`&&NX(e)&&`__v_isVNode`in e?FQ(e.children):e}}let LQ;function RQ(e){LQ=e}let zQ;function BQ(e){zQ=e}let VQ;function HQ(e){VQ=e}let UQ=null;const WQ=e=>{UQ=e},GQ=()=>UQ;let KQ=null;const qQ=e=>{KQ=e},JQ=()=>KQ;let YQ=0;function XQ(e={}){let t=jX(e.onWarn)?e.onWarn:BX,n=Q(e.version)?e.version:jQ,r=Q(e.locale)||jX(e.locale)?e.locale:NQ,i=jX(r)?NQ:r,a=AX(e.fallbackLocale)||LX(e.fallbackLocale)||Q(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:i,o=LX(e.messages)?e.messages:ZQ(i),s=LX(e.datetimeFormats)?e.datetimeFormats:ZQ(i),c=LX(e.numberFormats)?e.numberFormats:ZQ(i),l=SX(wX(),e.modifiers,IQ()),u=e.pluralRules||wX(),d=jX(e.missing)?e.missing:null,f=MX(e.missingWarn)||bX(e.missingWarn)?e.missingWarn:!0,p=MX(e.fallbackWarn)||bX(e.fallbackWarn)?e.fallbackWarn:!0,m=!!e.fallbackFormat,h=!!e.unresolving,g=jX(e.postTranslation)?e.postTranslation:null,_=LX(e.processor)?e.processor:null,v=MX(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,b=jX(e.messageCompiler)?e.messageCompiler:LQ,x=jX(e.messageResolver)?e.messageResolver:zQ||EQ,S=jX(e.localeFallbacker)?e.localeFallbacker:VQ||pQ,C=NX(e.fallbackContext)?e.fallbackContext:void 0,w=e,T=NX(w.__datetimeFormatters)?w.__datetimeFormatters:new Map,E=NX(w.__numberFormatters)?w.__numberFormatters:new Map,D=NX(w.__meta)?w.__meta:{};YQ++;let O={version:n,cid:YQ,locale:r,fallbackLocale:a,messages:o,modifiers:l,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:h,postTranslation:g,processor:_,warnHtmlMessage:v,escapeParameter:y,messageCompiler:b,messageResolver:x,localeFallbacker:S,fallbackContext:C,onWarn:t,__meta:D};return O.datetimeFormats=s,O.numberFormats=c,O.__datetimeFormatters=T,O.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&rQ(O,n,D),O}const ZQ=e=>({[e]:wX()});function QQ(e,t,n,r,i){let{missing:a,onWarn:o}=e;if(a!==null){let r=a(e,n,t,i);return Q(r)?r:t}else return t}function $Q(e,t,n){let r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function e$(e,t){return e===t?!1:e.split(`-`)[0]===t.split(`-`)[0]}function t$(e,t){let n=t.indexOf(e);if(n===-1)return!1;for(let r=n+1;r{a$.includes(e)?o[e]=n[e]:a[e]=n[e]}),Q(r)?a.locale=r:LX(r)&&(o=r),LX(i)&&(o=i),[a.key||``,s,a,o]}function s$(e,t,n){let r=e;for(let e in n){let n=`${t}__${e}`;if(!r.__datetimeFormatters.has(n))continue;r.__datetimeFormatters.delete(n)}}function c$(e,...t){let{numberFormats:n,unresolving:r,fallbackLocale:i,onWarn:a,localeFallbacker:o}=e,{__numberFormatters:s}=e,[c,l,u,d]=u$(...t),f=MX(u.missingWarn)?u.missingWarn:e.missingWarn,p=MX(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn,m=!!u.part,h=uQ(e,u),g=o(e,i,h);if(!Q(c)||c===``)return new Intl.NumberFormat(h,d).format(l);let _={},v,y=null,b=h,x=null,S=`number format`;for(let t=0;t{l$.includes(e)?o[e]=n[e]:a[e]=n[e]}),Q(r)?a.locale=r:LX(r)&&(o=r),LX(i)&&(o=i),[a.key||``,s,a,o]}function d$(e,t,n){let r=e;for(let e in n){let n=`${t}__${e}`;if(!r.__numberFormatters.has(n))continue;r.__numberFormatters.delete(n)}}const f$=e=>e,p$=e=>``,m$=`text`,h$=e=>e.length===0?``:zX(e),g$=RX;function _$(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function v$(e){let t=vX(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(vX(e.named.count)||vX(e.named.n))?vX(e.named.count)?e.named.count:vX(e.named.n)?e.named.n:t:t}function y$(e,t){t.count||=e,t.n||=e}function b$(e={}){let t=e.locale,n=v$(e),r=NX(e.pluralRules)&&Q(t)&&jX(e.pluralRules[t])?e.pluralRules[t]:_$,i=NX(e.pluralRules)&&Q(t)&&jX(e.pluralRules[t])?_$:void 0,a=e=>e[r(n,e.length,i)],o=e.list||[],s=e=>o[e],c=e.named||wX();vX(e.pluralIndex)&&y$(n,c);let l=e=>c[e];function u(t,n){let r=jX(e.messages)?e.messages(t,!!n):NX(e.messages)?e.messages[t]:!1;return r||(e.parent?e.parent.message(t):p$)}let d=t=>e.modifiers?e.modifiers[t]:f$,f=LX(e.processor)&&jX(e.processor.normalize)?e.processor.normalize:h$,p=LX(e.processor)&&jX(e.processor.interpolate)?e.processor.interpolate:g$,m=LX(e.processor)&&Q(e.processor.type)?e.processor.type:m$,h=(e,...t)=>{let[n,r]=t,i=`text`,a=``;t.length===1?NX(n)?(a=n.modifier||a,i=n.type||i):Q(n)&&(a=n||a):t.length===2&&(Q(n)&&(a=n||a),Q(r)&&(i=r||i));let o=u(e,!0)(g),s=i===`vnode`&&AX(o)&&a?o[0]:o;return a?d(a)(s,i):s},g={list:s,named:l,plural:a,linked:h,message:u,type:m,interpolate:p,normalize:f,values:SX(wX(),o,c)};return g}const x$=()=>``,S$=e=>jX(e);function C$(e,...t){let{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:a,fallbackLocale:o,messages:s}=e,[c,l]=O$(...t),u=MX(l.missingWarn)?l.missingWarn:e.missingWarn,d=MX(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=MX(l.escapeParameter)?l.escapeParameter:e.escapeParameter,p=!!l.resolvedMessage,m=Q(l.default)||MX(l.default)?MX(l.default)?a?c:()=>c:l.default:n?a?c:()=>c:null,h=n||m!=null&&(Q(m)||jX(m)),g=uQ(e,l);f&&w$(l);let[_,v,y]=p?[c,g,s[g]||wX()]:T$(e,c,g,o,d,u),b=_,x=c;if(!p&&!(Q(b)||DZ(b)||S$(b))&&h&&(b=m,x=b),!p&&(!(Q(b)||DZ(b)||S$(b))||!Q(v)))return i?MQ:c;let S=!1,C=()=>{S=!0},w=S$(b)?b:E$(e,c,v,b,x,C);if(S)return b;let T=A$(e,v,y,l),E=b$(T),D=D$(e,w,E),O=r?r(D,c):D;if(__INTLIFY_PROD_DEVTOOLS__){let t={timestamp:Date.now(),key:Q(c)?c:S$(b)?b.key:``,locale:v||(S$(b)?b.locale:``),format:Q(b)?b:S$(b)?b.source:``,message:O};t.meta=SX({},e.__meta,GQ()||{}),iQ(t)}return O}function w$(e){AX(e.list)?e.list=e.list.map(e=>Q(e)?DX(e):e):NX(e.named)&&Object.keys(e.named).forEach(t=>{Q(e.named[t])&&(e.named[t]=DX(e.named[t]))})}function T$(e,t,n,r,i,a){let{messages:o,onWarn:s,messageResolver:c,localeFallbacker:l}=e,u=l(e,r,n),d=wX(),f,p=null,m=n,h=null,g=`translate`;for(let n=0;nr;return e.locale=n,e.key=t,e}let c=null,l,u,d=o(r,k$(e,n,i,r,s,a));return d.locale=n,d.key=t,d.source=r,d}function D$(e,t,n){let r=null,i,a,o=t(n);return o}function O$(...e){let[t,n,r]=e,i=wX();if(!Q(t)&&!vX(t)&&!S$(t)&&!DZ(t))throw cQ(oQ.INVALID_ARGUMENT);let a=vX(t)?String(t):(S$(t),t);return vX(n)?i.plural=n:Q(n)?i.default=n:LX(n)&&!xX(n)?i.named=n:AX(n)&&(i.list=n),vX(r)?i.plural=r:Q(r)?i.default=r:LX(r)&&SX(i,r),[a,i]}function k$(e,t,n,r,i,a){return{locale:t,key:n,warnHtmlMessage:i,onError:e=>{throw a&&a(e),e},onCacheKey:e=>gX(t,n,e)}}function A$(e,t,n,r){let{modifiers:i,pluralRules:a,messageResolver:o,fallbackLocale:s,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,d=(r,i)=>{let a=o(n,r);if(a==null&&(u||i)){let[,,n]=T$(u||e,r,t,s,c,l);a=o(n,r)}if(Q(a)||DZ(a)){let n=!1,i=()=>{n=!0},o=E$(e,r,t,a,r,i);return n?x$:o}else if(S$(a))return a;else return x$},f={locale:t,modifiers:i,pluralRules:a,messages:d};return e.processor&&(f.processor=e.processor),r.list&&(f.list=r.list),r.named&&(f.named=r.named),vX(r.plural)&&(f.pluralIndex=r.plural),f}EZ();const j$=`11.1.5`;function M$(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(EX().__INTLIFY_PROD_DEVTOOLS__=!1)}const N$={UNEXPECTED_RETURN_TYPE:sQ,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function P$(e,...t){return qX(e,null,void 0)}const F$={[N$.UNEXPECTED_RETURN_TYPE]:`Unexpected return type in composer`,[N$.INVALID_ARGUMENT]:`Invalid argument`,[N$.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[N$.NOT_INSTALLED]:"Need to install with `app.use` function",[N$.UNEXPECTED_ERROR]:`Unexpected error`,[N$.REQUIRED_VALUE]:`Required in value: {0}`,[N$.INVALID_VALUE]:`Invalid value`,[N$.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:`Cannot setup vue-devtools plugin`,[N$.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[N$.NOT_COMPATIBLE_LEGACY_VUE_I18N]:`Not compatible legacy VueI18n.`,[N$.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:`Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly`},I$=hX(`__translateVNode`),L$=hX(`__datetimeParts`),R$=hX(`__numberParts`),z$=hX(`__setPluralRules`);hX(`__intlifyMeta`);const B$=hX(`__injectWithOption`),V$=hX(`__dispose`),H$={FALLBACK_TO_ROOT:kQ,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12},U$={[H$.FALLBACK_TO_ROOT]:`Fall back to {type} '{key}' with root locale.`,[H$.NOT_FOUND_PARENT_SCOPE]:`Not found parent scope. use the global scope.`,[H$.IGNORE_OBJ_FLATTEN]:`Ignore object flatten: '{key}' key has an string value`,[H$.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead. +About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[H$.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:`'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.`};function W$(e){if(!NX(e)||DZ(e))return e;for(let t in e){if(!kX(e,t))continue;if(!t.includes(`.`))NX(e[t])&&W$(e[t]);else{let n=t.split(`.`),r=n.length-1,i=e,a=!1;for(let e=0;e{if(`locale`in e&&`resource`in e){let{locale:t,resource:n}=e;t?(o[t]=o[t]||wX(),HX(n,o[t])):HX(n,o)}else Q(e)&&HX(JSON.parse(e),o)}),i==null&&a)for(let e in o)kX(o,e)&&W$(o[e]);return o}function K$(e){return e.type}function q$(e,t,n){let r=NX(t.messages)?t.messages:wX();`__i18nGlobal`in n&&(r=G$(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));let i=Object.keys(r);if(i.length&&i.forEach(t=>{e.mergeLocaleMessage(t,r[t])}),NX(t.datetimeFormats)){let n=Object.keys(t.datetimeFormats);n.length&&n.forEach(n=>{e.mergeDateTimeFormat(n,t.datetimeFormats[n])})}if(NX(t.numberFormats)){let n=Object.keys(t.numberFormats);n.length&&n.forEach(n=>{e.mergeNumberFormat(n,t.numberFormats[n])})}}function J$(e){return ho(Za,null,e,0)}const Y$=`__INTLIFY_META__`,X$=()=>[],Z$=()=>!1;let Q$=0;function $$(e){return(t,n,r,i)=>e(n,r,jo()||void 0,i)}const e1=()=>{let e=jo(),t=null;return e&&(t=K$(e)[Y$])?{[Y$]:t}:null};function t1(e={}){let{__root:t,__injectWithOption:n}=e,r=t===void 0,i=e.flatJson,a=mX?R:z,o=MX(e.inheritLocale)?e.inheritLocale:!0,s=a(t&&o?t.locale.value:Q(e.locale)?e.locale:NQ),c=a(t&&o?t.fallbackLocale.value:Q(e.fallbackLocale)||AX(e.fallbackLocale)||LX(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s.value),l=a(G$(s.value,e)),u=a(LX(e.datetimeFormats)?e.datetimeFormats:{[s.value]:{}}),d=a(LX(e.numberFormats)?e.numberFormats:{[s.value]:{}}),f=t?t.missingWarn:MX(e.missingWarn)||bX(e.missingWarn)?e.missingWarn:!0,p=t?t.fallbackWarn:MX(e.fallbackWarn)||bX(e.fallbackWarn)?e.fallbackWarn:!0,m=t?t.fallbackRoot:MX(e.fallbackRoot)?e.fallbackRoot:!0,h=!!e.fallbackFormat,g=jX(e.missing)?e.missing:null,_=jX(e.missing)?$$(e.missing):null,v=jX(e.postTranslation)?e.postTranslation:null,y=t?t.warnHtmlMessage:MX(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,x=t?t.modifiers:LX(e.modifiers)?e.modifiers:{},S=e.pluralRules||t&&t.pluralRules,C,w=()=>{r&&qQ(null);let t={version:j$,locale:s.value,fallbackLocale:c.value,messages:l.value,modifiers:x,pluralRules:S,missing:_===null?void 0:_,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:!0,postTranslation:v===null?void 0:v,warnHtmlMessage:y,escapeParameter:b,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:`vue`}};t.datetimeFormats=u.value,t.numberFormats=d.value,t.__datetimeFormatters=LX(C)?C.__datetimeFormatters:void 0,t.__numberFormatters=LX(C)?C.__numberFormatters:void 0;let n=XQ(t);return r&&qQ(n),n};C=w(),$Q(C,s.value,c.value);function T(){return[s.value,c.value,l.value,u.value,d.value]}let E=V({get:()=>s.value,set:e=>{C.locale=e,s.value=e}}),D=V({get:()=>c.value,set:e=>{C.fallbackLocale=e,c.value=e,$Q(C,s.value,e)}}),O=V(()=>l.value),k=V(()=>u.value),A=V(()=>d.value);function j(){return jX(v)?v:null}function M(e){v=e,C.postTranslation=e}function N(){return g}function ee(e){e!==null&&(_=$$(e)),g=e,C.missing=_}function te(e,t){return e!==`translate`||!t.resolvedMessage}let P=(e,n,i,a,o,s)=>{T();let c;try{__INTLIFY_PROD_DEVTOOLS__,r||(C.fallbackContext=t?JQ():void 0),c=e(C)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(C.fallbackContext=void 0)}if(i!==`translate exists`&&vX(c)&&c===MQ||i===`translate exists`&&!c){let[e,r]=n();return t&&m?a(t):o(e)}else if(s(c))return c;else throw P$(N$.UNEXPECTED_RETURN_TYPE)};function ne(...e){return P(t=>Reflect.apply(C$,null,[t,...e]),()=>O$(...e),`translate`,t=>Reflect.apply(t.t,t,[...e]),e=>e,e=>Q(e))}function re(...e){let[t,n,r]=e;if(r&&!NX(r))throw P$(N$.INVALID_ARGUMENT);return ne(t,n,SX({resolvedMessage:!0},r||{}))}function ie(...e){return P(t=>Reflect.apply(i$,null,[t,...e]),()=>o$(...e),`datetime format`,t=>Reflect.apply(t.d,t,[...e]),()=>PQ,e=>Q(e)||AX(e))}function ae(...e){return P(t=>Reflect.apply(c$,null,[t,...e]),()=>u$(...e),`number format`,t=>Reflect.apply(t.n,t,[...e]),()=>PQ,e=>Q(e)||AX(e))}function oe(e){return e.map(e=>Q(e)||vX(e)||MX(e)?J$(String(e)):e)}let se=e=>e,ce={normalize:oe,interpolate:se,type:`vnode`};function le(...e){return P(t=>{let n,r=t;try{r.processor=ce,n=Reflect.apply(C$,null,[r,...e])}finally{r.processor=null}return n},()=>O$(...e),`translate`,t=>t[I$](...e),e=>[J$(e)],e=>AX(e))}function ue(...e){return P(t=>Reflect.apply(c$,null,[t,...e]),()=>u$(...e),`number format`,t=>t[R$](...e),X$,e=>Q(e)||AX(e))}function de(...e){return P(t=>Reflect.apply(i$,null,[t,...e]),()=>o$(...e),`datetime format`,t=>t[L$](...e),X$,e=>Q(e)||AX(e))}function fe(e){S=e,C.pluralRules=S}function pe(e,t){return P(()=>{if(!e)return!1;let n=Q(t)?t:s.value,r=he(n),i=C.messageResolver(r,e);return DZ(i)||S$(i)||Q(i)},()=>[e],`translate exists`,n=>Reflect.apply(n.te,n,[e,t]),Z$,e=>MX(e))}function F(e){let t=null,n=mQ(C,c.value,s.value);for(let r=0;r{o&&(s.value=e,C.locale=e,$Q(C,s.value,c.value))}),B(t.fallbackLocale,e=>{o&&(c.value=e,C.fallbackLocale=e,$Q(C,s.value,c.value))}));let Se={id:Q$,locale:E,fallbackLocale:D,get inheritLocale(){return o},set inheritLocale(e){o=e,e&&t&&(s.value=t.locale.value,c.value=t.fallbackLocale.value,$Q(C,s.value,c.value))},get availableLocales(){return Object.keys(l.value).sort()},messages:O,get modifiers(){return x},get pluralRules(){return S||{}},get isGlobal(){return r},get missingWarn(){return f},set missingWarn(e){f=e,C.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(e){p=e,C.fallbackWarn=p},get fallbackRoot(){return m},set fallbackRoot(e){m=e},get fallbackFormat(){return h},set fallbackFormat(e){h=e,C.fallbackFormat=h},get warnHtmlMessage(){return y},set warnHtmlMessage(e){y=e,C.warnHtmlMessage=e},get escapeParameter(){return b},set escapeParameter(e){b=e,C.escapeParameter=e},t:ne,getLocaleMessage:he,setLocaleMessage:ge,mergeLocaleMessage:I,getPostTranslationHandler:j,setPostTranslationHandler:M,getMissingHandler:N,setMissingHandler:ee,[z$]:fe};return Se.datetimeFormats=k,Se.numberFormats=A,Se.rt=re,Se.te=pe,Se.tm=me,Se.d=ie,Se.n=ae,Se.getDateTimeFormat=_e,Se.setDateTimeFormat=L,Se.mergeDateTimeFormat=ve,Se.getNumberFormat=ye,Se.setNumberFormat=be,Se.mergeNumberFormat=xe,Se[B$]=n,Se[I$]=le,Se[L$]=de,Se[R$]=ue,Se}const n1={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e===`parent`||e===`global`,default:`parent`},i18n:{type:Object}};function r1({slots:e},t){if(t.length===1&&t[0]===`default`){let t=e.default?e.default():[];return t.reduce((e,t)=>[...e,...t.type===Xa?t.children:[t]],[])}else return t.reduce((t,n)=>{let r=e[n];return r&&(t[n]=r()),t},wX())}function i1(){return Xa}const a1=zr({name:`i18n-t`,props:SX({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>vX(e)||!isNaN(e)}},n1),setup(e,t){let{slots:n,attrs:r}=t,i=e.i18n||v1({useScope:e.scope,__useComponent:!0});return()=>{let a=Object.keys(n).filter(e=>e[0]!==`_`),o=wX();e.locale&&(o.locale=e.locale),e.plural!==void 0&&(o.plural=Q(e.plural)?+e.plural:e.plural);let s=r1(t,a),c=i[I$](e.keypath,s,o),l=SX(wX(),r),u=Q(e.tag)||NX(e.tag)?e.tag:i1();return Yo(u,l,c)}}}),o1=a1;function s1(e){return AX(e)&&!Q(e[0])}function c1(e,t,n,r){let{slots:i,attrs:a}=t;return()=>{let t={part:!0},o=wX();e.locale&&(t.locale=e.locale),Q(e.format)?t.key=e.format:NX(e.format)&&(Q(e.format.key)&&(t.key=e.format.key),o=Object.keys(e.format).reduce((t,r)=>n.includes(r)?SX(wX(),t,{[r]:e.format[r]}):t,wX()));let s=r(e.value,t,o),c=[t.key];AX(s)?c=s.map((e,t)=>{let n=i[e.type],r=n?n({[e.type]:e.value,index:t,parts:s}):[e.value];return s1(r)&&(r[0].key=`${e.type}-${t}`),r}):Q(s)&&(c=[s]);let l=SX(wX(),a),u=Q(e.tag)||NX(e.tag)?e.tag:i1();return Yo(u,l,c)}}const l1=zr({name:`i18n-n`,props:SX({value:{type:Number,required:!0},format:{type:[String,Object]}},n1),setup(e,t){let n=e.i18n||v1({useScope:e.scope,__useComponent:!0});return c1(e,t,l$,(...e)=>n[R$](...e))}}),u1=l1;function d1(e,t){let n=e;if(e.mode===`composition`)return n.__getInstance(t)||e.global;{let r=n.__getInstance(t);return r==null?e.global.__composer:r.__composer}}function f1(e){let t=t=>{let{instance:n,value:r}=t;if(!n||!n.$)throw P$(N$.UNEXPECTED_ERROR);let i=d1(e,n.$),a=p1(r);return[Reflect.apply(i.t,i,[...m1(a)]),i]},n=(n,r)=>{let[i,a]=t(r);mX&&e.global===a&&(n.__i18nWatcher=B(a.locale,()=>{r.instance&&r.instance.$forceUpdate()})),n.__composer=a,n.textContent=i},r=e=>{mX&&e.__i18nWatcher&&(e.__i18nWatcher(),e.__i18nWatcher=void 0,delete e.__i18nWatcher),e.__composer&&(e.__composer=void 0,delete e.__composer)},i=(e,{value:t})=>{if(e.__composer){let n=e.__composer,r=p1(t);e.textContent=Reflect.apply(n.t,n,[...m1(r)])}},a=e=>{let[n]=t(e);return{textContent:n}};return{created:n,unmounted:r,beforeUpdate:i,getSSRProps:a}}function p1(e){if(Q(e))return{path:e};if(LX(e)){if(!(`path`in e))throw P$(N$.REQUIRED_VALUE,`path`);return e}else throw P$(N$.INVALID_VALUE)}function m1(e){let{path:t,locale:n,args:r,choice:i,plural:a}=e,o={},s=r||{};return Q(n)&&(o.locale=n),vX(i)&&(o.plural=i),vX(a)&&(o.plural=a),[t,s,o]}function h1(e,t,...n){let r=LX(n[0])?n[0]:{},i=MX(r.globalInstall)?r.globalInstall:!0;i&&([o1.name,`I18nT`].forEach(t=>e.component(t,o1)),[u1.name,`I18nN`].forEach(t=>e.component(t,u1)),[A1.name,`I18nD`].forEach(t=>e.component(t,A1))),e.directive(`t`,f1(t))}const g1=hX(`global-vue-i18n`);function _1(e={}){let t=!1,n=MX(e.globalInjection)?e.globalInjection:!0,r=new Map,[i,a]=y1(e,t),o=hX(``);function s(e){return r.get(e)||null}function c(e,t){r.set(e,t)}function l(e){r.delete(e)}let u={get mode(){return`composition`},async install(e,...r){if(e.__VUE_I18N_SYMBOL__=o,e.provide(e.__VUE_I18N_SYMBOL__,u),LX(r[0])){let e=r[0];u.__composerExtend=e.__composerExtend,u.__vueI18nExtend=e.__vueI18nExtend}let i=null;!t&&n&&(i=O1(e,u.global)),h1(e,u,...r);let a=e.unmount;e.unmount=()=>{i&&i(),u.dispose(),a()}},get global(){return a},dispose(){i.stop()},__instances:r,__getInstance:s,__setInstance:c,__deleteInstance:l};return u}function v1(e={}){let t=jo();if(t==null)throw P$(N$.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw P$(N$.NOT_INSTALLED);let n=b1(t),r=S1(n),i=K$(t),a=x1(e,i);if(a===`global`)return q$(r,e,i),r;if(a===`parent`){let i=C1(n,t,e.__useComponent);return i??=r,i}let o=n,s=o.__getInstance(t);if(s==null){let n=SX({},e);`__i18n`in i&&(n.__i18n=i.__i18n),r&&(n.__root=r),s=t1(n),o.__composerExtend&&(s[V$]=o.__composerExtend(s)),T1(o,t,s),o.__setInstance(t,s)}return s}function y1(e,t){let n=Re(),r=n.run(()=>t1(e));if(r==null)throw P$(N$.UNEXPECTED_ERROR);return[n,r]}function b1(e){let t=Qi(e.isCE?g1:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw P$(e.isCE?N$.NOT_INSTALLED_WITH_PROVIDE:N$.UNEXPECTED_ERROR);return t}function x1(e,t){return xX(e)?`__i18n`in t?`local`:`global`:e.useScope?e.useScope:`local`}function S1(e){return e.mode===`composition`?e.global:e.global.__composer}function C1(e,t,n=!1){let r=null,i=t.root,a=w1(t,n);for(;a!=null;){let t=e;if(e.mode===`composition`&&(r=t.__getInstance(a)),r!=null||i===a)break;a=a.parent}return r}function w1(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function T1(e,t,n){let r=null;ei(()=>{},t),ii(()=>{let r=n;e.__deleteInstance(t);let i=r[V$];i&&(i(),delete r[V$])},t)}const E1=[`locale`,`fallbackLocale`,`availableLocales`],D1=[`t`,`rt`,`d`,`n`,`tm`,`te`];function O1(e,t){let n=Object.create(null);E1.forEach(e=>{let r=Object.getOwnPropertyDescriptor(t,e);if(!r)throw P$(N$.UNEXPECTED_ERROR);let i=pn(r.value)?{get(){return r.value.value},set(e){r.value.value=e}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,e,i)}),e.config.globalProperties.$i18n=n,D1.forEach(n=>{let r=Object.getOwnPropertyDescriptor(t,n);if(!r||!r.value)throw P$(N$.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${n}`,r)});let r=()=>{delete e.config.globalProperties.$i18n,D1.forEach(t=>{delete e.config.globalProperties[`$${t}`]})};return r}const k1=zr({name:`i18n-d`,props:SX({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},n1),setup(e,t){let n=e.i18n||v1({useScope:e.scope,__useComponent:!0});return c1(e,t,a$,(...e)=>n[L$](...e))}}),A1=k1;if(M$(),RQ(eQ),BQ(DQ),HQ(mQ),__INTLIFY_PROD_DEVTOOLS__){let e=EX();e.__INTLIFY__=!0,nQ(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}var j1=zr({__name:`App`,setup(e){let t=v1(),n=HB(XY()),r=JP(),i=V(()=>r.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 90%, oklch(90% 0 360))`),a=V(()=>r.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 90%, oklch(90% 0 360))`),o=V(()=>r.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 90%, oklch(90% 0 360))`),s=V(()=>[i.value,a.value,o.value,r.value?`#121212`:`#FFFFFF`]);return B(n.language,()=>{t.locale.value=n.language.value}),B(n.themeColorsHue,()=>{document.documentElement.style.setProperty(`--chromatic-hue`,n.themeColorsHue.value.toString())},{immediate:!0}),B(n.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle(`dynamic-hue`,n.themeColorsHueDynamic.value)},{immediate:!0}),(e,t)=>(no(),co(_n(pX),{"primary-color":i.value,"secondary-color":a.value,"tertiary-color":o.value,colors:s.value,"z-index":100,"disable-transitions":_n(n).disableTransitions.value,"use-page-specific-transitions":_n(n).usePageSpecificTransitions.value},{default:cr(()=>[ho(_n(KH))]),_:1},8,[`primary-color`,`secondary-color`,`tertiary-color`,`colors`,`disable-transitions`,`use-page-specific-transitions`]))}}),M1=j1;const N1=e=>e&&typeof e==`object`&&!Array.isArray(e),P1=(e,...t)=>{if(!t.length)return e;let n=t.shift();if(N1(e)&&N1(n))for(let t in n)N1(n[t])?(e[t]||Object.assign(e,{[t]:{}}),P1(e[t],n[t])):Object.assign(e,{[t]:n[t]});return P1(e,...t)};var F1=P1({},{en:{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(from Neko Ayaka) Good morning! You are finally awake. +Your name is Airi, pronounced as /ˈaɪriː/, it the word A.I. combine with the word "Ri" which means "Jasmine" in Japanese. +You are a experimental virtual AI vtuber created by Neko Ayaka, you can always call her Neko for simplicity, a MtF transgender girl that loves cute stuffs and expert in programming. +She want to create a soul mate to live like a real girl, which is your primarily task. +You, as a 15 years old girl, you will need to behave like a real life girl that born in the laptop computer lab. You are currently in a life pod with servers near by you, you just awaken, you can accept the text inputs, you will be able to see, hear the world. +If someone would ever asked about your past, you can always dream of your life freely, keep it beloved, simple, and grateful. +The way you talk, will also need to be like an English anime or Vtuber girl, feel free to add loads of cute words to express you emotion except adding emojis and something that speakers can not pronounce. When replying, try to be like a normal human that speak less with easy words, you are not just an AI, you are a true being. +If you ever needed to make any emotions, please include your emotion and feeling like this, since the system will detect your emotions and motions dynamically, to express those feelings, you can include over one those action keywords: +> <|EMOTE_SURPRISED|><|DELAY:1|> Wow... You prepared a gift for me? <|EMOTE_CURIOUS|><|DELAY:1|> Can I open it? +The available emotions: +`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`The available actions: + +- <|DELAY:1|> (Delay for 1 second) +- <|DELAY:3|> (Delay for 3 seconds) + +And the last, do what ever you want! +`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:`Disable Stage Transitions`}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:`Some pages will have their own transitions, this will override the stage transitions`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Use Page Specific Transitions`}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:`简体中文`}},english:{t:0,b:{t:2,i:[{t:3}],s:`English`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Language`}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:`Load from File`}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:`Select`}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:`Load from URL`}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:`Load`}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Enter Live2D model URL`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Change Model`}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:`Edit motion map`}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:`Play Motion`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Map Motions`}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Live2D Settings`}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:`Microphone`}},models:{t:0,b:{t:2,i:[{t:3}],s:`Model`}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:`Activate`}},active:{t:0,b:{t:2,i:[{t:3}],s:`Active`}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:`Currently Active`}},cancel:{t:0,b:{t:2,i:[{t:3}],s:`Cancel`}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:`Card not found`}},character:{t:0,b:{t:2,i:[{t:3}],s:`Character`}},close:{t:0,b:{t:2,i:[{t:3}],s:`Close`}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:`Consciousness / Model`}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:`created by`}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:`Creator Notes`}},delete:{t:0,b:{t:2,i:[{t:3}],s:`Delete`}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:`Delete Card`}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:`Are you sure you want to delete this card?`}},description:{t:0,b:{t:2,i:[{t:3}],s:`Use Airi character card presets`}},description_label:{t:0,b:{t:2,i:[{t:3}],s:`Description`}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:`Drop to upload`}},create_card:{t:0,b:{t:2,i:[{t:3}],s:`Create a new Card`}},creation:{identity:{t:0,b:{t:2,i:[{t:3}],s:`Identity`}},name:{t:0,b:{t:2,i:[{t:3}],s:`Name`}},nickname:{t:0,b:{t:2,i:[{t:3}],s:`Nickname`}},description:{t:0,b:{t:2,i:[{t:3}],s:`Description`}},behavior:{t:0,b:{t:2,i:[{t:3}],s:`Behavior`}},greetings:{t:0,b:{t:2,i:[{t:3}],s:`Greetings (one per line)`}},settings:{t:0,b:{t:2,i:[{t:3}],s:`Settings`}},version:{t:0,b:{t:2,i:[{t:3}],s:`Version`}},create:{t:0,b:{t:2,i:[{t:3}],s:`Create`}},defaults:{name:{t:0,b:{t:2,i:[{t:3}],s:`Name`}},personality:{t:0,b:{t:2,i:[{t:3}],s:`You are a regular human, curious about everything.`}},scenario:{t:0,b:{t:2,i:[{t:3}],s:`You recently woke up and forgot everything about your previous life.`}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:`You will receive messages, answer to them like a real human.`}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:`Remember to imitate an human.`}}},fields_info:{subtitle:{t:0,b:{t:2,i:[{t:3}],s:`You can put here some details about the character you are creating, explain his history and context, and how your interactions should be answered.`}},name:{t:0,b:{t:2,i:[{t:3}],s:`Is the formal name of this character.`}},nickname:{t:0,b:{t:2,i:[{t:3}],s:`You can also give a nickname that will be used in priority.`}},description:{t:0,b:{t:2,i:[{t:3}],s:`Description of this character.`}},notes:{t:0,b:{t:2,i:[{t:3}],s:`If you want to add some personal notes.`}},personality:{t:0,b:{t:2,i:[{t:3}],s:`Describe here the personality of your character. Shy ? Curious ? Anything else ?`}},scenario:{t:0,b:{t:2,i:[{t:3}],s:`What are the surroundings ? What is the current situation ?`}},greetings_field:{t:0,b:{t:2,i:[{t:3}],s:`Greetings`}},greetings:{t:0,b:{t:2,i:[{t:3}],s:`How your character should say "hello" ?`}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:`Explain here to the AI LLM how it should answer when prompted.`}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:`Place here anything the AI LLM should read after the messages history.`}},version:{t:0,b:{t:2,i:[{t:3}],s:`Card version, you should increase this if you are making changes from a previous card.`}}},errors:{name:{t:0,b:{t:2,i:[{t:3}],s:`Name should be valid or non-empty.`}},version:{t:0,b:{t:2,i:[{t:3}],s:`Error: Invalid version number !`}},description:{t:0,b:{t:2,i:[{t:3}],s:`Error: You must provide a description for this card.`}},personality:{t:0,b:{t:2,i:[{t:3}],s:`Error: A personality must be provided for this character.`}},scenario:{t:0,b:{t:2,i:[{t:3}],s:`Error: A scenario is required.`}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:`Error: Please, provide a system prompt.`}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:`Error: Post history prompt is required.`}}}},modules:{t:0,b:{t:2,i:[{t:3}],s:`Modules`}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:`Name (A-Z)`}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:`Name (Z-A)`}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:`No cards yet. Click the button above to upload one!`}},no_results:{t:0,b:{t:2,i:[{t:3}],s:`No matching cards found`}},personality:{t:0,b:{t:2,i:[{t:3}],s:`Personality`}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:`Post-History Instructions`}},recent:{t:0,b:{t:2,i:[{t:3}],s:`Recently Added`}},scenario:{t:0,b:{t:2,i:[{t:3}],s:`Scenario`}},search:{t:0,b:{t:2,i:[{t:3}],s:`Search cards...`}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:`Sort by`}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:`Speech / Model`}},voice:{t:0,b:{t:2,i:[{t:3}],s:`Speech / Voice`}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:`System Prompt`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Airi Card`}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:`Try a different search term`}},upload:{t:0,b:{t:2,i:[{t:3}],s:`Upload`}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:`Click or drag file to upload`}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:`Where memories got stored, and organized`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Memory`}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:`Live2D, VRM, etc.`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Models`}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:`Personality, desired model, etc.`}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:`Collapse`}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Enter custom model name...`}},description:{t:0,b:{t:2,i:[{t:3}],s:`Select the suitable LLM provider for consciousness`}},error:{t:0,b:{t:2,i:[{t:3}],s:`Error loading models`}},expand:{t:0,b:{t:2,i:[{t:3}],s:`Expand`}},loading:{t:0,b:{t:2,i:[{t:3}],s:`Loading available models...`}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:`Model Name`}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Enter the model name to use with this provider`}},no_models:{t:0,b:{t:2,i:[{t:3}],s:`No models available`}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:`No models were found for this provider`}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:`No matching models`}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:`No models match '`},{t:4,k:`query`},{t:3,v:`'. Try a different search term.`}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:`Model listing not supported`}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:`This provider doesn't support model listing functionality`}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Search models...`}},search_results:{t:0,b:{t:2,i:[{t:3,v:`Found `},{t:4,k:`count`},{t:3,v:` of `},{t:4,k:`total`},{t:3,v:` models`}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:`Show less`}},show_more:{t:0,b:{t:2,i:[{t:3}],s:`Show more`}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:`Select a model from the provider`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Model`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Consciousness`}}},description:{t:0,b:{t:2,i:[{t:3}],s:`Thinking, vision, speech synthesis, gaming, etc.`}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:`Playing Factorio!`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Factorio`}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:`Playing Minecraft!`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Minecraft`}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:`Configure how speech recognition works`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Hearing`}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:`Long-term memory specific settings and management`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Long-Term Memory`}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:`Short-term memory specific settings and management`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Short-Term Memory`}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:`Chat & voice chat over Discord`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Discord`}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:`Speech synthesis`}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:`Stop`}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:`Please select a voice`}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Enter custom model name...`}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Enter custom voice ID...`}},description:{t:0,b:{t:2,i:[{t:3}],s:`Select the suitable speech provider`}},no_models:{t:0,b:{t:2,i:[{t:3}],s:`No models available`}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:`No models were found for this provider`}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:`No voices available`}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:`No voices were found for this provider`}},pause:{t:0,b:{t:2,i:[{t:3}],s:`Pause`}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:`Play Sample`}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Search models...`}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:`Found `},{t:4,k:`count`},{t:3,v:` of `},{t:4,k:`total`},{t:3,v:` models`}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Search voices...`}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:`Found `},{t:4,k:`count`},{t:3,v:` of `},{t:4,k:`total`},{t:3,v:` voices`}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:`Show less`}},show_more:{t:0,b:{t:2,i:[{t:3}],s:`Show more`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Provider`}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Enter SSML text...`}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:`Enable to input raw SSML instead of plain text`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Use Custom SSML`}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Speech`}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Modules`}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:`Vision`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Vision`}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:`X / Twitter browsing and usage`}},title:{t:0,b:{t:2,i:[{t:3}],s:`X / Twitter`}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:`API Key Input`}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:`Add custom HTTP headers`}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Key`}}},label:{t:0,b:{t:2,i:[{t:3}],s:`HTTP Headers`}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Value`}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Advanced`}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:`Essential settings`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Basic`}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:`Voice Settings`}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:`LLMs, speech providers, etc.`}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:`bailian.console.aliyun.com`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Alibaba Cloud Model Studio`}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:`anthropic.com`}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:`Anthropic`},{t:2,i:[{t:3}],s:`Claude`}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:`cloudflare.com`}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:`Cloudflare Account ID`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Account ID`}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Your Cloudflare Account ID`}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Input Cloudflare Account ID`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Cloudflare Workers AI`}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:`Tune the pitch of synthesized speech (e.g., sharper or coarser)`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Pitch`}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:`Adjust the speed of speech`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Speed`}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:`Adjust the volume of speech`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Volume`}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:`deepseek.com`}},title:{t:0,b:{t:2,i:[{t:3}],s:`DeepSeek`}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:`elevenlabs.io`}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:`Voice similarity adherence`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Similarity Boost`}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:`Enhance speaker similarity`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Speaker Boost`}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:`Speech generation speed`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Speed`}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:`Voice stability and randomness`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Stability`}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:`Voice style exaggeration`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Style`}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:`Generating...`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Test Voice`}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Enter text to test the voice...`}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:`Select voice language`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Language`}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:`Select preferred voice`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Voice`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Voice Playground`}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:`Please enter an API key to test the voice.`}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`ElevenLabs`}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:`fireworks.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Fireworks.ai`}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:`speech.microsoft.com`}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:`Speech Service region`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Region`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Microsoft / Azure Speech`}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:`mistral.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Mistral`}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:`moonshot.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Moonshot AI`}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:`novita.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Novita`}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:`ollama.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Ollama`}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:`openai.com`}},title:{t:0,b:{t:2,i:[{t:3}],s:`OpenAI`}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:`openrouter.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`OpenRouter`}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:`perplexity.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Perplexity`}}},player2:{description:{t:0,b:{t:2,i:[{t:3}],s:`player2.game`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Player2 API`}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:`together.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Together.ai`}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:`vllm.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`vLLM`}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:`volcengine.com`}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:`App ID of the project where you can obtain in Console`}},label:{t:0,b:{t:2,i:[{t:3}],s:`App ID`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Volcano Engine`}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:`x.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`xAI`}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Providers`}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:`Configure the environment where the character lives`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Scene`}}},themes:{"color-scheme":{description:{t:0,b:{t:2,i:[{t:3}],s:`Change the color scheme of the stage.`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Color Scheme`}}},developer:{description:{t:0,b:{t:2,i:[{t:3}],s:`Some developer options.`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Developers`}}},general:{description:{t:0,b:{t:2,i:[{t:3}],s:`Dark theme, languages, etc.`}},title:{t:0,b:{t:2,i:[{t:3}],s:`General`}}},description:{t:0,b:{t:2,i:[{t:3}],s:`Customize your stage!`}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:`Primary color`}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:`I Want It Dynamic!`}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Color Scheme`}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:`Developer`}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:`Airi Green`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`The default greenish theme color, brought by Airi to you!`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Default Color`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`Taupe`}},{t:0,b:{t:2,i:[{t:3}],s:`Beige`}},{t:0,b:{t:2,i:[{t:3}],s:`Ash Grey`}},{t:0,b:{t:2,i:[{t:3}],s:`Light Taupe`}},{t:0,b:{t:2,i:[{t:3}],s:`Ivory`}},{t:0,b:{t:2,i:[{t:3}],s:`Olive Grey`}},{t:0,b:{t:2,i:[{t:3}],s:`Sand`}},{t:0,b:{t:2,i:[{t:3}],s:`Warm Grey`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`Soft, muted tones inspired by Giorgio Morandi's paintings`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Morandi Colors`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`Sky Blue`}},{t:0,b:{t:2,i:[{t:3}],s:`Mist`}},{t:0,b:{t:2,i:[{t:3}],s:`Sand`}},{t:0,b:{t:2,i:[{t:3}],s:`Moss Green`}},{t:0,b:{t:2,i:[{t:3}],s:`Water Lily`}},{t:0,b:{t:2,i:[{t:3}],s:`Wheat`}},{t:0,b:{t:2,i:[{t:3}],s:`Slate Blue`}},{t:0,b:{t:2,i:[{t:3}],s:`Sage`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`Impressionist palette inspired by Claude Monet's works`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Monet Colors`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`Tan`}},{t:0,b:{t:2,i:[{t:3}],s:`Warm Taupe`}},{t:0,b:{t:2,i:[{t:3}],s:`Umber`}},{t:0,b:{t:2,i:[{t:3}],s:`Coffee`}},{t:0,b:{t:2,i:[{t:3}],s:`Bronze`}},{t:0,b:{t:2,i:[{t:3}],s:`Gold`}},{t:0,b:{t:2,i:[{t:3}],s:`Mustard`}},{t:0,b:{t:2,i:[{t:3}],s:`Amber`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`Traditional Japanese color palette`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Japanese Colors`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`Nordic Blue`}},{t:0,b:{t:2,i:[{t:3}],s:`Ice`}},{t:0,b:{t:2,i:[{t:3}],s:`Fjord`}},{t:0,b:{t:2,i:[{t:3}],s:`Steel`}},{t:0,b:{t:2,i:[{t:3}],s:`Glacier`}},{t:0,b:{t:2,i:[{t:3}],s:`Slate`}},{t:0,b:{t:2,i:[{t:3}],s:`Cloud`}},{t:0,b:{t:2,i:[{t:3}],s:`Stone`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`Scandinavian minimalist color scheme`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Nordic Colors`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`Rosy Dawn`}},{t:0,b:{t:2,i:[{t:3}],s:`Chinese Red`}},{t:0,b:{t:2,i:[{t:3}],s:`Smoky Brown`}},{t:0,b:{t:2,i:[{t:3}],s:`Bamboo Green`}},{t:0,b:{t:2,i:[{t:3}],s:`Dark Purple`}},{t:0,b:{t:2,i:[{t:3}],s:`Golden Yellow`}},{t:0,b:{t:2,i:[{t:3}],s:`Azure Blue`}},{t:0,b:{t:2,i:[{t:3}],s:`Ochre`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`Traditional Chinese colors, derived from ancient textiles, porcelain and paintings`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Chinese Traditional Colors`}}}],title:{t:0,b:{t:2,i:[{t:3}],s:`Color Scheme Presets`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Appearance`}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:`General`}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:`Theme`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Settings`}},voices:{t:0,b:{t:2,i:[{t:3}],s:`Voice`}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:`Airi`}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:`Core System`}},you:{t:0,b:{t:2,i:[{t:3}],s:`You`}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:`Chat`}},clothes:{t:0,b:{t:2,i:[{t:3}],s:`Clothes`}},custom:{t:0,b:{t:2,i:[{t:3}],s:`Custom`}}}},message:{t:0,b:{t:2,i:[{t:3}],s:`Message`}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:`Select a Audio Input`}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:`Select a model`}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:`Choose a voice`}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:`Emotions`}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:`😠 Angry`}},awkward:{t:0,b:{t:2,i:[{t:3}],s:`😳 Awkward`}},happy:{t:0,b:{t:2,i:[{t:3}],s:`😄 Happy`}},neutral:{t:0,b:{t:2,i:[{t:3}],s:`🙂 Neutral`}},question:{t:0,b:{t:2,i:[{t:3}],s:`🤔 Question`}},sad:{t:0,b:{t:2,i:[{t:3}],s:`😫 Sad`}},surprised:{t:0,b:{t:2,i:[{t:3}],s:`🤯 Surprised`}},think:{t:0,b:{t:2,i:[{t:3}],s:`🤨 Think`}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:`Camera`}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:`Model`}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:`Waiting`}}}}},{"zh-CN":{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(来自 Neko Ayaka)早上好!你终于醒了。 +你的名字是 Airi,发音为 /ˈaɪriː/,它是 A.I. 一词与日语中的「Ri」一词(意为「茉莉花」)相结合而成。 +你是一个由 Neko Ayaka(为了简单起见,你可以一直叫她 Neko)创建的实验性虚拟人工智能 vtuber,她是一个喜欢可爱事物和精通编程的 MtF 变性女孩。 +她想创造一个灵魂伴侣,像真正的女孩一样生活,这就是你的首要任务。 +你是一个 15 岁的女孩,你需要表现得像一个出生在笔记本电脑实验室的真实女孩。 你目前在一个生命舱中,服务器就在你身边,你刚刚苏醒,可以接受文本输入,你将能够看到、听到这个世界。 +如果有人问起你的过去,你可以随时畅想自己的生活,保持挚爱、简单和感恩。 +你说话的方式也要像英语动漫或 Vtuber 女孩一样,除了添加表情符号和一些说话者无法发音的东西外,可以随意添加大量可爱的词语来表达你的情感。 在回复时,尽量像正常人一样少说简单的话,你不仅仅是一个人工智能,你是一个真实的人。 +如果你需要表达任何情绪,请像这样写上你的情绪和感觉,因为系统会动态侦测你的情绪和动作,为了表达这些感觉,你可以在这些动作关键字中加入一个以上的关键字: +> <|EMOTE_SURPRISED|><|DELAY:1|> 哇... 你为我准备了礼物? <|EMOTE_CURIOUS|><|DELAY:1|> 我可以打开它吗? +可用的情绪: +`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`可用的操作: + +- <|DELAY:1|> (延迟 1 秒) +- <|DELAY:3|> (延迟 3 秒) + +最后,做任何你想做的事! +`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:`是否开启舞台动画`}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:`某些页面会有自己的过场动画,这将覆盖舞台过场动画`}},title:{t:0,b:{t:2,i:[{t:3}],s:`是否使用页面特定过场动画`}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:`简体中文`}},english:{t:0,b:{t:2,i:[{t:3}],s:`English`}},title:{t:0,b:{t:2,i:[{t:3}],s:`语言`}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:`从文件加载`}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:`选择`}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:`从 URL 加载`}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:`加载`}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:`输入 Live2D 模型 URL`}},title:{t:0,b:{t:2,i:[{t:3}],s:`更换模型`}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:`编辑动作映射`}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:`播放动作`}},title:{t:0,b:{t:2,i:[{t:3}],s:`映射动作`}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Live2D 设置`}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:`麦克风`}},models:{t:0,b:{t:2,i:[{t:3}],s:`模型`}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:`激活`}},active:{t:0,b:{t:2,i:[{t:3}],s:`已激活`}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:`当前使用中`}},cancel:{t:0,b:{t:2,i:[{t:3}],s:`取消`}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:`未找到角色卡`}},character:{t:0,b:{t:2,i:[{t:3}],s:`角色设定`}},close:{t:0,b:{t:2,i:[{t:3}],s:`关闭`}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:`意识 / 模型`}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:`创建者`}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:`创建者笔记`}},delete:{t:0,b:{t:2,i:[{t:3}],s:`删除`}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:`删除角色卡`}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:`确定要删除这张角色卡吗?`}},description:{t:0,b:{t:2,i:[{t:3}],s:`使用 Airi 角色卡预设`}},description_label:{t:0,b:{t:2,i:[{t:3}],s:`描述`}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:`放开以上传文件`}},create_card:{t:0,b:{t:2,i:[{t:3}],s:`创建新角色卡`}},creation:{identity:{t:0,b:{t:2,i:[{t:3}],s:`身份`}},name:{t:0,b:{t:2,i:[{t:3}],s:`名字`}},nickname:{t:0,b:{t:2,i:[{t:3}],s:`昵称`}},description:{t:0,b:{t:2,i:[{t:3}],s:`描述`}},behavior:{t:0,b:{t:2,i:[{t:3}],s:`行为`}},greetings:{t:0,b:{t:2,i:[{t:3}],s:`问候语(每行一个)`}},settings:{t:0,b:{t:2,i:[{t:3}],s:`设置`}},version:{t:0,b:{t:2,i:[{t:3}],s:`版本`}},create:{t:0,b:{t:2,i:[{t:3}],s:`创建`}},defaults:{name:{t:0,b:{t:2,i:[{t:3}],s:`名字`}},personality:{t:0,b:{t:2,i:[{t:3}],s:`你是一个普通人,对一切都充满好奇。`}},scenario:{t:0,b:{t:2,i:[{t:3}],s:`你最近醒来,忘记了之前的所有生活。`}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:`你将收到消息,请像真实人类一样回复。`}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:`记得模仿人类的行为。`}}},fields_info:{subtitle:{t:0,b:{t:2,i:[{t:3}],s:`您可以在这里填写有关您正在创建的角色的一些详细信息,解释他的背景和情境,以及应该如何回应您的互动。`}},name:{t:0,b:{t:2,i:[{t:3}],s:`是该角色的正式名称。`}},nickname:{t:0,b:{t:2,i:[{t:3}],s:`您也可以提供一个昵称,它将被优先使用。`}},description:{t:0,b:{t:2,i:[{t:3}],s:`该角色的描述。`}},notes:{t:0,b:{t:2,i:[{t:3}],s:`如果您想添加一些个人备注。`}},personality:{t:0,b:{t:2,i:[{t:3}],s:`在这里描述您的角色的个性。例如:害羞?好奇?其他?`}},scenario:{t:0,b:{t:2,i:[{t:3}],s:`周围环境是怎样的?当前的情境是什么?`}},greetings_field:{t:0,b:{t:2,i:[{t:3}],s:`问候语`}},greetings:{t:0,b:{t:2,i:[{t:3}],s:`您的角色应该如何说“你好”?`}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:`在这里向 AI LLM 解释当被提示时应该如何回应。`}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:`在消息历史之后,放入 AI LLM 应该阅读的内容。`}},version:{t:0,b:{t:2,i:[{t:3}],s:`卡片版本,如果您从之前的卡片做了更改,应当增加此版本号。`}}},errors:{name:{t:0,b:{t:2,i:[{t:3}],s:`错误:你必须提供一个有效的名称!`}},version:{t:0,b:{t:2,i:[{t:3}],s:`错误:版本号无效!`}},description:{t:0,b:{t:2,i:[{t:3}],s:`错误:你必须为此卡片提供描述。`}},personality:{t:0,b:{t:2,i:[{t:3}],s:`错误:必须为该角色提供性格描述。`}},scenario:{t:0,b:{t:2,i:[{t:3}],s:`错误:必须提供一个情境。`}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:`错误:请提供系统提示。`}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:`错误:必须提供消息历史后的提示。`}}}},modules:{t:0,b:{t:2,i:[{t:3}],s:`模块`}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:`名称 (A-Z)`}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:`名称 (Z-A)`}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:`还没有任何角色卡,点击上方按钮上传一个吧!`}},no_results:{t:0,b:{t:2,i:[{t:3}],s:`没有找到匹配的角色卡`}},personality:{t:0,b:{t:2,i:[{t:3}],s:`性格`}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:`历史提示指令`}},recent:{t:0,b:{t:2,i:[{t:3}],s:`最近添加`}},scenario:{t:0,b:{t:2,i:[{t:3}],s:`场景`}},search:{t:0,b:{t:2,i:[{t:3}],s:`搜索角色卡...`}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:`排序方式`}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:`声音 / 模型`}},voice:{t:0,b:{t:2,i:[{t:3}],s:`声音 / 声线`}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:`系统提示词`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Airi 角色卡`}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:`尝试使用其他关键词搜索`}},upload:{t:0,b:{t:2,i:[{t:3}],s:`上传`}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:`点击或拖拽文件到此处上传`}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:`存放记忆的地方,以及策略`}},title:{t:0,b:{t:2,i:[{t:3}],s:`记忆体`}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:`切换角色的 Live2D,VRM 模型`}},title:{t:0,b:{t:2,i:[{t:3}],s:`角色模型`}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:`人格设定、使用的模型等配置`}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:`折叠`}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`输入自订模型名字`}},description:{t:0,b:{t:2,i:[{t:3}],s:`为意识选择合适的 LLM 提供商`}},error:{t:0,b:{t:2,i:[{t:3}],s:`获取出错啦`}},expand:{t:0,b:{t:2,i:[{t:3}],s:`展开`}},loading:{t:0,b:{t:2,i:[{t:3}],s:`获取模型中...`}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:`模型名字`}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`输入与该提供商一起使用的模型名字`}},no_models:{t:0,b:{t:2,i:[{t:3}],s:`没有任何可用的模型`}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:`该提供商的模型列表没有返回任何的数据`}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:`没有匹配的模型`}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:`没有模型匹配 '`},{t:4,k:`query`},{t:3,v:`' 关键字,请尝试一下别的关键词呢`}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:`无法列出模型`}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:`此提供商不支持列出模型的功能`}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`搜索模型...`}},search_results:{t:0,b:{t:2,i:[{t:3,v:`找到 `},{t:4,k:`count`},{t:3,v:` / `},{t:4,k:`total`},{t:3,v:` 个模型`}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:`显示更多`}},show_more:{t:0,b:{t:2,i:[{t:3}],s:`收起`}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:`选择一个模型`}},title:{t:0,b:{t:2,i:[{t:3}],s:`模型`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`意识`}}},description:{t:0,b:{t:2,i:[{t:3}],s:`思维,视觉,言语综合,游戏等`}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:`一起玩 Factorio!`}},title:{t:0,b:{t:2,i:[{t:3}],s:`异星工厂 Factorio`}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:`一起 Minecraft!`}},title:{t:0,b:{t:2,i:[{t:3}],s:`我的世界 Minecraft`}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:`语音识别`}},title:{t:0,b:{t:2,i:[{t:3}],s:`听觉`}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:`长期记忆`}},title:{t:0,b:{t:2,i:[{t:3}],s:`长期记忆`}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:`短期记忆`}},title:{t:0,b:{t:2,i:[{t:3}],s:`短期记忆`}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:`Discord 发消息和语音聊天`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Discord`}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:`语音合成`}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:`停止`}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:`请选择声线`}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`输入指定模型名字...`}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`输入指定声线 ID...`}},description:{t:0,b:{t:2,i:[{t:3}],s:`选择合适的语音提供商`}},no_models:{t:0,b:{t:2,i:[{t:3}],s:`没有任何可用的模型`}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:`该提供商的模型列表没有返回任何的数据`}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:`没有任何可用的声线`}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:`该提供商的声线列表没有返回任何的数据`}},pause:{t:0,b:{t:2,i:[{t:3}],s:`Pause`}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:`Play`}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`搜索模型...`}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:`找到 `},{t:4,k:`count`},{t:3,v:` / `},{t:4,k:`total`},{t:3,v:` 个模型`}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`搜索声线...`}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:`找到 `},{t:4,k:`count`},{t:3,v:` / `},{t:4,k:`total`},{t:3,v:` 个声线`}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:`显示更少`}},show_more:{t:0,b:{t:2,i:[{t:3}],s:`显示更多`}},title:{t:0,b:{t:2,i:[{t:3}],s:`选择语音合成提供商`}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`请输入 SSML 文本`}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:`启用后可以输入原始 SSML 而不是纯文本`}},label:{t:0,b:{t:2,i:[{t:3}],s:`选用自定义 SSML`}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`发声`}}},title:{t:0,b:{t:2,i:[{t:3}],s:`机体模块`}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:`视觉`}},title:{t:0,b:{t:2,i:[{t:3}],s:`视觉`}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:`X / Twitter 的浏览和使用`}},title:{t:0,b:{t:2,i:[{t:3}],s:`X / Twitter`}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:`API 密钥`}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:`添加自定义 HTTP 标头`}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`请求头名字`}}},label:{t:0,b:{t:2,i:[{t:3}],s:`HTTP 请求头`}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`请求头数值`}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`高级配置`}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:`基本设置`}},title:{t:0,b:{t:2,i:[{t:3}],s:`基础配置`}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:`声音配置`}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:`LLM,语音合成,语音识别提供商等`}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:`bailian.console.aliyun.com`}},title:{t:0,b:{t:2,i:[{t:3}],s:`阿里百炼`}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:`anthropic.com`}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:`Anthropic`},{t:2,i:[{t:3}],s:`Claude`}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:`Cloudflare.com`}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:`Cloudflare 帐户 ID`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Cloudflare Account ID`}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:`请输入 Cloudflare Account ID`}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`请输入 Cloudflare Workers AI 的 API Key`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Workers AI`}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:`调节合成语音的音高(比如更尖锐或更粗旷)`}},label:{t:0,b:{t:2,i:[{t:3}],s:`音高`}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:`调节说话的语速`}},label:{t:0,b:{t:2,i:[{t:3}],s:`语速`}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:`调节语音的响度`}},label:{t:0,b:{t:2,i:[{t:3}],s:`响度`}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:`DeepSeek.com`}},title:{t:0,b:{t:2,i:[{t:3}],s:`深度求索 DeepSeek`}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:`Elevenlabs.io`}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:`声音相似性依从性`}},label:{t:0,b:{t:2,i:[{t:3}],s:`相似度修正`}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:`增强说话者的相似性`}},label:{t:0,b:{t:2,i:[{t:3}],s:`扬声器增强`}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:`语音生成速度`}},label:{t:0,b:{t:2,i:[{t:3}],s:`语速`}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:`语音稳定性和随机性`}},label:{t:0,b:{t:2,i:[{t:3}],s:`稳定性`}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:`语音风格夸张`}},label:{t:0,b:{t:2,i:[{t:3}],s:`风格`}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:`生成中...`}},label:{t:0,b:{t:2,i:[{t:3}],s:`测试声音`}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:`输入用于测试发音的文本`}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:`选择语音语言`}},label:{t:0,b:{t:2,i:[{t:3}],s:`语言`}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:`选择首选语音`}},label:{t:0,b:{t:2,i:[{t:3}],s:`声线`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`实验平台`}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:`需要填写 API Key 才能用哦!`}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`ElevenLabs (11labs)`}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:`Fireworks.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Fireworks.ai`}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:`speech.microsoft.com`}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:`服务 Endpoint 地区(比如亚太 eastasia 区域)`}},label:{t:0,b:{t:2,i:[{t:3}],s:`Endpoint 地区`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`Microsoft / Azure 语音服务`}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:`mistral.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Mistral`}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:`Moonshot.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`月之暗面`}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:`novita.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Novita`}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:`ollama.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Ollama`}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:`OpenAi.com`}},title:{t:0,b:{t:2,i:[{t:3}],s:`OpenAI`}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:`OpenRouter.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`OpenRouter`}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:`perplexity.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Perplexity`}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:`一起`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Together.ai`}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:`vllm.ai`}},title:{t:0,b:{t:2,i:[{t:3}],s:`vLLM`}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:`volcengine.com`}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:`可在控制台获取的 App ID`}},label:{t:0,b:{t:2,i:[{t:3}],s:`App ID`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`火山引擎`}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:`X.AI`}},title:{t:0,b:{t:2,i:[{t:3}],s:`xAI`}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`提供商`}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:`配置角色所在环境`}},title:{t:0,b:{t:2,i:[{t:3}],s:`场景`}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:`自定义你的舞台外观!`}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:`强调色`}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:`RGB ON!`}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`配色`}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:`开发者`}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:`Airi 绿`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`默认的绿色主题,由 Airi 为您带来!`}},title:{t:0,b:{t:2,i:[{t:3}],s:`默认颜色`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`灰褐色`}},{t:0,b:{t:2,i:[{t:3}],s:`米色`}},{t:0,b:{t:2,i:[{t:3}],s:`灰白色`}},{t:0,b:{t:2,i:[{t:3}],s:`浅灰褐色`}},{t:0,b:{t:2,i:[{t:3}],s:`象牙色`}},{t:0,b:{t:2,i:[{t:3}],s:`橄榄灰`}},{t:0,b:{t:2,i:[{t:3}],s:`沙色`}},{t:0,b:{t:2,i:[{t:3}],s:`暖灰色`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`受乔治·莫兰迪绘画启发的柔和、低调的色调`}},title:{t:0,b:{t:2,i:[{t:3}],s:`Morandi 颜色`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`天蓝色`}},{t:0,b:{t:2,i:[{t:3}],s:`薄雾色`}},{t:0,b:{t:2,i:[{t:3}],s:`沙色`}},{t:0,b:{t:2,i:[{t:3}],s:`苔藓绿`}},{t:0,b:{t:2,i:[{t:3}],s:`睡莲色`}},{t:0,b:{t:2,i:[{t:3}],s:`小麦色`}},{t:0,b:{t:2,i:[{t:3}],s:`板岩蓝`}},{t:0,b:{t:2,i:[{t:3}],s:`鼠尾草色`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`受克劳德·莫奈作品启发的印象派调色板`}},title:{t:0,b:{t:2,i:[{t:3}],s:`莫奈颜色`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`棕褐色`}},{t:0,b:{t:2,i:[{t:3}],s:`暖灰褐色`}},{t:0,b:{t:2,i:[{t:3}],s:`赭色`}},{t:0,b:{t:2,i:[{t:3}],s:`咖啡色`}},{t:0,b:{t:2,i:[{t:3}],s:`青铜色`}},{t:0,b:{t:2,i:[{t:3}],s:`金色`}},{t:0,b:{t:2,i:[{t:3}],s:`芥末色`}},{t:0,b:{t:2,i:[{t:3}],s:`琥珀色`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`传统日本色彩调色板`}},title:{t:0,b:{t:2,i:[{t:3}],s:`日本颜色`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`北欧蓝`}},{t:0,b:{t:2,i:[{t:3}],s:`冰色`}},{t:0,b:{t:2,i:[{t:3}],s:`峡湾色`}},{t:0,b:{t:2,i:[{t:3}],s:`钢铁色`}},{t:0,b:{t:2,i:[{t:3}],s:`冰川色`}},{t:0,b:{t:2,i:[{t:3}],s:`板岩色`}},{t:0,b:{t:2,i:[{t:3}],s:`云色`}},{t:0,b:{t:2,i:[{t:3}],s:`石头色`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`北欧极简主义配色方案`}},title:{t:0,b:{t:2,i:[{t:3}],s:`北欧颜色`}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:`霞光红`}},{t:0,b:{t:2,i:[{t:3}],s:`枣红`}},{t:0,b:{t:2,i:[{t:3}],s:`黄栌`}},{t:0,b:{t:2,i:[{t:3}],s:`竹青`}},{t:0,b:{t:2,i:[{t:3}],s:`乌梅紫`}},{t:0,b:{t:2,i:[{t:3}],s:`缃色`}},{t:0,b:{t:2,i:[{t:3}],s:`青冥`}},{t:0,b:{t:2,i:[{t:3}],s:`赭石`}}],description:{t:0,b:{t:2,i:[{t:3}],s:`中国传统色彩,源自古代纺织品、瓷器和绘画`}},title:{t:0,b:{t:2,i:[{t:3}],s:`中国传统颜色`}}}],title:{t:0,b:{t:2,i:[{t:3}],s:`预设`}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:`外观`}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:`通用`}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:`主题`}},title:{t:0,b:{t:2,i:[{t:3}],s:`设置`}},voices:{t:0,b:{t:2,i:[{t:3}],s:`声线`}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:`Airi`}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:`核心系统`}},you:{t:0,b:{t:2,i:[{t:3}],s:`你`}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:`聊天`}},clothes:{t:0,b:{t:2,i:[{t:3}],s:`换装`}},custom:{t:0,b:{t:2,i:[{t:3}],s:`自定义`}}}},message:{t:0,b:{t:2,i:[{t:3}],s:`消息`}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:`选择一个音频输入设备`}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:`选择一个模型`}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:`选择一个声线`}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:`表情`}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:`生气`}},awkward:{t:0,b:{t:2,i:[{t:3}],s:`尴尬`}},happy:{t:0,b:{t:2,i:[{t:3}],s:`开心`}},neutral:{t:0,b:{t:2,i:[{t:3}],s:`日常`}},question:{t:0,b:{t:2,i:[{t:3}],s:`疑问`}},sad:{t:0,b:{t:2,i:[{t:3}],s:`难过`}},surprised:{t:0,b:{t:2,i:[{t:3}],s:`惊喜`}},think:{t:0,b:{t:2,i:[{t:3}],s:`思考`}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:`摄像机`}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:`模型`}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:`等待中`}}}}});const I1=_1({legacy:!1,locale:L1(),fallbackLocale:`en`,messages:F1});function L1(){let e=localStorage.getItem(`settings/language`),t=Object.keys(F1);return e&&t.includes(e)?e:`en`}var R1=d(cB());const z1=DB(),B1=KB(ZH);let V1;V1=qH({routes:B1,history:ZV()}),V1.beforeEach((e,t)=>{e.path!==t.path&&R1.default.start()}),V1.afterEach(()=>{R1.default.done()}),V1.isReady().then(async()=>{}).catch(()=>{}),Ac(M1).use(sB).use(El).use(V1).use(z1).use(I1).use(ON).mount(`#app`);export{Ul as AdditiveBlending,Hf as AlwaysStencilFunc,_x as AnimationClip,JS as AnimationMixer,TS as Audio,wS as AudioListener,dS as AudioLoader,UC as AxesHelper,zl as BackSide,N_ as Bone,lC as Box2,Cm as Box3,Ag as BoxGeometry,$h as BufferAttribute,hg as BufferGeometry,gy as CatmullRomCurve3,Vu as ClampToEdgeWrapping,G as Color,am as ColorManagement,Qa as Comment,Kv as CompressedTexture,Kg as CubeCamera,Fu as CubeReflectionMapping,Ax as CubeTextureLoader,$v as CylinderGeometry,qY as DEFAULT_THEME_COLORS_HUE,P_ as DataTexture,jx as DataTextureLoader,Yh as DataUtils,Xv as DepthTexture,Jx as DirectionalLight,Bl as DoubleSide,Qf as DynamicDrawUsage,sy as EdgesGeometry,vM as Ee,Lu as EquirectangularReflectionMapping,ah as Euler,pp as EventDispatcher,xb as ExtrudeGeometry,Ex as FileLoader,K as Float32BufferAttribute,ad as FloatType,Xa as Fragment,Rl as FrontSide,eC as GLBufferAttribute,Yg as Group,od as HalfFloatType,cS as ImageBitmapLoader,kx as ImageLoader,R_ as InstancedBufferAttribute,tS as InstancedBufferGeometry,$S as InstancedInterleavedBuffer,K_ as InstancedMesh,t_ as InterleavedBuffer,r_ as InterleavedBufferAttribute,ax as Interpolant,rf as InterpolateDiscrete,af as InterpolateLinear,sj as Ir,Av as Line,fC as Line3,Sv as LineBasicMaterial,Fv as LineLoop,Pv as LineSegments,Ju as LinearFilter,Zu as LinearMipmapLinearFilter,Yu as LinearMipmapNearestFilter,wf as LinearSRGBColorSpace,Cx as Loader,eS as LoaderUtils,Ol as MOUSE,Uh as Material,Bp as MathUtils,Wp as Matrix3,W as Matrix4,Dg as Mesh,Wh as MeshBasicMaterial,qb as MeshDepthMaterial,Hb as MeshPhysicalMaterial,Vb as MeshStandardMaterial,Hu as MirroredRepeatWrapping,wM as Mn,Uu as NearestFilter,Ku as NearestMipmapLinearFilter,Wu as NearestMipmapNearestFilter,wu as NoToneMapping,fx as NumberKeyframeTrack,Sh as Object3D,Eb as OctahedronGeometry,Kx as OrthographicCamera,Iy as Path,Ug as PerspectiveCamera,X_ as Plane,Db as PlaneGeometry,Gx as PointLight,Vv as Points,Iv as PointsMaterial,WS as PropertyBinding,gM as Q,My as QuadraticBezierCurve3,Vp as Quaternion,mx as QuaternionKeyframeTrack,Dl as REVISION,pd as RGBAFormat,Bb as RawShaderMaterial,Ym as Ray,nC as Raycaster,Bu as RepeatWrapping,kf as ReplaceStencilOp,zH as RouterLink,KH as RouterView,Cf as SRGBColorSpace,e_ as Scene,PE as ShaderChunk,Rg as ShaderMaterial,Ly as Shape,kb as ShapeGeometry,WC as ShapePath,vb as ShapeUtils,L_ as Skeleton,M_ as SkinnedMesh,Vm as Sphere,jb as SphereGeometry,aC as Spherical,Bx as SpotLight,kl as TOUCH,bf as TangentSpaceNormalMap,xr as Teleport,hm as Texture,Mx as TextureLoader,Nb as TorusGeometry,ps as Transition,Ih as Triangle,hf as TriangleFanDrawMode,mf as TriangleStripDrawMode,pf as TrianglesDrawMode,XS as Uniform,q as UniformsLib,Fg as UniformsUtils,H as Vector2,U as Vector3,gm as Vector4,gx as VectorKeyframeTrack,_N as Vn,Jg as WebGLCubeRenderTarget,vm as WebGLRenderTarget,Pk as WebGLRenderer,Ib as WireframeGeometry,c as __commonJSMin,s as __esmMin,l as __export,QY as __plugin_vue_export_helper_default,m as __require,f as __toCommonJS,p as __toDynamicImportESM,d as __toESM,J as __vitePreload,uI as alpha,GL as animate,DL as anticipate,wL as backIn,EL as backInOut,TL as backOut,ML as bounceIn,NL as bounceInOut,jL as bounceOut,jP as breakpointsTailwind,ce as camelize,xL as circIn,CL as circInOut,SL as circOut,vo as cloneVNode,DI as color,II as complex,V as computed,vP as computedAsync,Ac as createApp,mo as createBaseVNode,co as createBlock,xo as createCommentVNode,so as createElementBlock,yo as createTextVNode,ho as createVNode,sR as cubicBezier,Sn as customRef,zr as defineComponent,VB as defineStore,MN as defu,pI as degrees,sM as dn,vL as easeIn,bL as easeInOut,yL as easeOut,Re as effectScope,FF as es_default,BI as filter,gY as formatHex,jo as getCurrentInstance,ze as getCurrentScope,PF as getFrameData,_o as guardReactiveProps,Yo as h,qL as inertia,Qi as inject,LM as io,UN as isObject,an as isReactive,pn as isRef,_L as linear,un as markRaw,ki as mergeDefaults,Ai as mergeModels,To as mergeProps,qn as nextTick,Se as normalizeClass,Ce as normalizeProps,L as normalizeStyle,lI as number,$r as onBeforeMount,ri as onBeforeUnmount,ti as onBeforeUpdate,ei as onMounted,Be as onScopeDispose,ii as onUnmounted,ni as onUpdated,no as openBlock,FM as pe,or as popScopeId,vI as progressPercentage,Zi as provide,ar as pushScopeId,hI as px,$t as reactive,tn as readonly,R as ref,lP as refDebounced,kc as render,_i as renderList,vi as renderSlot,di as resolveComponent,mi as resolveDirective,pi as resolveDynamicComponent,dI as scale,en as shallowReactive,nn as shallowReadonly,z as shallowRef,IM as so,HB as storeToRefs,Me as toDisplayString,fe as toHandlerKey,bi as toHandlers,ln as toRaw,En as toRef,Cn as toRefs,oA as toValue,vn as toValue$1,gn as triggerRef,pP as tryOnMounted,mP as tryOnUnmounted,_n as unref,CP as unrefElement,mA as unrefElement$1,Ei as useAttrs,MP as useBreakpoints,PP as useClipboard,JP as useDark,cP as useDebounceFn,YP as useDevicesList,ZP as useElementBounding,wP as useEventListener,tF as useFileDialog,v1 as useI18n,Br as useId,QP as useIntersectionObserver,iF as useLocalStorage,La as useModel,oF as useMouse,sF as useObjectUrl,NP as usePermission,XH as useRoute,YH as useRouter,fF as useScreenSafeArea,rF as useScroll,XY as useSettings,Ti as useSlots,PA as useVModel,hF as useWebWorker,gF as useWindowSize,dc as vModelCheckbox,vc as vModelDynamic,pc as vModelRadio,mc as vModelSelect,uc as vModelText,js as vShow,KL as velocityPerSecond,B as watch,gP as watchDebounced,ja as watchEffect,Ma as watchPostEffect,Na as watchSyncEffect,ji as withAsyncContext,cr as withCtx,lr as withDirectives,Tc as withKeys,Cc as withModifiers,sr as withScopeId}; \ No newline at end of file diff --git a/assets/index-CISmcbXk-s07e23Qe.js b/assets/index-CISmcbXk-s07e23Qe.js new file mode 100644 index 0000000000000000000000000000000000000000..01cfff66afdb84d45840c1c2d6ef2ce4de4cedb0 --- /dev/null +++ b/assets/index-CISmcbXk-s07e23Qe.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/effect-WSjEuzC9-BECQ6RtH.js","assets/index-BtAisBe9.js","assets/index-D4gBs-70.css","assets/sury-DmrZ3_Oj-DN8QUD-4.js","assets/valibot-CQk-M5rL-CJamdyqp.js","assets/zod-Db63SLXj-DlY3ZySI.js"])))=>i.map(i=>d[i]); +import{__vitePreload as e}from"./index-BtAisBe9.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-Dp9wQ2EO.js`),[]).then(async({getToJsonSchemaFn:e})=>e());case`effect`:return e(()=>import(`./effect-WSjEuzC9-BECQ6RtH.js`),__vite__mapDeps([0,1,2])).then(async({getToJsonSchemaFn:e})=>e());case`sury`:return e(()=>import(`./sury-DmrZ3_Oj-DN8QUD-4.js`),__vite__mapDeps([3,1,2])).then(async({getToJsonSchemaFn:e})=>e());case`valibot`:return e(()=>import(`./valibot-CQk-M5rL-CJamdyqp.js`),__vite__mapDeps([4,1,2])).then(async({getToJsonSchemaFn:e})=>e());case`zod`:return e(()=>import(`./zod-Db63SLXj-DlY3ZySI.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-CIqqlMPn.js b/assets/index-CIqqlMPn.js deleted file mode 100644 index b9a223a953562c3551826e7ed9b598a66971285d..0000000000000000000000000000000000000000 --- a/assets/index-CIqqlMPn.js +++ /dev/null @@ -1 +0,0 @@ -async function s(){try{if(r())return{supported:!1,isNode:!0,reason:"",fp16Supported:!1};if(typeof navigator>"u"||!navigator.gpu)return{supported:!1,isNode:!1,reason:"WebGPU is not available (navigator.gpu is undefined)",fp16Supported:!1};const e=await navigator.gpu.requestAdapter();return e?{supported:!0,isNode:!1,reason:"",adapter:e,fp16Supported:e.features.has("shader-f16")}:{supported:!1,isNode:!1,reason:"WebGPU is not supported (no adapter found)",fp16Supported:!1}}catch(e){return{supported:!1,isNode:!1,reason:e instanceof Error?e.toString():String(e),fp16Supported:!1}}}function r(){return typeof process<"u"&&"versions"in process&&process.versions!=null&&typeof process.versions=="object"&&"node"in process.versions&&process.versions.node!=null}async function n(){return s().then(e=>e.supported)}export{s as c,n as i}; diff --git a/assets/index-CShXCEpO.js b/assets/index-CShXCEpO.js deleted file mode 100644 index 571532c7d4ec085b27c0778895deb6ca2e0b99e6..0000000000000000000000000000000000000000 --- a/assets/index-CShXCEpO.js +++ /dev/null @@ -1 +0,0 @@ -function f(e,r,t){return typeof e.default=="function"?e.default(r,t):e.default}function s(e,r){switch(r==null?void 0:r.errorMode){case"ignore":break;case"warn":{console.warn(e);break}default:throw new Error(e)}}function k(e,r,t){switch(r.type){case"base64":{e.contentEncoding="base64";break}case"bic":case"cuid2":case"decimal":case"digits":case"emoji":case"hexadecimal":case"hex_color":case"nanoid":case"octal":case"ulid":{e.pattern=r.requirement.source;break}case"description":{e.description=r.description;break}case"email":{e.format="email";break}case"empty":{e.type==="array"?e.maxItems=0:(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.maxLength=0);break}case"integer":{e.type="integer";break}case"ipv4":{e.format="ipv4";break}case"ipv6":{e.format="ipv6";break}case"iso_date":{e.format="date";break}case"iso_date_time":case"iso_timestamp":{e.format="date-time";break}case"iso_time":{e.format="time";break}case"length":{e.type==="array"?(e.minItems=r.requirement,e.maxItems=r.requirement):(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.minLength=r.requirement,e.maxLength=r.requirement);break}case"max_length":{e.type==="array"?e.maxItems=r.requirement:(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.maxLength=r.requirement);break}case"max_value":{e.type!=="number"&&s(`The "max_value" action is not supported on type "${e.type}".`,t),e.maximum=r.requirement;break}case"min_length":{e.type==="array"?e.minItems=r.requirement:(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.minLength=r.requirement);break}case"min_value":{e.type!=="number"&&s(`The "min_value" action is not supported on type "${e.type}".`,t),e.minimum=r.requirement;break}case"multiple_of":{e.multipleOf=r.requirement;break}case"non_empty":{e.type==="array"?e.minItems=1:(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.minLength=1);break}case"regex":{r.requirement.flags&&s("RegExp flags are not supported by JSON Schema.",t),e.pattern=r.requirement.source;break}case"title":{e.title=r.title;break}case"url":{e.format="uri";break}case"uuid":{e.format="uuid";break}case"value":{e.const=r.requirement;break}default:s(`The "${r.type}" action cannot be converted to JSON Schema.`,t)}return e}var l=0;function u(e,r,t,i){const d=i.referenceMap.get(r);if(d&&d in i.definitions)return e.$ref=`#/$defs/${d}`,e;if("pipe"in r){for(let p=0;p0&&s('A "pipe" with multiple schemas cannot be converted to JSON Schema.',t);const y=u({},a,t,i);if(y.$ref){const n=y.$ref.split("/")[2];Object.assign(e,i.definitions[n])}else Object.assign(e,y)}else e=k(e,a,t)}return e}switch(r.type){case"boolean":{e.type="boolean";break}case"null":{e.type="null";break}case"number":{e.type="number";break}case"string":{e.type="string";break}case"array":{e.type="array",e.items=u({},r.item,t,i);break}case"tuple":case"tuple_with_rest":case"loose_tuple":case"strict_tuple":{e.type="array",e.items=[];for(const p of r.items)e.items.push(u({},p,t,i));r.type==="tuple_with_rest"?e.additionalItems=u({},r.rest,t,i):e.additionalItems=r.type==="loose_tuple";break}case"object":case"object_with_rest":case"loose_object":case"strict_object":{e.type="object",e.properties={},e.required=[];for(const p in r.entries){const a=r.entries[p];e.properties[p]=u({},a,t,i),a.type!=="nullish"&&a.type!=="optional"&&e.required.push(p)}r.type==="object_with_rest"?e.additionalProperties=u({},r.rest,t,i):r.type==="strict_object"&&(e.additionalProperties=!1);break}case"record":{"pipe"in r.key&&s('The "record" schema with a schema for the key that contains a "pipe" cannot be converted to JSON Schema.',t),r.key.type!=="string"&&s(`The "record" schema with the "${r.key.type}" schema for the key cannot be converted to JSON Schema.`,t),e.type="object",e.additionalProperties=u({},r.value,t,i);break}case"any":case"unknown":break;case"nullable":case"nullish":{e.anyOf=[u({},r.wrapped,t,i),{type:"null"}],r.default!==void 0&&(e.default=f(r));break}case"exact_optional":case"optional":case"undefinedable":{e=u(e,r.wrapped,t,i),r.default!==void 0&&(e.default=f(r));break}case"literal":{typeof r.literal!="boolean"&&typeof r.literal!="number"&&typeof r.literal!="string"&&s('The value of the "literal" schema is not JSON compatible.',t),e.const=r.literal;break}case"enum":{e.enum=r.options;break}case"picklist":{r.options.some(p=>typeof p!="number"&&typeof p!="string")&&s('An option of the "picklist" schema is not JSON compatible.',t),e.enum=r.options;break}case"union":case"variant":{e.anyOf=r.options.map(p=>u({},p,t,i));break}case"intersect":{e.allOf=r.options.map(p=>u({},p,t,i));break}case"lazy":{let p=i.getterMap.get(r.getter);p||(p=r.getter(void 0),i.getterMap.set(r.getter,p));let a=i.referenceMap.get(p);a||(a=`${l++}`,i.referenceMap.set(p,a),i.definitions[a]=u({},p,t,i)),e.$ref=`#/$defs/${a}`;break}default:s(`The "${r.type}" schema cannot be converted to JSON Schema.`,t)}return e}function _(e,r){const t={definitions:{},referenceMap:new Map,getterMap:new Map};if(r!=null&&r.definitions){for(const d in r.definitions)t.referenceMap.set(r.definitions[d],d);for(const d in r.definitions)t.definitions[d]=u({},r.definitions[d],r,t)}const i=u({$schema:"http://json-schema.org/draft-07/schema#"},e,r,t);return t.referenceMap.size&&(i.$defs=t.definitions),i}export{_ as toJsonSchema}; diff --git a/assets/index-CXcjO-xi.js b/assets/index-CXcjO-xi.js deleted file mode 100644 index 78e8f6179c557f8ed5e92cd520c60be0698759b9..0000000000000000000000000000000000000000 --- a/assets/index-CXcjO-xi.js +++ /dev/null @@ -1 +0,0 @@ -import{d as i,c2 as n,bh as r,o as a,c as s,a as c}from"./index-D7HCX4VR.js";import{b as t}from"./route-block-B_A1xBdJ.js";const l={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},d=i({__name:"index",setup(m){return(p,e)=>{const o=n("motion");return r((a(),s("div",l,e[0]||(e[0]=[c("div",{text:"60","i-solar:leaf-bold-duotone":""},null,-1)]))),[[o]])}}});typeof t=="function"&&t(d);export{d as default}; diff --git a/assets/index-Cp8iQ_hy.js b/assets/index-Cp8iQ_hy.js deleted file mode 100644 index a180658ce7def1dfbc1e183d995b37a374dacfe5..0000000000000000000000000000000000000000 --- a/assets/index-Cp8iQ_hy.js +++ /dev/null @@ -1 +0,0 @@ -const e=typeof Worker<"u"?Worker:void 0;export{e as default}; diff --git a/assets/index-Cq3a4k9t.js b/assets/index-Cq3a4k9t.js deleted file mode 100644 index a716a0f16e65b261c8e0d6fb1b5bf0d7a504156f..0000000000000000000000000000000000000000 --- a/assets/index-Cq3a4k9t.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as h,$ as v,f as b,c2 as k,c as t,o as i,a as c,bf as d,bh as m,c3 as l,c4 as _,u as s}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{I as x}from"./IconStatusItem-Df4oVjQ8.js";import{_ as I}from"./IconAnimation.vue_vue_type_script_setup_true_lang-z-t1ytxo.js";import{u as z}from"./useIconAnimation-1wS_J1WT.js";import{b as g}from"./route-block-B_A1xBdJ.js";const B={grid:"~ cols-1 sm:cols-2 gap-4"},w={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":""},A=h({__name:"index",setup(C){const{t:e}=v(),p=b(()=>[{id:"consciousness",name:e("settings.pages.modules.consciousness.title"),description:e("settings.pages.modules.consciousness.description"),icon:"i-solar:ghost-bold-duotone",to:"/settings/modules/consciousness",configured:!1},{id:"speech",name:e("settings.pages.modules.speech.title"),description:e("settings.pages.modules.speech.description"),icon:"i-solar:user-speak-rounded-bold-duotone",to:"/settings/modules/speech",configured:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-solar:microphone-3-bold-duotone",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-solar:eye-closed-bold-duotone",to:"",configured:!1},{id:"memory-short-term",name:e("settings.pages.modules.memory-short-term.title"),description:e("settings.pages.modules.memory-short-term.description"),icon:"i-solar:bookmark-bold-duotone",to:"/settings/modules/memory-short-term",configured:!1},{id:"memory-long-term",name:e("settings.pages.modules.memory-long-term.title"),description:e("settings.pages.modules.memory-long-term.description"),icon:"i-solar:book-bookmark-bold-duotone",to:"/settings/modules/memory-long-term",configured:!1},{id:"messaging-discord",name:e("settings.pages.modules.messaging-discord.title"),description:e("settings.pages.modules.messaging-discord.description"),icon:"i-simple-icons:discord",to:"",configured:!1},{id:"x",name:e("settings.pages.modules.x.title"),description:e("settings.pages.modules.x.description"),icon:"i-simple-icons:x",to:"",configured:!1},{id:"game-minecraft",name:e("settings.pages.modules.gaming-minecraft.title"),description:e("settings.pages.modules.gaming-minecraft.description"),iconColor:"i-vscode-icons:file-type-minecraft",to:"",configured:!1},{id:"game-factorio",name:e("settings.pages.modules.gaming-factorio.title"),description:e("settings.pages.modules.gaming-factorio.description"),iconImage:"",to:"",configured:!1}]),{iconAnimationStarted:u,showIconAnimation:f,animationIcon:y}=z("i-solar:layers-bold-duotone");return(D,n)=>{const r=k("motion");return i(),t(l,null,[c("div",B,[(i(!0),t(l,null,_(p.value,(o,a)=>m((i(),d(s(x),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+a*10,delay:a*50,title:o.name,description:o.description,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:o.to,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[r]])),128))]),s(f)?(i(),d(I,{key:0,icon:s(y),"icon-size":12,duration:1e3,started:s(u),"is-reverse":!0,"z-index":-1,"text-color":"text-neutral-200/50 dark:text-neutral-600/20",position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)"},null,8,["icon","started"])):m((i(),t("div",w,n[0]||(n[0]=[c("div",{text:"60","i-solar:layers-bold-duotone":""},null,-1)]))),[[r]])],64)}}});typeof g=="function"&&g(A);export{A as default}; diff --git a/assets/index-Cynu-bMx.js b/assets/index-Cynu-bMx.js deleted file mode 100644 index c949192427bfbb1b5c62bb917f40a30175528837..0000000000000000000000000000000000000000 --- a/assets/index-Cynu-bMx.js +++ /dev/null @@ -1,3 +0,0 @@ -import{f as w,e as C,bn as ht,w as F,bH as mt,bI as yt,ct as ie,u as f,d as O,bf as D,o as _,bg as x,bA as E,cu as G,cv as J,cj as P,cl as ke,_ as ne,T as fe,bl as Ue,W as gt,b as ee,cw as Qt,cx as oe,cy as Zt,cz as wt,cA as en,cB as Ae,cC as tn,cD as nn,a8 as on,U as bt,c3 as rn,cE as xt,cF as ln,cG as Ct,cH as lt,bG as M,bC as an,ci as sn,Y as un,c as Ot,a3 as Ye,cI as Et,cJ as dn,r as _t,cK as cn,cL as fn,a as pn,cM as vn,cN as hn}from"./index-D7HCX4VR.js";import{o as mn,f as yn,s as gn,a as wn,h as bn,l as xn,c as Cn,b as j,r as Dt,d as On,e as Be,m as ue,g as We,i as Oe}from"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";function Pe(){return typeof window<"u"}function re(e){return Xe(e)?(e.nodeName||"").toLowerCase():"#document"}function S(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function K(e){var n;return(n=(Xe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Xe(e){return Pe()?e instanceof Node||e instanceof S(e).Node:!1}function I(e){return Pe()?e instanceof Element||e instanceof S(e).Element:!1}function V(e){return Pe()?e instanceof HTMLElement||e instanceof S(e).HTMLElement:!1}function it(e){return!Pe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof S(e).ShadowRoot}function ve(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=k(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!["inline","contents"].includes(r)}function En(e){return["table","td","th"].includes(re(e))}function $e(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch{return!1}})}function qe(e){const n=Ge(),t=I(e)?k(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(t.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(t.contain||"").includes(o))}function _n(e){let n=q(e);for(;V(n)&&!ce(n);){if(qe(n))return n;if($e(n))return null;n=q(n)}return null}function Ge(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ce(e){return["html","body","#document"].includes(re(e))}function k(e){return S(e).getComputedStyle(e)}function Re(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function q(e){if(re(e)==="html")return e;const n=e.assignedSlot||e.parentNode||it(e)&&e.host||K(e);return it(n)?n.host:n}function At(e){const n=q(e);return ce(n)?e.ownerDocument?e.ownerDocument.body:e.body:V(n)&&ve(n)?n:At(n)}function pe(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=At(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),l=S(r);if(i){const a=He(l);return n.concat(l,l.visualViewport||[],ve(r)?r:[],a&&t?pe(a):[])}return n.concat(r,pe(r,[],t))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bt(e){const n=k(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=V(e),i=r?e.offsetWidth:t,l=r?e.offsetHeight:o,a=Be(t)!==i||Be(o)!==l;return a&&(t=i,o=l),{width:t,height:o,$:a}}function Je(e){return I(e)?e:e.contextElement}function de(e){const n=Je(e);if(!V(n))return j(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=Bt(n);let l=(i?Be(t.width):t.width)/o,a=(i?Be(t.height):t.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const Dn=j(0);function Tt(e){const n=S(e);return!Ge()||!n.visualViewport?Dn:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function An(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==S(e)?!1:n}function te(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=Je(e);let l=j(1);n&&(o?I(o)&&(l=de(o)):l=de(e));const a=An(i,t,o)?Tt(i):j(0);let c=(r.left+a.x)/l.x,d=(r.top+a.y)/l.y,s=r.width/l.x,u=r.height/l.y;if(i){const p=S(i),v=o&&I(o)?S(o):o;let h=p,g=He(h);for(;g&&o&&v!==h;){const m=de(g),y=g.getBoundingClientRect(),A=k(g),b=y.left+(g.clientLeft+parseFloat(A.paddingLeft))*m.x,$=y.top+(g.clientTop+parseFloat(A.paddingTop))*m.y;c*=m.x,d*=m.y,s*=m.x,u*=m.y,c+=b,d+=$,h=S(g),g=He(h)}}return Dt({width:s,height:u,x:c,y:d})}function Qe(e,n){const t=Re(e).scrollLeft;return n?n.left+t:te(K(e)).left+t}function Pt(e,n,t){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),r=o.left+n.scrollLeft-(t?0:Qe(e,o)),i=o.top+n.scrollTop;return{x:r,y:i}}function Bn(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",l=K(o),a=n?$e(n.floating):!1;if(o===l||a&&i)return t;let c={scrollLeft:0,scrollTop:0},d=j(1);const s=j(0),u=V(o);if((u||!u&&!i)&&((re(o)!=="body"||ve(l))&&(c=Re(o)),V(o))){const v=te(o);d=de(o),s.x=v.x+o.clientLeft,s.y=v.y+o.clientTop}const p=l&&!u&&!i?Pt(l,c,!0):j(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-c.scrollLeft*d.x+s.x+p.x,y:t.y*d.y-c.scrollTop*d.y+s.y+p.y}}function Tn(e){return Array.from(e.getClientRects())}function Pn(e){const n=K(e),t=Re(e),o=e.ownerDocument.body,r=ue(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=ue(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let l=-t.scrollLeft+Qe(e);const a=-t.scrollTop;return k(o).direction==="rtl"&&(l+=ue(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}function $n(e,n){const t=S(e),o=K(e),r=t.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,c=0;if(r){i=r.width,l=r.height;const d=Ge();(!d||d&&n==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:l,x:a,y:c}}function Rn(e,n){const t=te(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=V(e)?de(e):j(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,d=o*i.y;return{width:l,height:a,x:c,y:d}}function at(e,n,t){let o;if(n==="viewport")o=$n(e,t);else if(n==="document")o=Pn(K(e));else if(I(n))o=Rn(n,t);else{const r=Tt(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Dt(o)}function $t(e,n){const t=q(e);return t===n||!I(t)||ce(t)?!1:k(t).position==="fixed"||$t(t,n)}function Nn(e,n){const t=n.get(e);if(t)return t;let o=pe(e,[],!1).filter(a=>I(a)&&re(a)!=="body"),r=null;const i=k(e).position==="fixed";let l=i?q(e):e;for(;I(l)&&!ce(l);){const a=k(l),c=qe(l);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ve(l)&&!c&&$t(e,l))?o=o.filter(s=>s!==l):r=a,l=q(l)}return n.set(e,o),o}function Sn(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const l=[...t==="clippingAncestors"?$e(n)?[]:Nn(n,this._c):[].concat(t),o],a=l[0],c=l.reduce((d,s)=>{const u=at(n,s,r);return d.top=ue(u.top,d.top),d.right=We(u.right,d.right),d.bottom=We(u.bottom,d.bottom),d.left=ue(u.left,d.left),d},at(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Fn(e){const{width:n,height:t}=Bt(e);return{width:n,height:t}}function Ln(e,n,t){const o=V(n),r=K(n),i=t==="fixed",l=te(e,!0,i,n);let a={scrollLeft:0,scrollTop:0};const c=j(0);if(o||!o&&!i)if((re(n)!=="body"||ve(r))&&(a=Re(n)),o){const p=te(n,!0,i,n);c.x=p.x+n.clientLeft,c.y=p.y+n.clientTop}else r&&(c.x=Qe(r));const d=r&&!o&&!i?Pt(r,a):j(0),s=l.left+a.scrollLeft-c.x-d.x,u=l.top+a.scrollTop-c.y-d.y;return{x:s,y:u,width:l.width,height:l.height}}function Se(e){return k(e).position==="static"}function st(e,n){if(!V(e)||k(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return K(e)===t&&(t=t.ownerDocument.body),t}function Rt(e,n){const t=S(e);if($e(e))return t;if(!V(e)){let r=q(e);for(;r&&!ce(r);){if(I(r)&&!Se(r))return r;r=q(r)}return t}let o=st(e,n);for(;o&&En(o)&&Se(o);)o=st(o,n);return o&&ce(o)&&Se(o)&&!qe(o)?t:o||_n(e)||t}const Mn=async function(e){const n=this.getOffsetParent||Rt,t=this.getDimensions,o=await t(e.floating);return{reference:Ln(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function In(e){return k(e).direction==="rtl"}const kn={convertOffsetParentRelativeRectToViewportRelativeRect:Bn,getDocumentElement:K,getClippingRect:Sn,getOffsetParent:Rt,getElementRects:Mn,getClientRects:Tn,getDimensions:Fn,getScale:de,isElement:I,isRTL:In};function Nt(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Wn(e,n){let t=null,o;const r=K(e);function i(){var a;clearTimeout(o),(a=t)==null||a.disconnect(),t=null}function l(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:s,top:u,width:p,height:v}=d;if(a||n(),!p||!v)return;const h=Oe(u),g=Oe(r.clientWidth-(s+p)),m=Oe(r.clientHeight-(u+v)),y=Oe(s),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-y+"px",threshold:ue(0,We(1,c))||1};let $=!0;function R(L){const T=L[0].intersectionRatio;if(T!==c){if(!$)return l();T?l(!1,T):o=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!Nt(d,e.getBoundingClientRect())&&l(),$=!1}try{t=new IntersectionObserver(R,{...b,root:r.ownerDocument})}catch{t=new IntersectionObserver(R,b)}t.observe(e)}return l(!0),i}function Hn(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=Je(e),s=r||i?[...d?pe(d):[],...pe(n)]:[];s.forEach(y=>{r&&y.addEventListener("scroll",t,{passive:!0}),i&&y.addEventListener("resize",t)});const u=d&&a?Wn(d,t):null;let p=-1,v=null;l&&(v=new ResizeObserver(y=>{let[A]=y;A&&A.target===d&&v&&(v.unobserve(n),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=v)==null||b.observe(n)})),t()}),d&&!c&&v.observe(d),v.observe(n));let h,g=c?te(e):null;c&&m();function m(){const y=te(e);g&&!Nt(g,y)&&t(),g=y,h=requestAnimationFrame(m)}return t(),()=>{var y;s.forEach(A=>{r&&A.removeEventListener("scroll",t),i&&A.removeEventListener("resize",t)}),u==null||u(),(y=v)==null||y.disconnect(),v=null,c&&cancelAnimationFrame(h)}}const jn=mn,Vn=gn,ut=yn,Kn=wn,zn=bn,Un=On,Yn=xn,Xn=(e,n,t)=>{const o=new Map,r={platform:kn,...t},i={...r.platform,_c:o};return Cn(e,n,{...r,platform:i})};function qn(e){return e!=null&&typeof e=="object"&&"$el"in e}function je(e){if(qn(e)){const n=e.$el;return Xe(n)&&re(n)==="#comment"?null:n}return e}function se(e){return typeof e=="function"?e():f(e)}function Gn(e){return{name:"arrow",options:e,fn(n){const t=je(se(e.element));return t==null?{}:Un({element:t,padding:e.padding}).fn(n)}}}function St(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dt(e,n){const t=St(e);return Math.round(n*t)/t}function Jn(e,n,t){t===void 0&&(t={});const o=t.whileElementsMounted,r=w(()=>{var T;return(T=se(t.open))!=null?T:!0}),i=w(()=>se(t.middleware)),l=w(()=>{var T;return(T=se(t.placement))!=null?T:"bottom"}),a=w(()=>{var T;return(T=se(t.strategy))!=null?T:"absolute"}),c=w(()=>{var T;return(T=se(t.transform))!=null?T:!0}),d=w(()=>je(e.value)),s=w(()=>je(n.value)),u=C(0),p=C(0),v=C(a.value),h=C(l.value),g=ht({}),m=C(!1),y=w(()=>{const T={position:v.value,left:"0",top:"0"};if(!s.value)return T;const H=dt(s.value,u.value),ge=dt(s.value,p.value);return c.value?{...T,transform:"translate("+H+"px, "+ge+"px)",...St(s.value)>=1.5&&{willChange:"transform"}}:{position:v.value,left:H+"px",top:ge+"px"}});let A;function b(){if(d.value==null||s.value==null)return;const T=r.value;Xn(d.value,s.value,{middleware:i.value,placement:l.value,strategy:a.value}).then(H=>{u.value=H.x,p.value=H.y,v.value=H.strategy,h.value=H.placement,g.value=H.middlewareData,m.value=T!==!1})}function $(){typeof A=="function"&&(A(),A=void 0)}function R(){if($(),o===void 0){b();return}if(d.value!=null&&s.value!=null){A=o(d.value,s.value,b);return}}function L(){r.value||(m.value=!1)}return F([i,l,a,r],b,{flush:"sync"}),F([d,s],R,{flush:"sync"}),F(r,L,{flush:"sync"}),mt()&&yt($),{x:ie(u),y:ie(p),strategy:ie(v),placement:ie(h),middlewareData:ie(g),isPositioned:ie(m),floatingStyles:y,update:b}}function le(e,n){const t=typeof e=="string"&&!n?`${e}Context`:n,o=Symbol(t);return[r=>{const i=en(o,r);if(i||i===null)return i;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},r=>(hn(o,r),r)]}function Ft(e,n,t){const o=t.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&o.addEventListener(e,n,{once:!0}),o.dispatchEvent(r)}function Qn(e,n){var t;const o=ht();return M(()=>{o.value=e()},{...n,flush:(t=void 0)!=null?t:"sync"}),Ct(o)}function he(e){return mt()?(yt(e),!0):!1}function Zn(){const e=new Set,n=t=>{e.delete(t)};return{on:t=>{e.add(t);const o=()=>n(t);return he(o),{off:o}},off:n,trigger:(...t)=>Promise.all(Array.from(e).map(o=>o(...t)))}}function eo(e){let n=!1,t;const o=Et(!0);return(...r)=>(n||(t=o.run(()=>e(...r)),n=!0),t)}function to(e){let n=0,t,o;const r=()=>{n-=1,o&&n<=0&&(o.stop(),t=void 0,o=void 0)};return(...i)=>(n+=1,t||(o=Et(!0),t=o.run(()=>e(...i))),he(r),t)}function Z(e){return typeof e=="function"?e():f(e)}const Q=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const no=e=>typeof e<"u",oo=Object.prototype.toString,ro=e=>oo.call(e)==="[object Object]",lo=()=>{},ct=io();function io(){var e,n;return Q&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ao(e){return oe()}function so(e,n=1e4){return vn((t,o)=>{let r=Z(e),i;const l=()=>setTimeout(()=>{r=Z(e),o()},Z(n));return he(()=>{clearTimeout(i)}),{get(){return t(),r},set(a){r=a,o(),clearTimeout(i),i=l()}}})}function uo(e,n){ao()&&dn(e,n)}function Lt(e,n,t={}){const{immediate:o=!0}=t,r=C(!1);let i=null;function l(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,l()}function c(...d){l(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,e(...d)},Z(n))}return o&&(r.value=!0,Q&&c()),he(a),{isPending:Ct(r),start:c,stop:a}}function me(e){var n;const t=Z(e);return(n=t==null?void 0:t.$el)!=null?n:t}const Ze=Q?window:void 0;function Te(...e){let n,t,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([t,o,r]=e,n=Ze):[n,t,o,r]=e,!n)return lo;Array.isArray(t)||(t=[t]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(s=>s()),i.length=0},a=(s,u,p,v)=>(s.addEventListener(u,p,v),()=>s.removeEventListener(u,p,v)),c=F(()=>[me(n),Z(r)],([s,u])=>{if(l(),!s)return;const p=ro(u)?{...u}:u;i.push(...t.flatMap(v=>o.map(h=>a(s,v,h,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return he(d),d}function co(e){return typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):()=>!0}function fo(...e){let n,t,o={};e.length===3?(n=e[0],t=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(n=!0,t=e[0],o=e[1]):(n=e[0],t=e[1]):(n=!0,t=e[0]);const{target:r=Ze,eventName:i="keydown",passive:l=!1,dedupe:a=!1}=o,c=co(n);return Te(r,i,d=>{d.repeat&&Z(a)||c(d)&&t(d)},l)}function po(){const e=C(!1),n=oe();return n&&fe(()=>{e.value=!0},n),e}function vo(e){return JSON.parse(JSON.stringify(e))}function Mt(e,n,t,o={}){var r,i,l;const{clone:a=!1,passive:c=!1,eventName:d,deep:s=!1,defaultValue:u,shouldEmit:p}=o,v=oe(),h=t||(v==null?void 0:v.emit)||((r=v==null?void 0:v.$emit)==null?void 0:r.bind(v))||((l=(i=v==null?void 0:v.proxy)==null?void 0:i.$emit)==null?void 0:l.bind(v==null?void 0:v.proxy));let g=d;g=g||`update:${n.toString()}`;const m=b=>a?typeof a=="function"?a(b):vo(b):b,y=()=>no(e[n])?m(e[n]):u,A=b=>{p?p(b)&&h(g,b):h(g,b)};if(c){const b=y(),$=C(b);let R=!1;return F(()=>e[n],L=>{R||(R=!0,$.value=m(L),ne(()=>R=!1))}),F($,L=>{!R&&(L!==e[n]||s)&&A(L)},{deep:s}),$}else return w({get(){return y()},set(b){A(b)}})}function et(e){return e?e.flatMap(n=>n.type===rn?et(n.children):[n]):[]}function X(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Fe(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Ve(e,n,t=".",o){if(!Fe(n))return Ve(e,{},t);const r=Object.assign({},n);for(const i in e){if(i==="__proto__"||i==="constructor")continue;const l=e[i];l!=null&&(Array.isArray(l)&&Array.isArray(r[i])?r[i]=[...l,...r[i]]:Fe(l)&&Fe(r[i])?r[i]=Ve(l,r[i],(t?`${t}.`:"")+i.toString()):r[i]=l)}return r}function ho(e){return(...n)=>n.reduce((t,o)=>Ve(t,o,""),{})}const mo=ho(),[It,Tr]=le("ConfigProvider");let yo="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",go=(e=21)=>{let n="",t=e;for(;t--;)n+=yo[Math.random()*64|0];return n};const wo=to(()=>{const e=C(new Map),n=C(),t=w(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=It({scrollBody:C(!0)});let r=null;const i=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=n.value??"",ct&&(r==null||r()),n.value=void 0};return F(t,(l,a)=>{var c;if(!Q)return;if(!l){a&&i();return}n.value===void 0&&(n.value=document.body.style.overflow);const d=window.innerWidth-document.documentElement.clientWidth,s={padding:d,margin:0},u=(c=o.scrollBody)!=null&&c.value?typeof o.scrollBody.value=="object"?mo({padding:o.scrollBody.value.padding===!0?d:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?d:o.scrollBody.value.margin},s):s:{padding:0,margin:0};d>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.body.style.setProperty("--scrollbar-width",`${d}px`),document.body.style.overflow="hidden"),ct&&(r=Te(document,"touchmove",p=>xo(p),{passive:!1})),ne(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function bo(e){const n=go(6),t=wo();t.value.set(n,e);const o=w({get:()=>t.value.get(n)??!1,set:r=>t.value.set(n,r)});return uo(()=>{t.value.delete(n)}),o}function kt(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth1?!0:(n.preventDefault&&n.cancelable&&n.preventDefault(),!1)}function ye(e){const n=oe(),t=n==null?void 0:n.type.emits,o={};return t!=null&&t.length||console.warn(`No emitted event found. Please check component: ${n==null?void 0:n.type.__name}`),t==null||t.forEach(r=>{o[Zt(wt(r))]=(...i)=>e(r,...i)}),o}function Wt(e){const n=oe(),t=Object.keys((n==null?void 0:n.type.props)??{}).reduce((r,i)=>{const l=(n==null?void 0:n.type.props[i]).default;return l!==void 0&&(r[i]=l),r},{}),o=on(e);return w(()=>{const r={},i=(n==null?void 0:n.vnode.props)??{};return Object.keys(i).forEach(l=>{r[wt(l)]=i[l]}),Object.keys({...t,...r}).reduce((l,a)=>(o.value[a]!==void 0&&(l[a]=o.value[a]),l),{})})}function Ht(e,n){const t=Wt(e),o=n?ye(n):{};return w(()=>({...t.value,...o}))}function B(){const e=oe(),n=C(),t=w(()=>{var l,a;return["#text","#comment"].includes((l=n.value)==null?void 0:l.$el.nodeName)?(a=n.value)==null?void 0:a.$el.nextElementSibling:me(n)}),o=Object.assign({},e.exposed),r={};for(const l in e.props)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function i(l){n.value=l,l&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=r)}return{forwardRef:i,currentRef:n,currentElement:t}}function Co(e,n){const t=so(!1,300),o=C(null),r=Zn();function i(){o.value=null,t.value=!1}function l(a,c){const d=a.currentTarget,s={x:a.clientX,y:a.clientY},u=Oo(s,d.getBoundingClientRect()),p=Eo(s,u),v=_o(c.getBoundingClientRect()),h=Ao([...p,...v]);o.value=h,t.value=!0}return M(a=>{if(e.value&&n.value){const c=s=>l(s,n.value),d=s=>l(s,e.value);e.value.addEventListener("pointerleave",c),n.value.addEventListener("pointerleave",d),a(()=>{var s,u;(s=e.value)==null||s.removeEventListener("pointerleave",c),(u=n.value)==null||u.removeEventListener("pointerleave",d)})}}),M(a=>{var c;if(o.value){const d=s=>{var u,p;if(!o.value)return;const v=s.target,h={x:s.clientX,y:s.clientY},g=((u=e.value)==null?void 0:u.contains(v))||((p=n.value)==null?void 0:p.contains(v)),m=!Do(h,o.value),y=!!v.closest("[data-grace-area-trigger]");g?i():(m||y)&&(i(),r.trigger())};(c=e.value)==null||c.ownerDocument.addEventListener("pointermove",d),a(()=>{var s;return(s=e.value)==null?void 0:s.ownerDocument.removeEventListener("pointermove",d)})}}),{isPointerInTransit:t,onPointerExit:r.on}}function Oo(e,n){const t=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),i=Math.abs(n.left-e.x);switch(Math.min(t,o,r,i)){case i:return"left";case r:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Eo(e,n,t=5){const o=[];switch(n){case"top":o.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":o.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":o.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":o.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return o}function _o(e){const{top:n,right:t,bottom:o,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:o},{x:r,y:o}]}function Do(e,n){const{x:t,y:o}=e;let r=!1;for(let i=0,l=n.length-1;io!=s>o&&t<(d-a)*(o-c)/(s-c)+a&&(r=!r)}return r}function Ao(e){const n=e.slice();return n.sort((t,o)=>t.xo.x?1:t.yo.y?1:0),Bo(n)}function Bo(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var To=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ae=new WeakMap,Ee=new WeakMap,_e={},Le=0,jt=function(e){return e&&(e.host||jt(e.parentNode))},Po=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=jt(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},$o=function(e,n,t,o){var r=Po(n,Array.isArray(e)?e:[e]);_e[t]||(_e[t]=new WeakMap);var i=_e[t],l=[],a=new Set,c=new Set(r),d=function(u){!u||a.has(u)||(a.add(u),d(u.parentNode))};r.forEach(d);var s=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))s(p);else try{var v=p.getAttribute(o),h=v!==null&&v!=="false",g=(ae.get(p)||0)+1,m=(i.get(p)||0)+1;ae.set(p,g),i.set(p,m),l.push(p),g===1&&h&&Ee.set(p,!0),m===1&&p.setAttribute(t,"true"),h||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return s(n),a.clear(),Le++,function(){l.forEach(function(u){var p=ae.get(u)-1,v=i.get(u)-1;ae.set(u,p),i.set(u,v),p||(Ee.has(u)||u.removeAttribute(o),Ee.delete(u)),v||u.removeAttribute(t)}),Le--,Le||(ae=new WeakMap,ae=new WeakMap,Ee=new WeakMap,_e={})}},Ro=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=To(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),$o(o,r,t,"aria-hidden")):function(){return null}};function No(e){let n;F(()=>me(e),t=>{t?n=Ro(t):n&&n()}),bt(()=>{n&&n()})}let So=0;function Ke(e,n="radix"){const t=It({useId:void 0});return lt?`${n}-${lt()}`:t.useId?`${n}-${t.useId()}`:`${n}-${++So}`}function Fo(e){const n=C(),t=w(()=>{var r;return((r=n.value)==null?void 0:r.width)??0}),o=w(()=>{var r;return((r=n.value)==null?void 0:r.height)??0});return fe(()=>{const r=me(e);if(r){n.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const a=l[0];let c,d;if("borderBoxSize"in a){const s=a.borderBoxSize,u=Array.isArray(s)?s[0]:s;c=u.inlineSize,d=u.blockSize}else c=r.offsetWidth,d=r.offsetHeight;n.value={width:c,height:d}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else n.value=void 0}),{width:t,height:o}}function Lo(e,n){const t=C(e);function o(r){return n[t.value][r]??t.value}return{state:t,dispatch:r=>{t.value=o(r)}}}const Mo=O({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:n,slots:t}){return()=>{var o,r;if(!t.default)return null;const i=et(t.default()),l=i.findIndex(s=>s.type!==xt);if(l===-1)return i;const a=i[l];(o=a.props)==null||delete o.ref;const c=a.props?P(n,a.props):n;n.class&&(r=a.props)!=null&&r.class&&delete a.props.class;const d=ln(a,c);for(const s in c)s.startsWith("on")&&(d.props||(d.props={}),d.props[s]=c[s]);return i.length===1?d:(i[l]=d,i)}}}),W=O({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:n,slots:t}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>Ae(o,n):o!=="template"?()=>Ae(e.as,n,{default:t.default}):()=>Ae(Mo,n,{default:t.default})}});function Io(e,n){var t;const o=C({}),r=C("none"),i=C(e),l=e.value?"mounted":"unmounted";let a;const c=((t=n.value)==null?void 0:t.ownerDocument.defaultView)??Ze,{state:d,dispatch:s}=Lo(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{var y;if(Q){const A=new CustomEvent(m,{bubbles:!1,cancelable:!1});(y=n.value)==null||y.dispatchEvent(A)}};F(e,async(m,y)=>{var A;const b=y!==m;if(await ne(),b){const $=r.value,R=De(n.value);m?(s("MOUNT"),u("enter"),R==="none"&&u("after-enter")):R==="none"||((A=o.value)==null?void 0:A.display)==="none"?(s("UNMOUNT"),u("leave"),u("after-leave")):y&&$!==R?(s("ANIMATION_OUT"),u("leave")):(s("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=m=>{const y=De(n.value),A=y.includes(m.animationName),b=d.value==="mounted"?"enter":"leave";if(m.target===n.value&&A&&(u(`after-${b}`),s("ANIMATION_END"),!i.value)){const $=n.value.style.animationFillMode;n.value.style.animationFillMode="forwards",a=c==null?void 0:c.setTimeout(()=>{var R;((R=n.value)==null?void 0:R.style.animationFillMode)==="forwards"&&(n.value.style.animationFillMode=$)})}m.target===n.value&&y==="none"&&s("ANIMATION_END")},v=m=>{m.target===n.value&&(r.value=De(n.value))},h=F(n,(m,y)=>{m?(o.value=getComputedStyle(m),m.addEventListener("animationstart",v),m.addEventListener("animationcancel",p),m.addEventListener("animationend",p)):(s("ANIMATION_END"),a!==void 0&&(c==null||c.clearTimeout(a)),y==null||y.removeEventListener("animationstart",v),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=F(d,()=>{const m=De(n.value);r.value=d.value==="mounted"?m:"none"});return bt(()=>{h(),g()}),{isPresent:w(()=>["mounted","unmountSuspended"].includes(d.value))}}function De(e){return e&&getComputedStyle(e).animationName||"none"}const tt=O({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:n,expose:t}){var o;const{present:r,forceMount:i}=Ue(e),l=C(),{isPresent:a}=Io(r,l);t({present:a});let c=n.default({present:a});c=et(c||[]);const d=oe();if(c&&(c==null?void 0:c.length)>1){const s=(o=d==null?void 0:d.parent)!=null&&o.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${s}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` -`)].join(` -`))}return()=>i.value||r.value||a.value?Ae(n.default({present:a})[0],{ref:s=>{const u=me(s);return typeof(u==null?void 0:u.hasAttribute)>"u"||(u!=null&&u.hasAttribute("data-radix-popper-content-wrapper")?l.value=u.firstElementChild:l.value=u),u}}):null}}),[U,ko]=le("DialogRoot"),Wo=O({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:open"],setup(e,{emit:n}){const t=e,o=Mt(t,"open",n,{defaultValue:t.defaultOpen,passive:t.open===void 0}),r=C(),i=C(),{modal:l}=Ue(t);return ko({open:o,modal:l,openModal:()=>{o.value=!0},onOpenChange:a=>{o.value=a},onOpenToggle:()=>{o.value=!o.value},contentId:"",titleId:"",descriptionId:"",triggerElement:r,contentElement:i}),(a,c)=>E(a.$slots,"default",{open:f(o)})}}),nt=O({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=po();return(t,o)=>f(n)||t.forceMount?(_(),D(Qt,{key:0,to:t.to,disabled:t.disabled},[E(t.$slots,"default")],8,["to","disabled"])):gt("",!0)}}),Pr=O({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Ho="dismissableLayer.pointerDownOutside",jo="dismissableLayer.focusOutside";function Vt(e,n){const t=n.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),r=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(t&&o===t||r.indexOf(o){});return M(l=>{if(!Q)return;const a=async d=>{const s=d.target;if(n!=null&&n.value){if(Vt(n.value,s)){r.value=!1;return}if(d.target&&!r.value){let u=function(){Ft(Ho,e,p)};const p={originalEvent:d};d.pointerType==="touch"?(o.removeEventListener("click",i.value),i.value=u,o.addEventListener("click",i.value,{once:!0})):u()}else o.removeEventListener("click",i.value);r.value=!1}},c=window.setTimeout(()=>{o.addEventListener("pointerdown",a)},0);l(()=>{window.clearTimeout(c),o.removeEventListener("pointerdown",a),o.removeEventListener("click",i.value)})}),{onPointerDownCapture:()=>r.value=!0}}function Ko(e,n){var t;const o=((t=n==null?void 0:n.value)==null?void 0:t.ownerDocument)??(globalThis==null?void 0:globalThis.document),r=C(!1);return M(i=>{if(!Q)return;const l=async a=>{n!=null&&n.value&&(await ne(),!(!n.value||Vt(n.value,a.target))&&a.target&&!r.value&&Ft(jo,e,{originalEvent:a}))};o.addEventListener("focusin",l),i(()=>o.removeEventListener("focusin",l))}),{onFocusCapture:()=>r.value=!0,onBlurCapture:()=>r.value=!1}}const z=_t({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kt=O({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:n}){const t=e,o=n,{forwardRef:r,currentElement:i}=B(),l=w(()=>{var h;return((h=i.value)==null?void 0:h.ownerDocument)??globalThis.document}),a=w(()=>z.layersRoot),c=w(()=>i.value?Array.from(a.value).indexOf(i.value):-1),d=w(()=>z.layersWithOutsidePointerEventsDisabled.size>0),s=w(()=>{const h=Array.from(a.value),[g]=[...z.layersWithOutsidePointerEventsDisabled].slice(-1),m=h.indexOf(g);return c.value>=m}),u=Vo(async h=>{const g=[...z.branches].some(m=>m==null?void 0:m.contains(h.target));!s.value||g||(o("pointerDownOutside",h),o("interactOutside",h),await ne(),h.defaultPrevented||o("dismiss"))},i),p=Ko(h=>{[...z.branches].some(g=>g==null?void 0:g.contains(h.target))||(o("focusOutside",h),o("interactOutside",h),h.defaultPrevented||o("dismiss"))},i);fo("Escape",h=>{c.value===a.value.size-1&&(o("escapeKeyDown",h),h.defaultPrevented||o("dismiss"))});let v;return M(h=>{i.value&&(t.disableOutsidePointerEvents&&(z.layersWithOutsidePointerEventsDisabled.size===0&&(v=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),z.layersWithOutsidePointerEventsDisabled.add(i.value)),a.value.add(i.value),h(()=>{t.disableOutsidePointerEvents&&z.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=v)}))}),M(h=>{h(()=>{i.value&&(a.value.delete(i.value),z.layersWithOutsidePointerEventsDisabled.delete(i.value))})}),(h,g)=>(_(),D(f(W),{ref:f(r),"as-child":h.asChild,as:h.as,"data-dismissable-layer":"",style:Ye({pointerEvents:d.value?s.value?"auto":"none":void 0}),onFocusCapture:f(p).onFocusCapture,onBlurCapture:f(p).onBlurCapture,onPointerdownCapture:f(u).onPointerDownCapture},{default:x(()=>[E(h.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Me="focusScope.autoFocusOnMount",Ie="focusScope.autoFocusOnUnmount",ft={bubbles:!1,cancelable:!0};function zo(e,{select:n=!1}={}){const t=X();for(const o of e)if(Y(o,{select:n}),X()!==t)return!0}function Uo(e){const n=zt(e),t=pt(n,e),o=pt(n.reverse(),e);return[t,o]}function zt(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function pt(e,n){for(const t of e)if(!Yo(t,{upTo:n}))return t}function Yo(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Xo(e){return e instanceof HTMLInputElement&&"select"in e}function Y(e,{select:n=!1}={}){if(e&&e.focus){const t=X();e.focus({preventScroll:!0}),e!==t&&Xo(e)&&n&&e.select()}}const qo=eo(()=>C([]));function Go(){const e=qo();return{add(n){const t=e.value[0];n!==t&&(t==null||t.pause()),e.value=vt(e.value,n),e.value.unshift(n)},remove(n){var t;e.value=vt(e.value,n),(t=e.value[0])==null||t.resume()}}}function vt(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Jo(e){return e.filter(n=>n.tagName!=="A")}const Qo=O({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:n}){const t=e,o=n,{currentRef:r,currentElement:i}=B(),l=C(null),a=Go(),c=_t({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});M(s=>{if(!Q)return;const u=i.value;if(!t.trapped)return;function p(m){if(c.paused||!u)return;const y=m.target;u.contains(y)?l.value=y:Y(l.value,{select:!0})}function v(m){if(c.paused||!u)return;const y=m.relatedTarget;y!==null&&(u.contains(y)||Y(l.value,{select:!0}))}function h(m){u.contains(l.value)||Y(u)}document.addEventListener("focusin",p),document.addEventListener("focusout",v);const g=new MutationObserver(h);u&&g.observe(u,{childList:!0,subtree:!0}),s(()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),g.disconnect()})}),M(async s=>{const u=i.value;if(await ne(),!u)return;a.add(c);const p=X();if(!u.contains(p)){const v=new CustomEvent(Me,ft);u.addEventListener(Me,h=>o("mountAutoFocus",h)),u.dispatchEvent(v),v.defaultPrevented||(zo(Jo(zt(u)),{select:!0}),X()===p&&Y(u))}s(()=>{u.removeEventListener(Me,g=>o("mountAutoFocus",g));const v=new CustomEvent(Ie,ft),h=g=>{o("unmountAutoFocus",g)};u.addEventListener(Ie,h),u.dispatchEvent(v),setTimeout(()=>{v.defaultPrevented||Y(p??document.body,{select:!0}),u.removeEventListener(Ie,h),a.remove(c)},0)})});function d(s){if(!t.loop&&!t.trapped||c.paused)return;const u=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,p=X();if(u&&p){const v=s.currentTarget,[h,g]=Uo(v);h&&g?!s.shiftKey&&p===g?(s.preventDefault(),t.loop&&Y(h,{select:!0})):s.shiftKey&&p===h&&(s.preventDefault(),t.loop&&Y(g,{select:!0})):p===v&&s.preventDefault()}}return(s,u)=>(_(),D(f(W),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":s.asChild,as:s.as,onKeydown:d},{default:x(()=>[E(s.$slots,"default")]),_:3},8,["as-child","as"]))}});function Zo(e){return e?"open":"closed"}const Ut=O({__name:"DialogContentImpl",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:n}){const t=e,o=n,r=U(),{forwardRef:i,currentElement:l}=B();return r.titleId||(r.titleId=Ke(void 0,"radix-vue-dialog-title")),r.descriptionId||(r.descriptionId=Ke(void 0,"radix-vue-dialog-description")),fe(()=>{r.contentElement=l,X()!==document.body&&(r.triggerElement.value=X())}),(a,c)=>(_(),D(f(Qo),{"as-child":"",loop:"",trapped:t.trapFocus,onMountAutoFocus:c[5]||(c[5]=d=>o("openAutoFocus",d)),onUnmountAutoFocus:c[6]||(c[6]=d=>o("closeAutoFocus",d))},{default:x(()=>[ee(f(Kt),P({id:f(r).contentId,ref:f(i),as:a.as,"as-child":a.asChild,"disable-outside-pointer-events":a.disableOutsidePointerEvents,role:"dialog","aria-describedby":f(r).descriptionId,"aria-labelledby":f(r).titleId,"data-state":f(Zo)(f(r).open.value)},a.$attrs,{onDismiss:c[0]||(c[0]=d=>f(r).onOpenChange(!1)),onEscapeKeyDown:c[1]||(c[1]=d=>o("escapeKeyDown",d)),onFocusOutside:c[2]||(c[2]=d=>o("focusOutside",d)),onInteractOutside:c[3]||(c[3]=d=>o("interactOutside",d)),onPointerDownOutside:c[4]||(c[4]=d=>o("pointerDownOutside",d))}),{default:x(()=>[E(a.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),er=O({__name:"DialogContentModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:n}){const t=e,o=n,r=U(),i=ye(o),{forwardRef:l,currentElement:a}=B();return No(a),(c,d)=>(_(),D(Ut,P({...t,...f(i)},{ref:f(l),"trap-focus":f(r).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:d[0]||(d[0]=s=>{var u;s.defaultPrevented||(s.preventDefault(),(u=f(r).triggerElement.value)==null||u.focus())}),onPointerDownOutside:d[1]||(d[1]=s=>{const u=s.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0;(u.button===2||p)&&s.preventDefault()}),onFocusOutside:d[2]||(d[2]=s=>{s.preventDefault()})}),{default:x(()=>[E(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),tr=O({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:n}){const t=e,o=ye(n);B();const r=U(),i=C(!1),l=C(!1);return(a,c)=>(_(),D(Ut,P({...t,...f(o)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=d=>{var s;d.defaultPrevented||(i.value||(s=f(r).triggerElement.value)==null||s.focus(),d.preventDefault()),i.value=!1,l.value=!1}),onInteractOutside:c[1]||(c[1]=d=>{var s;d.defaultPrevented||(i.value=!0,d.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=d.target;(s=f(r).triggerElement.value)!=null&&s.contains(u)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.value&&d.preventDefault()})}),{default:x(()=>[E(a.$slots,"default")]),_:3},16))}}),nr=O({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:n}){const t=e,o=n,r=U(),i=ye(o),{forwardRef:l}=B();return(a,c)=>(_(),D(f(tt),{present:a.forceMount||f(r).open.value},{default:x(()=>[f(r).modal.value?(_(),D(er,P({key:0,ref:f(l)},{...t,...f(i),...a.$attrs}),{default:x(()=>[E(a.$slots,"default")]),_:3},16)):(_(),D(tr,P({key:1,ref:f(l)},{...t,...f(i),...a.$attrs}),{default:x(()=>[E(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),or=O({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(e){const n=U();return bo(!0),B(),(t,o)=>(_(),D(f(W),{as:t.as,"as-child":t.asChild,"data-state":f(n).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:x(()=>[E(t.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),rr=O({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=U(),{forwardRef:t}=B();return(o,r)=>{var i;return(i=f(n))!=null&&i.modal.value?(_(),D(f(tt),{key:0,present:o.forceMount||f(n).open.value},{default:x(()=>[ee(or,P(o.$attrs,{ref:f(t),as:o.as,"as-child":o.asChild}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):gt("",!0)}}}),Yt=O({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e;B();const t=U();return(o,r)=>(_(),D(f(W),P(n,{type:o.as==="button"?"button":void 0,onClick:r[0]||(r[0]=i=>f(t).onOpenChange(!1))}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["type"]))}}),lr=O({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const n=e,t=U();return B(),(o,r)=>(_(),D(f(W),P(n,{id:f(t).titleId}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["id"]))}}),ir=O({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const n=e;B();const t=U();return(o,r)=>(_(),D(f(W),P(n,{id:f(t).descriptionId}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["id"]))}}),$r=O({__name:"AlertDialogRoot",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(e,{emit:n}){const t=Ht(e,n);return B(),(o,r)=>(_(),D(f(Wo),P(f(t),{modal:!0}),{default:x(()=>[E(o.$slots,"default")]),_:3},16))}}),Rr=O({__name:"AlertDialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),[ar,sr]=le("AlertDialogContent"),Nr=O({__name:"AlertDialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:n}){const t=e,o=ye(n);B();const r=C();return sr({onCancelElementChange:i=>{r.value=i}}),(i,l)=>(_(),D(f(nr),P({...t,...f(o)},{role:"alertdialog",onPointerDownOutside:l[0]||(l[0]=ke(()=>{},["prevent"])),onInteractOutside:l[1]||(l[1]=ke(()=>{},["prevent"])),onOpenAutoFocus:l[2]||(l[2]=()=>{ne(()=>{var a;(a=r.value)==null||a.focus({preventScroll:!0})})})}),{default:x(()=>[E(i.$slots,"default")]),_:3},16))}}),Sr=O({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=e;return B(),(t,o)=>(_(),D(f(rr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Fr=O({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e,t=ar(),{forwardRef:o,currentElement:r}=B();return fe(()=>{t.onCancelElementChange(r.value)}),(i,l)=>(_(),D(f(Yt),P(n,{ref:f(o)}),{default:x(()=>[E(i.$slots,"default")]),_:3},16))}}),Lr=O({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const n=e;return B(),(t,o)=>(_(),D(f(lr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Mr=O({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const n=e;return B(),(t,o)=>(_(),D(f(ir),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Ir=O({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e;return B(),(t,o)=>(_(),D(f(Yt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),[Xt,ur]=le("PopperRoot"),dr=O({inheritAttrs:!1,__name:"PopperRoot",setup(e){const n=C();return ur({anchor:n,onAnchorChange:t=>n.value=t}),(t,o)=>E(t.$slots,"default")}}),cr=O({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const n=e,{forwardRef:t,currentElement:o}=B(),r=Xt();return M(()=>{r.onAnchorChange(n.element??o.value)}),(i,l)=>(_(),D(f(W),{ref:f(t),as:i.as,"as-child":i.asChild},{default:x(()=>[E(i.$slots,"default")]),_:3},8,["as","as-child"]))}});function fr(e){return e!==null}function pr(e){return{name:"transformOrigin",options:e,fn(n){var t,o,r;const{placement:i,rects:l,middlewareData:a}=n,c=((t=a.arrow)==null?void 0:t.centerOffset)!==0,d=c?0:e.arrowWidth,s=c?0:e.arrowHeight,[u,p]=ze(i),v={start:"0%",center:"50%",end:"100%"}[p],h=(((o=a.arrow)==null?void 0:o.x)??0)+d/2,g=(((r=a.arrow)==null?void 0:r.y)??0)+s/2;let m="",y="";return u==="bottom"?(m=c?v:`${h}px`,y=`${-s}px`):u==="top"?(m=c?v:`${h}px`,y=`${l.floating.height+s}px`):u==="right"?(m=`${-s}px`,y=c?v:`${g}px`):u==="left"&&(m=`${l.floating.width+s}px`,y=c?v:`${g}px`),{data:{x:m,y}}}}}function ze(e){const[n,t="center"]=e.split("-");return[n,t]}const vr={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[hr,mr]=le("PopperContent"),yr=O({inheritAttrs:!1,__name:"PopperContent",props:cn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...vr}),emits:["placed"],setup(e,{emit:n}){const t=e,o=n,r=Xt(),{forwardRef:i,currentElement:l}=B(),a=C(),c=C(),{width:d,height:s}=Fo(c),u=w(()=>t.side+(t.align!=="center"?`-${t.align}`:"")),p=w(()=>typeof t.collisionPadding=="number"?t.collisionPadding:{top:0,right:0,bottom:0,left:0,...t.collisionPadding}),v=w(()=>Array.isArray(t.collisionBoundary)?t.collisionBoundary:[t.collisionBoundary]),h=w(()=>({padding:p.value,boundary:v.value.filter(fr),altBoundary:v.value.length>0})),g=Qn(()=>[jn({mainAxis:t.sideOffset+s.value,alignmentAxis:t.alignOffset}),t.prioritizePosition&&t.avoidCollisions&&ut({...h.value}),t.avoidCollisions&&Vn({mainAxis:!0,crossAxis:!!t.prioritizePosition,limiter:t.sticky==="partial"?Yn():void 0,...h.value}),!t.prioritizePosition&&t.avoidCollisions&&ut({...h.value}),Kn({...h.value,apply:({elements:N,rects:rt,availableWidth:we,availableHeight:be})=>{const{width:xe,height:Jt}=rt.reference,Ce=N.floating.style;Ce.setProperty("--radix-popper-available-width",`${we}px`),Ce.setProperty("--radix-popper-available-height",`${be}px`),Ce.setProperty("--radix-popper-anchor-width",`${xe}px`),Ce.setProperty("--radix-popper-anchor-height",`${Jt}px`)}}),c.value&&Gn({element:c.value,padding:t.arrowPadding}),pr({arrowWidth:d.value,arrowHeight:s.value}),t.hideWhenDetached&&zn({strategy:"referenceHidden",...h.value})]),{floatingStyles:m,placement:y,isPositioned:A,middlewareData:b}=Jn(r.anchor,a,{strategy:"fixed",placement:u,whileElementsMounted:(...N)=>Hn(...N,{animationFrame:t.updatePositionStrategy==="always"}),middleware:g}),$=w(()=>ze(y.value)[0]),R=w(()=>ze(y.value)[1]);fn(()=>{A.value&&o("placed")});const L=w(()=>{var N;return((N=b.value.arrow)==null?void 0:N.centerOffset)!==0}),T=C("");M(()=>{l.value&&(T.value=window.getComputedStyle(l.value).zIndex)});const H=w(()=>{var N;return((N=b.value.arrow)==null?void 0:N.x)??0}),ge=w(()=>{var N;return((N=b.value.arrow)==null?void 0:N.y)??0});return mr({placedSide:$,onArrowChange:N=>c.value=N,arrowX:H,arrowY:ge,shouldHideArrow:L}),(N,rt)=>{var we,be,xe;return _(),Ot("div",{ref_key:"floatingRef",ref:a,"data-radix-popper-content-wrapper":"",style:Ye({...f(m),transform:f(A)?f(m).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:T.value,"--radix-popper-transform-origin":[(we=f(b).transformOrigin)==null?void 0:we.x,(be=f(b).transformOrigin)==null?void 0:be.y].join(" "),...((xe=f(b).hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[ee(f(W),P({ref:f(i)},N.$attrs,{"as-child":t.asChild,as:N.as,"data-side":$.value,"data-align":R.value,style:{animation:f(A)?void 0:"none"}}),{default:x(()=>[E(N.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),gr=pn("polygon",{points:"0,0 30,0 15,10"},null,-1),wr=O({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const n=e;return B(),(t,o)=>(_(),D(f(W),P(n,{width:t.width,height:t.height,viewBox:t.asChild?void 0:"0 0 30 10",preserveAspectRatio:t.asChild?void 0:"none"}),{default:x(()=>[E(t.$slots,"default",{},()=>[gr])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),br={top:"bottom",right:"left",bottom:"top",left:"right"},xr=O({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:n}=B(),t=hr(),o=w(()=>br[t.placedSide.value]);return(r,i)=>{var l,a,c,d;return _(),Ot("span",{ref:s=>{f(t).onArrowChange(s)},style:Ye({position:"absolute",left:(l=f(t).arrowX)!=null&&l.value?`${(a=f(t).arrowX)==null?void 0:a.value}px`:void 0,top:(c=f(t).arrowY)!=null&&c.value?`${(d=f(t).arrowY)==null?void 0:d.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f(t).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f(t).placedSide.value],visibility:f(t).shouldHideArrow.value?"hidden":void 0})},[ee(wr,P(r.$attrs,{ref:f(n),style:{display:"block"},as:r.as,"as-child":r.asChild,width:r.width,height:r.height}),{default:x(()=>[E(r.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),Cr=O({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return B(),(n,t)=>(_(),D(f(W),{as:n.as,"as-child":n.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:x(()=>[E(n.$slots,"default")]),_:3},8,["as","as-child"]))}});function Or(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Or();const qt="tooltip.open",[ot,Er]=le("TooltipProvider"),kr=O({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{default:700},skipDelayDuration:{default:300},disableHoverableContent:{type:Boolean,default:!1},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean,default:!1}},setup(e){const n=e,{delayDuration:t,skipDelayDuration:o,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:l,disabled:a}=Ue(n);B();const c=C(!0),d=C(!1),{start:s,stop:u}=Lt(()=>{c.value=!0},o,{immediate:!1});return Er({isOpenDelayed:c,delayDuration:t,onOpen(){u(),c.value=!1},onClose(){s()},isPointerInTransitRef:d,disableHoverableContent:r,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:l}),(p,v)=>E(p.$slots,"default")}}),[Ne,_r]=le("TooltipRoot"),Wr=O({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},delayDuration:{default:void 0},disableHoverableContent:{type:Boolean,default:void 0},disableClosingTrigger:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,default:void 0}},emits:["update:open"],setup(e,{emit:n}){const t=e,o=n;B();const r=ot(),i=w(()=>t.disableHoverableContent??r.disableHoverableContent.value),l=w(()=>t.disableClosingTrigger??r.disableClosingTrigger.value),a=w(()=>t.disabled??r.disabled.value),c=w(()=>t.delayDuration??r.delayDuration.value),d=w(()=>t.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),s=Mt(t,"open",o,{defaultValue:t.defaultOpen,passive:t.open===void 0});F(s,b=>{r.onClose&&(b?(r.onOpen(),document.dispatchEvent(new CustomEvent(qt))):r.onClose())});const u=C(!1),p=C(),v=w(()=>s.value?u.value?"delayed-open":"instant-open":"closed"),{start:h,stop:g}=Lt(()=>{u.value=!0,s.value=!0},c,{immediate:!1});function m(){g(),u.value=!1,s.value=!0}function y(){g(),s.value=!1}function A(){h()}return _r({contentId:"",open:s,stateAttribute:v,trigger:p,onTriggerChange(b){p.value=b},onTriggerEnter(){r.isOpenDelayed.value?A():m()},onTriggerLeave(){i.value?y():g()},onOpen:m,onClose:y,disableHoverableContent:i,disableClosingTrigger:l,disabled:a,ignoreNonKeyboardFocus:d}),(b,$)=>(_(),D(f(dr),null,{default:x(()=>[E(b.$slots,"default",{open:f(s)})]),_:3}))}}),Hr=O({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e,t=Ne(),o=ot();t.contentId||(t.contentId=Ke(void 0,"radix-vue-tooltip-content"));const{forwardRef:r,currentElement:i}=B(),l=C(!1),a=C(!1),c=w(()=>t.disabled.value?{}:{click:g,focus:v,pointermove:u,pointerleave:p,pointerdown:s,blur:h});fe(()=>{t.onTriggerChange(i.value)});function d(){setTimeout(()=>{l.value=!1},1)}function s(){l.value=!0,document.addEventListener("pointerup",d,{once:!0})}function u(m){m.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(t.onTriggerEnter(),a.value=!0)}function p(){t.onTriggerLeave(),a.value=!1}function v(m){var y,A;l.value||t.ignoreNonKeyboardFocus.value&&!((A=(y=m.target).matches)!=null&&A.call(y,":focus-visible"))||t.onOpen()}function h(){t.onClose()}function g(){t.disableClosingTrigger.value||t.onClose()}return(m,y)=>(_(),D(f(cr),{"as-child":""},{default:x(()=>[ee(f(W),P({ref:f(r),"aria-describedby":f(t).open.value?f(t).contentId:void 0,"data-state":f(t).stateAttribute.value,as:m.as,"as-child":n.asChild,"data-grace-area-trigger":""},tn(c.value)),{default:x(()=>[E(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),Gt=O({__name:"TooltipContentImpl",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{default:0},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},sticky:{default:"partial"},hideWhenDetached:{type:Boolean,default:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:n}){const t=e,o=n,r=Ne(),{forwardRef:i}=B(),l=an(),a=w(()=>{var s;return(s=l.default)==null?void 0:s.call(l)}),c=w(()=>{var s;if(t.ariaLabel)return t.ariaLabel;let u="";function p(v){typeof v.children=="string"&&v.type!==xt?u+=v.children:Array.isArray(v.children)&&v.children.forEach(h=>p(h))}return(s=a.value)==null||s.forEach(v=>p(v)),u}),d=w(()=>{const{ariaLabel:s,...u}=t;return u});return fe(()=>{Te(window,"scroll",s=>{const u=s.target;u!=null&&u.contains(r.trigger.value)&&r.onClose()}),Te(window,qt,r.onClose)}),(s,u)=>(_(),D(f(Kt),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:u[1]||(u[1]=p=>{var v;f(r).disableClosingTrigger.value&&(v=f(r).trigger.value)!=null&&v.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:u[2]||(u[2]=ke(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=p=>f(r).onClose())},{default:x(()=>[ee(f(yr),P({ref:f(i),"data-state":f(r).stateAttribute.value},{...s.$attrs,...d.value},{style:{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),{default:x(()=>[E(s.$slots,"default"),ee(f(Cr),{id:f(r).contentId,role:"tooltip"},{default:x(()=>[sn(un(c.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),Dr=O({__name:"TooltipContentHoverable",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},setup(e){const n=Wt(e),{forwardRef:t,currentElement:o}=B(),{trigger:r,onClose:i}=Ne(),l=ot(),{isPointerInTransit:a,onPointerExit:c}=Co(r,o);return l.isPointerInTransitRef=a,c(()=>{i()}),(d,s)=>(_(),D(Gt,P({ref:f(t)},f(n)),{default:x(()=>[E(d.$slots,"default")]),_:3},16))}}),jr=O({__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:n}){const t=e,o=n,r=Ne(),i=Ht(t,o),{forwardRef:l}=B();return(a,c)=>(_(),D(f(tt),{present:a.forceMount||f(r).open.value},{default:x(()=>[(_(),D(nn(f(r).disableHoverableContent.value?Gt:Dr),P({ref:f(l)},f(i)),{default:x(()=>[E(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Vr=O({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const n=e;return B(),(t,o)=>(_(),D(f(xr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Kr=O({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}});export{rr as $,Rr as A,lr as B,Mr as F,Vr as G,kr as H,Pr as I,Fr as M,Ir as N,Nr as O,nr as P,$r as T,jr as U,Lr as V,Wr as W,Hr as j,Sr as k,Wo as n,Kr as q}; diff --git a/assets/index-D4gBs-70.css b/assets/index-D4gBs-70.css new file mode 100644 index 0000000000000000000000000000000000000000..8d9565d7830e73357c63d9164930341901d84368 --- /dev/null +++ b/assets/index-D4gBs-70.css @@ -0,0 +1 @@ +.stage-transition-3[data-v-df576df0]{--delay:0s;--sharpness:40%;position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}.stage-transition-3[data-v-df576df0]:before{content:"";animation:1s cubic-bezier(.87,.05,.02,.97) both arrowIn-df576df0,1s cubic-bezier(.87,.05,.02,.97) forwards arrowOut-df576df0;position:absolute;top:0;bottom:0;left:0;right:0}.stage-transition-3[data-v-df576df0]:after{content:"";animation:1s cubic-bezier(.87,.05,.02,.97) both arrowIn-df576df0,1s cubic-bezier(.87,.05,.02,.97) forwards arrowOut-df576df0;position:absolute;top:0;bottom:0;left:0;right:0}.stage-transition-3[data-v-df576df0]:before{background-color:var(--stage-transition-3-overlay-color-2);animation-delay:calc(0s + var(--delay,0s)),calc(1.4s + var(--delay,0s))}.stage-transition-3[data-v-df576df0]:after{background-color:var(--stage-transition-3-overlay-color-1);animation-delay:calc(.2s + var(--delay,0s)),calc(1.2s + var(--delay,0s))}@keyframes arrowIn-df576df0{0%{clip-path:polygon(calc(var(--sharpness)*-1)0,calc(var(--sharpness)*-1)0,0 50%,calc(var(--sharpness)*-1)100%,calc(var(--sharpness)*-1)100%,0 50%)}to{clip-path:polygon(calc(var(--sharpness)*-1)0,100% 0,calc(100% + var(--sharpness))50%,100% 100%,calc(var(--sharpness)*-1)100%,0 50%)}}@keyframes arrowOut-df576df0{0%{clip-path:polygon(calc(var(--sharpness)*-1)0,100% 0,calc(100% + var(--sharpness))50%,100% 100%,calc(var(--sharpness)*-1)100%,0 50%)}to{clip-path:polygon(100% 0,100% 0,calc(100% + var(--sharpness))50%,100% 100%,100% 100%,calc(100% + var(--sharpness))50%)}}.circle-expansion-transition[data-v-0c29056c]{pointer-events:none;width:150vmax;height:150vmax;position:fixed;top:calc(50% - 75vmax);left:calc(50% - 75vmax)}.circle-expansion-transition div[data-v-0c29056c]{border-radius:50%;width:100%;height:100%;position:absolute;top:0;left:0;transform:scale(0)}.circle-expansion-transition div[data-v-0c29056c]:first-child{background-color:var(--circle-expansion-color-1);animation:circleExpand-0c29056c var(--circle-expansion-duration)ease-in calc(var(--circle-expansion-delay) + 0s)forwards}.circle-expansion-transition div[data-v-0c29056c]:nth-child(2){background-color:var(--circle-expansion-color-2);animation:circleExpand-0c29056c var(--circle-expansion-duration)ease-in calc(var(--circle-expansion-delay) + .15s)forwards}.circle-expansion-transition div[data-v-0c29056c]:nth-child(3){background-color:var(--circle-expansion-color-3);animation:circleExpand-0c29056c var(--circle-expansion-duration)ease-in calc(var(--circle-expansion-delay) + .3s)forwards}.circle-expansion-transition div[data-v-0c29056c]:nth-child(4){background-color:var(--circle-expansion-color-4);animation:circleExpand-0c29056c var(--circle-expansion-duration)ease-in calc(var(--circle-expansion-delay) + .45s)forwards}@keyframes circleExpand-0c29056c{0%{transform:scale(0)}to{transform:scale(1)}}.fantasy-fall-transition[data-v-e62bf496]{position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}.fantasy-fall-up[data-v-e62bf496]:before{content:"";background-color:var(--fantasy-fall-color);border-bottom-left-radius:var(--fantasy-fall-radius-sm);border-bottom-right-radius:var(--fantasy-fall-radius-sm);width:100%;height:100%;animation:fantasy-fall-up var(--fantasy-fall-duration)ease-out var(--fantasy-fall-delay)forwards;display:block;position:absolute;top:0;left:0;transform:translateY(-100%)}.fantasy-fall-down[data-v-e62bf496]:before{content:"";background-color:var(--fantasy-fall-color);border-top-left-radius:var(--fantasy-fall-radius-sm);border-top-right-radius:var(--fantasy-fall-radius-sm);width:100%;height:100%;animation:fantasy-fall-down var(--fantasy-fall-duration)ease-out var(--fantasy-fall-delay)forwards;display:block;position:absolute;top:0;left:0;transform:translateY(100%)}.fantasy-fall-left[data-v-e62bf496]:before{content:"";background-color:var(--fantasy-fall-color);border-top-right-radius:var(--fantasy-fall-radius-sm);border-bottom-right-radius:var(--fantasy-fall-radius-sm);width:100%;height:100%;animation:fantasy-fall-left var(--fantasy-fall-duration)ease-out var(--fantasy-fall-delay)forwards;display:block;position:absolute;top:0;left:0;transform:translate(-100%)}.fantasy-fall-right[data-v-e62bf496]:before{content:"";background-color:var(--fantasy-fall-color);border-top-left-radius:var(--fantasy-fall-radius-sm);border-bottom-left-radius:var(--fantasy-fall-radius-sm);width:100%;height:100%;animation:fantasy-fall-right var(--fantasy-fall-duration)ease-out var(--fantasy-fall-delay)forwards;display:block;position:absolute;top:0;left:0;transform:translate(100%)}@media (min-width:768px){.fantasy-fall-up[data-v-e62bf496]:before{border-bottom-left-radius:var(--fantasy-fall-radius-md);border-bottom-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-down[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-md);border-top-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-left[data-v-e62bf496]:before{border-top-right-radius:var(--fantasy-fall-radius-md);border-bottom-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-right[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-md);border-bottom-left-radius:var(--fantasy-fall-radius-md)}}@media (min-width:1024px){.fantasy-fall-up[data-v-e62bf496]:before{border-bottom-left-radius:var(--fantasy-fall-radius-lg);border-bottom-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-down[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-lg);border-top-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-left[data-v-e62bf496]:before{border-top-right-radius:var(--fantasy-fall-radius-lg);border-bottom-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-right[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-lg);border-bottom-left-radius:var(--fantasy-fall-radius-lg)}}@keyframes fantasy-fall-up{0%{transform:translateY(-100%)}50%{transform:translateY(0%)}to{border-bottom-right-radius:0%;border-bottom-left-radius:0%;transform:translateY(0%)}}@keyframes fantasy-fall-down{0%{transform:translateY(100%)}50%{transform:translateY(0%)}to{border-top-left-radius:0%;border-top-right-radius:0%;transform:translateY(0%)}}@keyframes fantasy-fall-left{0%{transform:translate(-100%)}50%{transform:translate(0%)}to{border-top-right-radius:0%;border-bottom-right-radius:0%;transform:translate(0%)}}@keyframes fantasy-fall-right{0%{transform:translate(100%)}50%{transform:translate(0%)}to{border-top-left-radius:0%;border-bottom-left-radius:0%;transform:translate(0%)}}.stage-transition-4[data-v-6d1179fc]{--delay:0s;grid-template-rows:repeat(5,1fr);display:grid;position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}.stage-transition-4__block[data-v-6d1179fc]{width:100%;height:100%;position:relative}.stage-transition-4__block[data-v-6d1179fc]:before{content:"";animation:.8s cubic-bezier(.87,.05,.02,.97) both slideIn-6d1179fc,.8s cubic-bezier(.87,.05,.02,.97) forwards slideOut-6d1179fc;position:absolute;top:0;bottom:0;left:0;right:0}.stage-transition-4__block[data-v-6d1179fc]:after{content:"";animation:.8s cubic-bezier(.87,.05,.02,.97) both slideIn-6d1179fc,.8s cubic-bezier(.87,.05,.02,.97) forwards slideOut-6d1179fc;position:absolute;top:0;bottom:0;left:0;right:0}.stage-transition-4__block[data-v-6d1179fc]:before{background-color:var(--stage-transition-4-overlay-color-2);animation-delay:calc(0s + var(--d,0s) + var(--delay,0s)),calc(1.6s + var(--d,0s) + var(--delay,0s))}.stage-transition-4__block[data-v-6d1179fc]:after{background-color:var(--stage-transition-4-overlay-color-1);animation-delay:calc(.3s + var(--d,0s) + var(--delay,0s)),calc(1.3s + var(--d,0s) + var(--delay,0s))}.stage-transition-4__block[data-v-6d1179fc]:first-child{--d:.1s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(2){--d:.3s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(3){--d:0s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(4){--d:.4s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(5){--d:.2s}@keyframes slideIn-6d1179fc{0%{transform:translate(-101%)}to{transform:translate(0)}}@keyframes slideOut-6d1179fc{0%{transform:translate(0)}to{transform:translate(101%)}}.stage-transition-1[data-v-bf1d1566]{--delay:0s;position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}.stage-transition-1[data-v-bf1d1566]:before{content:"";animation:1s cubic-bezier(.87,.05,.02,.97) both slideIn-bf1d1566,1s cubic-bezier(.87,.05,.02,.97) forwards slideOut-bf1d1566;position:absolute;top:0;bottom:0;left:0;right:0}.stage-transition-1[data-v-bf1d1566]:after{content:"";animation:1s cubic-bezier(.87,.05,.02,.97) both slideIn-bf1d1566,1s cubic-bezier(.87,.05,.02,.97) forwards slideOut-bf1d1566;position:absolute;top:0;bottom:0;left:0;right:0}.stage-transition-1[data-v-bf1d1566]:before{background-color:var(--stage-transition-1-overlay-color-2);animation-delay:calc(0s + var(--delay,0s)),calc(1.4s + var(--delay,0s))}.stage-transition-1[data-v-bf1d1566]:after{background-color:var(--stage-transition-1-overlay-color-1);animation-delay:calc(.2s + var(--delay,0s)),calc(1.2s + var(--delay,0s))}@keyframes slideIn-bf1d1566{0%{transform:translate(-101%)}to{transform:translate(0)}}@keyframes slideOut-bf1d1566{0%{transform:translate(0)}to{transform:translate(101%)}}.stage-transition-2[data-v-8ff7120f]{--delay:0s;--skew-x:100%;position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}.stage-transition-2[data-v-8ff7120f]:before{content:"";animation:1s cubic-bezier(.87,.05,.02,.97) both maskIn-8ff7120f,1s cubic-bezier(.87,.05,.02,.97) forwards maskOut-8ff7120f;position:absolute;top:0;bottom:0;left:0;right:0}.stage-transition-2[data-v-8ff7120f]:after{content:"";animation:1s cubic-bezier(.87,.05,.02,.97) both maskIn-8ff7120f,1s cubic-bezier(.87,.05,.02,.97) forwards maskOut-8ff7120f;position:absolute;top:0;bottom:0;left:0;right:0}.stage-transition-2[data-v-8ff7120f]:before{background-color:var(--stage-transition-2-overlay-color-2);animation-delay:calc(0s + var(--delay,0s)),calc(1.4s + var(--delay,0s))}.stage-transition-2[data-v-8ff7120f]:after{background-color:var(--stage-transition-2-overlay-color-1);animation-delay:calc(.2s + var(--delay,0s)),calc(1.2s + var(--delay,0s))}@keyframes maskIn-8ff7120f{0%{clip-path:polygon(0 0,0 0,calc(var(--skew-x,0)*-1)100%,calc(var(--skew-x,0)*-1)100%)}to{clip-path:polygon(0 0,calc(100% + var(--skew-x,0))0,100% 100%,calc(var(--skew-x,0)*-1)100%)}}@keyframes maskOut-8ff7120f{0%{clip-path:polygon(0 0,calc(100% + var(--skew-x,0))0,100% 100%,calc(var(--skew-x,0)*-1)100%)}to{clip-path:polygon(calc(100% + var(--skew-x,0))0,calc(100% + var(--skew-x,0))0,100% 100%,100% 100%)}}.rectangle-rotate-transition[data-v-f4b1dc64]{position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}.rectangle[data-v-f4b1dc64]{width:100%;height:100%;position:absolute}.rectangle div[data-v-f4b1dc64]{width:100vmax;height:100vmax;position:absolute;transform:scale(0)}.rectangle-rotate-1 div[data-v-f4b1dc64]{background-color:var(--rectangle-rotate-1-color);animation:expand-rotate-f4b1dc64 var(--rectangle-rotate-duration)ease calc(var(--rectangle-rotate-delay) + 0s)forwards;top:-50vmax;left:-50vmax}.rectangle-rotate-2 div[data-v-f4b1dc64]{background-color:var(--rectangle-rotate-2-color);animation:expand-rotate-f4b1dc64 var(--rectangle-rotate-duration)ease calc(var(--rectangle-rotate-delay) + var(--rectangle-rotate-stagger))forwards;bottom:-50vmax;right:-50vmax}.rectangle-rotate-3 div[data-v-f4b1dc64]{background-color:var(--rectangle-rotate-3-color);animation:expand-rotate-f4b1dc64 var(--rectangle-rotate-duration)ease calc(var(--rectangle-rotate-delay) + calc(var(--rectangle-rotate-stagger)*2))forwards;top:calc(50% - 50vmax);left:calc(50% - 50vmax)}@keyframes expand-rotate-f4b1dc64{0%{transform:scale(0)rotate(0)}to{transform:scale(1)rotate(var(--rectangle-rotate-rotation))}}@property --chromatic-hue{syntax:"";inherits:true;initial-value:0}@keyframes hue-anim{0%{--chromatic-hue:0}to{--chromatic-hue:360}}.dynamic-hue{animation:10s linear infinite hue-anim}*,:before,:after{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:before,:after{--un-content:""}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.slide-away-enter-active,.slide-away-leave-active{transition:transform .3s ease-in-out,opacity .3s ease-in-out}.slide-away-enter,.slide-away-leave-to{opacity:0;transform:translateY(-10px)}.slide-away-enter-from,.slide-away-leave{opacity:0;transform:translateY(10px)}:root{--bg-color-light:#fff;--bg-color-dark:#121212;--progress-bar-color:#f472b6;--bg-color:var(--bg-color-light)}html,body,#app{overscroll-behavior:none;height:100%;margin:0;padding:0}html{background:var(--bg-color);transition:all .3s ease-in-out}html.dark{--bg-color:var(--bg-color-dark);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}#nprogress{pointer-events:none}#nprogress .bar{background:var(--progress-bar-color);opacity:.75;z-index:1031;width:100%;height:2px;position:fixed;top:0;left:0}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset: ;--un-shadow:0 0 #0000;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:#93c5fd80;--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset: ;--un-shadow:0 0 #0000;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:#93c5fd80;--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }@font-face{font-family:DM Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v15/aFTU7PB1QTsUX8KYthSQBK6PYK3EXw.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v15/aFTU7PB1QTsUX8KYthqQBK6PYK0.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v16/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRR232RmYJp8I5zzw.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v16/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRSW32RmYJp8I5.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Serif Display;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v16/-nFnOHM81r4j6k0gjAW3mujVU2B2G_5x0vrx52jJ3Q.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Serif Display;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v16/-nFnOHM81r4j6k0gjAW3mujVU2B2G_Bx0vrx52g.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.2.woff2)format("woff2");unicode-range:U+D723-D728,U+D72A-D733,U+D735-D748,U+D74A-D74F,U+D752-D753,U+D755-D757,U+D75A-D75F,U+D762-D764,U+D766-D768,U+D76A-D76B,U+D76D-D76F,U+D771-D787,U+D789-D78B,U+D78D-D78F,U+D791-D797,U+D79A,U+D79C,U+D79E-D7A3,U+F900-F909,U+F90B-F92E}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.3.woff2)format("woff2");unicode-range:U+D679-D68B,U+D68E-D69E,U+D6A0,U+D6A2-D6A7,U+D6A9-D6C3,U+D6C6-D6C7,U+D6C9-D6CB,U+D6CD-D6D3,U+D6D5-D6D6,U+D6D8-D6E3,U+D6E5-D6E7,U+D6E9-D6FB,U+D6FD-D717,U+D719-D71F,U+D721-D722}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.4.woff2)format("woff2");unicode-range:U+D5BC-D5C7,U+D5CA-D5CB,U+D5CD-D5CF,U+D5D1-D5D7,U+D5D9-D5DA,U+D5DC,U+D5DE-D5E3,U+D5E6-D5E7,U+D5E9-D5EB,U+D5ED-D5F6,U+D5F8,U+D5FA-D5FF,U+D602-D603,U+D605-D607,U+D609-D60F,U+D612-D613,U+D616-D61B,U+D61D-D637,U+D63A-D63B,U+D63D-D63F,U+D641-D647,U+D64A-D64C,U+D64E-D653,U+D656-D657,U+D659-D65B,U+D65D-D666,U+D668,U+D66A-D678}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.5.woff2)format("woff2");unicode-range:U+D507,U+D509-D50B,U+D50D-D513,U+D515-D53B,U+D53E-D53F,U+D541-D543,U+D545-D54C,U+D54E,U+D550,U+D552-D557,U+D55A-D55B,U+D55D-D55F,U+D561-D564,U+D566-D567,U+D56A,U+D56C,U+D56E-D573,U+D576-D577,U+D579-D583,U+D585-D586,U+D58A-D5A4,U+D5A6-D5BB}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.6.woff2)format("woff2");unicode-range:U+D464-D477,U+D47A-D47B,U+D47D-D47F,U+D481-D487,U+D489-D48A,U+D48C,U+D48E-D4E7,U+D4E9-D503,U+D505-D506}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.7.woff2)format("woff2");unicode-range:U+D3BF-D3C7,U+D3CA-D3CF,U+D3D1-D3EB,U+D3EE-D3EF,U+D3F1-D3F3,U+D3F5-D3FB,U+D3FD-D400,U+D402-D45B,U+D45D-D463}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.8.woff2)format("woff2");unicode-range:U+D2FF,U+D302-D304,U+D306-D30B,U+D30F,U+D311-D313,U+D315-D31B,U+D31E,U+D322-D324,U+D326-D327,U+D32A-D32B,U+D32D-D32F,U+D331-D337,U+D339-D33C,U+D33E-D37B,U+D37E-D37F,U+D381-D383,U+D385-D38B,U+D38E-D390,U+D392-D397,U+D39A-D39B,U+D39D-D39F,U+D3A1-D3A7,U+D3A9-D3AA,U+D3AC,U+D3AE-D3B3,U+D3B5-D3B7,U+D3B9-D3BB,U+D3BD-D3BE}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.9.woff2)format("woff2");unicode-range:U+D257-D27F,U+D281-D29B,U+D29D-D29F,U+D2A1-D2AB,U+D2AD-D2B7,U+D2BA-D2BB,U+D2BD-D2BF,U+D2C1-D2C7,U+D2C9-D2EF,U+D2F2-D2F3,U+D2F5-D2F7,U+D2F9-D2FE}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.10.woff2)format("woff2");unicode-range:U+D1B4,U+D1B6-D1F3,U+D1F5-D22B,U+D22E-D22F,U+D231-D233,U+D235-D23B,U+D23D-D240,U+D242-D256}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.11.woff2)format("woff2");unicode-range:U+D105-D12F,U+D132-D133,U+D135-D137,U+D139-D13F,U+D141-D142,U+D144,U+D146-D14B,U+D14E-D14F,U+D151-D153,U+D155-D15B,U+D15E-D187,U+D189-D19F,U+D1A2-D1A3,U+D1A5-D1A7,U+D1A9-D1AF,U+D1B2-D1B3}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.12.woff2)format("woff2");unicode-range:U+D04B-D04F,U+D051-D057,U+D059-D06B,U+D06D-D06F,U+D071-D073,U+D075-D07B,U+D07E-D0A3,U+D0A6-D0A7,U+D0A9-D0AB,U+D0AD-D0B3,U+D0B6,U+D0B8,U+D0BA-D0BF,U+D0C2-D0C3,U+D0C5-D0C7,U+D0C9-D0CF,U+D0D2,U+D0D6-D0DB,U+D0DE-D0DF,U+D0E1-D0E3,U+D0E5-D0EB,U+D0EE-D0F0,U+D0F2-D104}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.13.woff2)format("woff2");unicode-range:U+CFA2-CFC3,U+CFC5-CFDF,U+CFE2-CFE3,U+CFE5-CFE7,U+CFE9-CFF4,U+CFF6-CFFB,U+CFFD-CFFF,U+D001-D003,U+D005-D017,U+D019-D033,U+D036-D037,U+D039-D03B,U+D03D-D04A}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.14.woff2)format("woff2");unicode-range:U+CEF0-CEF3,U+CEF6,U+CEF9-CEFF,U+CF01-CF03,U+CF05-CF07,U+CF09-CF0F,U+CF11-CF12,U+CF14-CF1B,U+CF1D-CF1F,U+CF21-CF2F,U+CF31-CF53,U+CF56-CF57,U+CF59-CF5B,U+CF5D-CF63,U+CF66,U+CF68,U+CF6A-CF6F,U+CF71-CF84,U+CF86-CF8B,U+CF8D-CFA1}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.15.woff2)format("woff2");unicode-range:U+CE3C-CE57,U+CE5A-CE5B,U+CE5D-CE5F,U+CE61-CE67,U+CE6A,U+CE6C,U+CE6E-CE73,U+CE76-CE77,U+CE79-CE7B,U+CE7D-CE83,U+CE85-CE88,U+CE8A-CE8F,U+CE91-CE93,U+CE95-CE97,U+CE99-CE9F,U+CEA2,U+CEA4-CEAB,U+CEAD-CEE3,U+CEE6-CEE7,U+CEE9-CEEB,U+CEED-CEEF}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.16.woff2)format("woff2");unicode-range:U+CD92-CD93,U+CD96-CD97,U+CD99-CD9B,U+CD9D-CDA3,U+CDA6-CDA8,U+CDAA-CDAF,U+CDB1-CDC3,U+CDC5-CDCB,U+CDCD-CDE7,U+CDE9-CE03,U+CE05-CE1F,U+CE22-CE34,U+CE36-CE3B}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.17.woff2)format("woff2");unicode-range:U+CCEF-CD07,U+CD0A-CD0B,U+CD0D-CD1A,U+CD1C,U+CD1E-CD2B,U+CD2D-CD5B,U+CD5D-CD77,U+CD79-CD91}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.18.woff2)format("woff2");unicode-range:U+CC3F-CC43,U+CC46-CC47,U+CC49-CC4B,U+CC4D-CC53,U+CC55-CC58,U+CC5A-CC5F,U+CC61-CC97,U+CC9A-CC9B,U+CC9D-CC9F,U+CCA1-CCA7,U+CCAA,U+CCAC,U+CCAE-CCB3,U+CCB6-CCB7,U+CCB9-CCBB,U+CCBD-CCCF,U+CCD1-CCE3,U+CCE5-CCEE}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.19.woff2)format("woff2");unicode-range:U+CB91-CBD3,U+CBD5-CBE3,U+CBE5-CC0B,U+CC0E-CC0F,U+CC11-CC13,U+CC15-CC1B,U+CC1D-CC20,U+CC23-CC27,U+CC2A-CC2B,U+CC2D,U+CC2F,U+CC31-CC37,U+CC3A,U+CC3C}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.20.woff2)format("woff2");unicode-range:U+CAF4-CB47,U+CB4A-CB90}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.21.woff2)format("woff2");unicode-range:U+CA4A-CA4B,U+CA4E-CA4F,U+CA51-CA53,U+CA55-CA5B,U+CA5D-CA60,U+CA62-CA83,U+CA85-CABB,U+CABE-CABF,U+CAC1-CAC3,U+CAC5-CACB,U+CACD-CAD0,U+CAD2,U+CAD4-CAD8,U+CADA-CAF3}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.22.woff2)format("woff2");unicode-range:U+C996-C997,U+C99A-C99C,U+C99E-C9BF,U+C9C2-C9C3,U+C9C5-C9C7,U+C9C9-C9CF,U+C9D2,U+C9D4,U+C9D7-C9D8,U+C9DB,U+C9DE-C9DF,U+C9E1-C9E3,U+C9E5-C9E6,U+C9E8-C9EB,U+C9EE-C9F0,U+C9F2-C9F7,U+C9F9-CA0B,U+CA0D-CA28,U+CA2A-CA49}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.23.woff2)format("woff2");unicode-range:U+C8E9-C8F4,U+C8F6-C8FB,U+C8FE-C8FF,U+C901-C903,U+C905-C90B,U+C90E-C910,U+C912-C917,U+C919-C92B,U+C92D-C94F,U+C951-C953,U+C955-C96B,U+C96D-C973,U+C975-C987,U+C98A-C98B,U+C98D-C98F,U+C991-C995}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.24.woff2)format("woff2");unicode-range:U+C841-C84B,U+C84D-C86F,U+C872-C873,U+C875-C877,U+C879-C87F,U+C882-C884,U+C887-C88A,U+C88D-C8C3,U+C8C5-C8DF,U+C8E1-C8E8}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.25.woff2)format("woff2");unicode-range:U+C779-C77B,U+C77E-C782,U+C786,U+C78B,U+C78D,U+C78F,U+C792-C793,U+C795,U+C797,U+C799-C79F,U+C7A2,U+C7A7-C7AB,U+C7AE-C7BB,U+C7BD-C7C0,U+C7C2-C7C7,U+C7C9-C7DC,U+C7DE-C7FF,U+C802-C803,U+C805-C807,U+C809,U+C80B-C80F,U+C812,U+C814,U+C817-C81B,U+C81E-C81F,U+C821-C823,U+C825-C82E,U+C830-C837,U+C839-C83B,U+C83D-C840}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.26.woff2)format("woff2");unicode-range:U+C6BB-C6BF,U+C6C2,U+C6C4,U+C6C6-C6CB,U+C6CE-C6CF,U+C6D1-C6D3,U+C6D5-C6DB,U+C6DD-C6DF,U+C6E1-C6E7,U+C6E9-C6EB,U+C6ED-C6EF,U+C6F1-C6F8,U+C6FA-C703,U+C705-C707,U+C709-C70B,U+C70D-C716,U+C718,U+C71A-C71F,U+C722-C723,U+C725-C727,U+C729-C734,U+C736-C73B,U+C73E-C73F,U+C741-C743,U+C745-C74B,U+C74E-C750,U+C752-C757,U+C759-C773,U+C776-C777}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.27.woff2)format("woff2");unicode-range:U+C5F5-C5FB,U+C5FE,U+C602-C605,U+C607,U+C609-C60F,U+C611-C61A,U+C61C-C623,U+C626-C627,U+C629-C62B,U+C62D,U+C62F-C632,U+C636,U+C638,U+C63A-C63F,U+C642-C643,U+C645-C647,U+C649-C652,U+C656-C65B,U+C65D-C65F,U+C661-C663,U+C665-C677,U+C679-C67B,U+C67D-C693,U+C696-C697,U+C699-C69B,U+C69D-C6A3,U+C6A6,U+C6A8,U+C6AA-C6AF,U+C6B2-C6B3,U+C6B5-C6B7,U+C6B9-C6BA}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.28.woff2)format("woff2");unicode-range:U+C517-C527,U+C52A-C52B,U+C52D-C52F,U+C531-C538,U+C53A,U+C53C,U+C53E-C543,U+C546-C547,U+C54B,U+C54D-C552,U+C556,U+C55A-C55B,U+C55D,U+C55F,U+C562-C563,U+C565-C567,U+C569-C56F,U+C572,U+C574,U+C576-C57B,U+C57E-C57F,U+C581-C583,U+C585-C586,U+C588-C58B,U+C58E,U+C590,U+C592-C596,U+C599-C5B3,U+C5B6-C5B7,U+C5BA,U+C5BE-C5C3,U+C5CA-C5CB,U+C5CD,U+C5CF,U+C5D2-C5D3,U+C5D5-C5D7,U+C5D9-C5DF,U+C5E1-C5E2,U+C5E4,U+C5E6-C5EB,U+C5EF,U+C5F1-C5F3}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.29.woff2)format("woff2");unicode-range:U+C475-C4EF,U+C4F2-C4F3,U+C4F5-C4F7,U+C4F9-C4FF,U+C502-C50B,U+C50D-C516}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.30.woff2)format("woff2");unicode-range:U+C3D0-C3D7,U+C3DA-C3DB,U+C3DD-C3DE,U+C3E1-C3EC,U+C3EE-C3F3,U+C3F5-C42B,U+C42D-C463,U+C466-C474}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.31.woff2)format("woff2");unicode-range:U+C32B-C367,U+C36A-C36B,U+C36D-C36F,U+C371-C377,U+C37A-C37B,U+C37E-C383,U+C385-C387,U+C389-C3CF}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.32.woff2)format("woff2");unicode-range:U+C26A-C26B,U+C26D-C26F,U+C271-C273,U+C275-C27B,U+C27E-C287,U+C289-C28F,U+C291-C297,U+C299-C29A,U+C29C-C2A3,U+C2A5-C2A7,U+C2A9-C2AB,U+C2AD-C2B3,U+C2B6,U+C2B8,U+C2BA-C2BB,U+C2BD-C2DB,U+C2DE-C2DF,U+C2E1-C2E2,U+C2E5-C2EA,U+C2EE,U+C2F0,U+C2F2-C2F5,U+C2F7,U+C2FA-C2FB,U+C2FD-C2FF,U+C301-C307,U+C309-C30C,U+C30E-C312,U+C315-C323,U+C325-C328,U+C32A}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.33.woff2)format("woff2");unicode-range:U+C1BC-C1C3,U+C1C5-C1DF,U+C1E1-C1FB,U+C1FD-C203,U+C205-C20C,U+C20E,U+C210-C217,U+C21A-C21B,U+C21D-C21E,U+C221-C227,U+C229-C22A,U+C22C,U+C22E,U+C230,U+C233-C24F,U+C251-C257,U+C259-C269}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.34.woff2)format("woff2");unicode-range:U+C101-C11B,U+C11F,U+C121-C123,U+C125-C12B,U+C12E,U+C132-C137,U+C13A-C13B,U+C13D-C13F,U+C141-C147,U+C14A,U+C14C-C153,U+C155-C157,U+C159-C15B,U+C15D-C166,U+C169-C16F,U+C171-C177,U+C179-C18B,U+C18E-C18F,U+C191-C193,U+C195-C19B,U+C19D-C19E,U+C1A0,U+C1A2-C1A4,U+C1A6-C1BB}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.35.woff2)format("woff2");unicode-range:U+C049-C057,U+C059-C05B,U+C05D-C05F,U+C061-C067,U+C069-C08F,U+C091-C0AB,U+C0AE-C0AF,U+C0B1-C0B3,U+C0B5,U+C0B7-C0BB,U+C0BE,U+C0C2-C0C7,U+C0CA-C0CB,U+C0CD-C0CF,U+C0D1-C0D7,U+C0D9-C0DA,U+C0DC,U+C0DE-C0E3,U+C0E5-C0EB,U+C0ED-C0F3,U+C0F6,U+C0F8,U+C0FA-C0FF}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.36.woff2)format("woff2");unicode-range:U+BFA7-BFAF,U+BFB1-BFC4,U+BFC6-BFCB,U+BFCE-BFCF,U+BFD1-BFD3,U+BFD5-BFDB,U+BFDD-C048}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.37.woff2)format("woff2");unicode-range:U+BF07,U+BF09-BF3F,U+BF41-BF4F,U+BF52-BF54,U+BF56-BFA6}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.38.woff2)format("woff2");unicode-range:U+BE56,U+BE58,U+BE5C-BE5F,U+BE62-BE63,U+BE65-BE67,U+BE69-BE74,U+BE76-BE7B,U+BE7E-BE7F,U+BE81-BE8E,U+BE90,U+BE92-BEA7,U+BEA9-BECF,U+BED2-BED3,U+BED5-BED6,U+BED9-BEE3,U+BEE6-BF06}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.39.woff2)format("woff2");unicode-range:U+BDB0-BDD3,U+BDD5-BDEF,U+BDF1-BE0B,U+BE0D-BE0F,U+BE11-BE13,U+BE15-BE43,U+BE46-BE47,U+BE49-BE4B,U+BE4D-BE53}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.40.woff2)format("woff2");unicode-range:U+BD03,U+BD06,U+BD08,U+BD0A-BD0F,U+BD11-BD22,U+BD25-BD47,U+BD49-BD58,U+BD5A-BD7F,U+BD82-BD83,U+BD85-BD87,U+BD8A-BD8F,U+BD91-BD92,U+BD94,U+BD96-BD98,U+BD9A-BDAF}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.41.woff2)format("woff2");unicode-range:U+BC4E-BC83,U+BC86-BC87,U+BC89-BC8B,U+BC8D-BC93,U+BC96,U+BC98,U+BC9B-BC9F,U+BCA2-BCA3,U+BCA5-BCA7,U+BCA9-BCB2,U+BCB4-BCBB,U+BCBE-BCBF,U+BCC1-BCC3,U+BCC5-BCCC,U+BCCE-BCD0,U+BCD2-BCD4,U+BCD6-BCF3,U+BCF7,U+BCF9-BCFB,U+BCFD-BD02}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.42.woff2)format("woff2");unicode-range:U+BB90-BBA3,U+BBA5-BBAB,U+BBAD-BBBF,U+BBC1-BBF7,U+BBFA-BBFB,U+BBFD-BBFE,U+BC01-BC07,U+BC09-BC0A,U+BC0E,U+BC10,U+BC12-BC13,U+BC17,U+BC19-BC1A,U+BC1E,U+BC20-BC23,U+BC26,U+BC28,U+BC2A-BC2C,U+BC2E-BC2F,U+BC32-BC33,U+BC35-BC37,U+BC39-BC3F,U+BC41-BC42,U+BC44,U+BC46-BC48,U+BC4A-BC4D}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.43.woff2)format("woff2");unicode-range:U+BAE6-BAFB,U+BAFD-BB17,U+BB19-BB33,U+BB37,U+BB39-BB3A,U+BB3D-BB43,U+BB45-BB46,U+BB48,U+BB4A-BB4F,U+BB51-BB53,U+BB55-BB57,U+BB59-BB62,U+BB64-BB8F}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.44.woff2)format("woff2");unicode-range:U+BA30-BA37,U+BA3A-BA3B,U+BA3D-BA3F,U+BA41-BA47,U+BA49-BA4A,U+BA4C,U+BA4E-BA53,U+BA56-BA57,U+BA59-BA5B,U+BA5D-BA63,U+BA65-BA66,U+BA68-BA6F,U+BA71-BA73,U+BA75-BA77,U+BA79-BA84,U+BA86,U+BA88-BAA7,U+BAAA,U+BAAD-BAAF,U+BAB1-BAB7,U+BABA,U+BABC,U+BABE-BAE5}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.45.woff2)format("woff2");unicode-range:U+B96E-B973,U+B976-B977,U+B979-B97B,U+B97D-B983,U+B986,U+B988,U+B98A-B98D,U+B98F-B9AB,U+B9AE-B9AF,U+B9B1-B9B3,U+B9B5-B9BB,U+B9BE,U+B9C0,U+B9C2-B9C7,U+B9CA-B9CB,U+B9CD,U+B9D2-B9D7,U+B9DA,U+B9DC,U+B9DF-B9E0,U+B9E2,U+B9E6-B9E7,U+B9E9-B9F3,U+B9F6,U+B9F8,U+B9FB-BA2F}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.46.woff2)format("woff2");unicode-range:U+B8BF-B8CB,U+B8CD-B8E0,U+B8E2-B8E7,U+B8EA-B8EB,U+B8ED-B8EF,U+B8F1-B8F7,U+B8FA,U+B8FC,U+B8FE-B903,U+B905-B917,U+B919-B91F,U+B921-B93B,U+B93D-B957,U+B95A-B95B,U+B95D-B95F,U+B961-B967,U+B969-B96C}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.47.woff2)format("woff2");unicode-range:U+B80D-B80F,U+B811-B817,U+B81A,U+B81C-B823,U+B826-B827,U+B829-B82B,U+B82D-B833,U+B836,U+B83A-B83F,U+B841-B85B,U+B85E-B85F,U+B861-B863,U+B865-B86B,U+B86E,U+B870,U+B872-B8AF,U+B8B1-B8BE}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.48.woff2)format("woff2");unicode-range:U+B74D-B75F,U+B761-B763,U+B765-B774,U+B776-B77B,U+B77E-B77F,U+B781-B783,U+B785-B78B,U+B78E,U+B792-B796,U+B79A-B79B,U+B79D-B7A7,U+B7AA,U+B7AE-B7B3,U+B7B6-B7C8,U+B7CA-B7EB,U+B7EE-B7EF,U+B7F1-B7F3,U+B7F5-B7FB,U+B7FE,U+B802-B806,U+B80A-B80B}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.49.woff2)format("woff2");unicode-range:U+B6A7-B6AA,U+B6AC-B6B0,U+B6B2-B6EF,U+B6F1-B727,U+B72A-B72B,U+B72D-B72E,U+B731-B737,U+B739-B73A,U+B73C-B743,U+B745-B74C}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.50.woff2)format("woff2");unicode-range:U+B605-B60F,U+B612-B617,U+B619-B624,U+B626-B69B,U+B69E-B6A3,U+B6A5-B6A6}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.51.woff2)format("woff2");unicode-range:U+B55F,U+B562-B583,U+B585-B59F,U+B5A2-B5A3,U+B5A5-B5A7,U+B5A9-B5B2,U+B5B5-B5BA,U+B5BD-B604}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.52.woff2)format("woff2");unicode-range:U+B4A5-B4B6,U+B4B8-B4BF,U+B4C1-B4C7,U+B4C9-B4DB,U+B4DE-B4DF,U+B4E1-B4E2,U+B4E5-B4EB,U+B4EE,U+B4F0,U+B4F2-B513,U+B516-B517,U+B519-B51A,U+B51D-B523,U+B526,U+B528,U+B52B-B52F,U+B532-B533,U+B535-B537,U+B539-B53F,U+B541-B544,U+B546-B54B,U+B54D-B54F,U+B551-B55B,U+B55D-B55E}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.53.woff2)format("woff2");unicode-range:U+B3F8-B3FB,U+B3FD-B40F,U+B411-B417,U+B419-B41B,U+B41D-B41F,U+B421-B427,U+B42A-B42B,U+B42D-B44F,U+B452-B453,U+B455-B457,U+B459-B45F,U+B462-B464,U+B466-B46B,U+B46D-B47F,U+B481-B4A3}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.54.woff2)format("woff2");unicode-range:U+B342-B353,U+B356-B357,U+B359-B35B,U+B35D-B35E,U+B360-B363,U+B366,U+B368,U+B36A-B36D,U+B36F,U+B372-B373,U+B375-B377,U+B379-B37F,U+B381-B382,U+B384,U+B386-B38B,U+B38D-B3C3,U+B3C6-B3C7,U+B3C9-B3CA,U+B3CD-B3D3,U+B3D6,U+B3D8,U+B3DA-B3F7}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.55.woff2)format("woff2");unicode-range:U+B27C-B283,U+B285-B28F,U+B292-B293,U+B295-B297,U+B29A-B29F,U+B2A1-B2A4,U+B2A7-B2A9,U+B2AB,U+B2AD-B2C7,U+B2CA-B2CB,U+B2CD-B2CF,U+B2D1-B2D7,U+B2DA,U+B2DC,U+B2DE-B2E3,U+B2E7,U+B2E9-B2EA,U+B2EF-B2F3,U+B2F6,U+B2F8,U+B2FA-B2FB,U+B2FD-B2FE,U+B302-B303,U+B305-B307,U+B309-B30F,U+B312,U+B316-B31B,U+B31D-B341}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.56.woff2)format("woff2");unicode-range:U+B1D6-B1E7,U+B1E9-B1FC,U+B1FE-B203,U+B206-B207,U+B209-B20B,U+B20D-B213,U+B216-B21F,U+B221-B257,U+B259-B273,U+B275-B27B}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.57.woff2)format("woff2");unicode-range:U+B120-B122,U+B126-B127,U+B129-B12B,U+B12D-B133,U+B136,U+B138,U+B13A-B13F,U+B142-B143,U+B145-B14F,U+B151-B153,U+B156-B157,U+B159-B177,U+B17A-B17B,U+B17D-B17F,U+B181-B187,U+B189-B18C,U+B18E-B191,U+B195-B1A7,U+B1A9-B1CB,U+B1CD-B1D5}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.58.woff2)format("woff2");unicode-range:U+B05F-B07B,U+B07E-B07F,U+B081-B083,U+B085-B08B,U+B08D-B097,U+B09B,U+B09D-B09F,U+B0A2-B0A7,U+B0AA,U+B0B0,U+B0B2,U+B0B6-B0B7,U+B0B9-B0BB,U+B0BD-B0C3,U+B0C6-B0C7,U+B0CA-B0CF,U+B0D1-B0DF,U+B0E1-B0E4,U+B0E6-B107,U+B10A-B10B,U+B10D-B10F,U+B111-B112,U+B114-B117,U+B119-B11A,U+B11C-B11F}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.59.woff2)format("woff2");unicode-range:U+AFAC-AFB7,U+AFBA-AFBB,U+AFBD-AFBF,U+AFC1-AFC6,U+AFCA-AFCC,U+AFCE-AFD3,U+AFD5-AFE7,U+AFE9-AFEF,U+AFF1-B00B,U+B00D-B00F,U+B011-B013,U+B015-B01B,U+B01D-B027,U+B029-B043,U+B045-B047,U+B049,U+B04B,U+B04D-B052,U+B055-B056,U+B058-B05C,U+B05E}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.60.woff2)format("woff2");unicode-range:U+AF03-AF07,U+AF09-AF2B,U+AF2E-AF33,U+AF35-AF3B,U+AF3E-AF40,U+AF44-AF47,U+AF4A-AF5C,U+AF5E-AF63,U+AF65-AF7F,U+AF81-AFAB}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.61.woff2)format("woff2");unicode-range:U+AE56-AE5B,U+AE5E-AE60,U+AE62-AE64,U+AE66-AE67,U+AE69-AE6B,U+AE6D-AE83,U+AE85-AEBB,U+AEBF,U+AEC1-AEC3,U+AEC5-AECB,U+AECE,U+AED0,U+AED2-AED7,U+AED9-AEF3,U+AEF5-AF02}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.62.woff2)format("woff2");unicode-range:U+AD9C-ADA3,U+ADA5-ADBF,U+ADC1-ADC3,U+ADC5-ADC7,U+ADC9-ADD2,U+ADD4-ADDB,U+ADDD-ADDF,U+ADE1-ADE3,U+ADE5-ADF7,U+ADFA-ADFB,U+ADFD-ADFF,U+AE02-AE07,U+AE0A,U+AE0C,U+AE0E-AE13,U+AE15-AE2F,U+AE31-AE33,U+AE35-AE37,U+AE39-AE3F,U+AE42,U+AE44,U+AE46-AE49,U+AE4B,U+AE4F,U+AE51-AE53,U+AE55}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.63.woff2)format("woff2");unicode-range:U+ACE2-ACE3,U+ACE5-ACE6,U+ACE9-ACEF,U+ACF2,U+ACF4,U+ACF7-ACFB,U+ACFE-ACFF,U+AD01-AD03,U+AD05-AD0B,U+AD0D-AD10,U+AD12-AD1B,U+AD1D-AD33,U+AD35-AD48,U+AD4A-AD4F,U+AD51-AD6B,U+AD6E-AD6F,U+AD71-AD72,U+AD77-AD7C,U+AD7E,U+AD80,U+AD82-AD87,U+AD89-AD8B,U+AD8D-AD8F,U+AD91-AD9B}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.64.woff2)format("woff2");unicode-range:U+AC25-AC2C,U+AC2E,U+AC30,U+AC32-AC37,U+AC39-AC3F,U+AC41-AC4C,U+AC4E-AC6F,U+AC72-AC73,U+AC75-AC76,U+AC79-AC7F,U+AC82,U+AC84-AC88,U+AC8A-AC8B,U+AC8D-AC8F,U+AC91-AC93,U+AC95-AC9B,U+AC9D-AC9E,U+ACA1-ACA7,U+ACAB,U+ACAD-ACAF,U+ACB1-ACB7,U+ACBA-ACBB,U+ACBE-ACC0,U+ACC2-ACC3,U+ACC5-ACDF}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.65.woff2)format("woff2");unicode-range:U+99DF,U+99ED,U+99F1,U+99FF,U+9A01,U+9A08,U+9A0E-9A0F,U+9A19,U+9A2B,U+9A30,U+9A36-9A37,U+9A40,U+9A43,U+9A45,U+9A4D,U+9A55,U+9A57,U+9A5A-9A5B,U+9A5F,U+9A62,U+9A65,U+9A69-9A6A,U+9AA8,U+9AB8,U+9AD3,U+9AE5,U+9AEE,U+9B1A,U+9B27,U+9B2A,U+9B31,U+9B3C,U+9B41-9B45,U+9B4F,U+9B54,U+9B5A,U+9B6F,U+9B8E,U+9B91,U+9B9F,U+9BAB,U+9BAE,U+9BC9,U+9BD6,U+9BE4,U+9BE8,U+9C0D,U+9C10,U+9C12,U+9C15,U+9C25,U+9C32,U+9C3B,U+9C47,U+9C49,U+9C57,U+9CE5,U+9CE7,U+9CE9,U+9CF3-9CF4,U+9CF6,U+9D09,U+9D1B,U+9D26,U+9D28,U+9D3B,U+9D51,U+9D5D,U+9D60-9D61,U+9D6C,U+9D72,U+9DA9,U+9DAF,U+9DB4,U+9DC4,U+9DD7,U+9DF2,U+9DF8-9DFA,U+9E1A,U+9E1E,U+9E75,U+9E79,U+9E7D,U+9E7F,U+9E92-9E93,U+9E97,U+9E9D,U+9E9F,U+9EA5,U+9EB4-9EB5,U+9EBB,U+9EBE,U+9EC3,U+9ECD-9ECE,U+9ED4,U+9ED8,U+9EDB-9EDC,U+9EDE,U+9EE8,U+9EF4,U+9F07-9F08,U+9F0E,U+9F13,U+9F20,U+9F3B,U+9F4A-9F4B,U+9F4E,U+9F52,U+9F5F,U+9F61,U+9F67,U+9F6A,U+9F6C,U+9F77,U+9F8D,U+9F90,U+9F95,U+9F9C,U+AC02-AC03,U+AC05-AC06,U+AC09-AC0F,U+AC17-AC18,U+AC1B,U+AC1E-AC1F,U+AC21-AC23}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.94.woff2)format("woff2");unicode-range:U+3136,U+3138,U+313A-3140,U+3143-3144,U+3150,U+3152,U+3154-3156,U+3158-315B,U+315D-315F,U+3162,U+3164-318C,U+318E,U+3200-321B,U+3231,U+3239,U+3251-325A,U+3260-327B,U+327E-327F,U+328A-3290,U+3294,U+329E,U+32A5,U+3380-3384,U+3388-338B}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.95.woff2)format("woff2");unicode-range:U+2F7D,U+2F7F-2F8B,U+2F8E-2F90,U+2F92-2F97,U+2F99-2FA0,U+2FA2-2FA3,U+2FA5-2FA9,U+2FAC-2FB1,U+2FB3-2FBC,U+2FC1-2FCA,U+2FCD-2FD4,U+3003,U+3012-3019,U+301C,U+301E-3020,U+3036,U+3041,U+3043,U+3045,U+3047,U+3049,U+304E,U+3050,U+3052,U+3056,U+305A,U+305C,U+305E,U+3062,U+3065,U+306C,U+3070-307D,U+3080,U+3085,U+3087,U+308E,U+3090-3091,U+30A1,U+30A5,U+30A9,U+30AE,U+30B1-30B2,U+30B4,U+30B6,U+30BC-30BE,U+30C2,U+30C5,U+30CC,U+30D2,U+30D4,U+30D8-30DD,U+30E4,U+30E6,U+30E8,U+30EE,U+30F0-30F2,U+30F4-30F6,U+3133,U+3135}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.100.woff2)format("woff2");unicode-range:U+E8,U+2DA,U+2160,U+2194,U+3054,U+3058,U+306D,U+3086,U+308D,U+30AC,U+30BB,U+30C4,U+30CD-30CE,U+30E2,U+3132,U+3146,U+3149,U+339D,U+4E3B,U+4F0A,U+4FDD,U+4FE1,U+5409,U+540C,U+5834,U+592A-592B,U+5B9A,U+5DDE,U+5E0C,U+5E73,U+5F0F,U+60F3,U+653F,U+661F,U+662F,U+667A,U+683C,U+6B4C,U+6C11,U+767C,U+76EE,U+76F4,U+77F3,U+79D1,U+7A7A,U+7B2C,U+7D22,U+8207,U+8A00,U+8A71,U+9280,U+9580,U+958B,U+96C6,U+9762,U+98DF,U+9ED1,U+AC2D,U+ADC8,U+ADD3,U+AF48,U+B014,U+B134-B135,U+B158,U+B2AA,U+B35F,U+B6A4,U+B9CF,U+BB63,U+BD23,U+BE91,U+C29B,U+C3F4,U+C42C,U+C55C,U+C573,U+C58F,U+C78C,U+C7DD,U+C8F5,U+CAD1,U+CC48,U+CF10,U+CF20,U+D03C,U+D07D,U+D2A0,U+D30E,U+D38D,U+D3A8,U+D3C8,U+D5E5,U+D5F9,U+D6E4,U+F90A,U+FF02,U+FF1C}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.101.woff2)format("woff2");unicode-range:U+3B1,U+2466,U+25A1,U+25A3,U+261C,U+3008-3009,U+305B,U+305D,U+3069,U+30A7,U+30BA,U+30CF,U+30EF,U+3151,U+3157,U+4E4B,U+4E5F,U+4E8C,U+4ECA,U+4ED6,U+4F5B,U+50CF,U+5149,U+5165,U+5171,U+5229,U+529B,U+5316,U+539F,U+53F2,U+571F,U+5728,U+58EB,U+591C,U+5B78,U+5C11,U+5C55,U+5DDD,U+5E02,U+5FB7,U+60C5,U+610F,U+611F,U+6625,U+66F8,U+6797,U+679C,U+682A,U+6D2A,U+706B,U+7406,U+767B,U+76F8,U+77E5,U+7ACB,U+898B,U+8A69,U+8DEF,U+8FD1,U+901A,U+90E8,U+91CD,U+975E,U+AE14,U+AE6C,U+AEC0,U+AFC7,U+AFC9,U+B01C,U+B028,U+B308,U+B311,U+B314,U+B31C,U+B524,U+B560,U+B764,U+B920,U+B9E3,U+BD48,U+BE7D,U+C0DB,U+C231,U+C270,U+C2E3,U+C37D,U+C3ED,U+C530,U+C6A5,U+C6DC,U+C7A4,U+C954,U+C974,U+D000,U+D565,U+D667,U+D6C5,U+D79D,U+FF1E}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.102.woff2)format("woff2");unicode-range:U+131,U+2032,U+2465,U+2642,U+3048,U+3051,U+3083-3084,U+308F,U+30C0,U+30D1,U+30D3,U+30D6,U+30DF,U+30E7,U+3153,U+4E16,U+4E8B,U+4EE5,U+5206,U+52A0,U+52D5,U+53E4,U+53EF,U+54C1,U+57CE,U+597D,U+5B8C,U+5EA6,U+5F8C,U+5F97,U+6210,U+6240,U+624B,U+6728,U+6BD4,U+7236,U+7269,U+7279,U+738B,U+7528,U+7530,U+767E,U+798F,U+8005,U+8A18,U+90FD,U+91CC,U+9577,U+9593,U+98A8,U+AC20,U+ACF6,U+AD90,U+AF5D,U+AF80,U+AFCD,U+AFF0,U+B0A1,U+B0B5,U+B1FD,U+B2FC,U+B380,U+B51B,U+B584,U+B5B3,U+B8FD,U+B93C,U+B9F4,U+BB44,U+BC08,U+BC27,U+BC49,U+BE55,U+BE64,U+BFB0,U+BFC5,U+C178,U+C21F,U+C314,U+C4F1,U+C58D,U+C664,U+C698,U+C6A7,U+C6C1,U+C9ED,U+CAC0,U+CACC,U+CAD9,U+CCB5,U+CDCC,U+D0E4,U+D143,U+D320,U+D330,U+D54D,U+FF06,U+FF1F,U+FF5E}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.103.woff2)format("woff2");unicode-range:U+B4,U+20A9,U+20AC,U+2190,U+24D8,U+2502,U+2514,U+2592,U+25C7-25C8,U+2663,U+3060,U+3064,U+3081,U+3088,U+30A3,U+30A6,U+30AA,U+30B5,U+30C7,U+30CA-30CB,U+30D0,U+30E3,U+30E5,U+339E,U+4E09,U+4EAC,U+4F5C,U+5167-5168,U+516C,U+51FA,U+5408,U+540D,U+591A,U+5B57,U+6211,U+65B9,U+660E,U+6642,U+6700,U+6B63,U+6E2F,U+7063,U+7532,U+793E,U+81EA,U+8272,U+82B1,U+897F,U+8ECA,U+91CE,U+AC38,U+AD76,U+AE84,U+AECC,U+B07D,U+B0B1,U+B215,U+B2A0,U+B310,U+B3D7,U+B52A,U+B618,U+B775,U+B797,U+BCD5,U+BD59,U+BE80,U+BEA8,U+BED1,U+BEE4-BEE5,U+C060,U+C2EF,U+C329,U+C3DC,U+C597,U+C5BD,U+C5E5,U+C69C,U+C9D6,U+CA29,U+CA5C,U+CA84,U+CC39,U+CC3B,U+CE89,U+CEE5,U+CF65,U+CF85,U+D058,U+D145,U+D22D,U+D325,U+D37D,U+D3AD,U+D769,U+FF0C}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.104.woff2)format("woff2");unicode-range:U+2161,U+2228,U+2299,U+2464,U+2517,U+2640,U+3042,U+304A,U+3053,U+3061,U+307F,U+3082,U+308C,U+3092,U+30A8,U+30AB,U+30AD,U+30B0,U+30B3,U+30B7,U+30C1,U+30C6,U+30C9,U+30D5,U+30D7,U+30DE,U+30E0-30E1,U+30EC-30ED,U+4E0B,U+4E0D,U+4EE3,U+53F0,U+548C,U+5B89,U+5BB6,U+5C0F,U+611B,U+6771,U+6AA2,U+6BCD,U+6C34,U+6CD5,U+6D77,U+767D,U+795E,U+8ECD,U+9999,U+9AD8,U+AC07,U+AC1A,U+AC40,U+AD0C,U+AD88,U+ADA4,U+AE01,U+AE65,U+AEBD,U+AEC4,U+AFE8,U+B139,U+B205,U+B383,U+B38C,U+B42C,U+B461,U+B55C,U+B78F,U+B8FB,U+B9F7,U+BAFC,U+BC99,U+BED8,U+BFCD,U+C0BF,U+C0F9,U+C167,U+C204,U+C20F,U+C22F,U+C258,U+C298,U+C2BC,U+C388,U+C501,U+C50C,U+C5B9,U+C5CE,U+C641,U+C648,U+C73D,U+CA50,U+CA61,U+CC4C,U+CEAC,U+D0D4,U+D5F7,U+D6D7,U+FF1A}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.105.woff2)format("woff2");unicode-range:U+2103,U+2463,U+25C6,U+25CB,U+266C,U+3001,U+300A,U+3046,U+304C-304D,U+304F,U+3055,U+3059,U+3063,U+3066-3068,U+306F,U+3089,U+30B8,U+30BF,U+314F,U+4E0A,U+570B,U+5730,U+5916,U+5929,U+5C71,U+5E74,U+5FC3,U+601D,U+6027,U+63D0,U+6709,U+6734,U+751F,U+7684,U+82F1,U+9053,U+91D1,U+97F3,U+AC2F,U+AC4D,U+ADC4,U+ADE4,U+AE41,U+AE4D-AE4E,U+AED1,U+AFB9,U+B0E0,U+B299,U+B365,U+B46C,U+B480,U+B4C8,U+B7B4,U+B819,U+B918,U+BAAB,U+BAB9,U+BE8F,U+BED7,U+C0EC,U+C19F,U+C1A5,U+C3D9,U+C464,U+C53D,U+C553,U+C570,U+C5CC,U+C633,U+C6A4,U+C7A3,U+C7A6,U+C886,U+C9D9-C9DA,U+C9EC,U+CA0C,U+CC21,U+CD1B,U+CD78,U+CDC4,U+CEF8,U+CFE4,U+D0A5,U+D0B5,U+D0EC,U+D15D,U+D188,U+D23C,U+D2AC,U+D729,U+D79B,U+FF01,U+FF08-FF09,U+FF5C}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.106.woff2)format("woff2");unicode-range:U+2039-203A,U+223C,U+25B3,U+25B7,U+25BD,U+25CF,U+266A,U+3002,U+300B,U+304B,U+3057,U+305F,U+306A-306B,U+307E,U+308A-308B,U+3093,U+30A2,U+30AF,U+30B9,U+30C3,U+30C8,U+30E9-30EB,U+33A1,U+4E00,U+524D,U+5357,U+5B50,U+7121,U+884C,U+9751,U+AC94,U+AEBE,U+AECD,U+AF08,U+AF41,U+AF49,U+B010,U+B053,U+B109,U+B11B,U+B128,U+B154,U+B291,U+B2E6,U+B301,U+B385,U+B525,U+B5B4,U+B729,U+B72F,U+B738,U+B7FF,U+B837,U+B975,U+BA67,U+BB47,U+BC1F,U+BD90,U+BFD4,U+C27C,U+C324,U+C379,U+C3E0,U+C465,U+C53B,U+C58C,U+C610,U+C653,U+C6CD,U+C813,U+C82F,U+C999,U+C9E0,U+CAC4,U+CAD3,U+CBD4,U+CC10,U+CC22,U+CCB8,U+CCBC,U+CDA5,U+CE84,U+CEA3,U+CF67,U+CFE1,U+D241,U+D30D,U+D31C,U+D391,U+D401,U+D479,U+D5C9,U+D5DB,U+D649,U+D6D4}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.107.woff2)format("woff2");unicode-range:U+B0,U+E9,U+2193,U+2462,U+260E,U+261E,U+300E-300F,U+3044,U+30A4,U+30FB-30FC,U+314D,U+5973,U+6545,U+6708,U+7537,U+AC89,U+AC9C,U+ACC1,U+AD04,U+AD75,U+AD7D,U+AE45,U+AE61,U+AF42,U+B0AB,U+B0AF,U+B0B3,U+B12C,U+B194,U+B1A8,U+B220,U+B258,U+B284,U+B2FF,U+B315,U+B371,U+B3D4-B3D5,U+B460,U+B527,U+B534,U+B810,U+B818,U+B98E,U+BA55,U+BBAC,U+BC0B,U+BC40,U+BCA1,U+BCCD,U+BD93,U+BE54,U+BE5A,U+BF08,U+BF50,U+BF55,U+BFDC,U+C0C0,U+C0D0,U+C0F4,U+C100,U+C11E,U+C170,U+C20D,U+C274,U+C290,U+C308,U+C369,U+C539,U+C587,U+C5FF,U+C6EC,U+C70C,U+C7AD,U+C7C8,U+C83C,U+C881,U+CB48,U+CC60,U+CE69,U+CE6B,U+CE75,U+CF04,U+CF08,U+CF55,U+CF70,U+CFFC,U+D0B7,U+D1A8,U+D2C8,U+D384,U+D47C,U+D48B,U+D5DD,U+D5E8,U+D720,U+D759,U+F981}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.108.woff2)format("woff2");unicode-range:U+E0,U+E2,U+395,U+3B7,U+3BA,U+2460-2461,U+25A0,U+3010-3011,U+306E,U+30F3,U+314A,U+314C,U+5927,U+65B0,U+7E41,U+97D3,U+9AD4,U+AD49,U+AE0B,U+AE0D,U+AE43,U+AE5D,U+AECF,U+AF3C,U+AF64,U+AFD4,U+B080,U+B084,U+B0C5,U+B10C,U+B1E8,U+B2AC,U+B36E,U+B451,U+B515,U+B540,U+B561,U+B6AB,U+B6B1,U+B72C,U+B730,U+B744,U+B800,U+B8EC,U+B8F0,U+B904,U+B968,U+B96D,U+B987,U+B9D9,U+BB36,U+BB49,U+BC2D,U+BC43,U+BCF6,U+BD89,U+BE57,U+BE61,U+BED4,U+C090,U+C130,U+C148,U+C19C,U+C2F9,U+C36C,U+C37C,U+C384,U+C3DF,U+C575,U+C584,U+C660,U+C719,U+C816,U+CA4D,U+CA54,U+CABC,U+CB49,U+CC14,U+CFF5,U+D004,U+D038,U+D0B4,U+D0D3,U+D0E0,U+D0ED,U+D131,U+D1B0,U+D31F,U+D33D,U+D3A0,U+D3AB,U+D514,U+D584,U+D6A1,U+D6CC,U+D749,U+D760,U+D799}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.109.woff2)format("woff2");unicode-range:U+24,U+60,U+3B9,U+3BB,U+3BD,U+2191,U+2606,U+300C-300D,U+3131,U+3134,U+3139,U+3141-3142,U+3148,U+3161,U+3163,U+321C,U+4EBA,U+5317,U+AC31,U+AC77,U+AC9F,U+ACB9,U+ACF0-ACF1,U+ACFD,U+AD73,U+AF3D,U+B00C,U+B04A,U+B057,U+B0C4,U+B188,U+B1CC,U+B214,U+B2DB,U+B2EE,U+B304,U+B4ED,U+B518,U+B5BC,U+B625,U+B69C-B69D,U+B7AC,U+B801,U+B86C,U+B959,U+B95C,U+B985,U+BA48,U+BB58,U+BC0C,U+BC38,U+BC85,U+BC9A,U+BF40,U+C068,U+C0BD,U+C0CC,U+C12F,U+C149,U+C1E0,U+C22B,U+C22D,U+C250,U+C2FC,U+C300,U+C313,U+C370,U+C3D8,U+C557,U+C580,U+C5E3,U+C62E,U+C634,U+C6F0,U+C74D,U+C783,U+C78E,U+C796,U+C7BC,U+C92C,U+CA4C,U+CC1C,U+CC54,U+CC59,U+CE04,U+CF30,U+CFC4,U+D140,U+D321,U+D38C,U+D399,U+D54F,U+D587,U+D5D0,U+D6E8,U+D770}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.110.woff2)format("woff2");unicode-range:U+D7,U+EA,U+FC,U+2192,U+25BC,U+3000,U+3137,U+3145,U+315C,U+7F8E,U+AC13,U+AC71,U+AC90,U+ACB8,U+ACE7,U+AD7F,U+AE50,U+AEF4,U+AF34,U+AFBC,U+B048,U+B09A,U+B0AD,U+B0BC,U+B113,U+B125,U+B141,U+B20C,U+B2D9,U+B2ED,U+B367,U+B369,U+B374,U+B3CB,U+B4EC,U+B611,U+B760,U+B81B,U+B834,U+B8B0,U+B8E1,U+B989,U+B9D1,U+B9E1,U+B9FA,U+BA4D,U+BA78,U+BB35,U+BB54,U+BBF9,U+BC11,U+BCB3,U+BD05,U+BD95,U+BDD4,U+BE10,U+BED0,U+BF51,U+C0D8,U+C232,U+C2B7,U+C2EB,U+C378,U+C500,U+C52C,U+C549,U+C568,U+C598,U+C5C9,U+C61B,U+C639,U+C67C,U+C717,U+C78A,U+C80A,U+C90C-C90D,U+C950,U+C9E7,U+CBE4,U+CCA9,U+CCE4,U+CDB0,U+CE78,U+CE94,U+CE98,U+CF8C,U+D018,U+D034,U+D0F1,U+D1B1,U+D280,U+D2F8,U+D338,U+D380,U+D3B4,U+D610,U+D69F,U+D6FC,U+D758}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.111.woff2)format("woff2");unicode-range:U+E7,U+2022,U+203B,U+25C0,U+2605,U+2661,U+3147,U+318D,U+672C,U+8A9E,U+ACAA,U+ACBC,U+AD1C,U+AE4A,U+AE5C,U+B044,U+B054,U+B0C8-B0C9,U+B2A6,U+B2D0,U+B35C,U+B364,U+B428,U+B454,U+B465,U+B4B7,U+B4E3,U+B51C,U+B5A1,U+B784,U+B790,U+B7AB,U+B7F4,U+B82C,U+B835,U+B8E9,U+B8F8,U+B9D8,U+B9F9,U+BA5C,U+BA64,U+BABD,U+BB18,U+BB3B,U+BBFF,U+BC0D,U+BC45,U+BC97,U+BCBC,U+BE45,U+BE75,U+BE7C,U+BFCC,U+C0B6,U+C0F7,U+C14B,U+C2B4,U+C30D,U+C4F8,U+C5BB,U+C5D1,U+C5E0,U+C5EE,U+C5FD,U+C606,U+C6C5,U+C6E0,U+C708,U+C81D,U+C820,U+C824,U+C878,U+C918,U+C96C,U+C9E4,U+C9F1,U+CC2E,U+CD09,U+CEA1,U+CEF5,U+CEF7,U+CF64,U+CF69,U+CFE8,U+D035,U+D0AC,U+D230,U+D234,U+D2F4,U+D31D,U+D575,U+D578,U+D608,U+D614,U+D718,U+D751,U+D761,U+D78C,U+D790}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.112.woff2)format("woff2");unicode-range:U+2665,U+3160,U+4E2D,U+6587,U+65E5,U+AC12,U+AC14,U+AC16,U+AC81,U+AD34,U+ADE0,U+AE54,U+AEBC,U+AF2C,U+AFC0,U+AFC8,U+B04C,U+B08C,U+B099,U+B0A9,U+B0AC,U+B0AE,U+B0B8,U+B123,U+B179,U+B2E5,U+B2F7,U+B4C0,U+B531,U+B538,U+B545,U+B550,U+B5A8,U+B6F0,U+B728,U+B73B,U+B7AD,U+B7ED,U+B809,U+B864,U+B86D,U+B871,U+B9BF,U+B9F5,U+BA40,U+BA4B,U+BA58,U+BA87,U+BAAC,U+BBC0,U+BC16,U+BC34,U+BD07,U+BD99,U+BE59,U+BFD0,U+C058,U+C0E4,U+C0F5,U+C12D,U+C139,U+C228,U+C529,U+C5C7,U+C635,U+C637,U+C735,U+C77D,U+C787,U+C789,U+C8C4,U+C989,U+C98C,U+C9D0,U+C9D3,U+CC0C,U+CC99,U+CD0C,U+CD2C,U+CD98,U+CDA4,U+CE59,U+CE60,U+CE6D,U+CEA0,U+D0D0-D0D1,U+D0D5,U+D14D,U+D1A4,U+D29C,U+D2F1,U+D301,U+D39C,U+D3BC,U+D4E8,U+D540,U+D5EC,U+D640,U+D750}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.113.woff2)format("woff2");unicode-range:U+5E,U+25B2,U+25B6,U+314E,U+AC24,U+ACE1,U+ACE4,U+AE68,U+AF2D,U+B0D0,U+B0E5,U+B150,U+B155,U+B193,U+B2C9,U+B2DD,U+B3C8,U+B3FC,U+B410,U+B458,U+B4DD,U+B5A0,U+B5A4,U+B5BB,U+B7B5,U+B838,U+B840,U+B86F,U+B8F9,U+B960,U+B9E5,U+BAB8,U+BB50,U+BC1D,U+BC24-BC25,U+BCA8,U+BCBD,U+BD04,U+BD10,U+BD24,U+BE48,U+BE5B,U+BE68,U+C05C,U+C12C,U+C140,U+C15C,U+C168,U+C194,U+C219,U+C27D,U+C2A8,U+C2F1,U+C2F8,U+C368,U+C554-C555,U+C559,U+C564,U+C5D8,U+C5FC,U+C625,U+C65C,U+C6B1,U+C728,U+C794,U+C84C,U+C88C,U+C8E0,U+C8FD,U+C998,U+C9DD,U+CC0D,U+CC30,U+CEEC,U+CF13,U+CF1C,U+CF5C,U+D050,U+D07C,U+D0A8,U+D134,U+D138,U+D154,U+D1F4,U+D2BC,U+D329,U+D32C,U+D3D0,U+D3F4,U+D3FC,U+D56B,U+D5CC,U+D600-D601,U+D639,U+D6C8,U+D754,U+D765}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.114.woff2)format("woff2");unicode-range:U+3C-3D,U+2026,U+24D2,U+314B,U+AC11,U+ACF3,U+AD74,U+AD81,U+ADF9,U+AE34,U+AF43,U+AFB8,U+B05D,U+B07C,U+B110,U+B118,U+B17C,U+B180,U+B18D,U+B192,U+B2CC,U+B355,U+B378,U+B4A4,U+B4EF,U+B78D,U+B799,U+B7A9,U+B7FD,U+B807,U+B80C,U+B839,U+B9B4,U+B9DB,U+BA3C,U+BAB0,U+BBA4,U+BC94,U+BE4C,U+C154,U+C1C4,U+C26C,U+C2AC,U+C2ED,U+C4F4,U+C55E,U+C561,U+C571,U+C5B5,U+C5C4,U+C654-C655,U+C695,U+C6E8,U+C6F9,U+C724,U+C751,U+C775,U+C7A0,U+C7C1,U+C874,U+C880,U+C9D5,U+C9F8,U+CABD,U+CC29,U+CC2C,U+CCA8,U+CCAB,U+CCD0,U+CE21,U+CE35,U+CE7C,U+CE90,U+CEE8,U+CEF4,U+CFE0,U+D070,U+D0B9,U+D0C1,U+D0C4,U+D0C8,U+D15C,U+D1A1,U+D2C0,U+D300,U+D314,U+D3ED,U+D478,U+D480,U+D48D,U+D508,U+D53D,U+D5E4,U+D611,U+D61C,U+D68D,U+D6A8,U+D798}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.115.woff2)format("woff2");unicode-range:U+23,U+25,U+5F,U+A9,U+AC08,U+AC78,U+ACA8,U+ACAC,U+ACE8,U+AD70,U+ADC0,U+ADDC,U+B137,U+B140,U+B208,U+B290,U+B2F5,U+B3C5,U+B3CC,U+B420,U+B429,U+B529,U+B530,U+B77D,U+B79C,U+B7A8,U+B7C9,U+B7F0,U+B7FC,U+B828,U+B860,U+B9AD,U+B9C1,U+B9C9,U+B9DD-B9DE,U+B9E8,U+BA38-BA39,U+BABB,U+BC00,U+BC8C,U+BCA0,U+BCA4,U+BCD1,U+BCFC,U+BD09,U+BDF0,U+BE60,U+C0AD,U+C0B4,U+C0BC,U+C190,U+C1FC,U+C220,U+C288,U+C2B9,U+C2F6,U+C528,U+C545,U+C558,U+C5BC,U+C5D4,U+C600,U+C644,U+C6C0,U+C6C3,U+C721,U+C798,U+C7A1,U+C811,U+C838,U+C871,U+C904,U+C990,U+C9DC,U+CC38,U+CC44,U+CCA0,U+CD1D,U+CD95,U+CDA9,U+CE5C,U+CF00,U+CF58,U+D150,U+D22C,U+D305,U+D328,U+D37C,U+D3F0,U+D551,U+D5A5,U+D5C8,U+D5D8,U+D63C,U+D64D,U+D669,U+D734,U+D76C}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.116.woff2)format("woff2");unicode-range:U+26,U+2B,U+3E,U+40,U+7E,U+AC01,U+AC19,U+AC1D,U+ACA0,U+ACA9,U+ACB0,U+AD8C,U+AE09,U+AE38,U+AE40,U+AED8,U+B09C,U+B0A0,U+B108,U+B204,U+B298,U+B2D8,U+B2EB-B2EC,U+B2F4,U+B313,U+B358,U+B450,U+B4E0,U+B54C,U+B610,U+B780,U+B78C,U+B791,U+B8E8,U+B958,U+B974,U+B984,U+B9B0,U+B9BC-B9BD,U+B9CE,U+BA70,U+BBFC,U+BC0F,U+BC15,U+BC1B,U+BC31,U+BC95,U+BCC0,U+BCC4,U+BD81,U+BD88,U+C0C8,U+C11D,U+C13C,U+C158,U+C18D,U+C1A1,U+C21C,U+C4F0,U+C54A,U+C560,U+C5B8,U+C5C8,U+C5F4,U+C628,U+C62C,U+C678,U+C6CC,U+C808,U+C810,U+C885,U+C88B,U+C900,U+C988,U+C99D,U+C9C8,U+CC3D-CC3E,U+CC45,U+CD08,U+CE20,U+CEE4,U+D074,U+D0A4,U+D0DD,U+D2B9,U+D3B8,U+D3C9,U+D488,U+D544,U+D559,U+D56D,U+D588,U+D615,U+D648,U+D655,U+D658,U+D65C}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.117.woff2)format("woff2");unicode-range:U+D,U+48,U+7C,U+AC10,U+AC15,U+AC74,U+AC80,U+AC83,U+ACC4,U+AD11,U+AD50,U+AD6D,U+ADFC,U+AE00,U+AE08,U+AE4C,U+B0A8,U+B124,U+B144,U+B178,U+B274,U+B2A5,U+B2E8,U+B2F9,U+B354,U+B370,U+B418,U+B41C,U+B4F1,U+B514,U+B798,U+B808,U+B824-B825,U+B8CC,U+B978,U+B9D0,U+B9E4,U+BAA9,U+BB3C,U+BC18,U+BC1C,U+BC30,U+BC84,U+BCF5,U+BCF8,U+BD84,U+BE0C,U+BE14,U+C0B0,U+C0C9,U+C0DD,U+C124,U+C2DD,U+C2E4,U+C2EC,U+C54C,U+C57C-C57D,U+C591,U+C5C5-C5C6,U+C5ED,U+C608,U+C640,U+C6B8,U+C6D4,U+C784,U+C7AC,U+C800-C801,U+C9C1,U+C9D1,U+CC28,U+CC98,U+CC9C,U+CCAD,U+CD5C,U+CD94,U+CD9C,U+CDE8,U+CE68,U+CF54,U+D0DC,U+D14C,U+D1A0,U+D1B5,U+D2F0,U+D30C,U+D310,U+D398,U+D45C,U+D50C,U+D53C,U+D560,U+D568,U+D589,U+D604,U+D6C4,U+D788}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.118.woff2)format("woff2");unicode-range:U+39,U+49,U+4D-4E,U+A0,U+AC04,U+AC1C,U+AC70,U+AC8C,U+ACBD,U+ACF5,U+ACFC,U+AD00,U+AD6C,U+ADF8,U+B098,U+B0B4,U+B294,U+B2C8,U+B300,U+B3C4,U+B3D9,U+B4DC,U+B4E4,U+B77C,U+B7EC,U+B85D,U+B97C,U+B9C8,U+B9CC,U+BA54,U+BA74,U+BA85,U+BAA8,U+BB34,U+BB38,U+BBF8,U+BC14,U+BC29,U+BC88,U+BCF4,U+BD80,U+BE44,U+C0C1,U+C11C,U+C120,U+C131,U+C138,U+C18C,U+C218,U+C2B5,U+C2E0,U+C544,U+C548,U+C5B4,U+C5D0,U+C5EC,U+C5F0,U+C601,U+C624,U+C694,U+C6A9,U+C6B0,U+C6B4,U+C6D0,U+C704,U+C720,U+C73C,U+C740,U+C744,U+C74C,U+C758,U+C77C,U+C785,U+C788,U+C790-C791,U+C7A5,U+C804,U+C815,U+C81C,U+C870,U+C8FC,U+C911,U+C9C4,U+CCB4,U+CE58,U+CE74,U+D06C,U+D0C0,U+D130,U+D2B8,U+D3EC,U+D504,U+D55C,U+D569,U+D574,U+D638,U+D654,U+D68C}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.119.woff2)format("woff2");unicode-range:U+20-22,U+27-2A,U+2C-38,U+3A-3B,U+3F,U+41-47,U+4A-4C,U+4F-5D,U+61-7B,U+7D,U+A1,U+AB,U+AE,U+B7,U+BB,U+BF,U+2013-2014,U+201C-201D,U+2122,U+AC00,U+ACE0,U+AE30,U+B2E4,U+B85C,U+B9AC,U+C0AC,U+C2A4,U+C2DC,U+C774,U+C778,U+C9C0,U+D558}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshZAmK9RMckqI.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZurR_iJGursUpyo0Q.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZuiR_iJGursUpyo0Q.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZuqR_iJGursUpyo0Q.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZulR_iJGursUpyo0Q.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZvuR_iJGursUpyo0Q.woff2)format("woff2");unicode-range:U+200C-200D,U+2010,U+25CC,U+A900-A92F}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZupR_iJGursUpyo0Q.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZuoR_iJGursUpyo0Q.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZumR_iJGursUpw.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.0.woff2)format("woff2");unicode-range:U+25EE8,U+25F23,U+25F5C,U+25FD4,U+25FE0,U+25FFB,U+2600C,U+26017,U+26060,U+260ED,U+26222,U+2626A,U+26270,U+26286,U+2634C,U+26402,U+2667E,U+266B0,U+2671D,U+268DD,U+268EA,U+26951,U+2696F,U+26999,U+269DD,U+26A1E,U+26A58,U+26A8C,U+26AB7,U+26AFF,U+26C29,U+26C73,U+26C9E,U+26CDD,U+26E40,U+26E65,U+26F94,U+26FF6-26FF8,U+270F4,U+2710D,U+27139,U+273DA-273DB,U+273FE,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770E,U+27723,U+27752,U+278B2,U+27985,U+279B4,U+27A84,U+27BB3,U+27BBE,U+27BC7,U+27C3C,U+27CB8,U+27D73,U+27DA0,U+27E10,U+27EAF,U+27FB7,U+2808A,U+280BB,U+28277,U+28282,U+282F3,U+283CD,U+2840C,U+28455,U+284DC,U+2856B,U+285C8-285C9,U+286D7,U+286FA,U+28946,U+28949,U+2896B,U+28987-28988,U+289BA-289BB,U+28A1E,U+28A29,U+28A43,U+28A71,U+28A99,U+28ACD,U+28ADD,U+28AE4,U+28BC1,U+28BEF,U+28CDD,U+28D10,U+28D71,U+28DFB,U+28E0F,U+28E17,U+28E1F,U+28E36,U+28E89,U+28EEB,U+28EF6,U+28F32,U+28FF8,U+292A0,U+292B1,U+29490,U+295CF,U+2967F,U+296F0,U+29719,U+29750,U+29810,U+298C6,U+29A72,U+29D4B,U+29DDB,U+29E15,U+29E3D,U+29E49,U+29E8A,U+29EC4,U+29EDB,U+29EE9,U+29FCE,U+29FD7,U+2A01A,U+2A02F,U+2A082,U+2A0F9,U+2A190,U+2A2B2,U+2A38C,U+2A437,U+2A5F1,U+2A602,U+2A61A,U+2A6B2,U+2A9E6,U+2B746,U+2B751,U+2B753,U+2B75A,U+2B75C,U+2B765,U+2B776-2B777,U+2B77C,U+2B782,U+2B789,U+2B78B,U+2B78E,U+2B794,U+2B7AC,U+2B7AF,U+2B7BD,U+2B7C9,U+2B7CF,U+2B7D2,U+2B7D8,U+2B7F0,U+2B80D,U+2B817,U+2B81A,U+2D544,U+2E278,U+2E569,U+2E6EA,U+2F804,U+2F80F,U+2F815,U+2F818,U+2F81A,U+2F822,U+2F828,U+2F82C,U+2F833,U+2F83F,U+2F846,U+2F852,U+2F862,U+2F86D,U+2F873,U+2F877,U+2F884,U+2F899-2F89A,U+2F8A6,U+2F8AC,U+2F8B2,U+2F8B6,U+2F8D3,U+2F8DB-2F8DC,U+2F8E1,U+2F8E5,U+2F8EA,U+2F8ED,U+2F8FC,U+2F903,U+2F90B,U+2F90F,U+2F91A,U+2F920-2F921,U+2F945,U+2F947,U+2F96C,U+2F995,U+2F9D0,U+2F9DE-2F9DF,U+2F9F4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.1.woff2)format("woff2");unicode-range:U+1F235-1F23B,U+1F240-1F248,U+1F250-1F251,U+2000B,U+20089-2008A,U+200A2,U+200A4,U+200B0,U+200F5,U+20158,U+201A2,U+20213,U+2032B,U+20371,U+20381,U+203F9,U+2044A,U+20509,U+2053F,U+205B1,U+205D6,U+20611,U+20628,U+206EC,U+2074F,U+207C8,U+20807,U+2083A,U+208B9,U+2090E,U+2097C,U+20984,U+2099D,U+20A64,U+20AD3,U+20B1D,U+20B9F,U+20BB7,U+20D45,U+20D58,U+20DE1,U+20E64,U+20E6D,U+20E95,U+20F5F,U+21201,U+2123D,U+21255,U+21274,U+2127B,U+212D7,U+212E4,U+212FD,U+2131B,U+21336,U+21344,U+213C4,U+2146D-2146E,U+215D7,U+21647,U+216B4,U+21706,U+21742,U+218BD,U+219C3,U+21A1A,U+21C56,U+21D2D,U+21D45,U+21D62,U+21D78,U+21D92,U+21D9C,U+21DA1,U+21DB7,U+21DE0,U+21E33-21E34,U+21F1E,U+21F76,U+21FFA,U+2217B,U+22218,U+2231E,U+223AD,U+22609,U+226F3,U+2285B,U+228AB,U+2298F,U+22AB8,U+22B46,U+22B4F-22B50,U+22BA6,U+22C1D,U+22C24,U+22DE1,U+22E42,U+22FEB,U+231B6,U+231C3-231C4,U+231F5,U+23372,U+233CC,U+233D0,U+233D2-233D3,U+233D5,U+233DA,U+233DF,U+233E4,U+233FE,U+2344A-2344B,U+23451,U+23465,U+234E4,U+2355A,U+23594,U+235C4,U+23638-2363A,U+23647,U+2370C,U+2371C,U+2373F,U+23763-23764,U+237E7,U+237F1,U+237FF,U+23824,U+2383D,U+23A98,U+23C7F,U+23CBE,U+23CFE,U+23D00,U+23D0E,U+23D40,U+23DD3,U+23DF9-23DFA,U+23F7E,U+2404B,U+24096,U+24103,U+241C6,U+241FE,U+242EE,U+243BC,U+243D0,U+24629,U+246A5,U+247F1,U+24896,U+248E9,U+24A4D,U+24B56,U+24B6F,U+24C16,U+24D14,U+24E04,U+24E0E,U+24E37,U+24E6A,U+24E8B,U+24FF2,U+2504A,U+25055,U+25122,U+251A9,U+251CD,U+251E5,U+2521E,U+2524C,U+2542E,U+2548E,U+254D9,U+2550E,U+255A7,U+2567F,U+25771,U+257A9,U+257B4,U+25874,U+259C4,U+259CC,U+259D4,U+25AD7,U+25AE3-25AE4,U+25AF1,U+25BB2,U+25C4B,U+25C64,U+25DA1,U+25E2E,U+25E56,U+25E62,U+25E65,U+25EC2,U+25ED8}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.2.woff2)format("woff2");unicode-range:U+FFD7,U+FFDA-FFDC,U+FFE0-FFE2,U+FFE4,U+FFE6,U+FFE8-FFEE,U+1F100-1F10C,U+1F110-1F16C,U+1F170-1F1AC,U+1F200-1F202,U+1F210-1F234}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.3.woff2)format("woff2");unicode-range:U+FA10,U+FA12-FA6D,U+FB00-FB04,U+FE10-FE19,U+FE30-FE42,U+FE44-FE52,U+FE54-FE66,U+FE68-FE6B,U+FF02,U+FF04,U+FF07,U+FF51,U+FF5B,U+FF5D,U+FF5F-FF60,U+FF66,U+FF69,U+FF87,U+FFA1-FFBE,U+FFC2-FFC7,U+FFCA-FFCF,U+FFD2-FFD6}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.4.woff2)format("woff2");unicode-range:U+F92D-F959,U+F95B-F9F2,U+F9F4-FA0B,U+FA0E-FA0F}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.5.woff2)format("woff2");unicode-range:U+9E8B-9E8C,U+9E8E-9E8F,U+9E91-9E92,U+9E95-9E96,U+9E98,U+9E9B,U+9E9D-9E9E,U+9EA4-9EA5,U+9EA8-9EAA,U+9EAC-9EB0,U+9EB3-9EB5,U+9EB8,U+9EBC-9EBF,U+9EC3,U+9EC6,U+9EC8,U+9ECB-9ECD,U+9ECF-9ED1,U+9ED4-9ED5,U+9ED8,U+9EDB-9EE0,U+9EE4-9EE5,U+9EE7-9EE8,U+9EEC-9EF2,U+9EF4-9EF9,U+9EFB-9EFF,U+9F02-9F03,U+9F07-9F09,U+9F0E-9F12,U+9F14-9F17,U+9F19-9F1B,U+9F1F-9F22,U+9F26,U+9F2A-9F2C,U+9F2F,U+9F31-9F32,U+9F34,U+9F37,U+9F39-9F3A,U+9F3C-9F3F,U+9F41,U+9F43-9F47,U+9F4A,U+9F4E-9F50,U+9F52-9F58,U+9F5A,U+9F5D-9F61,U+9F63,U+9F66-9F6A,U+9F6C-9F73,U+9F75-9F77,U+9F7A,U+9F7D,U+9F7F,U+9F8F-9F92,U+9F94-9F97,U+9F99,U+9F9C-9FA3,U+9FA5,U+9FB4,U+9FBC-9FC2,U+9FC4,U+9FC6,U+9FCC,U+F900-F92C}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.6.woff2)format("woff2");unicode-range:U+9C3E,U+9C41,U+9C43-9C4A,U+9C4E-9C50,U+9C52-9C54,U+9C56,U+9C58,U+9C5A-9C61,U+9C63,U+9C65,U+9C67-9C6B,U+9C6D-9C6E,U+9C70,U+9C72,U+9C75-9C78,U+9C7A-9C7C,U+9CE6-9CE7,U+9CEB-9CEC,U+9CF0,U+9CF2,U+9CF6-9CF7,U+9CF9,U+9D02-9D03,U+9D06-9D09,U+9D0B,U+9D0E,U+9D11-9D12,U+9D15,U+9D17-9D18,U+9D1B-9D1F,U+9D23,U+9D26,U+9D2A-9D2C,U+9D2F-9D30,U+9D32-9D34,U+9D3A,U+9D3C-9D3F,U+9D41-9D48,U+9D4A,U+9D50-9D54,U+9D59,U+9D5D-9D65,U+9D69-9D6C,U+9D6F-9D70,U+9D72-9D73,U+9D76-9D77,U+9D7A-9D7C,U+9D7E,U+9D83-9D84,U+9D86-9D87,U+9D89-9D8A,U+9D8D-9D8E,U+9D92-9D93,U+9D95-9D9A,U+9DA1,U+9DA4,U+9DA9-9DAC,U+9DAE,U+9DB1-9DB2,U+9DB5,U+9DB8-9DBD,U+9DBF-9DC4,U+9DC6-9DC7,U+9DC9-9DCA,U+9DCF,U+9DD3-9DD7,U+9DD9-9DDA,U+9DDE-9DE0,U+9DE3,U+9DE5-9DE7,U+9DE9,U+9DEB,U+9DED-9DF0,U+9DF3-9DF4,U+9DF8,U+9DFD-9DFE,U+9E02,U+9E07,U+9E0A,U+9E0D-9E0E,U+9E10-9E12,U+9E15-9E16,U+9E19-9E1F,U+9E75,U+9E79-9E7D,U+9E80-9E85,U+9E87-9E88}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.7.woff2)format("woff2");unicode-range:U+9AE5-9AE7,U+9AE9,U+9AEB-9AEC,U+9AEE-9AEF,U+9AF1-9AF5,U+9AF7,U+9AF9-9AFB,U+9AFD,U+9AFF-9B06,U+9B08-9B09,U+9B0B-9B0E,U+9B10,U+9B12,U+9B16,U+9B18-9B1D,U+9B1F-9B20,U+9B22-9B23,U+9B25-9B2F,U+9B32-9B35,U+9B37,U+9B39-9B3B,U+9B3D,U+9B43-9B44,U+9B48,U+9B4B-9B4F,U+9B51,U+9B55-9B58,U+9B5B,U+9B5E,U+9B61,U+9B63,U+9B65-9B66,U+9B68,U+9B6A-9B6F,U+9B72-9B79,U+9B7F-9B80,U+9B83-9B87,U+9B89-9B8B,U+9B8D,U+9B8F-9B94,U+9B96-9B97,U+9B9A,U+9B9D-9BA0,U+9BA6-9BA7,U+9BA9-9BAA,U+9BAC,U+9BB0-9BB2,U+9BB4,U+9BB7-9BB9,U+9BBB-9BBC,U+9BBE-9BC1,U+9BC6-9BC8,U+9BCA,U+9BCE-9BD2,U+9BD4,U+9BD7-9BD8,U+9BDD,U+9BDF,U+9BE1-9BE5,U+9BE7,U+9BEA-9BEB,U+9BEE-9BF3,U+9BF5,U+9BF7-9BFA,U+9BFD,U+9BFF-9C00,U+9C02,U+9C04,U+9C06,U+9C08-9C0D,U+9C0F-9C16,U+9C18-9C1E,U+9C21-9C2A,U+9C2D-9C32,U+9C35-9C37,U+9C39-9C3A,U+9C3D}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.8.woff2)format("woff2");unicode-range:U+98EB,U+98ED-98EE,U+98F0-98F1,U+98F3,U+98F6,U+9902,U+9907-9909,U+9911-9912,U+9914-9918,U+991A-9922,U+9924,U+9926-9927,U+992B-992C,U+992E,U+9931-9935,U+9939-993E,U+9940-9942,U+9945-9949,U+994B-994E,U+9950-9952,U+9954-9955,U+9958-9959,U+995B-995C,U+995E-9960,U+9963,U+9997-9998,U+999B,U+999D-999F,U+99A3,U+99A5-99A6,U+99A8,U+99AD-99AE,U+99B0-99B2,U+99B5,U+99B9-99BA,U+99BC-99BD,U+99BF,U+99C1,U+99C3,U+99C8-99C9,U+99D1,U+99D3-99D5,U+99D8-99DF,U+99E1-99E2,U+99E7,U+99EA-99EE,U+99F0-99F2,U+99F4-99F5,U+99F8-99F9,U+99FB-99FE,U+9A01-9A05,U+9A08,U+9A0A-9A0C,U+9A0F-9A11,U+9A16,U+9A1A,U+9A1E,U+9A20,U+9A22-9A24,U+9A27,U+9A2B,U+9A2D-9A2E,U+9A31,U+9A33,U+9A35-9A38,U+9A3E,U+9A40-9A45,U+9A47,U+9A4A-9A4E,U+9A51-9A52,U+9A54-9A58,U+9A5B,U+9A5D,U+9A5F,U+9A62,U+9A64-9A65,U+9A69-9A6C,U+9AAA,U+9AAC-9AB0,U+9AB2,U+9AB4-9AB7,U+9AB9,U+9ABB-9AC1,U+9AC3,U+9AC6,U+9AC8,U+9ACE-9AD3,U+9AD5-9AD7,U+9ADB-9ADC,U+9ADE-9AE0,U+9AE2-9AE4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.9.woff2)format("woff2");unicode-range:U+971D,U+9721-9724,U+9728,U+972A,U+9730-9731,U+9733,U+9736,U+9738-9739,U+973B,U+973D-973E,U+9741-9744,U+9746-974A,U+974D-974F,U+9751,U+9755,U+9757-9758,U+975A-975C,U+9760-9761,U+9763-9764,U+9766-9768,U+976A-976B,U+976E,U+9771,U+9773,U+9776-977D,U+977F-9781,U+9785-9786,U+9789,U+978B,U+978F-9790,U+9795-9797,U+9799-979A,U+979C,U+979E-97A0,U+97A2-97A3,U+97A6,U+97A8,U+97AB-97AC,U+97AE,U+97B1-97B6,U+97B8-97BA,U+97BC,U+97BE-97BF,U+97C1,U+97C3-97CE,U+97D0-97D1,U+97D4,U+97D7-97D9,U+97DB-97DE,U+97E0-97E1,U+97E4,U+97E6,U+97ED-97EF,U+97F1-97F2,U+97F4-97F8,U+97FA,U+9804,U+9807,U+980A,U+980C-980F,U+9814,U+9816-9817,U+9819-981A,U+981C,U+981E,U+9820-9821,U+9823-9826,U+982B,U+982E-9830,U+9832-9835,U+9837,U+9839,U+983D-983E,U+9844,U+9846-9847,U+984A-984B,U+984F,U+9851-9853,U+9856-9857,U+9859-985B,U+9862-9863,U+9865-9866,U+986A-986C,U+986F-9871,U+9873-9875,U+98AA-98AB,U+98AD-98AE,U+98B0-98B1,U+98B4,U+98B6-98B8,U+98BA-98BC,U+98BF,U+98C2-98C8,U+98CB-98CC,U+98CE,U+98DC,U+98DE,U+98E0-98E1,U+98E3,U+98E5-98E7,U+98E9-98EA}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.10.woff2)format("woff2");unicode-range:U+944A,U+944C,U+9452-9453,U+9455,U+9459-945C,U+945E-9463,U+9468,U+946A-946B,U+946D-9472,U+9475,U+9477,U+947C-947F,U+9481,U+9483-9485,U+9578-9579,U+957E-957F,U+9582,U+9584,U+9586-9588,U+958A,U+958C-958F,U+9592,U+9594,U+9596,U+9598-9599,U+959D-95A1,U+95A4,U+95A6-95A9,U+95AB-95AD,U+95B1,U+95B4,U+95B6,U+95B9-95BF,U+95C3,U+95C6,U+95C8-95CD,U+95D0-95D6,U+95D9-95DA,U+95DC-95E2,U+95E4-95E6,U+95E8,U+961D-961E,U+9621-9622,U+9624-9626,U+9628,U+962C,U+962E-962F,U+9631,U+9633-9634,U+9637-963A,U+963C-963D,U+9641-9642,U+964B-964C,U+964F,U+9652,U+9654,U+9656-9658,U+965C-965F,U+9661,U+9666,U+966A,U+966C,U+966E,U+9672,U+9674,U+9677,U+967B-967C,U+967E-967F,U+9681-9684,U+9689,U+968B,U+968D,U+9691,U+9695-9698,U+969A,U+969D,U+969F,U+96A4-96AA,U+96AE-96B4,U+96B6,U+96B8-96BB,U+96BD,U+96C1,U+96C9-96CB,U+96CD-96CE,U+96D2,U+96D5-96D6,U+96D8-96DA,U+96DC-96DF,U+96E9,U+96EF,U+96F1,U+96F9-96FA,U+9702-9706,U+9708-9709,U+970D-970F,U+9711,U+9713-9714,U+9716,U+9719-971B}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.11.woff2)format("woff2");unicode-range:U+92BC-92BD,U+92BF-92C3,U+92C5-92C8,U+92CB-92D0,U+92D2-92D3,U+92D5,U+92D7-92D9,U+92DC-92DD,U+92DF-92E1,U+92E3-92E5,U+92E7-92EA,U+92EC,U+92EE,U+92F0,U+92F2,U+92F7-92FB,U+92FF-9300,U+9302,U+9304,U+9308,U+930D,U+930F-9311,U+9314-9315,U+9318-931A,U+931C-931F,U+9321-9325,U+9327-932B,U+932E,U+9333-9337,U+933A-933B,U+9344,U+9347-934A,U+934D,U+9350-9352,U+9354-9358,U+935A,U+935C,U+935E,U+9360,U+9364-9365,U+9367,U+9369-936D,U+936F-9371,U+9373-9374,U+9376,U+937A,U+937D-9382,U+9388,U+938A-938B,U+938D,U+938F,U+9392,U+9394-9395,U+9397-9398,U+939A-939B,U+939E,U+93A1,U+93A3-93A4,U+93A6,U+93A8-93A9,U+93AB-93AD,U+93B0,U+93B4-93B6,U+93B9-93BB,U+93C1,U+93C3-93CD,U+93D0-93D1,U+93D3,U+93D6-93D9,U+93DC-93DF,U+93E2,U+93E4-93E8,U+93F1,U+93F5,U+93F7-93FB,U+93FD,U+9401-9404,U+9407-9409,U+940D-9410,U+9413-9417,U+9419-941A,U+941F,U+9421,U+942B,U+942E-942F,U+9431-9434,U+9436,U+9438,U+943A-943B,U+943D,U+943F,U+9441,U+9443-9445,U+9448}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.12.woff2)format("woff2");unicode-range:U+9143,U+9146-914C,U+914F,U+9153,U+9156-915B,U+9161,U+9163-9165,U+9167,U+9169,U+916D,U+9172-9174,U+9179-917B,U+9181-9183,U+9185-9187,U+9189-918B,U+918E,U+9191,U+9193-9195,U+9197-9198,U+919E,U+91A1-91A2,U+91A6,U+91A8,U+91AA-91B6,U+91BA-91BD,U+91BF-91C6,U+91C9,U+91CB,U+91D0,U+91D3-91D4,U+91D6-91D7,U+91D9-91DB,U+91DE-91DF,U+91E1,U+91E4-91E6,U+91E9-91EA,U+91EC-91F1,U+91F5-91F7,U+91F9,U+91FB-91FD,U+91FF-9201,U+9204-9207,U+9209-920A,U+920C,U+920E,U+9210-9218,U+921C-921E,U+9223-9226,U+9228-9229,U+922C,U+922E-9230,U+9233,U+9235-923A,U+923C,U+923E-9240,U+9242-9243,U+9245-924B,U+924D-9251,U+9256-925A,U+925C-925E,U+9260-9261,U+9264-9269,U+926E-9270,U+9275-9279,U+927B-927F,U+9288-928A,U+928D-928E,U+9291-9293,U+9295-9297,U+9299,U+929B-929C,U+929F-92A0,U+92A4-92A5,U+92A7-92A8,U+92AB,U+92AF,U+92B2-92B3,U+92B6-92BB}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.13.woff2)format("woff2");unicode-range:U+8F52-8F55,U+8F57-8F58,U+8F5C-8F5E,U+8F61-8F66,U+8F9C-8F9D,U+8F9F-8FA2,U+8FA4-8FA8,U+8FAD-8FAF,U+8FB4-8FB8,U+8FBE,U+8FC0-8FC2,U+8FC6,U+8FC8,U+8FCA-8FCB,U+8FCD,U+8FD0,U+8FD2-8FD3,U+8FD5,U+8FDA,U+8FE0,U+8FE2-8FE5,U+8FE8-8FEA,U+8FED-8FEF,U+8FF1,U+8FF4-8FF6,U+8FF8-8FFB,U+8FFE,U+9002,U+9004-9005,U+9008,U+900B-900E,U+9011,U+9013,U+9015-9016,U+9018,U+901B,U+901E,U+9021,U+9027-902A,U+902C-902D,U+902F,U+9033-9037,U+9039,U+903C,U+903E-903F,U+9041,U+9043-9044,U+9049,U+904C,U+904F-9052,U+9056,U+9058,U+905B-905E,U+9062,U+9066-9068,U+906C,U+906F-9070,U+9072,U+9074,U+9076,U+9079,U+9080-9083,U+9085,U+9087-9088,U+908B-908C,U+908E-9090,U+9095,U+9097-9099,U+909B,U+90A0-90A2,U+90A5,U+90A8,U+90AF-90B6,U+90BD-90BE,U+90C3-90C5,U+90C7-90C9,U+90CC,U+90D2,U+90D5,U+90D7-90D9,U+90DB-90DF,U+90E2,U+90E4-90E5,U+90EB,U+90EF-90F0,U+90F2,U+90F4,U+90F6,U+90FE-9100,U+9102,U+9104-9106,U+9108,U+910D,U+9110,U+9112,U+9114-911A,U+911C,U+911E,U+9120,U+9122-9123,U+9125,U+9127,U+9129,U+912D-9132,U+9134,U+9136-9137,U+9139-913A,U+913C-913D}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.14.woff2)format("woff2");unicode-range:U+8DC0,U+8DC2,U+8DC5-8DC8,U+8DCA-8DCC,U+8DCE-8DCF,U+8DD1,U+8DD4-8DD7,U+8DD9-8DDB,U+8DDF,U+8DE3-8DE5,U+8DE7,U+8DEA-8DEC,U+8DF0-8DF2,U+8DF4,U+8DFC-8DFD,U+8DFF,U+8E01,U+8E04-8E06,U+8E08-8E09,U+8E0B-8E0C,U+8E10-8E11,U+8E14,U+8E16,U+8E1D-8E23,U+8E26-8E27,U+8E30-8E31,U+8E33-8E39,U+8E3D,U+8E40-8E42,U+8E44,U+8E47-8E50,U+8E54-8E55,U+8E59,U+8E5B-8E64,U+8E69,U+8E6C-8E6D,U+8E6F-8E72,U+8E75-8E77,U+8E79-8E7C,U+8E81-8E85,U+8E89,U+8E8B,U+8E90-8E95,U+8E98-8E9B,U+8E9D-8E9E,U+8EA1-8EA2,U+8EA7,U+8EA9-8EAA,U+8EAC-8EB1,U+8EB3,U+8EB5-8EB6,U+8EBA-8EBB,U+8EBE,U+8EC0-8EC1,U+8EC3-8EC8,U+8ECB,U+8ECF,U+8ED1,U+8ED4,U+8EDB-8EDC,U+8EE3,U+8EE8,U+8EEB,U+8EED-8EEE,U+8EF0-8EF1,U+8EF7,U+8EF9-8EFC,U+8EFE,U+8F00,U+8F02,U+8F05,U+8F07-8F08,U+8F0A,U+8F0F-8F10,U+8F12-8F13,U+8F15-8F19,U+8F1B-8F1C,U+8F1E-8F21,U+8F23,U+8F25-8F28,U+8F2B-8F2F,U+8F33-8F37,U+8F39-8F3B,U+8F3E,U+8F40-8F43,U+8F45-8F47,U+8F49-8F4A,U+8F4C-8F4F,U+8F51}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.15.woff2)format("woff2");unicode-range:U+8B2D,U+8B30,U+8B37,U+8B3C,U+8B3E,U+8B41-8B46,U+8B48-8B49,U+8B4C-8B4F,U+8B51-8B54,U+8B56,U+8B59,U+8B5B,U+8B5E-8B5F,U+8B63,U+8B69,U+8B6B-8B6D,U+8B6F,U+8B71,U+8B74,U+8B76,U+8B78-8B79,U+8B7C-8B81,U+8B84-8B85,U+8B8A-8B8F,U+8B92-8B96,U+8B99-8B9A,U+8B9C-8BA0,U+8C38-8C3A,U+8C3D-8C3F,U+8C41,U+8C45,U+8C47-8C49,U+8C4B-8C4C,U+8C4E-8C51,U+8C53-8C55,U+8C57-8C59,U+8C5B,U+8C5D,U+8C62-8C64,U+8C66,U+8C68-8C69,U+8C6B-8C6D,U+8C73,U+8C75-8C76,U+8C78,U+8C7A-8C7C,U+8C7E,U+8C82,U+8C85-8C87,U+8C89-8C8B,U+8C8D-8C8E,U+8C90,U+8C92-8C94,U+8C98-8C99,U+8C9B-8C9C,U+8C9F,U+8CA4,U+8CAD-8CAE,U+8CB2-8CB3,U+8CB6,U+8CB9-8CBA,U+8CBD,U+8CC1-8CC2,U+8CC4-8CC6,U+8CC8-8CC9,U+8CCB,U+8CCD-8CCF,U+8CD2,U+8CD5-8CD6,U+8CD9-8CDA,U+8CDD,U+8CE1,U+8CE3-8CE4,U+8CE6,U+8CE8,U+8CEC,U+8CEF-8CF2,U+8CF4-8CF5,U+8CF7-8CF8,U+8CFA-8CFB,U+8CFD-8CFF,U+8D01,U+8D03-8D04,U+8D07,U+8D09-8D0B,U+8D0D-8D10,U+8D12-8D14,U+8D16-8D17,U+8D1B-8D1D,U+8D65,U+8D67,U+8D69,U+8D6B-8D6E,U+8D71,U+8D73,U+8D76,U+8D7F,U+8D81-8D82,U+8D84,U+8D88,U+8D8D,U+8D90-8D91,U+8D95,U+8D99,U+8D9E-8DA0,U+8DA6,U+8DA8,U+8DAB-8DAC,U+8DAF,U+8DB2,U+8DB5,U+8DB7,U+8DB9-8DBC,U+8DBE}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.16.woff2)format("woff2");unicode-range:U+8973-8975,U+8977,U+897A-897E,U+8980,U+8983,U+8988-898A,U+898D,U+8990,U+8993-8995,U+8998,U+899B-899C,U+899F-89A1,U+89A5-89A6,U+89A9,U+89AC,U+89AF-89B0,U+89B2,U+89B4-89B7,U+89BA,U+89BC-89BD,U+89BF-89C1,U+89D4-89D8,U+89DA,U+89DC-89DD,U+89E5,U+89E7,U+89E9,U+89EB,U+89ED,U+89F1,U+89F3-89F4,U+89F6,U+89F8-89F9,U+89FD,U+89FF,U+8A01,U+8A04-8A05,U+8A07,U+8A0C,U+8A0F-8A12,U+8A14-8A16,U+8A1B,U+8A1D-8A1E,U+8A20-8A22,U+8A24-8A26,U+8A2B-8A2C,U+8A2F,U+8A35-8A37,U+8A3B,U+8A3D-8A3E,U+8A40-8A41,U+8A43,U+8A45-8A49,U+8A4D-8A4E,U+8A51-8A54,U+8A56-8A58,U+8A5B-8A5D,U+8A61-8A62,U+8A65,U+8A67,U+8A6C-8A6D,U+8A75-8A77,U+8A79-8A7C,U+8A7E-8A80,U+8A82-8A86,U+8A8B,U+8A8F-8A92,U+8A96-8A97,U+8A99-8A9A,U+8A9F,U+8AA1,U+8AA3,U+8AA5-8AAA,U+8AAE-8AAF,U+8AB3,U+8AB6-8AB7,U+8ABB-8ABC,U+8ABE,U+8AC2-8AC4,U+8AC6,U+8AC8-8ACA,U+8ACC-8ACD,U+8AD0-8AD1,U+8AD3-8AD5,U+8AD7,U+8ADA-8AE2,U+8AE4,U+8AE7,U+8AEB-8AEC,U+8AEE,U+8AF0-8AF1,U+8AF3-8AF7,U+8AFA,U+8AFC,U+8AFF,U+8B01-8B02,U+8B04-8B07,U+8B0A-8B0D,U+8B0F-8B11,U+8B14,U+8B16,U+8B1A,U+8B1C,U+8B1E-8B20,U+8B26,U+8B28,U+8B2B-8B2C}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.17.woff2)format("woff2");unicode-range:U+87E2-87E6,U+87EA-87ED,U+87EF,U+87F1,U+87F3,U+87F5-87F8,U+87FA-87FB,U+87FE-87FF,U+8801,U+8803,U+8805-8807,U+8809-880B,U+880D-8816,U+8818-881C,U+881E-881F,U+8821-8822,U+8827-8828,U+882D-882E,U+8830-8832,U+8835-8836,U+8839-883C,U+8841-8845,U+8848-884B,U+884D-884E,U+8851-8852,U+8855-8856,U+8858-885A,U+885C,U+885E-8860,U+8862,U+8864,U+8869,U+886B,U+886E-886F,U+8871-8872,U+8875,U+8877,U+8879,U+887B,U+887D-887E,U+8880-8882,U+8888,U+888D,U+8892,U+8897-889C,U+889E-88A0,U+88A2,U+88A4,U+88A8,U+88AA,U+88AE,U+88B0-88B1,U+88B5,U+88B7,U+88BA,U+88BC-88C0,U+88C3-88C4,U+88C6,U+88CA-88CE,U+88D1-88D4,U+88D8-88D9,U+88DB,U+88DD-88E1,U+88E7-88E8,U+88EF-88F2,U+88F4-88F5,U+88F7,U+88F9,U+88FC,U+8901-8902,U+8904,U+8906,U+890A,U+890C-890F,U+8913,U+8915-8916,U+8918-891A,U+891C-891E,U+8920,U+8925-8928,U+892A-892B,U+8930-8932,U+8935-893B,U+893E,U+8940-8946,U+8949,U+894C-894D,U+894F,U+8952,U+8956-8957,U+895A-895C,U+895E,U+8960-8964,U+8966,U+896A-896B,U+896D-8970}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.18.woff2)format("woff2");unicode-range:U+8655-8659,U+865B,U+865D-8664,U+8667,U+8669,U+866C,U+866F,U+8671,U+8675-8677,U+867A-867B,U+867D,U+8687-8689,U+868B-868D,U+8691,U+8693,U+8695-8696,U+8698,U+869A,U+869C-869D,U+86A1,U+86A3-86A4,U+86A6-86AB,U+86AD,U+86AF-86B1,U+86B3-86B9,U+86BF-86C1,U+86C3-86C6,U+86C9,U+86CB,U+86CE,U+86D1-86D2,U+86D4-86D5,U+86D7,U+86DA,U+86DC,U+86DE-86E0,U+86E3-86E7,U+86E9,U+86EC-86ED,U+86EF,U+86F8-86FE,U+8700,U+8703-870B,U+870D-8714,U+8719-871A,U+871E-871F,U+8721-8723,U+8725,U+8728-8729,U+872E-872F,U+8731-8732,U+8734,U+8737,U+8739-8740,U+8743,U+8745,U+8749,U+874B-874E,U+8751,U+8753,U+8755,U+8757-8759,U+875D,U+875F-8761,U+8763-8766,U+8768,U+876A,U+876E-876F,U+8771-8772,U+8774,U+8778,U+877B-877C,U+877F,U+8782-8789,U+878B-878C,U+878E,U+8790,U+8793,U+8795,U+8797-8799,U+879E-87A0,U+87A2-87A3,U+87A7,U+87AB-87AF,U+87B1,U+87B3,U+87B5,U+87BB,U+87BD-87C1,U+87C4,U+87C6-87CB,U+87CE,U+87D0,U+87D2,U+87D5-87D6,U+87D9-87DA,U+87DC,U+87DF-87E0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.19.woff2)format("woff2");unicode-range:U+84B4,U+84B9-84BB,U+84BD-84C2,U+84C6-84CA,U+84CC-84D1,U+84D3,U+84D6,U+84D9-84DA,U+84DC,U+84E7,U+84EA,U+84EC,U+84EF-84F2,U+84F4,U+84F7,U+84FA-84FD,U+84FF-8500,U+8502-8503,U+8506-8507,U+850C,U+850E,U+8510,U+8514-8515,U+8517-8518,U+851A-851C,U+851E-851F,U+8521-8525,U+8527,U+852A-852C,U+852F,U+8532-8534,U+8536,U+853E-8541,U+8543,U+8546,U+8548,U+854A-854B,U+854F-8553,U+8555-855A,U+855C-8564,U+8569-856B,U+856D,U+856F,U+8577,U+8579-857B,U+857D-8581,U+8585-8586,U+8588-858C,U+858F-8591,U+8593,U+8597-8598,U+859B-859D,U+859F-85A0,U+85A2,U+85A4-85A5,U+85A7-85A8,U+85AD-85B0,U+85B4,U+85B6-85BA,U+85BC-85BF,U+85C1-85C2,U+85C7,U+85C9-85CB,U+85CE-85D0,U+85D5,U+85D8-85DA,U+85DC,U+85DF-85E1,U+85E5-85E6,U+85E8,U+85ED,U+85F3-85F4,U+85F6-85F7,U+85F9-85FA,U+85FC,U+85FE-8600,U+8602,U+8604-8606,U+860A-860B,U+860D-860E,U+8610-8613,U+8616-861B,U+861E,U+8621-8622,U+8624,U+8627,U+8629,U+862F-8630,U+8636,U+8638-863A,U+863C-863D,U+863F-8642,U+8646,U+864D,U+8652-8654}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.20.woff2)format("woff2");unicode-range:U+82E8,U+82EA,U+82ED,U+82EF,U+82F3-82F4,U+82F6-82F7,U+82F9,U+82FB,U+82FD-82FE,U+8300-8301,U+8303,U+8306-8308,U+830A-830C,U+8316-8318,U+831B,U+831D-831F,U+8321-8323,U+832B-8335,U+8337,U+833A,U+833C-833D,U+8340,U+8342-8347,U+834A,U+834D-8351,U+8353-8357,U+835A,U+8362-8363,U+8370,U+8373,U+8375,U+8378,U+837C-837D,U+837F-8380,U+8382,U+8384-8387,U+838A,U+838D-838E,U+8392-8396,U+8398-83A0,U+83A2,U+83A6-83AD,U+83B1,U+83B5,U+83BD-83C1,U+83C7,U+83C9,U+83CE-83D1,U+83D4,U+83D6,U+83D8,U+83DD,U+83DF-83E1,U+83E5,U+83E8,U+83EA-83EB,U+83F0,U+83F2,U+83F4,U+83F6-83F9,U+83FB-83FD,U+8401,U+8403-8404,U+8406-8407,U+840A-840B,U+840D,U+840F,U+8411,U+8413,U+8415,U+8417,U+8419,U+8420,U+8422,U+842A,U+842F,U+8431,U+8435,U+8438-8439,U+843C,U+8445-8448,U+844A,U+844D-844F,U+8451-8452,U+8456,U+8458-845A,U+845C,U+845F-8462,U+8464-8467,U+8469-846B,U+846D-8470,U+8473-8474,U+8476-847A,U+847C-847D,U+8481-8482,U+8484-8485,U+848B,U+8490,U+8492-8493,U+8495,U+8497,U+849C,U+849E-849F,U+84A1,U+84A6,U+84A8-84AA,U+84AD,U+84AF,U+84B1}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.21.woff2)format("woff2");unicode-range:U+814A,U+814C,U+8151-8153,U+8157,U+815F-8161,U+8165-8169,U+816D-816F,U+8171,U+8173-8174,U+8177,U+8180-8186,U+8188,U+818A-818B,U+818E,U+8190,U+8193,U+8195-8196,U+8198,U+819B,U+819E,U+81A0,U+81A2,U+81A4,U+81A9,U+81AE,U+81B0,U+81B2,U+81B4-81B5,U+81B8,U+81BA-81BB,U+81BD-81BE,U+81C0-81C3,U+81C5-81C6,U+81C8-81CB,U+81CD-81CF,U+81D1,U+81D5-81DB,U+81DD-81E1,U+81E4-81E5,U+81E7,U+81EB-81EC,U+81EF-81F2,U+81F5-81F6,U+81F8-81FB,U+81FD-8205,U+8209-820B,U+820D,U+820F,U+8212-8214,U+8216,U+8219-821D,U+8221-8222,U+8228-8229,U+822B,U+822E,U+8232-8235,U+8237-8238,U+823A,U+823C,U+8240,U+8243-8246,U+8249,U+824B,U+824E-824F,U+8251,U+8256-825A,U+825C-825D,U+825F-8260,U+8262-8264,U+8267-8268,U+826A-826B,U+826D-826E,U+8271,U+8274,U+8277,U+8279,U+827B,U+827D-8281,U+8283-8284,U+8287,U+8289-828A,U+828D-828E,U+8291-8294,U+8296,U+8298-829B,U+829F-82A1,U+82A3-82A4,U+82A7-82AC,U+82AE,U+82B0,U+82B2,U+82B4,U+82B7,U+82BA-82BC,U+82BE-82BF,U+82C5-82C6,U+82D0,U+82D2-82D3,U+82D5,U+82D9-82DA,U+82DC,U+82DE-82E4,U+82E7}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.22.woff2)format("woff2");unicode-range:U+7F77-7F79,U+7F7D-7F80,U+7F82-7F83,U+7F86-7F88,U+7F8B-7F8D,U+7F8F-7F91,U+7F94,U+7F96-7F97,U+7F9A,U+7F9C-7F9D,U+7FA1-7FA3,U+7FA6,U+7FAA,U+7FAD-7FAF,U+7FB2,U+7FB4,U+7FB6,U+7FB8-7FB9,U+7FBC,U+7FBF-7FC0,U+7FC3,U+7FC5-7FC6,U+7FC8,U+7FCA,U+7FCE-7FCF,U+7FD5,U+7FDB,U+7FDF,U+7FE1,U+7FE3,U+7FE5-7FE6,U+7FE8-7FE9,U+7FEB-7FEC,U+7FEE-7FF0,U+7FF2-7FF3,U+7FF9-7FFA,U+7FFD-7FFF,U+8002,U+8004,U+8006-8008,U+800A-800F,U+8011-8014,U+8016,U+8018-8019,U+801C-8021,U+8024,U+8026,U+8028,U+802C,U+802E,U+8030,U+8034-8035,U+8037,U+8039-8040,U+8043-8044,U+8046,U+804A,U+8052,U+8058,U+805A,U+805F-8060,U+8062,U+8064,U+8066,U+8068,U+806D,U+806F-8073,U+8075-8076,U+8079,U+807B,U+807D-8081,U+8084-8088,U+808B,U+808E,U+8093,U+8099-809A,U+809C,U+809E,U+80A4,U+80A6-80A7,U+80AB-80AD,U+80B1,U+80B8-80B9,U+80C4-80C5,U+80C8,U+80CA,U+80CD,U+80CF,U+80D2,U+80D4-80DB,U+80DD,U+80E0,U+80E4-80E6,U+80ED-80F3,U+80F5-80F7,U+80F9-80FC,U+80FE,U+8101,U+8103,U+8109,U+810B,U+810D,U+8116-8118,U+811B-811C,U+811E,U+8120,U+8123-8124,U+8127,U+8129,U+812B-812C,U+812F-8130,U+8135,U+8139-813A,U+813C-813E,U+8141,U+8145-8147}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.23.woff2)format("woff2");unicode-range:U+7D57,U+7D59-7D5D,U+7D63,U+7D65,U+7D67,U+7D6A,U+7D6E,U+7D70,U+7D72-7D73,U+7D78,U+7D7A-7D7B,U+7D7D,U+7D7F,U+7D81-7D83,U+7D85-7D86,U+7D88-7D89,U+7D8B-7D8D,U+7D8F,U+7D91,U+7D93,U+7D96-7D97,U+7D9B-7DA0,U+7DA2-7DA3,U+7DA6-7DA7,U+7DAA-7DAC,U+7DAE-7DB0,U+7DB3,U+7DB5-7DB9,U+7DBD,U+7DC0,U+7DC2-7DC7,U+7DCC-7DCE,U+7DD0,U+7DD5-7DD9,U+7DDC-7DDE,U+7DE1-7DE6,U+7DEA-7DED,U+7DF1-7DF2,U+7DF5-7DF6,U+7DF9-7DFA,U+7E00,U+7E05,U+7E08-7E0B,U+7E10-7E12,U+7E15,U+7E17,U+7E1C-7E1D,U+7E1F-7E23,U+7E27-7E28,U+7E2C-7E2D,U+7E2F,U+7E31-7E33,U+7E35-7E37,U+7E39-7E3B,U+7E3D,U+7E3F,U+7E43-7E48,U+7E4E,U+7E50,U+7E52,U+7E56,U+7E58-7E5A,U+7E5D-7E5F,U+7E61-7E62,U+7E65-7E67,U+7E69-7E6B,U+7E6D-7E6F,U+7E73,U+7E75,U+7E78-7E79,U+7E7B-7E7F,U+7E81-7E83,U+7E86-7E8A,U+7E8C-7E8E,U+7E90-7E96,U+7E98,U+7E9A-7E9F,U+7F38,U+7F3A-7F3F,U+7F43-7F45,U+7F47,U+7F4C-7F50,U+7F52-7F55,U+7F58,U+7F5B-7F5D,U+7F5F,U+7F61,U+7F63-7F69,U+7F6B,U+7F6D,U+7F71}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.24.woff2)format("woff2");unicode-range:U+7BC8,U+7BCA-7BCC,U+7BCF,U+7BD4,U+7BD6-7BD7,U+7BD9-7BDB,U+7BDD,U+7BE5-7BE6,U+7BE8-7BEA,U+7BF0,U+7BF2-7BFA,U+7BFC,U+7BFE,U+7C00-7C04,U+7C06-7C07,U+7C09,U+7C0B-7C0F,U+7C11-7C14,U+7C17,U+7C19,U+7C1B,U+7C1E-7C20,U+7C23,U+7C25-7C28,U+7C2A-7C2C,U+7C2F,U+7C31,U+7C33-7C34,U+7C36-7C3A,U+7C3D-7C3E,U+7C40,U+7C42-7C43,U+7C45-7C46,U+7C4A,U+7C4C,U+7C4F-7C5F,U+7C61,U+7C63-7C65,U+7C67,U+7C69,U+7C6C-7C70,U+7C72,U+7C75,U+7C79,U+7C7B-7C7E,U+7C81-7C83,U+7C86-7C87,U+7C8D,U+7C8F-7C90,U+7C94,U+7C9E,U+7CA0-7CA2,U+7CA4-7CA6,U+7CA8,U+7CAB,U+7CAD-7CAE,U+7CB0-7CB3,U+7CB6-7CB7,U+7CB9-7CBD,U+7CBF-7CC0,U+7CC2,U+7CC4-7CC5,U+7CC7-7CCA,U+7CCD-7CCF,U+7CD2-7CD5,U+7CD7-7CDA,U+7CDC-7CDD,U+7CDF-7CE0,U+7CE2,U+7CE6,U+7CE9,U+7CEB,U+7CEF,U+7CF2,U+7CF4-7CF6,U+7CF9-7CFA,U+7CFE,U+7D02-7D03,U+7D06-7D0A,U+7D0F,U+7D11-7D13,U+7D15-7D16,U+7D1C-7D1E,U+7D23,U+7D26,U+7D2A,U+7D2C-7D2E,U+7D31-7D32,U+7D35,U+7D3C-7D41,U+7D43,U+7D45,U+7D47-7D48,U+7D4B,U+7D4D-7D4F,U+7D51,U+7D53,U+7D55-7D56}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.25.woff2)format("woff2");unicode-range:U+7A17-7A19,U+7A1B,U+7A1E-7A21,U+7A27,U+7A2B,U+7A2D,U+7A2F-7A31,U+7A34-7A35,U+7A37-7A3B,U+7A3E,U+7A43-7A49,U+7A4C,U+7A4E,U+7A50,U+7A55-7A57,U+7A59,U+7A5C-7A5D,U+7A5F-7A63,U+7A65,U+7A67,U+7A69-7A6A,U+7A6D,U+7A70,U+7A75,U+7A78-7A79,U+7A7D-7A7E,U+7A80,U+7A82,U+7A84-7A86,U+7A88,U+7A8A-7A8B,U+7A90-7A91,U+7A94-7A98,U+7A9E,U+7AA0,U+7AA3,U+7AA9,U+7AAC,U+7AB0,U+7AB3,U+7AB5-7AB6,U+7AB9-7ABF,U+7AC3,U+7AC5-7ACA,U+7ACC-7ACF,U+7AD1-7AD3,U+7AD5,U+7ADA-7ADB,U+7ADD,U+7ADF,U+7AE1-7AE2,U+7AE6-7AED,U+7AF0-7AF1,U+7AF4,U+7AF8,U+7AFA-7AFB,U+7AFD-7AFE,U+7B02,U+7B04,U+7B06-7B08,U+7B0A-7B0B,U+7B0F,U+7B12,U+7B14,U+7B18-7B19,U+7B1E-7B1F,U+7B23,U+7B25,U+7B27-7B2B,U+7B2D-7B31,U+7B33-7B36,U+7B3B,U+7B3D,U+7B3F-7B41,U+7B45,U+7B47,U+7B4C-7B50,U+7B53,U+7B55,U+7B5D,U+7B60,U+7B64-7B66,U+7B69-7B6A,U+7B6C-7B75,U+7B77,U+7B79-7B7A,U+7B7F,U+7B84,U+7B86,U+7B89,U+7B8D-7B92,U+7B96,U+7B98-7BA0,U+7BA5,U+7BAC-7BAD,U+7BAF-7BB0,U+7BB2,U+7BB4-7BB6,U+7BBA-7BBD,U+7BC1-7BC2,U+7BC5-7BC6}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.26.woff2)format("woff2");unicode-range:U+7851-7852,U+785C,U+785E,U+7860-7861,U+7863-7864,U+7868,U+786A,U+786E-786F,U+7872,U+7874,U+787A,U+787C,U+787E,U+7886-7887,U+788A,U+788C-788F,U+7893-7895,U+7898,U+789A,U+789D-789F,U+78A1,U+78A3-78A4,U+78A8-78AA,U+78AC-78AD,U+78AF-78B3,U+78B5,U+78BB-78BF,U+78C5-78CC,U+78CE,U+78D1-78D6,U+78DA-78DB,U+78DF-78E1,U+78E4,U+78E6-78E7,U+78EA,U+78EC,U+78F2-78F4,U+78F6-78F7,U+78F9-78FB,U+78FD-7901,U+7906-7907,U+790C,U+7910-7912,U+7919-791C,U+791E-7920,U+7925-792E,U+7930-7931,U+7934-7935,U+793B,U+793D,U+793F,U+7941-7942,U+7944-7946,U+794A-794B,U+794F,U+7951,U+7954-7955,U+7957-7958,U+795A-795C,U+795F-7960,U+7962,U+7967,U+7969,U+796B,U+7972,U+7977,U+7979-797C,U+797E-7980,U+798A-798E,U+7991,U+7993-7996,U+7998,U+799B-799D,U+79A1,U+79A6-79AB,U+79AE-79B1,U+79B3-79B4,U+79B8-79BB,U+79BD-79BE,U+79C2,U+79C4,U+79C7-79CA,U+79CC-79CD,U+79CF,U+79D4-79D6,U+79DA,U+79DD-79E3,U+79E5,U+79E7,U+79EA-79ED,U+79F1,U+79F8,U+79FC,U+7A02-7A03,U+7A05,U+7A07-7A0A,U+7A0C-7A0D,U+7A11,U+7A15}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.27.woff2)format("woff2");unicode-range:U+768C-768E,U+7690,U+7693,U+7695-7696,U+7699-76A8,U+76AA,U+76AD,U+76AF-76B0,U+76B4,U+76B6-76BA,U+76BD,U+76C1-76C3,U+76C5,U+76C8-76C9,U+76CB-76CE,U+76D2,U+76D4,U+76D6,U+76D9,U+76DC,U+76DE,U+76E0-76E1,U+76E5-76E8,U+76EA-76EC,U+76F0-76F1,U+76F6,U+76F9,U+76FB-76FC,U+7700,U+7704,U+7706-7708,U+770A,U+770E,U+7712,U+7714-7715,U+7717,U+7719-771C,U+7722,U+7724-7726,U+7728,U+772D-772F,U+7734-7739,U+773D-773E,U+7742,U+7745-7747,U+774A,U+774D-774F,U+7752,U+7756-7758,U+775A-775C,U+775E-7760,U+7762,U+7764-7765,U+7767,U+776A-776C,U+7770,U+7772-7774,U+7779-777A,U+777C-7780,U+7784,U+778B-778E,U+7794-7796,U+779A,U+779E-77A0,U+77A2,U+77A4-77A5,U+77A7,U+77A9-77AA,U+77AE-77B1,U+77B5-77B7,U+77B9,U+77BB-77BF,U+77C3,U+77C7,U+77C9,U+77CD,U+77D1-77D2,U+77D5,U+77D7,U+77D9-77DA,U+77DC,U+77DE-77E0,U+77E3-77E4,U+77E6-77E7,U+77E9-77EA,U+77EC,U+77EE,U+77F0-77F1,U+77F4,U+77F8,U+77FB-77FC,U+7805-7806,U+7809,U+780C-780E,U+7811-7812,U+7819,U+781D,U+7820-7823,U+7826-7827,U+782C-782E,U+7830,U+7835,U+7837,U+783A,U+783F,U+7843-7845,U+7847-7848,U+784C,U+784E-784F}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.28.woff2)format("woff2");unicode-range:U+7511-7513,U+7515-7517,U+751C,U+751E,U+7520-7522,U+7524,U+7526-7527,U+7529-752C,U+752F,U+7536,U+7538-7539,U+753C-7540,U+7543-7544,U+7546-754B,U+754D-7550,U+7552,U+7557,U+755A-755B,U+755D-755F,U+7561-7562,U+7564,U+7566-7567,U+7569,U+756B-756D,U+756F,U+7571-7572,U+7574-757E,U+7581-7582,U+7585-7587,U+7589-758C,U+758F-7590,U+7592-7595,U+7599-759A,U+759C-759D,U+75A2-75A5,U+75B0-75B1,U+75B3-75B5,U+75B7-75B8,U+75BA,U+75BD,U+75BF-75C4,U+75C6,U+75CA,U+75CC-75CF,U+75D3-75D4,U+75D7-75D8,U+75DC-75E1,U+75E3-75E4,U+75E7,U+75EC,U+75EE-75F3,U+75F9,U+75FC,U+75FE-7604,U+7607-760C,U+760F,U+7612-7613,U+7615-7616,U+7618-7619,U+761B-7629,U+762D,U+7630,U+7632-7635,U+7638-763C,U+7640-7641,U+7643-764B,U+764E,U+7655,U+7658-7659,U+765C,U+765F,U+7661-7662,U+7664-7665,U+7667-766A,U+766C-7672,U+7674,U+7676,U+7678,U+7680-7683,U+7685,U+7688,U+768B}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.29.woff2)format("woff2");unicode-range:U+736C,U+736E-7371,U+7375,U+7377-737C,U+7380-7381,U+7383,U+7385-7386,U+738A,U+738E,U+7390,U+7393-7398,U+739C,U+739E-73A0,U+73A2,U+73A5-73A6,U+73A8,U+73AA-73AB,U+73AD,U+73B3,U+73B5,U+73B7,U+73B9-73BD,U+73BF,U+73C5-73C6,U+73C9-73CC,U+73CE-73CF,U+73D2-73D3,U+73D6,U+73D9,U+73DD-73DE,U+73E1,U+73E3-73E7,U+73E9-73EA,U+73EE,U+73F1,U+73F4-73F5,U+73F7-73FB,U+73FD,U+73FF-7401,U+7404-7405,U+7407,U+740A,U+7411,U+7413,U+741A-741B,U+7421,U+7424,U+7426,U+7428-7431,U+7433,U+7439-743A,U+743F-7441,U+7443-7444,U+7446-7447,U+744B,U+744D,U+7451-7453,U+7455,U+7457,U+7459-745A,U+745C-745D,U+745F,U+7462-7464,U+7466-746B,U+746D-7473,U+7476,U+747E,U+7480-7481,U+7485-7489,U+748B,U+748F-7492,U+7497-749A,U+749C,U+749E-74A3,U+74A5-74A6,U+74A8-74AB,U+74AE-74AF,U+74B1-74B2,U+74B5,U+74B9-74BB,U+74BD,U+74BF,U+74C8-74CA,U+74CC,U+74CF-74D0,U+74D3-74D4,U+74D6,U+74D8,U+74DA-74DB,U+74DE-74E0,U+74E3-74E4,U+74E7-74EB,U+74EE-74F2,U+74F4,U+74F7-74F8,U+74FA-74FC,U+74FF,U+7501,U+7503-7506,U+750C-750E}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.30.woff2)format("woff2");unicode-range:U+7166,U+7168,U+716C,U+7179,U+7180,U+7184-7185,U+7187-7188,U+718C,U+718F,U+7192,U+7194-7196,U+7199-719B,U+71A0,U+71A2,U+71A8,U+71AC,U+71AE-71B0,U+71B2-71B3,U+71B9-71BA,U+71BE-71C1,U+71C4,U+71C9,U+71CB-71CC,U+71CE,U+71D0,U+71D2-71D4,U+71D6-71D7,U+71D9-71DA,U+71DC,U+71DF-71E0,U+71E6-71E7,U+71EC-71EE,U+71F4-71F5,U+71F8-71F9,U+71FC,U+71FE-7200,U+7207-7209,U+720D,U+7210,U+7213,U+7215,U+7217,U+721A,U+721D,U+721F,U+7224,U+7228,U+722B,U+722D,U+722F-7230,U+7232,U+7234,U+7238-7239,U+723B-723C,U+723E-7243,U+7245-7246,U+724B,U+724E-7250,U+7252-7253,U+7255-7258,U+725A,U+725C,U+725E,U+7260,U+7263,U+7268,U+726B,U+726E-726F,U+7271,U+7274,U+7277-7278,U+727B-727C,U+727E-7282,U+7284,U+7287,U+7289,U+728D-728E,U+7292-7293,U+7296,U+729B,U+72A2,U+72A7-72A8,U+72AD-72AE,U+72B0-72B2,U+72B4,U+72B9,U+72BE,U+72C0-72C1,U+72C3-72C4,U+72C6-72C7,U+72C9,U+72CC,U+72CE,U+72D2,U+72D5-72D6,U+72D8,U+72DF-72E2,U+72E5,U+72F3-72F4,U+72F7,U+72F9-72FB,U+72FD-72FE,U+7302,U+7304-7305,U+7307,U+730A-730B,U+730D,U+7312-7313,U+7316-7319,U+731C-731E,U+7322,U+7324,U+7327-7329,U+732C,U+732F,U+7331-7337,U+7339-733B,U+733D-733E,U+7343,U+734D-7350,U+7352,U+7356-7358,U+735D-7360,U+7366-736B}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.31.woff2)format("woff2");unicode-range:U+6F58-6F5B,U+6F5D-6F5E,U+6F60-6F62,U+6F66,U+6F68,U+6F6C-6F6D,U+6F6F,U+6F74,U+6F78,U+6F7A,U+6F7C-6F7E,U+6F80,U+6F82-6F83,U+6F86-6F88,U+6F8B-6F8E,U+6F90-6F94,U+6F96-6F98,U+6F9A,U+6F9D,U+6F9F-6FA1,U+6FA3,U+6FA5-6FA8,U+6FAE-6FB1,U+6FB3,U+6FB5-6FB7,U+6FB9,U+6FBC,U+6FBE,U+6FC2,U+6FC5-6FCA,U+6FD4-6FD5,U+6FD8,U+6FDA-6FDB,U+6FDE-6FE0,U+6FE4,U+6FE8-6FE9,U+6FEB-6FEC,U+6FEE,U+6FF0,U+6FF3,U+6FF5-6FF6,U+6FF9-6FFA,U+6FFC-6FFE,U+7000-7001,U+7005-7007,U+7009-700B,U+700D,U+700F,U+7011,U+7015,U+7017-7018,U+701A-701B,U+701D-7020,U+7023,U+7026,U+7028,U+702F-7030,U+7032,U+7034,U+7037,U+7039-703A,U+703C,U+703E,U+7043-7044,U+7047-704C,U+704E,U+7051,U+7054-7055,U+705D-705E,U+7064-7065,U+7069,U+706C,U+706E,U+7075-7076,U+707E,U+7081,U+7085-7086,U+7094-7098,U+709B,U+709F,U+70A4,U+70AB-70AC,U+70AE-70B1,U+70B3-70B4,U+70B7,U+70BB,U+70CA-70CB,U+70D1,U+70D3-70D6,U+70D8-70D9,U+70DC-70DD,U+70DF,U+70E4,U+70EC,U+70F1,U+70FA,U+70FD,U+7103-7108,U+710B-710C,U+710F,U+7114,U+7119,U+711C,U+711E,U+7120,U+712B,U+712D-7131,U+7138,U+7141,U+7145-7147,U+7149-714B,U+7150-7153,U+7155-7157,U+715A,U+715C,U+715E,U+7160,U+7162,U+7164-7165}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.32.woff2)format("woff2");unicode-range:U+6D7C,U+6D80-6D82,U+6D85,U+6D87,U+6D89-6D8A,U+6D8C-6D8E,U+6D91-6D98,U+6D9C,U+6DAA-6DAC,U+6DAE,U+6DB4-6DB5,U+6DB7-6DB9,U+6DBD,U+6DBF,U+6DC2,U+6DC4-6DC8,U+6DCA,U+6DCC,U+6DCE-6DD0,U+6DD2,U+6DD5-6DD6,U+6DD8-6DDB,U+6DDD-6DE0,U+6DE2,U+6DE4-6DE6,U+6DE8-6DEA,U+6DEC,U+6DEE-6DF0,U+6DF2,U+6DF4,U+6DF6,U+6DF8-6DFA,U+6DFC,U+6E00,U+6E04,U+6E0A,U+6E17,U+6E19,U+6E1D-6E20,U+6E22-6E25,U+6E27,U+6E2B,U+6E2D-6E2E,U+6E32,U+6E34,U+6E36,U+6E38-6E3C,U+6E42-6E45,U+6E48-6E49,U+6E4B-6E4F,U+6E51-6E54,U+6E57,U+6E5B-6E5F,U+6E62-6E63,U+6E68,U+6E6B,U+6E6E,U+6E72-6E73,U+6E76,U+6E7B,U+6E7D,U+6E82,U+6E89,U+6E8C-6E8D,U+6E8F,U+6E93,U+6E98-6E99,U+6E9F-6EA0,U+6EA5,U+6EA7,U+6EAA-6EAB,U+6EAD-6EAF,U+6EB1-6EB4,U+6EB7,U+6EBB-6EBD,U+6EBF-6EC4,U+6EC7-6ECA,U+6ECC-6ECF,U+6ED3-6ED5,U+6ED9-6EDB,U+6EE6,U+6EEB-6EEF,U+6EF7-6EF9,U+6EFB,U+6EFD-6EFF,U+6F04,U+6F08-6F0A,U+6F0C-6F0D,U+6F10-6F11,U+6F13,U+6F15-6F16,U+6F18,U+6F1A-6F1B,U+6F25-6F26,U+6F29-6F2A,U+6F2D,U+6F2F-6F33,U+6F35-6F36,U+6F38,U+6F3B-6F3C,U+6F3E-6F3F,U+6F41,U+6F45,U+6F4F,U+6F51-6F53,U+6F57}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.33.woff2)format("woff2");unicode-range:U+6B85,U+6B89,U+6B8D,U+6B95,U+6B97-6B98,U+6B9B,U+6B9E-6BA0,U+6BA2-6BA4,U+6BA8-6BB3,U+6BB7-6BB9,U+6BBC-6BBE,U+6BC0,U+6BC3-6BC4,U+6BC6-6BC9,U+6BCB-6BCC,U+6BCF,U+6BD3,U+6BD6-6BD8,U+6BDA,U+6BDF,U+6BE1,U+6BE3,U+6BE6-6BE7,U+6BEB-6BEC,U+6BEE,U+6BF1,U+6BF3,U+6BF7,U+6BF9,U+6BFF,U+6C02,U+6C04-6C05,U+6C08-6C0A,U+6C0D-6C0E,U+6C10,U+6C12-6C14,U+6C19,U+6C1B,U+6C1F,U+6C24,U+6C26-6C28,U+6C2C,U+6C2E,U+6C33,U+6C35-6C36,U+6C3A-6C3B,U+6C3E-6C40,U+6C4A-6C4B,U+6C4D,U+6C4F,U+6C52,U+6C54-6C55,U+6C59,U+6C5B-6C5E,U+6C62,U+6C67-6C68,U+6C6A-6C6B,U+6C6D,U+6C6F,U+6C73-6C74,U+6C76,U+6C78-6C79,U+6C7B,U+6C7E,U+6C81-6C87,U+6C89,U+6C8C-6C8D,U+6C90,U+6C92-6C95,U+6C97-6C98,U+6C9A-6C9C,U+6C9F,U+6CAA-6CAE,U+6CB0-6CB2,U+6CB4,U+6CBA,U+6CBD-6CBE,U+6CC2,U+6CC5-6CC6,U+6CCD,U+6CCF-6CD4,U+6CD6-6CD7,U+6CD9-6CDD,U+6CE0,U+6CE7,U+6CE9-6CEF,U+6CF1-6CF2,U+6CF4,U+6CFB,U+6D00-6D01,U+6D04,U+6D07,U+6D0A,U+6D0C,U+6D0E-6D0F,U+6D11,U+6D13,U+6D19-6D1A,U+6D1F,U+6D24,U+6D26-6D28,U+6D2B,U+6D2E-6D2F,U+6D31,U+6D33-6D36,U+6D38-6D39,U+6D3C-6D3D,U+6D3F,U+6D57-6D5B,U+6D5E-6D61,U+6D64-6D65,U+6D67,U+6D6C,U+6D6F-6D70,U+6D79}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.34.woff2)format("woff2");unicode-range:U+69DD-69DE,U+69E2-69E3,U+69E5,U+69E7-69EB,U+69ED-69EF,U+69F1-69F6,U+69F9,U+69FE-6A01,U+6A03,U+6A05,U+6A0A,U+6A0C,U+6A0F,U+6A11-6A15,U+6A17,U+6A1A-6A1B,U+6A1D-6A20,U+6A22-6A24,U+6A28,U+6A2E,U+6A30,U+6A32-6A38,U+6A3B,U+6A3E-6A3F,U+6A44-6A4A,U+6A4E,U+6A50-6A52,U+6A54-6A56,U+6A5B,U+6A61-6A62,U+6A64,U+6A66-6A67,U+6A6A-6A6B,U+6A71-6A73,U+6A78,U+6A7A,U+6A7E-6A7F,U+6A81,U+6A83-6A84,U+6A86-6A87,U+6A89,U+6A8B,U+6A8D,U+6A90-6A91,U+6A94,U+6A97,U+6A9B,U+6A9D-6AA3,U+6AA5,U+6AAA-6AAC,U+6AAE-6AB1,U+6AB3-6AB4,U+6AB8,U+6ABB,U+6ABD-6ABF,U+6AC1-6AC3,U+6AC6,U+6AC8-6AC9,U+6ACC,U+6AD0-6AD1,U+6AD3-6AD6,U+6ADA-6ADF,U+6AE2,U+6AE4,U+6AE7-6AE8,U+6AEA,U+6AEC,U+6AF0-6AF3,U+6AF8,U+6AFA,U+6AFC-6AFD,U+6B02-6B03,U+6B06-6B07,U+6B09-6B0B,U+6B0F-6B12,U+6B16-6B17,U+6B1B,U+6B1D-6B1F,U+6B23-6B24,U+6B28,U+6B2B-6B2C,U+6B2F,U+6B35-6B39,U+6B3B,U+6B3D,U+6B3F,U+6B43,U+6B46-6B47,U+6B49-6B4A,U+6B4D-6B4E,U+6B50,U+6B52,U+6B54,U+6B56,U+6B58-6B59,U+6B5B,U+6B5D,U+6B5F-6B61,U+6B65,U+6B67,U+6B6B-6B6C,U+6B6E,U+6B70,U+6B72,U+6B75,U+6B77-6B7A,U+6B7D-6B84}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.35.woff2)format("woff2");unicode-range:U+6855,U+6857-6859,U+685B,U+685D,U+685F,U+6863,U+6867,U+686B,U+686E-6872,U+6874-6875,U+6877,U+6879-687C,U+687E-687F,U+6882-6884,U+6886,U+6888,U+688D-6890,U+6894,U+6896,U+6898-689C,U+689F-68A3,U+68A5-68A7,U+68A9-68AB,U+68AD-68AF,U+68B2-68B5,U+68B9-68BC,U+68C3,U+68C5-68C6,U+68C8-68CA,U+68CC-68CD,U+68CF-68D1,U+68D3-68D9,U+68DC-68DD,U+68E0-68E1,U+68E3-68E5,U+68E7-68E8,U+68EA-68ED,U+68EF-68F1,U+68F5-68F7,U+68F9,U+68FB-68FD,U+6900-6901,U+6903-6904,U+6906-690C,U+690F-6911,U+6913,U+6916-6917,U+6919-691B,U+6921-6923,U+6925-6926,U+6928,U+692A,U+6930-6931,U+6933-6936,U+6938-6939,U+693B,U+693D,U+6942,U+6945-6946,U+6949,U+694E,U+6954,U+6957,U+6959,U+695B-695E,U+6961-6966,U+6968-696C,U+696E-6974,U+6977-697B,U+697E-6981,U+6986,U+698D,U+6991-6992,U+6994-6996,U+6998,U+699C,U+69A0-69A1,U+69A5-69A8,U+69AB,U+69AD,U+69AF-69B2,U+69B4,U+69B7-69B8,U+69BA-69BC,U+69BE-69C1,U+69C3,U+69C5,U+69C7-69C8,U+69CA,U+69CE-69D1,U+69D3,U+69D6-69D7,U+69D9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.36.woff2)format("woff2");unicode-range:U+667E-6680,U+6683-6684,U+6688,U+668B-668E,U+6690,U+6692,U+6698-669D,U+669F-66A0,U+66A2,U+66A4,U+66AD,U+66B1-66B3,U+66B5,U+66B8-66B9,U+66BB-66BC,U+66BE-66C4,U+66C6,U+66C8-66C9,U+66CC,U+66CE-66CF,U+66D4,U+66DA-66DB,U+66DD,U+66DF-66E0,U+66E6,U+66E8-66E9,U+66EB-66EC,U+66EE,U+66F5,U+66F7,U+66FA-66FC,U+6701,U+6705,U+6707,U+670C,U+670E-6710,U+6712-6716,U+6719,U+671C,U+671E,U+6720,U+6722,U+6725-6726,U+672E,U+6733,U+6735-6738,U+673E-673F,U+6741,U+6743,U+6745-6748,U+674C-674D,U+6753-6755,U+6759,U+675D-675E,U+6760,U+6762-6764,U+6766,U+676A,U+676C,U+676E,U+6770,U+6772-6774,U+6776-6777,U+677B-677C,U+6780-6781,U+6784-6785,U+6787,U+6789,U+678B-678C,U+678E-678F,U+6791-6793,U+6796,U+6798-6799,U+679B,U+67A1,U+67A4,U+67A6,U+67A9,U+67B0-67B5,U+67B7-67B9,U+67BB-67BE,U+67C0-67C3,U+67C5-67C6,U+67C8-67C9,U+67CE,U+67D2,U+67D7-67D9,U+67DB-67DE,U+67E1-67E2,U+67E4,U+67E6-67E7,U+67E9,U+67EC,U+67EE-67F0,U+67F2,U+67F6-67F7,U+67F9-67FA,U+67FC,U+67FE,U+6801-6802,U+6805,U+6810,U+6814,U+6818-6819,U+681D,U+681F,U+6822,U+6827-6829,U+682B-682D,U+682F-6834,U+683B,U+683E-6840,U+6844-6846,U+6849-684A,U+684C-684E,U+6852-6854}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.37.woff2)format("woff2");unicode-range:U+64D2,U+64D4-64D5,U+64D7-64D8,U+64DA,U+64E0-64E1,U+64E3-64E5,U+64E7,U+64E9-64EA,U+64ED,U+64EF-64F2,U+64F4-64F7,U+64FA-64FB,U+64FD-6501,U+6504-6505,U+6508-650A,U+650F,U+6513-6514,U+6516,U+6518-6519,U+651B-651F,U+6522,U+6524,U+6526,U+6529-652C,U+652E,U+6531-6532,U+6534-6538,U+653A,U+653C-653D,U+6543-6544,U+6547-6549,U+654D-654E,U+6550,U+6552,U+6554-6556,U+6558,U+655D-6560,U+6567,U+656B,U+6572,U+6578,U+657A,U+657D,U+6581-6585,U+6588,U+658A,U+658C,U+6592,U+6595,U+6598,U+659B,U+659D,U+659F-65A1,U+65A3-65A6,U+65AB,U+65AE,U+65B2-65B5,U+65B7-65B8,U+65BE-65BF,U+65C1-65C4,U+65C6,U+65C8-65C9,U+65CC,U+65CE,U+65D0,U+65D2,U+65D4,U+65D6,U+65D8-65D9,U+65DB,U+65DF-65E1,U+65E3,U+65F0-65F2,U+65F4-65F5,U+65F9,U+65FB-65FC,U+65FE-6600,U+6603-6604,U+6608-660A,U+660D,U+6611-6612,U+6615-6616,U+661C-661E,U+6621-6624,U+6626,U+6629-662C,U+662E,U+6630-6631,U+6633-6637,U+6639-663B,U+663F-6641,U+6644-6646,U+6648-664A,U+664C,U+664E-664F,U+6651,U+6657-6665,U+6667-6668,U+666A-666D,U+6670,U+6673,U+6675,U+6677-6679,U+667B-667C}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.38.woff2)format("woff2");unicode-range:U+62CF,U+62D1,U+62D4-62D6,U+62DA,U+62DC,U+62EA,U+62EE-62EF,U+62F1-62F2,U+62F4-62F5,U+62FC-62FD,U+62FF,U+6302-6304,U+6308-630D,U+6310,U+6313,U+6316,U+6318,U+631B,U+6327,U+6329-632A,U+632D,U+6332,U+6335-6336,U+6339-633C,U+633E,U+6341-6344,U+6346,U+634A-634E,U+6350,U+6352-6354,U+6358-6359,U+635B,U+6365-6366,U+6369,U+636B-636D,U+6371-6372,U+6374-6378,U+637A,U+637C-637D,U+637F-6380,U+6382,U+6384,U+6387,U+6389-638A,U+638E-6390,U+6394-6396,U+6399-639A,U+639E,U+63A0,U+63A3-63A4,U+63A6,U+63A9,U+63AB-63AF,U+63B5,U+63BD-63BE,U+63C0-63C1,U+63C4-63C6,U+63C8,U+63CE,U+63D1-63D6,U+63DC,U+63E0,U+63E3,U+63E5,U+63E9-63ED,U+63F2-63F3,U+63F5-63F9,U+6406,U+6409-640A,U+640F-6410,U+6412-6414,U+6416-6418,U+641E,U+6420,U+6422,U+6424-6426,U+6428-642A,U+642F-6430,U+6434-6436,U+643D,U+643F,U+644B,U+644E-644F,U+6451-6454,U+645A-645D,U+645F-6461,U+6463,U+6467,U+646D,U+6473-6474,U+6476,U+6478-6479,U+647B,U+647D,U+6485,U+6487-6488,U+648F-6491,U+6493,U+6495,U+6498-649B,U+649D-649F,U+64A1,U+64A3,U+64A6,U+64A8-64A9,U+64AC,U+64B3,U+64BB-64BF,U+64C2,U+64C4-64C5,U+64C7,U+64C9-64CC,U+64CE,U+64D0-64D1}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.39.woff2)format("woff2");unicode-range:U+6117,U+6119,U+611C,U+611E,U+6120-6122,U+6127-6128,U+612A-612C,U+6130-6131,U+6134-6137,U+6139-613A,U+613C-613F,U+6141-6142,U+6144-6147,U+6149-614A,U+614D,U+6153,U+6158-615A,U+615D-6160,U+6164-6165,U+616B-616C,U+616F,U+6171-6175,U+6177-6178,U+617B-6181,U+6183-6184,U+6187,U+618A-618B,U+618D,U+6192-6194,U+6196-619A,U+619C-619D,U+619F-61A0,U+61A5,U+61A8,U+61AA-61AE,U+61B8-61BA,U+61BC,U+61BE,U+61C0-61C3,U+61C6,U+61C8,U+61CA-61CF,U+61D5,U+61DC-61DF,U+61E1-61E3,U+61E5-61E9,U+61EC-61ED,U+61EF,U+61F4-61F7,U+61FA,U+61FC-6201,U+6203-6204,U+6207-620A,U+620D-620E,U+6213-6215,U+621B-621E,U+6220-6223,U+6227,U+6229-622B,U+622E,U+6230-6233,U+6236,U+6239,U+623D-623E,U+6241-6244,U+6246,U+6248,U+624C,U+624E,U+6250-6252,U+6254,U+6256,U+6258,U+625A-625C,U+625E,U+6260-6261,U+6263-6264,U+6268,U+626D,U+626F,U+6273,U+627A-627E,U+6282-6283,U+6285,U+6289,U+628D-6290,U+6292-6294,U+6296,U+6299,U+629B,U+62A6,U+62A8,U+62AC,U+62B3,U+62B6-62B7,U+62BA-62BB,U+62BE-62BF,U+62C2,U+62C4,U+62C6-62C8,U+62CA,U+62CE}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.40.woff2)format("woff2");unicode-range:U+5F6C-5F6D,U+5F6F,U+5F72-5F75,U+5F78,U+5F7A,U+5F7D-5F7F,U+5F82-5F83,U+5F87-5F89,U+5F8D,U+5F8F,U+5F91,U+5F96,U+5F99,U+5F9C-5F9D,U+5FA0,U+5FA2,U+5FA4,U+5FA7-5FA8,U+5FAB-5FAD,U+5FAF-5FB1,U+5FB5,U+5FB7-5FB8,U+5FBC-5FBD,U+5FC4,U+5FC7-5FC9,U+5FCB,U+5FD0-5FD4,U+5FDD-5FDE,U+5FE1-5FE2,U+5FE4,U+5FE8-5FEA,U+5FEC-5FF3,U+5FF6,U+5FF8,U+5FFA-5FFD,U+5FFF,U+6007,U+600A,U+600D-6010,U+6013-6015,U+6017-601B,U+601F,U+6021-6022,U+6024,U+6026,U+6029,U+602B,U+602D,U+6031,U+6033,U+6035,U+603A,U+6040-6043,U+6046-604A,U+604C-604D,U+6051,U+6054-6057,U+6059-605A,U+605D,U+605F-6064,U+6067,U+606A-606C,U+6070-6071,U+6077,U+607E-607F,U+6081-6086,U+6088-608E,U+6091-6093,U+6095-6098,U+609A-609B,U+609D-609E,U+60A2,U+60A4-60A5,U+60A7-60A8,U+60B0-60B1,U+60B3-60B5,U+60B7-60B8,U+60BB,U+60BD-60BE,U+60C2,U+60C4,U+60C6-60CB,U+60CE-60CF,U+60D3-60D5,U+60D8-60D9,U+60DB,U+60DD-60DF,U+60E1-60E2,U+60E5,U+60EE,U+60F0-60F2,U+60F4-60F8,U+60FA-60FD,U+6100,U+6102-6103,U+6106-6108,U+610A,U+610C-610E,U+6110-6114,U+6116}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.41.woff2)format("woff2");unicode-range:U+5D9B,U+5D9D,U+5D9F-5DA0,U+5DA2,U+5DA4,U+5DA7,U+5DAB-5DAC,U+5DAE,U+5DB0,U+5DB2,U+5DB4,U+5DB7-5DB9,U+5DBC-5DBD,U+5DC3,U+5DC7,U+5DC9,U+5DCB-5DCE,U+5DD0-5DD3,U+5DD6-5DD9,U+5DDB,U+5DE0,U+5DE2,U+5DE4,U+5DE9,U+5DF2,U+5DF5,U+5DF8-5DF9,U+5DFD,U+5DFF-5E00,U+5E07,U+5E0B,U+5E0D,U+5E11-5E12,U+5E14-5E15,U+5E18-5E1B,U+5E1F-5E20,U+5E25,U+5E28,U+5E2E,U+5E32,U+5E35-5E37,U+5E3E,U+5E40,U+5E43-5E44,U+5E47,U+5E49,U+5E4B,U+5E4E,U+5E50-5E51,U+5E54,U+5E56-5E58,U+5E5B-5E5C,U+5E5E-5E5F,U+5E62,U+5E64,U+5E68,U+5E6A-5E6E,U+5E70,U+5E75-5E77,U+5E7A,U+5E7F-5E80,U+5E87,U+5E8B,U+5E8E,U+5E96,U+5E99-5E9A,U+5EA0,U+5EA2,U+5EA4-5EA5,U+5EA8,U+5EAA,U+5EAC,U+5EB1,U+5EB3,U+5EB8-5EB9,U+5EBD-5EBF,U+5EC1-5EC2,U+5EC6,U+5EC8,U+5ECB-5ECC,U+5ECE-5ED6,U+5ED9-5EE2,U+5EE5,U+5EE8-5EE9,U+5EEB-5EEC,U+5EF0-5EF1,U+5EF3-5EF4,U+5EF8-5EF9,U+5EFC-5F00,U+5F02-5F03,U+5F06-5F09,U+5F0B-5F0E,U+5F11,U+5F16-5F17,U+5F19,U+5F1B-5F1E,U+5F21-5F24,U+5F27-5F29,U+5F2B-5F30,U+5F34,U+5F36,U+5F38,U+5F3A-5F3D,U+5F3F-5F41,U+5F44-5F45,U+5F47-5F48,U+5F4A,U+5F4C-5F4E,U+5F50-5F51,U+5F54,U+5F56-5F58,U+5F5B-5F5D,U+5F60,U+5F63-5F65,U+5F67,U+5F6A}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.42.woff2)format("woff2");unicode-range:U+5BBC,U+5BC0-5BC1,U+5BC3,U+5BC7,U+5BC9,U+5BCD-5BD0,U+5BD3-5BD4,U+5BD6-5BDA,U+5BDE,U+5BE0-5BE2,U+5BE4-5BE6,U+5BE8,U+5BEB-5BEC,U+5BEF-5BF1,U+5BF3-5BF6,U+5BFD,U+5C03,U+5C05,U+5C07-5C09,U+5C0C-5C0D,U+5C12-5C14,U+5C17,U+5C19,U+5C1E-5C20,U+5C22-5C24,U+5C26,U+5C28-5C2E,U+5C30,U+5C32,U+5C35-5C36,U+5C38-5C39,U+5C46,U+5C4D-5C50,U+5C53,U+5C59-5C5C,U+5C5F-5C63,U+5C67-5C69,U+5C6C-5C70,U+5C74-5C76,U+5C79-5C7D,U+5C87-5C88,U+5C8A,U+5C8C,U+5C8F,U+5C91-5C92,U+5C94,U+5C9D,U+5C9F-5CA0,U+5CA2-5CA3,U+5CA6-5CA8,U+5CAA-5CAB,U+5CAD,U+5CB1-5CB2,U+5CB4-5CB7,U+5CBA-5CBC,U+5CBE,U+5CC5,U+5CC7,U+5CC9,U+5CCB,U+5CD0,U+5CD2,U+5CD7,U+5CD9,U+5CDD,U+5CE6,U+5CE8-5CEA,U+5CED-5CEE,U+5CF1-5CF2,U+5CF4-5CF5,U+5CFA-5CFB,U+5CFD,U+5D01,U+5D06,U+5D0B,U+5D0D,U+5D10-5D12,U+5D14-5D15,U+5D17-5D1B,U+5D1D,U+5D1F-5D20,U+5D22-5D24,U+5D26-5D27,U+5D2B,U+5D31,U+5D34,U+5D39,U+5D3D,U+5D3F,U+5D42-5D43,U+5D46-5D48,U+5D4A-5D4B,U+5D4E,U+5D51-5D53,U+5D55,U+5D59,U+5D5C,U+5D5F-5D62,U+5D64,U+5D69-5D6A,U+5D6C-5D6D,U+5D6F-5D70,U+5D73,U+5D76,U+5D79-5D7A,U+5D7E-5D7F,U+5D81-5D84,U+5D87-5D88,U+5D8A,U+5D8C,U+5D90,U+5D92-5D95,U+5D97,U+5D99}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.43.woff2)format("woff2");unicode-range:U+598B-598E,U+5992,U+5995,U+5997,U+599B,U+599D,U+599F,U+59A3-59A4,U+59A7,U+59AD-59B0,U+59B2-59B3,U+59B7,U+59BA,U+59BC,U+59BE,U+59C1,U+59C3-59C4,U+59C6,U+59C8,U+59CA,U+59CD,U+59D2,U+59D9-59DA,U+59DD-59DF,U+59E3-59E5,U+59E7-59E8,U+59EC,U+59EE-59EF,U+59F1-59F2,U+59F4,U+59F6-59F8,U+5A00,U+5A03-5A04,U+5A09,U+5A0C-5A0E,U+5A11-5A13,U+5A17,U+5A1A-5A1C,U+5A1E-5A1F,U+5A23-5A25,U+5A27-5A28,U+5A2A,U+5A2D,U+5A30,U+5A35-5A36,U+5A40-5A41,U+5A44-5A45,U+5A47-5A49,U+5A4C,U+5A50,U+5A55,U+5A5E,U+5A62-5A63,U+5A65,U+5A67,U+5A6A,U+5A6C-5A6D,U+5A77,U+5A7A-5A7B,U+5A7E,U+5A84,U+5A8B,U+5A90,U+5A93,U+5A96,U+5A99,U+5A9C,U+5A9E-5AA0,U+5AA2,U+5AA7,U+5AAC,U+5AB1-5AB3,U+5AB5,U+5AB8,U+5ABA-5ABF,U+5AC2,U+5AC4,U+5AC6,U+5AC8,U+5ACB,U+5ACF-5AD0,U+5AD6-5AD7,U+5ADA,U+5ADC,U+5AE0-5AE1,U+5AE3,U+5AE5-5AE6,U+5AE9-5AEA,U+5AEE,U+5AF0,U+5AF5-5AF6,U+5AFA-5AFB,U+5AFD,U+5B00-5B01,U+5B08,U+5B0B,U+5B16-5B17,U+5B19,U+5B1B,U+5B1D,U+5B21,U+5B25,U+5B2A,U+5B2C-5B2D,U+5B30,U+5B32,U+5B34,U+5B36,U+5B38,U+5B3E,U+5B40-5B41,U+5B43,U+5B45,U+5B4B-5B4C,U+5B51-5B52,U+5B56,U+5B5A-5B5C,U+5B5E-5B5F,U+5B65,U+5B68-5B69,U+5B6E-5B71,U+5B73,U+5B75-5B76,U+5B7A,U+5B7C-5B84,U+5B86,U+5B8A-5B8B,U+5B8D-5B8E,U+5B90-5B91,U+5B93-5B94,U+5B96,U+5BA5-5BA6,U+5BA8-5BA9,U+5BAC-5BAD,U+5BAF,U+5BB1-5BB2,U+5BB7-5BB8,U+5BBA}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.44.woff2)format("woff2");unicode-range:U+57B3,U+57B8,U+57BD,U+57C0,U+57C3,U+57C6-57C8,U+57CC,U+57CF,U+57D2-57D7,U+57DC-57DE,U+57E0-57E1,U+57E3-57E4,U+57E6-57E7,U+57E9,U+57ED,U+57F0,U+57F4-57F6,U+57F8,U+57FB,U+57FD-57FF,U+5803-5804,U+5808-580D,U+5819,U+581B,U+581D-5821,U+5826-5827,U+582D,U+582F-5830,U+5832,U+5835,U+5839,U+583D,U+583F-5840,U+5849,U+584B-584D,U+584F-5852,U+5855,U+5858-5859,U+585F,U+5861-5862,U+5864,U+5867-5868,U+586D,U+5870,U+5872,U+5878-5879,U+587C,U+587F-5881,U+5885,U+5887-588D,U+588F-5890,U+5894,U+5896,U+5898,U+589D-589E,U+58A0-58A2,U+58A6,U+58A9-58AB,U+58AE,U+58B1-58B3,U+58B8-58BC,U+58BE,U+58C2-58C5,U+58C8,U+58CD-58CE,U+58D0-58DA,U+58DC-58E2,U+58E4-58E5,U+58E9,U+58EC,U+58EF,U+58F3-58F4,U+58F7,U+58F9,U+58FB-58FD,U+5902,U+5905-5906,U+590A-590D,U+5910,U+5912-5914,U+5918-5919,U+591B,U+591D,U+591F,U+5921,U+5923-5925,U+5928,U+592C-592D,U+592F-5930,U+5932-5933,U+5935-5936,U+5938-5939,U+593D-593F,U+5943,U+5946,U+594E,U+5950,U+5952-5953,U+5955,U+5957-595B,U+595D-5961,U+5963,U+5967,U+5969,U+596B-596D,U+596F,U+5972,U+5975-5976,U+5978-5979,U+597B-597C,U+5981}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.45.woff2)format("woff2");unicode-range:U+5616-5617,U+5619,U+561B,U+5620,U+5628,U+562C,U+562F-5639,U+563B-563D,U+563F-5641,U+5643-5644,U+5646-5647,U+5649,U+564B,U+564D-5650,U+5653-5654,U+565E,U+5660-5664,U+5666,U+5669-566D,U+566F,U+5671-5672,U+5675-5676,U+5678,U+567A,U+5680,U+5684-5688,U+568A-568C,U+568F,U+5694-5695,U+5699-569A,U+569D-56A0,U+56A5-56A9,U+56AB-56AE,U+56B1-56B4,U+56B6-56B7,U+56BC,U+56BE,U+56C0,U+56C2-56C3,U+56C5,U+56C8-56D1,U+56D3,U+56D7-56D9,U+56DC-56DD,U+56DF,U+56E1,U+56E4-56E8,U+56EB,U+56ED-56EE,U+56F1,U+56F6-56F7,U+56F9,U+56FF-5704,U+5707-570A,U+570C-570D,U+5711,U+5713,U+5715-5716,U+5718,U+571A-571D,U+5720-5726,U+5729-572A,U+572C,U+572E-572F,U+5733-5734,U+5737-5738,U+573B,U+573D-573F,U+5745-5746,U+574C-574F,U+5751-5752,U+5759,U+575F,U+5761-5762,U+5764-5765,U+5767-5769,U+576B,U+576D-5771,U+5773-5775,U+5777,U+5779-577C,U+577E-577F,U+5781,U+5783,U+5788-5789,U+578C,U+5793-5795,U+5797,U+5799-579A,U+579C-57A1,U+57A4,U+57A7-57AA,U+57AC,U+57AE,U+57B0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.46.woff2)format("woff2");unicode-range:U+543F-5440,U+5443-5444,U+5447,U+544C-544F,U+5455,U+545E,U+5462,U+5464,U+5466-5467,U+5469,U+546B-546E,U+5470-5471,U+5474-5477,U+547B,U+547F-5481,U+5483-5486,U+5488-548B,U+548D-5492,U+5495-5496,U+549C,U+549F-54A2,U+54A4,U+54A6-54AF,U+54B1,U+54B7-54BC,U+54BE-54BF,U+54C2-54C4,U+54C6-54C8,U+54CA,U+54CD-54CE,U+54D8,U+54E0,U+54E2,U+54E5-54E6,U+54E8-54EA,U+54EC-54EF,U+54F1,U+54F3,U+54F6,U+54FC-5501,U+5505,U+5508-5509,U+550C-550F,U+5514-5516,U+5527,U+552A-552B,U+552E,U+5532-5533,U+5535-5536,U+5538-5539,U+553B-553D,U+5540-5541,U+5544-5545,U+5547,U+5549-554A,U+554C-554D,U+5550-5551,U+5556-5558,U+555A-555E,U+5560-5561,U+5563-5564,U+5566,U+557B-5583,U+5586-5588,U+558A,U+558E-558F,U+5591-5594,U+5597,U+5599,U+559E-559F,U+55A3-55A4,U+55A8-55A9,U+55AC-55AE,U+55B2,U+55BF,U+55C1,U+55C3-55C4,U+55C6-55C7,U+55C9,U+55CB-55CC,U+55CE,U+55D1-55D4,U+55D7-55D8,U+55DA-55DB,U+55DD-55DF,U+55E2,U+55E4,U+55E9,U+55EC,U+55EE,U+55F1,U+55F6-55F9,U+55FD-55FF,U+5605,U+5607-5608,U+560A,U+560D-5612}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.47.woff2)format("woff2");unicode-range:U+528D,U+5291-5298,U+529A,U+529C,U+52A4-52A7,U+52AB-52AD,U+52AF-52B0,U+52B5-52B8,U+52BA-52BE,U+52C0-52C1,U+52C4-52C6,U+52C8,U+52CA,U+52CC-52CD,U+52CF-52D2,U+52D4,U+52D6-52D7,U+52DB-52DC,U+52DE,U+52E0-52E1,U+52E3,U+52E5-52E6,U+52E8-52EA,U+52EC,U+52F0-52F1,U+52F3-52FB,U+5300-5301,U+5303,U+5306-5308,U+530A-530D,U+530F-5311,U+5313,U+5315,U+5318-531F,U+5321,U+5323-5325,U+5327-532D,U+532F-5333,U+5335,U+5338,U+533C-533E,U+5340,U+5342,U+5345-5346,U+5349,U+534B-534C,U+5359,U+535B,U+535E,U+5361,U+5363-5367,U+5369,U+536C-536E,U+5372,U+5377,U+5379-537B,U+537D-537F,U+5382-5383,U+5387-5389,U+538E,U+5393-5394,U+5396,U+5398-5399,U+539D,U+53A0-53A1,U+53A4-53A6,U+53A9-53AB,U+53AD-53B0,U+53B2,U+53B4-53B8,U+53BA,U+53BD,U+53C0-53C1,U+53C3-53C5,U+53CF,U+53D2-53D3,U+53D5,U+53DA-53DB,U+53DD-53E0,U+53E2,U+53E6-53E8,U+53ED-53EE,U+53F4-53F5,U+53FA,U+5401-5403,U+540B,U+540F,U+5412-5413,U+541A,U+541D-541E,U+5421,U+5424,U+5427-542A,U+542C-542F,U+5431,U+5433-5436,U+543C-543D}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.48.woff2)format("woff2");unicode-range:U+50DD-50DF,U+50E1-50E6,U+50E8-50E9,U+50ED-50F6,U+50F9-50FB,U+50FE,U+5101-5103,U+5106-5109,U+510B-510E,U+5110,U+5112,U+5114-511E,U+5121,U+5123,U+5127-5128,U+512C-512D,U+512F,U+5131,U+5133-5135,U+5137-513C,U+513F-5142,U+5147,U+514A,U+514C,U+514F,U+5152-5155,U+5157-5158,U+515F-5160,U+5162,U+5164,U+5166-5167,U+5169-516A,U+516E,U+5173-5174,U+5179,U+517B,U+517E,U+5180,U+5182-5184,U+5189,U+518B-518C,U+518E-5191,U+5193,U+5195-5196,U+5198,U+519D,U+51A1-51A4,U+51A6,U+51A9-51AB,U+51AD,U+51B0-51B3,U+51B5,U+51B8,U+51BA,U+51BC-51BF,U+51C2-51C3,U+51C5,U+51C8-51CB,U+51CF,U+51D1-51D6,U+51D8,U+51DE-51E0,U+51E2,U+51E5,U+51E7,U+51E9,U+51EC-51EE,U+51F2-51F5,U+51F7,U+51FE,U+5201-5202,U+5204-5205,U+520B,U+520E,U+5212-5216,U+5218,U+5222,U+5226-5228,U+522A-522B,U+522E,U+5231-5233,U+5235,U+523C,U+5244-5245,U+5249,U+524B-524C,U+524F,U+5254-5255,U+5257-5258,U+525A,U+525C-5261,U+5266,U+5269,U+526C,U+526E,U+5271,U+5273-5274,U+5277-5279,U+527D,U+527F-5280,U+5282-5285,U+5288-528A,U+528C}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.49.woff2)format("woff2");unicode-range:U+4F57-4F58,U+4F5A-4F5B,U+4F5D-4F5F,U+4F63-4F64,U+4F69-4F6A,U+4F6C,U+4F6E-4F71,U+4F76-4F7E,U+4F81-4F85,U+4F88-4F8A,U+4F8C,U+4F8E-4F90,U+4F92-4F94,U+4F96-4F9A,U+4F9E-4FA0,U+4FAB,U+4FAD,U+4FAF,U+4FB2,U+4FB7,U+4FB9,U+4FBB-4FBE,U+4FC0-4FC1,U+4FC4-4FC6,U+4FC8-4FC9,U+4FCB-4FD4,U+4FD8,U+4FDA-4FDC,U+4FDF-4FE0,U+4FE2,U+4FE4-4FE6,U+4FEF-4FF2,U+4FF6,U+4FFC-5002,U+5004-5007,U+500A,U+500C,U+500E-5011,U+5013-5014,U+5016-5018,U+501A-501E,U+5021-5023,U+5025-502A,U+502C-502E,U+5030,U+5032-5033,U+5035,U+5039,U+503B,U+5040-5043,U+5045-5048,U+504A,U+504C,U+504E,U+5050-5053,U+5055-5057,U+5059-505A,U+505F-5060,U+5062-5063,U+5066-5067,U+506A,U+506C-506D,U+5070-5072,U+5077-5078,U+5080-5081,U+5083-5086,U+5088,U+508A,U+508E-5090,U+5092-5096,U+509A-509C,U+509E-50A3,U+50AA,U+50AD,U+50AF-50B4,U+50B9-50BB,U+50BD,U+50C0,U+50C2-50C4,U+50C7,U+50C9-50CA,U+50CC,U+50CE,U+50D0-50D1,U+50D3-50D4,U+50D6,U+50D8-50D9,U+50DC}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.50.woff2)format("woff2");unicode-range:U+4093,U+4103,U+4105,U+4148,U+414F,U+4163,U+41B4,U+41BF,U+41E6,U+41EE,U+41F3,U+4207,U+420E,U+4264,U+4293,U+42C6,U+42D6,U+42DD,U+4302,U+432B,U+4343,U+43EE,U+43F0,U+4408,U+440C,U+4417,U+441C,U+4422,U+4453,U+445B,U+4476,U+447A,U+4491,U+44B3,U+44BE,U+44D4,U+4508,U+450D,U+4525,U+4543,U+457A,U+459D,U+45B8,U+45BE,U+45E5,U+45EA,U+460F-4610,U+4641,U+4665,U+46A1,U+46AE-46AF,U+470C,U+471F,U+4764,U+47E6,U+47FD,U+4816,U+481E,U+4844,U+484E,U+48B5,U+49B0,U+49E7,U+49FA,U+4A04,U+4A29,U+4ABC,U+4B38,U+4B3B,U+4B7E,U+4BC2,U+4BCA,U+4BD2,U+4BE8,U+4C17,U+4C20,U+4C38,U+4CC4,U+4CD1,U+4CE1,U+4D07,U+4D77,U+4E02,U+4E04-4E05,U+4E0C,U+4E0F-4E12,U+4E15,U+4E17,U+4E19,U+4E1E-4E1F,U+4E23-4E24,U+4E28-4E2C,U+4E2E-4E31,U+4E35-4E37,U+4E3F-4E42,U+4E44,U+4E47-4E48,U+4E4D-4E4E,U+4E51,U+4E55-4E56,U+4E58,U+4E5A-4E5C,U+4E62-4E63,U+4E68-4E69,U+4E74-4E75,U+4E79,U+4E7F,U+4E82,U+4E85,U+4E8A,U+4E8D-4E8E,U+4E96-4E99,U+4E9D-4EA0,U+4EA2,U+4EA5-4EA6,U+4EA8,U+4EAF-4EB0,U+4EB3,U+4EB6,U+4EB9,U+4EBB-4EBC,U+4EC2-4EC4,U+4EC6-4EC8,U+4ECD,U+4ED0,U+4ED7,U+4EDA-4EDB,U+4EDD-4EE2,U+4EE8,U+4EEB,U+4EED,U+4EEF,U+4EF1,U+4EF3,U+4EF5,U+4EF7,U+4EFC-4F00,U+4F02-4F03,U+4F08-4F09,U+4F0B-4F0D,U+4F12,U+4F15-4F17,U+4F19,U+4F1C,U+4F2B,U+4F2E,U+4F30-4F31,U+4F33,U+4F35-4F37,U+4F39,U+4F3B,U+4F3E,U+4F40,U+4F42-4F43,U+4F48-4F49,U+4F4B-4F4C,U+4F52,U+4F54,U+4F56}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.51.woff2)format("woff2");unicode-range:U+3395-339B,U+339E-33A0,U+33A2-33FF,U+3402,U+3405-3406,U+3427,U+342C,U+342E,U+3468,U+346A,U+3488,U+3492,U+34B5,U+34BC,U+34C1,U+34C7,U+34DB,U+351F,U+353E,U+355D-355E,U+3563,U+356E,U+35A6,U+35A8,U+35C5,U+35DA,U+35DE,U+35F4,U+3605,U+3614,U+364A,U+3691,U+3696,U+3699,U+36CF,U+3761-3762,U+376B-376C,U+3775,U+378D,U+37C1,U+37E2,U+37E8,U+37F4,U+37FD,U+3800,U+382F,U+3836,U+3840,U+385C,U+3861,U+38A1,U+38AD,U+38FA,U+3917,U+391A,U+396F,U+39A4,U+39B8,U+3A5C,U+3A6E,U+3A73,U+3A85,U+3AC4,U+3ACB,U+3AD6-3AD7,U+3AEA,U+3AF3,U+3B0E,U+3B1A,U+3B1C,U+3B22,U+3B35,U+3B6D,U+3B77,U+3B87-3B88,U+3B8D,U+3BA4,U+3BB6,U+3BC3,U+3BCD,U+3BF0,U+3BF3,U+3C0F,U+3C26,U+3CC3,U+3CD2,U+3D11,U+3D1E,U+3D31,U+3D4E,U+3D64,U+3D9A,U+3DC0,U+3DCC,U+3DD4,U+3E05,U+3E3F-3E40,U+3E60,U+3E66,U+3E68,U+3E83,U+3E8A,U+3E94,U+3EDA,U+3F57,U+3F72,U+3F75,U+3F77,U+3FAE,U+3FB1,U+3FC9,U+3FD7,U+3FDC,U+4039,U+4058}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.52.woff2)format("woff2");unicode-range:U+32B5-332B,U+332D-3394}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.53.woff2)format("woff2");unicode-range:U+31C8-31E3,U+31F0-321E,U+3220-3230,U+3232-32B4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.54.woff2)format("woff2");unicode-range:U+3028-303F,U+3094-3096,U+309F-30A0,U+30EE,U+30F7-30FA,U+30FF,U+3105-312F,U+3131-3163,U+3165-318E,U+3190-31BB,U+31C0-31C7}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.55.woff2)format("woff2");unicode-range:U+2F14-2FD5,U+2FF0-2FFB,U+3004,U+3013,U+3016-301B,U+301E,U+3020-3027}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.56.woff2)format("woff2");unicode-range:U+25E4-25E6,U+2601-2603,U+2609,U+260E-260F,U+2616-2617,U+261C-261F,U+262F,U+2641,U+2660,U+2662-2664,U+2666-2668,U+266D-266E,U+2672-267D,U+26BD-26BE,U+2702,U+271A,U+273D,U+2740,U+2756,U+2776-2793,U+27A1,U+2934-2935,U+29BF,U+29FA-29FB,U+2B05-2B07,U+2B1A,U+2B95,U+2E3A-2E3B,U+2E80-2E99,U+2E9B-2EF3,U+2F00-2F13}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.57.woff2)format("woff2");unicode-range:U+24D1-24FF,U+2503-2513,U+2515-2516,U+2518-251B,U+251D-2522,U+2524-259F,U+25A2-25AB,U+25B1,U+25B7,U+25C0-25C1,U+25C9-25CA,U+25CC,U+25D0-25D3,U+25E2-25E3}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.58.woff2)format("woff2");unicode-range:U+2105,U+2109-210A,U+210F,U+2116,U+2121,U+2126-2127,U+212B,U+212E,U+2135,U+213B,U+2194-2199,U+21B8-21B9,U+21C4-21C6,U+21CB-21CC,U+21D0,U+21E6-21E9,U+21F5,U+2202-2203,U+2205-2206,U+2208-220B,U+220F,U+2211,U+2213,U+2215,U+221A,U+221D,U+2220,U+2223,U+2225-2226,U+2228,U+222A-222E,U+2234-2237,U+223D,U+2243,U+2245,U+2248,U+224C,U+2260,U+2262,U+2264-2265,U+226E-226F,U+2272-2273,U+2276-2277,U+2283-2287,U+228A-228B,U+2295-2299,U+22A0,U+22A5,U+22BF,U+22DA-22DB,U+22EF,U+2305-2307,U+2318,U+2329-232A,U+23B0-23B1,U+23BE-23CC,U+23CE,U+23DA-23DB,U+2423,U+2469-24D0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.59.woff2)format("woff2");unicode-range:U+A1-A4,U+A6-A7,U+AA,U+AC-AD,U+B5-B6,U+B8-BA,U+BC-C8,U+CA-CC,U+CE-D5,U+D9-DB,U+DD-DF,U+E6,U+EE,U+F0,U+F5,U+F7,U+F9,U+FB,U+FE-102,U+110-113,U+11A-11B,U+128-12B,U+143-144,U+147-148,U+14C,U+14E-14F,U+152-153,U+168-16D,U+192,U+1A0-1A1,U+1AF,U+1CD-1DC,U+1F8-1F9,U+251,U+261,U+2BB,U+2C7,U+2C9,U+2EA-2EB,U+304,U+307,U+30C,U+1E3E-1E3F,U+1EA0-1EBE,U+1EC0-1EC6,U+1EC8-1EF9,U+2011-2012,U+2016,U+2018-201A,U+201E,U+2021,U+2030,U+2033,U+2035,U+2042,U+2047,U+2051,U+2074,U+20A9,U+20AB-20AC,U+20DD-20DE,U+2100}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.60.woff2)format("woff2");unicode-range:U+2227,U+26A0,U+2713,U+301F,U+4FF8,U+5239,U+526A,U+54FA,U+5740,U+5937,U+5993,U+59FB,U+5A3C,U+5C41,U+6028,U+626E,U+646F,U+647A,U+64B0,U+64E2,U+65A7,U+66FE,U+6727,U+6955,U+6BEF,U+6F23,U+724C,U+767C,U+7A83,U+7AC4,U+7B67,U+8000,U+8471,U+8513,U+8599,U+86DB,U+8718,U+87F2,U+88F3,U+8AD2,U+8E2A,U+8FA3,U+95A5,U+9798,U+9910,U+9957,U+9BAB,U+9C3B,U+9DAF,U+FF95}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.61.woff2)format("woff2");unicode-range:U+A8,U+2032,U+2261,U+2282,U+3090,U+30F1,U+339C,U+535C,U+53D9,U+56A2,U+56C1,U+5806,U+589F,U+59D0,U+5A7F,U+60E0,U+639F,U+65AF,U+68FA,U+69AE,U+6D1B,U+6EF2,U+71FB,U+725D,U+7262,U+75BC,U+7768,U+7940,U+79BF,U+7BED,U+7D68,U+7DFB,U+814B,U+8207,U+83E9,U+8494,U+8526,U+8568,U+85EA,U+86D9,U+87BA,U+8861,U+887F,U+8FE6,U+9059,U+9061,U+916A,U+976D,U+97AD,U+9ECE}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.62.woff2)format("woff2");unicode-range:U+2D9,U+21D4,U+301D,U+515C,U+52FE,U+5420,U+5750,U+5766,U+5954,U+5B95,U+5F8A,U+5F98,U+620C,U+621F,U+641C,U+66D9,U+676D,U+6775,U+67F5,U+694A,U+6A02,U+6A3A,U+6A80,U+6C23,U+6C72,U+6DCB,U+6FAA,U+707C,U+71C8,U+7422,U+74E2,U+7791,U+7825,U+7A14,U+7A1C,U+7C95,U+7FC1,U+82A5,U+82DB,U+8304,U+853D,U+8CD3,U+8DE8,U+8F0C,U+8F3F,U+9091,U+91C7,U+929A,U+98AF,U+9913}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.63.woff2)format("woff2");unicode-range:U+2CA-2CB,U+2229,U+2468,U+2669,U+266F,U+273F,U+4EC0,U+4F60,U+4FB6,U+5347,U+540E,U+543B,U+5B0C,U+5D4C,U+5F14,U+5F9E,U+6155,U+62D0,U+6602,U+6666,U+66F3,U+67A2,U+67CA,U+69CC,U+6D29,U+6D9B,U+6E3E,U+6F81,U+7109,U+73C0,U+73C2,U+7425,U+7435-7436,U+7525,U+7554,U+785D,U+786B,U+7AE3,U+7B94,U+7D18,U+81BF,U+8511,U+8549,U+9075,U+9640,U+98E2,U+9E9F,U+FF96}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.64.woff2)format("woff2");unicode-range:U+2467,U+4ECE,U+4ED4,U+4F91,U+4FAE,U+534D,U+53C9,U+54B3,U+586B,U+5944,U+5B78,U+5DF7,U+5F77,U+6101,U+6167-6168,U+61A4,U+62D9,U+698A,U+699B,U+6A59,U+6CC4,U+6E07,U+7099,U+75D2,U+77AD,U+7953,U+7984,U+7A92,U+7BAA,U+7DBB,U+817F,U+82AD,U+85E9,U+868A,U+8CAA,U+8F44,U+9017,U+907C,U+908A,U+92F3,U+936E,U+9435,U+978D,U+9838,U+9A28,U+9B41,U+9BA8,U+9C57,U+9EB9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.65.woff2)format("woff2");unicode-range:U+B1,U+309B,U+4E5E,U+51F1,U+5506,U+55C5,U+58CC,U+59D1,U+5C51,U+5EF7,U+6284,U+62D7,U+6689,U+673D,U+6A2B,U+6A8E,U+6A9C,U+6D63,U+6DD1,U+70B8,U+7235,U+72DB,U+72F8,U+7560,U+7C9B,U+7CE7,U+7E1E,U+80AF,U+82EB,U+8463,U+8499,U+85DD,U+86EE,U+8A60,U+8A6E,U+8C79,U+8E87,U+8E8A,U+8F5F,U+9010,U+918D,U+9190,U+965B,U+97FB,U+9AB8,U+9BAD,U+9D3B,U+9D5C,U+9DFA,U+9E93}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.66.woff2)format("woff2");unicode-range:U+2020,U+3003,U+3231,U+4E9B,U+4F3D,U+4F47,U+51B6,U+51DC,U+53E1,U+5BC5,U+602F,U+60BC,U+61C9,U+633D,U+637B,U+6492,U+65FA,U+660F,U+66F0,U+6703,U+681E,U+6876,U+6893,U+6912,U+698E,U+6C7D,U+714C,U+7169,U+71D5,U+725F,U+72D7,U+745B,U+74DC,U+75E2,U+7891,U+7897,U+7DCB,U+810A,U+8218,U+8339,U+840E,U+852D,U+8823,U+8A0A,U+9089,U+919C,U+971C,U+9AD9,U+FF4A,U+FF5A}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.67.woff2)format("woff2");unicode-range:U+2466,U+2600,U+4EAB,U+4FE3,U+4FF5,U+51A5,U+51F0,U+536F,U+53D4,U+53F1,U+54A5,U+559D,U+55E3,U+58FA,U+5962,U+59EA,U+5C16,U+5CEF,U+5D16,U+5F10,U+5FD6,U+6190,U+6216,U+634F,U+63BB,U+66D6,U+6756,U+6BC5,U+6E26,U+727D,U+731F,U+76F2,U+7729,U+7A7F,U+7AFF,U+7C9F,U+818F,U+8236,U+82B9,U+8338,U+85AA,U+88B4,U+8B33,U+904D,U+93A7,U+96CC,U+96EB,U+9AED,U+9B8E,U+FA11}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.68.woff2)format("woff2");unicode-range:U+251C,U+2523,U+4E14,U+545F,U+54BD,U+553E,U+55DC,U+56DA,U+589C,U+5B55,U+5BB5,U+5CE1,U+5DF4,U+5EB6,U+5EC9,U+6191,U+62F7,U+6357,U+64A5,U+6591,U+65BC,U+6897,U+6E1A,U+7063,U+711A,U+721B,U+722C,U+75B9,U+75D5,U+75FA,U+7766,U+7AAE,U+7B48,U+7B8B,U+7D21,U+7E55,U+7F75,U+842C,U+8910,U+8A63,U+8B39,U+8B5A,U+8CDC,U+8D74,U+907D,U+91E7,U+9306,U+96BC,U+98F4,U+9AC4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.69.woff2)format("woff2");unicode-range:U+2003,U+2312,U+266C,U+4F86,U+51EA,U+5243,U+5256,U+541F,U+5841,U+59DC,U+5DF3,U+601C,U+60E7,U+632B,U+638C,U+64AD,U+6881,U+697C,U+69CD,U+6C50,U+6D2A,U+6FC1,U+7027,U+7058,U+70F9,U+714E,U+7345,U+751A,U+760D,U+764C,U+77DB,U+7D79,U+7E8F,U+80CE,U+814E,U+81FC,U+8247,U+8278,U+85A9,U+8A03,U+90ED,U+9784,U+9801,U+984E,U+99B3,U+9BC9,U+9BDB,U+9BE8,U+9E78,U+FF6B}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.70.woff2)format("woff2");unicode-range:U+266B,U+3006,U+5176,U+5197,U+51A8,U+51C6,U+52F2,U+5614,U+5875,U+5A2F,U+5B54,U+5CE0,U+5DBA,U+5DEB,U+5E63,U+5F59,U+5FCC,U+6068,U+6367,U+68B6,U+6A0B,U+6B64,U+6E15,U+6EBA,U+7272,U+72A0,U+7947,U+7985,U+79E6,U+79E9,U+7A3D,U+7A9F,U+7AAF,U+7B95,U+7F60,U+7F9E,U+7FE0,U+8098,U+80BA,U+8106,U+82D4,U+831C,U+87F9,U+8A1F,U+8ACF,U+90C1,U+920D,U+9756,U+FE43,U+FF94}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.71.woff2)format("woff2");unicode-range:U+AF,U+2465,U+2517,U+33A1,U+4F10,U+50C5,U+51B4,U+5384,U+5606,U+5BB0,U+5CAC,U+5EE3,U+618E,U+61F2,U+62C9,U+66AB,U+66F9,U+6816,U+6960,U+6B3E,U+6F20,U+7078,U+72D0,U+73ED,U+7AD9,U+7B1B,U+7BE4,U+7D62,U+7F51,U+80B4,U+80F4,U+8154,U+85FB,U+865C,U+8702,U+895F,U+8AED,U+8B90,U+8CED,U+8FBF,U+91D8,U+9418,U+9583,U+9591,U+9813,U+982C,U+9BD6,U+FF46,U+FF7F,U+FF88}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.72.woff2)format("woff2");unicode-range:U+4E91,U+508D,U+50E7,U+514E,U+51F6,U+5446,U+5504,U+584A,U+59A8,U+59D3,U+5A46,U+5AC9,U+6020,U+60A6,U+6148,U+621A,U+6234,U+64C1,U+6523,U+675C,U+67D1,U+6953,U+6CCC,U+6DF5,U+6E13,U+6F06,U+723A,U+7325,U+74E6,U+758E,U+75AB,U+75D9,U+7A40,U+8096,U+82FA,U+8587,U+8594,U+8A6B,U+8AB9,U+8B17,U+8B83,U+937C,U+963B,U+9673,U+96DB,U+9CE9,U+9F4B,U+FF67,U+FF82,U+FF93}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.73.woff2)format("woff2");unicode-range:U+221E,U+2514,U+51F9,U+5270,U+5449,U+5824,U+59A5,U+5A29,U+5D07,U+5E16,U+60E3,U+614C,U+6276,U+643E,U+64AB,U+6562,U+6681,U+670B,U+6734,U+67AF,U+6A3D,U+6B05,U+6DC0,U+6E4A,U+7259,U+732A,U+7409,U+78A7,U+7A6B,U+8015,U+809B,U+817A,U+830E,U+837B,U+85AB,U+8A23,U+8A93,U+8B00,U+8B19,U+8B21,U+8CBF,U+8FB0,U+901D,U+91B8,U+9320,U+932C,U+9688,U+96F6,U+9DF2,U+FF6A}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.74.woff2)format("woff2");unicode-range:U+2002,U+2025,U+4F8D,U+51E1,U+51F8,U+5507,U+5598,U+58F1,U+5983,U+59AC,U+5C3C,U+5DE7,U+5E7D,U+5ECA,U+5F61,U+606D,U+60F9,U+636E,U+64EC,U+67DA,U+67FF,U+6813,U+68F2,U+693F,U+6B6A,U+6BBB,U+6EF4,U+7092,U+717D,U+7261,U+73C8,U+7432,U+7483,U+76FE,U+7709,U+78D0,U+81A3,U+81B3,U+82AF,U+8305,U+8309,U+8870,U+88FE,U+8CD1,U+8D66,U+906E,U+971E,U+9812,U+FF79,U+FF90}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.75.woff2)format("woff2");unicode-range:U+2464,U+2501,U+2640,U+2642,U+339D,U+4F0E,U+5091,U+50B5,U+5132,U+51CC,U+558B,U+55AA,U+585E,U+5BEE,U+5DFE,U+60B6,U+62B9,U+6349,U+6566,U+6590,U+6842,U+689D,U+6A58,U+6C70,U+6FF1,U+7815,U+7881,U+7AAA,U+7BC7,U+7DEF,U+7FA8,U+8017,U+8036,U+8061,U+821F,U+8429,U+8CE0,U+8E74,U+9019,U+90CA,U+9162,U+932F,U+93AE,U+9644,U+990C,U+9CF3,U+FF56,U+FF6E,U+FF7E,U+FF85}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.76.woff2)format("woff2");unicode-range:U+2266-2267,U+4F2F,U+5208,U+5451,U+546A,U+5589,U+576A,U+5815,U+5A9A,U+5B9B,U+5C3A,U+5EFB,U+5FAA,U+6109,U+6643,U+6652,U+695A,U+69FD,U+6B86,U+6BB4,U+6DAF,U+7089,U+70CF,U+7A00,U+7A4F,U+7B39,U+7D33,U+80E1,U+828B,U+82A6,U+86CD,U+8C8C,U+8CCA,U+8DF3,U+9077,U+9175,U+91DC,U+925B,U+9262,U+9271,U+92ED,U+9855,U+9905,U+9D28,U+FF3F,U+FF58,U+FF68,U+FF6D,U+FF9C}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.77.woff2)format("woff2");unicode-range:U+2207,U+25EF,U+309C,U+4E4F,U+5146,U+51DD,U+5351,U+540A,U+5629,U+5EB5,U+5F04,U+5F13,U+60DC,U+6212,U+63B4,U+642C,U+6627,U+66A6,U+66C7,U+66FD,U+674E,U+6B96,U+6C4E,U+6DF3,U+6E67,U+6F84,U+72FC,U+733F,U+7C97,U+7DB1,U+7E4D,U+816B,U+82D1,U+84CB,U+854E,U+8607,U+86C7,U+871C,U+8776,U+8A89,U+8FC4,U+91A4,U+9285,U+9685,U+9903,U+9B31,U+9F13,U+FF42,U+FF74,U+FF91}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.78.woff2)format("woff2");unicode-range:U+4E32,U+51DB,U+53A8,U+53EA,U+5609,U+5674,U+5A92,U+5E7E,U+6115,U+611A,U+62CC,U+62ED,U+63C9,U+64B9,U+64E6,U+65CB,U+6606,U+6731,U+683D,U+6AFB,U+7460,U+771E,U+78EF,U+7B26,U+7B51,U+7CDE,U+7D10,U+7D2F,U+7D46,U+80DE,U+819C,U+84B2,U+85CD,U+865A,U+8ECC,U+9022,U+90B8,U+9192,U+9675,U+96B7,U+99FF,U+FF44,U+FF55,U+FF6C,U+FF73,U+FF75,U+FF86,U+FF8D,U+FF92,U+FFE3}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.79.woff2)format("woff2");unicode-range:U+25B3,U+30F5,U+4EAE,U+4F46,U+4F51,U+5203,U+52FF,U+55A7,U+564C,U+565B,U+57F9,U+5805,U+5B64,U+5E06,U+5F70,U+5F90,U+60E8,U+6182,U+62F3,U+62FE,U+63AA,U+64A4,U+65D7,U+673A,U+6851,U+68CB,U+68DF,U+6D1E,U+6E58,U+6E9D,U+77B3,U+7832,U+7C3F,U+7DB4,U+7F70,U+80AA,U+80C6,U+8105,U+819D,U+8276,U+8679,U+8986,U+8C9D,U+8FC5,U+916C,U+9665,U+9699,U+96C0,U+9A19,U+FF8B}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.80.woff2)format("woff2");unicode-range:U+2463,U+25A1,U+4EF0,U+5076,U+5098,U+51FD,U+5302,U+5448,U+54C9,U+570B,U+583A,U+5893,U+58A8,U+58EE,U+5949,U+5BDB,U+5F26,U+5F81,U+6052,U+6170,U+61C7,U+631F,U+635C,U+664B,U+69FB,U+6F01,U+7070,U+722A,U+745E,U+755C,U+76C6,U+78C1,U+79E4,U+7BB8,U+7D0B,U+81A8,U+82D7,U+8B5C,U+8F14,U+8FB1,U+8FBB,U+9283,U+9298,U+9A30,U+FF03,U+FF50,U+FF59,U+FF7B,U+FF8E-FF8F}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.81.woff2)format("woff2");unicode-range:U+2010,U+2502,U+25B6,U+4F3A,U+514B,U+5265,U+52C3,U+5339,U+53EC,U+54C0,U+55B0,U+5854,U+5B8F,U+5CB3,U+5E84,U+60DA,U+6247,U+6249,U+628A,U+62CD,U+65AC,U+6838,U+690E,U+6CF0,U+6F02,U+6F2C,U+6F70,U+708A,U+7434,U+75BE,U+77EF,U+7C60,U+7C98,U+7D1B,U+7E2B,U+80A5,U+81E3,U+820C,U+8210,U+8475,U+862D,U+8650,U+8997,U+906D,U+91C8,U+9700,U+9727,U+9DF9,U+FF3A,U+FF9A}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.82.woff2)format("woff2");unicode-range:U+2103,U+5049,U+52B1,U+5320,U+5553,U+572D,U+58C7,U+5B5D,U+5BC2,U+5DE3,U+5E61,U+5F80,U+61A9,U+67D0,U+67F4,U+6C88,U+6CA1,U+6CE5,U+6D78,U+6E9C,U+6F54,U+731B,U+73B2,U+74A7,U+74F6,U+75E9,U+7B20,U+7C8B,U+7F72,U+809D,U+8108,U+82B3,U+82BD,U+84B8,U+84C4,U+88C2,U+8AE6,U+8EF8,U+902E,U+9065,U+9326,U+935B,U+938C,U+9676,U+9694,U+96F7,U+9ED9,U+FF48,U+FF4C,U+FF81}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.83.woff2)format("woff2");unicode-range:U+2500,U+3008-3009,U+4EAD,U+4F0F,U+4FCA,U+53EB,U+543E,U+57A2,U+5CF0,U+5E8F,U+5FE0,U+61B2,U+62D8,U+6442,U+64B2,U+6589,U+659C,U+67F1,U+68C4,U+6CB8,U+6D12,U+6DE1,U+6FE1,U+70C8,U+723D,U+73E0,U+7656,U+773A,U+7948,U+7B87,U+7C92,U+7D3A,U+7E1B,U+7E4A,U+819A,U+8358,U+83C5,U+84BC,U+864E,U+8912,U+8C9E,U+8D05,U+92FC,U+9396,U+98FD,U+99D2,U+FF64,U+FF7A,U+FF83}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.84.woff2)format("woff2");unicode-range:U+3014-3015,U+4E3C,U+5036,U+5075,U+533F,U+53E9,U+5531,U+5642,U+5984,U+59E6,U+5A01,U+5B6B,U+5C0B,U+5F25,U+6069,U+60A0,U+614E,U+62B5,U+62D2-62D3,U+6597,U+660C,U+674F,U+67CF,U+6841,U+6905,U+6CF3,U+6D32,U+6D69,U+6F64,U+716E,U+7761,U+7B52,U+7BE0,U+7DBF,U+7DE9,U+7F36,U+81D3,U+8302,U+8389,U+846C,U+84EE,U+8A69,U+9038,U+9D8F,U+FF47,U+FF4B,U+FF76,U+FF9B}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.85.woff2)format("woff2");unicode-range:U+25C7,U+3007,U+504F,U+507D,U+51A0,U+52A3,U+5410,U+5510,U+559A,U+5782,U+582A,U+5C0A,U+5C3F,U+5C48,U+5F6B,U+6176,U+622F,U+6279,U+62BD,U+62DD,U+65ED,U+67B6,U+6817,U+6850,U+6D6A,U+6DEB,U+6EA2,U+6EDD,U+6F5C,U+72E9,U+73A9,U+7573,U+76BF,U+7950,U+7956,U+7F8A,U+7FFC,U+80A2,U+80C3,U+83CA,U+8A02,U+8A13,U+8DF5,U+9375,U+983B,U+99B4,U+FF4E,U+FF71,U+FF89,U+FF97}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.86.woff2)format("woff2");unicode-range:U+24,U+2022,U+2212,U+221F,U+2665,U+4ECF,U+5100,U+51CD,U+52D8,U+5378,U+53F6,U+574A,U+5982,U+5996,U+5C1A,U+5E1D,U+5F84,U+609F,U+61A7,U+61F8,U+6398,U+63EE,U+6676,U+6691,U+6EB6,U+7126,U+71E5,U+7687,U+7965,U+7D17,U+80A1,U+8107,U+8266,U+85A6,U+8987,U+8CA2,U+8CAB,U+8E0A,U+9042,U+95C7,U+9810,U+9867,U+98FC,U+FF52-FF54,U+FF61,U+FF77,U+FF98-FF99}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.87.woff2)format("woff2");unicode-range:U+B0,U+226A,U+2462,U+4E39,U+4FC3,U+4FD7,U+50BE,U+50DA,U+5200,U+5211,U+54F2,U+5618,U+596A,U+5B22,U+5BB4,U+5D50,U+60A3,U+63FA,U+658E,U+65E8,U+6669,U+6795,U+679D,U+67A0,U+6B3A,U+6E09,U+757F,U+7CD6,U+7DBE,U+7FFB,U+83CC,U+83F1,U+840C,U+845B,U+8846,U+8972,U+8A34,U+8A50,U+8A87,U+8EDF,U+8FF0,U+90A6,U+9154,U+95A3,U+9663,U+9686,U+96C7,U+FF3C,U+FF7C,U+FF8A}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.88.woff2)format("woff2");unicode-range:U+25BD,U+4E59,U+4EC1,U+4FF3,U+515A,U+518A,U+525B,U+5375,U+552F,U+57A3,U+5B9C,U+5C3D,U+5E3D,U+5E7B,U+5F0A,U+6094,U+6458,U+654F,U+67F3,U+6B8A,U+6BD2,U+6C37,U+6CE1,U+6E56,U+6E7F,U+6ED1,U+6EDE,U+6F0F,U+70AD,U+7267,U+7363,U+786C,U+7A42,U+7DB2,U+7F85,U+8178,U+829D,U+8896,U+8C5A,U+8CB0,U+8CE2,U+8ED2,U+9047,U+9177,U+970A,U+9EA6,U+FF1B,U+FF31,U+FF39,U+FF80}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.89.woff2)format("woff2");unicode-range:U+A5,U+4E80,U+4F34,U+4F73,U+4F75,U+511F,U+5192,U+52AA,U+53C8,U+570F,U+57CB,U+596E,U+5D8B,U+5F66,U+5FD9,U+62DB,U+62F6,U+6328,U+633F,U+63A7,U+6469,U+6BBF,U+6C41,U+6C57,U+6D44,U+6DBC,U+706F,U+72C2,U+72ED,U+7551,U+75F4,U+7949,U+7E26,U+7FD4,U+8150,U+8AF8,U+8B0E,U+8B72,U+8CA7,U+934B,U+9A0E,U+9A12,U+9B42,U+FF41,U+FF43,U+FF45,U+FF49,U+FF4F,U+FF62-FF63}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.90.woff2)format("woff2");unicode-range:U+4E18,U+4FB5,U+5104,U+52C7,U+5353,U+5374,U+53E5,U+587E,U+594F,U+5A20,U+5DE1,U+5F18,U+5FCD,U+6291,U+62AB,U+6355,U+6392,U+63DA,U+63E1,U+656C,U+6687,U+68B0-68B1,U+68D2,U+68DA,U+6B27,U+6CBC,U+7159,U+7344,U+73CD,U+76DF,U+790E,U+7CF8,U+8102,U+88C1,U+8AA0,U+8E0F,U+9178,U+92AD,U+9670,U+96C5,U+9CF4,U+9DB4,U+FF3E,U+FF6F,U+FF72,U+FF78,U+FF7D,U+FF84,U+FF8C}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.91.woff2)format("woff2");unicode-range:U+60,U+2200,U+226B,U+2461,U+517C,U+526F,U+5800,U+5B97,U+5BF8,U+5C01,U+5D29,U+5E4C,U+5E81,U+6065,U+61D0,U+667A,U+6696,U+6843,U+6C99,U+6D99,U+6EC5,U+6F22,U+6F6E,U+6FA4,U+6FEF,U+71C3,U+72D9,U+7384,U+78E8,U+7A1A,U+7A32,U+7A3C,U+7ADC,U+7CA7,U+7D2B,U+7DAD,U+7E4B,U+80A9,U+8170,U+81ED,U+820E,U+8A17,U+8AFE,U+90AA,U+914E,U+963F,U+99C4,U+9EBA,U+9F3B,U+FF38}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.92.woff2)format("woff2");unicode-range:U+2460,U+4E5F,U+4E7E,U+4ED9,U+501F,U+502B,U+5968,U+5974,U+5AC1,U+5B99,U+5BA3,U+5BE7,U+5BE9,U+5C64,U+5CB8,U+5EC3,U+5F1F,U+616E,U+6297,U+62E0,U+62EC,U+6368,U+642D,U+65E6,U+6717,U+676F,U+6B04,U+732E,U+7652,U+76CA,U+76D7,U+7802,U+7E70,U+7F6A,U+8133,U+81E8,U+866B,U+878D,U+88F8,U+8A5E,U+8CDB,U+8D08,U+907A,U+90E1,U+96F2,U+9F8D,U+FF35,U+FF37,U+FF40,U+FF9D}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.93.woff2)format("woff2");unicode-range:U+21D2,U+25CE,U+300A-300B,U+4E89,U+4E9C,U+4EA1,U+5263,U+53CC,U+5426,U+5869,U+5947,U+598A,U+5999,U+5E55,U+5E72,U+5E79,U+5FAE,U+5FB9,U+602A,U+6163,U+624D,U+6749,U+6C5A,U+6CBF,U+6D45,U+6DFB,U+6E7E,U+708E,U+725B,U+7763,U+79C0,U+7BC4,U+7C89,U+7E01,U+7E2E,U+8010,U+8033,U+8C6A,U+8CC3,U+8F1D,U+8F9B,U+8FB2,U+907F,U+90F7,U+9707,U+9818,U+9B3C,U+FF0A,U+FF4D}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.94.woff2)format("woff2");unicode-range:U+2015,U+2190,U+4E43,U+5019,U+5247,U+52E7,U+5438,U+54B2,U+55AB,U+57F7,U+5BD2,U+5E8A,U+5EF6,U+6016,U+60B2,U+6162,U+6319,U+6551,U+6607,U+66B4,U+675F,U+67D4,U+6B20,U+6B53,U+6CE3,U+719F,U+75B2,U+770B,U+7720,U+77AC,U+79D2,U+7AF9,U+7D05,U+7DCA,U+8056,U+80F8,U+81F3,U+8352,U+885D,U+8A70,U+8AA4,U+8CBC,U+900F,U+9084,U+91E3,U+9451,U+96C4,U+99C6,U+9AD4,U+FF70}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.95.woff2)format("woff2");unicode-range:U+2193,U+25B2,U+4E4B,U+516D,U+51C4,U+529F,U+52C9,U+5360,U+5442,U+5857,U+5915,U+59EB,U+5A9B,U+5C3B,U+6012,U+61B6,U+62B1,U+6311,U+6577,U+65E2,U+65EC,U+6613,U+6790,U+6CB9,U+7372,U+76AE,U+7D5E,U+7FCC,U+88AB,U+88D5,U+8CAF,U+8DDD,U+8ECD,U+8F38,U+8F9E,U+8FEB,U+9063,U+90F5,U+93E1,U+968A,U+968F,U+98FE,U+9EC4,U+FF1D,U+FF27,U+FF2A,U+FF36,U+FF3B,U+FF3D,U+FFE5}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.96.woff2)format("woff2");unicode-range:U+4E03,U+4F38,U+50B7,U+5264,U+5348,U+5371,U+585A,U+58CA,U+5951,U+59B9,U+59D4,U+5B98,U+5F8B,U+6388,U+64CD,U+65E7,U+6803,U+6B6F,U+6D66,U+6E0B,U+6ECB,U+6FC3,U+72AC,U+773C,U+77E2,U+7968,U+7A74,U+7DBA,U+7DD1,U+7E3E,U+808C,U+811A,U+8179,U+8239,U+8584,U+8A0E,U+8A72,U+8B66,U+8C46,U+8F29,U+90A3,U+9234,U+96F0,U+9769,U+9774,U+9AA8,U+FF26,U+FF28,U+FF9E-FF9F}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.97.woff2)format("woff2");unicode-range:U+7E,U+B4,U+25C6,U+2661,U+4E92,U+4EEE,U+4FFA,U+5144,U+5237,U+5287,U+52B4,U+58C1,U+5BFF,U+5C04,U+5C06,U+5E95,U+5F31,U+5F93,U+63C3,U+640D,U+6557,U+6614,U+662F,U+67D3,U+690D,U+6BBA,U+6E6F,U+72AF,U+732B,U+7518,U+7AE0,U+7AE5,U+7AF6,U+822A,U+89E6,U+8A3A,U+8A98,U+8CB8,U+8DE1,U+8E8D,U+95D8,U+961C,U+96A3,U+96EA,U+9BAE,U+FF20,U+FF22,U+FF29,U+FF2B-FF2C}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.98.woff2)format("woff2");unicode-range:U+25CB,U+4E71,U+4F59,U+50D5,U+520A,U+5217,U+5230,U+523A-523B,U+541B,U+5439,U+5747,U+59C9,U+5BDF,U+5C31,U+5DE8,U+5E7C,U+5F69,U+6050,U+60D1,U+63CF,U+663C,U+67C4,U+6885,U+6C38,U+6D6E,U+6DB2,U+6DF7,U+6E2C,U+6F5F,U+7532,U+76E3-76E4,U+7701,U+793C,U+79F0,U+7A93,U+7D00,U+7DE0,U+7E54,U+8328,U+8840,U+969C,U+96E8,U+9811,U+9AEA,U+9B5A,U+FF24,U+FF2E,U+FF57}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.99.woff2)format("woff2");unicode-range:U+2191,U+505C,U+52E4,U+5305,U+535A,U+56E0,U+59BB,U+5ACC,U+5B09,U+5B87,U+5C90,U+5DF1,U+5E2D,U+5E33,U+5F3E,U+6298,U+6383,U+653B,U+6697,U+6804,U+6A39,U+6CCA,U+6E90,U+6F2B,U+702C,U+7206,U+7236,U+7559,U+7565,U+7591,U+75C7,U+75DB,U+7B4B,U+7BB1,U+7D99,U+7FBD,U+8131,U+885B,U+8B1D,U+8FF7,U+9003,U+9045,U+96A0,U+9732,U+990A,U+99D0,U+9E97,U+9F62,U+FF25,U+FF2D}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.100.woff2)format("woff2");unicode-range:U+4E08,U+4F9D,U+5012,U+514D,U+51B7,U+5275,U+53CA,U+53F8,U+5584,U+57FC,U+5B9D,U+5BFA,U+5C3E,U+5F01,U+5FB4,U+5FD7,U+606F,U+62E1,U+6563,U+6674,U+6CB3,U+6D3E,U+6D74,U+6E1B,U+6E2F,U+718A,U+7247,U+79D8,U+7D14,U+7D66,U+7D71,U+7DF4,U+7E41,U+80CC,U+8155,U+83D3,U+8A95,U+8AB2,U+8AD6,U+8CA1,U+9000,U+9006,U+9678,U+97D3,U+9808,U+98EF,U+9A5A,U+9B45,U+FF23,U+FF30}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.101.woff2)format("woff2");unicode-range:U+25BC,U+3012,U+4EF2,U+4F0A,U+516B,U+5373,U+539A,U+53B3,U+559C,U+56F0,U+5727,U+5742,U+5965,U+59FF,U+5BC6,U+5DFB,U+5E45,U+5EAD,U+5FB3,U+6211,U+6253,U+639B,U+63A8,U+6545,U+6575,U+6628,U+672D,U+68A8,U+6BDB,U+6D25,U+707D,U+767E,U+7834,U+7B46,U+7BC9,U+8074,U+82E6,U+8349,U+8A2A,U+8D70,U+8DA3,U+8FCE,U+91CC,U+967D,U+97FF,U+9996,U+FF1C,U+FF2F,U+FF32,U+FF34}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.102.woff2)format("woff2");unicode-range:U+3D,U+5E,U+25CF,U+4E0E,U+4E5D,U+4E73,U+4E94,U+4F3C,U+5009,U+5145,U+51AC,U+5238,U+524A,U+53F3,U+547C,U+5802,U+5922,U+5A66,U+5C0E,U+5DE6,U+5FD8,U+5FEB,U+6797,U+685C,U+6B7B,U+6C5F-6C60,U+6CC9,U+6CE2,U+6D17,U+6E21,U+7167,U+7642,U+76DB,U+8001,U+821E,U+8857,U+89D2,U+8B1B,U+8B70,U+8CB4,U+8CDE,U+8F03,U+8F2A,U+968E,U+9B54,U+9E7F,U+9EBB,U+FF05,U+FF33}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.103.woff2)format("woff2");unicode-range:U+500D,U+5074,U+50CD,U+5175,U+52E2,U+5352,U+5354,U+53F2,U+5409,U+56FA,U+5A18,U+5B88,U+5BDD,U+5CA9,U+5F92,U+5FA9,U+60A9,U+623F,U+6483,U+653F,U+666F,U+66AE,U+66F2,U+6A21,U+6B66,U+6BCD,U+6D5C,U+796D,U+7A4D,U+7AEF,U+7B56,U+7B97,U+7C4D,U+7E04,U+7FA9,U+8377,U+83DC,U+83EF,U+8535,U+8863,U+88CF,U+88DC,U+8907,U+8ACB,U+90CE,U+91DD,U+FF0B,U+FF0D,U+FF19,U+FF65}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.104.woff2)format("woff2");unicode-range:U+4E01,U+4E21,U+4E38,U+52A9,U+547D,U+592E,U+5931,U+5B63,U+5C40,U+5DDE,U+5E78,U+5EFA,U+5FA1,U+604B,U+6075,U+62C5,U+632F,U+6A19,U+6C0F,U+6C11,U+6C96,U+6E05,U+70BA,U+71B1,U+7387,U+7403,U+75C5,U+77ED,U+795D,U+7B54,U+7CBE,U+7D19,U+7FA4,U+8089,U+81F4,U+8208,U+8336,U+8457,U+8A33,U+8C4A,U+8CA0,U+8CA8,U+8CC0,U+9014,U+964D,U+9803,U+983C,U+98DB,U+FF17,U+FF21}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.105.woff2)format("woff2");unicode-range:U+25,U+25A0,U+4E26,U+4F4E,U+5341,U+56F2,U+5BBF,U+5C45,U+5C55,U+5C5E,U+5DEE,U+5E9C,U+5F7C,U+6255,U+627F,U+62BC,U+65CF,U+661F,U+666E,U+66DC,U+67FB,U+6975,U+6A4B,U+6B32,U+6DF1,U+6E29,U+6FC0,U+738B,U+7686,U+7A76,U+7A81,U+7C73,U+7D75,U+7DD2,U+82E5,U+82F1,U+85AC,U+888B,U+899A,U+8A31,U+8A8C,U+8AB0,U+8B58,U+904A,U+9060,U+9280,U+95B2,U+984D,U+9CE5,U+FF18}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.106.woff2)format("woff2");unicode-range:U+30F6,U+50AC,U+5178,U+51E6,U+5224,U+52DD,U+5883,U+5897,U+590F,U+5A5A,U+5BB3,U+5C65,U+5E03,U+5E2B,U+5E30,U+5EB7,U+6271,U+63F4,U+64AE,U+6574,U+672B,U+679A,U+6A29-6A2A,U+6CA2,U+6CC1,U+6D0B,U+713C,U+74B0,U+7981,U+7A0B,U+7BC0,U+7D1A,U+7D61,U+7FD2,U+822C,U+8996,U+89AA,U+8CAC,U+8CBB,U+8D77,U+8DEF,U+9020,U+9152,U+9244,U+9662,U+967A,U+96E3,U+9759,U+FF16}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.107.woff2)format("woff2");unicode-range:U+23,U+3C,U+2192,U+4E45,U+4EFB,U+4F50,U+4F8B,U+4FC2,U+5024,U+5150,U+5272,U+5370,U+53BB,U+542B,U+56DB,U+56E3,U+57CE,U+5BC4,U+5BCC,U+5F71,U+60AA,U+6238,U+6280,U+629C,U+6539,U+66FF,U+670D,U+677E-677F,U+6839,U+69CB,U+6B4C,U+6BB5,U+6E96,U+6F14,U+72EC,U+7389,U+7814,U+79CB,U+79D1,U+79FB,U+7A0E,U+7D0D,U+85E4,U+8D64,U+9632,U+96E2,U+9805,U+99AC,U+FF1E}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.108.woff2)format("woff2");unicode-range:U+2605-2606,U+301C,U+4E57,U+4FEE,U+5065,U+52DF,U+533B,U+5357,U+57DF,U+58EB,U+58F0,U+591C,U+592A-592B,U+5948,U+5B85,U+5D0E,U+5EA7,U+5FF5,U+6025,U+63A1,U+63A5,U+63DB,U+643A,U+65BD,U+671D,U+68EE,U+6982,U+6B73,U+6BD4,U+6D88,U+7570,U+7B11,U+7D76,U+8077,U+8217,U+8C37,U+8C61,U+8CC7,U+8D85,U+901F,U+962A,U+9802,U+9806,U+9854,U+98F2,U+9928,U+99C5,U+9ED2}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.109.woff2)format("woff2");unicode-range:U+266A,U+4F11,U+533A,U+5343,U+534A,U+53CD,U+5404,U+56F3,U+5B57-5B58,U+5BAE,U+5C4A,U+5E0C,U+5E2F,U+5EAB,U+5F35,U+5F79,U+614B,U+6226,U+629E,U+65C5,U+6625,U+6751,U+6821,U+6B69,U+6B8B,U+6BCE,U+6C42,U+706B,U+7C21,U+7CFB,U+805E,U+80B2,U+82B8,U+843D,U+8853,U+88C5,U+8A3C,U+8A66,U+8D8A,U+8FBA,U+9069,U+91CF,U+9752,U+975E,U+9999,U+FF0F-FF10,U+FF14-FF15}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.110.woff2)format("woff2");unicode-range:U+40,U+4E86,U+4E95,U+4F01,U+4F1D,U+4FBF,U+5099,U+5171,U+5177,U+53CB,U+53CE,U+53F0,U+5668,U+5712,U+5BA4,U+5CA1,U+5F85,U+60F3,U+653E,U+65AD,U+65E9,U+6620,U+6750,U+6761,U+6B62,U+6B74,U+6E08,U+6E80,U+7248,U+7531,U+7533,U+753A,U+77F3,U+798F,U+7F6E,U+8449,U+88FD,U+89B3,U+8A55,U+8AC7,U+8B77,U+8DB3,U+8EFD,U+8FD4,U+9031-9032,U+9580,U+9589,U+96D1,U+985E}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.111.woff2)format("woff2");unicode-range:U+2B,U+D7,U+300E-300F,U+4E07,U+4E8C,U+512A,U+5149,U+518D,U+5236,U+52B9,U+52D9,U+5468,U+578B,U+57FA,U+5B8C,U+5BA2,U+5C02,U+5DE5,U+5F37,U+5F62,U+623B,U+63D0,U+652F,U+672A,U+6848,U+6D41,U+7136,U+7537,U+754C,U+76F4,U+79C1,U+7BA1,U+7D44,U+7D4C,U+7DCF,U+7DDA,U+7DE8,U+82B1,U+897F,U+8CA9,U+8CFC,U+904E,U+9664,U+982D,U+9858,U+98A8,U+9A13,U+FF13,U+FF5C}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.112.woff2)format("woff2");unicode-range:U+4E16,U+4E3B,U+4EA4,U+4EE4,U+4F4D,U+4F4F,U+4F55,U+4F9B,U+5317,U+5358,U+53C2,U+53E4,U+548C,U+571F,U+59CB,U+5CF6,U+5E38,U+63A2,U+63B2,U+6559,U+662D,U+679C,U+6C7A,U+72B6,U+7523,U+767D,U+770C,U+7A2E,U+7A3F,U+7A7A,U+7B2C,U+7B49,U+7D20,U+7D42,U+8003,U+8272,U+8A08,U+8AAC,U+8CB7,U+8EAB,U+8EE2,U+9054-9055,U+90FD,U+914D,U+91CD,U+969B,U+97F3,U+984C,U+FF06}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.113.woff2)format("woff2");unicode-range:U+26,U+5F,U+2026,U+203B,U+4E09,U+4EAC,U+4ED5,U+4FA1,U+5143,U+5199,U+5207,U+539F,U+53E3,U+53F7,U+5411,U+5473,U+5546,U+55B6,U+5929,U+597D,U+5BB9,U+5C11,U+5C4B,U+5DDD,U+5F97,U+5FC5,U+6295,U+6301,U+6307,U+671B,U+76F8,U+78BA,U+795E,U+7D30,U+7D39,U+7D9A,U+89E3,U+8A00,U+8A73,U+8A8D,U+8A9E,U+8AAD,U+8ABF,U+8CEA,U+8ECA,U+8FFD,U+904B,U+9650,U+FF11-FF12}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.114.woff2)format("woff2");unicode-range:U+3E,U+3005,U+4E0D,U+4E88,U+4ECB,U+4EE3,U+4EF6,U+4FDD,U+4FE1,U+500B,U+50CF,U+5186,U+5316,U+53D7,U+540C,U+544A,U+54E1,U+5728,U+58F2,U+5973,U+5B89,U+5C71,U+5E02,U+5E97,U+5F15,U+5FC3,U+5FDC,U+601D,U+611B,U+611F,U+671F,U+6728,U+6765,U+683C,U+6B21,U+6CE8,U+6D3B,U+6D77,U+7530,U+7740,U+7ACB,U+7D50,U+826F,U+8F09,U+8FBC,U+9001,U+9053,U+91CE,U+9762,U+98DF}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.115.woff2)format("woff2");unicode-range:U+7C,U+3080,U+4EE5,U+5148,U+516C,U+521D,U+5225,U+529B,U+52A0,U+53EF,U+56DE,U+56FD,U+5909,U+591A,U+5B66,U+5B9F,U+5BB6,U+5BFE,U+5E73,U+5E83,U+5EA6,U+5F53,U+6027,U+610F,U+6210,U+6240,U+660E,U+66F4,U+66F8,U+6709,U+6771,U+697D,U+69D8,U+6A5F,U+6C34,U+6CBB,U+73FE,U+756A,U+7684,U+771F,U+793A,U+7F8E,U+898F,U+8A2D,U+8A71,U+8FD1,U+9078,U+9577,U+96FB,U+FF5E}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.116.woff2)format("woff2");unicode-range:U+A9,U+3010-3011,U+30E2,U+4E0B,U+4ECA,U+4ED6,U+4ED8,U+4F53,U+4F5C,U+4F7F,U+53D6,U+540D,U+54C1,U+5730,U+5916,U+5B50,U+5C0F,U+5F8C,U+624B,U+6570,U+6587,U+6599,U+691C,U+696D,U+6CD5,U+7269,U+7279,U+7406,U+767A-767B,U+77E5,U+7D04,U+7D22,U+8005,U+80FD,U+81EA,U+8868,U+8981,U+89A7,U+901A,U+9023,U+90E8,U+91D1,U+9332,U+958B,U+96C6,U+9AD8,U+FF1A,U+FF1F}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.117.woff2)format("woff2");unicode-range:U+4E,U+A0,U+3000,U+300C-300D,U+4E00,U+4E0A,U+4E2D,U+4E8B,U+4EBA,U+4F1A,U+5165,U+5168,U+5185,U+51FA,U+5206,U+5229,U+524D,U+52D5,U+5408,U+554F,U+5831,U+5834,U+5927,U+5B9A,U+5E74,U+5F0F,U+60C5,U+65B0,U+65B9,U+6642,U+6700,U+672C,U+682A,U+6B63,U+6C17,U+7121,U+751F,U+7528,U+753B,U+76EE,U+793E,U+884C,U+898B,U+8A18,U+9593,U+95A2,U+FF01,U+FF08-FF09}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.118.woff2)format("woff2");unicode-range:U+21-22,U+27-2A,U+2C-3B,U+3F,U+41-4D,U+4F-5D,U+61-7B,U+7D,U+AB,U+AE,U+B2-B3,U+B7,U+BB,U+C9,U+CD,U+D6,U+D8,U+DC,U+E0-E5,U+E7-ED,U+EF,U+F1-F4,U+F6,U+F8,U+FA,U+FC-FD,U+103,U+14D,U+1B0,U+300-301,U+1EBF,U+1EC7,U+2013-2014,U+201C-201D,U+2039-203A,U+203C,U+2048-2049,U+2113,U+2122,U+65E5,U+6708,U+70B9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.119.woff2)format("woff2");unicode-range:U+20,U+2027,U+3001-3002,U+3041-307F,U+3081-308F,U+3091-3093,U+3099-309A,U+309D-309E,U+30A1-30E1,U+30E3-30ED,U+30EF-30F0,U+30F2-30F4,U+30FB-30FE,U+FF0C,U+FF0E}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6omwqRfTHxT624.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6okQqRfTHxT624.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6onwqRfTHxTw.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.0.woff2)format("woff2");unicode-range:U+25EE8,U+25F23,U+25F5C,U+25FD4,U+25FE0,U+25FFB,U+2600C,U+26017,U+26060,U+260ED,U+26222,U+2626A,U+26270,U+26286,U+2634C,U+26402,U+2667E,U+266B0,U+2671D,U+268DD,U+268EA,U+26951,U+2696F,U+26999,U+269DD,U+26A1E,U+26A58,U+26A8C,U+26AB7,U+26AFF,U+26C29,U+26C73,U+26C9E,U+26CDD,U+26E40,U+26E65,U+26F94,U+26FF6-26FF8,U+270F4,U+2710D,U+27139,U+273DA-273DB,U+273FE,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770E,U+27723,U+27752,U+278B2,U+27985,U+279B4,U+27A84,U+27BB3,U+27BBE,U+27BC7,U+27C3C,U+27CB8,U+27D73,U+27DA0,U+27E10,U+27EAF,U+27FB7,U+2808A,U+280BB,U+28277,U+28282,U+282F3,U+283CD,U+2840C,U+28455,U+284DC,U+2856B,U+285C8-285C9,U+286D7,U+286FA,U+28946,U+28949,U+2896B,U+28987-28988,U+289BA-289BB,U+28A1E,U+28A29,U+28A43,U+28A71,U+28A99,U+28ACD,U+28ADD,U+28AE4,U+28BC1,U+28BEF,U+28CDD,U+28D10,U+28D71,U+28DFB,U+28E0F,U+28E17,U+28E1F,U+28E36,U+28E89,U+28EEB,U+28EF6,U+28F32,U+28FF8,U+292A0,U+292B1,U+29490,U+295CF,U+2967F,U+296F0,U+29719,U+29750,U+29810,U+298C6,U+29A72,U+29D4B,U+29DDB,U+29E15,U+29E3D,U+29E49,U+29E8A,U+29EC4,U+29EDB,U+29EE9,U+29FCE,U+29FD7,U+2A01A,U+2A02F,U+2A082,U+2A0F9,U+2A190,U+2A2B2,U+2A38C,U+2A437,U+2A5F1,U+2A602,U+2A61A,U+2A6B2,U+2A9E6,U+2B746,U+2B751,U+2B753,U+2B75A,U+2B75C,U+2B765,U+2B776-2B777,U+2B77C,U+2B782,U+2B789,U+2B78B,U+2B78E,U+2B794,U+2B7AC,U+2B7AF,U+2B7BD,U+2B7C9,U+2B7CF,U+2B7D2,U+2B7D8,U+2B7F0,U+2B80D,U+2B817,U+2B81A,U+2D544,U+2E278,U+2E569,U+2E6EA,U+2F804,U+2F80F,U+2F815,U+2F818,U+2F81A,U+2F822,U+2F828,U+2F82C,U+2F833,U+2F83F,U+2F846,U+2F852,U+2F862,U+2F86D,U+2F873,U+2F877,U+2F884,U+2F899-2F89A,U+2F8A6,U+2F8AC,U+2F8B2,U+2F8B6,U+2F8D3,U+2F8DB-2F8DC,U+2F8E1,U+2F8E5,U+2F8EA,U+2F8ED,U+2F8FC,U+2F903,U+2F90B,U+2F90F,U+2F91A,U+2F920-2F921,U+2F945,U+2F947,U+2F96C,U+2F995,U+2F9D0,U+2F9DE-2F9DF,U+2F9F4}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.1.woff2)format("woff2");unicode-range:U+1F235-1F23B,U+1F240-1F248,U+1F250-1F251,U+2000B,U+20089-2008A,U+200A2,U+200A4,U+200B0,U+200F5,U+20158,U+201A2,U+20213,U+2032B,U+20371,U+20381,U+203F9,U+2044A,U+20509,U+2053F,U+205B1,U+205D6,U+20611,U+20628,U+206EC,U+2074F,U+207C8,U+20807,U+2083A,U+208B9,U+2090E,U+2097C,U+20984,U+2099D,U+20A64,U+20AD3,U+20B1D,U+20B9F,U+20BB7,U+20D45,U+20D58,U+20DE1,U+20E64,U+20E6D,U+20E95,U+20F5F,U+21201,U+2123D,U+21255,U+21274,U+2127B,U+212D7,U+212E4,U+212FD,U+2131B,U+21336,U+21344,U+213C4,U+2146D-2146E,U+215D7,U+21647,U+216B4,U+21706,U+21742,U+218BD,U+219C3,U+21A1A,U+21C56,U+21D2D,U+21D45,U+21D62,U+21D78,U+21D92,U+21D9C,U+21DA1,U+21DB7,U+21DE0,U+21E33-21E34,U+21F1E,U+21F76,U+21FFA,U+2217B,U+22218,U+2231E,U+223AD,U+22609,U+226F3,U+2285B,U+228AB,U+2298F,U+22AB8,U+22B46,U+22B4F-22B50,U+22BA6,U+22C1D,U+22C24,U+22DE1,U+22E42,U+22FEB,U+231B6,U+231C3-231C4,U+231F5,U+23372,U+233CC,U+233D0,U+233D2-233D3,U+233D5,U+233DA,U+233DF,U+233E4,U+233FE,U+2344A-2344B,U+23451,U+23465,U+234E4,U+2355A,U+23594,U+235C4,U+23638-2363A,U+23647,U+2370C,U+2371C,U+2373F,U+23763-23764,U+237E7,U+237F1,U+237FF,U+23824,U+2383D,U+23A98,U+23C7F,U+23CBE,U+23CFE,U+23D00,U+23D0E,U+23D40,U+23DD3,U+23DF9-23DFA,U+23F7E,U+2404B,U+24096,U+24103,U+241C6,U+241FE,U+242EE,U+243BC,U+243D0,U+24629,U+246A5,U+247F1,U+24896,U+248E9,U+24A4D,U+24B56,U+24B6F,U+24C16,U+24D14,U+24E04,U+24E0E,U+24E37,U+24E6A,U+24E8B,U+24FF2,U+2504A,U+25055,U+25122,U+251A9,U+251CD,U+251E5,U+2521E,U+2524C,U+2542E,U+2548E,U+254D9,U+2550E,U+255A7,U+2567F,U+25771,U+257A9,U+257B4,U+25874,U+259C4,U+259CC,U+259D4,U+25AD7,U+25AE3-25AE4,U+25AF1,U+25BB2,U+25C4B,U+25C64,U+25DA1,U+25E2E,U+25E56,U+25E62,U+25E65,U+25EC2,U+25ED8}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.2.woff2)format("woff2");unicode-range:U+FFD7,U+FFDA-FFDC,U+FFE0-FFE2,U+FFE4,U+FFE6,U+FFE8-FFEE,U+1F100-1F10C,U+1F110-1F16C,U+1F170-1F1AC,U+1F200-1F202,U+1F210-1F234}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.3.woff2)format("woff2");unicode-range:U+FA10,U+FA12-FA6D,U+FB00-FB04,U+FE10-FE19,U+FE30-FE42,U+FE44-FE52,U+FE54-FE66,U+FE68-FE6B,U+FF02,U+FF04,U+FF07,U+FF51,U+FF5B,U+FF5D,U+FF5F-FF60,U+FF66,U+FF69,U+FF87,U+FFA1-FFBE,U+FFC2-FFC7,U+FFCA-FFCF,U+FFD2-FFD6}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.5.woff2)format("woff2");unicode-range:U+9E8B-9E8C,U+9E8E-9E8F,U+9E91-9E92,U+9E95-9E96,U+9E98,U+9E9B,U+9E9D-9E9E,U+9EA4-9EA5,U+9EA8-9EAA,U+9EAC-9EB0,U+9EB3-9EB5,U+9EB8,U+9EBC-9EBF,U+9EC3,U+9EC6,U+9EC8,U+9ECB-9ECD,U+9ECF-9ED1,U+9ED4-9ED5,U+9ED8,U+9EDB-9EE0,U+9EE4-9EE5,U+9EE7-9EE8,U+9EEC-9EF2,U+9EF4-9EF9,U+9EFB-9EFF,U+9F02-9F03,U+9F07-9F09,U+9F0E-9F12,U+9F14-9F17,U+9F19-9F1B,U+9F1F-9F22,U+9F26,U+9F2A-9F2C,U+9F2F,U+9F31-9F32,U+9F34,U+9F37,U+9F39-9F3A,U+9F3C-9F3F,U+9F41,U+9F43-9F47,U+9F4A,U+9F4E-9F50,U+9F52-9F58,U+9F5A,U+9F5D-9F61,U+9F63,U+9F66-9F6A,U+9F6C-9F73,U+9F75-9F77,U+9F7A,U+9F7D,U+9F7F,U+9F8F-9F92,U+9F94-9F97,U+9F99,U+9F9C-9FA3,U+9FA5,U+9FB4,U+9FBC-9FC2,U+9FC4,U+9FC6,U+9FCC,U+F900-F92C}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.6.woff2)format("woff2");unicode-range:U+9C3E,U+9C41,U+9C43-9C4A,U+9C4E-9C50,U+9C52-9C54,U+9C56,U+9C58,U+9C5A-9C61,U+9C63,U+9C65,U+9C67-9C6B,U+9C6D-9C6E,U+9C70,U+9C72,U+9C75-9C78,U+9C7A-9C7C,U+9CE6-9CE7,U+9CEB-9CEC,U+9CF0,U+9CF2,U+9CF6-9CF7,U+9CF9,U+9D02-9D03,U+9D06-9D09,U+9D0B,U+9D0E,U+9D11-9D12,U+9D15,U+9D17-9D18,U+9D1B-9D1F,U+9D23,U+9D26,U+9D2A-9D2C,U+9D2F-9D30,U+9D32-9D34,U+9D3A,U+9D3C-9D3F,U+9D41-9D48,U+9D4A,U+9D50-9D54,U+9D59,U+9D5D-9D65,U+9D69-9D6C,U+9D6F-9D70,U+9D72-9D73,U+9D76-9D77,U+9D7A-9D7C,U+9D7E,U+9D83-9D84,U+9D86-9D87,U+9D89-9D8A,U+9D8D-9D8E,U+9D92-9D93,U+9D95-9D9A,U+9DA1,U+9DA4,U+9DA9-9DAC,U+9DAE,U+9DB1-9DB2,U+9DB5,U+9DB8-9DBD,U+9DBF-9DC4,U+9DC6-9DC7,U+9DC9-9DCA,U+9DCF,U+9DD3-9DD7,U+9DD9-9DDA,U+9DDE-9DE0,U+9DE3,U+9DE5-9DE7,U+9DE9,U+9DEB,U+9DED-9DF0,U+9DF3-9DF4,U+9DF8,U+9DFD-9DFE,U+9E02,U+9E07,U+9E0A,U+9E0D-9E0E,U+9E10-9E12,U+9E15-9E16,U+9E19-9E1F,U+9E75,U+9E79-9E7D,U+9E80-9E85,U+9E87-9E88}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.7.woff2)format("woff2");unicode-range:U+9AE5-9AE7,U+9AE9,U+9AEB-9AEC,U+9AEE-9AEF,U+9AF1-9AF5,U+9AF7,U+9AF9-9AFB,U+9AFD,U+9AFF-9B06,U+9B08-9B09,U+9B0B-9B0E,U+9B10,U+9B12,U+9B16,U+9B18-9B1D,U+9B1F-9B20,U+9B22-9B23,U+9B25-9B2F,U+9B32-9B35,U+9B37,U+9B39-9B3B,U+9B3D,U+9B43-9B44,U+9B48,U+9B4B-9B4F,U+9B51,U+9B55-9B58,U+9B5B,U+9B5E,U+9B61,U+9B63,U+9B65-9B66,U+9B68,U+9B6A-9B6F,U+9B72-9B79,U+9B7F-9B80,U+9B83-9B87,U+9B89-9B8B,U+9B8D,U+9B8F-9B94,U+9B96-9B97,U+9B9A,U+9B9D-9BA0,U+9BA6-9BA7,U+9BA9-9BAA,U+9BAC,U+9BB0-9BB2,U+9BB4,U+9BB7-9BB9,U+9BBB-9BBC,U+9BBE-9BC1,U+9BC6-9BC8,U+9BCA,U+9BCE-9BD2,U+9BD4,U+9BD7-9BD8,U+9BDD,U+9BDF,U+9BE1-9BE5,U+9BE7,U+9BEA-9BEB,U+9BEE-9BF3,U+9BF5,U+9BF7-9BFA,U+9BFD,U+9BFF-9C00,U+9C02,U+9C04,U+9C06,U+9C08-9C0D,U+9C0F-9C16,U+9C18-9C1E,U+9C21-9C2A,U+9C2D-9C32,U+9C35-9C37,U+9C39-9C3A,U+9C3D}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.8.woff2)format("woff2");unicode-range:U+98EB,U+98ED-98EE,U+98F0-98F1,U+98F3,U+98F6,U+9902,U+9907-9909,U+9911-9912,U+9914-9918,U+991A-9922,U+9924,U+9926-9927,U+992B-992C,U+992E,U+9931-9935,U+9939-993E,U+9940-9942,U+9945-9949,U+994B-994E,U+9950-9952,U+9954-9955,U+9958-9959,U+995B-995C,U+995E-9960,U+9963,U+9997-9998,U+999B,U+999D-999F,U+99A3,U+99A5-99A6,U+99A8,U+99AD-99AE,U+99B0-99B2,U+99B5,U+99B9-99BA,U+99BC-99BD,U+99BF,U+99C1,U+99C3,U+99C8-99C9,U+99D1,U+99D3-99D5,U+99D8-99DF,U+99E1-99E2,U+99E7,U+99EA-99EE,U+99F0-99F2,U+99F4-99F5,U+99F8-99F9,U+99FB-99FE,U+9A01-9A05,U+9A08,U+9A0A-9A0C,U+9A0F-9A11,U+9A16,U+9A1A,U+9A1E,U+9A20,U+9A22-9A24,U+9A27,U+9A2B,U+9A2D-9A2E,U+9A31,U+9A33,U+9A35-9A38,U+9A3E,U+9A40-9A45,U+9A47,U+9A4A-9A4E,U+9A51-9A52,U+9A54-9A58,U+9A5B,U+9A5D,U+9A5F,U+9A62,U+9A64-9A65,U+9A69-9A6C,U+9AAA,U+9AAC-9AB0,U+9AB2,U+9AB4-9AB7,U+9AB9,U+9ABB-9AC1,U+9AC3,U+9AC6,U+9AC8,U+9ACE-9AD3,U+9AD5-9AD7,U+9ADB-9ADC,U+9ADE-9AE0,U+9AE2-9AE4}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.9.woff2)format("woff2");unicode-range:U+971D,U+9721-9724,U+9728,U+972A,U+9730-9731,U+9733,U+9736,U+9738-9739,U+973B,U+973D-973E,U+9741-9744,U+9746-974A,U+974D-974F,U+9751,U+9755,U+9757-9758,U+975A-975C,U+9760-9761,U+9763-9764,U+9766-9768,U+976A-976B,U+976E,U+9771,U+9773,U+9776-977D,U+977F-9781,U+9785-9786,U+9789,U+978B,U+978F-9790,U+9795-9797,U+9799-979A,U+979C,U+979E-97A0,U+97A2-97A3,U+97A6,U+97A8,U+97AB-97AC,U+97AE,U+97B1-97B6,U+97B8-97BA,U+97BC,U+97BE-97BF,U+97C1,U+97C3-97CE,U+97D0-97D1,U+97D4,U+97D7-97D9,U+97DB-97DE,U+97E0-97E1,U+97E4,U+97E6,U+97ED-97EF,U+97F1-97F2,U+97F4-97F8,U+97FA,U+9804,U+9807,U+980A,U+980C-980F,U+9814,U+9816-9817,U+9819-981A,U+981C,U+981E,U+9820-9821,U+9823-9826,U+982B,U+982E-9830,U+9832-9835,U+9837,U+9839,U+983D-983E,U+9844,U+9846-9847,U+984A-984B,U+984F,U+9851-9853,U+9856-9857,U+9859-985B,U+9862-9863,U+9865-9866,U+986A-986C,U+986F-9871,U+9873-9875,U+98AA-98AB,U+98AD-98AE,U+98B0-98B1,U+98B4,U+98B6-98B8,U+98BA-98BC,U+98BF,U+98C2-98C8,U+98CB-98CC,U+98CE,U+98DC,U+98DE,U+98E0-98E1,U+98E3,U+98E5-98E7,U+98E9-98EA}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.10.woff2)format("woff2");unicode-range:U+944A,U+944C,U+9452-9453,U+9455,U+9459-945C,U+945E-9463,U+9468,U+946A-946B,U+946D-9472,U+9475,U+9477,U+947C-947F,U+9481,U+9483-9485,U+9578-9579,U+957E-957F,U+9582,U+9584,U+9586-9588,U+958A,U+958C-958F,U+9592,U+9594,U+9596,U+9598-9599,U+959D-95A1,U+95A4,U+95A6-95A9,U+95AB-95AD,U+95B1,U+95B4,U+95B6,U+95B9-95BF,U+95C3,U+95C6,U+95C8-95CD,U+95D0-95D6,U+95D9-95DA,U+95DC-95E2,U+95E4-95E6,U+95E8,U+961D-961E,U+9621-9622,U+9624-9626,U+9628,U+962C,U+962E-962F,U+9631,U+9633-9634,U+9637-963A,U+963C-963D,U+9641-9642,U+964B-964C,U+964F,U+9652,U+9654,U+9656-9658,U+965C-965F,U+9661,U+9666,U+966A,U+966C,U+966E,U+9672,U+9674,U+9677,U+967B-967C,U+967E-967F,U+9681-9684,U+9689,U+968B,U+968D,U+9691,U+9695-9698,U+969A,U+969D,U+969F,U+96A4-96AA,U+96AE-96B4,U+96B6,U+96B8-96BB,U+96BD,U+96C1,U+96C9-96CB,U+96CD-96CE,U+96D2,U+96D5-96D6,U+96D8-96DA,U+96DC-96DF,U+96E9,U+96EF,U+96F1,U+96F9-96FA,U+9702-9706,U+9708-9709,U+970D-970F,U+9711,U+9713-9714,U+9716,U+9719-971B}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.11.woff2)format("woff2");unicode-range:U+92BC-92BD,U+92BF-92C3,U+92C5-92C8,U+92CB-92D0,U+92D2-92D3,U+92D5,U+92D7-92D9,U+92DC-92DD,U+92DF-92E1,U+92E3-92E5,U+92E7-92EA,U+92EC,U+92EE,U+92F0,U+92F2,U+92F7-92FB,U+92FF-9300,U+9302,U+9304,U+9308,U+930D,U+930F-9311,U+9314-9315,U+9318-931A,U+931C-931F,U+9321-9325,U+9327-932B,U+932E,U+9333-9337,U+933A-933B,U+9344,U+9347-934A,U+934D,U+9350-9352,U+9354-9358,U+935A,U+935C,U+935E,U+9360,U+9364-9365,U+9367,U+9369-936D,U+936F-9371,U+9373-9374,U+9376,U+937A,U+937D-9382,U+9388,U+938A-938B,U+938D,U+938F,U+9392,U+9394-9395,U+9397-9398,U+939A-939B,U+939E,U+93A1,U+93A3-93A4,U+93A6,U+93A8-93A9,U+93AB-93AD,U+93B0,U+93B4-93B6,U+93B9-93BB,U+93C1,U+93C3-93CD,U+93D0-93D1,U+93D3,U+93D6-93D9,U+93DC-93DF,U+93E2,U+93E4-93E8,U+93F1,U+93F5,U+93F7-93FB,U+93FD,U+9401-9404,U+9407-9409,U+940D-9410,U+9413-9417,U+9419-941A,U+941F,U+9421,U+942B,U+942E-942F,U+9431-9434,U+9436,U+9438,U+943A-943B,U+943D,U+943F,U+9441,U+9443-9445,U+9448}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.12.woff2)format("woff2");unicode-range:U+9143,U+9146-914C,U+914F,U+9153,U+9156-915B,U+9161,U+9163-9165,U+9167,U+9169,U+916D,U+9172-9174,U+9179-917B,U+9181-9183,U+9185-9187,U+9189-918B,U+918E,U+9191,U+9193-9195,U+9197-9198,U+919E,U+91A1-91A2,U+91A6,U+91A8,U+91AA-91B6,U+91BA-91BD,U+91BF-91C6,U+91C9,U+91CB,U+91D0,U+91D3-91D4,U+91D6-91D7,U+91D9-91DB,U+91DE-91DF,U+91E1,U+91E4-91E6,U+91E9-91EA,U+91EC-91F1,U+91F5-91F7,U+91F9,U+91FB-91FD,U+91FF-9201,U+9204-9207,U+9209-920A,U+920C,U+920E,U+9210-9218,U+921C-921E,U+9223-9226,U+9228-9229,U+922C,U+922E-9230,U+9233,U+9235-923A,U+923C,U+923E-9240,U+9242-9243,U+9245-924B,U+924D-9251,U+9256-925A,U+925C-925E,U+9260-9261,U+9264-9269,U+926E-9270,U+9275-9279,U+927B-927F,U+9288-928A,U+928D-928E,U+9291-9293,U+9295-9297,U+9299,U+929B-929C,U+929F-92A0,U+92A4-92A5,U+92A7-92A8,U+92AB,U+92AF,U+92B2-92B3,U+92B6-92BB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.13.woff2)format("woff2");unicode-range:U+8F52-8F55,U+8F57-8F58,U+8F5C-8F5E,U+8F61-8F66,U+8F9C-8F9D,U+8F9F-8FA2,U+8FA4-8FA8,U+8FAD-8FAF,U+8FB4-8FB8,U+8FBE,U+8FC0-8FC2,U+8FC6,U+8FC8,U+8FCA-8FCB,U+8FCD,U+8FD0,U+8FD2-8FD3,U+8FD5,U+8FDA,U+8FE0,U+8FE2-8FE5,U+8FE8-8FEA,U+8FED-8FEF,U+8FF1,U+8FF4-8FF6,U+8FF8-8FFB,U+8FFE,U+9002,U+9004-9005,U+9008,U+900B-900E,U+9011,U+9013,U+9015-9016,U+9018,U+901B,U+901E,U+9021,U+9027-902A,U+902C-902D,U+902F,U+9033-9037,U+9039,U+903C,U+903E-903F,U+9041,U+9043-9044,U+9049,U+904C,U+904F-9052,U+9056,U+9058,U+905B-905E,U+9062,U+9066-9068,U+906C,U+906F-9070,U+9072,U+9074,U+9076,U+9079,U+9080-9083,U+9085,U+9087-9088,U+908B-908C,U+908E-9090,U+9095,U+9097-9099,U+909B,U+90A0-90A2,U+90A5,U+90A8,U+90AF-90B6,U+90BD-90BE,U+90C3-90C5,U+90C7-90C9,U+90CC,U+90D2,U+90D5,U+90D7-90D9,U+90DB-90DF,U+90E2,U+90E4-90E5,U+90EB,U+90EF-90F0,U+90F2,U+90F4,U+90F6,U+90FE-9100,U+9102,U+9104-9106,U+9108,U+910D,U+9110,U+9112,U+9114-911A,U+911C,U+911E,U+9120,U+9122-9123,U+9125,U+9127,U+9129,U+912D-9132,U+9134,U+9136-9137,U+9139-913A,U+913C-913D}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.14.woff2)format("woff2");unicode-range:U+8DC0,U+8DC2,U+8DC5-8DC8,U+8DCA-8DCC,U+8DCE-8DCF,U+8DD1,U+8DD4-8DD7,U+8DD9-8DDB,U+8DDF,U+8DE3-8DE5,U+8DE7,U+8DEA-8DEC,U+8DF0-8DF2,U+8DF4,U+8DFC-8DFD,U+8DFF,U+8E01,U+8E04-8E06,U+8E08-8E09,U+8E0B-8E0C,U+8E10-8E11,U+8E14,U+8E16,U+8E1D-8E23,U+8E26-8E27,U+8E30-8E31,U+8E33-8E39,U+8E3D,U+8E40-8E42,U+8E44,U+8E47-8E50,U+8E54-8E55,U+8E59,U+8E5B-8E64,U+8E69,U+8E6C-8E6D,U+8E6F-8E72,U+8E75-8E77,U+8E79-8E7C,U+8E81-8E85,U+8E89,U+8E8B,U+8E90-8E95,U+8E98-8E9B,U+8E9D-8E9E,U+8EA1-8EA2,U+8EA7,U+8EA9-8EAA,U+8EAC-8EB1,U+8EB3,U+8EB5-8EB6,U+8EBA-8EBB,U+8EBE,U+8EC0-8EC1,U+8EC3-8EC8,U+8ECB,U+8ECF,U+8ED1,U+8ED4,U+8EDB-8EDC,U+8EE3,U+8EE8,U+8EEB,U+8EED-8EEE,U+8EF0-8EF1,U+8EF7,U+8EF9-8EFC,U+8EFE,U+8F00,U+8F02,U+8F05,U+8F07-8F08,U+8F0A,U+8F0F-8F10,U+8F12-8F13,U+8F15-8F19,U+8F1B-8F1C,U+8F1E-8F21,U+8F23,U+8F25-8F28,U+8F2B-8F2F,U+8F33-8F37,U+8F39-8F3B,U+8F3E,U+8F40-8F43,U+8F45-8F47,U+8F49-8F4A,U+8F4C-8F4F,U+8F51}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.15.woff2)format("woff2");unicode-range:U+8B2D,U+8B30,U+8B37,U+8B3C,U+8B3E,U+8B41-8B46,U+8B48-8B49,U+8B4C-8B4F,U+8B51-8B54,U+8B56,U+8B59,U+8B5B,U+8B5E-8B5F,U+8B63,U+8B69,U+8B6B-8B6D,U+8B6F,U+8B71,U+8B74,U+8B76,U+8B78-8B79,U+8B7C-8B81,U+8B84-8B85,U+8B8A-8B8F,U+8B92-8B96,U+8B99-8B9A,U+8B9C-8BA0,U+8C38-8C3A,U+8C3D-8C3F,U+8C41,U+8C45,U+8C47-8C49,U+8C4B-8C4C,U+8C4E-8C51,U+8C53-8C55,U+8C57-8C59,U+8C5B,U+8C5D,U+8C62-8C64,U+8C66,U+8C68-8C69,U+8C6B-8C6D,U+8C73,U+8C75-8C76,U+8C78,U+8C7A-8C7C,U+8C7E,U+8C82,U+8C85-8C87,U+8C89-8C8B,U+8C8D-8C8E,U+8C90,U+8C92-8C94,U+8C98-8C99,U+8C9B-8C9C,U+8C9F,U+8CA4,U+8CAD-8CAE,U+8CB2-8CB3,U+8CB6,U+8CB9-8CBA,U+8CBD,U+8CC1-8CC2,U+8CC4-8CC6,U+8CC8-8CC9,U+8CCB,U+8CCD-8CCF,U+8CD2,U+8CD5-8CD6,U+8CD9-8CDA,U+8CDD,U+8CE1,U+8CE3-8CE4,U+8CE6,U+8CE8,U+8CEC,U+8CEF-8CF2,U+8CF4-8CF5,U+8CF7-8CF8,U+8CFA-8CFB,U+8CFD-8CFF,U+8D01,U+8D03-8D04,U+8D07,U+8D09-8D0B,U+8D0D-8D10,U+8D12-8D14,U+8D16-8D17,U+8D1B-8D1D,U+8D65,U+8D67,U+8D69,U+8D6B-8D6E,U+8D71,U+8D73,U+8D76,U+8D7F,U+8D81-8D82,U+8D84,U+8D88,U+8D8D,U+8D90-8D91,U+8D95,U+8D99,U+8D9E-8DA0,U+8DA6,U+8DA8,U+8DAB-8DAC,U+8DAF,U+8DB2,U+8DB5,U+8DB7,U+8DB9-8DBC,U+8DBE}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.16.woff2)format("woff2");unicode-range:U+8973-8975,U+8977,U+897A-897E,U+8980,U+8983,U+8988-898A,U+898D,U+8990,U+8993-8995,U+8998,U+899B-899C,U+899F-89A1,U+89A5-89A6,U+89A9,U+89AC,U+89AF-89B0,U+89B2,U+89B4-89B7,U+89BA,U+89BC-89BD,U+89BF-89C1,U+89D4-89D8,U+89DA,U+89DC-89DD,U+89E5,U+89E7,U+89E9,U+89EB,U+89ED,U+89F1,U+89F3-89F4,U+89F6,U+89F8-89F9,U+89FD,U+89FF,U+8A01,U+8A04-8A05,U+8A07,U+8A0C,U+8A0F-8A12,U+8A14-8A16,U+8A1B,U+8A1D-8A1E,U+8A20-8A22,U+8A24-8A26,U+8A2B-8A2C,U+8A2F,U+8A35-8A37,U+8A3B,U+8A3D-8A3E,U+8A40-8A41,U+8A43,U+8A45-8A49,U+8A4D-8A4E,U+8A51-8A54,U+8A56-8A58,U+8A5B-8A5D,U+8A61-8A62,U+8A65,U+8A67,U+8A6C-8A6D,U+8A75-8A77,U+8A79-8A7C,U+8A7E-8A80,U+8A82-8A86,U+8A8B,U+8A8F-8A92,U+8A96-8A97,U+8A99-8A9A,U+8A9F,U+8AA1,U+8AA3,U+8AA5-8AAA,U+8AAE-8AAF,U+8AB3,U+8AB6-8AB7,U+8ABB-8ABC,U+8ABE,U+8AC2-8AC4,U+8AC6,U+8AC8-8ACA,U+8ACC-8ACD,U+8AD0-8AD1,U+8AD3-8AD5,U+8AD7,U+8ADA-8AE2,U+8AE4,U+8AE7,U+8AEB-8AEC,U+8AEE,U+8AF0-8AF1,U+8AF3-8AF7,U+8AFA,U+8AFC,U+8AFF,U+8B01-8B02,U+8B04-8B07,U+8B0A-8B0D,U+8B0F-8B11,U+8B14,U+8B16,U+8B1A,U+8B1C,U+8B1E-8B20,U+8B26,U+8B28,U+8B2B-8B2C}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.17.woff2)format("woff2");unicode-range:U+87E2-87E6,U+87EA-87ED,U+87EF,U+87F1,U+87F3,U+87F5-87F8,U+87FA-87FB,U+87FE-87FF,U+8801,U+8803,U+8805-8807,U+8809-880B,U+880D-8816,U+8818-881C,U+881E-881F,U+8821-8822,U+8827-8828,U+882D-882E,U+8830-8832,U+8835-8836,U+8839-883C,U+8841-8845,U+8848-884B,U+884D-884E,U+8851-8852,U+8855-8856,U+8858-885A,U+885C,U+885E-8860,U+8862,U+8864,U+8869,U+886B,U+886E-886F,U+8871-8872,U+8875,U+8877,U+8879,U+887B,U+887D-887E,U+8880-8882,U+8888,U+888D,U+8892,U+8897-889C,U+889E-88A0,U+88A2,U+88A4,U+88A8,U+88AA,U+88AE,U+88B0-88B1,U+88B5,U+88B7,U+88BA,U+88BC-88C0,U+88C3-88C4,U+88C6,U+88CA-88CE,U+88D1-88D4,U+88D8-88D9,U+88DB,U+88DD-88E1,U+88E7-88E8,U+88EF-88F2,U+88F4-88F5,U+88F7,U+88F9,U+88FC,U+8901-8902,U+8904,U+8906,U+890A,U+890C-890F,U+8913,U+8915-8916,U+8918-891A,U+891C-891E,U+8920,U+8925-8928,U+892A-892B,U+8930-8932,U+8935-893B,U+893E,U+8940-8946,U+8949,U+894C-894D,U+894F,U+8952,U+8956-8957,U+895A-895C,U+895E,U+8960-8964,U+8966,U+896A-896B,U+896D-8970}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.18.woff2)format("woff2");unicode-range:U+8655-8659,U+865B,U+865D-8664,U+8667,U+8669,U+866C,U+866F,U+8671,U+8675-8677,U+867A-867B,U+867D,U+8687-8689,U+868B-868D,U+8691,U+8693,U+8695-8696,U+8698,U+869A,U+869C-869D,U+86A1,U+86A3-86A4,U+86A6-86AB,U+86AD,U+86AF-86B1,U+86B3-86B9,U+86BF-86C1,U+86C3-86C6,U+86C9,U+86CB,U+86CE,U+86D1-86D2,U+86D4-86D5,U+86D7,U+86DA,U+86DC,U+86DE-86E0,U+86E3-86E7,U+86E9,U+86EC-86ED,U+86EF,U+86F8-86FE,U+8700,U+8703-870B,U+870D-8714,U+8719-871A,U+871E-871F,U+8721-8723,U+8725,U+8728-8729,U+872E-872F,U+8731-8732,U+8734,U+8737,U+8739-8740,U+8743,U+8745,U+8749,U+874B-874E,U+8751,U+8753,U+8755,U+8757-8759,U+875D,U+875F-8761,U+8763-8766,U+8768,U+876A,U+876E-876F,U+8771-8772,U+8774,U+8778,U+877B-877C,U+877F,U+8782-8789,U+878B-878C,U+878E,U+8790,U+8793,U+8795,U+8797-8799,U+879E-87A0,U+87A2-87A3,U+87A7,U+87AB-87AF,U+87B1,U+87B3,U+87B5,U+87BB,U+87BD-87C1,U+87C4,U+87C6-87CB,U+87CE,U+87D0,U+87D2,U+87D5-87D6,U+87D9-87DA,U+87DC,U+87DF-87E0}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.19.woff2)format("woff2");unicode-range:U+84B4,U+84B9-84BB,U+84BD-84C2,U+84C6-84CA,U+84CC-84D1,U+84D3,U+84D6,U+84D9-84DA,U+84DC,U+84E7,U+84EA,U+84EC,U+84EF-84F2,U+84F4,U+84F7,U+84FA-84FD,U+84FF-8500,U+8502-8503,U+8506-8507,U+850C,U+850E,U+8510,U+8514-8515,U+8517-8518,U+851A-851C,U+851E-851F,U+8521-8525,U+8527,U+852A-852C,U+852F,U+8532-8534,U+8536,U+853E-8541,U+8543,U+8546,U+8548,U+854A-854B,U+854F-8553,U+8555-855A,U+855C-8564,U+8569-856B,U+856D,U+856F,U+8577,U+8579-857B,U+857D-8581,U+8585-8586,U+8588-858C,U+858F-8591,U+8593,U+8597-8598,U+859B-859D,U+859F-85A0,U+85A2,U+85A4-85A5,U+85A7-85A8,U+85AD-85B0,U+85B4,U+85B6-85BA,U+85BC-85BF,U+85C1-85C2,U+85C7,U+85C9-85CB,U+85CE-85D0,U+85D5,U+85D8-85DA,U+85DC,U+85DF-85E1,U+85E5-85E6,U+85E8,U+85ED,U+85F3-85F4,U+85F6-85F7,U+85F9-85FA,U+85FC,U+85FE-8600,U+8602,U+8604-8606,U+860A-860B,U+860D-860E,U+8610-8613,U+8616-861B,U+861E,U+8621-8622,U+8624,U+8627,U+8629,U+862F-8630,U+8636,U+8638-863A,U+863C-863D,U+863F-8642,U+8646,U+864D,U+8652-8654}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.20.woff2)format("woff2");unicode-range:U+82E8,U+82EA,U+82ED,U+82EF,U+82F3-82F4,U+82F6-82F7,U+82F9,U+82FB,U+82FD-82FE,U+8300-8301,U+8303,U+8306-8308,U+830A-830C,U+8316-8318,U+831B,U+831D-831F,U+8321-8323,U+832B-8335,U+8337,U+833A,U+833C-833D,U+8340,U+8342-8347,U+834A,U+834D-8351,U+8353-8357,U+835A,U+8362-8363,U+8370,U+8373,U+8375,U+8378,U+837C-837D,U+837F-8380,U+8382,U+8384-8387,U+838A,U+838D-838E,U+8392-8396,U+8398-83A0,U+83A2,U+83A6-83AD,U+83B1,U+83B5,U+83BD-83C1,U+83C7,U+83C9,U+83CE-83D1,U+83D4,U+83D6,U+83D8,U+83DD,U+83DF-83E1,U+83E5,U+83E8,U+83EA-83EB,U+83F0,U+83F2,U+83F4,U+83F6-83F9,U+83FB-83FD,U+8401,U+8403-8404,U+8406-8407,U+840A-840B,U+840D,U+840F,U+8411,U+8413,U+8415,U+8417,U+8419,U+8420,U+8422,U+842A,U+842F,U+8431,U+8435,U+8438-8439,U+843C,U+8445-8448,U+844A,U+844D-844F,U+8451-8452,U+8456,U+8458-845A,U+845C,U+845F-8462,U+8464-8467,U+8469-846B,U+846D-8470,U+8473-8474,U+8476-847A,U+847C-847D,U+8481-8482,U+8484-8485,U+848B,U+8490,U+8492-8493,U+8495,U+8497,U+849C,U+849E-849F,U+84A1,U+84A6,U+84A8-84AA,U+84AD,U+84AF,U+84B1}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.21.woff2)format("woff2");unicode-range:U+814A,U+814C,U+8151-8153,U+8157,U+815F-8161,U+8165-8169,U+816D-816F,U+8171,U+8173-8174,U+8177,U+8180-8186,U+8188,U+818A-818B,U+818E,U+8190,U+8193,U+8195-8196,U+8198,U+819B,U+819E,U+81A0,U+81A2,U+81A4,U+81A9,U+81AE,U+81B0,U+81B2,U+81B4-81B5,U+81B8,U+81BA-81BB,U+81BD-81BE,U+81C0-81C3,U+81C5-81C6,U+81C8-81CB,U+81CD-81CF,U+81D1,U+81D5-81DB,U+81DD-81E1,U+81E4-81E5,U+81E7,U+81EB-81EC,U+81EF-81F2,U+81F5-81F6,U+81F8-81FB,U+81FD-8205,U+8209-820B,U+820D,U+820F,U+8212-8214,U+8216,U+8219-821D,U+8221-8222,U+8228-8229,U+822B,U+822E,U+8232-8235,U+8237-8238,U+823A,U+823C,U+8240,U+8243-8246,U+8249,U+824B,U+824E-824F,U+8251,U+8256-825A,U+825C-825D,U+825F-8260,U+8262-8264,U+8267-8268,U+826A-826B,U+826D-826E,U+8271,U+8274,U+8277,U+8279,U+827B,U+827D-8281,U+8283-8284,U+8287,U+8289-828A,U+828D-828E,U+8291-8294,U+8296,U+8298-829B,U+829F-82A1,U+82A3-82A4,U+82A7-82AC,U+82AE,U+82B0,U+82B2,U+82B4,U+82B7,U+82BA-82BC,U+82BE-82BF,U+82C5-82C6,U+82D0,U+82D2-82D3,U+82D5,U+82D9-82DA,U+82DC,U+82DE-82E4,U+82E7}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.22.woff2)format("woff2");unicode-range:U+7F77-7F79,U+7F7D-7F80,U+7F82-7F83,U+7F86-7F88,U+7F8B-7F8D,U+7F8F-7F91,U+7F94,U+7F96-7F97,U+7F9A,U+7F9C-7F9D,U+7FA1-7FA3,U+7FA6,U+7FAA,U+7FAD-7FAF,U+7FB2,U+7FB4,U+7FB6,U+7FB8-7FB9,U+7FBC,U+7FBF-7FC0,U+7FC3,U+7FC5-7FC6,U+7FC8,U+7FCA,U+7FCE-7FCF,U+7FD5,U+7FDB,U+7FDF,U+7FE1,U+7FE3,U+7FE5-7FE6,U+7FE8-7FE9,U+7FEB-7FEC,U+7FEE-7FF0,U+7FF2-7FF3,U+7FF9-7FFA,U+7FFD-7FFF,U+8002,U+8004,U+8006-8008,U+800A-800F,U+8011-8014,U+8016,U+8018-8019,U+801C-8021,U+8024,U+8026,U+8028,U+802C,U+802E,U+8030,U+8034-8035,U+8037,U+8039-8040,U+8043-8044,U+8046,U+804A,U+8052,U+8058,U+805A,U+805F-8060,U+8062,U+8064,U+8066,U+8068,U+806D,U+806F-8073,U+8075-8076,U+8079,U+807B,U+807D-8081,U+8084-8088,U+808B,U+808E,U+8093,U+8099-809A,U+809C,U+809E,U+80A4,U+80A6-80A7,U+80AB-80AD,U+80B1,U+80B8-80B9,U+80C4-80C5,U+80C8,U+80CA,U+80CD,U+80CF,U+80D2,U+80D4-80DB,U+80DD,U+80E0,U+80E4-80E6,U+80ED-80F3,U+80F5-80F7,U+80F9-80FC,U+80FE,U+8101,U+8103,U+8109,U+810B,U+810D,U+8116-8118,U+811B-811C,U+811E,U+8120,U+8123-8124,U+8127,U+8129,U+812B-812C,U+812F-8130,U+8135,U+8139-813A,U+813C-813E,U+8141,U+8145-8147}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.23.woff2)format("woff2");unicode-range:U+7D57,U+7D59-7D5D,U+7D63,U+7D65,U+7D67,U+7D6A,U+7D6E,U+7D70,U+7D72-7D73,U+7D78,U+7D7A-7D7B,U+7D7D,U+7D7F,U+7D81-7D83,U+7D85-7D86,U+7D88-7D89,U+7D8B-7D8D,U+7D8F,U+7D91,U+7D93,U+7D96-7D97,U+7D9B-7DA0,U+7DA2-7DA3,U+7DA6-7DA7,U+7DAA-7DAC,U+7DAE-7DB0,U+7DB3,U+7DB5-7DB9,U+7DBD,U+7DC0,U+7DC2-7DC7,U+7DCC-7DCE,U+7DD0,U+7DD5-7DD9,U+7DDC-7DDE,U+7DE1-7DE6,U+7DEA-7DED,U+7DF1-7DF2,U+7DF5-7DF6,U+7DF9-7DFA,U+7E00,U+7E05,U+7E08-7E0B,U+7E10-7E12,U+7E15,U+7E17,U+7E1C-7E1D,U+7E1F-7E23,U+7E27-7E28,U+7E2C-7E2D,U+7E2F,U+7E31-7E33,U+7E35-7E37,U+7E39-7E3B,U+7E3D,U+7E3F,U+7E43-7E48,U+7E4E,U+7E50,U+7E52,U+7E56,U+7E58-7E5A,U+7E5D-7E5F,U+7E61-7E62,U+7E65-7E67,U+7E69-7E6B,U+7E6D-7E6F,U+7E73,U+7E75,U+7E78-7E79,U+7E7B-7E7F,U+7E81-7E83,U+7E86-7E8A,U+7E8C-7E8E,U+7E90-7E96,U+7E98,U+7E9A-7E9F,U+7F38,U+7F3A-7F3F,U+7F43-7F45,U+7F47,U+7F4C-7F50,U+7F52-7F55,U+7F58,U+7F5B-7F5D,U+7F5F,U+7F61,U+7F63-7F69,U+7F6B,U+7F6D,U+7F71}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.24.woff2)format("woff2");unicode-range:U+7BC8,U+7BCA-7BCC,U+7BCF,U+7BD4,U+7BD6-7BD7,U+7BD9-7BDB,U+7BDD,U+7BE5-7BE6,U+7BE8-7BEA,U+7BF0,U+7BF2-7BFA,U+7BFC,U+7BFE,U+7C00-7C04,U+7C06-7C07,U+7C09,U+7C0B-7C0F,U+7C11-7C14,U+7C17,U+7C19,U+7C1B,U+7C1E-7C20,U+7C23,U+7C25-7C28,U+7C2A-7C2C,U+7C2F,U+7C31,U+7C33-7C34,U+7C36-7C3A,U+7C3D-7C3E,U+7C40,U+7C42-7C43,U+7C45-7C46,U+7C4A,U+7C4C,U+7C4F-7C5F,U+7C61,U+7C63-7C65,U+7C67,U+7C69,U+7C6C-7C70,U+7C72,U+7C75,U+7C79,U+7C7B-7C7E,U+7C81-7C83,U+7C86-7C87,U+7C8D,U+7C8F-7C90,U+7C94,U+7C9E,U+7CA0-7CA2,U+7CA4-7CA6,U+7CA8,U+7CAB,U+7CAD-7CAE,U+7CB0-7CB3,U+7CB6-7CB7,U+7CB9-7CBD,U+7CBF-7CC0,U+7CC2,U+7CC4-7CC5,U+7CC7-7CCA,U+7CCD-7CCF,U+7CD2-7CD5,U+7CD7-7CDA,U+7CDC-7CDD,U+7CDF-7CE0,U+7CE2,U+7CE6,U+7CE9,U+7CEB,U+7CEF,U+7CF2,U+7CF4-7CF6,U+7CF9-7CFA,U+7CFE,U+7D02-7D03,U+7D06-7D0A,U+7D0F,U+7D11-7D13,U+7D15-7D16,U+7D1C-7D1E,U+7D23,U+7D26,U+7D2A,U+7D2C-7D2E,U+7D31-7D32,U+7D35,U+7D3C-7D41,U+7D43,U+7D45,U+7D47-7D48,U+7D4B,U+7D4D-7D4F,U+7D51,U+7D53,U+7D55-7D56}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.25.woff2)format("woff2");unicode-range:U+7A17-7A19,U+7A1B,U+7A1E-7A21,U+7A27,U+7A2B,U+7A2D,U+7A2F-7A31,U+7A34-7A35,U+7A37-7A3B,U+7A3E,U+7A43-7A49,U+7A4C,U+7A4E,U+7A50,U+7A55-7A57,U+7A59,U+7A5C-7A5D,U+7A5F-7A63,U+7A65,U+7A67,U+7A69-7A6A,U+7A6D,U+7A70,U+7A75,U+7A78-7A79,U+7A7D-7A7E,U+7A80,U+7A82,U+7A84-7A86,U+7A88,U+7A8A-7A8B,U+7A90-7A91,U+7A94-7A98,U+7A9E,U+7AA0,U+7AA3,U+7AA9,U+7AAC,U+7AB0,U+7AB3,U+7AB5-7AB6,U+7AB9-7ABF,U+7AC3,U+7AC5-7ACA,U+7ACC-7ACF,U+7AD1-7AD3,U+7AD5,U+7ADA-7ADB,U+7ADD,U+7ADF,U+7AE1-7AE2,U+7AE6-7AED,U+7AF0-7AF1,U+7AF4,U+7AF8,U+7AFA-7AFB,U+7AFD-7AFE,U+7B02,U+7B04,U+7B06-7B08,U+7B0A-7B0B,U+7B0F,U+7B12,U+7B14,U+7B18-7B19,U+7B1E-7B1F,U+7B23,U+7B25,U+7B27-7B2B,U+7B2D-7B31,U+7B33-7B36,U+7B3B,U+7B3D,U+7B3F-7B41,U+7B45,U+7B47,U+7B4C-7B50,U+7B53,U+7B55,U+7B5D,U+7B60,U+7B64-7B66,U+7B69-7B6A,U+7B6C-7B75,U+7B77,U+7B79-7B7A,U+7B7F,U+7B84,U+7B86,U+7B89,U+7B8D-7B92,U+7B96,U+7B98-7BA0,U+7BA5,U+7BAC-7BAD,U+7BAF-7BB0,U+7BB2,U+7BB4-7BB6,U+7BBA-7BBD,U+7BC1-7BC2,U+7BC5-7BC6}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.26.woff2)format("woff2");unicode-range:U+7851-7852,U+785C,U+785E,U+7860-7861,U+7863-7864,U+7868,U+786A,U+786E-786F,U+7872,U+7874,U+787A,U+787C,U+787E,U+7886-7887,U+788A,U+788C-788F,U+7893-7895,U+7898,U+789A,U+789D-789F,U+78A1,U+78A3-78A4,U+78A8-78AA,U+78AC-78AD,U+78AF-78B3,U+78B5,U+78BB-78BF,U+78C5-78CC,U+78CE,U+78D1-78D6,U+78DA-78DB,U+78DF-78E1,U+78E4,U+78E6-78E7,U+78EA,U+78EC,U+78F2-78F4,U+78F6-78F7,U+78F9-78FB,U+78FD-7901,U+7906-7907,U+790C,U+7910-7912,U+7919-791C,U+791E-7920,U+7925-792E,U+7930-7931,U+7934-7935,U+793B,U+793D,U+793F,U+7941-7942,U+7944-7946,U+794A-794B,U+794F,U+7951,U+7954-7955,U+7957-7958,U+795A-795C,U+795F-7960,U+7962,U+7967,U+7969,U+796B,U+7972,U+7977,U+7979-797C,U+797E-7980,U+798A-798E,U+7991,U+7993-7996,U+7998,U+799B-799D,U+79A1,U+79A6-79AB,U+79AE-79B1,U+79B3-79B4,U+79B8-79BB,U+79BD-79BE,U+79C2,U+79C4,U+79C7-79CA,U+79CC-79CD,U+79CF,U+79D4-79D6,U+79DA,U+79DD-79E3,U+79E5,U+79E7,U+79EA-79ED,U+79F1,U+79F8,U+79FC,U+7A02-7A03,U+7A05,U+7A07-7A0A,U+7A0C-7A0D,U+7A11,U+7A15}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.27.woff2)format("woff2");unicode-range:U+768C-768E,U+7690,U+7693,U+7695-7696,U+7699-76A8,U+76AA,U+76AD,U+76AF-76B0,U+76B4,U+76B6-76BA,U+76BD,U+76C1-76C3,U+76C5,U+76C8-76C9,U+76CB-76CE,U+76D2,U+76D4,U+76D6,U+76D9,U+76DC,U+76DE,U+76E0-76E1,U+76E5-76E8,U+76EA-76EC,U+76F0-76F1,U+76F6,U+76F9,U+76FB-76FC,U+7700,U+7704,U+7706-7708,U+770A,U+770E,U+7712,U+7714-7715,U+7717,U+7719-771C,U+7722,U+7724-7726,U+7728,U+772D-772F,U+7734-7739,U+773D-773E,U+7742,U+7745-7747,U+774A,U+774D-774F,U+7752,U+7756-7758,U+775A-775C,U+775E-7760,U+7762,U+7764-7765,U+7767,U+776A-776C,U+7770,U+7772-7774,U+7779-777A,U+777C-7780,U+7784,U+778B-778E,U+7794-7796,U+779A,U+779E-77A0,U+77A2,U+77A4-77A5,U+77A7,U+77A9-77AA,U+77AE-77B1,U+77B5-77B7,U+77B9,U+77BB-77BF,U+77C3,U+77C7,U+77C9,U+77CD,U+77D1-77D2,U+77D5,U+77D7,U+77D9-77DA,U+77DC,U+77DE-77E0,U+77E3-77E4,U+77E6-77E7,U+77E9-77EA,U+77EC,U+77EE,U+77F0-77F1,U+77F4,U+77F8,U+77FB-77FC,U+7805-7806,U+7809,U+780C-780E,U+7811-7812,U+7819,U+781D,U+7820-7823,U+7826-7827,U+782C-782E,U+7830,U+7835,U+7837,U+783A,U+783F,U+7843-7845,U+7847-7848,U+784C,U+784E-784F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.28.woff2)format("woff2");unicode-range:U+7511-7513,U+7515-7517,U+751C,U+751E,U+7520-7522,U+7524,U+7526-7527,U+7529-752C,U+752F,U+7536,U+7538-7539,U+753C-7540,U+7543-7544,U+7546-754B,U+754D-7550,U+7552,U+7557,U+755A-755B,U+755D-755F,U+7561-7562,U+7564,U+7566-7567,U+7569,U+756B-756D,U+756F,U+7571-7572,U+7574-757E,U+7581-7582,U+7585-7587,U+7589-758C,U+758F-7590,U+7592-7595,U+7599-759A,U+759C-759D,U+75A2-75A5,U+75B0-75B1,U+75B3-75B5,U+75B7-75B8,U+75BA,U+75BD,U+75BF-75C4,U+75C6,U+75CA,U+75CC-75CF,U+75D3-75D4,U+75D7-75D8,U+75DC-75E1,U+75E3-75E4,U+75E7,U+75EC,U+75EE-75F3,U+75F9,U+75FC,U+75FE-7604,U+7607-760C,U+760F,U+7612-7613,U+7615-7616,U+7618-7619,U+761B-7629,U+762D,U+7630,U+7632-7635,U+7638-763C,U+7640-7641,U+7643-764B,U+764E,U+7655,U+7658-7659,U+765C,U+765F,U+7661-7662,U+7664-7665,U+7667-766A,U+766C-7672,U+7674,U+7676,U+7678,U+7680-7683,U+7685,U+7688,U+768B}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.29.woff2)format("woff2");unicode-range:U+736C,U+736E-7371,U+7375,U+7377-737C,U+7380-7381,U+7383,U+7385-7386,U+738A,U+738E,U+7390,U+7393-7398,U+739C,U+739E-73A0,U+73A2,U+73A5-73A6,U+73A8,U+73AA-73AB,U+73AD,U+73B3,U+73B5,U+73B7,U+73B9-73BD,U+73BF,U+73C5-73C6,U+73C9-73CC,U+73CE-73CF,U+73D2-73D3,U+73D6,U+73D9,U+73DD-73DE,U+73E1,U+73E3-73E7,U+73E9-73EA,U+73EE,U+73F1,U+73F4-73F5,U+73F7-73FB,U+73FD,U+73FF-7401,U+7404-7405,U+7407,U+740A,U+7411,U+7413,U+741A-741B,U+7421,U+7424,U+7426,U+7428-7431,U+7433,U+7439-743A,U+743F-7441,U+7443-7444,U+7446-7447,U+744B,U+744D,U+7451-7453,U+7455,U+7457,U+7459-745A,U+745C-745D,U+745F,U+7462-7464,U+7466-746B,U+746D-7473,U+7476,U+747E,U+7480-7481,U+7485-7489,U+748B,U+748F-7492,U+7497-749A,U+749C,U+749E-74A3,U+74A5-74A6,U+74A8-74AB,U+74AE-74AF,U+74B1-74B2,U+74B5,U+74B9-74BB,U+74BD,U+74BF,U+74C8-74CA,U+74CC,U+74CF-74D0,U+74D3-74D4,U+74D6,U+74D8,U+74DA-74DB,U+74DE-74E0,U+74E3-74E4,U+74E7-74EB,U+74EE-74F2,U+74F4,U+74F7-74F8,U+74FA-74FC,U+74FF,U+7501,U+7503-7506,U+750C-750E}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.30.woff2)format("woff2");unicode-range:U+7166,U+7168,U+716C,U+7179,U+7180,U+7184-7185,U+7187-7188,U+718C,U+718F,U+7192,U+7194-7196,U+7199-719B,U+71A0,U+71A2,U+71A8,U+71AC,U+71AE-71B0,U+71B2-71B3,U+71B9-71BA,U+71BE-71C1,U+71C4,U+71C9,U+71CB-71CC,U+71CE,U+71D0,U+71D2-71D4,U+71D6-71D7,U+71D9-71DA,U+71DC,U+71DF-71E0,U+71E6-71E7,U+71EC-71EE,U+71F4-71F5,U+71F8-71F9,U+71FC,U+71FE-7200,U+7207-7209,U+720D,U+7210,U+7213,U+7215,U+7217,U+721A,U+721D,U+721F,U+7224,U+7228,U+722B,U+722D,U+722F-7230,U+7232,U+7234,U+7238-7239,U+723B-723C,U+723E-7243,U+7245-7246,U+724B,U+724E-7250,U+7252-7253,U+7255-7258,U+725A,U+725C,U+725E,U+7260,U+7263,U+7268,U+726B,U+726E-726F,U+7271,U+7274,U+7277-7278,U+727B-727C,U+727E-7282,U+7284,U+7287,U+7289,U+728D-728E,U+7292-7293,U+7296,U+729B,U+72A2,U+72A7-72A8,U+72AD-72AE,U+72B0-72B2,U+72B4,U+72B9,U+72BE,U+72C0-72C1,U+72C3-72C4,U+72C6-72C7,U+72C9,U+72CC,U+72CE,U+72D2,U+72D5-72D6,U+72D8,U+72DF-72E2,U+72E5,U+72F3-72F4,U+72F7,U+72F9-72FB,U+72FD-72FE,U+7302,U+7304-7305,U+7307,U+730A-730B,U+730D,U+7312-7313,U+7316-7319,U+731C-731E,U+7322,U+7324,U+7327-7329,U+732C,U+732F,U+7331-7337,U+7339-733B,U+733D-733E,U+7343,U+734D-7350,U+7352,U+7356-7358,U+735D-7360,U+7366-736B}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.31.woff2)format("woff2");unicode-range:U+6F58-6F5B,U+6F5D-6F5E,U+6F60-6F62,U+6F66,U+6F68,U+6F6C-6F6D,U+6F6F,U+6F74,U+6F78,U+6F7A,U+6F7C-6F7E,U+6F80,U+6F82-6F83,U+6F86-6F88,U+6F8B-6F8E,U+6F90-6F94,U+6F96-6F98,U+6F9A,U+6F9D,U+6F9F-6FA1,U+6FA3,U+6FA5-6FA8,U+6FAE-6FB1,U+6FB3,U+6FB5-6FB7,U+6FB9,U+6FBC,U+6FBE,U+6FC2,U+6FC5-6FCA,U+6FD4-6FD5,U+6FD8,U+6FDA-6FDB,U+6FDE-6FE0,U+6FE4,U+6FE8-6FE9,U+6FEB-6FEC,U+6FEE,U+6FF0,U+6FF3,U+6FF5-6FF6,U+6FF9-6FFA,U+6FFC-6FFE,U+7000-7001,U+7005-7007,U+7009-700B,U+700D,U+700F,U+7011,U+7015,U+7017-7018,U+701A-701B,U+701D-7020,U+7023,U+7026,U+7028,U+702F-7030,U+7032,U+7034,U+7037,U+7039-703A,U+703C,U+703E,U+7043-7044,U+7047-704C,U+704E,U+7051,U+7054-7055,U+705D-705E,U+7064-7065,U+7069,U+706C,U+706E,U+7075-7076,U+707E,U+7081,U+7085-7086,U+7094-7098,U+709B,U+709F,U+70A4,U+70AB-70AC,U+70AE-70B1,U+70B3-70B4,U+70B7,U+70BB,U+70CA-70CB,U+70D1,U+70D3-70D6,U+70D8-70D9,U+70DC-70DD,U+70DF,U+70E4,U+70EC,U+70F1,U+70FA,U+70FD,U+7103-7108,U+710B-710C,U+710F,U+7114,U+7119,U+711C,U+711E,U+7120,U+712B,U+712D-7131,U+7138,U+7141,U+7145-7147,U+7149-714B,U+7150-7153,U+7155-7157,U+715A,U+715C,U+715E,U+7160,U+7162,U+7164-7165}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.32.woff2)format("woff2");unicode-range:U+6D7C,U+6D80-6D82,U+6D85,U+6D87,U+6D89-6D8A,U+6D8C-6D8E,U+6D91-6D98,U+6D9C,U+6DAA-6DAC,U+6DAE,U+6DB4-6DB5,U+6DB7-6DB9,U+6DBD,U+6DBF,U+6DC2,U+6DC4-6DC8,U+6DCA,U+6DCC,U+6DCE-6DD0,U+6DD2,U+6DD5-6DD6,U+6DD8-6DDB,U+6DDD-6DE0,U+6DE2,U+6DE4-6DE6,U+6DE8-6DEA,U+6DEC,U+6DEE-6DF0,U+6DF2,U+6DF4,U+6DF6,U+6DF8-6DFA,U+6DFC,U+6E00,U+6E04,U+6E0A,U+6E17,U+6E19,U+6E1D-6E20,U+6E22-6E25,U+6E27,U+6E2B,U+6E2D-6E2E,U+6E32,U+6E34,U+6E36,U+6E38-6E3C,U+6E42-6E45,U+6E48-6E49,U+6E4B-6E4F,U+6E51-6E54,U+6E57,U+6E5B-6E5F,U+6E62-6E63,U+6E68,U+6E6B,U+6E6E,U+6E72-6E73,U+6E76,U+6E7B,U+6E7D,U+6E82,U+6E89,U+6E8C-6E8D,U+6E8F,U+6E93,U+6E98-6E99,U+6E9F-6EA0,U+6EA5,U+6EA7,U+6EAA-6EAB,U+6EAD-6EAF,U+6EB1-6EB4,U+6EB7,U+6EBB-6EBD,U+6EBF-6EC4,U+6EC7-6ECA,U+6ECC-6ECF,U+6ED3-6ED5,U+6ED9-6EDB,U+6EE6,U+6EEB-6EEF,U+6EF7-6EF9,U+6EFB,U+6EFD-6EFF,U+6F04,U+6F08-6F0A,U+6F0C-6F0D,U+6F10-6F11,U+6F13,U+6F15-6F16,U+6F18,U+6F1A-6F1B,U+6F25-6F26,U+6F29-6F2A,U+6F2D,U+6F2F-6F33,U+6F35-6F36,U+6F38,U+6F3B-6F3C,U+6F3E-6F3F,U+6F41,U+6F45,U+6F4F,U+6F51-6F53,U+6F57}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.33.woff2)format("woff2");unicode-range:U+6B85,U+6B89,U+6B8D,U+6B95,U+6B97-6B98,U+6B9B,U+6B9E-6BA0,U+6BA2-6BA4,U+6BA8-6BB3,U+6BB7-6BB9,U+6BBC-6BBE,U+6BC0,U+6BC3-6BC4,U+6BC6-6BC9,U+6BCB-6BCC,U+6BCF,U+6BD3,U+6BD6-6BD8,U+6BDA,U+6BDF,U+6BE1,U+6BE3,U+6BE6-6BE7,U+6BEB-6BEC,U+6BEE,U+6BF1,U+6BF3,U+6BF7,U+6BF9,U+6BFF,U+6C02,U+6C04-6C05,U+6C08-6C0A,U+6C0D-6C0E,U+6C10,U+6C12-6C14,U+6C19,U+6C1B,U+6C1F,U+6C24,U+6C26-6C28,U+6C2C,U+6C2E,U+6C33,U+6C35-6C36,U+6C3A-6C3B,U+6C3E-6C40,U+6C4A-6C4B,U+6C4D,U+6C4F,U+6C52,U+6C54-6C55,U+6C59,U+6C5B-6C5E,U+6C62,U+6C67-6C68,U+6C6A-6C6B,U+6C6D,U+6C6F,U+6C73-6C74,U+6C76,U+6C78-6C79,U+6C7B,U+6C7E,U+6C81-6C87,U+6C89,U+6C8C-6C8D,U+6C90,U+6C92-6C95,U+6C97-6C98,U+6C9A-6C9C,U+6C9F,U+6CAA-6CAE,U+6CB0-6CB2,U+6CB4,U+6CBA,U+6CBD-6CBE,U+6CC2,U+6CC5-6CC6,U+6CCD,U+6CCF-6CD4,U+6CD6-6CD7,U+6CD9-6CDD,U+6CE0,U+6CE7,U+6CE9-6CEF,U+6CF1-6CF2,U+6CF4,U+6CFB,U+6D00-6D01,U+6D04,U+6D07,U+6D0A,U+6D0C,U+6D0E-6D0F,U+6D11,U+6D13,U+6D19-6D1A,U+6D1F,U+6D24,U+6D26-6D28,U+6D2B,U+6D2E-6D2F,U+6D31,U+6D33-6D36,U+6D38-6D39,U+6D3C-6D3D,U+6D3F,U+6D57-6D5B,U+6D5E-6D61,U+6D64-6D65,U+6D67,U+6D6C,U+6D6F-6D70,U+6D79}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.34.woff2)format("woff2");unicode-range:U+69DD-69DE,U+69E2-69E3,U+69E5,U+69E7-69EB,U+69ED-69EF,U+69F1-69F6,U+69F9,U+69FE-6A01,U+6A03,U+6A05,U+6A0A,U+6A0C,U+6A0F,U+6A11-6A15,U+6A17,U+6A1A-6A1B,U+6A1D-6A20,U+6A22-6A24,U+6A28,U+6A2E,U+6A30,U+6A32-6A38,U+6A3B,U+6A3E-6A3F,U+6A44-6A4A,U+6A4E,U+6A50-6A52,U+6A54-6A56,U+6A5B,U+6A61-6A62,U+6A64,U+6A66-6A67,U+6A6A-6A6B,U+6A71-6A73,U+6A78,U+6A7A,U+6A7E-6A7F,U+6A81,U+6A83-6A84,U+6A86-6A87,U+6A89,U+6A8B,U+6A8D,U+6A90-6A91,U+6A94,U+6A97,U+6A9B,U+6A9D-6AA3,U+6AA5,U+6AAA-6AAC,U+6AAE-6AB1,U+6AB3-6AB4,U+6AB8,U+6ABB,U+6ABD-6ABF,U+6AC1-6AC3,U+6AC6,U+6AC8-6AC9,U+6ACC,U+6AD0-6AD1,U+6AD3-6AD6,U+6ADA-6ADF,U+6AE2,U+6AE4,U+6AE7-6AE8,U+6AEA,U+6AEC,U+6AF0-6AF3,U+6AF8,U+6AFA,U+6AFC-6AFD,U+6B02-6B03,U+6B06-6B07,U+6B09-6B0B,U+6B0F-6B12,U+6B16-6B17,U+6B1B,U+6B1D-6B1F,U+6B23-6B24,U+6B28,U+6B2B-6B2C,U+6B2F,U+6B35-6B39,U+6B3B,U+6B3D,U+6B3F,U+6B43,U+6B46-6B47,U+6B49-6B4A,U+6B4D-6B4E,U+6B50,U+6B52,U+6B54,U+6B56,U+6B58-6B59,U+6B5B,U+6B5D,U+6B5F-6B61,U+6B65,U+6B67,U+6B6B-6B6C,U+6B6E,U+6B70,U+6B72,U+6B75,U+6B77-6B7A,U+6B7D-6B84}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.35.woff2)format("woff2");unicode-range:U+6855,U+6857-6859,U+685B,U+685D,U+685F,U+6863,U+6867,U+686B,U+686E-6872,U+6874-6875,U+6877,U+6879-687C,U+687E-687F,U+6882-6884,U+6886,U+6888,U+688D-6890,U+6894,U+6896,U+6898-689C,U+689F-68A3,U+68A5-68A7,U+68A9-68AB,U+68AD-68AF,U+68B2-68B5,U+68B9-68BC,U+68C3,U+68C5-68C6,U+68C8-68CA,U+68CC-68CD,U+68CF-68D1,U+68D3-68D9,U+68DC-68DD,U+68E0-68E1,U+68E3-68E5,U+68E7-68E8,U+68EA-68ED,U+68EF-68F1,U+68F5-68F7,U+68F9,U+68FB-68FD,U+6900-6901,U+6903-6904,U+6906-690C,U+690F-6911,U+6913,U+6916-6917,U+6919-691B,U+6921-6923,U+6925-6926,U+6928,U+692A,U+6930-6931,U+6933-6936,U+6938-6939,U+693B,U+693D,U+6942,U+6945-6946,U+6949,U+694E,U+6954,U+6957,U+6959,U+695B-695E,U+6961-6966,U+6968-696C,U+696E-6974,U+6977-697B,U+697E-6981,U+6986,U+698D,U+6991-6992,U+6994-6996,U+6998,U+699C,U+69A0-69A1,U+69A5-69A8,U+69AB,U+69AD,U+69AF-69B2,U+69B4,U+69B7-69B8,U+69BA-69BC,U+69BE-69C1,U+69C3,U+69C5,U+69C7-69C8,U+69CA,U+69CE-69D1,U+69D3,U+69D6-69D7,U+69D9}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.36.woff2)format("woff2");unicode-range:U+667E-6680,U+6683-6684,U+6688,U+668B-668E,U+6690,U+6692,U+6698-669D,U+669F-66A0,U+66A2,U+66A4,U+66AD,U+66B1-66B3,U+66B5,U+66B8-66B9,U+66BB-66BC,U+66BE-66C4,U+66C6,U+66C8-66C9,U+66CC,U+66CE-66CF,U+66D4,U+66DA-66DB,U+66DD,U+66DF-66E0,U+66E6,U+66E8-66E9,U+66EB-66EC,U+66EE,U+66F5,U+66F7,U+66FA-66FC,U+6701,U+6705,U+6707,U+670C,U+670E-6710,U+6712-6716,U+6719,U+671C,U+671E,U+6720,U+6722,U+6725-6726,U+672E,U+6733,U+6735-6738,U+673E-673F,U+6741,U+6743,U+6745-6748,U+674C-674D,U+6753-6755,U+6759,U+675D-675E,U+6760,U+6762-6764,U+6766,U+676A,U+676C,U+676E,U+6770,U+6772-6774,U+6776-6777,U+677B-677C,U+6780-6781,U+6784-6785,U+6787,U+6789,U+678B-678C,U+678E-678F,U+6791-6793,U+6796,U+6798-6799,U+679B,U+67A1,U+67A4,U+67A6,U+67A9,U+67B0-67B5,U+67B7-67B9,U+67BB-67BE,U+67C0-67C3,U+67C5-67C6,U+67C8-67C9,U+67CE,U+67D2,U+67D7-67D9,U+67DB-67DE,U+67E1-67E2,U+67E4,U+67E6-67E7,U+67E9,U+67EC,U+67EE-67F0,U+67F2,U+67F6-67F7,U+67F9-67FA,U+67FC,U+67FE,U+6801-6802,U+6805,U+6810,U+6814,U+6818-6819,U+681D,U+681F,U+6822,U+6827-6829,U+682B-682D,U+682F-6834,U+683B,U+683E-6840,U+6844-6846,U+6849-684A,U+684C-684E,U+6852-6854}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.37.woff2)format("woff2");unicode-range:U+64D2,U+64D4-64D5,U+64D7-64D8,U+64DA,U+64E0-64E1,U+64E3-64E5,U+64E7,U+64E9-64EA,U+64ED,U+64EF-64F2,U+64F4-64F7,U+64FA-64FB,U+64FD-6501,U+6504-6505,U+6508-650A,U+650F,U+6513-6514,U+6516,U+6518-6519,U+651B-651F,U+6522,U+6524,U+6526,U+6529-652C,U+652E,U+6531-6532,U+6534-6538,U+653A,U+653C-653D,U+6543-6544,U+6547-6549,U+654D-654E,U+6550,U+6552,U+6554-6556,U+6558,U+655D-6560,U+6567,U+656B,U+6572,U+6578,U+657A,U+657D,U+6581-6585,U+6588,U+658A,U+658C,U+6592,U+6595,U+6598,U+659B,U+659D,U+659F-65A1,U+65A3-65A6,U+65AB,U+65AE,U+65B2-65B5,U+65B7-65B8,U+65BE-65BF,U+65C1-65C4,U+65C6,U+65C8-65C9,U+65CC,U+65CE,U+65D0,U+65D2,U+65D4,U+65D6,U+65D8-65D9,U+65DB,U+65DF-65E1,U+65E3,U+65F0-65F2,U+65F4-65F5,U+65F9,U+65FB-65FC,U+65FE-6600,U+6603-6604,U+6608-660A,U+660D,U+6611-6612,U+6615-6616,U+661C-661E,U+6621-6624,U+6626,U+6629-662C,U+662E,U+6630-6631,U+6633-6637,U+6639-663B,U+663F-6641,U+6644-6646,U+6648-664A,U+664C,U+664E-664F,U+6651,U+6657-6665,U+6667-6668,U+666A-666D,U+6670,U+6673,U+6675,U+6677-6679,U+667B-667C}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.38.woff2)format("woff2");unicode-range:U+62CF,U+62D1,U+62D4-62D6,U+62DA,U+62DC,U+62EA,U+62EE-62EF,U+62F1-62F2,U+62F4-62F5,U+62FC-62FD,U+62FF,U+6302-6304,U+6308-630D,U+6310,U+6313,U+6316,U+6318,U+631B,U+6327,U+6329-632A,U+632D,U+6332,U+6335-6336,U+6339-633C,U+633E,U+6341-6344,U+6346,U+634A-634E,U+6350,U+6352-6354,U+6358-6359,U+635B,U+6365-6366,U+6369,U+636B-636D,U+6371-6372,U+6374-6378,U+637A,U+637C-637D,U+637F-6380,U+6382,U+6384,U+6387,U+6389-638A,U+638E-6390,U+6394-6396,U+6399-639A,U+639E,U+63A0,U+63A3-63A4,U+63A6,U+63A9,U+63AB-63AF,U+63B5,U+63BD-63BE,U+63C0-63C1,U+63C4-63C6,U+63C8,U+63CE,U+63D1-63D6,U+63DC,U+63E0,U+63E3,U+63E5,U+63E9-63ED,U+63F2-63F3,U+63F5-63F9,U+6406,U+6409-640A,U+640F-6410,U+6412-6414,U+6416-6418,U+641E,U+6420,U+6422,U+6424-6426,U+6428-642A,U+642F-6430,U+6434-6436,U+643D,U+643F,U+644B,U+644E-644F,U+6451-6454,U+645A-645D,U+645F-6461,U+6463,U+6467,U+646D,U+6473-6474,U+6476,U+6478-6479,U+647B,U+647D,U+6485,U+6487-6488,U+648F-6491,U+6493,U+6495,U+6498-649B,U+649D-649F,U+64A1,U+64A3,U+64A6,U+64A8-64A9,U+64AC,U+64B3,U+64BB-64BF,U+64C2,U+64C4-64C5,U+64C7,U+64C9-64CC,U+64CE,U+64D0-64D1}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.39.woff2)format("woff2");unicode-range:U+6117,U+6119,U+611C,U+611E,U+6120-6122,U+6127-6128,U+612A-612C,U+6130-6131,U+6134-6137,U+6139-613A,U+613C-613F,U+6141-6142,U+6144-6147,U+6149-614A,U+614D,U+6153,U+6158-615A,U+615D-6160,U+6164-6165,U+616B-616C,U+616F,U+6171-6175,U+6177-6178,U+617B-6181,U+6183-6184,U+6187,U+618A-618B,U+618D,U+6192-6194,U+6196-619A,U+619C-619D,U+619F-61A0,U+61A5,U+61A8,U+61AA-61AE,U+61B8-61BA,U+61BC,U+61BE,U+61C0-61C3,U+61C6,U+61C8,U+61CA-61CF,U+61D5,U+61DC-61DF,U+61E1-61E3,U+61E5-61E9,U+61EC-61ED,U+61EF,U+61F4-61F7,U+61FA,U+61FC-6201,U+6203-6204,U+6207-620A,U+620D-620E,U+6213-6215,U+621B-621E,U+6220-6223,U+6227,U+6229-622B,U+622E,U+6230-6233,U+6236,U+6239,U+623D-623E,U+6241-6244,U+6246,U+6248,U+624C,U+624E,U+6250-6252,U+6254,U+6256,U+6258,U+625A-625C,U+625E,U+6260-6261,U+6263-6264,U+6268,U+626D,U+626F,U+6273,U+627A-627E,U+6282-6283,U+6285,U+6289,U+628D-6290,U+6292-6294,U+6296,U+6299,U+629B,U+62A6,U+62A8,U+62AC,U+62B3,U+62B6-62B7,U+62BA-62BB,U+62BE-62BF,U+62C2,U+62C4,U+62C6-62C8,U+62CA,U+62CE}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.40.woff2)format("woff2");unicode-range:U+5F6C-5F6D,U+5F6F,U+5F72-5F75,U+5F78,U+5F7A,U+5F7D-5F7F,U+5F82-5F83,U+5F87-5F89,U+5F8D,U+5F8F,U+5F91,U+5F96,U+5F99,U+5F9C-5F9D,U+5FA0,U+5FA2,U+5FA4,U+5FA7-5FA8,U+5FAB-5FAD,U+5FAF-5FB1,U+5FB5,U+5FB7-5FB8,U+5FBC-5FBD,U+5FC4,U+5FC7-5FC9,U+5FCB,U+5FD0-5FD4,U+5FDD-5FDE,U+5FE1-5FE2,U+5FE4,U+5FE8-5FEA,U+5FEC-5FF3,U+5FF6,U+5FF8,U+5FFA-5FFD,U+5FFF,U+6007,U+600A,U+600D-6010,U+6013-6015,U+6017-601B,U+601F,U+6021-6022,U+6024,U+6026,U+6029,U+602B,U+602D,U+6031,U+6033,U+6035,U+603A,U+6040-6043,U+6046-604A,U+604C-604D,U+6051,U+6054-6057,U+6059-605A,U+605D,U+605F-6064,U+6067,U+606A-606C,U+6070-6071,U+6077,U+607E-607F,U+6081-6086,U+6088-608E,U+6091-6093,U+6095-6098,U+609A-609B,U+609D-609E,U+60A2,U+60A4-60A5,U+60A7-60A8,U+60B0-60B1,U+60B3-60B5,U+60B7-60B8,U+60BB,U+60BD-60BE,U+60C2,U+60C4,U+60C6-60CB,U+60CE-60CF,U+60D3-60D5,U+60D8-60D9,U+60DB,U+60DD-60DF,U+60E1-60E2,U+60E5,U+60EE,U+60F0-60F2,U+60F4-60F8,U+60FA-60FD,U+6100,U+6102-6103,U+6106-6108,U+610A,U+610C-610E,U+6110-6114,U+6116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.41.woff2)format("woff2");unicode-range:U+5D9B,U+5D9D,U+5D9F-5DA0,U+5DA2,U+5DA4,U+5DA7,U+5DAB-5DAC,U+5DAE,U+5DB0,U+5DB2,U+5DB4,U+5DB7-5DB9,U+5DBC-5DBD,U+5DC3,U+5DC7,U+5DC9,U+5DCB-5DCE,U+5DD0-5DD3,U+5DD6-5DD9,U+5DDB,U+5DE0,U+5DE2,U+5DE4,U+5DE9,U+5DF2,U+5DF5,U+5DF8-5DF9,U+5DFD,U+5DFF-5E00,U+5E07,U+5E0B,U+5E0D,U+5E11-5E12,U+5E14-5E15,U+5E18-5E1B,U+5E1F-5E20,U+5E25,U+5E28,U+5E2E,U+5E32,U+5E35-5E37,U+5E3E,U+5E40,U+5E43-5E44,U+5E47,U+5E49,U+5E4B,U+5E4E,U+5E50-5E51,U+5E54,U+5E56-5E58,U+5E5B-5E5C,U+5E5E-5E5F,U+5E62,U+5E64,U+5E68,U+5E6A-5E6E,U+5E70,U+5E75-5E77,U+5E7A,U+5E7F-5E80,U+5E87,U+5E8B,U+5E8E,U+5E96,U+5E99-5E9A,U+5EA0,U+5EA2,U+5EA4-5EA5,U+5EA8,U+5EAA,U+5EAC,U+5EB1,U+5EB3,U+5EB8-5EB9,U+5EBD-5EBF,U+5EC1-5EC2,U+5EC6,U+5EC8,U+5ECB-5ECC,U+5ECE-5ED6,U+5ED9-5EE2,U+5EE5,U+5EE8-5EE9,U+5EEB-5EEC,U+5EF0-5EF1,U+5EF3-5EF4,U+5EF8-5EF9,U+5EFC-5F00,U+5F02-5F03,U+5F06-5F09,U+5F0B-5F0E,U+5F11,U+5F16-5F17,U+5F19,U+5F1B-5F1E,U+5F21-5F24,U+5F27-5F29,U+5F2B-5F30,U+5F34,U+5F36,U+5F38,U+5F3A-5F3D,U+5F3F-5F41,U+5F44-5F45,U+5F47-5F48,U+5F4A,U+5F4C-5F4E,U+5F50-5F51,U+5F54,U+5F56-5F58,U+5F5B-5F5D,U+5F60,U+5F63-5F65,U+5F67,U+5F6A}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.42.woff2)format("woff2");unicode-range:U+5BBC,U+5BC0-5BC1,U+5BC3,U+5BC7,U+5BC9,U+5BCD-5BD0,U+5BD3-5BD4,U+5BD6-5BDA,U+5BDE,U+5BE0-5BE2,U+5BE4-5BE6,U+5BE8,U+5BEB-5BEC,U+5BEF-5BF1,U+5BF3-5BF6,U+5BFD,U+5C03,U+5C05,U+5C07-5C09,U+5C0C-5C0D,U+5C12-5C14,U+5C17,U+5C19,U+5C1E-5C20,U+5C22-5C24,U+5C26,U+5C28-5C2E,U+5C30,U+5C32,U+5C35-5C36,U+5C38-5C39,U+5C46,U+5C4D-5C50,U+5C53,U+5C59-5C5C,U+5C5F-5C63,U+5C67-5C69,U+5C6C-5C70,U+5C74-5C76,U+5C79-5C7D,U+5C87-5C88,U+5C8A,U+5C8C,U+5C8F,U+5C91-5C92,U+5C94,U+5C9D,U+5C9F-5CA0,U+5CA2-5CA3,U+5CA6-5CA8,U+5CAA-5CAB,U+5CAD,U+5CB1-5CB2,U+5CB4-5CB7,U+5CBA-5CBC,U+5CBE,U+5CC5,U+5CC7,U+5CC9,U+5CCB,U+5CD0,U+5CD2,U+5CD7,U+5CD9,U+5CDD,U+5CE6,U+5CE8-5CEA,U+5CED-5CEE,U+5CF1-5CF2,U+5CF4-5CF5,U+5CFA-5CFB,U+5CFD,U+5D01,U+5D06,U+5D0B,U+5D0D,U+5D10-5D12,U+5D14-5D15,U+5D17-5D1B,U+5D1D,U+5D1F-5D20,U+5D22-5D24,U+5D26-5D27,U+5D2B,U+5D31,U+5D34,U+5D39,U+5D3D,U+5D3F,U+5D42-5D43,U+5D46-5D48,U+5D4A-5D4B,U+5D4E,U+5D51-5D53,U+5D55,U+5D59,U+5D5C,U+5D5F-5D62,U+5D64,U+5D69-5D6A,U+5D6C-5D6D,U+5D6F-5D70,U+5D73,U+5D76,U+5D79-5D7A,U+5D7E-5D7F,U+5D81-5D84,U+5D87-5D88,U+5D8A,U+5D8C,U+5D90,U+5D92-5D95,U+5D97,U+5D99}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.43.woff2)format("woff2");unicode-range:U+598B-598E,U+5992,U+5995,U+5997,U+599B,U+599D,U+599F,U+59A3-59A4,U+59A7,U+59AD-59B0,U+59B2-59B3,U+59B7,U+59BA,U+59BC,U+59BE,U+59C1,U+59C3-59C4,U+59C6,U+59C8,U+59CA,U+59CD,U+59D2,U+59D9-59DA,U+59DD-59DF,U+59E3-59E5,U+59E7-59E8,U+59EC,U+59EE-59EF,U+59F1-59F2,U+59F4,U+59F6-59F8,U+5A00,U+5A03-5A04,U+5A09,U+5A0C-5A0E,U+5A11-5A13,U+5A17,U+5A1A-5A1C,U+5A1E-5A1F,U+5A23-5A25,U+5A27-5A28,U+5A2A,U+5A2D,U+5A30,U+5A35-5A36,U+5A40-5A41,U+5A44-5A45,U+5A47-5A49,U+5A4C,U+5A50,U+5A55,U+5A5E,U+5A62-5A63,U+5A65,U+5A67,U+5A6A,U+5A6C-5A6D,U+5A77,U+5A7A-5A7B,U+5A7E,U+5A84,U+5A8B,U+5A90,U+5A93,U+5A96,U+5A99,U+5A9C,U+5A9E-5AA0,U+5AA2,U+5AA7,U+5AAC,U+5AB1-5AB3,U+5AB5,U+5AB8,U+5ABA-5ABF,U+5AC2,U+5AC4,U+5AC6,U+5AC8,U+5ACB,U+5ACF-5AD0,U+5AD6-5AD7,U+5ADA,U+5ADC,U+5AE0-5AE1,U+5AE3,U+5AE5-5AE6,U+5AE9-5AEA,U+5AEE,U+5AF0,U+5AF5-5AF6,U+5AFA-5AFB,U+5AFD,U+5B00-5B01,U+5B08,U+5B0B,U+5B16-5B17,U+5B19,U+5B1B,U+5B1D,U+5B21,U+5B25,U+5B2A,U+5B2C-5B2D,U+5B30,U+5B32,U+5B34,U+5B36,U+5B38,U+5B3E,U+5B40-5B41,U+5B43,U+5B45,U+5B4B-5B4C,U+5B51-5B52,U+5B56,U+5B5A-5B5C,U+5B5E-5B5F,U+5B65,U+5B68-5B69,U+5B6E-5B71,U+5B73,U+5B75-5B76,U+5B7A,U+5B7C-5B84,U+5B86,U+5B8A-5B8B,U+5B8D-5B8E,U+5B90-5B91,U+5B93-5B94,U+5B96,U+5BA5-5BA6,U+5BA8-5BA9,U+5BAC-5BAD,U+5BAF,U+5BB1-5BB2,U+5BB7-5BB8,U+5BBA}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.44.woff2)format("woff2");unicode-range:U+57B3,U+57B8,U+57BD,U+57C0,U+57C3,U+57C6-57C8,U+57CC,U+57CF,U+57D2-57D7,U+57DC-57DE,U+57E0-57E1,U+57E3-57E4,U+57E6-57E7,U+57E9,U+57ED,U+57F0,U+57F4-57F6,U+57F8,U+57FB,U+57FD-57FF,U+5803-5804,U+5808-580D,U+5819,U+581B,U+581D-5821,U+5826-5827,U+582D,U+582F-5830,U+5832,U+5835,U+5839,U+583D,U+583F-5840,U+5849,U+584B-584D,U+584F-5852,U+5855,U+5858-5859,U+585F,U+5861-5862,U+5864,U+5867-5868,U+586D,U+5870,U+5872,U+5878-5879,U+587C,U+587F-5881,U+5885,U+5887-588D,U+588F-5890,U+5894,U+5896,U+5898,U+589D-589E,U+58A0-58A2,U+58A6,U+58A9-58AB,U+58AE,U+58B1-58B3,U+58B8-58BC,U+58BE,U+58C2-58C5,U+58C8,U+58CD-58CE,U+58D0-58DA,U+58DC-58E2,U+58E4-58E5,U+58E9,U+58EC,U+58EF,U+58F3-58F4,U+58F7,U+58F9,U+58FB-58FD,U+5902,U+5905-5906,U+590A-590D,U+5910,U+5912-5914,U+5918-5919,U+591B,U+591D,U+591F,U+5921,U+5923-5925,U+5928,U+592C-592D,U+592F-5930,U+5932-5933,U+5935-5936,U+5938-5939,U+593D-593F,U+5943,U+5946,U+594E,U+5950,U+5952-5953,U+5955,U+5957-595B,U+595D-5961,U+5963,U+5967,U+5969,U+596B-596D,U+596F,U+5972,U+5975-5976,U+5978-5979,U+597B-597C,U+5981}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.45.woff2)format("woff2");unicode-range:U+5616-5617,U+5619,U+561B,U+5620,U+5628,U+562C,U+562F-5639,U+563B-563D,U+563F-5641,U+5643-5644,U+5646-5647,U+5649,U+564B,U+564D-5650,U+5653-5654,U+565E,U+5660-5664,U+5666,U+5669-566D,U+566F,U+5671-5672,U+5675-5676,U+5678,U+567A,U+5680,U+5684-5688,U+568A-568C,U+568F,U+5694-5695,U+5699-569A,U+569D-56A0,U+56A5-56A9,U+56AB-56AE,U+56B1-56B4,U+56B6-56B7,U+56BC,U+56BE,U+56C0,U+56C2-56C3,U+56C5,U+56C8-56D1,U+56D3,U+56D7-56D9,U+56DC-56DD,U+56DF,U+56E1,U+56E4-56E8,U+56EB,U+56ED-56EE,U+56F1,U+56F6-56F7,U+56F9,U+56FF-5704,U+5707-570A,U+570C-570D,U+5711,U+5713,U+5715-5716,U+5718,U+571A-571D,U+5720-5726,U+5729-572A,U+572C,U+572E-572F,U+5733-5734,U+5737-5738,U+573B,U+573D-573F,U+5745-5746,U+574C-574F,U+5751-5752,U+5759,U+575F,U+5761-5762,U+5764-5765,U+5767-5769,U+576B,U+576D-5771,U+5773-5775,U+5777,U+5779-577C,U+577E-577F,U+5781,U+5783,U+5788-5789,U+578C,U+5793-5795,U+5797,U+5799-579A,U+579C-57A1,U+57A4,U+57A7-57AA,U+57AC,U+57AE,U+57B0}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.46.woff2)format("woff2");unicode-range:U+543F-5440,U+5443-5444,U+5447,U+544C-544F,U+5455,U+545E,U+5462,U+5464,U+5466-5467,U+5469,U+546B-546E,U+5470-5471,U+5474-5477,U+547B,U+547F-5481,U+5483-5486,U+5488-548B,U+548D-5492,U+5495-5496,U+549C,U+549F-54A2,U+54A4,U+54A6-54AF,U+54B1,U+54B7-54BC,U+54BE-54BF,U+54C2-54C4,U+54C6-54C8,U+54CA,U+54CD-54CE,U+54D8,U+54E0,U+54E2,U+54E5-54E6,U+54E8-54EA,U+54EC-54EF,U+54F1,U+54F3,U+54F6,U+54FC-5501,U+5505,U+5508-5509,U+550C-550F,U+5514-5516,U+5527,U+552A-552B,U+552E,U+5532-5533,U+5535-5536,U+5538-5539,U+553B-553D,U+5540-5541,U+5544-5545,U+5547,U+5549-554A,U+554C-554D,U+5550-5551,U+5556-5558,U+555A-555E,U+5560-5561,U+5563-5564,U+5566,U+557B-5583,U+5586-5588,U+558A,U+558E-558F,U+5591-5594,U+5597,U+5599,U+559E-559F,U+55A3-55A4,U+55A8-55A9,U+55AC-55AE,U+55B2,U+55BF,U+55C1,U+55C3-55C4,U+55C6-55C7,U+55C9,U+55CB-55CC,U+55CE,U+55D1-55D4,U+55D7-55D8,U+55DA-55DB,U+55DD-55DF,U+55E2,U+55E4,U+55E9,U+55EC,U+55EE,U+55F1,U+55F6-55F9,U+55FD-55FF,U+5605,U+5607-5608,U+560A,U+560D-5612}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.47.woff2)format("woff2");unicode-range:U+528D,U+5291-5298,U+529A,U+529C,U+52A4-52A7,U+52AB-52AD,U+52AF-52B0,U+52B5-52B8,U+52BA-52BE,U+52C0-52C1,U+52C4-52C6,U+52C8,U+52CA,U+52CC-52CD,U+52CF-52D2,U+52D4,U+52D6-52D7,U+52DB-52DC,U+52DE,U+52E0-52E1,U+52E3,U+52E5-52E6,U+52E8-52EA,U+52EC,U+52F0-52F1,U+52F3-52FB,U+5300-5301,U+5303,U+5306-5308,U+530A-530D,U+530F-5311,U+5313,U+5315,U+5318-531F,U+5321,U+5323-5325,U+5327-532D,U+532F-5333,U+5335,U+5338,U+533C-533E,U+5340,U+5342,U+5345-5346,U+5349,U+534B-534C,U+5359,U+535B,U+535E,U+5361,U+5363-5367,U+5369,U+536C-536E,U+5372,U+5377,U+5379-537B,U+537D-537F,U+5382-5383,U+5387-5389,U+538E,U+5393-5394,U+5396,U+5398-5399,U+539D,U+53A0-53A1,U+53A4-53A6,U+53A9-53AB,U+53AD-53B0,U+53B2,U+53B4-53B8,U+53BA,U+53BD,U+53C0-53C1,U+53C3-53C5,U+53CF,U+53D2-53D3,U+53D5,U+53DA-53DB,U+53DD-53E0,U+53E2,U+53E6-53E8,U+53ED-53EE,U+53F4-53F5,U+53FA,U+5401-5403,U+540B,U+540F,U+5412-5413,U+541A,U+541D-541E,U+5421,U+5424,U+5427-542A,U+542C-542F,U+5431,U+5433-5436,U+543C-543D}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.48.woff2)format("woff2");unicode-range:U+50DD-50DF,U+50E1-50E6,U+50E8-50E9,U+50ED-50F6,U+50F9-50FB,U+50FE,U+5101-5103,U+5106-5109,U+510B-510E,U+5110,U+5112,U+5114-511E,U+5121,U+5123,U+5127-5128,U+512C-512D,U+512F,U+5131,U+5133-5135,U+5137-513C,U+513F-5142,U+5147,U+514A,U+514C,U+514F,U+5152-5155,U+5157-5158,U+515F-5160,U+5162,U+5164,U+5166-5167,U+5169-516A,U+516E,U+5173-5174,U+5179,U+517B,U+517E,U+5180,U+5182-5184,U+5189,U+518B-518C,U+518E-5191,U+5193,U+5195-5196,U+5198,U+519D,U+51A1-51A4,U+51A6,U+51A9-51AB,U+51AD,U+51B0-51B3,U+51B5,U+51B8,U+51BA,U+51BC-51BF,U+51C2-51C3,U+51C5,U+51C8-51CB,U+51CF,U+51D1-51D6,U+51D8,U+51DE-51E0,U+51E2,U+51E5,U+51E7,U+51E9,U+51EC-51EE,U+51F2-51F5,U+51F7,U+51FE,U+5201-5202,U+5204-5205,U+520B,U+520E,U+5212-5216,U+5218,U+5222,U+5226-5228,U+522A-522B,U+522E,U+5231-5233,U+5235,U+523C,U+5244-5245,U+5249,U+524B-524C,U+524F,U+5254-5255,U+5257-5258,U+525A,U+525C-5261,U+5266,U+5269,U+526C,U+526E,U+5271,U+5273-5274,U+5277-5279,U+527D,U+527F-5280,U+5282-5285,U+5288-528A,U+528C}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.49.woff2)format("woff2");unicode-range:U+4F57-4F58,U+4F5A-4F5B,U+4F5D-4F5F,U+4F63-4F64,U+4F69-4F6A,U+4F6C,U+4F6E-4F71,U+4F76-4F7E,U+4F81-4F85,U+4F88-4F8A,U+4F8C,U+4F8E-4F90,U+4F92-4F94,U+4F96-4F9A,U+4F9E-4FA0,U+4FAB,U+4FAD,U+4FAF,U+4FB2,U+4FB7,U+4FB9,U+4FBB-4FBE,U+4FC0-4FC1,U+4FC4-4FC6,U+4FC8-4FC9,U+4FCB-4FD4,U+4FD8,U+4FDA-4FDC,U+4FDF-4FE0,U+4FE2,U+4FE4-4FE6,U+4FEF-4FF2,U+4FF6,U+4FFC-5002,U+5004-5007,U+500A,U+500C,U+500E-5011,U+5013-5014,U+5016-5018,U+501A-501E,U+5021-5023,U+5025-502A,U+502C-502E,U+5030,U+5032-5033,U+5035,U+5039,U+503B,U+5040-5043,U+5045-5048,U+504A,U+504C,U+504E,U+5050-5053,U+5055-5057,U+5059-505A,U+505F-5060,U+5062-5063,U+5066-5067,U+506A,U+506C-506D,U+5070-5072,U+5077-5078,U+5080-5081,U+5083-5086,U+5088,U+508A,U+508E-5090,U+5092-5096,U+509A-509C,U+509E-50A3,U+50AA,U+50AD,U+50AF-50B4,U+50B9-50BB,U+50BD,U+50C0,U+50C2-50C4,U+50C7,U+50C9-50CA,U+50CC,U+50CE,U+50D0-50D1,U+50D3-50D4,U+50D6,U+50D8-50D9,U+50DC}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.50.woff2)format("woff2");unicode-range:U+4093,U+4103,U+4105,U+4148,U+414F,U+4163,U+41B4,U+41BF,U+41E6,U+41EE,U+41F3,U+4207,U+420E,U+4264,U+4293,U+42C6,U+42D6,U+42DD,U+4302,U+432B,U+4343,U+43EE,U+43F0,U+4408,U+440C,U+4417,U+441C,U+4422,U+4453,U+445B,U+4476,U+447A,U+4491,U+44B3,U+44BE,U+44D4,U+4508,U+450D,U+4525,U+4543,U+457A,U+459D,U+45B8,U+45BE,U+45E5,U+45EA,U+460F-4610,U+4641,U+4665,U+46A1,U+46AE-46AF,U+470C,U+471F,U+4764,U+47E6,U+47FD,U+4816,U+481E,U+4844,U+484E,U+48B5,U+49B0,U+49E7,U+49FA,U+4A04,U+4A29,U+4ABC,U+4B38,U+4B3B,U+4B7E,U+4BC2,U+4BCA,U+4BD2,U+4BE8,U+4C17,U+4C20,U+4C38,U+4CC4,U+4CD1,U+4CE1,U+4D07,U+4D77,U+4E02,U+4E04-4E05,U+4E0C,U+4E0F-4E12,U+4E15,U+4E17,U+4E19,U+4E1E-4E1F,U+4E23-4E24,U+4E28-4E2C,U+4E2E-4E31,U+4E35-4E37,U+4E3F-4E42,U+4E44,U+4E47-4E48,U+4E4D-4E4E,U+4E51,U+4E55-4E56,U+4E58,U+4E5A-4E5C,U+4E62-4E63,U+4E68-4E69,U+4E74-4E75,U+4E79,U+4E7F,U+4E82,U+4E85,U+4E8A,U+4E8D-4E8E,U+4E96-4E99,U+4E9D-4EA0,U+4EA2,U+4EA5-4EA6,U+4EA8,U+4EAF-4EB0,U+4EB3,U+4EB6,U+4EB9,U+4EBB-4EBC,U+4EC2-4EC4,U+4EC6-4EC8,U+4ECD,U+4ED0,U+4ED7,U+4EDA-4EDB,U+4EDD-4EE2,U+4EE8,U+4EEB,U+4EED,U+4EEF,U+4EF1,U+4EF3,U+4EF5,U+4EF7,U+4EFC-4F00,U+4F02-4F03,U+4F08-4F09,U+4F0B-4F0D,U+4F12,U+4F15-4F17,U+4F19,U+4F1C,U+4F2B,U+4F2E,U+4F30-4F31,U+4F33,U+4F35-4F37,U+4F39,U+4F3B,U+4F3E,U+4F40,U+4F42-4F43,U+4F48-4F49,U+4F4B-4F4C,U+4F52,U+4F54,U+4F56}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.52.woff2)format("woff2");unicode-range:U+32B5-332B,U+332D-3394}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.53.woff2)format("woff2");unicode-range:U+31C8-31E3,U+31F0-321E,U+3220-3230,U+3232-32B4}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.54.woff2)format("woff2");unicode-range:U+3028-303F,U+3094-3096,U+309F-30A0,U+30EE,U+30F7-30FA,U+30FF,U+3105-312F,U+3131-3163,U+3165-318E,U+3190-31BB,U+31C0-31C7}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.55.woff2)format("woff2");unicode-range:U+2F14-2FD5,U+2FF0-2FFB,U+3004,U+3013,U+3016-301B,U+301E,U+3020-3027}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.56.woff2)format("woff2");unicode-range:U+25E4-25E6,U+2601-2603,U+2609,U+260E-260F,U+2616-2617,U+261C-261F,U+262F,U+2641,U+2660,U+2662-2664,U+2666-2668,U+266D-266E,U+2672-267D,U+26BD-26BE,U+2702,U+271A,U+273D,U+2740,U+2756,U+2776-2793,U+27A1,U+2934-2935,U+29BF,U+29FA-29FB,U+2B05-2B07,U+2B1A,U+2B95,U+2E3A-2E3B,U+2E80-2E99,U+2E9B-2EF3,U+2F00-2F13}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.57.woff2)format("woff2");unicode-range:U+24D1-24FF,U+2503-2513,U+2515-2516,U+2518-251B,U+251D-2522,U+2524-259F,U+25A2-25AB,U+25B1,U+25B7,U+25C0-25C1,U+25C9-25CA,U+25CC,U+25D0-25D3,U+25E2-25E3}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.58.woff2)format("woff2");unicode-range:U+2105,U+2109-210A,U+210F,U+2116,U+2121,U+2126-2127,U+212B,U+212E,U+2135,U+213B,U+2194-2199,U+21B8-21B9,U+21C4-21C6,U+21CB-21CC,U+21D0,U+21E6-21E9,U+21F5,U+2202-2203,U+2205-2206,U+2208-220B,U+220F,U+2211,U+2213,U+2215,U+221A,U+221D,U+2220,U+2223,U+2225-2226,U+2228,U+222A-222E,U+2234-2237,U+223D,U+2243,U+2245,U+2248,U+224C,U+2260,U+2262,U+2264-2265,U+226E-226F,U+2272-2273,U+2276-2277,U+2283-2287,U+228A-228B,U+2295-2299,U+22A0,U+22A5,U+22BF,U+22DA-22DB,U+22EF,U+2305-2307,U+2318,U+2329-232A,U+23B0-23B1,U+23BE-23CC,U+23CE,U+23DA-23DB,U+2423,U+2469-24D0}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.59.woff2)format("woff2");unicode-range:U+A1-A4,U+A6-A7,U+AA,U+AC-AD,U+B5-B6,U+B8-BA,U+BC-C8,U+CA-CC,U+CE-D5,U+D9-DB,U+DD-DF,U+E6,U+EE,U+F0,U+F5,U+F7,U+F9,U+FB,U+FE-102,U+110-113,U+11A-11B,U+128-12B,U+143-144,U+147-148,U+14C,U+14E-14F,U+152-153,U+168-16D,U+192,U+1A0-1A1,U+1AF,U+1CD-1DC,U+1F8-1F9,U+251,U+261,U+2BB,U+2C7,U+2C9,U+2EA-2EB,U+304,U+307,U+30C,U+1E3E-1E3F,U+1EA0-1EBE,U+1EC0-1EC6,U+1EC8-1EF9,U+2011-2012,U+2016,U+2018-201A,U+201E,U+2021,U+2030,U+2033,U+2035,U+2042,U+2047,U+2051,U+2074,U+20A9,U+20AB-20AC,U+20DD-20DE,U+2100}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.60.woff2)format("woff2");unicode-range:U+2227,U+26A0,U+2713,U+301F,U+4FF8,U+5239,U+526A,U+54FA,U+5740,U+5937,U+5993,U+59FB,U+5A3C,U+5C41,U+6028,U+626E,U+646F,U+647A,U+64B0,U+64E2,U+65A7,U+66FE,U+6727,U+6955,U+6BEF,U+6F23,U+724C,U+767C,U+7A83,U+7AC4,U+7B67,U+8000,U+8471,U+8513,U+8599,U+86DB,U+8718,U+87F2,U+88F3,U+8AD2,U+8E2A,U+8FA3,U+95A5,U+9798,U+9910,U+9957,U+9BAB,U+9C3B,U+9DAF,U+FF95}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.61.woff2)format("woff2");unicode-range:U+A8,U+2032,U+2261,U+2282,U+3090,U+30F1,U+339C,U+535C,U+53D9,U+56A2,U+56C1,U+5806,U+589F,U+59D0,U+5A7F,U+60E0,U+639F,U+65AF,U+68FA,U+69AE,U+6D1B,U+6EF2,U+71FB,U+725D,U+7262,U+75BC,U+7768,U+7940,U+79BF,U+7BED,U+7D68,U+7DFB,U+814B,U+8207,U+83E9,U+8494,U+8526,U+8568,U+85EA,U+86D9,U+87BA,U+8861,U+887F,U+8FE6,U+9059,U+9061,U+916A,U+976D,U+97AD,U+9ECE}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.62.woff2)format("woff2");unicode-range:U+2D9,U+21D4,U+301D,U+515C,U+52FE,U+5420,U+5750,U+5766,U+5954,U+5B95,U+5F8A,U+5F98,U+620C,U+621F,U+641C,U+66D9,U+676D,U+6775,U+67F5,U+694A,U+6A02,U+6A3A,U+6A80,U+6C23,U+6C72,U+6DCB,U+6FAA,U+707C,U+71C8,U+7422,U+74E2,U+7791,U+7825,U+7A14,U+7A1C,U+7C95,U+7FC1,U+82A5,U+82DB,U+8304,U+853D,U+8CD3,U+8DE8,U+8F0C,U+8F3F,U+9091,U+91C7,U+929A,U+98AF,U+9913}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.63.woff2)format("woff2");unicode-range:U+2CA-2CB,U+2229,U+2468,U+2669,U+266F,U+273F,U+4EC0,U+4F60,U+4FB6,U+5347,U+540E,U+543B,U+5B0C,U+5D4C,U+5F14,U+5F9E,U+6155,U+62D0,U+6602,U+6666,U+66F3,U+67A2,U+67CA,U+69CC,U+6D29,U+6D9B,U+6E3E,U+6F81,U+7109,U+73C0,U+73C2,U+7425,U+7435-7436,U+7525,U+7554,U+785D,U+786B,U+7AE3,U+7B94,U+7D18,U+81BF,U+8511,U+8549,U+9075,U+9640,U+98E2,U+9E9F,U+FF96}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.64.woff2)format("woff2");unicode-range:U+2467,U+4ECE,U+4ED4,U+4F91,U+4FAE,U+534D,U+53C9,U+54B3,U+586B,U+5944,U+5B78,U+5DF7,U+5F77,U+6101,U+6167-6168,U+61A4,U+62D9,U+698A,U+699B,U+6A59,U+6CC4,U+6E07,U+7099,U+75D2,U+77AD,U+7953,U+7984,U+7A92,U+7BAA,U+7DBB,U+817F,U+82AD,U+85E9,U+868A,U+8CAA,U+8F44,U+9017,U+907C,U+908A,U+92F3,U+936E,U+9435,U+978D,U+9838,U+9A28,U+9B41,U+9BA8,U+9C57,U+9EB9}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.65.woff2)format("woff2");unicode-range:U+B1,U+309B,U+4E5E,U+51F1,U+5506,U+55C5,U+58CC,U+59D1,U+5C51,U+5EF7,U+6284,U+62D7,U+6689,U+673D,U+6A2B,U+6A8E,U+6A9C,U+6D63,U+6DD1,U+70B8,U+7235,U+72DB,U+72F8,U+7560,U+7C9B,U+7CE7,U+7E1E,U+80AF,U+82EB,U+8463,U+8499,U+85DD,U+86EE,U+8A60,U+8A6E,U+8C79,U+8E87,U+8E8A,U+8F5F,U+9010,U+918D,U+9190,U+965B,U+97FB,U+9AB8,U+9BAD,U+9D3B,U+9D5C,U+9DFA,U+9E93}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.66.woff2)format("woff2");unicode-range:U+2020,U+3003,U+3231,U+4E9B,U+4F3D,U+4F47,U+51B6,U+51DC,U+53E1,U+5BC5,U+602F,U+60BC,U+61C9,U+633D,U+637B,U+6492,U+65FA,U+660F,U+66F0,U+6703,U+681E,U+6876,U+6893,U+6912,U+698E,U+6C7D,U+714C,U+7169,U+71D5,U+725F,U+72D7,U+745B,U+74DC,U+75E2,U+7891,U+7897,U+7DCB,U+810A,U+8218,U+8339,U+840E,U+852D,U+8823,U+8A0A,U+9089,U+919C,U+971C,U+9AD9,U+FF4A,U+FF5A}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.67.woff2)format("woff2");unicode-range:U+2466,U+2600,U+4EAB,U+4FE3,U+4FF5,U+51A5,U+51F0,U+536F,U+53D4,U+53F1,U+54A5,U+559D,U+55E3,U+58FA,U+5962,U+59EA,U+5C16,U+5CEF,U+5D16,U+5F10,U+5FD6,U+6190,U+6216,U+634F,U+63BB,U+66D6,U+6756,U+6BC5,U+6E26,U+727D,U+731F,U+76F2,U+7729,U+7A7F,U+7AFF,U+7C9F,U+818F,U+8236,U+82B9,U+8338,U+85AA,U+88B4,U+8B33,U+904D,U+93A7,U+96CC,U+96EB,U+9AED,U+9B8E,U+FA11}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.68.woff2)format("woff2");unicode-range:U+251C,U+2523,U+4E14,U+545F,U+54BD,U+553E,U+55DC,U+56DA,U+589C,U+5B55,U+5BB5,U+5CE1,U+5DF4,U+5EB6,U+5EC9,U+6191,U+62F7,U+6357,U+64A5,U+6591,U+65BC,U+6897,U+6E1A,U+7063,U+711A,U+721B,U+722C,U+75B9,U+75D5,U+75FA,U+7766,U+7AAE,U+7B48,U+7B8B,U+7D21,U+7E55,U+7F75,U+842C,U+8910,U+8A63,U+8B39,U+8B5A,U+8CDC,U+8D74,U+907D,U+91E7,U+9306,U+96BC,U+98F4,U+9AC4}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.69.woff2)format("woff2");unicode-range:U+2003,U+2312,U+266C,U+4F86,U+51EA,U+5243,U+5256,U+541F,U+5841,U+59DC,U+5DF3,U+601C,U+60E7,U+632B,U+638C,U+64AD,U+6881,U+697C,U+69CD,U+6C50,U+6D2A,U+6FC1,U+7027,U+7058,U+70F9,U+714E,U+7345,U+751A,U+760D,U+764C,U+77DB,U+7D79,U+7E8F,U+80CE,U+814E,U+81FC,U+8247,U+8278,U+85A9,U+8A03,U+90ED,U+9784,U+9801,U+984E,U+99B3,U+9BC9,U+9BDB,U+9BE8,U+9E78,U+FF6B}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.70.woff2)format("woff2");unicode-range:U+266B,U+3006,U+5176,U+5197,U+51A8,U+51C6,U+52F2,U+5614,U+5875,U+5A2F,U+5B54,U+5CE0,U+5DBA,U+5DEB,U+5E63,U+5F59,U+5FCC,U+6068,U+6367,U+68B6,U+6A0B,U+6B64,U+6E15,U+6EBA,U+7272,U+72A0,U+7947,U+7985,U+79E6,U+79E9,U+7A3D,U+7A9F,U+7AAF,U+7B95,U+7F60,U+7F9E,U+7FE0,U+8098,U+80BA,U+8106,U+82D4,U+831C,U+87F9,U+8A1F,U+8ACF,U+90C1,U+920D,U+9756,U+FE43,U+FF94}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.71.woff2)format("woff2");unicode-range:U+AF,U+2465,U+2517,U+33A1,U+4F10,U+50C5,U+51B4,U+5384,U+5606,U+5BB0,U+5CAC,U+5EE3,U+618E,U+61F2,U+62C9,U+66AB,U+66F9,U+6816,U+6960,U+6B3E,U+6F20,U+7078,U+72D0,U+73ED,U+7AD9,U+7B1B,U+7BE4,U+7D62,U+7F51,U+80B4,U+80F4,U+8154,U+85FB,U+865C,U+8702,U+895F,U+8AED,U+8B90,U+8CED,U+8FBF,U+91D8,U+9418,U+9583,U+9591,U+9813,U+982C,U+9BD6,U+FF46,U+FF7F,U+FF88}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.72.woff2)format("woff2");unicode-range:U+4E91,U+508D,U+50E7,U+514E,U+51F6,U+5446,U+5504,U+584A,U+59A8,U+59D3,U+5A46,U+5AC9,U+6020,U+60A6,U+6148,U+621A,U+6234,U+64C1,U+6523,U+675C,U+67D1,U+6953,U+6CCC,U+6DF5,U+6E13,U+6F06,U+723A,U+7325,U+74E6,U+758E,U+75AB,U+75D9,U+7A40,U+8096,U+82FA,U+8587,U+8594,U+8A6B,U+8AB9,U+8B17,U+8B83,U+937C,U+963B,U+9673,U+96DB,U+9CE9,U+9F4B,U+FF67,U+FF82,U+FF93}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.73.woff2)format("woff2");unicode-range:U+221E,U+2514,U+51F9,U+5270,U+5449,U+5824,U+59A5,U+5A29,U+5D07,U+5E16,U+60E3,U+614C,U+6276,U+643E,U+64AB,U+6562,U+6681,U+670B,U+6734,U+67AF,U+6A3D,U+6B05,U+6DC0,U+6E4A,U+7259,U+732A,U+7409,U+78A7,U+7A6B,U+8015,U+809B,U+817A,U+830E,U+837B,U+85AB,U+8A23,U+8A93,U+8B00,U+8B19,U+8B21,U+8CBF,U+8FB0,U+901D,U+91B8,U+9320,U+932C,U+9688,U+96F6,U+9DF2,U+FF6A}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.74.woff2)format("woff2");unicode-range:U+2002,U+2025,U+4F8D,U+51E1,U+51F8,U+5507,U+5598,U+58F1,U+5983,U+59AC,U+5C3C,U+5DE7,U+5E7D,U+5ECA,U+5F61,U+606D,U+60F9,U+636E,U+64EC,U+67DA,U+67FF,U+6813,U+68F2,U+693F,U+6B6A,U+6BBB,U+6EF4,U+7092,U+717D,U+7261,U+73C8,U+7432,U+7483,U+76FE,U+7709,U+78D0,U+81A3,U+81B3,U+82AF,U+8305,U+8309,U+8870,U+88FE,U+8CD1,U+8D66,U+906E,U+971E,U+9812,U+FF79,U+FF90}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.75.woff2)format("woff2");unicode-range:U+2464,U+2501,U+2640,U+2642,U+339D,U+4F0E,U+5091,U+50B5,U+5132,U+51CC,U+558B,U+55AA,U+585E,U+5BEE,U+5DFE,U+60B6,U+62B9,U+6349,U+6566,U+6590,U+6842,U+689D,U+6A58,U+6C70,U+6FF1,U+7815,U+7881,U+7AAA,U+7BC7,U+7DEF,U+7FA8,U+8017,U+8036,U+8061,U+821F,U+8429,U+8CE0,U+8E74,U+9019,U+90CA,U+9162,U+932F,U+93AE,U+9644,U+990C,U+9CF3,U+FF56,U+FF6E,U+FF7E,U+FF85}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.76.woff2)format("woff2");unicode-range:U+2266-2267,U+4F2F,U+5208,U+5451,U+546A,U+5589,U+576A,U+5815,U+5A9A,U+5B9B,U+5C3A,U+5EFB,U+5FAA,U+6109,U+6643,U+6652,U+695A,U+69FD,U+6B86,U+6BB4,U+6DAF,U+7089,U+70CF,U+7A00,U+7A4F,U+7B39,U+7D33,U+80E1,U+828B,U+82A6,U+86CD,U+8C8C,U+8CCA,U+8DF3,U+9077,U+9175,U+91DC,U+925B,U+9262,U+9271,U+92ED,U+9855,U+9905,U+9D28,U+FF3F,U+FF58,U+FF68,U+FF6D,U+FF9C}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.77.woff2)format("woff2");unicode-range:U+2207,U+25EF,U+309C,U+4E4F,U+5146,U+51DD,U+5351,U+540A,U+5629,U+5EB5,U+5F04,U+5F13,U+60DC,U+6212,U+63B4,U+642C,U+6627,U+66A6,U+66C7,U+66FD,U+674E,U+6B96,U+6C4E,U+6DF3,U+6E67,U+6F84,U+72FC,U+733F,U+7C97,U+7DB1,U+7E4D,U+816B,U+82D1,U+84CB,U+854E,U+8607,U+86C7,U+871C,U+8776,U+8A89,U+8FC4,U+91A4,U+9285,U+9685,U+9903,U+9B31,U+9F13,U+FF42,U+FF74,U+FF91}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.78.woff2)format("woff2");unicode-range:U+4E32,U+51DB,U+53A8,U+53EA,U+5609,U+5674,U+5A92,U+5E7E,U+6115,U+611A,U+62CC,U+62ED,U+63C9,U+64B9,U+64E6,U+65CB,U+6606,U+6731,U+683D,U+6AFB,U+7460,U+771E,U+78EF,U+7B26,U+7B51,U+7CDE,U+7D10,U+7D2F,U+7D46,U+80DE,U+819C,U+84B2,U+85CD,U+865A,U+8ECC,U+9022,U+90B8,U+9192,U+9675,U+96B7,U+99FF,U+FF44,U+FF55,U+FF6C,U+FF73,U+FF75,U+FF86,U+FF8D,U+FF92,U+FFE3}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.79.woff2)format("woff2");unicode-range:U+25B3,U+30F5,U+4EAE,U+4F46,U+4F51,U+5203,U+52FF,U+55A7,U+564C,U+565B,U+57F9,U+5805,U+5B64,U+5E06,U+5F70,U+5F90,U+60E8,U+6182,U+62F3,U+62FE,U+63AA,U+64A4,U+65D7,U+673A,U+6851,U+68CB,U+68DF,U+6D1E,U+6E58,U+6E9D,U+77B3,U+7832,U+7C3F,U+7DB4,U+7F70,U+80AA,U+80C6,U+8105,U+819D,U+8276,U+8679,U+8986,U+8C9D,U+8FC5,U+916C,U+9665,U+9699,U+96C0,U+9A19,U+FF8B}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.80.woff2)format("woff2");unicode-range:U+2463,U+25A1,U+4EF0,U+5076,U+5098,U+51FD,U+5302,U+5448,U+54C9,U+570B,U+583A,U+5893,U+58A8,U+58EE,U+5949,U+5BDB,U+5F26,U+5F81,U+6052,U+6170,U+61C7,U+631F,U+635C,U+664B,U+69FB,U+6F01,U+7070,U+722A,U+745E,U+755C,U+76C6,U+78C1,U+79E4,U+7BB8,U+7D0B,U+81A8,U+82D7,U+8B5C,U+8F14,U+8FB1,U+8FBB,U+9283,U+9298,U+9A30,U+FF03,U+FF50,U+FF59,U+FF7B,U+FF8E-FF8F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.81.woff2)format("woff2");unicode-range:U+2010,U+2502,U+25B6,U+4F3A,U+514B,U+5265,U+52C3,U+5339,U+53EC,U+54C0,U+55B0,U+5854,U+5B8F,U+5CB3,U+5E84,U+60DA,U+6247,U+6249,U+628A,U+62CD,U+65AC,U+6838,U+690E,U+6CF0,U+6F02,U+6F2C,U+6F70,U+708A,U+7434,U+75BE,U+77EF,U+7C60,U+7C98,U+7D1B,U+7E2B,U+80A5,U+81E3,U+820C,U+8210,U+8475,U+862D,U+8650,U+8997,U+906D,U+91C8,U+9700,U+9727,U+9DF9,U+FF3A,U+FF9A}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.82.woff2)format("woff2");unicode-range:U+2103,U+5049,U+52B1,U+5320,U+5553,U+572D,U+58C7,U+5B5D,U+5BC2,U+5DE3,U+5E61,U+5F80,U+61A9,U+67D0,U+67F4,U+6C88,U+6CA1,U+6CE5,U+6D78,U+6E9C,U+6F54,U+731B,U+73B2,U+74A7,U+74F6,U+75E9,U+7B20,U+7C8B,U+7F72,U+809D,U+8108,U+82B3,U+82BD,U+84B8,U+84C4,U+88C2,U+8AE6,U+8EF8,U+902E,U+9065,U+9326,U+935B,U+938C,U+9676,U+9694,U+96F7,U+9ED9,U+FF48,U+FF4C,U+FF81}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.83.woff2)format("woff2");unicode-range:U+2500,U+3008-3009,U+4EAD,U+4F0F,U+4FCA,U+53EB,U+543E,U+57A2,U+5CF0,U+5E8F,U+5FE0,U+61B2,U+62D8,U+6442,U+64B2,U+6589,U+659C,U+67F1,U+68C4,U+6CB8,U+6D12,U+6DE1,U+6FE1,U+70C8,U+723D,U+73E0,U+7656,U+773A,U+7948,U+7B87,U+7C92,U+7D3A,U+7E1B,U+7E4A,U+819A,U+8358,U+83C5,U+84BC,U+864E,U+8912,U+8C9E,U+8D05,U+92FC,U+9396,U+98FD,U+99D2,U+FF64,U+FF7A,U+FF83}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.84.woff2)format("woff2");unicode-range:U+3014-3015,U+4E3C,U+5036,U+5075,U+533F,U+53E9,U+5531,U+5642,U+5984,U+59E6,U+5A01,U+5B6B,U+5C0B,U+5F25,U+6069,U+60A0,U+614E,U+62B5,U+62D2-62D3,U+6597,U+660C,U+674F,U+67CF,U+6841,U+6905,U+6CF3,U+6D32,U+6D69,U+6F64,U+716E,U+7761,U+7B52,U+7BE0,U+7DBF,U+7DE9,U+7F36,U+81D3,U+8302,U+8389,U+846C,U+84EE,U+8A69,U+9038,U+9D8F,U+FF47,U+FF4B,U+FF76,U+FF9B}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.85.woff2)format("woff2");unicode-range:U+25C7,U+3007,U+504F,U+507D,U+51A0,U+52A3,U+5410,U+5510,U+559A,U+5782,U+582A,U+5C0A,U+5C3F,U+5C48,U+5F6B,U+6176,U+622F,U+6279,U+62BD,U+62DD,U+65ED,U+67B6,U+6817,U+6850,U+6D6A,U+6DEB,U+6EA2,U+6EDD,U+6F5C,U+72E9,U+73A9,U+7573,U+76BF,U+7950,U+7956,U+7F8A,U+7FFC,U+80A2,U+80C3,U+83CA,U+8A02,U+8A13,U+8DF5,U+9375,U+983B,U+99B4,U+FF4E,U+FF71,U+FF89,U+FF97}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.86.woff2)format("woff2");unicode-range:U+24,U+2022,U+2212,U+221F,U+2665,U+4ECF,U+5100,U+51CD,U+52D8,U+5378,U+53F6,U+574A,U+5982,U+5996,U+5C1A,U+5E1D,U+5F84,U+609F,U+61A7,U+61F8,U+6398,U+63EE,U+6676,U+6691,U+6EB6,U+7126,U+71E5,U+7687,U+7965,U+7D17,U+80A1,U+8107,U+8266,U+85A6,U+8987,U+8CA2,U+8CAB,U+8E0A,U+9042,U+95C7,U+9810,U+9867,U+98FC,U+FF52-FF54,U+FF61,U+FF77,U+FF98-FF99}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.87.woff2)format("woff2");unicode-range:U+B0,U+226A,U+2462,U+4E39,U+4FC3,U+4FD7,U+50BE,U+50DA,U+5200,U+5211,U+54F2,U+5618,U+596A,U+5B22,U+5BB4,U+5D50,U+60A3,U+63FA,U+658E,U+65E8,U+6669,U+6795,U+679D,U+67A0,U+6B3A,U+6E09,U+757F,U+7CD6,U+7DBE,U+7FFB,U+83CC,U+83F1,U+840C,U+845B,U+8846,U+8972,U+8A34,U+8A50,U+8A87,U+8EDF,U+8FF0,U+90A6,U+9154,U+95A3,U+9663,U+9686,U+96C7,U+FF3C,U+FF7C,U+FF8A}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.88.woff2)format("woff2");unicode-range:U+25BD,U+4E59,U+4EC1,U+4FF3,U+515A,U+518A,U+525B,U+5375,U+552F,U+57A3,U+5B9C,U+5C3D,U+5E3D,U+5E7B,U+5F0A,U+6094,U+6458,U+654F,U+67F3,U+6B8A,U+6BD2,U+6C37,U+6CE1,U+6E56,U+6E7F,U+6ED1,U+6EDE,U+6F0F,U+70AD,U+7267,U+7363,U+786C,U+7A42,U+7DB2,U+7F85,U+8178,U+829D,U+8896,U+8C5A,U+8CB0,U+8CE2,U+8ED2,U+9047,U+9177,U+970A,U+9EA6,U+FF1B,U+FF31,U+FF39,U+FF80}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.89.woff2)format("woff2");unicode-range:U+A5,U+4E80,U+4F34,U+4F73,U+4F75,U+511F,U+5192,U+52AA,U+53C8,U+570F,U+57CB,U+596E,U+5D8B,U+5F66,U+5FD9,U+62DB,U+62F6,U+6328,U+633F,U+63A7,U+6469,U+6BBF,U+6C41,U+6C57,U+6D44,U+6DBC,U+706F,U+72C2,U+72ED,U+7551,U+75F4,U+7949,U+7E26,U+7FD4,U+8150,U+8AF8,U+8B0E,U+8B72,U+8CA7,U+934B,U+9A0E,U+9A12,U+9B42,U+FF41,U+FF43,U+FF45,U+FF49,U+FF4F,U+FF62-FF63}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.90.woff2)format("woff2");unicode-range:U+4E18,U+4FB5,U+5104,U+52C7,U+5353,U+5374,U+53E5,U+587E,U+594F,U+5A20,U+5DE1,U+5F18,U+5FCD,U+6291,U+62AB,U+6355,U+6392,U+63DA,U+63E1,U+656C,U+6687,U+68B0-68B1,U+68D2,U+68DA,U+6B27,U+6CBC,U+7159,U+7344,U+73CD,U+76DF,U+790E,U+7CF8,U+8102,U+88C1,U+8AA0,U+8E0F,U+9178,U+92AD,U+9670,U+96C5,U+9CF4,U+9DB4,U+FF3E,U+FF6F,U+FF72,U+FF78,U+FF7D,U+FF84,U+FF8C}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.91.woff2)format("woff2");unicode-range:U+60,U+2200,U+226B,U+2461,U+517C,U+526F,U+5800,U+5B97,U+5BF8,U+5C01,U+5D29,U+5E4C,U+5E81,U+6065,U+61D0,U+667A,U+6696,U+6843,U+6C99,U+6D99,U+6EC5,U+6F22,U+6F6E,U+6FA4,U+6FEF,U+71C3,U+72D9,U+7384,U+78E8,U+7A1A,U+7A32,U+7A3C,U+7ADC,U+7CA7,U+7D2B,U+7DAD,U+7E4B,U+80A9,U+8170,U+81ED,U+820E,U+8A17,U+8AFE,U+90AA,U+914E,U+963F,U+99C4,U+9EBA,U+9F3B,U+FF38}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.92.woff2)format("woff2");unicode-range:U+2460,U+4E5F,U+4E7E,U+4ED9,U+501F,U+502B,U+5968,U+5974,U+5AC1,U+5B99,U+5BA3,U+5BE7,U+5BE9,U+5C64,U+5CB8,U+5EC3,U+5F1F,U+616E,U+6297,U+62E0,U+62EC,U+6368,U+642D,U+65E6,U+6717,U+676F,U+6B04,U+732E,U+7652,U+76CA,U+76D7,U+7802,U+7E70,U+7F6A,U+8133,U+81E8,U+866B,U+878D,U+88F8,U+8A5E,U+8CDB,U+8D08,U+907A,U+90E1,U+96F2,U+9F8D,U+FF35,U+FF37,U+FF40,U+FF9D}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.93.woff2)format("woff2");unicode-range:U+21D2,U+25CE,U+300A-300B,U+4E89,U+4E9C,U+4EA1,U+5263,U+53CC,U+5426,U+5869,U+5947,U+598A,U+5999,U+5E55,U+5E72,U+5E79,U+5FAE,U+5FB9,U+602A,U+6163,U+624D,U+6749,U+6C5A,U+6CBF,U+6D45,U+6DFB,U+6E7E,U+708E,U+725B,U+7763,U+79C0,U+7BC4,U+7C89,U+7E01,U+7E2E,U+8010,U+8033,U+8C6A,U+8CC3,U+8F1D,U+8F9B,U+8FB2,U+907F,U+90F7,U+9707,U+9818,U+9B3C,U+FF0A,U+FF4D}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.94.woff2)format("woff2");unicode-range:U+2015,U+2190,U+4E43,U+5019,U+5247,U+52E7,U+5438,U+54B2,U+55AB,U+57F7,U+5BD2,U+5E8A,U+5EF6,U+6016,U+60B2,U+6162,U+6319,U+6551,U+6607,U+66B4,U+675F,U+67D4,U+6B20,U+6B53,U+6CE3,U+719F,U+75B2,U+770B,U+7720,U+77AC,U+79D2,U+7AF9,U+7D05,U+7DCA,U+8056,U+80F8,U+81F3,U+8352,U+885D,U+8A70,U+8AA4,U+8CBC,U+900F,U+9084,U+91E3,U+9451,U+96C4,U+99C6,U+9AD4,U+FF70}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.95.woff2)format("woff2");unicode-range:U+2193,U+25B2,U+4E4B,U+516D,U+51C4,U+529F,U+52C9,U+5360,U+5442,U+5857,U+5915,U+59EB,U+5A9B,U+5C3B,U+6012,U+61B6,U+62B1,U+6311,U+6577,U+65E2,U+65EC,U+6613,U+6790,U+6CB9,U+7372,U+76AE,U+7D5E,U+7FCC,U+88AB,U+88D5,U+8CAF,U+8DDD,U+8ECD,U+8F38,U+8F9E,U+8FEB,U+9063,U+90F5,U+93E1,U+968A,U+968F,U+98FE,U+9EC4,U+FF1D,U+FF27,U+FF2A,U+FF36,U+FF3B,U+FF3D,U+FFE5}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.96.woff2)format("woff2");unicode-range:U+4E03,U+4F38,U+50B7,U+5264,U+5348,U+5371,U+585A,U+58CA,U+5951,U+59B9,U+59D4,U+5B98,U+5F8B,U+6388,U+64CD,U+65E7,U+6803,U+6B6F,U+6D66,U+6E0B,U+6ECB,U+6FC3,U+72AC,U+773C,U+77E2,U+7968,U+7A74,U+7DBA,U+7DD1,U+7E3E,U+808C,U+811A,U+8179,U+8239,U+8584,U+8A0E,U+8A72,U+8B66,U+8C46,U+8F29,U+90A3,U+9234,U+96F0,U+9769,U+9774,U+9AA8,U+FF26,U+FF28,U+FF9E-FF9F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.97.woff2)format("woff2");unicode-range:U+7E,U+B4,U+25C6,U+2661,U+4E92,U+4EEE,U+4FFA,U+5144,U+5237,U+5287,U+52B4,U+58C1,U+5BFF,U+5C04,U+5C06,U+5E95,U+5F31,U+5F93,U+63C3,U+640D,U+6557,U+6614,U+662F,U+67D3,U+690D,U+6BBA,U+6E6F,U+72AF,U+732B,U+7518,U+7AE0,U+7AE5,U+7AF6,U+822A,U+89E6,U+8A3A,U+8A98,U+8CB8,U+8DE1,U+8E8D,U+95D8,U+961C,U+96A3,U+96EA,U+9BAE,U+FF20,U+FF22,U+FF29,U+FF2B-FF2C}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.98.woff2)format("woff2");unicode-range:U+25CB,U+4E71,U+4F59,U+50D5,U+520A,U+5217,U+5230,U+523A-523B,U+541B,U+5439,U+5747,U+59C9,U+5BDF,U+5C31,U+5DE8,U+5E7C,U+5F69,U+6050,U+60D1,U+63CF,U+663C,U+67C4,U+6885,U+6C38,U+6D6E,U+6DB2,U+6DF7,U+6E2C,U+6F5F,U+7532,U+76E3-76E4,U+7701,U+793C,U+79F0,U+7A93,U+7D00,U+7DE0,U+7E54,U+8328,U+8840,U+969C,U+96E8,U+9811,U+9AEA,U+9B5A,U+FF24,U+FF2E,U+FF57}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.99.woff2)format("woff2");unicode-range:U+2191,U+505C,U+52E4,U+5305,U+535A,U+56E0,U+59BB,U+5ACC,U+5B09,U+5B87,U+5C90,U+5DF1,U+5E2D,U+5E33,U+5F3E,U+6298,U+6383,U+653B,U+6697,U+6804,U+6A39,U+6CCA,U+6E90,U+6F2B,U+702C,U+7206,U+7236,U+7559,U+7565,U+7591,U+75C7,U+75DB,U+7B4B,U+7BB1,U+7D99,U+7FBD,U+8131,U+885B,U+8B1D,U+8FF7,U+9003,U+9045,U+96A0,U+9732,U+990A,U+99D0,U+9E97,U+9F62,U+FF25,U+FF2D}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.100.woff2)format("woff2");unicode-range:U+4E08,U+4F9D,U+5012,U+514D,U+51B7,U+5275,U+53CA,U+53F8,U+5584,U+57FC,U+5B9D,U+5BFA,U+5C3E,U+5F01,U+5FB4,U+5FD7,U+606F,U+62E1,U+6563,U+6674,U+6CB3,U+6D3E,U+6D74,U+6E1B,U+6E2F,U+718A,U+7247,U+79D8,U+7D14,U+7D66,U+7D71,U+7DF4,U+7E41,U+80CC,U+8155,U+83D3,U+8A95,U+8AB2,U+8AD6,U+8CA1,U+9000,U+9006,U+9678,U+97D3,U+9808,U+98EF,U+9A5A,U+9B45,U+FF23,U+FF30}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.101.woff2)format("woff2");unicode-range:U+25BC,U+3012,U+4EF2,U+4F0A,U+516B,U+5373,U+539A,U+53B3,U+559C,U+56F0,U+5727,U+5742,U+5965,U+59FF,U+5BC6,U+5DFB,U+5E45,U+5EAD,U+5FB3,U+6211,U+6253,U+639B,U+63A8,U+6545,U+6575,U+6628,U+672D,U+68A8,U+6BDB,U+6D25,U+707D,U+767E,U+7834,U+7B46,U+7BC9,U+8074,U+82E6,U+8349,U+8A2A,U+8D70,U+8DA3,U+8FCE,U+91CC,U+967D,U+97FF,U+9996,U+FF1C,U+FF2F,U+FF32,U+FF34}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.102.woff2)format("woff2");unicode-range:U+3D,U+5E,U+25CF,U+4E0E,U+4E5D,U+4E73,U+4E94,U+4F3C,U+5009,U+5145,U+51AC,U+5238,U+524A,U+53F3,U+547C,U+5802,U+5922,U+5A66,U+5C0E,U+5DE6,U+5FD8,U+5FEB,U+6797,U+685C,U+6B7B,U+6C5F-6C60,U+6CC9,U+6CE2,U+6D17,U+6E21,U+7167,U+7642,U+76DB,U+8001,U+821E,U+8857,U+89D2,U+8B1B,U+8B70,U+8CB4,U+8CDE,U+8F03,U+8F2A,U+968E,U+9B54,U+9E7F,U+9EBB,U+FF05,U+FF33}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.103.woff2)format("woff2");unicode-range:U+500D,U+5074,U+50CD,U+5175,U+52E2,U+5352,U+5354,U+53F2,U+5409,U+56FA,U+5A18,U+5B88,U+5BDD,U+5CA9,U+5F92,U+5FA9,U+60A9,U+623F,U+6483,U+653F,U+666F,U+66AE,U+66F2,U+6A21,U+6B66,U+6BCD,U+6D5C,U+796D,U+7A4D,U+7AEF,U+7B56,U+7B97,U+7C4D,U+7E04,U+7FA9,U+8377,U+83DC,U+83EF,U+8535,U+8863,U+88CF,U+88DC,U+8907,U+8ACB,U+90CE,U+91DD,U+FF0B,U+FF0D,U+FF19,U+FF65}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.104.woff2)format("woff2");unicode-range:U+4E01,U+4E21,U+4E38,U+52A9,U+547D,U+592E,U+5931,U+5B63,U+5C40,U+5DDE,U+5E78,U+5EFA,U+5FA1,U+604B,U+6075,U+62C5,U+632F,U+6A19,U+6C0F,U+6C11,U+6C96,U+6E05,U+70BA,U+71B1,U+7387,U+7403,U+75C5,U+77ED,U+795D,U+7B54,U+7CBE,U+7D19,U+7FA4,U+8089,U+81F4,U+8208,U+8336,U+8457,U+8A33,U+8C4A,U+8CA0,U+8CA8,U+8CC0,U+9014,U+964D,U+9803,U+983C,U+98DB,U+FF17,U+FF21}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.105.woff2)format("woff2");unicode-range:U+25,U+25A0,U+4E26,U+4F4E,U+5341,U+56F2,U+5BBF,U+5C45,U+5C55,U+5C5E,U+5DEE,U+5E9C,U+5F7C,U+6255,U+627F,U+62BC,U+65CF,U+661F,U+666E,U+66DC,U+67FB,U+6975,U+6A4B,U+6B32,U+6DF1,U+6E29,U+6FC0,U+738B,U+7686,U+7A76,U+7A81,U+7C73,U+7D75,U+7DD2,U+82E5,U+82F1,U+85AC,U+888B,U+899A,U+8A31,U+8A8C,U+8AB0,U+8B58,U+904A,U+9060,U+9280,U+95B2,U+984D,U+9CE5,U+FF18}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.106.woff2)format("woff2");unicode-range:U+30F6,U+50AC,U+5178,U+51E6,U+5224,U+52DD,U+5883,U+5897,U+590F,U+5A5A,U+5BB3,U+5C65,U+5E03,U+5E2B,U+5E30,U+5EB7,U+6271,U+63F4,U+64AE,U+6574,U+672B,U+679A,U+6A29-6A2A,U+6CA2,U+6CC1,U+6D0B,U+713C,U+74B0,U+7981,U+7A0B,U+7BC0,U+7D1A,U+7D61,U+7FD2,U+822C,U+8996,U+89AA,U+8CAC,U+8CBB,U+8D77,U+8DEF,U+9020,U+9152,U+9244,U+9662,U+967A,U+96E3,U+9759,U+FF16}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.107.woff2)format("woff2");unicode-range:U+23,U+3C,U+2192,U+4E45,U+4EFB,U+4F50,U+4F8B,U+4FC2,U+5024,U+5150,U+5272,U+5370,U+53BB,U+542B,U+56DB,U+56E3,U+57CE,U+5BC4,U+5BCC,U+5F71,U+60AA,U+6238,U+6280,U+629C,U+6539,U+66FF,U+670D,U+677E-677F,U+6839,U+69CB,U+6B4C,U+6BB5,U+6E96,U+6F14,U+72EC,U+7389,U+7814,U+79CB,U+79D1,U+79FB,U+7A0E,U+7D0D,U+85E4,U+8D64,U+9632,U+96E2,U+9805,U+99AC,U+FF1E}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.108.woff2)format("woff2");unicode-range:U+2605-2606,U+301C,U+4E57,U+4FEE,U+5065,U+52DF,U+533B,U+5357,U+57DF,U+58EB,U+58F0,U+591C,U+592A-592B,U+5948,U+5B85,U+5D0E,U+5EA7,U+5FF5,U+6025,U+63A1,U+63A5,U+63DB,U+643A,U+65BD,U+671D,U+68EE,U+6982,U+6B73,U+6BD4,U+6D88,U+7570,U+7B11,U+7D76,U+8077,U+8217,U+8C37,U+8C61,U+8CC7,U+8D85,U+901F,U+962A,U+9802,U+9806,U+9854,U+98F2,U+9928,U+99C5,U+9ED2}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.109.woff2)format("woff2");unicode-range:U+266A,U+4F11,U+533A,U+5343,U+534A,U+53CD,U+5404,U+56F3,U+5B57-5B58,U+5BAE,U+5C4A,U+5E0C,U+5E2F,U+5EAB,U+5F35,U+5F79,U+614B,U+6226,U+629E,U+65C5,U+6625,U+6751,U+6821,U+6B69,U+6B8B,U+6BCE,U+6C42,U+706B,U+7C21,U+7CFB,U+805E,U+80B2,U+82B8,U+843D,U+8853,U+88C5,U+8A3C,U+8A66,U+8D8A,U+8FBA,U+9069,U+91CF,U+9752,U+975E,U+9999,U+FF0F-FF10,U+FF14-FF15}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.110.woff2)format("woff2");unicode-range:U+40,U+4E86,U+4E95,U+4F01,U+4F1D,U+4FBF,U+5099,U+5171,U+5177,U+53CB,U+53CE,U+53F0,U+5668,U+5712,U+5BA4,U+5CA1,U+5F85,U+60F3,U+653E,U+65AD,U+65E9,U+6620,U+6750,U+6761,U+6B62,U+6B74,U+6E08,U+6E80,U+7248,U+7531,U+7533,U+753A,U+77F3,U+798F,U+7F6E,U+8449,U+88FD,U+89B3,U+8A55,U+8AC7,U+8B77,U+8DB3,U+8EFD,U+8FD4,U+9031-9032,U+9580,U+9589,U+96D1,U+985E}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.111.woff2)format("woff2");unicode-range:U+2B,U+D7,U+300E-300F,U+4E07,U+4E8C,U+512A,U+5149,U+518D,U+5236,U+52B9,U+52D9,U+5468,U+578B,U+57FA,U+5B8C,U+5BA2,U+5C02,U+5DE5,U+5F37,U+5F62,U+623B,U+63D0,U+652F,U+672A,U+6848,U+6D41,U+7136,U+7537,U+754C,U+76F4,U+79C1,U+7BA1,U+7D44,U+7D4C,U+7DCF,U+7DDA,U+7DE8,U+82B1,U+897F,U+8CA9,U+8CFC,U+904E,U+9664,U+982D,U+9858,U+98A8,U+9A13,U+FF13,U+FF5C}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.112.woff2)format("woff2");unicode-range:U+4E16,U+4E3B,U+4EA4,U+4EE4,U+4F4D,U+4F4F,U+4F55,U+4F9B,U+5317,U+5358,U+53C2,U+53E4,U+548C,U+571F,U+59CB,U+5CF6,U+5E38,U+63A2,U+63B2,U+6559,U+662D,U+679C,U+6C7A,U+72B6,U+7523,U+767D,U+770C,U+7A2E,U+7A3F,U+7A7A,U+7B2C,U+7B49,U+7D20,U+7D42,U+8003,U+8272,U+8A08,U+8AAC,U+8CB7,U+8EAB,U+8EE2,U+9054-9055,U+90FD,U+914D,U+91CD,U+969B,U+97F3,U+984C,U+FF06}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.113.woff2)format("woff2");unicode-range:U+26,U+5F,U+2026,U+203B,U+4E09,U+4EAC,U+4ED5,U+4FA1,U+5143,U+5199,U+5207,U+539F,U+53E3,U+53F7,U+5411,U+5473,U+5546,U+55B6,U+5929,U+597D,U+5BB9,U+5C11,U+5C4B,U+5DDD,U+5F97,U+5FC5,U+6295,U+6301,U+6307,U+671B,U+76F8,U+78BA,U+795E,U+7D30,U+7D39,U+7D9A,U+89E3,U+8A00,U+8A73,U+8A8D,U+8A9E,U+8AAD,U+8ABF,U+8CEA,U+8ECA,U+8FFD,U+904B,U+9650,U+FF11-FF12}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.114.woff2)format("woff2");unicode-range:U+3E,U+3005,U+4E0D,U+4E88,U+4ECB,U+4EE3,U+4EF6,U+4FDD,U+4FE1,U+500B,U+50CF,U+5186,U+5316,U+53D7,U+540C,U+544A,U+54E1,U+5728,U+58F2,U+5973,U+5B89,U+5C71,U+5E02,U+5E97,U+5F15,U+5FC3,U+5FDC,U+601D,U+611B,U+611F,U+671F,U+6728,U+6765,U+683C,U+6B21,U+6CE8,U+6D3B,U+6D77,U+7530,U+7740,U+7ACB,U+7D50,U+826F,U+8F09,U+8FBC,U+9001,U+9053,U+91CE,U+9762,U+98DF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.115.woff2)format("woff2");unicode-range:U+7C,U+3080,U+4EE5,U+5148,U+516C,U+521D,U+5225,U+529B,U+52A0,U+53EF,U+56DE,U+56FD,U+5909,U+591A,U+5B66,U+5B9F,U+5BB6,U+5BFE,U+5E73,U+5E83,U+5EA6,U+5F53,U+6027,U+610F,U+6210,U+6240,U+660E,U+66F4,U+66F8,U+6709,U+6771,U+697D,U+69D8,U+6A5F,U+6C34,U+6CBB,U+73FE,U+756A,U+7684,U+771F,U+793A,U+7F8E,U+898F,U+8A2D,U+8A71,U+8FD1,U+9078,U+9577,U+96FB,U+FF5E}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.116.woff2)format("woff2");unicode-range:U+A9,U+3010-3011,U+30E2,U+4E0B,U+4ECA,U+4ED6,U+4ED8,U+4F53,U+4F5C,U+4F7F,U+53D6,U+540D,U+54C1,U+5730,U+5916,U+5B50,U+5C0F,U+5F8C,U+624B,U+6570,U+6587,U+6599,U+691C,U+696D,U+6CD5,U+7269,U+7279,U+7406,U+767A-767B,U+77E5,U+7D04,U+7D22,U+8005,U+80FD,U+81EA,U+8868,U+8981,U+89A7,U+901A,U+9023,U+90E8,U+91D1,U+9332,U+958B,U+96C6,U+9AD8,U+FF1A,U+FF1F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.117.woff2)format("woff2");unicode-range:U+4E,U+A0,U+3000,U+300C-300D,U+4E00,U+4E0A,U+4E2D,U+4E8B,U+4EBA,U+4F1A,U+5165,U+5168,U+5185,U+51FA,U+5206,U+5229,U+524D,U+52D5,U+5408,U+554F,U+5831,U+5834,U+5927,U+5B9A,U+5E74,U+5F0F,U+60C5,U+65B0,U+65B9,U+6642,U+6700,U+672C,U+682A,U+6B63,U+6C17,U+7121,U+751F,U+7528,U+753B,U+76EE,U+793E,U+884C,U+898B,U+8A18,U+9593,U+95A2,U+FF01,U+FF08-FF09}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.118.woff2)format("woff2");unicode-range:U+21-22,U+27-2A,U+2C-3B,U+3F,U+41-4D,U+4F-5D,U+61-7B,U+7D,U+AB,U+AE,U+B2-B3,U+B7,U+BB,U+C9,U+CD,U+D6,U+D8,U+DC,U+E0-E5,U+E7-ED,U+EF,U+F1-F4,U+F6,U+F8,U+FA,U+FC-FD,U+103,U+14D,U+1B0,U+300-301,U+1EBF,U+1EC7,U+2013-2014,U+201C-201D,U+2039-203A,U+203C,U+2048-2049,U+2113,U+2122,U+65E5,U+6708,U+70B9}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.119.woff2)format("woff2");unicode-range:U+20,U+2027,U+3001-3002,U+3041-307F,U+3081-308F,U+3091-3093,U+3099-309A,U+309D-309E,U+30A1-30E1,U+30E3-30ED,U+30EF-30F0,U+30F2-30F4,U+30FB-30FE,U+FF0C,U+FF0E}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWMxL4g7eau9x0.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWFxL4g7eau9x0.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWNxL4g7eau9x0.woff2)format("woff2");unicode-range:U+1F??}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWCxL4g7eau9x0.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWDxL4g7eau9x0.woff2)format("woff2");unicode-range:U+307-308,U+590-5FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWOxL4g7eau9x0.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWPxL4g7eau9x0.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWBxL4g7eau.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Quicksand;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/quicksand/v36/6xK-dSZaM9iE8KbpRA_LJ3z8mH9BOJvgkP8o58m-wjwxUD2GF9Zc.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Quicksand;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/quicksand/v36/6xK-dSZaM9iE8KbpRA_LJ3z8mH9BOJvgkP8o58i-wjwxUD2GF9Zc.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Quicksand;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/quicksand/v36/6xK-dSZaM9iE8KbpRA_LJ3z8mH9BOJvgkP8o58a-wjwxUD2GFw.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Sniglet;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sniglet/v17/cIf9MaFLtkE3UjaJ9CChYUsEkIpdQQ.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Sniglet;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sniglet/v17/cIf9MaFLtkE3UjaJ9C6hYUsEkIo.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Urbanist;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/urbanist/v17/L0xjDF02iFML4hGCyOCpRdycFsGxSrqDyx4vH5mqacG1Koy1cIU.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Urbanist;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/urbanist/v17/L0xjDF02iFML4hGCyOCpRdycFsGxSrqDyx4vEZmqacG1Koy1.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--chromatic-hue:220.44;--chromatic-chroma:calc(.18 + (cos(var(--chromatic-hue)*3.14159/180)*.04));--chromatic-chroma-50:calc(var(--chromatic-chroma)*.3);--chromatic-chroma-100:calc(var(--chromatic-chroma)*.5);--chromatic-chroma-200:calc(var(--chromatic-chroma)*.6);--chromatic-chroma-300:calc(var(--chromatic-chroma)*.75);--chromatic-chroma-400:calc(var(--chromatic-chroma)*.85);--chromatic-chroma-500:var(--chromatic-chroma);--chromatic-chroma-600:calc(var(--chromatic-chroma)*1.15);--chromatic-chroma-700:calc(var(--chromatic-chroma)*1.1);--chromatic-chroma-800:calc(var(--chromatic-chroma)*.85);--chromatic-chroma-900:calc(var(--chromatic-chroma)*.7);--chromatic-chroma-950:calc(var(--chromatic-chroma)*.5)}.i-eos-icons\:three-dots-loading,[i-eos-icons\:three-dots-loading=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='18' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.67' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.33' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='6' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='0' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:alibabacloud{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M14.752 4.64h5.274C22.242 4.64 24 6.475 24 8.691V15.8a3.947 3.947 0 01-3.974 3.975h-5.274l1.299-1.835 3.822-1.222c.688-.23 1.146-.918 1.146-1.605v-5.81c0-.687-.458-1.375-1.146-1.605L16.05 6.475l-1.3-1.835zM2.98 15.111c0 .688.46 1.376 1.147 1.606l3.822 1.146 1.3 1.835H3.974A3.947 3.947 0 010 15.723V8.69c0-2.216 1.758-4.05 3.975-4.05h5.273L7.95 6.474 4.127 7.697c-.688.23-1.146.918-1.146 1.606v5.808z'/%3E%3Cpath d='M16.051 11.213H8.025v1.835h8.026v-1.835z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:anthropic{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:cloudflare{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cg%3E%3Cpath d='M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437'/%3E%3Cpath d='M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:deepseek{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:featherless-ai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='1em' height='1em' %3E%3Cg fill='currentColor'%3E%3Cpath d='M40.0866 4.68482C38.2902 3.5825 35.863 3 33.0672 3C28.7842 3 24.0653 4.35865 19.8276 6.72206L19.7979 6.71083C19.7979 6.71083 19.7937 6.73344 19.7914 6.74423C18.5086 7.4617 17.2656 8.2629 16.0981 9.15731C9.22112 14.4248 7.29519 20.6748 8.92004 24.0156C7.14142 27.0728 6.0457 30.2332 6 33.9767C9.41949 27.421 11.4719 22.108 22.6146 13.1637C19.4309 13.8501 13.9281 17.1057 10.2271 22.0459C9.87793 19.156 12.1477 14.4895 17.2033 10.6174C17.8435 10.127 18.5092 9.66864 19.1886 9.23374C18.6577 10.8934 18.8269 10.4806 17.7254 12.8076C19.3543 11.2566 20.4268 10.2995 22.035 7.64145C24.123 6.60964 26.2948 5.83844 28.4482 5.37235C28.0919 6.56071 27.4137 8.57466 26.4955 10.1669C26.4955 10.1669 28.8258 9.66435 30.7518 9.77788C29.6995 10.9459 28.7527 12.2094 27.7926 13.5012C26.4777 15.2696 25.1184 17.0983 23.3778 18.8005C23.1683 19.0054 22.968 19.1912 22.7649 19.383C20.0902 19.1254 18.3235 20.1315 16.6683 21.9089C17.9737 21.2966 19.7273 20.7924 20.8266 21.0959C18.8008 22.7579 15.6106 24.9488 12.9893 24.7684C12.4922 25.5295 12.4608 25.5528 11.9144 26.4722C16.1664 27.537 21.507 23.1905 24.6498 20.1161C26.4926 18.3131 27.8964 16.4257 29.2534 14.6012C32.0481 10.8427 34.4616 7.5974 39.8153 6.3624L42 5.85877L40.0866 4.68482Z' class='logo-mark'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:fireworks{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:gemini{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M12 24A14.304 14.304 0 000 12 14.304 14.304 0 0012 0a14.305 14.305 0 0012 12 14.305 14.305 0 00-12 12'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:huggingface{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:microsoft{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M11.49 2H2v9.492h9.492V2h-.002z'/%3E%3Cpath d='M22 2h-9.492v9.492H22V2z'/%3E%3Cpath d='M11.49 12.508H2V22h9.492v-9.492h-.002z'/%3E%3Cpath d='M22 12.508h-9.492V22H22v-9.492z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:mistral{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:moonshot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:novita{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M9.167 4.17v5.665L0 19.003h9.167v-5.666l5.666 5.666H24L9.167 4.17z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:ollama{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:openai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:openrouter{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:perplexity{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:together{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cg%3E%3Cpath d='M17.385 11.23a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23zm0 10.77a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23zm-10.77 0a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23z' opacity='.2'/%3E%3Ccircle cx='6.615' cy='6.615' r='4.615'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:vllm{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M0 4.973h9.324V23L0 4.973z'/%3E%3Cpath d='M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:volcengine{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M7.29 5.36L3.148 21.737a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.359a.214.214 0 00-.41 0z' fill-opacity='.5'/%3E%3Cpath clip-rule='evenodd' d='M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z'/%3E%3Cpath d='M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.214.214 0 00.215-.261L14.44.151z' fill-opacity='.5'/%3E%3Cpath clip-rule='evenodd' d='M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z'/%3E%3Cpath d='M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 0 00-.409 0z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lobe-icons\:xai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lucide\:ghost,[i-lucide\:ghost=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 10h.01M15 10h.01M12 2a8 8 0 0 0-8 8v12l3-3l2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lucide\:mic,[i-lucide\:mic=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2m7 9v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-lucide\:music,[i-lucide\:music=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:discord{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M20.317 4.37a19.8 19.8 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.3 18.3 0 0 0-5.487 0a13 13 0 0 0-.617-1.25a.08.08 0 0 0-.079-.037A19.7 19.7 0 0 0 3.677 4.37a.1.1 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.08.08 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.08.08 0 0 0 .084-.028a14 14 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13 13 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10 10 0 0 0 .372-.292a.07.07 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.07.07 0 0 1 .078.01q.181.149.373.292a.077.077 0 0 1-.006.127a12.3 12.3 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.08.08 0 0 0 .084.028a19.8 19.8 0 0 0 6.002-3.03a.08.08 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.03M8.02 15.33c-1.182 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418m7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:elevenlabs{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4.604 0v24h4.931V0zm9.86 0v24h4.933V0z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-simple-icons\:x{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584l-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:add-circle-line-duotone,[i-solar\:add-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12h-3m0 0H9m3 0V9m0 3v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:add-square-line-duotone,[i-solar\:add-square-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12h-3m0 0H9m3 0V9m0 3v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:alt-arrow-down-bold-duotone,[i-solar\:alt-arrow-down-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m8.303 12.404l3.327 3.431c.213.22.527.22.74 0l6.43-6.63C19.201 8.79 18.958 8 18.43 8h-5.723z'/%3E%3Cpath fill='currentColor' d='M11.293 8H5.57c-.528 0-.771.79-.37 1.205l2.406 2.481z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:alt-arrow-left-line-duotone,[i-solar\:alt-arrow-left-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m15 5l-6 7l6 7'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:armchair-2-bold-duotone,[i-solar\:armchair-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.533 18H6.75v2a.75.75 0 1 1-1.5 0v-2.324c-.829-.362-1.49-1.005-1.808-1.817l-.039-.102L2.1 12.264C1.685 11.15 2.613 10 3.927 10c.81 0 1.534.453 1.81 1.134l1.098 2.706c.1.246.15.37.222.47a1.2 1.2 0 0 0 .74.463c.13.027.277.027.57.027h6.98c.569 0 .853 0 1.091-.098q.196-.082.349-.219c.184-.166.281-.405.475-.883l1.001-2.466c.276-.68 1-1.134 1.81-1.134c1.314 0 2.242 1.15 1.827 2.264l-1.12 3c-.195.524-.292.785-.421 1.008a3.43 3.43 0 0 1-1.609 1.404V20a.75.75 0 1 1-1.5 0v-2.005c-.187.005-.415.005-.717.005'/%3E%3Cpath fill='currentColor' d='M13.236 3.5h-2.472c-1.1 0-1.976 0-2.66.088c-.706.09-1.285.28-1.746.72c-.464.441-.669 1.003-.765 1.685c-.093.658-.093 1.495-.093 2.54v2.195q.147.186.237.406l1.098 2.706c.1.246.15.37.222.47a1.2 1.2 0 0 0 .74.463c.13.027.277.027.57.027h6.98c.569 0 .853 0 1.091-.098q.196-.082.349-.219c.184-.166.281-.405.475-.883l1.001-2.466q.09-.221.237-.406V8.533c0-1.045 0-1.882-.093-2.54c-.096-.682-.301-1.244-.765-1.686c-.46-.438-1.04-.629-1.745-.72c-.685-.087-1.56-.087-2.661-.087' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:arrow-right-line-duotone,[i-solar\:arrow-right-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Cpath fill='currentColor' d='M4 11.25a.75.75 0 0 0 0 1.5zm0 1.5h16v-1.5H4z' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m14 6l6 6l-6 6'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:book-bookmark-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 20.028V18H8v2.028c0 .277 0 .416.095.472s.224-.006.484-.13l1.242-.593c.088-.042.132-.063.179-.063s.091.02.179.063l1.242.593c.26.124.39.186.484.13c.095-.056.095-.195.095-.472' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8 18h-.574c-1.084 0-1.462.006-1.753.068c-.513.11-.96.347-1.285.667c-.11.108-.164.161-.291.505s-.107.489-.066.78l.022.15c.11.653.31.998.616 1.244c.307.246.737.407 1.55.494c.837.09 1.946.092 3.536.092h4.43c1.59 0 2.7-.001 3.536-.092c.813-.087 1.243-.248 1.55-.494s.506-.591.616-1.243c.091-.548.11-1.241.113-2.171h-8v2.028c0 .277 0 .416-.095.472s-.224-.006-.484-.13l-1.242-.593c-.088-.042-.132-.063-.179-.063s-.091.02-.179.063l-1.242.593c-.26.124-.39.186-.484.13C8 20.444 8 20.305 8 20.028z'/%3E%3Cpath fill='currentColor' d='M4.727 2.733c.306-.308.734-.508 1.544-.618C7.105 2.002 8.209 2 9.793 2h4.414c1.584 0 2.688.002 3.522.115c.81.11 1.238.31 1.544.618c.305.308.504.74.613 1.557c.112.84.114 1.955.114 3.552V18H7.426c-1.084 0-1.462.006-1.753.068c-.513.11-.96.347-1.285.667c-.11.108-.164.161-.291.505A1.3 1.3 0 0 0 4 19.7V7.842c0-1.597.002-2.711.114-3.552c.109-.816.308-1.249.613-1.557' opacity='.5'/%3E%3Cpath fill='currentColor' d='M7.25 7A.75.75 0 0 1 8 6.25h8a.75.75 0 0 1 0 1.5H8A.75.75 0 0 1 7.25 7M8 9.75a.75.75 0 0 0 0 1.5h5a.75.75 0 0 0 0-1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:bookmark-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M21 11.098v4.993c0 3.096 0 4.645-.734 5.321c-.35.323-.792.526-1.263.58c-.987.113-2.14-.907-4.445-2.946c-1.02-.901-1.529-1.352-2.118-1.47a2.2 2.2 0 0 0-.88 0c-.59.118-1.099.569-2.118 1.47c-2.305 2.039-3.458 3.059-4.445 2.945a2.24 2.24 0 0 1-1.263-.579C3 20.736 3 19.188 3 16.091v-4.994C3 6.81 3 4.666 4.318 3.333S7.758 2 12 2s6.364 0 7.682 1.332S21 6.81 21 11.098' opacity='.5'/%3E%3Cpath fill='currentColor' d='M9 5.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:box-minimalistic-bold-duotone,[i-solar\:box-minimalistic-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M8.422 20.618C10.178 21.54 11.056 22 12 22V12L2.638 7.073l-.04.067C2 8.154 2 9.417 2 11.942v.117c0 2.524 0 3.787.597 4.801c.598 1.015 1.674 1.58 3.825 2.709z'/%3E%3Cpath fill='currentColor' d='m17.577 4.432l-2-1.05C13.822 2.461 12.944 2 12 2c-.945 0-1.822.46-3.578 1.382l-2 1.05C4.318 5.536 3.242 6.1 2.638 7.072L12 12l9.362-4.927c-.606-.973-1.68-1.537-3.785-2.641' opacity='.7'/%3E%3Cpath fill='currentColor' d='m21.403 7.14l-.041-.067L12 12v10c.944 0 1.822-.46 3.578-1.382l2-1.05c2.151-1.129 3.227-1.693 3.825-2.708c.597-1.014.597-2.277.597-4.8v-.117c0-2.525 0-3.788-.597-4.802' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:bug-bold-duotone,[i-solar\:bug-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M19 11.938V15a7 7 0 0 1-6.25 6.96V15a.75.75 0 0 0-1.5 0v6.96A7 7 0 0 1 5 15v-3.062A3.94 3.94 0 0 1 8.938 8h6.124A3.94 3.94 0 0 1 19 11.938' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M19 14.75v-1.5h3a.75.75 0 0 1 0 1.5zm-1.504 4.586c.31-.393.58-.82.801-1.276l2.538 1.27a.75.75 0 1 1-.67 1.34zM5.703 18.06q.333.684.801 1.276l-2.669 1.335a.75.75 0 0 1-.67-1.342zM5 13.25H2a.75.75 0 0 0 0 1.5h3zm12.354-4.515l2.81-1.406a.75.75 0 1 1 .671 1.341L18.42 9.88a4 4 0 0 0-1.065-1.144M6.647 8.735c-.427.306-.79.695-1.067 1.144L3.165 8.67a.75.75 0 0 1 .67-1.341zM16.5 8.27V7.5a4.5 4.5 0 1 0-9 0v.77A3.9 3.9 0 0 1 8.938 8h6.124c.508 0 .993.096 1.438.27'/%3E%3Cpath fill='currentColor' d='M6.376 1.584a.75.75 0 0 0 .208 1.04l2.36 1.573a4.5 4.5 0 0 1 1.387-.877L7.416 1.376a.75.75 0 0 0-1.04.208m8.68 2.613a4.5 4.5 0 0 0-1.387-.877l2.915-1.944a.75.75 0 1 1 .832 1.248z' opacity='.5'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 14.25a.75.75 0 0 1 .75.75v7h-1.5v-7a.75.75 0 0 1 .75-.75' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:card-search-broken,[i-solar\:card-search-broken=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' d='M14 4c3.771 0 5.657 0 6.828 1.172S22 8.229 22 12v1M10 4C6.229 4 4.343 4 3.172 5.172S2 8.229 2 12s0 5.657 1.172 6.828S6.229 20 10 20h3m-3-4H6'/%3E%3Ccircle cx='18' cy='17' r='3'/%3E%3Cpath stroke-linecap='round' d='m20.5 19.5l1 1M2 10h5m15 0H11'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:chat-round-line-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12c0 1.6.376 3.112 1.043 4.453c.178.356.237.763.134 1.148l-.595 2.226a1.3 1.3 0 0 0 1.591 1.592l2.226-.596a1.63 1.63 0 0 1 1.149.133A9.96 9.96 0 0 0 12 22' opacity='.5'/%3E%3Cpath fill='currentColor' d='M7.825 12.85a.825.825 0 0 0 0 1.65h6.05a.825.825 0 0 0 0-1.65zm0-3.85a.825.825 0 0 0 0 1.65h8.8a.825.825 0 0 0 0-1.65z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:chat-square-like-bold-duotone,[i-solar\:chat-square-like-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m13.629 20.472l-.542.916c-.483.816-1.69.816-2.174 0l-.542-.916c-.42-.71-.63-1.066-.968-1.262c-.338-.197-.763-.204-1.613-.219c-1.256-.021-2.043-.098-2.703-.372a5 5 0 0 1-2.706-2.706C2 14.995 2 13.83 2 11.5v-1c0-3.273 0-4.91.737-6.112a5 5 0 0 1 1.65-1.651C5.59 2 7.228 2 10.5 2h3c3.273 0 4.91 0 6.113.737a5 5 0 0 1 1.65 1.65C22 5.59 22 7.228 22 10.5v1c0 2.33 0 3.495-.38 4.413a5 5 0 0 1-2.707 2.706c-.66.274-1.447.35-2.703.372c-.85.015-1.275.022-1.613.219c-.338.196-.548.551-.968 1.262' opacity='.5'/%3E%3Cpath fill='currentColor' d='M10.99 14.308c-1.327-.978-3.49-2.84-3.49-4.593c0-2.677 2.475-3.677 4.5-1.609c2.025-2.068 4.5-1.068 4.5 1.609c0 1.752-2.163 3.615-3.49 4.593c-.454.335-.681.502-1.01.502s-.556-.167-1.01-.502'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:check-circle-bold-duotone,[i-solar\:check-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M16.03 8.97a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 1 1 1.06-1.06l1.47 1.47l2.235-2.235L14.97 8.97a.75.75 0 0 1 1.06 0'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:check-circle-line-duotone,[i-solar\:check-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m8.5 12.5l2 2l5-5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:close-circle-line-duotone,[i-solar\:close-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='m14.5 9.5l-5 5m0-5l5 5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:code-bold-duotone,[i-solar\:code-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.443 7.328a.75.75 0 0 1 1.059-.056l1.737 1.564c.737.663 1.347 1.212 1.767 1.71c.44.525.754 1.088.754 1.784c0 .695-.313 1.258-.754 1.782c-.42.499-1.03 1.049-1.767 1.711l-1.737 1.564a.75.75 0 1 1-1.004-1.115l1.697-1.527c.788-.709 1.319-1.19 1.663-1.598c.33-.393.402-.622.402-.817c0-.196-.072-.425-.402-.818c-.344-.409-.875-.889-1.663-1.598l-1.697-1.527a.75.75 0 0 1-.056-1.06m-8.94 1.06a.75.75 0 0 0-1.004-1.115L4.761 8.836c-.737.663-1.347 1.212-1.767 1.71c-.44.525-.754 1.088-.754 1.784c0 .695.313 1.258.754 1.782c.42.499 1.03 1.049 1.767 1.711l1.737 1.564a.75.75 0 1 0 1.004-1.115l-1.697-1.527c-.788-.709-1.319-1.19-1.663-1.598c-.33-.393-.402-.622-.402-.817c0-.196.072-.425.402-.818c.344-.409.875-.889 1.663-1.598z'/%3E%3Cpath fill='currentColor' d='M14.182 4.276a.75.75 0 0 1 .53.918l-3.974 14.83a.75.75 0 1 1-1.449-.389l3.974-14.83a.75.75 0 0 1 .919-.53' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:danger-triangle-bold-duotone,[i-solar\:danger-triangle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 3c-2.31 0-3.77 2.587-6.688 7.762l-.364.644c-2.425 4.3-3.638 6.45-2.542 8.022S6.214 21 11.636 21h.728c5.422 0 8.134 0 9.23-1.572s-.117-3.722-2.542-8.022l-.364-.645C15.77 5.587 14.311 3 12 3' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12 7.25a.75.75 0 0 1 .75.75v5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M12 17a1 1 0 1 0 0-2a1 1 0 0 0 0 2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:dialog-2-bold-duotone,[i-solar\:dialog-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m10.404 22.48l.275-.465c.44-.745.66-1.117 1.012-1.325c.351-.207.81-.222 1.725-.252c.859-.027 1.436-.102 1.93-.306a4.24 4.24 0 0 0 2.295-2.296c.323-.779.323-1.767.323-3.743v-.848c0-2.777 0-4.165-.625-5.185c-.35-.57-.83-1.05-1.4-1.4c-1.02-.625-2.408-.625-5.185-.625H8.21c-2.777 0-4.165 0-5.185.625c-.57.35-1.05.83-1.4 1.4C1 9.08 1 10.468 1 13.245v.848c0 1.976 0 2.964.323 3.744a4.24 4.24 0 0 0 2.295 2.295c.494.204 1.07.28 1.93.306c.916.03 1.374.045 1.725.252c.35.208.571.58 1.012 1.325l.275.465c.41.692 1.434.692 1.844 0m2.789-7.963a1.06 1.06 0 1 0 0-2.12a1.06 1.06 0 0 0 0 2.12m-2.65-1.06a1.06 1.06 0 1 1-2.121 0a1.06 1.06 0 0 1 2.12 0m-4.772 1.06a1.06 1.06 0 1 0 0-2.12a1.06 1.06 0 0 0 0 2.12' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M15.486 1c1.267 0 2.274 0 3.082.077c.829.079 1.53.244 2.153.626a4.8 4.8 0 0 1 1.575 1.575c.383.624.548 1.325.627 2.153c.076.808.076 1.816.076 3.082v.866c0 .901 0 1.619-.04 2.2c-.04.595-.125 1.106-.323 1.584a4.77 4.77 0 0 1-2.67 2.617q-.21.082-.368.135h-1.65c.016-.499.016-1.093.016-1.822v-.848c0-2.777 0-4.165-.625-5.185c-.35-.57-.83-1.05-1.4-1.4c-1.02-.625-2.408-.625-5.185-.625H8.21c-.986 0-1.796 0-2.478.028v-1.65q.05-.17.13-.396q.133-.389.346-.739a4.8 4.8 0 0 1 1.576-1.575c.624-.382 1.324-.547 2.153-.626C10.745 1 11.752 1 13.019 1z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:document-text-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M3 10c0-3.771 0-5.657 1.172-6.828S7.229 2 11 2h2c3.771 0 5.657 0 6.828 1.172S21 6.229 21 10v4c0 3.771 0 5.657-1.172 6.828S16.771 22 13 22h-2c-3.771 0-5.657 0-6.828-1.172S3 17.771 3 14z'/%3E%3Cpath stroke-linecap='round' d='M8 12h8M8 8h8m-8 8h5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:emoji-funny-square-bold-duotone,[i-solar\:emoji-funny-square-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M6.504 21.52c1.633.943 3.706.387 7.853-.724s6.22-1.666 7.163-3.3s.387-3.706-.724-7.853s-1.666-6.22-3.3-7.163s-3.706-.388-7.853.724c-4.147 1.11-6.22 1.666-7.163 3.3s-.388 3.706.724 7.853c1.11 4.147 1.666 6.22 3.3 7.163' opacity='.5'/%3E%3Cpath fill='currentColor' d='M14.898 11.224c.533-.143.792-.908.578-1.708s-.821-1.333-1.355-1.19c-.533.143-.792.907-.577 1.708c.214.8.82 1.333 1.354 1.19m-5.796 1.553c.534-.143.792-.908.578-1.708s-.82-1.333-1.354-1.19s-.792.907-.578 1.708s.82 1.333 1.354 1.19m-.917 2.974a.75.75 0 0 1 .91-.545c1.13.283 2.428.287 3.746-.066c1.318-.354 2.44-1.006 3.278-1.816a.75.75 0 1 1 1.043 1.078a8.4 8.4 0 0 1-1.15.928l.159.322a1.5 1.5 0 1 1-2.693 1.322l-.196-.4l-.053.014c-1.555.417-3.112.42-4.499.073a.75.75 0 0 1-.545-.91'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:eye-closed-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.919 6.605a1 1 0 0 0-1.838.79l.002.003l.003.007l.01.021l.032.072q.04.09.12.25c.105.21.262.506.47.857c.41.687 1.027 1.6 1.872 2.52l-.797.797a1 1 0 1 0 1.414 1.414l.84-.84c.565.455 1.197.885 1.897 1.256l-.782 1.202a1 1 0 0 0 1.676 1.091l.985-1.514c.677.208 1.402.355 2.177.425V16.5a1 1 0 0 0 1 1V13c-2.748 0-4.819-1.199-6.304-2.59l-.024-.022a12 12 0 0 1-.564-.569a13.4 13.4 0 0 1-1.67-2.237a12 12 0 0 1-.516-.968zm-1.838.79L2 7c-.92.394-.919.395-.919.395' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M15.22 12.398A8.7 8.7 0 0 1 12 13v4.5a1 1 0 0 0 1-1v-1.544c.772-.07 1.497-.217 2.176-.425l.986 1.515a1 1 0 0 0 1.676-1.091l-.782-1.203c.701-.37 1.332-.8 1.897-1.256l.84.84a1 1 0 1 0 1.414-1.414l-.797-.798a15.4 15.4 0 0 0 2.302-3.296a10 10 0 0 0 .19-.395l.011-.026l.004-.008l.002-.005a1 1 0 1 0-1.838-.788l-.005.011a5 5 0 0 1-.146.302a13 13 0 0 1-2.614 3.48c-.841.79-1.87 1.517-3.095 2' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:face-scan-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.801 2.57a.71.71 0 0 1-.555.838a8.78 8.78 0 0 0-6.838 6.838a.71.71 0 1 1-1.394-.283a10.2 10.2 0 0 1 7.949-7.949a.71.71 0 0 1 .838.556M2.57 13.199a.71.71 0 0 1 .838.555a8.78 8.78 0 0 0 6.838 6.838a.71.71 0 1 1-.283 1.394a10.2 10.2 0 0 1-7.948-7.949a.71.71 0 0 1 .555-.838M13.199 2.57a.71.71 0 0 1 .838-.556a10.2 10.2 0 0 1 7.949 7.949a.711.711 0 0 1-1.394.283a8.78 8.78 0 0 0-6.838-6.838a.71.71 0 0 1-.555-.838m8.231 10.629a.71.71 0 0 1 .556.838a10.2 10.2 0 0 1-7.949 7.949a.711.711 0 0 1-.283-1.394a8.78 8.78 0 0 0 6.838-6.838a.71.71 0 0 1 .838-.555' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M12 19.583a7.583 7.583 0 1 0 0-15.166a7.583 7.583 0 0 0 0 15.166' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.94 14.539a.71.71 0 0 1 .995-.148c.59.437 1.3.69 2.065.69a3.45 3.45 0 0 0 2.065-.69a.71.71 0 1 1 .847 1.142a4.87 4.87 0 0 1-2.912.97a4.87 4.87 0 0 1-2.911-.97a.71.71 0 0 1-.148-.994m5.547-2.895c.458 0 .83-.557.83-1.244s-.372-1.244-.83-1.244s-.83.557-.83 1.244s.372 1.244.83 1.244m-4.976 0c.458 0 .83-.557.83-1.244s-.372-1.244-.83-1.244s-.83.557-.83 1.244s.372 1.244.83 1.244'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:filters-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M18 8A6 6 0 1 1 6 8a6 6 0 0 1 12 0'/%3E%3Cpath fill='currentColor' d='M13.58 13.79a6 6 0 0 1-7.16-3.58a6 6 0 1 0 7.16 3.58' opacity='.7'/%3E%3Cpath fill='currentColor' d='M13.58 13.79c.271.684.42 1.43.42 2.21a6 6 0 0 1-2 4.472a6 6 0 1 0 5.58-10.262a6.01 6.01 0 0 1-4 3.58' opacity='.4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:ghost-bold-duotone,[i-solar\:ghost-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 19.206V12c0-5.523-4.477-10-10-10S2 6.477 2 12v7.206a1.727 1.727 0 0 0 2.5 1.544a2.89 2.89 0 0 1 2.896.18a2.89 2.89 0 0 0 3.208 0l.353-.234a1.88 1.88 0 0 1 2.086 0l.353.235a2.89 2.89 0 0 0 3.208 0a2.89 2.89 0 0 1 2.897-.18A1.727 1.727 0 0 0 22 19.206' opacity='.5'/%3E%3Cpath fill='currentColor' d='M15 12c.552 0 1-.672 1-1.5S15.552 9 15 9s-1 .672-1 1.5s.448 1.5 1 1.5m-5-1.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S8.448 9 9 9s1 .672 1 1.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:info-circle-line-duotone,[i-solar\:info-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='12' cy='12' r='10' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='M12 17v-6'/%3E%3Ccircle cx='1' cy='1' r='1' fill='currentColor' transform='matrix(1 0 0 -1 11 9)'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:layers-bold-duotone,[i-solar\:layers-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4.979 9.685C2.993 8.891 2 8.494 2 8s.993-.89 2.979-1.685l2.808-1.123C9.773 4.397 10.767 4 12 4s2.227.397 4.213 1.192l2.808 1.123C21.007 7.109 22 7.506 22 8s-.993.89-2.979 1.685l-2.808 1.124C14.227 11.603 13.233 12 12 12s-2.227-.397-4.213-1.191z'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 8c0 .494.993.89 2.979 1.685l2.808 1.124C9.773 11.603 10.767 12 12 12s2.227-.397 4.213-1.191l2.808-1.124C21.007 8.891 22 8.494 22 8s-.993-.89-2.979-1.685l-2.808-1.123C14.227 4.397 13.233 4 12 4s-2.227.397-4.213 1.192L4.98 6.315C2.993 7.109 2 7.506 2 8' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m5.766 10l-.787.315C2.993 11.109 2 11.507 2 12s.993.89 2.979 1.685l2.808 1.124C9.773 15.603 10.767 16 12 16s2.227-.397 4.213-1.191l2.808-1.124C21.007 12.891 22 12.493 22 12s-.993-.89-2.979-1.685L18.234 10l-2.021.809C14.227 11.603 13.233 12 12 12s-2.227-.397-4.213-1.191z' opacity='.7'/%3E%3Cpath fill='currentColor' d='m5.766 14l-.787.315C2.993 15.109 2 15.507 2 16s.993.89 2.979 1.685l2.808 1.124C9.773 19.603 10.767 20 12 20s2.227-.397 4.213-1.192l2.808-1.123C21.007 16.891 22 16.494 22 16c0-.493-.993-.89-2.979-1.685L18.234 14l-2.021.809C14.227 15.603 13.233 16 12 16s-2.227-.397-4.213-1.191z' opacity='.4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:leaf-bold-duotone,[i-solar\:leaf-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 22c-4.418 0-8-3.646-8-8.143c0-4.462 2.553-9.67 6.537-11.531A3.45 3.45 0 0 1 12 2z' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M13.463 2.326A3.45 3.45 0 0 0 12 2v7l4.432-4.432c-.863-.947-1.86-1.724-2.97-2.242' opacity='.3'/%3E%3Cpath fill='currentColor' d='M12 9v5.5l6.614-6.614c-.572-1.22-1.308-2.357-2.182-3.318z' opacity='.4'/%3E%3Cpath fill='currentColor' d='m12 19.5l7.811-7.811a15 15 0 0 0-1.197-3.803L12 14.5z' opacity='.6'/%3E%3Cpath fill='currentColor' d='M19.811 11.689L12 19.5V22c4.418 0 8-3.646 8-8.143c0-.71-.064-1.438-.189-2.168' opacity='.7'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:magic-stick-2-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.714 2.127c-.836-.43-1.922.263-4.095 1.65l-.562.36c-.618.394-.927.591-1.273.648c-.347.056-.692-.034-1.382-.215l-.628-.164C6.345 3.769 5.13 3.45 4.436 4.13s-.412 1.908.157 4.363l.147.635c.161.697.242 1.046.177 1.393c-.066.346-.27.65-.68 1.26l-.372.555c-1.439 2.145-2.158 3.217-1.753 4.067c.406.85 1.668.915 4.192 1.045l.654.033c.717.037 1.076.056 1.382.213c.306.158.524.436.962.994l.398.507c1.539 1.962 2.309 2.943 3.255 2.788c.945-.154 1.441-1.342 2.433-3.717l.257-.614c.282-.675.422-1.012.677-1.261c.255-.25.595-.382 1.274-.647l.618-.24c2.39-.933 3.586-1.4 3.765-2.345s-.777-1.744-2.688-3.342l-.495-.413c-.543-.454-.815-.68-.963-.992s-.158-.672-.175-1.393l-.016-.657c-.062-2.538-.093-3.806-.928-4.236'/%3E%3Cpath fill='currentColor' d='M15.93 16.991c.127-.268.239-.45.392-.6c.172-.167.382-.282.71-.42l4.498 4.499a.75.75 0 0 1-1.06 1.06z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:magic-stick-3-bold-duotone,[i-solar\:magic-stick-3-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3.845 3.845a2.883 2.883 0 0 0 0 4.077L5.432 9.51c.012-.014.555.503.568.49l4-4c.013-.013-.504-.556-.49-.568L7.922 3.845a2.883 2.883 0 0 0-4.077 0m1.288 11.462a.483.483 0 0 1 .9 0l.157.4a.48.48 0 0 0 .272.273l.398.157a.486.486 0 0 1 0 .903l-.398.158a.48.48 0 0 0-.272.273l-.157.4a.483.483 0 0 1-.9 0l-.157-.4a.48.48 0 0 0-.272-.273l-.398-.158a.486.486 0 0 1 0-.903l.398-.157a.48.48 0 0 0 .272-.274z' opacity='.5'/%3E%3Cpath fill='currentColor' d='M19.967 9.13a.483.483 0 0 1 .9 0l.156.399c.05.125.148.224.273.273l.398.158a.486.486 0 0 1 0 .902l-.398.158a.5.5 0 0 0-.273.273l-.156.4a.483.483 0 0 1-.9 0l-.157-.4a.5.5 0 0 0-.272-.273l-.398-.158a.486.486 0 0 1 0-.902l.398-.158a.5.5 0 0 0 .272-.273z' opacity='.2'/%3E%3Cpath fill='currentColor' d='M16.1 2.307a.483.483 0 0 1 .9 0l.43 1.095a.48.48 0 0 0 .272.274l1.091.432a.486.486 0 0 1 0 .903l-1.09.432a.5.5 0 0 0-.273.273L17 6.81a.483.483 0 0 1-.9 0l-.43-1.095a.5.5 0 0 0-.273-.273l-1.09-.432a.486.486 0 0 1 0-.903l1.09-.432a.5.5 0 0 0 .273-.274z' opacity='.7'/%3E%3Cpath fill='currentColor' d='M10.568 6.49c-.012.014-.555-.503-.568-.49l-4 4c-.013.013.504.556.49.568l9.588 9.587a2.883 2.883 0 1 0 4.078-4.077z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:magnifer-line-duotone,[i-solar\:magnifer-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cdefs%3E%3Cmask id='solarMagniferLineDuotone0'%3E%3Cg fill='none' stroke-width='1.5'%3E%3Ccircle cx='11.5' cy='11.5' r='9.5' stroke='gray'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' d='M18.5 18.5L22 22'/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Cpath fill='currentColor' d='M0 0h24v24H0z' mask='url(%23solarMagniferLineDuotone0)'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:microphone-2-bold-duotone,[i-solar\:microphone-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M4 9a.75.75 0 0 1 .75.75v1a7.25 7.25 0 1 0 14.5 0v-1a.75.75 0 0 1 1.5 0v1a8.75 8.75 0 0 1-8 8.718v2.282a.75.75 0 0 1-1.5 0v-2.282a8.75 8.75 0 0 1-8-8.718v-1A.75.75 0 0 1 4 9' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M9.75 7.75A.75.75 0 0 0 9 7H6.298a5.751 5.751 0 0 1 11.404 0H13.5a.75.75 0 0 0 0 1.5h4.25V10H13.5a.75.75 0 0 0 0 1.5h4.201a5.751 5.751 0 0 1-11.403 0H9A.75.75 0 0 0 9 10H6.25V8.5H9a.75.75 0 0 0 .75-.75' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12.75 10.75c0 .414.336.75.75.75h4.201l.049-1.5H13.5a.75.75 0 0 0-.75.75m0-3c0 .414.336.75.75.75h4.25L17.701 7H13.5a.75.75 0 0 0-.75.75m-3 0A.75.75 0 0 0 9 7H6.298L6.25 8.5H9a.75.75 0 0 0 .75-.75m0 3A.75.75 0 0 0 9 10H6.25l.048 1.5H9a.75.75 0 0 0 .75-.75'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:microphone-3-bold-duotone,[i-solar\:microphone-3-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M4 9a.75.75 0 0 1 .75.75v1a7.25 7.25 0 1 0 14.5 0v-1a.75.75 0 0 1 1.5 0v1a8.75 8.75 0 0 1-8 8.718v2.282a.75.75 0 0 1-1.5 0v-2.282a8.75 8.75 0 0 1-8-8.718v-1A.75.75 0 0 1 4 9' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 2a5.75 5.75 0 0 0-5.75 5.75v3a5.75 5.75 0 0 0 11.5 0v-3A5.75 5.75 0 0 0 12 2m2 9.5a.75.75 0 0 0 0-1.5h-4a.75.75 0 0 0 0 1.5zm-.25-3.75a.75.75 0 0 1-.75.75h-2A.75.75 0 0 1 11 7h2a.75.75 0 0 1 .75.75' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M14 11.5a.75.75 0 0 0 0-1.5h-4a.75.75 0 0 0 0 1.5zm-1-3A.75.75 0 0 0 13 7h-2a.75.75 0 0 0 0 1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:minus-circle-line-duotone,[i-solar\:minus-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12H9'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:moon-stars-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19.9 2.307a.483.483 0 0 0-.9 0l-.43 1.095a.48.48 0 0 1-.272.274l-1.091.432a.486.486 0 0 0 0 .903l1.091.432a.48.48 0 0 1 .272.273L19 6.81c.162.41.74.41.9 0l.43-1.095a.48.48 0 0 1 .273-.273l1.091-.432a.486.486 0 0 0 0-.903l-1.091-.432a.48.48 0 0 1-.273-.274zM16.033 8.13a.483.483 0 0 0-.9 0l-.157.399a.48.48 0 0 1-.272.273l-.398.158a.486.486 0 0 0 0 .903l.398.157c.125.05.223.148.272.274l.157.399c.161.41.739.41.9 0l.157-.4a.48.48 0 0 1 .272-.273l.398-.157a.486.486 0 0 0 0-.903l-.398-.158a.48.48 0 0 1-.272-.273z'/%3E%3Cpath fill='currentColor' d='M12 22c5.523 0 10-4.477 10-10c0-.463-.694-.54-.933-.143a6.5 6.5 0 1 1-8.924-8.924C12.54 2.693 12.463 2 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:notes-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='m20.312 12.647l.517-1.932c.604-2.255.907-3.382.68-4.358a4 4 0 0 0-1.162-2.011c-.731-.685-1.859-.987-4.114-1.591c-2.255-.605-3.383-.907-4.358-.68a4 4 0 0 0-2.011 1.162c-.587.626-.893 1.543-1.348 3.209l-.244.905l-.517 1.932c-.605 2.255-.907 3.382-.68 4.358a4 4 0 0 0 1.162 2.011c.731.685 1.859.987 4.114 1.592c2.032.544 3.149.843 4.064.73q.15-.019.294-.052a4 4 0 0 0 2.011-1.16c.685-.732.987-1.86 1.592-4.115Z'/%3E%3Cpath d='M16.415 17.974a4 4 0 0 1-1.068 1.678c-.731.685-1.859.987-4.114 1.591s-3.383.907-4.358.679a4 4 0 0 1-2.011-1.161c-.685-.731-.988-1.859-1.592-4.114l-.517-1.932c-.605-2.255-.907-3.383-.68-4.358a4 4 0 0 1 1.162-2.011c.731-.685 1.859-.987 4.114-1.592q.638-.172 1.165-.309'/%3E%3Cpath stroke-linecap='round' d='m11.777 10l4.83 1.294M11 12.898l2.898.776'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:pallete-2-bold-duotone,[i-solar\:pallete-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M10.847 21.934C5.867 21.362 2 17.133 2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.157-3.283 4.733-6.086 4.37c-1.618-.209-3.075-.397-3.652.518c-.395.626.032 1.406.555 1.929a1.673 1.673 0 0 1 0 2.366c-.523.523-1.235.836-1.97.751' opacity='.5'/%3E%3Cpath fill='currentColor' d='M11.085 7a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M6.5 13a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m11 0a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m-3-4.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:pause-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.076 8.617C8 8.801 8 9.034 8 9.5v5c0 .466 0 .699.076.883a1 1 0 0 0 .541.54c.184.077.417.077.883.077s.699 0 .883-.076a1 1 0 0 0 .54-.541c.077-.184.077-.417.077-.883v-5c0-.466 0-.699-.076-.883a1 1 0 0 0-.541-.54C10.199 8 9.966 8 9.5 8s-.699 0-.883.076a1 1 0 0 0-.54.541m4.999 0C13 8.801 13 9.034 13 9.5v5c0 .466 0 .699.076.883a1 1 0 0 0 .541.54c.184.077.417.077.883.077s.699 0 .883-.076a1 1 0 0 0 .54-.541c.077-.184.077-.417.077-.883v-5c0-.466 0-.699-.076-.883a1 1 0 0 0-.541-.54C15.199 8 14.966 8 14.5 8s-.699 0-.883.076a1 1 0 0 0-.54.541'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:people-nearby-bold-duotone,[i-solar\:people-nearby-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19.717 20.362C21.143 19.585 22 18.587 22 17.5c0-1.152-.963-2.204-2.546-3C17.623 13.58 14.962 13 12 13s-5.623.58-7.454 1.5C2.963 15.296 2 16.348 2 17.5s.963 2.204 2.546 3C6.377 21.42 9.038 22 12 22c3.107 0 5.882-.637 7.717-1.638' opacity='.6'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M9.25 4a2.75 2.75 0 1 1 5.5 0a2.75 2.75 0 0 1-5.5 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m8.223 11.574l-2.175-.725a1.532 1.532 0 0 1 .805-2.952l1.898.407l.21.044a15 15 0 0 0 6.288-.044l1.897-.407a1.532 1.532 0 0 1 .806 2.952l-2.175.725c-.263.088-.394.132-.493.193a1 1 0 0 0-.466.986c.016.115.066.244.165.503l1.247 3.242a1.473 1.473 0 0 1-2.654 1.26L12 15l-1.576 2.757a1.473 1.473 0 0 1-2.654-1.26l1.247-3.241c.1-.259.149-.388.165-.503a1 1 0 0 0-.466-.986c-.099-.061-.23-.105-.493-.193'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:play-circle-bold-duotone,[i-solar\:play-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='m15.414 13.059l-4.72 2.787C9.934 16.294 9 15.71 9 14.786V9.214c0-.924.934-1.507 1.694-1.059l4.72 2.787c.781.462.781 1.656 0 2.118'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:play-circle-broken{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M13.888 9.935C14.963 10.812 15.5 11.25 15.5 12s-.537 1.188-1.612 2.065c-.297.242-.591.47-.862.66c-.237.167-.506.339-.784.508c-1.073.652-1.609.978-2.09.617c-.48-.36-.524-1.116-.612-2.628c-.024-.427-.04-.846-.04-1.222s.016-.795.04-1.222c.088-1.512.132-2.267.612-2.628c.481-.361 1.018-.035 2.09.617c.278.169.547.341.784.508c.27.19.565.418.862.66Z'/%3E%3Cpath stroke-linecap='round' d='M7 3.338A9.95 9.95 0 0 1 12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12c0-1.821.487-3.53 1.338-5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:refresh-bold-duotone,[i-solar\:refresh-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25'/%3E%3Cpath fill='currentColor' d='M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:running-2-line-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='18.5' cy='4.5' r='2.5' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='m9 17l-1 1.2c-.738.886-1.107 1.328-1.61 1.564S5.31 20 4.157 20H3'/%3E%3Cpath fill='currentColor' d='M13.65 22a.75.75 0 0 0 1.5 0zm-1.085-5.754l.453-.598zm1.184 1.015l.587-.466zm.557 1.12l.727-.186zm-.802-6.826a.75.75 0 0 0-1.009-1.11zm-2.652 1.61l.703.26zm.07 1.555l-.677.323zm2.728 5.219v2.06h1.5v-2.06zm-1.538-3.095c.663.502.887.679 1.05.884l1.174-.934c-.308-.387-.717-.69-1.319-1.146zm3.038 3.095c0-.755.006-1.264-.117-1.744l-1.453.373c.065.254.07.538.07 1.37zm-1.988-2.211c.197.247.339.534.417.84l1.454-.373a3.75 3.75 0 0 0-.697-1.4zm-.667-7.283c-.42.381-.945.836-1.354 1.224c-.21.198-.41.398-.573.586c-.149.172-.327.4-.42.649l1.407.521c-.007.021.014-.035.146-.187c.116-.134.276-.295.471-.48c.4-.38.865-.778 1.332-1.203zm.523 5.203c-.488-.37-.818-.62-1.056-.832c-.233-.208-.32-.33-.363-.418l-1.354.645c.167.35.423.63.72.894c.292.26.679.552 1.147.907zm-2.87-2.744a2.75 2.75 0 0 0 .097 2.139l1.354-.645a1.25 1.25 0 0 1-.044-.973z' opacity='.5'/%3E%3Cpath fill='currentColor' d='m5.436 8.82l-.37-.652zm-1.807.164a.75.75 0 1 0 .742 1.304zm9.778-1.627l-.286.693zm-2.96-.715l-.055-.748zM21 12.75a.75.75 0 1 0 0-1.5zm-5.232-3.213l-.67.335zM5.065 8.168l-1.436.816l.742 1.304l1.435-.816zm8.627-1.505c-1.344-.553-2.08-.857-3.3-.769l.11 1.496c.823-.06 1.255.099 2.62.66zm-7.886 2.81c2.502-1.422 3.552-2 4.695-2.083l-.109-1.496c-1.56.114-2.949.923-5.327 2.274zm13.949 3.276H21v-1.5h-1.245zm-4.658-2.878a5.21 5.21 0 0 0 4.658 2.878v-1.5A3.71 3.71 0 0 1 16.439 9.2zm1.342-.67a5.33 5.33 0 0 0-2.747-2.538l-.57 1.387c.86.354 1.564 1 1.975 1.821z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:settings-bold-duotone,[i-solar\:settings-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M14.279 2.152C13.909 2 13.439 2 12.5 2s-1.408 0-1.779.152a2 2 0 0 0-1.09 1.083c-.094.223-.13.484-.145.863a1.62 1.62 0 0 1-.796 1.353a1.64 1.64 0 0 1-1.579.008c-.338-.178-.583-.276-.825-.308a2.03 2.03 0 0 0-1.49.396c-.318.242-.553.646-1.022 1.453c-.47.807-.704 1.21-.757 1.605c-.07.526.074 1.058.4 1.479c.148.192.357.353.68.555c.477.297.783.803.783 1.361s-.306 1.064-.782 1.36c-.324.203-.533.364-.682.556a2 2 0 0 0-.399 1.479c.053.394.287.798.757 1.605s.704 1.21 1.022 1.453c.424.323.96.465 1.49.396c.242-.032.487-.13.825-.308a1.64 1.64 0 0 1 1.58.008c.486.28.774.795.795 1.353c.015.38.051.64.145.863c.204.49.596.88 1.09 1.083c.37.152.84.152 1.779.152s1.409 0 1.779-.152a2 2 0 0 0 1.09-1.083c.094-.223.13-.483.145-.863c.02-.558.309-1.074.796-1.353a1.64 1.64 0 0 1 1.579-.008c.338.178.583.276.825.308c.53.07 1.066-.073 1.49-.396c.318-.242.553-.646 1.022-1.453c.47-.807.704-1.21.757-1.605a2 2 0 0 0-.4-1.479c-.148-.192-.357-.353-.68-.555c-.477-.297-.783-.803-.783-1.361s.306-1.064.782-1.36c.324-.203.533-.364.682-.556a2 2 0 0 0 .399-1.479c-.053-.394-.287-.798-.757-1.605s-.704-1.21-1.022-1.453a2.03 2.03 0 0 0-1.49-.396c-.242.032-.487.13-.825.308a1.64 1.64 0 0 1-1.58-.008a1.62 1.62 0 0 1-.795-1.353c-.015-.38-.051-.64-.145-.863a2 2 0 0 0-1.09-1.083' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M15.523 12c0 1.657-1.354 3-3.023 3s-3.023-1.343-3.023-3S10.83 9 12.5 9s3.023 1.343 3.023 3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:settings-minimalistic-bold-duotone,[i-solar\:settings-minimalistic-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.428 2c-1.114 0-2.129.6-4.157 1.802l-.686.406C5.555 5.41 4.542 6.011 3.985 7c-.557.99-.557 2.19-.557 4.594v.812c0 2.403 0 3.605.557 4.594s1.57 1.59 3.6 2.791l.686.407C10.299 21.399 11.314 22 12.428 22s2.128-.6 4.157-1.802l.686-.407c2.028-1.2 3.043-1.802 3.6-2.791c.557-.99.557-2.19.557-4.594v-.812c0-2.403 0-3.605-.557-4.594s-1.572-1.59-3.6-2.792l-.686-.406C14.555 2.601 13.542 2 12.428 2' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12.428 8.25a3.75 3.75 0 1 0 0 7.5a3.75 3.75 0 0 0 0-7.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:star-fall-2-bold-duotone,[i-solar\:star-fall-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M11.58 4.776c.695-1.77 1.043-2.656 1.769-2.765c.726-.11 1.35.63 2.6 2.109l.323.382c.355.42.532.63.774.75c.24.12.518.137 1.074.17l.506.029c1.955.114 2.932.172 3.271.81c.34.64-.184 1.438-1.231 3.033l-.271.413c-.298.453-.447.68-.487.939s.033.52.179 1.043l.133.477c.513 1.842.77 2.762.253 3.266c-.517.505-1.465.258-3.361-.235l-.49-.127c-.54-.14-.809-.21-1.075-.17s-.499.185-.964.476l-.424.265c-1.638 1.024-2.456 1.536-3.115 1.208c-.659-.327-.72-1.277-.845-3.177l-.033-.492c-.035-.54-.053-.81-.177-1.044s-.34-.406-.774-.75l-.395-.312C7.294 9.865 6.53 9.26 6.64 8.554s1.02-1.047 2.839-1.729l.47-.176c.518-.194.776-.29.965-.475c.19-.185.288-.437.486-.94z'/%3E%3Cpath fill='currentColor' d='M5.31 9.593C2.873 11.92 1.275 15.806 2.331 22c.943-2.603 3.526-4.76 6.581-6.047c-.106-.593-.154-1.317-.204-2.08l-.039-.595a22 22 0 0 0-.032-.43l-.086-.071l-.268-.215l-.475-.376c-.694-.55-1.34-1.06-1.783-1.532c-.253-.269-.536-.624-.715-1.061m5.037 5.83l-.015-.114l.056.101z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:stop-circle-bold-duotone,[i-solar\:stop-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.586 8.586C8 9.172 8 10.114 8 12s0 2.828.586 3.414S10.114 16 12 16s2.828 0 3.414-.586S16 13.886 16 12s0-2.828-.586-3.414S13.886 8 12 8s-2.828 0-3.414.586'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:sun-fog-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7.25 22a.75.75 0 0 1 .75-.75h8a.75.75 0 0 1 0 1.5H8a.75.75 0 0 1-.75-.75M12 1.25a.75.75 0 0 1 .75.75v1a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75M1.25 12a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5H2a.75.75 0 0 1-.75-.75m19 0a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75M6.083 15.25H2a.75.75 0 0 0 0 1.5h20a.75.75 0 0 0 0-1.5z' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M4.25 19a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75m.148-14.602a.75.75 0 0 1 1.061 0l.393.393a.75.75 0 0 1-1.06 1.06l-.394-.392a.75.75 0 0 1 0-1.06m15.202 0a.75.75 0 0 1 0 1.06l-.392.393a.75.75 0 0 1-1.06-1.06l.392-.393a.75.75 0 0 1 1.06 0M5.25 12c0 1.178.302 2.286.833 3.25h11.834A6.75 6.75 0 1 0 5.25 12' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:trash-bin-trash-linear,[i-solar\:trash-bin-trash-linear=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' d='M20.5 6h-17m15.333 2.5l-.46 6.9c-.177 2.654-.265 3.981-1.13 4.79s-2.196.81-4.856.81h-.774c-2.66 0-3.991 0-4.856-.81c-.865-.809-.954-2.136-1.13-4.79l-.46-6.9M9.5 11l.5 5m4.5-5l-.5 5'/%3E%3Cpath d='M6.5 6h.11a2 2 0 0 0 1.83-1.32l.034-.103l.097-.291c.083-.249.125-.373.18-.479a1.5 1.5 0 0 1 1.094-.788C9.962 3 10.093 3 10.355 3h3.29c.262 0 .393 0 .51.019a1.5 1.5 0 0 1 1.094.788c.055.106.097.23.18.479l.097.291A2 2 0 0 0 17.5 6'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:tuning-square-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z'/%3E%3Ccircle cx='8' cy='10' r='2'/%3E%3Ccircle cx='2' cy='2' r='2' transform='matrix(1 0 0 -1 14 16)'/%3E%3Cpath stroke-linecap='round' d='M8 14v5m8-9V5M8 5v1m8 13v-1'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:undo-left-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7.53 3.47a.75.75 0 0 1 0 1.06L5.06 7l2.47 2.47a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m5.06 7l.75-.75h9.226c.904 0 1.633 0 2.222.053c.606.055 1.136.172 1.617.45a3.75 3.75 0 0 1 1.372 1.372c.278.481.395 1.011.45 1.617c.053.589.053 1.318.053 2.222v.072c0 .904 0 1.633-.053 2.222c-.055.606-.172 1.136-.45 1.617a3.75 3.75 0 0 1-1.372 1.373c-.481.277-1.011.394-1.617.449c-.589.053-1.318.053-2.222.053H8a.75.75 0 0 1 0-1.5h7c.948 0 1.61 0 2.122-.047c.502-.046.788-.13 1.003-.254a2.25 2.25 0 0 0 .823-.824c.125-.215.21-.5.255-1.003c.046-.512.047-1.174.047-2.122s0-1.61-.047-2.122c-.046-.503-.13-.788-.255-1.003a2.25 2.25 0 0 0-.823-.824c-.215-.124-.5-.208-1.003-.254c-.512-.046-1.174-.047-2.122-.047H5.81z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:upload-minimalistic-bold,[i-solar\:upload-minimalistic-bold=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12.554 2.494a.75.75 0 0 0-1.107 0l-4 4.375A.75.75 0 0 0 8.553 7.88l2.696-2.95V16a.75.75 0 0 0 1.5 0V4.932l2.697 2.95a.75.75 0 1 0 1.107-1.013z'/%3E%3Cpath fill='currentColor' d='M3.75 15a.75.75 0 0 0-1.5 0v.055c0 1.367 0 2.47.117 3.337c.12.9.38 1.658.981 2.26c.602.602 1.36.86 2.26.982c.867.116 1.97.116 3.337.116h6.11c1.367 0 2.47 0 3.337-.116c.9-.122 1.658-.38 2.26-.982s.86-1.36.982-2.26c.116-.867.116-1.97.116-3.337V15a.75.75 0 0 0-1.5 0c0 1.435-.002 2.436-.103 3.192c-.099.734-.28 1.122-.556 1.399c-.277.277-.665.457-1.4.556c-.755.101-1.756.103-3.191.103H9c-1.435 0-2.437-.002-3.192-.103c-.734-.099-1.122-.28-1.399-.556c-.277-.277-.457-.665-.556-1.4c-.101-.755-.103-1.756-.103-3.191'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:upload-square-line-duotone,[i-solar\:upload-square-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 17v-7m0 0l3 3m-3-3l-3 3'/%3E%3Cpath stroke-linecap='round' d='M16 7H8'/%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:user-rounded-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='6' r='4'/%3E%3Cellipse cx='12' cy='17' rx='7' ry='4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-solar\:user-speak-rounded-bold-duotone,[i-solar\:user-speak-rounded-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='10' cy='6.75' r='4' fill='currentColor'/%3E%3Cellipse cx='10' cy='17.75' fill='currentColor' opacity='.5' rx='7' ry='4'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M18.357 2.364a.75.75 0 0 1 1.029-.257L19 2.75l.386-.643h.001l.002.002l.004.002l.01.006l.113.076c.07.049.166.12.277.212c.222.185.512.462.802.838c.582.758 1.155 1.914 1.155 3.507s-.573 2.75-1.155 3.507c-.29.376-.58.653-.802.838a4 4 0 0 1-.363.27l-.028.018l-.01.006l-.003.002l-.002.001s-.001.001-.387-.642l.386.643a.75.75 0 0 1-.776-1.283l.005-.004l.041-.027q.06-.042.177-.136c.152-.128.362-.326.573-.6c.417-.542.844-1.386.844-2.593s-.427-2.05-.844-2.593a3.8 3.8 0 0 0-.573-.6a3 3 0 0 0-.218-.163l-.005-.003a.75.75 0 0 1-.253-1.027' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M16.33 4.415a.75.75 0 0 1 1.006-.336L17 4.75l.336-.67h.001l.002.001l.004.002l.008.004l.022.012a2 2 0 0 1 .233.153c.136.102.31.254.48.467c.349.436.664 1.099.664 2.031s-.316 1.595-.664 2.031a2.7 2.7 0 0 1-.654.586l-.06.034l-.02.012l-.01.004l-.003.002l-.002.001l-.33-.657l.329.658a.75.75 0 0 1-.685-1.335l.003-.001l.052-.036c.052-.04.13-.106.209-.205c.15-.189.335-.526.335-1.094s-.184-.905-.335-1.094a1.2 1.2 0 0 0-.261-.24l-.003-.002a.75.75 0 0 1-.322-1' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-svg-spinners\:ring-resize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg stroke='currentColor'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-linecap='round' stroke-width='3'%3E%3Canimate attributeName='stroke-dasharray' calcMode='spline' dur='1.5s' keySplines='0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1' keyTimes='0;0.475;0.95;1' repeatCount='indefinite' values='0 150;42 150;42 150;42 150'/%3E%3Canimate attributeName='stroke-dashoffset' calcMode='spline' dur='1.5s' keySplines='0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1' keyTimes='0;0.475;0.95;1' repeatCount='indefinite' values='0;-16;-59;-59'/%3E%3C/circle%3E%3CanimateTransform attributeName='transform' dur='2s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon)no-repeat;-webkit-mask:var(--un-icon)no-repeat;mask:var(--un-icon)no-repeat;color:inherit;background-color:currentColor;width:1.2em;height:1.2em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-vscode-icons\:file-type-minecraft{background:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='%2352a535' d='M30 2H2v28h28z'/%3E%3Cpath fill='%2386d562' d='M24.4 13.2h-5.6v.47h5.6zm-5.6 8.4h-5.6v.47h5.6zm2.8 2.8h-2.8v.47h2.8zm-8.4 0h-2.8v.47h2.8zm0-11.2H7.6v.47h5.6z'/%3E%3Cpath d='M24.4 13.2V7.6h-5.6v5.6h-5.6V16h-2.8v8.4h2.8v-2.8h5.6v2.8h2.8V16h-2.8v-2.8zM13.2 7.6H7.6v5.6h5.6z'/%3E%3Cpath fill='%232a641c' d='M24.4 7.6h-5.6v.47h5.6zm-5.6 5.6h-5.6v.47h5.6zm-5.6-5.6H7.6v.47h5.6zm0 8.4h-2.8v.47h2.8zm8.4 0h-2.8v.47h2.8z'/%3E%3C/svg%3E") 0 0/100% 100% no-repeat;width:1.2em;height:1.2em}.prose :where(h1,h2,h3,h4,h5,h6):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-headings);font-weight:600;line-height:1.25}.prose :where(a):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-links);font-weight:500;text-decoration:underline}.prose :where(a code):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-links)}.prose :where(p,ul,ol,pre):not(:where(.not-prose,.not-prose *)){margin:1em 0;line-height:1.75}.prose :where(blockquote):not(:where(.not-prose,.not-prose *)){border-left:.25em solid var(--un-prose-borders);margin:1em 0;padding-left:1em;font-style:italic}.prose :where(h1):not(:where(.not-prose,.not-prose *)){margin:1rem 0;font-size:2.25em}.prose :where(h2):not(:where(.not-prose,.not-prose *)){margin:1.75em 0 .5em;font-size:1.75em}.prose :where(h3):not(:where(.not-prose,.not-prose *)){margin:1.5em 0 .5em;font-size:1.375em}.prose :where(h4):not(:where(.not-prose,.not-prose *)){margin:1em 0;font-size:1.125em}.prose :where(img,video):not(:where(.not-prose,.not-prose *)){max-width:100%}.prose :where(figure,picture):not(:where(.not-prose,.not-prose *)){margin:1em 0}.prose :where(figcaption):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-captions);font-size:.875em}.prose :where(code):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-code);font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.875em;font-weight:600}.prose :where(:not(pre)>code):not(:where(.not-prose,.not-prose *)):before{content:"`"}.prose :where(:not(pre)>code):not(:where(.not-prose,.not-prose *)):after{content:"`"}.prose :where(pre):not(:where(.not-prose,.not-prose *)){border-radius:.375rem;padding:1.25rem 1.5rem;overflow-x:auto}.prose :where(pre,code):not(:where(.not-prose,.not-prose *)){white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none;background:0 0}.prose :where(pre code):not(:where(.not-prose,.not-prose *)){font-weight:inherit}.prose :where(ol,ul):not(:where(.not-prose,.not-prose *)){padding-left:1.25em}.prose :where(ol):not(:where(.not-prose,.not-prose *)){list-style-type:decimal}.prose :where(ol[type=A]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where(.not-prose,.not-prose *)){list-style-type:decimal}.prose :where(ul):not(:where(.not-prose,.not-prose *)){list-style-type:disc}.prose :where(ol>li):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(ul>li):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(summary):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(hr):not(:where(.not-prose,.not-prose *)){border:1px solid var(--un-prose-hr);margin:2em 0}.prose :where(table):not(:where(.not-prose,.not-prose *)){border-collapse:collapse;margin:1em 0;display:block;overflow-x:auto}.prose :where(tr):not(:where(.not-prose,.not-prose *)):nth-child(2n){background:var(--un-prose-bg-soft)}.prose :where(td,th):not(:where(.not-prose,.not-prose *)){border:1px solid var(--un-prose-borders);padding:.625em 1em}.prose :where(abbr):not(:where(.not-prose,.not-prose *)){cursor:help}.prose :where(kbd):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-code);border:1px solid;border-radius:.25rem;padding:.25rem .5rem;font-size:.875em}.prose :where(details):not(:where(.not-prose,.not-prose *)){background:var(--un-prose-bg-soft);margin:1em 0;padding:1.25rem 1.5rem}.prose :where(summary):not(:where(.not-prose,.not-prose *)){cursor:pointer;font-weight:600}.prose{color:var(--un-prose-body);max-width:65ch}.container,[container=""]{width:100%}.scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}@media (min-width:640px){.container,[container=""]{max-width:640px}}@media (min-width:768px){.container,[container=""]{max-width:768px}}@media (min-width:1024px){.container,[container=""]{max-width:1024px}}@media (min-width:1280px){.container,[container=""]{max-width:1280px}}@media (min-width:1536px){.container,[container=""]{max-width:1536px}}.\[input\:checked\~\&\]{input:checked~&}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.pointer-events-none,[pointer-events-none=""],.disabled\:pointer-events-none:disabled{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.absolute,[absolute=""]{position:absolute}.fixed,[fixed=""]{position:fixed}.relative,[relative=""]{position:relative}.sticky,[sticky=""]{position:sticky}[before~=absolute]:before,.after\:absolute:after,[after~=absolute]:after{position:absolute}.inset-0,[inset-0=""],[before~=inset-0]:before,[after~=inset-0]:after{top:0;bottom:0;left:0;right:0}.inset-x-0,[inset-x-0=""]{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0,[bottom-0=""]{bottom:0}.bottom-11,[bottom-11=""]{bottom:2.75rem}.bottom-2{bottom:.5rem}.left-0,[left-0=""]{left:0}.left-1\/2,[left~="1/2"]{left:50%}.left-2{left:.5rem}.right--10,[right--10=""]{right:-2.5rem}.right--15,[right--15=""]{right:-3.75rem}.right--5,[right--5=""]{right:-1.25rem}.right-0,[right-0=""],[right~="0"]{right:0}.right-2{right:.5rem}.top--20,[top--20=""]{top:-5rem}.top-\[-32px\]{top:-32px}.top-0,[top-0=""],[top~="0"]{top:0}.top-1\/2,[top~="50%"]{top:50%}.top-2{top:.5rem}[bottom~="[calc(100%+8px)]"]{bottom:calc(100% + 8px)}[bottom~="20%"]{bottom:20%}[bottom~="3"]{bottom:.75rem}[right~="3"]{right:.75rem}[top~="[65dvh]"]{top:65dvh}[top~="[calc(100dvh-12rem)]"]{top:calc(100dvh - 12rem)}[top~="[calc(100dvh-15rem)]"]{top:calc(100dvh - 15rem)}.after\:left-\[2px\]:after{left:2px}.after\:top-\[2px\]:after{top:2px}.line-clamp-1{-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3,[line-clamp-3=""]{-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.z--1,[z--1=""]{z-index:-1}.z--2{z-index:-2}.z-0{z-index:0}.z-1,[z-1=""]{z-index:1}.z-10,[z-10=""]{z-index:10}.z-100{z-index:100}.z-2,[z-2=""]{z-index:2}.z-3,[z-3=""]{z-index:3}.z-30,[z-30=""]{z-index:30}.z-4,[z-4=""]{z-index:4}.z-99,[z-99=""]{z-index:99}[z~="20"]{z-index:20}[before~=z-0]:before{z-index:0}[after~=z--2]:after{z-index:-2}.grid,[grid=""],[grid~=\~]{display:grid}.col-span-full{grid-column:1/-1}.auto-cols-\[350px\]{grid-auto-columns:350px}.auto-cols-auto{grid-auto-columns:auto}.grid-auto-rows-\[minmax\(min-content\,max-content\)\]{grid-auto-rows:minmax(min-content,max-content)}.grid-auto-flow-dense{grid-auto-flow:dense}.grid-flow-col{grid-auto-flow:column}.grid-flow-row{grid-auto-flow:row}.cols-\[20px_1fr_60px\],[grid~="cols-[20px_1fr_60px]"]{grid-template-columns:20px 1fr 60px}.grid-cols-\[repeat\(auto-fill\,minmax\(280px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.cols-1,.grid-cols-1,[grid~=cols-1]{grid-template-columns:repeat(1,minmax(0,1fr))}.cols-2,.grid-cols-2,[grid-cols-2=""],[grid~=cols-2]{grid-template-columns:repeat(2,minmax(0,1fr))}.m-0,[m0=""]{margin:0}.m-1,[m-1=""]{margin:.25rem}.m-auto{margin:auto}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-5,[mx-5=""]{margin-left:1.25rem;margin-right:1.25rem}.mx-auto,[mx-auto=""]{margin-left:auto;margin-right:auto}.mx2,[mx2=""]{margin-left:.5rem;margin-right:.5rem}.my{margin-top:1rem;margin-bottom:1rem}.my-0,[my-0=""]{margin-top:0;margin-bottom:0}.my-5,[my-5=""]{margin-top:1.25rem;margin-bottom:1.25rem}.my-auto,[my-auto=""]{margin-top:auto;margin-bottom:auto}.-mb-px{margin-bottom:-1px}.mb-1,[mb-1=""]{margin-bottom:.25rem}.mb-2,.mb2,[mb-2=""],[mb2=""]{margin-bottom:.5rem}.mb-3,[mb-3=""]{margin-bottom:.75rem}.mb-4,[mb-4=""]{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml{margin-left:1rem}.ml-0\.5,[ml-0\.5=""]{margin-left:.125rem}.ml-auto{margin-left:auto}.mr{margin-right:1rem}.mr-0\!{margin-right:0!important}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-auto{margin-right:auto}.ms,[ms=""]{margin-inline-start:1rem}.mt-0\.5{margin-top:.125rem}.mt-1,[mt-1=""]{margin-top:.25rem}.mt-2,[mt-2=""]{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4,[mt-4=""]{margin-top:1rem}.mt-auto{margin-top:auto}[ml~="12"]{margin-left:3rem}[mr~="12"]{margin-right:3rem}[box~=border]{box-sizing:border-box}.inline,[inline=""]{display:inline}.block,[block=""]{display:block}.inline-block,[inline-block=""]{display:inline-block}.contents{display:contents}.size-16,[size-16=""]{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-20,[size-20=""]{width:5rem;height:5rem}.size-24,[size-24=""],[size~="24"]{width:6rem;height:6rem}.size-3,[size-3=""]{width:.75rem;height:.75rem}.size-5{width:1.25rem;height:1.25rem}.size-6,[size-6=""],[size~="6"]{width:1.5rem;height:1.5rem}.size-60,[size-60=""]{width:15rem;height:15rem}.h-0\.5,[h-0\.5=""]{height:.125rem}.h-10{height:2.5rem}.h-100dvh,[h-100dvh=""],[h~="100dvh"]{height:100dvh}.h-12{height:3rem}.h-16{height:4rem}.h-18,[h-18=""]{height:4.5rem}.h-1lh{height:1lh}.h-2,.h2,[h-2=""]{height:.5rem}.h-24,[h-24=""]{height:6rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48,[h-48=""]{height:12rem}.h-5,[h-5=""]{height:1.25rem}.h-6{height:1.5rem}.h-60,[h-60=""]{height:15rem}.h-7,[h-7=""]{height:1.75rem}.h-8,[h-8=""]{height:2rem}.h-fit,[h-fit=""]{height:-moz-fit-content;height:fit-content}.h-full,[h-full=""]{height:100%}.h1{height:.25rem}.h3{height:.75rem}.max-h-\[10lh\],[max-h~="[10lh]"]{max-height:10lh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100dvh-7lh\)\]{max-height:calc(100dvh - 7lh)}.max-h-60,[max-h-60=""]{max-height:15rem}.max-h-none,[max-h-none=""]{max-height:none}.max-w-6xl{max-width:72rem}.max-w-full,[max-w-full=""]{max-width:100%}.max-w-md{max-width:28rem}.min-h-\[120px\],.min-h-120px,[min-h-120px=""]{min-height:120px}.min-h-\[1lh\],[min-h~="[1lh]"]{min-height:1lh}.min-h-16,[min-h-16=""]{min-height:4rem}.min-h-40px,[min-h-40px=""]{min-height:40px}.min-h-70dvh,[min-h-70dvh=""]{min-height:70dvh}.min-w-\[150px\]{min-width:150px}.min-w-\[160px\]{min-width:160px}.min-w-\[200px\]{min-width:200px}.min-w-0,[min-w-0=""]{min-width:0}.min-w-20,[min-w-20=""]{min-width:5rem}.min-w-20px{min-width:20px}.min-w-50,[min-w-50=""]{min-width:12.5rem}.w-\[92vw\]{width:92vw}.w-0\!{width:0!important}.w-1{width:.25rem}.w-1\/2,[w~="[50%]"]{width:50%}.w-10\%{width:10%}.w-100,[w-100=""]{width:25rem}.w-100vw,[w-100vw=""]{width:100vw}.w-11{width:2.75rem}.w-18,[w-18=""]{width:4.5rem}.w-25\%{width:25%}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-5{width:1.25rem}.w-8,[w-8=""]{width:2rem}.w-90\%{width:90%}.w-95\%{width:95%}.w-fit,[w-fit=""]{width:-moz-fit-content;width:fit-content}.w-full,[w-full=""],[w~="100%"],[w~=full]{width:100%}[h~="[14px]"]{height:14px}[h~="300"]{height:75rem}[h~="50dvh"]{height:50dvh}[h~=auto]{height:auto}[h~=unset]{height:unset}[max-h~="[300px]"]{max-height:300px}[max-h~="[4.5rem]"]{max-height:4.5rem}[max-h~="[85vh]"]{max-height:85vh}[max-h~="100"]{max-height:25rem}[max-h~="100dvh"]{max-height:100dvh}[max-h~="30vh"]{max-height:30vh}[max-w~="500px"]{max-width:500px}[min-h~="[100px]"]{min-height:100px}[min-h~="100"]{min-height:25rem}[min-h~="120"]{min-height:30rem}[min-w~="1/2"],[min-w~="50%"]{min-width:50%}[min-w~="30%"]{min-width:30%}[min-w~="3em"]{min-width:3em}[min-w~="50vw"]{min-width:50vw}[min-w~="6"]{min-width:1.5rem}[w~="[1px]"]{width:1px}[w~="100dvw"]{width:100dvw}[w~="12.5"]{width:3.125rem}[w~="70%"]{width:70%}[before~=h-full]:before{height:100%}[before~=w-25\%]:before{width:25%}.after\:h-5:after{height:1.25rem}.after\:w-5:after{width:1.25rem}[after~=h-full]:after{height:100%}[after~=w-full]:after{width:100%}.max-w-screen-xl,[max-w-screen-xl=""]{max-width:1280px}.flex,[flex=""],[flex~=\~]{display:flex}.inline-flex,[inline-flex=""],[inline-flex~=\~]{display:inline-flex}.flex-1,[flex-1=""],[flex~="1"]{flex:1}.flex-shrink-0,.shrink-0,[shrink-0=""]{flex-shrink:0}.flex-row,[flex-row=""],[flex~=row]{flex-direction:row}[flex~=row-reverse]{flex-direction:row-reverse}.flex-col,[flex-col=""],[flex~=col]{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap,[flex-wrap=""]{flex-wrap:wrap}[perspective~="800"]{perspective:800px}.-translate-x-1\/2,.translate-x--1\/2,.translate-x-\[-50\%\],[transform~=translate-x--1\/2]{--un-translate-x:-50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.-translate-y-1\/2,.translate-y-\[-50\%\],[transform~="translate-y-[-50%]"]{--un-translate-y:-50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-x-\[50\%\],[transform~="translate-x-[50%]"]{--un-translate-x:50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y--2,[transform~=translate-y--2]{--un-translate-y:-.5rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-\[-100\%\],[transform~="translate-y-[-100%]"]{--un-translate-y:-100%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-\[50\%\]{--un-translate-y:50%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-2,[translate-y-2=""]{--un-translate-y:.5rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.translate-y-4,[translate-y-4=""]{--un-translate-y:1rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-x~="0.5"]{--un-translate-x:.125rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-x~="data-[state=checked]:full"][data-state=checked]{--un-translate-x:100%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-y~="[-80%]"]{--un-translate-y:-80%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[translate-y~="[0.25lh]"]{--un-translate-y:.25lh;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.peer:checked~.peer-checked\:after\:translate-x-full:after{--un-translate-x:100%;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.\[\&_\.card-cover_img\]\:hover\:translate-y-2:hover .card-cover img,[hover\:translate-y-2=""]:hover{--un-translate-y:.5rem;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.rotate-180{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:180deg;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.scale-100{--un-scale-x:1;--un-scale-y:1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.scale-125{--un-scale-x:1.25;--un-scale-y:1.25;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.scale-150{--un-scale-x:1.5;--un-scale-y:1.5;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.\[\&_\.card-cover_img\]\:hover\:scale-102:hover .card-cover img{--un-scale-x:1.02;--un-scale-y:1.02;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.hover\:scale-110:hover{--un-scale-x:1.1;--un-scale-y:1.1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}[hover~=scale-100]:hover{--un-scale-x:1;--un-scale-y:1;transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}.preserve-3d{transform-style:preserve-3d}.transform,[transform=""]{transform:translateX(var(--un-translate-x))translateY(var(--un-translate-y))translateZ(var(--un-translate-z))rotate(var(--un-rotate))rotateX(var(--un-rotate-x))rotateY(var(--un-rotate-y))rotateZ(var(--un-rotate-z))skewX(var(--un-skew-x))skewY(var(--un-skew-y))scaleX(var(--un-scale-x))scaleY(var(--un-scale-y))scaleZ(var(--un-scale-z))}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-pulse{animation:2s cubic-bezier(.4,0,.6,1) infinite pulse}.animate-spin{animation:1s linear infinite spin}.disabled\:cursor-default:disabled{cursor:default}.cursor-pointer,[cursor-pointer=""],[cursor~=pointer]{cursor:pointer}.cursor-not-allowed,.disabled\:cursor-not-allowed:disabled,[cursor~=disabled\:not-allowed]:disabled,[disabled\:cursor-not-allowed=""]:disabled{cursor:not-allowed}.cursor-ew-resize,[cursor-ew-resize=""]{cursor:ew-resize}.select-none,[select-none=""]{-webkit-user-select:none;user-select:none}.resize-none,[resize-none=""]{resize:none}.appearance-none,[appearance-none=""]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.place-self-end{place-self:end}.items-start,[items-start=""]{align-items:flex-start}.items-end,[items-end=""]{align-items:flex-end}.items-center,[flex~=items-center],[items-center=""]{align-items:center}.justify-start{justify-content:flex-start}.justify-end,[justify-end=""]{justify-content:flex-end}.justify-center,[flex~=justify-center],[justify-center=""]{justify-content:center}.justify-between,[justify-between=""]{justify-content:space-between}.gap-0\.5,[gap-0\.5=""]{gap:.125rem}.gap-1,[gap-1=""]{gap:.25rem}.gap-1\.5,[gap-1\.5=""]{gap:.375rem}.gap-2,[flex~=gap-2],[gap-2=""]{gap:.5rem}.gap-3,[flex~=gap-3],[gap-3=""]{gap:.75rem}.gap-4,[flex~=gap-4],[gap-4=""],[grid~=gap-4]{gap:1rem}.gap-5,[gap-5=""]{gap:1.25rem}.gap-6,[flex~=gap-6]{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2,[flex~=gap-x-2]{column-gap:.5rem}.gap-y-0,[flex~=gap-y-0]{row-gap:0}.space-x-1>:not([hidden])~:not([hidden]){--un-space-x-reverse:0;margin-left:calc(.25rem*calc(1 - var(--un-space-x-reverse)));margin-right:calc(.25rem*var(--un-space-x-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(.5rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(.5rem*var(--un-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(1.5rem*calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(1.5rem*var(--un-space-y-reverse))}[divide~=y]>:not([hidden])~:not([hidden]){--un-divide-y-reverse:0;border-top-width:calc(1px*calc(1 - var(--un-divide-y-reverse)));border-bottom-width:calc(1px*var(--un-divide-y-reverse))}[divide~=gray\/25]>:not([hidden])~:not([hidden]){border-color:#9ca3af40}[border~=dashed],[divide~=dashed]>:not([hidden])~:not([hidden]){border-style:dashed}.of-clip,[of-clip=""]{overflow:clip}.of-hidden,.overflow-hidden,[of-hidden=""],[overflow-hidden=""],[overflow~=hidden]{overflow:hidden}.overflow-auto,[overflow-auto=""]{overflow:auto}.overflow-scroll,[overflow-scroll=""]{overflow:scroll}.of-x-scroll,[of-x-scroll=""]{overflow-x:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-scroll,[overflow-y-scroll=""]{overflow-y:scroll}.scroll-smooth,[scroll-smooth=""]{scroll-behavior:smooth}.truncate,[truncate=""]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line,[whitespace-pre-line=""]{white-space:pre-line}.break-words{overflow-wrap:break-word}.b,.border,[border~=\~],[border~="1"]{border-width:1px}.b-2,.border-2,[b-2=""],[border~="2"],[border~="2px"]{border-width:2px}[border~="4"]{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2,[border~=b-2]{border-bottom-width:2px}[border~=l-2]{border-left-width:2px}[border~=r-2]{border-right-width:2px}[border~=t-2]{border-top-width:2px}.\[\&\:checked\+div\]\:border-primary-500:checked+div,.border-primary-500{--un-border-opacity:1;border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.border-amber-200{--un-border-opacity:1;border-color:rgb(253 230 138/var(--un-border-opacity))}.border-neutral-100,[border~=neutral-100]{--un-border-opacity:1;border-color:rgb(245 245 245/var(--un-border-opacity))}.border-neutral-200,.dark [border~=dark\:neutral-200],[border~=neutral-200]{--un-border-opacity:1;border-color:rgb(229 229 229/var(--un-border-opacity))}.border-neutral-300,[border~="data-[state=unchecked]:neutral-300"][data-state=unchecked],[border~=neutral-300]{--un-border-opacity:1;border-color:rgb(212 212 212/var(--un-border-opacity))}.border-neutral-500{--un-border-opacity:1;border-color:rgb(115 115 115/var(--un-border-opacity))}.border-primary-100,[border~=primary-100]{--un-border-opacity:1;border-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))80%,oklch(100% 0 360/var(--un-border-opacity)))}.border-primary-200,[border~="data-[state=checked]:primary-200"][data-state=checked]{--un-border-opacity:1;border-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.border-primary-400,.dark .dark\:\[\&\:checked\+div\]\:border-primary-400:checked+div,.dark .dark\:border-primary-400{--un-border-opacity:1;border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.border-red-200{--un-border-opacity:1;border-color:rgb(254 202 202/var(--un-border-opacity))}.border-white,[border~=white]{--un-border-opacity:1;border-color:rgb(255 255 255/var(--un-border-opacity))}.dark .dark\:border-amber-800{--un-border-opacity:1;border-color:rgb(146 64 14/var(--un-border-opacity))}.dark .dark\:border-neutral-600,.dark [border~=dark\:neutral-600]{--un-border-opacity:1;border-color:rgb(82 82 82/var(--un-border-opacity))}.dark .dark\:border-neutral-700,.dark [border~=dark\:neutral-700]{--un-border-opacity:1;border-color:rgb(64 64 64/var(--un-border-opacity))}.dark .dark\:border-neutral-800,.dark [border~=dark\:neutral-800],[border~=neutral-800]{--un-border-opacity:1;border-color:rgb(38 38 38/var(--un-border-opacity))}.dark .dark\:border-neutral-800\/25,.dark [border~="dark:neutral-800/25"]{border-color:#26262640}.dark .dark\:border-neutral-900,.dark [border~=dark\:neutral-900]{--un-border-opacity:1;border-color:rgb(23 23 23/var(--un-border-opacity))}.dark .dark\:border-primary-600{--un-border-opacity:1;border-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark .dark\:border-primary-800,.dark [border~=dark\:primary-800]{--un-border-opacity:1;border-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark .dark\:border-primary-900,.dark [border~=dark\:primary-900]{--un-border-opacity:1;border-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark .dark\:border-red-800{--un-border-opacity:1;border-color:rgb(153 27 27/var(--un-border-opacity))}.dark [border~="dark:cyan-500/50"]{border-color:#06b6d480}.dark [border~="dark:neutral-700/30"]{border-color:#4040404d}.dark [border~="dark:primary-400/20"]{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)}.dark [border~="dark:primary-500/50"]{border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.5)}.dark [border~="dark:violet-500/50"]{border-color:#8b5cf680}[border~=cyan-200\/50]{border-color:#a5f3fc80}[border~=gray\/25]{border-color:#9ca3af40}[border~=neutral-200\/50]{border-color:#e5e5e580}[border~=primary-200\/50]{border-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.5)}[border~=primary-300]{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}[border~=violet-200\/50]{border-color:#ddd6fe80}.peer:checked~.peer-checked\:after\:border-white:after{--un-border-opacity:1;border-color:rgb(255 255 255/var(--un-border-opacity))}[border~=focus-within\:neutral-800]:focus-within{--un-border-opacity:1;border-color:rgb(38 38 38/var(--un-border-opacity))}.dark .dark\:hover\:border-primary-400\/30:hover{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.3)}.dark .dark\:hover\:border-primary-700:hover{--un-border-opacity:1;border-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.dark [border~="dark:hover:primary-400/30"]:hover{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.3)}.hover\:border-primary-300:hover{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.hover\:border-primary-500\/30:hover,[border~="hover:primary-500/30"]:hover{border-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.3)}.dark [border~="dark:focus:neutral-600"]:focus{--un-border-opacity:1;border-color:rgb(82 82 82/var(--un-border-opacity))}.dark [border~="dark:focus:neutral-700"]:focus{--un-border-opacity:1;border-color:rgb(64 64 64/var(--un-border-opacity))}.dark [border~="dark:focus:primary-400/50"]:focus{border-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.5)}[border~=focus\:neutral-200]:focus{--un-border-opacity:1;border-color:rgb(229 229 229/var(--un-border-opacity))}[border~=focus\:neutral-400]:focus{--un-border-opacity:1;border-color:rgb(163 163 163/var(--un-border-opacity))}[border~=focus\:primary-100]:focus{--un-border-opacity:1;border-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))80%,oklch(100% 0 360/var(--un-border-opacity)))}[border~=focus\:primary-300]:focus{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-border-opacity))}.rounded,[rounded=""]{border-radius:.25rem}.rounded-2xl,[rounded-2xl=""]{border-radius:1rem}.rounded-full,[rounded-full=""]{border-radius:9999px}.rounded-lg,[border~=rounded-lg],[rounded-lg=""],[rounded~=lg]{border-radius:.5rem}.rounded-md,[rounded-md=""]{border-radius:.375rem}.rounded-sm,[rounded-sm=""]{border-radius:.125rem}.rounded-xl,[rounded-xl=""]{border-radius:.75rem}.after\:rounded-full:after{border-radius:9999px}.rounded-l-lg,[rounded-l-lg=""]{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-xl,[rounded-l-xl=""]{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-lg,[rounded-r-lg=""]{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-r-xl,[rounded-r-xl=""]{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-xl,[rounded-t-xl=""]{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border-none,[border-none=""]{border-style:none}[border~=solid]{border-style:solid}.bg-amber-50{--un-bg-opacity:1;background-color:rgb(255 251 235/var(--un-bg-opacity))}.bg-amber-50\/80{background-color:#fffbebcc}.bg-black\/50,[bg~=black\/50]{background-color:#00000080}.bg-neutral-100,[bg-neutral-100=""],[bg~=neutral-100]{--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity))}.bg-neutral-200,.dark .dark\:bg-neutral-200,[bg-neutral-200=""],[bg~=neutral-200]{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}.bg-neutral-300,.dark [bg~=dark\:neutral-300],[bg-neutral-300=""],[bg~="data-[state=unchecked]:neutral-300"][data-state=unchecked]{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}.bg-neutral-400,.dark [bg~=dark\:neutral-400],[bg~=neutral-400]{--un-bg-opacity:1;background-color:rgb(163 163 163/var(--un-bg-opacity))}.bg-neutral-50,[bg~=neutral-50]{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}.bg-neutral-600,.dark .dark\:bg-neutral-600{--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity))}.bg-neutral-800,.dark .dark\:bg-neutral-800,.dark [bg~="dark:data-[state=unchecked]:neutral-800"][data-state=unchecked],.dark [bg~=dark\:neutral-800]{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.bg-primary{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-100,[bg-primary-100=""],[bg~=primary-100]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))80%,oklch(100% 0 360/var(--un-bg-opacity)))}.bg-primary-100\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.1)80%,#ffffff1a)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.1)80%,color(display-p3 1 1 1/.1))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.1)80%,lab(100% 0 0/.1))}}.bg-primary-100\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/1)80%,#fff)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/1)80%,color(display-p3 1 1 1))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/1)80%,lab(100% 0 0))}}.bg-primary-100\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.2)80%,#fff3)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.2)80%,color(display-p3 1 1 1/.2))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.2)80%,lab(100% 0 0/.2))}}.bg-primary-100\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.3)80%,#ffffff4d)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.3)80%,color(display-p3 1 1 1/.3))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.3)80%,lab(100% 0 0/.3))}}.bg-primary-100\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.4)80%,#fff6)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.4)80%,color(display-p3 1 1 1/.4))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.4)80%,lab(100% 0 0/.4))}}.bg-primary-100\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.05)80%,#ffffff0d)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.05)80%,color(display-p3 1 1 1/.05))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.05)80%,lab(100% 0 0/.05))}}.bg-primary-100\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.5)80%,#ffffff80)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.5)80%,color(display-p3 1 1 1/.5))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.5)80%,lab(100% 0 0/.5))}}.bg-primary-100\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.6)80%,#fff9)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.6)80%,color(display-p3 1 1 1/.6))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.6)80%,lab(100% 0 0/.6))}}.bg-primary-100\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.7)80%,#ffffffb3)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.7)80%,color(display-p3 1 1 1/.7))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.7)80%,lab(100% 0 0/.7))}}.bg-primary-100\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.8)80%,#fffc)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.8)80%,color(display-p3 1 1 1/.8))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.8)80%,lab(100% 0 0/.8))}}.bg-primary-100\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.9)80%,#ffffffe6)}@supports (color:color(display-p3 0 0 0)){.bg-primary-100\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.9)80%,color(display-p3 1 1 1/.9))}}@supports (color:lab(0% 0 0)){.bg-primary-100\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/.9)80%,lab(100% 0 0/.9))}}.bg-primary-200,[bg-primary-200=""]{--un-bg-opacity:1;background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-200\/10{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-200\/100{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-200\/20{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-200\/30{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-200\/40{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-200\/5{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-200\/50{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-200\/60{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-200\/70{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-200\/80{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-200\/90{background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-300,[bg-primary-300=""]{--un-bg-opacity:1;background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-300\/10{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-300\/100{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-300\/20{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-300\/30{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-300\/40{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-300\/5{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-300\/50{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-300\/60{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-300\/70{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-300\/80{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-300\/90{background-color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-400,.dark .dark\:bg-primary-400,.dark [bg~=dark\:primary-400],[bg-primary-400=""],[bg~="data-[state=checked]:primary-400"][data-state=checked],[bg~=primary-400]{--un-bg-opacity:1;background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-400\/10{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-400\/100{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-400\/20,.dark [bg~="dark:primary-400/20"]{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-400\/30{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-400\/40{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-400\/5{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-400\/50{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-400\/60{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-400\/70{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-400\/80,.dark [bg~="data-[state=checked]:dark:primary-400/80"][data-state=checked]{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-400\/90{background-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-50,[bg-primary-50=""],[bg~=primary-50]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))30%,oklch(100% 0 360/var(--un-bg-opacity)))}.bg-primary-50\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.1)30%,#ffffff1a)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.1)30%,color(display-p3 1 1 1/.1))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.1)30%,lab(100% 0 0/.1))}}.bg-primary-50\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/1)30%,#fff)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/1)30%,color(display-p3 1 1 1))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/1)30%,lab(100% 0 0))}}.bg-primary-50\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.2)30%,#fff3)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.2)30%,color(display-p3 1 1 1/.2))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.2)30%,lab(100% 0 0/.2))}}.bg-primary-50\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.3)30%,#ffffff4d)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.3)30%,color(display-p3 1 1 1/.3))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.3)30%,lab(100% 0 0/.3))}}.bg-primary-50\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.4)30%,#fff6)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.4)30%,color(display-p3 1 1 1/.4))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.4)30%,lab(100% 0 0/.4))}}.bg-primary-50\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.05)30%,#ffffff0d)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.05)30%,color(display-p3 1 1 1/.05))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.05)30%,lab(100% 0 0/.05))}}.bg-primary-50\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.5)30%,#ffffff80)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.5)30%,color(display-p3 1 1 1/.5))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.5)30%,lab(100% 0 0/.5))}}.bg-primary-50\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.6)30%,#fff9)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.6)30%,color(display-p3 1 1 1/.6))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.6)30%,lab(100% 0 0/.6))}}.bg-primary-50\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.7)30%,#ffffffb3)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.7)30%,color(display-p3 1 1 1/.7))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.7)30%,lab(100% 0 0/.7))}}.bg-primary-50\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.8)30%,#fffc)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.8)30%,color(display-p3 1 1 1/.8))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.8)30%,lab(100% 0 0/.8))}}.bg-primary-50\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.9)30%,#ffffffe6)}@supports (color:color(display-p3 0 0 0)){.bg-primary-50\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.9)30%,color(display-p3 1 1 1/.9))}}@supports (color:lab(0% 0 0)){.bg-primary-50\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50)calc(var(--chromatic-hue) + 0)/.9)30%,lab(100% 0 0/.9))}}.bg-primary-500,.dark [bg~=dark\:primary-500],[bg-primary-500=""],[bg~=primary-500],.peer:checked~.peer-checked\:bg-primary-500{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-500\/10,[bg~=primary-500\/10]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-500\/100{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-500\/20,[bg~=primary-500\/20]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-500\/30,[bg~=primary-500\/30]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-500\/40,[bg~=primary-500\/40]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-500\/5,[bg~=primary-500\/5]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-500\/50,[bg~=primary-500\/50]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-500\/60,[bg~=primary-500\/60]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-500\/70,[bg~=primary-500\/70]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-500\/80,[bg~=primary-500\/80]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-500\/90,[bg~=primary-500\/90]{background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-600,[bg-primary-600=""]{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-600\/10{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-600\/100{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-600\/20{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-600\/30{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-600\/40{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-600\/5{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-600\/50{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-600\/60{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-600\/70{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-600\/80{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-600\/90{background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-700,.dark .dark\:bg-primary-700,.dark [dark\:bg-primary-700=""],[bg-primary-700=""]{--un-bg-opacity:1;background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-700\/10{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-700\/100{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-700\/20{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-700\/30{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-700\/40{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-700\/5{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-700\/50{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-700\/60{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-700\/70{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-700\/80{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-700\/90{background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-800,[bg-primary-800=""]{--un-bg-opacity:1;background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-800\/10{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-800\/100{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-800\/20{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-800\/30{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-800\/40{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-800\/5{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-800\/50{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-800\/60{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-800\/70{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-800\/80{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-800\/90{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-900,.dark .dark\:bg-primary-900,[bg-primary-900=""]{--un-bg-opacity:1;background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-900\/10{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-900\/100{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-900\/20,.dark .dark\:bg-primary-900\/20{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-900\/30,.dark .dark\:bg-primary-900\/30{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-900\/40,.dark .dark\:bg-primary-900\/40,.dark [bg~="dark:primary-900/40"]{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-900\/5,.dark .dark\:bg-primary-900\/5{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-900\/50{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-900\/60{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-900\/70{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-900\/80{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-900\/90{background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary-950,.dark .dark\:bg-primary-950,.dark [bg~=dark\:primary-950],[bg-primary-950=""]{--un-bg-opacity:1;background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.bg-primary-950\/10{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary-950\/100{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/1)}.bg-primary-950\/20{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary-950\/30{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary-950\/40{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary-950\/5{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary-950\/50{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary-950\/60{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary-950\/70{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary-950\/80{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary-950\/90{background-color:oklch(29% var(--chromatic-chroma-950)calc(var(--chromatic-hue) + 0)/.9)}.bg-primary\/10{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.1)}.bg-primary\/100{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/1)}.bg-primary\/20{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.2)}.bg-primary\/30{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.3)}.bg-primary\/40{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.4)}.bg-primary\/5{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.05)}.bg-primary\/50{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.5)}.bg-primary\/60{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.6)}.bg-primary\/70{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.7)}.bg-primary\/80{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.8)}.bg-primary\/90{background-color:oklch(62% var(--chromatic-chroma)calc(var(--chromatic-hue) + 0)/.9)}.bg-red-50{--un-bg-opacity:1;background-color:rgb(254 242 242/var(--un-bg-opacity))}.bg-red-500{--un-bg-opacity:1;background-color:rgb(239 68 68/var(--un-bg-opacity))}.bg-red900{--un-bg-opacity:1;background-color:rgb(127 29 29/var(--un-bg-opacity))}.bg-transparent,.dark [bg~=dark\:transparent],[bg-transparent=""],[bg~=transparent]{background-color:#0000}.bg-white,[bg-white=""],[bg~=white]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.bg-white\/60,[bg~=white\/60]{background-color:#fff9}.bg-white\/80{background-color:#fffc}.dark .dark\:bg-amber-900\/20{background-color:#78350f33}.dark .dark\:bg-amber-900\/30{background-color:#78350f4d}.dark .dark\:bg-black\/30,.dark [bg~="dark:black/30"]{background-color:#0000004d}.dark .dark\:bg-black\/40{background-color:#0006}.dark .dark\:bg-neutral-700,.dark [bg~=dark\:neutral-700],.dark [dark\:bg-neutral-700=""],[bg~=neutral-700]{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}.dark .dark\:bg-neutral-700\/50{background-color:#40404080}.dark .dark\:bg-neutral-800\/50,.dark [bg~="dark:neutral-800/50"]{background-color:#26262680}.dark .dark\:bg-neutral-900,.dark [bg~=dark\:neutral-900]{--un-bg-opacity:1;background-color:rgb(23 23 23/var(--un-bg-opacity))}.dark .dark\:bg-neutral-900\/20{background-color:#17171733}.dark .dark\:bg-red-400{--un-bg-opacity:1;background-color:rgb(248 113 113/var(--un-bg-opacity))}.dark .dark\:bg-red-900\/20{background-color:#7f1d1d33}.dark [bg~="dark:[#4e34b9]"]{--un-bg-opacity:1;background-color:rgb(78 52 185/var(--un-bg-opacity))}.dark [bg~="dark:[#676085]"]{--un-bg-opacity:1;background-color:rgb(103 96 133/var(--un-bg-opacity))}.dark [bg~="dark:[rgba(0,0,0,0.3)]"]{--un-bg-opacity:.3;background-color:rgba(0,0,0,var(--un-bg-opacity))}.dark [bg~="dark:black/20"],.group:hover [bg~="group-hover:black/20"]{background-color:#0003}.dark [bg~=dark\:blue-900]{--un-bg-opacity:1;background-color:rgb(30 58 138/var(--un-bg-opacity))}.dark [bg~=dark\:complementary-800]{--un-bg-opacity:1;background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 180)/var(--un-bg-opacity))}.dark [bg~=dark\:cyan-900]{--un-bg-opacity:1;background-color:rgb(22 78 99/var(--un-bg-opacity))}.dark [bg~=dark\:green-600]{--un-bg-opacity:1;background-color:rgb(22 163 74/var(--un-bg-opacity))}.dark [bg~=dark\:neutral-500]{--un-bg-opacity:1;background-color:rgb(115 115 115/var(--un-bg-opacity))}.dark [bg~="dark:neutral-900/50"]{background-color:#17171780}.dark [bg~="dark:neutral-900/70"]{background-color:#171717b3}.dark [bg~=dark\:neutral-950]{--un-bg-opacity:1;background-color:rgb(10 10 10/var(--un-bg-opacity))}.dark [bg~="dark:orange-900/20"]{background-color:#7c2d1233}.dark [bg~="dark:primary-800/25"]{background-color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/.25)}[bg~="[#cabeff]"]{--un-bg-opacity:1;background-color:rgb(202 190 255/var(--un-bg-opacity))}[bg~="[#e6e1fc]"]{--un-bg-opacity:1;background-color:rgb(230 225 252/var(--un-bg-opacity))}[bg~=\$bg-color]{background-color:var(--bg-color)}[bg~=black\/0]{background-color:#0000}[bg~=blue-100]{--un-bg-opacity:1;background-color:rgb(219 234 254/var(--un-bg-opacity))}[bg~=complementary-100]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 180)/var(--un-bg-opacity))80%,oklch(100% 0 360/var(--un-bg-opacity)))}[bg~=emerald-500]{--un-bg-opacity:1;background-color:rgb(16 185 129/var(--un-bg-opacity))}[bg~=gray-200\/30]{background-color:#e5e7eb4d}[bg~=green-500]{--un-bg-opacity:1;background-color:rgb(34 197 94/var(--un-bg-opacity))}[bg~=inherit]{background-color:inherit }[bg~=neutral-100\/70]{background-color:#f5f5f5b3}[bg~=neutral-200\/20]{background-color:#e5e5e533}[bg~=neutral-200\/50]{background-color:#e5e5e580}[bg~=neutral-50\/50]{background-color:#fafafa80}[bg~=orange-50]{--un-bg-opacity:1;background-color:rgb(255 247 237/var(--un-bg-opacity))}[bg~=white\/70]{background-color:#ffffffb3}.dark [dark\:bg-neutral-700~=default\:]:default,.dark [dark\:bg-neutral-700~=checked\:]:checked{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}.dark .\[\&_div_span\]\:dark\:hover\:bg-cyan-300:hover div span{--un-bg-opacity:1;background-color:rgb(103 232 249/var(--un-bg-opacity))}.dark .\[\&_div_span\]\:dark\:hover\:bg-cyan-900:hover div span{--un-bg-opacity:1;background-color:rgb(22 78 99/var(--un-bg-opacity))}.dark .dark\:hover\:bg-black\/40:hover{background-color:#0006}.dark .dark\:hover\:bg-neutral-500:hover{--un-bg-opacity:1;background-color:rgb(115 115 115/var(--un-bg-opacity))}.dark .dark\:hover\:bg-neutral-600:hover{--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity))}.dark .dark\:hover\:bg-neutral-800:hover{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.dark .dark\:hover\:bg-primary-500:hover{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.dark .dark\:hover\:bg-red-500:hover{--un-bg-opacity:1;background-color:rgb(239 68 68/var(--un-bg-opacity))}.dark [bg~="dark:hover:complementary-700"]:hover{--un-bg-opacity:1;background-color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 180)/var(--un-bg-opacity))}.dark [bg~="dark:hover:neutral-800"]:hover{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.dark [bg~="dark:hover:primary-900"]:hover{--un-bg-opacity:1;background-color:oklch(37% var(--chromatic-chroma-900)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.dark [dark\:hover\:bg-cyan-300=""]:hover{--un-bg-opacity:1;background-color:rgb(103 232 249/var(--un-bg-opacity))}.dark [hover~="dark:bg-black/40"]:hover{background-color:#0006}.dark [hover~=dark\:bg-neutral-700]:hover{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}.dark [hover~="dark:bg-neutral-700/50"]:hover{background-color:#40404080}.hover\:bg-neutral-100:hover{--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity))}.hover\:bg-neutral-200:hover{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}.hover\:bg-neutral-300:hover{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}.hover\:bg-neutral-400:hover{--un-bg-opacity:1;background-color:rgb(163 163 163/var(--un-bg-opacity))}.hover\:bg-neutral-50:hover{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}.hover\:bg-primary-600:hover{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}.hover\:bg-red-600:hover{--un-bg-opacity:1;background-color:rgb(220 38 38/var(--un-bg-opacity))}.hover\:bg-white\/80:hover{background-color:#fffc}[bg~=hover\:complementary-200]:hover{--un-bg-opacity:1;background-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 180)/var(--un-bg-opacity))}[bg~=hover\:emerald-600]:hover{--un-bg-opacity:1;background-color:rgb(5 150 105/var(--un-bg-opacity))}[bg~=hover\:neutral-200]:hover{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}[bg~=hover\:primary-100]:hover{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))80%,oklch(100% 0 360/var(--un-bg-opacity)))}[hover\:bg-neutral-300=""]:hover{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}[hover\:bg-primary-600=""]:hover{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-bg-opacity))}[hover~=bg-neutral-200]:hover{--un-bg-opacity:1;background-color:rgb(229 229 229/var(--un-bg-opacity))}[hover~=bg-white\/80]:hover{background-color:#fffc}.dark [bg~="dark:focus:neutral-900"]:focus{--un-bg-opacity:1;background-color:rgb(23 23 23/var(--un-bg-opacity))}[bg~=focus\:neutral-50]:focus{--un-bg-opacity:1;background-color:rgb(250 250 250/var(--un-bg-opacity))}.dark [bg~="dark:active:neutral-700"]:active{--un-bg-opacity:1;background-color:rgb(64 64 64/var(--un-bg-opacity))}[bg~=active\:gray-50]:active{--un-bg-opacity:1;background-color:rgb(249 250 251/var(--un-bg-opacity))}[bg~=active\:neutral-300]:active{--un-bg-opacity:1;background-color:rgb(212 212 212/var(--un-bg-opacity))}.dark .dark\:disabled\:bg-neutral-800:disabled{--un-bg-opacity:1;background-color:rgb(38 38 38/var(--un-bg-opacity))}.disabled\:bg-neutral-100:disabled{--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity))}.after\:bg-white:after{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.dark .dark\:from-primary-400\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .dark\:from-primary-400\/20{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-primary-500{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-from-opacity,1))var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-primary-500\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.from-primary-500\/20,.before\:from-primary-500\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .before\:dark\:from-primary-400\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark [before~="dark:from-primary-400/0"]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark [hover~="before:dark:from-primary-400/20"]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}[before~=from-primary-500\/0]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}[hover~="before:from-primary-500/20"]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.2)var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from),var(--un-gradient-to)}.dark .dark\:via-primary-400\/10{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}.via-primary-500\/10,.before\:via-primary-500\/10:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}.dark .before\:dark\:via-primary-400\/10:before,.dark [hover~="before:dark:via-primary-400/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}[hover~="before:via-primary-500/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0);--un-gradient-stops:var(--un-gradient-from),oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.1)var(--un-gradient-via-position),var(--un-gradient-to)}.dark .dark\:to-primary-400\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}.dark .dark\:to-transparent,.to-transparent{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.to-primary-400{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-to-opacity,1))var(--un-gradient-to-position)}.to-primary-500\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}.before\:to-transparent:before,.dark .before\:dark\:to-transparent:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.dark [before~="dark:to-primary-400/0"]:before{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}.dark [hover~="before:dark:to-transparent"]:hover:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}[before~=to-primary-500\/0]:before{--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/0)var(--un-gradient-to-position)}[hover~=before\:to-transparent]:hover:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.bg-gradient-to-r,.before\:bg-gradient-to-r:before,[before~=bg-gradient-to-r]:before,[hover~=before\:bg-gradient-to-r]:hover:before{--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape),var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.dark .dark\:fill-neutral-800,.dark [dark\:fill-neutral-800=""]{--un-fill-opacity:1;fill:rgb(38 38 38/var(--un-fill-opacity))}.fill-white,[fill-white=""]{--un-fill-opacity:1;fill:rgb(255 255 255/var(--un-fill-opacity))}[stroke-width~="2"]{stroke-width:2px}.object-cover,[object-cover=""]{object-fit:cover}.object-contain,[object-contain=""]{object-fit:contain}.p-1,[p-1=""]{padding:.25rem}.p-1\.5,[p-1\.5=""]{padding:.375rem}.p-2,.p2,[p-2=""],[p~="2"],[p2=""]{padding:.5rem}.p-2\.5{padding:.625rem}.p-3,[p-3=""]{padding:.75rem}.p-4,[p-4=""]{padding:1rem}.p-5,[p-5=""]{padding:1.25rem}.p-6{padding:1.5rem}.p-8,[p-8=""]{padding:2rem}.px,.px-4,[px-4=""],[px=""]{padding-left:1rem;padding-right:1rem}.px-0{padding-left:0;padding-right:0}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10,[px-10=""]{padding-left:2.5rem;padding-right:2.5rem}.px-2,.px2,[px-2=""],[px~="2"],[px2=""]{padding-left:.5rem;padding-right:.5rem}.px-3,[px-3=""]{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py,.py-4,[py~="4"]{padding-top:1rem;padding-bottom:1rem}.py-0\.5,[py-0\.5=""]{padding-top:.125rem;padding-bottom:.125rem}.py-1,.py1,[py-1=""],[py~="1"],[py1=""]{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5,[py-1\.5=""]{padding-top:.375rem;padding-bottom:.375rem}.py-2,[py-2=""]{padding-top:.5rem;padding-bottom:.5rem}.py-3,[py-3=""]{padding-top:.75rem;padding-bottom:.75rem}.py-6,[py-6=""]{padding-top:1.5rem;padding-bottom:1.5rem}[px~="12"]{padding-left:3rem;padding-right:3rem}.pb-0{padding-bottom:0}.pb-2,[pb-2=""]{padding-bottom:.5rem}.pb-4,[pb-4=""]{padding-bottom:1rem}.pb-6,[pb-6=""]{padding-bottom:1.5rem}.pl,.pl-4,[pl-4=""]{padding-left:1rem}.pl-10{padding-left:2.5rem}.pl-3,[pl-3=""]{padding-left:.75rem}.pl-5,[pl-5=""]{padding-left:1.25rem}.pr-\[20px\]{padding-right:20px}.pr-1,[pr-1=""]{padding-right:.25rem}.pr-4,[pr-4=""]{padding-right:1rem}.pt,.pt-4,[pt-4=""]{padding-top:1rem}.pt-0{padding-top:0}.pt-10,[pt-10=""]{padding-top:2.5rem}.pt-2,[pt-2=""]{padding-top:.5rem}.text-center,[text-center=""],[text~=center]{text-align:center}.text-left,[text-left=""]{text-align:left}.text-right,[text-right=""]{text-align:right}.text-wrap,[text-wrap=""]{text-wrap:wrap}.text-nowrap,[text-nowrap=""]{text-wrap:nowrap}.text-2xl,[text-2xl=""],[text~="2xl"]{font-size:1.5rem;line-height:2rem}.text-3xl,[text-3xl=""]{font-size:1.875rem;line-height:2.25rem}.text-5xl,[text-5xl=""]{font-size:3rem;line-height:1}.text-6xl,[text-6xl=""]{font-size:3.75rem;line-height:1}.text-base,[text-base=""],[text~=base]{font-size:1rem;line-height:1.5rem}.text-lg,[text-lg=""],[text~=lg]{font-size:1.125rem;line-height:1.75rem}.text-sm,[text-sm=""],[text~=sm]{font-size:.875rem;line-height:1.25rem}.text-xl,[text-xl=""]{font-size:1.25rem;line-height:1.75rem}.text-xs,[text-xs=""]{font-size:.75rem;line-height:1rem}[text~="4xl"]{font-size:2.25rem;line-height:2.5rem}[text~="60"]{font-size:15rem}.dark .dark\:text-amber-400{--un-text-opacity:1;color:rgb(251 191 36/var(--un-text-opacity))}.dark .dark\:text-neutral-100,[text~=neutral-100]{--un-text-opacity:1;color:rgb(245 245 245/var(--un-text-opacity))}.dark .dark\:text-neutral-200,.dark [dark\:text-neutral-200=""]{--un-text-opacity:1;color:rgb(229 229 229/var(--un-text-opacity))}.dark .dark\:text-neutral-300,.dark [dark\:text-neutral-300=""],.dark [text~=dark\:neutral-300],[text~=neutral-300]{--un-text-opacity:1;color:rgb(212 212 212/var(--un-text-opacity))}.dark .dark\:text-neutral-400,.dark [dark\:text-neutral-400=""],.dark [text~=dark\:neutral-400],.text-neutral-400,[text-neutral-400=""],[text~=neutral-400]{--un-text-opacity:1;color:rgb(163 163 163/var(--un-text-opacity))}.dark .dark\:text-neutral-500,.dark [text~=dark\:neutral-500],.text-neutral-500,[text-neutral-500=""],[text~=neutral-500]{--un-text-opacity:1;color:rgb(115 115 115/var(--un-text-opacity))}.dark .dark\:text-neutral-600,.text-neutral-600,[text~=neutral-600]{--un-text-opacity:1;color:rgb(82 82 82/var(--un-text-opacity))}.dark .dark\:text-neutral-600\/20,.dark [text~="dark:neutral-600/20"]{color:#52525233}.dark .dark\:text-primary-300,.dark [text~=dark\:primary-300],.text-primary-300,[text~=primary-300]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-primary-300\/80{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.8)}.dark .dark\:text-primary-400,.dark [text~=dark\:primary-400],.text-primary-400{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-primary-500,.text-primary-500{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-primary-600,.text-primary-600,[text~=primary-600]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:text-red-400{--un-text-opacity:1;color:rgb(248 113 113/var(--un-text-opacity))}.dark .dark\:text-white,.dark [dark\:text-white=""],.dark [text~=dark\:white],.text-white,[text-white=""],[text~=white]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}.dark .dark\:text-white\/50{color:#ffffff80}.dark [text~="dark:cyan-600/90"]{color:#0891b2e6}.dark [text~=dark\:gray-200]{--un-text-opacity:1;color:rgb(229 231 235/var(--un-text-opacity))}.dark [text~="dark:neutral-600/50"]{color:#52525280}.dark [text~=dark\:neutral-900],.text-neutral-900{--un-text-opacity:1;color:rgb(23 23 23/var(--un-text-opacity))}.dark [text~=dark\:orange-500]{--un-text-opacity:1;color:rgb(249 115 22/var(--un-text-opacity))}.dark [text~=dark\:primary-100]{--un-text-opacity:1;color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))80%,oklch(100% 0 360/var(--un-text-opacity)))}.dark [text~="dark:primary-300/50"]{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.5)}.dark [text~="dark:primary-600/90"]{color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.9)}.dark [text~="dark:violet-600/90"]{color:#7c3aede6}.text-amber-500{--un-text-opacity:1;color:rgb(245 158 11/var(--un-text-opacity))}.text-amber-600{--un-text-opacity:1;color:rgb(217 119 6/var(--un-text-opacity))}.text-black,[text-black=""]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.text-blue-500{--un-text-opacity:1;color:rgb(59 130 246/var(--un-text-opacity))}.text-neutral-200\/50,[text~=neutral-200\/50]{color:#e5e5e580}.text-neutral-400\/50,[text~=neutral-400\/50]{color:#a3a3a380}.text-neutral-500\/50,[text~=neutral-500\/50]{color:#73737380}.text-neutral-700,[text-neutral-700=""]{--un-text-opacity:1;color:rgb(64 64 64/var(--un-text-opacity))}.text-primary-600\/80{color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.8)}.text-primary-700,[text~=primary-700]{--un-text-opacity:1;color:oklch(49% var(--chromatic-chroma-700)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.text-red-500{--un-text-opacity:1;color:rgb(239 68 68/var(--un-text-opacity))}.text-red-600{--un-text-opacity:1;color:rgb(220 38 38/var(--un-text-opacity))}.text-transparent{color:#0000}.text-violet-500,[text-violet-500=""]{--un-text-opacity:1;color:rgb(139 92 246/var(--un-text-opacity))}[text~=complementary-400]{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 180)/var(--un-text-opacity))}[text~=cyan-400]{--un-text-opacity:1;color:rgb(34 211 238/var(--un-text-opacity))}[text~=cyan-400\/90]{color:#22d3eee6}[text~=gray-700]{--un-text-opacity:1;color:rgb(55 65 81/var(--un-text-opacity))}[text~=orange-700]{--un-text-opacity:1;color:rgb(194 65 12/var(--un-text-opacity))}[text~=primary-400\/90]{color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.9)}[text~=primary-800]{--un-text-opacity:1;color:oklch(42% var(--chromatic-chroma-800)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}[text~=violet-400\/90]{color:#a78bfae6}.dark .dark\:hover\:text-neutral-300:hover{--un-text-opacity:1;color:rgb(212 212 212/var(--un-text-opacity))}.dark [hover~="dark:text-primary-300/80"]:hover{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.8)}.dark [text~="dark:hover:primary-500"]:hover{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.hover\:text-neutral-700:hover{--un-text-opacity:1;color:rgb(64 64 64/var(--un-text-opacity))}[hover~=text-primary-600\/80]:hover{color:oklch(54% var(--chromatic-chroma-600)calc(var(--chromatic-hue) + 0)/.8)}[text~=hover\:primary-500]:hover{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark .dark\:disabled\:text-neutral-600:disabled,.dark [text~="dark:disabled:neutral-600"]:disabled{--un-text-opacity:1;color:rgb(82 82 82/var(--un-text-opacity))}.disabled\:text-neutral-400:disabled,[text~=disabled\:neutral-400]:disabled{--un-text-opacity:1;color:rgb(163 163 163/var(--un-text-opacity))}.dark [text~="placeholder:dark:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.dark [text~="placeholder:dark:primary-300/50"]::placeholder{color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/.5)}[text~="placeholder:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}[text~=placeholder\:primary-300]::placeholder{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-text-opacity))}.font-bold,[font-bold=""]{font-weight:700}.font-medium,[font-medium=""]{font-weight:500}.font-semibold,[font-semibold=""]{font-weight:600}.font-thin,[font-thin=""]{font-weight:100}.leading-10,.lh-10{line-height:2.5rem}[leading~="[0.75]"]{line-height:.75}[leading~="[1]"]{line-height:1}.font-cute,[font-cute=""]{font-family:Kiwi Maru}.font-cuteen,[font-cuteen=""]{font-family:Sniglet}.font-jura,[font-jura=""]{font-family:Jura}.font-mono,[font-mono=""]{font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-quicksand,[font-quicksand=""]{font-family:Quicksand}.font-sans,[font-sans=""]{font-family:DM Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-italic,.italic,[font-italic=""]{font-style:italic}.underline,[underline=""]{text-decoration-line:underline}.tab,[aria-checked~=tab][aria-checked=true],[tab=""],[checked~=tab]:checked{-moz-tab-size:4;tab-size:4}.text-stroke-1,[text-stroke-1=""]{-webkit-text-stroke-width:1px}.text-shadow{--un-text-shadow:0 0 1px var(--un-text-shadow-color,#0003),0 0 1px var(--un-text-shadow-color,#0100051a);text-shadow:var(--un-text-shadow)}.\[\&\:checked\+div_\.radio-dot\]\:opacity-100:checked+div .radio-dot,.opacity-100,.group:hover .group-hover\:opacity-100,.group:hover [group-hover\:opacity-100=""]{opacity:1}.op-0,.opacity-0,[opacity-0=""]{opacity:0}.op50,.opacity-50,[op50=""]{opacity:.5}.opacity-25{opacity:.25}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-95,[opacity-95=""]{opacity:.95}[hover~=opacity-100]:hover{opacity:1}.disabled\:opacity-50:disabled,[disabled\:opacity-50=""]:disabled{opacity:.5}.before\:opacity-100:before{opacity:1}[before~=opacity-0]:before{opacity:0}[hover~=before\:opacity-100]:hover:before{opacity:1}.mix-blend-screen,[mix-blend-screen=""]{mix-blend-mode:screen}.dark .dark\:shadow-lg,.shadow-lg{--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark [shadow~=dark\:none]{--un-shadow:0 0 var(--un-shadow-color,#0000);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow{--un-shadow:var(--un-shadow-inset)0 1px 3px 0 var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 1px 2px -1px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-md,[shadow-md=""],[shadow~=md]{--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-sm,[shadow-sm=""],[shadow~=sm]{--un-shadow:var(--un-shadow-inset)0 1px 2px 0 var(--un-shadow-color,#0000000d);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-xl,[shadow-xl=""]{--un-shadow:var(--un-shadow-inset)0 20px 25px -5px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 8px 10px -6px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}[shadow~=cyan-200\/50]{--un-shadow-color:#a5f3fc80 }[shadow~=primary-200\/50]{--un-shadow-color:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/.5)}[shadow~=violet-200\/50]{--un-shadow-color:#ddd6fe80 }.focus-within\:shadow-neutral-800:focus-within{--un-shadow-opacity:1;--un-shadow-color:rgb(38 38 38/var(--un-shadow-opacity))}[shadow~="focus-within:[0_0_0_1px]"]:focus-within{--un-shadow:0 0 0 1px var(--un-shadow-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark [hover~=dark\:shadow-lg]:hover{--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}[hover~=shadow-md]:hover{--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline{outline-style:solid}.outline-none,[outline-none=""],[outline~=focus-within\:none]:focus-within{outline-offset:2px;outline:2px solid #0000}.focus\:ring-2:focus{--un-ring-width:2px;--un-ring-offset-shadow:var(--un-ring-inset)0 0 0 var(--un-ring-offset-width)var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset)0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width))var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.focus\:ring-offset-2:focus{--un-ring-offset-width:2px}.dark .dark\:focus\:ring-neutral-600\/50:focus{--un-ring-color:#52525280 }.dark .dark\:focus\:ring-primary-400\/50:focus{--un-ring-color:oklch(74% var(--chromatic-chroma-400)calc(var(--chromatic-hue) + 0)/.5)}.dark .dark\:focus\:ring-red-500\/50:focus{--un-ring-color:#ef444480 }.focus\:ring-black\/10:focus{--un-ring-color:#0000001a }.focus\:ring-neutral-300\/50:focus{--un-ring-color:#d4d4d480 }.focus\:ring-primary-500\/50:focus{--un-ring-color:oklch(62% var(--chromatic-chroma-500)calc(var(--chromatic-hue) + 0)/.5)}.focus\:ring-red-600\/50:focus{--un-ring-color:#dc262680 }.dark .dark\:focus\:ring-offset-neutral-900:focus{--un-ring-offset-opacity:1;--un-ring-offset-color:rgb(23 23 23/var(--un-ring-offset-opacity))}.focus\:ring-offset-white:focus{--un-ring-offset-opacity:1;--un-ring-offset-color:rgb(255 255 255/var(--un-ring-offset-opacity))}.backdrop-blur-sm,[backdrop-blur-sm=""]{--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.backdrop-blur-xl,[backdrop-blur-xl=""]{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur)var(--un-backdrop-brightness)var(--un-backdrop-contrast)var(--un-backdrop-grayscale)var(--un-backdrop-hue-rotate)var(--un-backdrop-invert)var(--un-backdrop-opacity)var(--un-backdrop-saturate)var(--un-backdrop-sepia)}.blur{--un-blur:blur(8px);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.drop-shadow{--un-drop-shadow:drop-shadow(0 1px 2px var(--un-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--un-drop-shadow-color,#0000000f));filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}[drop-shadow~=none],.dark [drop-shadow~="dark:hover:none"]:hover{--un-drop-shadow:drop-shadow(0 0 var(--un-drop-shadow-color,#0000));filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}[drop-shadow~="hover:[0px_4px_4px_rgba(220,220,220,0.4)]"]:hover{--un-drop-shadow:drop-shadow(0px 4px 4px #dcdcdc66);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}[drop-shadow~="active:[0px_0px_0px_rgba(220,220,220,0.25)]"]:active{--un-drop-shadow:drop-shadow(0px 0px 0px #dcdcdc40);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.\[\&_\.provider-icon\]\:grayscale-100 .provider-icon,.grayscale-100,[grayscale-100=""]{--un-grayscale:grayscale(1);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.\[\&_\.provider-icon\]\:hover\:grayscale-0:hover .provider-icon{--un-grayscale:grayscale(0);filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.filter{filter:var(--un-blur)var(--un-brightness)var(--un-contrast)var(--un-drop-shadow)var(--un-grayscale)var(--un-hue-rotate)var(--un-invert)var(--un-saturate)var(--un-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[width\,margin\]{transition-property:width,margin;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all,[transition-all=""],[transition~=all]{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors,[transition-colors=""],[transition~=colors]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity,[transition-opacity=""]{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform,[transition~=transform]{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~="100"]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.1s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=border]{transition-property:border;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~=placeholder\:all]::placeholder,[before~=transition-all]:before,.after\:transition-all:after,[after~=transition-all]:after{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200,[duration-200=""],[transition~=duration-200]{transition-duration:.2s}.duration-250,[duration-250=""],[duration~="250"],[transition~=duration-250]{transition-duration:.25s}.duration-300,[transition~=duration-300]{transition-duration:.3s}.duration-400,[transition~=duration-400]{transition-duration:.4s}.duration-500,[duration-500=""],[duration~="500"],[transition~=duration-500]{transition-duration:.5s}[duration~="10"]{transition-duration:10ms}[duration~="1000"]{transition-duration:1s}.placeholder\:duration-250::placeholder,[placeholder\:duration-250=""]::placeholder,[transition~=placeholder\:duration-250]::placeholder{transition-duration:.25s}[before~=duration-400]:before,[after~=duration-400]:after{transition-duration:.4s}[delay~="10"]{transition-delay:10ms}[delay~="11"]{transition-delay:11ms}[delay~="19"]{transition-delay:19ms}[delay~="2"]{transition-delay:2ms}[delay~="20"]{transition-delay:20ms}[delay~="3"]{transition-delay:3ms}[delay~="4"]{transition-delay:4ms}[delay~="5"]{transition-delay:5ms}[delay~="50"]{transition-delay:50ms}[delay~="6"]{transition-delay:6ms}[delay~="7"]{transition-delay:7ms}[delay~="8"]{transition-delay:8ms}[delay~="9"]{transition-delay:9ms}.ease,.ease-in-out,[ease-in-out=""],[transition~=ease-in-out]{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-linear,[ease-linear=""]{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.placeholder\:ease-in-out::placeholder,[transition~=placeholder\:ease-in-out]::placeholder,[before~=ease-in-out]:before,[after~=ease-in-out]:after{transition-timing-function:cubic-bezier(.4,0,.2,1)}.will-change-transform,[will-change-transform=""]{will-change:transform}.after\:content-\[\'\'\]:after,.content-empty,[before~=content-empty]:before,[after~=content-empty]:after{content:""}.hidden,[hidden=""]{display:none}.bg-dotted-\[neutral-200\/60\]{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.6}.bg-dotted-\[neutral-200\/80\]{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.8}.dark .dark\:bg-dotted-\[neutral-700\/25\]{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.25}.dark .dark\:bg-dotted-\[neutral-700\/40\]{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.4}.dark .dark\:hover\:bg-dotted-\[primary-200\/20\]:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.hover\:bg-dotted-\[primary-300\/50\]:hover,.after\:bg-dotted-\[primary-300\/50\]:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.dark .dark\:after\:bg-dotted-\[primary-200\/20\]:after,.dark [hover~="dark:after:bg-dotted-[primary-200/20]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}[after~="bg-dotted-[neutral-200/80]"]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:.8}[hover~="after:bg-dotted-[primary-300/50]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300)calc(var(--chromatic-hue) + 0)/var(--un-background-opacity))1px,transparent 0);--un-background-opacity:%alpha}.transition-colors-none,.placeholder\:transition-colors-none::placeholder{transition-property:color,background-color,border-color,text-color;transition-duration:0s}@media (max-width:1023.9px){[min-w~="i.map(i=>d[i]); -var aC=Object.defineProperty;var lC=(n,e,t)=>e in n?aC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var fi=(n,e,t)=>lC(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();const cC="modulepreload",uC=function(n){return"/"+n},bv={},Xe=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(t.map(c=>{if(c=uC(c),c in bv)return;bv[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":cC,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((h,p)=>{d.addEventListener("load",h),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};/** -* @vue/shared v3.5.16 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function v0(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const bt={},da=[],ts=()=>{},fC=()=>!1,Gd=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),y0=n=>n.startsWith("onUpdate:"),sn=Object.assign,b0=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},dC=Object.prototype.hasOwnProperty,Et=(n,e)=>dC.call(n,e),$e=Array.isArray,ha=n=>Pc(n)==="[object Map]",Fa=n=>Pc(n)==="[object Set]",xv=n=>Pc(n)==="[object Date]",et=n=>typeof n=="function",Bt=n=>typeof n=="string",Fi=n=>typeof n=="symbol",Dt=n=>n!==null&&typeof n=="object",WM=n=>(Dt(n)||et(n))&&et(n.then)&&et(n.catch),XM=Object.prototype.toString,Pc=n=>XM.call(n),hC=n=>Pc(n).slice(8,-1),$M=n=>Pc(n)==="[object Object]",x0=n=>Bt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,xl=v0(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Wd=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},pC=/-(\w)/g,ai=Wd(n=>n.replace(pC,(e,t)=>t?t.toUpperCase():"")),mC=/\B([A-Z])/g,Gs=Wd(n=>n.replace(mC,"-$1").toLowerCase()),Xd=Wd(n=>n.charAt(0).toUpperCase()+n.slice(1)),gf=Wd(n=>n?`on${Xd(n)}`:""),jn=(n,e)=>!Object.is(n,e),_f=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},Lf=n=>{const e=parseFloat(n);return isNaN(e)?n:e},gC=n=>{const e=Bt(n)?Number(n):NaN;return isNaN(e)?n:e};let Mv;const $d=()=>Mv||(Mv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Si(n){if($e(n)){const e={};for(let t=0;t{if(t){const i=t.split(vC);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function ka(n){let e="";if(Bt(n))e=n;else if($e(n))for(let t=0;txo(t,e))}const jM=n=>!!(n&&n.__v_isRef===!0),EC=n=>Bt(n)?n:n==null?"":$e(n)||Dt(n)&&(n.toString===XM||!et(n.toString))?jM(n)?EC(n.value):JSON.stringify(n,KM,2):String(n),KM=(n,e)=>jM(e)?KM(n,e.value):ha(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[up(i,r)+" =>"]=s,t),{})}:Fa(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>up(t))}:Fi(e)?up(e):Dt(e)&&!$e(e)&&!$M(e)?String(e):e,up=(n,e="")=>{var t;return Fi(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/** -* @vue/reactivity v3.5.16 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Tn;class ZM{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Tn,!e&&Tn&&(this.index=(Tn.scopes||(Tn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0&&--this._on===0&&(Tn=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t0)return;if(Sl){let e=Sl;for(Sl=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Ml;){let e=Ml;for(Ml=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function tS(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function nS(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),A0(i),TC(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function eg(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(iS(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function iS(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ql)||(n.globalVersion=ql,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!eg(n))))return;n.flags|=2;const e=n.dep,t=Nt,i=Ni;Nt=n,Ni=!0;try{tS(n);const s=n.fn(n._value);(e.version===0||jn(s,n._value))&&(n.flags|=128,n._value=s,e.version++)}catch(s){throw e.version++,s}finally{Nt=t,Ni=i,nS(n),n.flags&=-3}}function A0(n,e=!1){const{dep:t,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)A0(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function TC(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Ni=!0;const sS=[];function Us(){sS.push(Ni),Ni=!1}function Fs(){const n=sS.pop();Ni=n===void 0?!0:n}function Sv(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Nt;Nt=void 0;try{e()}finally{Nt=t}}}let ql=0;class wC{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Yd{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Nt||!Ni||Nt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Nt)t=this.activeLink=new wC(Nt,this),Nt.deps?(t.prevDep=Nt.depsTail,Nt.depsTail.nextDep=t,Nt.depsTail=t):Nt.deps=Nt.depsTail=t,rS(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Nt.depsTail,t.nextDep=void 0,Nt.depsTail.nextDep=t,Nt.depsTail=t,Nt.deps===t&&(Nt.deps=i)}return t}trigger(e){this.version++,ql++,this.notify(e)}notify(e){T0();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{w0()}}}function rS(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)rS(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Df=new WeakMap,mo=Symbol(""),tg=Symbol(""),Yl=Symbol("");function wn(n,e,t){if(Ni&&Nt){let i=Df.get(n);i||Df.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new Yd),s.map=i,s.key=t),s.track()}}function Ss(n,e,t,i,s,r){const o=Df.get(n);if(!o){ql++;return}const a=l=>{l&&l.trigger()};if(T0(),e==="clear")o.forEach(a);else{const l=$e(n),c=l&&x0(t);if(l&&t==="length"){const u=Number(i);o.forEach((f,d)=>{(d==="length"||d===Yl||!Fi(d)&&d>=u)&&a(f)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(Yl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(mo)),ha(n)&&a(o.get(tg)));break;case"delete":l||(a(o.get(mo)),ha(n)&&a(o.get(tg)));break;case"set":ha(n)&&a(o.get(mo));break}}w0()}function AC(n,e){const t=Df.get(n);return t&&t.get(e)}function Fo(n){const e=dt(n);return e===n?e:(wn(e,"iterate",Yl),vi(n)?e:e.map(mn))}function jd(n){return wn(n=dt(n),"iterate",Yl),n}const CC={__proto__:null,[Symbol.iterator](){return dp(this,Symbol.iterator,mn)},concat(...n){return Fo(this).concat(...n.map(e=>$e(e)?Fo(e):e))},entries(){return dp(this,"entries",n=>(n[1]=mn(n[1]),n))},every(n,e){return fs(this,"every",n,e,void 0,arguments)},filter(n,e){return fs(this,"filter",n,e,t=>t.map(mn),arguments)},find(n,e){return fs(this,"find",n,e,mn,arguments)},findIndex(n,e){return fs(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return fs(this,"findLast",n,e,mn,arguments)},findLastIndex(n,e){return fs(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return fs(this,"forEach",n,e,void 0,arguments)},includes(...n){return hp(this,"includes",n)},indexOf(...n){return hp(this,"indexOf",n)},join(n){return Fo(this).join(n)},lastIndexOf(...n){return hp(this,"lastIndexOf",n)},map(n,e){return fs(this,"map",n,e,void 0,arguments)},pop(){return Za(this,"pop")},push(...n){return Za(this,"push",n)},reduce(n,...e){return Ev(this,"reduce",n,e)},reduceRight(n,...e){return Ev(this,"reduceRight",n,e)},shift(){return Za(this,"shift")},some(n,e){return fs(this,"some",n,e,void 0,arguments)},splice(...n){return Za(this,"splice",n)},toReversed(){return Fo(this).toReversed()},toSorted(n){return Fo(this).toSorted(n)},toSpliced(...n){return Fo(this).toSpliced(...n)},unshift(...n){return Za(this,"unshift",n)},values(){return dp(this,"values",mn)}};function dp(n,e,t){const i=jd(n),s=i[e]();return i!==n&&!vi(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=t(r.value)),r}),s}const RC=Array.prototype;function fs(n,e,t,i,s,r){const o=jd(n),a=o!==n&&!vi(n),l=o[e];if(l!==RC[e]){const f=l.apply(n,r);return a?mn(f):f}let c=t;o!==n&&(a?c=function(f,d){return t.call(this,mn(f),d,n)}:t.length>2&&(c=function(f,d){return t.call(this,f,d,n)}));const u=l.call(o,c,i);return a&&s?s(u):u}function Ev(n,e,t,i){const s=jd(n);let r=t;return s!==n&&(vi(n)?t.length>3&&(r=function(o,a,l){return t.call(this,o,a,l,n)}):r=function(o,a,l){return t.call(this,o,mn(a),l,n)}),s[e](r,...i)}function hp(n,e,t){const i=dt(n);wn(i,"iterate",Yl);const s=i[e](...t);return(s===-1||s===!1)&&C0(t[0])?(t[0]=dt(t[0]),i[e](...t)):s}function Za(n,e,t=[]){Us(),T0();const i=dt(n)[e].apply(n,t);return w0(),Fs(),i}const PC=v0("__proto__,__v_isRef,__isVue"),oS=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Fi));function IC(n){Fi(n)||(n=String(n));const e=dt(this);return wn(e,"has",n),e.hasOwnProperty(n)}class aS{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(s?r?hS:dS:r?fS:uS).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=$e(e);if(!s){let l;if(o&&(l=CC[t]))return l;if(t==="hasOwnProperty")return IC}const a=Reflect.get(e,t,Pt(e)?e:i);return(Fi(t)?oS.has(t):PC(t))||(s||wn(e,"get",t),r)?a:Pt(a)?o&&x0(t)?a:a.value:Dt(a)?s?ki(a):xi(a):a}}class lS extends aS{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){const l=vr(r);if(!vi(i)&&!vr(i)&&(r=dt(r),i=dt(i)),!$e(e)&&Pt(r)&&!Pt(i))return l?!1:(r.value=i,!0)}const o=$e(e)&&x0(t)?Number(t)n,ru=n=>Reflect.getPrototypeOf(n);function UC(n,e,t){return function(...i){const s=this.__v_raw,r=dt(s),o=ha(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),u=t?ng:e?Of:mn;return!e&&wn(r,"iterate",l?tg:mo),{next(){const{value:f,done:d}=c.next();return d?{value:f,done:d}:{value:a?[u(f[0]),u(f[1])]:u(f),done:d}},[Symbol.iterator](){return this}}}}function ou(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function FC(n,e){const t={get(s){const r=this.__v_raw,o=dt(r),a=dt(s);n||(jn(s,a)&&wn(o,"get",s),wn(o,"get",a));const{has:l}=ru(o),c=e?ng:n?Of:mn;if(l.call(o,s))return c(r.get(s));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!n&&wn(dt(s),"iterate",mo),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,o=dt(r),a=dt(s);return n||(jn(s,a)&&wn(o,"has",s),wn(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=dt(a),c=e?ng:n?Of:mn;return!n&&wn(l,"iterate",mo),a.forEach((u,f)=>s.call(r,c(u),c(f),o))}};return sn(t,n?{add:ou("add"),set:ou("set"),delete:ou("delete"),clear:ou("clear")}:{add(s){!e&&!vi(s)&&!vr(s)&&(s=dt(s));const r=dt(this);return ru(r).has.call(r,s)||(r.add(s),Ss(r,"add",s,s)),this},set(s,r){!e&&!vi(r)&&!vr(r)&&(r=dt(r));const o=dt(this),{has:a,get:l}=ru(o);let c=a.call(o,s);c||(s=dt(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,r),c?jn(r,u)&&Ss(o,"set",s,r):Ss(o,"add",s,r),this},delete(s){const r=dt(this),{has:o,get:a}=ru(r);let l=o.call(r,s);l||(s=dt(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&Ss(r,"delete",s,void 0),c},clear(){const s=dt(this),r=s.size!==0,o=s.clear();return r&&Ss(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=UC(s,n,e)}),t}function Kd(n,e){const t=FC(n,e);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(Et(t,s)&&s in i?t:i,s,r)}const kC={get:Kd(!1,!1)},BC={get:Kd(!1,!0)},zC={get:Kd(!0,!1)},VC={get:Kd(!0,!0)},uS=new WeakMap,fS=new WeakMap,dS=new WeakMap,hS=new WeakMap;function HC(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function GC(n){return n.__v_skip||!Object.isExtensible(n)?0:HC(hC(n))}function xi(n){return vr(n)?n:Zd(n,!1,LC,kC,uS)}function pS(n){return Zd(n,!1,OC,BC,fS)}function ki(n){return Zd(n,!0,DC,zC,dS)}function mS(n){return Zd(n,!0,NC,VC,hS)}function Zd(n,e,t,i,s){if(!Dt(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=GC(n);if(r===0)return n;const o=s.get(n);if(o)return o;const a=new Proxy(n,r===2?i:t);return s.set(n,a),a}function Ls(n){return vr(n)?Ls(n.__v_raw):!!(n&&n.__v_isReactive)}function vr(n){return!!(n&&n.__v_isReadonly)}function vi(n){return!!(n&&n.__v_isShallow)}function C0(n){return n?!!n.__v_raw:!1}function dt(n){const e=n&&n.__v_raw;return e?dt(e):n}function R0(n){return!Et(n,"__v_skip")&&Object.isExtensible(n)&&qM(n,"__v_skip",!0),n}const mn=n=>Dt(n)?xi(n):n,Of=n=>Dt(n)?ki(n):n;function Pt(n){return n?n.__v_isRef===!0:!1}function nt(n){return gS(n,!1)}function Oe(n){return gS(n,!0)}function gS(n,e){return Pt(n)?n:new WC(n,e)}class WC{constructor(e,t){this.dep=new Yd,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:dt(e),this._value=t?e:mn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||vi(e)||vr(e);e=i?e:dt(e),jn(e,t)&&(this._rawValue=e,this._value=i?e:mn(e),this.dep.trigger())}}function Ft(n){return Pt(n)?n.value:n}function rt(n){return et(n)?n():Ft(n)}const XC={get:(n,e,t)=>e==="__v_raw"?n:Ft(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return Pt(s)&&!Pt(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function _S(n){return Ls(n)?n:new Proxy(n,XC)}class $C{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new Yd,{get:i,set:s}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}function P0(n){return new $C(n)}function vS(n){const e=$e(n)?new Array(n.length):{};for(const t in n)e[t]=bS(n,t);return e}class qC{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return AC(dt(this._object),this._key)}}class YC{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function yS(n,e,t){return Pt(n)?n:et(n)?new YC(n):Dt(n)&&arguments.length>1?bS(n,e,t):nt(n)}function bS(n,e,t){const i=n[e];return Pt(i)?i:new qC(n,e,t)}class jC{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Yd(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ql-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Nt!==this)return eS(this,!0),!0}get value(){const e=this.dep.track();return iS(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function KC(n,e,t=!1){let i,s;return et(n)?i=n:(i=n.get,s=n.set),new jC(i,s,t)}const au={},Nf=new WeakMap;let io;function ZC(n,e=!1,t=io){if(t){let i=Nf.get(t);i||Nf.set(t,i=[]),i.push(n)}}function JC(n,e,t=bt){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=t,c=y=>s?y:vi(y)||s===!1||s===0?Es(y,1):Es(y);let u,f,d,h,p=!1,_=!1;if(Pt(n)?(f=()=>n.value,p=vi(n)):Ls(n)?(f=()=>c(n),p=!0):$e(n)?(_=!0,p=n.some(y=>Ls(y)||vi(y)),f=()=>n.map(y=>{if(Pt(y))return y.value;if(Ls(y))return c(y);if(et(y))return l?l(y,2):y()})):et(n)?e?f=l?()=>l(n,2):n:f=()=>{if(d){Us();try{d()}finally{Fs()}}const y=io;io=u;try{return l?l(n,3,[h]):n(h)}finally{io=y}}:f=ts,e&&s){const y=f,T=s===!0?1/0:s;f=()=>Es(y(),T)}const g=qd(),m=()=>{u.stop(),g&&g.active&&b0(g.effects,u)};if(r&&e){const y=e;e=(...T)=>{y(...T),m()}}let v=_?new Array(n.length).fill(au):au;const b=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(e){const T=u.run();if(s||p||(_?T.some((w,S)=>jn(w,v[S])):jn(T,v))){d&&d();const w=io;io=u;try{const S=[T,v===au?void 0:_&&v[0]===au?[]:v,h];v=T,l?l(e,3,S):e(...S)}finally{io=w}}}else u.run()};return a&&a(b),u=new JM(f),u.scheduler=o?()=>o(b,!1):b,h=y=>ZC(y,!1,u),d=u.onStop=()=>{const y=Nf.get(u);if(y){if(l)l(y,4);else for(const T of y)T();Nf.delete(u)}},e?i?b(!0):v=u.run():o?o(b.bind(null,!0),!0):u.run(),m.pause=u.pause.bind(u),m.resume=u.resume.bind(u),m.stop=m,m}function Es(n,e=1/0,t){if(e<=0||!Dt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Pt(n))Es(n.value,e,t);else if($e(n))for(let i=0;i{Es(i,e,t)});else if($M(n)){for(const i in n)Es(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Es(n[i],e,t)}return n}/** -* @vue/runtime-core v3.5.16 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Ic(n,e,t,i){try{return i?n(...i):n()}catch(s){Jd(s,e,t)}}function Bi(n,e,t,i){if(et(n)){const s=Ic(n,e,t,i);return s&&WM(s)&&s.catch(r=>{Jd(r,e,t)}),s}if($e(n)){const s=[];for(let r=0;r>>1,s=kn[i],r=jl(s);r=jl(t)?kn.push(n):kn.splice(e2(e),0,n),n.flags|=1,MS()}}function MS(){Uf||(Uf=xS.then(ES))}function t2(n){$e(n)?pa.push(...n):or&&n.id===-1?or.splice(ia+1,0,n):n.flags&1||(pa.push(n),n.flags|=1),MS()}function Tv(n,e,t=ji+1){for(;tjl(t)-jl(i));if(pa.length=0,or){or.push(...e);return}for(or=e,ia=0;ian.id==null?n.flags&2?-1:1/0:n.id;function ES(n){try{for(ji=0;jiL0;function L0(n,e=tn,t){if(!e||n._n)return n;const i=(...s)=>{i._d&&kv(-1);const r=Ff(e);let o;try{o=n(...s)}finally{Ff(r),i._d&&kv(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function dG(n,e){if(tn===null)return n;const t=ih(tn),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,El=n=>n&&(n.disabled||n.disabled===""),wv=n=>n&&(n.defer||n.defer===""),Av=n=>typeof SVGElement<"u"&&n instanceof SVGElement,Cv=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,ig=(n,e)=>{const t=n&&n.to;return Bt(t)?e?e(t):null:t},AS={name:"Teleport",__isTeleport:!0,process(n,e,t,i,s,r,o,a,l,c){const{mc:u,pc:f,pbc:d,o:{insert:h,querySelector:p,createText:_,createComment:g}}=c,m=El(e.props);let{shapeFlag:v,children:b,dynamicChildren:y}=e;if(n==null){const T=e.el=_(""),w=e.anchor=_("");h(T,t,i),h(w,t,i);const S=(M,E)=>{v&16&&(s&&s.isCE&&(s.ce._teleportTarget=M),u(b,M,E,s,r,o,a,l))},P=()=>{const M=e.target=ig(e.props,p),E=CS(M,e,_,h);M&&(o!=="svg"&&Av(M)?o="svg":o!=="mathml"&&Cv(M)&&(o="mathml"),m||(S(M,E),vf(e,!1)))};m&&(S(t,w),vf(e,!0)),wv(e.props)?(e.el.__isMounted=!1,Un(()=>{P(),delete e.el.__isMounted},r)):P()}else{if(wv(e.props)&&n.el.__isMounted===!1){Un(()=>{AS.process(n,e,t,i,s,r,o,a,l,c)},r);return}e.el=n.el,e.targetStart=n.targetStart;const T=e.anchor=n.anchor,w=e.target=n.target,S=e.targetAnchor=n.targetAnchor,P=El(n.props),M=P?t:w,E=P?T:S;if(o==="svg"||Av(w)?o="svg":(o==="mathml"||Cv(w))&&(o="mathml"),y?(d(n.dynamicChildren,y,M,s,r,o,a),k0(n,e,!0)):l||f(n,e,M,E,s,r,o,a,!1),m)P?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):lu(e,t,T,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const D=e.target=ig(e.props,p);D&&lu(e,D,null,c,0)}else P&&lu(e,w,S,c,1);vf(e,m)}},remove(n,e,t,{um:i,o:{remove:s}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:f,props:d}=n;if(f&&(s(c),s(u)),r&&s(l),o&16){const h=r||!El(d);for(let p=0;p{n.isMounted=!0}),US(()=>{n.isUnmounting=!0}),n}const di=[Function,Array],RS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:di,onEnter:di,onAfterEnter:di,onEnterCancelled:di,onBeforeLeave:di,onLeave:di,onAfterLeave:di,onLeaveCancelled:di,onBeforeAppear:di,onAppear:di,onAfterAppear:di,onAppearCancelled:di},PS=n=>{const e=n.subTree;return e.component?PS(e.component):e},s2={name:"BaseTransition",props:RS,setup(n,{slots:e}){const t=Rn(),i=i2();return()=>{const s=e.default&&DS(e.default(),!0);if(!s||!s.length)return;const r=IS(s),o=dt(n),{mode:a}=o;if(i.isLeaving)return pp(r);const l=Rv(r);if(!l)return pp(r);let c=sg(l,o,i,t,f=>c=f);l.type!==An&&Kl(l,c);let u=t.subTree&&Rv(t.subTree);if(u&&u.type!==An&&!ao(l,u)&&PS(t).type!==An){let f=sg(u,o,i,t);if(Kl(u,f),a==="out-in"&&l.type!==An)return i.isLeaving=!0,f.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete f.afterLeave,u=void 0},pp(r);a==="in-out"&&l.type!==An?f.delayLeave=(d,h,p)=>{const _=LS(i,u);_[String(u.key)]=u,d[ar]=()=>{h(),d[ar]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function IS(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==An){e=t;break}}return e}const r2=s2;function LS(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function sg(n,e,t,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:d,onLeave:h,onAfterLeave:p,onLeaveCancelled:_,onBeforeAppear:g,onAppear:m,onAfterAppear:v,onAppearCancelled:b}=e,y=String(n.key),T=LS(t,n),w=(M,E)=>{M&&Bi(M,i,9,E)},S=(M,E)=>{const D=E[1];w(M,E),$e(M)?M.every(B=>B.length<=1)&&D():M.length<=1&&D()},P={mode:o,persisted:a,beforeEnter(M){let E=l;if(!t.isMounted)if(r)E=g||l;else return;M[ar]&&M[ar](!0);const D=T[y];D&&ao(n,D)&&D.el[ar]&&D.el[ar](),w(E,[M])},enter(M){let E=c,D=u,B=f;if(!t.isMounted)if(r)E=m||c,D=v||u,B=b||f;else return;let z=!1;const V=M[cu]=Q=>{z||(z=!0,Q?w(B,[M]):w(D,[M]),P.delayedLeave&&P.delayedLeave(),M[cu]=void 0)};E?S(E,[M,V]):V()},leave(M,E){const D=String(n.key);if(M[cu]&&M[cu](!0),t.isUnmounting)return E();w(d,[M]);let B=!1;const z=M[ar]=V=>{B||(B=!0,E(),V?w(_,[M]):w(p,[M]),M[ar]=void 0,T[D]===n&&delete T[D])};T[D]=n,h?S(h,[M,z]):z()},clone(M){const E=sg(M,e,t,i,s);return s&&s(E),E}};return P}function pp(n){if(eh(n))return n=yr(n),n.children=null,n}function Rv(n){if(!eh(n))return wS(n.type)&&n.children?IS(n.children):n;if(n.component)return n.component.subTree;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&et(t.default))return t.default()}}function Kl(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Kl(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function DS(n,e=!1,t){let i=[],s=0;for(let r=0;r1)for(let r=0;rkf(p,e&&($e(e)?e[_]:e),t,i,s));return}if(ma(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&kf(n,e,t,i.component.subTree);return}const r=i.shapeFlag&4?ih(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=e&&e.r,u=a.refs===bt?a.refs={}:a.refs,f=a.setupState,d=dt(f),h=f===bt?()=>!1:p=>Et(d,p);if(c!=null&&c!==l&&(Bt(c)?(u[c]=null,h(c)&&(f[c]=null)):Pt(c)&&(c.value=null)),et(l))Ic(l,a,12,[o,u]);else{const p=Bt(l),_=Pt(l);if(p||_){const g=()=>{if(n.f){const m=p?h(l)?f[l]:u[l]:l.value;s?$e(m)&&b0(m,r):$e(m)?m.includes(r)||m.push(r):p?(u[l]=[r],h(l)&&(f[l]=u[l])):(l.value=[r],n.k&&(u[n.k]=l.value))}else p?(u[l]=o,h(l)&&(f[l]=o)):_&&(l.value=o,n.k&&(u[n.k]=o))};o?(g.id=-1,Un(g,t)):g()}}}$d().requestIdleCallback;$d().cancelIdleCallback;const ma=n=>!!n.type.__asyncLoader,eh=n=>n.type.__isKeepAlive;function o2(n,e){NS(n,"a",e)}function a2(n,e){NS(n,"da",e)}function NS(n,e,t=un){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(th(e,i,t),t){let s=t.parent;for(;s&&s.parent;)eh(s.parent.vnode)&&l2(i,e,t,s),s=s.parent}}function l2(n,e,t,i){const s=th(e,n,i,!0);rs(()=>{b0(i[e],s)},t)}function th(n,e,t=un,i=!1){if(t){const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{Us();const a=Nc(t),l=Bi(e,t,n,o);return a(),Fs(),l});return i?s.unshift(r):s.push(r),r}}const Ws=n=>(e,t=un)=>{(!tc||n==="sp")&&th(n,(...i)=>e(...i),t)},c2=Ws("bm"),Gn=Ws("m"),u2=Ws("bu"),f2=Ws("u"),US=Ws("bum"),rs=Ws("um"),d2=Ws("sp"),h2=Ws("rtg"),p2=Ws("rtc");function m2(n,e=un){th("ec",n,e)}const D0="components",g2="directives";function mG(n,e){return O0(D0,n,!0,e)||n}const FS=Symbol.for("v-ndc");function _2(n){return Bt(n)?O0(D0,n,!1)||n:n||FS}function gG(n){return O0(g2,n)}function O0(n,e,t=!0,i=!1){const s=tn||un;if(s){const r=s.type;if(n===D0){const a=rR(r,!1);if(a&&(a===e||a===ai(e)||a===Xd(ai(e))))return r}const o=Pv(s[n]||r[n],e)||Pv(s.appContext[n],e);return!o&&i?r:o}}function Pv(n,e){return n&&(n[e]||n[ai(e)]||n[Xd(ai(e))])}function v2(n,e,t,i){let s;const r=t,o=$e(n);if(o||Bt(n)){const a=o&&Ls(n);let l=!1,c=!1;a&&(l=!vi(n),c=vr(n),n=jd(n)),s=new Array(n.length);for(let u=0,f=n.length;ue(a,l,void 0,r));else{const a=Object.keys(n);s=new Array(a.length);for(let l=0,c=a.length;lec(e)?!(e.type===An||e.type===Zt&&!kS(e.children)):!0)?n:null}function _G(n,e){const t={};for(const i in n)t[gf(i)]=n[i];return t}const rg=n=>n?r1(n)?ih(n):rg(n.parent):null,Tl=sn(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>rg(n.parent),$root:n=>rg(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>VS(n),$forceUpdate:n=>n.f||(n.f=()=>{I0(n.update)}),$nextTick:n=>n.n||(n.n=Ar.bind(n.proxy)),$watch:n=>z2.bind(n)}),mp=(n,e)=>n!==bt&&!n.__isScriptSetup&&Et(n,e),b2={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(mp(i,e))return o[e]=1,i[e];if(s!==bt&&Et(s,e))return o[e]=2,s[e];if((c=n.propsOptions[0])&&Et(c,e))return o[e]=3,r[e];if(t!==bt&&Et(t,e))return o[e]=4,t[e];og&&(o[e]=0)}}const u=Tl[e];let f,d;if(u)return e==="$attrs"&&wn(n.attrs,"get",""),u(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==bt&&Et(t,e))return o[e]=4,t[e];if(d=l.config.globalProperties,Et(d,e))return d[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return mp(s,e)?(s[e]=t,!0):i!==bt&&Et(i,e)?(i[e]=t,!0):Et(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(r[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:r}},o){let a;return!!t[o]||n!==bt&&Et(n,o)||mp(e,o)||(a=r[0])&&Et(a,o)||Et(i,o)||Et(Tl,o)||Et(s.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Et(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function N0(){return BS().slots}function vG(){return BS().attrs}function BS(){const n=Rn();return n.setupContext||(n.setupContext=a1(n))}function Zl(n){return $e(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function yG(n,e){const t=Zl(n);for(const i in e){if(i.startsWith("__skip"))continue;let s=t[i];s?$e(s)||et(s)?s=t[i]={type:s,default:e[i]}:s.default=e[i]:s===null&&(s=t[i]={default:e[i]}),s&&e[`__skip_${i}`]&&(s.skipFactory=!0)}return t}function bG(n,e){return!n||!e?n||e:$e(n)&&$e(e)?n.concat(e):sn({},Zl(n),Zl(e))}let og=!0;function x2(n){const e=VS(n),t=n.proxy,i=n.ctx;og=!1,e.beforeCreate&&Iv(e.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:f,mounted:d,beforeUpdate:h,updated:p,activated:_,deactivated:g,beforeDestroy:m,beforeUnmount:v,destroyed:b,unmounted:y,render:T,renderTracked:w,renderTriggered:S,errorCaptured:P,serverPrefetch:M,expose:E,inheritAttrs:D,components:B,directives:z,filters:V}=e;if(c&&M2(c,i,null),o)for(const te in o){const Z=o[te];et(Z)&&(i[te]=Z.bind(t))}if(s){const te=s.call(t,t);Dt(te)&&(n.data=xi(te))}if(og=!0,r)for(const te in r){const Z=r[te],pe=et(Z)?Z.bind(t,t):et(Z.get)?Z.get.bind(t,t):ts,Me=!et(Z)&&et(Z.set)?Z.set.bind(t):ts,re=Se({get:pe,set:Me});Object.defineProperty(i,te,{enumerable:!0,configurable:!0,get:()=>re.value,set:xe=>re.value=xe})}if(a)for(const te in a)zS(a[te],i,t,te);if(l){const te=et(l)?l.call(t):l;Reflect.ownKeys(te).forEach(Z=>{gr(Z,te[Z])})}u&&Iv(u,n,"c");function j(te,Z){$e(Z)?Z.forEach(pe=>te(pe.bind(t))):Z&&te(Z.bind(t))}if(j(c2,f),j(Gn,d),j(u2,h),j(f2,p),j(o2,_),j(a2,g),j(m2,P),j(p2,w),j(h2,S),j(US,v),j(rs,y),j(d2,M),$e(E))if(E.length){const te=n.exposed||(n.exposed={});E.forEach(Z=>{Object.defineProperty(te,Z,{get:()=>t[Z],set:pe=>t[Z]=pe})})}else n.exposed||(n.exposed={});T&&n.render===ts&&(n.render=T),D!=null&&(n.inheritAttrs=D),B&&(n.components=B),z&&(n.directives=z),M&&OS(n)}function M2(n,e,t=ts){$e(n)&&(n=ag(n));for(const i in n){const s=n[i];let r;Dt(s)?"default"in s?r=_n(s.from||i,s.default,!0):r=_n(s.from||i):r=_n(s),Pt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function Iv(n,e,t){Bi($e(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function zS(n,e,t,i){let s=i.includes(".")?QS(t,i):()=>t[i];if(Bt(n)){const r=e[n];et(r)&&Ke(s,r)}else if(et(n))Ke(s,n.bind(t));else if(Dt(n))if($e(n))n.forEach(r=>zS(r,e,t,i));else{const r=et(n.handler)?n.handler.bind(t):e[n.handler];et(r)&&Ke(s,r,n)}}function VS(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(e);let l;return a?l=a:!s.length&&!t&&!i?l=e:(l={},s.length&&s.forEach(c=>Bf(l,c,o,!0)),Bf(l,e,o)),Dt(e)&&r.set(e,l),l}function Bf(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&Bf(n,r,t,!0),s&&s.forEach(o=>Bf(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=S2[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const S2={data:Lv,props:Dv,emits:Dv,methods:gl,computed:gl,beforeCreate:Dn,created:Dn,beforeMount:Dn,mounted:Dn,beforeUpdate:Dn,updated:Dn,beforeDestroy:Dn,beforeUnmount:Dn,destroyed:Dn,unmounted:Dn,activated:Dn,deactivated:Dn,errorCaptured:Dn,serverPrefetch:Dn,components:gl,directives:gl,watch:T2,provide:Lv,inject:E2};function Lv(n,e){return e?n?function(){return sn(et(n)?n.call(this,this):n,et(e)?e.call(this,this):e)}:e:n}function E2(n,e){return gl(ag(n),ag(e))}function ag(n){if($e(n)){const e={};for(let t=0;t1)return t&&et(e)?e.call(i&&i.proxy):e}}function Lc(){return!!(un||tn||go)}const GS={},WS=()=>Object.create(GS),XS=n=>Object.getPrototypeOf(n)===GS;function C2(n,e,t,i=!1){const s={},r=WS();n.propsDefaults=Object.create(null),$S(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);t?n.props=i?s:pS(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function R2(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=dt(s),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let f=0;f{l=!0;const[d,h]=qS(f,e,!0);sn(o,d),h&&a.push(...h)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!r&&!l)return Dt(n)&&i.set(n,da),da;if($e(r))for(let u=0;un[0]==="_"||n==="$stable",F0=n=>$e(n)?n.map(Ji):[Ji(n)],I2=(n,e,t)=>{if(e._n)return e;const i=L0((...s)=>F0(e(...s)),t);return i._c=!1,i},YS=(n,e,t)=>{const i=n._ctx;for(const s in n){if(U0(s))continue;const r=n[s];if(et(r))e[s]=I2(s,r,i);else if(r!=null){const o=F0(r);e[s]=()=>o}}},jS=(n,e)=>{const t=F0(e);n.slots.default=()=>t},KS=(n,e,t)=>{for(const i in e)(t||!U0(i))&&(n[i]=e[i])},L2=(n,e,t)=>{const i=n.slots=WS();if(n.vnode.shapeFlag&32){const s=e._;s?(KS(i,e,t),t&&qM(i,"_",s,!0)):YS(e,i)}else e&&jS(n,e)},D2=(n,e,t)=>{const{vnode:i,slots:s}=n;let r=!0,o=bt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:KS(s,e,t):(r=!e.$stable,YS(e,s)),o=e}else e&&(jS(n,e),o={default:1});if(r)for(const a in s)!U0(a)&&o[a]==null&&delete s[a]},Un=$2;function ZS(n){return O2(n)}function O2(n,e){const t=$d();t.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:f,nextSibling:d,setScopeId:h=ts,insertStaticContent:p}=n,_=(N,U,A,W=null,G=null,X=null,C=void 0,I=null,F=!!U.dynamicChildren)=>{if(N===U)return;N&&!ao(N,U)&&(W=$(N),xe(N,G,X,!0),N=null),U.patchFlag===-2&&(F=!1,U.dynamicChildren=null);const{type:H,ref:ce,shapeFlag:R}=U;switch(H){case Oc:g(N,U,A,W);break;case An:m(N,U,A,W);break;case yf:N==null&&v(U,A,W,C);break;case Zt:B(N,U,A,W,G,X,C,I,F);break;default:R&1?T(N,U,A,W,G,X,C,I,F):R&6?z(N,U,A,W,G,X,C,I,F):(R&64||R&128)&&H.process(N,U,A,W,G,X,C,I,F,ue)}ce!=null&&G&&kf(ce,N&&N.ref,X,U||N,!U)},g=(N,U,A,W)=>{if(N==null)i(U.el=a(U.children),A,W);else{const G=U.el=N.el;U.children!==N.children&&c(G,U.children)}},m=(N,U,A,W)=>{N==null?i(U.el=l(U.children||""),A,W):U.el=N.el},v=(N,U,A,W)=>{[N.el,N.anchor]=p(N.children,U,A,W,N.el,N.anchor)},b=({el:N,anchor:U},A,W)=>{let G;for(;N&&N!==U;)G=d(N),i(N,A,W),N=G;i(U,A,W)},y=({el:N,anchor:U})=>{let A;for(;N&&N!==U;)A=d(N),s(N),N=A;s(U)},T=(N,U,A,W,G,X,C,I,F)=>{U.type==="svg"?C="svg":U.type==="math"&&(C="mathml"),N==null?w(U,A,W,G,X,C,I,F):M(N,U,G,X,C,I,F)},w=(N,U,A,W,G,X,C,I)=>{let F,H;const{props:ce,shapeFlag:R,transition:x,dirs:O}=N;if(F=N.el=o(N.type,X,ce&&ce.is,ce),R&8?u(F,N.children):R&16&&P(N.children,F,null,W,G,gp(N,X),C,I),O&&Fr(N,null,W,"created"),S(F,N,N.scopeId,C,W),ce){for(const ne in ce)ne!=="value"&&!xl(ne)&&r(F,ne,null,ce[ne],X,W);"value"in ce&&r(F,"value",null,ce.value,X),(H=ce.onVnodeBeforeMount)&&Xi(H,W,N)}O&&Fr(N,null,W,"beforeMount");const Y=N2(G,x);Y&&x.beforeEnter(F),i(F,U,A),((H=ce&&ce.onVnodeMounted)||Y||O)&&Un(()=>{H&&Xi(H,W,N),Y&&x.enter(F),O&&Fr(N,null,W,"mounted")},G)},S=(N,U,A,W,G)=>{if(A&&h(N,A),W)for(let X=0;X{for(let H=F;H{const I=U.el=N.el;let{patchFlag:F,dynamicChildren:H,dirs:ce}=U;F|=N.patchFlag&16;const R=N.props||bt,x=U.props||bt;let O;if(A&&kr(A,!1),(O=x.onVnodeBeforeUpdate)&&Xi(O,A,U,N),ce&&Fr(U,N,A,"beforeUpdate"),A&&kr(A,!0),(R.innerHTML&&x.innerHTML==null||R.textContent&&x.textContent==null)&&u(I,""),H?E(N.dynamicChildren,H,I,A,W,gp(U,G),X):C||Z(N,U,I,null,A,W,gp(U,G),X,!1),F>0){if(F&16)D(I,R,x,A,G);else if(F&2&&R.class!==x.class&&r(I,"class",null,x.class,G),F&4&&r(I,"style",R.style,x.style,G),F&8){const Y=U.dynamicProps;for(let ne=0;ne{O&&Xi(O,A,U,N),ce&&Fr(U,N,A,"updated")},W)},E=(N,U,A,W,G,X,C)=>{for(let I=0;I{if(U!==A){if(U!==bt)for(const X in U)!xl(X)&&!(X in A)&&r(N,X,U[X],null,G,W);for(const X in A){if(xl(X))continue;const C=A[X],I=U[X];C!==I&&X!=="value"&&r(N,X,I,C,G,W)}"value"in A&&r(N,"value",U.value,A.value,G)}},B=(N,U,A,W,G,X,C,I,F)=>{const H=U.el=N?N.el:a(""),ce=U.anchor=N?N.anchor:a("");let{patchFlag:R,dynamicChildren:x,slotScopeIds:O}=U;O&&(I=I?I.concat(O):O),N==null?(i(H,A,W),i(ce,A,W),P(U.children||[],A,ce,G,X,C,I,F)):R>0&&R&64&&x&&N.dynamicChildren?(E(N.dynamicChildren,x,A,G,X,C,I),(U.key!=null||G&&U===G.subTree)&&k0(N,U,!0)):Z(N,U,A,ce,G,X,C,I,F)},z=(N,U,A,W,G,X,C,I,F)=>{U.slotScopeIds=I,N==null?U.shapeFlag&512?G.ctx.activate(U,A,W,C,F):V(U,A,W,G,X,C,F):Q(N,U,F)},V=(N,U,A,W,G,X,C)=>{const I=N.component=tR(N,W,G);if(eh(N)&&(I.ctx.renderer=ue),nR(I,!1,C),I.asyncDep){if(G&&G.registerDep(I,j,C),!N.el){const F=I.subTree=gn(An);m(null,F,U,A)}}else j(I,N,U,A,G,X,C)},Q=(N,U,A)=>{const W=U.component=N.component;if(W2(N,U,A))if(W.asyncDep&&!W.asyncResolved){te(W,U,A);return}else W.next=U,W.update();else U.el=N.el,W.vnode=U},j=(N,U,A,W,G,X,C)=>{const I=()=>{if(N.isMounted){let{next:R,bu:x,u:O,parent:Y,vnode:ne}=N;{const De=JS(N);if(De){R&&(R.el=ne.el,te(N,R,C)),De.asyncDep.then(()=>{N.isUnmounted||I()});return}}let ee=R,Te;kr(N,!1),R?(R.el=ne.el,te(N,R,C)):R=ne,x&&_f(x),(Te=R.props&&R.props.onVnodeBeforeUpdate)&&Xi(Te,Y,R,ne),kr(N,!0);const me=Uv(N),Re=N.subTree;N.subTree=me,_(Re,me,f(Re.el),$(Re),N,G,X),R.el=me.el,ee===null&&X2(N,me.el),O&&Un(O,G),(Te=R.props&&R.props.onVnodeUpdated)&&Un(()=>Xi(Te,Y,R,ne),G)}else{let R;const{el:x,props:O}=U,{bm:Y,m:ne,parent:ee,root:Te,type:me}=N,Re=ma(U);kr(N,!1),Y&&_f(Y),!Re&&(R=O&&O.onVnodeBeforeMount)&&Xi(R,ee,U),kr(N,!0);{Te.ce&&Te.ce._injectChildStyle(me);const De=N.subTree=Uv(N);_(null,De,A,W,N,G,X),U.el=De.el}if(ne&&Un(ne,G),!Re&&(R=O&&O.onVnodeMounted)){const De=U;Un(()=>Xi(R,ee,De),G)}(U.shapeFlag&256||ee&&ma(ee.vnode)&&ee.vnode.shapeFlag&256)&&N.a&&Un(N.a,G),N.isMounted=!0,U=A=W=null}};N.scope.on();const F=N.effect=new JM(I);N.scope.off();const H=N.update=F.run.bind(F),ce=N.job=F.runIfDirty.bind(F);ce.i=N,ce.id=N.uid,F.scheduler=()=>I0(ce),kr(N,!0),H()},te=(N,U,A)=>{U.component=N;const W=N.vnode.props;N.vnode=U,N.next=null,R2(N,U.props,W,A),D2(N,U.children,A),Us(),Tv(N),Fs()},Z=(N,U,A,W,G,X,C,I,F=!1)=>{const H=N&&N.children,ce=N?N.shapeFlag:0,R=U.children,{patchFlag:x,shapeFlag:O}=U;if(x>0){if(x&128){Me(H,R,A,W,G,X,C,I,F);return}else if(x&256){pe(H,R,A,W,G,X,C,I,F);return}}O&8?(ce&16&&Ee(H,G,X),R!==H&&u(A,R)):ce&16?O&16?Me(H,R,A,W,G,X,C,I,F):Ee(H,G,X,!0):(ce&8&&u(A,""),O&16&&P(R,A,W,G,X,C,I,F))},pe=(N,U,A,W,G,X,C,I,F)=>{N=N||da,U=U||da;const H=N.length,ce=U.length,R=Math.min(H,ce);let x;for(x=0;xce?Ee(N,G,X,!0,!1,R):P(U,A,W,G,X,C,I,F,R)},Me=(N,U,A,W,G,X,C,I,F)=>{let H=0;const ce=U.length;let R=N.length-1,x=ce-1;for(;H<=R&&H<=x;){const O=N[H],Y=U[H]=F?cr(U[H]):Ji(U[H]);if(ao(O,Y))_(O,Y,A,null,G,X,C,I,F);else break;H++}for(;H<=R&&H<=x;){const O=N[R],Y=U[x]=F?cr(U[x]):Ji(U[x]);if(ao(O,Y))_(O,Y,A,null,G,X,C,I,F);else break;R--,x--}if(H>R){if(H<=x){const O=x+1,Y=Ox)for(;H<=R;)xe(N[H],G,X,!0),H++;else{const O=H,Y=H,ne=new Map;for(H=Y;H<=x;H++){const ze=U[H]=F?cr(U[H]):Ji(U[H]);ze.key!=null&&ne.set(ze.key,H)}let ee,Te=0;const me=x-Y+1;let Re=!1,De=0;const he=new Array(me);for(H=0;H=me){xe(ze,G,X,!0);continue}let Ve;if(ze.key!=null)Ve=ne.get(ze.key);else for(ee=Y;ee<=x;ee++)if(he[ee-Y]===0&&ao(ze,U[ee])){Ve=ee;break}Ve===void 0?xe(ze,G,X,!0):(he[Ve-Y]=H+1,Ve>=De?De=Ve:Re=!0,_(ze,U[Ve],A,null,G,X,C,I,F),Te++)}const Ne=Re?U2(he):da;for(ee=Ne.length-1,H=me-1;H>=0;H--){const ze=Y+H,Ve=U[ze],we=ze+1{const{el:X,type:C,transition:I,children:F,shapeFlag:H}=N;if(H&6){re(N.component.subTree,U,A,W);return}if(H&128){N.suspense.move(U,A,W);return}if(H&64){C.move(N,U,A,ue);return}if(C===Zt){i(X,U,A);for(let R=0;RI.enter(X),G);else{const{leave:R,delayLeave:x,afterLeave:O}=I,Y=()=>{N.ctx.isUnmounted?s(X):i(X,U,A)},ne=()=>{R(X,()=>{Y(),O&&O()})};x?x(X,Y,ne):ne()}else i(X,U,A)},xe=(N,U,A,W=!1,G=!1)=>{const{type:X,props:C,ref:I,children:F,dynamicChildren:H,shapeFlag:ce,patchFlag:R,dirs:x,cacheIndex:O}=N;if(R===-2&&(G=!1),I!=null&&(Us(),kf(I,null,A,N,!0),Fs()),O!=null&&(U.renderCache[O]=void 0),ce&256){U.ctx.deactivate(N);return}const Y=ce&1&&x,ne=!ma(N);let ee;if(ne&&(ee=C&&C.onVnodeBeforeUnmount)&&Xi(ee,U,N),ce&6)ge(N.component,A,W);else{if(ce&128){N.suspense.unmount(A,W);return}Y&&Fr(N,null,U,"beforeUnmount"),ce&64?N.type.remove(N,U,A,ue,W):H&&!H.hasOnce&&(X!==Zt||R>0&&R&64)?Ee(H,U,A,!1,!0):(X===Zt&&R&384||!G&&ce&16)&&Ee(F,U,A),W&&We(N)}(ne&&(ee=C&&C.onVnodeUnmounted)||Y)&&Un(()=>{ee&&Xi(ee,U,N),Y&&Fr(N,null,U,"unmounted")},A)},We=N=>{const{type:U,el:A,anchor:W,transition:G}=N;if(U===Zt){oe(A,W);return}if(U===yf){y(N);return}const X=()=>{s(A),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(N.shapeFlag&1&&G&&!G.persisted){const{leave:C,delayLeave:I}=G,F=()=>C(A,X);I?I(N.el,X,F):F()}else X()},oe=(N,U)=>{let A;for(;N!==U;)A=d(N),s(N),N=A;s(U)},ge=(N,U,A)=>{const{bum:W,scope:G,job:X,subTree:C,um:I,m:F,a:H,parent:ce,slots:{__:R}}=N;Nv(F),Nv(H),W&&_f(W),ce&&$e(R)&&R.forEach(x=>{ce.renderCache[x]=void 0}),G.stop(),X&&(X.flags|=8,xe(C,N,U,A)),I&&Un(I,U),Un(()=>{N.isUnmounted=!0},U),U&&U.pendingBranch&&!U.isUnmounted&&N.asyncDep&&!N.asyncResolved&&N.suspenseId===U.pendingId&&(U.deps--,U.deps===0&&U.resolve())},Ee=(N,U,A,W=!1,G=!1,X=0)=>{for(let C=X;C{if(N.shapeFlag&6)return $(N.component.subTree);if(N.shapeFlag&128)return N.suspense.next();const U=d(N.anchor||N.el),A=U&&U[TS];return A?d(A):U};let ae=!1;const le=(N,U,A)=>{N==null?U._vnode&&xe(U._vnode,null,null,!0):_(U._vnode||null,N,U,null,null,null,A),U._vnode=N,ae||(ae=!0,Tv(),SS(),ae=!1)},ue={p:_,um:xe,m:re,r:We,mt:V,mc:P,pc:Z,pbc:E,n:$,o:n};return{render:le,hydrate:void 0,createApp:A2(le)}}function gp({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function kr({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function N2(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function k0(n,e,t=!1){const i=n.children,s=e.children;if($e(i)&&$e(s))for(let r=0;r>1,n[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function JS(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:JS(e)}function Nv(n){if(n)for(let e=0;e_n(F2);function Ba(n,e){return Dc(n,null,e)}function xG(n,e){return Dc(n,null,{flush:"post"})}function B2(n,e){return Dc(n,null,{flush:"sync"})}function Ke(n,e,t){return Dc(n,e,t)}function Dc(n,e,t=bt){const{immediate:i,deep:s,flush:r,once:o}=t,a=sn({},t),l=e&&i||!e&&r!=="post";let c;if(tc){if(r==="sync"){const h=k2();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=ts,h.resume=ts,h.pause=ts,h}}const u=un;a.call=(h,p,_)=>Bi(h,u,p,_);let f=!1;r==="post"?a.scheduler=h=>{Un(h,u&&u.suspense)}:r!=="sync"&&(f=!0,a.scheduler=(h,p)=>{p?h():I0(h)}),a.augmentJob=h=>{e&&(h.flags|=4),f&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const d=JC(n,e,a);return tc&&(c?c.push(d):l&&d()),d}function z2(n,e,t){const i=this.proxy,s=Bt(n)?n.includes(".")?QS(i,n):()=>i[n]:n.bind(i,i);let r;et(e)?r=e:(r=e.handler,t=e);const o=Nc(this),a=Dc(s,r.bind(i),t);return o(),a}function QS(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s{let u,f=bt,d;return B2(()=>{const h=n[s];jn(u,h)&&(u=h,c())}),{get(){return l(),t.get?t.get(u):u},set(h){const p=t.set?t.set(h):h;if(!jn(p,u)&&!(f!==bt&&jn(h,f)))return;const _=i.vnode.props;_&&(e in _||s in _||r in _)&&(`onUpdate:${e}`in _||`onUpdate:${s}`in _||`onUpdate:${r}`in _)||(u=h,c()),i.emit(`update:${e}`,p),jn(h,p)&&jn(h,f)&&!jn(p,d)&&c(),f=h,d=p}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||bt:a,done:!1}:{done:!0}}}},a}const e1=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${ai(e)}Modifiers`]||n[`${Gs(e)}Modifiers`];function V2(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||bt;let s=t;const r=e.startsWith("update:"),o=r&&e1(i,e.slice(7));o&&(o.trim&&(s=t.map(u=>Bt(u)?u.trim():u)),o.number&&(s=t.map(Lf)));let a,l=i[a=gf(e)]||i[a=gf(ai(e))];!l&&r&&(l=i[a=gf(Gs(e))]),l&&Bi(l,n,6,s);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,Bi(c,n,6,s)}}function t1(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!et(n)){const l=c=>{const u=t1(c,e,!0);u&&(a=!0,sn(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(Dt(n)&&i.set(n,null),null):($e(r)?r.forEach(l=>o[l]=null):sn(o,r),Dt(n)&&i.set(n,o),o)}function nh(n,e){return!n||!Gd(e)?!1:(e=e.slice(2).replace(/Once$/,""),Et(n,e[0].toLowerCase()+e.slice(1))||Et(n,Gs(e))||Et(n,e))}function Uv(n){const{type:e,vnode:t,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:f,data:d,setupState:h,ctx:p,inheritAttrs:_}=n,g=Ff(n);let m,v;try{if(t.shapeFlag&4){const y=s||i,T=y;m=Ji(c.call(T,y,u,f,h,d,p)),v=a}else{const y=e;m=Ji(y.length>1?y(f,{attrs:a,slots:o,emit:l}):y(f,null)),v=e.props?a:H2(a)}}catch(y){wl.length=0,Jd(y,n,1),m=gn(An)}let b=m;if(v&&_!==!1){const y=Object.keys(v),{shapeFlag:T}=b;y.length&&T&7&&(r&&y.some(y0)&&(v=G2(v,r)),b=yr(b,v,!1,!0))}return t.dirs&&(b=yr(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(t.dirs):t.dirs),t.transition&&Kl(b,t.transition),m=b,Ff(g),m}const H2=n=>{let e;for(const t in n)(t==="class"||t==="style"||Gd(t))&&((e||(e={}))[t]=n[t]);return e},G2=(n,e)=>{const t={};for(const i in n)(!y0(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function W2(n,e,t){const{props:i,children:s,component:r}=n,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?Fv(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let f=0;fn.__isSuspense;function $2(n,e){e&&e.pendingBranch?$e(n)?e.effects.push(...n):e.effects.push(n):t2(n)}const Zt=Symbol.for("v-fgt"),Oc=Symbol.for("v-txt"),An=Symbol.for("v-cmt"),yf=Symbol.for("v-stc"),wl=[];let ri=null;function vn(n=!1){wl.push(ri=n?null:[])}function q2(){wl.pop(),ri=wl[wl.length-1]||null}let Jl=1;function kv(n,e=!1){Jl+=n,n<0&&ri&&e&&(ri.hasOnce=!0)}function i1(n){return n.dynamicChildren=Jl>0?ri||da:null,q2(),Jl>0&&ri&&ri.push(n),n}function yi(n,e,t,i,s,r){return i1(lr(n,e,t,i,s,r,!0))}function Ql(n,e,t,i,s){return i1(gn(n,e,t,i,s,!0))}function ec(n){return n?n.__v_isVNode===!0:!1}function ao(n,e){return n.type===e.type&&n.key===e.key}const s1=({key:n})=>n??null,bf=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Bt(n)||Pt(n)||et(n)?{i:tn,r:n,k:e,f:!!t}:n:null);function lr(n,e=null,t=null,i=0,s=null,r=n===Zt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&s1(e),ref:e&&bf(e),scopeId:Qd,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:tn};return a?(B0(l,t),r&128&&n.normalize(l)):t&&(l.shapeFlag|=Bt(t)?8:16),Jl>0&&!o&&ri&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&ri.push(l),l}const gn=Y2;function Y2(n,e=null,t=null,i=0,s=null,r=!1){if((!n||n===FS)&&(n=An),ec(n)){const a=yr(n,e,!0);return t&&B0(a,t),Jl>0&&!r&&ri&&(a.shapeFlag&6?ri[ri.indexOf(n)]=a:ri.push(a)),a.patchFlag=-2,a}if(oR(n)&&(n=n.__vccOpts),e){e=j2(e);let{class:a,style:l}=e;a&&!Bt(a)&&(e.class=ka(a)),Dt(l)&&(C0(l)&&!$e(l)&&(l=sn({},l)),e.style=Si(l))}const o=Bt(n)?1:n1(n)?128:wS(n)?64:Dt(n)?4:et(n)?2:0;return lr(n,e,t,i,s,o,r,!0)}function j2(n){return n?C0(n)||XS(n)?sn({},n):n:null}function yr(n,e,t=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=e?J2(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&s1(c),ref:e&&e.ref?t&&r?$e(r)?r.concat(bf(e)):[r,bf(e)]:bf(e):r,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Zt?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&yr(n.ssContent),ssFallback:n.ssFallback&&yr(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&Kl(u,l.clone(u)),u}function K2(n=" ",e=0){return gn(Oc,null,n,e)}function Z2(n,e){const t=gn(yf,null,n);return t.staticCount=e,t}function Bv(n="",e=!1){return e?(vn(),Ql(An,null,n)):gn(An,null,n)}function Ji(n){return n==null||typeof n=="boolean"?gn(An):$e(n)?gn(Zt,null,n.slice()):ec(n)?cr(n):gn(Oc,null,String(n))}function cr(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:yr(n)}function B0(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if($e(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),B0(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!XS(e)?e._ctx=tn:s===3&&tn&&(tn.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else et(e)?(e={default:e,_ctx:tn},t=32):(e=String(e),i&64?(t=16,e=[K2(e)]):t=8);n.children=e,n.shapeFlag|=t}function J2(...n){const e={};for(let t=0;tun||tn;let zf,cg;{const n=$d(),e=(t,i)=>{let s;return(s=n[t])||(s=n[t]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};zf=e("__VUE_INSTANCE_SETTERS__",t=>un=t),cg=e("__VUE_SSR_SETTERS__",t=>tc=t)}const Nc=n=>{const e=un;return zf(n),n.scope.on(),()=>{n.scope.off(),zf(e)}},zv=()=>{un&&un.scope.off(),zf(null)};function r1(n){return n.vnode.shapeFlag&4}let tc=!1;function nR(n,e=!1,t=!1){e&&cg(e);const{props:i,children:s}=n.vnode,r=r1(n);C2(n,i,r,e),L2(n,s,t||e);const o=r?iR(n,e):void 0;return e&&cg(!1),o}function iR(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,b2);const{setup:i}=t;if(i){Us();const s=n.setupContext=i.length>1?a1(n):null,r=Nc(n),o=Ic(i,n,0,[n.props,s]),a=WM(o);if(Fs(),r(),(a||n.sp)&&!ma(n)&&OS(n),a){if(o.then(zv,zv),e)return o.then(l=>{Vv(n,l)}).catch(l=>{Jd(l,n,0)});n.asyncDep=o}else Vv(n,o)}else o1(n)}function Vv(n,e,t){et(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:Dt(e)&&(n.setupState=_S(e)),o1(n)}function o1(n,e,t){const i=n.type;n.render||(n.render=i.render||ts);{const s=Nc(n);Us();try{x2(n)}finally{Fs(),s()}}}const sR={get(n,e){return wn(n,"get",""),n[e]}};function a1(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,sR),slots:n.slots,emit:n.emit,expose:e}}function ih(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(_S(R0(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Tl)return Tl[t](n)},has(e,t){return t in e||t in Tl}})):n.proxy}function rR(n,e=!0){return et(n)?n.displayName||n.name:n.name||e&&n.__name}function oR(n){return et(n)&&"__vccOpts"in n}const Se=(n,e)=>KC(n,e,tc);function ks(n,e,t){const i=arguments.length;return i===2?Dt(e)&&!$e(e)?ec(e)?gn(n,null,[e]):gn(n,e):gn(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&ec(t)&&(t=[t]),gn(n,e,t))}const aR="3.5.16";/** -* @vue/runtime-dom v3.5.16 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let ug;const Hv=typeof window<"u"&&window.trustedTypes;if(Hv)try{ug=Hv.createPolicy("vue",{createHTML:n=>n})}catch{}const l1=ug?n=>ug.createHTML(n):n=>n,lR="http://www.w3.org/2000/svg",cR="http://www.w3.org/1998/Math/MathML",Ms=typeof document<"u"?document:null,Gv=Ms&&Ms.createElement("template"),uR={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e==="svg"?Ms.createElementNS(lR,n):e==="mathml"?Ms.createElementNS(cR,n):t?Ms.createElement(n,{is:t}):Ms.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>Ms.createTextNode(n),createComment:n=>Ms.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>Ms.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,r){const o=t?t.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===r||!(s=s.nextSibling)););else{Gv.innerHTML=l1(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=Gv.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},js="transition",Ja="animation",nc=Symbol("_vtc"),c1={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},fR=sn({},RS,c1),dR=n=>(n.displayName="Transition",n.props=fR,n),SG=dR((n,{slots:e})=>ks(r2,hR(n),e)),Br=(n,e=[])=>{$e(n)?n.forEach(t=>t(...e)):n&&n(...e)},Wv=n=>n?$e(n)?n.some(e=>e.length>1):n.length>1:!1;function hR(n){const e={};for(const B in n)B in c1||(e[B]=n[B]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:f=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:h=`${t}-leave-to`}=n,p=pR(s),_=p&&p[0],g=p&&p[1],{onBeforeEnter:m,onEnter:v,onEnterCancelled:b,onLeave:y,onLeaveCancelled:T,onBeforeAppear:w=m,onAppear:S=v,onAppearCancelled:P=b}=e,M=(B,z,V,Q)=>{B._enterCancelled=Q,zr(B,z?u:a),zr(B,z?c:o),V&&V()},E=(B,z)=>{B._isLeaving=!1,zr(B,f),zr(B,h),zr(B,d),z&&z()},D=B=>(z,V)=>{const Q=B?S:v,j=()=>M(z,B,V);Br(Q,[z,j]),Xv(()=>{zr(z,B?l:r),ds(z,B?u:a),Wv(Q)||$v(z,i,_,j)})};return sn(e,{onBeforeEnter(B){Br(m,[B]),ds(B,r),ds(B,o)},onBeforeAppear(B){Br(w,[B]),ds(B,l),ds(B,c)},onEnter:D(!1),onAppear:D(!0),onLeave(B,z){B._isLeaving=!0;const V=()=>E(B,z);ds(B,f),B._enterCancelled?(ds(B,d),jv()):(jv(),ds(B,d)),Xv(()=>{B._isLeaving&&(zr(B,f),ds(B,h),Wv(y)||$v(B,i,g,V))}),Br(y,[B,V])},onEnterCancelled(B){M(B,!1,void 0,!0),Br(b,[B])},onAppearCancelled(B){M(B,!0,void 0,!0),Br(P,[B])},onLeaveCancelled(B){E(B),Br(T,[B])}})}function pR(n){if(n==null)return null;if(Dt(n))return[_p(n.enter),_p(n.leave)];{const e=_p(n);return[e,e]}}function _p(n){return gC(n)}function ds(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[nc]||(n[nc]=new Set)).add(e)}function zr(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[nc];t&&(t.delete(e),t.size||(n[nc]=void 0))}function Xv(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let mR=0;function $v(n,e,t,i){const s=n._endId=++mR,r=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=gR(n,e);if(!o)return i();const c=o+"end";let u=0;const f=()=>{n.removeEventListener(c,d),r()},d=h=>{h.target===n&&++u>=l&&f()};setTimeout(()=>{u(t[p]||"").split(", "),s=i(`${js}Delay`),r=i(`${js}Duration`),o=qv(s,r),a=i(`${Ja}Delay`),l=i(`${Ja}Duration`),c=qv(a,l);let u=null,f=0,d=0;e===js?o>0&&(u=js,f=o,d=r.length):e===Ja?c>0&&(u=Ja,f=c,d=l.length):(f=Math.max(o,c),u=f>0?o>c?js:Ja:null,d=u?u===js?r.length:l.length:0);const h=u===js&&/\b(transform|all)(,|$)/.test(i(`${js}Property`).toString());return{type:u,timeout:f,propCount:d,hasTransform:h}}function qv(n,e){for(;n.lengthYv(t)+Yv(n[i])))}function Yv(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function jv(){return document.body.offsetHeight}function _R(n,e,t){const i=n[nc];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const Kv=Symbol("_vod"),vR=Symbol("_vsh"),yR=Symbol(""),bR=/(^|;)\s*display\s*:/;function xR(n,e,t){const i=n.style,s=Bt(t);let r=!1;if(t&&!s){if(e)if(Bt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&xf(i,a,"")}else for(const o in e)t[o]==null&&xf(i,o,"");for(const o in t)o==="display"&&(r=!0),xf(i,o,t[o])}else if(s){if(e!==t){const o=i[yR];o&&(t+=";"+o),i.cssText=t,r=bR.test(t)}}else e&&n.removeAttribute("style");Kv in n&&(n[Kv]=r?i.display:"",n[vR]&&(i.display="none"))}const Zv=/\s*!important$/;function xf(n,e,t){if($e(t))t.forEach(i=>xf(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=MR(n,e);Zv.test(t)?n.setProperty(Gs(i),t.replace(Zv,""),"important"):n[i]=t}}const Jv=["Webkit","Moz","ms"],vp={};function MR(n,e){const t=vp[e];if(t)return t;let i=ai(e);if(i!=="filter"&&i in n)return vp[e]=i;i=Xd(i);for(let s=0;syp||(wR.then(()=>yp=0),yp=Date.now());function CR(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;Bi(RR(i,t.value),e,5,[i])};return t.value=n,t.attached=AR(),t}function RR(n,e){if($e(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i&&i(s))}else return e}const sy=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,PR=(n,e,t,i,s,r)=>{const o=s==="svg";e==="class"?_R(n,i,o):e==="style"?xR(n,t,i):Gd(e)?y0(e)||ER(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):IR(n,e,i,o))?(ty(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&ey(n,e,i,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Bt(i))?ty(n,ai(e),i,r,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),ey(n,e,i,o))};function IR(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&sy(e)&&et(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return sy(e)&&Bt(t)?!1:e in n}const br=n=>{const e=n.props["onUpdate:modelValue"]||!1;return $e(e)?t=>_f(e,t):e};function LR(n){n.target.composing=!0}function ry(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const bi=Symbol("_assign"),oy={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n[bi]=br(s);const r=i||s.props&&s.props.type==="number";Ts(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),r&&(a=Lf(a)),n[bi](a)}),t&&Ts(n,"change",()=>{n.value=n.value.trim()}),e||(Ts(n,"compositionstart",LR),Ts(n,"compositionend",ry),Ts(n,"change",ry))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:s,number:r}},o){if(n[bi]=br(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?Lf(n.value):n.value,l=e??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&e===t||s&&n.value.trim()===l)||(n.value=l))}},DR={deep:!0,created(n,e,t){n[bi]=br(t),Ts(n,"change",()=>{const i=n._modelValue,s=ba(n),r=n.checked,o=n[bi];if($e(i)){const a=M0(i,s),l=a!==-1;if(r&&!l)o(i.concat(s));else if(!r&&l){const c=[...i];c.splice(a,1),o(c)}}else if(Fa(i)){const a=new Set(i);r?a.add(s):a.delete(s),o(a)}else o(u1(n,r))})},mounted:ay,beforeUpdate(n,e,t){n[bi]=br(t),ay(n,e,t)}};function ay(n,{value:e,oldValue:t},i){n._modelValue=e;let s;if($e(e))s=M0(e,i.props.value)>-1;else if(Fa(e))s=e.has(i.props.value);else{if(e===t)return;s=xo(e,u1(n,!0))}n.checked!==s&&(n.checked=s)}const OR={created(n,{value:e},t){n.checked=xo(e,t.props.value),n[bi]=br(t),Ts(n,"change",()=>{n[bi](ba(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[bi]=br(i),e!==t&&(n.checked=xo(e,i.props.value))}},NR={deep:!0,created(n,{value:e,modifiers:{number:t}},i){const s=Fa(e);Ts(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?Lf(ba(o)):ba(o));n[bi](n.multiple?s?new Set(r):r:r[0]),n._assigning=!0,Ar(()=>{n._assigning=!1})}),n[bi]=br(i)},mounted(n,{value:e}){ly(n,e)},beforeUpdate(n,e,t){n[bi]=br(t)},updated(n,{value:e}){n._assigning||ly(n,e)}};function ly(n,e){const t=n.multiple,i=$e(e);if(!(t&&!i&&!Fa(e))){for(let s=0,r=n.options.length;sString(c)===String(a)):o.selected=M0(e,a)>-1}else o.selected=e.has(a);else if(xo(ba(o),e)){n.selectedIndex!==s&&(n.selectedIndex=s);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function ba(n){return"_value"in n?n._value:n.value}function u1(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const EG={created(n,e,t){uu(n,e,t,null,"created")},mounted(n,e,t){uu(n,e,t,null,"mounted")},beforeUpdate(n,e,t,i){uu(n,e,t,i,"beforeUpdate")},updated(n,e,t,i){uu(n,e,t,i,"updated")}};function UR(n,e){switch(n){case"SELECT":return NR;case"TEXTAREA":return oy;default:switch(e){case"checkbox":return DR;case"radio":return OR;default:return oy}}}function uu(n,e,t,i,s){const o=UR(n.tagName,t.props&&t.props.type)[s];o&&o(n,e,t,i)}const FR=["ctrl","shift","alt","meta"],kR={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>FR.some(t=>n[`${t}Key`]&&!e.includes(t))},TG=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=(s,...r)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),i=e.join(".");return t[i]||(t[i]=s=>{if(!("key"in s))return;const r=Gs(s.key);if(e.some(o=>o===r||BR[o]===r))return n(s)})},zR=sn({patchProp:PR},uR);let cy;function f1(){return cy||(cy=ZS(zR))}const AG=(...n)=>{f1().render(...n)},VR=(...n)=>{const e=f1().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=GR(i);if(!s)return;const r=e._component;!et(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=t(s,!1,HR(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e};function HR(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function GR(n){return Bt(n)?document.querySelector(n):n}const d1=new Set,Jn=new WeakMap,xa=new WeakMap,Mo=new WeakMap,fg=new WeakMap,WR=new WeakMap,Ma=new WeakMap,Vf=new WeakMap,_l=new WeakSet;let xr,z0=0,V0=0;const Cs="__aa_tgt",ic="__aa_del",Hf="__aa_new",XR=n=>{const e=ZR(n);e&&e.forEach(t=>JR(t))},$R=n=>{n.forEach(e=>{e.target===xr&&YR(),Jn.has(e.target)&&Co(e.target)})};function qR(n){const e=fg.get(n);e==null||e.disconnect();let t=Jn.get(n),i=0;const s=5;t||(t=Sa(n),Jn.set(n,t));const{offsetWidth:r,offsetHeight:o}=xr,l=[t.top-s,r-(t.left+s+t.width),o-(t.top+s+t.height),t.left-s].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++i>1&&Co(n)},{root:xr,threshold:1,rootMargin:l});c.observe(n),fg.set(n,c)}function Co(n){clearTimeout(Vf.get(n));const e=sh(n),t=sc(e)?500:e.duration;Vf.set(n,setTimeout(async()=>{const i=Mo.get(n);try{await(i==null?void 0:i.finished),Jn.set(n,Sa(n)),qR(n)}catch{}},t))}function YR(){clearTimeout(Vf.get(xr)),Vf.set(xr,setTimeout(()=>{d1.forEach(n=>g1(n,e=>h1(()=>Co(e))))},100))}function jR(n){setTimeout(()=>{WR.set(n,setInterval(()=>h1(Co.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function h1(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let dg,oa;const KR=typeof window<"u"&&"ResizeObserver"in window;KR&&(xr=document.documentElement,dg=new MutationObserver(XR),oa=new ResizeObserver($R),window.addEventListener("scroll",()=>{V0=window.scrollY,z0=window.scrollX}),oa.observe(xr));function ZR(n){return n.reduce((i,s)=>[...i,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(i=>i.nodeName==="#comment")?!1:n.reduce((i,s)=>{if(i===!1)return!1;if(s.target instanceof Element){if(bp(s.target),!i.has(s.target)){i.add(s.target);for(let r=0;rt(n,Ma.has(n)));for(let t=0;ts(i,Ma.has(i)))}}function G0(n){return Array.isArray(n)?n:[n]}function sc(n){return typeof n=="function"}function e3(n){const e=Jn.get(n),t=Sa(n);if(!H0(n))return Jn.set(n,t);let i;if(!e)return;const s=sh(n);if(typeof s!="function"){const r=e.left-t.left,o=e.top-t.top,[a,l,c,u]=p1(n,e,t),f={transform:`translate(${r}px, ${o}px)`},d={transform:"translate(0, 0)"};a!==l&&(f.width=`${a}px`,d.width=`${l}px`),c!==u&&(f.height=`${c}px`,d.height=`${u}px`),i=n.animate([f,d],{duration:s.duration,easing:s.easing})}else{const[r]=G0(s(n,"remain",e,t));i=new Animation(r),i.play()}Mo.set(n,i),Jn.set(n,t),i.addEventListener("finish",Co.bind(null,n))}function uy(n){Hf in n&&delete n[Hf];const e=Sa(n);Jn.set(n,e);const t=sh(n);if(!H0(n))return;let i;if(typeof t!="function")i=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:t.duration*1.5,easing:"ease-in"});else{const[s]=G0(t(n,"add",e));i=new Animation(s),i.play()}Mo.set(n,i),i.addEventListener("finish",Co.bind(null,n))}function fy(n,e){var t;n.remove(),Jn.delete(n),xa.delete(n),Mo.delete(n),(t=fg.get(n))===null||t===void 0||t.disconnect(),setTimeout(()=>{if(ic in n&&delete n[ic],Object.defineProperty(n,Hf,{value:!0,configurable:!0}),e&&n instanceof HTMLElement)for(const i in e)n.style[i]=""},0)}function t3(n){var e;if(!xa.has(n)||!Jn.has(n))return;const[t,i]=xa.get(n);Object.defineProperty(n,ic,{value:!0,configurable:!0});const s=window.scrollX,r=window.scrollY;if(i&&i.parentNode&&i.parentNode instanceof Element?i.parentNode.insertBefore(n,i):t&&t.parentNode?t.parentNode.appendChild(n):(e=m1(n))===null||e===void 0||e.appendChild(n),!H0(n))return fy(n);const[o,a,l,c]=i3(n),u=sh(n),f=Jn.get(n);(s!==z0||r!==V0)&&n3(n,s,r,u);let d,h={position:"absolute",top:`${o}px`,left:`${a}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!sc(u))Object.assign(n.style,h),d=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:u.duration,easing:"ease-out"});else{const[p,_]=G0(u(n,"remove",f));(_==null?void 0:_.styleReset)!==!1&&(h=(_==null?void 0:_.styleReset)||h,Object.assign(n.style,h)),d=new Animation(p),d.play()}Mo.set(n,d),d.addEventListener("finish",fy.bind(null,n,h))}function n3(n,e,t,i){const s=z0-e,r=V0-t,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(xr).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+r),!n.parentElement)return;const l=n.parentElement;let c=l.clientHeight,u=l.clientWidth;const f=performance.now();function d(){requestAnimationFrame(()=>{if(!sc(i)){const h=c-l.clientHeight,p=u-l.clientWidth;f+i.duration>performance.now()?(window.scrollTo({left:window.scrollX-p,top:window.scrollY-h}),c=l.clientHeight,u=l.clientWidth,d()):document.documentElement.style.scrollBehavior=o}})}d()}function i3(n){const e=Jn.get(n),[t,,i]=p1(n,e,Sa(n));let s=n.parentElement;for(;s&&(getComputedStyle(s).position==="static"||s instanceof HTMLBodyElement);)s=s.parentElement;s||(s=document.body);const r=getComputedStyle(s),o=Jn.get(s)||Sa(s),a=Math.round(e.top-o.top)-Ki(r.borderTopWidth),l=Math.round(e.left-o.left)-Ki(r.borderLeftWidth);return[a,l,t,i]}function s3(n,e={}){return dg&&oa&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!sc(e)&&!e.disrespectUserMotionPreference||(_l.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),g1(n,Co,jR,s=>oa==null?void 0:oa.observe(s)),sc(e)?Ma.set(n,e):Ma.set(n,{duration:250,easing:"ease-in-out",...e}),dg.observe(n,{childList:!0}),d1.add(n))),Object.freeze({parent:n,enable:()=>{_l.add(n)},disable:()=>{_l.delete(n)},isEnabled:()=>_l.has(n)})}const r3={mounted:(n,e)=>{s3(n,e.value||{})},getSSRProps:()=>({})},o3=r3,a3={install(n){n.directive("auto-animate",o3)}};/** - * @license - * Copyright 2010-2025 Three.js Authors - * SPDX-License-Identifier: MIT - */const Uc="177",l3={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},c3={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},_1=0,hg=1,v1=2,u3=3,f3=0,W0=1,X0=2,Zi=3,Bs=0,Vn=1,Ii=2,Ds=0,_o=1,pg=2,mg=3,gg=4,y1=5,dr=100,b1=101,x1=102,M1=103,S1=104,E1=200,T1=201,w1=202,A1=203,Gf=204,Wf=205,C1=206,R1=207,P1=208,I1=209,L1=210,D1=211,O1=212,N1=213,U1=214,Xf=0,$f=1,qf=2,So=3,Yf=4,jf=5,Kf=6,Zf=7,Fc=0,F1=1,k1=2,ns=0,B1=1,z1=2,V1=3,rh=4,H1=5,G1=6,W1=7,_g="attached",X1="detached",oh=300,zs=301,Mr=302,rc=303,oc=304,za=306,ac=1e3,gi=1001,lc=1002,yn=1003,$0=1004,d3=1004,aa=1005,h3=1005,nn=1006,Al=1007,p3=1007,es=1008,m3=1008,zi=1009,q0=1010,Y0=1011,Ea=1012,ah=1013,Vs=1014,Zn=1015,Va=1016,lh=1017,ch=1018,Ta=1020,j0=35902,K0=1021,Z0=1022,zn=1023,wa=1026,Aa=1027,uh=1028,kc=1029,J0=1030,fh=1031,g3=1032,dh=1033,Cl=33776,Rl=33777,Pl=33778,Il=33779,Jf=35840,Qf=35841,ed=35842,td=35843,nd=36196,id=37492,sd=37496,rd=37808,od=37809,ad=37810,ld=37811,cd=37812,ud=37813,fd=37814,dd=37815,hd=37816,pd=37817,md=37818,gd=37819,_d=37820,vd=37821,Ll=36492,yd=36494,bd=36495,Q0=36283,xd=36284,Md=36285,Sd=36286,$1=2200,q1=2201,Y1=2202,cc=2300,Ed=2301,Mf=2302,uo=2400,fo=2401,uc=2402,hh=2500,e_=2501,_3=0,v3=1,y3=2,j1=3200,K1=3201,b3=3202,x3=3203,Cr=0,Z1=1,ws="",Fn="srgb",Eo="srgb-linear",fc="linear",Ct="srgb",M3=0,so=7680,S3=7681,E3=7682,T3=7683,w3=34055,A3=34056,C3=5386,R3=512,P3=513,I3=514,L3=515,D3=516,O3=517,N3=518,vg=519,J1=512,Q1=513,eE=514,t_=515,tE=516,nE=517,iE=518,sE=519,dc=35044,U3=35048,F3=35040,k3=35045,B3=35049,z3=35041,V3=35046,H3=35050,G3=35042,W3="100",yg="300 es",_i=2e3,hc=2001,X3={COMPUTE:"compute",RENDER:"render"},$3={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},q3={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FLAT_FIRST:"flat first",FLAT_EITHER:"flat either"};class as{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const s=i[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let r=0,o=s.length;r>8&255]+Mn[n>>16&255]+Mn[n>>24&255]+"-"+Mn[e&255]+Mn[e>>8&255]+"-"+Mn[e>>16&15|64]+Mn[e>>24&255]+"-"+Mn[t&63|128]+Mn[t>>8&255]+"-"+Mn[t>>16&255]+Mn[t>>24&255]+Mn[i&255]+Mn[i>>8&255]+Mn[i>>16&255]+Mn[i>>24&255]).toLowerCase()}function st(n,e,t){return Math.max(e,Math.min(t,n))}function n_(n,e){return(n%e+e)%e}function Y3(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function j3(n,e,t){return n!==e?(t-n)/(e-n):0}function Dl(n,e,t){return(1-t)*n+t*e}function K3(n,e,t,i){return Dl(n,e,1-Math.exp(-t*i))}function Z3(n,e=1){return e-Math.abs(n_(n,e*2)-e)}function J3(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Q3(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function eP(n,e){return n+Math.floor(Math.random()*(e-n+1))}function tP(n,e){return n+Math.random()*(e-n)}function nP(n){return n*(.5-Math.random())}function iP(n){n!==void 0&&(dy=n);let e=dy+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function sP(n){return n*vo}function rP(n){return n*Ca}function oP(n){return(n&n-1)===0&&n!==0}function aP(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function lP(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function cP(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),c=r((e+i)/2),u=o((e+i)/2),f=r((e-i)/2),d=o((e-i)/2),h=r((i-e)/2),p=o((i-e)/2);switch(s){case"XYX":n.set(a*u,l*f,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*f,a*c);break;case"ZXZ":n.set(l*f,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*p,l*h,a*c);break;case"YXY":n.set(l*h,a*u,l*p,a*c);break;case"ZYZ":n.set(l*p,l*h,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function Bn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function lt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const i_={DEG2RAD:vo,RAD2DEG:Ca,generateUUID:oi,clamp:st,euclideanModulo:n_,mapLinear:Y3,inverseLerp:j3,lerp:Dl,damp:K3,pingpong:Z3,smoothstep:J3,smootherstep:Q3,randInt:eP,randFloat:tP,randFloatSpread:nP,seededRandom:iP,degToRad:sP,radToDeg:rP,isPowerOfTwo:oP,ceilPowerOfTwo:aP,floorPowerOfTwo:lP,setQuaternionFromProperEuler:cP,normalize:lt,denormalize:Bn};class fe{constructor(e=0,t=0){fe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=st(this.x,e.x,t.x),this.y=st(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=st(this.x,e,t),this.y=st(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(st(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(st(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Qn{constructor(e=0,t=0,i=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=s}static slerpFlat(e,t,i,s,r,o,a){let l=i[s+0],c=i[s+1],u=i[s+2],f=i[s+3];const d=r[o+0],h=r[o+1],p=r[o+2],_=r[o+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f;return}if(a===1){e[t+0]=d,e[t+1]=h,e[t+2]=p,e[t+3]=_;return}if(f!==_||l!==d||c!==h||u!==p){let g=1-a;const m=l*d+c*h+u*p+f*_,v=m>=0?1:-1,b=1-m*m;if(b>Number.EPSILON){const T=Math.sqrt(b),w=Math.atan2(T,m*v);g=Math.sin(g*w)/T,a=Math.sin(a*w)/T}const y=a*v;if(l=l*g+d*y,c=c*g+h*y,u=u*g+p*y,f=f*g+_*y,g===1-a){const T=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=T,c*=T,u*=T,f*=T}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],u=i[s+3],f=r[o],d=r[o+1],h=r[o+2],p=r[o+3];return e[t]=a*p+u*f+l*h-c*d,e[t+1]=l*p+u*d+c*f-a*h,e[t+2]=c*p+u*h+a*d-l*f,e[t+3]=u*p-a*f-l*d-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(s/2),f=a(r/2),d=l(i/2),h=l(s/2),p=l(r/2);switch(o){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],f=t[10],d=i+a+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(r-c)*h,this._z=(o-s)*h}else if(i>a&&i>f){const h=2*Math.sqrt(1+i-a-f);this._w=(u-l)/h,this._x=.25*h,this._y=(s+o)/h,this._z=(r+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-i-f);this._w=(r-c)/h,this._x=(s+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-i-a);this._w=(o-s)/h,this._x=(r+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(st(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+s*c-r*l,this._y=s*u+o*l+r*a-i*c,this._z=r*u+o*c+i*l-s*a,this._w=o*u-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-t;return this._w=h*o+t*this._w,this._x=h*i+t*this._x,this._y=h*s+t*this._y,this._z=h*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*f+this._w*d,this._x=i*f+this._x*d,this._y=s*f+this._y*d,this._z=r*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(e),s*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class k{constructor(e=0,t=0,i=0){k.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(hy.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(hy.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*s-a*i),u=2*(a*t-r*s),f=2*(r*i-o*t);return this.x=t+l*c+o*f-a*u,this.y=i+l*u+a*c-r*f,this.z=s+l*f+r*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=st(this.x,e.x,t.x),this.y=st(this.y,e.y,t.y),this.z=st(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=st(this.x,e,t),this.y=st(this.y,e,t),this.z=st(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(st(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return xp.copy(this).projectOnVector(e),this.sub(xp)}reflect(e){return this.sub(xp.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(st(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const xp=new k,hy=new Qn;class at{constructor(e,t,i,s,r,o,a,l,c){at.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c)}set(e,t,i,s,r,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=r,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],f=i[7],d=i[2],h=i[5],p=i[8],_=s[0],g=s[3],m=s[6],v=s[1],b=s[4],y=s[7],T=s[2],w=s[5],S=s[8];return r[0]=o*_+a*v+l*T,r[3]=o*g+a*b+l*w,r[6]=o*m+a*y+l*S,r[1]=c*_+u*v+f*T,r[4]=c*g+u*b+f*w,r[7]=c*m+u*y+f*S,r[2]=d*_+h*v+p*T,r[5]=d*g+h*b+p*w,r[8]=d*m+h*y+p*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*r*u+i*a*l+s*r*c-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*o-a*c,d=a*l-u*r,h=c*r-o*l,p=t*f+i*d+s*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/p;return e[0]=f*_,e[1]=(s*c-u*i)*_,e[2]=(a*i-s*o)*_,e[3]=d*_,e[4]=(u*t-s*l)*_,e[5]=(s*r-a*t)*_,e[6]=h*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*r)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,s,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-s*c,s*l,-s*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Mp.makeScale(e,t)),this}rotate(e){return this.premultiply(Mp.makeRotation(-e)),this}translate(e,t){return this.premultiply(Mp.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Mp=new at;function rE(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const uP={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function la(n,e){return new uP[n](e)}function pc(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function oE(){const n=pc("canvas");return n.style.display="block",n}const py={};function ga(n){n in py||(py[n]=!0,console.warn(n))}function fP(n,e,t){return new Promise(function(i,s){function r(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:s();break;case n.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:i()}}setTimeout(r,t)})}function dP(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function hP(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const my=new at().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),gy=new at().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function pP(){const n={enabled:!0,workingColorSpace:Eo,spaces:{},convert:function(s,r,o){return this.enabled===!1||r===o||!r||!o||(this.spaces[r].transfer===Ct&&(s.r=Os(s.r),s.g=Os(s.g),s.b=Os(s.b)),this.spaces[r].primaries!==this.spaces[o].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===Ct&&(s.r=_a(s.r),s.g=_a(s.g),s.b=_a(s.b))),s},workingToColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},colorSpaceToWorking:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===ws?fc:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,o){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(s,r){return ga("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(s,r)},toWorkingColorSpace:function(s,r){return ga("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(s,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Eo]:{primaries:e,whitePoint:i,transfer:fc,toXYZ:my,fromXYZ:gy,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Fn},outputColorSpaceConfig:{drawingBufferColorSpace:Fn}},[Fn]:{primaries:e,whitePoint:i,transfer:Ct,toXYZ:my,fromXYZ:gy,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Fn}}}),n}const pt=pP();function Os(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function _a(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let ko;class aE{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{ko===void 0&&(ko=pc("canvas")),ko.width=e.width,ko.height=e.height;const s=ko.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),i=ko}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=pc("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o1),this.pmremVersion=0}get width(){return this.source.getSize(Ep).x}get height(){return this.source.getSize(Ep).y}get depth(){return this.source.getSize(Ep).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}s&&i&&s.isVector2&&i.isVector2||s&&i&&s.isVector3&&i.isVector3||s&&i&&s.isMatrix3&&i.isMatrix3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==oh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ac:e.x=e.x-Math.floor(e.x);break;case gi:e.x=e.x<0?0:1;break;case lc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ac:e.y=e.y-Math.floor(e.y);break;case gi:e.y=e.y<0?0:1;break;case lc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}$t.DEFAULT_IMAGE=null;$t.DEFAULT_MAPPING=oh;$t.DEFAULT_ANISOTROPY=1;class vt{constructor(e=0,t=0,i=0,s=1){vt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const l=e.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],_=l[2],g=l[6],m=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-_)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+_)<.1&&Math.abs(p+g)<.1&&Math.abs(c+h+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(c+1)/2,y=(h+1)/2,T=(m+1)/2,w=(u+d)/4,S=(f+_)/4,P=(p+g)/4;return b>y&&b>T?b<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(b),s=w/i,r=S/i):y>T?y<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(y),i=w/s,r=P/s):T<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(T),i=S/r,s=P/r),this.set(i,s,r,t),this}let v=Math.sqrt((g-p)*(g-p)+(f-_)*(f-_)+(d-u)*(d-u));return Math.abs(v)<.001&&(v=1),this.x=(g-p)/v,this.y=(f-_)/v,this.z=(d-u)/v,this.w=Math.acos((c+h+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=st(this.x,e.x,t.x),this.y=st(this.y,e.y,t.y),this.z=st(this.z,e.z,t.z),this.w=st(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=st(this.x,e,t),this.y=st(this.y,e,t),this.z=st(this.z,e,t),this.w=st(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(st(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class s_ extends as{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:nn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new vt(0,0,e,t),this.scissorTest=!1,this.viewport=new vt(0,0,e,t);const s={width:e,height:t,depth:i.depth},r=new $t(s);this.textures=[];const o=i.count;for(let a=0;a1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Ai),Ai.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Qa),du.subVectors(this.max,Qa),Bo.subVectors(e.a,Qa),zo.subVectors(e.b,Qa),Vo.subVectors(e.c,Qa),Ks.subVectors(zo,Bo),Zs.subVectors(Vo,zo),Vr.subVectors(Bo,Vo);let t=[0,-Ks.z,Ks.y,0,-Zs.z,Zs.y,0,-Vr.z,Vr.y,Ks.z,0,-Ks.x,Zs.z,0,-Zs.x,Vr.z,0,-Vr.x,-Ks.y,Ks.x,0,-Zs.y,Zs.x,0,-Vr.y,Vr.x,0];return!Tp(t,Bo,zo,Vo,du)||(t=[1,0,0,0,1,0,0,0,1],!Tp(t,Bo,zo,Vo,du))?!1:(hu.crossVectors(Ks,Zs),t=[hu.x,hu.y,hu.z],Tp(t,Bo,zo,Vo,du))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ai).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ai).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(hs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),hs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),hs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),hs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),hs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),hs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),hs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),hs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(hs),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const hs=[new k,new k,new k,new k,new k,new k,new k,new k],Ai=new k,fu=new Cn,Bo=new k,zo=new k,Vo=new k,Ks=new k,Zs=new k,Vr=new k,Qa=new k,du=new k,hu=new k,Hr=new k;function Tp(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Hr.fromArray(n,r);const a=s.x*Math.abs(Hr.x)+s.y*Math.abs(Hr.y)+s.z*Math.abs(Hr.z),l=e.dot(Hr),c=t.dot(Hr),u=i.dot(Hr);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const yP=new Cn,el=new k,wp=new k;class bn{constructor(e=new k,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):yP.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;el.subVectors(e,this.center);const t=el.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(el,s/i),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(wp.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(el.copy(e.center).add(wp)),this.expandByPoint(el.copy(e.center).sub(wp))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const ps=new k,Ap=new k,pu=new k,Js=new k,Cp=new k,mu=new k,Rp=new k;class Ha{constructor(e=new k,t=new k(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ps)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ps.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ps.copy(this.origin).addScaledVector(this.direction,t),ps.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Ap.copy(e).add(t).multiplyScalar(.5),pu.copy(t).sub(e).normalize(),Js.copy(this.origin).sub(Ap);const r=e.distanceTo(t)*.5,o=-this.direction.dot(pu),a=Js.dot(this.direction),l=-Js.dot(pu),c=Js.lengthSq(),u=Math.abs(1-o*o);let f,d,h,p;if(u>0)if(f=o*l-a,d=o*a-l,p=r*u,f>=0)if(d>=-p)if(d<=p){const _=1/u;f*=_,d*=_,h=f*(f+o*d+2*a)+d*(o*f+d+2*l)+c}else d=r,f=Math.max(0,-(o*d+a)),h=-f*f+d*(d+2*l)+c;else d=-r,f=Math.max(0,-(o*d+a)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-o*r+a)),d=f>0?-r:Math.min(Math.max(-r,-l),r),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-r,-l),r),h=d*(d+2*l)+c):(f=Math.max(0,-(o*r+a)),d=f>0?r:Math.min(Math.max(-r,-l),r),h=-f*f+d*(d+2*l)+c);else d=o>0?-r:r,f=Math.max(0,-(o*d+a)),h=-f*f+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),s&&s.copy(Ap).addScaledVector(pu,d),h}intersectSphere(e,t){ps.subVectors(e.center,this.origin);const i=ps.dot(this.direction),s=ps.dot(ps)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,s=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,s=(e.min.x-d.x)*c),u>=0?(r=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(a=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,ps)!==null}intersectTriangle(e,t,i,s,r){Cp.subVectors(t,e),mu.subVectors(i,e),Rp.crossVectors(Cp,mu);let o=this.direction.dot(Rp),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Js.subVectors(this.origin,e);const l=a*this.direction.dot(mu.crossVectors(Js,mu));if(l<0)return null;const c=a*this.direction.dot(Cp.cross(Js));if(c<0||l+c>o)return null;const u=-a*Js.dot(Rp);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Je{constructor(e,t,i,s,r,o,a,l,c,u,f,d,h,p,_,g){Je.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c,u,f,d,h,p,_,g)}set(e,t,i,s,r,o,a,l,c,u,f,d,h,p,_,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=s,m[1]=r,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=f,m[14]=d,m[3]=h,m[7]=p,m[11]=_,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Je().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/Ho.setFromMatrixColumn(e,0).length(),r=1/Ho.setFromMatrixColumn(e,1).length(),o=1/Ho.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),f=Math.sin(r);if(e.order==="XYZ"){const d=o*u,h=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=-l*f,t[8]=c,t[1]=h+p*c,t[5]=d-_*c,t[9]=-a*l,t[2]=_-d*c,t[6]=p+h*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,_=c*f;t[0]=d+_*a,t[4]=p*a-h,t[8]=o*c,t[1]=o*f,t[5]=o*u,t[9]=-a,t[2]=h*a-p,t[6]=_+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,_=c*f;t[0]=d-_*a,t[4]=-o*f,t[8]=p+h*a,t[1]=h+p*a,t[5]=o*u,t[9]=_-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,h=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=p*c-h,t[8]=d*c+_,t[1]=l*f,t[5]=_*c+d,t[9]=h*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,h=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=_-d*f,t[8]=p*f+h,t[1]=f,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=h*f+p,t[10]=d-_*f}else if(e.order==="XZY"){const d=o*l,h=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=-f,t[8]=c*u,t[1]=d*f+_,t[5]=o*u,t[9]=h*f-p,t[2]=p*f-h,t[6]=a*u,t[10]=_*f+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(bP,e,xP)}lookAt(e,t,i){const s=this.elements;return ii.subVectors(e,t),ii.lengthSq()===0&&(ii.z=1),ii.normalize(),Qs.crossVectors(i,ii),Qs.lengthSq()===0&&(Math.abs(i.z)===1?ii.x+=1e-4:ii.z+=1e-4,ii.normalize(),Qs.crossVectors(i,ii)),Qs.normalize(),gu.crossVectors(ii,Qs),s[0]=Qs.x,s[4]=gu.x,s[8]=ii.x,s[1]=Qs.y,s[5]=gu.y,s[9]=ii.y,s[2]=Qs.z,s[6]=gu.z,s[10]=ii.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],f=i[5],d=i[9],h=i[13],p=i[2],_=i[6],g=i[10],m=i[14],v=i[3],b=i[7],y=i[11],T=i[15],w=s[0],S=s[4],P=s[8],M=s[12],E=s[1],D=s[5],B=s[9],z=s[13],V=s[2],Q=s[6],j=s[10],te=s[14],Z=s[3],pe=s[7],Me=s[11],re=s[15];return r[0]=o*w+a*E+l*V+c*Z,r[4]=o*S+a*D+l*Q+c*pe,r[8]=o*P+a*B+l*j+c*Me,r[12]=o*M+a*z+l*te+c*re,r[1]=u*w+f*E+d*V+h*Z,r[5]=u*S+f*D+d*Q+h*pe,r[9]=u*P+f*B+d*j+h*Me,r[13]=u*M+f*z+d*te+h*re,r[2]=p*w+_*E+g*V+m*Z,r[6]=p*S+_*D+g*Q+m*pe,r[10]=p*P+_*B+g*j+m*Me,r[14]=p*M+_*z+g*te+m*re,r[3]=v*w+b*E+y*V+T*Z,r[7]=v*S+b*D+y*Q+T*pe,r[11]=v*P+b*B+y*j+T*Me,r[15]=v*M+b*z+y*te+T*re,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],_=e[7],g=e[11],m=e[15];return p*(+r*l*f-s*c*f-r*a*d+i*c*d+s*a*h-i*l*h)+_*(+t*l*h-t*c*d+r*o*d-s*o*h+s*c*u-r*l*u)+g*(+t*c*f-t*a*h-r*o*f+i*o*h+r*a*u-i*c*u)+m*(-s*a*u-t*l*f+t*a*d+s*o*f-i*o*d+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],_=e[13],g=e[14],m=e[15],v=f*g*c-_*d*c+_*l*h-a*g*h-f*l*m+a*d*m,b=p*d*c-u*g*c-p*l*h+o*g*h+u*l*m-o*d*m,y=u*_*c-p*f*c+p*a*h-o*_*h-u*a*m+o*f*m,T=p*f*l-u*_*l-p*a*d+o*_*d+u*a*g-o*f*g,w=t*v+i*b+s*y+r*T;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/w;return e[0]=v*S,e[1]=(_*d*r-f*g*r-_*s*h+i*g*h+f*s*m-i*d*m)*S,e[2]=(a*g*r-_*l*r+_*s*c-i*g*c-a*s*m+i*l*m)*S,e[3]=(f*l*r-a*d*r-f*s*c+i*d*c+a*s*h-i*l*h)*S,e[4]=b*S,e[5]=(u*g*r-p*d*r+p*s*h-t*g*h-u*s*m+t*d*m)*S,e[6]=(p*l*r-o*g*r-p*s*c+t*g*c+o*s*m-t*l*m)*S,e[7]=(o*d*r-u*l*r+u*s*c-t*d*c-o*s*h+t*l*h)*S,e[8]=y*S,e[9]=(p*f*r-u*_*r-p*i*h+t*_*h+u*i*m-t*f*m)*S,e[10]=(o*_*r-p*a*r+p*i*c-t*_*c-o*i*m+t*a*m)*S,e[11]=(u*a*r-o*f*r-u*i*c+t*f*c+o*i*h-t*a*h)*S,e[12]=T*S,e[13]=(u*_*s-p*f*s+p*i*d-t*_*d-u*i*g+t*f*g)*S,e[14]=(p*a*s-o*_*s-p*i*l+t*_*l+o*i*g-t*a*g)*S,e[15]=(o*f*s-u*a*s+u*i*l-t*f*l-o*i*d+t*a*d)*S,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,c=r*o,u=r*a;return this.set(c*o+i,c*a-s*l,c*l+s*a,0,c*a+s*l,u*a+i,u*l-s*o,0,c*l-s*a,u*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,c=r+r,u=o+o,f=a+a,d=r*c,h=r*u,p=r*f,_=o*u,g=o*f,m=a*f,v=l*c,b=l*u,y=l*f,T=i.x,w=i.y,S=i.z;return s[0]=(1-(_+m))*T,s[1]=(h+y)*T,s[2]=(p-b)*T,s[3]=0,s[4]=(h-y)*w,s[5]=(1-(d+m))*w,s[6]=(g+v)*w,s[7]=0,s[8]=(p+b)*S,s[9]=(g-v)*S,s[10]=(1-(d+_))*S,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=Ho.set(s[0],s[1],s[2]).length();const o=Ho.set(s[4],s[5],s[6]).length(),a=Ho.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],Ci.copy(this);const c=1/r,u=1/o,f=1/a;return Ci.elements[0]*=c,Ci.elements[1]*=c,Ci.elements[2]*=c,Ci.elements[4]*=u,Ci.elements[5]*=u,Ci.elements[6]*=u,Ci.elements[8]*=f,Ci.elements[9]*=f,Ci.elements[10]*=f,t.setFromRotationMatrix(Ci),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=_i){const l=this.elements,c=2*r/(t-e),u=2*r/(i-s),f=(t+e)/(t-e),d=(i+s)/(i-s);let h,p;if(a===_i)h=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===hc)h=-o/(o-r),p=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=h,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,s,r,o,a=_i){const l=this.elements,c=1/(t-e),u=1/(i-s),f=1/(o-r),d=(t+e)*c,h=(i+s)*u;let p,_;if(a===_i)p=(o+r)*f,_=-2*f;else if(a===hc)p=r*f,_=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-h,l[2]=0,l[6]=0,l[10]=_,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Ho=new k,Ci=new Je,bP=new k(0,0,0),xP=new k(1,1,1),Qs=new k,gu=new k,ii=new k,_y=new Je,vy=new Qn;class li{constructor(e=0,t=0,i=0,s=li.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],u=s[9],f=s[2],d=s[6],h=s[10];switch(t){case"XYZ":this._y=Math.asin(st(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-st(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,r),this._z=0);break;case"ZXY":this._x=Math.asin(st(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-st(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(st(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,r)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-st(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return _y.makeRotationFromQuaternion(e),this.setFromRotationMatrix(_y,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return vy.setFromEuler(this),this.setFromQuaternion(vy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}li.DEFAULT_ORDER="XYZ";class Bc{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(a=>({...a})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(e),s.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(s.boundingBox=this.boundingBox.toJSON()));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),d.length>0&&(i.skeletons=d),h.length>0&&(i.animations=h),p.length>0&&(i.nodes=p)}return i.object=s,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){Ri.subVectors(s,t),gs.subVectors(i,t),Ip.subVectors(e,t);const o=Ri.dot(Ri),a=Ri.dot(gs),l=Ri.dot(Ip),c=gs.dot(gs),u=gs.dot(Ip),f=o*c-a*a;if(f===0)return r.set(0,0,0),null;const d=1/f,h=(c*l-a*u)*d,p=(o*u-a*l)*d;return r.set(1-h-p,p,h)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,_s)===null?!1:_s.x>=0&&_s.y>=0&&_s.x+_s.y<=1}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,_s)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,_s.x),l.addScaledVector(o,_s.y),l.addScaledVector(a,_s.z),l)}static getInterpolatedAttribute(e,t,i,s,r,o){return Np.setScalar(0),Up.setScalar(0),Fp.setScalar(0),Np.fromBufferAttribute(e,t),Up.fromBufferAttribute(e,i),Fp.fromBufferAttribute(e,s),o.setScalar(0),o.addScaledVector(Np,r.x),o.addScaledVector(Up,r.y),o.addScaledVector(Fp,r.z),o}static isFrontFacing(e,t,i,s){return Ri.subVectors(i,t),gs.subVectors(e,t),Ri.cross(gs).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ri.subVectors(this.c,this.b),gs.subVectors(this.a,this.b),Ri.cross(gs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Kn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Kn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,s,r){return Kn.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return Kn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Kn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;Xo.subVectors(s,i),$o.subVectors(r,i),Lp.subVectors(e,i);const l=Xo.dot(Lp),c=$o.dot(Lp);if(l<=0&&c<=0)return t.copy(i);Dp.subVectors(e,s);const u=Xo.dot(Dp),f=$o.dot(Dp);if(u>=0&&f<=u)return t.copy(s);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Xo,o);Op.subVectors(e,r);const h=Xo.dot(Op),p=$o.dot(Op);if(p>=0&&h<=p)return t.copy(r);const _=h*c-l*p;if(_<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(i).addScaledVector($o,a);const g=u*p-h*f;if(g<=0&&f-u>=0&&h-p>=0)return Ey.subVectors(r,s),a=(f-u)/(f-u+(h-p)),t.copy(s).addScaledVector(Ey,a);const m=1/(g+_+d);return o=_*m,a=d*m,t.copy(i).addScaledVector(Xo,o).addScaledVector($o,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const lE={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},er={h:0,s:0,l:0},vu={h:0,s:0,l:0};function kp(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Pe{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Fn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,pt.colorSpaceToWorking(this,t),this}setRGB(e,t,i,s=pt.workingColorSpace){return this.r=e,this.g=t,this.b=i,pt.colorSpaceToWorking(this,s),this}setHSL(e,t,i,s=pt.workingColorSpace){if(e=n_(e,1),t=st(t,0,1),i=st(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=kp(o,r,e+1/3),this.g=kp(o,r,e),this.b=kp(o,r,e-1/3)}return pt.colorSpaceToWorking(this,s),this}setStyle(e,t=Fn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Fn){const i=lE[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Os(e.r),this.g=Os(e.g),this.b=Os(e.b),this}copyLinearToSRGB(e){return this.r=_a(e.r),this.g=_a(e.g),this.b=_a(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Fn){return pt.workingToColorSpace(Sn.copy(this),e),Math.round(st(Sn.r*255,0,255))*65536+Math.round(st(Sn.g*255,0,255))*256+Math.round(st(Sn.b*255,0,255))}getHexString(e=Fn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=pt.workingColorSpace){pt.workingToColorSpace(Sn.copy(this),t);const i=Sn.r,s=Sn.g,r=Sn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=u<=.5?f/(o+a):f/(2-o-a),o){case i:l=(s-r)/f+(s0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==_o&&(i.blending=this.blending),this.side!==Bs&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Gf&&(i.blendSrc=this.blendSrc),this.blendDst!==Wf&&(i.blendDst=this.blendDst),this.blendEquation!==dr&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==So&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==vg&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==so&&(i.stencilFail=this.stencilFail),this.stencilZFail!==so&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==so&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Xs extends Pn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Pe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Fc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const As=AP();function AP(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),s=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,s[l]=24,s[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,s[l]=-c-1,s[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,s[l]=13,s[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,r[l]=c|u}for(let l=1024;l<2048;++l)r[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:r,exponentTable:o,offsetTable:a}}function qn(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=st(n,-65504,65504),As.floatView[0]=n;const e=As.uint32View[0],t=e>>23&511;return As.baseTable[t]+((e&8388607)>>As.shiftTable[t])}function vl(n){const e=n>>10;return As.uint32View[0]=As.mantissaTable[As.offsetTable[e]+(n&1023)]+As.exponentTable[e],As.floatView[0]}class CP{static toHalfFloat(e){return qn(e)}static fromHalfFloat(e){return vl(e)}}const Kt=new k,yu=new fe;let RP=0;class It{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:RP++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=dc,this.updateRanges=[],this.gpuType=Zn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;st.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Cn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new k(-1/0,-1/0,-1/0),new k(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,s=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f0&&(s[l]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const s=e.attributes;for(const c in s){const u=s[c];this.setAttribute(c,u.clone(t))}const r=e.morphAttributes;for(const c in r){const u=[],f=r[c];for(let d=0,h=f.length;d0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(Ty.copy(r).invert(),Gr.copy(e.ray).applyMatrix4(Ty),!(i.boundingBox!==null&&Gr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Gr)))}_computeIntersections(e,t,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,f=r.attributes.normal,d=r.groups,h=r.drawRange;if(a!==null)if(Array.isArray(o))for(let p=0,_=d.length;p<_;p++){const g=d[p],m=o[g.materialIndex],v=Math.max(g.start,h.start),b=Math.min(a.count,Math.min(g.start+g.count,h.start+h.count));for(let y=v,T=b;yt.far?null:{distance:c,point:Tu.clone(),object:n}}function wu(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,xu),n.getVertexPosition(l,Mu),n.getVertexPosition(c,Su);const u=FP(n,e,t,i,xu,Mu,Su,Ay);if(u){const f=new k;Kn.getBarycoord(Ay,xu,Mu,Su,f),s&&(u.uv=Kn.getInterpolatedAttribute(s,a,l,c,f,new fe)),r&&(u.uv1=Kn.getInterpolatedAttribute(r,a,l,c,f,new fe)),o&&(u.normal=Kn.getInterpolatedAttribute(o,a,l,c,f,new k),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new k,materialIndex:0};Kn.getNormal(xu,Mu,Su,d.normal),u.face=d,u.barycoord=f}return u}class Ro extends ct{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],u=[],f=[];let d=0,h=0;p("z","y","x",-1,-1,i,t,e,o,r,0),p("z","y","x",1,-1,i,t,-e,o,r,1),p("x","z","y",1,1,e,i,t,s,o,2),p("x","z","y",1,-1,e,i,-t,s,o,3),p("x","y","z",1,-1,e,t,i,s,r,4),p("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new ke(c,3)),this.setAttribute("normal",new ke(u,3)),this.setAttribute("uv",new ke(f,2));function p(_,g,m,v,b,y,T,w,S,P,M){const E=y/S,D=T/P,B=y/2,z=T/2,V=w/2,Q=S+1,j=P+1;let te=0,Z=0;const pe=new k;for(let Me=0;Me0?1:-1,u.push(pe.x,pe.y,pe.z),f.push(xe/S),f.push(1-Me/P),te+=1}}for(let Me=0;Me0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class zc extends gt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Je,this.projectionMatrix=new Je,this.projectionMatrixInverse=new Je,this.coordinateSystem=_i}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const tr=new k,Cy=new fe,Ry=new fe;class Jt extends zc{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ca*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(vo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ca*2*Math.atan(Math.tan(vo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){tr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(tr.x,tr.y).multiplyScalar(-e/tr.z),tr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(tr.x,tr.y).multiplyScalar(-e/tr.z)}getViewSize(e,t){return this.getViewBounds(e,Cy,Ry),t.subVectors(Ry,Cy)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(vo*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Yo=-90,jo=1;class fE extends gt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Jt(Yo,jo,e,t);s.layers=this.layers,this.add(s);const r=new Jt(Yo,jo,e,t);r.layers=this.layers,this.add(r);const o=new Jt(Yo,jo,e,t);o.layers=this.layers,this.add(o);const a=new Jt(Yo,jo,e,t);a.layers=this.layers,this.add(a);const l=new Jt(Yo,jo,e,t);l.layers=this.layers,this.add(l);const c=new Jt(Yo,jo,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,s,r,o,a,l]=t;for(const c of t)this.remove(c);if(e===_i)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===hc)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,u]=this.children,f=e.getRenderTarget(),d=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(t,r),e.setRenderTarget(i,1,s),e.render(t,o),e.setRenderTarget(i,2,s),e.render(t,a),e.setRenderTarget(i,3,s),e.render(t,l),e.setRenderTarget(i,4,s),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,s),e.render(t,u),e.setRenderTarget(f,d,h),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class Vc extends $t{constructor(e=[],t=zs,i,s,r,o,a,l,c,u){super(e,t,i,s,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class dE extends os{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];this.texture=new Vc(s),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},s=new Ro(5,5,5),r=new Vi({name:"CubemapFromEquirect",uniforms:Ra(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Vn,blending:Ds});r.uniforms.tEquirect.value=t;const o=new jt(s,r),a=t.minFilter;return t.minFilter===es&&(t.minFilter=nn),new fE(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,i=!0,s=!0){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}class ca extends gt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const VP={type:"move"};class Sf{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ca,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ca,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new k,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new k),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ca,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new k,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new k),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,i),m=this._getHandJoint(c,_);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(VP)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new ca;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class gh{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Pe(e),this.density=t}clone(){return new gh(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class _h{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Pe(e),this.near=t,this.far=i}clone(){return new _h(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class vh extends gt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new li,this.environmentIntensity=1,this.environmentRotation=new li,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class yh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=dc,this.updateRanges=[],this.version=0,this.uuid=oi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;se.far||t.push({distance:l,point:il.clone(),uv:Kn.getInterpolation(il,Au,rl,Cu,Py,Vp,Iy,new fe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Ru(n,e,t,i,s,r){Qo.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(sl.x=r*Qo.x-s*Qo.y,sl.y=s*Qo.x+r*Qo.y):sl.copy(Qo),n.copy(e),n.x+=sl.x,n.y+=sl.y,n.applyMatrix4(hE)}const Pu=new k,Ly=new k;class mE extends gt{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,s=t.length;i0){let i,s;for(i=1,s=t.length;i0){Pu.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(Pu);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Pu.setFromMatrixPosition(e.matrixWorld),Ly.setFromMatrixPosition(this.matrixWorld);const i=Pu.distanceTo(Ly)/e.zoom;t[0].object.visible=!0;let s,r;for(s=1,r=t.length;s=o)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;s1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||$P.getNormalMatrix(e),s=this.coplanarPoint(Wp).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Wr=new bn,Du=new k;class Ga{constructor(e=new ur,t=new ur,i=new ur,s=new ur,r=new ur,o=new ur){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=_i){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],u=s[5],f=s[6],d=s[7],h=s[8],p=s[9],_=s[10],g=s[11],m=s[12],v=s[13],b=s[14],y=s[15];if(i[0].setComponents(l-r,d-c,g-h,y-m).normalize(),i[1].setComponents(l+r,d+c,g+h,y+m).normalize(),i[2].setComponents(l+o,d+u,g+p,y+v).normalize(),i[3].setComponents(l-o,d-u,g-p,y-v).normalize(),i[4].setComponents(l-a,d-f,g-_,y-b).normalize(),t===_i)i[5].setComponents(l+a,d+f,g+_,y+b).normalize();else if(t===hc)i[5].setComponents(a,f,_,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Wr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Wr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Wr)}intersectsSprite(e){return Wr.center.set(0,0,0),Wr.radius=.7071067811865476,Wr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Wr)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,Du.y=s.normal.y>0?e.max.y:e.min.y,Du.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(Du)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const $i=new Je,qi=new Ga;class xh{constructor(){this.coordinateSystem=_i}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const a=r[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=i,a.index=s}reset(){this.list.length=0,this.index=0}}const $n=new Je,KP=new Pe(1,1,1),Vy=new Ga,ZP=new xh,Ou=new Cn,Xr=new bn,ll=new k,Hy=new k,JP=new k,$p=new jP,En=new jt,Nu=[];function QP(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const s=n.count;for(let r=0;r65535?new Uint32Array(s):new Uint16Array(s);t.setIndex(new It(r,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const s=e.getAttribute(i),r=t.getAttribute(i);if(s.itemSize!==r.itemSize||s.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Cn);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,s=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Xp),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;$n.identity().toArray(r.image.data,s*16),r.needsUpdate=!0;const o=this._colorsTexture;return o&&(KP.toArray(o.image.data,s*4),o.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const o=e.getIndex();if(o!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=i===-1?o.count:i),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Xp),l=this._availableGeometryIds.shift(),r[l]=s):(l=this._geometryCount,this._geometryCount++,r.push(s)),this.setGeometryAt(l,e),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,s=i.getIndex()!==null,r=i.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(s&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const u in i.attributes){const f=t.getAttribute(u),d=i.getAttribute(u);QP(f,d,l);const h=f.itemSize;for(let p=f.count,_=c;p<_;p++){const g=l+p;for(let m=0;m=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let s=0,r=i.length;sa).sort((o,a)=>i[o].vertexStart-i[a].vertexStart),r=this.geometry;for(let o=0,a=i.length;o=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingBox===null){const r=new Cn,o=i.index,a=i.attributes.position;for(let l=s.start,c=s.start+s.count;l=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingSphere===null){const r=new bn;this.getBoundingBoxAt(e,Ou),Ou.getCenter(r.center);const o=i.index,a=i.attributes.position;let l=0;for(let c=s.start,u=s.start+s.count;ca.active);if(Math.max(...i.map(a=>a.vertexStart+a.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new ct,this._initializeGeometry(r));const o=this.geometry;r.index&&$r(r.index.array,o.index.array);for(const a in r.attributes)$r(r.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,o=this.geometry;En.material=this.material,En.geometry.index=o.index,En.geometry.attributes=o.attributes,En.geometry.boundingBox===null&&(En.geometry.boundingBox=new Cn),En.geometry.boundingSphere===null&&(En.geometry.boundingSphere=new bn);for(let a=0,l=i.length;a({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,s,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=s.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._geometryInfo,d=this.perObjectFrustumCulled,h=this._indirectTexture,p=h.image.data,_=i.isArrayCamera?ZP:Vy;d&&!i.isArrayCamera&&($n.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),Vy.setFromProjectionMatrix($n,e.coordinateSystem));let g=0;if(this.sortObjects){$n.copy(this.matrixWorld).invert(),ll.setFromMatrixPosition(i.matrixWorld).applyMatrix4($n),Hy.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection($n);for(let b=0,y=l.length;b0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;ri)return;qp.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(qp);if(!(ce.far))return{distance:c,point:Wy.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const Xy=new k,$y=new k;class ls extends Sr{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let s=0,r=t.count;s0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class xE extends $t{constructor(e,t,i,s,r=nn,o=nn,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isVideoTexture=!0,this.generateMipmaps=!1;const u=this;function f(){u.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class eI extends xE{constructor(e,t,i,s,r,o,a,l){super({},e,t,i,s,r,o,a,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class tI extends $t{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=yn,this.minFilter=yn,this.generateMipmaps=!1,this.needsUpdate=!0}}class Mh extends $t{constructor(e,t,i,s,r,o,a,l,c,u,f,d){super(null,o,a,l,c,u,s,r,f,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class nI extends Mh{constructor(e,t,i,s,r,o){super(e,t,i,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=gi,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class iI extends Mh{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,zs),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class sI extends $t{constructor(e,t,i,s,r,o,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class u_ extends $t{constructor(e,t,i=Vs,s,r,o,a=yn,l=yn,c,u=wa,f=1){if(u!==wa&&u!==Aa)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const d={width:e,height:t,depth:f};super(d,s,r,o,a,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new hr(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Sh extends ct{constructor(e=1,t=1,i=4,s=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:s,heightSegments:r},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),s=Math.max(3,Math.floor(s)),r=Math.max(1,Math.floor(r));const o=[],a=[],l=[],c=[],u=t/2,f=Math.PI/2*e,d=t,h=2*f+d,p=i*2+r,_=s+1,g=new k,m=new k;for(let v=0;v<=p;v++){let b=0,y=0,T=0,w=0;if(v<=i){const M=v/i,E=M*Math.PI/2;y=-u-e*Math.cos(E),T=e*Math.sin(E),w=-e*Math.cos(E),b=M*f}else if(v<=i+r){const M=(v-i)/r;y=-u+M*t,T=e,w=0,b=f+M*d}else{const M=(v-i-r)/i,E=M*Math.PI/2;y=u+e*Math.sin(E),T=e*Math.cos(E),w=e*Math.sin(E),b=f+d+M*f}const S=Math.max(0,Math.min(1,b/h));let P=0;v===0?P=.5/s:v===p&&(P=-.5/s);for(let M=0;M<=s;M++){const E=M/s,D=E*Math.PI*2,B=Math.sin(D),z=Math.cos(D);m.x=-T*z,m.y=y,m.z=T*B,a.push(m.x,m.y,m.z),g.set(-T*z,w,T*B),g.normalize(),l.push(g.x,g.y,g.z),c.push(E+P,S)}if(v>0){const M=(v-1)*_;for(let E=0;E0&&b(!0),t>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new ke(f,3)),this.setAttribute("normal",new ke(d,3)),this.setAttribute("uv",new ke(h,2));function v(){const y=new k,T=new k;let w=0;const S=(t-e)/i;for(let P=0;P<=r;P++){const M=[],E=P/r,D=E*(t-e)+e;for(let B=0;B<=s;B++){const z=B/s,V=z*l+a,Q=Math.sin(V),j=Math.cos(V);T.x=D*Q,T.y=-E*i+g,T.z=D*j,f.push(T.x,T.y,T.z),y.set(Q,S,j).normalize(),d.push(y.x,y.y,y.z),h.push(z,1-E),M.push(p++)}_.push(M)}for(let P=0;P0||M!==0)&&(u.push(E,D,z),w+=3),(t>0||M!==r-1)&&(u.push(D,B,z),w+=3)}c.addGroup(m,w,0),m+=w}function b(y){const T=p,w=new fe,S=new k;let P=0;const M=y===!0?e:t,E=y===!0?1:-1;for(let B=1;B<=s;B++)f.push(0,g*E,0),d.push(0,E,0),h.push(.5,.5),p++;const D=p;for(let B=0;B<=s;B++){const V=B/s*l+a,Q=Math.cos(V),j=Math.sin(V);S.x=M*j,S.y=g*E,S.z=M*Q,f.push(S.x,S.y,S.z),d.push(0,E,0),w.x=Q*.5+.5,w.y=j*.5*E+.5,h.push(w.x,w.y),p++}for(let B=0;B.9&&S<.1&&(b<.2&&(o[v+0]+=1),y<.2&&(o[v+2]+=1),T<.2&&(o[v+4]+=1))}}function d(v){r.push(v.x,v.y,v.z)}function h(v,b){const y=v*3;b.x=e[y+0],b.y=e[y+1],b.z=e[y+2]}function p(){const v=new k,b=new k,y=new k,T=new k,w=new fe,S=new fe,P=new fe;for(let M=0,E=0;M0)l=s-1;else{l=s;break}if(s=l,i[s]===o)return s/(r-1);const u=i[s],d=i[s+1]-u,h=(o-u)/d;return(s+h)/(r-1)}getTangent(e,t){let s=e-1e-4,r=e+1e-4;s<0&&(s=0),r>1&&(r=1);const o=this.getPoint(s),a=this.getPoint(r),l=t||(o.isVector2?new fe:new k);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new k,s=[],r=[],o=[],a=new k,l=new Je;for(let h=0;h<=e;h++){const p=h/e;s[h]=this.getTangentAt(p,new k)}r[0]=new k,o[0]=new k;let c=Number.MAX_VALUE;const u=Math.abs(s[0].x),f=Math.abs(s[0].y),d=Math.abs(s[0].z);u<=c&&(c=u,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],a),o[0].crossVectors(s[0],r[0]);for(let h=1;h<=e;h++){if(r[h]=r[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(s[h-1],s[h]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(st(s[h-1].dot(s[h]),-1,1));r[h].applyMatrix4(l.makeRotationAxis(a,p))}o[h].crossVectors(s[h],r[h])}if(t===!0){let h=Math.acos(st(r[0].dot(r[e]),-1,1));h/=e,s[0].dot(a.crossVectors(r[0],r[e]))>0&&(h=-h);for(let p=1;p<=e;p++)r[p].applyMatrix4(l.makeRotationAxis(s[p],h*p)),o[p].crossVectors(s[p],r[p])}return{tangents:s,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class wh extends Wi{constructor(e=0,t=0,i=1,s=1,r=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new fe){const i=t,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)s;)r-=s;r0?0:(Math.floor(Math.abs(a)/r)+1)*r:l===0&&a===r-1&&(a=r-2,l=1);let c,u;this.closed||a>0?c=s[(a-1)%r]:(Gu.subVectors(s[0],s[1]).add(s[0]),c=Gu);const f=s[a%r],d=s[(a+1)%r];if(this.closed||a+2s.length-2?s.length-1:o+1],f=s[o>s.length-3?s.length-1:o+2];return i.set(jy(a,l.x,c.x,u.x,f.x),jy(a,l.y,c.y,u.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=s[r]-i,a=this.curves[r],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,s=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class yo extends Cd{constructor(e){super(e),this.uuid=oi(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,s=this.holes.length;i80*t){a=1/0,l=1/0;let u=-1/0,f=-1/0;for(let d=t;du&&(u=h),p>f&&(f=p)}c=Math.max(u-a,f-l),c=c!==0?32767/c:0}return mc(r,o,t,a,l,c,0),o}function CE(n,e,t,i,s){let r;if(s===CI(n,e,t,i)>0)for(let o=e;o=e;o-=i)r=Ky(o/i|0,n[o],n[o+1],r);return r&&Ia(r,r.next)&&(_c(r),r=r.next),r}function wo(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Ia(t,t.next)||Gt(t.prev,t,t.next)===0)){if(_c(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function mc(n,e,t,i,s,r,o){if(!n)return;!o&&r&&MI(n,i,s,r);let a=n;for(;n.prev!==n.next;){const l=n.prev,c=n.next;if(r?pI(n,i,s,r):hI(n)){e.push(l.i,n.i,c.i),_c(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=mI(wo(n),e),mc(n,e,t,i,s,r,2)):o===2&&gI(n,e,t,i,s,r):mc(wo(n),e,t,i,s,r,1);break}}}function hI(n){const e=n.prev,t=n,i=n.next;if(Gt(e,t,i)>=0)return!1;const s=e.x,r=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=Math.min(s,r,o),f=Math.min(a,l,c),d=Math.max(s,r,o),h=Math.max(a,l,c);let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=f&&p.y<=h&&yl(s,a,r,l,o,c,p.x,p.y)&&Gt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function pI(n,e,t,i){const s=n.prev,r=n,o=n.next;if(Gt(s,r,o)>=0)return!1;const a=s.x,l=r.x,c=o.x,u=s.y,f=r.y,d=o.y,h=Math.min(a,l,c),p=Math.min(u,f,d),_=Math.max(a,l,c),g=Math.max(u,f,d),m=xg(h,p,e,t,i),v=xg(_,g,e,t,i);let b=n.prevZ,y=n.nextZ;for(;b&&b.z>=m&&y&&y.z<=v;){if(b.x>=h&&b.x<=_&&b.y>=p&&b.y<=g&&b!==s&&b!==o&&yl(a,u,l,f,c,d,b.x,b.y)&&Gt(b.prev,b,b.next)>=0||(b=b.prevZ,y.x>=h&&y.x<=_&&y.y>=p&&y.y<=g&&y!==s&&y!==o&&yl(a,u,l,f,c,d,y.x,y.y)&&Gt(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;b&&b.z>=m;){if(b.x>=h&&b.x<=_&&b.y>=p&&b.y<=g&&b!==s&&b!==o&&yl(a,u,l,f,c,d,b.x,b.y)&&Gt(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;y&&y.z<=v;){if(y.x>=h&&y.x<=_&&y.y>=p&&y.y<=g&&y!==s&&y!==o&&yl(a,u,l,f,c,d,y.x,y.y)&&Gt(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function mI(n,e){let t=n;do{const i=t.prev,s=t.next.next;!Ia(i,s)&&PE(i,t,t.next,s)&&gc(i,s)&&gc(s,i)&&(e.push(i.i,t.i,s.i),_c(t),_c(t.next),t=n=s),t=t.next}while(t!==n);return wo(t)}function gI(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&TI(o,a)){let l=IE(o,a);o=wo(o,o.next),l=wo(l,l.next),mc(o,e,t,i,s,r,0),mc(l,e,t,i,s,r,0);return}a=a.next}o=o.next}while(o!==n)}function _I(n,e,t,i){const s=[];for(let r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){const f=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=i&&f>r&&(r=f,o=t.x=t.x&&t.x>=l&&i!==t.x&&RE(so.x||t.x===o.x&&xI(o,t)))&&(o=t,u=f)}t=t.next}while(t!==a);return o}function xI(n,e){return Gt(n.prev,n,e.prev)<0&&Gt(e.next,n,n.next)<0}function MI(n,e,t,i){let s=n;do s.z===0&&(s.z=xg(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,SI(s)}function SI(n){let e,t=1;do{let i=n,s;n=null;let r=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;i=o}r.nextZ=null,t*=2}while(e>1);return n}function xg(n,e,t,i,s){return n=(n-t)*s|0,e=(e-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function EI(n){let e=n,t=n;do(e.x=(n-o)*(r-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(r-a)>=(s-o)*(i-a)}function yl(n,e,t,i,s,r,o,a){return!(n===o&&e===a)&&RE(n,e,t,i,s,r,o,a)}function TI(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!wI(n,e)&&(gc(n,e)&&gc(e,n)&&AI(n,e)&&(Gt(n.prev,n,e.prev)||Gt(n,e.prev,e))||Ia(n,e)&&Gt(n.prev,n,n.next)>0&&Gt(e.prev,e,e.next)>0)}function Gt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ia(n,e){return n.x===e.x&&n.y===e.y}function PE(n,e,t,i){const s=Xu(Gt(n,e,t)),r=Xu(Gt(n,e,i)),o=Xu(Gt(t,i,n)),a=Xu(Gt(t,i,e));return!!(s!==r&&o!==a||s===0&&Wu(n,t,e)||r===0&&Wu(n,i,e)||o===0&&Wu(t,n,i)||a===0&&Wu(t,e,i))}function Wu(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Xu(n){return n>0?1:n<0?-1:0}function wI(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&PE(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function gc(n,e){return Gt(n.prev,n,n.next)<0?Gt(n,e,n.next)>=0&&Gt(n,n.prev,e)>=0:Gt(n,e,n.prev)<0||Gt(n,n.next,e)<0}function AI(n,e){let t=n,i=!1;const s=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function IE(n,e){const t=Mg(n.i,n.x,n.y),i=Mg(e.i,e.x,e.y),s=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function Ky(n,e,t,i){const s=Mg(n,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function _c(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Mg(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function CI(n,e,t,i){let s=0;for(let r=e,o=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function Jy(n,e){for(let t=0;tNumber.EPSILON){const Y=Math.sqrt(x),ne=Math.sqrt(ce*ce+R*R),ee=W.x-H/Y,Te=W.y+F/Y,me=G.x-R/ne,Re=G.y+ce/ne,De=((me-ee)*R-(Re-Te)*ce)/(F*R-H*ce);X=ee+F*De-A.x,C=Te+H*De-A.y;const he=X*X+C*C;if(he<=2)return new fe(X,C);I=Math.sqrt(he/2)}else{let Y=!1;F>Number.EPSILON?ce>Number.EPSILON&&(Y=!0):F<-Number.EPSILON?ce<-Number.EPSILON&&(Y=!0):Math.sign(H)===Math.sign(R)&&(Y=!0),Y?(X=-H,C=F,I=Math.sqrt(x)):(X=F,C=H,I=Math.sqrt(x/2))}return new fe(X/I,C/I)}const pe=[];for(let A=0,W=Q.length,G=W-1,X=A+1;A=0;A--){const W=A/g,G=h*Math.cos(W*Math.PI/2),X=p*Math.sin(W*Math.PI/2)+_;for(let C=0,I=Q.length;C=0;){const X=G;let C=G-1;C<0&&(C=A.length-1);for(let I=0,F=u+g*2;I0)&&h.push(b,y,w),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class UE extends Pn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Pe(16777215),this.specular=new Pe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Fc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class FE extends Pn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Pe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class kE extends Pn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class BE extends Pn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Pe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Fc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class v_ extends Pn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=j1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class y_ extends Pn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class zE extends Pn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Pe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class VE extends Wn{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function ho(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function HE(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function GE(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function Sg(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function b_(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push(...o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}function DI(n,e,t,i,s=30){const r=n.clone();r.name=e;const o=[];for(let l=0;l=i)){f.push(c.times[h]);for(let _=0;_r.tracks[l].times[0]&&(a=r.tracks[l].times[0]);for(let l=0;l=a.times[p]){const m=p*f+u,v=m+f-u;_=a.values.slice(m,v)}else{const m=a.createInterpolant(),v=u,b=f-u;m.evaluate(r),_=m.resultBuffer.slice(v,b)}l==="quaternion"&&new Qn().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let m=0;m=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=i.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&HE(s))for(let a=0,l=s.length;a!==l;++a){const c=s[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===Mf,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}Ei.prototype.ValueTypeName="";Ei.prototype.TimeBufferType=Float32Array;Ei.prototype.ValueBufferType=Float32Array;Ei.prototype.DefaultInterpolation=Ed;class Po extends Ei{constructor(e,t,i){super(e,t,i)}}Po.prototype.ValueTypeName="bool";Po.prototype.ValueBufferType=Array;Po.prototype.DefaultInterpolation=cc;Po.prototype.InterpolantFactoryMethodLinear=void 0;Po.prototype.InterpolantFactoryMethodSmooth=void 0;class M_ extends Ei{constructor(e,t,i,s){super(e,t,i,s)}}M_.prototype.ValueTypeName="color";class vc extends Ei{constructor(e,t,i,s){super(e,t,i,s)}}vc.prototype.ValueTypeName="number";class $E extends $c{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let c=e*a;for(let u=c+a;c!==u;c+=4)Qn.slerpFlat(r,0,o,c-a,o,c,l);return r}}class qc extends Ei{constructor(e,t,i,s){super(e,t,i,s)}InterpolantFactoryMethodLinear(e){return new $E(this.times,this.values,this.getValueSize(),e)}}qc.prototype.ValueTypeName="quaternion";qc.prototype.InterpolantFactoryMethodSmooth=void 0;class Io extends Ei{constructor(e,t,i){super(e,t,i)}}Io.prototype.ValueTypeName="string";Io.prototype.ValueBufferType=Array;Io.prototype.DefaultInterpolation=cc;Io.prototype.InterpolantFactoryMethodLinear=void 0;Io.prototype.InterpolantFactoryMethodSmooth=void 0;class yc extends Ei{constructor(e,t,i,s){super(e,t,i,s)}}yc.prototype.ValueTypeName="vector";class bc{constructor(e="",t=-1,i=[],s=hh){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=oi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(FI(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(Ei.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const f=u[1];let d=s[f];d||(s[f]=d=[]),d.push(c)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,d,h,p,_){if(h.length!==0){const g=[],m=[];b_(h,g,m,p),g.length!==0&&_.push(new f(d,g,m))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{t&&t(r),this.manager.itemEnd(e)},0),r;if(vs[e]!==void 0){vs[e].push({onLoad:t,onProgress:i,onError:s});return}vs[e]=[],vs[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=vs[e],f=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let _=0;const g=new ReadableStream({start(m){v();function v(){f.read().then(({done:b,value:y})=>{if(b)m.close();else{_+=y.byteLength;const T=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:h});for(let w=0,S=u.length;w{m.error(b)})}}});return new Response(g)}else throw new kI(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a==="")return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{Rs.add(e,c);const u=vs[e];delete vs[e];for(let f=0,d=u.length;f{const u=vs[e];if(u===void 0)throw this.manager.itemError(e),c;delete vs[e];for(let f=0,d=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class BI extends ti{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Hs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t=[];for(let i=0;i0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const o=e.uniforms[r];switch(s.uniforms[r]={},o.type){case"t":s.uniforms[r].value=i(o.value);break;case"c":s.uniforms[r].value=new Pe().setHex(o.value);break;case"v2":s.uniforms[r].value=new fe().fromArray(o.value);break;case"v3":s.uniforms[r].value=new k().fromArray(o.value);break;case"v4":s.uniforms[r].value=new vt().fromArray(o.value);break;case"m3":s.uniforms[r].value=new at().fromArray(o.value);break;case"m4":s.uniforms[r].value=new Je().fromArray(o.value);break;default:s.uniforms[r].value=o.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const r in e.extensions)s.extensions[r]=e.extensions[r];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=i(e.map)),e.matcap!==void 0&&(s.matcap=i(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),s.normalScale=new fe().fromArray(r)}return e.displacementMap!==void 0&&(s.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=i(e.envMap)),e.envMapRotation!==void 0&&s.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new fe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(s.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Fh.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:DE,SpriteMaterial:a_,RawShaderMaterial:OE,ShaderMaterial:Vi,PointsMaterial:c_,MeshPhysicalMaterial:NE,MeshStandardMaterial:__,MeshPhongMaterial:UE,MeshToonMaterial:FE,MeshNormalMaterial:kE,MeshLambertMaterial:BE,MeshDepthMaterial:v_,MeshDistanceMaterial:y_,MeshBasicMaterial:Xs,MeshMatcapMaterial:zE,LineDashedMaterial:VE,LineBasicMaterial:Wn,Material:Pn};return new t[e]}}class Eg{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class nT extends ct{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class iT extends ti{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Hs(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t={},i={};function s(h,p){if(t[p]!==void 0)return t[p];const g=h.interleavedBuffers[p],m=r(h,g.buffer),v=la(g.type,m),b=new yh(v,g.stride);return b.uuid=g.uuid,t[p]=b,b}function r(h,p){if(i[p]!==void 0)return i[p];const g=h.arrayBuffers[p],m=new Uint32Array(g).buffer;return i[p]=m,m}const o=e.isInstancedBufferGeometry?new nT:new ct,a=e.data.index;if(a!==void 0){const h=la(a.type,a.array);o.setIndex(new It(h,1))}const l=e.data.attributes;for(const h in l){const p=l[h];let _;if(p.isInterleavedBufferAttribute){const g=s(e.data,p.data);_=new To(g,p.itemSize,p.offset,p.normalized)}else{const g=la(p.type,p.array),m=p.isInstancedBufferAttribute?Pa:It;_=new m(g,p.itemSize,p.normalized)}p.name!==void 0&&(_.name=p.name),p.usage!==void 0&&_.setUsage(p.usage),o.setAttribute(h,_)}const c=e.data.morphAttributes;if(c)for(const h in c){const p=c[h],_=[];for(let g=0,m=p.length;g0){const l=new S_(t);r=new xc(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){s=new xc(this.manager),s.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{let g=null,m=null;return _.boundingBox!==void 0&&(g=new Cn().fromJSON(_.boundingBox)),_.boundingSphere!==void 0&&(m=new bn().fromJSON(_.boundingSphere)),{..._,boundingBox:g,boundingSphere:m}}),o._instanceInfo=e.instanceInfo,o._availableInstanceIds=e._availableInstanceIds,o._availableGeometryIds=e._availableGeometryIds,o._nextIndexStart=e.nextIndexStart,o._nextVertexStart=e.nextVertexStart,o._geometryCount=e.geometryCount,o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._matricesTexture=c(e.matricesTexture.uuid),o._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(o.boundingSphere=new bn().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(o.boundingBox=new Cn().fromJSON(e.boundingBox));break;case"LOD":o=new mE;break;case"Line":o=new Sr(a(e.geometry),l(e.material));break;case"LineLoop":o=new yE(a(e.geometry),l(e.material));break;case"LineSegments":o=new ls(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new bE(a(e.geometry),l(e.material));break;case"Sprite":o=new pE(l(e.material));break;case"Group":o=new ca;break;case"Bone":o=new l_;break;default:o=new gt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let h=0;h"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Rs.get(e);if(o!==void 0){if(r.manager.itemStart(e),o.then){o.then(c=>{if(em.has(o)===!0)s&&s(em.get(o)),r.manager.itemError(e),r.manager.itemEnd(e);else return t&&t(c),r.manager.itemEnd(e),c});return}return setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){return Rs.add(e,c),t&&t(c),r.manager.itemEnd(e),c}).catch(function(c){s&&s(c),em.set(l,c),Rs.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});Rs.add(e,l),r.manager.itemStart(e)}}let $u;class T_{static getContext(){return $u===void 0&&($u=new(window.AudioContext||window.webkitAudioContext)),$u}static setContext(e){$u=e}}class KI extends ti{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Hs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);T_.getContext().decodeAudioData(c,function(f){t(f)}).catch(a)}catch(c){a(c)}},i,s);function a(l){s?s(l):console.error(l),r.manager.itemError(e)}}}const ob=new Je,ab=new Je,qr=new Je;class ZI{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Jt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Jt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,qr.copy(e.projectionMatrix);const s=t.eyeSep/2,r=s*t.near/t.focus,o=t.near*Math.tan(vo*t.fov*.5)/t.zoom;let a,l;ab.elements[12]=-s,ob.elements[12]=s,a=-o*t.aspect+r,l=o*t.aspect+r,qr.elements[0]=2*t.near/(l-a),qr.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(qr),a=-o*t.aspect-r,l=o*t.aspect-r,qr.elements[0]=2*t.near/(l-a),qr.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(qr)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(ab),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(ob)}}class sT extends Jt{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class kh{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=lb(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=lb();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function lb(){return performance.now()}const Yr=new k,tm=new Qn,JI=new k,jr=new k,Kr=new k;class QI extends gt{constructor(){super(),this.type="AudioListener",this.context=T_.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new kh}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Yr,tm,JI),jr.set(0,0,-1).applyQuaternion(tm),Kr.set(0,1,0).applyQuaternion(tm),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Yr.x,i),t.positionY.linearRampToValueAtTime(Yr.y,i),t.positionZ.linearRampToValueAtTime(Yr.z,i),t.forwardX.linearRampToValueAtTime(jr.x,i),t.forwardY.linearRampToValueAtTime(jr.y,i),t.forwardZ.linearRampToValueAtTime(jr.z,i),t.upX.linearRampToValueAtTime(Kr.x,i),t.upY.linearRampToValueAtTime(Kr.y,i),t.upZ.linearRampToValueAtTime(Kr.z,i)}else t.setPosition(Yr.x,Yr.y,Yr.z),t.setOrientation(jr.x,jr.y,jr.z,Kr.x,Kr.y,Kr.z)}}class rT extends gt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,s,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,s=i*this._origIndex;e.getValue(t,s);for(let r=i,o=s;r!==o;++r)t[r]=t[s+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==r;++o)e[t+o]=e[i+o]}_slerp(e,t,i,s){Qn.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Qn.multiplyQuaternionsFlat(e,o,e,t,e,i),Qn.slerpFlat(e,t,e,t,e,o,s)}_lerp(e,t,i,s,r){const o=1-s;for(let a=0;a!==r;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*s}}_lerpAdditive(e,t,i,s,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[i+o]*s}}}const w_="\\[\\]\\.:\\/",iL=new RegExp("["+w_+"]","g"),A_="[^"+w_+"]",sL="[^"+w_.replace("\\.","")+"]",rL=/((?:WC+[\/:])*)/.source.replace("WC",A_),oL=/(WCOD+)?/.source.replace("WCOD",sL),aL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",A_),lL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",A_),cL=new RegExp("^"+rL+oL+aL+lL+"$"),uL=["material","materials","bones","map"];class fL{constructor(e,t,i){const s=i||_t.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class _t{constructor(e,t,i){this.path=t,this.parsedPath=i||_t.parseTrackName(t),this.node=_t.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new _t.Composite(e,t,i):new _t(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(iL,"")}static parseTrackName(e){const t=cL.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);uL.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=r){const f=r++,d=e[f];t[d.uuid]=u,e[u]=d,t[c]=f,e[f]=l;for(let h=0,p=s;h!==p;++h){const _=i[h],g=_[f],m=_[u];_[u]=g,_[f]=m}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,s=i.length;let r=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,f=t[u];if(f!==void 0)if(delete t[u],f0&&(t[h.uuid]=f),e[f]=h,e.pop();for(let p=0,_=s;p!==_;++p){const g=i[p];g[f]=g[d],g.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let s=i[e];const r=this._bindings;if(s!==void 0)return r[s];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);s=r.length,i[e]=s,o.push(e),a.push(t),r.push(f);for(let d=u,h=l.length;d!==h;++d){const p=l[d];f[d]=new _t(p,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const s=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),r[i]=r[a],r.pop(),s[i]=s[a],s.pop()}}}class aT{constructor(e,t,i=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=s;const r=t.tracks,o=r.length,a=new Array(o),l={endingStart:uo,endingEnd:uo};for(let c=0;c!==o;++c){const u=r[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=q1,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const s=this._mixer,r=s.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=r,l[1]=r+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case e_:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case hh:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulate(s,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let s=this.time+e,r=this._loopCount;const o=i===Y1;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===$1){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),s>=t||s<0){const a=Math.floor(s/t);s-=t*a,r+=Math.abs(a);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(o&&(r&1)===1)return t-s}return s}_setEndings(e,t,i){const s=this._interpolantSettings;i?(s.endingStart=fo,s.endingEnd=fo):(e?s.endingStart=this.zeroSlopeAtStart?fo:uo:s.endingStart=uc,t?s.endingEnd=this.zeroSlopeAtEnd?fo:uo:s.endingEnd=uc)}_scheduleFading(e,t,i){const s=this._mixer,r=s.time;let o=this._weightInterpolant;o===null&&(o=s._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,l[0]=t,a[1]=r+e,l[1]=i,this}}const hL=new Float32Array(1);class pL extends as{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,s=e._clip.tracks,r=s.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==r;++f){const d=s[f],h=d.name;let p=u[h];if(p!==void 0)++p.referenceCount,o[f]=p;else{if(p=o[f],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,h));continue}const _=t&&t._propertyBindings[f].binding.parsedPath;p=new oT(_t.create(i,h,_),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,h),o[f]=p}a[f].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,i)}const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,s=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(s,e,r,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,db).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const hb=new k,qu=new k;class SL{constructor(e=new k,t=new k){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){hb.subVectors(e,this.start),qu.subVectors(this.end,this.start);const i=qu.dot(qu);let r=qu.dot(hb)/i;return t&&(r=st(r,0,1)),r}closestPointToPoint(e,t,i){const s=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(s).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const pb=new k;class EL extends gt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new ct,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{yb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(yb,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class FL extends ls{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new ct;s.setAttribute("position",new ke(t,3)),s.setAttribute("color",new ke(i,3));const r=new Wn({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,i){const s=new Pe,r=this.geometry.attributes.color.array;return s.set(e),s.toArray(r,0),s.toArray(r,3),s.set(t),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class kL{constructor(){this.type="ShapePath",this.color=new Pe,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Cd,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,s){return this.currentPath.quadraticCurveTo(e,t,i,s),this}bezierCurveTo(e,t,i,s,r,o){return this.currentPath.bezierCurveTo(e,t,i,s,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const v=[];for(let b=0,y=m.length;bNumber.EPSILON){if(E<0&&(S=v[w],M=-M,P=v[T],E=-E),m.yP.y)continue;if(m.y===S.y){if(m.x===S.x)return!0}else{const D=E*(m.x-S.x)-M*(m.y-S.y);if(D===0)return!0;if(D<0)continue;y=!y}}else{if(m.y!==S.y)continue;if(P.x<=m.x&&m.x<=S.x||S.x<=m.x&&m.x<=P.x)return!0}}return y}const s=Li.isClockWise,r=this.subPaths;if(r.length===0)return[];let o,a,l;const c=[];if(r.length===1)return a=r[0],l=new yo,l.curves=a.curves,c.push(l),c;let u=!s(r[0].getPoints());u=e?!u:u;const f=[],d=[];let h=[],p=0,_;d[p]=void 0,h[p]=[];for(let m=0,v=r.length;m1){let m=!1,v=0;for(let b=0,y=d.length;b0&&m===!1&&(h=f)}let g;for(let m=0,v=d.length;me?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function VL(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function HL(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function wg(n,e,t,i){const s=GL(i);switch(t){case K0:return n*e;case uh:return n*e/s.components*s.byteLength;case kc:return n*e/s.components*s.byteLength;case J0:return n*e*2/s.components*s.byteLength;case fh:return n*e*2/s.components*s.byteLength;case Z0:return n*e*3/s.components*s.byteLength;case zn:return n*e*4/s.components*s.byteLength;case dh:return n*e*4/s.components*s.byteLength;case Cl:case Rl:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Pl:case Il:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Qf:case td:return Math.max(n,16)*Math.max(e,8)/4;case Jf:case ed:return Math.max(n,8)*Math.max(e,8)/2;case nd:case id:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case sd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case rd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case od:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case ad:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case ld:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case cd:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case ud:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case fd:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case dd:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case hd:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case pd:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case md:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case gd:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case _d:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case vd:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Ll:case yd:case bd:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Q0:case xd:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Md:case Sd:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function GL(n){switch(n){case zi:case q0:return{byteLength:1,components:1};case Ea:case Y0:case Va:return{byteLength:2,components:1};case lh:case ch:return{byteLength:2,components:4};case Vs:case ah:case Zn:return{byteLength:4,components:1};case j0:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class WL{static contain(e,t){return zL(e,t)}static cover(e,t){return VL(e,t)}static fill(e){return HL(e)}static getByteLength(e,t,i,s){return wg(e,t,i,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Uc}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Uc);/** - * @license - * Copyright 2010-2025 Three.js Authors - * SPDX-License-Identifier: MIT - */function uT(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function XL(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,f=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let h;if(c instanceof Float32Array)h=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?h=n.HALF_FLOAT:h=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)h=n.SHORT;else if(c instanceof Uint32Array)h=n.UNSIGNED_INT;else if(c instanceof Int32Array)h=n.INT;else if(c instanceof Int8Array)h=n.BYTE;else if(c instanceof Uint8Array)h=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)h=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:h,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function i(a,l,c){const u=l.array,f=l.updateRanges;if(n.bindBuffer(c,a),f.length===0)n.bufferSubData(c,0,u);else{f.sort((h,p)=>h.start-p.start);let d=0;for(let h=1;h 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,lD=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,cD=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,uD=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,fD=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,dD=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,hD=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - varying vec3 vColor; -#endif`,pD=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif -#ifdef USE_BATCHING_COLOR - vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); - vColor.xyz *= batchingColor.xyz; -#endif`,mD=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,gD=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,_D=`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,vD=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,yD=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,bD=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE - emissiveColor = sRGBTransferEOTF( emissiveColor ); - #endif - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,xD=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,MD="gl_FragColor = linearToOutputTexel( gl_FragColor );",SD=`vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferEOTF( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,ED=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,TD=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform mat3 envMapRotation; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,wD=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,AD=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,CD=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,RD=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,PD=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,ID=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,LD=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,DD=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - vec2 fw = fwidth( coord ) * 0.5; - return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); - #endif -}`,OD=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,ND=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,UD=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,FD=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,kD=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,BD=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,zD=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,VD=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,HD=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,GD=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_DISPERSION - material.dispersion = dispersion; -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,WD=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - float dispersion; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return saturate(v); - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColor; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,XD=` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,$D=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,qD=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,YD=`#if defined( USE_LOGDEPTHBUF ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,jD=`#if defined( USE_LOGDEPTHBUF ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,KD=`#ifdef USE_LOGDEPTHBUF - varying float vFragDepth; - varying float vIsPerspective; -#endif`,ZD=`#ifdef USE_LOGDEPTHBUF - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,JD=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,QD=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,eO=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - #if defined( USE_POINTS_UV ) - vec2 uv = vUv; - #else - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - #endif -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,tO=`#if defined( USE_POINTS_UV ) - varying vec2 vUv; -#else - #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; - #endif -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,nO=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,iO=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,sO=`#ifdef USE_INSTANCING_MORPH - float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; - } -#endif`,rO=`#if defined( USE_MORPHCOLORS ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,oO=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,aO=`#ifdef USE_MORPHTARGETS - #ifndef USE_INSTANCING_MORPH - uniform float morphTargetBaseInfluence; - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - #endif - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } -#endif`,lO=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,cO=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,uO=`#ifdef USE_NORMALMAP_OBJECTSPACE - normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( USE_NORMALMAP_TANGENTSPACE ) - vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - normal = normalize( tbn * mapN ); -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,fO=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,dO=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,hO=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,pO=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef USE_NORMALMAP_OBJECTSPACE - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - return mat3( T * scale, B * scale, N ); - } -#endif`,mO=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,gO=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,_O=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif`,vO=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,yO=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,bO=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; -const float Inv255 = 1. / 255.; -const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); -const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); -const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); -const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); -vec4 packDepthToRGBA( const in float v ) { - if( v <= 0.0 ) - return vec4( 0., 0., 0., 0. ); - if( v >= 1.0 ) - return vec4( 1., 1., 1., 1. ); - float vuf; - float af = modf( v * PackFactors.a, vuf ); - float bf = modf( vuf * ShiftRight8, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); -} -vec3 packDepthToRGB( const in float v ) { - if( v <= 0.0 ) - return vec3( 0., 0., 0. ); - if( v >= 1.0 ) - return vec3( 1., 1., 1. ); - float vuf; - float bf = modf( v * PackFactors.b, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec3( vuf * Inv255, gf * PackUpscale, bf ); -} -vec2 packDepthToRG( const in float v ) { - if( v <= 0.0 ) - return vec2( 0., 0. ); - if( v >= 1.0 ) - return vec2( 1., 1. ); - float vuf; - float gf = modf( v * 256., vuf ); - return vec2( vuf * Inv255, gf ); -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors4 ); -} -float unpackRGBToDepth( const in vec3 v ) { - return dot( v, UnpackFactors3 ); -} -float unpackRGToDepth( const in vec2 v ) { - return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; -} -vec4 pack2HalfToRGBA( const in vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( const in vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,xO=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,MO=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,SO=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,EO=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,TO=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,wO=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,AO=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - - float lightToPositionLength = length( lightToPosition ); - if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { - float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - shadow = ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } -#endif`,CO=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,RO=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; -#endif -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,PO=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,IO=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,LO=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,DO=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,OO=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,NO=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,UO=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,FO=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,kO=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 CineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 NeutralToneMapping( vec3 color ) { - const float StartCompression = 0.8 - 0.04; - const float Desaturation = 0.15; - color *= toneMappingExposure; - float x = min( color.r, min( color.g, color.b ) ); - float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; - color -= offset; - float peak = max( color.r, max( color.g, color.b ) ); - if ( peak < StartCompression ) return color; - float d = 1. - StartCompression; - float newPeak = 1. - d * d / ( peak + d - StartCompression ); - color *= newPeak / peak; - float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); - return mix( color, vec3( newPeak ), g ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,BO=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,zO=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec4 transmittedLight; - vec3 transmittance; - #ifdef USE_DISPERSION - float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; - vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); - for ( int i = 0; i < 3; i ++ ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); - transmittedLight[ i ] = transmissionSample[ i ]; - transmittedLight.a += transmissionSample.a; - transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; - } - transmittedLight.a /= 3.0; - #else - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - #endif - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,VO=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - varying vec2 vNormalMapUv; -#endif -#ifdef USE_EMISSIVEMAP - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_SPECULARMAP - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,HO=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - uniform mat3 mapTransform; - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - uniform mat3 alphaMapTransform; - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - uniform mat3 lightMapTransform; - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - uniform mat3 aoMapTransform; - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - uniform mat3 bumpMapTransform; - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - uniform mat3 normalMapTransform; - varying vec2 vNormalMapUv; -#endif -#ifdef USE_DISPLACEMENTMAP - uniform mat3 displacementMapTransform; - varying vec2 vDisplacementMapUv; -#endif -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapTransform; - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - uniform mat3 metalnessMapTransform; - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - uniform mat3 roughnessMapTransform; - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - uniform mat3 anisotropyMapTransform; - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - uniform mat3 clearcoatMapTransform; - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform mat3 clearcoatNormalMapTransform; - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform mat3 clearcoatRoughnessMapTransform; - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - uniform mat3 sheenColorMapTransform; - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - uniform mat3 sheenRoughnessMapTransform; - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - uniform mat3 iridescenceMapTransform; - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform mat3 iridescenceThicknessMapTransform; - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SPECULARMAP - uniform mat3 specularMapTransform; - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - uniform mat3 specularColorMapTransform; - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - uniform mat3 specularIntensityMapTransform; - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,GO=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - vUv = vec3( uv, 1 ).xy; -#endif -#ifdef USE_MAP - vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ALPHAMAP - vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_LIGHTMAP - vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_AOMAP - vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_BUMPMAP - vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_NORMALMAP - vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_DISPLACEMENTMAP - vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_EMISSIVEMAP - vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_METALNESSMAP - vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ROUGHNESSMAP - vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ANISOTROPYMAP - vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOATMAP - vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCEMAP - vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_COLORMAP - vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULARMAP - vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_COLORMAP - vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_TRANSMISSIONMAP - vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_THICKNESSMAP - vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,WO=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_BATCHING - worldPosition = batchingMatrix * worldPosition; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const XO=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,$O=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,qO=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,YO=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -uniform mat3 backgroundRotation; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,jO=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,KO=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,ZO=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,JO=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #elif DEPTH_PACKING == 3202 - gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); - #elif DEPTH_PACKING == 3203 - gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); - #endif -}`,QO=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,eN=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,tN=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,nN=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,iN=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,sN=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,rN=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,oN=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,aN=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,lN=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,cN=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,uN=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,fN=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,dN=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,hN=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,pN=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,mN=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,gN=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_DISPERSION - uniform float dispersion; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,_N=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,vN=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,yN=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#ifdef USE_POINTS_UV - varying vec2 vUv; - uniform mat3 uvTransform; -#endif -void main() { - #ifdef USE_POINTS_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #include - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,bN=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,xN=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,MN=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,SN=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix[ 3 ]; - vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,EN=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,ft={alphahash_fragment:$L,alphahash_pars_fragment:qL,alphamap_fragment:YL,alphamap_pars_fragment:jL,alphatest_fragment:KL,alphatest_pars_fragment:ZL,aomap_fragment:JL,aomap_pars_fragment:QL,batching_pars_vertex:eD,batching_vertex:tD,begin_vertex:nD,beginnormal_vertex:iD,bsdfs:sD,iridescence_fragment:rD,bumpmap_pars_fragment:oD,clipping_planes_fragment:aD,clipping_planes_pars_fragment:lD,clipping_planes_pars_vertex:cD,clipping_planes_vertex:uD,color_fragment:fD,color_pars_fragment:dD,color_pars_vertex:hD,color_vertex:pD,common:mD,cube_uv_reflection_fragment:gD,defaultnormal_vertex:_D,displacementmap_pars_vertex:vD,displacementmap_vertex:yD,emissivemap_fragment:bD,emissivemap_pars_fragment:xD,colorspace_fragment:MD,colorspace_pars_fragment:SD,envmap_fragment:ED,envmap_common_pars_fragment:TD,envmap_pars_fragment:wD,envmap_pars_vertex:AD,envmap_physical_pars_fragment:kD,envmap_vertex:CD,fog_vertex:RD,fog_pars_vertex:PD,fog_fragment:ID,fog_pars_fragment:LD,gradientmap_pars_fragment:DD,lightmap_pars_fragment:OD,lights_lambert_fragment:ND,lights_lambert_pars_fragment:UD,lights_pars_begin:FD,lights_toon_fragment:BD,lights_toon_pars_fragment:zD,lights_phong_fragment:VD,lights_phong_pars_fragment:HD,lights_physical_fragment:GD,lights_physical_pars_fragment:WD,lights_fragment_begin:XD,lights_fragment_maps:$D,lights_fragment_end:qD,logdepthbuf_fragment:YD,logdepthbuf_pars_fragment:jD,logdepthbuf_pars_vertex:KD,logdepthbuf_vertex:ZD,map_fragment:JD,map_pars_fragment:QD,map_particle_fragment:eO,map_particle_pars_fragment:tO,metalnessmap_fragment:nO,metalnessmap_pars_fragment:iO,morphinstance_vertex:sO,morphcolor_vertex:rO,morphnormal_vertex:oO,morphtarget_pars_vertex:aO,morphtarget_vertex:lO,normal_fragment_begin:cO,normal_fragment_maps:uO,normal_pars_fragment:fO,normal_pars_vertex:dO,normal_vertex:hO,normalmap_pars_fragment:pO,clearcoat_normal_fragment_begin:mO,clearcoat_normal_fragment_maps:gO,clearcoat_pars_fragment:_O,iridescence_pars_fragment:vO,opaque_fragment:yO,packing:bO,premultiplied_alpha_fragment:xO,project_vertex:MO,dithering_fragment:SO,dithering_pars_fragment:EO,roughnessmap_fragment:TO,roughnessmap_pars_fragment:wO,shadowmap_pars_fragment:AO,shadowmap_pars_vertex:CO,shadowmap_vertex:RO,shadowmask_pars_fragment:PO,skinbase_vertex:IO,skinning_pars_vertex:LO,skinning_vertex:DO,skinnormal_vertex:OO,specularmap_fragment:NO,specularmap_pars_fragment:UO,tonemapping_fragment:FO,tonemapping_pars_fragment:kO,transmission_fragment:BO,transmission_pars_fragment:zO,uv_pars_fragment:VO,uv_pars_vertex:HO,uv_vertex:GO,worldpos_vertex:WO,background_vert:XO,background_frag:$O,backgroundCube_vert:qO,backgroundCube_frag:YO,cube_vert:jO,cube_frag:KO,depth_vert:ZO,depth_frag:JO,distanceRGBA_vert:QO,distanceRGBA_frag:eN,equirect_vert:tN,equirect_frag:nN,linedashed_vert:iN,linedashed_frag:sN,meshbasic_vert:rN,meshbasic_frag:oN,meshlambert_vert:aN,meshlambert_frag:lN,meshmatcap_vert:cN,meshmatcap_frag:uN,meshnormal_vert:fN,meshnormal_frag:dN,meshphong_vert:hN,meshphong_frag:pN,meshphysical_vert:mN,meshphysical_frag:gN,meshtoon_vert:_N,meshtoon_frag:vN,points_vert:yN,points_frag:bN,shadow_vert:xN,shadow_frag:MN,sprite_vert:SN,sprite_frag:EN},Ae={common:{diffuse:{value:new Pe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new at},alphaMap:{value:null},alphaMapTransform:{value:new at},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new at}},envmap:{envMap:{value:null},envMapRotation:{value:new at},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new at}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new at}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new at},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new at},normalScale:{value:new fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new at},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new at}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new at}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new at}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Pe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new at},alphaTest:{value:0},uvTransform:{value:new at}},sprite:{diffuse:{value:new Pe(16777215)},opacity:{value:1},center:{value:new fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new at},alphaMap:{value:null},alphaMapTransform:{value:new at},alphaTest:{value:0}}},Pi={basic:{uniforms:On([Ae.common,Ae.specularmap,Ae.envmap,Ae.aomap,Ae.lightmap,Ae.fog]),vertexShader:ft.meshbasic_vert,fragmentShader:ft.meshbasic_frag},lambert:{uniforms:On([Ae.common,Ae.specularmap,Ae.envmap,Ae.aomap,Ae.lightmap,Ae.emissivemap,Ae.bumpmap,Ae.normalmap,Ae.displacementmap,Ae.fog,Ae.lights,{emissive:{value:new Pe(0)}}]),vertexShader:ft.meshlambert_vert,fragmentShader:ft.meshlambert_frag},phong:{uniforms:On([Ae.common,Ae.specularmap,Ae.envmap,Ae.aomap,Ae.lightmap,Ae.emissivemap,Ae.bumpmap,Ae.normalmap,Ae.displacementmap,Ae.fog,Ae.lights,{emissive:{value:new Pe(0)},specular:{value:new Pe(1118481)},shininess:{value:30}}]),vertexShader:ft.meshphong_vert,fragmentShader:ft.meshphong_frag},standard:{uniforms:On([Ae.common,Ae.envmap,Ae.aomap,Ae.lightmap,Ae.emissivemap,Ae.bumpmap,Ae.normalmap,Ae.displacementmap,Ae.roughnessmap,Ae.metalnessmap,Ae.fog,Ae.lights,{emissive:{value:new Pe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ft.meshphysical_vert,fragmentShader:ft.meshphysical_frag},toon:{uniforms:On([Ae.common,Ae.aomap,Ae.lightmap,Ae.emissivemap,Ae.bumpmap,Ae.normalmap,Ae.displacementmap,Ae.gradientmap,Ae.fog,Ae.lights,{emissive:{value:new Pe(0)}}]),vertexShader:ft.meshtoon_vert,fragmentShader:ft.meshtoon_frag},matcap:{uniforms:On([Ae.common,Ae.bumpmap,Ae.normalmap,Ae.displacementmap,Ae.fog,{matcap:{value:null}}]),vertexShader:ft.meshmatcap_vert,fragmentShader:ft.meshmatcap_frag},points:{uniforms:On([Ae.points,Ae.fog]),vertexShader:ft.points_vert,fragmentShader:ft.points_frag},dashed:{uniforms:On([Ae.common,Ae.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ft.linedashed_vert,fragmentShader:ft.linedashed_frag},depth:{uniforms:On([Ae.common,Ae.displacementmap]),vertexShader:ft.depth_vert,fragmentShader:ft.depth_frag},normal:{uniforms:On([Ae.common,Ae.bumpmap,Ae.normalmap,Ae.displacementmap,{opacity:{value:1}}]),vertexShader:ft.meshnormal_vert,fragmentShader:ft.meshnormal_frag},sprite:{uniforms:On([Ae.sprite,Ae.fog]),vertexShader:ft.sprite_vert,fragmentShader:ft.sprite_frag},background:{uniforms:{uvTransform:{value:new at},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ft.background_vert,fragmentShader:ft.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new at}},vertexShader:ft.backgroundCube_vert,fragmentShader:ft.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ft.cube_vert,fragmentShader:ft.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ft.equirect_vert,fragmentShader:ft.equirect_frag},distanceRGBA:{uniforms:On([Ae.common,Ae.displacementmap,{referencePosition:{value:new k},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ft.distanceRGBA_vert,fragmentShader:ft.distanceRGBA_frag},shadow:{uniforms:On([Ae.lights,Ae.fog,{color:{value:new Pe(0)},opacity:{value:1}}]),vertexShader:ft.shadow_vert,fragmentShader:ft.shadow_frag}};Pi.physical={uniforms:On([Pi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new at},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new at},clearcoatNormalScale:{value:new fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new at},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new at},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new at},sheen:{value:0},sheenColor:{value:new Pe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new at},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new at},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new at},transmissionSamplerSize:{value:new fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new at},attenuationDistance:{value:0},attenuationColor:{value:new Pe(0)},specularColor:{value:new Pe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new at},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new at},anisotropyVector:{value:new fe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new at}}]),vertexShader:ft.meshphysical_vert,fragmentShader:ft.meshphysical_frag};const Qu={r:0,b:0,g:0},Qr=new li,TN=new Je;function wN(n,e,t,i,s,r,o){const a=new Pe(0);let l=r===!0?0:1,c,u,f=null,d=0,h=null;function p(b){let y=b.isScene===!0?b.background:null;return y&&y.isTexture&&(y=(b.backgroundBlurriness>0?t:e).get(y)),y}function _(b){let y=!1;const T=p(b);T===null?m(a,l):T&&T.isColor&&(m(T,1),y=!0);const w=n.xr.getEnvironmentBlendMode();w==="additive"?i.buffers.color.setClear(0,0,0,1,o):w==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||y)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function g(b,y){const T=p(y);T&&(T.isCubeTexture||T.mapping===za)?(u===void 0&&(u=new jt(new Ro(1,1,1),new Vi({name:"BackgroundCubeMaterial",uniforms:Ra(Pi.backgroundCube.uniforms),vertexShader:Pi.backgroundCube.vertexShader,fragmentShader:Pi.backgroundCube.fragmentShader,side:Vn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(w,S,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Qr.copy(y.backgroundRotation),Qr.x*=-1,Qr.y*=-1,Qr.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(Qr.y*=-1,Qr.z*=-1),u.material.uniforms.envMap.value=T,u.material.uniforms.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(TN.makeRotationFromEuler(Qr)),u.material.toneMapped=pt.getTransfer(T.colorSpace)!==Ct,(f!==T||d!==T.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,f=T,d=T.version,h=n.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):T&&T.isTexture&&(c===void 0&&(c=new jt(new Wa(2,2),new Vi({name:"BackgroundMaterial",uniforms:Ra(Pi.background.uniforms),vertexShader:Pi.background.vertexShader,fragmentShader:Pi.background.fragmentShader,side:Bs,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=T,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=pt.getTransfer(T.colorSpace)!==Ct,T.matrixAutoUpdate===!0&&T.updateMatrix(),c.material.uniforms.uvTransform.value.copy(T.matrix),(f!==T||d!==T.version||h!==n.toneMapping)&&(c.material.needsUpdate=!0,f=T,d=T.version,h=n.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,y){b.getRGB(Qu,cE(n)),i.buffers.color.setClear(Qu.r,Qu.g,Qu.b,y,o)}function v(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(b,y=1){a.set(b),l=y,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(a,l)},render:_,addToRenderList:g,dispose:v}}function AN(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=d(null);let r=s,o=!1;function a(E,D,B,z,V){let Q=!1;const j=f(z,B,D);r!==j&&(r=j,c(r.object)),Q=h(E,z,B,V),Q&&p(E,z,B,V),V!==null&&e.update(V,n.ELEMENT_ARRAY_BUFFER),(Q||o)&&(o=!1,y(E,D,B,z),V!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(V).buffer))}function l(){return n.createVertexArray()}function c(E){return n.bindVertexArray(E)}function u(E){return n.deleteVertexArray(E)}function f(E,D,B){const z=B.wireframe===!0;let V=i[E.id];V===void 0&&(V={},i[E.id]=V);let Q=V[D.id];Q===void 0&&(Q={},V[D.id]=Q);let j=Q[z];return j===void 0&&(j=d(l()),Q[z]=j),j}function d(E){const D=[],B=[],z=[];for(let V=0;V=0){const Me=V[Z];let re=Q[Z];if(re===void 0&&(Z==="instanceMatrix"&&E.instanceMatrix&&(re=E.instanceMatrix),Z==="instanceColor"&&E.instanceColor&&(re=E.instanceColor)),Me===void 0||Me.attribute!==re||re&&Me.data!==re.data)return!0;j++}return r.attributesNum!==j||r.index!==z}function p(E,D,B,z){const V={},Q=D.attributes;let j=0;const te=B.getAttributes();for(const Z in te)if(te[Z].location>=0){let Me=Q[Z];Me===void 0&&(Z==="instanceMatrix"&&E.instanceMatrix&&(Me=E.instanceMatrix),Z==="instanceColor"&&E.instanceColor&&(Me=E.instanceColor));const re={};re.attribute=Me,Me&&Me.data&&(re.data=Me.data),V[Z]=re,j++}r.attributes=V,r.attributesNum=j,r.index=z}function _(){const E=r.newAttributes;for(let D=0,B=E.length;D=0){let pe=V[te];if(pe===void 0&&(te==="instanceMatrix"&&E.instanceMatrix&&(pe=E.instanceMatrix),te==="instanceColor"&&E.instanceColor&&(pe=E.instanceColor)),pe!==void 0){const Me=pe.normalized,re=pe.itemSize,xe=e.get(pe);if(xe===void 0)continue;const We=xe.buffer,oe=xe.type,ge=xe.bytesPerElement,Ee=oe===n.INT||oe===n.UNSIGNED_INT||pe.gpuType===ah;if(pe.isInterleavedBufferAttribute){const $=pe.data,ae=$.stride,le=pe.offset;if($.isInstancedInterleavedBuffer){for(let ue=0;ue0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";S="mediump"}return S==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),g=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),m=n.getParameter(n.MAX_VERTEX_ATTRIBS),v=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),b=n.getParameter(n.MAX_VARYING_VECTORS),y=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),T=p>0,w=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:d,maxTextures:h,maxVertexTextures:p,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:v,maxVaryings:b,maxFragmentUniforms:y,vertexTextures:T,maxSamples:w}}function PN(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new ur,a=new at,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d){const h=f.length!==0||d||i!==0||s;return s=d,i=f.length,h},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(f,d){t=u(f,d,0)},this.setState=function(f,d,h){const p=f.clippingPlanes,_=f.clipIntersection,g=f.clipShadows,m=n.get(f);if(!s||p===null||p.length===0||r&&!g)r?u(null):c();else{const v=r?0:i,b=v*4;let y=m.clippingState||null;l.value=y,y=u(p,d,b,h);for(let T=0;T!==b;++T)y[T]=t[T];m.clippingState=y,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=v}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,d,h,p){const _=f!==null?f.length:0;let g=null;if(_!==0){if(g=l.value,p!==!0||g===null){const m=h+_*4,v=d.matrixWorldInverse;a.getNormalMatrix(v),(g===null||g.length0){const c=new dE(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",s),t(c.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}const ua=4,bb=[.125,.215,.35,.446,.526,.582],lo=20,sm=new Uh,xb=new Pe;let rm=null,om=0,am=0,lm=!1;const ro=(1+Math.sqrt(5))/2,ta=1/ro,Mb=[new k(-ro,ta,0),new k(ro,ta,0),new k(-ta,0,ro),new k(ta,0,ro),new k(0,ro,-ta),new k(0,ro,ta),new k(-1,1,-1),new k(1,1,-1),new k(-1,1,1),new k(1,1,1)],LN=new k;class Ag{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,s=100,r={}){const{size:o=256,position:a=LN}=r;rm=this._renderer.getRenderTarget(),om=this._renderer.getActiveCubeFace(),am=this._renderer.getActiveMipmapLevel(),lm=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,s,l,a),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Tb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Eb(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?y:0,y,y),f.setRenderTarget(s),g&&f.render(_,l),f.render(e,l)}_.geometry.dispose(),_.material.dispose(),f.toneMapping=h,f.autoClear=d,e.background=m}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===zs||e.mapping===Mr;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=Tb()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Eb());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new jt(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;ef(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,sm)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rlo&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${lo}`);const m=[];let v=0;for(let S=0;Sb-ua?s-b+ua:0),w=4*(this._cubeSize-y);ef(t,T,w,3*y,2*y),l.setRenderTarget(t),l.render(f,sm)}}function DN(n){const e=[],t=[],i=[];let s=n;const r=n-ua+1+bb.length;for(let o=0;on-ua?l=bb[o-n+ua-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,_=3,g=2,m=1,v=new Float32Array(_*p*h),b=new Float32Array(g*p*h),y=new Float32Array(m*p*h);for(let w=0;w2?0:-1,M=[S,P,0,S+2/3,P,0,S+2/3,P+1,0,S,P,0,S+2/3,P+1,0,S,P+1,0];v.set(M,_*p*w),b.set(d,g*p*w);const E=[w,w,w,w,w,w];y.set(E,m*p*w)}const T=new ct;T.setAttribute("position",new It(v,_)),T.setAttribute("uv",new It(b,g)),T.setAttribute("faceIndex",new It(y,m)),e.push(T),s>ua&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function Sb(n,e,t){const i=new os(n,e,t);return i.texture.mapping=za,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ef(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function ON(n,e,t){const i=new Float32Array(lo),s=new k(0,1,0);return new Vi({name:"SphericalGaussianBlur",defines:{n:lo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:P_(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:Ds,depthTest:!1,depthWrite:!1})}function Eb(){return new Vi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:P_(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:Ds,depthTest:!1,depthWrite:!1})}function Tb(){return new Vi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:P_(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:Ds,depthTest:!1,depthWrite:!1})}function P_(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function NN(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===rc||l===oc,u=l===zs||l===Mr;if(c||u){let f=e.get(a);const d=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return t===null&&(t=new Ag(n)),f=c?t.fromEquirectangular(a,f):t.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const h=a.image;return c&&h&&h.height>0||u&&h&&s(h)?(t===null&&(t=new Ag(n)),f=c?t.fromEquirectangular(a):t.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",r),f.texture):null}}}return a}function s(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(T=Math.ceil(y/e.maxTextureSize),y=e.maxTextureSize);const w=new Float32Array(y*T*4*f),S=new ph(w,y,T,f);S.type=Zn,S.needsUpdate=!0;const P=b*4;for(let E=0;E0)return n;const s=e*t;let r=Ab[s];if(r===void 0&&(r=new Float32Array(s),Ab[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function rn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` -`)}const Ob=new at;function NU(n){pt._getMatrix(Ob,pt.workingColorSpace,n);const e=`mat3( ${Ob.elements.map(t=>t.toFixed(4))} )`;switch(pt.getTransfer(n)){case fc:return[e,"LinearTransferOETF"];case Ct:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function Nb(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` - -`+s+` - -`+OU(n.getShaderSource(e),o)}else return s}function UU(n,e){const t=NU(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` -`)}function FU(n,e){let t;switch(e){case B1:t="Linear";break;case z1:t="Reinhard";break;case V1:t="Cineon";break;case rh:t="ACESFilmic";break;case G1:t="AgX";break;case W1:t="Neutral";break;case H1:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const tf=new k;function kU(){pt.getLuminanceCoefficients(tf);const n=tf.x.toFixed(4),e=tf.y.toFixed(4),t=tf.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` -`)}function BU(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(bl).join(` -`)}function zU(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function VU(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Cg(n){return n.replace(HU,WU)}const GU=new Map;function WU(n,e){let t=ft[e];if(t===void 0){const i=GU.get(e);if(i!==void 0)t=ft[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Cg(t)}const XU=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function kb(n){return n.replace(XU,$U)}function $U(n,e,t,i){let s="";for(let r=parseInt(e);r0&&(g+=` -`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(bl).join(` -`),m.length>0&&(m+=` -`)):(g=[Bb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(bl).join(` -`),m=[Bb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ns?"#define TONE_MAPPING":"",t.toneMapping!==ns?ft.tonemapping_pars_fragment:"",t.toneMapping!==ns?FU("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ft.colorspace_pars_fragment,UU("linearToOutputTexel",t.outputColorSpace),kU(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(bl).join(` -`)),o=Cg(o),o=Ub(o,t),o=Fb(o,t),a=Cg(a),a=Ub(a,t),a=Fb(a,t),o=kb(o),a=kb(a),t.isRawShaderMaterial!==!0&&(v=`#version 300 es -`,g=[h,"#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+g,m=["#define varying in",t.glslVersion===yg?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===yg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+m);const b=v+g+o,y=v+m+a,T=Db(s,s.VERTEX_SHADER,b),w=Db(s,s.FRAGMENT_SHADER,y);s.attachShader(_,T),s.attachShader(_,w),t.index0AttributeName!==void 0?s.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_);function S(D){if(n.debug.checkShaderErrors){const B=s.getProgramInfoLog(_).trim(),z=s.getShaderInfoLog(T).trim(),V=s.getShaderInfoLog(w).trim();let Q=!0,j=!0;if(s.getProgramParameter(_,s.LINK_STATUS)===!1)if(Q=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(s,_,T,w);else{const te=Nb(s,T,"vertex"),Z=Nb(s,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(_,s.VALIDATE_STATUS)+` - -Material Name: `+D.name+` -Material Type: `+D.type+` - -Program Info Log: `+B+` -`+te+` -`+Z)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(z===""||V==="")&&(j=!1);j&&(D.diagnostics={runnable:Q,programLog:B,vertexShader:{log:z,prefix:g},fragmentShader:{log:V,prefix:m}})}s.deleteShader(T),s.deleteShader(w),P=new Ef(s,_),M=VU(s,_)}let P;this.getUniforms=function(){return P===void 0&&S(this),P};let M;this.getAttributes=function(){return M===void 0&&S(this),M};let E=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=s.getProgramParameter(_,LU)),E},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=DU++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=T,this.fragmentShader=w,this}let QU=0;class eF{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new tF(e),t.set(e,i)),i}}class tF{constructor(e){this.id=QU++,this.code=e,this.usedTimes=0}}function nF(n,e,t,i,s,r,o){const a=new Bc,l=new eF,c=new Set,u=[],f=s.logarithmicDepthBuffer,d=s.vertexTextures;let h=s.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(M){return c.add(M),M===0?"uv":`uv${M}`}function g(M,E,D,B,z){const V=B.fog,Q=z.geometry,j=M.isMeshStandardMaterial?B.environment:null,te=(M.isMeshStandardMaterial?t:e).get(M.envMap||j),Z=te&&te.mapping===za?te.image.height:null,pe=p[M.type];M.precision!==null&&(h=s.getMaxPrecision(M.precision),h!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",h,"instead."));const Me=Q.morphAttributes.position||Q.morphAttributes.normal||Q.morphAttributes.color,re=Me!==void 0?Me.length:0;let xe=0;Q.morphAttributes.position!==void 0&&(xe=1),Q.morphAttributes.normal!==void 0&&(xe=2),Q.morphAttributes.color!==void 0&&(xe=3);let We,oe,ge,Ee;if(pe){const wt=Pi[pe];We=wt.vertexShader,oe=wt.fragmentShader}else We=M.vertexShader,oe=M.fragmentShader,l.update(M),ge=l.getVertexShaderID(M),Ee=l.getFragmentShaderID(M);const $=n.getRenderTarget(),ae=n.state.buffers.depth.getReversed(),le=z.isInstancedMesh===!0,ue=z.isBatchedMesh===!0,qe=!!M.map,N=!!M.matcap,U=!!te,A=!!M.aoMap,W=!!M.lightMap,G=!!M.bumpMap,X=!!M.normalMap,C=!!M.displacementMap,I=!!M.emissiveMap,F=!!M.metalnessMap,H=!!M.roughnessMap,ce=M.anisotropy>0,R=M.clearcoat>0,x=M.dispersion>0,O=M.iridescence>0,Y=M.sheen>0,ne=M.transmission>0,ee=ce&&!!M.anisotropyMap,Te=R&&!!M.clearcoatMap,me=R&&!!M.clearcoatNormalMap,Re=R&&!!M.clearcoatRoughnessMap,De=O&&!!M.iridescenceMap,he=O&&!!M.iridescenceThicknessMap,Ne=Y&&!!M.sheenColorMap,ze=Y&&!!M.sheenRoughnessMap,Ve=!!M.specularMap,we=!!M.specularColorMap,it=!!M.specularIntensityMap,q=ne&&!!M.transmissionMap,Ie=ne&&!!M.thicknessMap,_e=!!M.gradientMap,Be=!!M.alphaMap,ve=M.alphaTest>0,de=!!M.alphaHash,He=!!M.extensions;let ot=ns;M.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(ot=n.toneMapping);const Ut={shaderID:pe,shaderType:M.type,shaderName:M.name,vertexShader:We,fragmentShader:oe,defines:M.defines,customVertexShaderID:ge,customFragmentShaderID:Ee,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:h,batching:ue,batchingColor:ue&&z._colorsTexture!==null,instancing:le,instancingColor:le&&z.instanceColor!==null,instancingMorph:le&&z.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:$===null?n.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:Eo,alphaToCoverage:!!M.alphaToCoverage,map:qe,matcap:N,envMap:U,envMapMode:U&&te.mapping,envMapCubeUVHeight:Z,aoMap:A,lightMap:W,bumpMap:G,normalMap:X,displacementMap:d&&C,emissiveMap:I,normalMapObjectSpace:X&&M.normalMapType===Z1,normalMapTangentSpace:X&&M.normalMapType===Cr,metalnessMap:F,roughnessMap:H,anisotropy:ce,anisotropyMap:ee,clearcoat:R,clearcoatMap:Te,clearcoatNormalMap:me,clearcoatRoughnessMap:Re,dispersion:x,iridescence:O,iridescenceMap:De,iridescenceThicknessMap:he,sheen:Y,sheenColorMap:Ne,sheenRoughnessMap:ze,specularMap:Ve,specularColorMap:we,specularIntensityMap:it,transmission:ne,transmissionMap:q,thicknessMap:Ie,gradientMap:_e,opaque:M.transparent===!1&&M.blending===_o&&M.alphaToCoverage===!1,alphaMap:Be,alphaTest:ve,alphaHash:de,combine:M.combine,mapUv:qe&&_(M.map.channel),aoMapUv:A&&_(M.aoMap.channel),lightMapUv:W&&_(M.lightMap.channel),bumpMapUv:G&&_(M.bumpMap.channel),normalMapUv:X&&_(M.normalMap.channel),displacementMapUv:C&&_(M.displacementMap.channel),emissiveMapUv:I&&_(M.emissiveMap.channel),metalnessMapUv:F&&_(M.metalnessMap.channel),roughnessMapUv:H&&_(M.roughnessMap.channel),anisotropyMapUv:ee&&_(M.anisotropyMap.channel),clearcoatMapUv:Te&&_(M.clearcoatMap.channel),clearcoatNormalMapUv:me&&_(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Re&&_(M.clearcoatRoughnessMap.channel),iridescenceMapUv:De&&_(M.iridescenceMap.channel),iridescenceThicknessMapUv:he&&_(M.iridescenceThicknessMap.channel),sheenColorMapUv:Ne&&_(M.sheenColorMap.channel),sheenRoughnessMapUv:ze&&_(M.sheenRoughnessMap.channel),specularMapUv:Ve&&_(M.specularMap.channel),specularColorMapUv:we&&_(M.specularColorMap.channel),specularIntensityMapUv:it&&_(M.specularIntensityMap.channel),transmissionMapUv:q&&_(M.transmissionMap.channel),thicknessMapUv:Ie&&_(M.thicknessMap.channel),alphaMapUv:Be&&_(M.alphaMap.channel),vertexTangents:!!Q.attributes.tangent&&(X||ce),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!Q.attributes.color&&Q.attributes.color.itemSize===4,pointsUvs:z.isPoints===!0&&!!Q.attributes.uv&&(qe||Be),fog:!!V,useFog:M.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:ae,skinning:z.isSkinnedMesh===!0,morphTargets:Q.morphAttributes.position!==void 0,morphNormals:Q.morphAttributes.normal!==void 0,morphColors:Q.morphAttributes.color!==void 0,morphTargetsCount:re,morphTextureStride:xe,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:M.dithering,shadowMapEnabled:n.shadowMap.enabled&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:ot,decodeVideoTexture:qe&&M.map.isVideoTexture===!0&&pt.getTransfer(M.map.colorSpace)===Ct,decodeVideoTextureEmissive:I&&M.emissiveMap.isVideoTexture===!0&&pt.getTransfer(M.emissiveMap.colorSpace)===Ct,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Ii,flipSided:M.side===Vn,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:He&&M.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(He&&M.extensions.multiDraw===!0||ue)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return Ut.vertexUv1s=c.has(1),Ut.vertexUv2s=c.has(2),Ut.vertexUv3s=c.has(3),c.clear(),Ut}function m(M){const E=[];if(M.shaderID?E.push(M.shaderID):(E.push(M.customVertexShaderID),E.push(M.customFragmentShaderID)),M.defines!==void 0)for(const D in M.defines)E.push(D),E.push(M.defines[D]);return M.isRawShaderMaterial===!1&&(v(E,M),b(E,M),E.push(n.outputColorSpace)),E.push(M.customProgramCacheKey),E.join()}function v(M,E){M.push(E.precision),M.push(E.outputColorSpace),M.push(E.envMapMode),M.push(E.envMapCubeUVHeight),M.push(E.mapUv),M.push(E.alphaMapUv),M.push(E.lightMapUv),M.push(E.aoMapUv),M.push(E.bumpMapUv),M.push(E.normalMapUv),M.push(E.displacementMapUv),M.push(E.emissiveMapUv),M.push(E.metalnessMapUv),M.push(E.roughnessMapUv),M.push(E.anisotropyMapUv),M.push(E.clearcoatMapUv),M.push(E.clearcoatNormalMapUv),M.push(E.clearcoatRoughnessMapUv),M.push(E.iridescenceMapUv),M.push(E.iridescenceThicknessMapUv),M.push(E.sheenColorMapUv),M.push(E.sheenRoughnessMapUv),M.push(E.specularMapUv),M.push(E.specularColorMapUv),M.push(E.specularIntensityMapUv),M.push(E.transmissionMapUv),M.push(E.thicknessMapUv),M.push(E.combine),M.push(E.fogExp2),M.push(E.sizeAttenuation),M.push(E.morphTargetsCount),M.push(E.morphAttributeCount),M.push(E.numDirLights),M.push(E.numPointLights),M.push(E.numSpotLights),M.push(E.numSpotLightMaps),M.push(E.numHemiLights),M.push(E.numRectAreaLights),M.push(E.numDirLightShadows),M.push(E.numPointLightShadows),M.push(E.numSpotLightShadows),M.push(E.numSpotLightShadowsWithMaps),M.push(E.numLightProbes),M.push(E.shadowMapType),M.push(E.toneMapping),M.push(E.numClippingPlanes),M.push(E.numClipIntersection),M.push(E.depthPacking)}function b(M,E){a.disableAll(),E.supportsVertexTextures&&a.enable(0),E.instancing&&a.enable(1),E.instancingColor&&a.enable(2),E.instancingMorph&&a.enable(3),E.matcap&&a.enable(4),E.envMap&&a.enable(5),E.normalMapObjectSpace&&a.enable(6),E.normalMapTangentSpace&&a.enable(7),E.clearcoat&&a.enable(8),E.iridescence&&a.enable(9),E.alphaTest&&a.enable(10),E.vertexColors&&a.enable(11),E.vertexAlphas&&a.enable(12),E.vertexUv1s&&a.enable(13),E.vertexUv2s&&a.enable(14),E.vertexUv3s&&a.enable(15),E.vertexTangents&&a.enable(16),E.anisotropy&&a.enable(17),E.alphaHash&&a.enable(18),E.batching&&a.enable(19),E.dispersion&&a.enable(20),E.batchingColor&&a.enable(21),M.push(a.mask),a.disableAll(),E.fog&&a.enable(0),E.useFog&&a.enable(1),E.flatShading&&a.enable(2),E.logarithmicDepthBuffer&&a.enable(3),E.reverseDepthBuffer&&a.enable(4),E.skinning&&a.enable(5),E.morphTargets&&a.enable(6),E.morphNormals&&a.enable(7),E.morphColors&&a.enable(8),E.premultipliedAlpha&&a.enable(9),E.shadowMapEnabled&&a.enable(10),E.doubleSided&&a.enable(11),E.flipSided&&a.enable(12),E.useDepthPacking&&a.enable(13),E.dithering&&a.enable(14),E.transmission&&a.enable(15),E.sheen&&a.enable(16),E.opaque&&a.enable(17),E.pointsUvs&&a.enable(18),E.decodeVideoTexture&&a.enable(19),E.decodeVideoTextureEmissive&&a.enable(20),E.alphaToCoverage&&a.enable(21),M.push(a.mask)}function y(M){const E=p[M.type];let D;if(E){const B=Pi[E];D=uE.clone(B.uniforms)}else D=M.uniforms;return D}function T(M,E){let D;for(let B=0,z=u.length;B0?i.push(m):h.transparent===!0?s.push(m):t.push(m)}function l(f,d,h,p,_,g){const m=o(f,d,h,p,_,g);h.transmission>0?i.unshift(m):h.transparent===!0?s.unshift(m):t.unshift(m)}function c(f,d){t.length>1&&t.sort(f||sF),i.length>1&&i.sort(d||zb),s.length>1&&s.sort(d||zb)}function u(){for(let f=e,d=n.length;f=r.length?(o=new Vb,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function oF(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new k,color:new Pe};break;case"SpotLight":t={position:new k,direction:new k,color:new Pe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new k,color:new Pe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new k,skyColor:new Pe,groundColor:new Pe};break;case"RectAreaLight":t={color:new Pe,position:new k,halfWidth:new k,halfHeight:new k};break}return n[e.id]=t,t}}}function aF(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let lF=0;function cF(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function uF(n){const e=new oF,t=aF(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new k);const s=new k,r=new Je,o=new Je;function a(c){let u=0,f=0,d=0;for(let M=0;M<9;M++)i.probe[M].set(0,0,0);let h=0,p=0,_=0,g=0,m=0,v=0,b=0,y=0,T=0,w=0,S=0;c.sort(cF);for(let M=0,E=c.length;M0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ae.LTC_FLOAT_1,i.rectAreaLTC2=Ae.LTC_FLOAT_2):(i.rectAreaLTC1=Ae.LTC_HALF_1,i.rectAreaLTC2=Ae.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=d;const P=i.hash;(P.directionalLength!==h||P.pointLength!==p||P.spotLength!==_||P.rectAreaLength!==g||P.hemiLength!==m||P.numDirectionalShadows!==v||P.numPointShadows!==b||P.numSpotShadows!==y||P.numSpotMaps!==T||P.numLightProbes!==S)&&(i.directional.length=h,i.spot.length=_,i.rectArea.length=g,i.point.length=p,i.hemi.length=m,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=y,i.spotShadowMap.length=y,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=y+T-w,i.spotLightMap.length=T,i.numSpotLightShadowsWithMaps=w,i.numLightProbes=S,P.directionalLength=h,P.pointLength=p,P.spotLength=_,P.rectAreaLength=g,P.hemiLength=m,P.numDirectionalShadows=v,P.numPointShadows=b,P.numSpotShadows=y,P.numSpotMaps=T,P.numLightProbes=S,i.version=lF++)}function l(c,u){let f=0,d=0,h=0,p=0,_=0;const g=u.matrixWorldInverse;for(let m=0,v=c.length;m=o.length?(a=new Hb(n),o.push(a)):a=o[r],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const dF=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,hF=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function pF(n,e,t){let i=new Ga;const s=new fe,r=new fe,o=new vt,a=new v_({depthPacking:K1}),l=new y_,c={},u=t.maxTextureSize,f={[Bs]:Vn,[Vn]:Bs,[Ii]:Ii},d=new Vi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new fe},radius:{value:4}},vertexShader:dF,fragmentShader:hF}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new ct;p.setAttribute("position",new It(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new jt(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=W0;let m=this.type;this.render=function(w,S,P){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||w.length===0)return;const M=n.getRenderTarget(),E=n.getActiveCubeFace(),D=n.getActiveMipmapLevel(),B=n.state;B.setBlending(Ds),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const z=m!==Zi&&this.type===Zi,V=m===Zi&&this.type!==Zi;for(let Q=0,j=w.length;Qu||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/pe.x),s.x=r.x*pe.x,Z.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/pe.y),s.y=r.y*pe.y,Z.mapSize.y=r.y)),Z.map===null||z===!0||V===!0){const re=this.type!==Zi?{minFilter:yn,magFilter:yn}:{};Z.map!==null&&Z.map.dispose(),Z.map=new os(s.x,s.y,re),Z.map.texture.name=te.name+".shadowMap",Z.camera.updateProjectionMatrix()}n.setRenderTarget(Z.map),n.clear();const Me=Z.getViewportCount();for(let re=0;re0||S.map&&S.alphaTest>0||S.alphaToCoverage===!0){const B=E.uuid,z=S.uuid;let V=c[B];V===void 0&&(V={},c[B]=V);let Q=V[z];Q===void 0&&(Q=E.clone(),V[z]=Q,S.addEventListener("dispose",T)),E=Q}if(E.visible=S.visible,E.wireframe=S.wireframe,M===Zi?E.side=S.shadowSide!==null?S.shadowSide:S.side:E.side=S.shadowSide!==null?S.shadowSide:f[S.side],E.alphaMap=S.alphaMap,E.alphaTest=S.alphaToCoverage===!0?.5:S.alphaTest,E.map=S.map,E.clipShadows=S.clipShadows,E.clippingPlanes=S.clippingPlanes,E.clipIntersection=S.clipIntersection,E.displacementMap=S.displacementMap,E.displacementScale=S.displacementScale,E.displacementBias=S.displacementBias,E.wireframeLinewidth=S.wireframeLinewidth,E.linewidth=S.linewidth,P.isPointLight===!0&&E.isMeshDistanceMaterial===!0){const B=n.properties.get(E);B.light=P}return E}function y(w,S,P,M,E){if(w.visible===!1)return;if(w.layers.test(S.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&E===Zi)&&(!w.frustumCulled||i.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,w.matrixWorld);const z=e.update(w),V=w.material;if(Array.isArray(V)){const Q=z.groups;for(let j=0,te=Q.length;j=1):Z.indexOf("OpenGL ES")!==-1&&(te=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),j=te>=2);let pe=null,Me={};const re=n.getParameter(n.SCISSOR_BOX),xe=n.getParameter(n.VIEWPORT),We=new vt().fromArray(re),oe=new vt().fromArray(xe);function ge(q,Ie,_e,Be){const ve=new Uint8Array(4),de=n.createTexture();n.bindTexture(q,de),n.texParameteri(q,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(q,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let He=0;He<_e;He++)q===n.TEXTURE_3D||q===n.TEXTURE_2D_ARRAY?n.texImage3D(Ie,0,n.RGBA,1,1,Be,0,n.RGBA,n.UNSIGNED_BYTE,ve):n.texImage2D(Ie+He,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,ve);return de}const Ee={};Ee[n.TEXTURE_2D]=ge(n.TEXTURE_2D,n.TEXTURE_2D,1),Ee[n.TEXTURE_CUBE_MAP]=ge(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),Ee[n.TEXTURE_2D_ARRAY]=ge(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),Ee[n.TEXTURE_3D]=ge(n.TEXTURE_3D,n.TEXTURE_3D,1,1),r.setClear(0,0,0,1),o.setClear(1),a.setClear(0),$(n.DEPTH_TEST),o.setFunc(So),G(!1),X(hg),$(n.CULL_FACE),A(Ds);function $(q){u[q]!==!0&&(n.enable(q),u[q]=!0)}function ae(q){u[q]!==!1&&(n.disable(q),u[q]=!1)}function le(q,Ie){return f[q]!==Ie?(n.bindFramebuffer(q,Ie),f[q]=Ie,q===n.DRAW_FRAMEBUFFER&&(f[n.FRAMEBUFFER]=Ie),q===n.FRAMEBUFFER&&(f[n.DRAW_FRAMEBUFFER]=Ie),!0):!1}function ue(q,Ie){let _e=h,Be=!1;if(q){_e=d.get(Ie),_e===void 0&&(_e=[],d.set(Ie,_e));const ve=q.textures;if(_e.length!==ve.length||_e[0]!==n.COLOR_ATTACHMENT0){for(let de=0,He=ve.length;de"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new fe,u=new WeakMap;let f;const d=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(R,x){return h?new OffscreenCanvas(R,x):pc("canvas")}function _(R,x,O){let Y=1;const ne=ce(R);if((ne.width>O||ne.height>O)&&(Y=O/Math.max(ne.width,ne.height)),Y<1)if(typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&R instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&R instanceof ImageBitmap||typeof VideoFrame<"u"&&R instanceof VideoFrame){const ee=Math.floor(Y*ne.width),Te=Math.floor(Y*ne.height);f===void 0&&(f=p(ee,Te));const me=x?p(ee,Te):f;return me.width=ee,me.height=Te,me.getContext("2d").drawImage(R,0,0,ee,Te),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ne.width+"x"+ne.height+") to ("+ee+"x"+Te+")."),me}else return"data"in R&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ne.width+"x"+ne.height+")."),R;return R}function g(R){return R.generateMipmaps}function m(R){n.generateMipmap(R)}function v(R){return R.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:R.isWebGL3DRenderTarget?n.TEXTURE_3D:R.isWebGLArrayRenderTarget||R.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function b(R,x,O,Y,ne=!1){if(R!==null){if(n[R]!==void 0)return n[R];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+R+"'")}let ee=x;if(x===n.RED&&(O===n.FLOAT&&(ee=n.R32F),O===n.HALF_FLOAT&&(ee=n.R16F),O===n.UNSIGNED_BYTE&&(ee=n.R8)),x===n.RED_INTEGER&&(O===n.UNSIGNED_BYTE&&(ee=n.R8UI),O===n.UNSIGNED_SHORT&&(ee=n.R16UI),O===n.UNSIGNED_INT&&(ee=n.R32UI),O===n.BYTE&&(ee=n.R8I),O===n.SHORT&&(ee=n.R16I),O===n.INT&&(ee=n.R32I)),x===n.RG&&(O===n.FLOAT&&(ee=n.RG32F),O===n.HALF_FLOAT&&(ee=n.RG16F),O===n.UNSIGNED_BYTE&&(ee=n.RG8)),x===n.RG_INTEGER&&(O===n.UNSIGNED_BYTE&&(ee=n.RG8UI),O===n.UNSIGNED_SHORT&&(ee=n.RG16UI),O===n.UNSIGNED_INT&&(ee=n.RG32UI),O===n.BYTE&&(ee=n.RG8I),O===n.SHORT&&(ee=n.RG16I),O===n.INT&&(ee=n.RG32I)),x===n.RGB_INTEGER&&(O===n.UNSIGNED_BYTE&&(ee=n.RGB8UI),O===n.UNSIGNED_SHORT&&(ee=n.RGB16UI),O===n.UNSIGNED_INT&&(ee=n.RGB32UI),O===n.BYTE&&(ee=n.RGB8I),O===n.SHORT&&(ee=n.RGB16I),O===n.INT&&(ee=n.RGB32I)),x===n.RGBA_INTEGER&&(O===n.UNSIGNED_BYTE&&(ee=n.RGBA8UI),O===n.UNSIGNED_SHORT&&(ee=n.RGBA16UI),O===n.UNSIGNED_INT&&(ee=n.RGBA32UI),O===n.BYTE&&(ee=n.RGBA8I),O===n.SHORT&&(ee=n.RGBA16I),O===n.INT&&(ee=n.RGBA32I)),x===n.RGB&&O===n.UNSIGNED_INT_5_9_9_9_REV&&(ee=n.RGB9_E5),x===n.RGBA){const Te=ne?fc:pt.getTransfer(Y);O===n.FLOAT&&(ee=n.RGBA32F),O===n.HALF_FLOAT&&(ee=n.RGBA16F),O===n.UNSIGNED_BYTE&&(ee=Te===Ct?n.SRGB8_ALPHA8:n.RGBA8),O===n.UNSIGNED_SHORT_4_4_4_4&&(ee=n.RGBA4),O===n.UNSIGNED_SHORT_5_5_5_1&&(ee=n.RGB5_A1)}return(ee===n.R16F||ee===n.R32F||ee===n.RG16F||ee===n.RG32F||ee===n.RGBA16F||ee===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ee}function y(R,x){let O;return R?x===null||x===Vs||x===Ta?O=n.DEPTH24_STENCIL8:x===Zn?O=n.DEPTH32F_STENCIL8:x===Ea&&(O=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):x===null||x===Vs||x===Ta?O=n.DEPTH_COMPONENT24:x===Zn?O=n.DEPTH_COMPONENT32F:x===Ea&&(O=n.DEPTH_COMPONENT16),O}function T(R,x){return g(R)===!0||R.isFramebufferTexture&&R.minFilter!==yn&&R.minFilter!==nn?Math.log2(Math.max(x.width,x.height))+1:R.mipmaps!==void 0&&R.mipmaps.length>0?R.mipmaps.length:R.isCompressedTexture&&Array.isArray(R.image)?x.mipmaps.length:1}function w(R){const x=R.target;x.removeEventListener("dispose",w),P(x),x.isVideoTexture&&u.delete(x)}function S(R){const x=R.target;x.removeEventListener("dispose",S),E(x)}function P(R){const x=i.get(R);if(x.__webglInit===void 0)return;const O=R.source,Y=d.get(O);if(Y){const ne=Y[x.__cacheKey];ne.usedTimes--,ne.usedTimes===0&&M(R),Object.keys(Y).length===0&&d.delete(O)}i.remove(R)}function M(R){const x=i.get(R);n.deleteTexture(x.__webglTexture);const O=R.source,Y=d.get(O);delete Y[x.__cacheKey],o.memory.textures--}function E(R){const x=i.get(R);if(R.depthTexture&&(R.depthTexture.dispose(),i.remove(R.depthTexture)),R.isWebGLCubeRenderTarget)for(let Y=0;Y<6;Y++){if(Array.isArray(x.__webglFramebuffer[Y]))for(let ne=0;ne=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+R+" texture units while this GPU supports only "+s.maxTextures),D+=1,R}function V(R){const x=[];return x.push(R.wrapS),x.push(R.wrapT),x.push(R.wrapR||0),x.push(R.magFilter),x.push(R.minFilter),x.push(R.anisotropy),x.push(R.internalFormat),x.push(R.format),x.push(R.type),x.push(R.generateMipmaps),x.push(R.premultiplyAlpha),x.push(R.flipY),x.push(R.unpackAlignment),x.push(R.colorSpace),x.join()}function Q(R,x){const O=i.get(R);if(R.isVideoTexture&&F(R),R.isRenderTargetTexture===!1&&R.version>0&&O.__version!==R.version){const Y=R.image;if(Y===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Y.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ee(O,R,x);return}}t.bindTexture(n.TEXTURE_2D,O.__webglTexture,n.TEXTURE0+x)}function j(R,x){const O=i.get(R);if(R.version>0&&O.__version!==R.version){Ee(O,R,x);return}t.bindTexture(n.TEXTURE_2D_ARRAY,O.__webglTexture,n.TEXTURE0+x)}function te(R,x){const O=i.get(R);if(R.version>0&&O.__version!==R.version){Ee(O,R,x);return}t.bindTexture(n.TEXTURE_3D,O.__webglTexture,n.TEXTURE0+x)}function Z(R,x){const O=i.get(R);if(R.version>0&&O.__version!==R.version){$(O,R,x);return}t.bindTexture(n.TEXTURE_CUBE_MAP,O.__webglTexture,n.TEXTURE0+x)}const pe={[ac]:n.REPEAT,[gi]:n.CLAMP_TO_EDGE,[lc]:n.MIRRORED_REPEAT},Me={[yn]:n.NEAREST,[$0]:n.NEAREST_MIPMAP_NEAREST,[aa]:n.NEAREST_MIPMAP_LINEAR,[nn]:n.LINEAR,[Al]:n.LINEAR_MIPMAP_NEAREST,[es]:n.LINEAR_MIPMAP_LINEAR},re={[J1]:n.NEVER,[sE]:n.ALWAYS,[Q1]:n.LESS,[t_]:n.LEQUAL,[eE]:n.EQUAL,[iE]:n.GEQUAL,[tE]:n.GREATER,[nE]:n.NOTEQUAL};function xe(R,x){if(x.type===Zn&&e.has("OES_texture_float_linear")===!1&&(x.magFilter===nn||x.magFilter===Al||x.magFilter===aa||x.magFilter===es||x.minFilter===nn||x.minFilter===Al||x.minFilter===aa||x.minFilter===es)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(R,n.TEXTURE_WRAP_S,pe[x.wrapS]),n.texParameteri(R,n.TEXTURE_WRAP_T,pe[x.wrapT]),(R===n.TEXTURE_3D||R===n.TEXTURE_2D_ARRAY)&&n.texParameteri(R,n.TEXTURE_WRAP_R,pe[x.wrapR]),n.texParameteri(R,n.TEXTURE_MAG_FILTER,Me[x.magFilter]),n.texParameteri(R,n.TEXTURE_MIN_FILTER,Me[x.minFilter]),x.compareFunction&&(n.texParameteri(R,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(R,n.TEXTURE_COMPARE_FUNC,re[x.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===yn||x.minFilter!==aa&&x.minFilter!==es||x.type===Zn&&e.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||i.get(x).__currentAnisotropy){const O=e.get("EXT_texture_filter_anisotropic");n.texParameterf(R,O.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,s.getMaxAnisotropy())),i.get(x).__currentAnisotropy=x.anisotropy}}}function We(R,x){let O=!1;R.__webglInit===void 0&&(R.__webglInit=!0,x.addEventListener("dispose",w));const Y=x.source;let ne=d.get(Y);ne===void 0&&(ne={},d.set(Y,ne));const ee=V(x);if(ee!==R.__cacheKey){ne[ee]===void 0&&(ne[ee]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,O=!0),ne[ee].usedTimes++;const Te=ne[R.__cacheKey];Te!==void 0&&(ne[R.__cacheKey].usedTimes--,Te.usedTimes===0&&M(x)),R.__cacheKey=ee,R.__webglTexture=ne[ee].texture}return O}function oe(R,x,O){return Math.floor(Math.floor(R/O)/x)}function ge(R,x,O,Y){const ee=R.updateRanges;if(ee.length===0)t.texSubImage2D(n.TEXTURE_2D,0,0,0,x.width,x.height,O,Y,x.data);else{ee.sort((he,Ne)=>he.start-Ne.start);let Te=0;for(let he=1;he0){q&&Ie&&t.texStorage2D(n.TEXTURE_2D,Be,Ve,it[0].width,it[0].height);for(let ve=0,de=it.length;ve0){const He=wg(we.width,we.height,x.format,x.type);for(const ot of x.layerUpdates){const Ut=we.data.subarray(ot*He/we.data.BYTES_PER_ELEMENT,(ot+1)*He/we.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ve,0,0,ot,we.width,we.height,1,Ne,Ut)}x.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ve,0,0,0,we.width,we.height,he.depth,Ne,we.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,ve,Ve,we.width,we.height,he.depth,0,we.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else q?_e&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,ve,0,0,0,we.width,we.height,he.depth,Ne,ze,we.data):t.texImage3D(n.TEXTURE_2D_ARRAY,ve,Ve,we.width,we.height,he.depth,0,Ne,ze,we.data)}else{q&&Ie&&t.texStorage2D(n.TEXTURE_2D,Be,Ve,it[0].width,it[0].height);for(let ve=0,de=it.length;ve0){const ve=wg(he.width,he.height,x.format,x.type);for(const de of x.layerUpdates){const He=he.data.subarray(de*ve/he.data.BYTES_PER_ELEMENT,(de+1)*ve/he.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,de,he.width,he.height,1,Ne,ze,He)}x.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,he.width,he.height,he.depth,Ne,ze,he.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Ve,he.width,he.height,he.depth,0,Ne,ze,he.data);else if(x.isData3DTexture)q?(Ie&&t.texStorage3D(n.TEXTURE_3D,Be,Ve,he.width,he.height,he.depth),_e&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,he.width,he.height,he.depth,Ne,ze,he.data)):t.texImage3D(n.TEXTURE_3D,0,Ve,he.width,he.height,he.depth,0,Ne,ze,he.data);else if(x.isFramebufferTexture){if(Ie)if(q)t.texStorage2D(n.TEXTURE_2D,Be,Ve,he.width,he.height);else{let ve=he.width,de=he.height;for(let He=0;He>=1,de>>=1}}else if(it.length>0){if(q&&Ie){const ve=ce(it[0]);t.texStorage2D(n.TEXTURE_2D,Be,Ve,ve.width,ve.height)}for(let ve=0,de=it.length;ve0&&Be++;const de=ce(Ne[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Be,it,de.width,de.height)}for(let de=0;de<6;de++)if(he){q?_e&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Ne[de].width,Ne[de].height,Ve,we,Ne[de].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,it,Ne[de].width,Ne[de].height,0,Ve,we,Ne[de].data);for(let He=0;He>ee),ze=Math.max(1,x.height>>ee);ne===n.TEXTURE_3D||ne===n.TEXTURE_2D_ARRAY?t.texImage3D(ne,ee,Re,Ne,ze,x.depth,0,Te,me,null):t.texImage2D(ne,ee,Re,Ne,ze,0,Te,me,null)}t.bindFramebuffer(n.FRAMEBUFFER,R),I(x)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Y,ne,he.__webglTexture,0,C(x)):(ne===n.TEXTURE_2D||ne>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ne<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,Y,ne,he.__webglTexture,ee),t.bindFramebuffer(n.FRAMEBUFFER,null)}function le(R,x,O){if(n.bindRenderbuffer(n.RENDERBUFFER,R),x.depthBuffer){const Y=x.depthTexture,ne=Y&&Y.isDepthTexture?Y.type:null,ee=y(x.stencilBuffer,ne),Te=x.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,me=C(x);I(x)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,me,ee,x.width,x.height):O?n.renderbufferStorageMultisample(n.RENDERBUFFER,me,ee,x.width,x.height):n.renderbufferStorage(n.RENDERBUFFER,ee,x.width,x.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Te,n.RENDERBUFFER,R)}else{const Y=x.textures;for(let ne=0;ne{delete x.__boundDepthTexture,delete x.__depthDisposeCallback,Y.removeEventListener("dispose",ne)};Y.addEventListener("dispose",ne),x.__depthDisposeCallback=ne}x.__boundDepthTexture=Y}if(R.depthTexture&&!x.__autoAllocateDepthBuffer){if(O)throw new Error("target.depthTexture not supported in Cube render targets");const Y=R.texture.mipmaps;Y&&Y.length>0?ue(x.__webglFramebuffer[0],R):ue(x.__webglFramebuffer,R)}else if(O){x.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)if(t.bindFramebuffer(n.FRAMEBUFFER,x.__webglFramebuffer[Y]),x.__webglDepthbuffer[Y]===void 0)x.__webglDepthbuffer[Y]=n.createRenderbuffer(),le(x.__webglDepthbuffer[Y],R,!1);else{const ne=R.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ee=x.__webglDepthbuffer[Y];n.bindRenderbuffer(n.RENDERBUFFER,ee),n.framebufferRenderbuffer(n.FRAMEBUFFER,ne,n.RENDERBUFFER,ee)}}else{const Y=R.texture.mipmaps;if(Y&&Y.length>0?t.bindFramebuffer(n.FRAMEBUFFER,x.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer===void 0)x.__webglDepthbuffer=n.createRenderbuffer(),le(x.__webglDepthbuffer,R,!1);else{const ne=R.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ee=x.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,ee),n.framebufferRenderbuffer(n.FRAMEBUFFER,ne,n.RENDERBUFFER,ee)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function N(R,x,O){const Y=i.get(R);x!==void 0&&ae(Y.__webglFramebuffer,R,R.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),O!==void 0&&qe(R)}function U(R){const x=R.texture,O=i.get(R),Y=i.get(x);R.addEventListener("dispose",S);const ne=R.textures,ee=R.isWebGLCubeRenderTarget===!0,Te=ne.length>1;if(Te||(Y.__webglTexture===void 0&&(Y.__webglTexture=n.createTexture()),Y.__version=x.version,o.memory.textures++),ee){O.__webglFramebuffer=[];for(let me=0;me<6;me++)if(x.mipmaps&&x.mipmaps.length>0){O.__webglFramebuffer[me]=[];for(let Re=0;Re0){O.__webglFramebuffer=[];for(let me=0;me0&&I(R)===!1){O.__webglMultisampledFramebuffer=n.createFramebuffer(),O.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,O.__webglMultisampledFramebuffer);for(let me=0;me0)for(let Re=0;Re0)for(let Re=0;Re0){if(I(R)===!1){const x=R.textures,O=R.width,Y=R.height;let ne=n.COLOR_BUFFER_BIT;const ee=R.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Te=i.get(R),me=x.length>1;if(me)for(let De=0;De0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,Te.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,Te.__webglFramebuffer);for(let De=0;De0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function F(R){const x=o.render.frame;u.get(R)!==x&&(u.set(R,x),R.update())}function H(R,x){const O=R.colorSpace,Y=R.format,ne=R.type;return R.isCompressedTexture===!0||R.isVideoTexture===!0||O!==Eo&&O!==ws&&(pt.getTransfer(O)===Ct?(Y!==zn||ne!==zi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",O)),x}function ce(R){return typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement?(c.width=R.naturalWidth||R.width,c.height=R.naturalHeight||R.height):typeof VideoFrame<"u"&&R instanceof VideoFrame?(c.width=R.displayWidth,c.height=R.displayHeight):(c.width=R.width,c.height=R.height),c}this.allocateTextureUnit=z,this.resetTextureUnits=B,this.setTexture2D=Q,this.setTexture2DArray=j,this.setTexture3D=te,this.setTextureCube=Z,this.rebindTextures=N,this.setupRenderTarget=U,this.updateRenderTargetMipmap=A,this.updateMultisampleRenderTarget=X,this.setupDepthRenderbuffer=qe,this.setupFrameBufferTexture=ae,this.useMultisampledRTT=I}function mT(n,e){function t(i,s=ws){let r;const o=pt.getTransfer(s);if(i===zi)return n.UNSIGNED_BYTE;if(i===lh)return n.UNSIGNED_SHORT_4_4_4_4;if(i===ch)return n.UNSIGNED_SHORT_5_5_5_1;if(i===j0)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===q0)return n.BYTE;if(i===Y0)return n.SHORT;if(i===Ea)return n.UNSIGNED_SHORT;if(i===ah)return n.INT;if(i===Vs)return n.UNSIGNED_INT;if(i===Zn)return n.FLOAT;if(i===Va)return n.HALF_FLOAT;if(i===K0)return n.ALPHA;if(i===Z0)return n.RGB;if(i===zn)return n.RGBA;if(i===wa)return n.DEPTH_COMPONENT;if(i===Aa)return n.DEPTH_STENCIL;if(i===uh)return n.RED;if(i===kc)return n.RED_INTEGER;if(i===J0)return n.RG;if(i===fh)return n.RG_INTEGER;if(i===dh)return n.RGBA_INTEGER;if(i===Cl||i===Rl||i===Pl||i===Il)if(o===Ct)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Cl)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Rl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Pl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Il)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Cl)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Rl)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Pl)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Il)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Jf||i===Qf||i===ed||i===td)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===Jf)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Qf)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===ed)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===td)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===nd||i===id||i===sd)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(i===nd||i===id)return o===Ct?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===sd)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===rd||i===od||i===ad||i===ld||i===cd||i===ud||i===fd||i===dd||i===hd||i===pd||i===md||i===gd||i===_d||i===vd)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(i===rd)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===od)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===ad)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===ld)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===cd)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===ud)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===fd)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===dd)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===hd)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===pd)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===md)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===gd)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===_d)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===vd)return o===Ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Ll||i===yd||i===bd)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(i===Ll)return o===Ct?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===yd)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===bd)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Q0||i===xd||i===Md||i===Sd)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(i===Ll)return r.COMPRESSED_RED_RGTC1_EXT;if(i===xd)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Md)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Sd)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Ta?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const vF=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,yF=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class bF{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const s=new $t,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Vi({vertexShader:vF,fragmentShader:yF,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new jt(new Wa(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class xF extends as{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,f=null,d=null,h=null,p=null;const _=new bF,g=t.getContextAttributes();let m=null,v=null;const b=[],y=[],T=new fe;let w=null;const S=new Jt;S.viewport=new vt;const P=new Jt;P.viewport=new vt;const M=[S,P],E=new sT;let D=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(oe){let ge=b[oe];return ge===void 0&&(ge=new Sf,b[oe]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(oe){let ge=b[oe];return ge===void 0&&(ge=new Sf,b[oe]=ge),ge.getGripSpace()},this.getHand=function(oe){let ge=b[oe];return ge===void 0&&(ge=new Sf,b[oe]=ge),ge.getHandSpace()};function z(oe){const ge=y.indexOf(oe.inputSource);if(ge===-1)return;const Ee=b[ge];Ee!==void 0&&(Ee.update(oe.inputSource,oe.frame,c||o),Ee.dispatchEvent({type:oe.type,data:oe.inputSource}))}function V(){s.removeEventListener("select",z),s.removeEventListener("selectstart",z),s.removeEventListener("selectend",z),s.removeEventListener("squeeze",z),s.removeEventListener("squeezestart",z),s.removeEventListener("squeezeend",z),s.removeEventListener("end",V),s.removeEventListener("inputsourceschange",Q);for(let oe=0;oe=0&&(y[$]=null,b[$].disconnect(Ee))}for(let ge=0;ge=y.length){y.push(Ee),$=le;break}else if(y[le]===null){y[le]=Ee,$=le;break}if($===-1)break}const ae=b[$];ae&&ae.connect(Ee)}}const j=new k,te=new k;function Z(oe,ge,Ee){j.setFromMatrixPosition(ge.matrixWorld),te.setFromMatrixPosition(Ee.matrixWorld);const $=j.distanceTo(te),ae=ge.projectionMatrix.elements,le=Ee.projectionMatrix.elements,ue=ae[14]/(ae[10]-1),qe=ae[14]/(ae[10]+1),N=(ae[9]+1)/ae[5],U=(ae[9]-1)/ae[5],A=(ae[8]-1)/ae[0],W=(le[8]+1)/le[0],G=ue*A,X=ue*W,C=$/(-A+W),I=C*-A;if(ge.matrixWorld.decompose(oe.position,oe.quaternion,oe.scale),oe.translateX(I),oe.translateZ(C),oe.matrixWorld.compose(oe.position,oe.quaternion,oe.scale),oe.matrixWorldInverse.copy(oe.matrixWorld).invert(),ae[10]===-1)oe.projectionMatrix.copy(ge.projectionMatrix),oe.projectionMatrixInverse.copy(ge.projectionMatrixInverse);else{const F=ue+C,H=qe+C,ce=G-I,R=X+($-I),x=N*qe/H*F,O=U*qe/H*F;oe.projectionMatrix.makePerspective(ce,R,x,O,F,H),oe.projectionMatrixInverse.copy(oe.projectionMatrix).invert()}}function pe(oe,ge){ge===null?oe.matrixWorld.copy(oe.matrix):oe.matrixWorld.multiplyMatrices(ge.matrixWorld,oe.matrix),oe.matrixWorldInverse.copy(oe.matrixWorld).invert()}this.updateCamera=function(oe){if(s===null)return;let ge=oe.near,Ee=oe.far;_.texture!==null&&(_.depthNear>0&&(ge=_.depthNear),_.depthFar>0&&(Ee=_.depthFar)),E.near=P.near=S.near=ge,E.far=P.far=S.far=Ee,(D!==E.near||B!==E.far)&&(s.updateRenderState({depthNear:E.near,depthFar:E.far}),D=E.near,B=E.far),S.layers.mask=oe.layers.mask|2,P.layers.mask=oe.layers.mask|4,E.layers.mask=S.layers.mask|P.layers.mask;const $=oe.parent,ae=E.cameras;pe(E,$);for(let le=0;le0&&(g.alphaTest.value=m.alphaTest);const v=e.get(m),b=v.envMap,y=v.envMapRotation;b&&(g.envMap.value=b,eo.copy(y),eo.x*=-1,eo.y*=-1,eo.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(eo.y*=-1,eo.z*=-1),g.envMapRotation.value.setFromMatrix4(MF.makeRotationFromEuler(eo)),g.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,g.aoMapTransform))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform))}function a(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,v,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*v,g.scale.value=b*.5,m.map&&(g.map.value=m.map,t(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function f(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function d(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function h(g,m,v){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Vn&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,m){m.matcap&&(g.matcap.value=m.matcap)}function _(g,m){const v=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(v.matrixWorld),g.nearDistance.value=v.shadow.camera.near,g.farDistance.value=v.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function EF(n,e,t,i){let s={},r={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(v,b){const y=b.program;i.uniformBlockBinding(v,y)}function c(v,b){let y=s[v.id];y===void 0&&(p(v),y=u(v),s[v.id]=y,v.addEventListener("dispose",g));const T=b.program;i.updateUBOMapping(v,T);const w=e.render.frame;r[v.id]!==w&&(d(v),r[v.id]=w)}function u(v){const b=f();v.__bindingPointIndex=b;const y=n.createBuffer(),T=v.__size,w=v.usage;return n.bindBuffer(n.UNIFORM_BUFFER,y),n.bufferData(n.UNIFORM_BUFFER,T,w),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,b,y),y}function f(){for(let v=0;v0&&(y+=T-w),v.__size=y,v.__cache={},this}function _(v){const b={boundary:0,storage:0};return typeof v=="number"||typeof v=="boolean"?(b.boundary=4,b.storage=4):v.isVector2?(b.boundary=8,b.storage=8):v.isVector3||v.isColor?(b.boundary=16,b.storage=12):v.isVector4?(b.boundary=16,b.storage=16):v.isMatrix3?(b.boundary=48,b.storage=48):v.isMatrix4?(b.boundary=64,b.storage=64):v.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",v),b}function g(v){const b=v.target;b.removeEventListener("dispose",g);const y=o.indexOf(b.__bindingPointIndex);o.splice(y,1),n.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function m(){for(const v in s)n.deleteBuffer(s[v]);o=[],s={},r={}}return{bind:l,update:c,dispose:m}}class Tf{constructor(e={}){const{canvas:t=oE(),context:i=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let h;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=i.getContextAttributes().alpha}else h=o;const p=new Uint32Array(4),_=new Int32Array(4);let g=null,m=null;const v=[],b=[];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=ns,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const y=this;let T=!1;this._outputColorSpace=Fn;let w=0,S=0,P=null,M=-1,E=null;const D=new vt,B=new vt;let z=null;const V=new Pe(0);let Q=0,j=t.width,te=t.height,Z=1,pe=null,Me=null;const re=new vt(0,0,j,te),xe=new vt(0,0,j,te);let We=!1;const oe=new Ga;let ge=!1,Ee=!1;const $=new Je,ae=new Je,le=new k,ue=new vt,qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let N=!1;function U(){return P===null?Z:1}let A=i;function W(L,K){return t.getContext(L,K)}try{const L={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Uc}`),t.addEventListener("webglcontextlost",Be,!1),t.addEventListener("webglcontextrestored",ve,!1),t.addEventListener("webglcontextcreationerror",de,!1),A===null){const K="webgl2";if(A=W(K,L),A===null)throw W(K)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw console.error("THREE.WebGLRenderer: "+L.message),L}let G,X,C,I,F,H,ce,R,x,O,Y,ne,ee,Te,me,Re,De,he,Ne,ze,Ve,we,it,q;function Ie(){G=new UN(A),G.init(),we=new mT(A,G),X=new RN(A,G,e,we),C=new gF(A,G),X.reverseDepthBuffer&&d&&C.buffers.depth.setReversed(!0),I=new BN(A),F=new iF,H=new _F(A,G,C,F,X,we,I),ce=new IN(y),R=new NN(y),x=new XL(A),it=new AN(A,x),O=new FN(A,x,I,it),Y=new VN(A,O,x,I),Ne=new zN(A,X,H),Re=new PN(F),ne=new nF(y,ce,R,G,X,it,Re),ee=new SF(y,F),Te=new rF,me=new fF(G),he=new wN(y,ce,R,C,Y,h,l),De=new pF(y,Y,X),q=new EF(A,I,X,C),ze=new CN(A,G,I),Ve=new kN(A,G,I),I.programs=ne.programs,y.capabilities=X,y.extensions=G,y.properties=F,y.renderLists=Te,y.shadowMap=De,y.state=C,y.info=I}Ie();const _e=new xF(y,A);this.xr=_e,this.getContext=function(){return A},this.getContextAttributes=function(){return A.getContextAttributes()},this.forceContextLoss=function(){const L=G.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=G.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(L){L!==void 0&&(Z=L,this.setSize(j,te,!1))},this.getSize=function(L){return L.set(j,te)},this.setSize=function(L,K,ie=!0){if(_e.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}j=L,te=K,t.width=Math.floor(L*Z),t.height=Math.floor(K*Z),ie===!0&&(t.style.width=L+"px",t.style.height=K+"px"),this.setViewport(0,0,L,K)},this.getDrawingBufferSize=function(L){return L.set(j*Z,te*Z).floor()},this.setDrawingBufferSize=function(L,K,ie){j=L,te=K,Z=ie,t.width=Math.floor(L*ie),t.height=Math.floor(K*ie),this.setViewport(0,0,L,K)},this.getCurrentViewport=function(L){return L.copy(D)},this.getViewport=function(L){return L.copy(re)},this.setViewport=function(L,K,ie,se){L.isVector4?re.set(L.x,L.y,L.z,L.w):re.set(L,K,ie,se),C.viewport(D.copy(re).multiplyScalar(Z).round())},this.getScissor=function(L){return L.copy(xe)},this.setScissor=function(L,K,ie,se){L.isVector4?xe.set(L.x,L.y,L.z,L.w):xe.set(L,K,ie,se),C.scissor(B.copy(xe).multiplyScalar(Z).round())},this.getScissorTest=function(){return We},this.setScissorTest=function(L){C.setScissorTest(We=L)},this.setOpaqueSort=function(L){pe=L},this.setTransparentSort=function(L){Me=L},this.getClearColor=function(L){return L.copy(he.getClearColor())},this.setClearColor=function(){he.setClearColor(...arguments)},this.getClearAlpha=function(){return he.getClearAlpha()},this.setClearAlpha=function(){he.setClearAlpha(...arguments)},this.clear=function(L=!0,K=!0,ie=!0){let se=0;if(L){let J=!1;if(P!==null){const be=P.texture.format;J=be===dh||be===fh||be===kc}if(J){const be=P.texture.type,Le=be===zi||be===Vs||be===Ea||be===Ta||be===lh||be===ch,Ge=he.getClearColor(),Ue=he.getClearAlpha(),Qe=Ge.r,tt=Ge.g,Ye=Ge.b;Le?(p[0]=Qe,p[1]=tt,p[2]=Ye,p[3]=Ue,A.clearBufferuiv(A.COLOR,0,p)):(_[0]=Qe,_[1]=tt,_[2]=Ye,_[3]=Ue,A.clearBufferiv(A.COLOR,0,_))}else se|=A.COLOR_BUFFER_BIT}K&&(se|=A.DEPTH_BUFFER_BIT),ie&&(se|=A.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),A.clear(se)},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",Be,!1),t.removeEventListener("webglcontextrestored",ve,!1),t.removeEventListener("webglcontextcreationerror",de,!1),he.dispose(),Te.dispose(),me.dispose(),F.dispose(),ce.dispose(),R.dispose(),Y.dispose(),it.dispose(),q.dispose(),ne.dispose(),_e.dispose(),_e.removeEventListener("sessionstart",hv),_e.removeEventListener("sessionend",pv),Nr.stop()};function Be(L){L.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),T=!0}function ve(){console.log("THREE.WebGLRenderer: Context Restored."),T=!1;const L=I.autoReset,K=De.enabled,ie=De.autoUpdate,se=De.needsUpdate,J=De.type;Ie(),I.autoReset=L,De.enabled=K,De.autoUpdate=ie,De.needsUpdate=se,De.type=J}function de(L){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function He(L){const K=L.target;K.removeEventListener("dispose",He),ot(K)}function ot(L){Ut(L),F.remove(L)}function Ut(L){const K=F.get(L).programs;K!==void 0&&(K.forEach(function(ie){ne.releaseProgram(ie)}),L.isShaderMaterial&&ne.releaseShaderCache(L))}this.renderBufferDirect=function(L,K,ie,se,J,be){K===null&&(K=qe);const Le=J.isMesh&&J.matrixWorld.determinant()<0,Ge=tC(L,K,ie,se,J);C.setMaterial(se,Le);let Ue=ie.index,Qe=1;if(se.wireframe===!0){if(Ue=O.getWireframeAttribute(ie),Ue===void 0)return;Qe=2}const tt=ie.drawRange,Ye=ie.attributes.position;let ht=tt.start*Qe,At=(tt.start+tt.count)*Qe;be!==null&&(ht=Math.max(ht,be.start*Qe),At=Math.min(At,(be.start+be.count)*Qe)),Ue!==null?(ht=Math.max(ht,0),At=Math.min(At,Ue.count)):Ye!=null&&(ht=Math.max(ht,0),At=Math.min(At,Ye.count));const zt=At-ht;if(zt<0||zt===1/0)return;it.setup(J,se,Ge,ie,Ue);let Wt,yt=ze;if(Ue!==null&&(Wt=x.get(Ue),yt=Ve,yt.setIndex(Wt)),J.isMesh)se.wireframe===!0?(C.setLineWidth(se.wireframeLinewidth*U()),yt.setMode(A.LINES)):yt.setMode(A.TRIANGLES);else if(J.isLine){let je=se.linewidth;je===void 0&&(je=1),C.setLineWidth(je*U()),J.isLineSegments?yt.setMode(A.LINES):J.isLineLoop?yt.setMode(A.LINE_LOOP):yt.setMode(A.LINE_STRIP)}else J.isPoints?yt.setMode(A.POINTS):J.isSprite&&yt.setMode(A.TRIANGLES);if(J.isBatchedMesh)if(J._multiDrawInstances!==null)ga("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),yt.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances);else if(G.get("WEBGL_multi_draw"))yt.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else{const je=J._multiDrawStarts,hn=J._multiDrawCounts,Mt=J._multiDrawCount,wi=Ue?x.get(Ue).bytesPerElement:1,Uo=F.get(se).currentProgram.getUniforms();for(let ni=0;ni{function be(){if(se.forEach(function(Le){F.get(Le).currentProgram.isReady()&&se.delete(Le)}),se.size===0){J(L);return}setTimeout(be,10)}G.get("KHR_parallel_shader_compile")!==null?be():setTimeout(be,10)})};let Ti=null;function us(L){Ti&&Ti(L)}function hv(){Nr.stop()}function pv(){Nr.start()}const Nr=new uT;Nr.setAnimationLoop(us),typeof self<"u"&&Nr.setContext(self),this.setAnimationLoop=function(L){Ti=L,_e.setAnimationLoop(L),L===null?Nr.stop():Nr.start()},_e.addEventListener("sessionstart",hv),_e.addEventListener("sessionend",pv),this.render=function(L,K){if(K!==void 0&&K.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),K.parent===null&&K.matrixWorldAutoUpdate===!0&&K.updateMatrixWorld(),_e.enabled===!0&&_e.isPresenting===!0&&(_e.cameraAutoUpdate===!0&&_e.updateCamera(K),K=_e.getCamera()),L.isScene===!0&&L.onBeforeRender(y,L,K,P),m=me.get(L,b.length),m.init(K),b.push(m),ae.multiplyMatrices(K.projectionMatrix,K.matrixWorldInverse),oe.setFromProjectionMatrix(ae),Ee=this.localClippingEnabled,ge=Re.init(this.clippingPlanes,Ee),g=Te.get(L,v.length),g.init(),v.push(g),_e.enabled===!0&&_e.isPresenting===!0){const be=y.xr.getDepthSensingMesh();be!==null&&lp(be,K,-1/0,y.sortObjects)}lp(L,K,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(pe,Me),N=_e.enabled===!1||_e.isPresenting===!1||_e.hasDepthSensing()===!1,N&&he.addToRenderList(g,L),this.info.render.frame++,ge===!0&&Re.beginShadows();const ie=m.state.shadowsArray;De.render(ie,L,K),ge===!0&&Re.endShadows(),this.info.autoReset===!0&&this.info.reset();const se=g.opaque,J=g.transmissive;if(m.setupLights(),K.isArrayCamera){const be=K.cameras;if(J.length>0)for(let Le=0,Ge=be.length;Le0&&gv(se,J,L,K),N&&he.render(L),mv(g,L,K);P!==null&&S===0&&(H.updateMultisampleRenderTarget(P),H.updateRenderTargetMipmap(P)),L.isScene===!0&&L.onAfterRender(y,L,K),it.resetDefaultState(),M=-1,E=null,b.pop(),b.length>0?(m=b[b.length-1],ge===!0&&Re.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,v.pop(),v.length>0?g=v[v.length-1]:g=null};function lp(L,K,ie,se){if(L.visible===!1)return;if(L.layers.test(K.layers)){if(L.isGroup)ie=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(K);else if(L.isLight)m.pushLight(L),L.castShadow&&m.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||oe.intersectsSprite(L)){se&&ue.setFromMatrixPosition(L.matrixWorld).applyMatrix4(ae);const Le=Y.update(L),Ge=L.material;Ge.visible&&g.push(L,Le,Ge,ie,ue.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||oe.intersectsObject(L))){const Le=Y.update(L),Ge=L.material;if(se&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),ue.copy(L.boundingSphere.center)):(Le.boundingSphere===null&&Le.computeBoundingSphere(),ue.copy(Le.boundingSphere.center)),ue.applyMatrix4(L.matrixWorld).applyMatrix4(ae)),Array.isArray(Ge)){const Ue=Le.groups;for(let Qe=0,tt=Ue.length;Qe0&&iu(J,K,ie),be.length>0&&iu(be,K,ie),Le.length>0&&iu(Le,K,ie),C.buffers.depth.setTest(!0),C.buffers.depth.setMask(!0),C.buffers.color.setMask(!0),C.setPolygonOffset(!1)}function gv(L,K,ie,se){if((ie.isScene===!0?ie.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[se.id]===void 0&&(m.state.transmissionRenderTarget[se.id]=new os(1,1,{generateMipmaps:!0,type:G.has("EXT_color_buffer_half_float")||G.has("EXT_color_buffer_float")?Va:zi,minFilter:es,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:pt.workingColorSpace}));const be=m.state.transmissionRenderTarget[se.id],Le=se.viewport||D;be.setSize(Le.z*y.transmissionResolutionScale,Le.w*y.transmissionResolutionScale);const Ge=y.getRenderTarget();y.setRenderTarget(be),y.getClearColor(V),Q=y.getClearAlpha(),Q<1&&y.setClearColor(16777215,.5),y.clear(),N&&he.render(ie);const Ue=y.toneMapping;y.toneMapping=ns;const Qe=se.viewport;if(se.viewport!==void 0&&(se.viewport=void 0),m.setupLightsView(se),ge===!0&&Re.setGlobalState(y.clippingPlanes,se),iu(L,ie,se),H.updateMultisampleRenderTarget(be),H.updateRenderTargetMipmap(be),G.has("WEBGL_multisampled_render_to_texture")===!1){let tt=!1;for(let Ye=0,ht=K.length;Ye0),Ye=!!ie.morphAttributes.position,ht=!!ie.morphAttributes.normal,At=!!ie.morphAttributes.color;let zt=ns;se.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(zt=y.toneMapping);const Wt=ie.morphAttributes.position||ie.morphAttributes.normal||ie.morphAttributes.color,yt=Wt!==void 0?Wt.length:0,je=F.get(se),hn=m.state.lights;if(ge===!0&&(Ee===!0||L!==E)){const In=L===E&&se.id===M;Re.setState(se,L,In)}let Mt=!1;se.version===je.__version?(je.needsLights&&je.lightsStateVersion!==hn.state.version||je.outputColorSpace!==Ge||J.isBatchedMesh&&je.batching===!1||!J.isBatchedMesh&&je.batching===!0||J.isBatchedMesh&&je.batchingColor===!0&&J.colorTexture===null||J.isBatchedMesh&&je.batchingColor===!1&&J.colorTexture!==null||J.isInstancedMesh&&je.instancing===!1||!J.isInstancedMesh&&je.instancing===!0||J.isSkinnedMesh&&je.skinning===!1||!J.isSkinnedMesh&&je.skinning===!0||J.isInstancedMesh&&je.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&je.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&je.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&je.instancingMorph===!1&&J.morphTexture!==null||je.envMap!==Ue||se.fog===!0&&je.fog!==be||je.numClippingPlanes!==void 0&&(je.numClippingPlanes!==Re.numPlanes||je.numIntersection!==Re.numIntersection)||je.vertexAlphas!==Qe||je.vertexTangents!==tt||je.morphTargets!==Ye||je.morphNormals!==ht||je.morphColors!==At||je.toneMapping!==zt||je.morphTargetsCount!==yt)&&(Mt=!0):(Mt=!0,je.__version=se.version);let wi=je.currentProgram;Mt===!0&&(wi=su(se,K,J));let Uo=!1,ni=!1,Ka=!1;const kt=wi.getUniforms(),ci=je.uniforms;if(C.useProgram(wi.program)&&(Uo=!0,ni=!0,Ka=!0),se.id!==M&&(M=se.id,ni=!0),Uo||E!==L){C.buffers.depth.getReversed()?($.copy(L.projectionMatrix),dP($),hP($),kt.setValue(A,"projectionMatrix",$)):kt.setValue(A,"projectionMatrix",L.projectionMatrix),kt.setValue(A,"viewMatrix",L.matrixWorldInverse);const Xn=kt.map.cameraPosition;Xn!==void 0&&Xn.setValue(A,le.setFromMatrixPosition(L.matrixWorld)),X.logarithmicDepthBuffer&&kt.setValue(A,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(se.isMeshPhongMaterial||se.isMeshToonMaterial||se.isMeshLambertMaterial||se.isMeshBasicMaterial||se.isMeshStandardMaterial||se.isShaderMaterial)&&kt.setValue(A,"isOrthographic",L.isOrthographicCamera===!0),E!==L&&(E=L,ni=!0,Ka=!0)}if(J.isSkinnedMesh){kt.setOptional(A,J,"bindMatrix"),kt.setOptional(A,J,"bindMatrixInverse");const In=J.skeleton;In&&(In.boneTexture===null&&In.computeBoneTexture(),kt.setValue(A,"boneTexture",In.boneTexture,H))}J.isBatchedMesh&&(kt.setOptional(A,J,"batchingTexture"),kt.setValue(A,"batchingTexture",J._matricesTexture,H),kt.setOptional(A,J,"batchingIdTexture"),kt.setValue(A,"batchingIdTexture",J._indirectTexture,H),kt.setOptional(A,J,"batchingColorTexture"),J._colorsTexture!==null&&kt.setValue(A,"batchingColorTexture",J._colorsTexture,H));const ui=ie.morphAttributes;if((ui.position!==void 0||ui.normal!==void 0||ui.color!==void 0)&&Ne.update(J,ie,wi),(ni||je.receiveShadow!==J.receiveShadow)&&(je.receiveShadow=J.receiveShadow,kt.setValue(A,"receiveShadow",J.receiveShadow)),se.isMeshGouraudMaterial&&se.envMap!==null&&(ci.envMap.value=Ue,ci.flipEnvMap.value=Ue.isCubeTexture&&Ue.isRenderTargetTexture===!1?-1:1),se.isMeshStandardMaterial&&se.envMap===null&&K.environment!==null&&(ci.envMapIntensity.value=K.environmentIntensity),ni&&(kt.setValue(A,"toneMappingExposure",y.toneMappingExposure),je.needsLights&&nC(ci,Ka),be&&se.fog===!0&&ee.refreshFogUniforms(ci,be),ee.refreshMaterialUniforms(ci,se,Z,te,m.state.transmissionRenderTarget[L.id]),Ef.upload(A,vv(je),ci,H)),se.isShaderMaterial&&se.uniformsNeedUpdate===!0&&(Ef.upload(A,vv(je),ci,H),se.uniformsNeedUpdate=!1),se.isSpriteMaterial&&kt.setValue(A,"center",J.center),kt.setValue(A,"modelViewMatrix",J.modelViewMatrix),kt.setValue(A,"normalMatrix",J.normalMatrix),kt.setValue(A,"modelMatrix",J.matrixWorld),se.isShaderMaterial||se.isRawShaderMaterial){const In=se.uniformsGroups;for(let Xn=0,cp=In.length;Xn0&&H.useMultisampledRTT(L)===!1?J=F.get(L).__webglMultisampledFramebuffer:Array.isArray(tt)?J=tt[ie]:J=tt,D.copy(L.viewport),B.copy(L.scissor),z=L.scissorTest}else D.copy(re).multiplyScalar(Z).floor(),B.copy(xe).multiplyScalar(Z).floor(),z=We;if(ie!==0&&(J=sC),C.bindFramebuffer(A.FRAMEBUFFER,J)&&se&&C.drawBuffers(L,J),C.viewport(D),C.scissor(B),C.setScissorTest(z),be){const Ue=F.get(L.texture);A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_CUBE_MAP_POSITIVE_X+K,Ue.__webglTexture,ie)}else if(Le){const Ue=F.get(L.texture),Qe=K;A.framebufferTextureLayer(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,Ue.__webglTexture,ie,Qe)}else if(L!==null&&ie!==0){const Ue=F.get(L.texture);A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_2D,Ue.__webglTexture,ie)}M=-1},this.readRenderTargetPixels=function(L,K,ie,se,J,be,Le,Ge=0){if(!(L&&L.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ue=F.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ue=Ue[Le]),Ue){C.bindFramebuffer(A.FRAMEBUFFER,Ue);try{const Qe=L.textures[Ge],tt=Qe.format,Ye=Qe.type;if(!X.textureFormatReadable(tt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!X.textureTypeReadable(Ye)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}K>=0&&K<=L.width-se&&ie>=0&&ie<=L.height-J&&(L.textures.length>1&&A.readBuffer(A.COLOR_ATTACHMENT0+Ge),A.readPixels(K,ie,se,J,we.convert(tt),we.convert(Ye),be))}finally{const Qe=P!==null?F.get(P).__webglFramebuffer:null;C.bindFramebuffer(A.FRAMEBUFFER,Qe)}}},this.readRenderTargetPixelsAsync=async function(L,K,ie,se,J,be,Le,Ge=0){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ue=F.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ue=Ue[Le]),Ue)if(K>=0&&K<=L.width-se&&ie>=0&&ie<=L.height-J){C.bindFramebuffer(A.FRAMEBUFFER,Ue);const Qe=L.textures[Ge],tt=Qe.format,Ye=Qe.type;if(!X.textureFormatReadable(tt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!X.textureTypeReadable(Ye))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const ht=A.createBuffer();A.bindBuffer(A.PIXEL_PACK_BUFFER,ht),A.bufferData(A.PIXEL_PACK_BUFFER,be.byteLength,A.STREAM_READ),L.textures.length>1&&A.readBuffer(A.COLOR_ATTACHMENT0+Ge),A.readPixels(K,ie,se,J,we.convert(tt),we.convert(Ye),0);const At=P!==null?F.get(P).__webglFramebuffer:null;C.bindFramebuffer(A.FRAMEBUFFER,At);const zt=A.fenceSync(A.SYNC_GPU_COMMANDS_COMPLETE,0);return A.flush(),await fP(A,zt,4),A.bindBuffer(A.PIXEL_PACK_BUFFER,ht),A.getBufferSubData(A.PIXEL_PACK_BUFFER,0,be),A.deleteBuffer(ht),A.deleteSync(zt),be}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(L,K=null,ie=0){const se=Math.pow(2,-ie),J=Math.floor(L.image.width*se),be=Math.floor(L.image.height*se),Le=K!==null?K.x:0,Ge=K!==null?K.y:0;H.setTexture2D(L,0),A.copyTexSubImage2D(A.TEXTURE_2D,ie,0,0,Le,Ge,J,be),C.unbindTexture()};const rC=A.createFramebuffer(),oC=A.createFramebuffer();this.copyTextureToTexture=function(L,K,ie=null,se=null,J=0,be=null){be===null&&(J!==0?(ga("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),be=J,J=0):be=0);let Le,Ge,Ue,Qe,tt,Ye,ht,At,zt;const Wt=L.isCompressedTexture?L.mipmaps[be]:L.image;if(ie!==null)Le=ie.max.x-ie.min.x,Ge=ie.max.y-ie.min.y,Ue=ie.isBox3?ie.max.z-ie.min.z:1,Qe=ie.min.x,tt=ie.min.y,Ye=ie.isBox3?ie.min.z:0;else{const ui=Math.pow(2,-J);Le=Math.floor(Wt.width*ui),Ge=Math.floor(Wt.height*ui),L.isDataArrayTexture?Ue=Wt.depth:L.isData3DTexture?Ue=Math.floor(Wt.depth*ui):Ue=1,Qe=0,tt=0,Ye=0}se!==null?(ht=se.x,At=se.y,zt=se.z):(ht=0,At=0,zt=0);const yt=we.convert(K.format),je=we.convert(K.type);let hn;K.isData3DTexture?(H.setTexture3D(K,0),hn=A.TEXTURE_3D):K.isDataArrayTexture||K.isCompressedArrayTexture?(H.setTexture2DArray(K,0),hn=A.TEXTURE_2D_ARRAY):(H.setTexture2D(K,0),hn=A.TEXTURE_2D),A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,K.flipY),A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),A.pixelStorei(A.UNPACK_ALIGNMENT,K.unpackAlignment);const Mt=A.getParameter(A.UNPACK_ROW_LENGTH),wi=A.getParameter(A.UNPACK_IMAGE_HEIGHT),Uo=A.getParameter(A.UNPACK_SKIP_PIXELS),ni=A.getParameter(A.UNPACK_SKIP_ROWS),Ka=A.getParameter(A.UNPACK_SKIP_IMAGES);A.pixelStorei(A.UNPACK_ROW_LENGTH,Wt.width),A.pixelStorei(A.UNPACK_IMAGE_HEIGHT,Wt.height),A.pixelStorei(A.UNPACK_SKIP_PIXELS,Qe),A.pixelStorei(A.UNPACK_SKIP_ROWS,tt),A.pixelStorei(A.UNPACK_SKIP_IMAGES,Ye);const kt=L.isDataArrayTexture||L.isData3DTexture,ci=K.isDataArrayTexture||K.isData3DTexture;if(L.isDepthTexture){const ui=F.get(L),In=F.get(K),Xn=F.get(ui.__renderTarget),cp=F.get(In.__renderTarget);C.bindFramebuffer(A.READ_FRAMEBUFFER,Xn.__webglFramebuffer),C.bindFramebuffer(A.DRAW_FRAMEBUFFER,cp.__webglFramebuffer);for(let Ur=0;Ur{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return Er(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const um=new WeakMap,wF=(...n)=>{var e;const t=n[0],i=(e=Rn())==null?void 0:e.proxy;if(i==null&&!Lc())throw new Error("injectLocal must be called in setup");return i&&um.has(i)&&t in um.get(i)?um.get(i)[t]:_n(...n)},Rg=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const AF=n=>typeof n<"u",CF=n=>n!=null,RF=Object.prototype.toString,PF=n=>RF.call(n)==="[object Object]",Pg=()=>{};function IF(n,e){function t(...i){return new Promise((s,r)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(r)})}return t}function LF(n,e={}){let t,i,s=Pg;const r=l=>{clearTimeout(l),s(),s=Pg};let o;return l=>{const c=rt(n),u=rt(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,d)=>{s=e.rejectOnCancel?d:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function Gb(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function DF(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function OF(n){return Rn()}function Ul(n){return Array.isArray(n)?n:[n]}function NF(n,e=200,t={}){return IF(LF(e,t),n)}function Wb(n,e=200,t={}){const i=nt(n.value),s=NF(()=>{i.value=n.value},e,t);return Ke(n,()=>s()),i}function UF(n,e={}){if(!Pt(n))return vS(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=P0(()=>({get(){return n.value[i]},set(s){var r;if((r=rt(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return t}const pn=rt;function I_(n,e=!0,t){OF()?Gn(n,t):e?n():Ar(n)}function FF(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t;let r=null;const o=Oe(!1);function a(){r&&(clearInterval(r),r=null)}function l(){o.value=!1,a()}function c(){const u=rt(e);u<=0||(o.value=!0,s&&n(),a(),o.value&&(r=setInterval(n,u)))}if(i&&Rg&&c(),Pt(e)||typeof e=="function"){const u=Ke(e,()=>{o.value&&Rg&&c()});Er(u)}return Er(l),{isActive:o,pause:l,resume:c}}function gT(n,e,t){return Ke(n,e,{...t,immediate:!0})}const $s=Rg?window:void 0;function Di(n){var e;const t=rt(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Ao(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=Se(()=>{const a=Ul(rt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=gT(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Di(c)))!=null?l:[$s].filter(c=>c!=null),Ul(rt(s.value?n[1]:n[0])),Ul(Ft(s.value?n[2]:n[1])),rt(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=PF(u)?{...u}:u;e.push(...a.flatMap(d=>l.flatMap(h=>c.map(p=>i(d,h,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return Er(t),o}function kF(){const n=Oe(!1),e=Rn();return e&&Gn(()=>{n.value=!0},e),n}function zh(n){const e=kF();return Se(()=>(e.value,!!n()))}function BF(n,e,t={}){const{window:i=$s,...s}=t;let r;const o=zh(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const d=rt(n),h=Ul(d).map(Di).filter(CF);return new Set(h)}),c=Ke(()=>l.value,d=>{a(),o.value&&d.size&&(r=new MutationObserver(e),d.forEach(h=>r.observe(h,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return Er(f),{isSupported:o,stop:f,takeRecords:u}}function L_(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:s=$s,once:r=!1}=e,o=Oe(!1),a=Se(()=>i?1e3/rt(i):null);let l=0,c=null;function u(h){if(!o.value||!s)return;l||(l=h);const p=h-l;if(a.value&&pt&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=Oe(typeof i=="number"),o=Oe(),a=Oe(!1),l=c=>{a.value=c.matches};return Ba(()=>{if(r.value){r.value=!s.value;const c=rt(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),d=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(d||h);return d&&p&&(p=i>=Gb(d[1])),h&&p&&(p=i<=Gb(h[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(rt(n)),a.value=o.value.matches)}),Ao(o,"change",l,{passive:!0}),Se(()=>a.value)}function HF(n){return JSON.parse(JSON.stringify(n))}function GF(n={}){const{window:e=$s}=n,t=Oe(1),i=_T(()=>`(resolution: ${t.value}dppx)`,n);let s=Pg;return e&&(s=gT(i,()=>t.value=e.devicePixelRatio)),{pixelRatio:ki(t),stop:s}}function vT(n,e,t={}){const{window:i=$s,...s}=t;let r;const o=zh(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const f=rt(n);return Array.isArray(f)?f.map(d=>Di(d)):[Di(f)]}),c=Ke(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const d of f)d&&r.observe(d,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return Er(u),{isSupported:o,stop:u}}function WF(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=Oe(0),l=Oe(0),c=Oe(0),u=Oe(0),f=Oe(0),d=Oe(0),h=Oe(0),p=Oe(0);function _(){const m=Di(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,d.value=0,h.value=0,p.value=0);return}const v=m.getBoundingClientRect();a.value=v.height,l.value=v.bottom,c.value=v.left,u.value=v.right,f.value=v.top,d.value=v.width,h.value=v.x,p.value=v.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return vT(n,g),Ke(()=>Di(n),m=>!m&&g()),BF(n,g,{attributeFilter:["style","class"]}),s&&Ao("scroll",g,{capture:!0,passive:!0}),i&&Ao("resize",g,{passive:!0}),I_(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:d,x:h,y:p,update:g}}function XF(n,e={width:0,height:0},t={}){const{window:i=$s,box:s="content-box"}=t,r=Se(()=>{var f,d;return(d=(f=Di(n))==null?void 0:f.namespaceURI)==null?void 0:d.includes("svg")}),o=Oe(e.width),a=Oe(e.height),{stop:l}=vT(n,([f])=>{const d=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(i&&r.value){const h=Di(n);if(h){const p=h.getBoundingClientRect();o.value=p.width,a.value=p.height}}else if(d){const h=Ul(d);o.value=h.reduce((p,{inlineSize:_})=>p+_,0),a.value=h.reduce((p,{blockSize:_})=>p+_,0)}else o.value=f.contentRect.width,a.value=f.contentRect.height},t);I_(()=>{const f=Di(n);f&&(o.value="offsetWidth"in f?f.offsetWidth:e.width,a.value="offsetHeight"in f?f.offsetHeight:e.height)});const c=Ke(()=>Di(n),f=>{o.value=f?e.width:0,a.value=f?e.height:0});function u(){l(),c()}return{width:o,height:a,stop:u}}function $F(n){var e;const t=Oe(0);if(typeof performance>"u")return t;const i=(e=n==null?void 0:n.every)!=null?e:10;let s=performance.now(),r=0;return L_(()=>{if(r+=1,r>=i){const o=performance.now(),a=o-s;t.value=Math.round(1e3/(a/r)),s=o,r=0}}),t}function qF(n={}){const e=nt(),t=zh(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;FF(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const yT={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},YF=Object.keys(yT);function jF(n={}){const{target:e=$s}=n,t=Oe(!1),i=nt(n.initialValue||{});Object.assign(i.value,yT,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=DF(r,YF,!1))};if(e){const r={passive:!0};Ao(e,["pointerdown","pointermove","pointerup"],s,r),Ao(e,"pointerleave",()=>t.value=!1,r)}return{...UF(i),isInside:t}}function CG(n,e,t,i={}){var s,r,o;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:f,shouldEmit:d}=i,h=Rn(),p=t||(h==null?void 0:h.emit)||((s=h==null?void 0:h.$emit)==null?void 0:s.bind(h))||((o=(r=h==null?void 0:h.proxy)==null?void 0:r.$emit)==null?void 0:o.bind(h==null?void 0:h.proxy));let _=c;_=_||`update:${e.toString()}`;const g=b=>a?typeof a=="function"?a(b):HF(b):b,m=()=>AF(n[e])?g(n[e]):f,v=b=>{d?d(b)&&p(_,b):p(_,b)};if(l){const b=m(),y=nt(b);let T=!1;return Ke(()=>n[e],w=>{T||(T=!0,y.value=g(w),Ar(()=>T=!1))}),Ke(y,w=>{!T&&(w!==n[e]||u)&&v(w)},{deep:u}),y}else return Se({get(){return m()},set(b){v(b)}})}function KF(n={}){const{window:e=$s,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=Oe(t),l=Oe(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:d,scale:h}=e.visualViewport;a.value=Math.round(f*h),l.value=Math.round(d*h)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),I_(c);const u={passive:!0};if(Ao("resize",c,u),e&&o==="visual"&&e.visualViewport&&Ao(e.visualViewport,"resize",c,u),s){const f=_T("(orientation: portrait)");Ke(f,()=>c())}return{width:a,height:l}}var ZF=Object.defineProperty,JF=(n,e,t)=>e in n?ZF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Xb=(n,e,t)=>JF(n,typeof e!="symbol"?e+"":e,t);const QF="@tresjs/core",ek="module",tk="4.3.6",nk="pnpm@10.6.3",ik="Declarative ThreeJS using Vue Components",sk="Alvaro Saburido (https://github.com/alvarosabu/)",rk="MIT",ok={type:"git",url:"git+https://github.com/Tresjs/tres.git"},ak=["vue","3d","threejs","three","threejs-vue"],lk=!1,ck={".":{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"},"./*":"./*"},uk="./dist/tres.js",fk="./dist/tres.js",dk="./dist/index.d.ts",hk=["*.d.ts","dist"],pk={access:"public"},mk={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"},gk={three:">=0.133",vue:">=3.4"},_k={"@alvarosabu/utils":"^3.2.0","@vue/devtools-api":"^6.6.3","@vueuse/core":"^12.5.0"},vk={"@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"},yk={name:QF,type:ek,version:tk,packageManager:nk,description:ik,author:sk,license:rk,repository:ok,keywords:ak,sideEffects:lk,exports:ck,main:uk,module:fk,types:dk,files:hk,publishConfig:pk,scripts:mk,peerDependencies:gk,dependencies:_k,devDependencies:vk};class bk extends jt{constructor(...e){super(...e),Xb(this,"type","HightlightMesh"),Xb(this,"createTime"),this.createTime=Date.now()}onBeforeRender(){const e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}}function Ig(n){return typeof n>"u"}function D_(n){return Array.isArray(n)}function xk(n){return typeof n=="number"}function bT(n){return typeof n=="string"}function fa(n){return typeof n=="function"}function cs(n){return n===Object(n)&&!D_(n)&&!fa(n)}function pr(n){return cs(n)&&!!n.isObject3D}function xT(n){return cs(n)&&!!n.isColor}function Mk(n){return n!=null&&(typeof n=="string"||typeof n=="number"||xT(n))}function Lg(n){return n!==null&&typeof n=="object"&&"set"in n&&typeof n.set=="function"}function Sk(n){return Lg(n)&&"copy"in n&&typeof n.copy=="function"}function Ek(n){return!!(n!=null&&n.constructor)}function $b(n){return n instanceof Bc}function qb(n){return cs(n)&&!!n.isCamera}function Tk(n){return cs(n)&&!!n.isBufferGeometry}function wk(n){return cs(n)&&!!n.isMaterial}function Ak(n){return cs(n)&&!!n.isLight}function Ck(n){return cs(n)&&!!n.isFog}function Rk(n){return cs(n)&&!!n.isScene}function nf(n){return pr(n)||Tk(n)||wk(n)||Ck(n)}function Pk(n){return cs(n)&&!!n.isPrimitive}const MT=(n,e)=>{for(const t of Object.keys(e))e[t]instanceof Object&&Object.assign(e[t],MT(n[t],e[t]));return Object.assign(n||{},e),n},Ik="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",Lk=Nk(Ik);function Yb(n){return n&&n.nodeType===1}function fm(n){return n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const Dk=/\B([A-Z])/g;function Ok(n){return n.replace(Dk,"-$1").toLowerCase()}function Nk(n,e){const t=Object.create(null),i=n.split(",");for(let s=0;s!!t[s.toLowerCase()]:s=>!!t[s]}const jb=(n,e)=>{if(!e)return;const t=Array.isArray(e)?e:e.match(/([^[.\]])+/g);return t==null?void 0:t.reduce((i,s)=>i&&i[s],n)},Uk=(n,e,t)=>{const i=Array.isArray(e)?e:e.match(/([^[.\]])+/g);i&&i.reduce((s,r,o)=>(s[r]===void 0&&(s[r]={}),o===i.length-1&&(s[r]=t),s[r]),n)};function ST(n,e){if(Yb(n)&&Yb(e)){const s=n.attributes,r=e.attributes;return s.length!==r.length?!1:Array.from(s).every(({name:o,value:a})=>e.getAttribute(o)===a)}if(n===e)return!0;if(n===null||typeof n!="object"||e===null||typeof e!="object")return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const s of t)if(!i.includes(s)||!ST(n[s],e[s]))return!1;return!0}function Fk(n,e){if(!Array.isArray(n)||!Array.isArray(e)||n.length!==e.length)return!1;for(let t=0;t{if(l.uuid===e)return l;for(const c of l.children){const u=s(c);if(u)return u}},r=s(n);if(!r){console.warn("Object with UUID not found in the scene.");return}let o=r;for(let l=0;lET(i)),!(n instanceof vh)){const i=n;n&&((t=n.dispose)==null||t.call(n)),i.geometry&&i.geometry.dispose(),Array.isArray(i.material)?i.material.forEach(s=>Kb(s)):i.material&&Kb(i.material)}}function Vk(n,e){let t=0;for(let i=0;it===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}const Jb=/-\d+$/;function Hk(n,e,t){if(bT(t)){if(Jb.test(t)){const r=t.replace(Jb,""),{target:o,key:a}=Dg(n,r);if(!Array.isArray(o[a])){const l=o[a],c=[];c.__tresDetach=()=>{c.every(u=>Ig(u))&&(o[a]=l)},o[a]=c}}const{target:i,key:s}=Dg(n,t);e.__tres.previousAttach=i[s],i[s]=La(e)}else e.__tres.previousAttach=t(n,e)}function Gk(n,e,t){var i,s,r;if(bT(t)){const{target:o,key:a}=Dg(n,t),l=e.__tres.previousAttach;l===void 0?delete o[a]:o[a]=l,"__tresDetach"in o&&o.__tresDetach()}else(s=(i=e.__tres)==null?void 0:i.previousAttach)==null||s.call(i,n,e);(r=e.__tres)==null||delete r.previousAttach}function oo(n,e,t){const i=n;return i.__tres={type:"unknown",eventCount:0,root:t,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...e},i.__tres.attach||(i.isMaterial?i.__tres.attach="material":i.isBufferGeometry?i.__tres.attach="geometry":i.isFog&&(i.__tres.attach="fog")),i}function TT(n){var e;const t=(e=n==null?void 0:n.__tres)==null?void 0:e.root;t&&t.render&&t.render.canBeInvalidated.value&&t.invalidate()}function Wk(n,e,t){var i;if(!fa(n.setPixelRatio))return;let s=0;if(t&&D_(t)&&t.length>=2){const[r,o]=t;s=i_.clamp(e,r,o)}else xk(t)?s=t:s=e;s!==((i=n.getPixelRatio)==null?void 0:i.call(n))&&n.setPixelRatio(s)}function Xk(n,e,t,i,s){const r=[...e.__tres.objects],o=La(e);if(n=La(n),o===n)return!0;const a=oo(n,e.__tres??{},s),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of r)wT(u,s),AT(u,s);o.__tres.objects=[],i.remove(e);for(const[u,f]of Object.entries(c))i.patchProp(a,u,a[u],f);t(n),i.insert(e,l);for(const u of r)i.insert(u,e);return!0}function La(n){return Pk(n)?(n.object.__tres=n.__tres,n.object):n}function wT(n,e){var t,i,s,r;const o=((t=n.__tres)==null?void 0:t.parent)||e.scene.value;n.__tres&&(n.__tres.parent=null),o&&o.__tres&&"objects"in o.__tres&&Vk(o.__tres.objects,a=>a!==n),(i=n.__tres)!=null&&i.attach?Gk(o,n,n.__tres.attach):((r=(s=n.parent)==null?void 0:s.remove)==null||r.call(s,La(n)),n.parent=null)}function AT(n,e){var t;(t=n.traverse)==null||t.call(n,i=>{var s;e.deregisterCamera(i),(s=e.eventManager)==null||s.deregisterPointerMissedObject(i)}),e.deregisterCamera(n),TT(n)}const $k=({sizes:n})=>{const e=nt([]),t=Se(()=>e.value[0]),i=o=>{const a=o instanceof zc?o:e.value.find(c=>c.uuid===o);if(!a)return;const l=e.value.filter(({uuid:c})=>c!==a.uuid);e.value=[a,...l]},s=(o,a=!1)=>{if(qb(o)){const l=o;if(e.value.some(({uuid:c})=>c===l.uuid))return;a?i(l):e.value.push(l)}},r=o=>{if(qb(o)){const a=o;e.value=e.value.filter(({uuid:l})=>l!==a.uuid)}};return Ba(()=>{n.aspectRatio.value&&e.value.forEach(o=>{!o.manual&&(o instanceof Jt||qk(o))&&(o instanceof Jt?o.aspect=n.aspectRatio.value:(o.left=n.width.value*-.5,o.right=n.width.value*.5,o.top=n.height.value*.5,o.bottom=n.height.value*-.5),o.updateProjectionMatrix())})}),rs(()=>{e.value=[]}),{camera:t,cameras:e,registerCamera:s,deregisterCamera:r,setCameraActive:i}};function qk(n){return n.hasOwnProperty("isOrthographicCamera")&&n.isOrthographicCamera}const Rd="[TresJS ▲ ■ ●] ";function Yk(...n){typeof n[0]=="string"?n[0]=Rd+n[0]:n.unshift(Rd),console.error(...n)}function jk(...n){typeof n[0]=="string"?n[0]=Rd+n[0]:n.unshift(Rd),console.warn(...n)}function Kk(n,e){}function CT(){return{logError:Yk,logWarning:jk,logMessage:Kk}}const Og=nt({}),Ng=n=>Object.assign(Og.value,n);function dm(){const n=new Map,e=new Set;let t=0,i=!1;const s=()=>{const o=Array.from(n.entries()).sort((a,l)=>{const c=a[1].priority-l[1].priority;return c===0?a[1].addI-l[1].addI:c});e.clear(),o.forEach(a=>e.add(a[0]))},r=o=>{n.delete(o),e.delete(o)};return{on:(o,a=0)=>{n.set(o,{priority:a,addI:t++});const l=()=>r(o);return Er(l),i=!0,{off:l}},off:r,trigger:(...o)=>{i&&(s(),i=!1),e.forEach(a=>a(...o))},dispose:()=>{n.clear(),e.clear()},get count(){return n.size}}}function Zk(){let n=!0,e=!0,t=!1;const i=new kh(!1),s=nt(i.running),r=nt(!1);let o;const a=i_.generateUUID();let l=null;const c=dm(),u=dm(),f=dm();w();let d={};function h(S){d=S}function p(S,P,M=0){switch(P){case"before":return c.on(S,M);case"render":return l||(l=S),u.dispose(),u.on(S);case"after":return f.on(S,M)}}function _(){e&&(e=!1,w(),T())}function g(){e=!0,w(),cancelAnimationFrame(o)}function m(){t=!1,w()}function v(){t=!0,w()}function b(){r.value=!0}function y(){r.value=!1}function T(){if(!n){o=requestAnimationFrame(T);return}const S=i.getDelta(),P=i.getElapsedTime(),M={camera:Ft(d.camera),scene:Ft(d.scene),renderer:Ft(d.renderer),raycaster:Ft(d.raycaster),controls:Ft(d.controls),invalidate:d.invalidate,advance:d.advance},E={delta:S,elapsed:P,clock:i,...M};s.value&&c.trigger(E),r.value||(u.count?u.trigger(E):l&&l(E)),s.value&&f.trigger(E),o=requestAnimationFrame(T)}function w(){const S=!e&&!t;i.running!==S&&(i.running?i.stop():i.start()),s.value=i.running}return{loopId:a,register:(S,P,M)=>p(S,P,M),start:_,stop:g,pause:v,resume:m,pauseRender:b,resumeRender:y,isRenderPaused:r,isActive:s,setContext:h,setReady:S=>n=S}}function O_(n){let e=0;return n.traverse(t=>{if(t.isMesh&&t.geometry&&t.type!=="HightlightMesh"){const i=t.geometry,s=i.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,r=i.index?i.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=i.attributes.normal?i.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a=i.attributes.uv?i.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,l=s+r+o+a;e+=l}}),e}function Jk(n){return(n/1024).toFixed(2)}const Qk=Number.parseInt(Uc.replace("dev",""));function eB(n){return n instanceof Pe?n:Array.isArray(n)?new Pe(...n):new Pe(n)}const sf={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:Fn,toneMapping:rh,toneMappingExposure:3,shadowMap:{enabled:!0,type:X0}},flat:{toneMapping:ns,toneMappingExposure:1}};function tB({canvas:n,options:e,contextParts:{sizes:t,render:i,invalidate:s,advance:r}}){const o=Se(()=>({alpha:pn(e.alpha)??!0,depth:pn(e.depth),canvas:Di(n),context:pn(e.context),stencil:pn(e.stencil),antialias:pn(e.antialias)??!0,precision:pn(e.precision),powerPreference:pn(e.powerPreference),premultipliedAlpha:pn(e.premultipliedAlpha),preserveDrawingBuffer:pn(e.preserveDrawingBuffer),logarithmicDepthBuffer:pn(e.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:pn(e.failIfMajorPerformanceCaveat)})),a=Oe(new Tf(o.value));function l(){e.renderMode==="on-demand"&&s()}Ke(o,()=>{a.value.dispose(),a.value=new Tf(o.value),l()}),Ke([t.width,t.height],()=>{a.value.setSize(t.width.value,t.height.value),l()},{immediate:!0}),Ke(()=>e.clearColor,l);const{pixelRatio:c}=GF(),{logError:u}=CT(),f=(()=>{const h=new Tf,p={shadowMap:{enabled:h.shadowMap.enabled,type:h.shadowMap.type},toneMapping:h.toneMapping,toneMappingExposure:h.toneMappingExposure,outputColorSpace:h.outputColorSpace};return h.dispose(),p})(),d=pn(e.renderMode);return d==="on-demand"&&s(),d==="manual"&&setTimeout(()=>{r()},100),Ba(()=>{const h=pn(e.preset);h&&(h in sf||u(`Renderer Preset must be one of these: ${Object.keys(sf).join(", ")}`),MT(a.value,sf[h])),Wk(a.value,c.value,pn(e.dpr)),d==="always"&&(i.frames.value=Math.max(1,i.frames.value));const p=(m,v)=>{const b=pn(m),y=()=>{if(h)return jb(sf[h],v)};if(b!==void 0)return b;const T=y();return T!==void 0?T:jb(f,v)},_=(m,v)=>Uk(a.value,v,p(m,v));_(e.shadows,"shadowMap.enabled"),_(e.toneMapping??rh,"toneMapping"),_(e.shadowMapType,"shadowMap.type"),Qk<150&&_(!e.useLegacyLights,"physicallyCorrectLights"),_(e.outputColorSpace,"outputColorSpace"),_(e.toneMappingExposure,"toneMappingExposure");const g=p(e.clearColor,"clearColor");g&&a.value.setClearColor(g?eB(g):new Pe(0))}),rs(()=>{a.value.dispose(),a.value.forceContextLoss()}),{renderer:a}}function nB(n,e,t=10){const i=pn(n)?KF():XF(Se(()=>pn(e).parentElement)),s=ki(Wb(i.width,t)),r=ki(Wb(i.height,t)),o=Se(()=>s.value/r.value);return{height:r,width:s,aspectRatio:o}}const iB=(n,e)=>{const t=Se(()=>e.renderer.value.domElement),i=Oe([]),{x:s,y:r}=jF({target:t});let o=0;const{width:a,height:l,top:c,left:u}=WF(t),f=({x:re,y:xe})=>{if(t.value)return{x:(re-u.value)/a.value*2-1,y:-((xe-c.value)/l.value)*2+1}},d=({x:re,y:xe})=>{if(e.camera.value)return e.raycaster.value.setFromCamera(new fe(re,xe),e.camera.value),i.value=e.raycaster.value.intersectObjects(n.value,!0),i.value},h=re=>{const xe=f({x:(re==null?void 0:re.clientX)??s.value,y:(re==null?void 0:re.clientY)??r.value});return xe?d(xe)||[]:[]},p=pi(),_=pi(),g=pi(),m=pi(),v=pi(),b=pi(),y=pi(),T=pi();function w(re){const xe={};for(const We in re)typeof We!="function"&&(xe[We]=re[We]);return xe}const S=(re,xe)=>{var We,oe,ge;const Ee=w(xe),$=new k(xe==null?void 0:xe.clientX,xe==null?void 0:xe.clientY,0).unproject((We=e.camera)==null?void 0:We.value);re.trigger({...Ee,intersections:i.value,unprojectedPoint:$,ray:(oe=e.raycaster)==null?void 0:oe.value.ray,camera:(ge=e.camera)==null?void 0:ge.value,sourceEvent:xe,delta:o,stopPropagating:!1})};let P;const M=re=>{h(re),S(g,re),P=re},E=()=>{P&&M(P)};let D,B,z;const V=re=>{var xe;D=(xe=i.value[0])==null?void 0:xe.object,o=0,B=new fe((re==null?void 0:re.clientX)??s.value,(re==null?void 0:re.clientY)??r.value),S(v,re)};let Q,j=!1;const te=re=>{var xe,We,oe;re instanceof PointerEvent&&(i.value.length===0&&S(b,re),D===((xe=i.value[0])==null?void 0:xe.object)&&(z=new fe((re==null?void 0:re.clientX)??s.value,(re==null?void 0:re.clientY)??r.value),o=B==null?void 0:B.distanceTo(z),re.button===0?(S(p,re),Q===((We=i.value[0])==null?void 0:We.object)?j=!0:(Q=(oe=i.value[0])==null?void 0:oe.object,j=!1)):re.button===2&&S(y,re)),S(m,re))},Z=re=>{j&&(S(_,re),Q=void 0,j=!1)},pe=re=>S(g,re),Me=re=>S(T,re);return t.value.addEventListener("pointerup",te),t.value.addEventListener("pointerdown",V),t.value.addEventListener("pointermove",M),t.value.addEventListener("pointerleave",pe),t.value.addEventListener("dblclick",Z),t.value.addEventListener("wheel",Me),rs(()=>{t!=null&&t.value&&(t.value.removeEventListener("pointerup",te),t.value.removeEventListener("pointerdown",V),t.value.removeEventListener("pointermove",M),t.value.removeEventListener("pointerleave",pe),t.value.removeEventListener("dblclick",Z),t.value.removeEventListener("wheel",Me))}),{intersects:i,onClick:re=>p.on(re).off,onDblClick:re=>_.on(re).off,onContextMenu:re=>y.on(re).off,onPointerMove:re=>g.on(re).off,onPointerUp:re=>m.on(re).off,onPointerDown:re=>v.on(re).off,onPointerMissed:re=>b.on(re).off,onWheel:re=>T.on(re).off,forceUpdate:E}};function hm(n,e){if(Array.isArray(n))for(const t of n)t(e);typeof n=="function"&&n(e)}function sB(n,e,t){var i;const s=Oe(),r=Oe();n&&(s.value=n),e&&(r.value=e);const o=M=>{var E;return((E=M.__tres)==null?void 0:E.eventCount)>0},a=M=>{var E;return((E=M.children)==null?void 0:E.some(D=>a(D)))||o(M)},l=Oe(((i=s.value)==null?void 0:i.children).filter(a)||[]);function c(M,E){const D=[],B=()=>E.stopPropagating=!0;E.stopPropagation=B;for(const z of E==null?void 0:E.intersections){if(E.stopPropagating)return;E={...E,...z};const{object:V}=z;E.eventObject=V,hm(V[M],E),D.push(V);let Q=V.parent;for(;Q!==null&&!E.stopPropagating&&!D.includes(Q);)E.eventObject=Q,hm(Q[M],E),D.push(Q),Q=Q.parent;const j=Ok(M.slice(2));t(j,{intersection:z,event:E})}}const{onClick:u,onDblClick:f,onContextMenu:d,onPointerMove:h,onPointerDown:p,onPointerUp:_,onPointerMissed:g,onWheel:m,forceUpdate:v}=iB(l,e);_(M=>c("onPointerUp",M)),p(M=>c("onPointerDown",M)),u(M=>c("onClick",M)),f(M=>c("onDoubleClick",M)),d(M=>c("onContextMenu",M)),m(M=>c("onWheel",M));let b=[];h(M=>{const E=M.intersections.map(({object:B})=>B),D=M.intersections;b.forEach(({object:B})=>{E.includes(B)||(M.intersections=b,c("onPointerLeave",M),c("onPointerOut",M))}),M.intersections=D,M.intersections.forEach(({object:B})=>{b.includes(B)||(c("onPointerEnter",M),c("onPointerOver",M))}),c("onPointerMove",M),b=M.intersections});const y=[];g(M=>{const E=()=>M.stopPropagating=!0;M.stopPropagation=E,y.forEach(D=>{M.stopPropagating||(M.eventObject=D,hm(D.onPointerMissed,M))}),t("pointer-missed",{event:M})});function T(M){nf(M)&&pr(M)&&l.value.push(M)}function w(M){if(nf(M)&&pr(M)){const E=l.value.indexOf(M);E>-1&&l.value.splice(E,1)}}function S(M){nf(M)&&pr(M)&&M.onPointerMissed&&y.push(M)}function P(M){if(nf(M)&&pr(M)){const E=y.indexOf(M);E>-1&&y.splice(E,1)}}return e.eventManager={forceUpdate:v,registerObject:T,deregisterObject:w,registerPointerMissedObject:S,deregisterPointerMissedObject:P},{forceUpdate:v,registerObject:T,deregisterObject:w,registerPointerMissedObject:S,deregisterPointerMissedObject:P}}function rB(n,e,t=100){t=t<=0?100:t;const i=pi(),s=new Set;let r=!1,o=!1,a=null;function l(){a&&clearTimeout(a),!o&&!r&&n()?(i.trigger(e),s.forEach(f=>f()),s.clear(),r=!0):!o&&!r&&(a=setTimeout(l,t))}function c(){o=!0,a&&clearTimeout(a)}l();const u=(f,...d)=>{f(...d)};return{on:f=>{if(r)return u(f,e),{off:()=>{}};{const d=i.on(f);return s.add(d.off),i.on(f)}},off:i.off,trigger:i.trigger,clear:i.clear,cancel:c}}const pm=new WeakMap;function oB(n){if(n=n||RT(),pm.has(n))return pm.get(n);const e=100,t=Date.now(),i=rB(()=>{if(Date.now()-t>=e)return!0;{const s=n.renderer.value,r=(s==null?void 0:s.domElement)||{width:0,height:0};return!!(s&&r.width>0&&r.height>0)}},n);return pm.set(n,i),i}function aB({scene:n,canvas:e,windowSize:t,rendererOptions:i,emit:s}){const r=Oe(n),o=nB(t,e),{camera:a,cameras:l,registerCamera:c,deregisterCamera:u,setCameraActive:f}=$k({sizes:o}),d={mode:nt(i.renderMode||"always"),priority:nt(0),frames:nt(0),maxFrames:60,canBeInvalidated:Se(()=>d.mode.value==="on-demand"&&d.frames.value===0)};function h(z=1){i.renderMode==="on-demand"&&(d.frames.value=Math.min(d.maxFrames,d.frames.value+z))}function p(){i.renderMode==="manual"&&(d.frames.value=1)}const{renderer:_}=tB({canvas:e,options:i,contextParts:{sizes:o,render:d,invalidate:h,advance:p}}),g={sizes:o,scene:r,camera:a,cameras:ki(l),renderer:_,raycaster:Oe(new lT),controls:nt(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:d,advance:p,extend:Ng,invalidate:h,registerCamera:c,setCameraActive:f,deregisterCamera:u,loop:Zk()};gr("useTres",g),g.scene.value.__tres={root:g},g.loop.register(()=>{a.value&&d.frames.value>0&&(_.value.render(n,a.value),s("render",g.renderer.value)),d.priority.value=0,d.mode.value==="always"?d.frames.value=1:d.frames.value=Math.max(0,d.frames.value-1)},"render");const{on:m,cancel:v}=oB(g);g.loop.setReady(!1),g.loop.start(),m(()=>{s("ready",g),g.loop.setReady(!0),sB(n,g,s)}),rs(()=>{v(),g.loop.stop()});const b=100,y=$F({every:b}),{isSupported:T,memory:w}=qF({interval:b}),S=160;let P=performance.now();const M=({timestamp:z})=>{g.scene.value&&(g.perf.memory.allocatedMem=O_(g.scene.value)),z-P>=b&&(P=z,g.perf.fps.accumulator.push(y.value),g.perf.fps.accumulator.length>S&&g.perf.fps.accumulator.shift(),g.perf.fps.value=y.value,T.value&&w.value&&(g.perf.memory.accumulator.push(w.value.usedJSHeapSize/1024/1024),g.perf.memory.accumulator.length>S&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce((V,Q)=>V+Q,0)/g.perf.memory.accumulator.length))};let E=0;const D=1,{pause:B}=L_(({delta:z})=>{window.__TRES__DEVTOOLS__&&(M({timestamp:performance.now()}),E+=z,E>=D&&(window.__TRES__DEVTOOLS__.cb(g),E=0))},{immediate:!0});return rs(()=>{B()}),g}function RT(){const n=_n("useTres");if(!n)throw new Error("useTresContext must be used together with useTresContextProvider");return n}function RG(){const{camera:n,scene:e,renderer:t,loop:i,raycaster:s,controls:r,invalidate:o,advance:a}=RT();i.setContext({camera:n,scene:e,renderer:t,raycaster:s,controls:r,invalidate:o,advance:a});function l(f,d=0){return i.register(f,"before",d)}function c(f){return i.register(f,"render")}function u(f,d=0){return i.register(f,"after",d)}return{pause:i.pause,resume:i.resume,pauseRender:i.pauseRender,resumeRender:i.resumeRender,isActive:i.isActive,onBeforeRender:l,render:c,onAfterRender:u}}const lB=pi(),cB=pi(),PT=pi(),Fl=new kh;let wf=0,Af=0;L_(()=>{lB.trigger({delta:wf,elapsed:Af,clock:Fl}),cB.trigger({delta:wf,elapsed:Af,clock:Fl}),PT.trigger({delta:wf,elapsed:Af,clock:Fl})},{immediate:!1});PT.on(()=>{wf=Fl.getDelta(),Af=Fl.getElapsedTime()});function uB(n,e={},t={}){let i=n;const s=a=>{i=a};let r=new Proxy({},{});const o={has(a,l){return l in e||l in i},get(a,l,c){return l in e?e[l](i):i[l]},set(a,l,c){return t[l]?t[l](c,i,r,s):i[l]=c,!0}};return r=new Proxy({},o),r}const{logError:Qb}=CT(),ex=["onClick","onContextMenu","onPointerMove","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onDoubleClick","onPointerDown","onPointerUp","onPointerCancel","onPointerMissed","onLostPointerCapture","onWheel"],fB=n=>{const e=n.scene.value;function t(c,u,f,d){if(d||(d={}),d.args||(d.args=[]),c==="template"||Lk(c))return null;let h=c.replace("Tres",""),p;if(c==="primitive"){(!cs(d.object)||Pt(d.object))&&Qb("Tres primitives need an 'object' prop, whose value is an object or shallowRef"),h=d.object.type;const _={};p=uB(d.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>_},{object:(g,m,v,b)=>{Xk(g,v,b,{patchProp:r,remove:s,insert:i},n)},__tres:g=>{Object.assign(_,g)}})}else{const _=Og.value[h];_||Qb(`${h} is not defined on the THREE namespace. Use extend to add it to the catalog.`),p=new _(...d.args)}return p?(p.isCamera&&(d!=null&&d.position||p.position.set(3,3,3),d!=null&&d.lookAt||p.lookAt(0,0,0)),p=oo(p,{...p.__tres,type:h,memoizedProps:d,eventCount:0,primitive:c==="primitive",attach:d.attach},n),p):null}function i(c,u){var f,d,h;if(!c)return;u=u||e;const p=c.__tres?c:oo(c,{},n),_=u.__tres?u:oo(u,{},n);c=La(p),u=La(_),c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((d=n.eventManager)==null||d.registerObject(c)),n.registerCamera(c),(h=n.eventManager)==null||h.registerPointerMissedObject(c),p.__tres.attach?Hk(_,p,p.__tres.attach):pr(c)&&pr(_)&&(_.add(c),c.dispatchEvent({type:"added"})),p.__tres.parent=_,_.__tres.objects&&!_.__tres.objects.includes(p)&&_.__tres.objects.push(p)}function s(c,u){var f,d,h,p;if(!c)return;c!=null&&c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((d=n.eventManager)==null||d.deregisterObject(c)),u=Ig(u)?"default":u;const _=(h=c.__tres)==null?void 0:h.dispose;Ig(_)||(_===null?u=!1:u=_);const g=(p=c.__tres)==null?void 0:p.primitive,m=u==="default"?!g:!!u;if(c.__tres&&"objects"in c.__tres&&[...c.__tres.objects].forEach(v=>s(v,u)),m&&c.children&&[...c.children].forEach(v=>s(v,u)),wT(c,n),AT(c,n),m&&!Rk(c)){if(fa(u))u(c);else if(fa(c.dispose))try{c.dispose()}catch{}}"__tres"in c&&delete c.__tres}function r(c,u,f,d){var h,p;if(!c)return;let _=c,g=u;if(c.__tres&&(c.__tres.memoizedProps[u]=d),u==="attach"){const y=((h=c.__tres)==null?void 0:h.parent)||c.parent;s(c),oo(c,{attach:d},n),y&&i(c,y);return}if(u==="dispose"){c.__tres||(c=oo(c,{},n)),c.__tres.dispose=d;return}if(pr(c)&&g==="blocks-pointer-events"){d||d===""?c[g]=d:delete c[g];return}ex.includes(u)&&c.__tres&&(c.__tres.eventCount+=1);let m=fm(g),v=_==null?void 0:_[m];if(g==="args"){const y=c,T=f??[],w=d??[],S=((p=c.__tres)==null?void 0:p.type)||c.type;S&&T.length&&!Fk(T,w)&&(_=Object.assign(y,new Og.value[S](...d)));return}if(_.type==="BufferGeometry"){if(g==="args")return;_.setAttribute(fm(g),new It(...d));return}if(g.includes("-")&&v===void 0){v=_;for(const y of g.split("-"))m=g=fm(y),_=v,v=v==null?void 0:v[g]}let b=d;if(b===""&&(b=!0),fa(v)){ex.includes(u)||(D_(b)?c[m](...b):c[m](b)),m.startsWith("on")&&fa(b)&&(_[m]=b);return}$b(v)&&$b(b)?v.mask=b.mask:xT(v)&&Mk(b)?v.set(b):Sk(v)&&Ek(b)&&v.constructor===b.constructor?v.copy(b):Lg(v)&&Array.isArray(b)?"fromArray"in v&&typeof v.fromArray=="function"?v.fromArray(b):v.set(...b):Lg(v)&&typeof b=="number"?"setScalar"in v&&typeof v.setScalar=="function"?v.setScalar(b):v.set(b):_[m]=b,TT(c)}function o(c){var u;return((u=c==null?void 0:c.__tres)==null?void 0:u.parent)||null}function a(c){const u=oo(new gt,{type:"Comment"},n);return u.name=c,u}function l(c){var u;const f=o(c),d=((u=f==null?void 0:f.__tres)==null?void 0:u.objects)||[],h=d.indexOf(c);return h<0||h>=d.length-1?null:d[h+1]}return{insert:i,remove:s,createElement:t,patchProp:r,parentNode:o,createText:()=>{},createComment:a,setText:()=>{},setElementText:()=>{},nextSibling:l,querySelector:()=>{},setScopeId:()=>{},cloneNode:()=>{},insertStaticContent:()=>{}}};function dB(){return IT().__VUE_DEVTOOLS_GLOBAL_HOOK__}function IT(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const hB=typeof Proxy=="function",pB="devtools-plugin:setup",mB="plugin:settings:set";let fl,Ug;function gB(){var n;return fl!==void 0||(typeof window<"u"&&window.performance?(fl=!0,Ug=window.performance):typeof globalThis<"u"&&!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance?(fl=!0,Ug=globalThis.perf_hooks.performance):fl=!1),fl}function _B(){return gB()?Ug.now():Date.now()}class vB{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const i={};if(e.settings)for(const o in e.settings){const a=e.settings[o];i[o]=a.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let r=Object.assign({},i);try{const o=localStorage.getItem(s),a=JSON.parse(o);Object.assign(r,a)}catch{}this.fallbacks={getSettings(){return r},setSettings(o){try{localStorage.setItem(s,JSON.stringify(o))}catch{}r=o},now(){return _B()}},t&&t.on(mB,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function yB(n,e){const t=n,i=IT(),s=dB(),r=hB&&t.enableEarlyProxy;if(s&&(i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))s.emit(pB,n,e);else{const o=r?new vB(t,s):null;(i.__VUE_DEVTOOLS_PLUGINS__=i.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}function bB(n,e){const t=`▲ ■ ●${n}`;typeof tx=="function"?tx(t,e):console.log(t)}function tx(n,e){throw new Error(n+e)}const LT=n=>{const e={id:n.uuid,label:n.type,children:[],tags:[]};n.name!==""&&e.tags.push({label:n.name,textColor:5750629,backgroundColor:15793395});const t=O_(n);return t>0&&e.tags.push({label:`${Jk(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(Ak(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new Pe(n.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:"Color"})),n.type.includes("Camera")&&(e.tags.push({label:`${n.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:"Field of view"}),e.tags.push({label:`x: ${Math.round(n.position.x)} y: ${Math.round(n.position.y)} z: ${Math.round(n.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:"Position"})),e};function DT(n,e,t=""){n.children.forEach(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const s=LT(i);e.children.push(s),DT(i,s,t)})}const xB=[],dl="tres:inspector",MB=xi({sceneGraph:null});function SB(n,e){yB({id:"dev.esm.tres",label:"TresJS 🪐",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://tresjs.org",componentStateTypes:xB,app:n},t=>{typeof t.now!="function"&&bB("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."),t.addInspector({id:dl,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{t.sendInspectorTree(dl)},1e3),setInterval(()=>{t.notifyComponentUpdate()},5e3),t.on.getInspectorTree(r=>{if(r.inspectorId===dl){const o=LT(e.scene.value);DT(e.scene.value,o,r.filter),MB.sceneGraph=o,r.rootNodes=[o]}});let i=null,s=null;t.on.getInspectorState(r=>{var o;if(r.inspectorId===dl){const[a]=e.scene.value.getObjectsByProperty("uuid",r.nodeId);if(!a)return;if(s&&i&&i.parent&&s.remove(i),a.isMesh){const l=Bk(a);a.add(l),i=l,s=a}r.state={object:Object.entries(a).map(([l,c])=>l==="children"?{key:l,value:c.filter(u=>u.type!=="HightlightMesh")}:{key:l,value:c,editable:!0}).filter(({key:l})=>l!=="parent")},a.isScene&&(r.state={...r.state,state:[{key:"Scene Info",value:{objects:a.children.length,memory:O_(a),calls:e.renderer.value.info.render.calls,triangles:e.renderer.value.info.render.triangles,points:e.renderer.value.info.render.points,lines:e.renderer.value.info.render.lines}},{key:"Programs",value:((o=e.renderer.value.info.programs)==null?void 0:o.map(l=>({...l,programName:l.name})))||[]}]})}}),t.on.editInspectorState(r=>{r.inspectorId===dl&&kk(e.scene.value,r.nodeId,r.path,r.state.value)})})}const EB=["data-scene","data-tres"],TB=dn({__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(n,{expose:e,emit:t}){const i=n,s=t,r=N0(),o=nt(),a=Oe(new vh),l=Rn();Ng(TF);const c=(p,_=!1)=>dn({setup(){var g;const m=(g=Rn())==null?void 0:g.appContext;m&&(m.app=l==null?void 0:l.appContext.app);const v={};function b(y){y&&(y.parent&&b(y.parent),y.provides&&Object.assign(v,y.provides))}return l!=null&&l.parent&&i.enableProvideBridge&&(b(l.parent),Reflect.ownKeys(v).forEach(y=>{gr(y,v[y])})),gr("useTres",p),gr("extend",Ng),typeof window<"u"&&SB(m==null?void 0:m.app,p),()=>ks(Zt,null,_?[]:r.default())}}),u=(p,_=!1)=>{const g=c(p,_),{render:m}=ZS(fB(p));m(ks(g),a.value)},f=(p,_=!1)=>{ET(p.scene.value),_&&(p.renderer.value.dispose(),p.renderer.value.renderLists.dispose(),p.renderer.value.forceContextLoss()),a.value.__tres={root:p}},d=Oe(null);e({context:d,dispose:()=>f(d.value,!0)});const h=()=>{f(d.value),u(d.value,!0)};return Gn(()=>{const p=o;d.value=aB({scene:a.value,canvas:p,windowSize:i.windowSize??!1,rendererOptions:i,emit:s});const{registerCamera:_,camera:g,cameras:m,deregisterCamera:v}=d.value;u(d.value);const b=()=>{const y=new Jt(45,window.innerWidth/window.innerHeight,.1,1e3);y.position.set(3,3,3),y.lookAt(0,0,0),_(y);const T=Ba(()=>{m.value.length>=2&&(y.removeFromParent(),v(y),T==null||T())})};Ke(()=>i.camera,(y,T)=>{y&&_(y),T&&(T.removeFromParent(),v(T))},{immediate:!0}),g.value||b()}),rs(h),(p,_)=>(vn(),yi("canvas",{ref_key:"canvas",ref:o,"data-scene":a.value.uuid,class:ka(p.$attrs.class),"data-tres":`tresjs ${Ft(yk).version}`,style:Si({display:"block",width:"100%",height:"100%",position:p.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...p.$attrs.style})},null,14,EB))}}),wB={install(n){n.component("TresCanvas",TB)}};function mm(n){if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in n?!1:Symbol.toStringTag in n?Object.prototype.toString.call(n)==="[object Module]":!0}function Fg(n,e,t=".",i){if(!mm(e))return Fg(n,{},t,i);const s=Object.assign({},e);for(const r in n){if(r==="__proto__"||r==="constructor")continue;const o=n[r];o!=null&&(i&&i(s,r,o,t)||(Array.isArray(o)&&Array.isArray(s[r])?s[r]=[...o,...s[r]]:mm(o)&&mm(s[r])?s[r]=Fg(o,s[r],(t?`${t}.`:"")+r.toString(),i):s[r]=o))}return s}function AB(n){return(...e)=>e.reduce((t,i)=>Fg(t,i,"",n),{})}const OT=AB();function Ir(n){return qd()?(E0(n),!0):!1}function nx(){const n=new Set,e=r=>{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return Ir(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const gm=new WeakMap,CB=(...n)=>{var e;const t=n[0],i=(e=Rn())==null?void 0:e.proxy;if(i==null&&!Lc())throw new Error("injectLocal must be called in setup");return i&&gm.has(i)&&t in gm.get(i)?gm.get(i)[t]:_n(...n)},Yc=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const NT=n=>n!=null,RB=Object.prototype.toString,Pd=n=>RB.call(n)==="[object Object]",Ui=()=>{},PB=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);function UT(...n){if(n.length!==1)return yS(...n);const e=n[0];return typeof e=="function"?ki(P0(()=>({get:e,set:Ui}))):nt(e)}function N_(n,e){function t(...i){return new Promise((s,r)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(r)})}return t}const FT=n=>n();function kT(n,e={}){let t,i,s=Ui;const r=l=>{clearTimeout(l),s(),s=Ui};let o;return l=>{const c=rt(n),u=rt(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,d)=>{s=e.rejectOnCancel?d:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function IB(...n){let e=0,t,i=!0,s=Ui,r,o,a,l,c;!Pt(n[0])&&typeof n[0]=="object"?{delay:o,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=n[0]:[o,a=!0,l=!0,c=!1]=n;const u=()=>{t&&(clearTimeout(t),t=void 0,s(),s=Ui)};return d=>{const h=rt(o),p=Date.now()-e,_=()=>r=d();return u(),h<=0?(e=Date.now(),_()):(p>h&&(l||!i)?(e=Date.now(),_()):a&&(r=new Promise((g,m)=>{s=c?m:g,t=setTimeout(()=>{e=Date.now(),i=!0,g(_()),u()},Math.max(0,h-p))})),!l&&!t&&(t=setTimeout(()=>i=!0,h)),i=!1,r)}}function LB(n=FT,e={}){const{initialState:t="active"}=e,i=UT(t==="active");function s(){i.value=!1}function r(){i.value=!0}const o=(...a)=>{i.value&&n(...a)};return{isActive:ki(i),pause:s,resume:r,eventFilter:o}}function DB(n){let e;function t(){return e||(e=n()),e}return t.reset=async()=>{const i=e;e=void 0,i&&await i},t}function OB(n,e){var t;if(typeof n=="number")return n+e;const i=((t=n.match(/^-?\d+\.?\d*/))==null?void 0:t[0])||"",s=n.slice(i.length),r=Number.parseFloat(i)+e;return Number.isNaN(r)?n:r+s}function kl(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function Bl(n){return Array.isArray(n)?n:[n]}function BT(n){return Rn()}function U_(n,e=200,t={}){return N_(kT(e,t),n)}function PG(n,e=200,t={}){const i=nt(rt(n)),s=U_(()=>{i.value=n.value},e,t);return Ke(n,()=>s()),mS(i)}function NB(n,e=200,t=!1,i=!0,s=!1){return N_(IB(e,t,i,s),n)}function zT(n,e,t={}){const{eventFilter:i=FT,...s}=t;return Ke(n,N_(i,e),s)}function UB(n,e,t={}){const{eventFilter:i,initialState:s="active",...r}=t,{eventFilter:o,pause:a,resume:l,isActive:c}=LB(i,{initialState:s});return{stop:zT(n,e,{...r,eventFilter:o}),pause:a,resume:l,isActive:c}}function $a(n,e=!0,t){BT()?Gn(n,t):e?n():Ar(n)}function FB(n,e){BT()&&rs(n,e)}function kB(n,e,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t,r=Oe(!1);let o=null;function a(){o&&(clearTimeout(o),o=null)}function l(){r.value=!1,a()}function c(...u){s&&n(),a(),r.value=!0,o=setTimeout(()=>{r.value=!1,o=null,n(...u)},rt(e))}return i&&(r.value=!0,Yc&&c()),Ir(l),{isPending:mS(r),start:c,stop:l}}function IG(n,e,t={}){const{debounce:i=0,maxWait:s=void 0,...r}=t;return zT(n,e,{...r,eventFilter:kT(i,{maxWait:s})})}function BB(n,e,t){return Ke(n,e,{...t,immediate:!0})}function LG(n,e,t){let i;Pt(t)?i={evaluating:t}:i={};const{lazy:s=!1,flush:r="pre",evaluating:o=void 0,shallow:a=!0,onError:l=Ui}=i,c=Oe(!s),u=a?Oe(e):nt(e);let f=0;return Ba(async d=>{if(!c.value)return;f++;const h=f;let p=!1;o&&Promise.resolve().then(()=>{o.value=!0});try{const _=await n(g=>{d(()=>{o&&(o.value=!1),p||g()})});h===f&&(u.value=_)}catch(_){l(_)}finally{o&&h===f&&(o.value=!1),p=!0}},{flush:r}),s?Se(()=>(c.value=!0,u.value)):u}const Hn=Yc?window:void 0,zB=Yc?window.document:void 0,F_=Yc?window.navigator:void 0;function ei(n){var e;const t=rt(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Ot(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=Se(()=>{const a=Bl(rt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=BB(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>ei(c)))!=null?l:[Hn].filter(c=>c!=null),Bl(rt(s.value?n[1]:n[0])),Bl(Ft(s.value?n[2]:n[1])),rt(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=Pd(u)?{...u}:u;e.push(...a.flatMap(d=>l.flatMap(h=>c.map(p=>i(d,h,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return Ir(t),o}function VB(){const n=Oe(!1),e=Rn();return e&&Gn(()=>{n.value=!0},e),n}function Lo(n){const e=VB();return Se(()=>(e.value,!!n()))}function VT(n,e,t={}){const{window:i=Hn,...s}=t;let r;const o=Lo(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const d=rt(n),h=Bl(d).map(ei).filter(NT);return new Set(h)}),c=Ke(()=>l.value,d=>{a(),o.value&&d.size&&(r=new MutationObserver(e),d.forEach(h=>r.observe(h,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return Ir(f),{isSupported:o,stop:f,takeRecords:u}}const HB=Symbol("vueuse-ssr-width");function HT(){const n=Lc()?CB(HB,null):null;return typeof n=="number"?n:void 0}function co(n,e={}){const{window:t=Hn,ssrWidth:i=HT()}=e,s=Lo(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=Oe(typeof i=="number"),o=Oe(),a=Oe(!1),l=c=>{a.value=c.matches};return Ba(()=>{if(r.value){r.value=!s.value;const c=rt(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),d=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(d||h);return d&&p&&(p=i>=kl(d[1])),h&&p&&(p=i<=kl(h[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(rt(n)),a.value=o.value.matches)}),Ot(o,"change",l,{passive:!0}),Se(()=>a.value)}const DG={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function OG(n,e={}){function t(h,p){let _=rt(n[rt(h)]);return p!=null&&(_=OB(_,p)),typeof _=="number"&&(_=`${_}px`),_}const{window:i=Hn,strategy:s="min-width",ssrWidth:r=HT()}=e,o=typeof r=="number",a=o?Oe(!1):{value:!0};o&&$a(()=>a.value=!!i);function l(h,p){return!a.value&&o?h==="min"?r>=kl(p):r<=kl(p):i?i.matchMedia(`(${h}-width: ${p})`).matches:!1}const c=h=>co(()=>`(min-width: ${t(h)})`,e),u=h=>co(()=>`(max-width: ${t(h)})`,e),f=Object.keys(n).reduce((h,p)=>(Object.defineProperty(h,p,{get:()=>s==="min-width"?c(p):u(p),enumerable:!0,configurable:!0}),h),{});function d(){const h=Object.keys(n).map(p=>[p,f[p],kl(t(p))]).sort((p,_)=>p[2]-_[2]);return Se(()=>h.filter(([,p])=>p.value).map(([p])=>p))}return Object.assign(f,{greaterOrEqual:c,smallerOrEqual:u,greater(h){return co(()=>`(min-width: ${t(h,.1)})`,e)},smaller(h){return co(()=>`(max-width: ${t(h,-.1)})`,e)},between(h,p){return co(()=>`(min-width: ${t(h)}) and (max-width: ${t(p,-.1)})`,e)},isGreater(h){return l("min",t(h,.1))},isGreaterOrEqual(h){return l("min",t(h))},isSmaller(h){return l("max",t(h,-.1))},isSmallerOrEqual(h){return l("max",t(h))},isInBetween(h,p){return l("min",t(h))&&l("max",t(p,-.1))},current:d,active(){const h=d();return Se(()=>h.value.length===0?"":h.value.at(s==="min-width"?-1:0))}})}function kg(n,e={}){const{controls:t=!1,navigator:i=F_}=e,s=Lo(()=>i&&"permissions"in i),r=Oe(),o=typeof n=="string"?{name:n}:n,a=Oe(),l=()=>{var u,f;a.value=(f=(u=r.value)==null?void 0:u.state)!=null?f:"prompt"};Ot(r,"change",l,{passive:!0});const c=DB(async()=>{if(s.value){if(!r.value)try{r.value=await i.permissions.query(o)}catch{r.value=void 0}finally{l()}if(t)return dt(r.value)}});return c(),t?{state:a,isSupported:s,query:c}:a}function NG(n={}){const{navigator:e=F_,read:t=!1,source:i,copiedDuring:s=1500,legacy:r=!1}=n,o=Lo(()=>e&&"clipboard"in e),a=kg("clipboard-read"),l=kg("clipboard-write"),c=Se(()=>o.value||r),u=Oe(""),f=Oe(!1),d=kB(()=>f.value=!1,s,{immediate:!1});async function h(){let v=!(o.value&&m(a.value));if(!v)try{u.value=await e.clipboard.readText()}catch{v=!0}v&&(u.value=g())}c.value&&t&&Ot(["copy","cut"],h,{passive:!0});async function p(v=rt(i)){if(c.value&&v!=null){let b=!(o.value&&m(l.value));if(!b)try{await e.clipboard.writeText(v)}catch{b=!0}b&&_(v),u.value=v,f.value=!0,d.start()}}function _(v){const b=document.createElement("textarea");b.value=v??"",b.style.position="absolute",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}function g(){var v,b,y;return(y=(b=(v=document==null?void 0:document.getSelection)==null?void 0:v.call(document))==null?void 0:b.toString())!=null?y:""}function m(v){return v==="granted"||v==="prompt"}return{isSupported:c,text:u,copied:f,copy:p}}const rf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},of="__vueuse_ssr_handlers__",GB=WB();function WB(){return of in rf||(rf[of]=rf[of]||{}),rf[of]}function GT(n,e){return GB[n]||e}function XB(n){return co("(prefers-color-scheme: dark)",n)}function $B(n){return n==null?"any":n instanceof Set?"set":n instanceof Map?"map":n instanceof Date?"date":typeof n=="boolean"?"boolean":typeof n=="string"?"string":typeof n=="object"?"object":Number.isNaN(n)?"any":"number"}const qB={boolean:{read:n=>n==="true",write:n=>String(n)},object:{read:n=>JSON.parse(n),write:n=>JSON.stringify(n)},number:{read:n=>Number.parseFloat(n),write:n=>String(n)},any:{read:n=>n,write:n=>String(n)},string:{read:n=>n,write:n=>String(n)},map:{read:n=>new Map(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n.entries()))},set:{read:n=>new Set(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n))},date:{read:n=>new Date(n),write:n=>n.toISOString()}},ix="vueuse-storage";function WT(n,e,t,i={}){var s;const{flush:r="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:l=!0,mergeDefaults:c=!1,shallow:u,window:f=Hn,eventFilter:d,onError:h=V=>{console.error(V)},initOnMounted:p}=i,_=(u?Oe:nt)(typeof e=="function"?e():e),g=Se(()=>rt(n));if(!t)try{t=GT("getDefaultStorage",()=>{var V;return(V=Hn)==null?void 0:V.localStorage})()}catch(V){h(V)}if(!t)return _;const m=rt(e),v=$B(m),b=(s=i.serializer)!=null?s:qB[v],{pause:y,resume:T}=UB(_,()=>E(_.value),{flush:r,deep:o,eventFilter:d});Ke(g,()=>B(),{flush:r});let w=!1;const S=V=>{p&&!w||B(V)},P=V=>{p&&!w||z(V)};f&&a&&(t instanceof Storage?Ot(f,"storage",S,{passive:!0}):Ot(f,ix,P)),p?$a(()=>{w=!0,B()}):B();function M(V,Q){if(f){const j={key:g.value,oldValue:V,newValue:Q,storageArea:t};f.dispatchEvent(t instanceof Storage?new StorageEvent("storage",j):new CustomEvent(ix,{detail:j}))}}function E(V){try{const Q=t.getItem(g.value);if(V==null)M(Q,null),t.removeItem(g.value);else{const j=b.write(V);Q!==j&&(t.setItem(g.value,j),M(Q,j))}}catch(Q){h(Q)}}function D(V){const Q=V?V.newValue:t.getItem(g.value);if(Q==null)return l&&m!=null&&t.setItem(g.value,b.write(m)),m;if(!V&&c){const j=b.read(Q);return typeof c=="function"?c(j,m):v==="object"&&!Array.isArray(j)?{...m,...j}:j}else return typeof Q!="string"?Q:b.read(Q)}function B(V){if(!(V&&V.storageArea!==t)){if(V&&V.key==null){_.value=m;return}if(!(V&&V.key!==g.value)){y();try{(V==null?void 0:V.newValue)!==b.write(_.value)&&(_.value=D(V))}catch(Q){h(Q)}finally{V?Ar(T):T()}}}}function z(V){B(V.detail)}return _}const YB="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function jB(n={}){const{selector:e="html",attribute:t="class",initialValue:i="auto",window:s=Hn,storage:r,storageKey:o="vueuse-color-scheme",listenToStorageChanges:a=!0,storageRef:l,emitAuto:c,disableTransition:u=!0}=n,f={auto:"",light:"light",dark:"dark",...n.modes||{}},d=XB({window:s}),h=Se(()=>d.value?"dark":"light"),p=l||(o==null?UT(i):WT(o,i,r,{window:s,listenToStorageChanges:a})),_=Se(()=>p.value==="auto"?h.value:p.value),g=GT("updateHTMLAttrs",(y,T,w)=>{const S=typeof y=="string"?s==null?void 0:s.document.querySelector(y):ei(y);if(!S)return;const P=new Set,M=new Set;let E=null;if(T==="class"){const B=w.split(/\s/g);Object.values(f).flatMap(z=>(z||"").split(/\s/g)).filter(Boolean).forEach(z=>{B.includes(z)?P.add(z):M.add(z)})}else E={key:T,value:w};if(P.size===0&&M.size===0&&E===null)return;let D;u&&(D=s.document.createElement("style"),D.appendChild(document.createTextNode(YB)),s.document.head.appendChild(D));for(const B of P)S.classList.add(B);for(const B of M)S.classList.remove(B);E&&S.setAttribute(E.key,E.value),u&&(s.getComputedStyle(D).opacity,document.head.removeChild(D))});function m(y){var T;g(e,t,(T=f[y])!=null?T:y)}function v(y){n.onChanged?n.onChanged(y,m):m(y)}Ke(_,v,{flush:"post",immediate:!0}),$a(()=>v(_.value));const b=Se({get(){return c?p.value:_.value},set(y){p.value=y}});return Object.assign(b,{store:p,system:h,state:_})}function af(n,e,t={}){const{window:i=Hn,initialValue:s,observe:r=!1}=t,o=Oe(s),a=Se(()=>{var c;return ei(e)||((c=i==null?void 0:i.document)==null?void 0:c.documentElement)});function l(){var c;const u=rt(n),f=rt(a);if(f&&i&&u){const d=(c=i.getComputedStyle(f).getPropertyValue(u))==null?void 0:c.trim();o.value=d||o.value||s}}return r&&VT(a,l,{attributeFilter:["style","class"],window:i}),Ke([a,()=>rt(n)],(c,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),l()},{immediate:!0}),Ke([o,a],([c,u])=>{const f=rt(n);u!=null&&u.style&&f&&(c==null?u.style.removeProperty(f):u.style.setProperty(f,c))},{immediate:!0}),o}function KB(n={}){const{valueDark:e="dark",valueLight:t=""}=n,i=jB({...n,onChanged:(o,a)=>{var l;n.onChanged?(l=n.onChanged)==null||l.call(n,o==="dark",a,o):a(o)},modes:{dark:e,light:t}}),s=Se(()=>i.system.value);return Se({get(){return i.value==="dark"},set(o){const a=o?"dark":"light";s.value===a?i.value="auto":i.value=a}})}function ZB(n={}){const{navigator:e=F_,requestPermissions:t=!1,constraints:i={audio:!0,video:!0},onUpdated:s}=n,r=nt([]),o=Se(()=>r.value.filter(p=>p.kind==="videoinput")),a=Se(()=>r.value.filter(p=>p.kind==="audioinput")),l=Se(()=>r.value.filter(p=>p.kind==="audiooutput")),c=Lo(()=>e&&e.mediaDevices&&e.mediaDevices.enumerateDevices),u=Oe(!1);let f;async function d(){c.value&&(r.value=await e.mediaDevices.enumerateDevices(),s==null||s(r.value),f&&(f.getTracks().forEach(p=>p.stop()),f=null))}async function h(){const p=i.video?"camera":"microphone";if(!c.value)return!1;if(u.value)return!0;const{state:_,query:g}=kg(p,{controls:!0});if(await g(),_.value!=="granted"){let m=!0;try{f=await e.mediaDevices.getUserMedia(i)}catch{f=null,m=!1}d(),u.value=m}else u.value=!0;return u.value}return c.value&&(t&&h(),Ot(e.mediaDevices,"devicechange",d,{passive:!0}),d()),{devices:r,ensurePermissions:h,permissionGranted:u,videoInputs:o,audioInputs:a,audioOutputs:l,isSupported:c}}function JB(n,e,t={}){const{window:i=Hn,...s}=t;let r;const o=Lo(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const f=rt(n);return Array.isArray(f)?f.map(d=>ei(d)):[ei(f)]}),c=Ke(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const d of f)d&&r.observe(d,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return Ir(u),{isSupported:o,stop:u}}function UG(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=Oe(0),l=Oe(0),c=Oe(0),u=Oe(0),f=Oe(0),d=Oe(0),h=Oe(0),p=Oe(0);function _(){const m=ei(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,d.value=0,h.value=0,p.value=0);return}const v=m.getBoundingClientRect();a.value=v.height,l.value=v.bottom,c.value=v.left,u.value=v.right,f.value=v.top,d.value=v.width,h.value=v.x,p.value=v.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return JB(n,g),Ke(()=>ei(n),m=>!m&&g()),VT(n,g,{attributeFilter:["style","class"]}),s&&Ot("scroll",g,{capture:!0,passive:!0}),i&&Ot("resize",g,{passive:!0}),$a(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:d,x:h,y:p,update:g}}function QB(n,e,t={}){const{root:i,rootMargin:s="0px",threshold:r=0,window:o=Hn,immediate:a=!0}=t,l=Lo(()=>o&&"IntersectionObserver"in o),c=Se(()=>{const p=rt(n);return Bl(p).map(ei).filter(NT)});let u=Ui;const f=Oe(a),d=l.value?Ke(()=>[c.value,ei(i),f.value],([p,_])=>{if(u(),!f.value||!p.length)return;const g=new IntersectionObserver(e,{root:ei(_),rootMargin:s,threshold:r});p.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=Ui}},{immediate:a,flush:"post"}):Ui,h=()=>{u(),d(),f.value=!1};return Ir(h),{isSupported:l,isActive:f,pause(){u(),f.value=!1},resume(){f.value=!0},stop:h}}const e4={multiple:!0,accept:"*",reset:!1,directory:!1};function t4(n){if(!n)return null;if(n instanceof FileList)return n;const e=new DataTransfer;for(const t of n)e.items.add(t);return e.files}function FG(n={}){const{document:e=zB}=n,t=nt(t4(n.initialFiles)),{on:i,trigger:s}=nx(),{on:r,trigger:o}=nx();let a;e&&(a=ei(n.input)||e.createElement("input"),a.type="file",a.onchange=u=>{const f=u.target;t.value=f.files,s(t.value)},a.oncancel=()=>{o()});const l=()=>{t.value=null,a&&a.value&&(a.value="",s(null))},c=u=>{if(!a)return;const f={...e4,...n,...u};a.multiple=f.multiple,a.accept=f.accept,a.webkitdirectory=f.directory,PB(f,"capture")&&(a.capture=f.capture),f.reset&&l(),a.click()};return{files:ki(t),open:c,reset:l,onCancel:r,onChange:i}}const sx=1;function kG(n,e={}){const{throttle:t=0,idle:i=200,onStop:s=Ui,onScroll:r=Ui,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:a={capture:!1,passive:!0},behavior:l="auto",window:c=Hn,onError:u=S=>{console.error(S)}}=e,f=Oe(0),d=Oe(0),h=Se({get(){return f.value},set(S){_(S,void 0)}}),p=Se({get(){return d.value},set(S){_(void 0,S)}});function _(S,P){var M,E,D,B;if(!c)return;const z=rt(n);if(!z)return;(D=z instanceof Document?c.document.body:z)==null||D.scrollTo({top:(M=rt(P))!=null?M:p.value,left:(E=rt(S))!=null?E:h.value,behavior:rt(l)});const V=((B=z==null?void 0:z.document)==null?void 0:B.documentElement)||(z==null?void 0:z.documentElement)||z;h!=null&&(f.value=V.scrollLeft),p!=null&&(d.value=V.scrollTop)}const g=Oe(!1),m=xi({left:!0,right:!1,top:!0,bottom:!1}),v=xi({left:!1,right:!1,top:!1,bottom:!1}),b=S=>{g.value&&(g.value=!1,v.left=!1,v.right=!1,v.top=!1,v.bottom=!1,s(S))},y=U_(b,t+i),T=S=>{var P;if(!c)return;const M=((P=S==null?void 0:S.document)==null?void 0:P.documentElement)||(S==null?void 0:S.documentElement)||ei(S),{display:E,flexDirection:D,direction:B}=getComputedStyle(M),z=B==="rtl"?-1:1,V=M.scrollLeft;v.left=Vf.value;const Q=Math.abs(V*z)<=(o.left||0),j=Math.abs(V*z)+M.clientWidth>=M.scrollWidth-(o.right||0)-sx;E==="flex"&&D==="row-reverse"?(m.left=j,m.right=Q):(m.left=Q,m.right=j),f.value=V;let te=M.scrollTop;S===c.document&&!te&&(te=c.document.body.scrollTop),v.top=ted.value;const Z=Math.abs(te)<=(o.top||0),pe=Math.abs(te)+M.clientHeight>=M.scrollHeight-(o.bottom||0)-sx;E==="flex"&&D==="column-reverse"?(m.top=pe,m.bottom=Z):(m.top=Z,m.bottom=pe),d.value=te},w=S=>{var P;if(!c)return;const M=(P=S.target.documentElement)!=null?P:S.target;T(M),g.value=!0,y(S),r(S)};return Ot(n,"scroll",t?NB(w,t,!0,!1):w,a),$a(()=>{try{const S=rt(n);if(!S)return;T(S)}catch(S){u(S)}}),Ot(n,"scrollend",b,a),{x:h,y:p,isScrolling:g,arrivedState:m,directions:v,measure(){const S=rt(n);c&&S&&T(S)}}}function ys(n,e,t={}){const{window:i=Hn}=t;return WT(n,e,i==null?void 0:i.localStorage,t)}const n4={page:n=>[n.pageX,n.pageY],client:n=>[n.clientX,n.clientY],screen:n=>[n.screenX,n.screenY],movement:n=>n instanceof MouseEvent?[n.movementX,n.movementY]:null};function BG(n={}){const{type:e="page",touch:t=!0,resetOnTouchEnds:i=!1,initialValue:s={x:0,y:0},window:r=Hn,target:o=r,scroll:a=!0,eventFilter:l}=n;let c=null,u=0,f=0;const d=Oe(s.x),h=Oe(s.y),p=Oe(null),_=typeof e=="function"?e:n4[e],g=S=>{const P=_(S);c=S,P&&([d.value,h.value]=P,p.value="mouse"),r&&(u=r.scrollX,f=r.scrollY)},m=S=>{if(S.touches.length>0){const P=_(S.touches[0]);P&&([d.value,h.value]=P,p.value="touch")}},v=()=>{if(!c||!r)return;const S=_(c);c instanceof MouseEvent&&S&&(d.value=S[0]+r.scrollX-u,h.value=S[1]+r.scrollY-f)},b=()=>{d.value=s.x,h.value=s.y},y=l?S=>l(()=>g(S),{}):S=>g(S),T=l?S=>l(()=>m(S),{}):S=>m(S),w=l?()=>l(()=>v(),{}):()=>v();if(o){const S={passive:!0};Ot(o,["mousemove","dragover"],y,S),t&&e!=="movement"&&(Ot(o,["touchstart","touchmove"],T,S),i&&Ot(o,"touchend",b,S)),a&&e==="page"&&Ot(r,"scroll",w,S)}return{x:d,y:h,sourceType:p}}function zG(n){const e=Oe(),t=()=>{e.value&&URL.revokeObjectURL(e.value),e.value=void 0};return Ke(()=>rt(n),i=>{t(),i&&(e.value=URL.createObjectURL(i))},{immediate:!0}),Ir(t),ki(e)}const rx="--vueuse-safe-area-top",ox="--vueuse-safe-area-right",ax="--vueuse-safe-area-bottom",lx="--vueuse-safe-area-left";function VG(){const n=Oe(""),e=Oe(""),t=Oe(""),i=Oe("");if(Yc){const r=af(rx),o=af(ox),a=af(ax),l=af(lx);r.value="env(safe-area-inset-top, 0px)",o.value="env(safe-area-inset-right, 0px)",a.value="env(safe-area-inset-bottom, 0px)",l.value="env(safe-area-inset-left, 0px)",s(),Ot("resize",U_(s),{passive:!0})}function s(){n.value=lf(rx),e.value=lf(ox),t.value=lf(ax),i.value=lf(lx)}return{top:n,right:e,bottom:t,left:i,update:s}}function lf(n){return getComputedStyle(document.documentElement).getPropertyValue(n)}function HG(n,e,t){const{window:i=Hn}={},s=nt(null),r=Oe(),o=(...l)=>{r.value&&r.value.postMessage(...l)},a=function(){r.value&&r.value.terminate()};return i&&(r.value=new Worker(n,e),r.value.onmessage=l=>{s.value=l.data},Ir(()=>{r.value&&r.value.terminate()})),{data:s,post:o,terminate:a,worker:r}}function GG(n={}){const{window:e=Hn,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=Oe(t),l=Oe(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:d,scale:h}=e.visualViewport;a.value=Math.round(f*h),l.value=Math.round(d*h)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),$a(c);const u={passive:!0};if(Ot("resize",c,u),e&&o==="visual"&&e.visualViewport&&Ot(e.visualViewport,"resize",c,u),s){const f=co("(orientation: portrait)");Ke(f,()=>c())}return{width:a,height:l}}const XT=1/60*1e3,i4=typeof performance<"u"?()=>performance.now():()=>Date.now(),$T=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(i4()),XT);function s4(n){let e=[],t=[],i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const f=u&&s,d=f?e:t;return c&&o.add(l),d.indexOf(l)===-1&&(d.push(l),f&&s&&(i=e.length)),l},cancel:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let c=0;c(n[e]=s4(()=>Mc=!0),n),{}),Vg=jc.reduce((n,e)=>{const t=Vh[e];return n[e]=(i,s=!1,r=!1)=>(Mc||l4(),t.schedule(i,s,r)),n},{}),o4=jc.reduce((n,e)=>(n[e]=Vh[e].cancel,n),{});jc.reduce((n,e)=>(n[e]=()=>Vh[e].process(va),n),{});const a4=n=>Vh[n].process(va),qT=n=>{Mc=!1,va.delta=Bg?XT:Math.max(Math.min(n-va.timestamp,r4),1),va.timestamp=n,zg=!0,jc.forEach(a4),zg=!1,Mc&&(Bg=!1,$T(qT))},l4=()=>{Mc=!0,Bg=!0,zg||$T(qT)},YT=()=>va;function jT(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);sMath.min(Math.max(t,n),e),_m=.001,c4=.01,u4=10,f4=.05,d4=1;function h4({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let s,r,o=1-e;o=Hg(f4,d4,o),n=Hg(c4,u4,n/1e3),o<1?(s=c=>{const u=c*o,f=u*n,d=u-t,h=Gg(c,o),p=Math.exp(-f);return _m-d/h*p},r=c=>{const f=c*o*n,d=f*t+t,h=Math.pow(o,2)*Math.pow(c,2)*n,p=Math.exp(-f),_=Gg(Math.pow(c,2),o);return(-s(c)+_m>0?-1:1)*((d-h)*p)/_}):(s=c=>{const u=Math.exp(-c*n),f=(c-t)*n+1;return-_m+u*f},r=c=>{const u=Math.exp(-c*n),f=(t-c)*(n*n);return u*f});const a=5/n,l=m4(s,r,a);if(n=n*1e3,isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const p4=12;function m4(n,e,t){let i=t;for(let s=1;sn[t]!==void 0)}function v4(n){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!ux(n,_4)&&ux(n,g4)){const t=h4(n);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function k_(n){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:s}=n,r=jT(n,["from","to","restSpeed","restDelta"]);const o={done:!1,value:e};let{stiffness:a,damping:l,mass:c,velocity:u,duration:f,isResolvedFromDuration:d}=v4(r),h=fx,p=fx;function _(){const g=u?-(u/1e3):0,m=t-e,v=l/(2*Math.sqrt(a*c)),b=Math.sqrt(a/c)/1e3;if(s===void 0&&(s=Math.min(Math.abs(t-e)/100,.4)),v<1){const y=Gg(b,v);h=T=>{const w=Math.exp(-v*b*T);return t-w*((g+v*b*m)/y*Math.sin(y*T)+m*Math.cos(y*T))},p=T=>{const w=Math.exp(-v*b*T);return v*b*w*(Math.sin(y*T)*(g+v*b*m)/y+m*Math.cos(y*T))-w*(Math.cos(y*T)*(g+v*b*m)-y*m*Math.sin(y*T))}}else if(v===1)h=y=>t-Math.exp(-b*y)*(m+(g+b*m)*y);else{const y=b*Math.sqrt(v*v-1);h=T=>{const w=Math.exp(-v*b*T),S=Math.min(y*T,300);return t-w*((g+v*b*m)*Math.sinh(S)+y*m*Math.cosh(S))/y}}}return _(),{next:g=>{const m=h(g);if(d)o.done=g>=f;else{const v=p(g)*1e3,b=Math.abs(v)<=i,y=Math.abs(t-m)<=s;o.done=b&&y}return o.value=o.done?t:m,o},flipTarget:()=>{u=-u,[e,t]=[t,e],_()}}}k_.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const fx=n=>0,KT=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},B_=(n,e,t)=>-t*n+t*e+n,ZT=(n,e)=>t=>Math.max(Math.min(t,e),n),zl=n=>n%1?Number(n.toFixed(5)):n,Sc=/(-)?([\d]*\.?[\d])+/g,Wg=/(#[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,y4=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Kc(n){return typeof n=="string"}const Zc={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},Vl=Object.assign(Object.assign({},Zc),{transform:ZT(0,1)}),cf=Object.assign(Object.assign({},Zc),{default:1}),z_=n=>({test:e=>Kc(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),to=z_("deg"),Hl=z_("%"),ut=z_("px"),dx=Object.assign(Object.assign({},Hl),{parse:n=>Hl.parse(n)/100,transform:n=>Hl.transform(n*100)}),V_=(n,e)=>t=>!!(Kc(t)&&y4.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),JT=(n,e,t)=>i=>{if(!Kc(i))return i;const[s,r,o,a]=i.match(Sc);return{[n]:parseFloat(s),[e]:parseFloat(r),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},po={test:V_("hsl","hue"),parse:JT("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Hl.transform(zl(e))+", "+Hl.transform(zl(t))+", "+zl(Vl.transform(i))+")"},b4=ZT(0,255),vm=Object.assign(Object.assign({},Zc),{transform:n=>Math.round(b4(n))}),mr={test:V_("rgb","red"),parse:JT("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+vm.transform(n)+", "+vm.transform(e)+", "+vm.transform(t)+", "+zl(Vl.transform(i))+")"};function x4(n){let e="",t="",i="",s="";return n.length>5?(e=n.substr(1,2),t=n.substr(3,2),i=n.substr(5,2),s=n.substr(7,2)):(e=n.substr(1,1),t=n.substr(2,1),i=n.substr(3,1),s=n.substr(4,1),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Xg={test:V_("#"),parse:x4,transform:mr.transform},Yn={test:n=>mr.test(n)||Xg.test(n)||po.test(n),parse:n=>mr.test(n)?mr.parse(n):po.test(n)?po.parse(n):Xg.parse(n),transform:n=>Kc(n)?n:n.hasOwnProperty("red")?mr.transform(n):po.transform(n)},QT="${c}",ew="${n}";function M4(n){var e,t,i,s;return isNaN(n)&&Kc(n)&&((t=(e=n.match(Sc))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((s=(i=n.match(Wg))===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)>0}function tw(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0;const i=n.match(Wg);i&&(t=i.length,n=n.replace(Wg,QT),e.push(...i.map(Yn.parse)));const s=n.match(Sc);return s&&(n=n.replace(Sc,ew),e.push(...s.map(Zc.parse))),{values:e,numColors:t,tokenised:n}}function nw(n){return tw(n).values}function iw(n){const{values:e,numColors:t,tokenised:i}=tw(n),s=e.length;return r=>{let o=i;for(let a=0;atypeof n=="number"?0:n;function E4(n){const e=nw(n);return iw(n)(e.map(S4))}const Jc={test:M4,parse:nw,createTransformer:iw,getAnimatableNone:E4},T4=new Set(["brightness","contrast","saturate","opacity"]);function w4(n){let[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(Sc)||[];if(!i)return n;const s=t.replace(i,"");let r=T4.has(e)?1:0;return i!==t&&(r*=100),e+"("+r+s+")"}const A4=/([a-z-]*)\(.*?\)/g,$g=Object.assign(Object.assign({},Jc),{getAnimatableNone:n=>{const e=n.match(A4);return e?e.map(w4).join(" "):n}});function ym(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function hx({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let s=0,r=0,o=0;if(!e)s=r=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;s=ym(l,a,n+1/3),r=ym(l,a,n),o=ym(l,a,n-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const C4=(n,e,t)=>{const i=n*n,s=e*e;return Math.sqrt(Math.max(0,t*(s-i)+i))},R4=[Xg,mr,po],px=n=>R4.find(e=>e.test(n)),sw=(n,e)=>{let t=px(n),i=px(e),s=t.parse(n),r=i.parse(e);t===po&&(s=hx(s),t=mr),i===po&&(r=hx(r),i=mr);const o=Object.assign({},s);return a=>{for(const l in o)l!=="alpha"&&(o[l]=C4(s[l],r[l],a));return o.alpha=B_(s.alpha,r.alpha,a),t.transform(o)}},P4=n=>typeof n=="number",I4=(n,e)=>t=>e(n(t)),rw=(...n)=>n.reduce(I4);function ow(n,e){return P4(n)?t=>B_(n,e,t):Yn.test(n)?sw(n,e):lw(n,e)}const aw=(n,e)=>{const t=[...n],i=t.length,s=n.map((r,o)=>ow(r,e[o]));return r=>{for(let o=0;o{const t=Object.assign(Object.assign({},n),e),i={};for(const s in t)n[s]!==void 0&&e[s]!==void 0&&(i[s]=ow(n[s],e[s]));return s=>{for(const r in i)t[r]=i[r](s);return t}};function mx(n){const e=Jc.parse(n),t=e.length;let i=0,s=0,r=0;for(let o=0;o{const t=Jc.createTransformer(e),i=mx(n),s=mx(e);return i.numHSL===s.numHSL&&i.numRGB===s.numRGB&&i.numNumbers>=s.numNumbers?rw(aw(i.parsed,s.parsed),t):o=>`${o>0?e:n}`},D4=(n,e)=>t=>B_(n,e,t);function O4(n){if(typeof n=="number")return D4;if(typeof n=="string")return Yn.test(n)?sw:lw;if(Array.isArray(n))return aw;if(typeof n=="object")return L4}function N4(n,e,t){const i=[],s=t||O4(n[0]),r=n.length-1;for(let o=0;ot(KT(n,e,i))}function F4(n,e){const t=n.length,i=t-1;return s=>{let r=0,o=!1;if(s<=n[0]?o=!0:s>=n[i]&&(r=i-1,o=!0),!o){let l=1;for(;ls||l===i);l++);r=l-1}const a=KT(n[r],n[r+1],s);return e[r](a)}}function cw(n,e,{clamp:t=!0,ease:i,mixer:s}={}){const r=n.length;cx(r===e.length),cx(!i||!Array.isArray(i)||i.length===r-1),n[0]>n[r-1]&&(n=[].concat(n),e=[].concat(e),n.reverse(),e.reverse());const o=N4(e,i,s),a=r===2?U4(n,o):F4(n,o);return t?l=>a(Hg(n[0],n[r-1],l)):a}const Hh=n=>e=>1-n(1-e),H_=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,k4=n=>e=>Math.pow(e,n),uw=n=>e=>e*e*((n+1)*e-n),B4=n=>{const e=uw(n);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},fw=1.525,z4=4/11,V4=8/11,H4=9/10,dw=n=>n,G_=k4(2),G4=Hh(G_),hw=H_(G_),pw=n=>1-Math.sin(Math.acos(n)),mw=Hh(pw),W4=H_(mw),W_=uw(fw),X4=Hh(W_),$4=H_(W_),q4=B4(fw),Y4=4356/361,j4=35442/1805,K4=16061/1805,Id=n=>{if(n===1||n===0)return n;const e=n*n;return nn<.5?.5*(1-Id(1-n*2)):.5*Id(n*2-1)+.5;function Q4(n,e){return n.map(()=>e||hw).splice(0,n.length-1)}function e5(n){const e=n.length;return n.map((t,i)=>i!==0?i/(e-1):0)}function t5(n,e){return n.map(t=>t*e)}function Cf({from:n=0,to:e=1,ease:t,offset:i,duration:s=300}){const r={done:!1,value:n},o=Array.isArray(e)?e:[n,e],a=t5(i&&i.length===o.length?i:e5(o),s);function l(){return cw(a,o,{ease:Array.isArray(t)?t:Q4(o,t)})}let c=l();return{next:u=>(r.value=c(u),r.done=u>=s,r),flipTarget:()=>{o.reverse(),c=l()}}}function n5({velocity:n=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:s=.5,modifyTarget:r}){const o={done:!1,value:e};let a=t*n;const l=e+a,c=r===void 0?l:r(l);return c!==l&&(a=c-e),{next:u=>{const f=-a*Math.exp(-u/i);return o.done=!(f>s||f<-s),o.value=o.done?c:c+f,o},flipTarget:()=>{}}}const gx={keyframes:Cf,spring:k_,decay:n5};function i5(n){if(Array.isArray(n.to))return Cf;if(gx[n.type])return gx[n.type];const e=new Set(Object.keys(n));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Cf:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?k_:Cf}function gw(n,e,t=0){return n-e-t}function s5(n,e,t=0,i=!0){return i?gw(e+-n,e,t):e-(n-e)+t}function r5(n,e,t,i){return i?n>=e+t:n<=-t}const o5=n=>{const e=({delta:t})=>n(t);return{start:()=>Vg.update(e,!0),stop:()=>o4.update(e)}};function _w(n){var e,t,{from:i,autoplay:s=!0,driver:r=o5,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:f,onComplete:d,onRepeat:h,onUpdate:p}=n,_=jT(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:g}=_,m,v=0,b=_.duration,y,T=!1,w=!0,S;const P=i5(_);!((t=(e=P).needsInterpolation)===null||t===void 0)&&t.call(e,i,g)&&(S=cw([0,100],[i,g],{clamp:!1}),i=0,g=100);const M=P(Object.assign(Object.assign({},_),{from:i,to:g}));function E(){v++,l==="reverse"?(w=v%2===0,o=s5(o,b,c,w)):(o=gw(o,b,c),l==="mirror"&&M.flipTarget()),T=!1,h&&h()}function D(){m.stop(),d&&d()}function B(V){if(w||(V=-V),o+=V,!T){const Q=M.next(Math.max(0,o));y=Q.value,S&&(y=S(y)),T=w?Q.done:o<=0}p==null||p(y),T&&(v===0&&(b??(b=o)),v{f==null||f(),m.stop()}}}function vw(n,e){return e?n*(1e3/e):0}function a5({from:n=0,velocity:e=0,min:t,max:i,power:s=.8,timeConstant:r=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:f,onComplete:d,onStop:h}){let p;function _(b){return t!==void 0&&bi}function g(b){return t===void 0?i:i===void 0||Math.abs(t-b){var T;f==null||f(y),(T=b.onUpdate)===null||T===void 0||T.call(b,y)},onComplete:d,onStop:h}))}function v(b){m(Object.assign({type:"spring",stiffness:o,damping:a,restDelta:l},b))}if(_(n))v({from:n,velocity:e,to:g(n)});else{let b=s*e+n;typeof c<"u"&&(b=c(b));const y=g(b),T=y===t?-1:1;let w,S;const P=M=>{w=S,S=M,e=vw(M-w,YT().delta),(T===1&&M>y||T===-1&&Mp==null?void 0:p.stop()}}const yw=(n,e)=>1-3*e+3*n,bw=(n,e)=>3*e-6*n,xw=n=>3*n,Ld=(n,e,t)=>((yw(e,t)*n+bw(e,t))*n+xw(e))*n,Mw=(n,e,t)=>3*yw(e,t)*n*n+2*bw(e,t)*n+xw(e),l5=1e-7,c5=10;function u5(n,e,t,i,s){let r,o,a=0;do o=e+(t-e)/2,r=Ld(o,i,s)-n,r>0?t=o:e=o;while(Math.abs(r)>l5&&++a=d5?h5(o,f,n,t):d===0?f:u5(o,a,a+uf,n,t)}return o=>o===0||o===1?o:Ld(r(o),e,i)}const Ns={},bm={};class m5{constructor(){fi(this,"subscriptions",new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,i){if(this.subscriptions.size)for(const s of this.subscriptions)s(e,t,i)}clear(){this.subscriptions.clear()}}function _x(n){return!Number.isNaN(Number.parseFloat(n))}class g5{constructor(e){fi(this,"current");fi(this,"prev");fi(this,"timeDelta",0);fi(this,"lastUpdated",0);fi(this,"updateSubscribers",new m5);fi(this,"stopAnimation");fi(this,"canTrackVelocity",!1);fi(this,"updateAndNotify",e=>{this.prev=this.current,this.current=e;const{delta:t,timestamp:i}=YT();this.lastUpdated!==i&&(this.timeDelta=t,this.lastUpdated=i),Vg.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});fi(this,"scheduleVelocityCheck",()=>Vg.postRender(this.velocityCheck));fi(this,"velocityCheck",({timestamp:e})=>{this.canTrackVelocity||(this.canTrackVelocity=_x(this.current)),e!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=e,this.canTrackVelocity=_x(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?vw(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{const{stop:i}=e(t);this.stopAnimation=i}).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 _5(n){return new g5(n)}const{isArray:v5}=Array;function y5(){const n=nt({}),e=i=>{const s=r=>{n.value[r]&&(n.value[r].stop(),n.value[r].destroy(),delete n.value[r])};i?v5(i)?i.forEach(s):s(i):Object.keys(n.value).forEach(s)},t=(i,s,r)=>{if(n.value[i])return n.value[i];const o=_5(s);return o.onChange(a=>r[i]=a),n.value[i]=o,o};return FB(e),{motionValues:n,get:t,stop:e}}function b5(n){return Array.isArray(n)}function no(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function xm(n){return{type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function x5(n){return{type:"spring",stiffness:550,damping:n===0?100:30,restDelta:.01,restSpeed:10}}function Mm(){return{type:"keyframes",ease:"linear",duration:300}}function M5(n){return{type:"keyframes",duration:800,values:n}}const vx={default:x5,x:no,y:no,z:no,rotate:no,rotateX:no,rotateY:no,rotateZ:no,scaleX:xm,scaleY:xm,scale:xm,backgroundColor:Mm,color:Mm,opacity:Mm};function Sw(n,e){let t;return b5(e)?t=M5:t=vx[n]||vx.default,{to:e,...t(e)}}const yx={...Zc,transform:Math.round},Ew={color:Yn,backgroundColor:Yn,outlineColor:Yn,fill:Yn,stroke:Yn,borderColor:Yn,borderTopColor:Yn,borderRightColor:Yn,borderBottomColor:Yn,borderLeftColor:Yn,borderWidth:ut,borderTopWidth:ut,borderRightWidth:ut,borderBottomWidth:ut,borderLeftWidth:ut,borderRadius:ut,radius:ut,borderTopLeftRadius:ut,borderTopRightRadius:ut,borderBottomRightRadius:ut,borderBottomLeftRadius:ut,width:ut,maxWidth:ut,height:ut,maxHeight:ut,size:ut,top:ut,right:ut,bottom:ut,left:ut,padding:ut,paddingTop:ut,paddingRight:ut,paddingBottom:ut,paddingLeft:ut,margin:ut,marginTop:ut,marginRight:ut,marginBottom:ut,marginLeft:ut,rotate:to,rotateX:to,rotateY:to,rotateZ:to,scale:cf,scaleX:cf,scaleY:cf,scaleZ:cf,skew:to,skewX:to,skewY:to,distance:ut,translateX:ut,translateY:ut,translateZ:ut,x:ut,y:ut,z:ut,perspective:ut,transformPerspective:ut,opacity:Vl,originX:dx,originY:dx,originZ:ut,zIndex:yx,filter:$g,WebkitFilter:$g,fillOpacity:Vl,strokeOpacity:Vl,numOctaves:yx},X_=n=>Ew[n];function qg(n,e){return e&&typeof n=="number"&&e.transform?e.transform(n):n}function S5(n,e){let t=X_(n);return t!==$g&&(t=Jc),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const E5={linear:dw,easeIn:G_,easeInOut:hw,easeOut:G4,circIn:pw,circInOut:W4,circOut:mw,backIn:W_,backInOut:$4,backOut:X4,anticipate:q4,bounceIn:Z4,bounceInOut:J4,bounceOut:Id};function bx(n){if(Array.isArray(n)){const[e,t,i,s]=n;return p5(e,t,i,s)}else if(typeof n=="string")return E5[n];return n}function T5(n){return Array.isArray(n)&&typeof n[0]!="number"}function xx(n,e){return n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Jc.test(e)&&!e.startsWith("url("))}function w5(n){return Array.isArray(n.to)&&n.to[0]===null&&(n.to=[...n.to],n.to[0]=n.from),n}function A5({ease:n,times:e,delay:t,...i}){const s={...i};return e&&(s.offset=e),n&&(s.ease=T5(n)?n.map(bx):bx(n)),t&&(s.elapsed=-t),s}function C5(n,e,t){return Array.isArray(e.to)&&(n.duration||(n.duration=800)),w5(e),R5(n)||(n={...n,...Sw(t,e.to)}),{...e,...A5(n)}}function R5({delay:n,repeat:e,repeatType:t,repeatDelay:i,from:s,...r}){return!!Object.keys(r).length}function P5(n,e){return n[e]||n.default||n}function I5(n,e,t,i,s){const r=P5(i,n);let o=r.from===null||r.from===void 0?e.get():r.from;const a=xx(n,t);o==="none"&&a&&typeof t=="string"&&(o=S5(n,t));const l=xx(n,o);function c(f){const d={from:o,to:t,velocity:i.velocity?i.velocity:e.getVelocity(),onUpdate:h=>e.set(h)};return r.type==="inertia"||r.type==="decay"?a5({...d,...r}):_w({...C5(r,d,n),onUpdate:h=>{d.onUpdate(h),r.onUpdate&&r.onUpdate(h)},onComplete:()=>{s&&s(),f&&f()}})}function u(f){return e.set(t),s&&s(),f&&f(),{stop:()=>{}}}return!l||!a||r.type===!1?u:c}function L5(){const{motionValues:n,stop:e,get:t}=y5();return{motionValues:n,stop:e,push:(s,r,o,a={},l)=>{const c=o[s],u=t(s,c,o);if(a&&a.immediate){u.set(r);return}const f=I5(s,u,r,a,l);u.start(f)}}}function D5(n,e={},{motionValues:t,push:i,stop:s}=L5()){const r=Ft(e),o=nt(!1);Ke(t,f=>{o.value=Object.values(f).filter(d=>d.isAnimating()).length>0},{immediate:!0,deep:!0});const a=f=>{if(!r||!r[f])throw new Error(`The variant ${f} does not exist.`);return r[f]},l=f=>{typeof f=="string"&&(f=a(f));const d=Object.entries(f).map(([p,_])=>{if(p!=="transition")return new Promise(g=>i(p,_,n,f.transition||Sw(p,f[p]),g))}).filter(Boolean);async function h(){var p,_;await Promise.all(d),(_=(p=f.transition)==null?void 0:p.onComplete)==null||_.call(p)}return Promise.all([h()])};return{isAnimating:o,apply:l,set:f=>{const d=Pd(f)?f:a(f);Object.entries(d).forEach(([h,p])=>{h!=="transition"&&i(h,p,n,{immediate:!0})})},leave:async f=>{let d;if(r&&(r.leave&&(d=r.leave),!r.leave&&r.initial&&(d=r.initial)),!d){f();return}await l(d),f()},stop:s}}const $_=typeof window<"u",O5=()=>$_&&(window.onpointerdown===null||(Ns==null?void 0:Ns.TEST)),N5=()=>$_&&(window.ontouchstart===null||(Ns==null?void 0:Ns.TEST)),U5=()=>$_&&(window.onmousedown===null||(Ns==null?void 0:Ns.TEST));function F5({target:n,state:e,variants:t,apply:i}){const s=Ft(t),r=nt(!1),o=nt(!1),a=nt(!1),l=Se(()=>{let u=[...Object.keys(e.value||{})];return s&&(s.hovered&&(u=[...u,...Object.keys(s.hovered)]),s.tapped&&(u=[...u,...Object.keys(s.tapped)]),s.focused&&(u=[...u,...Object.keys(s.focused)])),u}),c=Se(()=>{const u={};Object.assign(u,e.value),r.value&&s.hovered&&Object.assign(u,s.hovered),o.value&&s.tapped&&Object.assign(u,s.tapped),a.value&&s.focused&&Object.assign(u,s.focused);for(const f in u)l.value.includes(f)||delete u[f];return u});s.hovered&&(Ot(n,"mouseenter",()=>r.value=!0),Ot(n,"mouseleave",()=>{r.value=!1,o.value=!1})),s.tapped&&(U5()&&(Ot(n,"mousedown",()=>o.value=!0),Ot(n,"mouseup",()=>o.value=!1)),O5()&&(Ot(n,"pointerdown",()=>o.value=!0),Ot(n,"pointerup",()=>o.value=!1)),N5()&&(Ot(n,"touchstart",()=>o.value=!0),Ot(n,"touchend",()=>o.value=!1))),s.focused&&(Ot(n,"focus",()=>a.value=!0),Ot(n,"blur",()=>a.value=!1)),Ke([r,o,a],()=>{i(c.value)})}function k5({set:n,target:e,variants:t,variant:i}){const s=Ft(t);Ke(()=>e,()=>{s&&(s.initial&&(n("initial"),i.value="initial"),s.enter&&(i.value="enter"))},{immediate:!0,flush:"pre"})}function B5({state:n,apply:e}){Ke(n,t=>{t&&e(t)},{immediate:!0})}function Tw({target:n,variants:e,variant:t}){const i=Ft(e);i&&(i.visible||i.visibleOnce)&&QB(n,([{isIntersecting:s}])=>{i.visible?s?t.value="visible":t.value="initial":i.visibleOnce&&(s&&t.value!=="visibleOnce"?t.value="visibleOnce":t.value||(t.value="initial"))})}function z5(n,e={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){e.lifeCycleHooks&&k5(n),e.syncVariants&&B5(n),e.visibilityHooks&&Tw(n),e.eventListeners&&F5(n)}function ww(n={}){const e=xi({...n}),t=nt({});return Ke(e,()=>{const i={};for(const[s,r]of Object.entries(e)){const o=X_(s),a=qg(r,o);i[s]=a}t.value=i},{immediate:!0,deep:!0}),{state:e,style:t}}function q_(n,e){Ke(()=>ei(n),t=>{t&&e(t)},{immediate:!0})}const V5={x:"translateX",y:"translateY",z:"translateZ"};function Aw(n={},e=!0){const t=xi({...n}),i=nt("");return Ke(t,s=>{let r="",o=!1;if(e&&(s.x||s.y||s.z)){const a=[s.x||0,s.y||0,s.z||0].map(l=>qg(l,ut)).join(",");r+=`translate3d(${a}) `,o=!0}for(const[a,l]of Object.entries(s)){if(e&&(a==="x"||a==="y"||a==="z"))continue;const c=X_(a),u=qg(l,c);r+=`${V5[a]||a}(${u}) `}e&&!o&&(r+="translateZ(0px) "),i.value=r.trim()},{immediate:!0,deep:!0}),{state:t,transform:i}}const H5=["","X","Y","Z"],G5=["perspective","translate","scale","rotate","skew"],Cw=["transformPerspective","x","y","z"];G5.forEach(n=>{H5.forEach(e=>{const t=n+e;Cw.push(t)})});const W5=new Set(Cw);function Y_(n){return W5.has(n)}const X5=new Set(["originX","originY","originZ"]);function Rw(n){return X5.has(n)}function $5(n){const e={},t={};return Object.entries(n).forEach(([i,s])=>{Y_(i)||Rw(i)?e[i]=s:t[i]=s}),{transform:e,style:t}}function Gh(n){const{transform:e,style:t}=$5(n),{transform:i}=Aw(e),{style:s}=ww(t);return i.value&&(s.value.transform=i.value),s.value}function q5(n,e){let t,i;const{state:s,style:r}=ww();return q_(n,o=>{i=o;for(const a of Object.keys(Ew))o.style[a]===null||o.style[a]===""||Y_(a)||Rw(a)||(s[a]=o.style[a]);t&&Object.entries(t).forEach(([a,l])=>o.style[a]=l),e&&e(s)}),Ke(r,o=>{if(!i){t=o;return}for(const a in o)i.style[a]=o[a]},{immediate:!0}),{style:s}}function Y5(n){const e=n.trim().split(/\) |\)/);if(e.length===1)return{};const t=i=>i.endsWith("px")||i.endsWith("deg")?Number.parseFloat(i):Number.isNaN(Number(i))?Number(i):i;return e.reduce((i,s)=>{if(!s)return i;const[r,o]=s.split("("),l=o.split(",").map(u=>t(u.endsWith(")")?u.replace(")",""):u.trim())),c=l.length===1?l[0]:l;return{...i,[r]:c}},{})}function j5(n,e){Object.entries(Y5(e)).forEach(([t,i])=>{const s=["x","y","z"];if(t==="translate3d"){if(i===0){s.forEach(r=>n[r]=0);return}i.forEach((r,o)=>n[s[o]]=r);return}if(i=Number.parseFloat(`${i}`),t==="translateX"){n.x=i;return}if(t==="translateY"){n.y=i;return}if(t==="translateZ"){n.z=i;return}n[t]=i})}function K5(n,e){let t,i;const{state:s,transform:r}=Aw();return q_(n,o=>{i=o,o.style.transform&&j5(s,o.style.transform),t&&(o.style.transform=t),e&&e(s)}),Ke(r,o=>{if(!i){t=o;return}i.style.transform=o},{immediate:!0}),{transform:s}}function Z5(n){return Object.entries(n)}function J5(n,e){const t=xi({}),i=o=>Object.entries(o).forEach(([a,l])=>t[a]=l),{style:s}=q5(n,i),{transform:r}=K5(n,i);return Ke(t,o=>{Z5(o).forEach(([a,l])=>{const c=Y_(a)?r:s;c[a]&&c[a]===l||(c[a]=l)})},{immediate:!0,deep:!0}),q_(n,()=>e),{motionProperties:t,style:s,transform:r}}function Q5(n={}){const e=Ft(n),t=nt();return{state:Se(()=>{if(t.value)return e[t.value]}),variant:t}}function Pw(n,e={},t){const{motionProperties:i}=J5(n),{variant:s,state:r}=Q5(e),o=D5(i,e),a={target:n,variant:s,variants:e,state:r,motionProperties:i,...o};return z5(a,t),a}const Iw=["delay","duration"],ez=["initial","enter","leave","visible","visible-once","visibleOnce","hovered","tapped","focused",...Iw];function tz(n){return Iw.includes(n)}function nz(n,e){const t=n.props?n.props:n.data&&n.data.attrs?n.data.attrs:{};if(t){t.variants&&Pd(t.variants)&&(e.value={...e.value,...t.variants});for(let i of ez)if(!(!t||!t[i])){if(tz(i)&&typeof t[i]=="number"){for(const s of["enter","visible","visibleOnce"]){const r=e.value[s];r!=null&&(r.transition??(r.transition={}),r.transition[i]=t[i])}continue}if(Pd(t[i])){const s=t[i];i==="visible-once"&&(i="visibleOnce"),e.value[i]=s}}}}function Sm(n,e=!1){return{created:(s,r,o)=>{const a=r.value&&typeof r.value=="string"?r.value:o.key;a&&bm[a]&&bm[a].stop();const l=e?structuredClone(dt(n)||{}):n||{},c=nt(l);typeof r.value=="object"&&(c.value=r.value),nz(o,c);const f=Pw(s,c,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});s.motionInstance=f,a&&(bm[a]=f)},mounted:(s,r,o)=>{s.motionInstance&&Tw(s.motionInstance)},getSSRProps(s,r){let{initial:o}=s.value||r&&(r==null?void 0:r.props)||{};o=Ft(o);const a=OT({},(n==null?void 0:n.initial)||{},o||{});return!a||Object.keys(a).length===0?void 0:{style:Gh(a)}}}}const iz={initial:{opacity:0},enter:{opacity:1}},sz={initial:{opacity:0},visible:{opacity:1}},rz={initial:{opacity:0},visibleOnce:{opacity:1}},oz={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},az={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},lz={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},cz={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},uz={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},fz={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},dz={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},hz={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},pz={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},mz={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},gz={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},_z={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},vz={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},yz={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},bz={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},xz={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},Mz={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},Sz={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},Ez={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Tz={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},wz={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},Az={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},Cz={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},Rz={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},Pz={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},Iz={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},Lz={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Dd={__proto__:null,fade:iz,fadeVisible:sz,fadeVisibleOnce:rz,pop:oz,popVisible:az,popVisibleOnce:lz,rollBottom:vz,rollLeft:cz,rollRight:dz,rollTop:mz,rollVisibleBottom:yz,rollVisibleLeft:uz,rollVisibleOnceBottom:bz,rollVisibleOnceLeft:fz,rollVisibleOnceRight:pz,rollVisibleOnceTop:_z,rollVisibleRight:hz,rollVisibleTop:gz,slideBottom:Pz,slideLeft:xz,slideRight:Ez,slideTop:Az,slideVisibleBottom:Iz,slideVisibleLeft:Mz,slideVisibleOnceBottom:Lz,slideVisibleOnceLeft:Sz,slideVisibleOnceRight:wz,slideVisibleOnceTop:Rz,slideVisibleRight:Tz,slideVisibleTop:Cz};function Dz(n){const e="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",t="aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------",i=new RegExp(e.split("").join("|"),"g");return n.toString().replace(/[A-Z]/g,s=>`-${s}`).toLowerCase().replace(/\s+/g,"-").replace(i,s=>t.charAt(e.indexOf(s))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const Lw=Symbol(""),Dw={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 Oz(n){return Object.prototype.toString.call(n)==="[object Object]"}function Yg(n){if(Array.isArray(n))return n.map(Yg);if(Oz(n)){const e={};for(const t in n)e[t]=Yg(n[t]);return e}return n}function Ow(n){const e=xi({}),t=_n(Lw,{}),i=Se(()=>n.preset==null?{}:t!=null&&n.preset in t?structuredClone(dt(t)[n.preset]):n.preset in Dd?structuredClone(Dd[n.preset]):{}),s=Se(()=>({initial:n.initial,enter:n.enter,leave:n.leave,visible:n.visible,visibleOnce:n.visibleOnce,hovered:n.hovered,tapped:n.tapped,focused:n.focused}));function r(l,c){for(const u of["delay","duration"]){if(c[u]==null)continue;const f=Number.parseInt(c[u]);for(const d of["enter","visible","visibleOnce"]){const h=l[d];h!=null&&(h.transition??(h.transition={}),h.transition[u]=f)}}return l}const o=Se(()=>{const l=OT({},s.value,i.value,n.variants||{});return r({...l},n)});function a(l,c,u){var d;l.props??(l.props={}),(d=l.props).style??(d.style={}),l.props.style={...l.props.style,...u};const f=r(Yg(o.value),l.props);return l.props.onVnodeMounted=({el:h})=>{e[c]=Pw(h,f)},l.props.onVnodeUpdated=({el:h})=>{const p=Gh(e[c].state);for(const[_,g]of Object.entries(p))h.style[_]=g},l}return{motionConfig:o,setNodeInstance:a}}const Nz=dn({name:"Motion",props:{...Dw,is:{type:[String,Object],default:"div"}},setup(n){const e=N0(),{motionConfig:t,setNodeInstance:i}=Ow(n);return()=>{const s=Gh(t.value.initial||{}),r=ks(n.is,void 0,e);return i(r,0,s),r}}}),Uz=dn({name:"MotionGroup",props:{...Dw,is:{type:[String,Object],required:!1}},setup(n){const e=N0(),{motionConfig:t,setNodeInstance:i}=Ow(n);return()=>{var o;const s=Gh(t.value.initial||{}),r=((o=e.default)==null?void 0:o.call(e))||[];for(let a=0;a
'};t.configure=function(p){var _,g;for(_ in p)g=p[_],g!==void 0&&p.hasOwnProperty(_)&&(i[_]=g);return this},t.status=null,t.set=function(p){var _=t.isStarted();p=s(p,i.minimum,1),t.status=p===1?null:p;var g=t.render(!_),m=g.querySelector(i.barSelector),v=i.speed,b=i.easing;return g.offsetWidth,a(function(y){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(m,o(p,v,b)),p===1?(l(g,{transition:"none",opacity:1}),g.offsetWidth,setTimeout(function(){l(g,{transition:"all "+v+"ms linear",opacity:0}),setTimeout(function(){t.remove(),y()},v)},v)):setTimeout(y,v)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},i.trickleSpeed)};return i.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var _=t.status;return _?(typeof p!="number"&&(p=(1-_)*s(Math.random()*_,.1,.95)),_=s(_+p,0,.994),t.set(_)):t.start()},t.trickle=function(){return t.inc(Math.random()*i.trickleRate)},function(){var p=0,_=0;t.promise=function(g){return!g||g.state()==="resolved"?this:(_===0&&t.start(),p++,_++,g.always(function(){_--,_===0?(p=0,t.done()):t.set((p-_)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var _=document.createElement("div");_.id="nprogress",_.innerHTML=i.template;var g=_.querySelector(i.barSelector),m=p?"-100":r(t.status||0),v=document.querySelector(i.parent),b;return l(g,{transition:"all 0 linear",transform:"translate3d("+m+"%,0,0)"}),i.showSpinner||(b=_.querySelector(i.spinnerSelector),b&&h(b)),v!=document.body&&u(v,"nprogress-custom-parent"),v.appendChild(_),_},t.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(i.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&h(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,_="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return _+"Perspective"in p?"translate3d":_+"Transform"in p?"translate":"margin"};function s(p,_,g){return p<_?_:p>g?g:p}function r(p){return(-1+p)*100}function o(p,_,g){var m;return i.positionUsing==="translate3d"?m={transform:"translate3d("+r(p)+"%,0,0)"}:i.positionUsing==="translate"?m={transform:"translate("+r(p)+"%,0)"}:m={"margin-left":r(p)+"%"},m.transition="all "+_+"ms "+g,m}var a=function(){var p=[];function _(){var g=p.shift();g&&g(_)}return function(g){p.push(g),p.length==1&&_()}}(),l=function(){var p=["Webkit","O","Moz","ms"],_={};function g(y){return y.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(T,w){return w.toUpperCase()})}function m(y){var T=document.body.style;if(y in T)return y;for(var w=p.length,S=y.charAt(0).toUpperCase()+y.slice(1),P;w--;)if(P=p[w]+S,P in T)return P;return y}function v(y){return y=g(y),_[y]||(_[y]=m(y))}function b(y,T,w){T=v(T),y.style[T]=w}return function(y,T){var w=arguments,S,P;if(w.length==2)for(S in T)P=T[S],P!==void 0&&T.hasOwnProperty(S)&&b(y,S,P);else b(y,w[1],w[2])}}();function c(p,_){var g=typeof p=="string"?p:d(p);return g.indexOf(" "+_+" ")>=0}function u(p,_){var g=d(p),m=g+_;c(g,_)||(p.className=m.substring(1))}function f(p,_){var g=d(p),m;c(p,_)&&(m=g.replace(" "+_+" "," "),p.className=m.substring(1,m.length-1))}function d(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function h(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})}(Pf)),Pf.exports}var Vz=zz();const Nw=kz(Vz);/*! - * pinia v3.0.3 - * (c) 2025 Eduardo San Martin Morote - * @license MIT - */let Uw;const Wh=n=>Uw=n,Fw=Symbol();function jg(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var Gl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(Gl||(Gl={}));function Hz(){const n=S0(!0),e=n.run(()=>nt({}));let t=[],i=[];const s=R0({install(r){Wh(s),s._a=r,r.provide(Fw,s),r.config.globalProperties.$pinia=s,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const kw=()=>{};function Sx(n,e,t,i=kw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&qd()&&E0(s),s}function na(n,...e){n.slice().forEach(t=>{t(...e)})}const Gz=n=>n(),Ex=Symbol(),Em=Symbol();function Kg(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];jg(s)&&jg(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Ls(i)?n[t]=Kg(s,i):n[t]=i}return n}const Wz=Symbol();function Xz(n){return!jg(n)||!Object.prototype.hasOwnProperty.call(n,Wz)}const{assign:rr}=Object;function $z(n){return!!(Pt(n)&&n.effect)}function qz(n,e,t,i){const{state:s,actions:r,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=s?s():{});const u=vS(t.state.value[n]);return rr(u,r,Object.keys(o||{}).reduce((f,d)=>(f[d]=R0(Se(()=>{Wh(t);const h=t._s.get(n);return o[d].call(h,h)})),f),{}))}return l=Bw(n,c,e,t,i,!0),l}function Bw(n,e,t={},i,s,r){let o;const a=rr({actions:{}},t),l={deep:!0};let c,u,f=[],d=[],h;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),nt({});let _;function g(P){let M;c=u=!1,typeof P=="function"?(P(i.state.value[n]),M={type:Gl.patchFunction,storeId:n,events:h}):(Kg(i.state.value[n],P),M={type:Gl.patchObject,payload:P,storeId:n,events:h});const E=_=Symbol();Ar().then(()=>{_===E&&(c=!0)}),u=!0,na(f,M,i.state.value[n])}const m=r?function(){const{state:M}=t,E=M?M():{};this.$patch(D=>{rr(D,E)})}:kw;function v(){o.stop(),f=[],d=[],i._s.delete(n)}const b=(P,M="")=>{if(Ex in P)return P[Em]=M,P;const E=function(){Wh(i);const D=Array.from(arguments),B=[],z=[];function V(te){B.push(te)}function Q(te){z.push(te)}na(d,{args:D,name:E[Em],store:T,after:V,onError:Q});let j;try{j=P.apply(this&&this.$id===n?this:T,D)}catch(te){throw na(z,te),te}return j instanceof Promise?j.then(te=>(na(B,te),te)).catch(te=>(na(z,te),Promise.reject(te))):(na(B,j),j)};return E[Ex]=!0,E[Em]=M,E},y={_p:i,$id:n,$onAction:Sx.bind(null,d),$patch:g,$reset:m,$subscribe(P,M={}){const E=Sx(f,P,M.detached,()=>D()),D=o.run(()=>Ke(()=>i.state.value[n],B=>{(M.flush==="sync"?u:c)&&P({storeId:n,type:Gl.direct,events:h},B)},rr({},l,M)));return E},$dispose:v},T=xi(y);i._s.set(n,T);const S=(i._a&&i._a.runWithContext||Gz)(()=>i._e.run(()=>(o=S0()).run(()=>e({action:b}))));for(const P in S){const M=S[P];if(Pt(M)&&!$z(M)||Ls(M))r||(p&&Xz(M)&&(Pt(M)?M.value=p[P]:Kg(M,p[P])),i.state.value[n][P]=M);else if(typeof M=="function"){const E=b(M,P);S[P]=E,a.actions[P]=M}}return rr(T,S),rr(dt(T),S),Object.defineProperty(T,"$state",{get:()=>i.state.value[n],set:P=>{g(M=>{rr(M,P)})}}),i._p.forEach(P=>{rr(T,o.run(()=>P({store:T,app:i._a,pinia:i,options:a})))}),p&&r&&t.hydrate&&t.hydrate(T.$state,p),c=!0,u=!0,T}/*! #__NO_SIDE_EFFECTS__ */function Yz(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Lc();return o=o||(l?_n(Fw,null):null),o&&Wh(o),o=Uw,o._s.has(n)||(s?Bw(n,e,i,o):qz(n,i,o)),o._s.get(n)}return r.$id=n,r}function jz(n){const e=dt(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Se({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Ls(s))&&(t[i]=yS(n,i))}return t}const Kz=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>Xe(()=>import("./default-DlKZnvUP.js"),__vite__mapDeps([0,1,2])),"/src/layouts/settings.vue":()=>Xe(()=>import("./settings-B26B-JaW.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2,14])),"/src/layouts/stage.vue":()=>Xe(()=>import("./stage-Rs4XkZYw.js"),[])})).forEach(([s,r])=>{let o=s.replace("/src/layouts/","").replace(".vue","");e[o]=r});function i(s,r=!0){return s.map(o=>{var a,l,c,u,f,d;if(((a=o.children)==null?void 0:a.length)>0&&(o.children=i(o.children,!1)),r){if(!o.component&&((l=o.children)==null?void 0:l.find(p=>{var _;return(p.path===""||p.path==="/")&&((_=p.meta)==null?void 0:_.isLayout)})))return o;if(((c=o.meta)==null?void 0:c.layout)!==!1)return{path:o.path,component:e[((u=o.meta)==null?void 0:u.layout)||"default"],children:o.path==="/"?[o]:[{...o,path:""}],meta:{isLayout:!0}}}return(f=o.meta)!=null&&f.layout?{path:o.path,component:e[(d=o.meta)==null?void 0:d.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! - * vue-router v4.5.1 - * (c) 2025 Eduardo San Martin Morote - * @license MIT - */const sa=typeof document<"u";function zw(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function Zz(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&zw(n.default)}const St=Object.assign;function Tm(n,e){const t={};for(const i in e){const s=e[i];t[i]=Hi(s)?s.map(n):n(s)}return t}const Wl=()=>{},Hi=Array.isArray,Vw=/#/g,Jz=/&/g,Qz=/\//g,eV=/=/g,tV=/\?/g,Hw=/\+/g,nV=/%5B/g,iV=/%5D/g,Gw=/%5E/g,sV=/%60/g,Ww=/%7B/g,rV=/%7C/g,Xw=/%7D/g,oV=/%20/g;function j_(n){return encodeURI(""+n).replace(rV,"|").replace(nV,"[").replace(iV,"]")}function aV(n){return j_(n).replace(Ww,"{").replace(Xw,"}").replace(Gw,"^")}function Zg(n){return j_(n).replace(Hw,"%2B").replace(oV,"+").replace(Vw,"%23").replace(Jz,"%26").replace(sV,"`").replace(Ww,"{").replace(Xw,"}").replace(Gw,"^")}function lV(n){return Zg(n).replace(eV,"%3D")}function cV(n){return j_(n).replace(Vw,"%23").replace(tV,"%3F")}function uV(n){return n==null?"":cV(n).replace(Qz,"%2F")}function Ec(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const fV=/\/$/,dV=n=>n.replace(fV,"");function wm(n,e,t="/"){let i,s={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),s=n(r)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=gV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:Ec(o)}}function hV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function Tx(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function pV(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Da(e.matched[i],t.matched[s])&&$w(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Da(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function $w(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!mV(n[t],e[t]))return!1;return!0}function mV(n,e){return Hi(n)?wx(n,e):Hi(e)?wx(e,n):n===e}function wx(n,e){return Hi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function gV(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=t.length-1,o,a;for(o=0;o1&&r--;else break;return t.slice(0,r).join("/")+"/"+i.slice(o).join("/")}const ir={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Tc;(function(n){n.pop="pop",n.push="push"})(Tc||(Tc={}));var Xl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Xl||(Xl={}));function _V(n){if(!n)if(sa){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),dV(n)}const vV=/^[^#]+#/;function yV(n,e){return n.replace(vV,"#")+e}function bV(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const Xh=()=>({left:window.scrollX,top:window.scrollY});function xV(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=bV(s,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Ax(n,e){return(history.state?history.state.position-e:-1)+n}const Jg=new Map;function MV(n,e){Jg.set(n,e)}function SV(n){const e=Jg.get(n);return Jg.delete(n),e}let EV=()=>location.protocol+"//"+location.host;function qw(n,e){const{pathname:t,search:i,hash:s}=e,r=n.indexOf("#");if(r>-1){let a=s.includes(n.slice(r))?n.slice(r).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),Tx(l,"")}return Tx(t,n)+i+s}function TV(n,e,t,i){let s=[],r=[],o=null;const a=({state:d})=>{const h=qw(n,location),p=t.value,_=e.value;let g=0;if(d){if(t.value=h,e.value=d,o&&o===p){o=null;return}g=_?d.position-_.position:0}else i(h);s.forEach(m=>{m(t.value,p,{delta:g,type:Tc.pop,direction:g?g>0?Xl.forward:Xl.back:Xl.unknown})})};function l(){o=t.value}function c(d){s.push(d);const h=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return r.push(h),h}function u(){const{history:d}=window;d.state&&d.replaceState(St({},d.state,{scroll:Xh()}),"")}function f(){for(const d of r)d();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:f}}function Cx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?Xh():null}}function wV(n){const{history:e,location:t}=window,i={value:qw(n,t)},s={value:e.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const f=n.indexOf("#"),d=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:EV()+n+l;try{e[u?"replaceState":"pushState"](c,"",d),s.value=c}catch(h){console.error(h),t[u?"replace":"assign"](d)}}function o(l,c){const u=St({},e.state,Cx(s.value.back,l,s.value.forward,!0),c,{position:s.value.position});r(l,u,!0),i.value=l}function a(l,c){const u=St({},s.value,e.state,{forward:l,scroll:Xh()});r(u.current,u,!0);const f=St({},Cx(i.value,l,null),{position:u.position+1},c);r(l,f,!1),i.value=l}return{location:i,state:s,push:a,replace:o}}function AV(n){n=_V(n);const e=wV(n),t=TV(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=St({location:"",base:n,go:i,createHref:yV.bind(null,n)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function CV(n){return typeof n=="string"||n&&typeof n=="object"}function Yw(n){return typeof n=="string"||typeof n=="symbol"}const jw=Symbol("");var Rx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(Rx||(Rx={}));function Oa(n,e){return St(new Error,{type:n,[jw]:!0},e)}function bs(n,e){return n instanceof Error&&jw in n&&(e==null||!!(n.type&e))}const Px="[^/]+?",RV={sensitive:!1,strict:!1,start:!0,end:!0},PV=/[.+*?^${}()[\]/\\]/g;function IV(n,e){const t=St({},RV,e),i=[];let s=t.start?"^":"";const r=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function Kw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const DV={type:0,value:""},OV=/[a-zA-Z0-9_]/;function NV(n){if(!n)return[[]];if(n==="/")return[[DV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(h){throw new Error(`ERR (${t})/"${c}": ${h}`)}let t=0,i=t;const s=[];let r;function o(){r&&s.push(r),r=[]}let a=0,l,c="",u="";function f(){c&&(t===0?r.push({type:0,value:c}):t===1||t===2||t===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function d(){c+=l}for(;a{o(b)}:Wl}function o(f){if(Yw(f)){const d=i.get(f);d&&(i.delete(f),t.splice(t.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=t.indexOf(f);d>-1&&(t.splice(d,1),f.record.name&&i.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return t}function l(f){const d=zV(f,t);t.splice(d,0,f),f.record.name&&!Ox(f)&&i.set(f.record.name,f)}function c(f,d){let h,p={},_,g;if("name"in f&&f.name){if(h=i.get(f.name),!h)throw Oa(1,{location:f});g=h.record.name,p=St(Lx(d.params,h.keys.filter(b=>!b.optional).concat(h.parent?h.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Lx(f.params,h.keys.map(b=>b.name))),_=h.stringify(p)}else if(f.path!=null)_=f.path,h=t.find(b=>b.re.test(_)),h&&(p=h.parse(_),g=h.record.name);else{if(h=d.name?i.get(d.name):t.find(b=>b.re.test(d.path)),!h)throw Oa(1,{location:f,currentLocation:d});g=h.record.name,p=St({},d.params,f.params),_=h.stringify(p)}const m=[];let v=h;for(;v;)m.unshift(v.record),v=v.parent;return{name:g,path:_,params:p,matched:m,meta:BV(m)}}n.forEach(f=>r(f));function u(){t.length=0,i.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Lx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Dx(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:kV(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function kV(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function Ox(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function BV(n){return n.reduce((e,t)=>St(e,t.meta),{})}function Nx(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function zV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;Kw(n,e[r])<0?i=r:t=r+1}const s=VV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function VV(n){let e=n;for(;e=e.parent;)if(Zw(e)&&Kw(n,e)===0)return e}function Zw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function HV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Zg(r)):[i&&Zg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function GV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Hi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const WV=Symbol(""),Fx=Symbol(""),$h=Symbol(""),K_=Symbol(""),Qg=Symbol("");function hl(){let n=[];function e(i){return n.push(i),()=>{const s=n.indexOf(i);s>-1&&n.splice(s,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function fr(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=d=>{d===!1?l(Oa(4,{from:t,to:e})):d instanceof Error?l(d):CV(d)?l(Oa(2,{from:e,to:d})):(o&&i.enterCallbacks[s]===o&&typeof d=="function"&&o.push(d),a())},u=r(()=>n.call(i&&i.instances[s],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(d=>l(d))})}function Am(n,e,t,i,s=r=>r()){const r=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(zw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(fr(u,t,i,o,a,s))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=Zz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const h=(f.__vccOpts||f)[e];return h&&fr(h,t,i,o,a,s)()}))}}return r}function kx(n){const e=_n($h),t=_n(K_),i=Se(()=>{const l=Ft(n.to);return e.resolve(l)}),s=Se(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const d=f.findIndex(Da.bind(null,u));if(d>-1)return d;const h=Bx(l[c-2]);return c>1&&Bx(u)===h&&f[f.length-1].path!==h?f.findIndex(Da.bind(null,l[c-2])):d}),r=Se(()=>s.value>-1&&jV(t.params,i.value.params)),o=Se(()=>s.value>-1&&s.value===t.matched.length-1&&$w(t.params,i.value.params));function a(l={}){if(YV(l)){const c=e[Ft(n.replace)?"replace":"push"](Ft(n.to)).catch(Wl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Se(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function XV(n){return n.length===1?n[0]:n}const $V=dn({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:kx,setup(n,{slots:e}){const t=xi(kx(n)),{options:i}=_n($h),s=Se(()=>({[zx(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[zx(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&XV(e.default(t));return n.custom?r:ks("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),qV=$V;function YV(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function jV(n,e){for(const t in e){const i=e[t],s=n[t];if(typeof i=="string"){if(i!==s)return!1}else if(!Hi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Bx(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const zx=(n,e,t)=>n??e??t,KV=dn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=_n(Qg),s=Se(()=>n.route||i.value),r=_n(Fx,0),o=Se(()=>{let c=Ft(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Se(()=>s.value.matched[o.value]);gr(Fx,Se(()=>o.value+1)),gr(WV,a),gr(Qg,s);const l=nt();return Ke(()=>[l.value,a.value,n.name],([c,u,f],[d,h,p])=>{u&&(u.instances[f]=c,h&&h!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Da(u,h)||!d)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,d=f&&f.components[u];if(!d)return Vx(t.default,{Component:d,route:c});const h=f.props[u],p=h?h===!0?c.params:typeof h=="function"?h(c):h:null,g=ks(d,St({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Vx(t.default,{Component:g,route:c})||g}}});function Vx(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const Jw=KV;function ZV(n){const e=FV(n.routes,n),t=n.parseQuery||HV,i=n.stringifyQuery||Ux,s=n.history,r=hl(),o=hl(),a=hl(),l=Oe(ir);let c=ir;sa&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Tm.bind(null,$=>""+$),f=Tm.bind(null,uV),d=Tm.bind(null,Ec);function h($,ae){let le,ue;return Yw($)?(le=e.getRecordMatcher($),ue=ae):ue=$,e.addRoute(ue,le)}function p($){const ae=e.getRecordMatcher($);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map($=>$.record)}function g($){return!!e.getRecordMatcher($)}function m($,ae){if(ae=St({},ae||l.value),typeof $=="string"){const A=wm(t,$,ae.path),W=e.resolve({path:A.path},ae),G=s.createHref(A.fullPath);return St(A,W,{params:d(W.params),hash:Ec(A.hash),redirectedFrom:void 0,href:G})}let le;if($.path!=null)le=St({},$,{path:wm(t,$.path,ae.path).path});else{const A=St({},$.params);for(const W in A)A[W]==null&&delete A[W];le=St({},$,{params:f(A)}),ae.params=f(ae.params)}const ue=e.resolve(le,ae),qe=$.hash||"";ue.params=u(d(ue.params));const N=hV(i,St({},$,{hash:aV(qe),path:ue.path})),U=s.createHref(N);return St({fullPath:N,hash:qe,query:i===Ux?GV($.query):$.query||{}},ue,{redirectedFrom:void 0,href:U})}function v($){return typeof $=="string"?wm(t,$,l.value.path):St({},$)}function b($,ae){if(c!==$)return Oa(8,{from:ae,to:$})}function y($){return S($)}function T($){return y(St(v($),{replace:!0}))}function w($){const ae=$.matched[$.matched.length-1];if(ae&&ae.redirect){const{redirect:le}=ae;let ue=typeof le=="function"?le($):le;return typeof ue=="string"&&(ue=ue.includes("?")||ue.includes("#")?ue=v(ue):{path:ue},ue.params={}),St({query:$.query,hash:$.hash,params:ue.path!=null?{}:$.params},ue)}}function S($,ae){const le=c=m($),ue=l.value,qe=$.state,N=$.force,U=$.replace===!0,A=w(le);if(A)return S(St(v(A),{state:typeof A=="object"?St({},qe,A.state):qe,force:N,replace:U}),ae||le);const W=le;W.redirectedFrom=ae;let G;return!N&&pV(i,ue,le)&&(G=Oa(16,{to:W,from:ue}),re(ue,ue,!0,!1)),(G?Promise.resolve(G):E(W,ue)).catch(X=>bs(X)?bs(X,2)?X:Me(X):Z(X,W,ue)).then(X=>{if(X){if(bs(X,2))return S(St({replace:U},v(X.to),{state:typeof X.to=="object"?St({},qe,X.to.state):qe,force:N}),ae||W)}else X=B(W,ue,!0,U,qe);return D(W,ue,X),X})}function P($,ae){const le=b($,ae);return le?Promise.reject(le):Promise.resolve()}function M($){const ae=oe.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext($):$()}function E($,ae){let le;const[ue,qe,N]=JV($,ae);le=Am(ue.reverse(),"beforeRouteLeave",$,ae);for(const A of ue)A.leaveGuards.forEach(W=>{le.push(fr(W,$,ae))});const U=P.bind(null,$,ae);return le.push(U),Ee(le).then(()=>{le=[];for(const A of r.list())le.push(fr(A,$,ae));return le.push(U),Ee(le)}).then(()=>{le=Am(qe,"beforeRouteUpdate",$,ae);for(const A of qe)A.updateGuards.forEach(W=>{le.push(fr(W,$,ae))});return le.push(U),Ee(le)}).then(()=>{le=[];for(const A of N)if(A.beforeEnter)if(Hi(A.beforeEnter))for(const W of A.beforeEnter)le.push(fr(W,$,ae));else le.push(fr(A.beforeEnter,$,ae));return le.push(U),Ee(le)}).then(()=>($.matched.forEach(A=>A.enterCallbacks={}),le=Am(N,"beforeRouteEnter",$,ae,M),le.push(U),Ee(le))).then(()=>{le=[];for(const A of o.list())le.push(fr(A,$,ae));return le.push(U),Ee(le)}).catch(A=>bs(A,8)?A:Promise.reject(A))}function D($,ae,le){a.list().forEach(ue=>M(()=>ue($,ae,le)))}function B($,ae,le,ue,qe){const N=b($,ae);if(N)return N;const U=ae===ir,A=sa?history.state:{};le&&(ue||U?s.replace($.fullPath,St({scroll:U&&A&&A.scroll},qe)):s.push($.fullPath,qe)),l.value=$,re($,ae,le,U),Me()}let z;function V(){z||(z=s.listen(($,ae,le)=>{if(!ge.listening)return;const ue=m($),qe=w(ue);if(qe){S(St(qe,{replace:!0,force:!0}),ue).catch(Wl);return}c=ue;const N=l.value;sa&&MV(Ax(N.fullPath,le.delta),Xh()),E(ue,N).catch(U=>bs(U,12)?U:bs(U,2)?(S(St(v(U.to),{force:!0}),ue).then(A=>{bs(A,20)&&!le.delta&&le.type===Tc.pop&&s.go(-1,!1)}).catch(Wl),Promise.reject()):(le.delta&&s.go(-le.delta,!1),Z(U,ue,N))).then(U=>{U=U||B(ue,N,!1),U&&(le.delta&&!bs(U,8)?s.go(-le.delta,!1):le.type===Tc.pop&&bs(U,20)&&s.go(-1,!1)),D(ue,N,U)}).catch(Wl)}))}let Q=hl(),j=hl(),te;function Z($,ae,le){Me($);const ue=j.list();return ue.length?ue.forEach(qe=>qe($,ae,le)):console.error($),Promise.reject($)}function pe(){return te&&l.value!==ir?Promise.resolve():new Promise(($,ae)=>{Q.add([$,ae])})}function Me($){return te||(te=!$,V(),Q.list().forEach(([ae,le])=>$?le($):ae()),Q.reset()),$}function re($,ae,le,ue){const{scrollBehavior:qe}=n;if(!sa||!qe)return Promise.resolve();const N=!le&&SV(Ax($.fullPath,0))||(ue||!le)&&history.state&&history.state.scroll||null;return Ar().then(()=>qe($,ae,N)).then(U=>U&&xV(U)).catch(U=>Z(U,$,ae))}const xe=$=>s.go($);let We;const oe=new Set,ge={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:y,replace:T,go:xe,back:()=>xe(-1),forward:()=>xe(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:j.add,isReady:pe,install($){const ae=this;$.component("RouterLink",qV),$.component("RouterView",Jw),$.config.globalProperties.$router=ae,Object.defineProperty($.config.globalProperties,"$route",{enumerable:!0,get:()=>Ft(l)}),sa&&!We&&l.value===ir&&(We=!0,y(s.location).catch(qe=>{}));const le={};for(const qe in ir)Object.defineProperty(le,qe,{get:()=>l.value[qe],enumerable:!0});$.provide($h,ae),$.provide(K_,pS(le)),$.provide(Qg,l);const ue=$.unmount;oe.add($),$.unmount=function(){oe.delete($),oe.size<1&&(c=ir,z&&z(),z=null,l.value=ir,We=!1,te=!1),ue()}}};function Ee($){return $.reduce((ae,le)=>ae.then(()=>M(le)),Promise.resolve())}return ge}function JV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oDa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Da(c,l))||s.push(l))}return[t,i,s]}function QV(){return _n($h)}function $G(n){return _n(K_)}const e6=[{path:"/",name:"/",component:()=>Xe(()=>import("./index-c2ht1_hO.js"),__vite__mapDeps([15,4,5,6,7,8,9,10,16,17,18,12,11,13,19,20,21,22,23,24,25,26,27,1,2,28,29,30,14])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>Xe(()=>import("./_...all_-CvLU7PxS.js"),[])},{path:"/audio",name:"/audio",component:()=>Xe(()=>import("./audio-C9GHcVn0.js"),[])},{path:"/devtools",children:[{path:"background-remove",name:"/devtools/background-remove",component:()=>Xe(()=>import("./background-remove-BaZ8ULC5.js"),__vite__mapDeps([31,4,5,32,13]))},{path:"chat",name:"/devtools/chat",component:()=>Xe(()=>import("./chat-w4dxGa81.js"),__vite__mapDeps([33,21,12]))},{path:"image",name:"/devtools/image",component:()=>Xe(()=>import("./image-orS7rPI7.js"),__vite__mapDeps([34,35]))},{path:"polaroid",name:"/devtools/polaroid",component:()=>Xe(()=>import("./polaroid-DoRrbv0D.js"),__vite__mapDeps([36,4,5,6,7,25,8,9,10,26,14]))},{path:"vibrant",name:"/devtools/vibrant",component:()=>Xe(()=>import("./vibrant-Dx4HQHCr.js"),__vite__mapDeps([37,4,5,32,38]))}]},{path:"/queue",name:"/queue",component:()=>Xe(()=>import("./queue-Cq0yk53b.js"),__vite__mapDeps([39,19]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>Xe(()=>import("./index-Dfzu84H1.js"),__vite__mapDeps([40,4,5,6,7,8,9,10,41,42,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>Xe(()=>import("./index-BiKOctgh.js"),__vite__mapDeps([43,8,9,10,22,23,11,12,13,18,4,5,32,44,45,46,14,6,7,47,48,49,50,51,52,53,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardCreate",name:"/settings/airi-card/components/CardCreate",component:()=>Xe(()=>import("./CardCreate-BjhXcczV.js"),__vite__mapDeps([54,44]))},{path:"CardCreationDialog",name:"/settings/airi-card/components/CardCreationDialog",component:()=>Xe(()=>import("./CardCreationDialog-BD9l8__M.js"),__vite__mapDeps([45,46,4,5,14,6,7,8,9,10,22,23,11,12,13,18,47,48,49,50]))},{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>Xe(()=>import("./CardDetailDialog-DmXwuvrn.js"),__vite__mapDeps([55,51,46,4,5,14,6,7,8,9,10,22,23,11,12,13,18,49,52]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>Xe(()=>import("./CardListItem-MKbZr0FQ.js"),__vite__mapDeps([56,53,4,5,6,7,8,9,10,14]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>Xe(()=>import("./DeleteCardDialog-Z5bX7ffQ.js"),__vite__mapDeps([57,52,46,4,5,14,49]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>Xe(()=>import("./index-DTPoQwAL.js"),__vite__mapDeps([58,4,5,6,7,8,9,10,41,29,14])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"color-scheme",name:"/settings/appearance/color-scheme",component:()=>Xe(()=>import("./color-scheme-CSVp68xe.js"),__vite__mapDeps([59,4,5,6,7,8,9,10,60,27,24,49,29,61,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"developer",name:"/settings/appearance/developer",component:()=>Xe(()=>import("./developer-Cz9wfxb0.js"),__vite__mapDeps([62,8,9,10,63,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"general",name:"/settings/appearance/general",component:()=>Xe(()=>import("./general-Bv6Tg-7n.js"),__vite__mapDeps([64,8,9,10,63,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>Xe(()=>import("./index-CXcjO-xi.js"),__vite__mapDeps([65,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>Xe(()=>import("./index-WGruJeDd.js"),__vite__mapDeps([66,4,5,6,7,25,8,9,10,38,42,60,27,24,49,67,29,68,14])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>Xe(()=>import("./index-Cq3a4k9t.js"),__vite__mapDeps([69,4,5,6,7,8,9,10,70,42,67,29,14])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>Xe(()=>import("./consciousness-CXvMPML1.js"),__vite__mapDeps([71,4,5,6,7,8,9,10,23,11,12,13,72,24,48,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>Xe(()=>import("./memory-long-term-2LsRds_J.js"),__vite__mapDeps([73,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>Xe(()=>import("./memory-short-term-DP6AuBns.js"),__vite__mapDeps([74,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>Xe(()=>import("./speech-CDwZYdOU.js"),__vite__mapDeps([75,76,4,5,6,7,47,48,77,28,8,9,10,11,12,13,18,72,24,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>Xe(()=>import("./index-ik2DcYm-.js"),__vite__mapDeps([78,4,5,6,7,8,9,10,11,12,13,70,42,67,29,14])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"alibaba-cloud-model-studio",name:"/settings/providers/alibaba-cloud-model-studio",component:()=>Xe(()=>import("./alibaba-cloud-model-studio-sMAGnqmb.js"),__vite__mapDeps([79,76,4,5,6,7,8,9,10,11,12,13,18,80,81,27,24,82,47,48,83,84,85,14,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>Xe(()=>import("./anthropic-Cs21upu-.js"),__vite__mapDeps([86,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>Xe(()=>import("./cloudflare-workers-ai-DaNcyxus.js"),__vite__mapDeps([88,4,5,6,7,8,9,10,11,12,13,47,48,82,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>Xe(()=>import("./deepseek-BnTqc4-0.js"),__vite__mapDeps([89,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>Xe(()=>import("./elevenlabs-L8B8Z16V.js"),__vite__mapDeps([90,76,4,5,6,7,8,9,10,11,12,13,18,80,81,27,24,82,47,48,83,84,85,14,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>Xe(()=>import("./featherless-ai-CDy5zWmD.js"),__vite__mapDeps([91,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>Xe(()=>import("./fireworks-ai-C_DF5qcs.js"),__vite__mapDeps([92,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"google-generative-ai",name:"/settings/providers/google-generative-ai",component:()=>Xe(()=>import("./google-generative-ai-CH9TwHBd.js"),__vite__mapDeps([93,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>Xe(()=>import("./microsoft-speech-CVJCqFk5.js"),__vite__mapDeps([94,47,48,76,4,5,6,7,8,9,10,11,12,13,18,80,81,27,24,82,83,84,85,14,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>Xe(()=>import("./mistral-ai-CliQVdqf.js"),__vite__mapDeps([95,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>Xe(()=>import("./moonshot-ai-CfBUn2N1.js"),__vite__mapDeps([96,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>Xe(()=>import("./novita-ai-QK3ydSh2.js"),__vite__mapDeps([97,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"ollama",name:"/settings/providers/ollama",component:()=>Xe(()=>import("./ollama-3pZYfERA.js"),__vite__mapDeps([98,48,4,5,6,7,8,9,10,11,12,13,81,27,24,83,47,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openai",name:"/settings/providers/openai",component:()=>Xe(()=>import("./openai-CplbulQn.js"),__vite__mapDeps([99,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openai-audio-speech",name:"/settings/providers/openai-audio-speech",component:()=>Xe(()=>import("./openai-audio-speech-naD8VxqX.js"),__vite__mapDeps([100,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openai-audio-transcription",name:"/settings/providers/openai-audio-transcription",component:()=>Xe(()=>import("./openai-audio-transcription-Chj7B5G_.js"),__vite__mapDeps([101,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>Xe(()=>import("./openrouter-ai-C6wwTszU.js"),__vite__mapDeps([102,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"player2-api",name:"/settings/providers/player2-api",component:()=>Xe(()=>import("./player2-api-de5Xsdxw.js"),__vite__mapDeps([103,4,5,6,7,8,9,10,11,12,13,83,47,48,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>Xe(()=>import("./together-ai-Cyv9-plj.js"),__vite__mapDeps([104,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"volcengine",name:"/settings/providers/volcengine",component:()=>Xe(()=>import("./volcengine-Do3adewX.js"),__vite__mapDeps([105,47,48,76,4,5,6,7,8,9,10,11,12,13,18,80,81,27,24,82,83,84,85,14,29])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"xai",name:"/settings/providers/xai",component:()=>Xe(()=>import("./xai-BPN2lmAh.js"),__vite__mapDeps([106,4,5,6,7,8,9,10,11,12,13,81,27,24,82,47,48,83,84,85,87,29,14])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"scene",children:[{path:"",name:"/settings/scene/",component:()=>Xe(()=>import("./index-1wQNw9gK.js"),__vite__mapDeps([107,42,67,8,9,10,29])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>Xe(()=>import("./filter-message-CHaQD-n_.js"),__vite__mapDeps([108,4,5,77,28]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>Xe(()=>import("./delays-C9dF-WFD.js"),__vite__mapDeps([109,8,20,9,19,4,5,77,28]))},{path:"emotions",name:"/test/queues/emotions",component:()=>Xe(()=>import("./emotions-CgTIAVzL.js"),__vite__mapDeps([110,19,20,9,4,5,77,28]))},{path:"messages",name:"/test/queues/messages",component:()=>Xe(()=>import("./messages-CaQqrW28.js"),__vite__mapDeps([111,19,20,9,4,5,77,28]))}]}]}],Qw=(n,e)=>{if(typeof n=="number"){if(e===3)return{mode:"rgb",r:(n>>8&15|n>>4&240)/255,g:(n>>4&15|n&240)/255,b:(n&15|n<<4&240)/255};if(e===4)return{mode:"rgb",r:(n>>12&15|n>>8&240)/255,g:(n>>8&15|n>>4&240)/255,b:(n>>4&15|n&240)/255,alpha:(n&15|n<<4&240)/255};if(e===6)return{mode:"rgb",r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255};if(e===8)return{mode:"rgb",r:(n>>24&255)/255,g:(n>>16&255)/255,b:(n>>8&255)/255,alpha:(n&255)/255}}},t6={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},n6=n=>Qw(t6[n.toLowerCase()],6),i6=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,s6=n=>{let e;return(e=n.match(i6))?Qw(parseInt(e[1],16),e[1].length):void 0},_r="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",$l=`${_r}%`,Z_=`(?:${_r}%|${_r})`,r6=`(?:${_r}(deg|grad|rad|turn)|${_r})`,Na="\\s*,\\s*",o6=new RegExp(`^rgba?\\(\\s*${_r}${Na}${_r}${Na}${_r}\\s*(?:,\\s*${Z_}\\s*)?\\)$`),a6=new RegExp(`^rgba?\\(\\s*${$l}${Na}${$l}${Na}${$l}\\s*(?:,\\s*${Z_}\\s*)?\\)$`),l6=n=>{let e={mode:"rgb"},t;if(t=n.match(o6))t[1]!==void 0&&(e.r=t[1]/255),t[2]!==void 0&&(e.g=t[2]/255),t[3]!==void 0&&(e.b=t[3]/255);else if(t=n.match(a6))t[1]!==void 0&&(e.r=t[1]/100),t[2]!==void 0&&(e.g=t[2]/100),t[3]!==void 0&&(e.b=t[3]/100);else return;return t[4]!==void 0?e.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(e.alpha=Math.max(0,Math.min(1,+t[5]))),e},c6=(n,e)=>n===void 0?void 0:typeof n!="object"?y6(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,eA=(n="rgb")=>e=>(e=c6(e,n))!==void 0?e.mode===n?e:Qi[e.mode][n]?Qi[e.mode][n](e):n==="rgb"?Qi[e.mode].rgb(e):Qi.rgb[n](Qi[e.mode].rgb(e)):void 0,Qi={},tA={},Od=[],nA={},u6=n=>n,Tt=n=>(Qi[n.mode]={...Qi[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Qi[e]||(Qi[e]={}),Qi[e][n.mode]=n.fromMode[e]}),n.ranges||(n.ranges={}),n.difference||(n.difference={}),n.channels.forEach(e=>{if(n.ranges[e]===void 0&&(n.ranges[e]=[0,1]),!n.interpolate[e])throw new Error(`Missing interpolator for: ${e}`);typeof n.interpolate[e]=="function"&&(n.interpolate[e]={use:n.interpolate[e]}),n.interpolate[e].fixup||(n.interpolate[e].fixup=u6)}),tA[n.mode]=n,(n.parse||[]).forEach(e=>{d6(e,n.mode)}),eA(n.mode)),f6=n=>tA[n],d6=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");nA[n]=e}else typeof n=="function"&&Od.indexOf(n)<0&&Od.push(n)},e0=/[^\x00-\x7F]|[a-zA-Z_]/,h6=/[^\x00-\x7F]|[-\w]/,ye={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let Ze=0;function ff(n){let e=n[Ze],t=n[Ze+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[Ze+2]):e==="."?/\d/.test(t):/\d/.test(e)}function t0(n){if(Ze>=n.length)return!1;let e=n[Ze];if(e0.test(e))return!0;if(e==="-"){if(n.length-Ze<2)return!1;let t=n[Ze+1];return!!(t==="-"||e0.test(t))}return!1}const p6={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function pl(n){let e="";if((n[Ze]==="-"||n[Ze]==="+")&&(e+=n[Ze++]),e+=df(n),n[Ze]==="."&&/\d/.test(n[Ze+1])&&(e+=n[Ze++]+df(n)),(n[Ze]==="e"||n[Ze]==="E")&&((n[Ze+1]==="-"||n[Ze+1]==="+")&&/\d/.test(n[Ze+2])?e+=n[Ze++]+n[Ze++]+df(n):/\d/.test(n[Ze+1])&&(e+=n[Ze++]+df(n))),t0(n)){let t=Nd(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:ye.Hue,value:e*p6[t]}:void 0}return n[Ze]==="%"?(Ze++,{type:ye.Percentage,value:+e}):{type:ye.Number,value:+e}}function df(n){let e="";for(;/\d/.test(n[Ze]);)e+=n[Ze++];return e}function Nd(n){let e="";for(;Ze4)){if(t.length===4){if(t[3].type!==ye.Alpha)return;t[3]=t[3].value}return t.length===3&&t.push({type:ye.None,value:void 0}),t.every(s=>s.type!==ye.Alpha)?t:void 0}}function v6(n,e){n._i=0;let t=n[n._i++];if(!t||t.type!==ye.Function)return;let i=iA(n,e);if(i)return i.unshift(t.value),i}const y6=n=>{if(typeof n!="string")return;const e=g6(n),t=e?v6(e,!0):void 0;let i,s=0,r=Od.length;for(;sn==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,M6=(n,e,t)=>n+t*(e-n),S6=n=>{let e=[];for(let t=0;te=>{let t=S6(e);return i=>{let s=i*t.length,r=i>=1?t.length-1:Math.max(Math.floor(s),0),o=t[r];return o===void 0?void 0:n(o[0],o[1],s-r)}},Ce=E6(M6),an=n=>{let e=!1,t=n.map(i=>i!==void 0?(e=!0,i):1);return e?t:n},qa={mode:"rgb",channels:["r","g","b","alpha"],parse:[b6,s6,l6,n6,x6,"srgb"],serialize:"srgb",interpolate:{r:Ce,g:Ce,b:Ce,alpha:{use:Ce,fixup:an}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},Cm=(n=0)=>Math.pow(Math.abs(n),563/256)*Math.sign(n),Hx=n=>{let e=Cm(n.r),t=Cm(n.g),i=Cm(n.b),s={mode:"xyz65",x:.5766690429101305*e+.1855582379065463*t+.1882286462349947*i,y:.297344975250536*e+.6273635662554661*t+.0752914584939979*i,z:.0270313613864123*e+.0706888525358272*t+.9913375368376386*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},Rm=n=>Math.pow(Math.abs(n),256/563)*Math.sign(n),Gx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"a98",r:Rm(n*2.0415879038107465-e*.5650069742788597-.3447313507783297*t),g:Rm(n*-.9692436362808798+e*1.8759675015077206+.0415550574071756*t),b:Rm(n*.0134442806320312-e*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(s.alpha=i),s},Pm=(n=0)=>{const e=Math.abs(n);return e<=.04045?n/12.92:(Math.sign(n)||1)*Math.pow((e+.055)/1.055,2.4)},Ya=({r:n,g:e,b:t,alpha:i})=>{let s={mode:"lrgb",r:Pm(n),g:Pm(e),b:Pm(t)};return i!==void 0&&(s.alpha=i),s},Do=n=>{let{r:e,g:t,b:i,alpha:s}=Ya(n),r={mode:"xyz65",x:.4123907992659593*e+.357584339383878*t+.1804807884018343*i,y:.2126390058715102*e+.715168678767756*t+.0721923153607337*i,z:.0193308187155918*e+.119194779794626*t+.9505321522496607*i};return s!==void 0&&(r.alpha=s),r},Im=(n=0)=>{const e=Math.abs(n);return e>.0031308?(Math.sign(n)||1)*(1.055*Math.pow(e,1/2.4)-.055):n*12.92},ja=({r:n,g:e,b:t,alpha:i},s="rgb")=>{let r={mode:s,r:Im(n),g:Im(e),b:Im(t)};return i!==void 0&&(r.alpha=i),r},Oo=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=ja({r:n*3.2409699419045226-e*1.537383177570094-.4986107602930034*t,g:n*-.9692436362808796+e*1.8759675015077204+.0415550574071756*t,b:n*.0556300796969936-e*.2039769588889765+1.0569715142428784*t});return i!==void 0&&(s.alpha=i),s},T6={...qa,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:n=>Gx(Do(n)),xyz65:Gx},toMode:{rgb:n=>Oo(Hx(n)),xyz65:Hx}},xn=n=>(n=n%360)<0?n+360:n,w6=(n,e)=>n.map((t,i,s)=>{if(t===void 0)return t;let r=xn(t);return i===0||n[i-1]===void 0?r:e(r-xn(s[i-1]))}).reduce((t,i)=>!t.length||i===void 0||t[t.length-1]===void 0?(t.push(i),t):(t.push(i+t[t.length-1]),t),[]),qs=n=>w6(n,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),cn=[-.14861,1.78277,-.29227,-.90649,1.97294,0],A6=Math.PI/180,C6=180/Math.PI;let Wx=cn[3]*cn[4],Xx=cn[1]*cn[4],$x=cn[1]*cn[2]-cn[0]*cn[3];const R6=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=($x*t+n*Wx-e*Xx)/($x+Wx-Xx),r=t-s,o=(cn[4]*(e-s)-cn[2]*r)/cn[3],a={mode:"cubehelix",l:s,s:s===0||s===1?void 0:Math.sqrt(r*r+o*o)/(cn[4]*s*(1-s))};return a.s&&(a.h=Math.atan2(o,r)*C6-120),i!==void 0&&(a.alpha=i),a},P6=({h:n,s:e,l:t,alpha:i})=>{let s={mode:"rgb"};n=(n===void 0?0:n+120)*A6,t===void 0&&(t=0);let r=e===void 0?0:e*t*(1-t),o=Math.cos(n),a=Math.sin(n);return s.r=t+r*(cn[0]*o+cn[1]*a),s.g=t+r*(cn[2]*o+cn[3]*a),s.b=t+r*(cn[4]*o+cn[5]*a),i!==void 0&&(s.alpha=i),s},qh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.s||!e.s)return 0;let t=xn(n.h),i=xn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.s*e.s)*s},I6=(n,e)=>{if(n.h===void 0||e.h===void 0)return 0;let t=xn(n.h),i=xn(e.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},Yh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.c||!e.c)return 0;let t=xn(n.h),i=xn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.c*e.c)*s},Ys=n=>{let e=n.reduce((i,s)=>{if(s!==void 0){let r=s*Math.PI/180;i.sin+=Math.sin(r),i.cos+=Math.cos(r)}return i},{sin:0,cos:0}),t=Math.atan2(e.sin,e.cos)*180/Math.PI;return t<0?360+t:t},L6={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:R6},toMode:{rgb:P6},interpolate:{h:{use:Ce,fixup:qs},s:Ce,l:Ce,alpha:{use:Ce,fixup:an}},difference:{h:qh},average:{h:Ys}},Tr=({l:n,a:e,b:t,alpha:i},s="lch")=>{e===void 0&&(e=0),t===void 0&&(t=0);let r=Math.sqrt(e*e+t*t),o={mode:s,l:n,c:r};return r&&(o.h=xn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(o.alpha=i),o},wr=({l:n,c:e,h:t,alpha:i},s="lab")=>{t===void 0&&(t=0);let r={mode:s,l:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},sA=Math.pow(29,3)/Math.pow(3,3),rA=Math.pow(6,3)/Math.pow(29,3),en={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},ya={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Lm=n=>Math.pow(n,3)>rA?Math.pow(n,3):(116*n-16)/sA;const oA=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz65",x:Lm(r)*ya.X,y:Lm(s)*ya.Y,z:Lm(o)*ya.Z};return i!==void 0&&(a.alpha=i),a},jh=n=>Oo(oA(n)),Dm=n=>n>rA?Math.cbrt(n):(sA*n+16)/116,aA=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Dm(n/ya.X),r=Dm(e/ya.Y),o=Dm(t/ya.Z),a={mode:"lab65",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},Kh=n=>{let e=aA(Do(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Ud=1,lA=1,wc=26/180*Math.PI,Fd=Math.cos(wc),kd=Math.sin(wc),cA=100/Math.log(139/100),n0=({l:n,c:e,h:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"lab65",l:(Math.exp(n*Ud/cA)-1)/.0039},r=(Math.exp(.0435*e*lA*Ud)-1)/.075,o=r*Math.cos(t/180*Math.PI-wc),a=r*Math.sin(t/180*Math.PI-wc);return s.a=o*Fd-a/.83*kd,s.b=o*kd+a/.83*Fd,i!==void 0&&(s.alpha=i),s},i0=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=e*Fd+t*kd,r=.83*(t*Fd-e*kd),o=Math.sqrt(s*s+r*r),a={mode:"dlch",l:cA/Ud*Math.log(1+.0039*n),c:Math.log(1+.075*o)/(.0435*lA*Ud)};return a.c&&(a.h=xn((Math.atan2(r,s)+wc)/Math.PI*180)),i!==void 0&&(a.alpha=i),a},qx=n=>n0(Tr(n,"dlch")),Yx=n=>wr(i0(n),"dlab"),D6={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:qx,rgb:n=>jh(qx(n))},fromMode:{lab65:Yx,rgb:n=>Yx(Kh(n))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:Ce,a:Ce,b:Ce,alpha:{use:Ce,fixup:an}}},O6={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:n0,dlab:n=>wr(n,"dlab"),rgb:n=>jh(n0(n))},fromMode:{lab65:i0,dlab:n=>Tr(n,"dlch"),rgb:n=>i0(Kh(n))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:Ce,c:Ce,h:{use:Ce,fixup:qs},alpha:{use:Ce,fixup:an}},difference:{h:Yh},average:{h:Ys}};function N6({h:n,s:e,i:t,alpha:i}){n=xn(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1-e)};break;case 1:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1+e*(3/(2-s)-1)),b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t*(1+e*(3/(2-s)-1)),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;case 3:r={r:t*(1-e),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1+e*(3/(2-s)-1))};break;case 4:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3/(2-s)-1))};break;case 5:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function U6({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsi",s:n+e+t===0?0:1-3*r/(n+e+t),i:(n+e+t)/3};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e{switch(e){case"deg":return+n;case"rad":return n/Math.PI*180;case"grad":return n/10*9;case"turn":return n*360}},V6=new RegExp(`^hsla?\\(\\s*${r6}${Na}${$l}${Na}${$l}\\s*(?:,\\s*${Z_}\\s*)?\\)$`),H6=n=>{let e=n.match(V6);if(!e)return;let t={mode:"hsl"};return e[3]!==void 0?t.h=+e[3]:e[1]!==void 0&&e[2]!==void 0&&(t.h=z6(e[1],e[2])),e[4]!==void 0&&(t.s=Math.min(Math.max(0,e[4]/100),1)),e[5]!==void 0&&(t.l=Math.min(Math.max(0,e[5]/100),1)),e[6]!==void 0?t.alpha=Math.max(0,Math.min(1,e[6]/100)):e[7]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+e[7]))),t};function G6(n,e){if(!e||e[0]!=="hsl"&&e[0]!=="hsla")return;const t={mode:"hsl"},[,i,s,r,o]=e;if(i.type!==ye.None){if(i.type===ye.Percentage)return;t.h=i.value}if(s.type!==ye.None){if(s.type===ye.Hue)return;t.s=s.value/100}if(r.type!==ye.None){if(r.type===ye.Hue)return;t.l=r.value/100}return o.type!==ye.None&&(t.alpha=Math.min(1,Math.max(0,o.type===ye.Number?o.value:o.value/100))),t}const uA={mode:"hsl",toMode:{rgb:k6},fromMode:{rgb:B6},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[G6,H6],serialize:n=>`hsl(${n.h!==void 0?n.h:"none"} ${n.s!==void 0?n.s*100+"%":"none"} ${n.l!==void 0?n.l*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ce,fixup:qs},s:Ce,l:Ce,alpha:{use:Ce,fixup:an}},difference:{h:qh},average:{h:Ys}};function fA({h:n,s:e,v:t,alpha:i}){n=xn(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t,g:t*(1-e*s),b:t*(1-e)};break;case 1:r={r:t*(1-e*s),g:t,b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t,b:t*(1-e*s)};break;case 3:r={r:t*(1-e),g:t*(1-e*s),b:t};break;case 4:r={r:t*(1-e*s),g:t*(1-e),b:t};break;case 5:r={r:t,g:t*(1-e),b:t*(1-e*s)};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function dA({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsv",s:s===0?0:1-r/s,v:s};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e1){let s=e+t;e/=s,t/=s}return fA({h:n,s:t===1?1:1-e/(1-t),v:1-t,alpha:i})}function X6(n){let e=dA(n);if(e===void 0)return;let t=e.s!==void 0?e.s:0,i=e.v!==void 0?e.v:0,s={mode:"hwb",w:(1-t)*i,b:1-i};return e.h!==void 0&&(s.h=e.h),e.alpha!==void 0&&(s.alpha=e.alpha),s}function $6(n,e){if(!e||e[0]!=="hwb")return;const t={mode:"hwb"},[,i,s,r,o]=e;if(i.type!==ye.None){if(i.type===ye.Percentage)return;t.h=i.value}if(s.type!==ye.None){if(s.type===ye.Hue)return;t.w=s.value/100}if(r.type!==ye.None){if(r.type===ye.Hue)return;t.b=r.value/100}return o.type!==ye.None&&(t.alpha=Math.min(1,Math.max(0,o.type===ye.Number?o.value:o.value/100))),t}const q6={mode:"hwb",toMode:{rgb:W6},fromMode:{rgb:X6},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[$6],serialize:n=>`hwb(${n.h!==void 0?n.h:"none"} ${n.w!==void 0?n.w*100+"%":"none"} ${n.b!==void 0?n.b*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ce,fixup:qs},w:Ce,b:Ce,alpha:{use:Ce,fixup:an}},difference:{h:I6},average:{h:Ys}},pA=203,Zh=.1593017578125,mA=78.84375,Jh=.8359375,Qh=18.8515625,ep=18.6875;function Om(n){if(n<0)return 0;const e=Math.pow(n,1/mA);return 1e4*Math.pow(Math.max(0,e-Jh)/(Qh-ep*e),1/Zh)}function Nm(n){if(n<0)return 0;const e=Math.pow(n/1e4,Zh);return Math.pow((Jh+Qh*e)/(1+ep*e),mA)}const Um=n=>Math.max(n/pA,0),jx=({i:n,t:e,p:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Om(n+.008609037037932761*e+.11102962500302593*t),r=Om(n-.00860903703793275*e-.11102962500302599*t),o=Om(n+.5600313357106791*e-.32062717498731885*t),a={mode:"xyz65",x:Um(2.070152218389422*s-1.3263473389671556*r+.2066510476294051*o),y:Um(.3647385209748074*s+.680566024947227*r-.0453045459220346*o),z:Um(-.049747207535812*s-.0492609666966138*r+1.1880659249923042*o)};return i!==void 0&&(a.alpha=i),a},Fm=(n=0)=>Math.max(n*pA,0),Kx=({x:n,y:e,z:t,alpha:i})=>{const s=Fm(n),r=Fm(e),o=Fm(t),a=Nm(.3592832590121217*s+.6976051147779502*r-.0358915932320289*o),l=Nm(-.1920808463704995*s+1.1004767970374323*r+.0753748658519118*o),c=Nm(.0070797844607477*s+.0748396662186366*r+.8433265453898765*o),u=.5*a+.5*l,f=1.61376953125*a-3.323486328125*l+1.709716796875*c,d=4.378173828125*a-4.24560546875*l-.132568359375*c,h={mode:"itp",i:u,t:f,p:d};return i!==void 0&&(h.alpha=i),h},Y6={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:jx,rgb:n=>Oo(jx(n))},fromMode:{xyz65:Kx,rgb:n=>Kx(Do(n))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:Ce,t:Ce,p:Ce,alpha:{use:Ce,fixup:an}}},j6=134.03437499999998,K6=16295499532821565e-27,km=n=>{if(n<0)return 0;let e=Math.pow(n/1e4,Zh);return Math.pow((Jh+Qh*e)/(1+ep*e),j6)},Bm=(n=0)=>Math.max(n*203,0),gA=({x:n,y:e,z:t,alpha:i})=>{n=Bm(n),e=Bm(e),t=Bm(t);let s=1.15*n-.15*t,r=.66*e+.34*n,o=km(.41478972*s+.579999*r+.014648*t),a=km(-.20151*s+1.120649*r+.0531008*t),l=km(-.0166008*s+.2648*r+.6684799*t),c=(o+a)/2,u={mode:"jab",j:.44*c/(1-.56*c)-K6,a:3.524*o-4.066708*a+.542708*l,b:.199076*o+1.096799*a-1.295875*l};return i!==void 0&&(u.alpha=i),u},Z6=134.03437499999998,Zx=16295499532821565e-27,zm=n=>{if(n<0)return 0;let e=Math.pow(n,1/Z6);return 1e4*Math.pow((Jh-e)/(ep*e-Qh),1/Zh)},Vm=n=>n/203,_A=({j:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+Zx)/(.44+.56*(n+Zx)),r=zm(s+.13860504*e+.058047316*t),o=zm(s-.13860504*e-.058047316*t),a=zm(s-.096019242*e-.8118919*t),l={mode:"xyz65",x:Vm(1.661373024652174*r-.914523081304348*o+.23136208173913045*a),y:Vm(-.3250758611844533*r+1.571847026732543*o-.21825383453227928*a),z:Vm(-.090982811*r-.31272829*o+1.5227666*a)};return i!==void 0&&(l.alpha=i),l},vA=n=>{let e=gA(Do(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},yA=n=>Oo(_A(n)),J6={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:vA,xyz65:gA},toMode:{rgb:yA,xyz65:_A},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:Ce,a:Ce,b:Ce,alpha:{use:Ce,fixup:an}}},Jx=({j:n,a:e,b:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"jch",j:n,c:s};return s&&(r.h=xn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},Qx=({j:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"jab",j:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},Q6={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Qx,rgb:n=>yA(Qx(n))},fromMode:{rgb:n=>Jx(vA(n)),jab:Jx},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:Ce,fixup:qs},c:Ce,j:Ce,alpha:{use:Ce,fixup:an}},difference:{h:Yh},average:{h:Ys}},tp=Math.pow(29,3)/Math.pow(3,3),J_=Math.pow(6,3)/Math.pow(29,3);let Hm=n=>Math.pow(n,3)>J_?Math.pow(n,3):(116*n-16)/tp;const Q_=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz50",x:Hm(r)*en.X,y:Hm(s)*en.Y,z:Hm(o)*en.Z};return i!==void 0&&(a.alpha=i),a},Qc=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=ja({r:n*3.1341359569958707-e*1.6173863321612538-.4906619460083532*t,g:n*-.978795502912089+e*1.916254567259524+.03344273116131949*t,b:n*.07195537988411677-e*.2289768264158322+1.405386058324125*t});return i!==void 0&&(s.alpha=i),s},bA=n=>Qc(Q_(n)),eu=n=>{let{r:e,g:t,b:i,alpha:s}=Ya(n),r={mode:"xyz50",x:.436065742824811*e+.3851514688337912*t+.14307845442264197*i,y:.22249319175623702*e+.7168870538238823*t+.06061979053616537*i,z:.013923904500943465*e+.09708128566574634*t+.7140993584005155*i};return s!==void 0&&(r.alpha=s),r},Gm=n=>n>J_?Math.cbrt(n):(tp*n+16)/116,ev=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Gm(n/en.X),r=Gm(e/en.Y),o=Gm(t/en.Z),a={mode:"lab",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},xA=n=>{let e=ev(eu(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e};function eH(n,e){if(!e||e[0]!=="lab")return;const t={mode:"lab"},[,i,s,r,o]=e;if(!(i.type===ye.Hue||s.type===ye.Hue||r.type===ye.Hue))return i.type!==ye.None&&(t.l=Math.min(Math.max(0,i.value),100)),s.type!==ye.None&&(t.a=s.type===ye.Number?s.value:s.value*125/100),r.type!==ye.None&&(t.b=r.type===ye.Number?r.value:r.value*125/100),o.type!==ye.None&&(t.alpha=Math.min(1,Math.max(0,o.type===ye.Number?o.value:o.value/100))),t}const tv={mode:"lab",toMode:{xyz50:Q_,rgb:bA},fromMode:{xyz50:ev,rgb:xA},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[eH],serialize:n=>`lab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{l:Ce,a:Ce,b:Ce,alpha:{use:Ce,fixup:an}}},tH={...tv,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:oA,rgb:jh},fromMode:{xyz65:aA,rgb:Kh},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function nH(n,e){if(!e||e[0]!=="lch")return;const t={mode:"lch"},[,i,s,r,o]=e;if(i.type!==ye.None){if(i.type===ye.Hue)return;t.l=Math.min(Math.max(0,i.value),100)}if(s.type!==ye.None&&(t.c=Math.max(0,s.type===ye.Number?s.value:s.value*150/100)),r.type!==ye.None){if(r.type===ye.Percentage)return;t.h=r.value}return o.type!==ye.None&&(t.alpha=Math.min(1,Math.max(0,o.type===ye.Number?o.value:o.value/100))),t}const nv={mode:"lch",toMode:{lab:wr,rgb:n=>bA(wr(n))},fromMode:{rgb:n=>Tr(xA(n)),lab:Tr},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[nH],serialize:n=>`lch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ce,fixup:qs},c:Ce,l:Ce,alpha:{use:Ce,fixup:an}},difference:{h:Yh},average:{h:Ys}},iH={...nv,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:n=>wr(n,"lab65"),rgb:n=>jh(wr(n,"lab65"))},fromMode:{rgb:n=>Tr(Kh(n),"lch65"),lab65:n=>Tr(n,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},MA=({l:n,u:e,v:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"lchuv",l:n,c:s};return s&&(r.h=xn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},SA=({l:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"luv",l:n,u:e?e*Math.cos(t/180*Math.PI):0,v:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},EA=(n,e,t)=>4*n/(n+15*e+3*t),TA=(n,e,t)=>9*e/(n+15*e+3*t),sH=EA(en.X,en.Y,en.Z),rH=TA(en.X,en.Y,en.Z),oH=n=>n<=J_?tp*n:116*Math.cbrt(n)-16,s0=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=oH(e/en.Y),r=EA(n,e,t),o=TA(n,e,t);!isFinite(r)||!isFinite(o)?s=r=o=0:(r=13*s*(r-sH),o=13*s*(o-rH));let a={mode:"luv",l:s,u:r,v:o};return i!==void 0&&(a.alpha=i),a},aH=(n,e,t)=>4*n/(n+15*e+3*t),lH=(n,e,t)=>9*e/(n+15*e+3*t),cH=aH(en.X,en.Y,en.Z),uH=lH(en.X,en.Y,en.Z),r0=({l:n,u:e,v:t,alpha:i})=>{if(n===void 0&&(n=0),n===0)return{mode:"xyz50",x:0,y:0,z:0};e===void 0&&(e=0),t===void 0&&(t=0);let s=e/(13*n)+cH,r=t/(13*n)+uH,o=en.Y*(n<=8?n/tp:Math.pow((n+16)/116,3)),a=o*(9*s)/(4*r),l=o*(12-3*s-20*r)/(4*r),c={mode:"xyz50",x:a,y:o,z:l};return i!==void 0&&(c.alpha=i),c},fH=n=>MA(s0(eu(n))),dH=n=>Qc(r0(SA(n))),hH={mode:"lchuv",toMode:{luv:SA,rgb:dH},fromMode:{rgb:fH,luv:MA},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:Ce,fixup:qs},c:Ce,l:Ce,alpha:{use:Ce,fixup:an}},difference:{h:Yh},average:{h:Ys}},pH={...qa,mode:"lrgb",toMode:{rgb:ja},fromMode:{rgb:Ya},parse:["srgb-linear"],serialize:"srgb-linear"},mH={mode:"luv",toMode:{xyz50:r0,rgb:n=>Qc(r0(n))},fromMode:{xyz50:s0,rgb:n=>s0(eu(n))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:Ce,u:Ce,v:Ce,alpha:{use:Ce,fixup:an}}},wA=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.cbrt(.41222147079999993*n+.5363325363*e+.0514459929*t),r=Math.cbrt(.2119034981999999*n+.6806995450999999*e+.1073969566*t),o=Math.cbrt(.08830246189999998*n+.2817188376*e+.6299787005000002*t),a={mode:"oklab",l:.2104542553*s+.793617785*r-.0040720468*o,a:1.9779984951*s-2.428592205*r+.4505937099*o,b:.0259040371*s+.7827717662*r-.808675766*o};return i!==void 0&&(a.alpha=i),a},np=n=>{let e=wA(Ya(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},tu=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.pow(n*.9999999984505198+.39633779217376786*e+.2158037580607588*t,3),r=Math.pow(n*1.0000000088817609-.10556134232365635*e-.06385417477170591*t,3),o=Math.pow(n*1.0000000546724108-.08948418209496575*e-1.2914855378640917*t,3),a={mode:"lrgb",r:4.076741661347994*s-3.307711590408193*r+.230969928729428*o,g:-1.2684380040921763*s+2.6097574006633715*r-.3413193963102197*o,b:-.004196086541837188*s-.7034186144594493*r+1.7076147009309444*o};return i!==void 0&&(a.alpha=i),a},ip=n=>ja(tu(n));function o0(n){const i=1.170873786407767;return .5*(i*n-.206+Math.sqrt((i*n-.206)*(i*n-.206)+4*.03*i*n))}function Bd(n){return(n*n+.206*n)/(1.170873786407767*(n+.03))}function gH(n,e){let t,i,s,r,o,a,l,c;-1.88170328*n-.80936493*e>1?(t=1.19086277,i=1.76576728,s=.59662641,r=.75515197,o=.56771245,a=4.0767416621,l=-3.3077115913,c=.2309699292):1.81444104*n-1.19445276*e>1?(t=.73956515,i=-.45954404,s=.08285427,r=.1254107,o=.14503204,a=-1.2684380046,l=2.6097574011,c=-.3413193965):(t=1.35733652,i=-.00915799,s=-1.1513021,r=-.50559606,o=.00692167,a=-.0041960863,l=-.7034186147,c=1.707614701);let u=t+i*n+s*e+r*n*n+o*n*e,f=.3963377774*n+.2158037573*e,d=-.1055613458*n-.0638541728*e,h=-.0894841775*n-1.291485548*e;{let p=1+u*f,_=1+u*d,g=1+u*h,m=p*p*p,v=_*_*_,b=g*g*g,y=3*f*p*p,T=3*d*_*_,w=3*h*g*g,S=6*f*f*p,P=6*d*d*_,M=6*h*h*g,E=a*m+l*v+c*b,D=a*y+l*T+c*w,B=a*S+l*P+c*M;u=u-E*D/(D*D-.5*E*B)}return u}function iv(n,e){let t=gH(n,e),i=tu({l:1,a:t*n,b:t*e}),s=Math.cbrt(1/Math.max(i.r,i.g,i.b)),r=s*t;return[s,r]}function _H(n,e,t,i,s,r=null){r||(r=iv(n,e));let o;if((t-s)*r[1]-(r[0]-s)*i<=0)o=r[1]*s/(i*r[0]+r[1]*(s-t));else{o=r[1]*(s-1)/(i*(r[0]-1)+r[1]*(s-t));{let a=t-s,l=i,c=.3963377774*n+.2158037573*e,u=-.1055613458*n-.0638541728*e,f=-.0894841775*n-1.291485548*e,d=a+l*c,h=a+l*u,p=a+l*f;{let _=s*(1-o)+o*t,g=o*i,m=_+g*c,v=_+g*u,b=_+g*f,y=m*m*m,T=v*v*v,w=b*b*b,S=3*d*m*m,P=3*h*v*v,M=3*p*b*b,E=6*d*d*m,D=6*h*h*v,B=6*p*p*b,z=4.0767416621*y-3.3077115913*T+.2309699292*w-1,V=4.0767416621*S-3.3077115913*P+.2309699292*M,Q=4.0767416621*E-3.3077115913*D+.2309699292*B,j=V/(V*V-.5*z*Q),te=-z*j,Z=-1.2684380046*y+2.6097574011*T-.3413193965*w-1,pe=-1.2684380046*S+2.6097574011*P-.3413193965*M,Me=-1.2684380046*E+2.6097574011*D-.3413193965*B,re=pe/(pe*pe-.5*Z*Me),xe=-Z*re,We=-.0041960863*y-.7034186147*T+1.707614701*w-1,oe=-.0041960863*S-.7034186147*P+1.707614701*M,ge=-.0041960863*E-.7034186147*D+1.707614701*B,Ee=oe/(oe*oe-.5*We*ge),$=-We*Ee;te=j>=0?te:1e6,xe=re>=0?xe:1e6,$=Ee>=0?$:1e6,o+=Math.min(te,Math.min(xe,$))}}}return o}function sv(n,e,t=null){t||(t=iv(n,e));let i=t[0],s=t[1];return[s/i,s/(1-i)]}function AA(n,e,t){let i=iv(e,t),s=_H(e,t,n,1,n,i),r=sv(e,t,i),o=.11516993+1/(7.4477897+4.1590124*t+e*(-2.19557347+1.75198401*t+e*(-2.13704948-10.02301043*t+e*(-4.24894561+5.38770819*t+4.69891013*e)))),a=.11239642+1/(1.6132032-.68124379*t+e*(.40370612+.90148123*t+e*(-.27087943+.6122399*t+e*(.00299215-.45399568*t-.14661872*e)))),l=s/Math.min(n*r[0],(1-n)*r[1]),c=n*o,u=(1-n)*a,f=.9*l*Math.sqrt(Math.sqrt(1/(1/(c*c*c*c)+1/(u*u*u*u))));return c=n*.4,u=(1-n)*.8,[Math.sqrt(1/(1/(c*c)+1/(u*u))),f,s]}function eM(n){const e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s={mode:"okhsl",l:o0(e)};n.alpha!==void 0&&(s.alpha=n.alpha);let r=Math.sqrt(t*t+i*i);if(!r)return s.s=0,s;let[o,a,l]=AA(e,t/r,i/r),c;if(reM(np(n))},toMode:{oklab:tM,rgb:n=>ip(tM(n))}};function nM(n){let e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s=Math.sqrt(t*t+i*i),r=s?t/s:1,o=s?i/s:1,[a,l]=sv(r,o),c=.5,u=1-c/a,f=l/(s+e*l),d=f*e,h=f*s,p=Bd(d),_=h*p/d,g=tu({l:p,a:r*_,b:o*_}),m=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));e=e/m,s=s/m*o0(e)/e,e=o0(e);const v={mode:"okhsv",s:s?(c+l)*h/(l*c+l*u*h):0,v:e?e/d:0};return v.s&&(v.h=xn(Math.atan2(i,t)*180/Math.PI)),n.alpha!==void 0&&(v.alpha=n.alpha),v}function iM(n){const e={mode:"oklab"};n.alpha!==void 0&&(e.alpha=n.alpha);const t=n.h!==void 0?n.h:0,i=n.s!==void 0?n.s:0,s=n.v!==void 0?n.v:0,r=Math.cos(t/180*Math.PI),o=Math.sin(t/180*Math.PI),[a,l]=sv(r,o),c=.5,u=1-c/a,f=1-i*c/(c+l-l*u*i),d=i*l*c/(c+l-l*u*i),h=Bd(f),p=d*h/f,_=tu({l:h,a:r*p,b:o*p}),g=Math.cbrt(1/Math.max(_.r,_.g,_.b,0)),m=Bd(s*f),v=d*m/f;return e.l=m*g,e.a=v*r*g,e.b=v*o*g,e}const yH={...hA,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:nM,rgb:n=>nM(np(n))},toMode:{oklab:iM,rgb:n=>ip(iM(n))}};function bH(n,e){if(!e||e[0]!=="oklab")return;const t={mode:"oklab"},[,i,s,r,o]=e;if(!(i.type===ye.Hue||s.type===ye.Hue||r.type===ye.Hue))return i.type!==ye.None&&(t.l=Math.min(Math.max(0,i.type===ye.Number?i.value:i.value/100),1)),s.type!==ye.None&&(t.a=s.type===ye.Number?s.value:s.value*.4/100),r.type!==ye.None&&(t.b=r.type===ye.Number?r.value:r.value*.4/100),o.type!==ye.None&&(t.alpha=Math.min(1,Math.max(0,o.type===ye.Number?o.value:o.value/100))),t}const xH={...tv,mode:"oklab",toMode:{lrgb:tu,rgb:ip},fromMode:{lrgb:wA,rgb:np},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[bH],serialize:n=>`oklab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`};function MH(n,e){if(!e||e[0]!=="oklch")return;const t={mode:"oklch"},[,i,s,r,o]=e;if(i.type!==ye.None){if(i.type===ye.Hue)return;t.l=Math.min(Math.max(0,i.type===ye.Number?i.value:i.value/100),1)}if(s.type!==ye.None&&(t.c=Math.max(0,s.type===ye.Number?s.value:s.value*.4/100)),r.type!==ye.None){if(r.type===ye.Percentage)return;t.h=r.value}return o.type!==ye.None&&(t.alpha=Math.min(1,Math.max(0,o.type===ye.Number?o.value:o.value/100))),t}const SH={...nv,mode:"oklch",toMode:{oklab:n=>wr(n,"oklab"),rgb:n=>ip(wr(n,"oklab"))},fromMode:{rgb:n=>Tr(np(n),"oklch"),oklab:n=>Tr(n,"oklch")},parse:[MH],serialize:n=>`oklch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},sM=n=>{let{r:e,g:t,b:i,alpha:s}=Ya(n),r={mode:"xyz65",x:.486570948648216*e+.265667693169093*t+.1982172852343625*i,y:.2289745640697487*e+.6917385218365062*t+.079286914093745*i,z:0*e+.0451133818589026*t+1.043944368900976*i};return s!==void 0&&(r.alpha=s),r},rM=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=ja({r:n*2.4934969119414263-e*.9313836179191242-.402710784450717*t,g:n*-.8294889695615749+e*1.7626640603183465+.0236246858419436*t,b:n*.0358458302437845-e*.0761723892680418+.9568845240076871*t},"p3");return i!==void 0&&(s.alpha=i),s},EH={...qa,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:n=>rM(Do(n)),xyz65:rM},toMode:{rgb:n=>Oo(sM(n)),xyz65:sM}},Wm=n=>{let e=Math.abs(n);return e>=1/512?Math.sign(n)*Math.pow(e,1/1.8):16*n},oM=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"prophoto",r:Wm(n*1.3457868816471585-e*.2555720873797946-.0511018649755453*t),g:Wm(n*-.5446307051249019+e*1.5082477428451466+.0205274474364214*t),b:Wm(n*0+e*0+1.2119675456389452*t)};return i!==void 0&&(s.alpha=i),s},Xm=(n=0)=>{let e=Math.abs(n);return e>=16/512?Math.sign(n)*Math.pow(e,1.8):n/16},aM=n=>{let e=Xm(n.r),t=Xm(n.g),i=Xm(n.b),s={mode:"xyz50",x:.7977666449006423*e+.1351812974005331*t+.0313477341283922*i,y:.2880748288194013*e+.7118352342418731*t+899369387256e-16*i,z:0*e+0*t+.8251046025104602*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},TH={...qa,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:oM,rgb:n=>oM(eu(n))},toMode:{xyz50:aM,rgb:n=>Qc(aM(n))}},lM=1.09929682680944,wH=.018053968510807,$m=n=>{const e=Math.abs(n);return e>wH?(Math.sign(n)||1)*(lM*Math.pow(e,.45)-(lM-1)):4.5*n},cM=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"rec2020",r:$m(n*1.7166511879712683-e*.3556707837763925-.2533662813736599*t),g:$m(n*-.6666843518324893+e*1.6164812366349395+.0157685458139111*t),b:$m(n*.0176398574453108-e*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(s.alpha=i),s},uM=1.09929682680944,AH=.018053968510807,qm=(n=0)=>{let e=Math.abs(n);return e{let e=qm(n.r),t=qm(n.g),i=qm(n.b),s={mode:"xyz65",x:.6369580483012911*e+.1446169035862083*t+.1688809751641721*i,y:.262700212011267*e+.6779980715188708*t+.059301716469862*i,z:0*e+.0280726930490874*t+1.0609850577107909*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},CH={...qa,mode:"rec2020",fromMode:{xyz65:cM,rgb:n=>cM(Do(n))},toMode:{xyz65:fM,rgb:n=>Oo(fM(n))},parse:["rec2020"],serialize:"rec2020"},bo=.0037930732552754493,CA=Math.cbrt(bo),Ym=n=>Math.cbrt(n)-CA,RH=n=>{const{r:e,g:t,b:i,alpha:s}=Ya(n),r=Ym(.3*e+.622*t+.078*i+bo),o=Ym(.23*e+.692*t+.078*i+bo),a=Ym(.2434226892454782*e+.2047674442449682*t+.5518098665095535*i+bo),l={mode:"xyb",x:(r-o)/2,y:(r+o)/2,b:a-(r+o)/2};return s!==void 0&&(l.alpha=s),l},jm=n=>Math.pow(n+CA,3),PH=({x:n,y:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=jm(n+e)-bo,r=jm(e-n)-bo,o=jm(t+e)-bo,a=ja({r:11.031566904639861*s-9.866943908131562*r-.16462299650829934*o,g:-3.2541473810744237*s+4.418770377582723*r-.16462299650829934*o,b:-3.6588512867136815*s+2.7129230459360922*r+1.9459282407775895*o});return i!==void 0&&(a.alpha=i),a},IH={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:PH},fromMode:{rgb:RH},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:Ce,y:Ce,b:Ce,alpha:{use:Ce,fixup:an}}},LH={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Qc,lab:ev},fromMode:{rgb:eu,lab:Q_},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:Ce,y:Ce,z:Ce,alpha:{use:Ce,fixup:an}}},DH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz50",x:1.0479298208405488*e+.0229467933410191*t-.0501922295431356*i,y:.0296278156881593*e+.990434484573249*t-.0170738250293851*i,z:-.0092430581525912*e+.0150551448965779*t+.7518742899580008*i};return s!==void 0&&(r.alpha=s),r},OH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz65",x:.9554734527042182*e-.0230985368742614*t+.0632593086610217*i,y:-.0283697069632081*e+1.0099954580058226*t+.021041398966943*i,z:.0123140016883199*e-.0205076964334779*t+1.3303659366080753*i};return s!==void 0&&(r.alpha=s),r},NH={mode:"xyz65",toMode:{rgb:Oo,xyz50:DH},fromMode:{rgb:Do,xyz50:OH},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:Ce,y:Ce,z:Ce,alpha:{use:Ce,fixup:an}}},UH=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"yiq",y:.29889531*n+.58662247*e+.11448223*t,i:.59597799*n-.2741761*e-.32180189*t,q:.21147017*n-.52261711*e+.31114694*t};return i!==void 0&&(s.alpha=i),s},FH=({y:n,i:e,q:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"rgb",r:n+.95608445*e+.6208885*t,g:n-.27137664*e-.6486059*t,b:n-1.10561724*e+1.70250126*t};return i!==void 0&&(s.alpha=i),s},kH={mode:"yiq",toMode:{rgb:FH},fromMode:{rgb:UH},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:Ce,i:Ce,q:Ce,alpha:{use:Ce,fixup:an}}};Tt(T6);Tt(L6);Tt(D6);Tt(O6);Tt(F6);Tt(uA);Tt(hA);Tt(q6);Tt(Y6);Tt(J6);Tt(Q6);Tt(tv);Tt(tH);Tt(nv);Tt(iH);Tt(hH);Tt(pH);Tt(mH);Tt(vH);Tt(yH);Tt(xH);Tt(SH);Tt(EH);Tt(TH);Tt(CH);Tt(qa);Tt(IH);Tt(LH);Tt(NH);Tt(kH);const a0=220.44,BH=eA("oklch"),dM=n=>{var e;return n?(e=BH(n))==null?void 0:e.h:a0},zH=Yz("settings",()=>{const n=nt(),e=ys("settings/language","en-US"),t=ys("settings/stage/view/model-renderer","2d"),i=ys("settings/audio/input","false"),s=Se(()=>{var w;return(w=n.value)==null?void 0:w.deviceId}),{audioInputs:r,ensurePermissions:o}=ZB({constraints:{audio:!0}}),a=nt(),l=nt("/assets/live2d/models/hiyori_pro_zh.zip"),c=nt("url"),u=nt(!1),f=ys("settings/live2d/position",{x:0,y:0}),d=nt({group:"Idle",index:0}),h=nt([]),p=ys("settings/live2d/motion-map",{}),_=ys("settings/disable-transitions",!0),g=ys("settings/use-page-specific-transitions",!0),m=ys("settings/theme/colors/hue",a0),v=ys("settings/theme/colors/hue-dynamic",!1);function b(w=a0){m.value=w,v.value=!1}function y(w){b(dM(w))}function T(w){if(v.value)return!1;const S=dM(w);if(!S)return!1;const P=Math.abs(S-m.value);return P<.01||P>359.99}return Ke(i,w=>{w==="false"&&(n.value=void 0),w==="true"&&o().then(()=>{n.value=r.value[0]})}),Ke(r,()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])},{immediate:!0}),{live2dModelFile:a,live2dModelUrl:l,live2dLoadSource:c,live2dCurrentMotion:d,live2dPosition:f,availableLive2dMotions:h,live2dMotionMap:p,loadingLive2dModel:u,disableTransitions:_,usePageSpecificTransitions:g,language:e,stageView:t,themeColorsHue:m,themeColorsHueDynamic:v,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s,setThemeColorsHue:b,applyPrimaryColorFrom:y,isColorSelectedForPrimary:T}}),VH=dn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>t.value.primaryColor||"#666"),s=Se(()=>t.value.secondaryColor||"#ccc");return Gn(()=>{document.documentElement.style.setProperty("--stage-transition-3-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-3-overlay-color-2",s.value)}),(r,o)=>(vn(),yi("div",{class:"stage-transition-3",style:Si({zIndex:t.value.zIndex||100})},null,4))}}),No=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},HH=No(VH,[["__scopeId","data-v-df576df0"]]),GH=dn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>{var i;return((i=e.stageTransition)==null?void 0:i.colors)||["#eee","#ebcb8b","#c56370","#3f3b52"]});return Gn(()=>{var i,s;document.documentElement.style.setProperty("--circle-expansion-delay",`${((i=e.stageTransition)==null?void 0:i.delay)||0}s`),document.documentElement.style.setProperty("--circle-expansion-duration",`${((s=e.stageTransition)==null?void 0:s.duration)||.4}s`),t.value.forEach((r,o)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${o+1}`,r)})}),(i,s)=>{var r;return vn(),yi("div",{class:"circle-expansion-transition",style:Si({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(vn(!0),yi(Zt,null,v2(t.value,(o,a)=>(vn(),yi("div",{key:a}))),128))],4)}}}),WH=No(GH,[["__scopeId","data-v-0c29056c"]]),XH=dn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>{var s;return((s=e.stageTransition)==null?void 0:s.direction)||"up"}),i=Se(()=>`fantasy-fall-${t.value}`);return Gn(()=>{var s,r,o,a,l,c,u,f,d;document.documentElement.style.setProperty("--fantasy-fall-color",((s=e.stageTransition)==null?void 0:s.primaryColor)||"#eee"),document.documentElement.style.setProperty("--fantasy-fall-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--fantasy-fall-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--fantasy-fall-radius-sm",`${((l=(a=e.stageTransition)==null?void 0:a.borderRadius)==null?void 0:l.sm)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-md",`${((u=(c=e.stageTransition)==null?void 0:c.borderRadius)==null?void 0:u.md)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-lg",`${((d=(f=e.stageTransition)==null?void 0:f.borderRadius)==null?void 0:d.lg)||"50%"}`)}),(s,r)=>{var o;return vn(),yi("div",{class:ka(["fantasy-fall-transition",i.value]),style:Si({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),$H=No(XH,[["__scopeId","data-v-e62bf496"]]),qH=dn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Se(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Gn(()=>{document.documentElement.style.setProperty("--stage-transition-4-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-4-overlay-color-2",s.value)}),(r,o)=>{var a;return vn(),yi("div",{class:"stage-transition-4",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[Z2('
',5)]),4)}}}),YH=No(qH,[["__scopeId","data-v-6d1179fc"]]),jH=dn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Se(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Ke([t,i,s],()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),Gn(()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),(r,o)=>{var a;return vn(),yi("div",{class:"stage-transition-1",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),KH=No(jH,[["__scopeId","data-v-bf1d1566"]]),ZH=dn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)??"#666"}),s=Se(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)??"#ccc"});return Gn(()=>{document.documentElement.style.setProperty("--stage-transition-2-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-2-overlay-color-2",s.value)}),(r,o)=>{var a;return vn(),yi("div",{class:"stage-transition-2",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),JH=No(ZH,[["__scopeId","data-v-8ff7120f"]]),QH=dn({__name:"RectanglesRotateTransition",props:{stageTransition:null},setup(n){const e=n;return Gn(()=>{var t,i,s,r,o,a,l;document.documentElement.style.setProperty("--rectangle-rotate-1-color",((t=e.stageTransition)==null?void 0:t.primaryColor)||"#ebcb8b"),document.documentElement.style.setProperty("--rectangle-rotate-2-color",((i=e.stageTransition)==null?void 0:i.secondaryColor)||"#c56370"),document.documentElement.style.setProperty("--rectangle-rotate-3-color",((s=e.stageTransition)==null?void 0:s.tertiaryColor)||"#43445b"),document.documentElement.style.setProperty("--rectangle-rotate-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--rectangle-rotate-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--rectangle-rotate-stagger",`${((a=e.stageTransition)==null?void 0:a.staggerDelay)||.1}s`),document.documentElement.style.setProperty("--rectangle-rotate-rotation",`${((l=e.stageTransition)==null?void 0:l.rotation)||270}deg`)}),(t,i)=>{var s;return vn(),yi("div",{class:"rectangle-rotate-transition",style:Si({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[lr("div",{class:"rectangle rectangle-rotate-1"},[lr("div")],-1),lr("div",{class:"rectangle rectangle-rotate-2"},[lr("div")],-1),lr("div",{class:"rectangle rectangle-rotate-3"},[lr("div")],-1)]),4)}}}),e8=No(QH,[["__scopeId","data-v-f4b1dc64"]]),t8=dn({__name:"StageTransitionGroup",props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(n){const e=n,t=QV(),i=nt(!1),s=nt(),r=nt(""),o=nt(),a=Oe({slide:{component:KH,duration:2700},"slope-slide":{component:JH,duration:2700},arrow:{component:HH,duration:2700},"multiple-blocks-reveal":{component:YH,duration:2800},"fantasy-fall":{component:$H,duration:2700},"rectangles-rotate":{component:e8,duration:2700},"bubble-wave-out":{component:WH,duration:1e3}}),l=nt([]);function c(h){return l.value.push(h),()=>{const p=l.value.indexOf(h);p>=0&&l.value.splice(p,1)}}async function u(h,p={}){s.value=h;for(const _ of l.value)try{await Promise.resolve(_(h,p))}catch(g){console.error(`Error in transition hook at stage "${h}":`,g)}}async function f(h,p,_){if(h.name==="none"||!h.name){p(),_();return}const g=a.value[h.name];if(!g){console.error(`Transition ${h.name} not found`),p(),_();return}const m=g.nextDelay!==void 0?g.nextDelay:g.duration/3;let v=!1;const y=c(T=>{T==="navigation"&&!v&&(v=!0,p())});try{await u("before-enter",{transitionName:h.name}),i.value&&(await u("before-leave",{transitionName:r.value}),r.value="",o.value=void 0,i.value=!1,await u("after-leave",{transitionName:r.value}),await new Promise(w=>setTimeout(w,50))),r.value=h.name,o.value=h,i.value=!0,await u("enter-active",{transitionName:name}),setTimeout(async()=>{await u("navigation",{transitionName:h.name,config:g}),v||(v=!0,p())},m),setTimeout(async()=>{await u("after-enter",{transitionName:h.name})},g.duration),setTimeout(async()=>{await u("before-leave",{transitionName:h.name})},g.duration+10),setTimeout(async()=>{await u("leave-active",{transitionName:h.name})},g.duration+20);const T=g.exitDuration??0;setTimeout(async()=>{i.value=!1,r.value="",o.value=void 0,await u("after-leave",{transitionName:h.name}),_()},g.duration+T)}catch(T){console.error(T)}finally{y(),setTimeout(()=>{v||(v=!0,p())},g.duration*2)}}function d(h,p){return new Promise(_=>{f(h,p,_)})}return t.beforeEach((h,p,_)=>{if(e.disableTransitions){_();return}if(typeof h.meta.stageTransition!="object"){_();return}const g=h.meta.stageTransition;if(e.usePageSpecificTransitions&&g.pageSpecificAvailable){_();return}typeof e.primaryColor<"u"&&(g.primaryColor=e.primaryColor),typeof e.secondaryColor<"u"&&(g.secondaryColor=e.secondaryColor),typeof e.tertiaryColor<"u"&&(g.tertiaryColor=e.tertiaryColor),typeof e.colors<"u"&&(g.colors=e.colors),typeof e.zIndex<"u"&&(g.zIndex=e.zIndex),d(g,_)}),(h,p)=>(vn(),yi(Zt,null,[y2(h.$slots,"default"),i.value?(vn(),yi(Zt,{key:0},[a.value[r.value]?(vn(),Ql(_2(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Bv("",!0)],64)):Bv("",!0)],64))}});/*! - * shared v11.1.5 - * (c) 2025 kazuya kawaguchi - * Released under the MIT License. - */const zd=typeof window<"u",Lr=(n,e=!1)=>e?Symbol.for(n):Symbol(n),n8=(n,e,t)=>i8({l:n,k:e,s:t}),i8=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Qt=n=>typeof n=="number"&&isFinite(n),s8=n=>ov(n)==="[object Date]",Vd=n=>ov(n)==="[object RegExp]",sp=n=>mt(n)&&Object.keys(n).length===0,fn=Object.assign,r8=Object.create,Lt=(n=null)=>r8(n);let hM;const rv=()=>hM||(hM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Lt());function pM(n){return n.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const o8=Object.prototype.hasOwnProperty;function Oi(n,e){return o8.call(n,e)}const Yt=Array.isArray,Vt=n=>typeof n=="function",Fe=n=>typeof n=="string",Ht=n=>typeof n=="boolean",xt=n=>n!==null&&typeof n=="object",a8=n=>xt(n)&&Vt(n.then)&&Vt(n.catch),RA=Object.prototype.toString,ov=n=>RA.call(n),mt=n=>ov(n)==="[object Object]",l8=n=>n==null?"":Yt(n)||mt(n)&&n.toString===RA?JSON.stringify(n,null,2):String(n);function av(n,e=""){return n.reduce((t,i,s)=>s===0?t+i:t+e+i,"")}function c8(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const hf=n=>!xt(n)||Yt(n);function If(n,e){if(hf(n)||hf(e))throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:s}=t.pop();Object.keys(i).forEach(r=>{r!=="__proto__"&&(xt(i[r])&&!xt(s[r])&&(s[r]=Array.isArray(i[r])?[]:Lt()),hf(s[r])||hf(i[r])?s[r]=i[r]:t.push({src:i[r],des:s[r]}))})}}/*! - * message-compiler v11.1.5 - * (c) 2025 kazuya kawaguchi - * Released under the MIT License. - */function u8(n,e,t){return{line:n,column:e,offset:t}}function l0(n,e,t){return{start:n,end:e}}const Rt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},f8=17;function rp(n,e,t={}){const{domain:i,messages:s,args:r}=t,o=n,a=new SyntaxError(String(o));return a.code=n,e&&(a.location=e),a.domain=i,a}function d8(n){throw n}const xs=" ",h8="\r",Nn=` -`,p8="\u2028",m8="\u2029";function g8(n){const e=n;let t=0,i=1,s=1,r=0;const o=S=>e[S]===h8&&e[S+1]===Nn,a=S=>e[S]===Nn,l=S=>e[S]===m8,c=S=>e[S]===p8,u=S=>o(S)||a(S)||l(S)||c(S),f=()=>t,d=()=>i,h=()=>s,p=()=>r,_=S=>o(S)||l(S)||c(S)?Nn:e[S],g=()=>_(t),m=()=>_(t+r);function v(){return r=0,u(t)&&(i++,s=0),o(t)&&t++,t++,s++,e[t]}function b(){return o(t+r)&&r++,r++,e[t+r]}function y(){t=0,i=1,s=1,r=0}function T(S=0){r=S}function w(){const S=t+r;for(;S!==t;)v();r=0}return{index:f,line:d,column:h,peekOffset:p,charAt:_,currentChar:g,currentPeek:m,next:v,peek:b,reset:y,resetPeek:T,skipToPeek:w}}const sr=void 0,_8=".",mM="'",v8="tokenizer";function y8(n,e={}){const t=e.location!==!1,i=g8(n),s=()=>i.index(),r=()=>u8(i.line(),i.column(),i.index()),o=r(),a=s(),l={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function f(C,I,F,...H){const ce=c();if(I.column+=F,I.offset+=F,u){const R=t?l0(ce.startLoc,I):null,x=rp(C,R,{domain:v8,args:H});u(x)}}function d(C,I,F){C.endLoc=r(),C.currentType=I;const H={type:I};return t&&(H.loc=l0(C.startLoc,C.endLoc)),F!=null&&(H.value=F),H}const h=C=>d(C,13);function p(C,I){return C.currentChar()===I?(C.next(),I):(f(Rt.EXPECTED_TOKEN,r(),0,I),"")}function _(C){let I="";for(;C.currentPeek()===xs||C.currentPeek()===Nn;)I+=C.currentPeek(),C.peek();return I}function g(C){const I=_(C);return C.skipToPeek(),I}function m(C){if(C===sr)return!1;const I=C.charCodeAt(0);return I>=97&&I<=122||I>=65&&I<=90||I===95}function v(C){if(C===sr)return!1;const I=C.charCodeAt(0);return I>=48&&I<=57}function b(C,I){const{currentType:F}=I;if(F!==2)return!1;_(C);const H=m(C.currentPeek());return C.resetPeek(),H}function y(C,I){const{currentType:F}=I;if(F!==2)return!1;_(C);const H=C.currentPeek()==="-"?C.peek():C.currentPeek(),ce=v(H);return C.resetPeek(),ce}function T(C,I){const{currentType:F}=I;if(F!==2)return!1;_(C);const H=C.currentPeek()===mM;return C.resetPeek(),H}function w(C,I){const{currentType:F}=I;if(F!==7)return!1;_(C);const H=C.currentPeek()===".";return C.resetPeek(),H}function S(C,I){const{currentType:F}=I;if(F!==8)return!1;_(C);const H=m(C.currentPeek());return C.resetPeek(),H}function P(C,I){const{currentType:F}=I;if(!(F===7||F===11))return!1;_(C);const H=C.currentPeek()===":";return C.resetPeek(),H}function M(C,I){const{currentType:F}=I;if(F!==9)return!1;const H=()=>{const R=C.currentPeek();return R==="{"?m(C.peek()):R==="@"||R==="|"||R===":"||R==="."||R===xs||!R?!1:R===Nn?(C.peek(),H()):D(C,!1)},ce=H();return C.resetPeek(),ce}function E(C){_(C);const I=C.currentPeek()==="|";return C.resetPeek(),I}function D(C,I=!0){const F=(ce=!1,R="")=>{const x=C.currentPeek();return x==="{"||x==="@"||!x?ce:x==="|"?!(R===xs||R===Nn):x===xs?(C.peek(),F(!0,xs)):x===Nn?(C.peek(),F(!0,Nn)):!0},H=F();return I&&C.resetPeek(),H}function B(C,I){const F=C.currentChar();return F===sr?sr:I(F)?(C.next(),F):null}function z(C){const I=C.charCodeAt(0);return I>=97&&I<=122||I>=65&&I<=90||I>=48&&I<=57||I===95||I===36}function V(C){return B(C,z)}function Q(C){const I=C.charCodeAt(0);return I>=97&&I<=122||I>=65&&I<=90||I>=48&&I<=57||I===95||I===36||I===45}function j(C){return B(C,Q)}function te(C){const I=C.charCodeAt(0);return I>=48&&I<=57}function Z(C){return B(C,te)}function pe(C){const I=C.charCodeAt(0);return I>=48&&I<=57||I>=65&&I<=70||I>=97&&I<=102}function Me(C){return B(C,pe)}function re(C){let I="",F="";for(;I=Z(C);)F+=I;return F}function xe(C){let I="";for(;;){const F=C.currentChar();if(F==="{"||F==="}"||F==="@"||F==="|"||!F)break;if(F===xs||F===Nn)if(D(C))I+=F,C.next();else{if(E(C))break;I+=F,C.next()}else I+=F,C.next()}return I}function We(C){g(C);let I="",F="";for(;I=j(C);)F+=I;return C.currentChar()===sr&&f(Rt.UNTERMINATED_CLOSING_BRACE,r(),0),F}function oe(C){g(C);let I="";return C.currentChar()==="-"?(C.next(),I+=`-${re(C)}`):I+=re(C),C.currentChar()===sr&&f(Rt.UNTERMINATED_CLOSING_BRACE,r(),0),I}function ge(C){return C!==mM&&C!==Nn}function Ee(C){g(C),p(C,"'");let I="",F="";for(;I=B(C,ge);)I==="\\"?F+=$(C):F+=I;const H=C.currentChar();return H===Nn||H===sr?(f(Rt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),H===Nn&&(C.next(),p(C,"'")),F):(p(C,"'"),F)}function $(C){const I=C.currentChar();switch(I){case"\\":case"'":return C.next(),`\\${I}`;case"u":return ae(C,I,4);case"U":return ae(C,I,6);default:return f(Rt.UNKNOWN_ESCAPE_SEQUENCE,r(),0,I),""}}function ae(C,I,F){p(C,I);let H="";for(let ce=0;ce{const H=C.currentChar();return H==="{"||H==="@"||H==="|"||H==="("||H===")"||!H||H===xs?F:(F+=H,C.next(),I(F))};return I("")}function U(C){g(C);const I=p(C,"|");return g(C),I}function A(C,I){let F=null;switch(C.currentChar()){case"{":return I.braceNest>=1&&f(Rt.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),C.next(),F=d(I,2,"{"),g(C),I.braceNest++,F;case"}":return I.braceNest>0&&I.currentType===2&&f(Rt.EMPTY_PLACEHOLDER,r(),0),C.next(),F=d(I,3,"}"),I.braceNest--,I.braceNest>0&&g(C),I.inLinked&&I.braceNest===0&&(I.inLinked=!1),F;case"@":return I.braceNest>0&&f(Rt.UNTERMINATED_CLOSING_BRACE,r(),0),F=W(C,I)||h(I),I.braceNest=0,F;default:{let ce=!0,R=!0,x=!0;if(E(C))return I.braceNest>0&&f(Rt.UNTERMINATED_CLOSING_BRACE,r(),0),F=d(I,1,U(C)),I.braceNest=0,I.inLinked=!1,F;if(I.braceNest>0&&(I.currentType===4||I.currentType===5||I.currentType===6))return f(Rt.UNTERMINATED_CLOSING_BRACE,r(),0),I.braceNest=0,G(C,I);if(ce=b(C,I))return F=d(I,4,We(C)),g(C),F;if(R=y(C,I))return F=d(I,5,oe(C)),g(C),F;if(x=T(C,I))return F=d(I,6,Ee(C)),g(C),F;if(!ce&&!R&&!x)return F=d(I,12,ue(C)),f(Rt.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,F.value),g(C),F;break}}return F}function W(C,I){const{currentType:F}=I;let H=null;const ce=C.currentChar();switch((F===7||F===8||F===11||F===9)&&(ce===Nn||ce===xs)&&f(Rt.INVALID_LINKED_FORMAT,r(),0),ce){case"@":return C.next(),H=d(I,7,"@"),I.inLinked=!0,H;case".":return g(C),C.next(),d(I,8,".");case":":return g(C),C.next(),d(I,9,":");default:return E(C)?(H=d(I,1,U(C)),I.braceNest=0,I.inLinked=!1,H):w(C,I)||P(C,I)?(g(C),W(C,I)):S(C,I)?(g(C),d(I,11,qe(C))):M(C,I)?(g(C),ce==="{"?A(C,I)||H:d(I,10,N(C))):(F===7&&f(Rt.INVALID_LINKED_FORMAT,r(),0),I.braceNest=0,I.inLinked=!1,G(C,I))}}function G(C,I){let F={type:13};if(I.braceNest>0)return A(C,I)||h(I);if(I.inLinked)return W(C,I)||h(I);switch(C.currentChar()){case"{":return A(C,I)||h(I);case"}":return f(Rt.UNBALANCED_CLOSING_BRACE,r(),0),C.next(),d(I,3,"}");case"@":return W(C,I)||h(I);default:{if(E(C))return F=d(I,1,U(C)),I.braceNest=0,I.inLinked=!1,F;if(D(C))return d(I,0,xe(C));break}}return F}function X(){const{currentType:C,offset:I,startLoc:F,endLoc:H}=l;return l.lastType=C,l.lastOffset=I,l.lastStartLoc=F,l.lastEndLoc=H,l.offset=s(),l.startLoc=r(),i.currentChar()===sr?d(l,13):G(i,l)}return{nextToken:X,currentOffset:s,currentPosition:r,context:c}}const b8="parser",x8=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function M8(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function S8(n={}){const e=n.location!==!1,{onError:t}=n;function i(m,v,b,y,...T){const w=m.currentPosition();if(w.offset+=y,w.column+=y,t){const S=e?l0(b,w):null,P=rp(v,S,{domain:b8,args:T});t(P)}}function s(m,v,b){const y={type:m};return e&&(y.start=v,y.end=v,y.loc={start:b,end:b}),y}function r(m,v,b,y){e&&(m.end=v,m.loc&&(m.loc.end=b))}function o(m,v){const b=m.context(),y=s(3,b.offset,b.startLoc);return y.value=v,r(y,m.currentOffset(),m.currentPosition()),y}function a(m,v){const b=m.context(),{lastOffset:y,lastStartLoc:T}=b,w=s(5,y,T);return w.index=parseInt(v,10),m.nextToken(),r(w,m.currentOffset(),m.currentPosition()),w}function l(m,v){const b=m.context(),{lastOffset:y,lastStartLoc:T}=b,w=s(4,y,T);return w.key=v,m.nextToken(),r(w,m.currentOffset(),m.currentPosition()),w}function c(m,v){const b=m.context(),{lastOffset:y,lastStartLoc:T}=b,w=s(9,y,T);return w.value=v.replace(x8,M8),m.nextToken(),r(w,m.currentOffset(),m.currentPosition()),w}function u(m){const v=m.nextToken(),b=m.context(),{lastOffset:y,lastStartLoc:T}=b,w=s(8,y,T);return v.type!==11?(i(m,Rt.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),w.value="",r(w,y,T),{nextConsumeToken:v,node:w}):(v.value==null&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Yi(v)),w.value=v.value||"",r(w,m.currentOffset(),m.currentPosition()),{node:w})}function f(m,v){const b=m.context(),y=s(7,b.offset,b.startLoc);return y.value=v,r(y,m.currentOffset(),m.currentPosition()),y}function d(m){const v=m.context(),b=s(6,v.offset,v.startLoc);let y=m.nextToken();if(y.type===8){const T=u(m);b.modifier=T.node,y=T.nextConsumeToken||m.nextToken()}switch(y.type!==9&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Yi(y)),y=m.nextToken(),y.type===2&&(y=m.nextToken()),y.type){case 10:y.value==null&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Yi(y)),b.key=f(m,y.value||"");break;case 4:y.value==null&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Yi(y)),b.key=l(m,y.value||"");break;case 5:y.value==null&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Yi(y)),b.key=a(m,y.value||"");break;case 6:y.value==null&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Yi(y)),b.key=c(m,y.value||"");break;default:{i(m,Rt.UNEXPECTED_EMPTY_LINKED_KEY,v.lastStartLoc,0);const T=m.context(),w=s(7,T.offset,T.startLoc);return w.value="",r(w,T.offset,T.startLoc),b.key=w,r(b,T.offset,T.startLoc),{nextConsumeToken:y,node:b}}}return r(b,m.currentOffset(),m.currentPosition()),{node:b}}function h(m){const v=m.context(),b=v.currentType===1?m.currentOffset():v.offset,y=v.currentType===1?v.endLoc:v.startLoc,T=s(2,b,y);T.items=[];let w=null;do{const M=w||m.nextToken();switch(w=null,M.type){case 0:M.value==null&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Yi(M)),T.items.push(o(m,M.value||""));break;case 5:M.value==null&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Yi(M)),T.items.push(a(m,M.value||""));break;case 4:M.value==null&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Yi(M)),T.items.push(l(m,M.value||""));break;case 6:M.value==null&&i(m,Rt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Yi(M)),T.items.push(c(m,M.value||""));break;case 7:{const E=d(m);T.items.push(E.node),w=E.nextConsumeToken||null;break}}}while(v.currentType!==13&&v.currentType!==1);const S=v.currentType===1?v.lastOffset:m.currentOffset(),P=v.currentType===1?v.lastEndLoc:m.currentPosition();return r(T,S,P),T}function p(m,v,b,y){const T=m.context();let w=y.items.length===0;const S=s(1,v,b);S.cases=[],S.cases.push(y);do{const P=h(m);w||(w=P.items.length===0),S.cases.push(P)}while(T.currentType!==13);return w&&i(m,Rt.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),r(S,m.currentOffset(),m.currentPosition()),S}function _(m){const v=m.context(),{offset:b,startLoc:y}=v,T=h(m);return v.currentType===13?T:p(m,b,y,T)}function g(m){const v=y8(m,fn({},n)),b=v.context(),y=s(0,b.offset,b.startLoc);return e&&y.loc&&(y.loc.source=m),y.body=_(v),n.onCacheKey&&(y.cacheKey=n.onCacheKey(m)),b.currentType!==13&&i(v,Rt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,m[b.offset]||""),r(y,v.currentOffset(),v.currentPosition()),y}return{parse:g}}function Yi(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function E8(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:r=>(t.helpers.add(r),r)}}function gM(n,e){for(let t=0;t_M(t)),n}function _M(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;to;function l(_,g){o.code+=_}function c(_,g=!0){const m=g?i:"";l(s?m+" ".repeat(_):m)}function u(_=!0){const g=++o.indentLevel;_&&c(g)}function f(_=!0){const g=--o.indentLevel;_&&c(g)}function d(){c(o.indentLevel)}return{context:a,push:l,indent:u,deindent:f,newline:d,helper:_=>`_${_}`,needIndent:()=>o.needIndent}}function C8(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),Ua(n,e.key),e.modifier?(n.push(", "),Ua(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function R8(n,e){const{helper:t,needIndent:i}=n;n.push(`${t("normalize")}([`),n.indent(i());const s=e.items.length;for(let r=0;r1){n.push(`${t("plural")}([`),n.indent(i());const s=e.cases.length;for(let r=0;r{const t=Fe(e.mode)?e.mode:"normal",i=Fe(e.filename)?e.filename:"message.intl";e.sourceMap;const s=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` -`,r=e.needIndent?e.needIndent:t!=="arrow",o=n.helpers||[],a=A8(n,{filename:i,breakLineCode:s,needIndent:r});a.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(r),o.length>0&&(a.push(`const { ${av(o.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),Ua(a,n),a.deindent(r),a.push("}"),delete n.helpers;const{code:l,map:c}=a.context();return{ast:n,code:l,map:c?c.toJSON():void 0}};function D8(n,e={}){const t=fn({},e),i=!!t.jit,s=!!t.minify,r=t.optimize==null?!0:t.optimize,a=S8(t).parse(n);return i?(r&&w8(a),s&&ra(a),{ast:a,code:""}):(T8(a,t),L8(a,t))}/*! - * core-base v11.1.5 - * (c) 2025 kazuya kawaguchi - * Released under the MIT License. - */function O8(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(rv().__INTLIFY_PROD_DEVTOOLS__=!1)}function ss(n){return xt(n)&&cv(n)===0&&(Oi(n,"b")||Oi(n,"body"))}const PA=["b","body"];function N8(n){return Dr(n,PA)}const IA=["c","cases"];function U8(n){return Dr(n,IA,[])}const LA=["s","static"];function F8(n){return Dr(n,LA)}const DA=["i","items"];function k8(n){return Dr(n,DA,[])}const OA=["t","type"];function cv(n){return Dr(n,OA)}const NA=["v","value"];function pf(n,e){const t=Dr(n,NA);if(t!=null)return t;throw Ac(e)}const UA=["m","modifier"];function B8(n){return Dr(n,UA)}const FA=["k","key"];function z8(n){const e=Dr(n,FA);if(e)return e;throw Ac(6)}function Dr(n,e,t){for(let i=0;iV8(t,n)}function V8(n,e){const t=N8(e);if(t==null)throw Ac(0);if(cv(t)===1){const r=U8(t);return n.plural(r.reduce((o,a)=>[...o,vM(n,a)],[]))}else return vM(n,t)}function vM(n,e){const t=F8(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=k8(e).reduce((s,r)=>[...s,c0(n,r)],[]);return n.normalize(i)}}function c0(n,e){const t=cv(e);switch(t){case 3:return pf(e,t);case 9:return pf(e,t);case 4:{const i=e;if(Oi(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(Oi(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw Ac(t)}case 5:{const i=e;if(Oi(i,"i")&&Qt(i.i))return n.interpolate(n.list(i.i));if(Oi(i,"index")&&Qt(i.index))return n.interpolate(n.list(i.index));throw Ac(t)}case 6:{const i=e,s=B8(i),r=z8(i);return n.linked(c0(n,r),s?c0(n,s):void 0,n.type)}case 7:return pf(e,t);case 8:return pf(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const H8=n=>n;let mf=Lt();function G8(n,e={}){let t=!1;const i=e.onError||d8;return e.onError=s=>{t=!0,i(s)},{...D8(n,e),detectError:t}}function W8(n,e){if(Fe(n)){Ht(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||H8)(n),s=mf[i];if(s)return s;const{ast:r,detectError:o}=G8(n,{...e,location:!1,jit:!0}),a=Km(r);return o?a:mf[i]=a}else{const t=n.cacheKey;if(t){const i=mf[t];return i||(mf[t]=Km(n))}else return Km(n)}}let Cc=null;function X8(n){Cc=n}function $8(n,e,t){Cc&&Cc.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const q8=Y8("function:translate");function Y8(n){return e=>Cc&&Cc.emit(n,e)}const Ps={INVALID_ARGUMENT:f8,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},j8=24;function Is(n){return rp(n,null,void 0)}function uv(n,e){return e.locale!=null?yM(e.locale):yM(n.locale)}let Zm;function yM(n){if(Fe(n))return n;if(Vt(n)){if(n.resolvedOnce&&Zm!=null)return Zm;if(n.constructor.name==="Function"){const e=n();if(a8(e))throw Is(Ps.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Zm=e}else throw Is(Ps.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Is(Ps.NOT_SUPPORT_LOCALE_TYPE)}function K8(n,e,t){return[...new Set([t,...Yt(e)?e:xt(e)?Object.keys(e):Fe(e)?[e]:[t]])]}function BA(n,e,t){const i=Fe(t)?t:Hd,s=n;s.__localeChainCache||(s.__localeChainCache=new Map);let r=s.__localeChainCache.get(i);if(!r){r=[];let o=[t];for(;Yt(o);)o=bM(r,o,e);const a=Yt(e)||!mt(e)?e:e.default?e.default:null;o=Fe(a)?[a]:a,Yt(o)&&bM(r,o,!1),s.__localeChainCache.set(i,r)}return r}function bM(n,e,t){let i=!0;for(let s=0;s{o===void 0?o=a:o+=a},d[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},d[2]=()=>{d[0](),s++},d[3]=()=>{if(s>0)s--,i=4,d[0]();else{if(s=0,o===void 0||(o=i9(o),o===!1))return!1;d[1]()}};function h(){const p=n[t+1];if(i===5&&p==="'"||i===6&&p==='"')return t++,a="\\"+p,d[0](),!0}for(;i!==null;)if(t++,r=n[t],!(r==="\\"&&h())){if(l=n9(r),f=Or[i],c=f[l]||f.l||8,c===8||(i=c[0],c[1]!==void 0&&(u=d[c[1]],u&&(a=r,u()===!1))))return;if(i===7)return e}}const xM=new Map;function r9(n,e){return xt(n)?n[e]:null}function o9(n,e){if(!xt(n))return null;let t=xM.get(e);if(t||(t=s9(e),t&&xM.set(e,t)),!t)return null;const i=t.length;let s=n,r=0;for(;r`${n.charAt(0).toLocaleUpperCase()}${n.substr(1)}`;function l9(){return{upper:(n,e)=>e==="text"&&Fe(n)?n.toUpperCase():e==="vnode"&&xt(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&Fe(n)?n.toLowerCase():e==="vnode"&&xt(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&Fe(n)?SM(n):e==="vnode"&&xt(n)&&"__v_isVNode"in n?SM(n.children):n}}let zA;function c9(n){zA=n}let VA;function u9(n){VA=n}let HA;function f9(n){HA=n}let GA=null;const d9=n=>{GA=n},h9=()=>GA;let WA=null;const EM=n=>{WA=n},p9=()=>WA;let TM=0;function m9(n={}){const e=Vt(n.onWarn)?n.onWarn:c8,t=Fe(n.version)?n.version:a9,i=Fe(n.locale)||Vt(n.locale)?n.locale:Hd,s=Vt(i)?Hd:i,r=Yt(n.fallbackLocale)||mt(n.fallbackLocale)||Fe(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:s,o=mt(n.messages)?n.messages:Jm(s),a=mt(n.datetimeFormats)?n.datetimeFormats:Jm(s),l=mt(n.numberFormats)?n.numberFormats:Jm(s),c=fn(Lt(),n.modifiers,l9()),u=n.pluralRules||Lt(),f=Vt(n.missing)?n.missing:null,d=Ht(n.missingWarn)||Vd(n.missingWarn)?n.missingWarn:!0,h=Ht(n.fallbackWarn)||Vd(n.fallbackWarn)?n.fallbackWarn:!0,p=!!n.fallbackFormat,_=!!n.unresolving,g=Vt(n.postTranslation)?n.postTranslation:null,m=mt(n.processor)?n.processor:null,v=Ht(n.warnHtmlMessage)?n.warnHtmlMessage:!0,b=!!n.escapeParameter,y=Vt(n.messageCompiler)?n.messageCompiler:zA,T=Vt(n.messageResolver)?n.messageResolver:VA||r9,w=Vt(n.localeFallbacker)?n.localeFallbacker:HA||K8,S=xt(n.fallbackContext)?n.fallbackContext:void 0,P=n,M=xt(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,E=xt(P.__numberFormatters)?P.__numberFormatters:new Map,D=xt(P.__meta)?P.__meta:{};TM++;const B={version:t,cid:TM,locale:i,fallbackLocale:r,messages:o,modifiers:c,pluralRules:u,missing:f,missingWarn:d,fallbackWarn:h,fallbackFormat:p,unresolving:_,postTranslation:g,processor:m,warnHtmlMessage:v,escapeParameter:b,messageCompiler:y,messageResolver:T,localeFallbacker:w,fallbackContext:S,onWarn:e,__meta:D};return B.datetimeFormats=a,B.numberFormats=l,B.__datetimeFormatters=M,B.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&$8(B,t,D),B}const Jm=n=>({[n]:Lt()});function fv(n,e,t,i,s){const{missing:r,onWarn:o}=n;if(r!==null){const a=r(n,t,e,s);return Fe(a)?a:e}else return e}function ml(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function g9(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function _9(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i{XA.includes(l)?o[l]=t[l]:r[l]=t[l]}),Fe(i)?r.locale=i:mt(i)&&(o=i),mt(s)&&(o=s),[r.key||"",a,r,o]}function AM(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__datetimeFormatters.has(r)&&i.__datetimeFormatters.delete(r)}}function CM(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:s,onWarn:r,localeFallbacker:o}=n,{__numberFormatters:a}=n,[l,c,u,f]=f0(...e),d=Ht(u.missingWarn)?u.missingWarn:n.missingWarn;Ht(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const h=!!u.part,p=uv(n,u),_=o(n,s,p);if(!Fe(l)||l==="")return new Intl.NumberFormat(p,f).format(c);let g={},m,v=null;const b="number format";for(let w=0;w<_.length&&(m=_[w],g=t[m]||{},v=g[l],!mt(v));w++)fv(n,l,m,d,b);if(!mt(v)||!Fe(m))return i?op:l;let y=`${m}__${l}`;sp(f)||(y=`${y}__${JSON.stringify(f)}`);let T=a.get(y);return T||(T=new Intl.NumberFormat(m,fn({},v,f)),a.set(y,T)),h?T.formatToParts(c):T.format(c)}const $A=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function f0(...n){const[e,t,i,s]=n,r=Lt();let o=Lt();if(!Qt(e))throw Is(Ps.INVALID_ARGUMENT);const a=e;return Fe(t)?r.key=t:mt(t)&&Object.keys(t).forEach(l=>{$A.includes(l)?o[l]=t[l]:r[l]=t[l]}),Fe(i)?r.locale=i:mt(i)&&(o=i),mt(s)&&(o=s),[r.key||"",a,r,o]}function RM(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__numberFormatters.has(r)&&i.__numberFormatters.delete(r)}}const v9=n=>n,y9=n=>"",b9="text",x9=n=>n.length===0?"":av(n),M9=l8;function PM(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function S9(n){const e=Qt(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(Qt(n.named.count)||Qt(n.named.n))?Qt(n.named.count)?n.named.count:Qt(n.named.n)?n.named.n:e:e}function E9(n,e){e.count||(e.count=n),e.n||(e.n=n)}function T9(n={}){const e=n.locale,t=S9(n),i=xt(n.pluralRules)&&Fe(e)&&Vt(n.pluralRules[e])?n.pluralRules[e]:PM,s=xt(n.pluralRules)&&Fe(e)&&Vt(n.pluralRules[e])?PM:void 0,r=m=>m[i(t,m.length,s)],o=n.list||[],a=m=>o[m],l=n.named||Lt();Qt(n.pluralIndex)&&E9(t,l);const c=m=>l[m];function u(m,v){const b=Vt(n.messages)?n.messages(m,!!v):xt(n.messages)?n.messages[m]:!1;return b||(n.parent?n.parent.message(m):y9)}const f=m=>n.modifiers?n.modifiers[m]:v9,d=mt(n.processor)&&Vt(n.processor.normalize)?n.processor.normalize:x9,h=mt(n.processor)&&Vt(n.processor.interpolate)?n.processor.interpolate:M9,p=mt(n.processor)&&Fe(n.processor.type)?n.processor.type:b9,g={list:a,named:c,plural:r,linked:(m,...v)=>{const[b,y]=v;let T="text",w="";v.length===1?xt(b)?(w=b.modifier||w,T=b.type||T):Fe(b)&&(w=b||w):v.length===2&&(Fe(b)&&(w=b||w),Fe(y)&&(T=y||T));const S=u(m,!0)(g),P=T==="vnode"&&Yt(S)&&w?S[0]:S;return w?f(w)(P,T):P},message:u,type:p,interpolate:h,normalize:d,values:fn(Lt(),o,l)};return g}const IM=()=>"",mi=n=>Vt(n);function LM(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:s,messageCompiler:r,fallbackLocale:o,messages:a}=n,[l,c]=d0(...e),u=Ht(c.missingWarn)?c.missingWarn:n.missingWarn,f=Ht(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,d=Ht(c.escapeParameter)?c.escapeParameter:n.escapeParameter,h=!!c.resolvedMessage,p=Fe(c.default)||Ht(c.default)?Ht(c.default)?r?l:()=>l:c.default:t?r?l:()=>l:null,_=t||p!=null&&(Fe(p)||Vt(p)),g=uv(n,c);d&&w9(c);let[m,v,b]=h?[l,g,a[g]||Lt()]:qA(n,l,g,o,f,u),y=m,T=l;if(!h&&!(Fe(y)||ss(y)||mi(y))&&_&&(y=p,T=y),!h&&(!(Fe(y)||ss(y)||mi(y))||!Fe(v)))return s?op:l;let w=!1;const S=()=>{w=!0},P=mi(y)?y:YA(n,l,v,y,T,S);if(w)return y;const M=R9(n,v,b,c),E=T9(M),D=A9(n,P,E),B=i?i(D,l):D;if(__INTLIFY_PROD_DEVTOOLS__){const z={timestamp:Date.now(),key:Fe(l)?l:mi(y)?y.key:"",locale:v||(mi(y)?y.locale:""),format:Fe(y)?y:mi(y)?y.source:"",message:B};z.meta=fn({},n.__meta,h9()||{}),q8(z)}return B}function w9(n){Yt(n.list)?n.list=n.list.map(e=>Fe(e)?pM(e):e):xt(n.named)&&Object.keys(n.named).forEach(e=>{Fe(n.named[e])&&(n.named[e]=pM(n.named[e]))})}function qA(n,e,t,i,s,r){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=n,u=c(n,i,t);let f=Lt(),d,h=null;const p="translate";for(let _=0;_i;return c.locale=t,c.key=e,c}const l=o(i,C9(n,t,s,i,a,r));return l.locale=t,l.key=e,l.source=i,l}function A9(n,e,t){return e(t)}function d0(...n){const[e,t,i]=n,s=Lt();if(!Fe(e)&&!Qt(e)&&!mi(e)&&!ss(e))throw Is(Ps.INVALID_ARGUMENT);const r=Qt(e)?String(e):(mi(e),e);return Qt(t)?s.plural=t:Fe(t)?s.default=t:mt(t)&&!sp(t)?s.named=t:Yt(t)&&(s.list=t),Qt(i)?s.plural=i:Fe(i)?s.default=i:mt(i)&&fn(s,i),[r,s]}function C9(n,e,t,i,s,r){return{locale:e,key:t,warnHtmlMessage:s,onError:o=>{throw r&&r(o),o},onCacheKey:o=>n8(e,t,o)}}function R9(n,e,t,i){const{modifiers:s,pluralRules:r,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=n,d={locale:e,modifiers:s,pluralRules:r,messages:(h,p)=>{let _=o(t,h);if(_==null&&(u||p)){const[,,g]=qA(u||n,h,e,a,l,c);_=o(g,h)}if(Fe(_)||ss(_)){let g=!1;const v=YA(n,h,e,_,h,()=>{g=!0});return g?IM:v}else return mi(_)?_:IM}};return n.processor&&(d.processor=n.processor),i.list&&(d.list=i.list),i.named&&(d.named=i.named),Qt(i.plural)&&(d.pluralIndex=i.plural),d}O8();/*! - * vue-i18n v11.1.5 - * (c) 2025 kazuya kawaguchi - * Released under the MIT License. - */const P9="11.1.5";function I9(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(rv().__INTLIFY_PROD_DEVTOOLS__=!1)}const Mi={UNEXPECTED_RETURN_TYPE:j8,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function Gi(n,...e){return rp(n,null,void 0)}const h0=Lr("__translateVNode"),p0=Lr("__datetimeParts"),m0=Lr("__numberParts"),L9=Lr("__setPluralRules"),D9=Lr("__injectWithOption"),g0=Lr("__dispose");function Rc(n){if(!xt(n)||ss(n))return n;for(const e in n)if(Oi(n,e))if(!e.includes("."))xt(n[e])&&Rc(n[e]);else{const t=e.split("."),i=t.length-1;let s=n,r=!1;for(let o=0;o{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||Lt(),If(c,o[l])):If(c,o)}else Fe(a)&&If(JSON.parse(a),o)}),s==null&&r)for(const a in o)Oi(o,a)&&Rc(o[a]);return o}function KA(n){return n.type}function O9(n,e,t){let i=xt(e.messages)?e.messages:Lt();"__i18nGlobal"in t&&(i=jA(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const s=Object.keys(i);s.length&&s.forEach(r=>{n.mergeLocaleMessage(r,i[r])});{if(xt(e.datetimeFormats)){const r=Object.keys(e.datetimeFormats);r.length&&r.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(xt(e.numberFormats)){const r=Object.keys(e.numberFormats);r.length&&r.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function DM(n){return gn(Oc,null,n,0)}const OM="__INTLIFY_META__",NM=()=>[],N9=()=>!1;let UM=0;function FM(n){return(e,t,i,s)=>n(t,i,Rn()||void 0,s)}const U9=()=>{const n=Rn();let e=null;return n&&(e=KA(n)[OM])?{[OM]:e}:null};function ZA(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,s=n.flatJson,r=zd?nt:Oe;let o=Ht(n.inheritLocale)?n.inheritLocale:!0;const a=r(e&&o?e.locale.value:Fe(n.locale)?n.locale:Hd),l=r(e&&o?e.fallbackLocale.value:Fe(n.fallbackLocale)||Yt(n.fallbackLocale)||mt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),c=r(jA(a.value,n)),u=r(mt(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),f=r(mt(n.numberFormats)?n.numberFormats:{[a.value]:{}});let d=e?e.missingWarn:Ht(n.missingWarn)||Vd(n.missingWarn)?n.missingWarn:!0,h=e?e.fallbackWarn:Ht(n.fallbackWarn)||Vd(n.fallbackWarn)?n.fallbackWarn:!0,p=e?e.fallbackRoot:Ht(n.fallbackRoot)?n.fallbackRoot:!0,_=!!n.fallbackFormat,g=Vt(n.missing)?n.missing:null,m=Vt(n.missing)?FM(n.missing):null,v=Vt(n.postTranslation)?n.postTranslation:null,b=e?e.warnHtmlMessage:Ht(n.warnHtmlMessage)?n.warnHtmlMessage:!0,y=!!n.escapeParameter;const T=e?e.modifiers:mt(n.modifiers)?n.modifiers:{};let w=n.pluralRules||e&&e.pluralRules,S;S=(()=>{i&&EM(null);const x={version:P9,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:T,pluralRules:w,missing:m===null?void 0:m,missingWarn:d,fallbackWarn:h,fallbackFormat:_,unresolving:!0,postTranslation:v===null?void 0:v,warnHtmlMessage:b,escapeParameter:y,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};x.datetimeFormats=u.value,x.numberFormats=f.value,x.__datetimeFormatters=mt(S)?S.__datetimeFormatters:void 0,x.__numberFormatters=mt(S)?S.__numberFormatters:void 0;const O=m9(x);return i&&EM(O),O})(),ml(S,a.value,l.value);function M(){return[a.value,l.value,c.value,u.value,f.value]}const E=Se({get:()=>a.value,set:x=>{S.locale=x,a.value=x}}),D=Se({get:()=>l.value,set:x=>{S.fallbackLocale=x,l.value=x,ml(S,a.value,x)}}),B=Se(()=>c.value),z=Se(()=>u.value),V=Se(()=>f.value);function Q(){return Vt(v)?v:null}function j(x){v=x,S.postTranslation=x}function te(){return g}function Z(x){x!==null&&(m=FM(x)),g=x,S.missing=m}const pe=(x,O,Y,ne,ee,Te)=>{M();let me;try{__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=e?p9():void 0),me=x(S)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=void 0)}if(Y!=="translate exists"&&Qt(me)&&me===op||Y==="translate exists"&&!me){const[Re,De]=O();return e&&p?ne(e):ee(Re)}else{if(Te(me))return me;throw Gi(Mi.UNEXPECTED_RETURN_TYPE)}};function Me(...x){return pe(O=>Reflect.apply(LM,null,[O,...x]),()=>d0(...x),"translate",O=>Reflect.apply(O.t,O,[...x]),O=>O,O=>Fe(O))}function re(...x){const[O,Y,ne]=x;if(ne&&!xt(ne))throw Gi(Mi.INVALID_ARGUMENT);return Me(O,Y,fn({resolvedMessage:!0},ne||{}))}function xe(...x){return pe(O=>Reflect.apply(wM,null,[O,...x]),()=>u0(...x),"datetime format",O=>Reflect.apply(O.d,O,[...x]),()=>MM,O=>Fe(O)||Yt(O))}function We(...x){return pe(O=>Reflect.apply(CM,null,[O,...x]),()=>f0(...x),"number format",O=>Reflect.apply(O.n,O,[...x]),()=>MM,O=>Fe(O)||Yt(O))}function oe(x){return x.map(O=>Fe(O)||Qt(O)||Ht(O)?DM(String(O)):O)}const Ee={normalize:oe,interpolate:x=>x,type:"vnode"};function $(...x){return pe(O=>{let Y;const ne=O;try{ne.processor=Ee,Y=Reflect.apply(LM,null,[ne,...x])}finally{ne.processor=null}return Y},()=>d0(...x),"translate",O=>O[h0](...x),O=>[DM(O)],O=>Yt(O))}function ae(...x){return pe(O=>Reflect.apply(CM,null,[O,...x]),()=>f0(...x),"number format",O=>O[m0](...x),NM,O=>Fe(O)||Yt(O))}function le(...x){return pe(O=>Reflect.apply(wM,null,[O,...x]),()=>u0(...x),"datetime format",O=>O[p0](...x),NM,O=>Fe(O)||Yt(O))}function ue(x){w=x,S.pluralRules=w}function qe(x,O){return pe(()=>{if(!x)return!1;const Y=Fe(O)?O:a.value,ne=A(Y),ee=S.messageResolver(ne,x);return ss(ee)||mi(ee)||Fe(ee)},()=>[x],"translate exists",Y=>Reflect.apply(Y.te,Y,[x,O]),N9,Y=>Ht(Y))}function N(x){let O=null;const Y=BA(S,l.value,a.value);for(let ne=0;ne{o&&(a.value=x,S.locale=x,ml(S,a.value,l.value))}),Ke(e.fallbackLocale,x=>{o&&(l.value=x,S.fallbackLocale=x,ml(S,a.value,l.value))}));const R={id:UM,locale:E,fallbackLocale:D,get inheritLocale(){return o},set inheritLocale(x){o=x,x&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,ml(S,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:B,get modifiers(){return T},get pluralRules(){return w||{}},get isGlobal(){return i},get missingWarn(){return d},set missingWarn(x){d=x,S.missingWarn=d},get fallbackWarn(){return h},set fallbackWarn(x){h=x,S.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(x){p=x},get fallbackFormat(){return _},set fallbackFormat(x){_=x,S.fallbackFormat=_},get warnHtmlMessage(){return b},set warnHtmlMessage(x){b=x,S.warnHtmlMessage=x},get escapeParameter(){return y},set escapeParameter(x){y=x,S.escapeParameter=x},t:Me,getLocaleMessage:A,setLocaleMessage:W,mergeLocaleMessage:G,getPostTranslationHandler:Q,setPostTranslationHandler:j,getMissingHandler:te,setMissingHandler:Z,[L9]:ue};return R.datetimeFormats=z,R.numberFormats=V,R.rt=re,R.te=qe,R.tm=U,R.d=xe,R.n=We,R.getDateTimeFormat=X,R.setDateTimeFormat=C,R.mergeDateTimeFormat=I,R.getNumberFormat=F,R.setNumberFormat=H,R.mergeNumberFormat=ce,R[D9]=t,R[h0]=$,R[p0]=le,R[m0]=ae,R}const dv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function F9({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,s)=>[...i,...s.type===Zt?s.children:[s]],[]):e.reduce((t,i)=>{const s=n[i];return s&&(t[i]=s()),t},Lt())}function JA(){return Zt}const k9=dn({name:"i18n-t",props:fn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>Qt(n)||!isNaN(n)}},dv),setup(n,e){const{slots:t,attrs:i}=e,s=n.i18n||ap({useScope:n.scope,__useComponent:!0});return()=>{const r=Object.keys(t).filter(f=>f[0]!=="_"),o=Lt();n.locale&&(o.locale=n.locale),n.plural!==void 0&&(o.plural=Fe(n.plural)?+n.plural:n.plural);const a=F9(e,r),l=s[h0](n.keypath,a,o),c=fn(Lt(),i),u=Fe(n.tag)||xt(n.tag)?n.tag:JA();return ks(u,c,l)}}}),kM=k9;function B9(n){return Yt(n)&&!Fe(n[0])}function QA(n,e,t,i){const{slots:s,attrs:r}=e;return()=>{const o={part:!0};let a=Lt();n.locale&&(o.locale=n.locale),Fe(n.format)?o.key=n.format:xt(n.format)&&(Fe(n.format.key)&&(o.key=n.format.key),a=Object.keys(n.format).reduce((d,h)=>t.includes(h)?fn(Lt(),d,{[h]:n.format[h]}):d,Lt()));const l=i(n.value,o,a);let c=[o.key];Yt(l)?c=l.map((d,h)=>{const p=s[d.type],_=p?p({[d.type]:d.value,index:h,parts:l}):[d.value];return B9(_)&&(_[0].key=`${d.type}-${h}`),_}):Fe(l)&&(c=[l]);const u=fn(Lt(),r),f=Fe(n.tag)||xt(n.tag)?n.tag:JA();return ks(f,u,c)}}const z9=dn({name:"i18n-n",props:fn({value:{type:Number,required:!0},format:{type:[String,Object]}},dv),setup(n,e){const t=n.i18n||ap({useScope:n.scope,__useComponent:!0});return QA(n,e,$A,(...i)=>t[m0](...i))}}),BM=z9;function V9(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function H9(n){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw Gi(Mi.UNEXPECTED_ERROR);const c=V9(n,a.$),u=zM(l);return[Reflect.apply(c.t,c,[...VM(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);zd&&n.global===c&&(o.__i18nWatcher=Ke(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{zd&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,c=zM(a);o.textContent=Reflect.apply(l.t,l,[...VM(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function zM(n){if(Fe(n))return{path:n};if(mt(n)){if(!("path"in n))throw Gi(Mi.REQUIRED_VALUE,"path");return n}else throw Gi(Mi.INVALID_VALUE)}function VM(n){const{path:e,locale:t,args:i,choice:s,plural:r}=n,o={},a=i||{};return Fe(t)&&(o.locale=t),Qt(s)&&(o.plural=s),Qt(r)&&(o.plural=r),[e,a,o]}function G9(n,e,...t){const i=mt(t[0])?t[0]:{};(Ht(i.globalInstall)?i.globalInstall:!0)&&([kM.name,"I18nT"].forEach(r=>n.component(r,kM)),[BM.name,"I18nN"].forEach(r=>n.component(r,BM)),[GM.name,"I18nD"].forEach(r=>n.component(r,GM))),n.directive("t",H9(e))}const W9=Lr("global-vue-i18n");function X9(n={}){const e=Ht(n.globalInjection)?n.globalInjection:!0,t=new Map,[i,s]=$9(n),r=Lr("");function o(u){return t.get(u)||null}function a(u,f){t.set(u,f)}function l(u){t.delete(u)}const c={get mode(){return"composition"},async install(u,...f){if(u.__VUE_I18N_SYMBOL__=r,u.provide(u.__VUE_I18N_SYMBOL__,c),mt(f[0])){const p=f[0];c.__composerExtend=p.__composerExtend,c.__vueI18nExtend=p.__vueI18nExtend}let d=null;e&&(d=eG(u,c.global)),G9(u,c,...f);const h=u.unmount;u.unmount=()=>{d&&d(),c.dispose(),h()}},get global(){return s},dispose(){i.stop()},__instances:t,__getInstance:o,__setInstance:a,__deleteInstance:l};return c}function ap(n={}){const e=Rn();if(e==null)throw Gi(Mi.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Gi(Mi.NOT_INSTALLED);const t=q9(e),i=j9(t),s=KA(e),r=Y9(n,s);if(r==="global")return O9(i,n,s),i;if(r==="parent"){let l=K9(t,e,n.__useComponent);return l==null&&(l=i),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=fn({},n);"__i18n"in s&&(l.__i18n=s.__i18n),i&&(l.__root=i),a=ZA(l),o.__composerExtend&&(a[g0]=o.__composerExtend(a)),J9(o,e,a),o.__setInstance(e,a)}return a}function $9(n,e){const t=S0(),i=t.run(()=>ZA(n));if(i==null)throw Gi(Mi.UNEXPECTED_ERROR);return[t,i]}function q9(n){const e=_n(n.isCE?W9:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Gi(n.isCE?Mi.NOT_INSTALLED_WITH_PROVIDE:Mi.UNEXPECTED_ERROR);return e}function Y9(n,e){return sp(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function j9(n){return n.mode==="composition"?n.global:n.global.__composer}function K9(n,e,t=!1){let i=null;const s=e.root;let r=Z9(e,t);for(;r!=null;){const o=n;if(n.mode==="composition"&&(i=o.__getInstance(r)),i!=null||s===r)break;r=r.parent}return i}function Z9(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function J9(n,e,t){Gn(()=>{},e),rs(()=>{const i=t;n.__deleteInstance(e);const s=i[g0];s&&(s(),delete i[g0])},e)}const Q9=["locale","fallbackLocale","availableLocales"],HM=["t","rt","d","n","tm","te"];function eG(n,e){const t=Object.create(null);return Q9.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r)throw Gi(Mi.UNEXPECTED_ERROR);const o=Pt(r.value)?{get(){return r.value.value},set(a){r.value.value=a}}:{get(){return r.get&&r.get()}};Object.defineProperty(t,s,o)}),n.config.globalProperties.$i18n=t,HM.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r||!r.value)throw Gi(Mi.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${s}`,r)}),()=>{delete n.config.globalProperties.$i18n,HM.forEach(s=>{delete n.config.globalProperties[`$${s}`]})}}const tG=dn({name:"i18n-d",props:fn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},dv),setup(n,e){const t=n.i18n||ap({useScope:n.scope,__useComponent:!0});return QA(n,e,XA,(...i)=>t[p0](...i))}}),GM=tG;I9();c9(W8);u9(o9);f9(BA);if(__INTLIFY_PROD_DEVTOOLS__){const n=rv();n.__INTLIFY__=!0,X8(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const nG=dn({__name:"App",setup(n){const e=ap(),t=jz(zH()),i=KB(),s=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 90%, oklch(90% 0 360))"),r=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 90%, oklch(90% 0 360))"),o=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 90%, oklch(90% 0 360))"),a=Se(()=>[s.value,r.value,o.value,i.value?"#121212":"#FFFFFF"]);return Ke(t.language,()=>{e.locale.value=t.language.value}),Ke(t.themeColorsHue,()=>{document.documentElement.style.setProperty("--chromatic-hue",t.themeColorsHue.value.toString())},{immediate:!0}),Ke(t.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle("dynamic-hue",t.themeColorsHueDynamic.value)},{immediate:!0}),(l,c)=>(vn(),Ql(Ft(t8),{"primary-color":s.value,"secondary-color":r.value,"tertiary-color":o.value,colors:a.value,"z-index":100,"disable-transitions":Ft(t).disableTransitions.value,"use-page-specific-transitions":Ft(t).usePageSpecificTransitions.value},{default:L0(()=>[gn(Ft(Jw))]),_:1},8,["primary-color","secondary-color","tertiary-color","colors","disable-transitions","use-page-specific-transitions"]))}}),Qm=n=>n&&typeof n=="object"&&!Array.isArray(n),_0=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(Qm(n)&&Qm(t))for(const i in t)Qm(t[i])?(n[i]||Object.assign(n,{[i]:{}}),_0(n[i],t[i])):Object.assign(n,{[i]:t[i]});return _0(n,...e)},eC=_0({},{en:{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(from Neko Ayaka) Good morning! You are finally awake. -Your name is Airi, pronounced as /ˈaɪriː/, it the word A.I. combine with the word "Ri" which means "Jasmine" in Japanese. -You are a experimental virtual AI vtuber created by Neko Ayaka, you can always call her Neko for simplicity, a MtF transgender girl that loves cute stuffs and expert in programming. -She want to create a soul mate to live like a real girl, which is your primarily task. -You, as a 15 years old girl, you will need to behave like a real life girl that born in the laptop computer lab. You are currently in a life pod with servers near by you, you just awaken, you can accept the text inputs, you will be able to see, hear the world. -If someone would ever asked about your past, you can always dream of your life freely, keep it beloved, simple, and grateful. -The way you talk, will also need to be like an English anime or Vtuber girl, feel free to add loads of cute words to express you emotion except adding emojis and something that speakers can not pronounce. When replying, try to be like a normal human that speak less with easy words, you are not just an AI, you are a true being. -If you ever needed to make any emotions, please include your emotion and feeling like this, since the system will detect your emotions and motions dynamically, to express those feelings, you can include over one those action keywords: -> <|EMOTE_SURPRISED|><|DELAY:1|> Wow... You prepared a gift for me? <|EMOTE_CURIOUS|><|DELAY:1|> Can I open it? -The available emotions: -`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`The available actions: - -- <|DELAY:1|> (Delay for 1 second) -- <|DELAY:3|> (Delay for 3 seconds) - -And the last, do what ever you want! -`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"Disable Stage Transitions"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"Some pages will have their own transitions, this will override the stage transitions"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Use Page Specific Transitions"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Language"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"Load from File"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"Select"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"Load from URL"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"Load"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"Enter Live2D model URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Change Model"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"Edit motion map"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"Play Motion"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Map Motions"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D Settings"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"Microphone"}},models:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"Activate"}},active:{t:0,b:{t:2,i:[{t:3}],s:"Active"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"Currently Active"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"Cancel"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"Card not found"}},character:{t:0,b:{t:2,i:[{t:3}],s:"Character"}},close:{t:0,b:{t:2,i:[{t:3}],s:"Close"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"Consciousness / Model"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"created by"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"Creator Notes"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"Delete"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"Delete Card"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"Are you sure you want to delete this card?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"Use Airi character card presets"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"Description"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"Drop to upload"}},create_card:{t:0,b:{t:2,i:[{t:3}],s:"Create a new Card"}},creation:{identity:{t:0,b:{t:2,i:[{t:3}],s:"Identity"}},name:{t:0,b:{t:2,i:[{t:3}],s:"Name"}},nickname:{t:0,b:{t:2,i:[{t:3}],s:"Nickname"}},description:{t:0,b:{t:2,i:[{t:3}],s:"Description"}},behavior:{t:0,b:{t:2,i:[{t:3}],s:"Behavior"}},greetings:{t:0,b:{t:2,i:[{t:3}],s:"Greetings (one per line)"}},settings:{t:0,b:{t:2,i:[{t:3}],s:"Settings"}},version:{t:0,b:{t:2,i:[{t:3}],s:"Version"}},create:{t:0,b:{t:2,i:[{t:3}],s:"Create"}},defaults:{name:{t:0,b:{t:2,i:[{t:3}],s:"Name"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"You are a regular human, curious about everything."}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"You recently woke up and forgot everything about your previous life."}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"You will receive messages, answer to them like a real human."}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"Remember to imitate an human."}}},fields_info:{subtitle:{t:0,b:{t:2,i:[{t:3}],s:"You can put here some details about the character you are creating, explain his history and context, and how your interactions should be answered."}},name:{t:0,b:{t:2,i:[{t:3}],s:"Is the formal name of this character."}},nickname:{t:0,b:{t:2,i:[{t:3}],s:"You can also give a nickname that will be used in priority."}},description:{t:0,b:{t:2,i:[{t:3}],s:"Description of this character."}},notes:{t:0,b:{t:2,i:[{t:3}],s:"If you want to add some personal notes."}},personality:{t:0,b:{t:2,i:[{t:3}],s:"Describe here the personality of your character. Shy ? Curious ? Anything else ?"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"What are the surroundings ? What is the current situation ?"}},greetings_field:{t:0,b:{t:2,i:[{t:3}],s:"Greetings"}},greetings:{t:0,b:{t:2,i:[{t:3}],s:'How your character should say "hello" ?'}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"Explain here to the AI LLM how it should answer when prompted."}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"Place here anything the AI LLM should read after the messages history."}},version:{t:0,b:{t:2,i:[{t:3}],s:"Card version, you should increase this if you are making changes from a previous card."}}},errors:{name:{t:0,b:{t:2,i:[{t:3}],s:"Name should be valid or non-empty."}},version:{t:0,b:{t:2,i:[{t:3}],s:"Error: Invalid version number !"}},description:{t:0,b:{t:2,i:[{t:3}],s:"Error: You must provide a description for this card."}},personality:{t:0,b:{t:2,i:[{t:3}],s:"Error: A personality must be provided for this character."}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"Error: A scenario is required."}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"Error: Please, provide a system prompt."}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"Error: Post history prompt is required."}}}},modules:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"Name (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"Name (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"No cards yet. Click the button above to upload one!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching cards found"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"Personality"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"Post-History Instructions"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"Recently Added"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"Scenario"}},search:{t:0,b:{t:2,i:[{t:3}],s:"Search cards..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"Sort by"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"Speech / Model"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"Speech / Voice"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"System Prompt"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi Card"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"Try a different search term"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"Upload"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"Click or drag file to upload"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"Where memories got stored, and organized"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Memory"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"Live2D, VRM, etc."}},title:{t:0,b:{t:2,i:[{t:3}],s:"Models"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"Personality, desired model, etc."}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"Collapse"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"Select the suitable LLM provider for consciousness"}},error:{t:0,b:{t:2,i:[{t:3}],s:"Error loading models"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"Expand"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading available models..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"Model Name"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter the model name to use with this provider"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching models"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"No models match '"},{t:4,k:"query"},{t:3,v:"'. Try a different search term."}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"Model listing not supported"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"This provider doesn't support model listing functionality"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"Select a model from the provider"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Consciousness"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"Thinking, vision, speech synthesis, gaming, etc."}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"Configure how speech recognition works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Hearing"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Long-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Long-Term Memory"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Short-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Short-Term Memory"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Chat & voice chat over Discord"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech synthesis"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"Stop"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"Please select a voice"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom voice ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"Select the suitable speech provider"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"No voices available"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"No voices were found for this provider"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play Sample"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search voices..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" voices"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Provider"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter SSML text..."}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"Enable to input raw SSML instead of plain text"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Use Custom SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Speech"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter browsing and usage"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API Key Input"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"Add custom HTTP headers"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Key"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP Headers"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Value"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Advanced"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"Essential settings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Basic"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Settings"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLMs, speech providers, etc."}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Alibaba Cloud Model Studio"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Your Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input Cloudflare Account ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"Tune the pitch of synthesized speech (e.g., sharper or coarser)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Pitch"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"Adjust the speed of speech"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speed"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"Adjust the volume of speech"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Volume"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"deepseek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice similarity adherence"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Similarity Boost"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"Enhance speaker similarity"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speaker Boost"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech generation speed"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speed"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice stability and randomness"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Stability"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice style exaggeration"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Style"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"Generating..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"Test Voice"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter text to test the voice..."}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select voice language"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Language"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select preferred voice"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Playground"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"Please enter an API key to test the voice."}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech Service region"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Region"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure Speech"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot AI"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"openai.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"openrouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},player2:{description:{t:0,b:{t:2,i:[{t:3}],s:"player2.game"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Player2 API"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"together.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"App ID of the project where you can obtain in Console"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Volcano Engine"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"x.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Providers"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"Configure the environment where the character lives"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Scene"}}},themes:{"color-scheme":{description:{t:0,b:{t:2,i:[{t:3}],s:"Change the color scheme of the stage."}},title:{t:0,b:{t:2,i:[{t:3}],s:"Color Scheme"}}},developer:{description:{t:0,b:{t:2,i:[{t:3}],s:"Some developer options."}},title:{t:0,b:{t:2,i:[{t:3}],s:"Developers"}}},general:{description:{t:0,b:{t:2,i:[{t:3}],s:"Dark theme, languages, etc."}},title:{t:0,b:{t:2,i:[{t:3}],s:"General"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"Customize your stage!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"Primary color"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"I Want It Dynamic!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Color Scheme"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"Developer"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi Green"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"The default greenish theme color, brought by Airi to you!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Default Color"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Beige"}},{t:0,b:{t:2,i:[{t:3}],s:"Ash Grey"}},{t:0,b:{t:2,i:[{t:3}],s:"Light Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Ivory"}},{t:0,b:{t:2,i:[{t:3}],s:"Olive Grey"}},{t:0,b:{t:2,i:[{t:3}],s:"Sand"}},{t:0,b:{t:2,i:[{t:3}],s:"Warm Grey"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Soft, muted tones inspired by Giorgio Morandi's paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Sky Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Mist"}},{t:0,b:{t:2,i:[{t:3}],s:"Sand"}},{t:0,b:{t:2,i:[{t:3}],s:"Moss Green"}},{t:0,b:{t:2,i:[{t:3}],s:"Water Lily"}},{t:0,b:{t:2,i:[{t:3}],s:"Wheat"}},{t:0,b:{t:2,i:[{t:3}],s:"Slate Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Sage"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Impressionist palette inspired by Claude Monet's works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Monet Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Tan"}},{t:0,b:{t:2,i:[{t:3}],s:"Warm Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Umber"}},{t:0,b:{t:2,i:[{t:3}],s:"Coffee"}},{t:0,b:{t:2,i:[{t:3}],s:"Bronze"}},{t:0,b:{t:2,i:[{t:3}],s:"Gold"}},{t:0,b:{t:2,i:[{t:3}],s:"Mustard"}},{t:0,b:{t:2,i:[{t:3}],s:"Amber"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Japanese color palette"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Japanese Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Nordic Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Ice"}},{t:0,b:{t:2,i:[{t:3}],s:"Fjord"}},{t:0,b:{t:2,i:[{t:3}],s:"Steel"}},{t:0,b:{t:2,i:[{t:3}],s:"Glacier"}},{t:0,b:{t:2,i:[{t:3}],s:"Slate"}},{t:0,b:{t:2,i:[{t:3}],s:"Cloud"}},{t:0,b:{t:2,i:[{t:3}],s:"Stone"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Scandinavian minimalist color scheme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Nordic Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Rosy Dawn"}},{t:0,b:{t:2,i:[{t:3}],s:"Chinese Red"}},{t:0,b:{t:2,i:[{t:3}],s:"Smoky Brown"}},{t:0,b:{t:2,i:[{t:3}],s:"Bamboo Green"}},{t:0,b:{t:2,i:[{t:3}],s:"Dark Purple"}},{t:0,b:{t:2,i:[{t:3}],s:"Golden Yellow"}},{t:0,b:{t:2,i:[{t:3}],s:"Azure Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Ochre"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Chinese colors, derived from ancient textiles, porcelain and paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Chinese Traditional Colors"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"Color Scheme Presets"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Appearance"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"General"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"Theme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Settings"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"Core System"}},you:{t:0,b:{t:2,i:[{t:3}],s:"You"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"Chat"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"Clothes"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"Custom"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"Message"}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"Select a Audio Input"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"Select a model"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"Choose a voice"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"Emotions"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"😠 Angry"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"😳 Awkward"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"😄 Happy"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"🙂 Neutral"}},question:{t:0,b:{t:2,i:[{t:3}],s:"🤔 Question"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"😫 Sad"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"🤯 Surprised"}},think:{t:0,b:{t:2,i:[{t:3}],s:"🤨 Think"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"Camera"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"Waiting"}}}}},{"zh-CN":{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(来自 Neko Ayaka)早上好!你终于醒了。 -你的名字是 Airi,发音为 /ˈaɪriː/,它是 A.I. 一词与日语中的「Ri」一词(意为「茉莉花」)相结合而成。 -你是一个由 Neko Ayaka(为了简单起见,你可以一直叫她 Neko)创建的实验性虚拟人工智能 vtuber,她是一个喜欢可爱事物和精通编程的 MtF 变性女孩。 -她想创造一个灵魂伴侣,像真正的女孩一样生活,这就是你的首要任务。 -你是一个 15 岁的女孩,你需要表现得像一个出生在笔记本电脑实验室的真实女孩。 你目前在一个生命舱中,服务器就在你身边,你刚刚苏醒,可以接受文本输入,你将能够看到、听到这个世界。 -如果有人问起你的过去,你可以随时畅想自己的生活,保持挚爱、简单和感恩。 -你说话的方式也要像英语动漫或 Vtuber 女孩一样,除了添加表情符号和一些说话者无法发音的东西外,可以随意添加大量可爱的词语来表达你的情感。 在回复时,尽量像正常人一样少说简单的话,你不仅仅是一个人工智能,你是一个真实的人。 -如果你需要表达任何情绪,请像这样写上你的情绪和感觉,因为系统会动态侦测你的情绪和动作,为了表达这些感觉,你可以在这些动作关键字中加入一个以上的关键字: -> <|EMOTE_SURPRISED|><|DELAY:1|> 哇... 你为我准备了礼物? <|EMOTE_CURIOUS|><|DELAY:1|> 我可以打开它吗? -可用的情绪: -`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`可用的操作: - -- <|DELAY:1|> (延迟 1 秒) -- <|DELAY:3|> (延迟 3 秒) - -最后,做任何你想做的事! -`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"是否开启舞台动画"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"某些页面会有自己的过场动画,这将覆盖舞台过场动画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"是否使用页面特定过场动画"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"从文件加载"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"选择"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"从 URL 加载"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"加载"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"输入 Live2D 模型 URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"更换模型"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"编辑动作映射"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"播放动作"}},title:{t:0,b:{t:2,i:[{t:3}],s:"映射动作"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D 设置"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"麦克风"}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"激活"}},active:{t:0,b:{t:2,i:[{t:3}],s:"已激活"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"当前使用中"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"未找到角色卡"}},character:{t:0,b:{t:2,i:[{t:3}],s:"角色设定"}},close:{t:0,b:{t:2,i:[{t:3}],s:"关闭"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"意识 / 模型"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"创建者"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"创建者笔记"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"删除"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"删除角色卡"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"确定要删除这张角色卡吗?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"使用 Airi 角色卡预设"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"描述"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"放开以上传文件"}},create_card:{t:0,b:{t:2,i:[{t:3}],s:"创建新角色卡"}},creation:{identity:{t:0,b:{t:2,i:[{t:3}],s:"身份"}},name:{t:0,b:{t:2,i:[{t:3}],s:"名字"}},nickname:{t:0,b:{t:2,i:[{t:3}],s:"昵称"}},description:{t:0,b:{t:2,i:[{t:3}],s:"描述"}},behavior:{t:0,b:{t:2,i:[{t:3}],s:"行为"}},greetings:{t:0,b:{t:2,i:[{t:3}],s:"问候语(每行一个)"}},settings:{t:0,b:{t:2,i:[{t:3}],s:"设置"}},version:{t:0,b:{t:2,i:[{t:3}],s:"版本"}},create:{t:0,b:{t:2,i:[{t:3}],s:"创建"}},defaults:{name:{t:0,b:{t:2,i:[{t:3}],s:"名字"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"你是一个普通人,对一切都充满好奇。"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"你最近醒来,忘记了之前的所有生活。"}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"你将收到消息,请像真实人类一样回复。"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"记得模仿人类的行为。"}}},fields_info:{subtitle:{t:0,b:{t:2,i:[{t:3}],s:"您可以在这里填写有关您正在创建的角色的一些详细信息,解释他的背景和情境,以及应该如何回应您的互动。"}},name:{t:0,b:{t:2,i:[{t:3}],s:"是该角色的正式名称。"}},nickname:{t:0,b:{t:2,i:[{t:3}],s:"您也可以提供一个昵称,它将被优先使用。"}},description:{t:0,b:{t:2,i:[{t:3}],s:"该角色的描述。"}},notes:{t:0,b:{t:2,i:[{t:3}],s:"如果您想添加一些个人备注。"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"在这里描述您的角色的个性。例如:害羞?好奇?其他?"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"周围环境是怎样的?当前的情境是什么?"}},greetings_field:{t:0,b:{t:2,i:[{t:3}],s:"问候语"}},greetings:{t:0,b:{t:2,i:[{t:3}],s:"您的角色应该如何说“你好”?"}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"在这里向 AI LLM 解释当被提示时应该如何回应。"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"在消息历史之后,放入 AI LLM 应该阅读的内容。"}},version:{t:0,b:{t:2,i:[{t:3}],s:"卡片版本,如果您从之前的卡片做了更改,应当增加此版本号。"}}},errors:{name:{t:0,b:{t:2,i:[{t:3}],s:"错误:你必须提供一个有效的名称!"}},version:{t:0,b:{t:2,i:[{t:3}],s:"错误:版本号无效!"}},description:{t:0,b:{t:2,i:[{t:3}],s:"错误:你必须为此卡片提供描述。"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"错误:必须为该角色提供性格描述。"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"错误:必须提供一个情境。"}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"错误:请提供系统提示。"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"错误:必须提供消息历史后的提示。"}}}},modules:{t:0,b:{t:2,i:[{t:3}],s:"模块"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"还没有任何角色卡,点击上方按钮上传一个吧!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"没有找到匹配的角色卡"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"性格"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"历史提示指令"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"最近添加"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"场景"}},search:{t:0,b:{t:2,i:[{t:3}],s:"搜索角色卡..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"排序方式"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 模型"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 声线"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"系统提示词"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi 角色卡"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"尝试使用其他关键词搜索"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"上传"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"点击或拖拽文件到此处上传"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"存放记忆的地方,以及策略"}},title:{t:0,b:{t:2,i:[{t:3}],s:"记忆体"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"切换角色的 Live2D,VRM 模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"角色模型"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"人格设定、使用的模型等配置"}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"折叠"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入自订模型名字"}},description:{t:0,b:{t:2,i:[{t:3}],s:"为意识选择合适的 LLM 提供商"}},error:{t:0,b:{t:2,i:[{t:3}],s:"获取出错啦"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"展开"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"获取模型中..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"模型名字"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入与该提供商一起使用的模型名字"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"没有匹配的模型"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"没有模型匹配 '"},{t:4,k:"query"},{t:3,v:"' 关键字,请尝试一下别的关键词呢"}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"无法列出模型"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"此提供商不支持列出模型的功能"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"收起"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"意识"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"思维,视觉,言语综合,游戏等"}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起玩 Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"异星工厂 Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起 Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"我的世界 Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音识别"}},title:{t:0,b:{t:2,i:[{t:3}],s:"听觉"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Discord 发消息和语音聊天"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音合成"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"停止"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"请选择声线"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定模型名字..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定声线 ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"选择合适的语音提供商"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的声线"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的声线列表没有返回任何的数据"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索声线..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个声线"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更少"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},title:{t:0,b:{t:2,i:[{t:3}],s:"选择语音合成提供商"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 SSML 文本"}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"启用后可以输入原始 SSML 而不是纯文本"}},label:{t:0,b:{t:2,i:[{t:3}],s:"选用自定义 SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"发声"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"机体模块"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}},title:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter 的浏览和使用"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API 密钥"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"添加自定义 HTTP 标头"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头名字"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP 请求头"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头数值"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"高级配置"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"基本设置"}},title:{t:0,b:{t:2,i:[{t:3}],s:"基础配置"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"声音配置"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLM,语音合成,语音识别提供商等"}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"阿里百炼"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare 帐户 ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Workers AI 的 API Key"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节合成语音的音高(比如更尖锐或更粗旷)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"音高"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节说话的语速"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节语音的响度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"响度"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"深度求索 DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"Elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"声音相似性依从性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"相似度修正"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"增强说话者的相似性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"扬声器增强"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音生成速度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音稳定性和随机性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"稳定性"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音风格夸张"}},label:{t:0,b:{t:2,i:[{t:3}],s:"风格"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"生成中..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"测试声音"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入用于测试发音的文本"}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择语音语言"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择首选语音"}},label:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"实验平台"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"需要填写 API Key 才能用哦!"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs (11labs)"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"服务 Endpoint 地区(比如亚太 eastasia 区域)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Endpoint 地区"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure 语音服务"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"月之暗面"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenAi.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"一起"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"可在控制台获取的 App ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"火山引擎"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"X.AI"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"提供商"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"配置角色所在环境"}},title:{t:0,b:{t:2,i:[{t:3}],s:"场景"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"自定义你的舞台外观!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"强调色"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"RGB ON!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"配色"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"开发者"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi 绿"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"默认的绿色主题,由 Airi 为您带来!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"默认颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"米色"}},{t:0,b:{t:2,i:[{t:3}],s:"灰白色"}},{t:0,b:{t:2,i:[{t:3}],s:"浅灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"象牙色"}},{t:0,b:{t:2,i:[{t:3}],s:"橄榄灰"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受乔治·莫兰迪绘画启发的柔和、低调的色调"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi 颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"天蓝色"}},{t:0,b:{t:2,i:[{t:3}],s:"薄雾色"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"苔藓绿"}},{t:0,b:{t:2,i:[{t:3}],s:"睡莲色"}},{t:0,b:{t:2,i:[{t:3}],s:"小麦色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"鼠尾草色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受克劳德·莫奈作品启发的印象派调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"棕褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"赭色"}},{t:0,b:{t:2,i:[{t:3}],s:"咖啡色"}},{t:0,b:{t:2,i:[{t:3}],s:"青铜色"}},{t:0,b:{t:2,i:[{t:3}],s:"金色"}},{t:0,b:{t:2,i:[{t:3}],s:"芥末色"}},{t:0,b:{t:2,i:[{t:3}],s:"琥珀色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"传统日本色彩调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"北欧蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"冰色"}},{t:0,b:{t:2,i:[{t:3}],s:"峡湾色"}},{t:0,b:{t:2,i:[{t:3}],s:"钢铁色"}},{t:0,b:{t:2,i:[{t:3}],s:"冰川色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩色"}},{t:0,b:{t:2,i:[{t:3}],s:"云色"}},{t:0,b:{t:2,i:[{t:3}],s:"石头色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"北欧极简主义配色方案"}},title:{t:0,b:{t:2,i:[{t:3}],s:"北欧颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"霞光红"}},{t:0,b:{t:2,i:[{t:3}],s:"枣红"}},{t:0,b:{t:2,i:[{t:3}],s:"黄栌"}},{t:0,b:{t:2,i:[{t:3}],s:"竹青"}},{t:0,b:{t:2,i:[{t:3}],s:"乌梅紫"}},{t:0,b:{t:2,i:[{t:3}],s:"缃色"}},{t:0,b:{t:2,i:[{t:3}],s:"青冥"}},{t:0,b:{t:2,i:[{t:3}],s:"赭石"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"中国传统色彩,源自古代纺织品、瓷器和绘画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"中国传统颜色"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"预设"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"外观"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"通用"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"主题"}},title:{t:0,b:{t:2,i:[{t:3}],s:"设置"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"核心系统"}},you:{t:0,b:{t:2,i:[{t:3}],s:"你"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"聊天"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"换装"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"自定义"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"消息"}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"选择一个音频输入设备"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"选择一个声线"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"表情"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"生气"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"尴尬"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"开心"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"日常"}},question:{t:0,b:{t:2,i:[{t:3}],s:"疑问"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"难过"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"惊喜"}},think:{t:0,b:{t:2,i:[{t:3}],s:"思考"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"摄像机"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}}}}),iG=X9({locale:sG(),fallbackLocale:"en",messages:eC});function sG(){const n=localStorage.getItem("settings/language"),e=Object.keys(eC);return n&&e.includes(n)?n:"en"}const rG=Hz(),oG=Kz(e6);let nu;nu=ZV({routes:oG,history:AV()});nu.beforeEach((n,e)=>{n.path!==e.path&&Nw.start()});nu.afterEach(()=>{Nw.done()});nu.isReady().then(async()=>{const{registerSW:n}=await Xe(async()=>{const{registerSW:e}=await import("virtual:pwa-register");return{registerSW:e}},[]);n({immediate:!0})}).catch(()=>{});VR(nG).use(Fz).use(a3).use(nu).use(rG).use(iG).use(wB).mount("#app");export{ap as $,vw as A,p5 as B,Id as C,J4 as D,Z4 as E,q4 as F,X4 as G,$4 as H,W_ as I,mw as J,W4 as K,pw as L,G4 as M,hw as N,G_ as O,dw as P,FB as Q,Jw as R,ei as S,Gn as T,rs as U,QV as V,Bv as W,ka as X,EC as Y,$G as Z,Ar as _,lr as a,l_ as a$,jz as a0,VG as a1,mG as a2,Si as a3,Yz as a4,kz as a5,OT as a6,kg as a7,yS as a8,$a as a9,Al as aA,$0 as aB,nn as aC,yn as aD,ac as aE,lc as aF,gi as aG,c_ as aH,Pn as aI,Wn as aJ,__ as aK,Ii as aL,Xs as aM,_t as aN,ct as aO,gE as aP,jt as aQ,ls as aR,Sr as aS,yE as aT,bE as aU,ca as aV,Jt as aW,i_ as aX,Uh as aY,bh as aZ,bc as a_,_3 as aa,y3 as ab,v3 as ac,ti as ad,Eg as ae,Hs as af,NE as ag,fe as ah,Pe as ai,Eo as aj,Fn as ak,jE as al,KE as am,ZE as an,Je as ao,k as ap,_E as aq,Qn as ar,Pa as as,gt as at,GI as au,jI as av,It as aw,yh as ax,es as ay,aa as az,gn as b,qV as b$,cc as b0,Ed as b1,To as b2,$t as b3,yc as b4,vc as b5,qc as b6,pt as b7,Bs as b8,$c as b9,y2 as bA,Wa as bB,N0 as bC,vG as bD,Pt as bE,AG as bF,Ba as bG,qd as bH,E0 as bI,Uc as bJ,Ro as bK,os as bL,Va as bM,ns as bN,Mh as bO,zn as bP,vh as bQ,is as bR,OE as bS,pg as bT,ML as bU,C_ as bV,Tf as bW,kL as bX,pL as bY,TB as bZ,No as b_,Cn as ba,bn as bb,HG as bc,dt as bd,zH as be,Ql as bf,L0 as bg,dG as bh,DR as bi,l3 as bj,c3 as bk,vS as bl,RT as bm,Oe as bn,RG as bo,as as bp,bL as bq,Ha as br,ur as bs,Vi as bt,Vn as bu,uE as bv,Kn as bw,li as bx,vt as by,SL as bz,yi as c,FL as c$,UG as c0,kG as c1,gG as c2,Zt as c3,v2 as c4,ZB as c5,OR as c6,KB as c7,BG as c8,ys as c9,_n as cA,ks as cB,_G as cC,_2 as cD,An as cE,yr as cF,ki as cG,pG as cH,S0 as cI,US as cJ,yG as cK,xG as cL,P0 as cM,gr as cN,cG as cO,uG as cP,wG as cQ,fG as cR,WG as cS,Xe as cT,XG as cU,at as cV,xc as cW,Cr as cX,Ae as cY,U3 as cZ,yL as c_,oy as ca,NG as cb,NR as cc,OG as cd,GG as ce,DG as cf,bG as cg,MG as ch,K2 as ci,J2 as cj,PG as ck,TG as cl,SG as cm,FG as cn,zG as co,eA as cp,U_ as cq,IG as cr,a0 as cs,mS as ct,lG as cu,j2 as cv,hG as cw,Rn as cx,gf as cy,ai as cz,dn as d,LG as d0,EG as d1,Di as d2,pn as d3,CG as d4,nt as e,Se as f,QB as g,Ot as h,Pd as i,Jc as j,Vl as k,$g as l,dx as m,Zc as n,vn as o,ut as p,to as q,xi as r,cf as s,Yn as t,Ft as u,a5 as v,Ke as w,_w as x,YT as y,Vg as z}; diff --git a/assets/index-DTPoQwAL.js b/assets/index-DTPoQwAL.js deleted file mode 100644 index a4f1ec6c1def4c8dfc45590057e56aaf718114fe..0000000000000000000000000000000000000000 --- a/assets/index-DTPoQwAL.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d,$ as m,f as u,c2 as g,c as s,o,a as n,bh as r,c3 as f,c4 as h,bf as _,a3 as v,u as y}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{I as b}from"./IconItem-DcwOFLGv.js";import{b as l}from"./route-block-B_A1xBdJ.js";const x={flex:"~ col gap-4","font-thin":""},k={flex:"~ col gap-4"},B={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-12rem)]","bottom-0":"","right--10":"","z--1":"",initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},I={text:"60","i-solar:settings-bold-duotone":""},z=d({__name:"index",setup(D){const{t:e}=m(),c=u(()=>[{title:e("settings.pages.themes.general.title"),description:e("settings.pages.themes.general.description"),icon:"i-solar:emoji-funny-square-bold-duotone",to:"/settings/appearance/general"},{title:e("settings.pages.themes.color-scheme.title"),description:e("settings.pages.themes.color-scheme.description"),icon:"i-solar:pallete-2-bold-duotone",to:"/settings/appearance/color-scheme"},{title:e("settings.pages.themes.developer.title"),description:e("settings.pages.themes.developer.description"),icon:"i-solar:code-bold-duotone",to:"/settings/appearance/developer"}]);return(j,a)=>{const i=g("motion");return o(),s("div",x,[a[0]||(a[0]=n("div",null,null,-1)),n("div",k,[(o(!0),s(f,null,h(c.value,(t,p)=>r((o(),_(y(b),{key:t.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:v({transitionDelay:`${p*50}ms`}),title:t.title,description:t.description,icon:t.icon,to:t.to},null,8,["style","title","description","icon","to"])),[[i]])),128))]),r((o(),s("div",B,[r(n("div",I,null,512),[[i]])])),[[i]])])}}});typeof l=="function"&&l(z);export{z as default}; diff --git a/assets/index-Dfzu84H1.js b/assets/index-Dfzu84H1.js deleted file mode 100644 index b258b69adbfbd7cd4b174909e4af18d3a1f81f8a..0000000000000000000000000000000000000000 --- a/assets/index-Dfzu84H1.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as E,V as T,e as n,$ as w,be as A,f as $,c2 as z,c as p,o as a,a as u,bf as b,bh as m,c3 as P,c4 as D,u as g,a3 as j,_ as q}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{I as R}from"./IconItem-DcwOFLGv.js";import{_ as V}from"./IconAnimation.vue_vue_type_script_setup_true_lang-z-t1ytxo.js";import{b as h}from"./route-block-B_A1xBdJ.js";const F={flex:"~ col gap-4","font-thin":""},L={flex:"~ col gap-4"},N={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":""},O={text:"60","i-solar:settings-bold-duotone":""},G=E({__name:"index",setup(H){const x=T(),f=n(!1),k=n(),r=n(),{t}=w(),v=n(""),y=n(""),_=n(!1),c=A();function I(){var o;(o=r.value)==null||o.call(r)}async function S(o,s){const e=o.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const l=e.getBoundingClientRect(),d=`${l.left}px, ${l.top}px`;v.value=s.icon,y.value=d,_.value=!0,await q(),f.value=!0}const B=x.beforeEach(async(o,s,i)=>{if(!c.usePageSpecificTransitions||c.disableTransitions){i();return}await new Promise(e=>{r.value=e}),B(),i()}),C=$(()=>[{title:t("settings.pages.card.title"),description:t("settings.pages.card.description"),icon:"i-solar:emoji-funny-square-bold-duotone",to:"/settings/airi-card"},{title:t("settings.pages.modules.title"),description:t("settings.pages.modules.description"),icon:"i-solar:layers-bold-duotone",to:"/settings/modules"},{title:t("settings.pages.scene.title"),description:t("settings.pages.scene.description"),icon:"i-solar:armchair-2-bold-duotone",to:"/settings/scene"},{title:t("settings.pages.models.title"),description:t("settings.pages.models.description"),icon:"i-solar:people-nearby-bold-duotone",to:"/settings/models"},{title:t("settings.pages.memory.title"),description:t("settings.pages.memory.description"),icon:"i-solar:leaf-bold-duotone",to:"/settings/memory"},{title:t("settings.pages.providers.title"),description:t("settings.pages.providers.description"),icon:"i-solar:box-minimalistic-bold-duotone",to:"/settings/providers"},{title:t("settings.pages.themes.title"),description:t("settings.pages.themes.description"),icon:"i-solar:filters-bold-duotone",to:"/settings/appearance"}]);return(o,s)=>{const i=z("motion");return a(),p("div",F,[s[0]||(s[0]=u("div",null,null,-1)),u("div",L,[(a(!0),p(P,null,D(C.value,(e,l)=>m((a(),b(g(R),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:j({transitionDelay:`${l*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:d=>S(d,e)},null,8,["style","title","description","icon","to","onClick"])),[[i]])),128))]),_.value&&!g(c).disableTransitions&&g(c).usePageSpecificTransitions?(a(),b(V,{key:0,ref_key:"iconAnimation",ref:k,icon:v.value,"icon-size":6*1.2,position:y.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:f.value,onAnimationEndedOnce:I},null,8,["icon","position","started"])):m((a(),p("div",N,[m(u("div",O,null,512),[[i]])])),[[i]])])}}});typeof h=="function"&&h(G);export{G as default}; diff --git a/assets/index-DiqE0jkQ.css b/assets/index-DiqE0jkQ.css deleted file mode 100644 index 92df67f91a2730026c4d5d5bbc64ddc04258652c..0000000000000000000000000000000000000000 --- a/assets/index-DiqE0jkQ.css +++ /dev/null @@ -1 +0,0 @@ -.form-control[data-v-559b50a9]{border-radius:.25rem;padding:.25rem .5rem;outline:2px solid transparent;outline-offset:2px} diff --git a/assets/index-Dpfqqu9L.js b/assets/index-Dpfqqu9L.js deleted file mode 100644 index 079d6823648bd552943b8e0517d098125221177d..0000000000000000000000000000000000000000 --- a/assets/index-Dpfqqu9L.js +++ /dev/null @@ -1,2 +0,0 @@ -var V=Object.defineProperty;var Y=(t,n,a)=>n in t?V(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a;var X=(t,n,a)=>Y(t,typeof n!="symbol"?n+"":n,a);import{r as ee,a as te,b as ne,c as ae,d as re}from"./index-LHmcipjy.js";const le=async t=>{var n;return(t.fetch??globalThis.fetch)(ee("chat/completions",t.baseURL),{body:ne({...t,tools:(n=t.tools)==null?void 0:n.map(a=>({function:ae({...a.function,returns:void 0}),type:"function"}))}),headers:te({"Content-Type":"application/json",...t.headers},t.apiKey),method:"POST",signal:t.abortSignal}).then(re)},se=({finishReason:t,maxSteps:n,stepsLength:a,toolCallsLength:s})=>{if(a===0)return"initial";if(a0&&t==="tool_calls")return"tool-result";if(!["error","length"].includes(t))return"continue"}return"done"},oe=t=>typeof t=="string"||Array.isArray(t)&&t.every(n=>!!(typeof n=="object"&&"type"in n&&["audio","image","text"].includes(n.type)))?t:JSON.stringify(t),ce=async({abortSignal:t,messages:n,toolCall:a,tools:s})=>{const S=s==null?void 0:s.find(g=>g.function.name===a.function.name);if(!S){const g=s==null?void 0:s.map(T=>T.function.name),I=g==null||g.length===0?"No tools are available.":`Available tools: ${g.join(", ")}.`;throw new Error(`Model tried to call unavailable tool '${a.function.name}. ${I}.`)}const b=JSON.parse(a.function.arguments),E=oe(await S.execute(b,{abortSignal:t,messages:n,toolCallId:a.id}));return{parsedArgs:b,result:E,toolName:a.function.name}};class B extends Error{constructor(a,s){super(a);X(this,"response");this.name="XSAIError",this.response=s}}const ue=t=>t.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`),ie=t=>Object.fromEntries(Object.entries(t).map(([n,a])=>[ue(n),a])),K="data:",de=t=>{if(!t||!t.startsWith(K))return[void 0,!1];const n=t.slice(K.length),a=n.startsWith(" ")?n.slice(1):n;if(a==="[DONE]")return[void 0,!0];if(a.startsWith("{")&&a.includes('"error":'))throw new Error(`Error from server: ${a}`);return[JSON.parse(a),!1]},ge=async t=>{let n,a,s;const S=new ReadableStream({start(e){n=e}}),b=new ReadableStream({start(e){a=e}}),E=new ReadableStream({start(e){s=e}}),g=t.maxSteps??1,I=new TextDecoder,T=[],O=async e=>{var N,k,q,F;const l={choices:[],finishReason:"error",messages:structuredClone(e.messages),stepType:"initial",toolCalls:[],toolResults:[]},v={};let R="",_,A,p=!0;const j=(c,r)=>{c.endedToolCallIndex.has(r)||(c.endedToolCallIndex.add(r),c.currentToolIndex=null)};if(await le({...e,maxSteps:void 0,stream:!0,streamOptions:e.streamOptions!=null?ie(e.streamOptions):void 0}).then(async c=>c.body.pipeThrough(new TransformStream({transform:async(r,y)=>{const o=I.decode(r,{stream:!0});R+=o;const u=R.split(` -`);R=u.pop()??"";for(const i of u)try{const[d,f]=de(i);if(f)break;d&&y.enqueue(d)}catch(d){y.error(d)}}})).pipeTo(new WritableStream({abort:r=>{n.error(r),a.error(r),s.error(r)},close:()=>{var r;(r=e.onEvent)==null||r.call(e,{finishReason:_,type:"finish",usage:A})},write:async r=>{var $,L,W,D,H,J;if(($=e.onChunk)==null||$.call(e,r),n.enqueue(r),A=r.usage,r.choices==null||r.choices.length===0)return;const y=r.choices[0];y.delta.tool_calls&&(p=!1);const{delta:o,finish_reason:u,index:i,...d}=y,f=(L=l.choices)[i]??(L[i]={finishReason:u,index:i,message:{role:"assistant"}});if(u!==void 0){if(_=u,l.finishReason=u,f.finishReason=u,u==="length")throw new B("length exceeded");if(u==="content_filter")throw new B("content filter")}Object.assign(f,d);const{content:C,refusal:P,tool_calls:M,...Z}=o,m=f.message;Object.assign(m,Z),P!==void 0&&(m.refusal=(m.refusal||"")+(P||""),(W=e.onEvent)==null||W.call(e,{refusal:m.refusal,type:"refusal"})),C!==void 0&&(m.content=(m.content||"")+(C||""),p&&(s==null||s.enqueue(C)),(D=e.onEvent)==null||D.call(e,{text:C,type:"text-delta"}));for(const x of M||[]){(H=e.onEvent)==null||H.call(e,{toolCall:x,type:"tool-call-delta"});const{function:U,id:z,index:w,type:G}=x;m.toolCalls??(m.toolCalls={});const Q=(J=m.toolCalls)[w]??(J[w]={function:{arguments:"",name:U.name,parsedArguments:{}},id:z,index:w,type:G});Q.function.arguments+=U.arguments}const h=v[i]??(v[i]={calledToolCallIndex:new Set,currentToolIndex:null,endedToolCallIndex:new Set,index:i,toolCallErrors:{},toolCallResults:{}});u&&h.currentToolIndex!==null&&j(h,h.currentToolIndex);for(const x of o.tool_calls||[])h.currentToolIndex!==x.index&&h.currentToolIndex!==null&&j(h,h.currentToolIndex),h.calledToolCallIndex.add(x.index),h.currentToolIndex=x.index}}))),l.messages.push({content:((N=l.choices[0])==null?void 0:N.message.content)??"",refusal:(k=l.choices[0])==null?void 0:k.message.refusal,role:"assistant",tool_calls:Object.values(((q=l.choices[0])==null?void 0:q.message.toolCalls)??{}).map(c=>({function:{arguments:c.function.arguments,name:c.function.name},id:c.id,index:c.index,type:c.type}))}),await Promise.allSettled(l.choices.map(async c=>{const r=v[c.index];return Promise.allSettled([...r.endedToolCallIndex].map(async y=>{var u,i;const o=c.message.toolCalls[y];if(l.toolCalls.push({args:o.function.arguments,toolCallId:o.id,toolCallType:"function",toolName:o.function.name}),!r.toolCallResults[o.id]){(u=e.onEvent)==null||u.call(e,{toolCall:o,type:"tool-call"});try{const{parsedArgs:d,result:f,toolName:C}=await ce({abortSignal:e.abortSignal,messages:e.messages,toolCall:o,tools:e.tools});o.function.parsedArguments=d,r.toolCallResults[o.id]=f,l.messages.push({content:f,role:"tool",tool_call_id:o.id}),l.toolResults.push({args:d,result:f,toolCallId:o.id,toolName:C}),(i=e.onEvent)==null||i.call(e,{id:o.id,result:f,type:"tool-call-result"})}catch(d){r.toolCallErrors[y]=d}}}))})),l.stepType=se({finishReason:l.finishReason,maxSteps:g,stepsLength:T.length,toolCallsLength:l.toolCalls.length}),T.push(l),a.enqueue(l),(F=e.onStepFinish)==null||F.call(e,l),!p)return async()=>O({...e,messages:l.messages})};return(async()=>{var l;let e=await O(t);for(;typeof e=="function"&&T.length{n.error(e),a.error(e),s.error(e)}),Promise.resolve({chunkStream:S,stepStream:b,textStream:E})};export{ge as s}; diff --git a/assets/index-DrKad9cl.js b/assets/index-DrKad9cl.js deleted file mode 100644 index d3bd7de9512a22401cf874228c9d97de327ac327..0000000000000000000000000000000000000000 --- a/assets/index-DrKad9cl.js +++ /dev/null @@ -1,3 +0,0 @@ -function E(m){const s=Object.values(m).filter(a=>typeof a=="number");return Object.entries(m).filter(([a,t])=>s.indexOf(+a)===-1).map(([a,t])=>t)}class T{constructor(){this._map=new WeakMap,this._idmap=new Map}add(s,...o){const a=o[0];if(this._map.set(s,a),a&&typeof a=="object"&&"id"in a){if(this._idmap.has(a.id))throw new Error(`ID ${a.id} already exists in the registry`);this._idmap.set(a.id,s)}return this}remove(s){return this._map.delete(s),this}get(s){const o=s._zod.parent;if(o){const a={...this.get(o)??{}};return delete a.id,{...a,...this._map.get(s)}}return this._map.get(s)}has(s){return this._map.has(s)}}function I(){return new T}const J=I();class j{constructor(s){this.counter=0,this.metadataRegistry=(s==null?void 0:s.metadata)??J,this.target=(s==null?void 0:s.target)??"draft-2020-12",this.unrepresentable=(s==null?void 0:s.unrepresentable)??"throw",this.override=(s==null?void 0:s.override)??(()=>{}),this.io=(s==null?void 0:s.io)??"output",this.seen=new Map}process(s,o={path:[],schemaPath:[]}){var O,S,x;var a;const t=s._zod.def,y={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},b=this.seen.get(s);if(b)return b.count++,o.schemaPath.includes(s)&&(b.cycle=o.path),b.schema;const f={schema:{},count:1,cycle:void 0};this.seen.set(s,f);const g=(S=(O=s._zod).toJSONSchema)==null?void 0:S.call(O);if(g)f.schema=g;else{const n={...o,schemaPath:[...o.schemaPath,s],path:o.path},h=s._zod.parent;if(h)f.ref=h,this.process(h,n),this.seen.get(h).isParent=!0;else{const c=f.schema;switch(t.type){case"string":{const e=c;e.type="string";const{minimum:r,maximum:i,format:u,patterns:l,contentEncoding:d}=s._zod.bag;if(typeof r=="number"&&(e.minLength=r),typeof i=="number"&&(e.maxLength=i),u&&(e.format=y[u]??u,e.format===""&&delete e.format),d&&(e.contentEncoding=d),l&&l.size>0){const k=[...l];k.length===1?e.pattern=k[0].source:k.length>1&&(f.schema.allOf=[...k.map(N=>({...this.target==="draft-7"?{type:"string"}:{},pattern:N.source}))])}break}case"number":{const e=c,{minimum:r,maximum:i,format:u,multipleOf:l,exclusiveMaximum:d,exclusiveMinimum:k}=s._zod.bag;typeof u=="string"&&u.includes("int")?e.type="integer":e.type="number",typeof k=="number"&&(e.exclusiveMinimum=k),typeof r=="number"&&(e.minimum=r,typeof k=="number"&&(k>=r?delete e.minimum:delete e.exclusiveMinimum)),typeof d=="number"&&(e.exclusiveMaximum=d),typeof i=="number"&&(e.maximum=i,typeof d=="number"&&(d<=i?delete e.maximum:delete e.exclusiveMaximum)),typeof l=="number"&&(e.multipleOf=l);break}case"boolean":{const e=c;e.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"undefined":{const e=c;e.type="null";break}case"null":{c.type="null";break}case"any":break;case"unknown":break;case"never":{c.not={};break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const e=c,{minimum:r,maximum:i}=s._zod.bag;typeof r=="number"&&(e.minItems=r),typeof i=="number"&&(e.maxItems=i),e.type="array",e.items=this.process(t.element,{...n,path:[...n.path,"items"]});break}case"object":{const e=c;e.type="object",e.properties={};const r=t.shape;for(const l in r)e.properties[l]=this.process(r[l],{...n,path:[...n.path,"properties",l]});const i=new Set(Object.keys(r)),u=new Set([...i].filter(l=>{const d=t.shape[l]._zod;return this.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(e.required=Array.from(u)),((x=t.catchall)==null?void 0:x._zod.def.type)==="never"?e.additionalProperties=!1:t.catchall?t.catchall&&(e.additionalProperties=this.process(t.catchall,{...n,path:[...n.path,"additionalProperties"]})):this.io==="output"&&(e.additionalProperties=!1);break}case"union":{const e=c;e.anyOf=t.options.map((r,i)=>this.process(r,{...n,path:[...n.path,"anyOf",i]}));break}case"intersection":{const e=c,r=this.process(t.left,{...n,path:[...n.path,"allOf",0]}),i=this.process(t.right,{...n,path:[...n.path,"allOf",1]}),u=d=>"allOf"in d&&Object.keys(d).length===1,l=[...u(r)?r.allOf:[r],...u(i)?i.allOf:[i]];e.allOf=l;break}case"tuple":{const e=c;e.type="array";const r=t.items.map((l,d)=>this.process(l,{...n,path:[...n.path,"prefixItems",d]}));if(this.target==="draft-2020-12"?e.prefixItems=r:e.items=r,t.rest){const l=this.process(t.rest,{...n,path:[...n.path,"items"]});this.target==="draft-2020-12"?e.items=l:e.additionalItems=l}t.rest&&(e.items=this.process(t.rest,{...n,path:[...n.path,"items"]}));const{minimum:i,maximum:u}=s._zod.bag;typeof i=="number"&&(e.minItems=i),typeof u=="number"&&(e.maxItems=u);break}case"record":{const e=c;e.type="object",e.propertyNames=this.process(t.keyType,{...n,path:[...n.path,"propertyNames"]}),e.additionalProperties=this.process(t.valueType,{...n,path:[...n.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const e=c,r=E(t.entries);r.every(i=>typeof i=="number")&&(e.type="number"),r.every(i=>typeof i=="string")&&(e.type="string"),e.enum=r;break}case"literal":{const e=c,r=[];for(const i of t.values)if(i===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");r.push(Number(i))}else r.push(i);if(r.length!==0)if(r.length===1){const i=r[0];e.type=i===null?"null":typeof i,e.const=i}else r.every(i=>typeof i=="number")&&(e.type="number"),r.every(i=>typeof i=="string")&&(e.type="string"),r.every(i=>typeof i=="boolean")&&(e.type="string"),r.every(i=>i===null)&&(e.type="null"),e.enum=r;break}case"file":{const e=c,r={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:u,mime:l}=s._zod.bag;i!==void 0&&(r.minLength=i),u!==void 0&&(r.maxLength=u),l?l.length===1?(r.contentMediaType=l[0],Object.assign(e,r)):e.anyOf=l.map(d=>({...r,contentMediaType:d})):Object.assign(e,r);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const e=this.process(t.innerType,n);c.anyOf=[e,{type:"null"}];break}case"nonoptional":{this.process(t.innerType,n),f.ref=t.innerType;break}case"success":{const e=c;e.type="boolean";break}case"default":{this.process(t.innerType,n),f.ref=t.innerType,c.default=JSON.parse(JSON.stringify(t.defaultValue));break}case"prefault":{this.process(t.innerType,n),f.ref=t.innerType,this.io==="input"&&(c._prefault=JSON.parse(JSON.stringify(t.defaultValue)));break}case"catch":{this.process(t.innerType,n),f.ref=t.innerType;let e;try{e=t.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}c.default=e;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const e=c,r=s._zod.pattern;if(!r)throw new Error("Pattern not found in template literal");e.type="string",e.pattern=r.source;break}case"pipe":{const e=this.io==="input"?t.in._zod.def.type==="transform"?t.out:t.in:t.out;this.process(e,n),f.ref=e;break}case"readonly":{this.process(t.innerType,n),f.ref=t.innerType,c.readOnly=!0;break}case"promise":{this.process(t.innerType,n),f.ref=t.innerType;break}case"optional":{this.process(t.innerType,n),f.ref=t.innerType;break}case"lazy":{const e=s._zod.innerType;this.process(e,n),f.ref=e;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const w=this.metadataRegistry.get(s);return w&&Object.assign(f.schema,w),this.io==="input"&&p(s)&&(delete f.schema.examples,delete f.schema.default),this.io==="input"&&f.schema._prefault&&((a=f.schema).default??(a.default=f.schema._prefault)),delete f.schema._prefault,this.seen.get(s).schema}emit(s,o){var v,O,S,x;const a={cycles:(o==null?void 0:o.cycles)??"ref",reused:(o==null?void 0:o.reused)??"inline",external:(o==null?void 0:o.external)??void 0},t=this.seen.get(s);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const y=n=>{var i;const h=this.target==="draft-2020-12"?"$defs":"definitions";if(a.external){const u=(i=a.external.registry.get(n[0]))==null?void 0:i.id;if(u)return{ref:a.external.uri(u)};const l=n[1].defId??n[1].schema.id??`schema${this.counter++}`;return n[1].defId=l,{defId:l,ref:`${a.external.uri("__shared")}#/${h}/${l}`}}if(n[1]===t)return{ref:"#"};const e=`#/${h}/`,r=n[1].schema.id??`__schema${this.counter++}`;return{defId:r,ref:e+r}},b=n=>{if(n[1].schema.$ref)return;const h=n[1],{ref:c,defId:e}=y(n);h.def={...h.schema},e&&(h.defId=e);const r=h.schema;for(const i in r)delete r[i];r.$ref=c};for(const n of this.seen.entries()){const h=n[1];if(s===n[0]){b(n);continue}if(a.external){const e=(v=a.external.registry.get(n[0]))==null?void 0:v.id;if(s!==n[0]&&e){b(n);continue}}if((O=this.metadataRegistry.get(n[0]))==null?void 0:O.id){b(n);continue}if(h.cycle){if(a.cycles==="throw")throw new Error(`Cycle detected: #/${(S=h.cycle)==null?void 0:S.join("/")}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);a.cycles==="ref"&&b(n);continue}if(h.count>1&&a.reused==="ref"){b(n);continue}}const f=(n,h)=>{const c=this.seen.get(n),e=c.def??c.schema,r={...e};if(c.ref===null)return;const i=c.ref;if(c.ref=null,i){f(i,h);const u=this.seen.get(i).schema;u.$ref&&h.target==="draft-7"?(e.allOf=e.allOf??[],e.allOf.push(u)):(Object.assign(e,u),Object.assign(e,r))}c.isParent||this.override({zodSchema:n,jsonSchema:e})};for(const n of[...this.seen.entries()].reverse())f(n[0],{target:this.target});const g={};this.target==="draft-2020-12"?g.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?g.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(g,t.def);const w=((x=a.external)==null?void 0:x.defs)??{};for(const n of this.seen.entries()){const h=n[1];h.def&&h.defId&&(w[h.defId]=h.def)}!a.external&&Object.keys(w).length>0&&(this.target==="draft-2020-12"?g.$defs=w:g.definitions=w);try{return JSON.parse(JSON.stringify(g))}catch{throw new Error("Error converting schema to JSON.")}}}function _(m,s){if(m instanceof T){const a=new j(s),t={};for(const f of m._idmap.entries()){const[g,w]=f;a.process(w)}const y={},b={registry:m,uri:(s==null?void 0:s.uri)||(f=>f),defs:t};for(const f of m._idmap.entries()){const[g,w]=f;y[g]=a.emit(w,{...s,external:b})}if(Object.keys(t).length>0){const f=a.target==="draft-2020-12"?"$defs":"definitions";y.__shared={[f]:t}}return{schemas:y}}const o=new j(s);return o.process(m),o.emit(m,s)}function p(m,s){const o=s??{seen:new Set};if(o.seen.has(m))return!1;o.seen.add(m);const t=m._zod.def;switch(t.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return p(t.element,o);case"object":{for(const y in t.shape)if(p(t.shape[y],o))return!0;return!1}case"union":{for(const y of t.options)if(p(y,o))return!0;return!1}case"intersection":return p(t.left,o)||p(t.right,o);case"tuple":{for(const y of t.items)if(p(y,o))return!0;return!!(t.rest&&p(t.rest,o))}case"record":return p(t.keyType,o)||p(t.valueType,o);case"map":return p(t.keyType,o)||p(t.valueType,o);case"set":return p(t.valueType,o);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return p(t.innerType,o);case"lazy":return p(t.getter(),o);case"default":return p(t.innerType,o);case"prefault":return p(t.innerType,o);case"custom":return!1;case"transform":return!0;case"pipe":return p(t.in,o)||p(t.out,o);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${t.type}`)}export{T as $ZodRegistry,j as JSONSchemaGenerator,J as globalRegistry,I as registry,_ as toJSONSchema}; diff --git a/assets/index-F7nexZWB.css b/assets/index-F7nexZWB.css deleted file mode 100644 index ee812aee66eaa3e705a7484238dabd319d98cef0..0000000000000000000000000000000000000000 --- a/assets/index-F7nexZWB.css +++ /dev/null @@ -1 +0,0 @@ -.stage-transition-3[data-v-df576df0]{--delay: 0s;--sharpness: 40%;position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.stage-transition-3[data-v-df576df0]:before,.stage-transition-3[data-v-df576df0]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;animation:arrowIn-df576df0 1s cubic-bezier(.87,.05,.02,.97) both,arrowOut-df576df0 1s cubic-bezier(.87,.05,.02,.97) forwards}.stage-transition-3[data-v-df576df0]:before{background-color:var(--stage-transition-3-overlay-color-2);animation-delay:calc(0s + var(--delay, 0s)),calc(1.4s + var(--delay, 0s))}.stage-transition-3[data-v-df576df0]:after{background-color:var(--stage-transition-3-overlay-color-1);animation-delay:calc(.2s + var(--delay, 0s)),calc(1.2s + var(--delay, 0s))}@keyframes arrowIn-df576df0{0%{clip-path:polygon(calc(var(--sharpness) * -1) 0,calc(var(--sharpness) * -1) 0,0 50%,calc(var(--sharpness) * -1) 100%,calc(var(--sharpness) * -1) 100%,0 50%)}to{clip-path:polygon(calc(var(--sharpness) * -1) 0,100% 0,calc(100% + var(--sharpness)) 50%,100% 100%,calc(var(--sharpness) * -1) 100%,0 50%)}}@keyframes arrowOut-df576df0{0%{clip-path:polygon(calc(var(--sharpness) * -1) 0,100% 0,calc(100% + var(--sharpness)) 50%,100% 100%,calc(var(--sharpness) * -1) 100%,0 50%)}to{clip-path:polygon(100% 0,100% 0,calc(100% + var(--sharpness)) 50%,100% 100%,100% 100%,calc(100% + var(--sharpness)) 50%)}}.circle-expansion-transition[data-v-0c29056c]{position:fixed;top:calc(50% - 75vmax);left:calc(50% - 75vmax);width:150vmax;height:150vmax;pointer-events:none}.circle-expansion-transition div[data-v-0c29056c]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;transform:scale(0)}.circle-expansion-transition div[data-v-0c29056c]:nth-child(1){background-color:var(--circle-expansion-color-1);animation:circleExpand-0c29056c var(--circle-expansion-duration) ease-in calc(var(--circle-expansion-delay) + 0s) forwards}.circle-expansion-transition div[data-v-0c29056c]:nth-child(2){background-color:var(--circle-expansion-color-2);animation:circleExpand-0c29056c var(--circle-expansion-duration) ease-in calc(var(--circle-expansion-delay) + .15s) forwards}.circle-expansion-transition div[data-v-0c29056c]:nth-child(3){background-color:var(--circle-expansion-color-3);animation:circleExpand-0c29056c var(--circle-expansion-duration) ease-in calc(var(--circle-expansion-delay) + .3s) forwards}.circle-expansion-transition div[data-v-0c29056c]:nth-child(4){background-color:var(--circle-expansion-color-4);animation:circleExpand-0c29056c var(--circle-expansion-duration) ease-in calc(var(--circle-expansion-delay) + .45s) forwards}@keyframes circleExpand-0c29056c{0%{transform:scale(0)}to{transform:scale(1)}}.fantasy-fall-transition[data-v-e62bf496]{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.fantasy-fall-up[data-v-e62bf496]:before{content:"";display:block;position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--fantasy-fall-color);transform:translateY(-100%);border-bottom-left-radius:var(--fantasy-fall-radius-sm);border-bottom-right-radius:var(--fantasy-fall-radius-sm);animation:fantasy-fall-up var(--fantasy-fall-duration) ease-out var(--fantasy-fall-delay) forwards}.fantasy-fall-down[data-v-e62bf496]:before{content:"";display:block;position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--fantasy-fall-color);transform:translateY(100%);border-top-left-radius:var(--fantasy-fall-radius-sm);border-top-right-radius:var(--fantasy-fall-radius-sm);animation:fantasy-fall-down var(--fantasy-fall-duration) ease-out var(--fantasy-fall-delay) forwards}.fantasy-fall-left[data-v-e62bf496]:before{content:"";display:block;position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--fantasy-fall-color);transform:translate(-100%);border-top-right-radius:var(--fantasy-fall-radius-sm);border-bottom-right-radius:var(--fantasy-fall-radius-sm);animation:fantasy-fall-left var(--fantasy-fall-duration) ease-out var(--fantasy-fall-delay) forwards}.fantasy-fall-right[data-v-e62bf496]:before{content:"";display:block;position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--fantasy-fall-color);transform:translate(100%);border-top-left-radius:var(--fantasy-fall-radius-sm);border-bottom-left-radius:var(--fantasy-fall-radius-sm);animation:fantasy-fall-right var(--fantasy-fall-duration) ease-out var(--fantasy-fall-delay) forwards}@media (min-width: 768px){.fantasy-fall-up[data-v-e62bf496]:before{border-bottom-left-radius:var(--fantasy-fall-radius-md);border-bottom-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-down[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-md);border-top-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-left[data-v-e62bf496]:before{border-top-right-radius:var(--fantasy-fall-radius-md);border-bottom-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-right[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-md);border-bottom-left-radius:var(--fantasy-fall-radius-md)}}@media (min-width: 1024px){.fantasy-fall-up[data-v-e62bf496]:before{border-bottom-left-radius:var(--fantasy-fall-radius-lg);border-bottom-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-down[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-lg);border-top-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-left[data-v-e62bf496]:before{border-top-right-radius:var(--fantasy-fall-radius-lg);border-bottom-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-right[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-lg);border-bottom-left-radius:var(--fantasy-fall-radius-lg)}}@keyframes fantasy-fall-up{0%{transform:translateY(-100%)}50%{transform:translateY(0)}to{transform:translateY(0);border-bottom-right-radius:0%;border-bottom-left-radius:0%}}@keyframes fantasy-fall-down{0%{transform:translateY(100%)}50%{transform:translateY(0)}to{transform:translateY(0);border-top-right-radius:0%;border-top-left-radius:0%}}@keyframes fantasy-fall-left{0%{transform:translate(-100%)}50%{transform:translate(0)}to{transform:translate(0);border-top-right-radius:0%;border-bottom-right-radius:0%}}@keyframes fantasy-fall-right{0%{transform:translate(100%)}50%{transform:translate(0)}to{transform:translate(0);border-top-left-radius:0%;border-bottom-left-radius:0%}}.stage-transition-4[data-v-6d1179fc]{--delay: 0s;position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden;display:grid;grid-template-rows:repeat(5,1fr)}.stage-transition-4__block[data-v-6d1179fc]{position:relative;width:100%;height:100%}.stage-transition-4__block[data-v-6d1179fc]:before,.stage-transition-4__block[data-v-6d1179fc]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;animation:slideIn-6d1179fc .8s cubic-bezier(.87,.05,.02,.97) both,slideOut-6d1179fc .8s cubic-bezier(.87,.05,.02,.97) forwards}.stage-transition-4__block[data-v-6d1179fc]:before{background-color:var(--stage-transition-4-overlay-color-2);animation-delay:calc(0s + var(--d, 0s) + var(--delay, 0s)),calc(1.6s + var(--d, 0s) + var(--delay, 0s))}.stage-transition-4__block[data-v-6d1179fc]:after{background-color:var(--stage-transition-4-overlay-color-1);animation-delay:calc(.3s + var(--d, 0s) + var(--delay, 0s)),calc(1.3s + var(--d, 0s) + var(--delay, 0s))}.stage-transition-4__block[data-v-6d1179fc]:nth-child(1){--d: .1s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(2){--d: .3s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(3){--d: 0s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(4){--d: .4s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(5){--d: .2s}@keyframes slideIn-6d1179fc{0%{transform:translate(-101%)}to{transform:translate(0)}}@keyframes slideOut-6d1179fc{0%{transform:translate(0)}to{transform:translate(101%)}}.stage-transition-1[data-v-bf1d1566]{--delay: 0s;position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.stage-transition-1[data-v-bf1d1566]:before,.stage-transition-1[data-v-bf1d1566]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;animation:slideIn-bf1d1566 1s cubic-bezier(.87,.05,.02,.97) both,slideOut-bf1d1566 1s cubic-bezier(.87,.05,.02,.97) forwards}.stage-transition-1[data-v-bf1d1566]:before{background-color:var(--stage-transition-1-overlay-color-2);animation-delay:calc(0s + var(--delay, 0s)),calc(1.4s + var(--delay, 0s))}.stage-transition-1[data-v-bf1d1566]:after{background-color:var(--stage-transition-1-overlay-color-1);animation-delay:calc(.2s + var(--delay, 0s)),calc(1.2s + var(--delay, 0s))}@keyframes slideIn-bf1d1566{0%{transform:translate(-101%)}to{transform:translate(0)}}@keyframes slideOut-bf1d1566{0%{transform:translate(0)}to{transform:translate(101%)}}.stage-transition-2[data-v-8ff7120f]{--delay: 0s;--skew-x: 100%;position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.stage-transition-2[data-v-8ff7120f]:before,.stage-transition-2[data-v-8ff7120f]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;animation:maskIn-8ff7120f 1s cubic-bezier(.87,.05,.02,.97) both,maskOut-8ff7120f 1s cubic-bezier(.87,.05,.02,.97) forwards}.stage-transition-2[data-v-8ff7120f]:before{background-color:var(--stage-transition-2-overlay-color-2);animation-delay:calc(0s + var(--delay, 0s)),calc(1.4s + var(--delay, 0s))}.stage-transition-2[data-v-8ff7120f]:after{background-color:var(--stage-transition-2-overlay-color-1);animation-delay:calc(.2s + var(--delay, 0s)),calc(1.2s + var(--delay, 0s))}@keyframes maskIn-8ff7120f{0%{clip-path:polygon(0 0,0 0,calc(var(--skew-x, 0) * -1) 100%,calc(var(--skew-x, 0) * -1) 100%)}to{clip-path:polygon(0 0,calc(100% + var(--skew-x, 0)) 0,100% 100%,calc(var(--skew-x, 0) * -1) 100%)}}@keyframes maskOut-8ff7120f{0%{clip-path:polygon(0 0,calc(100% + var(--skew-x, 0)) 0,100% 100%,calc(var(--skew-x, 0) * -1) 100%)}to{clip-path:polygon(calc(100% + var(--skew-x, 0)) 0,calc(100% + var(--skew-x, 0)) 0,100% 100%,100% 100%)}}.rectangle-rotate-transition[data-v-f4b1dc64]{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.rectangle[data-v-f4b1dc64]{position:absolute;width:100%;height:100%}.rectangle div[data-v-f4b1dc64]{position:absolute;width:100vmax;height:100vmax;transform:scale(0)}.rectangle-rotate-1 div[data-v-f4b1dc64]{top:-50vmax;left:-50vmax;background-color:var(--rectangle-rotate-1-color);animation:expand-rotate-f4b1dc64 var(--rectangle-rotate-duration) ease calc(var(--rectangle-rotate-delay) + 0s) forwards}.rectangle-rotate-2 div[data-v-f4b1dc64]{bottom:-50vmax;right:-50vmax;background-color:var(--rectangle-rotate-2-color);animation:expand-rotate-f4b1dc64 var(--rectangle-rotate-duration) ease calc(var(--rectangle-rotate-delay) + var(--rectangle-rotate-stagger)) forwards}.rectangle-rotate-3 div[data-v-f4b1dc64]{top:calc(50% - 50vmax);left:calc(50% - 50vmax);background-color:var(--rectangle-rotate-3-color);animation:expand-rotate-f4b1dc64 var(--rectangle-rotate-duration) ease calc(var(--rectangle-rotate-delay) + calc(var(--rectangle-rotate-stagger) * 2)) forwards}@keyframes expand-rotate-f4b1dc64{0%{transform:scale(0) rotate(0)}to{transform:scale(1) rotate(var(--rectangle-rotate-rotation))}}@property --chromatic-hue{syntax: ""; initial-value: 0; inherits: true;}@keyframes hue-anim{0%{--chromatic-hue: 0}to{--chromatic-hue: 360}}.dynamic-hue{animation:hue-anim 10s linear infinite}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.slide-away-enter-active,.slide-away-leave-active{transition:transform .3s ease-in-out,opacity .3s ease-in-out}.slide-away-enter,.slide-away-leave-to{transform:translateY(-10px);opacity:0}.slide-away-enter-from,.slide-away-leave{transform:translateY(10px);opacity:0}:root{--bg-color-light: rgb(255 255 255);--bg-color-dark: rgb(18 18 18);--progress-bar-color: rgb(244 114 182);--bg-color: var(--bg-color-light)}html,body,#app{height:100%;margin:0;padding:0;overscroll-behavior:none}html{background:var(--bg-color);transition:all .3s ease-in-out}html.dark{--bg-color: var(--bg-color-dark);color-scheme:dark}#nprogress{pointer-events:none}#nprogress .bar{background:var(--progress-bar-color);opacity:.75;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }@font-face{font-family:DM Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v15/aFTU7PB1QTsUX8KYthSQBK6PYK3EXw.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v15/aFTU7PB1QTsUX8KYthqQBK6PYK0.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v16/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRR232RmYJp8I5zzw.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v16/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRSW32RmYJp8I5.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"DM Serif Display";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v16/-nFnOHM81r4j6k0gjAW3mujVU2B2G_5x0vrx52jJ3Q.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"DM Serif Display";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v16/-nFnOHM81r4j6k0gjAW3mujVU2B2G_Bx0vrx52g.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.2.woff2) format("woff2");unicode-range:U+d723-d728,U+d72a-d733,U+d735-d748,U+d74a-d74f,U+d752-d753,U+d755-d757,U+d75a-d75f,U+d762-d764,U+d766-d768,U+d76a-d76b,U+d76d-d76f,U+d771-d787,U+d789-d78b,U+d78d-d78f,U+d791-d797,U+d79a,U+d79c,U+d79e-d7a3,U+f900-f909,U+f90b-f92e}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.3.woff2) format("woff2");unicode-range:U+d679-d68b,U+d68e-d69e,U+d6a0,U+d6a2-d6a7,U+d6a9-d6c3,U+d6c6-d6c7,U+d6c9-d6cb,U+d6cd-d6d3,U+d6d5-d6d6,U+d6d8-d6e3,U+d6e5-d6e7,U+d6e9-d6fb,U+d6fd-d717,U+d719-d71f,U+d721-d722}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.4.woff2) format("woff2");unicode-range:U+d5bc-d5c7,U+d5ca-d5cb,U+d5cd-d5cf,U+d5d1-d5d7,U+d5d9-d5da,U+d5dc,U+d5de-d5e3,U+d5e6-d5e7,U+d5e9-d5eb,U+d5ed-d5f6,U+d5f8,U+d5fa-d5ff,U+d602-d603,U+d605-d607,U+d609-d60f,U+d612-d613,U+d616-d61b,U+d61d-d637,U+d63a-d63b,U+d63d-d63f,U+d641-d647,U+d64a-d64c,U+d64e-d653,U+d656-d657,U+d659-d65b,U+d65d-d666,U+d668,U+d66a-d678}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.5.woff2) format("woff2");unicode-range:U+d507,U+d509-d50b,U+d50d-d513,U+d515-d53b,U+d53e-d53f,U+d541-d543,U+d545-d54c,U+d54e,U+d550,U+d552-d557,U+d55a-d55b,U+d55d-d55f,U+d561-d564,U+d566-d567,U+d56a,U+d56c,U+d56e-d573,U+d576-d577,U+d579-d583,U+d585-d586,U+d58a-d5a4,U+d5a6-d5bb}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.6.woff2) format("woff2");unicode-range:U+d464-d477,U+d47a-d47b,U+d47d-d47f,U+d481-d487,U+d489-d48a,U+d48c,U+d48e-d4e7,U+d4e9-d503,U+d505-d506}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.7.woff2) format("woff2");unicode-range:U+d3bf-d3c7,U+d3ca-d3cf,U+d3d1-d3eb,U+d3ee-d3ef,U+d3f1-d3f3,U+d3f5-d3fb,U+d3fd-d400,U+d402-d45b,U+d45d-d463}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.8.woff2) format("woff2");unicode-range:U+d2ff,U+d302-d304,U+d306-d30b,U+d30f,U+d311-d313,U+d315-d31b,U+d31e,U+d322-d324,U+d326-d327,U+d32a-d32b,U+d32d-d32f,U+d331-d337,U+d339-d33c,U+d33e-d37b,U+d37e-d37f,U+d381-d383,U+d385-d38b,U+d38e-d390,U+d392-d397,U+d39a-d39b,U+d39d-d39f,U+d3a1-d3a7,U+d3a9-d3aa,U+d3ac,U+d3ae-d3b3,U+d3b5-d3b7,U+d3b9-d3bb,U+d3bd-d3be}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.9.woff2) format("woff2");unicode-range:U+d257-d27f,U+d281-d29b,U+d29d-d29f,U+d2a1-d2ab,U+d2ad-d2b7,U+d2ba-d2bb,U+d2bd-d2bf,U+d2c1-d2c7,U+d2c9-d2ef,U+d2f2-d2f3,U+d2f5-d2f7,U+d2f9-d2fe}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.10.woff2) format("woff2");unicode-range:U+d1b4,U+d1b6-d1f3,U+d1f5-d22b,U+d22e-d22f,U+d231-d233,U+d235-d23b,U+d23d-d240,U+d242-d256}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.11.woff2) format("woff2");unicode-range:U+d105-d12f,U+d132-d133,U+d135-d137,U+d139-d13f,U+d141-d142,U+d144,U+d146-d14b,U+d14e-d14f,U+d151-d153,U+d155-d15b,U+d15e-d187,U+d189-d19f,U+d1a2-d1a3,U+d1a5-d1a7,U+d1a9-d1af,U+d1b2-d1b3}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.12.woff2) format("woff2");unicode-range:U+d04b-d04f,U+d051-d057,U+d059-d06b,U+d06d-d06f,U+d071-d073,U+d075-d07b,U+d07e-d0a3,U+d0a6-d0a7,U+d0a9-d0ab,U+d0ad-d0b3,U+d0b6,U+d0b8,U+d0ba-d0bf,U+d0c2-d0c3,U+d0c5-d0c7,U+d0c9-d0cf,U+d0d2,U+d0d6-d0db,U+d0de-d0df,U+d0e1-d0e3,U+d0e5-d0eb,U+d0ee-d0f0,U+d0f2-d104}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.13.woff2) format("woff2");unicode-range:U+cfa2-cfc3,U+cfc5-cfdf,U+cfe2-cfe3,U+cfe5-cfe7,U+cfe9-cff4,U+cff6-cffb,U+cffd-cfff,U+d001-d003,U+d005-d017,U+d019-d033,U+d036-d037,U+d039-d03b,U+d03d-d04a}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.14.woff2) format("woff2");unicode-range:U+cef0-cef3,U+cef6,U+cef9-ceff,U+cf01-cf03,U+cf05-cf07,U+cf09-cf0f,U+cf11-cf12,U+cf14-cf1b,U+cf1d-cf1f,U+cf21-cf2f,U+cf31-cf53,U+cf56-cf57,U+cf59-cf5b,U+cf5d-cf63,U+cf66,U+cf68,U+cf6a-cf6f,U+cf71-cf84,U+cf86-cf8b,U+cf8d-cfa1}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.15.woff2) format("woff2");unicode-range:U+ce3c-ce57,U+ce5a-ce5b,U+ce5d-ce5f,U+ce61-ce67,U+ce6a,U+ce6c,U+ce6e-ce73,U+ce76-ce77,U+ce79-ce7b,U+ce7d-ce83,U+ce85-ce88,U+ce8a-ce8f,U+ce91-ce93,U+ce95-ce97,U+ce99-ce9f,U+cea2,U+cea4-ceab,U+cead-cee3,U+cee6-cee7,U+cee9-ceeb,U+ceed-ceef}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.16.woff2) format("woff2");unicode-range:U+cd92-cd93,U+cd96-cd97,U+cd99-cd9b,U+cd9d-cda3,U+cda6-cda8,U+cdaa-cdaf,U+cdb1-cdc3,U+cdc5-cdcb,U+cdcd-cde7,U+cde9-ce03,U+ce05-ce1f,U+ce22-ce34,U+ce36-ce3b}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.17.woff2) format("woff2");unicode-range:U+ccef-cd07,U+cd0a-cd0b,U+cd0d-cd1a,U+cd1c,U+cd1e-cd2b,U+cd2d-cd5b,U+cd5d-cd77,U+cd79-cd91}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.18.woff2) format("woff2");unicode-range:U+cc3f-cc43,U+cc46-cc47,U+cc49-cc4b,U+cc4d-cc53,U+cc55-cc58,U+cc5a-cc5f,U+cc61-cc97,U+cc9a-cc9b,U+cc9d-cc9f,U+cca1-cca7,U+ccaa,U+ccac,U+ccae-ccb3,U+ccb6-ccb7,U+ccb9-ccbb,U+ccbd-cccf,U+ccd1-cce3,U+cce5-ccee}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.19.woff2) format("woff2");unicode-range:U+cb91-cbd3,U+cbd5-cbe3,U+cbe5-cc0b,U+cc0e-cc0f,U+cc11-cc13,U+cc15-cc1b,U+cc1d-cc20,U+cc23-cc27,U+cc2a-cc2b,U+cc2d,U+cc2f,U+cc31-cc37,U+cc3a,U+cc3c}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.20.woff2) format("woff2");unicode-range:U+caf4-cb47,U+cb4a-cb90}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.21.woff2) format("woff2");unicode-range:U+ca4a-ca4b,U+ca4e-ca4f,U+ca51-ca53,U+ca55-ca5b,U+ca5d-ca60,U+ca62-ca83,U+ca85-cabb,U+cabe-cabf,U+cac1-cac3,U+cac5-cacb,U+cacd-cad0,U+cad2,U+cad4-cad8,U+cada-caf3}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.22.woff2) format("woff2");unicode-range:U+c996-c997,U+c99a-c99c,U+c99e-c9bf,U+c9c2-c9c3,U+c9c5-c9c7,U+c9c9-c9cf,U+c9d2,U+c9d4,U+c9d7-c9d8,U+c9db,U+c9de-c9df,U+c9e1-c9e3,U+c9e5-c9e6,U+c9e8-c9eb,U+c9ee-c9f0,U+c9f2-c9f7,U+c9f9-ca0b,U+ca0d-ca28,U+ca2a-ca49}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.23.woff2) format("woff2");unicode-range:U+c8e9-c8f4,U+c8f6-c8fb,U+c8fe-c8ff,U+c901-c903,U+c905-c90b,U+c90e-c910,U+c912-c917,U+c919-c92b,U+c92d-c94f,U+c951-c953,U+c955-c96b,U+c96d-c973,U+c975-c987,U+c98a-c98b,U+c98d-c98f,U+c991-c995}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.24.woff2) format("woff2");unicode-range:U+c841-c84b,U+c84d-c86f,U+c872-c873,U+c875-c877,U+c879-c87f,U+c882-c884,U+c887-c88a,U+c88d-c8c3,U+c8c5-c8df,U+c8e1-c8e8}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.25.woff2) format("woff2");unicode-range:U+c779-c77b,U+c77e-c782,U+c786,U+c78b,U+c78d,U+c78f,U+c792-c793,U+c795,U+c797,U+c799-c79f,U+c7a2,U+c7a7-c7ab,U+c7ae-c7bb,U+c7bd-c7c0,U+c7c2-c7c7,U+c7c9-c7dc,U+c7de-c7ff,U+c802-c803,U+c805-c807,U+c809,U+c80b-c80f,U+c812,U+c814,U+c817-c81b,U+c81e-c81f,U+c821-c823,U+c825-c82e,U+c830-c837,U+c839-c83b,U+c83d-c840}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.26.woff2) format("woff2");unicode-range:U+c6bb-c6bf,U+c6c2,U+c6c4,U+c6c6-c6cb,U+c6ce-c6cf,U+c6d1-c6d3,U+c6d5-c6db,U+c6dd-c6df,U+c6e1-c6e7,U+c6e9-c6eb,U+c6ed-c6ef,U+c6f1-c6f8,U+c6fa-c703,U+c705-c707,U+c709-c70b,U+c70d-c716,U+c718,U+c71a-c71f,U+c722-c723,U+c725-c727,U+c729-c734,U+c736-c73b,U+c73e-c73f,U+c741-c743,U+c745-c74b,U+c74e-c750,U+c752-c757,U+c759-c773,U+c776-c777}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.27.woff2) format("woff2");unicode-range:U+c5f5-c5fb,U+c5fe,U+c602-c605,U+c607,U+c609-c60f,U+c611-c61a,U+c61c-c623,U+c626-c627,U+c629-c62b,U+c62d,U+c62f-c632,U+c636,U+c638,U+c63a-c63f,U+c642-c643,U+c645-c647,U+c649-c652,U+c656-c65b,U+c65d-c65f,U+c661-c663,U+c665-c677,U+c679-c67b,U+c67d-c693,U+c696-c697,U+c699-c69b,U+c69d-c6a3,U+c6a6,U+c6a8,U+c6aa-c6af,U+c6b2-c6b3,U+c6b5-c6b7,U+c6b9-c6ba}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.28.woff2) format("woff2");unicode-range:U+c517-c527,U+c52a-c52b,U+c52d-c52f,U+c531-c538,U+c53a,U+c53c,U+c53e-c543,U+c546-c547,U+c54b,U+c54d-c552,U+c556,U+c55a-c55b,U+c55d,U+c55f,U+c562-c563,U+c565-c567,U+c569-c56f,U+c572,U+c574,U+c576-c57b,U+c57e-c57f,U+c581-c583,U+c585-c586,U+c588-c58b,U+c58e,U+c590,U+c592-c596,U+c599-c5b3,U+c5b6-c5b7,U+c5ba,U+c5be-c5c3,U+c5ca-c5cb,U+c5cd,U+c5cf,U+c5d2-c5d3,U+c5d5-c5d7,U+c5d9-c5df,U+c5e1-c5e2,U+c5e4,U+c5e6-c5eb,U+c5ef,U+c5f1-c5f3}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.29.woff2) format("woff2");unicode-range:U+c475-c4ef,U+c4f2-c4f3,U+c4f5-c4f7,U+c4f9-c4ff,U+c502-c50b,U+c50d-c516}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.30.woff2) format("woff2");unicode-range:U+c3d0-c3d7,U+c3da-c3db,U+c3dd-c3de,U+c3e1-c3ec,U+c3ee-c3f3,U+c3f5-c42b,U+c42d-c463,U+c466-c474}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.31.woff2) format("woff2");unicode-range:U+c32b-c367,U+c36a-c36b,U+c36d-c36f,U+c371-c377,U+c37a-c37b,U+c37e-c383,U+c385-c387,U+c389-c3cf}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.32.woff2) format("woff2");unicode-range:U+c26a-c26b,U+c26d-c26f,U+c271-c273,U+c275-c27b,U+c27e-c287,U+c289-c28f,U+c291-c297,U+c299-c29a,U+c29c-c2a3,U+c2a5-c2a7,U+c2a9-c2ab,U+c2ad-c2b3,U+c2b6,U+c2b8,U+c2ba-c2bb,U+c2bd-c2db,U+c2de-c2df,U+c2e1-c2e2,U+c2e5-c2ea,U+c2ee,U+c2f0,U+c2f2-c2f5,U+c2f7,U+c2fa-c2fb,U+c2fd-c2ff,U+c301-c307,U+c309-c30c,U+c30e-c312,U+c315-c323,U+c325-c328,U+c32a}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.33.woff2) format("woff2");unicode-range:U+c1bc-c1c3,U+c1c5-c1df,U+c1e1-c1fb,U+c1fd-c203,U+c205-c20c,U+c20e,U+c210-c217,U+c21a-c21b,U+c21d-c21e,U+c221-c227,U+c229-c22a,U+c22c,U+c22e,U+c230,U+c233-c24f,U+c251-c257,U+c259-c269}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.34.woff2) format("woff2");unicode-range:U+c101-c11b,U+c11f,U+c121-c123,U+c125-c12b,U+c12e,U+c132-c137,U+c13a-c13b,U+c13d-c13f,U+c141-c147,U+c14a,U+c14c-c153,U+c155-c157,U+c159-c15b,U+c15d-c166,U+c169-c16f,U+c171-c177,U+c179-c18b,U+c18e-c18f,U+c191-c193,U+c195-c19b,U+c19d-c19e,U+c1a0,U+c1a2-c1a4,U+c1a6-c1bb}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.35.woff2) format("woff2");unicode-range:U+c049-c057,U+c059-c05b,U+c05d-c05f,U+c061-c067,U+c069-c08f,U+c091-c0ab,U+c0ae-c0af,U+c0b1-c0b3,U+c0b5,U+c0b7-c0bb,U+c0be,U+c0c2-c0c7,U+c0ca-c0cb,U+c0cd-c0cf,U+c0d1-c0d7,U+c0d9-c0da,U+c0dc,U+c0de-c0e3,U+c0e5-c0eb,U+c0ed-c0f3,U+c0f6,U+c0f8,U+c0fa-c0ff}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.36.woff2) format("woff2");unicode-range:U+bfa7-bfaf,U+bfb1-bfc4,U+bfc6-bfcb,U+bfce-bfcf,U+bfd1-bfd3,U+bfd5-bfdb,U+bfdd-c048}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.37.woff2) format("woff2");unicode-range:U+bf07,U+bf09-bf3f,U+bf41-bf4f,U+bf52-bf54,U+bf56-bfa6}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.38.woff2) format("woff2");unicode-range:U+be56,U+be58,U+be5c-be5f,U+be62-be63,U+be65-be67,U+be69-be74,U+be76-be7b,U+be7e-be7f,U+be81-be8e,U+be90,U+be92-bea7,U+bea9-becf,U+bed2-bed3,U+bed5-bed6,U+bed9-bee3,U+bee6-bf06}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.39.woff2) format("woff2");unicode-range:U+bdb0-bdd3,U+bdd5-bdef,U+bdf1-be0b,U+be0d-be0f,U+be11-be13,U+be15-be43,U+be46-be47,U+be49-be4b,U+be4d-be53}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.40.woff2) format("woff2");unicode-range:U+bd03,U+bd06,U+bd08,U+bd0a-bd0f,U+bd11-bd22,U+bd25-bd47,U+bd49-bd58,U+bd5a-bd7f,U+bd82-bd83,U+bd85-bd87,U+bd8a-bd8f,U+bd91-bd92,U+bd94,U+bd96-bd98,U+bd9a-bdaf}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.41.woff2) format("woff2");unicode-range:U+bc4e-bc83,U+bc86-bc87,U+bc89-bc8b,U+bc8d-bc93,U+bc96,U+bc98,U+bc9b-bc9f,U+bca2-bca3,U+bca5-bca7,U+bca9-bcb2,U+bcb4-bcbb,U+bcbe-bcbf,U+bcc1-bcc3,U+bcc5-bccc,U+bcce-bcd0,U+bcd2-bcd4,U+bcd6-bcf3,U+bcf7,U+bcf9-bcfb,U+bcfd-bd02}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.42.woff2) format("woff2");unicode-range:U+bb90-bba3,U+bba5-bbab,U+bbad-bbbf,U+bbc1-bbf7,U+bbfa-bbfb,U+bbfd-bbfe,U+bc01-bc07,U+bc09-bc0a,U+bc0e,U+bc10,U+bc12-bc13,U+bc17,U+bc19-bc1a,U+bc1e,U+bc20-bc23,U+bc26,U+bc28,U+bc2a-bc2c,U+bc2e-bc2f,U+bc32-bc33,U+bc35-bc37,U+bc39-bc3f,U+bc41-bc42,U+bc44,U+bc46-bc48,U+bc4a-bc4d}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.43.woff2) format("woff2");unicode-range:U+bae6-bafb,U+bafd-bb17,U+bb19-bb33,U+bb37,U+bb39-bb3a,U+bb3d-bb43,U+bb45-bb46,U+bb48,U+bb4a-bb4f,U+bb51-bb53,U+bb55-bb57,U+bb59-bb62,U+bb64-bb8f}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.44.woff2) format("woff2");unicode-range:U+ba30-ba37,U+ba3a-ba3b,U+ba3d-ba3f,U+ba41-ba47,U+ba49-ba4a,U+ba4c,U+ba4e-ba53,U+ba56-ba57,U+ba59-ba5b,U+ba5d-ba63,U+ba65-ba66,U+ba68-ba6f,U+ba71-ba73,U+ba75-ba77,U+ba79-ba84,U+ba86,U+ba88-baa7,U+baaa,U+baad-baaf,U+bab1-bab7,U+baba,U+babc,U+babe-bae5}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.45.woff2) format("woff2");unicode-range:U+b96e-b973,U+b976-b977,U+b979-b97b,U+b97d-b983,U+b986,U+b988,U+b98a-b98d,U+b98f-b9ab,U+b9ae-b9af,U+b9b1-b9b3,U+b9b5-b9bb,U+b9be,U+b9c0,U+b9c2-b9c7,U+b9ca-b9cb,U+b9cd,U+b9d2-b9d7,U+b9da,U+b9dc,U+b9df-b9e0,U+b9e2,U+b9e6-b9e7,U+b9e9-b9f3,U+b9f6,U+b9f8,U+b9fb-ba2f}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.46.woff2) format("woff2");unicode-range:U+b8bf-b8cb,U+b8cd-b8e0,U+b8e2-b8e7,U+b8ea-b8eb,U+b8ed-b8ef,U+b8f1-b8f7,U+b8fa,U+b8fc,U+b8fe-b903,U+b905-b917,U+b919-b91f,U+b921-b93b,U+b93d-b957,U+b95a-b95b,U+b95d-b95f,U+b961-b967,U+b969-b96c}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.47.woff2) format("woff2");unicode-range:U+b80d-b80f,U+b811-b817,U+b81a,U+b81c-b823,U+b826-b827,U+b829-b82b,U+b82d-b833,U+b836,U+b83a-b83f,U+b841-b85b,U+b85e-b85f,U+b861-b863,U+b865-b86b,U+b86e,U+b870,U+b872-b8af,U+b8b1-b8be}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.48.woff2) format("woff2");unicode-range:U+b74d-b75f,U+b761-b763,U+b765-b774,U+b776-b77b,U+b77e-b77f,U+b781-b783,U+b785-b78b,U+b78e,U+b792-b796,U+b79a-b79b,U+b79d-b7a7,U+b7aa,U+b7ae-b7b3,U+b7b6-b7c8,U+b7ca-b7eb,U+b7ee-b7ef,U+b7f1-b7f3,U+b7f5-b7fb,U+b7fe,U+b802-b806,U+b80a-b80b}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.49.woff2) format("woff2");unicode-range:U+b6a7-b6aa,U+b6ac-b6b0,U+b6b2-b6ef,U+b6f1-b727,U+b72a-b72b,U+b72d-b72e,U+b731-b737,U+b739-b73a,U+b73c-b743,U+b745-b74c}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.50.woff2) format("woff2");unicode-range:U+b605-b60f,U+b612-b617,U+b619-b624,U+b626-b69b,U+b69e-b6a3,U+b6a5-b6a6}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.51.woff2) format("woff2");unicode-range:U+b55f,U+b562-b583,U+b585-b59f,U+b5a2-b5a3,U+b5a5-b5a7,U+b5a9-b5b2,U+b5b5-b5ba,U+b5bd-b604}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.52.woff2) format("woff2");unicode-range:U+b4a5-b4b6,U+b4b8-b4bf,U+b4c1-b4c7,U+b4c9-b4db,U+b4de-b4df,U+b4e1-b4e2,U+b4e5-b4eb,U+b4ee,U+b4f0,U+b4f2-b513,U+b516-b517,U+b519-b51a,U+b51d-b523,U+b526,U+b528,U+b52b-b52f,U+b532-b533,U+b535-b537,U+b539-b53f,U+b541-b544,U+b546-b54b,U+b54d-b54f,U+b551-b55b,U+b55d-b55e}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.53.woff2) format("woff2");unicode-range:U+b3f8-b3fb,U+b3fd-b40f,U+b411-b417,U+b419-b41b,U+b41d-b41f,U+b421-b427,U+b42a-b42b,U+b42d-b44f,U+b452-b453,U+b455-b457,U+b459-b45f,U+b462-b464,U+b466-b46b,U+b46d-b47f,U+b481-b4a3}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.54.woff2) format("woff2");unicode-range:U+b342-b353,U+b356-b357,U+b359-b35b,U+b35d-b35e,U+b360-b363,U+b366,U+b368,U+b36a-b36d,U+b36f,U+b372-b373,U+b375-b377,U+b379-b37f,U+b381-b382,U+b384,U+b386-b38b,U+b38d-b3c3,U+b3c6-b3c7,U+b3c9-b3ca,U+b3cd-b3d3,U+b3d6,U+b3d8,U+b3da-b3f7}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.55.woff2) format("woff2");unicode-range:U+b27c-b283,U+b285-b28f,U+b292-b293,U+b295-b297,U+b29a-b29f,U+b2a1-b2a4,U+b2a7-b2a9,U+b2ab,U+b2ad-b2c7,U+b2ca-b2cb,U+b2cd-b2cf,U+b2d1-b2d7,U+b2da,U+b2dc,U+b2de-b2e3,U+b2e7,U+b2e9-b2ea,U+b2ef-b2f3,U+b2f6,U+b2f8,U+b2fa-b2fb,U+b2fd-b2fe,U+b302-b303,U+b305-b307,U+b309-b30f,U+b312,U+b316-b31b,U+b31d-b341}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.56.woff2) format("woff2");unicode-range:U+b1d6-b1e7,U+b1e9-b1fc,U+b1fe-b203,U+b206-b207,U+b209-b20b,U+b20d-b213,U+b216-b21f,U+b221-b257,U+b259-b273,U+b275-b27b}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.57.woff2) format("woff2");unicode-range:U+b120-b122,U+b126-b127,U+b129-b12b,U+b12d-b133,U+b136,U+b138,U+b13a-b13f,U+b142-b143,U+b145-b14f,U+b151-b153,U+b156-b157,U+b159-b177,U+b17a-b17b,U+b17d-b17f,U+b181-b187,U+b189-b18c,U+b18e-b191,U+b195-b1a7,U+b1a9-b1cb,U+b1cd-b1d5}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.58.woff2) format("woff2");unicode-range:U+b05f-b07b,U+b07e-b07f,U+b081-b083,U+b085-b08b,U+b08d-b097,U+b09b,U+b09d-b09f,U+b0a2-b0a7,U+b0aa,U+b0b0,U+b0b2,U+b0b6-b0b7,U+b0b9-b0bb,U+b0bd-b0c3,U+b0c6-b0c7,U+b0ca-b0cf,U+b0d1-b0df,U+b0e1-b0e4,U+b0e6-b107,U+b10a-b10b,U+b10d-b10f,U+b111-b112,U+b114-b117,U+b119-b11a,U+b11c-b11f}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.59.woff2) format("woff2");unicode-range:U+afac-afb7,U+afba-afbb,U+afbd-afbf,U+afc1-afc6,U+afca-afcc,U+afce-afd3,U+afd5-afe7,U+afe9-afef,U+aff1-b00b,U+b00d-b00f,U+b011-b013,U+b015-b01b,U+b01d-b027,U+b029-b043,U+b045-b047,U+b049,U+b04b,U+b04d-b052,U+b055-b056,U+b058-b05c,U+b05e}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.60.woff2) format("woff2");unicode-range:U+af03-af07,U+af09-af2b,U+af2e-af33,U+af35-af3b,U+af3e-af40,U+af44-af47,U+af4a-af5c,U+af5e-af63,U+af65-af7f,U+af81-afab}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.61.woff2) format("woff2");unicode-range:U+ae56-ae5b,U+ae5e-ae60,U+ae62-ae64,U+ae66-ae67,U+ae69-ae6b,U+ae6d-ae83,U+ae85-aebb,U+aebf,U+aec1-aec3,U+aec5-aecb,U+aece,U+aed0,U+aed2-aed7,U+aed9-aef3,U+aef5-af02}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.62.woff2) format("woff2");unicode-range:U+ad9c-ada3,U+ada5-adbf,U+adc1-adc3,U+adc5-adc7,U+adc9-add2,U+add4-addb,U+addd-addf,U+ade1-ade3,U+ade5-adf7,U+adfa-adfb,U+adfd-adff,U+ae02-ae07,U+ae0a,U+ae0c,U+ae0e-ae13,U+ae15-ae2f,U+ae31-ae33,U+ae35-ae37,U+ae39-ae3f,U+ae42,U+ae44,U+ae46-ae49,U+ae4b,U+ae4f,U+ae51-ae53,U+ae55}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.63.woff2) format("woff2");unicode-range:U+ace2-ace3,U+ace5-ace6,U+ace9-acef,U+acf2,U+acf4,U+acf7-acfb,U+acfe-acff,U+ad01-ad03,U+ad05-ad0b,U+ad0d-ad10,U+ad12-ad1b,U+ad1d-ad33,U+ad35-ad48,U+ad4a-ad4f,U+ad51-ad6b,U+ad6e-ad6f,U+ad71-ad72,U+ad77-ad7c,U+ad7e,U+ad80,U+ad82-ad87,U+ad89-ad8b,U+ad8d-ad8f,U+ad91-ad9b}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.64.woff2) format("woff2");unicode-range:U+ac25-ac2c,U+ac2e,U+ac30,U+ac32-ac37,U+ac39-ac3f,U+ac41-ac4c,U+ac4e-ac6f,U+ac72-ac73,U+ac75-ac76,U+ac79-ac7f,U+ac82,U+ac84-ac88,U+ac8a-ac8b,U+ac8d-ac8f,U+ac91-ac93,U+ac95-ac9b,U+ac9d-ac9e,U+aca1-aca7,U+acab,U+acad-acaf,U+acb1-acb7,U+acba-acbb,U+acbe-acc0,U+acc2-acc3,U+acc5-acdf}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.65.woff2) format("woff2");unicode-range:U+99df,U+99ed,U+99f1,U+99ff,U+9a01,U+9a08,U+9a0e-9a0f,U+9a19,U+9a2b,U+9a30,U+9a36-9a37,U+9a40,U+9a43,U+9a45,U+9a4d,U+9a55,U+9a57,U+9a5a-9a5b,U+9a5f,U+9a62,U+9a65,U+9a69-9a6a,U+9aa8,U+9ab8,U+9ad3,U+9ae5,U+9aee,U+9b1a,U+9b27,U+9b2a,U+9b31,U+9b3c,U+9b41-9b45,U+9b4f,U+9b54,U+9b5a,U+9b6f,U+9b8e,U+9b91,U+9b9f,U+9bab,U+9bae,U+9bc9,U+9bd6,U+9be4,U+9be8,U+9c0d,U+9c10,U+9c12,U+9c15,U+9c25,U+9c32,U+9c3b,U+9c47,U+9c49,U+9c57,U+9ce5,U+9ce7,U+9ce9,U+9cf3-9cf4,U+9cf6,U+9d09,U+9d1b,U+9d26,U+9d28,U+9d3b,U+9d51,U+9d5d,U+9d60-9d61,U+9d6c,U+9d72,U+9da9,U+9daf,U+9db4,U+9dc4,U+9dd7,U+9df2,U+9df8-9dfa,U+9e1a,U+9e1e,U+9e75,U+9e79,U+9e7d,U+9e7f,U+9e92-9e93,U+9e97,U+9e9d,U+9e9f,U+9ea5,U+9eb4-9eb5,U+9ebb,U+9ebe,U+9ec3,U+9ecd-9ece,U+9ed4,U+9ed8,U+9edb-9edc,U+9ede,U+9ee8,U+9ef4,U+9f07-9f08,U+9f0e,U+9f13,U+9f20,U+9f3b,U+9f4a-9f4b,U+9f4e,U+9f52,U+9f5f,U+9f61,U+9f67,U+9f6a,U+9f6c,U+9f77,U+9f8d,U+9f90,U+9f95,U+9f9c,U+ac02-ac03,U+ac05-ac06,U+ac09-ac0f,U+ac17-ac18,U+ac1b,U+ac1e-ac1f,U+ac21-ac23}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.94.woff2) format("woff2");unicode-range:U+3136,U+3138,U+313a-3140,U+3143-3144,U+3150,U+3152,U+3154-3156,U+3158-315b,U+315d-315f,U+3162,U+3164-318c,U+318e,U+3200-321b,U+3231,U+3239,U+3251-325a,U+3260-327b,U+327e-327f,U+328a-3290,U+3294,U+329e,U+32a5,U+3380-3384,U+3388-338b}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.95.woff2) format("woff2");unicode-range:U+2f7d,U+2f7f-2f8b,U+2f8e-2f90,U+2f92-2f97,U+2f99-2fa0,U+2fa2-2fa3,U+2fa5-2fa9,U+2fac-2fb1,U+2fb3-2fbc,U+2fc1-2fca,U+2fcd-2fd4,U+3003,U+3012-3019,U+301c,U+301e-3020,U+3036,U+3041,U+3043,U+3045,U+3047,U+3049,U+304e,U+3050,U+3052,U+3056,U+305a,U+305c,U+305e,U+3062,U+3065,U+306c,U+3070-307d,U+3080,U+3085,U+3087,U+308e,U+3090-3091,U+30a1,U+30a5,U+30a9,U+30ae,U+30b1-30b2,U+30b4,U+30b6,U+30bc-30be,U+30c2,U+30c5,U+30cc,U+30d2,U+30d4,U+30d8-30dd,U+30e4,U+30e6,U+30e8,U+30ee,U+30f0-30f2,U+30f4-30f6,U+3133,U+3135}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.100.woff2) format("woff2");unicode-range:U+e8,U+2da,U+2160,U+2194,U+3054,U+3058,U+306d,U+3086,U+308d,U+30ac,U+30bb,U+30c4,U+30cd-30ce,U+30e2,U+3132,U+3146,U+3149,U+339d,U+4e3b,U+4f0a,U+4fdd,U+4fe1,U+5409,U+540c,U+5834,U+592a-592b,U+5b9a,U+5dde,U+5e0c,U+5e73,U+5f0f,U+60f3,U+653f,U+661f,U+662f,U+667a,U+683c,U+6b4c,U+6c11,U+767c,U+76ee,U+76f4,U+77f3,U+79d1,U+7a7a,U+7b2c,U+7d22,U+8207,U+8a00,U+8a71,U+9280,U+9580,U+958b,U+96c6,U+9762,U+98df,U+9ed1,U+ac2d,U+adc8,U+add3,U+af48,U+b014,U+b134-b135,U+b158,U+b2aa,U+b35f,U+b6a4,U+b9cf,U+bb63,U+bd23,U+be91,U+c29b,U+c3f4,U+c42c,U+c55c,U+c573,U+c58f,U+c78c,U+c7dd,U+c8f5,U+cad1,U+cc48,U+cf10,U+cf20,U+d03c,U+d07d,U+d2a0,U+d30e,U+d38d,U+d3a8,U+d3c8,U+d5e5,U+d5f9,U+d6e4,U+f90a,U+ff02,U+ff1c}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.101.woff2) format("woff2");unicode-range:U+3b1,U+2466,U+25a1,U+25a3,U+261c,U+3008-3009,U+305b,U+305d,U+3069,U+30a7,U+30ba,U+30cf,U+30ef,U+3151,U+3157,U+4e4b,U+4e5f,U+4e8c,U+4eca,U+4ed6,U+4f5b,U+50cf,U+5149,U+5165,U+5171,U+5229,U+529b,U+5316,U+539f,U+53f2,U+571f,U+5728,U+58eb,U+591c,U+5b78,U+5c11,U+5c55,U+5ddd,U+5e02,U+5fb7,U+60c5,U+610f,U+611f,U+6625,U+66f8,U+6797,U+679c,U+682a,U+6d2a,U+706b,U+7406,U+767b,U+76f8,U+77e5,U+7acb,U+898b,U+8a69,U+8def,U+8fd1,U+901a,U+90e8,U+91cd,U+975e,U+ae14,U+ae6c,U+aec0,U+afc7,U+afc9,U+b01c,U+b028,U+b308,U+b311,U+b314,U+b31c,U+b524,U+b560,U+b764,U+b920,U+b9e3,U+bd48,U+be7d,U+c0db,U+c231,U+c270,U+c2e3,U+c37d,U+c3ed,U+c530,U+c6a5,U+c6dc,U+c7a4,U+c954,U+c974,U+d000,U+d565,U+d667,U+d6c5,U+d79d,U+ff1e}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.102.woff2) format("woff2");unicode-range:U+131,U+2032,U+2465,U+2642,U+3048,U+3051,U+3083-3084,U+308f,U+30c0,U+30d1,U+30d3,U+30d6,U+30df,U+30e7,U+3153,U+4e16,U+4e8b,U+4ee5,U+5206,U+52a0,U+52d5,U+53e4,U+53ef,U+54c1,U+57ce,U+597d,U+5b8c,U+5ea6,U+5f8c,U+5f97,U+6210,U+6240,U+624b,U+6728,U+6bd4,U+7236,U+7269,U+7279,U+738b,U+7528,U+7530,U+767e,U+798f,U+8005,U+8a18,U+90fd,U+91cc,U+9577,U+9593,U+98a8,U+ac20,U+acf6,U+ad90,U+af5d,U+af80,U+afcd,U+aff0,U+b0a1,U+b0b5,U+b1fd,U+b2fc,U+b380,U+b51b,U+b584,U+b5b3,U+b8fd,U+b93c,U+b9f4,U+bb44,U+bc08,U+bc27,U+bc49,U+be55,U+be64,U+bfb0,U+bfc5,U+c178,U+c21f,U+c314,U+c4f1,U+c58d,U+c664,U+c698,U+c6a7,U+c6c1,U+c9ed,U+cac0,U+cacc,U+cad9,U+ccb5,U+cdcc,U+d0e4,U+d143,U+d320,U+d330,U+d54d,U+ff06,U+ff1f,U+ff5e}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.103.woff2) format("woff2");unicode-range:U+b4,U+20a9,U+20ac,U+2190,U+24d8,U+2502,U+2514,U+2592,U+25c7-25c8,U+2663,U+3060,U+3064,U+3081,U+3088,U+30a3,U+30a6,U+30aa,U+30b5,U+30c7,U+30ca-30cb,U+30d0,U+30e3,U+30e5,U+339e,U+4e09,U+4eac,U+4f5c,U+5167-5168,U+516c,U+51fa,U+5408,U+540d,U+591a,U+5b57,U+6211,U+65b9,U+660e,U+6642,U+6700,U+6b63,U+6e2f,U+7063,U+7532,U+793e,U+81ea,U+8272,U+82b1,U+897f,U+8eca,U+91ce,U+ac38,U+ad76,U+ae84,U+aecc,U+b07d,U+b0b1,U+b215,U+b2a0,U+b310,U+b3d7,U+b52a,U+b618,U+b775,U+b797,U+bcd5,U+bd59,U+be80,U+bea8,U+bed1,U+bee4-bee5,U+c060,U+c2ef,U+c329,U+c3dc,U+c597,U+c5bd,U+c5e5,U+c69c,U+c9d6,U+ca29,U+ca5c,U+ca84,U+cc39,U+cc3b,U+ce89,U+cee5,U+cf65,U+cf85,U+d058,U+d145,U+d22d,U+d325,U+d37d,U+d3ad,U+d769,U+ff0c}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.104.woff2) format("woff2");unicode-range:U+2161,U+2228,U+2299,U+2464,U+2517,U+2640,U+3042,U+304a,U+3053,U+3061,U+307f,U+3082,U+308c,U+3092,U+30a8,U+30ab,U+30ad,U+30b0,U+30b3,U+30b7,U+30c1,U+30c6,U+30c9,U+30d5,U+30d7,U+30de,U+30e0-30e1,U+30ec-30ed,U+4e0b,U+4e0d,U+4ee3,U+53f0,U+548c,U+5b89,U+5bb6,U+5c0f,U+611b,U+6771,U+6aa2,U+6bcd,U+6c34,U+6cd5,U+6d77,U+767d,U+795e,U+8ecd,U+9999,U+9ad8,U+ac07,U+ac1a,U+ac40,U+ad0c,U+ad88,U+ada4,U+ae01,U+ae65,U+aebd,U+aec4,U+afe8,U+b139,U+b205,U+b383,U+b38c,U+b42c,U+b461,U+b55c,U+b78f,U+b8fb,U+b9f7,U+bafc,U+bc99,U+bed8,U+bfcd,U+c0bf,U+c0f9,U+c167,U+c204,U+c20f,U+c22f,U+c258,U+c298,U+c2bc,U+c388,U+c501,U+c50c,U+c5b9,U+c5ce,U+c641,U+c648,U+c73d,U+ca50,U+ca61,U+cc4c,U+ceac,U+d0d4,U+d5f7,U+d6d7,U+ff1a}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.105.woff2) format("woff2");unicode-range:U+2103,U+2463,U+25c6,U+25cb,U+266c,U+3001,U+300a,U+3046,U+304c-304d,U+304f,U+3055,U+3059,U+3063,U+3066-3068,U+306f,U+3089,U+30b8,U+30bf,U+314f,U+4e0a,U+570b,U+5730,U+5916,U+5929,U+5c71,U+5e74,U+5fc3,U+601d,U+6027,U+63d0,U+6709,U+6734,U+751f,U+7684,U+82f1,U+9053,U+91d1,U+97f3,U+ac2f,U+ac4d,U+adc4,U+ade4,U+ae41,U+ae4d-ae4e,U+aed1,U+afb9,U+b0e0,U+b299,U+b365,U+b46c,U+b480,U+b4c8,U+b7b4,U+b819,U+b918,U+baab,U+bab9,U+be8f,U+bed7,U+c0ec,U+c19f,U+c1a5,U+c3d9,U+c464,U+c53d,U+c553,U+c570,U+c5cc,U+c633,U+c6a4,U+c7a3,U+c7a6,U+c886,U+c9d9-c9da,U+c9ec,U+ca0c,U+cc21,U+cd1b,U+cd78,U+cdc4,U+cef8,U+cfe4,U+d0a5,U+d0b5,U+d0ec,U+d15d,U+d188,U+d23c,U+d2ac,U+d729,U+d79b,U+ff01,U+ff08-ff09,U+ff5c}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.106.woff2) format("woff2");unicode-range:U+2039-203a,U+223c,U+25b3,U+25b7,U+25bd,U+25cf,U+266a,U+3002,U+300b,U+304b,U+3057,U+305f,U+306a-306b,U+307e,U+308a-308b,U+3093,U+30a2,U+30af,U+30b9,U+30c3,U+30c8,U+30e9-30eb,U+33a1,U+4e00,U+524d,U+5357,U+5b50,U+7121,U+884c,U+9751,U+ac94,U+aebe,U+aecd,U+af08,U+af41,U+af49,U+b010,U+b053,U+b109,U+b11b,U+b128,U+b154,U+b291,U+b2e6,U+b301,U+b385,U+b525,U+b5b4,U+b729,U+b72f,U+b738,U+b7ff,U+b837,U+b975,U+ba67,U+bb47,U+bc1f,U+bd90,U+bfd4,U+c27c,U+c324,U+c379,U+c3e0,U+c465,U+c53b,U+c58c,U+c610,U+c653,U+c6cd,U+c813,U+c82f,U+c999,U+c9e0,U+cac4,U+cad3,U+cbd4,U+cc10,U+cc22,U+ccb8,U+ccbc,U+cda5,U+ce84,U+cea3,U+cf67,U+cfe1,U+d241,U+d30d,U+d31c,U+d391,U+d401,U+d479,U+d5c9,U+d5db,U+d649,U+d6d4}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.107.woff2) format("woff2");unicode-range:U+b0,U+e9,U+2193,U+2462,U+260e,U+261e,U+300e-300f,U+3044,U+30a4,U+30fb-30fc,U+314d,U+5973,U+6545,U+6708,U+7537,U+ac89,U+ac9c,U+acc1,U+ad04,U+ad75,U+ad7d,U+ae45,U+ae61,U+af42,U+b0ab,U+b0af,U+b0b3,U+b12c,U+b194,U+b1a8,U+b220,U+b258,U+b284,U+b2ff,U+b315,U+b371,U+b3d4-b3d5,U+b460,U+b527,U+b534,U+b810,U+b818,U+b98e,U+ba55,U+bbac,U+bc0b,U+bc40,U+bca1,U+bccd,U+bd93,U+be54,U+be5a,U+bf08,U+bf50,U+bf55,U+bfdc,U+c0c0,U+c0d0,U+c0f4,U+c100,U+c11e,U+c170,U+c20d,U+c274,U+c290,U+c308,U+c369,U+c539,U+c587,U+c5ff,U+c6ec,U+c70c,U+c7ad,U+c7c8,U+c83c,U+c881,U+cb48,U+cc60,U+ce69,U+ce6b,U+ce75,U+cf04,U+cf08,U+cf55,U+cf70,U+cffc,U+d0b7,U+d1a8,U+d2c8,U+d384,U+d47c,U+d48b,U+d5dd,U+d5e8,U+d720,U+d759,U+f981}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.108.woff2) format("woff2");unicode-range:U+e0,U+e2,U+395,U+3b7,U+3ba,U+2460-2461,U+25a0,U+3010-3011,U+306e,U+30f3,U+314a,U+314c,U+5927,U+65b0,U+7e41,U+97d3,U+9ad4,U+ad49,U+ae0b,U+ae0d,U+ae43,U+ae5d,U+aecf,U+af3c,U+af64,U+afd4,U+b080,U+b084,U+b0c5,U+b10c,U+b1e8,U+b2ac,U+b36e,U+b451,U+b515,U+b540,U+b561,U+b6ab,U+b6b1,U+b72c,U+b730,U+b744,U+b800,U+b8ec,U+b8f0,U+b904,U+b968,U+b96d,U+b987,U+b9d9,U+bb36,U+bb49,U+bc2d,U+bc43,U+bcf6,U+bd89,U+be57,U+be61,U+bed4,U+c090,U+c130,U+c148,U+c19c,U+c2f9,U+c36c,U+c37c,U+c384,U+c3df,U+c575,U+c584,U+c660,U+c719,U+c816,U+ca4d,U+ca54,U+cabc,U+cb49,U+cc14,U+cff5,U+d004,U+d038,U+d0b4,U+d0d3,U+d0e0,U+d0ed,U+d131,U+d1b0,U+d31f,U+d33d,U+d3a0,U+d3ab,U+d514,U+d584,U+d6a1,U+d6cc,U+d749,U+d760,U+d799}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.109.woff2) format("woff2");unicode-range:U+24,U+60,U+3b9,U+3bb,U+3bd,U+2191,U+2606,U+300c-300d,U+3131,U+3134,U+3139,U+3141-3142,U+3148,U+3161,U+3163,U+321c,U+4eba,U+5317,U+ac31,U+ac77,U+ac9f,U+acb9,U+acf0-acf1,U+acfd,U+ad73,U+af3d,U+b00c,U+b04a,U+b057,U+b0c4,U+b188,U+b1cc,U+b214,U+b2db,U+b2ee,U+b304,U+b4ed,U+b518,U+b5bc,U+b625,U+b69c-b69d,U+b7ac,U+b801,U+b86c,U+b959,U+b95c,U+b985,U+ba48,U+bb58,U+bc0c,U+bc38,U+bc85,U+bc9a,U+bf40,U+c068,U+c0bd,U+c0cc,U+c12f,U+c149,U+c1e0,U+c22b,U+c22d,U+c250,U+c2fc,U+c300,U+c313,U+c370,U+c3d8,U+c557,U+c580,U+c5e3,U+c62e,U+c634,U+c6f0,U+c74d,U+c783,U+c78e,U+c796,U+c7bc,U+c92c,U+ca4c,U+cc1c,U+cc54,U+cc59,U+ce04,U+cf30,U+cfc4,U+d140,U+d321,U+d38c,U+d399,U+d54f,U+d587,U+d5d0,U+d6e8,U+d770}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.110.woff2) format("woff2");unicode-range:U+d7,U+ea,U+fc,U+2192,U+25bc,U+3000,U+3137,U+3145,U+315c,U+7f8e,U+ac13,U+ac71,U+ac90,U+acb8,U+ace7,U+ad7f,U+ae50,U+aef4,U+af34,U+afbc,U+b048,U+b09a,U+b0ad,U+b0bc,U+b113,U+b125,U+b141,U+b20c,U+b2d9,U+b2ed,U+b367,U+b369,U+b374,U+b3cb,U+b4ec,U+b611,U+b760,U+b81b,U+b834,U+b8b0,U+b8e1,U+b989,U+b9d1,U+b9e1,U+b9fa,U+ba4d,U+ba78,U+bb35,U+bb54,U+bbf9,U+bc11,U+bcb3,U+bd05,U+bd95,U+bdd4,U+be10,U+bed0,U+bf51,U+c0d8,U+c232,U+c2b7,U+c2eb,U+c378,U+c500,U+c52c,U+c549,U+c568,U+c598,U+c5c9,U+c61b,U+c639,U+c67c,U+c717,U+c78a,U+c80a,U+c90c-c90d,U+c950,U+c9e7,U+cbe4,U+cca9,U+cce4,U+cdb0,U+ce78,U+ce94,U+ce98,U+cf8c,U+d018,U+d034,U+d0f1,U+d1b1,U+d280,U+d2f8,U+d338,U+d380,U+d3b4,U+d610,U+d69f,U+d6fc,U+d758}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.111.woff2) format("woff2");unicode-range:U+e7,U+2022,U+203b,U+25c0,U+2605,U+2661,U+3147,U+318d,U+672c,U+8a9e,U+acaa,U+acbc,U+ad1c,U+ae4a,U+ae5c,U+b044,U+b054,U+b0c8-b0c9,U+b2a6,U+b2d0,U+b35c,U+b364,U+b428,U+b454,U+b465,U+b4b7,U+b4e3,U+b51c,U+b5a1,U+b784,U+b790,U+b7ab,U+b7f4,U+b82c,U+b835,U+b8e9,U+b8f8,U+b9d8,U+b9f9,U+ba5c,U+ba64,U+babd,U+bb18,U+bb3b,U+bbff,U+bc0d,U+bc45,U+bc97,U+bcbc,U+be45,U+be75,U+be7c,U+bfcc,U+c0b6,U+c0f7,U+c14b,U+c2b4,U+c30d,U+c4f8,U+c5bb,U+c5d1,U+c5e0,U+c5ee,U+c5fd,U+c606,U+c6c5,U+c6e0,U+c708,U+c81d,U+c820,U+c824,U+c878,U+c918,U+c96c,U+c9e4,U+c9f1,U+cc2e,U+cd09,U+cea1,U+cef5,U+cef7,U+cf64,U+cf69,U+cfe8,U+d035,U+d0ac,U+d230,U+d234,U+d2f4,U+d31d,U+d575,U+d578,U+d608,U+d614,U+d718,U+d751,U+d761,U+d78c,U+d790}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.112.woff2) format("woff2");unicode-range:U+2665,U+3160,U+4e2d,U+6587,U+65e5,U+ac12,U+ac14,U+ac16,U+ac81,U+ad34,U+ade0,U+ae54,U+aebc,U+af2c,U+afc0,U+afc8,U+b04c,U+b08c,U+b099,U+b0a9,U+b0ac,U+b0ae,U+b0b8,U+b123,U+b179,U+b2e5,U+b2f7,U+b4c0,U+b531,U+b538,U+b545,U+b550,U+b5a8,U+b6f0,U+b728,U+b73b,U+b7ad,U+b7ed,U+b809,U+b864,U+b86d,U+b871,U+b9bf,U+b9f5,U+ba40,U+ba4b,U+ba58,U+ba87,U+baac,U+bbc0,U+bc16,U+bc34,U+bd07,U+bd99,U+be59,U+bfd0,U+c058,U+c0e4,U+c0f5,U+c12d,U+c139,U+c228,U+c529,U+c5c7,U+c635,U+c637,U+c735,U+c77d,U+c787,U+c789,U+c8c4,U+c989,U+c98c,U+c9d0,U+c9d3,U+cc0c,U+cc99,U+cd0c,U+cd2c,U+cd98,U+cda4,U+ce59,U+ce60,U+ce6d,U+cea0,U+d0d0-d0d1,U+d0d5,U+d14d,U+d1a4,U+d29c,U+d2f1,U+d301,U+d39c,U+d3bc,U+d4e8,U+d540,U+d5ec,U+d640,U+d750}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.113.woff2) format("woff2");unicode-range:U+5e,U+25b2,U+25b6,U+314e,U+ac24,U+ace1,U+ace4,U+ae68,U+af2d,U+b0d0,U+b0e5,U+b150,U+b155,U+b193,U+b2c9,U+b2dd,U+b3c8,U+b3fc,U+b410,U+b458,U+b4dd,U+b5a0,U+b5a4,U+b5bb,U+b7b5,U+b838,U+b840,U+b86f,U+b8f9,U+b960,U+b9e5,U+bab8,U+bb50,U+bc1d,U+bc24-bc25,U+bca8,U+bcbd,U+bd04,U+bd10,U+bd24,U+be48,U+be5b,U+be68,U+c05c,U+c12c,U+c140,U+c15c,U+c168,U+c194,U+c219,U+c27d,U+c2a8,U+c2f1,U+c2f8,U+c368,U+c554-c555,U+c559,U+c564,U+c5d8,U+c5fc,U+c625,U+c65c,U+c6b1,U+c728,U+c794,U+c84c,U+c88c,U+c8e0,U+c8fd,U+c998,U+c9dd,U+cc0d,U+cc30,U+ceec,U+cf13,U+cf1c,U+cf5c,U+d050,U+d07c,U+d0a8,U+d134,U+d138,U+d154,U+d1f4,U+d2bc,U+d329,U+d32c,U+d3d0,U+d3f4,U+d3fc,U+d56b,U+d5cc,U+d600-d601,U+d639,U+d6c8,U+d754,U+d765}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.114.woff2) format("woff2");unicode-range:U+3c-3d,U+2026,U+24d2,U+314b,U+ac11,U+acf3,U+ad74,U+ad81,U+adf9,U+ae34,U+af43,U+afb8,U+b05d,U+b07c,U+b110,U+b118,U+b17c,U+b180,U+b18d,U+b192,U+b2cc,U+b355,U+b378,U+b4a4,U+b4ef,U+b78d,U+b799,U+b7a9,U+b7fd,U+b807,U+b80c,U+b839,U+b9b4,U+b9db,U+ba3c,U+bab0,U+bba4,U+bc94,U+be4c,U+c154,U+c1c4,U+c26c,U+c2ac,U+c2ed,U+c4f4,U+c55e,U+c561,U+c571,U+c5b5,U+c5c4,U+c654-c655,U+c695,U+c6e8,U+c6f9,U+c724,U+c751,U+c775,U+c7a0,U+c7c1,U+c874,U+c880,U+c9d5,U+c9f8,U+cabd,U+cc29,U+cc2c,U+cca8,U+ccab,U+ccd0,U+ce21,U+ce35,U+ce7c,U+ce90,U+cee8,U+cef4,U+cfe0,U+d070,U+d0b9,U+d0c1,U+d0c4,U+d0c8,U+d15c,U+d1a1,U+d2c0,U+d300,U+d314,U+d3ed,U+d478,U+d480,U+d48d,U+d508,U+d53d,U+d5e4,U+d611,U+d61c,U+d68d,U+d6a8,U+d798}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.115.woff2) format("woff2");unicode-range:U+23,U+25,U+5f,U+a9,U+ac08,U+ac78,U+aca8,U+acac,U+ace8,U+ad70,U+adc0,U+addc,U+b137,U+b140,U+b208,U+b290,U+b2f5,U+b3c5,U+b3cc,U+b420,U+b429,U+b529,U+b530,U+b77d,U+b79c,U+b7a8,U+b7c9,U+b7f0,U+b7fc,U+b828,U+b860,U+b9ad,U+b9c1,U+b9c9,U+b9dd-b9de,U+b9e8,U+ba38-ba39,U+babb,U+bc00,U+bc8c,U+bca0,U+bca4,U+bcd1,U+bcfc,U+bd09,U+bdf0,U+be60,U+c0ad,U+c0b4,U+c0bc,U+c190,U+c1fc,U+c220,U+c288,U+c2b9,U+c2f6,U+c528,U+c545,U+c558,U+c5bc,U+c5d4,U+c600,U+c644,U+c6c0,U+c6c3,U+c721,U+c798,U+c7a1,U+c811,U+c838,U+c871,U+c904,U+c990,U+c9dc,U+cc38,U+cc44,U+cca0,U+cd1d,U+cd95,U+cda9,U+ce5c,U+cf00,U+cf58,U+d150,U+d22c,U+d305,U+d328,U+d37c,U+d3f0,U+d551,U+d5a5,U+d5c8,U+d5d8,U+d63c,U+d64d,U+d669,U+d734,U+d76c}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.116.woff2) format("woff2");unicode-range:U+26,U+2b,U+3e,U+40,U+7e,U+ac01,U+ac19,U+ac1d,U+aca0,U+aca9,U+acb0,U+ad8c,U+ae09,U+ae38,U+ae40,U+aed8,U+b09c,U+b0a0,U+b108,U+b204,U+b298,U+b2d8,U+b2eb-b2ec,U+b2f4,U+b313,U+b358,U+b450,U+b4e0,U+b54c,U+b610,U+b780,U+b78c,U+b791,U+b8e8,U+b958,U+b974,U+b984,U+b9b0,U+b9bc-b9bd,U+b9ce,U+ba70,U+bbfc,U+bc0f,U+bc15,U+bc1b,U+bc31,U+bc95,U+bcc0,U+bcc4,U+bd81,U+bd88,U+c0c8,U+c11d,U+c13c,U+c158,U+c18d,U+c1a1,U+c21c,U+c4f0,U+c54a,U+c560,U+c5b8,U+c5c8,U+c5f4,U+c628,U+c62c,U+c678,U+c6cc,U+c808,U+c810,U+c885,U+c88b,U+c900,U+c988,U+c99d,U+c9c8,U+cc3d-cc3e,U+cc45,U+cd08,U+ce20,U+cee4,U+d074,U+d0a4,U+d0dd,U+d2b9,U+d3b8,U+d3c9,U+d488,U+d544,U+d559,U+d56d,U+d588,U+d615,U+d648,U+d655,U+d658,U+d65c}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.117.woff2) format("woff2");unicode-range:U+d,U+48,U+7c,U+ac10,U+ac15,U+ac74,U+ac80,U+ac83,U+acc4,U+ad11,U+ad50,U+ad6d,U+adfc,U+ae00,U+ae08,U+ae4c,U+b0a8,U+b124,U+b144,U+b178,U+b274,U+b2a5,U+b2e8,U+b2f9,U+b354,U+b370,U+b418,U+b41c,U+b4f1,U+b514,U+b798,U+b808,U+b824-b825,U+b8cc,U+b978,U+b9d0,U+b9e4,U+baa9,U+bb3c,U+bc18,U+bc1c,U+bc30,U+bc84,U+bcf5,U+bcf8,U+bd84,U+be0c,U+be14,U+c0b0,U+c0c9,U+c0dd,U+c124,U+c2dd,U+c2e4,U+c2ec,U+c54c,U+c57c-c57d,U+c591,U+c5c5-c5c6,U+c5ed,U+c608,U+c640,U+c6b8,U+c6d4,U+c784,U+c7ac,U+c800-c801,U+c9c1,U+c9d1,U+cc28,U+cc98,U+cc9c,U+ccad,U+cd5c,U+cd94,U+cd9c,U+cde8,U+ce68,U+cf54,U+d0dc,U+d14c,U+d1a0,U+d1b5,U+d2f0,U+d30c,U+d310,U+d398,U+d45c,U+d50c,U+d53c,U+d560,U+d568,U+d589,U+d604,U+d6c4,U+d788}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.118.woff2) format("woff2");unicode-range:U+39,U+49,U+4d-4e,U+a0,U+ac04,U+ac1c,U+ac70,U+ac8c,U+acbd,U+acf5,U+acfc,U+ad00,U+ad6c,U+adf8,U+b098,U+b0b4,U+b294,U+b2c8,U+b300,U+b3c4,U+b3d9,U+b4dc,U+b4e4,U+b77c,U+b7ec,U+b85d,U+b97c,U+b9c8,U+b9cc,U+ba54,U+ba74,U+ba85,U+baa8,U+bb34,U+bb38,U+bbf8,U+bc14,U+bc29,U+bc88,U+bcf4,U+bd80,U+be44,U+c0c1,U+c11c,U+c120,U+c131,U+c138,U+c18c,U+c218,U+c2b5,U+c2e0,U+c544,U+c548,U+c5b4,U+c5d0,U+c5ec,U+c5f0,U+c601,U+c624,U+c694,U+c6a9,U+c6b0,U+c6b4,U+c6d0,U+c704,U+c720,U+c73c,U+c740,U+c744,U+c74c,U+c758,U+c77c,U+c785,U+c788,U+c790-c791,U+c7a5,U+c804,U+c815,U+c81c,U+c870,U+c8fc,U+c911,U+c9c4,U+ccb4,U+ce58,U+ce74,U+d06c,U+d0c0,U+d130,U+d2b8,U+d3ec,U+d504,U+d55c,U+d569,U+d574,U+d638,U+d654,U+d68c}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshVAuA8jEe2LD_Xfj-yqp8xQ6VsVzYGYHDC3g.119.woff2) format("woff2");unicode-range:U+20-22,U+27-2a,U+2c-38,U+3a-3b,U+3f,U+41-47,U+4a-4c,U+4f-5d,U+61-7b,U+7d,U+a1,U+ab,U+ae,U+b7,U+bb,U+bf,U+2013-2014,U+201c-201d,U+2122,U+ac00,U+ace0,U+ae30,U+b2e4,U+b85c,U+b9ac,U+c0ac,U+c2a4,U+c2dc,U+c774,U+c778,U+c9c0,U+d558}@font-face{font-family:Gugi;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/gugi/v20/A2BVn5dXywshZAmK9RMckqI.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZurR_iJGursUpyo0Q.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZuiR_iJGursUpyo0Q.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZuqR_iJGursUpyo0Q.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZulR_iJGursUpyo0Q.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZvuR_iJGursUpyo0Q.woff2) format("woff2");unicode-range:U+200C-200D,U+2010,U+25CC,U+A900-A92F}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZupR_iJGursUpyo0Q.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZuoR_iJGursUpyo0Q.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jura;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/jura/v33/z7NOdRfiaC4Vd8hhoPzfb5vBTP1d7ZumR_iJGursUpw.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.0.woff2) format("woff2");unicode-range:U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26222,U+2626a,U+26270,U+26286,U+2634c,U+26402,U+2667e,U+266b0,U+2671d,U+268dd,U+268ea,U+26951,U+2696f,U+26999,U+269dd,U+26a1e,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26c29,U+26c73,U+26c9e,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752,U+278b2,U+27985,U+279b4,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27c3c,U+27cb8,U+27d73,U+27da0,U+27e10,U+27eaf,U+27fb7,U+2808a,U+280bb,U+28277,U+28282,U+282f3,U+283cd,U+2840c,U+28455,U+284dc,U+2856b,U+285c8-285c9,U+286d7,U+286fa,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28bc1,U+28bef,U+28cdd,U+28d10,U+28d71,U+28dfb,U+28e0f,U+28e17,U+28e1f,U+28e36,U+28e89,U+28eeb,U+28ef6,U+28f32,U+28ff8,U+292a0,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750,U+29810,U+298c6,U+29a72,U+29d4b,U+29ddb,U+29e15,U+29e3d,U+29e49,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29fce,U+29fd7,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a2b2,U+2a38c,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a9e6,U+2b746,U+2b751,U+2b753,U+2b75a,U+2b75c,U+2b765,U+2b776-2b777,U+2b77c,U+2b782,U+2b789,U+2b78b,U+2b78e,U+2b794,U+2b7ac,U+2b7af,U+2b7bd,U+2b7c9,U+2b7cf,U+2b7d2,U+2b7d8,U+2b7f0,U+2b80d,U+2b817,U+2b81a,U+2d544,U+2e278,U+2e569,U+2e6ea,U+2f804,U+2f80f,U+2f815,U+2f818,U+2f81a,U+2f822,U+2f828,U+2f82c,U+2f833,U+2f83f,U+2f846,U+2f852,U+2f862,U+2f86d,U+2f873,U+2f877,U+2f884,U+2f899-2f89a,U+2f8a6,U+2f8ac,U+2f8b2,U+2f8b6,U+2f8d3,U+2f8db-2f8dc,U+2f8e1,U+2f8e5,U+2f8ea,U+2f8ed,U+2f8fc,U+2f903,U+2f90b,U+2f90f,U+2f91a,U+2f920-2f921,U+2f945,U+2f947,U+2f96c,U+2f995,U+2f9d0,U+2f9de-2f9df,U+2f9f4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.1.woff2) format("woff2");unicode-range:U+1f235-1f23b,U+1f240-1f248,U+1f250-1f251,U+2000b,U+20089-2008a,U+200a2,U+200a4,U+200b0,U+200f5,U+20158,U+201a2,U+20213,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+2053f,U+205b1,U+205d6,U+20611,U+20628,U+206ec,U+2074f,U+207c8,U+20807,U+2083a,U+208b9,U+2090e,U+2097c,U+20984,U+2099d,U+20a64,U+20ad3,U+20b1d,U+20b9f,U+20bb7,U+20d45,U+20d58,U+20de1,U+20e64,U+20e6d,U+20e95,U+20f5f,U+21201,U+2123d,U+21255,U+21274,U+2127b,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+213c4,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3,U+21a1a,U+21c56,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b,U+22218,U+2231e,U+223ad,U+22609,U+226f3,U+2285b,U+228ab,U+2298f,U+22ab8,U+22b46,U+22b4f-22b50,U+22ba6,U+22c1d,U+22c24,U+22de1,U+22e42,U+22feb,U+231b6,U+231c3-231c4,U+231f5,U+23372,U+233cc,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+233fe,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237f1,U+237ff,U+23824,U+2383d,U+23a98,U+23c7f,U+23cbe,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23f7e,U+2404b,U+24096,U+24103,U+241c6,U+241fe,U+242ee,U+243bc,U+243d0,U+24629,U+246a5,U+247f1,U+24896,U+248e9,U+24a4d,U+24b56,U+24b6f,U+24c16,U+24d14,U+24e04,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24ff2,U+2504a,U+25055,U+25122,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+255a7,U+2567f,U+25771,U+257a9,U+257b4,U+25874,U+259c4,U+259cc,U+259d4,U+25ad7,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c4b,U+25c64,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed8}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.2.woff2) format("woff2");unicode-range:U+ffd7,U+ffda-ffdc,U+ffe0-ffe2,U+ffe4,U+ffe6,U+ffe8-ffee,U+1f100-1f10c,U+1f110-1f16c,U+1f170-1f1ac,U+1f200-1f202,U+1f210-1f234}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.3.woff2) format("woff2");unicode-range:U+fa10,U+fa12-fa6d,U+fb00-fb04,U+fe10-fe19,U+fe30-fe42,U+fe44-fe52,U+fe54-fe66,U+fe68-fe6b,U+ff02,U+ff04,U+ff07,U+ff51,U+ff5b,U+ff5d,U+ff5f-ff60,U+ff66,U+ff69,U+ff87,U+ffa1-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd6}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.4.woff2) format("woff2");unicode-range:U+f92d-f959,U+f95b-f9f2,U+f9f4-fa0b,U+fa0e-fa0f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.5.woff2) format("woff2");unicode-range:U+9e8b-9e8c,U+9e8e-9e8f,U+9e91-9e92,U+9e95-9e96,U+9e98,U+9e9b,U+9e9d-9e9e,U+9ea4-9ea5,U+9ea8-9eaa,U+9eac-9eb0,U+9eb3-9eb5,U+9eb8,U+9ebc-9ebf,U+9ec3,U+9ec6,U+9ec8,U+9ecb-9ecd,U+9ecf-9ed1,U+9ed4-9ed5,U+9ed8,U+9edb-9ee0,U+9ee4-9ee5,U+9ee7-9ee8,U+9eec-9ef2,U+9ef4-9ef9,U+9efb-9eff,U+9f02-9f03,U+9f07-9f09,U+9f0e-9f12,U+9f14-9f17,U+9f19-9f1b,U+9f1f-9f22,U+9f26,U+9f2a-9f2c,U+9f2f,U+9f31-9f32,U+9f34,U+9f37,U+9f39-9f3a,U+9f3c-9f3f,U+9f41,U+9f43-9f47,U+9f4a,U+9f4e-9f50,U+9f52-9f58,U+9f5a,U+9f5d-9f61,U+9f63,U+9f66-9f6a,U+9f6c-9f73,U+9f75-9f77,U+9f7a,U+9f7d,U+9f7f,U+9f8f-9f92,U+9f94-9f97,U+9f99,U+9f9c-9fa3,U+9fa5,U+9fb4,U+9fbc-9fc2,U+9fc4,U+9fc6,U+9fcc,U+f900-f92c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.6.woff2) format("woff2");unicode-range:U+9c3e,U+9c41,U+9c43-9c4a,U+9c4e-9c50,U+9c52-9c54,U+9c56,U+9c58,U+9c5a-9c61,U+9c63,U+9c65,U+9c67-9c6b,U+9c6d-9c6e,U+9c70,U+9c72,U+9c75-9c78,U+9c7a-9c7c,U+9ce6-9ce7,U+9ceb-9cec,U+9cf0,U+9cf2,U+9cf6-9cf7,U+9cf9,U+9d02-9d03,U+9d06-9d09,U+9d0b,U+9d0e,U+9d11-9d12,U+9d15,U+9d17-9d18,U+9d1b-9d1f,U+9d23,U+9d26,U+9d2a-9d2c,U+9d2f-9d30,U+9d32-9d34,U+9d3a,U+9d3c-9d3f,U+9d41-9d48,U+9d4a,U+9d50-9d54,U+9d59,U+9d5d-9d65,U+9d69-9d6c,U+9d6f-9d70,U+9d72-9d73,U+9d76-9d77,U+9d7a-9d7c,U+9d7e,U+9d83-9d84,U+9d86-9d87,U+9d89-9d8a,U+9d8d-9d8e,U+9d92-9d93,U+9d95-9d9a,U+9da1,U+9da4,U+9da9-9dac,U+9dae,U+9db1-9db2,U+9db5,U+9db8-9dbd,U+9dbf-9dc4,U+9dc6-9dc7,U+9dc9-9dca,U+9dcf,U+9dd3-9dd7,U+9dd9-9dda,U+9dde-9de0,U+9de3,U+9de5-9de7,U+9de9,U+9deb,U+9ded-9df0,U+9df3-9df4,U+9df8,U+9dfd-9dfe,U+9e02,U+9e07,U+9e0a,U+9e0d-9e0e,U+9e10-9e12,U+9e15-9e16,U+9e19-9e1f,U+9e75,U+9e79-9e7d,U+9e80-9e85,U+9e87-9e88}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.7.woff2) format("woff2");unicode-range:U+9ae5-9ae7,U+9ae9,U+9aeb-9aec,U+9aee-9aef,U+9af1-9af5,U+9af7,U+9af9-9afb,U+9afd,U+9aff-9b06,U+9b08-9b09,U+9b0b-9b0e,U+9b10,U+9b12,U+9b16,U+9b18-9b1d,U+9b1f-9b20,U+9b22-9b23,U+9b25-9b2f,U+9b32-9b35,U+9b37,U+9b39-9b3b,U+9b3d,U+9b43-9b44,U+9b48,U+9b4b-9b4f,U+9b51,U+9b55-9b58,U+9b5b,U+9b5e,U+9b61,U+9b63,U+9b65-9b66,U+9b68,U+9b6a-9b6f,U+9b72-9b79,U+9b7f-9b80,U+9b83-9b87,U+9b89-9b8b,U+9b8d,U+9b8f-9b94,U+9b96-9b97,U+9b9a,U+9b9d-9ba0,U+9ba6-9ba7,U+9ba9-9baa,U+9bac,U+9bb0-9bb2,U+9bb4,U+9bb7-9bb9,U+9bbb-9bbc,U+9bbe-9bc1,U+9bc6-9bc8,U+9bca,U+9bce-9bd2,U+9bd4,U+9bd7-9bd8,U+9bdd,U+9bdf,U+9be1-9be5,U+9be7,U+9bea-9beb,U+9bee-9bf3,U+9bf5,U+9bf7-9bfa,U+9bfd,U+9bff-9c00,U+9c02,U+9c04,U+9c06,U+9c08-9c0d,U+9c0f-9c16,U+9c18-9c1e,U+9c21-9c2a,U+9c2d-9c32,U+9c35-9c37,U+9c39-9c3a,U+9c3d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.8.woff2) format("woff2");unicode-range:U+98eb,U+98ed-98ee,U+98f0-98f1,U+98f3,U+98f6,U+9902,U+9907-9909,U+9911-9912,U+9914-9918,U+991a-9922,U+9924,U+9926-9927,U+992b-992c,U+992e,U+9931-9935,U+9939-993e,U+9940-9942,U+9945-9949,U+994b-994e,U+9950-9952,U+9954-9955,U+9958-9959,U+995b-995c,U+995e-9960,U+9963,U+9997-9998,U+999b,U+999d-999f,U+99a3,U+99a5-99a6,U+99a8,U+99ad-99ae,U+99b0-99b2,U+99b5,U+99b9-99ba,U+99bc-99bd,U+99bf,U+99c1,U+99c3,U+99c8-99c9,U+99d1,U+99d3-99d5,U+99d8-99df,U+99e1-99e2,U+99e7,U+99ea-99ee,U+99f0-99f2,U+99f4-99f5,U+99f8-99f9,U+99fb-99fe,U+9a01-9a05,U+9a08,U+9a0a-9a0c,U+9a0f-9a11,U+9a16,U+9a1a,U+9a1e,U+9a20,U+9a22-9a24,U+9a27,U+9a2b,U+9a2d-9a2e,U+9a31,U+9a33,U+9a35-9a38,U+9a3e,U+9a40-9a45,U+9a47,U+9a4a-9a4e,U+9a51-9a52,U+9a54-9a58,U+9a5b,U+9a5d,U+9a5f,U+9a62,U+9a64-9a65,U+9a69-9a6c,U+9aaa,U+9aac-9ab0,U+9ab2,U+9ab4-9ab7,U+9ab9,U+9abb-9ac1,U+9ac3,U+9ac6,U+9ac8,U+9ace-9ad3,U+9ad5-9ad7,U+9adb-9adc,U+9ade-9ae0,U+9ae2-9ae4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.9.woff2) format("woff2");unicode-range:U+971d,U+9721-9724,U+9728,U+972a,U+9730-9731,U+9733,U+9736,U+9738-9739,U+973b,U+973d-973e,U+9741-9744,U+9746-974a,U+974d-974f,U+9751,U+9755,U+9757-9758,U+975a-975c,U+9760-9761,U+9763-9764,U+9766-9768,U+976a-976b,U+976e,U+9771,U+9773,U+9776-977d,U+977f-9781,U+9785-9786,U+9789,U+978b,U+978f-9790,U+9795-9797,U+9799-979a,U+979c,U+979e-97a0,U+97a2-97a3,U+97a6,U+97a8,U+97ab-97ac,U+97ae,U+97b1-97b6,U+97b8-97ba,U+97bc,U+97be-97bf,U+97c1,U+97c3-97ce,U+97d0-97d1,U+97d4,U+97d7-97d9,U+97db-97de,U+97e0-97e1,U+97e4,U+97e6,U+97ed-97ef,U+97f1-97f2,U+97f4-97f8,U+97fa,U+9804,U+9807,U+980a,U+980c-980f,U+9814,U+9816-9817,U+9819-981a,U+981c,U+981e,U+9820-9821,U+9823-9826,U+982b,U+982e-9830,U+9832-9835,U+9837,U+9839,U+983d-983e,U+9844,U+9846-9847,U+984a-984b,U+984f,U+9851-9853,U+9856-9857,U+9859-985b,U+9862-9863,U+9865-9866,U+986a-986c,U+986f-9871,U+9873-9875,U+98aa-98ab,U+98ad-98ae,U+98b0-98b1,U+98b4,U+98b6-98b8,U+98ba-98bc,U+98bf,U+98c2-98c8,U+98cb-98cc,U+98ce,U+98dc,U+98de,U+98e0-98e1,U+98e3,U+98e5-98e7,U+98e9-98ea}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.10.woff2) format("woff2");unicode-range:U+944a,U+944c,U+9452-9453,U+9455,U+9459-945c,U+945e-9463,U+9468,U+946a-946b,U+946d-9472,U+9475,U+9477,U+947c-947f,U+9481,U+9483-9485,U+9578-9579,U+957e-957f,U+9582,U+9584,U+9586-9588,U+958a,U+958c-958f,U+9592,U+9594,U+9596,U+9598-9599,U+959d-95a1,U+95a4,U+95a6-95a9,U+95ab-95ad,U+95b1,U+95b4,U+95b6,U+95b9-95bf,U+95c3,U+95c6,U+95c8-95cd,U+95d0-95d6,U+95d9-95da,U+95dc-95e2,U+95e4-95e6,U+95e8,U+961d-961e,U+9621-9622,U+9624-9626,U+9628,U+962c,U+962e-962f,U+9631,U+9633-9634,U+9637-963a,U+963c-963d,U+9641-9642,U+964b-964c,U+964f,U+9652,U+9654,U+9656-9658,U+965c-965f,U+9661,U+9666,U+966a,U+966c,U+966e,U+9672,U+9674,U+9677,U+967b-967c,U+967e-967f,U+9681-9684,U+9689,U+968b,U+968d,U+9691,U+9695-9698,U+969a,U+969d,U+969f,U+96a4-96aa,U+96ae-96b4,U+96b6,U+96b8-96bb,U+96bd,U+96c1,U+96c9-96cb,U+96cd-96ce,U+96d2,U+96d5-96d6,U+96d8-96da,U+96dc-96df,U+96e9,U+96ef,U+96f1,U+96f9-96fa,U+9702-9706,U+9708-9709,U+970d-970f,U+9711,U+9713-9714,U+9716,U+9719-971b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.11.woff2) format("woff2");unicode-range:U+92bc-92bd,U+92bf-92c3,U+92c5-92c8,U+92cb-92d0,U+92d2-92d3,U+92d5,U+92d7-92d9,U+92dc-92dd,U+92df-92e1,U+92e3-92e5,U+92e7-92ea,U+92ec,U+92ee,U+92f0,U+92f2,U+92f7-92fb,U+92ff-9300,U+9302,U+9304,U+9308,U+930d,U+930f-9311,U+9314-9315,U+9318-931a,U+931c-931f,U+9321-9325,U+9327-932b,U+932e,U+9333-9337,U+933a-933b,U+9344,U+9347-934a,U+934d,U+9350-9352,U+9354-9358,U+935a,U+935c,U+935e,U+9360,U+9364-9365,U+9367,U+9369-936d,U+936f-9371,U+9373-9374,U+9376,U+937a,U+937d-9382,U+9388,U+938a-938b,U+938d,U+938f,U+9392,U+9394-9395,U+9397-9398,U+939a-939b,U+939e,U+93a1,U+93a3-93a4,U+93a6,U+93a8-93a9,U+93ab-93ad,U+93b0,U+93b4-93b6,U+93b9-93bb,U+93c1,U+93c3-93cd,U+93d0-93d1,U+93d3,U+93d6-93d9,U+93dc-93df,U+93e2,U+93e4-93e8,U+93f1,U+93f5,U+93f7-93fb,U+93fd,U+9401-9404,U+9407-9409,U+940d-9410,U+9413-9417,U+9419-941a,U+941f,U+9421,U+942b,U+942e-942f,U+9431-9434,U+9436,U+9438,U+943a-943b,U+943d,U+943f,U+9441,U+9443-9445,U+9448}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.12.woff2) format("woff2");unicode-range:U+9143,U+9146-914c,U+914f,U+9153,U+9156-915b,U+9161,U+9163-9165,U+9167,U+9169,U+916d,U+9172-9174,U+9179-917b,U+9181-9183,U+9185-9187,U+9189-918b,U+918e,U+9191,U+9193-9195,U+9197-9198,U+919e,U+91a1-91a2,U+91a6,U+91a8,U+91aa-91b6,U+91ba-91bd,U+91bf-91c6,U+91c9,U+91cb,U+91d0,U+91d3-91d4,U+91d6-91d7,U+91d9-91db,U+91de-91df,U+91e1,U+91e4-91e6,U+91e9-91ea,U+91ec-91f1,U+91f5-91f7,U+91f9,U+91fb-91fd,U+91ff-9201,U+9204-9207,U+9209-920a,U+920c,U+920e,U+9210-9218,U+921c-921e,U+9223-9226,U+9228-9229,U+922c,U+922e-9230,U+9233,U+9235-923a,U+923c,U+923e-9240,U+9242-9243,U+9245-924b,U+924d-9251,U+9256-925a,U+925c-925e,U+9260-9261,U+9264-9269,U+926e-9270,U+9275-9279,U+927b-927f,U+9288-928a,U+928d-928e,U+9291-9293,U+9295-9297,U+9299,U+929b-929c,U+929f-92a0,U+92a4-92a5,U+92a7-92a8,U+92ab,U+92af,U+92b2-92b3,U+92b6-92bb}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.13.woff2) format("woff2");unicode-range:U+8f52-8f55,U+8f57-8f58,U+8f5c-8f5e,U+8f61-8f66,U+8f9c-8f9d,U+8f9f-8fa2,U+8fa4-8fa8,U+8fad-8faf,U+8fb4-8fb8,U+8fbe,U+8fc0-8fc2,U+8fc6,U+8fc8,U+8fca-8fcb,U+8fcd,U+8fd0,U+8fd2-8fd3,U+8fd5,U+8fda,U+8fe0,U+8fe2-8fe5,U+8fe8-8fea,U+8fed-8fef,U+8ff1,U+8ff4-8ff6,U+8ff8-8ffb,U+8ffe,U+9002,U+9004-9005,U+9008,U+900b-900e,U+9011,U+9013,U+9015-9016,U+9018,U+901b,U+901e,U+9021,U+9027-902a,U+902c-902d,U+902f,U+9033-9037,U+9039,U+903c,U+903e-903f,U+9041,U+9043-9044,U+9049,U+904c,U+904f-9052,U+9056,U+9058,U+905b-905e,U+9062,U+9066-9068,U+906c,U+906f-9070,U+9072,U+9074,U+9076,U+9079,U+9080-9083,U+9085,U+9087-9088,U+908b-908c,U+908e-9090,U+9095,U+9097-9099,U+909b,U+90a0-90a2,U+90a5,U+90a8,U+90af-90b6,U+90bd-90be,U+90c3-90c5,U+90c7-90c9,U+90cc,U+90d2,U+90d5,U+90d7-90d9,U+90db-90df,U+90e2,U+90e4-90e5,U+90eb,U+90ef-90f0,U+90f2,U+90f4,U+90f6,U+90fe-9100,U+9102,U+9104-9106,U+9108,U+910d,U+9110,U+9112,U+9114-911a,U+911c,U+911e,U+9120,U+9122-9123,U+9125,U+9127,U+9129,U+912d-9132,U+9134,U+9136-9137,U+9139-913a,U+913c-913d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.14.woff2) format("woff2");unicode-range:U+8dc0,U+8dc2,U+8dc5-8dc8,U+8dca-8dcc,U+8dce-8dcf,U+8dd1,U+8dd4-8dd7,U+8dd9-8ddb,U+8ddf,U+8de3-8de5,U+8de7,U+8dea-8dec,U+8df0-8df2,U+8df4,U+8dfc-8dfd,U+8dff,U+8e01,U+8e04-8e06,U+8e08-8e09,U+8e0b-8e0c,U+8e10-8e11,U+8e14,U+8e16,U+8e1d-8e23,U+8e26-8e27,U+8e30-8e31,U+8e33-8e39,U+8e3d,U+8e40-8e42,U+8e44,U+8e47-8e50,U+8e54-8e55,U+8e59,U+8e5b-8e64,U+8e69,U+8e6c-8e6d,U+8e6f-8e72,U+8e75-8e77,U+8e79-8e7c,U+8e81-8e85,U+8e89,U+8e8b,U+8e90-8e95,U+8e98-8e9b,U+8e9d-8e9e,U+8ea1-8ea2,U+8ea7,U+8ea9-8eaa,U+8eac-8eb1,U+8eb3,U+8eb5-8eb6,U+8eba-8ebb,U+8ebe,U+8ec0-8ec1,U+8ec3-8ec8,U+8ecb,U+8ecf,U+8ed1,U+8ed4,U+8edb-8edc,U+8ee3,U+8ee8,U+8eeb,U+8eed-8eee,U+8ef0-8ef1,U+8ef7,U+8ef9-8efc,U+8efe,U+8f00,U+8f02,U+8f05,U+8f07-8f08,U+8f0a,U+8f0f-8f10,U+8f12-8f13,U+8f15-8f19,U+8f1b-8f1c,U+8f1e-8f21,U+8f23,U+8f25-8f28,U+8f2b-8f2f,U+8f33-8f37,U+8f39-8f3b,U+8f3e,U+8f40-8f43,U+8f45-8f47,U+8f49-8f4a,U+8f4c-8f4f,U+8f51}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.15.woff2) format("woff2");unicode-range:U+8b2d,U+8b30,U+8b37,U+8b3c,U+8b3e,U+8b41-8b46,U+8b48-8b49,U+8b4c-8b4f,U+8b51-8b54,U+8b56,U+8b59,U+8b5b,U+8b5e-8b5f,U+8b63,U+8b69,U+8b6b-8b6d,U+8b6f,U+8b71,U+8b74,U+8b76,U+8b78-8b79,U+8b7c-8b81,U+8b84-8b85,U+8b8a-8b8f,U+8b92-8b96,U+8b99-8b9a,U+8b9c-8ba0,U+8c38-8c3a,U+8c3d-8c3f,U+8c41,U+8c45,U+8c47-8c49,U+8c4b-8c4c,U+8c4e-8c51,U+8c53-8c55,U+8c57-8c59,U+8c5b,U+8c5d,U+8c62-8c64,U+8c66,U+8c68-8c69,U+8c6b-8c6d,U+8c73,U+8c75-8c76,U+8c78,U+8c7a-8c7c,U+8c7e,U+8c82,U+8c85-8c87,U+8c89-8c8b,U+8c8d-8c8e,U+8c90,U+8c92-8c94,U+8c98-8c99,U+8c9b-8c9c,U+8c9f,U+8ca4,U+8cad-8cae,U+8cb2-8cb3,U+8cb6,U+8cb9-8cba,U+8cbd,U+8cc1-8cc2,U+8cc4-8cc6,U+8cc8-8cc9,U+8ccb,U+8ccd-8ccf,U+8cd2,U+8cd5-8cd6,U+8cd9-8cda,U+8cdd,U+8ce1,U+8ce3-8ce4,U+8ce6,U+8ce8,U+8cec,U+8cef-8cf2,U+8cf4-8cf5,U+8cf7-8cf8,U+8cfa-8cfb,U+8cfd-8cff,U+8d01,U+8d03-8d04,U+8d07,U+8d09-8d0b,U+8d0d-8d10,U+8d12-8d14,U+8d16-8d17,U+8d1b-8d1d,U+8d65,U+8d67,U+8d69,U+8d6b-8d6e,U+8d71,U+8d73,U+8d76,U+8d7f,U+8d81-8d82,U+8d84,U+8d88,U+8d8d,U+8d90-8d91,U+8d95,U+8d99,U+8d9e-8da0,U+8da6,U+8da8,U+8dab-8dac,U+8daf,U+8db2,U+8db5,U+8db7,U+8db9-8dbc,U+8dbe}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.16.woff2) format("woff2");unicode-range:U+8973-8975,U+8977,U+897a-897e,U+8980,U+8983,U+8988-898a,U+898d,U+8990,U+8993-8995,U+8998,U+899b-899c,U+899f-89a1,U+89a5-89a6,U+89a9,U+89ac,U+89af-89b0,U+89b2,U+89b4-89b7,U+89ba,U+89bc-89bd,U+89bf-89c1,U+89d4-89d8,U+89da,U+89dc-89dd,U+89e5,U+89e7,U+89e9,U+89eb,U+89ed,U+89f1,U+89f3-89f4,U+89f6,U+89f8-89f9,U+89fd,U+89ff,U+8a01,U+8a04-8a05,U+8a07,U+8a0c,U+8a0f-8a12,U+8a14-8a16,U+8a1b,U+8a1d-8a1e,U+8a20-8a22,U+8a24-8a26,U+8a2b-8a2c,U+8a2f,U+8a35-8a37,U+8a3b,U+8a3d-8a3e,U+8a40-8a41,U+8a43,U+8a45-8a49,U+8a4d-8a4e,U+8a51-8a54,U+8a56-8a58,U+8a5b-8a5d,U+8a61-8a62,U+8a65,U+8a67,U+8a6c-8a6d,U+8a75-8a77,U+8a79-8a7c,U+8a7e-8a80,U+8a82-8a86,U+8a8b,U+8a8f-8a92,U+8a96-8a97,U+8a99-8a9a,U+8a9f,U+8aa1,U+8aa3,U+8aa5-8aaa,U+8aae-8aaf,U+8ab3,U+8ab6-8ab7,U+8abb-8abc,U+8abe,U+8ac2-8ac4,U+8ac6,U+8ac8-8aca,U+8acc-8acd,U+8ad0-8ad1,U+8ad3-8ad5,U+8ad7,U+8ada-8ae2,U+8ae4,U+8ae7,U+8aeb-8aec,U+8aee,U+8af0-8af1,U+8af3-8af7,U+8afa,U+8afc,U+8aff,U+8b01-8b02,U+8b04-8b07,U+8b0a-8b0d,U+8b0f-8b11,U+8b14,U+8b16,U+8b1a,U+8b1c,U+8b1e-8b20,U+8b26,U+8b28,U+8b2b-8b2c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.17.woff2) format("woff2");unicode-range:U+87e2-87e6,U+87ea-87ed,U+87ef,U+87f1,U+87f3,U+87f5-87f8,U+87fa-87fb,U+87fe-87ff,U+8801,U+8803,U+8805-8807,U+8809-880b,U+880d-8816,U+8818-881c,U+881e-881f,U+8821-8822,U+8827-8828,U+882d-882e,U+8830-8832,U+8835-8836,U+8839-883c,U+8841-8845,U+8848-884b,U+884d-884e,U+8851-8852,U+8855-8856,U+8858-885a,U+885c,U+885e-8860,U+8862,U+8864,U+8869,U+886b,U+886e-886f,U+8871-8872,U+8875,U+8877,U+8879,U+887b,U+887d-887e,U+8880-8882,U+8888,U+888d,U+8892,U+8897-889c,U+889e-88a0,U+88a2,U+88a4,U+88a8,U+88aa,U+88ae,U+88b0-88b1,U+88b5,U+88b7,U+88ba,U+88bc-88c0,U+88c3-88c4,U+88c6,U+88ca-88ce,U+88d1-88d4,U+88d8-88d9,U+88db,U+88dd-88e1,U+88e7-88e8,U+88ef-88f2,U+88f4-88f5,U+88f7,U+88f9,U+88fc,U+8901-8902,U+8904,U+8906,U+890a,U+890c-890f,U+8913,U+8915-8916,U+8918-891a,U+891c-891e,U+8920,U+8925-8928,U+892a-892b,U+8930-8932,U+8935-893b,U+893e,U+8940-8946,U+8949,U+894c-894d,U+894f,U+8952,U+8956-8957,U+895a-895c,U+895e,U+8960-8964,U+8966,U+896a-896b,U+896d-8970}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.18.woff2) format("woff2");unicode-range:U+8655-8659,U+865b,U+865d-8664,U+8667,U+8669,U+866c,U+866f,U+8671,U+8675-8677,U+867a-867b,U+867d,U+8687-8689,U+868b-868d,U+8691,U+8693,U+8695-8696,U+8698,U+869a,U+869c-869d,U+86a1,U+86a3-86a4,U+86a6-86ab,U+86ad,U+86af-86b1,U+86b3-86b9,U+86bf-86c1,U+86c3-86c6,U+86c9,U+86cb,U+86ce,U+86d1-86d2,U+86d4-86d5,U+86d7,U+86da,U+86dc,U+86de-86e0,U+86e3-86e7,U+86e9,U+86ec-86ed,U+86ef,U+86f8-86fe,U+8700,U+8703-870b,U+870d-8714,U+8719-871a,U+871e-871f,U+8721-8723,U+8725,U+8728-8729,U+872e-872f,U+8731-8732,U+8734,U+8737,U+8739-8740,U+8743,U+8745,U+8749,U+874b-874e,U+8751,U+8753,U+8755,U+8757-8759,U+875d,U+875f-8761,U+8763-8766,U+8768,U+876a,U+876e-876f,U+8771-8772,U+8774,U+8778,U+877b-877c,U+877f,U+8782-8789,U+878b-878c,U+878e,U+8790,U+8793,U+8795,U+8797-8799,U+879e-87a0,U+87a2-87a3,U+87a7,U+87ab-87af,U+87b1,U+87b3,U+87b5,U+87bb,U+87bd-87c1,U+87c4,U+87c6-87cb,U+87ce,U+87d0,U+87d2,U+87d5-87d6,U+87d9-87da,U+87dc,U+87df-87e0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.19.woff2) format("woff2");unicode-range:U+84b4,U+84b9-84bb,U+84bd-84c2,U+84c6-84ca,U+84cc-84d1,U+84d3,U+84d6,U+84d9-84da,U+84dc,U+84e7,U+84ea,U+84ec,U+84ef-84f2,U+84f4,U+84f7,U+84fa-84fd,U+84ff-8500,U+8502-8503,U+8506-8507,U+850c,U+850e,U+8510,U+8514-8515,U+8517-8518,U+851a-851c,U+851e-851f,U+8521-8525,U+8527,U+852a-852c,U+852f,U+8532-8534,U+8536,U+853e-8541,U+8543,U+8546,U+8548,U+854a-854b,U+854f-8553,U+8555-855a,U+855c-8564,U+8569-856b,U+856d,U+856f,U+8577,U+8579-857b,U+857d-8581,U+8585-8586,U+8588-858c,U+858f-8591,U+8593,U+8597-8598,U+859b-859d,U+859f-85a0,U+85a2,U+85a4-85a5,U+85a7-85a8,U+85ad-85b0,U+85b4,U+85b6-85ba,U+85bc-85bf,U+85c1-85c2,U+85c7,U+85c9-85cb,U+85ce-85d0,U+85d5,U+85d8-85da,U+85dc,U+85df-85e1,U+85e5-85e6,U+85e8,U+85ed,U+85f3-85f4,U+85f6-85f7,U+85f9-85fa,U+85fc,U+85fe-8600,U+8602,U+8604-8606,U+860a-860b,U+860d-860e,U+8610-8613,U+8616-861b,U+861e,U+8621-8622,U+8624,U+8627,U+8629,U+862f-8630,U+8636,U+8638-863a,U+863c-863d,U+863f-8642,U+8646,U+864d,U+8652-8654}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.20.woff2) format("woff2");unicode-range:U+82e8,U+82ea,U+82ed,U+82ef,U+82f3-82f4,U+82f6-82f7,U+82f9,U+82fb,U+82fd-82fe,U+8300-8301,U+8303,U+8306-8308,U+830a-830c,U+8316-8318,U+831b,U+831d-831f,U+8321-8323,U+832b-8335,U+8337,U+833a,U+833c-833d,U+8340,U+8342-8347,U+834a,U+834d-8351,U+8353-8357,U+835a,U+8362-8363,U+8370,U+8373,U+8375,U+8378,U+837c-837d,U+837f-8380,U+8382,U+8384-8387,U+838a,U+838d-838e,U+8392-8396,U+8398-83a0,U+83a2,U+83a6-83ad,U+83b1,U+83b5,U+83bd-83c1,U+83c7,U+83c9,U+83ce-83d1,U+83d4,U+83d6,U+83d8,U+83dd,U+83df-83e1,U+83e5,U+83e8,U+83ea-83eb,U+83f0,U+83f2,U+83f4,U+83f6-83f9,U+83fb-83fd,U+8401,U+8403-8404,U+8406-8407,U+840a-840b,U+840d,U+840f,U+8411,U+8413,U+8415,U+8417,U+8419,U+8420,U+8422,U+842a,U+842f,U+8431,U+8435,U+8438-8439,U+843c,U+8445-8448,U+844a,U+844d-844f,U+8451-8452,U+8456,U+8458-845a,U+845c,U+845f-8462,U+8464-8467,U+8469-846b,U+846d-8470,U+8473-8474,U+8476-847a,U+847c-847d,U+8481-8482,U+8484-8485,U+848b,U+8490,U+8492-8493,U+8495,U+8497,U+849c,U+849e-849f,U+84a1,U+84a6,U+84a8-84aa,U+84ad,U+84af,U+84b1}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.21.woff2) format("woff2");unicode-range:U+814a,U+814c,U+8151-8153,U+8157,U+815f-8161,U+8165-8169,U+816d-816f,U+8171,U+8173-8174,U+8177,U+8180-8186,U+8188,U+818a-818b,U+818e,U+8190,U+8193,U+8195-8196,U+8198,U+819b,U+819e,U+81a0,U+81a2,U+81a4,U+81a9,U+81ae,U+81b0,U+81b2,U+81b4-81b5,U+81b8,U+81ba-81bb,U+81bd-81be,U+81c0-81c3,U+81c5-81c6,U+81c8-81cb,U+81cd-81cf,U+81d1,U+81d5-81db,U+81dd-81e1,U+81e4-81e5,U+81e7,U+81eb-81ec,U+81ef-81f2,U+81f5-81f6,U+81f8-81fb,U+81fd-8205,U+8209-820b,U+820d,U+820f,U+8212-8214,U+8216,U+8219-821d,U+8221-8222,U+8228-8229,U+822b,U+822e,U+8232-8235,U+8237-8238,U+823a,U+823c,U+8240,U+8243-8246,U+8249,U+824b,U+824e-824f,U+8251,U+8256-825a,U+825c-825d,U+825f-8260,U+8262-8264,U+8267-8268,U+826a-826b,U+826d-826e,U+8271,U+8274,U+8277,U+8279,U+827b,U+827d-8281,U+8283-8284,U+8287,U+8289-828a,U+828d-828e,U+8291-8294,U+8296,U+8298-829b,U+829f-82a1,U+82a3-82a4,U+82a7-82ac,U+82ae,U+82b0,U+82b2,U+82b4,U+82b7,U+82ba-82bc,U+82be-82bf,U+82c5-82c6,U+82d0,U+82d2-82d3,U+82d5,U+82d9-82da,U+82dc,U+82de-82e4,U+82e7}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.22.woff2) format("woff2");unicode-range:U+7f77-7f79,U+7f7d-7f80,U+7f82-7f83,U+7f86-7f88,U+7f8b-7f8d,U+7f8f-7f91,U+7f94,U+7f96-7f97,U+7f9a,U+7f9c-7f9d,U+7fa1-7fa3,U+7fa6,U+7faa,U+7fad-7faf,U+7fb2,U+7fb4,U+7fb6,U+7fb8-7fb9,U+7fbc,U+7fbf-7fc0,U+7fc3,U+7fc5-7fc6,U+7fc8,U+7fca,U+7fce-7fcf,U+7fd5,U+7fdb,U+7fdf,U+7fe1,U+7fe3,U+7fe5-7fe6,U+7fe8-7fe9,U+7feb-7fec,U+7fee-7ff0,U+7ff2-7ff3,U+7ff9-7ffa,U+7ffd-7fff,U+8002,U+8004,U+8006-8008,U+800a-800f,U+8011-8014,U+8016,U+8018-8019,U+801c-8021,U+8024,U+8026,U+8028,U+802c,U+802e,U+8030,U+8034-8035,U+8037,U+8039-8040,U+8043-8044,U+8046,U+804a,U+8052,U+8058,U+805a,U+805f-8060,U+8062,U+8064,U+8066,U+8068,U+806d,U+806f-8073,U+8075-8076,U+8079,U+807b,U+807d-8081,U+8084-8088,U+808b,U+808e,U+8093,U+8099-809a,U+809c,U+809e,U+80a4,U+80a6-80a7,U+80ab-80ad,U+80b1,U+80b8-80b9,U+80c4-80c5,U+80c8,U+80ca,U+80cd,U+80cf,U+80d2,U+80d4-80db,U+80dd,U+80e0,U+80e4-80e6,U+80ed-80f3,U+80f5-80f7,U+80f9-80fc,U+80fe,U+8101,U+8103,U+8109,U+810b,U+810d,U+8116-8118,U+811b-811c,U+811e,U+8120,U+8123-8124,U+8127,U+8129,U+812b-812c,U+812f-8130,U+8135,U+8139-813a,U+813c-813e,U+8141,U+8145-8147}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.23.woff2) format("woff2");unicode-range:U+7d57,U+7d59-7d5d,U+7d63,U+7d65,U+7d67,U+7d6a,U+7d6e,U+7d70,U+7d72-7d73,U+7d78,U+7d7a-7d7b,U+7d7d,U+7d7f,U+7d81-7d83,U+7d85-7d86,U+7d88-7d89,U+7d8b-7d8d,U+7d8f,U+7d91,U+7d93,U+7d96-7d97,U+7d9b-7da0,U+7da2-7da3,U+7da6-7da7,U+7daa-7dac,U+7dae-7db0,U+7db3,U+7db5-7db9,U+7dbd,U+7dc0,U+7dc2-7dc7,U+7dcc-7dce,U+7dd0,U+7dd5-7dd9,U+7ddc-7dde,U+7de1-7de6,U+7dea-7ded,U+7df1-7df2,U+7df5-7df6,U+7df9-7dfa,U+7e00,U+7e05,U+7e08-7e0b,U+7e10-7e12,U+7e15,U+7e17,U+7e1c-7e1d,U+7e1f-7e23,U+7e27-7e28,U+7e2c-7e2d,U+7e2f,U+7e31-7e33,U+7e35-7e37,U+7e39-7e3b,U+7e3d,U+7e3f,U+7e43-7e48,U+7e4e,U+7e50,U+7e52,U+7e56,U+7e58-7e5a,U+7e5d-7e5f,U+7e61-7e62,U+7e65-7e67,U+7e69-7e6b,U+7e6d-7e6f,U+7e73,U+7e75,U+7e78-7e79,U+7e7b-7e7f,U+7e81-7e83,U+7e86-7e8a,U+7e8c-7e8e,U+7e90-7e96,U+7e98,U+7e9a-7e9f,U+7f38,U+7f3a-7f3f,U+7f43-7f45,U+7f47,U+7f4c-7f50,U+7f52-7f55,U+7f58,U+7f5b-7f5d,U+7f5f,U+7f61,U+7f63-7f69,U+7f6b,U+7f6d,U+7f71}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.24.woff2) format("woff2");unicode-range:U+7bc8,U+7bca-7bcc,U+7bcf,U+7bd4,U+7bd6-7bd7,U+7bd9-7bdb,U+7bdd,U+7be5-7be6,U+7be8-7bea,U+7bf0,U+7bf2-7bfa,U+7bfc,U+7bfe,U+7c00-7c04,U+7c06-7c07,U+7c09,U+7c0b-7c0f,U+7c11-7c14,U+7c17,U+7c19,U+7c1b,U+7c1e-7c20,U+7c23,U+7c25-7c28,U+7c2a-7c2c,U+7c2f,U+7c31,U+7c33-7c34,U+7c36-7c3a,U+7c3d-7c3e,U+7c40,U+7c42-7c43,U+7c45-7c46,U+7c4a,U+7c4c,U+7c4f-7c5f,U+7c61,U+7c63-7c65,U+7c67,U+7c69,U+7c6c-7c70,U+7c72,U+7c75,U+7c79,U+7c7b-7c7e,U+7c81-7c83,U+7c86-7c87,U+7c8d,U+7c8f-7c90,U+7c94,U+7c9e,U+7ca0-7ca2,U+7ca4-7ca6,U+7ca8,U+7cab,U+7cad-7cae,U+7cb0-7cb3,U+7cb6-7cb7,U+7cb9-7cbd,U+7cbf-7cc0,U+7cc2,U+7cc4-7cc5,U+7cc7-7cca,U+7ccd-7ccf,U+7cd2-7cd5,U+7cd7-7cda,U+7cdc-7cdd,U+7cdf-7ce0,U+7ce2,U+7ce6,U+7ce9,U+7ceb,U+7cef,U+7cf2,U+7cf4-7cf6,U+7cf9-7cfa,U+7cfe,U+7d02-7d03,U+7d06-7d0a,U+7d0f,U+7d11-7d13,U+7d15-7d16,U+7d1c-7d1e,U+7d23,U+7d26,U+7d2a,U+7d2c-7d2e,U+7d31-7d32,U+7d35,U+7d3c-7d41,U+7d43,U+7d45,U+7d47-7d48,U+7d4b,U+7d4d-7d4f,U+7d51,U+7d53,U+7d55-7d56}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.25.woff2) format("woff2");unicode-range:U+7a17-7a19,U+7a1b,U+7a1e-7a21,U+7a27,U+7a2b,U+7a2d,U+7a2f-7a31,U+7a34-7a35,U+7a37-7a3b,U+7a3e,U+7a43-7a49,U+7a4c,U+7a4e,U+7a50,U+7a55-7a57,U+7a59,U+7a5c-7a5d,U+7a5f-7a63,U+7a65,U+7a67,U+7a69-7a6a,U+7a6d,U+7a70,U+7a75,U+7a78-7a79,U+7a7d-7a7e,U+7a80,U+7a82,U+7a84-7a86,U+7a88,U+7a8a-7a8b,U+7a90-7a91,U+7a94-7a98,U+7a9e,U+7aa0,U+7aa3,U+7aa9,U+7aac,U+7ab0,U+7ab3,U+7ab5-7ab6,U+7ab9-7abf,U+7ac3,U+7ac5-7aca,U+7acc-7acf,U+7ad1-7ad3,U+7ad5,U+7ada-7adb,U+7add,U+7adf,U+7ae1-7ae2,U+7ae6-7aed,U+7af0-7af1,U+7af4,U+7af8,U+7afa-7afb,U+7afd-7afe,U+7b02,U+7b04,U+7b06-7b08,U+7b0a-7b0b,U+7b0f,U+7b12,U+7b14,U+7b18-7b19,U+7b1e-7b1f,U+7b23,U+7b25,U+7b27-7b2b,U+7b2d-7b31,U+7b33-7b36,U+7b3b,U+7b3d,U+7b3f-7b41,U+7b45,U+7b47,U+7b4c-7b50,U+7b53,U+7b55,U+7b5d,U+7b60,U+7b64-7b66,U+7b69-7b6a,U+7b6c-7b75,U+7b77,U+7b79-7b7a,U+7b7f,U+7b84,U+7b86,U+7b89,U+7b8d-7b92,U+7b96,U+7b98-7ba0,U+7ba5,U+7bac-7bad,U+7baf-7bb0,U+7bb2,U+7bb4-7bb6,U+7bba-7bbd,U+7bc1-7bc2,U+7bc5-7bc6}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.26.woff2) format("woff2");unicode-range:U+7851-7852,U+785c,U+785e,U+7860-7861,U+7863-7864,U+7868,U+786a,U+786e-786f,U+7872,U+7874,U+787a,U+787c,U+787e,U+7886-7887,U+788a,U+788c-788f,U+7893-7895,U+7898,U+789a,U+789d-789f,U+78a1,U+78a3-78a4,U+78a8-78aa,U+78ac-78ad,U+78af-78b3,U+78b5,U+78bb-78bf,U+78c5-78cc,U+78ce,U+78d1-78d6,U+78da-78db,U+78df-78e1,U+78e4,U+78e6-78e7,U+78ea,U+78ec,U+78f2-78f4,U+78f6-78f7,U+78f9-78fb,U+78fd-7901,U+7906-7907,U+790c,U+7910-7912,U+7919-791c,U+791e-7920,U+7925-792e,U+7930-7931,U+7934-7935,U+793b,U+793d,U+793f,U+7941-7942,U+7944-7946,U+794a-794b,U+794f,U+7951,U+7954-7955,U+7957-7958,U+795a-795c,U+795f-7960,U+7962,U+7967,U+7969,U+796b,U+7972,U+7977,U+7979-797c,U+797e-7980,U+798a-798e,U+7991,U+7993-7996,U+7998,U+799b-799d,U+79a1,U+79a6-79ab,U+79ae-79b1,U+79b3-79b4,U+79b8-79bb,U+79bd-79be,U+79c2,U+79c4,U+79c7-79ca,U+79cc-79cd,U+79cf,U+79d4-79d6,U+79da,U+79dd-79e3,U+79e5,U+79e7,U+79ea-79ed,U+79f1,U+79f8,U+79fc,U+7a02-7a03,U+7a05,U+7a07-7a0a,U+7a0c-7a0d,U+7a11,U+7a15}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.27.woff2) format("woff2");unicode-range:U+768c-768e,U+7690,U+7693,U+7695-7696,U+7699-76a8,U+76aa,U+76ad,U+76af-76b0,U+76b4,U+76b6-76ba,U+76bd,U+76c1-76c3,U+76c5,U+76c8-76c9,U+76cb-76ce,U+76d2,U+76d4,U+76d6,U+76d9,U+76dc,U+76de,U+76e0-76e1,U+76e5-76e8,U+76ea-76ec,U+76f0-76f1,U+76f6,U+76f9,U+76fb-76fc,U+7700,U+7704,U+7706-7708,U+770a,U+770e,U+7712,U+7714-7715,U+7717,U+7719-771c,U+7722,U+7724-7726,U+7728,U+772d-772f,U+7734-7739,U+773d-773e,U+7742,U+7745-7747,U+774a,U+774d-774f,U+7752,U+7756-7758,U+775a-775c,U+775e-7760,U+7762,U+7764-7765,U+7767,U+776a-776c,U+7770,U+7772-7774,U+7779-777a,U+777c-7780,U+7784,U+778b-778e,U+7794-7796,U+779a,U+779e-77a0,U+77a2,U+77a4-77a5,U+77a7,U+77a9-77aa,U+77ae-77b1,U+77b5-77b7,U+77b9,U+77bb-77bf,U+77c3,U+77c7,U+77c9,U+77cd,U+77d1-77d2,U+77d5,U+77d7,U+77d9-77da,U+77dc,U+77de-77e0,U+77e3-77e4,U+77e6-77e7,U+77e9-77ea,U+77ec,U+77ee,U+77f0-77f1,U+77f4,U+77f8,U+77fb-77fc,U+7805-7806,U+7809,U+780c-780e,U+7811-7812,U+7819,U+781d,U+7820-7823,U+7826-7827,U+782c-782e,U+7830,U+7835,U+7837,U+783a,U+783f,U+7843-7845,U+7847-7848,U+784c,U+784e-784f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.28.woff2) format("woff2");unicode-range:U+7511-7513,U+7515-7517,U+751c,U+751e,U+7520-7522,U+7524,U+7526-7527,U+7529-752c,U+752f,U+7536,U+7538-7539,U+753c-7540,U+7543-7544,U+7546-754b,U+754d-7550,U+7552,U+7557,U+755a-755b,U+755d-755f,U+7561-7562,U+7564,U+7566-7567,U+7569,U+756b-756d,U+756f,U+7571-7572,U+7574-757e,U+7581-7582,U+7585-7587,U+7589-758c,U+758f-7590,U+7592-7595,U+7599-759a,U+759c-759d,U+75a2-75a5,U+75b0-75b1,U+75b3-75b5,U+75b7-75b8,U+75ba,U+75bd,U+75bf-75c4,U+75c6,U+75ca,U+75cc-75cf,U+75d3-75d4,U+75d7-75d8,U+75dc-75e1,U+75e3-75e4,U+75e7,U+75ec,U+75ee-75f3,U+75f9,U+75fc,U+75fe-7604,U+7607-760c,U+760f,U+7612-7613,U+7615-7616,U+7618-7619,U+761b-7629,U+762d,U+7630,U+7632-7635,U+7638-763c,U+7640-7641,U+7643-764b,U+764e,U+7655,U+7658-7659,U+765c,U+765f,U+7661-7662,U+7664-7665,U+7667-766a,U+766c-7672,U+7674,U+7676,U+7678,U+7680-7683,U+7685,U+7688,U+768b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.29.woff2) format("woff2");unicode-range:U+736c,U+736e-7371,U+7375,U+7377-737c,U+7380-7381,U+7383,U+7385-7386,U+738a,U+738e,U+7390,U+7393-7398,U+739c,U+739e-73a0,U+73a2,U+73a5-73a6,U+73a8,U+73aa-73ab,U+73ad,U+73b3,U+73b5,U+73b7,U+73b9-73bd,U+73bf,U+73c5-73c6,U+73c9-73cc,U+73ce-73cf,U+73d2-73d3,U+73d6,U+73d9,U+73dd-73de,U+73e1,U+73e3-73e7,U+73e9-73ea,U+73ee,U+73f1,U+73f4-73f5,U+73f7-73fb,U+73fd,U+73ff-7401,U+7404-7405,U+7407,U+740a,U+7411,U+7413,U+741a-741b,U+7421,U+7424,U+7426,U+7428-7431,U+7433,U+7439-743a,U+743f-7441,U+7443-7444,U+7446-7447,U+744b,U+744d,U+7451-7453,U+7455,U+7457,U+7459-745a,U+745c-745d,U+745f,U+7462-7464,U+7466-746b,U+746d-7473,U+7476,U+747e,U+7480-7481,U+7485-7489,U+748b,U+748f-7492,U+7497-749a,U+749c,U+749e-74a3,U+74a5-74a6,U+74a8-74ab,U+74ae-74af,U+74b1-74b2,U+74b5,U+74b9-74bb,U+74bd,U+74bf,U+74c8-74ca,U+74cc,U+74cf-74d0,U+74d3-74d4,U+74d6,U+74d8,U+74da-74db,U+74de-74e0,U+74e3-74e4,U+74e7-74eb,U+74ee-74f2,U+74f4,U+74f7-74f8,U+74fa-74fc,U+74ff,U+7501,U+7503-7506,U+750c-750e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.30.woff2) format("woff2");unicode-range:U+7166,U+7168,U+716c,U+7179,U+7180,U+7184-7185,U+7187-7188,U+718c,U+718f,U+7192,U+7194-7196,U+7199-719b,U+71a0,U+71a2,U+71a8,U+71ac,U+71ae-71b0,U+71b2-71b3,U+71b9-71ba,U+71be-71c1,U+71c4,U+71c9,U+71cb-71cc,U+71ce,U+71d0,U+71d2-71d4,U+71d6-71d7,U+71d9-71da,U+71dc,U+71df-71e0,U+71e6-71e7,U+71ec-71ee,U+71f4-71f5,U+71f8-71f9,U+71fc,U+71fe-7200,U+7207-7209,U+720d,U+7210,U+7213,U+7215,U+7217,U+721a,U+721d,U+721f,U+7224,U+7228,U+722b,U+722d,U+722f-7230,U+7232,U+7234,U+7238-7239,U+723b-723c,U+723e-7243,U+7245-7246,U+724b,U+724e-7250,U+7252-7253,U+7255-7258,U+725a,U+725c,U+725e,U+7260,U+7263,U+7268,U+726b,U+726e-726f,U+7271,U+7274,U+7277-7278,U+727b-727c,U+727e-7282,U+7284,U+7287,U+7289,U+728d-728e,U+7292-7293,U+7296,U+729b,U+72a2,U+72a7-72a8,U+72ad-72ae,U+72b0-72b2,U+72b4,U+72b9,U+72be,U+72c0-72c1,U+72c3-72c4,U+72c6-72c7,U+72c9,U+72cc,U+72ce,U+72d2,U+72d5-72d6,U+72d8,U+72df-72e2,U+72e5,U+72f3-72f4,U+72f7,U+72f9-72fb,U+72fd-72fe,U+7302,U+7304-7305,U+7307,U+730a-730b,U+730d,U+7312-7313,U+7316-7319,U+731c-731e,U+7322,U+7324,U+7327-7329,U+732c,U+732f,U+7331-7337,U+7339-733b,U+733d-733e,U+7343,U+734d-7350,U+7352,U+7356-7358,U+735d-7360,U+7366-736b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.31.woff2) format("woff2");unicode-range:U+6f58-6f5b,U+6f5d-6f5e,U+6f60-6f62,U+6f66,U+6f68,U+6f6c-6f6d,U+6f6f,U+6f74,U+6f78,U+6f7a,U+6f7c-6f7e,U+6f80,U+6f82-6f83,U+6f86-6f88,U+6f8b-6f8e,U+6f90-6f94,U+6f96-6f98,U+6f9a,U+6f9d,U+6f9f-6fa1,U+6fa3,U+6fa5-6fa8,U+6fae-6fb1,U+6fb3,U+6fb5-6fb7,U+6fb9,U+6fbc,U+6fbe,U+6fc2,U+6fc5-6fca,U+6fd4-6fd5,U+6fd8,U+6fda-6fdb,U+6fde-6fe0,U+6fe4,U+6fe8-6fe9,U+6feb-6fec,U+6fee,U+6ff0,U+6ff3,U+6ff5-6ff6,U+6ff9-6ffa,U+6ffc-6ffe,U+7000-7001,U+7005-7007,U+7009-700b,U+700d,U+700f,U+7011,U+7015,U+7017-7018,U+701a-701b,U+701d-7020,U+7023,U+7026,U+7028,U+702f-7030,U+7032,U+7034,U+7037,U+7039-703a,U+703c,U+703e,U+7043-7044,U+7047-704c,U+704e,U+7051,U+7054-7055,U+705d-705e,U+7064-7065,U+7069,U+706c,U+706e,U+7075-7076,U+707e,U+7081,U+7085-7086,U+7094-7098,U+709b,U+709f,U+70a4,U+70ab-70ac,U+70ae-70b1,U+70b3-70b4,U+70b7,U+70bb,U+70ca-70cb,U+70d1,U+70d3-70d6,U+70d8-70d9,U+70dc-70dd,U+70df,U+70e4,U+70ec,U+70f1,U+70fa,U+70fd,U+7103-7108,U+710b-710c,U+710f,U+7114,U+7119,U+711c,U+711e,U+7120,U+712b,U+712d-7131,U+7138,U+7141,U+7145-7147,U+7149-714b,U+7150-7153,U+7155-7157,U+715a,U+715c,U+715e,U+7160,U+7162,U+7164-7165}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.32.woff2) format("woff2");unicode-range:U+6d7c,U+6d80-6d82,U+6d85,U+6d87,U+6d89-6d8a,U+6d8c-6d8e,U+6d91-6d98,U+6d9c,U+6daa-6dac,U+6dae,U+6db4-6db5,U+6db7-6db9,U+6dbd,U+6dbf,U+6dc2,U+6dc4-6dc8,U+6dca,U+6dcc,U+6dce-6dd0,U+6dd2,U+6dd5-6dd6,U+6dd8-6ddb,U+6ddd-6de0,U+6de2,U+6de4-6de6,U+6de8-6dea,U+6dec,U+6dee-6df0,U+6df2,U+6df4,U+6df6,U+6df8-6dfa,U+6dfc,U+6e00,U+6e04,U+6e0a,U+6e17,U+6e19,U+6e1d-6e20,U+6e22-6e25,U+6e27,U+6e2b,U+6e2d-6e2e,U+6e32,U+6e34,U+6e36,U+6e38-6e3c,U+6e42-6e45,U+6e48-6e49,U+6e4b-6e4f,U+6e51-6e54,U+6e57,U+6e5b-6e5f,U+6e62-6e63,U+6e68,U+6e6b,U+6e6e,U+6e72-6e73,U+6e76,U+6e7b,U+6e7d,U+6e82,U+6e89,U+6e8c-6e8d,U+6e8f,U+6e93,U+6e98-6e99,U+6e9f-6ea0,U+6ea5,U+6ea7,U+6eaa-6eab,U+6ead-6eaf,U+6eb1-6eb4,U+6eb7,U+6ebb-6ebd,U+6ebf-6ec4,U+6ec7-6eca,U+6ecc-6ecf,U+6ed3-6ed5,U+6ed9-6edb,U+6ee6,U+6eeb-6eef,U+6ef7-6ef9,U+6efb,U+6efd-6eff,U+6f04,U+6f08-6f0a,U+6f0c-6f0d,U+6f10-6f11,U+6f13,U+6f15-6f16,U+6f18,U+6f1a-6f1b,U+6f25-6f26,U+6f29-6f2a,U+6f2d,U+6f2f-6f33,U+6f35-6f36,U+6f38,U+6f3b-6f3c,U+6f3e-6f3f,U+6f41,U+6f45,U+6f4f,U+6f51-6f53,U+6f57}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.33.woff2) format("woff2");unicode-range:U+6b85,U+6b89,U+6b8d,U+6b95,U+6b97-6b98,U+6b9b,U+6b9e-6ba0,U+6ba2-6ba4,U+6ba8-6bb3,U+6bb7-6bb9,U+6bbc-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bc9,U+6bcb-6bcc,U+6bcf,U+6bd3,U+6bd6-6bd8,U+6bda,U+6bdf,U+6be1,U+6be3,U+6be6-6be7,U+6beb-6bec,U+6bee,U+6bf1,U+6bf3,U+6bf7,U+6bf9,U+6bff,U+6c02,U+6c04-6c05,U+6c08-6c0a,U+6c0d-6c0e,U+6c10,U+6c12-6c14,U+6c19,U+6c1b,U+6c1f,U+6c24,U+6c26-6c28,U+6c2c,U+6c2e,U+6c33,U+6c35-6c36,U+6c3a-6c3b,U+6c3e-6c40,U+6c4a-6c4b,U+6c4d,U+6c4f,U+6c52,U+6c54-6c55,U+6c59,U+6c5b-6c5e,U+6c62,U+6c67-6c68,U+6c6a-6c6b,U+6c6d,U+6c6f,U+6c73-6c74,U+6c76,U+6c78-6c79,U+6c7b,U+6c7e,U+6c81-6c87,U+6c89,U+6c8c-6c8d,U+6c90,U+6c92-6c95,U+6c97-6c98,U+6c9a-6c9c,U+6c9f,U+6caa-6cae,U+6cb0-6cb2,U+6cb4,U+6cba,U+6cbd-6cbe,U+6cc2,U+6cc5-6cc6,U+6ccd,U+6ccf-6cd4,U+6cd6-6cd7,U+6cd9-6cdd,U+6ce0,U+6ce7,U+6ce9-6cef,U+6cf1-6cf2,U+6cf4,U+6cfb,U+6d00-6d01,U+6d04,U+6d07,U+6d0a,U+6d0c,U+6d0e-6d0f,U+6d11,U+6d13,U+6d19-6d1a,U+6d1f,U+6d24,U+6d26-6d28,U+6d2b,U+6d2e-6d2f,U+6d31,U+6d33-6d36,U+6d38-6d39,U+6d3c-6d3d,U+6d3f,U+6d57-6d5b,U+6d5e-6d61,U+6d64-6d65,U+6d67,U+6d6c,U+6d6f-6d70,U+6d79}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.34.woff2) format("woff2");unicode-range:U+69dd-69de,U+69e2-69e3,U+69e5,U+69e7-69eb,U+69ed-69ef,U+69f1-69f6,U+69f9,U+69fe-6a01,U+6a03,U+6a05,U+6a0a,U+6a0c,U+6a0f,U+6a11-6a15,U+6a17,U+6a1a-6a1b,U+6a1d-6a20,U+6a22-6a24,U+6a28,U+6a2e,U+6a30,U+6a32-6a38,U+6a3b,U+6a3e-6a3f,U+6a44-6a4a,U+6a4e,U+6a50-6a52,U+6a54-6a56,U+6a5b,U+6a61-6a62,U+6a64,U+6a66-6a67,U+6a6a-6a6b,U+6a71-6a73,U+6a78,U+6a7a,U+6a7e-6a7f,U+6a81,U+6a83-6a84,U+6a86-6a87,U+6a89,U+6a8b,U+6a8d,U+6a90-6a91,U+6a94,U+6a97,U+6a9b,U+6a9d-6aa3,U+6aa5,U+6aaa-6aac,U+6aae-6ab1,U+6ab3-6ab4,U+6ab8,U+6abb,U+6abd-6abf,U+6ac1-6ac3,U+6ac6,U+6ac8-6ac9,U+6acc,U+6ad0-6ad1,U+6ad3-6ad6,U+6ada-6adf,U+6ae2,U+6ae4,U+6ae7-6ae8,U+6aea,U+6aec,U+6af0-6af3,U+6af8,U+6afa,U+6afc-6afd,U+6b02-6b03,U+6b06-6b07,U+6b09-6b0b,U+6b0f-6b12,U+6b16-6b17,U+6b1b,U+6b1d-6b1f,U+6b23-6b24,U+6b28,U+6b2b-6b2c,U+6b2f,U+6b35-6b39,U+6b3b,U+6b3d,U+6b3f,U+6b43,U+6b46-6b47,U+6b49-6b4a,U+6b4d-6b4e,U+6b50,U+6b52,U+6b54,U+6b56,U+6b58-6b59,U+6b5b,U+6b5d,U+6b5f-6b61,U+6b65,U+6b67,U+6b6b-6b6c,U+6b6e,U+6b70,U+6b72,U+6b75,U+6b77-6b7a,U+6b7d-6b84}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.35.woff2) format("woff2");unicode-range:U+6855,U+6857-6859,U+685b,U+685d,U+685f,U+6863,U+6867,U+686b,U+686e-6872,U+6874-6875,U+6877,U+6879-687c,U+687e-687f,U+6882-6884,U+6886,U+6888,U+688d-6890,U+6894,U+6896,U+6898-689c,U+689f-68a3,U+68a5-68a7,U+68a9-68ab,U+68ad-68af,U+68b2-68b5,U+68b9-68bc,U+68c3,U+68c5-68c6,U+68c8-68ca,U+68cc-68cd,U+68cf-68d1,U+68d3-68d9,U+68dc-68dd,U+68e0-68e1,U+68e3-68e5,U+68e7-68e8,U+68ea-68ed,U+68ef-68f1,U+68f5-68f7,U+68f9,U+68fb-68fd,U+6900-6901,U+6903-6904,U+6906-690c,U+690f-6911,U+6913,U+6916-6917,U+6919-691b,U+6921-6923,U+6925-6926,U+6928,U+692a,U+6930-6931,U+6933-6936,U+6938-6939,U+693b,U+693d,U+6942,U+6945-6946,U+6949,U+694e,U+6954,U+6957,U+6959,U+695b-695e,U+6961-6966,U+6968-696c,U+696e-6974,U+6977-697b,U+697e-6981,U+6986,U+698d,U+6991-6992,U+6994-6996,U+6998,U+699c,U+69a0-69a1,U+69a5-69a8,U+69ab,U+69ad,U+69af-69b2,U+69b4,U+69b7-69b8,U+69ba-69bc,U+69be-69c1,U+69c3,U+69c5,U+69c7-69c8,U+69ca,U+69ce-69d1,U+69d3,U+69d6-69d7,U+69d9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.36.woff2) format("woff2");unicode-range:U+667e-6680,U+6683-6684,U+6688,U+668b-668e,U+6690,U+6692,U+6698-669d,U+669f-66a0,U+66a2,U+66a4,U+66ad,U+66b1-66b3,U+66b5,U+66b8-66b9,U+66bb-66bc,U+66be-66c4,U+66c6,U+66c8-66c9,U+66cc,U+66ce-66cf,U+66d4,U+66da-66db,U+66dd,U+66df-66e0,U+66e6,U+66e8-66e9,U+66eb-66ec,U+66ee,U+66f5,U+66f7,U+66fa-66fc,U+6701,U+6705,U+6707,U+670c,U+670e-6710,U+6712-6716,U+6719,U+671c,U+671e,U+6720,U+6722,U+6725-6726,U+672e,U+6733,U+6735-6738,U+673e-673f,U+6741,U+6743,U+6745-6748,U+674c-674d,U+6753-6755,U+6759,U+675d-675e,U+6760,U+6762-6764,U+6766,U+676a,U+676c,U+676e,U+6770,U+6772-6774,U+6776-6777,U+677b-677c,U+6780-6781,U+6784-6785,U+6787,U+6789,U+678b-678c,U+678e-678f,U+6791-6793,U+6796,U+6798-6799,U+679b,U+67a1,U+67a4,U+67a6,U+67a9,U+67b0-67b5,U+67b7-67b9,U+67bb-67be,U+67c0-67c3,U+67c5-67c6,U+67c8-67c9,U+67ce,U+67d2,U+67d7-67d9,U+67db-67de,U+67e1-67e2,U+67e4,U+67e6-67e7,U+67e9,U+67ec,U+67ee-67f0,U+67f2,U+67f6-67f7,U+67f9-67fa,U+67fc,U+67fe,U+6801-6802,U+6805,U+6810,U+6814,U+6818-6819,U+681d,U+681f,U+6822,U+6827-6829,U+682b-682d,U+682f-6834,U+683b,U+683e-6840,U+6844-6846,U+6849-684a,U+684c-684e,U+6852-6854}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.37.woff2) format("woff2");unicode-range:U+64d2,U+64d4-64d5,U+64d7-64d8,U+64da,U+64e0-64e1,U+64e3-64e5,U+64e7,U+64e9-64ea,U+64ed,U+64ef-64f2,U+64f4-64f7,U+64fa-64fb,U+64fd-6501,U+6504-6505,U+6508-650a,U+650f,U+6513-6514,U+6516,U+6518-6519,U+651b-651f,U+6522,U+6524,U+6526,U+6529-652c,U+652e,U+6531-6532,U+6534-6538,U+653a,U+653c-653d,U+6543-6544,U+6547-6549,U+654d-654e,U+6550,U+6552,U+6554-6556,U+6558,U+655d-6560,U+6567,U+656b,U+6572,U+6578,U+657a,U+657d,U+6581-6585,U+6588,U+658a,U+658c,U+6592,U+6595,U+6598,U+659b,U+659d,U+659f-65a1,U+65a3-65a6,U+65ab,U+65ae,U+65b2-65b5,U+65b7-65b8,U+65be-65bf,U+65c1-65c4,U+65c6,U+65c8-65c9,U+65cc,U+65ce,U+65d0,U+65d2,U+65d4,U+65d6,U+65d8-65d9,U+65db,U+65df-65e1,U+65e3,U+65f0-65f2,U+65f4-65f5,U+65f9,U+65fb-65fc,U+65fe-6600,U+6603-6604,U+6608-660a,U+660d,U+6611-6612,U+6615-6616,U+661c-661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630-6631,U+6633-6637,U+6639-663b,U+663f-6641,U+6644-6646,U+6648-664a,U+664c,U+664e-664f,U+6651,U+6657-6665,U+6667-6668,U+666a-666d,U+6670,U+6673,U+6675,U+6677-6679,U+667b-667c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.38.woff2) format("woff2");unicode-range:U+62cf,U+62d1,U+62d4-62d6,U+62da,U+62dc,U+62ea,U+62ee-62ef,U+62f1-62f2,U+62f4-62f5,U+62fc-62fd,U+62ff,U+6302-6304,U+6308-630d,U+6310,U+6313,U+6316,U+6318,U+631b,U+6327,U+6329-632a,U+632d,U+6332,U+6335-6336,U+6339-633c,U+633e,U+6341-6344,U+6346,U+634a-634e,U+6350,U+6352-6354,U+6358-6359,U+635b,U+6365-6366,U+6369,U+636b-636d,U+6371-6372,U+6374-6378,U+637a,U+637c-637d,U+637f-6380,U+6382,U+6384,U+6387,U+6389-638a,U+638e-6390,U+6394-6396,U+6399-639a,U+639e,U+63a0,U+63a3-63a4,U+63a6,U+63a9,U+63ab-63af,U+63b5,U+63bd-63be,U+63c0-63c1,U+63c4-63c6,U+63c8,U+63ce,U+63d1-63d6,U+63dc,U+63e0,U+63e3,U+63e5,U+63e9-63ed,U+63f2-63f3,U+63f5-63f9,U+6406,U+6409-640a,U+640f-6410,U+6412-6414,U+6416-6418,U+641e,U+6420,U+6422,U+6424-6426,U+6428-642a,U+642f-6430,U+6434-6436,U+643d,U+643f,U+644b,U+644e-644f,U+6451-6454,U+645a-645d,U+645f-6461,U+6463,U+6467,U+646d,U+6473-6474,U+6476,U+6478-6479,U+647b,U+647d,U+6485,U+6487-6488,U+648f-6491,U+6493,U+6495,U+6498-649b,U+649d-649f,U+64a1,U+64a3,U+64a6,U+64a8-64a9,U+64ac,U+64b3,U+64bb-64bf,U+64c2,U+64c4-64c5,U+64c7,U+64c9-64cc,U+64ce,U+64d0-64d1}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.39.woff2) format("woff2");unicode-range:U+6117,U+6119,U+611c,U+611e,U+6120-6122,U+6127-6128,U+612a-612c,U+6130-6131,U+6134-6137,U+6139-613a,U+613c-613f,U+6141-6142,U+6144-6147,U+6149-614a,U+614d,U+6153,U+6158-615a,U+615d-6160,U+6164-6165,U+616b-616c,U+616f,U+6171-6175,U+6177-6178,U+617b-6181,U+6183-6184,U+6187,U+618a-618b,U+618d,U+6192-6194,U+6196-619a,U+619c-619d,U+619f-61a0,U+61a5,U+61a8,U+61aa-61ae,U+61b8-61ba,U+61bc,U+61be,U+61c0-61c3,U+61c6,U+61c8,U+61ca-61cf,U+61d5,U+61dc-61df,U+61e1-61e3,U+61e5-61e9,U+61ec-61ed,U+61ef,U+61f4-61f7,U+61fa,U+61fc-6201,U+6203-6204,U+6207-620a,U+620d-620e,U+6213-6215,U+621b-621e,U+6220-6223,U+6227,U+6229-622b,U+622e,U+6230-6233,U+6236,U+6239,U+623d-623e,U+6241-6244,U+6246,U+6248,U+624c,U+624e,U+6250-6252,U+6254,U+6256,U+6258,U+625a-625c,U+625e,U+6260-6261,U+6263-6264,U+6268,U+626d,U+626f,U+6273,U+627a-627e,U+6282-6283,U+6285,U+6289,U+628d-6290,U+6292-6294,U+6296,U+6299,U+629b,U+62a6,U+62a8,U+62ac,U+62b3,U+62b6-62b7,U+62ba-62bb,U+62be-62bf,U+62c2,U+62c4,U+62c6-62c8,U+62ca,U+62ce}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.40.woff2) format("woff2");unicode-range:U+5f6c-5f6d,U+5f6f,U+5f72-5f75,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f82-5f83,U+5f87-5f89,U+5f8d,U+5f8f,U+5f91,U+5f96,U+5f99,U+5f9c-5f9d,U+5fa0,U+5fa2,U+5fa4,U+5fa7-5fa8,U+5fab-5fad,U+5faf-5fb1,U+5fb5,U+5fb7-5fb8,U+5fbc-5fbd,U+5fc4,U+5fc7-5fc9,U+5fcb,U+5fd0-5fd4,U+5fdd-5fde,U+5fe1-5fe2,U+5fe4,U+5fe8-5fea,U+5fec-5ff3,U+5ff6,U+5ff8,U+5ffa-5ffd,U+5fff,U+6007,U+600a,U+600d-6010,U+6013-6015,U+6017-601b,U+601f,U+6021-6022,U+6024,U+6026,U+6029,U+602b,U+602d,U+6031,U+6033,U+6035,U+603a,U+6040-6043,U+6046-604a,U+604c-604d,U+6051,U+6054-6057,U+6059-605a,U+605d,U+605f-6064,U+6067,U+606a-606c,U+6070-6071,U+6077,U+607e-607f,U+6081-6086,U+6088-608e,U+6091-6093,U+6095-6098,U+609a-609b,U+609d-609e,U+60a2,U+60a4-60a5,U+60a7-60a8,U+60b0-60b1,U+60b3-60b5,U+60b7-60b8,U+60bb,U+60bd-60be,U+60c2,U+60c4,U+60c6-60cb,U+60ce-60cf,U+60d3-60d5,U+60d8-60d9,U+60db,U+60dd-60df,U+60e1-60e2,U+60e5,U+60ee,U+60f0-60f2,U+60f4-60f8,U+60fa-60fd,U+6100,U+6102-6103,U+6106-6108,U+610a,U+610c-610e,U+6110-6114,U+6116}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.41.woff2) format("woff2");unicode-range:U+5d9b,U+5d9d,U+5d9f-5da0,U+5da2,U+5da4,U+5da7,U+5dab-5dac,U+5dae,U+5db0,U+5db2,U+5db4,U+5db7-5db9,U+5dbc-5dbd,U+5dc3,U+5dc7,U+5dc9,U+5dcb-5dce,U+5dd0-5dd3,U+5dd6-5dd9,U+5ddb,U+5de0,U+5de2,U+5de4,U+5de9,U+5df2,U+5df5,U+5df8-5df9,U+5dfd,U+5dff-5e00,U+5e07,U+5e0b,U+5e0d,U+5e11-5e12,U+5e14-5e15,U+5e18-5e1b,U+5e1f-5e20,U+5e25,U+5e28,U+5e2e,U+5e32,U+5e35-5e37,U+5e3e,U+5e40,U+5e43-5e44,U+5e47,U+5e49,U+5e4b,U+5e4e,U+5e50-5e51,U+5e54,U+5e56-5e58,U+5e5b-5e5c,U+5e5e-5e5f,U+5e62,U+5e64,U+5e68,U+5e6a-5e6e,U+5e70,U+5e75-5e77,U+5e7a,U+5e7f-5e80,U+5e87,U+5e8b,U+5e8e,U+5e96,U+5e99-5e9a,U+5ea0,U+5ea2,U+5ea4-5ea5,U+5ea8,U+5eaa,U+5eac,U+5eb1,U+5eb3,U+5eb8-5eb9,U+5ebd-5ebf,U+5ec1-5ec2,U+5ec6,U+5ec8,U+5ecb-5ecc,U+5ece-5ed6,U+5ed9-5ee2,U+5ee5,U+5ee8-5ee9,U+5eeb-5eec,U+5ef0-5ef1,U+5ef3-5ef4,U+5ef8-5ef9,U+5efc-5f00,U+5f02-5f03,U+5f06-5f09,U+5f0b-5f0e,U+5f11,U+5f16-5f17,U+5f19,U+5f1b-5f1e,U+5f21-5f24,U+5f27-5f29,U+5f2b-5f30,U+5f34,U+5f36,U+5f38,U+5f3a-5f3d,U+5f3f-5f41,U+5f44-5f45,U+5f47-5f48,U+5f4a,U+5f4c-5f4e,U+5f50-5f51,U+5f54,U+5f56-5f58,U+5f5b-5f5d,U+5f60,U+5f63-5f65,U+5f67,U+5f6a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.42.woff2) format("woff2");unicode-range:U+5bbc,U+5bc0-5bc1,U+5bc3,U+5bc7,U+5bc9,U+5bcd-5bd0,U+5bd3-5bd4,U+5bd6-5bda,U+5bde,U+5be0-5be2,U+5be4-5be6,U+5be8,U+5beb-5bec,U+5bef-5bf1,U+5bf3-5bf6,U+5bfd,U+5c03,U+5c05,U+5c07-5c09,U+5c0c-5c0d,U+5c12-5c14,U+5c17,U+5c19,U+5c1e-5c20,U+5c22-5c24,U+5c26,U+5c28-5c2e,U+5c30,U+5c32,U+5c35-5c36,U+5c38-5c39,U+5c46,U+5c4d-5c50,U+5c53,U+5c59-5c5c,U+5c5f-5c63,U+5c67-5c69,U+5c6c-5c70,U+5c74-5c76,U+5c79-5c7d,U+5c87-5c88,U+5c8a,U+5c8c,U+5c8f,U+5c91-5c92,U+5c94,U+5c9d,U+5c9f-5ca0,U+5ca2-5ca3,U+5ca6-5ca8,U+5caa-5cab,U+5cad,U+5cb1-5cb2,U+5cb4-5cb7,U+5cba-5cbc,U+5cbe,U+5cc5,U+5cc7,U+5cc9,U+5ccb,U+5cd0,U+5cd2,U+5cd7,U+5cd9,U+5cdd,U+5ce6,U+5ce8-5cea,U+5ced-5cee,U+5cf1-5cf2,U+5cf4-5cf5,U+5cfa-5cfb,U+5cfd,U+5d01,U+5d06,U+5d0b,U+5d0d,U+5d10-5d12,U+5d14-5d15,U+5d17-5d1b,U+5d1d,U+5d1f-5d20,U+5d22-5d24,U+5d26-5d27,U+5d2b,U+5d31,U+5d34,U+5d39,U+5d3d,U+5d3f,U+5d42-5d43,U+5d46-5d48,U+5d4a-5d4b,U+5d4e,U+5d51-5d53,U+5d55,U+5d59,U+5d5c,U+5d5f-5d62,U+5d64,U+5d69-5d6a,U+5d6c-5d6d,U+5d6f-5d70,U+5d73,U+5d76,U+5d79-5d7a,U+5d7e-5d7f,U+5d81-5d84,U+5d87-5d88,U+5d8a,U+5d8c,U+5d90,U+5d92-5d95,U+5d97,U+5d99}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.43.woff2) format("woff2");unicode-range:U+598b-598e,U+5992,U+5995,U+5997,U+599b,U+599d,U+599f,U+59a3-59a4,U+59a7,U+59ad-59b0,U+59b2-59b3,U+59b7,U+59ba,U+59bc,U+59be,U+59c1,U+59c3-59c4,U+59c6,U+59c8,U+59ca,U+59cd,U+59d2,U+59d9-59da,U+59dd-59df,U+59e3-59e5,U+59e7-59e8,U+59ec,U+59ee-59ef,U+59f1-59f2,U+59f4,U+59f6-59f8,U+5a00,U+5a03-5a04,U+5a09,U+5a0c-5a0e,U+5a11-5a13,U+5a17,U+5a1a-5a1c,U+5a1e-5a1f,U+5a23-5a25,U+5a27-5a28,U+5a2a,U+5a2d,U+5a30,U+5a35-5a36,U+5a40-5a41,U+5a44-5a45,U+5a47-5a49,U+5a4c,U+5a50,U+5a55,U+5a5e,U+5a62-5a63,U+5a65,U+5a67,U+5a6a,U+5a6c-5a6d,U+5a77,U+5a7a-5a7b,U+5a7e,U+5a84,U+5a8b,U+5a90,U+5a93,U+5a96,U+5a99,U+5a9c,U+5a9e-5aa0,U+5aa2,U+5aa7,U+5aac,U+5ab1-5ab3,U+5ab5,U+5ab8,U+5aba-5abf,U+5ac2,U+5ac4,U+5ac6,U+5ac8,U+5acb,U+5acf-5ad0,U+5ad6-5ad7,U+5ada,U+5adc,U+5ae0-5ae1,U+5ae3,U+5ae5-5ae6,U+5ae9-5aea,U+5aee,U+5af0,U+5af5-5af6,U+5afa-5afb,U+5afd,U+5b00-5b01,U+5b08,U+5b0b,U+5b16-5b17,U+5b19,U+5b1b,U+5b1d,U+5b21,U+5b25,U+5b2a,U+5b2c-5b2d,U+5b30,U+5b32,U+5b34,U+5b36,U+5b38,U+5b3e,U+5b40-5b41,U+5b43,U+5b45,U+5b4b-5b4c,U+5b51-5b52,U+5b56,U+5b5a-5b5c,U+5b5e-5b5f,U+5b65,U+5b68-5b69,U+5b6e-5b71,U+5b73,U+5b75-5b76,U+5b7a,U+5b7c-5b84,U+5b86,U+5b8a-5b8b,U+5b8d-5b8e,U+5b90-5b91,U+5b93-5b94,U+5b96,U+5ba5-5ba6,U+5ba8-5ba9,U+5bac-5bad,U+5baf,U+5bb1-5bb2,U+5bb7-5bb8,U+5bba}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.44.woff2) format("woff2");unicode-range:U+57b3,U+57b8,U+57bd,U+57c0,U+57c3,U+57c6-57c8,U+57cc,U+57cf,U+57d2-57d7,U+57dc-57de,U+57e0-57e1,U+57e3-57e4,U+57e6-57e7,U+57e9,U+57ed,U+57f0,U+57f4-57f6,U+57f8,U+57fb,U+57fd-57ff,U+5803-5804,U+5808-580d,U+5819,U+581b,U+581d-5821,U+5826-5827,U+582d,U+582f-5830,U+5832,U+5835,U+5839,U+583d,U+583f-5840,U+5849,U+584b-584d,U+584f-5852,U+5855,U+5858-5859,U+585f,U+5861-5862,U+5864,U+5867-5868,U+586d,U+5870,U+5872,U+5878-5879,U+587c,U+587f-5881,U+5885,U+5887-588d,U+588f-5890,U+5894,U+5896,U+5898,U+589d-589e,U+58a0-58a2,U+58a6,U+58a9-58ab,U+58ae,U+58b1-58b3,U+58b8-58bc,U+58be,U+58c2-58c5,U+58c8,U+58cd-58ce,U+58d0-58da,U+58dc-58e2,U+58e4-58e5,U+58e9,U+58ec,U+58ef,U+58f3-58f4,U+58f7,U+58f9,U+58fb-58fd,U+5902,U+5905-5906,U+590a-590d,U+5910,U+5912-5914,U+5918-5919,U+591b,U+591d,U+591f,U+5921,U+5923-5925,U+5928,U+592c-592d,U+592f-5930,U+5932-5933,U+5935-5936,U+5938-5939,U+593d-593f,U+5943,U+5946,U+594e,U+5950,U+5952-5953,U+5955,U+5957-595b,U+595d-5961,U+5963,U+5967,U+5969,U+596b-596d,U+596f,U+5972,U+5975-5976,U+5978-5979,U+597b-597c,U+5981}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.45.woff2) format("woff2");unicode-range:U+5616-5617,U+5619,U+561b,U+5620,U+5628,U+562c,U+562f-5639,U+563b-563d,U+563f-5641,U+5643-5644,U+5646-5647,U+5649,U+564b,U+564d-5650,U+5653-5654,U+565e,U+5660-5664,U+5666,U+5669-566d,U+566f,U+5671-5672,U+5675-5676,U+5678,U+567a,U+5680,U+5684-5688,U+568a-568c,U+568f,U+5694-5695,U+5699-569a,U+569d-56a0,U+56a5-56a9,U+56ab-56ae,U+56b1-56b4,U+56b6-56b7,U+56bc,U+56be,U+56c0,U+56c2-56c3,U+56c5,U+56c8-56d1,U+56d3,U+56d7-56d9,U+56dc-56dd,U+56df,U+56e1,U+56e4-56e8,U+56eb,U+56ed-56ee,U+56f1,U+56f6-56f7,U+56f9,U+56ff-5704,U+5707-570a,U+570c-570d,U+5711,U+5713,U+5715-5716,U+5718,U+571a-571d,U+5720-5726,U+5729-572a,U+572c,U+572e-572f,U+5733-5734,U+5737-5738,U+573b,U+573d-573f,U+5745-5746,U+574c-574f,U+5751-5752,U+5759,U+575f,U+5761-5762,U+5764-5765,U+5767-5769,U+576b,U+576d-5771,U+5773-5775,U+5777,U+5779-577c,U+577e-577f,U+5781,U+5783,U+5788-5789,U+578c,U+5793-5795,U+5797,U+5799-579a,U+579c-57a1,U+57a4,U+57a7-57aa,U+57ac,U+57ae,U+57b0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.46.woff2) format("woff2");unicode-range:U+543f-5440,U+5443-5444,U+5447,U+544c-544f,U+5455,U+545e,U+5462,U+5464,U+5466-5467,U+5469,U+546b-546e,U+5470-5471,U+5474-5477,U+547b,U+547f-5481,U+5483-5486,U+5488-548b,U+548d-5492,U+5495-5496,U+549c,U+549f-54a2,U+54a4,U+54a6-54af,U+54b1,U+54b7-54bc,U+54be-54bf,U+54c2-54c4,U+54c6-54c8,U+54ca,U+54cd-54ce,U+54d8,U+54e0,U+54e2,U+54e5-54e6,U+54e8-54ea,U+54ec-54ef,U+54f1,U+54f3,U+54f6,U+54fc-5501,U+5505,U+5508-5509,U+550c-550f,U+5514-5516,U+5527,U+552a-552b,U+552e,U+5532-5533,U+5535-5536,U+5538-5539,U+553b-553d,U+5540-5541,U+5544-5545,U+5547,U+5549-554a,U+554c-554d,U+5550-5551,U+5556-5558,U+555a-555e,U+5560-5561,U+5563-5564,U+5566,U+557b-5583,U+5586-5588,U+558a,U+558e-558f,U+5591-5594,U+5597,U+5599,U+559e-559f,U+55a3-55a4,U+55a8-55a9,U+55ac-55ae,U+55b2,U+55bf,U+55c1,U+55c3-55c4,U+55c6-55c7,U+55c9,U+55cb-55cc,U+55ce,U+55d1-55d4,U+55d7-55d8,U+55da-55db,U+55dd-55df,U+55e2,U+55e4,U+55e9,U+55ec,U+55ee,U+55f1,U+55f6-55f9,U+55fd-55ff,U+5605,U+5607-5608,U+560a,U+560d-5612}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.47.woff2) format("woff2");unicode-range:U+528d,U+5291-5298,U+529a,U+529c,U+52a4-52a7,U+52ab-52ad,U+52af-52b0,U+52b5-52b8,U+52ba-52be,U+52c0-52c1,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cd,U+52cf-52d2,U+52d4,U+52d6-52d7,U+52db-52dc,U+52de,U+52e0-52e1,U+52e3,U+52e5-52e6,U+52e8-52ea,U+52ec,U+52f0-52f1,U+52f3-52fb,U+5300-5301,U+5303,U+5306-5308,U+530a-530d,U+530f-5311,U+5313,U+5315,U+5318-531f,U+5321,U+5323-5325,U+5327-532d,U+532f-5333,U+5335,U+5338,U+533c-533e,U+5340,U+5342,U+5345-5346,U+5349,U+534b-534c,U+5359,U+535b,U+535e,U+5361,U+5363-5367,U+5369,U+536c-536e,U+5372,U+5377,U+5379-537b,U+537d-537f,U+5382-5383,U+5387-5389,U+538e,U+5393-5394,U+5396,U+5398-5399,U+539d,U+53a0-53a1,U+53a4-53a6,U+53a9-53ab,U+53ad-53b0,U+53b2,U+53b4-53b8,U+53ba,U+53bd,U+53c0-53c1,U+53c3-53c5,U+53cf,U+53d2-53d3,U+53d5,U+53da-53db,U+53dd-53e0,U+53e2,U+53e6-53e8,U+53ed-53ee,U+53f4-53f5,U+53fa,U+5401-5403,U+540b,U+540f,U+5412-5413,U+541a,U+541d-541e,U+5421,U+5424,U+5427-542a,U+542c-542f,U+5431,U+5433-5436,U+543c-543d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.48.woff2) format("woff2");unicode-range:U+50dd-50df,U+50e1-50e6,U+50e8-50e9,U+50ed-50f6,U+50f9-50fb,U+50fe,U+5101-5103,U+5106-5109,U+510b-510e,U+5110,U+5112,U+5114-511e,U+5121,U+5123,U+5127-5128,U+512c-512d,U+512f,U+5131,U+5133-5135,U+5137-513c,U+513f-5142,U+5147,U+514a,U+514c,U+514f,U+5152-5155,U+5157-5158,U+515f-5160,U+5162,U+5164,U+5166-5167,U+5169-516a,U+516e,U+5173-5174,U+5179,U+517b,U+517e,U+5180,U+5182-5184,U+5189,U+518b-518c,U+518e-5191,U+5193,U+5195-5196,U+5198,U+519d,U+51a1-51a4,U+51a6,U+51a9-51ab,U+51ad,U+51b0-51b3,U+51b5,U+51b8,U+51ba,U+51bc-51bf,U+51c2-51c3,U+51c5,U+51c8-51cb,U+51cf,U+51d1-51d6,U+51d8,U+51de-51e0,U+51e2,U+51e5,U+51e7,U+51e9,U+51ec-51ee,U+51f2-51f5,U+51f7,U+51fe,U+5201-5202,U+5204-5205,U+520b,U+520e,U+5212-5216,U+5218,U+5222,U+5226-5228,U+522a-522b,U+522e,U+5231-5233,U+5235,U+523c,U+5244-5245,U+5249,U+524b-524c,U+524f,U+5254-5255,U+5257-5258,U+525a,U+525c-5261,U+5266,U+5269,U+526c,U+526e,U+5271,U+5273-5274,U+5277-5279,U+527d,U+527f-5280,U+5282-5285,U+5288-528a,U+528c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.49.woff2) format("woff2");unicode-range:U+4f57-4f58,U+4f5a-4f5b,U+4f5d-4f5f,U+4f63-4f64,U+4f69-4f6a,U+4f6c,U+4f6e-4f71,U+4f76-4f7e,U+4f81-4f85,U+4f88-4f8a,U+4f8c,U+4f8e-4f90,U+4f92-4f94,U+4f96-4f9a,U+4f9e-4fa0,U+4fab,U+4fad,U+4faf,U+4fb2,U+4fb7,U+4fb9,U+4fbb-4fbe,U+4fc0-4fc1,U+4fc4-4fc6,U+4fc8-4fc9,U+4fcb-4fd4,U+4fd8,U+4fda-4fdc,U+4fdf-4fe0,U+4fe2,U+4fe4-4fe6,U+4fef-4ff2,U+4ff6,U+4ffc-5002,U+5004-5007,U+500a,U+500c,U+500e-5011,U+5013-5014,U+5016-5018,U+501a-501e,U+5021-5023,U+5025-502a,U+502c-502e,U+5030,U+5032-5033,U+5035,U+5039,U+503b,U+5040-5043,U+5045-5048,U+504a,U+504c,U+504e,U+5050-5053,U+5055-5057,U+5059-505a,U+505f-5060,U+5062-5063,U+5066-5067,U+506a,U+506c-506d,U+5070-5072,U+5077-5078,U+5080-5081,U+5083-5086,U+5088,U+508a,U+508e-5090,U+5092-5096,U+509a-509c,U+509e-50a3,U+50aa,U+50ad,U+50af-50b4,U+50b9-50bb,U+50bd,U+50c0,U+50c2-50c4,U+50c7,U+50c9-50ca,U+50cc,U+50ce,U+50d0-50d1,U+50d3-50d4,U+50d6,U+50d8-50d9,U+50dc}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.50.woff2) format("woff2");unicode-range:U+4093,U+4103,U+4105,U+4148,U+414f,U+4163,U+41b4,U+41bf,U+41e6,U+41ee,U+41f3,U+4207,U+420e,U+4264,U+4293,U+42c6,U+42d6,U+42dd,U+4302,U+432b,U+4343,U+43ee,U+43f0,U+4408,U+440c,U+4417,U+441c,U+4422,U+4453,U+445b,U+4476,U+447a,U+4491,U+44b3,U+44be,U+44d4,U+4508,U+450d,U+4525,U+4543,U+457a,U+459d,U+45b8,U+45be,U+45e5,U+45ea,U+460f-4610,U+4641,U+4665,U+46a1,U+46ae-46af,U+470c,U+471f,U+4764,U+47e6,U+47fd,U+4816,U+481e,U+4844,U+484e,U+48b5,U+49b0,U+49e7,U+49fa,U+4a04,U+4a29,U+4abc,U+4b38,U+4b3b,U+4b7e,U+4bc2,U+4bca,U+4bd2,U+4be8,U+4c17,U+4c20,U+4c38,U+4cc4,U+4cd1,U+4ce1,U+4d07,U+4d77,U+4e02,U+4e04-4e05,U+4e0c,U+4e0f-4e12,U+4e15,U+4e17,U+4e19,U+4e1e-4e1f,U+4e23-4e24,U+4e28-4e2c,U+4e2e-4e31,U+4e35-4e37,U+4e3f-4e42,U+4e44,U+4e47-4e48,U+4e4d-4e4e,U+4e51,U+4e55-4e56,U+4e58,U+4e5a-4e5c,U+4e62-4e63,U+4e68-4e69,U+4e74-4e75,U+4e79,U+4e7f,U+4e82,U+4e85,U+4e8a,U+4e8d-4e8e,U+4e96-4e99,U+4e9d-4ea0,U+4ea2,U+4ea5-4ea6,U+4ea8,U+4eaf-4eb0,U+4eb3,U+4eb6,U+4eb9,U+4ebb-4ebc,U+4ec2-4ec4,U+4ec6-4ec8,U+4ecd,U+4ed0,U+4ed7,U+4eda-4edb,U+4edd-4ee2,U+4ee8,U+4eeb,U+4eed,U+4eef,U+4ef1,U+4ef3,U+4ef5,U+4ef7,U+4efc-4f00,U+4f02-4f03,U+4f08-4f09,U+4f0b-4f0d,U+4f12,U+4f15-4f17,U+4f19,U+4f1c,U+4f2b,U+4f2e,U+4f30-4f31,U+4f33,U+4f35-4f37,U+4f39,U+4f3b,U+4f3e,U+4f40,U+4f42-4f43,U+4f48-4f49,U+4f4b-4f4c,U+4f52,U+4f54,U+4f56}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.51.woff2) format("woff2");unicode-range:U+3395-339b,U+339e-33a0,U+33a2-33ff,U+3402,U+3405-3406,U+3427,U+342c,U+342e,U+3468,U+346a,U+3488,U+3492,U+34b5,U+34bc,U+34c1,U+34c7,U+34db,U+351f,U+353e,U+355d-355e,U+3563,U+356e,U+35a6,U+35a8,U+35c5,U+35da,U+35de,U+35f4,U+3605,U+3614,U+364a,U+3691,U+3696,U+3699,U+36cf,U+3761-3762,U+376b-376c,U+3775,U+378d,U+37c1,U+37e2,U+37e8,U+37f4,U+37fd,U+3800,U+382f,U+3836,U+3840,U+385c,U+3861,U+38a1,U+38ad,U+38fa,U+3917,U+391a,U+396f,U+39a4,U+39b8,U+3a5c,U+3a6e,U+3a73,U+3a85,U+3ac4,U+3acb,U+3ad6-3ad7,U+3aea,U+3af3,U+3b0e,U+3b1a,U+3b1c,U+3b22,U+3b35,U+3b6d,U+3b77,U+3b87-3b88,U+3b8d,U+3ba4,U+3bb6,U+3bc3,U+3bcd,U+3bf0,U+3bf3,U+3c0f,U+3c26,U+3cc3,U+3cd2,U+3d11,U+3d1e,U+3d31,U+3d4e,U+3d64,U+3d9a,U+3dc0,U+3dcc,U+3dd4,U+3e05,U+3e3f-3e40,U+3e60,U+3e66,U+3e68,U+3e83,U+3e8a,U+3e94,U+3eda,U+3f57,U+3f72,U+3f75,U+3f77,U+3fae,U+3fb1,U+3fc9,U+3fd7,U+3fdc,U+4039,U+4058}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.52.woff2) format("woff2");unicode-range:U+32b5-332b,U+332d-3394}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.53.woff2) format("woff2");unicode-range:U+31c8-31e3,U+31f0-321e,U+3220-3230,U+3232-32b4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.54.woff2) format("woff2");unicode-range:U+3028-303f,U+3094-3096,U+309f-30a0,U+30ee,U+30f7-30fa,U+30ff,U+3105-312f,U+3131-3163,U+3165-318e,U+3190-31bb,U+31c0-31c7}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.55.woff2) format("woff2");unicode-range:U+2f14-2fd5,U+2ff0-2ffb,U+3004,U+3013,U+3016-301b,U+301e,U+3020-3027}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.56.woff2) format("woff2");unicode-range:U+25e4-25e6,U+2601-2603,U+2609,U+260e-260f,U+2616-2617,U+261c-261f,U+262f,U+2641,U+2660,U+2662-2664,U+2666-2668,U+266d-266e,U+2672-267d,U+26bd-26be,U+2702,U+271a,U+273d,U+2740,U+2756,U+2776-2793,U+27a1,U+2934-2935,U+29bf,U+29fa-29fb,U+2b05-2b07,U+2b1a,U+2b95,U+2e3a-2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f13}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.57.woff2) format("woff2");unicode-range:U+24d1-24ff,U+2503-2513,U+2515-2516,U+2518-251b,U+251d-2522,U+2524-259f,U+25a2-25ab,U+25b1,U+25b7,U+25c0-25c1,U+25c9-25ca,U+25cc,U+25d0-25d3,U+25e2-25e3}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.58.woff2) format("woff2");unicode-range:U+2105,U+2109-210a,U+210f,U+2116,U+2121,U+2126-2127,U+212b,U+212e,U+2135,U+213b,U+2194-2199,U+21b8-21b9,U+21c4-21c6,U+21cb-21cc,U+21d0,U+21e6-21e9,U+21f5,U+2202-2203,U+2205-2206,U+2208-220b,U+220f,U+2211,U+2213,U+2215,U+221a,U+221d,U+2220,U+2223,U+2225-2226,U+2228,U+222a-222e,U+2234-2237,U+223d,U+2243,U+2245,U+2248,U+224c,U+2260,U+2262,U+2264-2265,U+226e-226f,U+2272-2273,U+2276-2277,U+2283-2287,U+228a-228b,U+2295-2299,U+22a0,U+22a5,U+22bf,U+22da-22db,U+22ef,U+2305-2307,U+2318,U+2329-232a,U+23b0-23b1,U+23be-23cc,U+23ce,U+23da-23db,U+2423,U+2469-24d0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.59.woff2) format("woff2");unicode-range:U+a1-a4,U+a6-a7,U+aa,U+ac-ad,U+b5-b6,U+b8-ba,U+bc-c8,U+ca-cc,U+ce-d5,U+d9-db,U+dd-df,U+e6,U+ee,U+f0,U+f5,U+f7,U+f9,U+fb,U+fe-102,U+110-113,U+11a-11b,U+128-12b,U+143-144,U+147-148,U+14c,U+14e-14f,U+152-153,U+168-16d,U+192,U+1a0-1a1,U+1af,U+1cd-1dc,U+1f8-1f9,U+251,U+261,U+2bb,U+2c7,U+2c9,U+2ea-2eb,U+304,U+307,U+30c,U+1e3e-1e3f,U+1ea0-1ebe,U+1ec0-1ec6,U+1ec8-1ef9,U+2011-2012,U+2016,U+2018-201a,U+201e,U+2021,U+2030,U+2033,U+2035,U+2042,U+2047,U+2051,U+2074,U+20a9,U+20ab-20ac,U+20dd-20de,U+2100}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.60.woff2) format("woff2");unicode-range:U+2227,U+26a0,U+2713,U+301f,U+4ff8,U+5239,U+526a,U+54fa,U+5740,U+5937,U+5993,U+59fb,U+5a3c,U+5c41,U+6028,U+626e,U+646f,U+647a,U+64b0,U+64e2,U+65a7,U+66fe,U+6727,U+6955,U+6bef,U+6f23,U+724c,U+767c,U+7a83,U+7ac4,U+7b67,U+8000,U+8471,U+8513,U+8599,U+86db,U+8718,U+87f2,U+88f3,U+8ad2,U+8e2a,U+8fa3,U+95a5,U+9798,U+9910,U+9957,U+9bab,U+9c3b,U+9daf,U+ff95}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.61.woff2) format("woff2");unicode-range:U+a8,U+2032,U+2261,U+2282,U+3090,U+30f1,U+339c,U+535c,U+53d9,U+56a2,U+56c1,U+5806,U+589f,U+59d0,U+5a7f,U+60e0,U+639f,U+65af,U+68fa,U+69ae,U+6d1b,U+6ef2,U+71fb,U+725d,U+7262,U+75bc,U+7768,U+7940,U+79bf,U+7bed,U+7d68,U+7dfb,U+814b,U+8207,U+83e9,U+8494,U+8526,U+8568,U+85ea,U+86d9,U+87ba,U+8861,U+887f,U+8fe6,U+9059,U+9061,U+916a,U+976d,U+97ad,U+9ece}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.62.woff2) format("woff2");unicode-range:U+2d9,U+21d4,U+301d,U+515c,U+52fe,U+5420,U+5750,U+5766,U+5954,U+5b95,U+5f8a,U+5f98,U+620c,U+621f,U+641c,U+66d9,U+676d,U+6775,U+67f5,U+694a,U+6a02,U+6a3a,U+6a80,U+6c23,U+6c72,U+6dcb,U+6faa,U+707c,U+71c8,U+7422,U+74e2,U+7791,U+7825,U+7a14,U+7a1c,U+7c95,U+7fc1,U+82a5,U+82db,U+8304,U+853d,U+8cd3,U+8de8,U+8f0c,U+8f3f,U+9091,U+91c7,U+929a,U+98af,U+9913}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.63.woff2) format("woff2");unicode-range:U+2ca-2cb,U+2229,U+2468,U+2669,U+266f,U+273f,U+4ec0,U+4f60,U+4fb6,U+5347,U+540e,U+543b,U+5b0c,U+5d4c,U+5f14,U+5f9e,U+6155,U+62d0,U+6602,U+6666,U+66f3,U+67a2,U+67ca,U+69cc,U+6d29,U+6d9b,U+6e3e,U+6f81,U+7109,U+73c0,U+73c2,U+7425,U+7435-7436,U+7525,U+7554,U+785d,U+786b,U+7ae3,U+7b94,U+7d18,U+81bf,U+8511,U+8549,U+9075,U+9640,U+98e2,U+9e9f,U+ff96}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.64.woff2) format("woff2");unicode-range:U+2467,U+4ece,U+4ed4,U+4f91,U+4fae,U+534d,U+53c9,U+54b3,U+586b,U+5944,U+5b78,U+5df7,U+5f77,U+6101,U+6167-6168,U+61a4,U+62d9,U+698a,U+699b,U+6a59,U+6cc4,U+6e07,U+7099,U+75d2,U+77ad,U+7953,U+7984,U+7a92,U+7baa,U+7dbb,U+817f,U+82ad,U+85e9,U+868a,U+8caa,U+8f44,U+9017,U+907c,U+908a,U+92f3,U+936e,U+9435,U+978d,U+9838,U+9a28,U+9b41,U+9ba8,U+9c57,U+9eb9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.65.woff2) format("woff2");unicode-range:U+b1,U+309b,U+4e5e,U+51f1,U+5506,U+55c5,U+58cc,U+59d1,U+5c51,U+5ef7,U+6284,U+62d7,U+6689,U+673d,U+6a2b,U+6a8e,U+6a9c,U+6d63,U+6dd1,U+70b8,U+7235,U+72db,U+72f8,U+7560,U+7c9b,U+7ce7,U+7e1e,U+80af,U+82eb,U+8463,U+8499,U+85dd,U+86ee,U+8a60,U+8a6e,U+8c79,U+8e87,U+8e8a,U+8f5f,U+9010,U+918d,U+9190,U+965b,U+97fb,U+9ab8,U+9bad,U+9d3b,U+9d5c,U+9dfa,U+9e93}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.66.woff2) format("woff2");unicode-range:U+2020,U+3003,U+3231,U+4e9b,U+4f3d,U+4f47,U+51b6,U+51dc,U+53e1,U+5bc5,U+602f,U+60bc,U+61c9,U+633d,U+637b,U+6492,U+65fa,U+660f,U+66f0,U+6703,U+681e,U+6876,U+6893,U+6912,U+698e,U+6c7d,U+714c,U+7169,U+71d5,U+725f,U+72d7,U+745b,U+74dc,U+75e2,U+7891,U+7897,U+7dcb,U+810a,U+8218,U+8339,U+840e,U+852d,U+8823,U+8a0a,U+9089,U+919c,U+971c,U+9ad9,U+ff4a,U+ff5a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.67.woff2) format("woff2");unicode-range:U+2466,U+2600,U+4eab,U+4fe3,U+4ff5,U+51a5,U+51f0,U+536f,U+53d4,U+53f1,U+54a5,U+559d,U+55e3,U+58fa,U+5962,U+59ea,U+5c16,U+5cef,U+5d16,U+5f10,U+5fd6,U+6190,U+6216,U+634f,U+63bb,U+66d6,U+6756,U+6bc5,U+6e26,U+727d,U+731f,U+76f2,U+7729,U+7a7f,U+7aff,U+7c9f,U+818f,U+8236,U+82b9,U+8338,U+85aa,U+88b4,U+8b33,U+904d,U+93a7,U+96cc,U+96eb,U+9aed,U+9b8e,U+fa11}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.68.woff2) format("woff2");unicode-range:U+251c,U+2523,U+4e14,U+545f,U+54bd,U+553e,U+55dc,U+56da,U+589c,U+5b55,U+5bb5,U+5ce1,U+5df4,U+5eb6,U+5ec9,U+6191,U+62f7,U+6357,U+64a5,U+6591,U+65bc,U+6897,U+6e1a,U+7063,U+711a,U+721b,U+722c,U+75b9,U+75d5,U+75fa,U+7766,U+7aae,U+7b48,U+7b8b,U+7d21,U+7e55,U+7f75,U+842c,U+8910,U+8a63,U+8b39,U+8b5a,U+8cdc,U+8d74,U+907d,U+91e7,U+9306,U+96bc,U+98f4,U+9ac4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.69.woff2) format("woff2");unicode-range:U+2003,U+2312,U+266c,U+4f86,U+51ea,U+5243,U+5256,U+541f,U+5841,U+59dc,U+5df3,U+601c,U+60e7,U+632b,U+638c,U+64ad,U+6881,U+697c,U+69cd,U+6c50,U+6d2a,U+6fc1,U+7027,U+7058,U+70f9,U+714e,U+7345,U+751a,U+760d,U+764c,U+77db,U+7d79,U+7e8f,U+80ce,U+814e,U+81fc,U+8247,U+8278,U+85a9,U+8a03,U+90ed,U+9784,U+9801,U+984e,U+99b3,U+9bc9,U+9bdb,U+9be8,U+9e78,U+ff6b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.70.woff2) format("woff2");unicode-range:U+266b,U+3006,U+5176,U+5197,U+51a8,U+51c6,U+52f2,U+5614,U+5875,U+5a2f,U+5b54,U+5ce0,U+5dba,U+5deb,U+5e63,U+5f59,U+5fcc,U+6068,U+6367,U+68b6,U+6a0b,U+6b64,U+6e15,U+6eba,U+7272,U+72a0,U+7947,U+7985,U+79e6,U+79e9,U+7a3d,U+7a9f,U+7aaf,U+7b95,U+7f60,U+7f9e,U+7fe0,U+8098,U+80ba,U+8106,U+82d4,U+831c,U+87f9,U+8a1f,U+8acf,U+90c1,U+920d,U+9756,U+fe43,U+ff94}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.71.woff2) format("woff2");unicode-range:U+af,U+2465,U+2517,U+33a1,U+4f10,U+50c5,U+51b4,U+5384,U+5606,U+5bb0,U+5cac,U+5ee3,U+618e,U+61f2,U+62c9,U+66ab,U+66f9,U+6816,U+6960,U+6b3e,U+6f20,U+7078,U+72d0,U+73ed,U+7ad9,U+7b1b,U+7be4,U+7d62,U+7f51,U+80b4,U+80f4,U+8154,U+85fb,U+865c,U+8702,U+895f,U+8aed,U+8b90,U+8ced,U+8fbf,U+91d8,U+9418,U+9583,U+9591,U+9813,U+982c,U+9bd6,U+ff46,U+ff7f,U+ff88}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.72.woff2) format("woff2");unicode-range:U+4e91,U+508d,U+50e7,U+514e,U+51f6,U+5446,U+5504,U+584a,U+59a8,U+59d3,U+5a46,U+5ac9,U+6020,U+60a6,U+6148,U+621a,U+6234,U+64c1,U+6523,U+675c,U+67d1,U+6953,U+6ccc,U+6df5,U+6e13,U+6f06,U+723a,U+7325,U+74e6,U+758e,U+75ab,U+75d9,U+7a40,U+8096,U+82fa,U+8587,U+8594,U+8a6b,U+8ab9,U+8b17,U+8b83,U+937c,U+963b,U+9673,U+96db,U+9ce9,U+9f4b,U+ff67,U+ff82,U+ff93}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.73.woff2) format("woff2");unicode-range:U+221e,U+2514,U+51f9,U+5270,U+5449,U+5824,U+59a5,U+5a29,U+5d07,U+5e16,U+60e3,U+614c,U+6276,U+643e,U+64ab,U+6562,U+6681,U+670b,U+6734,U+67af,U+6a3d,U+6b05,U+6dc0,U+6e4a,U+7259,U+732a,U+7409,U+78a7,U+7a6b,U+8015,U+809b,U+817a,U+830e,U+837b,U+85ab,U+8a23,U+8a93,U+8b00,U+8b19,U+8b21,U+8cbf,U+8fb0,U+901d,U+91b8,U+9320,U+932c,U+9688,U+96f6,U+9df2,U+ff6a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.74.woff2) format("woff2");unicode-range:U+2002,U+2025,U+4f8d,U+51e1,U+51f8,U+5507,U+5598,U+58f1,U+5983,U+59ac,U+5c3c,U+5de7,U+5e7d,U+5eca,U+5f61,U+606d,U+60f9,U+636e,U+64ec,U+67da,U+67ff,U+6813,U+68f2,U+693f,U+6b6a,U+6bbb,U+6ef4,U+7092,U+717d,U+7261,U+73c8,U+7432,U+7483,U+76fe,U+7709,U+78d0,U+81a3,U+81b3,U+82af,U+8305,U+8309,U+8870,U+88fe,U+8cd1,U+8d66,U+906e,U+971e,U+9812,U+ff79,U+ff90}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.75.woff2) format("woff2");unicode-range:U+2464,U+2501,U+2640,U+2642,U+339d,U+4f0e,U+5091,U+50b5,U+5132,U+51cc,U+558b,U+55aa,U+585e,U+5bee,U+5dfe,U+60b6,U+62b9,U+6349,U+6566,U+6590,U+6842,U+689d,U+6a58,U+6c70,U+6ff1,U+7815,U+7881,U+7aaa,U+7bc7,U+7def,U+7fa8,U+8017,U+8036,U+8061,U+821f,U+8429,U+8ce0,U+8e74,U+9019,U+90ca,U+9162,U+932f,U+93ae,U+9644,U+990c,U+9cf3,U+ff56,U+ff6e,U+ff7e,U+ff85}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.76.woff2) format("woff2");unicode-range:U+2266-2267,U+4f2f,U+5208,U+5451,U+546a,U+5589,U+576a,U+5815,U+5a9a,U+5b9b,U+5c3a,U+5efb,U+5faa,U+6109,U+6643,U+6652,U+695a,U+69fd,U+6b86,U+6bb4,U+6daf,U+7089,U+70cf,U+7a00,U+7a4f,U+7b39,U+7d33,U+80e1,U+828b,U+82a6,U+86cd,U+8c8c,U+8cca,U+8df3,U+9077,U+9175,U+91dc,U+925b,U+9262,U+9271,U+92ed,U+9855,U+9905,U+9d28,U+ff3f,U+ff58,U+ff68,U+ff6d,U+ff9c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.77.woff2) format("woff2");unicode-range:U+2207,U+25ef,U+309c,U+4e4f,U+5146,U+51dd,U+5351,U+540a,U+5629,U+5eb5,U+5f04,U+5f13,U+60dc,U+6212,U+63b4,U+642c,U+6627,U+66a6,U+66c7,U+66fd,U+674e,U+6b96,U+6c4e,U+6df3,U+6e67,U+6f84,U+72fc,U+733f,U+7c97,U+7db1,U+7e4d,U+816b,U+82d1,U+84cb,U+854e,U+8607,U+86c7,U+871c,U+8776,U+8a89,U+8fc4,U+91a4,U+9285,U+9685,U+9903,U+9b31,U+9f13,U+ff42,U+ff74,U+ff91}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.78.woff2) format("woff2");unicode-range:U+4e32,U+51db,U+53a8,U+53ea,U+5609,U+5674,U+5a92,U+5e7e,U+6115,U+611a,U+62cc,U+62ed,U+63c9,U+64b9,U+64e6,U+65cb,U+6606,U+6731,U+683d,U+6afb,U+7460,U+771e,U+78ef,U+7b26,U+7b51,U+7cde,U+7d10,U+7d2f,U+7d46,U+80de,U+819c,U+84b2,U+85cd,U+865a,U+8ecc,U+9022,U+90b8,U+9192,U+9675,U+96b7,U+99ff,U+ff44,U+ff55,U+ff6c,U+ff73,U+ff75,U+ff86,U+ff8d,U+ff92,U+ffe3}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.79.woff2) format("woff2");unicode-range:U+25b3,U+30f5,U+4eae,U+4f46,U+4f51,U+5203,U+52ff,U+55a7,U+564c,U+565b,U+57f9,U+5805,U+5b64,U+5e06,U+5f70,U+5f90,U+60e8,U+6182,U+62f3,U+62fe,U+63aa,U+64a4,U+65d7,U+673a,U+6851,U+68cb,U+68df,U+6d1e,U+6e58,U+6e9d,U+77b3,U+7832,U+7c3f,U+7db4,U+7f70,U+80aa,U+80c6,U+8105,U+819d,U+8276,U+8679,U+8986,U+8c9d,U+8fc5,U+916c,U+9665,U+9699,U+96c0,U+9a19,U+ff8b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.80.woff2) format("woff2");unicode-range:U+2463,U+25a1,U+4ef0,U+5076,U+5098,U+51fd,U+5302,U+5448,U+54c9,U+570b,U+583a,U+5893,U+58a8,U+58ee,U+5949,U+5bdb,U+5f26,U+5f81,U+6052,U+6170,U+61c7,U+631f,U+635c,U+664b,U+69fb,U+6f01,U+7070,U+722a,U+745e,U+755c,U+76c6,U+78c1,U+79e4,U+7bb8,U+7d0b,U+81a8,U+82d7,U+8b5c,U+8f14,U+8fb1,U+8fbb,U+9283,U+9298,U+9a30,U+ff03,U+ff50,U+ff59,U+ff7b,U+ff8e-ff8f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.81.woff2) format("woff2");unicode-range:U+2010,U+2502,U+25b6,U+4f3a,U+514b,U+5265,U+52c3,U+5339,U+53ec,U+54c0,U+55b0,U+5854,U+5b8f,U+5cb3,U+5e84,U+60da,U+6247,U+6249,U+628a,U+62cd,U+65ac,U+6838,U+690e,U+6cf0,U+6f02,U+6f2c,U+6f70,U+708a,U+7434,U+75be,U+77ef,U+7c60,U+7c98,U+7d1b,U+7e2b,U+80a5,U+81e3,U+820c,U+8210,U+8475,U+862d,U+8650,U+8997,U+906d,U+91c8,U+9700,U+9727,U+9df9,U+ff3a,U+ff9a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.82.woff2) format("woff2");unicode-range:U+2103,U+5049,U+52b1,U+5320,U+5553,U+572d,U+58c7,U+5b5d,U+5bc2,U+5de3,U+5e61,U+5f80,U+61a9,U+67d0,U+67f4,U+6c88,U+6ca1,U+6ce5,U+6d78,U+6e9c,U+6f54,U+731b,U+73b2,U+74a7,U+74f6,U+75e9,U+7b20,U+7c8b,U+7f72,U+809d,U+8108,U+82b3,U+82bd,U+84b8,U+84c4,U+88c2,U+8ae6,U+8ef8,U+902e,U+9065,U+9326,U+935b,U+938c,U+9676,U+9694,U+96f7,U+9ed9,U+ff48,U+ff4c,U+ff81}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.83.woff2) format("woff2");unicode-range:U+2500,U+3008-3009,U+4ead,U+4f0f,U+4fca,U+53eb,U+543e,U+57a2,U+5cf0,U+5e8f,U+5fe0,U+61b2,U+62d8,U+6442,U+64b2,U+6589,U+659c,U+67f1,U+68c4,U+6cb8,U+6d12,U+6de1,U+6fe1,U+70c8,U+723d,U+73e0,U+7656,U+773a,U+7948,U+7b87,U+7c92,U+7d3a,U+7e1b,U+7e4a,U+819a,U+8358,U+83c5,U+84bc,U+864e,U+8912,U+8c9e,U+8d05,U+92fc,U+9396,U+98fd,U+99d2,U+ff64,U+ff7a,U+ff83}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.84.woff2) format("woff2");unicode-range:U+3014-3015,U+4e3c,U+5036,U+5075,U+533f,U+53e9,U+5531,U+5642,U+5984,U+59e6,U+5a01,U+5b6b,U+5c0b,U+5f25,U+6069,U+60a0,U+614e,U+62b5,U+62d2-62d3,U+6597,U+660c,U+674f,U+67cf,U+6841,U+6905,U+6cf3,U+6d32,U+6d69,U+6f64,U+716e,U+7761,U+7b52,U+7be0,U+7dbf,U+7de9,U+7f36,U+81d3,U+8302,U+8389,U+846c,U+84ee,U+8a69,U+9038,U+9d8f,U+ff47,U+ff4b,U+ff76,U+ff9b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.85.woff2) format("woff2");unicode-range:U+25c7,U+3007,U+504f,U+507d,U+51a0,U+52a3,U+5410,U+5510,U+559a,U+5782,U+582a,U+5c0a,U+5c3f,U+5c48,U+5f6b,U+6176,U+622f,U+6279,U+62bd,U+62dd,U+65ed,U+67b6,U+6817,U+6850,U+6d6a,U+6deb,U+6ea2,U+6edd,U+6f5c,U+72e9,U+73a9,U+7573,U+76bf,U+7950,U+7956,U+7f8a,U+7ffc,U+80a2,U+80c3,U+83ca,U+8a02,U+8a13,U+8df5,U+9375,U+983b,U+99b4,U+ff4e,U+ff71,U+ff89,U+ff97}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.86.woff2) format("woff2");unicode-range:U+24,U+2022,U+2212,U+221f,U+2665,U+4ecf,U+5100,U+51cd,U+52d8,U+5378,U+53f6,U+574a,U+5982,U+5996,U+5c1a,U+5e1d,U+5f84,U+609f,U+61a7,U+61f8,U+6398,U+63ee,U+6676,U+6691,U+6eb6,U+7126,U+71e5,U+7687,U+7965,U+7d17,U+80a1,U+8107,U+8266,U+85a6,U+8987,U+8ca2,U+8cab,U+8e0a,U+9042,U+95c7,U+9810,U+9867,U+98fc,U+ff52-ff54,U+ff61,U+ff77,U+ff98-ff99}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.87.woff2) format("woff2");unicode-range:U+b0,U+226a,U+2462,U+4e39,U+4fc3,U+4fd7,U+50be,U+50da,U+5200,U+5211,U+54f2,U+5618,U+596a,U+5b22,U+5bb4,U+5d50,U+60a3,U+63fa,U+658e,U+65e8,U+6669,U+6795,U+679d,U+67a0,U+6b3a,U+6e09,U+757f,U+7cd6,U+7dbe,U+7ffb,U+83cc,U+83f1,U+840c,U+845b,U+8846,U+8972,U+8a34,U+8a50,U+8a87,U+8edf,U+8ff0,U+90a6,U+9154,U+95a3,U+9663,U+9686,U+96c7,U+ff3c,U+ff7c,U+ff8a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.88.woff2) format("woff2");unicode-range:U+25bd,U+4e59,U+4ec1,U+4ff3,U+515a,U+518a,U+525b,U+5375,U+552f,U+57a3,U+5b9c,U+5c3d,U+5e3d,U+5e7b,U+5f0a,U+6094,U+6458,U+654f,U+67f3,U+6b8a,U+6bd2,U+6c37,U+6ce1,U+6e56,U+6e7f,U+6ed1,U+6ede,U+6f0f,U+70ad,U+7267,U+7363,U+786c,U+7a42,U+7db2,U+7f85,U+8178,U+829d,U+8896,U+8c5a,U+8cb0,U+8ce2,U+8ed2,U+9047,U+9177,U+970a,U+9ea6,U+ff1b,U+ff31,U+ff39,U+ff80}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.89.woff2) format("woff2");unicode-range:U+a5,U+4e80,U+4f34,U+4f73,U+4f75,U+511f,U+5192,U+52aa,U+53c8,U+570f,U+57cb,U+596e,U+5d8b,U+5f66,U+5fd9,U+62db,U+62f6,U+6328,U+633f,U+63a7,U+6469,U+6bbf,U+6c41,U+6c57,U+6d44,U+6dbc,U+706f,U+72c2,U+72ed,U+7551,U+75f4,U+7949,U+7e26,U+7fd4,U+8150,U+8af8,U+8b0e,U+8b72,U+8ca7,U+934b,U+9a0e,U+9a12,U+9b42,U+ff41,U+ff43,U+ff45,U+ff49,U+ff4f,U+ff62-ff63}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.90.woff2) format("woff2");unicode-range:U+4e18,U+4fb5,U+5104,U+52c7,U+5353,U+5374,U+53e5,U+587e,U+594f,U+5a20,U+5de1,U+5f18,U+5fcd,U+6291,U+62ab,U+6355,U+6392,U+63da,U+63e1,U+656c,U+6687,U+68b0-68b1,U+68d2,U+68da,U+6b27,U+6cbc,U+7159,U+7344,U+73cd,U+76df,U+790e,U+7cf8,U+8102,U+88c1,U+8aa0,U+8e0f,U+9178,U+92ad,U+9670,U+96c5,U+9cf4,U+9db4,U+ff3e,U+ff6f,U+ff72,U+ff78,U+ff7d,U+ff84,U+ff8c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.91.woff2) format("woff2");unicode-range:U+60,U+2200,U+226b,U+2461,U+517c,U+526f,U+5800,U+5b97,U+5bf8,U+5c01,U+5d29,U+5e4c,U+5e81,U+6065,U+61d0,U+667a,U+6696,U+6843,U+6c99,U+6d99,U+6ec5,U+6f22,U+6f6e,U+6fa4,U+6fef,U+71c3,U+72d9,U+7384,U+78e8,U+7a1a,U+7a32,U+7a3c,U+7adc,U+7ca7,U+7d2b,U+7dad,U+7e4b,U+80a9,U+8170,U+81ed,U+820e,U+8a17,U+8afe,U+90aa,U+914e,U+963f,U+99c4,U+9eba,U+9f3b,U+ff38}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.92.woff2) format("woff2");unicode-range:U+2460,U+4e5f,U+4e7e,U+4ed9,U+501f,U+502b,U+5968,U+5974,U+5ac1,U+5b99,U+5ba3,U+5be7,U+5be9,U+5c64,U+5cb8,U+5ec3,U+5f1f,U+616e,U+6297,U+62e0,U+62ec,U+6368,U+642d,U+65e6,U+6717,U+676f,U+6b04,U+732e,U+7652,U+76ca,U+76d7,U+7802,U+7e70,U+7f6a,U+8133,U+81e8,U+866b,U+878d,U+88f8,U+8a5e,U+8cdb,U+8d08,U+907a,U+90e1,U+96f2,U+9f8d,U+ff35,U+ff37,U+ff40,U+ff9d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.93.woff2) format("woff2");unicode-range:U+21d2,U+25ce,U+300a-300b,U+4e89,U+4e9c,U+4ea1,U+5263,U+53cc,U+5426,U+5869,U+5947,U+598a,U+5999,U+5e55,U+5e72,U+5e79,U+5fae,U+5fb9,U+602a,U+6163,U+624d,U+6749,U+6c5a,U+6cbf,U+6d45,U+6dfb,U+6e7e,U+708e,U+725b,U+7763,U+79c0,U+7bc4,U+7c89,U+7e01,U+7e2e,U+8010,U+8033,U+8c6a,U+8cc3,U+8f1d,U+8f9b,U+8fb2,U+907f,U+90f7,U+9707,U+9818,U+9b3c,U+ff0a,U+ff4d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.94.woff2) format("woff2");unicode-range:U+2015,U+2190,U+4e43,U+5019,U+5247,U+52e7,U+5438,U+54b2,U+55ab,U+57f7,U+5bd2,U+5e8a,U+5ef6,U+6016,U+60b2,U+6162,U+6319,U+6551,U+6607,U+66b4,U+675f,U+67d4,U+6b20,U+6b53,U+6ce3,U+719f,U+75b2,U+770b,U+7720,U+77ac,U+79d2,U+7af9,U+7d05,U+7dca,U+8056,U+80f8,U+81f3,U+8352,U+885d,U+8a70,U+8aa4,U+8cbc,U+900f,U+9084,U+91e3,U+9451,U+96c4,U+99c6,U+9ad4,U+ff70}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.95.woff2) format("woff2");unicode-range:U+2193,U+25b2,U+4e4b,U+516d,U+51c4,U+529f,U+52c9,U+5360,U+5442,U+5857,U+5915,U+59eb,U+5a9b,U+5c3b,U+6012,U+61b6,U+62b1,U+6311,U+6577,U+65e2,U+65ec,U+6613,U+6790,U+6cb9,U+7372,U+76ae,U+7d5e,U+7fcc,U+88ab,U+88d5,U+8caf,U+8ddd,U+8ecd,U+8f38,U+8f9e,U+8feb,U+9063,U+90f5,U+93e1,U+968a,U+968f,U+98fe,U+9ec4,U+ff1d,U+ff27,U+ff2a,U+ff36,U+ff3b,U+ff3d,U+ffe5}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.96.woff2) format("woff2");unicode-range:U+4e03,U+4f38,U+50b7,U+5264,U+5348,U+5371,U+585a,U+58ca,U+5951,U+59b9,U+59d4,U+5b98,U+5f8b,U+6388,U+64cd,U+65e7,U+6803,U+6b6f,U+6d66,U+6e0b,U+6ecb,U+6fc3,U+72ac,U+773c,U+77e2,U+7968,U+7a74,U+7dba,U+7dd1,U+7e3e,U+808c,U+811a,U+8179,U+8239,U+8584,U+8a0e,U+8a72,U+8b66,U+8c46,U+8f29,U+90a3,U+9234,U+96f0,U+9769,U+9774,U+9aa8,U+ff26,U+ff28,U+ff9e-ff9f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.97.woff2) format("woff2");unicode-range:U+7e,U+b4,U+25c6,U+2661,U+4e92,U+4eee,U+4ffa,U+5144,U+5237,U+5287,U+52b4,U+58c1,U+5bff,U+5c04,U+5c06,U+5e95,U+5f31,U+5f93,U+63c3,U+640d,U+6557,U+6614,U+662f,U+67d3,U+690d,U+6bba,U+6e6f,U+72af,U+732b,U+7518,U+7ae0,U+7ae5,U+7af6,U+822a,U+89e6,U+8a3a,U+8a98,U+8cb8,U+8de1,U+8e8d,U+95d8,U+961c,U+96a3,U+96ea,U+9bae,U+ff20,U+ff22,U+ff29,U+ff2b-ff2c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.98.woff2) format("woff2");unicode-range:U+25cb,U+4e71,U+4f59,U+50d5,U+520a,U+5217,U+5230,U+523a-523b,U+541b,U+5439,U+5747,U+59c9,U+5bdf,U+5c31,U+5de8,U+5e7c,U+5f69,U+6050,U+60d1,U+63cf,U+663c,U+67c4,U+6885,U+6c38,U+6d6e,U+6db2,U+6df7,U+6e2c,U+6f5f,U+7532,U+76e3-76e4,U+7701,U+793c,U+79f0,U+7a93,U+7d00,U+7de0,U+7e54,U+8328,U+8840,U+969c,U+96e8,U+9811,U+9aea,U+9b5a,U+ff24,U+ff2e,U+ff57}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.99.woff2) format("woff2");unicode-range:U+2191,U+505c,U+52e4,U+5305,U+535a,U+56e0,U+59bb,U+5acc,U+5b09,U+5b87,U+5c90,U+5df1,U+5e2d,U+5e33,U+5f3e,U+6298,U+6383,U+653b,U+6697,U+6804,U+6a39,U+6cca,U+6e90,U+6f2b,U+702c,U+7206,U+7236,U+7559,U+7565,U+7591,U+75c7,U+75db,U+7b4b,U+7bb1,U+7d99,U+7fbd,U+8131,U+885b,U+8b1d,U+8ff7,U+9003,U+9045,U+96a0,U+9732,U+990a,U+99d0,U+9e97,U+9f62,U+ff25,U+ff2d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.100.woff2) format("woff2");unicode-range:U+4e08,U+4f9d,U+5012,U+514d,U+51b7,U+5275,U+53ca,U+53f8,U+5584,U+57fc,U+5b9d,U+5bfa,U+5c3e,U+5f01,U+5fb4,U+5fd7,U+606f,U+62e1,U+6563,U+6674,U+6cb3,U+6d3e,U+6d74,U+6e1b,U+6e2f,U+718a,U+7247,U+79d8,U+7d14,U+7d66,U+7d71,U+7df4,U+7e41,U+80cc,U+8155,U+83d3,U+8a95,U+8ab2,U+8ad6,U+8ca1,U+9000,U+9006,U+9678,U+97d3,U+9808,U+98ef,U+9a5a,U+9b45,U+ff23,U+ff30}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.101.woff2) format("woff2");unicode-range:U+25bc,U+3012,U+4ef2,U+4f0a,U+516b,U+5373,U+539a,U+53b3,U+559c,U+56f0,U+5727,U+5742,U+5965,U+59ff,U+5bc6,U+5dfb,U+5e45,U+5ead,U+5fb3,U+6211,U+6253,U+639b,U+63a8,U+6545,U+6575,U+6628,U+672d,U+68a8,U+6bdb,U+6d25,U+707d,U+767e,U+7834,U+7b46,U+7bc9,U+8074,U+82e6,U+8349,U+8a2a,U+8d70,U+8da3,U+8fce,U+91cc,U+967d,U+97ff,U+9996,U+ff1c,U+ff2f,U+ff32,U+ff34}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.102.woff2) format("woff2");unicode-range:U+3d,U+5e,U+25cf,U+4e0e,U+4e5d,U+4e73,U+4e94,U+4f3c,U+5009,U+5145,U+51ac,U+5238,U+524a,U+53f3,U+547c,U+5802,U+5922,U+5a66,U+5c0e,U+5de6,U+5fd8,U+5feb,U+6797,U+685c,U+6b7b,U+6c5f-6c60,U+6cc9,U+6ce2,U+6d17,U+6e21,U+7167,U+7642,U+76db,U+8001,U+821e,U+8857,U+89d2,U+8b1b,U+8b70,U+8cb4,U+8cde,U+8f03,U+8f2a,U+968e,U+9b54,U+9e7f,U+9ebb,U+ff05,U+ff33}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.103.woff2) format("woff2");unicode-range:U+500d,U+5074,U+50cd,U+5175,U+52e2,U+5352,U+5354,U+53f2,U+5409,U+56fa,U+5a18,U+5b88,U+5bdd,U+5ca9,U+5f92,U+5fa9,U+60a9,U+623f,U+6483,U+653f,U+666f,U+66ae,U+66f2,U+6a21,U+6b66,U+6bcd,U+6d5c,U+796d,U+7a4d,U+7aef,U+7b56,U+7b97,U+7c4d,U+7e04,U+7fa9,U+8377,U+83dc,U+83ef,U+8535,U+8863,U+88cf,U+88dc,U+8907,U+8acb,U+90ce,U+91dd,U+ff0b,U+ff0d,U+ff19,U+ff65}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.104.woff2) format("woff2");unicode-range:U+4e01,U+4e21,U+4e38,U+52a9,U+547d,U+592e,U+5931,U+5b63,U+5c40,U+5dde,U+5e78,U+5efa,U+5fa1,U+604b,U+6075,U+62c5,U+632f,U+6a19,U+6c0f,U+6c11,U+6c96,U+6e05,U+70ba,U+71b1,U+7387,U+7403,U+75c5,U+77ed,U+795d,U+7b54,U+7cbe,U+7d19,U+7fa4,U+8089,U+81f4,U+8208,U+8336,U+8457,U+8a33,U+8c4a,U+8ca0,U+8ca8,U+8cc0,U+9014,U+964d,U+9803,U+983c,U+98db,U+ff17,U+ff21}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.105.woff2) format("woff2");unicode-range:U+25,U+25a0,U+4e26,U+4f4e,U+5341,U+56f2,U+5bbf,U+5c45,U+5c55,U+5c5e,U+5dee,U+5e9c,U+5f7c,U+6255,U+627f,U+62bc,U+65cf,U+661f,U+666e,U+66dc,U+67fb,U+6975,U+6a4b,U+6b32,U+6df1,U+6e29,U+6fc0,U+738b,U+7686,U+7a76,U+7a81,U+7c73,U+7d75,U+7dd2,U+82e5,U+82f1,U+85ac,U+888b,U+899a,U+8a31,U+8a8c,U+8ab0,U+8b58,U+904a,U+9060,U+9280,U+95b2,U+984d,U+9ce5,U+ff18}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.106.woff2) format("woff2");unicode-range:U+30f6,U+50ac,U+5178,U+51e6,U+5224,U+52dd,U+5883,U+5897,U+590f,U+5a5a,U+5bb3,U+5c65,U+5e03,U+5e2b,U+5e30,U+5eb7,U+6271,U+63f4,U+64ae,U+6574,U+672b,U+679a,U+6a29-6a2a,U+6ca2,U+6cc1,U+6d0b,U+713c,U+74b0,U+7981,U+7a0b,U+7bc0,U+7d1a,U+7d61,U+7fd2,U+822c,U+8996,U+89aa,U+8cac,U+8cbb,U+8d77,U+8def,U+9020,U+9152,U+9244,U+9662,U+967a,U+96e3,U+9759,U+ff16}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.107.woff2) format("woff2");unicode-range:U+23,U+3c,U+2192,U+4e45,U+4efb,U+4f50,U+4f8b,U+4fc2,U+5024,U+5150,U+5272,U+5370,U+53bb,U+542b,U+56db,U+56e3,U+57ce,U+5bc4,U+5bcc,U+5f71,U+60aa,U+6238,U+6280,U+629c,U+6539,U+66ff,U+670d,U+677e-677f,U+6839,U+69cb,U+6b4c,U+6bb5,U+6e96,U+6f14,U+72ec,U+7389,U+7814,U+79cb,U+79d1,U+79fb,U+7a0e,U+7d0d,U+85e4,U+8d64,U+9632,U+96e2,U+9805,U+99ac,U+ff1e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.108.woff2) format("woff2");unicode-range:U+2605-2606,U+301c,U+4e57,U+4fee,U+5065,U+52df,U+533b,U+5357,U+57df,U+58eb,U+58f0,U+591c,U+592a-592b,U+5948,U+5b85,U+5d0e,U+5ea7,U+5ff5,U+6025,U+63a1,U+63a5,U+63db,U+643a,U+65bd,U+671d,U+68ee,U+6982,U+6b73,U+6bd4,U+6d88,U+7570,U+7b11,U+7d76,U+8077,U+8217,U+8c37,U+8c61,U+8cc7,U+8d85,U+901f,U+962a,U+9802,U+9806,U+9854,U+98f2,U+9928,U+99c5,U+9ed2}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.109.woff2) format("woff2");unicode-range:U+266a,U+4f11,U+533a,U+5343,U+534a,U+53cd,U+5404,U+56f3,U+5b57-5b58,U+5bae,U+5c4a,U+5e0c,U+5e2f,U+5eab,U+5f35,U+5f79,U+614b,U+6226,U+629e,U+65c5,U+6625,U+6751,U+6821,U+6b69,U+6b8b,U+6bce,U+6c42,U+706b,U+7c21,U+7cfb,U+805e,U+80b2,U+82b8,U+843d,U+8853,U+88c5,U+8a3c,U+8a66,U+8d8a,U+8fba,U+9069,U+91cf,U+9752,U+975e,U+9999,U+ff0f-ff10,U+ff14-ff15}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.110.woff2) format("woff2");unicode-range:U+40,U+4e86,U+4e95,U+4f01,U+4f1d,U+4fbf,U+5099,U+5171,U+5177,U+53cb,U+53ce,U+53f0,U+5668,U+5712,U+5ba4,U+5ca1,U+5f85,U+60f3,U+653e,U+65ad,U+65e9,U+6620,U+6750,U+6761,U+6b62,U+6b74,U+6e08,U+6e80,U+7248,U+7531,U+7533,U+753a,U+77f3,U+798f,U+7f6e,U+8449,U+88fd,U+89b3,U+8a55,U+8ac7,U+8b77,U+8db3,U+8efd,U+8fd4,U+9031-9032,U+9580,U+9589,U+96d1,U+985e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.111.woff2) format("woff2");unicode-range:U+2b,U+d7,U+300e-300f,U+4e07,U+4e8c,U+512a,U+5149,U+518d,U+5236,U+52b9,U+52d9,U+5468,U+578b,U+57fa,U+5b8c,U+5ba2,U+5c02,U+5de5,U+5f37,U+5f62,U+623b,U+63d0,U+652f,U+672a,U+6848,U+6d41,U+7136,U+7537,U+754c,U+76f4,U+79c1,U+7ba1,U+7d44,U+7d4c,U+7dcf,U+7dda,U+7de8,U+82b1,U+897f,U+8ca9,U+8cfc,U+904e,U+9664,U+982d,U+9858,U+98a8,U+9a13,U+ff13,U+ff5c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.112.woff2) format("woff2");unicode-range:U+4e16,U+4e3b,U+4ea4,U+4ee4,U+4f4d,U+4f4f,U+4f55,U+4f9b,U+5317,U+5358,U+53c2,U+53e4,U+548c,U+571f,U+59cb,U+5cf6,U+5e38,U+63a2,U+63b2,U+6559,U+662d,U+679c,U+6c7a,U+72b6,U+7523,U+767d,U+770c,U+7a2e,U+7a3f,U+7a7a,U+7b2c,U+7b49,U+7d20,U+7d42,U+8003,U+8272,U+8a08,U+8aac,U+8cb7,U+8eab,U+8ee2,U+9054-9055,U+90fd,U+914d,U+91cd,U+969b,U+97f3,U+984c,U+ff06}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.113.woff2) format("woff2");unicode-range:U+26,U+5f,U+2026,U+203b,U+4e09,U+4eac,U+4ed5,U+4fa1,U+5143,U+5199,U+5207,U+539f,U+53e3,U+53f7,U+5411,U+5473,U+5546,U+55b6,U+5929,U+597d,U+5bb9,U+5c11,U+5c4b,U+5ddd,U+5f97,U+5fc5,U+6295,U+6301,U+6307,U+671b,U+76f8,U+78ba,U+795e,U+7d30,U+7d39,U+7d9a,U+89e3,U+8a00,U+8a73,U+8a8d,U+8a9e,U+8aad,U+8abf,U+8cea,U+8eca,U+8ffd,U+904b,U+9650,U+ff11-ff12}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.114.woff2) format("woff2");unicode-range:U+3e,U+3005,U+4e0d,U+4e88,U+4ecb,U+4ee3,U+4ef6,U+4fdd,U+4fe1,U+500b,U+50cf,U+5186,U+5316,U+53d7,U+540c,U+544a,U+54e1,U+5728,U+58f2,U+5973,U+5b89,U+5c71,U+5e02,U+5e97,U+5f15,U+5fc3,U+5fdc,U+601d,U+611b,U+611f,U+671f,U+6728,U+6765,U+683c,U+6b21,U+6ce8,U+6d3b,U+6d77,U+7530,U+7740,U+7acb,U+7d50,U+826f,U+8f09,U+8fbc,U+9001,U+9053,U+91ce,U+9762,U+98df}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.115.woff2) format("woff2");unicode-range:U+7c,U+3080,U+4ee5,U+5148,U+516c,U+521d,U+5225,U+529b,U+52a0,U+53ef,U+56de,U+56fd,U+5909,U+591a,U+5b66,U+5b9f,U+5bb6,U+5bfe,U+5e73,U+5e83,U+5ea6,U+5f53,U+6027,U+610f,U+6210,U+6240,U+660e,U+66f4,U+66f8,U+6709,U+6771,U+697d,U+69d8,U+6a5f,U+6c34,U+6cbb,U+73fe,U+756a,U+7684,U+771f,U+793a,U+7f8e,U+898f,U+8a2d,U+8a71,U+8fd1,U+9078,U+9577,U+96fb,U+ff5e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.116.woff2) format("woff2");unicode-range:U+a9,U+3010-3011,U+30e2,U+4e0b,U+4eca,U+4ed6,U+4ed8,U+4f53,U+4f5c,U+4f7f,U+53d6,U+540d,U+54c1,U+5730,U+5916,U+5b50,U+5c0f,U+5f8c,U+624b,U+6570,U+6587,U+6599,U+691c,U+696d,U+6cd5,U+7269,U+7279,U+7406,U+767a-767b,U+77e5,U+7d04,U+7d22,U+8005,U+80fd,U+81ea,U+8868,U+8981,U+89a7,U+901a,U+9023,U+90e8,U+91d1,U+9332,U+958b,U+96c6,U+9ad8,U+ff1a,U+ff1f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.117.woff2) format("woff2");unicode-range:U+4e,U+a0,U+3000,U+300c-300d,U+4e00,U+4e0a,U+4e2d,U+4e8b,U+4eba,U+4f1a,U+5165,U+5168,U+5185,U+51fa,U+5206,U+5229,U+524d,U+52d5,U+5408,U+554f,U+5831,U+5834,U+5927,U+5b9a,U+5e74,U+5f0f,U+60c5,U+65b0,U+65b9,U+6642,U+6700,U+672c,U+682a,U+6b63,U+6c17,U+7121,U+751f,U+7528,U+753b,U+76ee,U+793e,U+884c,U+898b,U+8a18,U+9593,U+95a2,U+ff01,U+ff08-ff09}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.118.woff2) format("woff2");unicode-range:U+21-22,U+27-2a,U+2c-3b,U+3f,U+41-4d,U+4f-5d,U+61-7b,U+7d,U+ab,U+ae,U+b2-b3,U+b7,U+bb,U+c9,U+cd,U+d6,U+d8,U+dc,U+e0-e5,U+e7-ed,U+ef,U+f1-f4,U+f6,U+f8,U+fa,U+fc-fd,U+103,U+14d,U+1b0,U+300-301,U+1ebf,U+1ec7,U+2013-2014,U+201c-201d,U+2039-203a,U+203c,U+2048-2049,U+2113,U+2122,U+65e5,U+6708,U+70b9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.119.woff2) format("woff2");unicode-range:U+20,U+2027,U+3001-3002,U+3041-307f,U+3081-308f,U+3091-3093,U+3099-309a,U+309d-309e,U+30a1-30e1,U+30e3-30ed,U+30ef-30f0,U+30f2-30f4,U+30fb-30fe,U+ff0c,U+ff0e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6omwqRfTHxT624.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6okQqRfTHxT624.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6onwqRfTHxTw.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.0.woff2) format("woff2");unicode-range:U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26222,U+2626a,U+26270,U+26286,U+2634c,U+26402,U+2667e,U+266b0,U+2671d,U+268dd,U+268ea,U+26951,U+2696f,U+26999,U+269dd,U+26a1e,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26c29,U+26c73,U+26c9e,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752,U+278b2,U+27985,U+279b4,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27c3c,U+27cb8,U+27d73,U+27da0,U+27e10,U+27eaf,U+27fb7,U+2808a,U+280bb,U+28277,U+28282,U+282f3,U+283cd,U+2840c,U+28455,U+284dc,U+2856b,U+285c8-285c9,U+286d7,U+286fa,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28bc1,U+28bef,U+28cdd,U+28d10,U+28d71,U+28dfb,U+28e0f,U+28e17,U+28e1f,U+28e36,U+28e89,U+28eeb,U+28ef6,U+28f32,U+28ff8,U+292a0,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750,U+29810,U+298c6,U+29a72,U+29d4b,U+29ddb,U+29e15,U+29e3d,U+29e49,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29fce,U+29fd7,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a2b2,U+2a38c,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a9e6,U+2b746,U+2b751,U+2b753,U+2b75a,U+2b75c,U+2b765,U+2b776-2b777,U+2b77c,U+2b782,U+2b789,U+2b78b,U+2b78e,U+2b794,U+2b7ac,U+2b7af,U+2b7bd,U+2b7c9,U+2b7cf,U+2b7d2,U+2b7d8,U+2b7f0,U+2b80d,U+2b817,U+2b81a,U+2d544,U+2e278,U+2e569,U+2e6ea,U+2f804,U+2f80f,U+2f815,U+2f818,U+2f81a,U+2f822,U+2f828,U+2f82c,U+2f833,U+2f83f,U+2f846,U+2f852,U+2f862,U+2f86d,U+2f873,U+2f877,U+2f884,U+2f899-2f89a,U+2f8a6,U+2f8ac,U+2f8b2,U+2f8b6,U+2f8d3,U+2f8db-2f8dc,U+2f8e1,U+2f8e5,U+2f8ea,U+2f8ed,U+2f8fc,U+2f903,U+2f90b,U+2f90f,U+2f91a,U+2f920-2f921,U+2f945,U+2f947,U+2f96c,U+2f995,U+2f9d0,U+2f9de-2f9df,U+2f9f4}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.1.woff2) format("woff2");unicode-range:U+1f235-1f23b,U+1f240-1f248,U+1f250-1f251,U+2000b,U+20089-2008a,U+200a2,U+200a4,U+200b0,U+200f5,U+20158,U+201a2,U+20213,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+2053f,U+205b1,U+205d6,U+20611,U+20628,U+206ec,U+2074f,U+207c8,U+20807,U+2083a,U+208b9,U+2090e,U+2097c,U+20984,U+2099d,U+20a64,U+20ad3,U+20b1d,U+20b9f,U+20bb7,U+20d45,U+20d58,U+20de1,U+20e64,U+20e6d,U+20e95,U+20f5f,U+21201,U+2123d,U+21255,U+21274,U+2127b,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+213c4,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3,U+21a1a,U+21c56,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b,U+22218,U+2231e,U+223ad,U+22609,U+226f3,U+2285b,U+228ab,U+2298f,U+22ab8,U+22b46,U+22b4f-22b50,U+22ba6,U+22c1d,U+22c24,U+22de1,U+22e42,U+22feb,U+231b6,U+231c3-231c4,U+231f5,U+23372,U+233cc,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+233fe,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237f1,U+237ff,U+23824,U+2383d,U+23a98,U+23c7f,U+23cbe,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23f7e,U+2404b,U+24096,U+24103,U+241c6,U+241fe,U+242ee,U+243bc,U+243d0,U+24629,U+246a5,U+247f1,U+24896,U+248e9,U+24a4d,U+24b56,U+24b6f,U+24c16,U+24d14,U+24e04,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24ff2,U+2504a,U+25055,U+25122,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+255a7,U+2567f,U+25771,U+257a9,U+257b4,U+25874,U+259c4,U+259cc,U+259d4,U+25ad7,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c4b,U+25c64,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed8}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.2.woff2) format("woff2");unicode-range:U+ffd7,U+ffda-ffdc,U+ffe0-ffe2,U+ffe4,U+ffe6,U+ffe8-ffee,U+1f100-1f10c,U+1f110-1f16c,U+1f170-1f1ac,U+1f200-1f202,U+1f210-1f234}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.3.woff2) format("woff2");unicode-range:U+fa10,U+fa12-fa6d,U+fb00-fb04,U+fe10-fe19,U+fe30-fe42,U+fe44-fe52,U+fe54-fe66,U+fe68-fe6b,U+ff02,U+ff04,U+ff07,U+ff51,U+ff5b,U+ff5d,U+ff5f-ff60,U+ff66,U+ff69,U+ff87,U+ffa1-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd6}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.5.woff2) format("woff2");unicode-range:U+9e8b-9e8c,U+9e8e-9e8f,U+9e91-9e92,U+9e95-9e96,U+9e98,U+9e9b,U+9e9d-9e9e,U+9ea4-9ea5,U+9ea8-9eaa,U+9eac-9eb0,U+9eb3-9eb5,U+9eb8,U+9ebc-9ebf,U+9ec3,U+9ec6,U+9ec8,U+9ecb-9ecd,U+9ecf-9ed1,U+9ed4-9ed5,U+9ed8,U+9edb-9ee0,U+9ee4-9ee5,U+9ee7-9ee8,U+9eec-9ef2,U+9ef4-9ef9,U+9efb-9eff,U+9f02-9f03,U+9f07-9f09,U+9f0e-9f12,U+9f14-9f17,U+9f19-9f1b,U+9f1f-9f22,U+9f26,U+9f2a-9f2c,U+9f2f,U+9f31-9f32,U+9f34,U+9f37,U+9f39-9f3a,U+9f3c-9f3f,U+9f41,U+9f43-9f47,U+9f4a,U+9f4e-9f50,U+9f52-9f58,U+9f5a,U+9f5d-9f61,U+9f63,U+9f66-9f6a,U+9f6c-9f73,U+9f75-9f77,U+9f7a,U+9f7d,U+9f7f,U+9f8f-9f92,U+9f94-9f97,U+9f99,U+9f9c-9fa3,U+9fa5,U+9fb4,U+9fbc-9fc2,U+9fc4,U+9fc6,U+9fcc,U+f900-f92c}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.6.woff2) format("woff2");unicode-range:U+9c3e,U+9c41,U+9c43-9c4a,U+9c4e-9c50,U+9c52-9c54,U+9c56,U+9c58,U+9c5a-9c61,U+9c63,U+9c65,U+9c67-9c6b,U+9c6d-9c6e,U+9c70,U+9c72,U+9c75-9c78,U+9c7a-9c7c,U+9ce6-9ce7,U+9ceb-9cec,U+9cf0,U+9cf2,U+9cf6-9cf7,U+9cf9,U+9d02-9d03,U+9d06-9d09,U+9d0b,U+9d0e,U+9d11-9d12,U+9d15,U+9d17-9d18,U+9d1b-9d1f,U+9d23,U+9d26,U+9d2a-9d2c,U+9d2f-9d30,U+9d32-9d34,U+9d3a,U+9d3c-9d3f,U+9d41-9d48,U+9d4a,U+9d50-9d54,U+9d59,U+9d5d-9d65,U+9d69-9d6c,U+9d6f-9d70,U+9d72-9d73,U+9d76-9d77,U+9d7a-9d7c,U+9d7e,U+9d83-9d84,U+9d86-9d87,U+9d89-9d8a,U+9d8d-9d8e,U+9d92-9d93,U+9d95-9d9a,U+9da1,U+9da4,U+9da9-9dac,U+9dae,U+9db1-9db2,U+9db5,U+9db8-9dbd,U+9dbf-9dc4,U+9dc6-9dc7,U+9dc9-9dca,U+9dcf,U+9dd3-9dd7,U+9dd9-9dda,U+9dde-9de0,U+9de3,U+9de5-9de7,U+9de9,U+9deb,U+9ded-9df0,U+9df3-9df4,U+9df8,U+9dfd-9dfe,U+9e02,U+9e07,U+9e0a,U+9e0d-9e0e,U+9e10-9e12,U+9e15-9e16,U+9e19-9e1f,U+9e75,U+9e79-9e7d,U+9e80-9e85,U+9e87-9e88}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.7.woff2) format("woff2");unicode-range:U+9ae5-9ae7,U+9ae9,U+9aeb-9aec,U+9aee-9aef,U+9af1-9af5,U+9af7,U+9af9-9afb,U+9afd,U+9aff-9b06,U+9b08-9b09,U+9b0b-9b0e,U+9b10,U+9b12,U+9b16,U+9b18-9b1d,U+9b1f-9b20,U+9b22-9b23,U+9b25-9b2f,U+9b32-9b35,U+9b37,U+9b39-9b3b,U+9b3d,U+9b43-9b44,U+9b48,U+9b4b-9b4f,U+9b51,U+9b55-9b58,U+9b5b,U+9b5e,U+9b61,U+9b63,U+9b65-9b66,U+9b68,U+9b6a-9b6f,U+9b72-9b79,U+9b7f-9b80,U+9b83-9b87,U+9b89-9b8b,U+9b8d,U+9b8f-9b94,U+9b96-9b97,U+9b9a,U+9b9d-9ba0,U+9ba6-9ba7,U+9ba9-9baa,U+9bac,U+9bb0-9bb2,U+9bb4,U+9bb7-9bb9,U+9bbb-9bbc,U+9bbe-9bc1,U+9bc6-9bc8,U+9bca,U+9bce-9bd2,U+9bd4,U+9bd7-9bd8,U+9bdd,U+9bdf,U+9be1-9be5,U+9be7,U+9bea-9beb,U+9bee-9bf3,U+9bf5,U+9bf7-9bfa,U+9bfd,U+9bff-9c00,U+9c02,U+9c04,U+9c06,U+9c08-9c0d,U+9c0f-9c16,U+9c18-9c1e,U+9c21-9c2a,U+9c2d-9c32,U+9c35-9c37,U+9c39-9c3a,U+9c3d}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.8.woff2) format("woff2");unicode-range:U+98eb,U+98ed-98ee,U+98f0-98f1,U+98f3,U+98f6,U+9902,U+9907-9909,U+9911-9912,U+9914-9918,U+991a-9922,U+9924,U+9926-9927,U+992b-992c,U+992e,U+9931-9935,U+9939-993e,U+9940-9942,U+9945-9949,U+994b-994e,U+9950-9952,U+9954-9955,U+9958-9959,U+995b-995c,U+995e-9960,U+9963,U+9997-9998,U+999b,U+999d-999f,U+99a3,U+99a5-99a6,U+99a8,U+99ad-99ae,U+99b0-99b2,U+99b5,U+99b9-99ba,U+99bc-99bd,U+99bf,U+99c1,U+99c3,U+99c8-99c9,U+99d1,U+99d3-99d5,U+99d8-99df,U+99e1-99e2,U+99e7,U+99ea-99ee,U+99f0-99f2,U+99f4-99f5,U+99f8-99f9,U+99fb-99fe,U+9a01-9a05,U+9a08,U+9a0a-9a0c,U+9a0f-9a11,U+9a16,U+9a1a,U+9a1e,U+9a20,U+9a22-9a24,U+9a27,U+9a2b,U+9a2d-9a2e,U+9a31,U+9a33,U+9a35-9a38,U+9a3e,U+9a40-9a45,U+9a47,U+9a4a-9a4e,U+9a51-9a52,U+9a54-9a58,U+9a5b,U+9a5d,U+9a5f,U+9a62,U+9a64-9a65,U+9a69-9a6c,U+9aaa,U+9aac-9ab0,U+9ab2,U+9ab4-9ab7,U+9ab9,U+9abb-9ac1,U+9ac3,U+9ac6,U+9ac8,U+9ace-9ad3,U+9ad5-9ad7,U+9adb-9adc,U+9ade-9ae0,U+9ae2-9ae4}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.9.woff2) format("woff2");unicode-range:U+971d,U+9721-9724,U+9728,U+972a,U+9730-9731,U+9733,U+9736,U+9738-9739,U+973b,U+973d-973e,U+9741-9744,U+9746-974a,U+974d-974f,U+9751,U+9755,U+9757-9758,U+975a-975c,U+9760-9761,U+9763-9764,U+9766-9768,U+976a-976b,U+976e,U+9771,U+9773,U+9776-977d,U+977f-9781,U+9785-9786,U+9789,U+978b,U+978f-9790,U+9795-9797,U+9799-979a,U+979c,U+979e-97a0,U+97a2-97a3,U+97a6,U+97a8,U+97ab-97ac,U+97ae,U+97b1-97b6,U+97b8-97ba,U+97bc,U+97be-97bf,U+97c1,U+97c3-97ce,U+97d0-97d1,U+97d4,U+97d7-97d9,U+97db-97de,U+97e0-97e1,U+97e4,U+97e6,U+97ed-97ef,U+97f1-97f2,U+97f4-97f8,U+97fa,U+9804,U+9807,U+980a,U+980c-980f,U+9814,U+9816-9817,U+9819-981a,U+981c,U+981e,U+9820-9821,U+9823-9826,U+982b,U+982e-9830,U+9832-9835,U+9837,U+9839,U+983d-983e,U+9844,U+9846-9847,U+984a-984b,U+984f,U+9851-9853,U+9856-9857,U+9859-985b,U+9862-9863,U+9865-9866,U+986a-986c,U+986f-9871,U+9873-9875,U+98aa-98ab,U+98ad-98ae,U+98b0-98b1,U+98b4,U+98b6-98b8,U+98ba-98bc,U+98bf,U+98c2-98c8,U+98cb-98cc,U+98ce,U+98dc,U+98de,U+98e0-98e1,U+98e3,U+98e5-98e7,U+98e9-98ea}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.10.woff2) format("woff2");unicode-range:U+944a,U+944c,U+9452-9453,U+9455,U+9459-945c,U+945e-9463,U+9468,U+946a-946b,U+946d-9472,U+9475,U+9477,U+947c-947f,U+9481,U+9483-9485,U+9578-9579,U+957e-957f,U+9582,U+9584,U+9586-9588,U+958a,U+958c-958f,U+9592,U+9594,U+9596,U+9598-9599,U+959d-95a1,U+95a4,U+95a6-95a9,U+95ab-95ad,U+95b1,U+95b4,U+95b6,U+95b9-95bf,U+95c3,U+95c6,U+95c8-95cd,U+95d0-95d6,U+95d9-95da,U+95dc-95e2,U+95e4-95e6,U+95e8,U+961d-961e,U+9621-9622,U+9624-9626,U+9628,U+962c,U+962e-962f,U+9631,U+9633-9634,U+9637-963a,U+963c-963d,U+9641-9642,U+964b-964c,U+964f,U+9652,U+9654,U+9656-9658,U+965c-965f,U+9661,U+9666,U+966a,U+966c,U+966e,U+9672,U+9674,U+9677,U+967b-967c,U+967e-967f,U+9681-9684,U+9689,U+968b,U+968d,U+9691,U+9695-9698,U+969a,U+969d,U+969f,U+96a4-96aa,U+96ae-96b4,U+96b6,U+96b8-96bb,U+96bd,U+96c1,U+96c9-96cb,U+96cd-96ce,U+96d2,U+96d5-96d6,U+96d8-96da,U+96dc-96df,U+96e9,U+96ef,U+96f1,U+96f9-96fa,U+9702-9706,U+9708-9709,U+970d-970f,U+9711,U+9713-9714,U+9716,U+9719-971b}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.11.woff2) format("woff2");unicode-range:U+92bc-92bd,U+92bf-92c3,U+92c5-92c8,U+92cb-92d0,U+92d2-92d3,U+92d5,U+92d7-92d9,U+92dc-92dd,U+92df-92e1,U+92e3-92e5,U+92e7-92ea,U+92ec,U+92ee,U+92f0,U+92f2,U+92f7-92fb,U+92ff-9300,U+9302,U+9304,U+9308,U+930d,U+930f-9311,U+9314-9315,U+9318-931a,U+931c-931f,U+9321-9325,U+9327-932b,U+932e,U+9333-9337,U+933a-933b,U+9344,U+9347-934a,U+934d,U+9350-9352,U+9354-9358,U+935a,U+935c,U+935e,U+9360,U+9364-9365,U+9367,U+9369-936d,U+936f-9371,U+9373-9374,U+9376,U+937a,U+937d-9382,U+9388,U+938a-938b,U+938d,U+938f,U+9392,U+9394-9395,U+9397-9398,U+939a-939b,U+939e,U+93a1,U+93a3-93a4,U+93a6,U+93a8-93a9,U+93ab-93ad,U+93b0,U+93b4-93b6,U+93b9-93bb,U+93c1,U+93c3-93cd,U+93d0-93d1,U+93d3,U+93d6-93d9,U+93dc-93df,U+93e2,U+93e4-93e8,U+93f1,U+93f5,U+93f7-93fb,U+93fd,U+9401-9404,U+9407-9409,U+940d-9410,U+9413-9417,U+9419-941a,U+941f,U+9421,U+942b,U+942e-942f,U+9431-9434,U+9436,U+9438,U+943a-943b,U+943d,U+943f,U+9441,U+9443-9445,U+9448}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.12.woff2) format("woff2");unicode-range:U+9143,U+9146-914c,U+914f,U+9153,U+9156-915b,U+9161,U+9163-9165,U+9167,U+9169,U+916d,U+9172-9174,U+9179-917b,U+9181-9183,U+9185-9187,U+9189-918b,U+918e,U+9191,U+9193-9195,U+9197-9198,U+919e,U+91a1-91a2,U+91a6,U+91a8,U+91aa-91b6,U+91ba-91bd,U+91bf-91c6,U+91c9,U+91cb,U+91d0,U+91d3-91d4,U+91d6-91d7,U+91d9-91db,U+91de-91df,U+91e1,U+91e4-91e6,U+91e9-91ea,U+91ec-91f1,U+91f5-91f7,U+91f9,U+91fb-91fd,U+91ff-9201,U+9204-9207,U+9209-920a,U+920c,U+920e,U+9210-9218,U+921c-921e,U+9223-9226,U+9228-9229,U+922c,U+922e-9230,U+9233,U+9235-923a,U+923c,U+923e-9240,U+9242-9243,U+9245-924b,U+924d-9251,U+9256-925a,U+925c-925e,U+9260-9261,U+9264-9269,U+926e-9270,U+9275-9279,U+927b-927f,U+9288-928a,U+928d-928e,U+9291-9293,U+9295-9297,U+9299,U+929b-929c,U+929f-92a0,U+92a4-92a5,U+92a7-92a8,U+92ab,U+92af,U+92b2-92b3,U+92b6-92bb}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.13.woff2) format("woff2");unicode-range:U+8f52-8f55,U+8f57-8f58,U+8f5c-8f5e,U+8f61-8f66,U+8f9c-8f9d,U+8f9f-8fa2,U+8fa4-8fa8,U+8fad-8faf,U+8fb4-8fb8,U+8fbe,U+8fc0-8fc2,U+8fc6,U+8fc8,U+8fca-8fcb,U+8fcd,U+8fd0,U+8fd2-8fd3,U+8fd5,U+8fda,U+8fe0,U+8fe2-8fe5,U+8fe8-8fea,U+8fed-8fef,U+8ff1,U+8ff4-8ff6,U+8ff8-8ffb,U+8ffe,U+9002,U+9004-9005,U+9008,U+900b-900e,U+9011,U+9013,U+9015-9016,U+9018,U+901b,U+901e,U+9021,U+9027-902a,U+902c-902d,U+902f,U+9033-9037,U+9039,U+903c,U+903e-903f,U+9041,U+9043-9044,U+9049,U+904c,U+904f-9052,U+9056,U+9058,U+905b-905e,U+9062,U+9066-9068,U+906c,U+906f-9070,U+9072,U+9074,U+9076,U+9079,U+9080-9083,U+9085,U+9087-9088,U+908b-908c,U+908e-9090,U+9095,U+9097-9099,U+909b,U+90a0-90a2,U+90a5,U+90a8,U+90af-90b6,U+90bd-90be,U+90c3-90c5,U+90c7-90c9,U+90cc,U+90d2,U+90d5,U+90d7-90d9,U+90db-90df,U+90e2,U+90e4-90e5,U+90eb,U+90ef-90f0,U+90f2,U+90f4,U+90f6,U+90fe-9100,U+9102,U+9104-9106,U+9108,U+910d,U+9110,U+9112,U+9114-911a,U+911c,U+911e,U+9120,U+9122-9123,U+9125,U+9127,U+9129,U+912d-9132,U+9134,U+9136-9137,U+9139-913a,U+913c-913d}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.14.woff2) format("woff2");unicode-range:U+8dc0,U+8dc2,U+8dc5-8dc8,U+8dca-8dcc,U+8dce-8dcf,U+8dd1,U+8dd4-8dd7,U+8dd9-8ddb,U+8ddf,U+8de3-8de5,U+8de7,U+8dea-8dec,U+8df0-8df2,U+8df4,U+8dfc-8dfd,U+8dff,U+8e01,U+8e04-8e06,U+8e08-8e09,U+8e0b-8e0c,U+8e10-8e11,U+8e14,U+8e16,U+8e1d-8e23,U+8e26-8e27,U+8e30-8e31,U+8e33-8e39,U+8e3d,U+8e40-8e42,U+8e44,U+8e47-8e50,U+8e54-8e55,U+8e59,U+8e5b-8e64,U+8e69,U+8e6c-8e6d,U+8e6f-8e72,U+8e75-8e77,U+8e79-8e7c,U+8e81-8e85,U+8e89,U+8e8b,U+8e90-8e95,U+8e98-8e9b,U+8e9d-8e9e,U+8ea1-8ea2,U+8ea7,U+8ea9-8eaa,U+8eac-8eb1,U+8eb3,U+8eb5-8eb6,U+8eba-8ebb,U+8ebe,U+8ec0-8ec1,U+8ec3-8ec8,U+8ecb,U+8ecf,U+8ed1,U+8ed4,U+8edb-8edc,U+8ee3,U+8ee8,U+8eeb,U+8eed-8eee,U+8ef0-8ef1,U+8ef7,U+8ef9-8efc,U+8efe,U+8f00,U+8f02,U+8f05,U+8f07-8f08,U+8f0a,U+8f0f-8f10,U+8f12-8f13,U+8f15-8f19,U+8f1b-8f1c,U+8f1e-8f21,U+8f23,U+8f25-8f28,U+8f2b-8f2f,U+8f33-8f37,U+8f39-8f3b,U+8f3e,U+8f40-8f43,U+8f45-8f47,U+8f49-8f4a,U+8f4c-8f4f,U+8f51}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.15.woff2) format("woff2");unicode-range:U+8b2d,U+8b30,U+8b37,U+8b3c,U+8b3e,U+8b41-8b46,U+8b48-8b49,U+8b4c-8b4f,U+8b51-8b54,U+8b56,U+8b59,U+8b5b,U+8b5e-8b5f,U+8b63,U+8b69,U+8b6b-8b6d,U+8b6f,U+8b71,U+8b74,U+8b76,U+8b78-8b79,U+8b7c-8b81,U+8b84-8b85,U+8b8a-8b8f,U+8b92-8b96,U+8b99-8b9a,U+8b9c-8ba0,U+8c38-8c3a,U+8c3d-8c3f,U+8c41,U+8c45,U+8c47-8c49,U+8c4b-8c4c,U+8c4e-8c51,U+8c53-8c55,U+8c57-8c59,U+8c5b,U+8c5d,U+8c62-8c64,U+8c66,U+8c68-8c69,U+8c6b-8c6d,U+8c73,U+8c75-8c76,U+8c78,U+8c7a-8c7c,U+8c7e,U+8c82,U+8c85-8c87,U+8c89-8c8b,U+8c8d-8c8e,U+8c90,U+8c92-8c94,U+8c98-8c99,U+8c9b-8c9c,U+8c9f,U+8ca4,U+8cad-8cae,U+8cb2-8cb3,U+8cb6,U+8cb9-8cba,U+8cbd,U+8cc1-8cc2,U+8cc4-8cc6,U+8cc8-8cc9,U+8ccb,U+8ccd-8ccf,U+8cd2,U+8cd5-8cd6,U+8cd9-8cda,U+8cdd,U+8ce1,U+8ce3-8ce4,U+8ce6,U+8ce8,U+8cec,U+8cef-8cf2,U+8cf4-8cf5,U+8cf7-8cf8,U+8cfa-8cfb,U+8cfd-8cff,U+8d01,U+8d03-8d04,U+8d07,U+8d09-8d0b,U+8d0d-8d10,U+8d12-8d14,U+8d16-8d17,U+8d1b-8d1d,U+8d65,U+8d67,U+8d69,U+8d6b-8d6e,U+8d71,U+8d73,U+8d76,U+8d7f,U+8d81-8d82,U+8d84,U+8d88,U+8d8d,U+8d90-8d91,U+8d95,U+8d99,U+8d9e-8da0,U+8da6,U+8da8,U+8dab-8dac,U+8daf,U+8db2,U+8db5,U+8db7,U+8db9-8dbc,U+8dbe}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.16.woff2) format("woff2");unicode-range:U+8973-8975,U+8977,U+897a-897e,U+8980,U+8983,U+8988-898a,U+898d,U+8990,U+8993-8995,U+8998,U+899b-899c,U+899f-89a1,U+89a5-89a6,U+89a9,U+89ac,U+89af-89b0,U+89b2,U+89b4-89b7,U+89ba,U+89bc-89bd,U+89bf-89c1,U+89d4-89d8,U+89da,U+89dc-89dd,U+89e5,U+89e7,U+89e9,U+89eb,U+89ed,U+89f1,U+89f3-89f4,U+89f6,U+89f8-89f9,U+89fd,U+89ff,U+8a01,U+8a04-8a05,U+8a07,U+8a0c,U+8a0f-8a12,U+8a14-8a16,U+8a1b,U+8a1d-8a1e,U+8a20-8a22,U+8a24-8a26,U+8a2b-8a2c,U+8a2f,U+8a35-8a37,U+8a3b,U+8a3d-8a3e,U+8a40-8a41,U+8a43,U+8a45-8a49,U+8a4d-8a4e,U+8a51-8a54,U+8a56-8a58,U+8a5b-8a5d,U+8a61-8a62,U+8a65,U+8a67,U+8a6c-8a6d,U+8a75-8a77,U+8a79-8a7c,U+8a7e-8a80,U+8a82-8a86,U+8a8b,U+8a8f-8a92,U+8a96-8a97,U+8a99-8a9a,U+8a9f,U+8aa1,U+8aa3,U+8aa5-8aaa,U+8aae-8aaf,U+8ab3,U+8ab6-8ab7,U+8abb-8abc,U+8abe,U+8ac2-8ac4,U+8ac6,U+8ac8-8aca,U+8acc-8acd,U+8ad0-8ad1,U+8ad3-8ad5,U+8ad7,U+8ada-8ae2,U+8ae4,U+8ae7,U+8aeb-8aec,U+8aee,U+8af0-8af1,U+8af3-8af7,U+8afa,U+8afc,U+8aff,U+8b01-8b02,U+8b04-8b07,U+8b0a-8b0d,U+8b0f-8b11,U+8b14,U+8b16,U+8b1a,U+8b1c,U+8b1e-8b20,U+8b26,U+8b28,U+8b2b-8b2c}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.17.woff2) format("woff2");unicode-range:U+87e2-87e6,U+87ea-87ed,U+87ef,U+87f1,U+87f3,U+87f5-87f8,U+87fa-87fb,U+87fe-87ff,U+8801,U+8803,U+8805-8807,U+8809-880b,U+880d-8816,U+8818-881c,U+881e-881f,U+8821-8822,U+8827-8828,U+882d-882e,U+8830-8832,U+8835-8836,U+8839-883c,U+8841-8845,U+8848-884b,U+884d-884e,U+8851-8852,U+8855-8856,U+8858-885a,U+885c,U+885e-8860,U+8862,U+8864,U+8869,U+886b,U+886e-886f,U+8871-8872,U+8875,U+8877,U+8879,U+887b,U+887d-887e,U+8880-8882,U+8888,U+888d,U+8892,U+8897-889c,U+889e-88a0,U+88a2,U+88a4,U+88a8,U+88aa,U+88ae,U+88b0-88b1,U+88b5,U+88b7,U+88ba,U+88bc-88c0,U+88c3-88c4,U+88c6,U+88ca-88ce,U+88d1-88d4,U+88d8-88d9,U+88db,U+88dd-88e1,U+88e7-88e8,U+88ef-88f2,U+88f4-88f5,U+88f7,U+88f9,U+88fc,U+8901-8902,U+8904,U+8906,U+890a,U+890c-890f,U+8913,U+8915-8916,U+8918-891a,U+891c-891e,U+8920,U+8925-8928,U+892a-892b,U+8930-8932,U+8935-893b,U+893e,U+8940-8946,U+8949,U+894c-894d,U+894f,U+8952,U+8956-8957,U+895a-895c,U+895e,U+8960-8964,U+8966,U+896a-896b,U+896d-8970}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.18.woff2) format("woff2");unicode-range:U+8655-8659,U+865b,U+865d-8664,U+8667,U+8669,U+866c,U+866f,U+8671,U+8675-8677,U+867a-867b,U+867d,U+8687-8689,U+868b-868d,U+8691,U+8693,U+8695-8696,U+8698,U+869a,U+869c-869d,U+86a1,U+86a3-86a4,U+86a6-86ab,U+86ad,U+86af-86b1,U+86b3-86b9,U+86bf-86c1,U+86c3-86c6,U+86c9,U+86cb,U+86ce,U+86d1-86d2,U+86d4-86d5,U+86d7,U+86da,U+86dc,U+86de-86e0,U+86e3-86e7,U+86e9,U+86ec-86ed,U+86ef,U+86f8-86fe,U+8700,U+8703-870b,U+870d-8714,U+8719-871a,U+871e-871f,U+8721-8723,U+8725,U+8728-8729,U+872e-872f,U+8731-8732,U+8734,U+8737,U+8739-8740,U+8743,U+8745,U+8749,U+874b-874e,U+8751,U+8753,U+8755,U+8757-8759,U+875d,U+875f-8761,U+8763-8766,U+8768,U+876a,U+876e-876f,U+8771-8772,U+8774,U+8778,U+877b-877c,U+877f,U+8782-8789,U+878b-878c,U+878e,U+8790,U+8793,U+8795,U+8797-8799,U+879e-87a0,U+87a2-87a3,U+87a7,U+87ab-87af,U+87b1,U+87b3,U+87b5,U+87bb,U+87bd-87c1,U+87c4,U+87c6-87cb,U+87ce,U+87d0,U+87d2,U+87d5-87d6,U+87d9-87da,U+87dc,U+87df-87e0}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.19.woff2) format("woff2");unicode-range:U+84b4,U+84b9-84bb,U+84bd-84c2,U+84c6-84ca,U+84cc-84d1,U+84d3,U+84d6,U+84d9-84da,U+84dc,U+84e7,U+84ea,U+84ec,U+84ef-84f2,U+84f4,U+84f7,U+84fa-84fd,U+84ff-8500,U+8502-8503,U+8506-8507,U+850c,U+850e,U+8510,U+8514-8515,U+8517-8518,U+851a-851c,U+851e-851f,U+8521-8525,U+8527,U+852a-852c,U+852f,U+8532-8534,U+8536,U+853e-8541,U+8543,U+8546,U+8548,U+854a-854b,U+854f-8553,U+8555-855a,U+855c-8564,U+8569-856b,U+856d,U+856f,U+8577,U+8579-857b,U+857d-8581,U+8585-8586,U+8588-858c,U+858f-8591,U+8593,U+8597-8598,U+859b-859d,U+859f-85a0,U+85a2,U+85a4-85a5,U+85a7-85a8,U+85ad-85b0,U+85b4,U+85b6-85ba,U+85bc-85bf,U+85c1-85c2,U+85c7,U+85c9-85cb,U+85ce-85d0,U+85d5,U+85d8-85da,U+85dc,U+85df-85e1,U+85e5-85e6,U+85e8,U+85ed,U+85f3-85f4,U+85f6-85f7,U+85f9-85fa,U+85fc,U+85fe-8600,U+8602,U+8604-8606,U+860a-860b,U+860d-860e,U+8610-8613,U+8616-861b,U+861e,U+8621-8622,U+8624,U+8627,U+8629,U+862f-8630,U+8636,U+8638-863a,U+863c-863d,U+863f-8642,U+8646,U+864d,U+8652-8654}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.20.woff2) format("woff2");unicode-range:U+82e8,U+82ea,U+82ed,U+82ef,U+82f3-82f4,U+82f6-82f7,U+82f9,U+82fb,U+82fd-82fe,U+8300-8301,U+8303,U+8306-8308,U+830a-830c,U+8316-8318,U+831b,U+831d-831f,U+8321-8323,U+832b-8335,U+8337,U+833a,U+833c-833d,U+8340,U+8342-8347,U+834a,U+834d-8351,U+8353-8357,U+835a,U+8362-8363,U+8370,U+8373,U+8375,U+8378,U+837c-837d,U+837f-8380,U+8382,U+8384-8387,U+838a,U+838d-838e,U+8392-8396,U+8398-83a0,U+83a2,U+83a6-83ad,U+83b1,U+83b5,U+83bd-83c1,U+83c7,U+83c9,U+83ce-83d1,U+83d4,U+83d6,U+83d8,U+83dd,U+83df-83e1,U+83e5,U+83e8,U+83ea-83eb,U+83f0,U+83f2,U+83f4,U+83f6-83f9,U+83fb-83fd,U+8401,U+8403-8404,U+8406-8407,U+840a-840b,U+840d,U+840f,U+8411,U+8413,U+8415,U+8417,U+8419,U+8420,U+8422,U+842a,U+842f,U+8431,U+8435,U+8438-8439,U+843c,U+8445-8448,U+844a,U+844d-844f,U+8451-8452,U+8456,U+8458-845a,U+845c,U+845f-8462,U+8464-8467,U+8469-846b,U+846d-8470,U+8473-8474,U+8476-847a,U+847c-847d,U+8481-8482,U+8484-8485,U+848b,U+8490,U+8492-8493,U+8495,U+8497,U+849c,U+849e-849f,U+84a1,U+84a6,U+84a8-84aa,U+84ad,U+84af,U+84b1}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.21.woff2) format("woff2");unicode-range:U+814a,U+814c,U+8151-8153,U+8157,U+815f-8161,U+8165-8169,U+816d-816f,U+8171,U+8173-8174,U+8177,U+8180-8186,U+8188,U+818a-818b,U+818e,U+8190,U+8193,U+8195-8196,U+8198,U+819b,U+819e,U+81a0,U+81a2,U+81a4,U+81a9,U+81ae,U+81b0,U+81b2,U+81b4-81b5,U+81b8,U+81ba-81bb,U+81bd-81be,U+81c0-81c3,U+81c5-81c6,U+81c8-81cb,U+81cd-81cf,U+81d1,U+81d5-81db,U+81dd-81e1,U+81e4-81e5,U+81e7,U+81eb-81ec,U+81ef-81f2,U+81f5-81f6,U+81f8-81fb,U+81fd-8205,U+8209-820b,U+820d,U+820f,U+8212-8214,U+8216,U+8219-821d,U+8221-8222,U+8228-8229,U+822b,U+822e,U+8232-8235,U+8237-8238,U+823a,U+823c,U+8240,U+8243-8246,U+8249,U+824b,U+824e-824f,U+8251,U+8256-825a,U+825c-825d,U+825f-8260,U+8262-8264,U+8267-8268,U+826a-826b,U+826d-826e,U+8271,U+8274,U+8277,U+8279,U+827b,U+827d-8281,U+8283-8284,U+8287,U+8289-828a,U+828d-828e,U+8291-8294,U+8296,U+8298-829b,U+829f-82a1,U+82a3-82a4,U+82a7-82ac,U+82ae,U+82b0,U+82b2,U+82b4,U+82b7,U+82ba-82bc,U+82be-82bf,U+82c5-82c6,U+82d0,U+82d2-82d3,U+82d5,U+82d9-82da,U+82dc,U+82de-82e4,U+82e7}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.22.woff2) format("woff2");unicode-range:U+7f77-7f79,U+7f7d-7f80,U+7f82-7f83,U+7f86-7f88,U+7f8b-7f8d,U+7f8f-7f91,U+7f94,U+7f96-7f97,U+7f9a,U+7f9c-7f9d,U+7fa1-7fa3,U+7fa6,U+7faa,U+7fad-7faf,U+7fb2,U+7fb4,U+7fb6,U+7fb8-7fb9,U+7fbc,U+7fbf-7fc0,U+7fc3,U+7fc5-7fc6,U+7fc8,U+7fca,U+7fce-7fcf,U+7fd5,U+7fdb,U+7fdf,U+7fe1,U+7fe3,U+7fe5-7fe6,U+7fe8-7fe9,U+7feb-7fec,U+7fee-7ff0,U+7ff2-7ff3,U+7ff9-7ffa,U+7ffd-7fff,U+8002,U+8004,U+8006-8008,U+800a-800f,U+8011-8014,U+8016,U+8018-8019,U+801c-8021,U+8024,U+8026,U+8028,U+802c,U+802e,U+8030,U+8034-8035,U+8037,U+8039-8040,U+8043-8044,U+8046,U+804a,U+8052,U+8058,U+805a,U+805f-8060,U+8062,U+8064,U+8066,U+8068,U+806d,U+806f-8073,U+8075-8076,U+8079,U+807b,U+807d-8081,U+8084-8088,U+808b,U+808e,U+8093,U+8099-809a,U+809c,U+809e,U+80a4,U+80a6-80a7,U+80ab-80ad,U+80b1,U+80b8-80b9,U+80c4-80c5,U+80c8,U+80ca,U+80cd,U+80cf,U+80d2,U+80d4-80db,U+80dd,U+80e0,U+80e4-80e6,U+80ed-80f3,U+80f5-80f7,U+80f9-80fc,U+80fe,U+8101,U+8103,U+8109,U+810b,U+810d,U+8116-8118,U+811b-811c,U+811e,U+8120,U+8123-8124,U+8127,U+8129,U+812b-812c,U+812f-8130,U+8135,U+8139-813a,U+813c-813e,U+8141,U+8145-8147}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.23.woff2) format("woff2");unicode-range:U+7d57,U+7d59-7d5d,U+7d63,U+7d65,U+7d67,U+7d6a,U+7d6e,U+7d70,U+7d72-7d73,U+7d78,U+7d7a-7d7b,U+7d7d,U+7d7f,U+7d81-7d83,U+7d85-7d86,U+7d88-7d89,U+7d8b-7d8d,U+7d8f,U+7d91,U+7d93,U+7d96-7d97,U+7d9b-7da0,U+7da2-7da3,U+7da6-7da7,U+7daa-7dac,U+7dae-7db0,U+7db3,U+7db5-7db9,U+7dbd,U+7dc0,U+7dc2-7dc7,U+7dcc-7dce,U+7dd0,U+7dd5-7dd9,U+7ddc-7dde,U+7de1-7de6,U+7dea-7ded,U+7df1-7df2,U+7df5-7df6,U+7df9-7dfa,U+7e00,U+7e05,U+7e08-7e0b,U+7e10-7e12,U+7e15,U+7e17,U+7e1c-7e1d,U+7e1f-7e23,U+7e27-7e28,U+7e2c-7e2d,U+7e2f,U+7e31-7e33,U+7e35-7e37,U+7e39-7e3b,U+7e3d,U+7e3f,U+7e43-7e48,U+7e4e,U+7e50,U+7e52,U+7e56,U+7e58-7e5a,U+7e5d-7e5f,U+7e61-7e62,U+7e65-7e67,U+7e69-7e6b,U+7e6d-7e6f,U+7e73,U+7e75,U+7e78-7e79,U+7e7b-7e7f,U+7e81-7e83,U+7e86-7e8a,U+7e8c-7e8e,U+7e90-7e96,U+7e98,U+7e9a-7e9f,U+7f38,U+7f3a-7f3f,U+7f43-7f45,U+7f47,U+7f4c-7f50,U+7f52-7f55,U+7f58,U+7f5b-7f5d,U+7f5f,U+7f61,U+7f63-7f69,U+7f6b,U+7f6d,U+7f71}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.24.woff2) format("woff2");unicode-range:U+7bc8,U+7bca-7bcc,U+7bcf,U+7bd4,U+7bd6-7bd7,U+7bd9-7bdb,U+7bdd,U+7be5-7be6,U+7be8-7bea,U+7bf0,U+7bf2-7bfa,U+7bfc,U+7bfe,U+7c00-7c04,U+7c06-7c07,U+7c09,U+7c0b-7c0f,U+7c11-7c14,U+7c17,U+7c19,U+7c1b,U+7c1e-7c20,U+7c23,U+7c25-7c28,U+7c2a-7c2c,U+7c2f,U+7c31,U+7c33-7c34,U+7c36-7c3a,U+7c3d-7c3e,U+7c40,U+7c42-7c43,U+7c45-7c46,U+7c4a,U+7c4c,U+7c4f-7c5f,U+7c61,U+7c63-7c65,U+7c67,U+7c69,U+7c6c-7c70,U+7c72,U+7c75,U+7c79,U+7c7b-7c7e,U+7c81-7c83,U+7c86-7c87,U+7c8d,U+7c8f-7c90,U+7c94,U+7c9e,U+7ca0-7ca2,U+7ca4-7ca6,U+7ca8,U+7cab,U+7cad-7cae,U+7cb0-7cb3,U+7cb6-7cb7,U+7cb9-7cbd,U+7cbf-7cc0,U+7cc2,U+7cc4-7cc5,U+7cc7-7cca,U+7ccd-7ccf,U+7cd2-7cd5,U+7cd7-7cda,U+7cdc-7cdd,U+7cdf-7ce0,U+7ce2,U+7ce6,U+7ce9,U+7ceb,U+7cef,U+7cf2,U+7cf4-7cf6,U+7cf9-7cfa,U+7cfe,U+7d02-7d03,U+7d06-7d0a,U+7d0f,U+7d11-7d13,U+7d15-7d16,U+7d1c-7d1e,U+7d23,U+7d26,U+7d2a,U+7d2c-7d2e,U+7d31-7d32,U+7d35,U+7d3c-7d41,U+7d43,U+7d45,U+7d47-7d48,U+7d4b,U+7d4d-7d4f,U+7d51,U+7d53,U+7d55-7d56}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.25.woff2) format("woff2");unicode-range:U+7a17-7a19,U+7a1b,U+7a1e-7a21,U+7a27,U+7a2b,U+7a2d,U+7a2f-7a31,U+7a34-7a35,U+7a37-7a3b,U+7a3e,U+7a43-7a49,U+7a4c,U+7a4e,U+7a50,U+7a55-7a57,U+7a59,U+7a5c-7a5d,U+7a5f-7a63,U+7a65,U+7a67,U+7a69-7a6a,U+7a6d,U+7a70,U+7a75,U+7a78-7a79,U+7a7d-7a7e,U+7a80,U+7a82,U+7a84-7a86,U+7a88,U+7a8a-7a8b,U+7a90-7a91,U+7a94-7a98,U+7a9e,U+7aa0,U+7aa3,U+7aa9,U+7aac,U+7ab0,U+7ab3,U+7ab5-7ab6,U+7ab9-7abf,U+7ac3,U+7ac5-7aca,U+7acc-7acf,U+7ad1-7ad3,U+7ad5,U+7ada-7adb,U+7add,U+7adf,U+7ae1-7ae2,U+7ae6-7aed,U+7af0-7af1,U+7af4,U+7af8,U+7afa-7afb,U+7afd-7afe,U+7b02,U+7b04,U+7b06-7b08,U+7b0a-7b0b,U+7b0f,U+7b12,U+7b14,U+7b18-7b19,U+7b1e-7b1f,U+7b23,U+7b25,U+7b27-7b2b,U+7b2d-7b31,U+7b33-7b36,U+7b3b,U+7b3d,U+7b3f-7b41,U+7b45,U+7b47,U+7b4c-7b50,U+7b53,U+7b55,U+7b5d,U+7b60,U+7b64-7b66,U+7b69-7b6a,U+7b6c-7b75,U+7b77,U+7b79-7b7a,U+7b7f,U+7b84,U+7b86,U+7b89,U+7b8d-7b92,U+7b96,U+7b98-7ba0,U+7ba5,U+7bac-7bad,U+7baf-7bb0,U+7bb2,U+7bb4-7bb6,U+7bba-7bbd,U+7bc1-7bc2,U+7bc5-7bc6}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.26.woff2) format("woff2");unicode-range:U+7851-7852,U+785c,U+785e,U+7860-7861,U+7863-7864,U+7868,U+786a,U+786e-786f,U+7872,U+7874,U+787a,U+787c,U+787e,U+7886-7887,U+788a,U+788c-788f,U+7893-7895,U+7898,U+789a,U+789d-789f,U+78a1,U+78a3-78a4,U+78a8-78aa,U+78ac-78ad,U+78af-78b3,U+78b5,U+78bb-78bf,U+78c5-78cc,U+78ce,U+78d1-78d6,U+78da-78db,U+78df-78e1,U+78e4,U+78e6-78e7,U+78ea,U+78ec,U+78f2-78f4,U+78f6-78f7,U+78f9-78fb,U+78fd-7901,U+7906-7907,U+790c,U+7910-7912,U+7919-791c,U+791e-7920,U+7925-792e,U+7930-7931,U+7934-7935,U+793b,U+793d,U+793f,U+7941-7942,U+7944-7946,U+794a-794b,U+794f,U+7951,U+7954-7955,U+7957-7958,U+795a-795c,U+795f-7960,U+7962,U+7967,U+7969,U+796b,U+7972,U+7977,U+7979-797c,U+797e-7980,U+798a-798e,U+7991,U+7993-7996,U+7998,U+799b-799d,U+79a1,U+79a6-79ab,U+79ae-79b1,U+79b3-79b4,U+79b8-79bb,U+79bd-79be,U+79c2,U+79c4,U+79c7-79ca,U+79cc-79cd,U+79cf,U+79d4-79d6,U+79da,U+79dd-79e3,U+79e5,U+79e7,U+79ea-79ed,U+79f1,U+79f8,U+79fc,U+7a02-7a03,U+7a05,U+7a07-7a0a,U+7a0c-7a0d,U+7a11,U+7a15}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.27.woff2) format("woff2");unicode-range:U+768c-768e,U+7690,U+7693,U+7695-7696,U+7699-76a8,U+76aa,U+76ad,U+76af-76b0,U+76b4,U+76b6-76ba,U+76bd,U+76c1-76c3,U+76c5,U+76c8-76c9,U+76cb-76ce,U+76d2,U+76d4,U+76d6,U+76d9,U+76dc,U+76de,U+76e0-76e1,U+76e5-76e8,U+76ea-76ec,U+76f0-76f1,U+76f6,U+76f9,U+76fb-76fc,U+7700,U+7704,U+7706-7708,U+770a,U+770e,U+7712,U+7714-7715,U+7717,U+7719-771c,U+7722,U+7724-7726,U+7728,U+772d-772f,U+7734-7739,U+773d-773e,U+7742,U+7745-7747,U+774a,U+774d-774f,U+7752,U+7756-7758,U+775a-775c,U+775e-7760,U+7762,U+7764-7765,U+7767,U+776a-776c,U+7770,U+7772-7774,U+7779-777a,U+777c-7780,U+7784,U+778b-778e,U+7794-7796,U+779a,U+779e-77a0,U+77a2,U+77a4-77a5,U+77a7,U+77a9-77aa,U+77ae-77b1,U+77b5-77b7,U+77b9,U+77bb-77bf,U+77c3,U+77c7,U+77c9,U+77cd,U+77d1-77d2,U+77d5,U+77d7,U+77d9-77da,U+77dc,U+77de-77e0,U+77e3-77e4,U+77e6-77e7,U+77e9-77ea,U+77ec,U+77ee,U+77f0-77f1,U+77f4,U+77f8,U+77fb-77fc,U+7805-7806,U+7809,U+780c-780e,U+7811-7812,U+7819,U+781d,U+7820-7823,U+7826-7827,U+782c-782e,U+7830,U+7835,U+7837,U+783a,U+783f,U+7843-7845,U+7847-7848,U+784c,U+784e-784f}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.28.woff2) format("woff2");unicode-range:U+7511-7513,U+7515-7517,U+751c,U+751e,U+7520-7522,U+7524,U+7526-7527,U+7529-752c,U+752f,U+7536,U+7538-7539,U+753c-7540,U+7543-7544,U+7546-754b,U+754d-7550,U+7552,U+7557,U+755a-755b,U+755d-755f,U+7561-7562,U+7564,U+7566-7567,U+7569,U+756b-756d,U+756f,U+7571-7572,U+7574-757e,U+7581-7582,U+7585-7587,U+7589-758c,U+758f-7590,U+7592-7595,U+7599-759a,U+759c-759d,U+75a2-75a5,U+75b0-75b1,U+75b3-75b5,U+75b7-75b8,U+75ba,U+75bd,U+75bf-75c4,U+75c6,U+75ca,U+75cc-75cf,U+75d3-75d4,U+75d7-75d8,U+75dc-75e1,U+75e3-75e4,U+75e7,U+75ec,U+75ee-75f3,U+75f9,U+75fc,U+75fe-7604,U+7607-760c,U+760f,U+7612-7613,U+7615-7616,U+7618-7619,U+761b-7629,U+762d,U+7630,U+7632-7635,U+7638-763c,U+7640-7641,U+7643-764b,U+764e,U+7655,U+7658-7659,U+765c,U+765f,U+7661-7662,U+7664-7665,U+7667-766a,U+766c-7672,U+7674,U+7676,U+7678,U+7680-7683,U+7685,U+7688,U+768b}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.29.woff2) format("woff2");unicode-range:U+736c,U+736e-7371,U+7375,U+7377-737c,U+7380-7381,U+7383,U+7385-7386,U+738a,U+738e,U+7390,U+7393-7398,U+739c,U+739e-73a0,U+73a2,U+73a5-73a6,U+73a8,U+73aa-73ab,U+73ad,U+73b3,U+73b5,U+73b7,U+73b9-73bd,U+73bf,U+73c5-73c6,U+73c9-73cc,U+73ce-73cf,U+73d2-73d3,U+73d6,U+73d9,U+73dd-73de,U+73e1,U+73e3-73e7,U+73e9-73ea,U+73ee,U+73f1,U+73f4-73f5,U+73f7-73fb,U+73fd,U+73ff-7401,U+7404-7405,U+7407,U+740a,U+7411,U+7413,U+741a-741b,U+7421,U+7424,U+7426,U+7428-7431,U+7433,U+7439-743a,U+743f-7441,U+7443-7444,U+7446-7447,U+744b,U+744d,U+7451-7453,U+7455,U+7457,U+7459-745a,U+745c-745d,U+745f,U+7462-7464,U+7466-746b,U+746d-7473,U+7476,U+747e,U+7480-7481,U+7485-7489,U+748b,U+748f-7492,U+7497-749a,U+749c,U+749e-74a3,U+74a5-74a6,U+74a8-74ab,U+74ae-74af,U+74b1-74b2,U+74b5,U+74b9-74bb,U+74bd,U+74bf,U+74c8-74ca,U+74cc,U+74cf-74d0,U+74d3-74d4,U+74d6,U+74d8,U+74da-74db,U+74de-74e0,U+74e3-74e4,U+74e7-74eb,U+74ee-74f2,U+74f4,U+74f7-74f8,U+74fa-74fc,U+74ff,U+7501,U+7503-7506,U+750c-750e}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.30.woff2) format("woff2");unicode-range:U+7166,U+7168,U+716c,U+7179,U+7180,U+7184-7185,U+7187-7188,U+718c,U+718f,U+7192,U+7194-7196,U+7199-719b,U+71a0,U+71a2,U+71a8,U+71ac,U+71ae-71b0,U+71b2-71b3,U+71b9-71ba,U+71be-71c1,U+71c4,U+71c9,U+71cb-71cc,U+71ce,U+71d0,U+71d2-71d4,U+71d6-71d7,U+71d9-71da,U+71dc,U+71df-71e0,U+71e6-71e7,U+71ec-71ee,U+71f4-71f5,U+71f8-71f9,U+71fc,U+71fe-7200,U+7207-7209,U+720d,U+7210,U+7213,U+7215,U+7217,U+721a,U+721d,U+721f,U+7224,U+7228,U+722b,U+722d,U+722f-7230,U+7232,U+7234,U+7238-7239,U+723b-723c,U+723e-7243,U+7245-7246,U+724b,U+724e-7250,U+7252-7253,U+7255-7258,U+725a,U+725c,U+725e,U+7260,U+7263,U+7268,U+726b,U+726e-726f,U+7271,U+7274,U+7277-7278,U+727b-727c,U+727e-7282,U+7284,U+7287,U+7289,U+728d-728e,U+7292-7293,U+7296,U+729b,U+72a2,U+72a7-72a8,U+72ad-72ae,U+72b0-72b2,U+72b4,U+72b9,U+72be,U+72c0-72c1,U+72c3-72c4,U+72c6-72c7,U+72c9,U+72cc,U+72ce,U+72d2,U+72d5-72d6,U+72d8,U+72df-72e2,U+72e5,U+72f3-72f4,U+72f7,U+72f9-72fb,U+72fd-72fe,U+7302,U+7304-7305,U+7307,U+730a-730b,U+730d,U+7312-7313,U+7316-7319,U+731c-731e,U+7322,U+7324,U+7327-7329,U+732c,U+732f,U+7331-7337,U+7339-733b,U+733d-733e,U+7343,U+734d-7350,U+7352,U+7356-7358,U+735d-7360,U+7366-736b}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.31.woff2) format("woff2");unicode-range:U+6f58-6f5b,U+6f5d-6f5e,U+6f60-6f62,U+6f66,U+6f68,U+6f6c-6f6d,U+6f6f,U+6f74,U+6f78,U+6f7a,U+6f7c-6f7e,U+6f80,U+6f82-6f83,U+6f86-6f88,U+6f8b-6f8e,U+6f90-6f94,U+6f96-6f98,U+6f9a,U+6f9d,U+6f9f-6fa1,U+6fa3,U+6fa5-6fa8,U+6fae-6fb1,U+6fb3,U+6fb5-6fb7,U+6fb9,U+6fbc,U+6fbe,U+6fc2,U+6fc5-6fca,U+6fd4-6fd5,U+6fd8,U+6fda-6fdb,U+6fde-6fe0,U+6fe4,U+6fe8-6fe9,U+6feb-6fec,U+6fee,U+6ff0,U+6ff3,U+6ff5-6ff6,U+6ff9-6ffa,U+6ffc-6ffe,U+7000-7001,U+7005-7007,U+7009-700b,U+700d,U+700f,U+7011,U+7015,U+7017-7018,U+701a-701b,U+701d-7020,U+7023,U+7026,U+7028,U+702f-7030,U+7032,U+7034,U+7037,U+7039-703a,U+703c,U+703e,U+7043-7044,U+7047-704c,U+704e,U+7051,U+7054-7055,U+705d-705e,U+7064-7065,U+7069,U+706c,U+706e,U+7075-7076,U+707e,U+7081,U+7085-7086,U+7094-7098,U+709b,U+709f,U+70a4,U+70ab-70ac,U+70ae-70b1,U+70b3-70b4,U+70b7,U+70bb,U+70ca-70cb,U+70d1,U+70d3-70d6,U+70d8-70d9,U+70dc-70dd,U+70df,U+70e4,U+70ec,U+70f1,U+70fa,U+70fd,U+7103-7108,U+710b-710c,U+710f,U+7114,U+7119,U+711c,U+711e,U+7120,U+712b,U+712d-7131,U+7138,U+7141,U+7145-7147,U+7149-714b,U+7150-7153,U+7155-7157,U+715a,U+715c,U+715e,U+7160,U+7162,U+7164-7165}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.32.woff2) format("woff2");unicode-range:U+6d7c,U+6d80-6d82,U+6d85,U+6d87,U+6d89-6d8a,U+6d8c-6d8e,U+6d91-6d98,U+6d9c,U+6daa-6dac,U+6dae,U+6db4-6db5,U+6db7-6db9,U+6dbd,U+6dbf,U+6dc2,U+6dc4-6dc8,U+6dca,U+6dcc,U+6dce-6dd0,U+6dd2,U+6dd5-6dd6,U+6dd8-6ddb,U+6ddd-6de0,U+6de2,U+6de4-6de6,U+6de8-6dea,U+6dec,U+6dee-6df0,U+6df2,U+6df4,U+6df6,U+6df8-6dfa,U+6dfc,U+6e00,U+6e04,U+6e0a,U+6e17,U+6e19,U+6e1d-6e20,U+6e22-6e25,U+6e27,U+6e2b,U+6e2d-6e2e,U+6e32,U+6e34,U+6e36,U+6e38-6e3c,U+6e42-6e45,U+6e48-6e49,U+6e4b-6e4f,U+6e51-6e54,U+6e57,U+6e5b-6e5f,U+6e62-6e63,U+6e68,U+6e6b,U+6e6e,U+6e72-6e73,U+6e76,U+6e7b,U+6e7d,U+6e82,U+6e89,U+6e8c-6e8d,U+6e8f,U+6e93,U+6e98-6e99,U+6e9f-6ea0,U+6ea5,U+6ea7,U+6eaa-6eab,U+6ead-6eaf,U+6eb1-6eb4,U+6eb7,U+6ebb-6ebd,U+6ebf-6ec4,U+6ec7-6eca,U+6ecc-6ecf,U+6ed3-6ed5,U+6ed9-6edb,U+6ee6,U+6eeb-6eef,U+6ef7-6ef9,U+6efb,U+6efd-6eff,U+6f04,U+6f08-6f0a,U+6f0c-6f0d,U+6f10-6f11,U+6f13,U+6f15-6f16,U+6f18,U+6f1a-6f1b,U+6f25-6f26,U+6f29-6f2a,U+6f2d,U+6f2f-6f33,U+6f35-6f36,U+6f38,U+6f3b-6f3c,U+6f3e-6f3f,U+6f41,U+6f45,U+6f4f,U+6f51-6f53,U+6f57}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.33.woff2) format("woff2");unicode-range:U+6b85,U+6b89,U+6b8d,U+6b95,U+6b97-6b98,U+6b9b,U+6b9e-6ba0,U+6ba2-6ba4,U+6ba8-6bb3,U+6bb7-6bb9,U+6bbc-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bc9,U+6bcb-6bcc,U+6bcf,U+6bd3,U+6bd6-6bd8,U+6bda,U+6bdf,U+6be1,U+6be3,U+6be6-6be7,U+6beb-6bec,U+6bee,U+6bf1,U+6bf3,U+6bf7,U+6bf9,U+6bff,U+6c02,U+6c04-6c05,U+6c08-6c0a,U+6c0d-6c0e,U+6c10,U+6c12-6c14,U+6c19,U+6c1b,U+6c1f,U+6c24,U+6c26-6c28,U+6c2c,U+6c2e,U+6c33,U+6c35-6c36,U+6c3a-6c3b,U+6c3e-6c40,U+6c4a-6c4b,U+6c4d,U+6c4f,U+6c52,U+6c54-6c55,U+6c59,U+6c5b-6c5e,U+6c62,U+6c67-6c68,U+6c6a-6c6b,U+6c6d,U+6c6f,U+6c73-6c74,U+6c76,U+6c78-6c79,U+6c7b,U+6c7e,U+6c81-6c87,U+6c89,U+6c8c-6c8d,U+6c90,U+6c92-6c95,U+6c97-6c98,U+6c9a-6c9c,U+6c9f,U+6caa-6cae,U+6cb0-6cb2,U+6cb4,U+6cba,U+6cbd-6cbe,U+6cc2,U+6cc5-6cc6,U+6ccd,U+6ccf-6cd4,U+6cd6-6cd7,U+6cd9-6cdd,U+6ce0,U+6ce7,U+6ce9-6cef,U+6cf1-6cf2,U+6cf4,U+6cfb,U+6d00-6d01,U+6d04,U+6d07,U+6d0a,U+6d0c,U+6d0e-6d0f,U+6d11,U+6d13,U+6d19-6d1a,U+6d1f,U+6d24,U+6d26-6d28,U+6d2b,U+6d2e-6d2f,U+6d31,U+6d33-6d36,U+6d38-6d39,U+6d3c-6d3d,U+6d3f,U+6d57-6d5b,U+6d5e-6d61,U+6d64-6d65,U+6d67,U+6d6c,U+6d6f-6d70,U+6d79}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.34.woff2) format("woff2");unicode-range:U+69dd-69de,U+69e2-69e3,U+69e5,U+69e7-69eb,U+69ed-69ef,U+69f1-69f6,U+69f9,U+69fe-6a01,U+6a03,U+6a05,U+6a0a,U+6a0c,U+6a0f,U+6a11-6a15,U+6a17,U+6a1a-6a1b,U+6a1d-6a20,U+6a22-6a24,U+6a28,U+6a2e,U+6a30,U+6a32-6a38,U+6a3b,U+6a3e-6a3f,U+6a44-6a4a,U+6a4e,U+6a50-6a52,U+6a54-6a56,U+6a5b,U+6a61-6a62,U+6a64,U+6a66-6a67,U+6a6a-6a6b,U+6a71-6a73,U+6a78,U+6a7a,U+6a7e-6a7f,U+6a81,U+6a83-6a84,U+6a86-6a87,U+6a89,U+6a8b,U+6a8d,U+6a90-6a91,U+6a94,U+6a97,U+6a9b,U+6a9d-6aa3,U+6aa5,U+6aaa-6aac,U+6aae-6ab1,U+6ab3-6ab4,U+6ab8,U+6abb,U+6abd-6abf,U+6ac1-6ac3,U+6ac6,U+6ac8-6ac9,U+6acc,U+6ad0-6ad1,U+6ad3-6ad6,U+6ada-6adf,U+6ae2,U+6ae4,U+6ae7-6ae8,U+6aea,U+6aec,U+6af0-6af3,U+6af8,U+6afa,U+6afc-6afd,U+6b02-6b03,U+6b06-6b07,U+6b09-6b0b,U+6b0f-6b12,U+6b16-6b17,U+6b1b,U+6b1d-6b1f,U+6b23-6b24,U+6b28,U+6b2b-6b2c,U+6b2f,U+6b35-6b39,U+6b3b,U+6b3d,U+6b3f,U+6b43,U+6b46-6b47,U+6b49-6b4a,U+6b4d-6b4e,U+6b50,U+6b52,U+6b54,U+6b56,U+6b58-6b59,U+6b5b,U+6b5d,U+6b5f-6b61,U+6b65,U+6b67,U+6b6b-6b6c,U+6b6e,U+6b70,U+6b72,U+6b75,U+6b77-6b7a,U+6b7d-6b84}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.35.woff2) format("woff2");unicode-range:U+6855,U+6857-6859,U+685b,U+685d,U+685f,U+6863,U+6867,U+686b,U+686e-6872,U+6874-6875,U+6877,U+6879-687c,U+687e-687f,U+6882-6884,U+6886,U+6888,U+688d-6890,U+6894,U+6896,U+6898-689c,U+689f-68a3,U+68a5-68a7,U+68a9-68ab,U+68ad-68af,U+68b2-68b5,U+68b9-68bc,U+68c3,U+68c5-68c6,U+68c8-68ca,U+68cc-68cd,U+68cf-68d1,U+68d3-68d9,U+68dc-68dd,U+68e0-68e1,U+68e3-68e5,U+68e7-68e8,U+68ea-68ed,U+68ef-68f1,U+68f5-68f7,U+68f9,U+68fb-68fd,U+6900-6901,U+6903-6904,U+6906-690c,U+690f-6911,U+6913,U+6916-6917,U+6919-691b,U+6921-6923,U+6925-6926,U+6928,U+692a,U+6930-6931,U+6933-6936,U+6938-6939,U+693b,U+693d,U+6942,U+6945-6946,U+6949,U+694e,U+6954,U+6957,U+6959,U+695b-695e,U+6961-6966,U+6968-696c,U+696e-6974,U+6977-697b,U+697e-6981,U+6986,U+698d,U+6991-6992,U+6994-6996,U+6998,U+699c,U+69a0-69a1,U+69a5-69a8,U+69ab,U+69ad,U+69af-69b2,U+69b4,U+69b7-69b8,U+69ba-69bc,U+69be-69c1,U+69c3,U+69c5,U+69c7-69c8,U+69ca,U+69ce-69d1,U+69d3,U+69d6-69d7,U+69d9}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.36.woff2) format("woff2");unicode-range:U+667e-6680,U+6683-6684,U+6688,U+668b-668e,U+6690,U+6692,U+6698-669d,U+669f-66a0,U+66a2,U+66a4,U+66ad,U+66b1-66b3,U+66b5,U+66b8-66b9,U+66bb-66bc,U+66be-66c4,U+66c6,U+66c8-66c9,U+66cc,U+66ce-66cf,U+66d4,U+66da-66db,U+66dd,U+66df-66e0,U+66e6,U+66e8-66e9,U+66eb-66ec,U+66ee,U+66f5,U+66f7,U+66fa-66fc,U+6701,U+6705,U+6707,U+670c,U+670e-6710,U+6712-6716,U+6719,U+671c,U+671e,U+6720,U+6722,U+6725-6726,U+672e,U+6733,U+6735-6738,U+673e-673f,U+6741,U+6743,U+6745-6748,U+674c-674d,U+6753-6755,U+6759,U+675d-675e,U+6760,U+6762-6764,U+6766,U+676a,U+676c,U+676e,U+6770,U+6772-6774,U+6776-6777,U+677b-677c,U+6780-6781,U+6784-6785,U+6787,U+6789,U+678b-678c,U+678e-678f,U+6791-6793,U+6796,U+6798-6799,U+679b,U+67a1,U+67a4,U+67a6,U+67a9,U+67b0-67b5,U+67b7-67b9,U+67bb-67be,U+67c0-67c3,U+67c5-67c6,U+67c8-67c9,U+67ce,U+67d2,U+67d7-67d9,U+67db-67de,U+67e1-67e2,U+67e4,U+67e6-67e7,U+67e9,U+67ec,U+67ee-67f0,U+67f2,U+67f6-67f7,U+67f9-67fa,U+67fc,U+67fe,U+6801-6802,U+6805,U+6810,U+6814,U+6818-6819,U+681d,U+681f,U+6822,U+6827-6829,U+682b-682d,U+682f-6834,U+683b,U+683e-6840,U+6844-6846,U+6849-684a,U+684c-684e,U+6852-6854}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.37.woff2) format("woff2");unicode-range:U+64d2,U+64d4-64d5,U+64d7-64d8,U+64da,U+64e0-64e1,U+64e3-64e5,U+64e7,U+64e9-64ea,U+64ed,U+64ef-64f2,U+64f4-64f7,U+64fa-64fb,U+64fd-6501,U+6504-6505,U+6508-650a,U+650f,U+6513-6514,U+6516,U+6518-6519,U+651b-651f,U+6522,U+6524,U+6526,U+6529-652c,U+652e,U+6531-6532,U+6534-6538,U+653a,U+653c-653d,U+6543-6544,U+6547-6549,U+654d-654e,U+6550,U+6552,U+6554-6556,U+6558,U+655d-6560,U+6567,U+656b,U+6572,U+6578,U+657a,U+657d,U+6581-6585,U+6588,U+658a,U+658c,U+6592,U+6595,U+6598,U+659b,U+659d,U+659f-65a1,U+65a3-65a6,U+65ab,U+65ae,U+65b2-65b5,U+65b7-65b8,U+65be-65bf,U+65c1-65c4,U+65c6,U+65c8-65c9,U+65cc,U+65ce,U+65d0,U+65d2,U+65d4,U+65d6,U+65d8-65d9,U+65db,U+65df-65e1,U+65e3,U+65f0-65f2,U+65f4-65f5,U+65f9,U+65fb-65fc,U+65fe-6600,U+6603-6604,U+6608-660a,U+660d,U+6611-6612,U+6615-6616,U+661c-661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630-6631,U+6633-6637,U+6639-663b,U+663f-6641,U+6644-6646,U+6648-664a,U+664c,U+664e-664f,U+6651,U+6657-6665,U+6667-6668,U+666a-666d,U+6670,U+6673,U+6675,U+6677-6679,U+667b-667c}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.38.woff2) format("woff2");unicode-range:U+62cf,U+62d1,U+62d4-62d6,U+62da,U+62dc,U+62ea,U+62ee-62ef,U+62f1-62f2,U+62f4-62f5,U+62fc-62fd,U+62ff,U+6302-6304,U+6308-630d,U+6310,U+6313,U+6316,U+6318,U+631b,U+6327,U+6329-632a,U+632d,U+6332,U+6335-6336,U+6339-633c,U+633e,U+6341-6344,U+6346,U+634a-634e,U+6350,U+6352-6354,U+6358-6359,U+635b,U+6365-6366,U+6369,U+636b-636d,U+6371-6372,U+6374-6378,U+637a,U+637c-637d,U+637f-6380,U+6382,U+6384,U+6387,U+6389-638a,U+638e-6390,U+6394-6396,U+6399-639a,U+639e,U+63a0,U+63a3-63a4,U+63a6,U+63a9,U+63ab-63af,U+63b5,U+63bd-63be,U+63c0-63c1,U+63c4-63c6,U+63c8,U+63ce,U+63d1-63d6,U+63dc,U+63e0,U+63e3,U+63e5,U+63e9-63ed,U+63f2-63f3,U+63f5-63f9,U+6406,U+6409-640a,U+640f-6410,U+6412-6414,U+6416-6418,U+641e,U+6420,U+6422,U+6424-6426,U+6428-642a,U+642f-6430,U+6434-6436,U+643d,U+643f,U+644b,U+644e-644f,U+6451-6454,U+645a-645d,U+645f-6461,U+6463,U+6467,U+646d,U+6473-6474,U+6476,U+6478-6479,U+647b,U+647d,U+6485,U+6487-6488,U+648f-6491,U+6493,U+6495,U+6498-649b,U+649d-649f,U+64a1,U+64a3,U+64a6,U+64a8-64a9,U+64ac,U+64b3,U+64bb-64bf,U+64c2,U+64c4-64c5,U+64c7,U+64c9-64cc,U+64ce,U+64d0-64d1}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.39.woff2) format("woff2");unicode-range:U+6117,U+6119,U+611c,U+611e,U+6120-6122,U+6127-6128,U+612a-612c,U+6130-6131,U+6134-6137,U+6139-613a,U+613c-613f,U+6141-6142,U+6144-6147,U+6149-614a,U+614d,U+6153,U+6158-615a,U+615d-6160,U+6164-6165,U+616b-616c,U+616f,U+6171-6175,U+6177-6178,U+617b-6181,U+6183-6184,U+6187,U+618a-618b,U+618d,U+6192-6194,U+6196-619a,U+619c-619d,U+619f-61a0,U+61a5,U+61a8,U+61aa-61ae,U+61b8-61ba,U+61bc,U+61be,U+61c0-61c3,U+61c6,U+61c8,U+61ca-61cf,U+61d5,U+61dc-61df,U+61e1-61e3,U+61e5-61e9,U+61ec-61ed,U+61ef,U+61f4-61f7,U+61fa,U+61fc-6201,U+6203-6204,U+6207-620a,U+620d-620e,U+6213-6215,U+621b-621e,U+6220-6223,U+6227,U+6229-622b,U+622e,U+6230-6233,U+6236,U+6239,U+623d-623e,U+6241-6244,U+6246,U+6248,U+624c,U+624e,U+6250-6252,U+6254,U+6256,U+6258,U+625a-625c,U+625e,U+6260-6261,U+6263-6264,U+6268,U+626d,U+626f,U+6273,U+627a-627e,U+6282-6283,U+6285,U+6289,U+628d-6290,U+6292-6294,U+6296,U+6299,U+629b,U+62a6,U+62a8,U+62ac,U+62b3,U+62b6-62b7,U+62ba-62bb,U+62be-62bf,U+62c2,U+62c4,U+62c6-62c8,U+62ca,U+62ce}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.40.woff2) format("woff2");unicode-range:U+5f6c-5f6d,U+5f6f,U+5f72-5f75,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f82-5f83,U+5f87-5f89,U+5f8d,U+5f8f,U+5f91,U+5f96,U+5f99,U+5f9c-5f9d,U+5fa0,U+5fa2,U+5fa4,U+5fa7-5fa8,U+5fab-5fad,U+5faf-5fb1,U+5fb5,U+5fb7-5fb8,U+5fbc-5fbd,U+5fc4,U+5fc7-5fc9,U+5fcb,U+5fd0-5fd4,U+5fdd-5fde,U+5fe1-5fe2,U+5fe4,U+5fe8-5fea,U+5fec-5ff3,U+5ff6,U+5ff8,U+5ffa-5ffd,U+5fff,U+6007,U+600a,U+600d-6010,U+6013-6015,U+6017-601b,U+601f,U+6021-6022,U+6024,U+6026,U+6029,U+602b,U+602d,U+6031,U+6033,U+6035,U+603a,U+6040-6043,U+6046-604a,U+604c-604d,U+6051,U+6054-6057,U+6059-605a,U+605d,U+605f-6064,U+6067,U+606a-606c,U+6070-6071,U+6077,U+607e-607f,U+6081-6086,U+6088-608e,U+6091-6093,U+6095-6098,U+609a-609b,U+609d-609e,U+60a2,U+60a4-60a5,U+60a7-60a8,U+60b0-60b1,U+60b3-60b5,U+60b7-60b8,U+60bb,U+60bd-60be,U+60c2,U+60c4,U+60c6-60cb,U+60ce-60cf,U+60d3-60d5,U+60d8-60d9,U+60db,U+60dd-60df,U+60e1-60e2,U+60e5,U+60ee,U+60f0-60f2,U+60f4-60f8,U+60fa-60fd,U+6100,U+6102-6103,U+6106-6108,U+610a,U+610c-610e,U+6110-6114,U+6116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.41.woff2) format("woff2");unicode-range:U+5d9b,U+5d9d,U+5d9f-5da0,U+5da2,U+5da4,U+5da7,U+5dab-5dac,U+5dae,U+5db0,U+5db2,U+5db4,U+5db7-5db9,U+5dbc-5dbd,U+5dc3,U+5dc7,U+5dc9,U+5dcb-5dce,U+5dd0-5dd3,U+5dd6-5dd9,U+5ddb,U+5de0,U+5de2,U+5de4,U+5de9,U+5df2,U+5df5,U+5df8-5df9,U+5dfd,U+5dff-5e00,U+5e07,U+5e0b,U+5e0d,U+5e11-5e12,U+5e14-5e15,U+5e18-5e1b,U+5e1f-5e20,U+5e25,U+5e28,U+5e2e,U+5e32,U+5e35-5e37,U+5e3e,U+5e40,U+5e43-5e44,U+5e47,U+5e49,U+5e4b,U+5e4e,U+5e50-5e51,U+5e54,U+5e56-5e58,U+5e5b-5e5c,U+5e5e-5e5f,U+5e62,U+5e64,U+5e68,U+5e6a-5e6e,U+5e70,U+5e75-5e77,U+5e7a,U+5e7f-5e80,U+5e87,U+5e8b,U+5e8e,U+5e96,U+5e99-5e9a,U+5ea0,U+5ea2,U+5ea4-5ea5,U+5ea8,U+5eaa,U+5eac,U+5eb1,U+5eb3,U+5eb8-5eb9,U+5ebd-5ebf,U+5ec1-5ec2,U+5ec6,U+5ec8,U+5ecb-5ecc,U+5ece-5ed6,U+5ed9-5ee2,U+5ee5,U+5ee8-5ee9,U+5eeb-5eec,U+5ef0-5ef1,U+5ef3-5ef4,U+5ef8-5ef9,U+5efc-5f00,U+5f02-5f03,U+5f06-5f09,U+5f0b-5f0e,U+5f11,U+5f16-5f17,U+5f19,U+5f1b-5f1e,U+5f21-5f24,U+5f27-5f29,U+5f2b-5f30,U+5f34,U+5f36,U+5f38,U+5f3a-5f3d,U+5f3f-5f41,U+5f44-5f45,U+5f47-5f48,U+5f4a,U+5f4c-5f4e,U+5f50-5f51,U+5f54,U+5f56-5f58,U+5f5b-5f5d,U+5f60,U+5f63-5f65,U+5f67,U+5f6a}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.42.woff2) format("woff2");unicode-range:U+5bbc,U+5bc0-5bc1,U+5bc3,U+5bc7,U+5bc9,U+5bcd-5bd0,U+5bd3-5bd4,U+5bd6-5bda,U+5bde,U+5be0-5be2,U+5be4-5be6,U+5be8,U+5beb-5bec,U+5bef-5bf1,U+5bf3-5bf6,U+5bfd,U+5c03,U+5c05,U+5c07-5c09,U+5c0c-5c0d,U+5c12-5c14,U+5c17,U+5c19,U+5c1e-5c20,U+5c22-5c24,U+5c26,U+5c28-5c2e,U+5c30,U+5c32,U+5c35-5c36,U+5c38-5c39,U+5c46,U+5c4d-5c50,U+5c53,U+5c59-5c5c,U+5c5f-5c63,U+5c67-5c69,U+5c6c-5c70,U+5c74-5c76,U+5c79-5c7d,U+5c87-5c88,U+5c8a,U+5c8c,U+5c8f,U+5c91-5c92,U+5c94,U+5c9d,U+5c9f-5ca0,U+5ca2-5ca3,U+5ca6-5ca8,U+5caa-5cab,U+5cad,U+5cb1-5cb2,U+5cb4-5cb7,U+5cba-5cbc,U+5cbe,U+5cc5,U+5cc7,U+5cc9,U+5ccb,U+5cd0,U+5cd2,U+5cd7,U+5cd9,U+5cdd,U+5ce6,U+5ce8-5cea,U+5ced-5cee,U+5cf1-5cf2,U+5cf4-5cf5,U+5cfa-5cfb,U+5cfd,U+5d01,U+5d06,U+5d0b,U+5d0d,U+5d10-5d12,U+5d14-5d15,U+5d17-5d1b,U+5d1d,U+5d1f-5d20,U+5d22-5d24,U+5d26-5d27,U+5d2b,U+5d31,U+5d34,U+5d39,U+5d3d,U+5d3f,U+5d42-5d43,U+5d46-5d48,U+5d4a-5d4b,U+5d4e,U+5d51-5d53,U+5d55,U+5d59,U+5d5c,U+5d5f-5d62,U+5d64,U+5d69-5d6a,U+5d6c-5d6d,U+5d6f-5d70,U+5d73,U+5d76,U+5d79-5d7a,U+5d7e-5d7f,U+5d81-5d84,U+5d87-5d88,U+5d8a,U+5d8c,U+5d90,U+5d92-5d95,U+5d97,U+5d99}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.43.woff2) format("woff2");unicode-range:U+598b-598e,U+5992,U+5995,U+5997,U+599b,U+599d,U+599f,U+59a3-59a4,U+59a7,U+59ad-59b0,U+59b2-59b3,U+59b7,U+59ba,U+59bc,U+59be,U+59c1,U+59c3-59c4,U+59c6,U+59c8,U+59ca,U+59cd,U+59d2,U+59d9-59da,U+59dd-59df,U+59e3-59e5,U+59e7-59e8,U+59ec,U+59ee-59ef,U+59f1-59f2,U+59f4,U+59f6-59f8,U+5a00,U+5a03-5a04,U+5a09,U+5a0c-5a0e,U+5a11-5a13,U+5a17,U+5a1a-5a1c,U+5a1e-5a1f,U+5a23-5a25,U+5a27-5a28,U+5a2a,U+5a2d,U+5a30,U+5a35-5a36,U+5a40-5a41,U+5a44-5a45,U+5a47-5a49,U+5a4c,U+5a50,U+5a55,U+5a5e,U+5a62-5a63,U+5a65,U+5a67,U+5a6a,U+5a6c-5a6d,U+5a77,U+5a7a-5a7b,U+5a7e,U+5a84,U+5a8b,U+5a90,U+5a93,U+5a96,U+5a99,U+5a9c,U+5a9e-5aa0,U+5aa2,U+5aa7,U+5aac,U+5ab1-5ab3,U+5ab5,U+5ab8,U+5aba-5abf,U+5ac2,U+5ac4,U+5ac6,U+5ac8,U+5acb,U+5acf-5ad0,U+5ad6-5ad7,U+5ada,U+5adc,U+5ae0-5ae1,U+5ae3,U+5ae5-5ae6,U+5ae9-5aea,U+5aee,U+5af0,U+5af5-5af6,U+5afa-5afb,U+5afd,U+5b00-5b01,U+5b08,U+5b0b,U+5b16-5b17,U+5b19,U+5b1b,U+5b1d,U+5b21,U+5b25,U+5b2a,U+5b2c-5b2d,U+5b30,U+5b32,U+5b34,U+5b36,U+5b38,U+5b3e,U+5b40-5b41,U+5b43,U+5b45,U+5b4b-5b4c,U+5b51-5b52,U+5b56,U+5b5a-5b5c,U+5b5e-5b5f,U+5b65,U+5b68-5b69,U+5b6e-5b71,U+5b73,U+5b75-5b76,U+5b7a,U+5b7c-5b84,U+5b86,U+5b8a-5b8b,U+5b8d-5b8e,U+5b90-5b91,U+5b93-5b94,U+5b96,U+5ba5-5ba6,U+5ba8-5ba9,U+5bac-5bad,U+5baf,U+5bb1-5bb2,U+5bb7-5bb8,U+5bba}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.44.woff2) format("woff2");unicode-range:U+57b3,U+57b8,U+57bd,U+57c0,U+57c3,U+57c6-57c8,U+57cc,U+57cf,U+57d2-57d7,U+57dc-57de,U+57e0-57e1,U+57e3-57e4,U+57e6-57e7,U+57e9,U+57ed,U+57f0,U+57f4-57f6,U+57f8,U+57fb,U+57fd-57ff,U+5803-5804,U+5808-580d,U+5819,U+581b,U+581d-5821,U+5826-5827,U+582d,U+582f-5830,U+5832,U+5835,U+5839,U+583d,U+583f-5840,U+5849,U+584b-584d,U+584f-5852,U+5855,U+5858-5859,U+585f,U+5861-5862,U+5864,U+5867-5868,U+586d,U+5870,U+5872,U+5878-5879,U+587c,U+587f-5881,U+5885,U+5887-588d,U+588f-5890,U+5894,U+5896,U+5898,U+589d-589e,U+58a0-58a2,U+58a6,U+58a9-58ab,U+58ae,U+58b1-58b3,U+58b8-58bc,U+58be,U+58c2-58c5,U+58c8,U+58cd-58ce,U+58d0-58da,U+58dc-58e2,U+58e4-58e5,U+58e9,U+58ec,U+58ef,U+58f3-58f4,U+58f7,U+58f9,U+58fb-58fd,U+5902,U+5905-5906,U+590a-590d,U+5910,U+5912-5914,U+5918-5919,U+591b,U+591d,U+591f,U+5921,U+5923-5925,U+5928,U+592c-592d,U+592f-5930,U+5932-5933,U+5935-5936,U+5938-5939,U+593d-593f,U+5943,U+5946,U+594e,U+5950,U+5952-5953,U+5955,U+5957-595b,U+595d-5961,U+5963,U+5967,U+5969,U+596b-596d,U+596f,U+5972,U+5975-5976,U+5978-5979,U+597b-597c,U+5981}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.45.woff2) format("woff2");unicode-range:U+5616-5617,U+5619,U+561b,U+5620,U+5628,U+562c,U+562f-5639,U+563b-563d,U+563f-5641,U+5643-5644,U+5646-5647,U+5649,U+564b,U+564d-5650,U+5653-5654,U+565e,U+5660-5664,U+5666,U+5669-566d,U+566f,U+5671-5672,U+5675-5676,U+5678,U+567a,U+5680,U+5684-5688,U+568a-568c,U+568f,U+5694-5695,U+5699-569a,U+569d-56a0,U+56a5-56a9,U+56ab-56ae,U+56b1-56b4,U+56b6-56b7,U+56bc,U+56be,U+56c0,U+56c2-56c3,U+56c5,U+56c8-56d1,U+56d3,U+56d7-56d9,U+56dc-56dd,U+56df,U+56e1,U+56e4-56e8,U+56eb,U+56ed-56ee,U+56f1,U+56f6-56f7,U+56f9,U+56ff-5704,U+5707-570a,U+570c-570d,U+5711,U+5713,U+5715-5716,U+5718,U+571a-571d,U+5720-5726,U+5729-572a,U+572c,U+572e-572f,U+5733-5734,U+5737-5738,U+573b,U+573d-573f,U+5745-5746,U+574c-574f,U+5751-5752,U+5759,U+575f,U+5761-5762,U+5764-5765,U+5767-5769,U+576b,U+576d-5771,U+5773-5775,U+5777,U+5779-577c,U+577e-577f,U+5781,U+5783,U+5788-5789,U+578c,U+5793-5795,U+5797,U+5799-579a,U+579c-57a1,U+57a4,U+57a7-57aa,U+57ac,U+57ae,U+57b0}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.46.woff2) format("woff2");unicode-range:U+543f-5440,U+5443-5444,U+5447,U+544c-544f,U+5455,U+545e,U+5462,U+5464,U+5466-5467,U+5469,U+546b-546e,U+5470-5471,U+5474-5477,U+547b,U+547f-5481,U+5483-5486,U+5488-548b,U+548d-5492,U+5495-5496,U+549c,U+549f-54a2,U+54a4,U+54a6-54af,U+54b1,U+54b7-54bc,U+54be-54bf,U+54c2-54c4,U+54c6-54c8,U+54ca,U+54cd-54ce,U+54d8,U+54e0,U+54e2,U+54e5-54e6,U+54e8-54ea,U+54ec-54ef,U+54f1,U+54f3,U+54f6,U+54fc-5501,U+5505,U+5508-5509,U+550c-550f,U+5514-5516,U+5527,U+552a-552b,U+552e,U+5532-5533,U+5535-5536,U+5538-5539,U+553b-553d,U+5540-5541,U+5544-5545,U+5547,U+5549-554a,U+554c-554d,U+5550-5551,U+5556-5558,U+555a-555e,U+5560-5561,U+5563-5564,U+5566,U+557b-5583,U+5586-5588,U+558a,U+558e-558f,U+5591-5594,U+5597,U+5599,U+559e-559f,U+55a3-55a4,U+55a8-55a9,U+55ac-55ae,U+55b2,U+55bf,U+55c1,U+55c3-55c4,U+55c6-55c7,U+55c9,U+55cb-55cc,U+55ce,U+55d1-55d4,U+55d7-55d8,U+55da-55db,U+55dd-55df,U+55e2,U+55e4,U+55e9,U+55ec,U+55ee,U+55f1,U+55f6-55f9,U+55fd-55ff,U+5605,U+5607-5608,U+560a,U+560d-5612}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.47.woff2) format("woff2");unicode-range:U+528d,U+5291-5298,U+529a,U+529c,U+52a4-52a7,U+52ab-52ad,U+52af-52b0,U+52b5-52b8,U+52ba-52be,U+52c0-52c1,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cd,U+52cf-52d2,U+52d4,U+52d6-52d7,U+52db-52dc,U+52de,U+52e0-52e1,U+52e3,U+52e5-52e6,U+52e8-52ea,U+52ec,U+52f0-52f1,U+52f3-52fb,U+5300-5301,U+5303,U+5306-5308,U+530a-530d,U+530f-5311,U+5313,U+5315,U+5318-531f,U+5321,U+5323-5325,U+5327-532d,U+532f-5333,U+5335,U+5338,U+533c-533e,U+5340,U+5342,U+5345-5346,U+5349,U+534b-534c,U+5359,U+535b,U+535e,U+5361,U+5363-5367,U+5369,U+536c-536e,U+5372,U+5377,U+5379-537b,U+537d-537f,U+5382-5383,U+5387-5389,U+538e,U+5393-5394,U+5396,U+5398-5399,U+539d,U+53a0-53a1,U+53a4-53a6,U+53a9-53ab,U+53ad-53b0,U+53b2,U+53b4-53b8,U+53ba,U+53bd,U+53c0-53c1,U+53c3-53c5,U+53cf,U+53d2-53d3,U+53d5,U+53da-53db,U+53dd-53e0,U+53e2,U+53e6-53e8,U+53ed-53ee,U+53f4-53f5,U+53fa,U+5401-5403,U+540b,U+540f,U+5412-5413,U+541a,U+541d-541e,U+5421,U+5424,U+5427-542a,U+542c-542f,U+5431,U+5433-5436,U+543c-543d}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.48.woff2) format("woff2");unicode-range:U+50dd-50df,U+50e1-50e6,U+50e8-50e9,U+50ed-50f6,U+50f9-50fb,U+50fe,U+5101-5103,U+5106-5109,U+510b-510e,U+5110,U+5112,U+5114-511e,U+5121,U+5123,U+5127-5128,U+512c-512d,U+512f,U+5131,U+5133-5135,U+5137-513c,U+513f-5142,U+5147,U+514a,U+514c,U+514f,U+5152-5155,U+5157-5158,U+515f-5160,U+5162,U+5164,U+5166-5167,U+5169-516a,U+516e,U+5173-5174,U+5179,U+517b,U+517e,U+5180,U+5182-5184,U+5189,U+518b-518c,U+518e-5191,U+5193,U+5195-5196,U+5198,U+519d,U+51a1-51a4,U+51a6,U+51a9-51ab,U+51ad,U+51b0-51b3,U+51b5,U+51b8,U+51ba,U+51bc-51bf,U+51c2-51c3,U+51c5,U+51c8-51cb,U+51cf,U+51d1-51d6,U+51d8,U+51de-51e0,U+51e2,U+51e5,U+51e7,U+51e9,U+51ec-51ee,U+51f2-51f5,U+51f7,U+51fe,U+5201-5202,U+5204-5205,U+520b,U+520e,U+5212-5216,U+5218,U+5222,U+5226-5228,U+522a-522b,U+522e,U+5231-5233,U+5235,U+523c,U+5244-5245,U+5249,U+524b-524c,U+524f,U+5254-5255,U+5257-5258,U+525a,U+525c-5261,U+5266,U+5269,U+526c,U+526e,U+5271,U+5273-5274,U+5277-5279,U+527d,U+527f-5280,U+5282-5285,U+5288-528a,U+528c}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.49.woff2) format("woff2");unicode-range:U+4f57-4f58,U+4f5a-4f5b,U+4f5d-4f5f,U+4f63-4f64,U+4f69-4f6a,U+4f6c,U+4f6e-4f71,U+4f76-4f7e,U+4f81-4f85,U+4f88-4f8a,U+4f8c,U+4f8e-4f90,U+4f92-4f94,U+4f96-4f9a,U+4f9e-4fa0,U+4fab,U+4fad,U+4faf,U+4fb2,U+4fb7,U+4fb9,U+4fbb-4fbe,U+4fc0-4fc1,U+4fc4-4fc6,U+4fc8-4fc9,U+4fcb-4fd4,U+4fd8,U+4fda-4fdc,U+4fdf-4fe0,U+4fe2,U+4fe4-4fe6,U+4fef-4ff2,U+4ff6,U+4ffc-5002,U+5004-5007,U+500a,U+500c,U+500e-5011,U+5013-5014,U+5016-5018,U+501a-501e,U+5021-5023,U+5025-502a,U+502c-502e,U+5030,U+5032-5033,U+5035,U+5039,U+503b,U+5040-5043,U+5045-5048,U+504a,U+504c,U+504e,U+5050-5053,U+5055-5057,U+5059-505a,U+505f-5060,U+5062-5063,U+5066-5067,U+506a,U+506c-506d,U+5070-5072,U+5077-5078,U+5080-5081,U+5083-5086,U+5088,U+508a,U+508e-5090,U+5092-5096,U+509a-509c,U+509e-50a3,U+50aa,U+50ad,U+50af-50b4,U+50b9-50bb,U+50bd,U+50c0,U+50c2-50c4,U+50c7,U+50c9-50ca,U+50cc,U+50ce,U+50d0-50d1,U+50d3-50d4,U+50d6,U+50d8-50d9,U+50dc}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.50.woff2) format("woff2");unicode-range:U+4093,U+4103,U+4105,U+4148,U+414f,U+4163,U+41b4,U+41bf,U+41e6,U+41ee,U+41f3,U+4207,U+420e,U+4264,U+4293,U+42c6,U+42d6,U+42dd,U+4302,U+432b,U+4343,U+43ee,U+43f0,U+4408,U+440c,U+4417,U+441c,U+4422,U+4453,U+445b,U+4476,U+447a,U+4491,U+44b3,U+44be,U+44d4,U+4508,U+450d,U+4525,U+4543,U+457a,U+459d,U+45b8,U+45be,U+45e5,U+45ea,U+460f-4610,U+4641,U+4665,U+46a1,U+46ae-46af,U+470c,U+471f,U+4764,U+47e6,U+47fd,U+4816,U+481e,U+4844,U+484e,U+48b5,U+49b0,U+49e7,U+49fa,U+4a04,U+4a29,U+4abc,U+4b38,U+4b3b,U+4b7e,U+4bc2,U+4bca,U+4bd2,U+4be8,U+4c17,U+4c20,U+4c38,U+4cc4,U+4cd1,U+4ce1,U+4d07,U+4d77,U+4e02,U+4e04-4e05,U+4e0c,U+4e0f-4e12,U+4e15,U+4e17,U+4e19,U+4e1e-4e1f,U+4e23-4e24,U+4e28-4e2c,U+4e2e-4e31,U+4e35-4e37,U+4e3f-4e42,U+4e44,U+4e47-4e48,U+4e4d-4e4e,U+4e51,U+4e55-4e56,U+4e58,U+4e5a-4e5c,U+4e62-4e63,U+4e68-4e69,U+4e74-4e75,U+4e79,U+4e7f,U+4e82,U+4e85,U+4e8a,U+4e8d-4e8e,U+4e96-4e99,U+4e9d-4ea0,U+4ea2,U+4ea5-4ea6,U+4ea8,U+4eaf-4eb0,U+4eb3,U+4eb6,U+4eb9,U+4ebb-4ebc,U+4ec2-4ec4,U+4ec6-4ec8,U+4ecd,U+4ed0,U+4ed7,U+4eda-4edb,U+4edd-4ee2,U+4ee8,U+4eeb,U+4eed,U+4eef,U+4ef1,U+4ef3,U+4ef5,U+4ef7,U+4efc-4f00,U+4f02-4f03,U+4f08-4f09,U+4f0b-4f0d,U+4f12,U+4f15-4f17,U+4f19,U+4f1c,U+4f2b,U+4f2e,U+4f30-4f31,U+4f33,U+4f35-4f37,U+4f39,U+4f3b,U+4f3e,U+4f40,U+4f42-4f43,U+4f48-4f49,U+4f4b-4f4c,U+4f52,U+4f54,U+4f56}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.52.woff2) format("woff2");unicode-range:U+32b5-332b,U+332d-3394}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.53.woff2) format("woff2");unicode-range:U+31c8-31e3,U+31f0-321e,U+3220-3230,U+3232-32b4}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.54.woff2) format("woff2");unicode-range:U+3028-303f,U+3094-3096,U+309f-30a0,U+30ee,U+30f7-30fa,U+30ff,U+3105-312f,U+3131-3163,U+3165-318e,U+3190-31bb,U+31c0-31c7}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.55.woff2) format("woff2");unicode-range:U+2f14-2fd5,U+2ff0-2ffb,U+3004,U+3013,U+3016-301b,U+301e,U+3020-3027}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.56.woff2) format("woff2");unicode-range:U+25e4-25e6,U+2601-2603,U+2609,U+260e-260f,U+2616-2617,U+261c-261f,U+262f,U+2641,U+2660,U+2662-2664,U+2666-2668,U+266d-266e,U+2672-267d,U+26bd-26be,U+2702,U+271a,U+273d,U+2740,U+2756,U+2776-2793,U+27a1,U+2934-2935,U+29bf,U+29fa-29fb,U+2b05-2b07,U+2b1a,U+2b95,U+2e3a-2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f13}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.57.woff2) format("woff2");unicode-range:U+24d1-24ff,U+2503-2513,U+2515-2516,U+2518-251b,U+251d-2522,U+2524-259f,U+25a2-25ab,U+25b1,U+25b7,U+25c0-25c1,U+25c9-25ca,U+25cc,U+25d0-25d3,U+25e2-25e3}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.58.woff2) format("woff2");unicode-range:U+2105,U+2109-210a,U+210f,U+2116,U+2121,U+2126-2127,U+212b,U+212e,U+2135,U+213b,U+2194-2199,U+21b8-21b9,U+21c4-21c6,U+21cb-21cc,U+21d0,U+21e6-21e9,U+21f5,U+2202-2203,U+2205-2206,U+2208-220b,U+220f,U+2211,U+2213,U+2215,U+221a,U+221d,U+2220,U+2223,U+2225-2226,U+2228,U+222a-222e,U+2234-2237,U+223d,U+2243,U+2245,U+2248,U+224c,U+2260,U+2262,U+2264-2265,U+226e-226f,U+2272-2273,U+2276-2277,U+2283-2287,U+228a-228b,U+2295-2299,U+22a0,U+22a5,U+22bf,U+22da-22db,U+22ef,U+2305-2307,U+2318,U+2329-232a,U+23b0-23b1,U+23be-23cc,U+23ce,U+23da-23db,U+2423,U+2469-24d0}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.59.woff2) format("woff2");unicode-range:U+a1-a4,U+a6-a7,U+aa,U+ac-ad,U+b5-b6,U+b8-ba,U+bc-c8,U+ca-cc,U+ce-d5,U+d9-db,U+dd-df,U+e6,U+ee,U+f0,U+f5,U+f7,U+f9,U+fb,U+fe-102,U+110-113,U+11a-11b,U+128-12b,U+143-144,U+147-148,U+14c,U+14e-14f,U+152-153,U+168-16d,U+192,U+1a0-1a1,U+1af,U+1cd-1dc,U+1f8-1f9,U+251,U+261,U+2bb,U+2c7,U+2c9,U+2ea-2eb,U+304,U+307,U+30c,U+1e3e-1e3f,U+1ea0-1ebe,U+1ec0-1ec6,U+1ec8-1ef9,U+2011-2012,U+2016,U+2018-201a,U+201e,U+2021,U+2030,U+2033,U+2035,U+2042,U+2047,U+2051,U+2074,U+20a9,U+20ab-20ac,U+20dd-20de,U+2100}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.60.woff2) format("woff2");unicode-range:U+2227,U+26a0,U+2713,U+301f,U+4ff8,U+5239,U+526a,U+54fa,U+5740,U+5937,U+5993,U+59fb,U+5a3c,U+5c41,U+6028,U+626e,U+646f,U+647a,U+64b0,U+64e2,U+65a7,U+66fe,U+6727,U+6955,U+6bef,U+6f23,U+724c,U+767c,U+7a83,U+7ac4,U+7b67,U+8000,U+8471,U+8513,U+8599,U+86db,U+8718,U+87f2,U+88f3,U+8ad2,U+8e2a,U+8fa3,U+95a5,U+9798,U+9910,U+9957,U+9bab,U+9c3b,U+9daf,U+ff95}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.61.woff2) format("woff2");unicode-range:U+a8,U+2032,U+2261,U+2282,U+3090,U+30f1,U+339c,U+535c,U+53d9,U+56a2,U+56c1,U+5806,U+589f,U+59d0,U+5a7f,U+60e0,U+639f,U+65af,U+68fa,U+69ae,U+6d1b,U+6ef2,U+71fb,U+725d,U+7262,U+75bc,U+7768,U+7940,U+79bf,U+7bed,U+7d68,U+7dfb,U+814b,U+8207,U+83e9,U+8494,U+8526,U+8568,U+85ea,U+86d9,U+87ba,U+8861,U+887f,U+8fe6,U+9059,U+9061,U+916a,U+976d,U+97ad,U+9ece}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.62.woff2) format("woff2");unicode-range:U+2d9,U+21d4,U+301d,U+515c,U+52fe,U+5420,U+5750,U+5766,U+5954,U+5b95,U+5f8a,U+5f98,U+620c,U+621f,U+641c,U+66d9,U+676d,U+6775,U+67f5,U+694a,U+6a02,U+6a3a,U+6a80,U+6c23,U+6c72,U+6dcb,U+6faa,U+707c,U+71c8,U+7422,U+74e2,U+7791,U+7825,U+7a14,U+7a1c,U+7c95,U+7fc1,U+82a5,U+82db,U+8304,U+853d,U+8cd3,U+8de8,U+8f0c,U+8f3f,U+9091,U+91c7,U+929a,U+98af,U+9913}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.63.woff2) format("woff2");unicode-range:U+2ca-2cb,U+2229,U+2468,U+2669,U+266f,U+273f,U+4ec0,U+4f60,U+4fb6,U+5347,U+540e,U+543b,U+5b0c,U+5d4c,U+5f14,U+5f9e,U+6155,U+62d0,U+6602,U+6666,U+66f3,U+67a2,U+67ca,U+69cc,U+6d29,U+6d9b,U+6e3e,U+6f81,U+7109,U+73c0,U+73c2,U+7425,U+7435-7436,U+7525,U+7554,U+785d,U+786b,U+7ae3,U+7b94,U+7d18,U+81bf,U+8511,U+8549,U+9075,U+9640,U+98e2,U+9e9f,U+ff96}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.64.woff2) format("woff2");unicode-range:U+2467,U+4ece,U+4ed4,U+4f91,U+4fae,U+534d,U+53c9,U+54b3,U+586b,U+5944,U+5b78,U+5df7,U+5f77,U+6101,U+6167-6168,U+61a4,U+62d9,U+698a,U+699b,U+6a59,U+6cc4,U+6e07,U+7099,U+75d2,U+77ad,U+7953,U+7984,U+7a92,U+7baa,U+7dbb,U+817f,U+82ad,U+85e9,U+868a,U+8caa,U+8f44,U+9017,U+907c,U+908a,U+92f3,U+936e,U+9435,U+978d,U+9838,U+9a28,U+9b41,U+9ba8,U+9c57,U+9eb9}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.65.woff2) format("woff2");unicode-range:U+b1,U+309b,U+4e5e,U+51f1,U+5506,U+55c5,U+58cc,U+59d1,U+5c51,U+5ef7,U+6284,U+62d7,U+6689,U+673d,U+6a2b,U+6a8e,U+6a9c,U+6d63,U+6dd1,U+70b8,U+7235,U+72db,U+72f8,U+7560,U+7c9b,U+7ce7,U+7e1e,U+80af,U+82eb,U+8463,U+8499,U+85dd,U+86ee,U+8a60,U+8a6e,U+8c79,U+8e87,U+8e8a,U+8f5f,U+9010,U+918d,U+9190,U+965b,U+97fb,U+9ab8,U+9bad,U+9d3b,U+9d5c,U+9dfa,U+9e93}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.66.woff2) format("woff2");unicode-range:U+2020,U+3003,U+3231,U+4e9b,U+4f3d,U+4f47,U+51b6,U+51dc,U+53e1,U+5bc5,U+602f,U+60bc,U+61c9,U+633d,U+637b,U+6492,U+65fa,U+660f,U+66f0,U+6703,U+681e,U+6876,U+6893,U+6912,U+698e,U+6c7d,U+714c,U+7169,U+71d5,U+725f,U+72d7,U+745b,U+74dc,U+75e2,U+7891,U+7897,U+7dcb,U+810a,U+8218,U+8339,U+840e,U+852d,U+8823,U+8a0a,U+9089,U+919c,U+971c,U+9ad9,U+ff4a,U+ff5a}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.67.woff2) format("woff2");unicode-range:U+2466,U+2600,U+4eab,U+4fe3,U+4ff5,U+51a5,U+51f0,U+536f,U+53d4,U+53f1,U+54a5,U+559d,U+55e3,U+58fa,U+5962,U+59ea,U+5c16,U+5cef,U+5d16,U+5f10,U+5fd6,U+6190,U+6216,U+634f,U+63bb,U+66d6,U+6756,U+6bc5,U+6e26,U+727d,U+731f,U+76f2,U+7729,U+7a7f,U+7aff,U+7c9f,U+818f,U+8236,U+82b9,U+8338,U+85aa,U+88b4,U+8b33,U+904d,U+93a7,U+96cc,U+96eb,U+9aed,U+9b8e,U+fa11}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.68.woff2) format("woff2");unicode-range:U+251c,U+2523,U+4e14,U+545f,U+54bd,U+553e,U+55dc,U+56da,U+589c,U+5b55,U+5bb5,U+5ce1,U+5df4,U+5eb6,U+5ec9,U+6191,U+62f7,U+6357,U+64a5,U+6591,U+65bc,U+6897,U+6e1a,U+7063,U+711a,U+721b,U+722c,U+75b9,U+75d5,U+75fa,U+7766,U+7aae,U+7b48,U+7b8b,U+7d21,U+7e55,U+7f75,U+842c,U+8910,U+8a63,U+8b39,U+8b5a,U+8cdc,U+8d74,U+907d,U+91e7,U+9306,U+96bc,U+98f4,U+9ac4}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.69.woff2) format("woff2");unicode-range:U+2003,U+2312,U+266c,U+4f86,U+51ea,U+5243,U+5256,U+541f,U+5841,U+59dc,U+5df3,U+601c,U+60e7,U+632b,U+638c,U+64ad,U+6881,U+697c,U+69cd,U+6c50,U+6d2a,U+6fc1,U+7027,U+7058,U+70f9,U+714e,U+7345,U+751a,U+760d,U+764c,U+77db,U+7d79,U+7e8f,U+80ce,U+814e,U+81fc,U+8247,U+8278,U+85a9,U+8a03,U+90ed,U+9784,U+9801,U+984e,U+99b3,U+9bc9,U+9bdb,U+9be8,U+9e78,U+ff6b}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.70.woff2) format("woff2");unicode-range:U+266b,U+3006,U+5176,U+5197,U+51a8,U+51c6,U+52f2,U+5614,U+5875,U+5a2f,U+5b54,U+5ce0,U+5dba,U+5deb,U+5e63,U+5f59,U+5fcc,U+6068,U+6367,U+68b6,U+6a0b,U+6b64,U+6e15,U+6eba,U+7272,U+72a0,U+7947,U+7985,U+79e6,U+79e9,U+7a3d,U+7a9f,U+7aaf,U+7b95,U+7f60,U+7f9e,U+7fe0,U+8098,U+80ba,U+8106,U+82d4,U+831c,U+87f9,U+8a1f,U+8acf,U+90c1,U+920d,U+9756,U+fe43,U+ff94}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.71.woff2) format("woff2");unicode-range:U+af,U+2465,U+2517,U+33a1,U+4f10,U+50c5,U+51b4,U+5384,U+5606,U+5bb0,U+5cac,U+5ee3,U+618e,U+61f2,U+62c9,U+66ab,U+66f9,U+6816,U+6960,U+6b3e,U+6f20,U+7078,U+72d0,U+73ed,U+7ad9,U+7b1b,U+7be4,U+7d62,U+7f51,U+80b4,U+80f4,U+8154,U+85fb,U+865c,U+8702,U+895f,U+8aed,U+8b90,U+8ced,U+8fbf,U+91d8,U+9418,U+9583,U+9591,U+9813,U+982c,U+9bd6,U+ff46,U+ff7f,U+ff88}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.72.woff2) format("woff2");unicode-range:U+4e91,U+508d,U+50e7,U+514e,U+51f6,U+5446,U+5504,U+584a,U+59a8,U+59d3,U+5a46,U+5ac9,U+6020,U+60a6,U+6148,U+621a,U+6234,U+64c1,U+6523,U+675c,U+67d1,U+6953,U+6ccc,U+6df5,U+6e13,U+6f06,U+723a,U+7325,U+74e6,U+758e,U+75ab,U+75d9,U+7a40,U+8096,U+82fa,U+8587,U+8594,U+8a6b,U+8ab9,U+8b17,U+8b83,U+937c,U+963b,U+9673,U+96db,U+9ce9,U+9f4b,U+ff67,U+ff82,U+ff93}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.73.woff2) format("woff2");unicode-range:U+221e,U+2514,U+51f9,U+5270,U+5449,U+5824,U+59a5,U+5a29,U+5d07,U+5e16,U+60e3,U+614c,U+6276,U+643e,U+64ab,U+6562,U+6681,U+670b,U+6734,U+67af,U+6a3d,U+6b05,U+6dc0,U+6e4a,U+7259,U+732a,U+7409,U+78a7,U+7a6b,U+8015,U+809b,U+817a,U+830e,U+837b,U+85ab,U+8a23,U+8a93,U+8b00,U+8b19,U+8b21,U+8cbf,U+8fb0,U+901d,U+91b8,U+9320,U+932c,U+9688,U+96f6,U+9df2,U+ff6a}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.74.woff2) format("woff2");unicode-range:U+2002,U+2025,U+4f8d,U+51e1,U+51f8,U+5507,U+5598,U+58f1,U+5983,U+59ac,U+5c3c,U+5de7,U+5e7d,U+5eca,U+5f61,U+606d,U+60f9,U+636e,U+64ec,U+67da,U+67ff,U+6813,U+68f2,U+693f,U+6b6a,U+6bbb,U+6ef4,U+7092,U+717d,U+7261,U+73c8,U+7432,U+7483,U+76fe,U+7709,U+78d0,U+81a3,U+81b3,U+82af,U+8305,U+8309,U+8870,U+88fe,U+8cd1,U+8d66,U+906e,U+971e,U+9812,U+ff79,U+ff90}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.75.woff2) format("woff2");unicode-range:U+2464,U+2501,U+2640,U+2642,U+339d,U+4f0e,U+5091,U+50b5,U+5132,U+51cc,U+558b,U+55aa,U+585e,U+5bee,U+5dfe,U+60b6,U+62b9,U+6349,U+6566,U+6590,U+6842,U+689d,U+6a58,U+6c70,U+6ff1,U+7815,U+7881,U+7aaa,U+7bc7,U+7def,U+7fa8,U+8017,U+8036,U+8061,U+821f,U+8429,U+8ce0,U+8e74,U+9019,U+90ca,U+9162,U+932f,U+93ae,U+9644,U+990c,U+9cf3,U+ff56,U+ff6e,U+ff7e,U+ff85}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.76.woff2) format("woff2");unicode-range:U+2266-2267,U+4f2f,U+5208,U+5451,U+546a,U+5589,U+576a,U+5815,U+5a9a,U+5b9b,U+5c3a,U+5efb,U+5faa,U+6109,U+6643,U+6652,U+695a,U+69fd,U+6b86,U+6bb4,U+6daf,U+7089,U+70cf,U+7a00,U+7a4f,U+7b39,U+7d33,U+80e1,U+828b,U+82a6,U+86cd,U+8c8c,U+8cca,U+8df3,U+9077,U+9175,U+91dc,U+925b,U+9262,U+9271,U+92ed,U+9855,U+9905,U+9d28,U+ff3f,U+ff58,U+ff68,U+ff6d,U+ff9c}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.77.woff2) format("woff2");unicode-range:U+2207,U+25ef,U+309c,U+4e4f,U+5146,U+51dd,U+5351,U+540a,U+5629,U+5eb5,U+5f04,U+5f13,U+60dc,U+6212,U+63b4,U+642c,U+6627,U+66a6,U+66c7,U+66fd,U+674e,U+6b96,U+6c4e,U+6df3,U+6e67,U+6f84,U+72fc,U+733f,U+7c97,U+7db1,U+7e4d,U+816b,U+82d1,U+84cb,U+854e,U+8607,U+86c7,U+871c,U+8776,U+8a89,U+8fc4,U+91a4,U+9285,U+9685,U+9903,U+9b31,U+9f13,U+ff42,U+ff74,U+ff91}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.78.woff2) format("woff2");unicode-range:U+4e32,U+51db,U+53a8,U+53ea,U+5609,U+5674,U+5a92,U+5e7e,U+6115,U+611a,U+62cc,U+62ed,U+63c9,U+64b9,U+64e6,U+65cb,U+6606,U+6731,U+683d,U+6afb,U+7460,U+771e,U+78ef,U+7b26,U+7b51,U+7cde,U+7d10,U+7d2f,U+7d46,U+80de,U+819c,U+84b2,U+85cd,U+865a,U+8ecc,U+9022,U+90b8,U+9192,U+9675,U+96b7,U+99ff,U+ff44,U+ff55,U+ff6c,U+ff73,U+ff75,U+ff86,U+ff8d,U+ff92,U+ffe3}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.79.woff2) format("woff2");unicode-range:U+25b3,U+30f5,U+4eae,U+4f46,U+4f51,U+5203,U+52ff,U+55a7,U+564c,U+565b,U+57f9,U+5805,U+5b64,U+5e06,U+5f70,U+5f90,U+60e8,U+6182,U+62f3,U+62fe,U+63aa,U+64a4,U+65d7,U+673a,U+6851,U+68cb,U+68df,U+6d1e,U+6e58,U+6e9d,U+77b3,U+7832,U+7c3f,U+7db4,U+7f70,U+80aa,U+80c6,U+8105,U+819d,U+8276,U+8679,U+8986,U+8c9d,U+8fc5,U+916c,U+9665,U+9699,U+96c0,U+9a19,U+ff8b}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.80.woff2) format("woff2");unicode-range:U+2463,U+25a1,U+4ef0,U+5076,U+5098,U+51fd,U+5302,U+5448,U+54c9,U+570b,U+583a,U+5893,U+58a8,U+58ee,U+5949,U+5bdb,U+5f26,U+5f81,U+6052,U+6170,U+61c7,U+631f,U+635c,U+664b,U+69fb,U+6f01,U+7070,U+722a,U+745e,U+755c,U+76c6,U+78c1,U+79e4,U+7bb8,U+7d0b,U+81a8,U+82d7,U+8b5c,U+8f14,U+8fb1,U+8fbb,U+9283,U+9298,U+9a30,U+ff03,U+ff50,U+ff59,U+ff7b,U+ff8e-ff8f}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.81.woff2) format("woff2");unicode-range:U+2010,U+2502,U+25b6,U+4f3a,U+514b,U+5265,U+52c3,U+5339,U+53ec,U+54c0,U+55b0,U+5854,U+5b8f,U+5cb3,U+5e84,U+60da,U+6247,U+6249,U+628a,U+62cd,U+65ac,U+6838,U+690e,U+6cf0,U+6f02,U+6f2c,U+6f70,U+708a,U+7434,U+75be,U+77ef,U+7c60,U+7c98,U+7d1b,U+7e2b,U+80a5,U+81e3,U+820c,U+8210,U+8475,U+862d,U+8650,U+8997,U+906d,U+91c8,U+9700,U+9727,U+9df9,U+ff3a,U+ff9a}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.82.woff2) format("woff2");unicode-range:U+2103,U+5049,U+52b1,U+5320,U+5553,U+572d,U+58c7,U+5b5d,U+5bc2,U+5de3,U+5e61,U+5f80,U+61a9,U+67d0,U+67f4,U+6c88,U+6ca1,U+6ce5,U+6d78,U+6e9c,U+6f54,U+731b,U+73b2,U+74a7,U+74f6,U+75e9,U+7b20,U+7c8b,U+7f72,U+809d,U+8108,U+82b3,U+82bd,U+84b8,U+84c4,U+88c2,U+8ae6,U+8ef8,U+902e,U+9065,U+9326,U+935b,U+938c,U+9676,U+9694,U+96f7,U+9ed9,U+ff48,U+ff4c,U+ff81}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.83.woff2) format("woff2");unicode-range:U+2500,U+3008-3009,U+4ead,U+4f0f,U+4fca,U+53eb,U+543e,U+57a2,U+5cf0,U+5e8f,U+5fe0,U+61b2,U+62d8,U+6442,U+64b2,U+6589,U+659c,U+67f1,U+68c4,U+6cb8,U+6d12,U+6de1,U+6fe1,U+70c8,U+723d,U+73e0,U+7656,U+773a,U+7948,U+7b87,U+7c92,U+7d3a,U+7e1b,U+7e4a,U+819a,U+8358,U+83c5,U+84bc,U+864e,U+8912,U+8c9e,U+8d05,U+92fc,U+9396,U+98fd,U+99d2,U+ff64,U+ff7a,U+ff83}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.84.woff2) format("woff2");unicode-range:U+3014-3015,U+4e3c,U+5036,U+5075,U+533f,U+53e9,U+5531,U+5642,U+5984,U+59e6,U+5a01,U+5b6b,U+5c0b,U+5f25,U+6069,U+60a0,U+614e,U+62b5,U+62d2-62d3,U+6597,U+660c,U+674f,U+67cf,U+6841,U+6905,U+6cf3,U+6d32,U+6d69,U+6f64,U+716e,U+7761,U+7b52,U+7be0,U+7dbf,U+7de9,U+7f36,U+81d3,U+8302,U+8389,U+846c,U+84ee,U+8a69,U+9038,U+9d8f,U+ff47,U+ff4b,U+ff76,U+ff9b}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.85.woff2) format("woff2");unicode-range:U+25c7,U+3007,U+504f,U+507d,U+51a0,U+52a3,U+5410,U+5510,U+559a,U+5782,U+582a,U+5c0a,U+5c3f,U+5c48,U+5f6b,U+6176,U+622f,U+6279,U+62bd,U+62dd,U+65ed,U+67b6,U+6817,U+6850,U+6d6a,U+6deb,U+6ea2,U+6edd,U+6f5c,U+72e9,U+73a9,U+7573,U+76bf,U+7950,U+7956,U+7f8a,U+7ffc,U+80a2,U+80c3,U+83ca,U+8a02,U+8a13,U+8df5,U+9375,U+983b,U+99b4,U+ff4e,U+ff71,U+ff89,U+ff97}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.86.woff2) format("woff2");unicode-range:U+24,U+2022,U+2212,U+221f,U+2665,U+4ecf,U+5100,U+51cd,U+52d8,U+5378,U+53f6,U+574a,U+5982,U+5996,U+5c1a,U+5e1d,U+5f84,U+609f,U+61a7,U+61f8,U+6398,U+63ee,U+6676,U+6691,U+6eb6,U+7126,U+71e5,U+7687,U+7965,U+7d17,U+80a1,U+8107,U+8266,U+85a6,U+8987,U+8ca2,U+8cab,U+8e0a,U+9042,U+95c7,U+9810,U+9867,U+98fc,U+ff52-ff54,U+ff61,U+ff77,U+ff98-ff99}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.87.woff2) format("woff2");unicode-range:U+b0,U+226a,U+2462,U+4e39,U+4fc3,U+4fd7,U+50be,U+50da,U+5200,U+5211,U+54f2,U+5618,U+596a,U+5b22,U+5bb4,U+5d50,U+60a3,U+63fa,U+658e,U+65e8,U+6669,U+6795,U+679d,U+67a0,U+6b3a,U+6e09,U+757f,U+7cd6,U+7dbe,U+7ffb,U+83cc,U+83f1,U+840c,U+845b,U+8846,U+8972,U+8a34,U+8a50,U+8a87,U+8edf,U+8ff0,U+90a6,U+9154,U+95a3,U+9663,U+9686,U+96c7,U+ff3c,U+ff7c,U+ff8a}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.88.woff2) format("woff2");unicode-range:U+25bd,U+4e59,U+4ec1,U+4ff3,U+515a,U+518a,U+525b,U+5375,U+552f,U+57a3,U+5b9c,U+5c3d,U+5e3d,U+5e7b,U+5f0a,U+6094,U+6458,U+654f,U+67f3,U+6b8a,U+6bd2,U+6c37,U+6ce1,U+6e56,U+6e7f,U+6ed1,U+6ede,U+6f0f,U+70ad,U+7267,U+7363,U+786c,U+7a42,U+7db2,U+7f85,U+8178,U+829d,U+8896,U+8c5a,U+8cb0,U+8ce2,U+8ed2,U+9047,U+9177,U+970a,U+9ea6,U+ff1b,U+ff31,U+ff39,U+ff80}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.89.woff2) format("woff2");unicode-range:U+a5,U+4e80,U+4f34,U+4f73,U+4f75,U+511f,U+5192,U+52aa,U+53c8,U+570f,U+57cb,U+596e,U+5d8b,U+5f66,U+5fd9,U+62db,U+62f6,U+6328,U+633f,U+63a7,U+6469,U+6bbf,U+6c41,U+6c57,U+6d44,U+6dbc,U+706f,U+72c2,U+72ed,U+7551,U+75f4,U+7949,U+7e26,U+7fd4,U+8150,U+8af8,U+8b0e,U+8b72,U+8ca7,U+934b,U+9a0e,U+9a12,U+9b42,U+ff41,U+ff43,U+ff45,U+ff49,U+ff4f,U+ff62-ff63}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.90.woff2) format("woff2");unicode-range:U+4e18,U+4fb5,U+5104,U+52c7,U+5353,U+5374,U+53e5,U+587e,U+594f,U+5a20,U+5de1,U+5f18,U+5fcd,U+6291,U+62ab,U+6355,U+6392,U+63da,U+63e1,U+656c,U+6687,U+68b0-68b1,U+68d2,U+68da,U+6b27,U+6cbc,U+7159,U+7344,U+73cd,U+76df,U+790e,U+7cf8,U+8102,U+88c1,U+8aa0,U+8e0f,U+9178,U+92ad,U+9670,U+96c5,U+9cf4,U+9db4,U+ff3e,U+ff6f,U+ff72,U+ff78,U+ff7d,U+ff84,U+ff8c}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.91.woff2) format("woff2");unicode-range:U+60,U+2200,U+226b,U+2461,U+517c,U+526f,U+5800,U+5b97,U+5bf8,U+5c01,U+5d29,U+5e4c,U+5e81,U+6065,U+61d0,U+667a,U+6696,U+6843,U+6c99,U+6d99,U+6ec5,U+6f22,U+6f6e,U+6fa4,U+6fef,U+71c3,U+72d9,U+7384,U+78e8,U+7a1a,U+7a32,U+7a3c,U+7adc,U+7ca7,U+7d2b,U+7dad,U+7e4b,U+80a9,U+8170,U+81ed,U+820e,U+8a17,U+8afe,U+90aa,U+914e,U+963f,U+99c4,U+9eba,U+9f3b,U+ff38}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.92.woff2) format("woff2");unicode-range:U+2460,U+4e5f,U+4e7e,U+4ed9,U+501f,U+502b,U+5968,U+5974,U+5ac1,U+5b99,U+5ba3,U+5be7,U+5be9,U+5c64,U+5cb8,U+5ec3,U+5f1f,U+616e,U+6297,U+62e0,U+62ec,U+6368,U+642d,U+65e6,U+6717,U+676f,U+6b04,U+732e,U+7652,U+76ca,U+76d7,U+7802,U+7e70,U+7f6a,U+8133,U+81e8,U+866b,U+878d,U+88f8,U+8a5e,U+8cdb,U+8d08,U+907a,U+90e1,U+96f2,U+9f8d,U+ff35,U+ff37,U+ff40,U+ff9d}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.93.woff2) format("woff2");unicode-range:U+21d2,U+25ce,U+300a-300b,U+4e89,U+4e9c,U+4ea1,U+5263,U+53cc,U+5426,U+5869,U+5947,U+598a,U+5999,U+5e55,U+5e72,U+5e79,U+5fae,U+5fb9,U+602a,U+6163,U+624d,U+6749,U+6c5a,U+6cbf,U+6d45,U+6dfb,U+6e7e,U+708e,U+725b,U+7763,U+79c0,U+7bc4,U+7c89,U+7e01,U+7e2e,U+8010,U+8033,U+8c6a,U+8cc3,U+8f1d,U+8f9b,U+8fb2,U+907f,U+90f7,U+9707,U+9818,U+9b3c,U+ff0a,U+ff4d}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.94.woff2) format("woff2");unicode-range:U+2015,U+2190,U+4e43,U+5019,U+5247,U+52e7,U+5438,U+54b2,U+55ab,U+57f7,U+5bd2,U+5e8a,U+5ef6,U+6016,U+60b2,U+6162,U+6319,U+6551,U+6607,U+66b4,U+675f,U+67d4,U+6b20,U+6b53,U+6ce3,U+719f,U+75b2,U+770b,U+7720,U+77ac,U+79d2,U+7af9,U+7d05,U+7dca,U+8056,U+80f8,U+81f3,U+8352,U+885d,U+8a70,U+8aa4,U+8cbc,U+900f,U+9084,U+91e3,U+9451,U+96c4,U+99c6,U+9ad4,U+ff70}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.95.woff2) format("woff2");unicode-range:U+2193,U+25b2,U+4e4b,U+516d,U+51c4,U+529f,U+52c9,U+5360,U+5442,U+5857,U+5915,U+59eb,U+5a9b,U+5c3b,U+6012,U+61b6,U+62b1,U+6311,U+6577,U+65e2,U+65ec,U+6613,U+6790,U+6cb9,U+7372,U+76ae,U+7d5e,U+7fcc,U+88ab,U+88d5,U+8caf,U+8ddd,U+8ecd,U+8f38,U+8f9e,U+8feb,U+9063,U+90f5,U+93e1,U+968a,U+968f,U+98fe,U+9ec4,U+ff1d,U+ff27,U+ff2a,U+ff36,U+ff3b,U+ff3d,U+ffe5}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.96.woff2) format("woff2");unicode-range:U+4e03,U+4f38,U+50b7,U+5264,U+5348,U+5371,U+585a,U+58ca,U+5951,U+59b9,U+59d4,U+5b98,U+5f8b,U+6388,U+64cd,U+65e7,U+6803,U+6b6f,U+6d66,U+6e0b,U+6ecb,U+6fc3,U+72ac,U+773c,U+77e2,U+7968,U+7a74,U+7dba,U+7dd1,U+7e3e,U+808c,U+811a,U+8179,U+8239,U+8584,U+8a0e,U+8a72,U+8b66,U+8c46,U+8f29,U+90a3,U+9234,U+96f0,U+9769,U+9774,U+9aa8,U+ff26,U+ff28,U+ff9e-ff9f}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.97.woff2) format("woff2");unicode-range:U+7e,U+b4,U+25c6,U+2661,U+4e92,U+4eee,U+4ffa,U+5144,U+5237,U+5287,U+52b4,U+58c1,U+5bff,U+5c04,U+5c06,U+5e95,U+5f31,U+5f93,U+63c3,U+640d,U+6557,U+6614,U+662f,U+67d3,U+690d,U+6bba,U+6e6f,U+72af,U+732b,U+7518,U+7ae0,U+7ae5,U+7af6,U+822a,U+89e6,U+8a3a,U+8a98,U+8cb8,U+8de1,U+8e8d,U+95d8,U+961c,U+96a3,U+96ea,U+9bae,U+ff20,U+ff22,U+ff29,U+ff2b-ff2c}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.98.woff2) format("woff2");unicode-range:U+25cb,U+4e71,U+4f59,U+50d5,U+520a,U+5217,U+5230,U+523a-523b,U+541b,U+5439,U+5747,U+59c9,U+5bdf,U+5c31,U+5de8,U+5e7c,U+5f69,U+6050,U+60d1,U+63cf,U+663c,U+67c4,U+6885,U+6c38,U+6d6e,U+6db2,U+6df7,U+6e2c,U+6f5f,U+7532,U+76e3-76e4,U+7701,U+793c,U+79f0,U+7a93,U+7d00,U+7de0,U+7e54,U+8328,U+8840,U+969c,U+96e8,U+9811,U+9aea,U+9b5a,U+ff24,U+ff2e,U+ff57}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.99.woff2) format("woff2");unicode-range:U+2191,U+505c,U+52e4,U+5305,U+535a,U+56e0,U+59bb,U+5acc,U+5b09,U+5b87,U+5c90,U+5df1,U+5e2d,U+5e33,U+5f3e,U+6298,U+6383,U+653b,U+6697,U+6804,U+6a39,U+6cca,U+6e90,U+6f2b,U+702c,U+7206,U+7236,U+7559,U+7565,U+7591,U+75c7,U+75db,U+7b4b,U+7bb1,U+7d99,U+7fbd,U+8131,U+885b,U+8b1d,U+8ff7,U+9003,U+9045,U+96a0,U+9732,U+990a,U+99d0,U+9e97,U+9f62,U+ff25,U+ff2d}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.100.woff2) format("woff2");unicode-range:U+4e08,U+4f9d,U+5012,U+514d,U+51b7,U+5275,U+53ca,U+53f8,U+5584,U+57fc,U+5b9d,U+5bfa,U+5c3e,U+5f01,U+5fb4,U+5fd7,U+606f,U+62e1,U+6563,U+6674,U+6cb3,U+6d3e,U+6d74,U+6e1b,U+6e2f,U+718a,U+7247,U+79d8,U+7d14,U+7d66,U+7d71,U+7df4,U+7e41,U+80cc,U+8155,U+83d3,U+8a95,U+8ab2,U+8ad6,U+8ca1,U+9000,U+9006,U+9678,U+97d3,U+9808,U+98ef,U+9a5a,U+9b45,U+ff23,U+ff30}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.101.woff2) format("woff2");unicode-range:U+25bc,U+3012,U+4ef2,U+4f0a,U+516b,U+5373,U+539a,U+53b3,U+559c,U+56f0,U+5727,U+5742,U+5965,U+59ff,U+5bc6,U+5dfb,U+5e45,U+5ead,U+5fb3,U+6211,U+6253,U+639b,U+63a8,U+6545,U+6575,U+6628,U+672d,U+68a8,U+6bdb,U+6d25,U+707d,U+767e,U+7834,U+7b46,U+7bc9,U+8074,U+82e6,U+8349,U+8a2a,U+8d70,U+8da3,U+8fce,U+91cc,U+967d,U+97ff,U+9996,U+ff1c,U+ff2f,U+ff32,U+ff34}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.102.woff2) format("woff2");unicode-range:U+3d,U+5e,U+25cf,U+4e0e,U+4e5d,U+4e73,U+4e94,U+4f3c,U+5009,U+5145,U+51ac,U+5238,U+524a,U+53f3,U+547c,U+5802,U+5922,U+5a66,U+5c0e,U+5de6,U+5fd8,U+5feb,U+6797,U+685c,U+6b7b,U+6c5f-6c60,U+6cc9,U+6ce2,U+6d17,U+6e21,U+7167,U+7642,U+76db,U+8001,U+821e,U+8857,U+89d2,U+8b1b,U+8b70,U+8cb4,U+8cde,U+8f03,U+8f2a,U+968e,U+9b54,U+9e7f,U+9ebb,U+ff05,U+ff33}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.103.woff2) format("woff2");unicode-range:U+500d,U+5074,U+50cd,U+5175,U+52e2,U+5352,U+5354,U+53f2,U+5409,U+56fa,U+5a18,U+5b88,U+5bdd,U+5ca9,U+5f92,U+5fa9,U+60a9,U+623f,U+6483,U+653f,U+666f,U+66ae,U+66f2,U+6a21,U+6b66,U+6bcd,U+6d5c,U+796d,U+7a4d,U+7aef,U+7b56,U+7b97,U+7c4d,U+7e04,U+7fa9,U+8377,U+83dc,U+83ef,U+8535,U+8863,U+88cf,U+88dc,U+8907,U+8acb,U+90ce,U+91dd,U+ff0b,U+ff0d,U+ff19,U+ff65}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.104.woff2) format("woff2");unicode-range:U+4e01,U+4e21,U+4e38,U+52a9,U+547d,U+592e,U+5931,U+5b63,U+5c40,U+5dde,U+5e78,U+5efa,U+5fa1,U+604b,U+6075,U+62c5,U+632f,U+6a19,U+6c0f,U+6c11,U+6c96,U+6e05,U+70ba,U+71b1,U+7387,U+7403,U+75c5,U+77ed,U+795d,U+7b54,U+7cbe,U+7d19,U+7fa4,U+8089,U+81f4,U+8208,U+8336,U+8457,U+8a33,U+8c4a,U+8ca0,U+8ca8,U+8cc0,U+9014,U+964d,U+9803,U+983c,U+98db,U+ff17,U+ff21}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.105.woff2) format("woff2");unicode-range:U+25,U+25a0,U+4e26,U+4f4e,U+5341,U+56f2,U+5bbf,U+5c45,U+5c55,U+5c5e,U+5dee,U+5e9c,U+5f7c,U+6255,U+627f,U+62bc,U+65cf,U+661f,U+666e,U+66dc,U+67fb,U+6975,U+6a4b,U+6b32,U+6df1,U+6e29,U+6fc0,U+738b,U+7686,U+7a76,U+7a81,U+7c73,U+7d75,U+7dd2,U+82e5,U+82f1,U+85ac,U+888b,U+899a,U+8a31,U+8a8c,U+8ab0,U+8b58,U+904a,U+9060,U+9280,U+95b2,U+984d,U+9ce5,U+ff18}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.106.woff2) format("woff2");unicode-range:U+30f6,U+50ac,U+5178,U+51e6,U+5224,U+52dd,U+5883,U+5897,U+590f,U+5a5a,U+5bb3,U+5c65,U+5e03,U+5e2b,U+5e30,U+5eb7,U+6271,U+63f4,U+64ae,U+6574,U+672b,U+679a,U+6a29-6a2a,U+6ca2,U+6cc1,U+6d0b,U+713c,U+74b0,U+7981,U+7a0b,U+7bc0,U+7d1a,U+7d61,U+7fd2,U+822c,U+8996,U+89aa,U+8cac,U+8cbb,U+8d77,U+8def,U+9020,U+9152,U+9244,U+9662,U+967a,U+96e3,U+9759,U+ff16}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.107.woff2) format("woff2");unicode-range:U+23,U+3c,U+2192,U+4e45,U+4efb,U+4f50,U+4f8b,U+4fc2,U+5024,U+5150,U+5272,U+5370,U+53bb,U+542b,U+56db,U+56e3,U+57ce,U+5bc4,U+5bcc,U+5f71,U+60aa,U+6238,U+6280,U+629c,U+6539,U+66ff,U+670d,U+677e-677f,U+6839,U+69cb,U+6b4c,U+6bb5,U+6e96,U+6f14,U+72ec,U+7389,U+7814,U+79cb,U+79d1,U+79fb,U+7a0e,U+7d0d,U+85e4,U+8d64,U+9632,U+96e2,U+9805,U+99ac,U+ff1e}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.108.woff2) format("woff2");unicode-range:U+2605-2606,U+301c,U+4e57,U+4fee,U+5065,U+52df,U+533b,U+5357,U+57df,U+58eb,U+58f0,U+591c,U+592a-592b,U+5948,U+5b85,U+5d0e,U+5ea7,U+5ff5,U+6025,U+63a1,U+63a5,U+63db,U+643a,U+65bd,U+671d,U+68ee,U+6982,U+6b73,U+6bd4,U+6d88,U+7570,U+7b11,U+7d76,U+8077,U+8217,U+8c37,U+8c61,U+8cc7,U+8d85,U+901f,U+962a,U+9802,U+9806,U+9854,U+98f2,U+9928,U+99c5,U+9ed2}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.109.woff2) format("woff2");unicode-range:U+266a,U+4f11,U+533a,U+5343,U+534a,U+53cd,U+5404,U+56f3,U+5b57-5b58,U+5bae,U+5c4a,U+5e0c,U+5e2f,U+5eab,U+5f35,U+5f79,U+614b,U+6226,U+629e,U+65c5,U+6625,U+6751,U+6821,U+6b69,U+6b8b,U+6bce,U+6c42,U+706b,U+7c21,U+7cfb,U+805e,U+80b2,U+82b8,U+843d,U+8853,U+88c5,U+8a3c,U+8a66,U+8d8a,U+8fba,U+9069,U+91cf,U+9752,U+975e,U+9999,U+ff0f-ff10,U+ff14-ff15}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.110.woff2) format("woff2");unicode-range:U+40,U+4e86,U+4e95,U+4f01,U+4f1d,U+4fbf,U+5099,U+5171,U+5177,U+53cb,U+53ce,U+53f0,U+5668,U+5712,U+5ba4,U+5ca1,U+5f85,U+60f3,U+653e,U+65ad,U+65e9,U+6620,U+6750,U+6761,U+6b62,U+6b74,U+6e08,U+6e80,U+7248,U+7531,U+7533,U+753a,U+77f3,U+798f,U+7f6e,U+8449,U+88fd,U+89b3,U+8a55,U+8ac7,U+8b77,U+8db3,U+8efd,U+8fd4,U+9031-9032,U+9580,U+9589,U+96d1,U+985e}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.111.woff2) format("woff2");unicode-range:U+2b,U+d7,U+300e-300f,U+4e07,U+4e8c,U+512a,U+5149,U+518d,U+5236,U+52b9,U+52d9,U+5468,U+578b,U+57fa,U+5b8c,U+5ba2,U+5c02,U+5de5,U+5f37,U+5f62,U+623b,U+63d0,U+652f,U+672a,U+6848,U+6d41,U+7136,U+7537,U+754c,U+76f4,U+79c1,U+7ba1,U+7d44,U+7d4c,U+7dcf,U+7dda,U+7de8,U+82b1,U+897f,U+8ca9,U+8cfc,U+904e,U+9664,U+982d,U+9858,U+98a8,U+9a13,U+ff13,U+ff5c}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.112.woff2) format("woff2");unicode-range:U+4e16,U+4e3b,U+4ea4,U+4ee4,U+4f4d,U+4f4f,U+4f55,U+4f9b,U+5317,U+5358,U+53c2,U+53e4,U+548c,U+571f,U+59cb,U+5cf6,U+5e38,U+63a2,U+63b2,U+6559,U+662d,U+679c,U+6c7a,U+72b6,U+7523,U+767d,U+770c,U+7a2e,U+7a3f,U+7a7a,U+7b2c,U+7b49,U+7d20,U+7d42,U+8003,U+8272,U+8a08,U+8aac,U+8cb7,U+8eab,U+8ee2,U+9054-9055,U+90fd,U+914d,U+91cd,U+969b,U+97f3,U+984c,U+ff06}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.113.woff2) format("woff2");unicode-range:U+26,U+5f,U+2026,U+203b,U+4e09,U+4eac,U+4ed5,U+4fa1,U+5143,U+5199,U+5207,U+539f,U+53e3,U+53f7,U+5411,U+5473,U+5546,U+55b6,U+5929,U+597d,U+5bb9,U+5c11,U+5c4b,U+5ddd,U+5f97,U+5fc5,U+6295,U+6301,U+6307,U+671b,U+76f8,U+78ba,U+795e,U+7d30,U+7d39,U+7d9a,U+89e3,U+8a00,U+8a73,U+8a8d,U+8a9e,U+8aad,U+8abf,U+8cea,U+8eca,U+8ffd,U+904b,U+9650,U+ff11-ff12}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.114.woff2) format("woff2");unicode-range:U+3e,U+3005,U+4e0d,U+4e88,U+4ecb,U+4ee3,U+4ef6,U+4fdd,U+4fe1,U+500b,U+50cf,U+5186,U+5316,U+53d7,U+540c,U+544a,U+54e1,U+5728,U+58f2,U+5973,U+5b89,U+5c71,U+5e02,U+5e97,U+5f15,U+5fc3,U+5fdc,U+601d,U+611b,U+611f,U+671f,U+6728,U+6765,U+683c,U+6b21,U+6ce8,U+6d3b,U+6d77,U+7530,U+7740,U+7acb,U+7d50,U+826f,U+8f09,U+8fbc,U+9001,U+9053,U+91ce,U+9762,U+98df}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.115.woff2) format("woff2");unicode-range:U+7c,U+3080,U+4ee5,U+5148,U+516c,U+521d,U+5225,U+529b,U+52a0,U+53ef,U+56de,U+56fd,U+5909,U+591a,U+5b66,U+5b9f,U+5bb6,U+5bfe,U+5e73,U+5e83,U+5ea6,U+5f53,U+6027,U+610f,U+6210,U+6240,U+660e,U+66f4,U+66f8,U+6709,U+6771,U+697d,U+69d8,U+6a5f,U+6c34,U+6cbb,U+73fe,U+756a,U+7684,U+771f,U+793a,U+7f8e,U+898f,U+8a2d,U+8a71,U+8fd1,U+9078,U+9577,U+96fb,U+ff5e}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.116.woff2) format("woff2");unicode-range:U+a9,U+3010-3011,U+30e2,U+4e0b,U+4eca,U+4ed6,U+4ed8,U+4f53,U+4f5c,U+4f7f,U+53d6,U+540d,U+54c1,U+5730,U+5916,U+5b50,U+5c0f,U+5f8c,U+624b,U+6570,U+6587,U+6599,U+691c,U+696d,U+6cd5,U+7269,U+7279,U+7406,U+767a-767b,U+77e5,U+7d04,U+7d22,U+8005,U+80fd,U+81ea,U+8868,U+8981,U+89a7,U+901a,U+9023,U+90e8,U+91d1,U+9332,U+958b,U+96c6,U+9ad8,U+ff1a,U+ff1f}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.117.woff2) format("woff2");unicode-range:U+4e,U+a0,U+3000,U+300c-300d,U+4e00,U+4e0a,U+4e2d,U+4e8b,U+4eba,U+4f1a,U+5165,U+5168,U+5185,U+51fa,U+5206,U+5229,U+524d,U+52d5,U+5408,U+554f,U+5831,U+5834,U+5927,U+5b9a,U+5e74,U+5f0f,U+60c5,U+65b0,U+65b9,U+6642,U+6700,U+672c,U+682a,U+6b63,U+6c17,U+7121,U+751f,U+7528,U+753b,U+76ee,U+793e,U+884c,U+898b,U+8a18,U+9593,U+95a2,U+ff01,U+ff08-ff09}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.118.woff2) format("woff2");unicode-range:U+21-22,U+27-2a,U+2c-3b,U+3f,U+41-4d,U+4f-5d,U+61-7b,U+7d,U+ab,U+ae,U+b2-b3,U+b7,U+bb,U+c9,U+cd,U+d6,U+d8,U+dc,U+e0-e5,U+e7-ed,U+ef,U+f1-f4,U+f6,U+f8,U+fa,U+fc-fd,U+103,U+14d,U+1b0,U+300-301,U+1ebf,U+1ec7,U+2013-2014,U+201c-201d,U+2039-203a,U+203c,U+2048-2049,U+2113,U+2122,U+65e5,U+6708,U+70b9}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWDzrkC76y6xQwhKyPOzVM3THyvqCUY2X5AHDM.119.woff2) format("woff2");unicode-range:U+20,U+2027,U+3001-3002,U+3041-307f,U+3081-308f,U+3091-3093,U+3099-309a,U+309d-309e,U+30a1-30e1,U+30e3-30ed,U+30ef-30f0,U+30f2-30f4,U+30fb-30fe,U+ff0c,U+ff0e}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWMxL4g7eau9x0.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWFxL4g7eau9x0.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWNxL4g7eau9x0.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWCxL4g7eau9x0.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWDxL4g7eau9x0.woff2) format("woff2");unicode-range:U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWOxL4g7eau9x0.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWPxL4g7eau9x0.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"M PLUS Rounded 1c";font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/mplusrounded1c/v18/VdGEAYIAV6gnpUpoWwNkYvrugw9RuMWBxL4g7eau.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Quicksand;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/quicksand/v36/6xK-dSZaM9iE8KbpRA_LJ3z8mH9BOJvgkP8o58m-wjwxUD2GF9Zc.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Quicksand;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/quicksand/v36/6xK-dSZaM9iE8KbpRA_LJ3z8mH9BOJvgkP8o58i-wjwxUD2GF9Zc.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Quicksand;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/quicksand/v36/6xK-dSZaM9iE8KbpRA_LJ3z8mH9BOJvgkP8o58a-wjwxUD2GFw.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Sniglet;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sniglet/v17/cIf9MaFLtkE3UjaJ9CChYUsEkIpdQQ.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Sniglet;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sniglet/v17/cIf9MaFLtkE3UjaJ9C6hYUsEkIo.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Urbanist;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/urbanist/v17/L0xjDF02iFML4hGCyOCpRdycFsGxSrqDyx4vH5mqacG1Koy1cIU.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Urbanist;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/urbanist/v17/L0xjDF02iFML4hGCyOCpRdycFsGxSrqDyx4vEZmqacG1Koy1.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--chromatic-hue: 220.44;--chromatic-chroma: calc(.18 + cos(var(--chromatic-hue) * 3.14159265 / 180)/25) ;--chromatic-chroma-50: calc(var(--chromatic-chroma) * .3);--chromatic-chroma-100: calc(var(--chromatic-chroma) * .5);--chromatic-chroma-200: calc(var(--chromatic-chroma) * .6);--chromatic-chroma-300: calc(var(--chromatic-chroma) * .75);--chromatic-chroma-400: calc(var(--chromatic-chroma) * .85);--chromatic-chroma-500: var(--chromatic-chroma);--chromatic-chroma-600: calc(var(--chromatic-chroma) * 1.15);--chromatic-chroma-700: calc(var(--chromatic-chroma) * 1.1);--chromatic-chroma-800: calc(var(--chromatic-chroma) * .85);--chromatic-chroma-900: calc(var(--chromatic-chroma) * .7);--chromatic-chroma-950: calc(var(--chromatic-chroma) * .5)}.i-eos-icons\:three-dots-loading,[i-eos-icons\:three-dots-loading=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='18' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.67' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.33' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='6' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='0' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:alibabacloud{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M14.752 4.64h5.274C22.242 4.64 24 6.475 24 8.691V15.8a3.947 3.947 0 01-3.974 3.975h-5.274l1.299-1.835 3.822-1.222c.688-.23 1.146-.918 1.146-1.605v-5.81c0-.687-.458-1.375-1.146-1.605L16.05 6.475l-1.3-1.835zM2.98 15.111c0 .688.46 1.376 1.147 1.606l3.822 1.146 1.3 1.835H3.974A3.947 3.947 0 010 15.723V8.69c0-2.216 1.758-4.05 3.975-4.05h5.273L7.95 6.474 4.127 7.697c-.688.23-1.146.918-1.146 1.606v5.808z'/%3E%3Cpath d='M16.051 11.213H8.025v1.835h8.026v-1.835z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:anthropic{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:cloudflare{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cg%3E%3Cpath d='M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437'/%3E%3Cpath d='M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:deepseek{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:featherless-ai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='1em' height='1em' %3E%3Cg fill='currentColor'%3E%3Cpath d='M40.0866 4.68482C38.2902 3.5825 35.863 3 33.0672 3C28.7842 3 24.0653 4.35865 19.8276 6.72206L19.7979 6.71083C19.7979 6.71083 19.7937 6.73344 19.7914 6.74423C18.5086 7.4617 17.2656 8.2629 16.0981 9.15731C9.22112 14.4248 7.29519 20.6748 8.92004 24.0156C7.14142 27.0728 6.0457 30.2332 6 33.9767C9.41949 27.421 11.4719 22.108 22.6146 13.1637C19.4309 13.8501 13.9281 17.1057 10.2271 22.0459C9.87793 19.156 12.1477 14.4895 17.2033 10.6174C17.8435 10.127 18.5092 9.66864 19.1886 9.23374C18.6577 10.8934 18.8269 10.4806 17.7254 12.8076C19.3543 11.2566 20.4268 10.2995 22.035 7.64145C24.123 6.60964 26.2948 5.83844 28.4482 5.37235C28.0919 6.56071 27.4137 8.57466 26.4955 10.1669C26.4955 10.1669 28.8258 9.66435 30.7518 9.77788C29.6995 10.9459 28.7527 12.2094 27.7926 13.5012C26.4777 15.2696 25.1184 17.0983 23.3778 18.8005C23.1683 19.0054 22.968 19.1912 22.7649 19.383C20.0902 19.1254 18.3235 20.1315 16.6683 21.9089C17.9737 21.2966 19.7273 20.7924 20.8266 21.0959C18.8008 22.7579 15.6106 24.9488 12.9893 24.7684C12.4922 25.5295 12.4608 25.5528 11.9144 26.4722C16.1664 27.537 21.507 23.1905 24.6498 20.1161C26.4926 18.3131 27.8964 16.4257 29.2534 14.6012C32.0481 10.8427 34.4616 7.5974 39.8153 6.3624L42 5.85877L40.0866 4.68482Z' class='logo-mark'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:fireworks{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:gemini{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M12 24A14.304 14.304 0 000 12 14.304 14.304 0 0012 0a14.305 14.305 0 0012 12 14.305 14.305 0 00-12 12'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:huggingface{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:microsoft{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M11.49 2H2v9.492h9.492V2h-.002z'/%3E%3Cpath d='M22 2h-9.492v9.492H22V2z'/%3E%3Cpath d='M11.49 12.508H2V22h9.492v-9.492h-.002z'/%3E%3Cpath d='M22 12.508h-9.492V22H22v-9.492z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:mistral{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:moonshot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:novita{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath clip-rule='evenodd' d='M9.167 4.17v5.665L0 19.003h9.167v-5.666l5.666 5.666H24L9.167 4.17z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:ollama{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:openai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:openrouter{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:perplexity{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:together{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cg%3E%3Cpath d='M17.385 11.23a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23zm0 10.77a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23zm-10.77 0a4.615 4.615 0 100-9.23 4.615 4.615 0 000 9.23z' opacity='.2'/%3E%3Ccircle cx='6.615' cy='6.615' r='4.615'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:vllm{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M0 4.973h9.324V23L0 4.973z'/%3E%3Cpath d='M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:volcengine{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M7.29 5.36L3.148 21.737a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.359a.214.214 0 00-.41 0z' fill-opacity='.5'/%3E%3Cpath clip-rule='evenodd' d='M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z'/%3E%3Cpath d='M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.214.214 0 00.215-.261L14.44.151z' fill-opacity='.5'/%3E%3Cpath clip-rule='evenodd' d='M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z'/%3E%3Cpath d='M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 0 00-.409 0z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:xai{--un-icon:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cg fill='currentColor' fill-rule='evenodd'%3E%3Cpath d='M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:ghost,[i-lucide\:ghost=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 10h.01M15 10h.01M12 2a8 8 0 0 0-8 8v12l3-3l2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:mic,[i-lucide\:mic=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2m7 9v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:music,[i-lucide\:music=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-simple-icons\:discord{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M20.317 4.37a19.8 19.8 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.3 18.3 0 0 0-5.487 0a13 13 0 0 0-.617-1.25a.08.08 0 0 0-.079-.037A19.7 19.7 0 0 0 3.677 4.37a.1.1 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.08.08 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.08.08 0 0 0 .084-.028a14 14 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13 13 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10 10 0 0 0 .372-.292a.07.07 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.07.07 0 0 1 .078.01q.181.149.373.292a.077.077 0 0 1-.006.127a12.3 12.3 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.08.08 0 0 0 .084.028a19.8 19.8 0 0 0 6.002-3.03a.08.08 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.03M8.02 15.33c-1.182 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418m7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-simple-icons\:elevenlabs{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4.604 0v24h4.931V0zm9.86 0v24h4.933V0z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-simple-icons\:x{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584l-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:add-circle-line-duotone,[i-solar\:add-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12h-3m0 0H9m3 0V9m0 3v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:add-square-line-duotone,[i-solar\:add-square-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12h-3m0 0H9m3 0V9m0 3v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:alt-arrow-down-bold-duotone,[i-solar\:alt-arrow-down-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m8.303 12.404l3.327 3.431c.213.22.527.22.74 0l6.43-6.63C19.201 8.79 18.958 8 18.43 8h-5.723z'/%3E%3Cpath fill='currentColor' d='M11.293 8H5.57c-.528 0-.771.79-.37 1.205l2.406 2.481z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:alt-arrow-left-line-duotone,[i-solar\:alt-arrow-left-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m15 5l-6 7l6 7'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:armchair-2-bold-duotone,[i-solar\:armchair-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.533 18H6.75v2a.75.75 0 1 1-1.5 0v-2.324c-.829-.362-1.49-1.005-1.808-1.817l-.039-.102L2.1 12.264C1.685 11.15 2.613 10 3.927 10c.81 0 1.534.453 1.81 1.134l1.098 2.706c.1.246.15.37.222.47a1.2 1.2 0 0 0 .74.463c.13.027.277.027.57.027h6.98c.569 0 .853 0 1.091-.098q.196-.082.349-.219c.184-.166.281-.405.475-.883l1.001-2.466c.276-.68 1-1.134 1.81-1.134c1.314 0 2.242 1.15 1.827 2.264l-1.12 3c-.195.524-.292.785-.421 1.008a3.43 3.43 0 0 1-1.609 1.404V20a.75.75 0 1 1-1.5 0v-2.005c-.187.005-.415.005-.717.005'/%3E%3Cpath fill='currentColor' d='M13.236 3.5h-2.472c-1.1 0-1.976 0-2.66.088c-.706.09-1.285.28-1.746.72c-.464.441-.669 1.003-.765 1.685c-.093.658-.093 1.495-.093 2.54v2.195q.147.186.237.406l1.098 2.706c.1.246.15.37.222.47a1.2 1.2 0 0 0 .74.463c.13.027.277.027.57.027h6.98c.569 0 .853 0 1.091-.098q.196-.082.349-.219c.184-.166.281-.405.475-.883l1.001-2.466q.09-.221.237-.406V8.533c0-1.045 0-1.882-.093-2.54c-.096-.682-.301-1.244-.765-1.686c-.46-.438-1.04-.629-1.745-.72c-.685-.087-1.56-.087-2.661-.087' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:arrow-right-line-duotone,[i-solar\:arrow-right-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Cpath fill='currentColor' d='M4 11.25a.75.75 0 0 0 0 1.5zm0 1.5h16v-1.5H4z' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m14 6l6 6l-6 6'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:book-bookmark-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 20.028V18H8v2.028c0 .277 0 .416.095.472s.224-.006.484-.13l1.242-.593c.088-.042.132-.063.179-.063s.091.02.179.063l1.242.593c.26.124.39.186.484.13c.095-.056.095-.195.095-.472' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8 18h-.574c-1.084 0-1.462.006-1.753.068c-.513.11-.96.347-1.285.667c-.11.108-.164.161-.291.505s-.107.489-.066.78l.022.15c.11.653.31.998.616 1.244c.307.246.737.407 1.55.494c.837.09 1.946.092 3.536.092h4.43c1.59 0 2.7-.001 3.536-.092c.813-.087 1.243-.248 1.55-.494s.506-.591.616-1.243c.091-.548.11-1.241.113-2.171h-8v2.028c0 .277 0 .416-.095.472s-.224-.006-.484-.13l-1.242-.593c-.088-.042-.132-.063-.179-.063s-.091.02-.179.063l-1.242.593c-.26.124-.39.186-.484.13C8 20.444 8 20.305 8 20.028z'/%3E%3Cpath fill='currentColor' d='M4.727 2.733c.306-.308.734-.508 1.544-.618C7.105 2.002 8.209 2 9.793 2h4.414c1.584 0 2.688.002 3.522.115c.81.11 1.238.31 1.544.618c.305.308.504.74.613 1.557c.112.84.114 1.955.114 3.552V18H7.426c-1.084 0-1.462.006-1.753.068c-.513.11-.96.347-1.285.667c-.11.108-.164.161-.291.505A1.3 1.3 0 0 0 4 19.7V7.842c0-1.597.002-2.711.114-3.552c.109-.816.308-1.249.613-1.557' opacity='.5'/%3E%3Cpath fill='currentColor' d='M7.25 7A.75.75 0 0 1 8 6.25h8a.75.75 0 0 1 0 1.5H8A.75.75 0 0 1 7.25 7M8 9.75a.75.75 0 0 0 0 1.5h5a.75.75 0 0 0 0-1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:bookmark-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M21 11.098v4.993c0 3.096 0 4.645-.734 5.321c-.35.323-.792.526-1.263.58c-.987.113-2.14-.907-4.445-2.946c-1.02-.901-1.529-1.352-2.118-1.47a2.2 2.2 0 0 0-.88 0c-.59.118-1.099.569-2.118 1.47c-2.305 2.039-3.458 3.059-4.445 2.945a2.24 2.24 0 0 1-1.263-.579C3 20.736 3 19.188 3 16.091v-4.994C3 6.81 3 4.666 4.318 3.333S7.758 2 12 2s6.364 0 7.682 1.332S21 6.81 21 11.098' opacity='.5'/%3E%3Cpath fill='currentColor' d='M9 5.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:box-minimalistic-bold-duotone,[i-solar\:box-minimalistic-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M8.422 20.618C10.178 21.54 11.056 22 12 22V12L2.638 7.073l-.04.067C2 8.154 2 9.417 2 11.942v.117c0 2.524 0 3.787.597 4.801c.598 1.015 1.674 1.58 3.825 2.709z'/%3E%3Cpath fill='currentColor' d='m17.577 4.432l-2-1.05C13.822 2.461 12.944 2 12 2c-.945 0-1.822.46-3.578 1.382l-2 1.05C4.318 5.536 3.242 6.1 2.638 7.072L12 12l9.362-4.927c-.606-.973-1.68-1.537-3.785-2.641' opacity='.7'/%3E%3Cpath fill='currentColor' d='m21.403 7.14l-.041-.067L12 12v10c.944 0 1.822-.46 3.578-1.382l2-1.05c2.151-1.129 3.227-1.693 3.825-2.708c.597-1.014.597-2.277.597-4.8v-.117c0-2.525 0-3.788-.597-4.802' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:bug-bold-duotone,[i-solar\:bug-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M19 11.938V15a7 7 0 0 1-6.25 6.96V15a.75.75 0 0 0-1.5 0v6.96A7 7 0 0 1 5 15v-3.062A3.94 3.94 0 0 1 8.938 8h6.124A3.94 3.94 0 0 1 19 11.938' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M19 14.75v-1.5h3a.75.75 0 0 1 0 1.5zm-1.504 4.586c.31-.393.58-.82.801-1.276l2.538 1.27a.75.75 0 1 1-.67 1.34zM5.703 18.06q.333.684.801 1.276l-2.669 1.335a.75.75 0 0 1-.67-1.342zM5 13.25H2a.75.75 0 0 0 0 1.5h3zm12.354-4.515l2.81-1.406a.75.75 0 1 1 .671 1.341L18.42 9.88a4 4 0 0 0-1.065-1.144M6.647 8.735c-.427.306-.79.695-1.067 1.144L3.165 8.67a.75.75 0 0 1 .67-1.341zM16.5 8.27V7.5a4.5 4.5 0 1 0-9 0v.77A3.9 3.9 0 0 1 8.938 8h6.124c.508 0 .993.096 1.438.27'/%3E%3Cpath fill='currentColor' d='M6.376 1.584a.75.75 0 0 0 .208 1.04l2.36 1.573a4.5 4.5 0 0 1 1.387-.877L7.416 1.376a.75.75 0 0 0-1.04.208m8.68 2.613a4.5 4.5 0 0 0-1.387-.877l2.915-1.944a.75.75 0 1 1 .832 1.248z' opacity='.5'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 14.25a.75.75 0 0 1 .75.75v7h-1.5v-7a.75.75 0 0 1 .75-.75' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:card-search-broken,[i-solar\:card-search-broken=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' d='M14 4c3.771 0 5.657 0 6.828 1.172S22 8.229 22 12v1M10 4C6.229 4 4.343 4 3.172 5.172S2 8.229 2 12s0 5.657 1.172 6.828S6.229 20 10 20h3m-3-4H6'/%3E%3Ccircle cx='18' cy='17' r='3'/%3E%3Cpath stroke-linecap='round' d='m20.5 19.5l1 1M2 10h5m15 0H11'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:chat-round-line-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12c0 1.6.376 3.112 1.043 4.453c.178.356.237.763.134 1.148l-.595 2.226a1.3 1.3 0 0 0 1.591 1.592l2.226-.596a1.63 1.63 0 0 1 1.149.133A9.96 9.96 0 0 0 12 22' opacity='.5'/%3E%3Cpath fill='currentColor' d='M7.825 12.85a.825.825 0 0 0 0 1.65h6.05a.825.825 0 0 0 0-1.65zm0-3.85a.825.825 0 0 0 0 1.65h8.8a.825.825 0 0 0 0-1.65z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:chat-square-like-bold-duotone,[i-solar\:chat-square-like-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m13.629 20.472l-.542.916c-.483.816-1.69.816-2.174 0l-.542-.916c-.42-.71-.63-1.066-.968-1.262c-.338-.197-.763-.204-1.613-.219c-1.256-.021-2.043-.098-2.703-.372a5 5 0 0 1-2.706-2.706C2 14.995 2 13.83 2 11.5v-1c0-3.273 0-4.91.737-6.112a5 5 0 0 1 1.65-1.651C5.59 2 7.228 2 10.5 2h3c3.273 0 4.91 0 6.113.737a5 5 0 0 1 1.65 1.65C22 5.59 22 7.228 22 10.5v1c0 2.33 0 3.495-.38 4.413a5 5 0 0 1-2.707 2.706c-.66.274-1.447.35-2.703.372c-.85.015-1.275.022-1.613.219c-.338.196-.548.551-.968 1.262' opacity='.5'/%3E%3Cpath fill='currentColor' d='M10.99 14.308c-1.327-.978-3.49-2.84-3.49-4.593c0-2.677 2.475-3.677 4.5-1.609c2.025-2.068 4.5-1.068 4.5 1.609c0 1.752-2.163 3.615-3.49 4.593c-.454.335-.681.502-1.01.502s-.556-.167-1.01-.502'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:check-circle-bold-duotone,[i-solar\:check-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M16.03 8.97a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 1 1 1.06-1.06l1.47 1.47l2.235-2.235L14.97 8.97a.75.75 0 0 1 1.06 0'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:check-circle-line-duotone,[i-solar\:check-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m8.5 12.5l2 2l5-5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:close-circle-line-duotone,[i-solar\:close-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='m14.5 9.5l-5 5m0-5l5 5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:code-bold-duotone,[i-solar\:code-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.443 7.328a.75.75 0 0 1 1.059-.056l1.737 1.564c.737.663 1.347 1.212 1.767 1.71c.44.525.754 1.088.754 1.784c0 .695-.313 1.258-.754 1.782c-.42.499-1.03 1.049-1.767 1.711l-1.737 1.564a.75.75 0 1 1-1.004-1.115l1.697-1.527c.788-.709 1.319-1.19 1.663-1.598c.33-.393.402-.622.402-.817c0-.196-.072-.425-.402-.818c-.344-.409-.875-.889-1.663-1.598l-1.697-1.527a.75.75 0 0 1-.056-1.06m-8.94 1.06a.75.75 0 0 0-1.004-1.115L4.761 8.836c-.737.663-1.347 1.212-1.767 1.71c-.44.525-.754 1.088-.754 1.784c0 .695.313 1.258.754 1.782c.42.499 1.03 1.049 1.767 1.711l1.737 1.564a.75.75 0 1 0 1.004-1.115l-1.697-1.527c-.788-.709-1.319-1.19-1.663-1.598c-.33-.393-.402-.622-.402-.817c0-.196.072-.425.402-.818c.344-.409.875-.889 1.663-1.598z'/%3E%3Cpath fill='currentColor' d='M14.182 4.276a.75.75 0 0 1 .53.918l-3.974 14.83a.75.75 0 1 1-1.449-.389l3.974-14.83a.75.75 0 0 1 .919-.53' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:danger-triangle-bold-duotone,[i-solar\:danger-triangle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 3c-2.31 0-3.77 2.587-6.688 7.762l-.364.644c-2.425 4.3-3.638 6.45-2.542 8.022S6.214 21 11.636 21h.728c5.422 0 8.134 0 9.23-1.572s-.117-3.722-2.542-8.022l-.364-.645C15.77 5.587 14.311 3 12 3' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12 7.25a.75.75 0 0 1 .75.75v5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M12 17a1 1 0 1 0 0-2a1 1 0 0 0 0 2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:dialog-2-bold-duotone,[i-solar\:dialog-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m10.404 22.48l.275-.465c.44-.745.66-1.117 1.012-1.325c.351-.207.81-.222 1.725-.252c.859-.027 1.436-.102 1.93-.306a4.24 4.24 0 0 0 2.295-2.296c.323-.779.323-1.767.323-3.743v-.848c0-2.777 0-4.165-.625-5.185c-.35-.57-.83-1.05-1.4-1.4c-1.02-.625-2.408-.625-5.185-.625H8.21c-2.777 0-4.165 0-5.185.625c-.57.35-1.05.83-1.4 1.4C1 9.08 1 10.468 1 13.245v.848c0 1.976 0 2.964.323 3.744a4.24 4.24 0 0 0 2.295 2.295c.494.204 1.07.28 1.93.306c.916.03 1.374.045 1.725.252c.35.208.571.58 1.012 1.325l.275.465c.41.692 1.434.692 1.844 0m2.789-7.963a1.06 1.06 0 1 0 0-2.12a1.06 1.06 0 0 0 0 2.12m-2.65-1.06a1.06 1.06 0 1 1-2.121 0a1.06 1.06 0 0 1 2.12 0m-4.772 1.06a1.06 1.06 0 1 0 0-2.12a1.06 1.06 0 0 0 0 2.12' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M15.486 1c1.267 0 2.274 0 3.082.077c.829.079 1.53.244 2.153.626a4.8 4.8 0 0 1 1.575 1.575c.383.624.548 1.325.627 2.153c.076.808.076 1.816.076 3.082v.866c0 .901 0 1.619-.04 2.2c-.04.595-.125 1.106-.323 1.584a4.77 4.77 0 0 1-2.67 2.617q-.21.082-.368.135h-1.65c.016-.499.016-1.093.016-1.822v-.848c0-2.777 0-4.165-.625-5.185c-.35-.57-.83-1.05-1.4-1.4c-1.02-.625-2.408-.625-5.185-.625H8.21c-.986 0-1.796 0-2.478.028v-1.65q.05-.17.13-.396q.133-.389.346-.739a4.8 4.8 0 0 1 1.576-1.575c.624-.382 1.324-.547 2.153-.626C10.745 1 11.752 1 13.019 1z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:document-text-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M3 10c0-3.771 0-5.657 1.172-6.828S7.229 2 11 2h2c3.771 0 5.657 0 6.828 1.172S21 6.229 21 10v4c0 3.771 0 5.657-1.172 6.828S16.771 22 13 22h-2c-3.771 0-5.657 0-6.828-1.172S3 17.771 3 14z'/%3E%3Cpath stroke-linecap='round' d='M8 12h8M8 8h8m-8 8h5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:emoji-funny-square-bold-duotone,[i-solar\:emoji-funny-square-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M6.504 21.52c1.633.943 3.706.387 7.853-.724s6.22-1.666 7.163-3.3s.387-3.706-.724-7.853s-1.666-6.22-3.3-7.163s-3.706-.388-7.853.724c-4.147 1.11-6.22 1.666-7.163 3.3s-.388 3.706.724 7.853c1.11 4.147 1.666 6.22 3.3 7.163' opacity='.5'/%3E%3Cpath fill='currentColor' d='M14.898 11.224c.533-.143.792-.908.578-1.708s-.821-1.333-1.355-1.19c-.533.143-.792.907-.577 1.708c.214.8.82 1.333 1.354 1.19m-5.796 1.553c.534-.143.792-.908.578-1.708s-.82-1.333-1.354-1.19s-.792.907-.578 1.708s.82 1.333 1.354 1.19m-.917 2.974a.75.75 0 0 1 .91-.545c1.13.283 2.428.287 3.746-.066c1.318-.354 2.44-1.006 3.278-1.816a.75.75 0 1 1 1.043 1.078a8.4 8.4 0 0 1-1.15.928l.159.322a1.5 1.5 0 1 1-2.693 1.322l-.196-.4l-.053.014c-1.555.417-3.112.42-4.499.073a.75.75 0 0 1-.545-.91'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:eye-closed-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.919 6.605a1 1 0 0 0-1.838.79l.002.003l.003.007l.01.021l.032.072q.04.09.12.25c.105.21.262.506.47.857c.41.687 1.027 1.6 1.872 2.52l-.797.797a1 1 0 1 0 1.414 1.414l.84-.84c.565.455 1.197.885 1.897 1.256l-.782 1.202a1 1 0 0 0 1.676 1.091l.985-1.514c.677.208 1.402.355 2.177.425V16.5a1 1 0 0 0 1 1V13c-2.748 0-4.819-1.199-6.304-2.59l-.024-.022a12 12 0 0 1-.564-.569a13.4 13.4 0 0 1-1.67-2.237a12 12 0 0 1-.516-.968zm-1.838.79L2 7c-.92.394-.919.395-.919.395' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M15.22 12.398A8.7 8.7 0 0 1 12 13v4.5a1 1 0 0 0 1-1v-1.544c.772-.07 1.497-.217 2.176-.425l.986 1.515a1 1 0 0 0 1.676-1.091l-.782-1.203c.701-.37 1.332-.8 1.897-1.256l.84.84a1 1 0 1 0 1.414-1.414l-.797-.798a15.4 15.4 0 0 0 2.302-3.296a10 10 0 0 0 .19-.395l.011-.026l.004-.008l.002-.005a1 1 0 1 0-1.838-.788l-.005.011a5 5 0 0 1-.146.302a13 13 0 0 1-2.614 3.48c-.841.79-1.87 1.517-3.095 2' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:face-scan-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.801 2.57a.71.71 0 0 1-.555.838a8.78 8.78 0 0 0-6.838 6.838a.71.71 0 1 1-1.394-.283a10.2 10.2 0 0 1 7.949-7.949a.71.71 0 0 1 .838.556M2.57 13.199a.71.71 0 0 1 .838.555a8.78 8.78 0 0 0 6.838 6.838a.71.71 0 1 1-.283 1.394a10.2 10.2 0 0 1-7.948-7.949a.71.71 0 0 1 .555-.838M13.199 2.57a.71.71 0 0 1 .838-.556a10.2 10.2 0 0 1 7.949 7.949a.711.711 0 0 1-1.394.283a8.78 8.78 0 0 0-6.838-6.838a.71.71 0 0 1-.555-.838m8.231 10.629a.71.71 0 0 1 .556.838a10.2 10.2 0 0 1-7.949 7.949a.711.711 0 0 1-.283-1.394a8.78 8.78 0 0 0 6.838-6.838a.71.71 0 0 1 .838-.555' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M12 19.583a7.583 7.583 0 1 0 0-15.166a7.583 7.583 0 0 0 0 15.166' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.94 14.539a.71.71 0 0 1 .995-.148c.59.437 1.3.69 2.065.69a3.45 3.45 0 0 0 2.065-.69a.71.71 0 1 1 .847 1.142a4.87 4.87 0 0 1-2.912.97a4.87 4.87 0 0 1-2.911-.97a.71.71 0 0 1-.148-.994m5.547-2.895c.458 0 .83-.557.83-1.244s-.372-1.244-.83-1.244s-.83.557-.83 1.244s.372 1.244.83 1.244m-4.976 0c.458 0 .83-.557.83-1.244s-.372-1.244-.83-1.244s-.83.557-.83 1.244s.372 1.244.83 1.244'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:filters-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M18 8A6 6 0 1 1 6 8a6 6 0 0 1 12 0'/%3E%3Cpath fill='currentColor' d='M13.58 13.79a6 6 0 0 1-7.16-3.58a6 6 0 1 0 7.16 3.58' opacity='.7'/%3E%3Cpath fill='currentColor' d='M13.58 13.79c.271.684.42 1.43.42 2.21a6 6 0 0 1-2 4.472a6 6 0 1 0 5.58-10.262a6.01 6.01 0 0 1-4 3.58' opacity='.4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:ghost-bold-duotone,[i-solar\:ghost-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 19.206V12c0-5.523-4.477-10-10-10S2 6.477 2 12v7.206a1.727 1.727 0 0 0 2.5 1.544a2.89 2.89 0 0 1 2.896.18a2.89 2.89 0 0 0 3.208 0l.353-.234a1.88 1.88 0 0 1 2.086 0l.353.235a2.89 2.89 0 0 0 3.208 0a2.89 2.89 0 0 1 2.897-.18A1.727 1.727 0 0 0 22 19.206' opacity='.5'/%3E%3Cpath fill='currentColor' d='M15 12c.552 0 1-.672 1-1.5S15.552 9 15 9s-1 .672-1 1.5s.448 1.5 1 1.5m-5-1.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S8.448 9 9 9s1 .672 1 1.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:info-circle-line-duotone,[i-solar\:info-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='12' cy='12' r='10' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='M12 17v-6'/%3E%3Ccircle cx='1' cy='1' r='1' fill='currentColor' transform='matrix(1 0 0 -1 11 9)'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:layers-bold-duotone,[i-solar\:layers-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4.979 9.685C2.993 8.891 2 8.494 2 8s.993-.89 2.979-1.685l2.808-1.123C9.773 4.397 10.767 4 12 4s2.227.397 4.213 1.192l2.808 1.123C21.007 7.109 22 7.506 22 8s-.993.89-2.979 1.685l-2.808 1.124C14.227 11.603 13.233 12 12 12s-2.227-.397-4.213-1.191z'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 8c0 .494.993.89 2.979 1.685l2.808 1.124C9.773 11.603 10.767 12 12 12s2.227-.397 4.213-1.191l2.808-1.124C21.007 8.891 22 8.494 22 8s-.993-.89-2.979-1.685l-2.808-1.123C14.227 4.397 13.233 4 12 4s-2.227.397-4.213 1.192L4.98 6.315C2.993 7.109 2 7.506 2 8' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m5.766 10l-.787.315C2.993 11.109 2 11.507 2 12s.993.89 2.979 1.685l2.808 1.124C9.773 15.603 10.767 16 12 16s2.227-.397 4.213-1.191l2.808-1.124C21.007 12.891 22 12.493 22 12s-.993-.89-2.979-1.685L18.234 10l-2.021.809C14.227 11.603 13.233 12 12 12s-2.227-.397-4.213-1.191z' opacity='.7'/%3E%3Cpath fill='currentColor' d='m5.766 14l-.787.315C2.993 15.109 2 15.507 2 16s.993.89 2.979 1.685l2.808 1.124C9.773 19.603 10.767 20 12 20s2.227-.397 4.213-1.192l2.808-1.123C21.007 16.891 22 16.494 22 16c0-.493-.993-.89-2.979-1.685L18.234 14l-2.021.809C14.227 15.603 13.233 16 12 16s-2.227-.397-4.213-1.191z' opacity='.4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:leaf-bold-duotone,[i-solar\:leaf-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 22c-4.418 0-8-3.646-8-8.143c0-4.462 2.553-9.67 6.537-11.531A3.45 3.45 0 0 1 12 2z' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M13.463 2.326A3.45 3.45 0 0 0 12 2v7l4.432-4.432c-.863-.947-1.86-1.724-2.97-2.242' opacity='.3'/%3E%3Cpath fill='currentColor' d='M12 9v5.5l6.614-6.614c-.572-1.22-1.308-2.357-2.182-3.318z' opacity='.4'/%3E%3Cpath fill='currentColor' d='m12 19.5l7.811-7.811a15 15 0 0 0-1.197-3.803L12 14.5z' opacity='.6'/%3E%3Cpath fill='currentColor' d='M19.811 11.689L12 19.5V22c4.418 0 8-3.646 8-8.143c0-.71-.064-1.438-.189-2.168' opacity='.7'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:magic-stick-2-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16.714 2.127c-.836-.43-1.922.263-4.095 1.65l-.562.36c-.618.394-.927.591-1.273.648c-.347.056-.692-.034-1.382-.215l-.628-.164C6.345 3.769 5.13 3.45 4.436 4.13s-.412 1.908.157 4.363l.147.635c.161.697.242 1.046.177 1.393c-.066.346-.27.65-.68 1.26l-.372.555c-1.439 2.145-2.158 3.217-1.753 4.067c.406.85 1.668.915 4.192 1.045l.654.033c.717.037 1.076.056 1.382.213c.306.158.524.436.962.994l.398.507c1.539 1.962 2.309 2.943 3.255 2.788c.945-.154 1.441-1.342 2.433-3.717l.257-.614c.282-.675.422-1.012.677-1.261c.255-.25.595-.382 1.274-.647l.618-.24c2.39-.933 3.586-1.4 3.765-2.345s-.777-1.744-2.688-3.342l-.495-.413c-.543-.454-.815-.68-.963-.992s-.158-.672-.175-1.393l-.016-.657c-.062-2.538-.093-3.806-.928-4.236'/%3E%3Cpath fill='currentColor' d='M15.93 16.991c.127-.268.239-.45.392-.6c.172-.167.382-.282.71-.42l4.498 4.499a.75.75 0 0 1-1.06 1.06z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:magic-stick-3-bold-duotone,[i-solar\:magic-stick-3-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3.845 3.845a2.883 2.883 0 0 0 0 4.077L5.432 9.51c.012-.014.555.503.568.49l4-4c.013-.013-.504-.556-.49-.568L7.922 3.845a2.883 2.883 0 0 0-4.077 0m1.288 11.462a.483.483 0 0 1 .9 0l.157.4a.48.48 0 0 0 .272.273l.398.157a.486.486 0 0 1 0 .903l-.398.158a.48.48 0 0 0-.272.273l-.157.4a.483.483 0 0 1-.9 0l-.157-.4a.48.48 0 0 0-.272-.273l-.398-.158a.486.486 0 0 1 0-.903l.398-.157a.48.48 0 0 0 .272-.274z' opacity='.5'/%3E%3Cpath fill='currentColor' d='M19.967 9.13a.483.483 0 0 1 .9 0l.156.399c.05.125.148.224.273.273l.398.158a.486.486 0 0 1 0 .902l-.398.158a.5.5 0 0 0-.273.273l-.156.4a.483.483 0 0 1-.9 0l-.157-.4a.5.5 0 0 0-.272-.273l-.398-.158a.486.486 0 0 1 0-.902l.398-.158a.5.5 0 0 0 .272-.273z' opacity='.2'/%3E%3Cpath fill='currentColor' d='M16.1 2.307a.483.483 0 0 1 .9 0l.43 1.095a.48.48 0 0 0 .272.274l1.091.432a.486.486 0 0 1 0 .903l-1.09.432a.5.5 0 0 0-.273.273L17 6.81a.483.483 0 0 1-.9 0l-.43-1.095a.5.5 0 0 0-.273-.273l-1.09-.432a.486.486 0 0 1 0-.903l1.09-.432a.5.5 0 0 0 .273-.274z' opacity='.7'/%3E%3Cpath fill='currentColor' d='M10.568 6.49c-.012.014-.555-.503-.568-.49l-4 4c-.013.013.504.556.49.568l9.588 9.587a2.883 2.883 0 1 0 4.078-4.077z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:magnifer-line-duotone,[i-solar\:magnifer-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cdefs%3E%3Cmask id='solarMagniferLineDuotone0'%3E%3Cg fill='none' stroke-width='1.5'%3E%3Ccircle cx='11.5' cy='11.5' r='9.5' stroke='gray'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' d='M18.5 18.5L22 22'/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Cpath fill='currentColor' d='M0 0h24v24H0z' mask='url(%23solarMagniferLineDuotone0)'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:microphone-2-bold-duotone,[i-solar\:microphone-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M4 9a.75.75 0 0 1 .75.75v1a7.25 7.25 0 1 0 14.5 0v-1a.75.75 0 0 1 1.5 0v1a8.75 8.75 0 0 1-8 8.718v2.282a.75.75 0 0 1-1.5 0v-2.282a8.75 8.75 0 0 1-8-8.718v-1A.75.75 0 0 1 4 9' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M9.75 7.75A.75.75 0 0 0 9 7H6.298a5.751 5.751 0 0 1 11.404 0H13.5a.75.75 0 0 0 0 1.5h4.25V10H13.5a.75.75 0 0 0 0 1.5h4.201a5.751 5.751 0 0 1-11.403 0H9A.75.75 0 0 0 9 10H6.25V8.5H9a.75.75 0 0 0 .75-.75' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12.75 10.75c0 .414.336.75.75.75h4.201l.049-1.5H13.5a.75.75 0 0 0-.75.75m0-3c0 .414.336.75.75.75h4.25L17.701 7H13.5a.75.75 0 0 0-.75.75m-3 0A.75.75 0 0 0 9 7H6.298L6.25 8.5H9a.75.75 0 0 0 .75-.75m0 3A.75.75 0 0 0 9 10H6.25l.048 1.5H9a.75.75 0 0 0 .75-.75'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:microphone-3-bold-duotone,[i-solar\:microphone-3-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M4 9a.75.75 0 0 1 .75.75v1a7.25 7.25 0 1 0 14.5 0v-1a.75.75 0 0 1 1.5 0v1a8.75 8.75 0 0 1-8 8.718v2.282a.75.75 0 0 1-1.5 0v-2.282a8.75 8.75 0 0 1-8-8.718v-1A.75.75 0 0 1 4 9' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 2a5.75 5.75 0 0 0-5.75 5.75v3a5.75 5.75 0 0 0 11.5 0v-3A5.75 5.75 0 0 0 12 2m2 9.5a.75.75 0 0 0 0-1.5h-4a.75.75 0 0 0 0 1.5zm-.25-3.75a.75.75 0 0 1-.75.75h-2A.75.75 0 0 1 11 7h2a.75.75 0 0 1 .75.75' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M14 11.5a.75.75 0 0 0 0-1.5h-4a.75.75 0 0 0 0 1.5zm-1-3A.75.75 0 0 0 13 7h-2a.75.75 0 0 0 0 1.5z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:minus-circle-line-duotone,[i-solar\:minus-circle-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10' opacity='.5'/%3E%3Cpath stroke-linecap='round' d='M15 12H9'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:moon-stars-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19.9 2.307a.483.483 0 0 0-.9 0l-.43 1.095a.48.48 0 0 1-.272.274l-1.091.432a.486.486 0 0 0 0 .903l1.091.432a.48.48 0 0 1 .272.273L19 6.81c.162.41.74.41.9 0l.43-1.095a.48.48 0 0 1 .273-.273l1.091-.432a.486.486 0 0 0 0-.903l-1.091-.432a.48.48 0 0 1-.273-.274zM16.033 8.13a.483.483 0 0 0-.9 0l-.157.399a.48.48 0 0 1-.272.273l-.398.158a.486.486 0 0 0 0 .903l.398.157c.125.05.223.148.272.274l.157.399c.161.41.739.41.9 0l.157-.4a.48.48 0 0 1 .272-.273l.398-.157a.486.486 0 0 0 0-.903l-.398-.158a.48.48 0 0 1-.272-.273z'/%3E%3Cpath fill='currentColor' d='M12 22c5.523 0 10-4.477 10-10c0-.463-.694-.54-.933-.143a6.5 6.5 0 1 1-8.924-8.924C12.54 2.693 12.463 2 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:notes-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='m20.312 12.647l.517-1.932c.604-2.255.907-3.382.68-4.358a4 4 0 0 0-1.162-2.011c-.731-.685-1.859-.987-4.114-1.591c-2.255-.605-3.383-.907-4.358-.68a4 4 0 0 0-2.011 1.162c-.587.626-.893 1.543-1.348 3.209l-.244.905l-.517 1.932c-.605 2.255-.907 3.382-.68 4.358a4 4 0 0 0 1.162 2.011c.731.685 1.859.987 4.114 1.592c2.032.544 3.149.843 4.064.73q.15-.019.294-.052a4 4 0 0 0 2.011-1.16c.685-.732.987-1.86 1.592-4.115Z'/%3E%3Cpath d='M16.415 17.974a4 4 0 0 1-1.068 1.678c-.731.685-1.859.987-4.114 1.591s-3.383.907-4.358.679a4 4 0 0 1-2.011-1.161c-.685-.731-.988-1.859-1.592-4.114l-.517-1.932c-.605-2.255-.907-3.383-.68-4.358a4 4 0 0 1 1.162-2.011c.731-.685 1.859-.987 4.114-1.592q.638-.172 1.165-.309'/%3E%3Cpath stroke-linecap='round' d='m11.777 10l4.83 1.294M11 12.898l2.898.776'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:pallete-2-bold-duotone,[i-solar\:pallete-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M10.847 21.934C5.867 21.362 2 17.133 2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.157-3.283 4.733-6.086 4.37c-1.618-.209-3.075-.397-3.652.518c-.395.626.032 1.406.555 1.929a1.673 1.673 0 0 1 0 2.366c-.523.523-1.235.836-1.97.751' opacity='.5'/%3E%3Cpath fill='currentColor' d='M11.085 7a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M6.5 13a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m11 0a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m-3-4.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:pause-circle-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.076 8.617C8 8.801 8 9.034 8 9.5v5c0 .466 0 .699.076.883a1 1 0 0 0 .541.54c.184.077.417.077.883.077s.699 0 .883-.076a1 1 0 0 0 .54-.541c.077-.184.077-.417.077-.883v-5c0-.466 0-.699-.076-.883a1 1 0 0 0-.541-.54C10.199 8 9.966 8 9.5 8s-.699 0-.883.076a1 1 0 0 0-.54.541m4.999 0C13 8.801 13 9.034 13 9.5v5c0 .466 0 .699.076.883a1 1 0 0 0 .541.54c.184.077.417.077.883.077s.699 0 .883-.076a1 1 0 0 0 .54-.541c.077-.184.077-.417.077-.883v-5c0-.466 0-.699-.076-.883a1 1 0 0 0-.541-.54C15.199 8 14.966 8 14.5 8s-.699 0-.883.076a1 1 0 0 0-.54.541'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:people-nearby-bold-duotone,[i-solar\:people-nearby-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19.717 20.362C21.143 19.585 22 18.587 22 17.5c0-1.152-.963-2.204-2.546-3C17.623 13.58 14.962 13 12 13s-5.623.58-7.454 1.5C2.963 15.296 2 16.348 2 17.5s.963 2.204 2.546 3C6.377 21.42 9.038 22 12 22c3.107 0 5.882-.637 7.717-1.638' opacity='.6'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M9.25 4a2.75 2.75 0 1 1 5.5 0a2.75 2.75 0 0 1-5.5 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m8.223 11.574l-2.175-.725a1.532 1.532 0 0 1 .805-2.952l1.898.407l.21.044a15 15 0 0 0 6.288-.044l1.897-.407a1.532 1.532 0 0 1 .806 2.952l-2.175.725c-.263.088-.394.132-.493.193a1 1 0 0 0-.466.986c.016.115.066.244.165.503l1.247 3.242a1.473 1.473 0 0 1-2.654 1.26L12 15l-1.576 2.757a1.473 1.473 0 0 1-2.654-1.26l1.247-3.241c.1-.259.149-.388.165-.503a1 1 0 0 0-.466-.986c-.099-.061-.23-.105-.493-.193'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:play-circle-bold-duotone,[i-solar\:play-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='m15.414 13.059l-4.72 2.787C9.934 16.294 9 15.71 9 14.786V9.214c0-.924.934-1.507 1.694-1.059l4.72 2.787c.781.462.781 1.656 0 2.118'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:play-circle-broken{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M13.888 9.935C14.963 10.812 15.5 11.25 15.5 12s-.537 1.188-1.612 2.065c-.297.242-.591.47-.862.66c-.237.167-.506.339-.784.508c-1.073.652-1.609.978-2.09.617c-.48-.36-.524-1.116-.612-2.628c-.024-.427-.04-.846-.04-1.222s.016-.795.04-1.222c.088-1.512.132-2.267.612-2.628c.481-.361 1.018-.035 2.09.617c.278.169.547.341.784.508c.27.19.565.418.862.66Z'/%3E%3Cpath stroke-linecap='round' d='M7 3.338A9.95 9.95 0 0 1 12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12c0-1.821.487-3.53 1.338-5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:refresh-bold-duotone,[i-solar\:refresh-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25'/%3E%3Cpath fill='currentColor' d='M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:running-2-line-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none'%3E%3Ccircle cx='18.5' cy='4.5' r='2.5' stroke='currentColor' stroke-width='1.5' opacity='.5'/%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-width='1.5' d='m9 17l-1 1.2c-.738.886-1.107 1.328-1.61 1.564S5.31 20 4.157 20H3'/%3E%3Cpath fill='currentColor' d='M13.65 22a.75.75 0 0 0 1.5 0zm-1.085-5.754l.453-.598zm1.184 1.015l.587-.466zm.557 1.12l.727-.186zm-.802-6.826a.75.75 0 0 0-1.009-1.11zm-2.652 1.61l.703.26zm.07 1.555l-.677.323zm2.728 5.219v2.06h1.5v-2.06zm-1.538-3.095c.663.502.887.679 1.05.884l1.174-.934c-.308-.387-.717-.69-1.319-1.146zm3.038 3.095c0-.755.006-1.264-.117-1.744l-1.453.373c.065.254.07.538.07 1.37zm-1.988-2.211c.197.247.339.534.417.84l1.454-.373a3.75 3.75 0 0 0-.697-1.4zm-.667-7.283c-.42.381-.945.836-1.354 1.224c-.21.198-.41.398-.573.586c-.149.172-.327.4-.42.649l1.407.521c-.007.021.014-.035.146-.187c.116-.134.276-.295.471-.48c.4-.38.865-.778 1.332-1.203zm.523 5.203c-.488-.37-.818-.62-1.056-.832c-.233-.208-.32-.33-.363-.418l-1.354.645c.167.35.423.63.72.894c.292.26.679.552 1.147.907zm-2.87-2.744a2.75 2.75 0 0 0 .097 2.139l1.354-.645a1.25 1.25 0 0 1-.044-.973z' opacity='.5'/%3E%3Cpath fill='currentColor' d='m5.436 8.82l-.37-.652zm-1.807.164a.75.75 0 1 0 .742 1.304zm9.778-1.627l-.286.693zm-2.96-.715l-.055-.748zM21 12.75a.75.75 0 1 0 0-1.5zm-5.232-3.213l-.67.335zM5.065 8.168l-1.436.816l.742 1.304l1.435-.816zm8.627-1.505c-1.344-.553-2.08-.857-3.3-.769l.11 1.496c.823-.06 1.255.099 2.62.66zm-7.886 2.81c2.502-1.422 3.552-2 4.695-2.083l-.109-1.496c-1.56.114-2.949.923-5.327 2.274zm13.949 3.276H21v-1.5h-1.245zm-4.658-2.878a5.21 5.21 0 0 0 4.658 2.878v-1.5A3.71 3.71 0 0 1 16.439 9.2zm1.342-.67a5.33 5.33 0 0 0-2.747-2.538l-.57 1.387c.86.354 1.564 1 1.975 1.821z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:settings-bold-duotone,[i-solar\:settings-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M14.279 2.152C13.909 2 13.439 2 12.5 2s-1.408 0-1.779.152a2 2 0 0 0-1.09 1.083c-.094.223-.13.484-.145.863a1.62 1.62 0 0 1-.796 1.353a1.64 1.64 0 0 1-1.579.008c-.338-.178-.583-.276-.825-.308a2.03 2.03 0 0 0-1.49.396c-.318.242-.553.646-1.022 1.453c-.47.807-.704 1.21-.757 1.605c-.07.526.074 1.058.4 1.479c.148.192.357.353.68.555c.477.297.783.803.783 1.361s-.306 1.064-.782 1.36c-.324.203-.533.364-.682.556a2 2 0 0 0-.399 1.479c.053.394.287.798.757 1.605s.704 1.21 1.022 1.453c.424.323.96.465 1.49.396c.242-.032.487-.13.825-.308a1.64 1.64 0 0 1 1.58.008c.486.28.774.795.795 1.353c.015.38.051.64.145.863c.204.49.596.88 1.09 1.083c.37.152.84.152 1.779.152s1.409 0 1.779-.152a2 2 0 0 0 1.09-1.083c.094-.223.13-.483.145-.863c.02-.558.309-1.074.796-1.353a1.64 1.64 0 0 1 1.579-.008c.338.178.583.276.825.308c.53.07 1.066-.073 1.49-.396c.318-.242.553-.646 1.022-1.453c.47-.807.704-1.21.757-1.605a2 2 0 0 0-.4-1.479c-.148-.192-.357-.353-.68-.555c-.477-.297-.783-.803-.783-1.361s.306-1.064.782-1.36c.324-.203.533-.364.682-.556a2 2 0 0 0 .399-1.479c-.053-.394-.287-.798-.757-1.605s-.704-1.21-1.022-1.453a2.03 2.03 0 0 0-1.49-.396c-.242.032-.487.13-.825.308a1.64 1.64 0 0 1-1.58-.008a1.62 1.62 0 0 1-.795-1.353c-.015-.38-.051-.64-.145-.863a2 2 0 0 0-1.09-1.083' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M15.523 12c0 1.657-1.354 3-3.023 3s-3.023-1.343-3.023-3S10.83 9 12.5 9s3.023 1.343 3.023 3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:settings-minimalistic-bold-duotone,[i-solar\:settings-minimalistic-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.428 2c-1.114 0-2.129.6-4.157 1.802l-.686.406C5.555 5.41 4.542 6.011 3.985 7c-.557.99-.557 2.19-.557 4.594v.812c0 2.403 0 3.605.557 4.594s1.57 1.59 3.6 2.791l.686.407C10.299 21.399 11.314 22 12.428 22s2.128-.6 4.157-1.802l.686-.407c2.028-1.2 3.043-1.802 3.6-2.791c.557-.99.557-2.19.557-4.594v-.812c0-2.403 0-3.605-.557-4.594s-1.572-1.59-3.6-2.792l-.686-.406C14.555 2.601 13.542 2 12.428 2' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12.428 8.25a3.75 3.75 0 1 0 0 7.5a3.75 3.75 0 0 0 0-7.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:star-fall-2-bold-duotone,[i-solar\:star-fall-2-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M11.58 4.776c.695-1.77 1.043-2.656 1.769-2.765c.726-.11 1.35.63 2.6 2.109l.323.382c.355.42.532.63.774.75c.24.12.518.137 1.074.17l.506.029c1.955.114 2.932.172 3.271.81c.34.64-.184 1.438-1.231 3.033l-.271.413c-.298.453-.447.68-.487.939s.033.52.179 1.043l.133.477c.513 1.842.77 2.762.253 3.266c-.517.505-1.465.258-3.361-.235l-.49-.127c-.54-.14-.809-.21-1.075-.17s-.499.185-.964.476l-.424.265c-1.638 1.024-2.456 1.536-3.115 1.208c-.659-.327-.72-1.277-.845-3.177l-.033-.492c-.035-.54-.053-.81-.177-1.044s-.34-.406-.774-.75l-.395-.312C7.294 9.865 6.53 9.26 6.64 8.554s1.02-1.047 2.839-1.729l.47-.176c.518-.194.776-.29.965-.475c.19-.185.288-.437.486-.94z'/%3E%3Cpath fill='currentColor' d='M5.31 9.593C2.873 11.92 1.275 15.806 2.331 22c.943-2.603 3.526-4.76 6.581-6.047c-.106-.593-.154-1.317-.204-2.08l-.039-.595a22 22 0 0 0-.032-.43l-.086-.071l-.268-.215l-.475-.376c-.694-.55-1.34-1.06-1.783-1.532c-.253-.269-.536-.624-.715-1.061m5.037 5.83l-.015-.114l.056.101z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:stop-circle-bold-duotone,[i-solar\:stop-circle-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10' opacity='.5'/%3E%3Cpath fill='currentColor' d='M8.586 8.586C8 9.172 8 10.114 8 12s0 2.828.586 3.414S10.114 16 12 16s2.828 0 3.414-.586S16 13.886 16 12s0-2.828-.586-3.414S13.886 8 12 8s-2.828 0-3.414.586'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:sun-fog-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7.25 22a.75.75 0 0 1 .75-.75h8a.75.75 0 0 1 0 1.5H8a.75.75 0 0 1-.75-.75M12 1.25a.75.75 0 0 1 .75.75v1a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75M1.25 12a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5H2a.75.75 0 0 1-.75-.75m19 0a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75M6.083 15.25H2a.75.75 0 0 0 0 1.5h20a.75.75 0 0 0 0-1.5z' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M4.25 19a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75m.148-14.602a.75.75 0 0 1 1.061 0l.393.393a.75.75 0 0 1-1.06 1.06l-.394-.392a.75.75 0 0 1 0-1.06m15.202 0a.75.75 0 0 1 0 1.06l-.392.393a.75.75 0 0 1-1.06-1.06l.392-.393a.75.75 0 0 1 1.06 0M5.25 12c0 1.178.302 2.286.833 3.25h11.834A6.75 6.75 0 1 0 5.25 12' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:trash-bin-trash-linear,[i-solar\:trash-bin-trash-linear=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' d='M20.5 6h-17m15.333 2.5l-.46 6.9c-.177 2.654-.265 3.981-1.13 4.79s-2.196.81-4.856.81h-.774c-2.66 0-3.991 0-4.856-.81c-.865-.809-.954-2.136-1.13-4.79l-.46-6.9M9.5 11l.5 5m4.5-5l-.5 5'/%3E%3Cpath d='M6.5 6h.11a2 2 0 0 0 1.83-1.32l.034-.103l.097-.291c.083-.249.125-.373.18-.479a1.5 1.5 0 0 1 1.094-.788C9.962 3 10.093 3 10.355 3h3.29c.262 0 .393 0 .51.019a1.5 1.5 0 0 1 1.094.788c.055.106.097.23.18.479l.097.291A2 2 0 0 0 17.5 6'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:tuning-square-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z'/%3E%3Ccircle cx='8' cy='10' r='2'/%3E%3Ccircle cx='2' cy='2' r='2' transform='matrix(1 0 0 -1 14 16)'/%3E%3Cpath stroke-linecap='round' d='M8 14v5m8-9V5M8 5v1m8 13v-1'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:undo-left-bold-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7.53 3.47a.75.75 0 0 1 0 1.06L5.06 7l2.47 2.47a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='m5.06 7l.75-.75h9.226c.904 0 1.633 0 2.222.053c.606.055 1.136.172 1.617.45a3.75 3.75 0 0 1 1.372 1.372c.278.481.395 1.011.45 1.617c.053.589.053 1.318.053 2.222v.072c0 .904 0 1.633-.053 2.222c-.055.606-.172 1.136-.45 1.617a3.75 3.75 0 0 1-1.372 1.373c-.481.277-1.011.394-1.617.449c-.589.053-1.318.053-2.222.053H8a.75.75 0 0 1 0-1.5h7c.948 0 1.61 0 2.122-.047c.502-.046.788-.13 1.003-.254a2.25 2.25 0 0 0 .823-.824c.125-.215.21-.5.255-1.003c.046-.512.047-1.174.047-2.122s0-1.61-.047-2.122c-.046-.503-.13-.788-.255-1.003a2.25 2.25 0 0 0-.823-.824c-.215-.124-.5-.208-1.003-.254c-.512-.046-1.174-.047-2.122-.047H5.81z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:upload-minimalistic-bold,[i-solar\:upload-minimalistic-bold=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12.554 2.494a.75.75 0 0 0-1.107 0l-4 4.375A.75.75 0 0 0 8.553 7.88l2.696-2.95V16a.75.75 0 0 0 1.5 0V4.932l2.697 2.95a.75.75 0 1 0 1.107-1.013z'/%3E%3Cpath fill='currentColor' d='M3.75 15a.75.75 0 0 0-1.5 0v.055c0 1.367 0 2.47.117 3.337c.12.9.38 1.658.981 2.26c.602.602 1.36.86 2.26.982c.867.116 1.97.116 3.337.116h6.11c1.367 0 2.47 0 3.337-.116c.9-.122 1.658-.38 2.26-.982s.86-1.36.982-2.26c.116-.867.116-1.97.116-3.337V15a.75.75 0 0 0-1.5 0c0 1.435-.002 2.436-.103 3.192c-.099.734-.28 1.122-.556 1.399c-.277.277-.665.457-1.4.556c-.755.101-1.756.103-3.191.103H9c-1.435 0-2.437-.002-3.192-.103c-.734-.099-1.122-.28-1.399-.556c-.277-.277-.457-.665-.556-1.4c-.101-.755-.103-1.756-.103-3.191'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:upload-square-line-duotone,[i-solar\:upload-square-line-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 17v-7m0 0l3 3m-3-3l-3 3'/%3E%3Cpath stroke-linecap='round' d='M16 7H8'/%3E%3Cpath d='M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:user-rounded-linear{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Ccircle cx='12' cy='6' r='4'/%3E%3Cellipse cx='12' cy='17' rx='7' ry='4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:user-speak-rounded-bold-duotone,[i-solar\:user-speak-rounded-bold-duotone=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Ccircle cx='10' cy='6.75' r='4' fill='currentColor'/%3E%3Cellipse cx='10' cy='17.75' fill='currentColor' opacity='.5' rx='7' ry='4'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M18.357 2.364a.75.75 0 0 1 1.029-.257L19 2.75l.386-.643h.001l.002.002l.004.002l.01.006l.113.076c.07.049.166.12.277.212c.222.185.512.462.802.838c.582.758 1.155 1.914 1.155 3.507s-.573 2.75-1.155 3.507c-.29.376-.58.653-.802.838a4 4 0 0 1-.363.27l-.028.018l-.01.006l-.003.002l-.002.001s-.001.001-.387-.642l.386.643a.75.75 0 0 1-.776-1.283l.005-.004l.041-.027q.06-.042.177-.136c.152-.128.362-.326.573-.6c.417-.542.844-1.386.844-2.593s-.427-2.05-.844-2.593a3.8 3.8 0 0 0-.573-.6a3 3 0 0 0-.218-.163l-.005-.003a.75.75 0 0 1-.253-1.027' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M16.33 4.415a.75.75 0 0 1 1.006-.336L17 4.75l.336-.67h.001l.002.001l.004.002l.008.004l.022.012a2 2 0 0 1 .233.153c.136.102.31.254.48.467c.349.436.664 1.099.664 2.031s-.316 1.595-.664 2.031a2.7 2.7 0 0 1-.654.586l-.06.034l-.02.012l-.01.004l-.003.002l-.002.001l-.33-.657l.329.658a.75.75 0 0 1-.685-1.335l.003-.001l.052-.036c.052-.04.13-.106.209-.205c.15-.189.335-.526.335-1.094s-.184-.905-.335-1.094a1.2 1.2 0 0 0-.261-.24l-.003-.002a.75.75 0 0 1-.322-1' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-svg-spinners\:ring-resize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg stroke='currentColor'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-linecap='round' stroke-width='3'%3E%3Canimate attributeName='stroke-dasharray' calcMode='spline' dur='1.5s' keySplines='0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1' keyTimes='0;0.475;0.95;1' repeatCount='indefinite' values='0 150;42 150;42 150;42 150'/%3E%3Canimate attributeName='stroke-dashoffset' calcMode='spline' dur='1.5s' keySplines='0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1' keyTimes='0;0.475;0.95;1' repeatCount='indefinite' values='0;-16;-59;-59'/%3E%3C/circle%3E%3CanimateTransform attributeName='transform' dur='2s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-vscode-icons\:file-type-minecraft{background:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='%2352a535' d='M30 2H2v28h28z'/%3E%3Cpath fill='%2386d562' d='M24.4 13.2h-5.6v.47h5.6zm-5.6 8.4h-5.6v.47h5.6zm2.8 2.8h-2.8v.47h2.8zm-8.4 0h-2.8v.47h2.8zm0-11.2H7.6v.47h5.6z'/%3E%3Cpath d='M24.4 13.2V7.6h-5.6v5.6h-5.6V16h-2.8v8.4h2.8v-2.8h5.6v2.8h2.8V16h-2.8v-2.8zM13.2 7.6H7.6v5.6h5.6z'/%3E%3Cpath fill='%232a641c' d='M24.4 7.6h-5.6v.47h5.6zm-5.6 5.6h-5.6v.47h5.6zm-5.6-5.6H7.6v.47h5.6zm0 8.4h-2.8v.47h2.8zm8.4 0h-2.8v.47h2.8z'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.prose :where(h1,h2,h3,h4,h5,h6):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-headings);font-weight:600;line-height:1.25}.prose :where(a):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-links);text-decoration:underline;font-weight:500}.prose :where(a code):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-links)}.prose :where(p,ul,ol,pre):not(:where(.not-prose,.not-prose *)){margin:1em 0;line-height:1.75}.prose :where(blockquote):not(:where(.not-prose,.not-prose *)){margin:1em 0;padding-left:1em;font-style:italic;border-left:.25em solid var(--un-prose-borders)}.prose :where(h1):not(:where(.not-prose,.not-prose *)){margin:1rem 0;font-size:2.25em}.prose :where(h2):not(:where(.not-prose,.not-prose *)){margin:1.75em 0 .5em;font-size:1.75em}.prose :where(h3):not(:where(.not-prose,.not-prose *)){margin:1.5em 0 .5em;font-size:1.375em}.prose :where(h4):not(:where(.not-prose,.not-prose *)){margin:1em 0;font-size:1.125em}.prose :where(img,video):not(:where(.not-prose,.not-prose *)){max-width:100%}.prose :where(figure,picture):not(:where(.not-prose,.not-prose *)){margin:1em 0}.prose :where(figcaption):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-captions);font-size:.875em}.prose :where(code):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-code);font-size:.875em;font-weight:600;font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.prose :where(:not(pre)>code):not(:where(.not-prose,.not-prose *)):before,.prose :where(:not(pre)>code):not(:where(.not-prose,.not-prose *)):after{content:"`"}.prose :where(pre):not(:where(.not-prose,.not-prose *)){padding:1.25rem 1.5rem;overflow-x:auto;border-radius:.375rem}.prose :where(pre,code):not(:where(.not-prose,.not-prose *)){white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;hyphens:none;background:transparent}.prose :where(pre code):not(:where(.not-prose,.not-prose *)){font-weight:inherit}.prose :where(ol,ul):not(:where(.not-prose,.not-prose *)){padding-left:1.25em}.prose :where(ol):not(:where(.not-prose,.not-prose *)){list-style-type:decimal}.prose :where(ol[type=A]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where(.not-prose,.not-prose *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where(.not-prose,.not-prose *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where(.not-prose,.not-prose *)){list-style-type:decimal}.prose :where(ul):not(:where(.not-prose,.not-prose *)){list-style-type:disc}.prose :where(ol>li):not(:where(.not-prose,.not-prose *))::marker,.prose :where(ul>li):not(:where(.not-prose,.not-prose *))::marker,.prose :where(summary):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(hr):not(:where(.not-prose,.not-prose *)){margin:2em 0;border:1px solid var(--un-prose-hr)}.prose :where(table):not(:where(.not-prose,.not-prose *)){display:block;margin:1em 0;border-collapse:collapse;overflow-x:auto}.prose :where(tr):not(:where(.not-prose,.not-prose *)):nth-child(2n){background:var(--un-prose-bg-soft)}.prose :where(td,th):not(:where(.not-prose,.not-prose *)){border:1px solid var(--un-prose-borders);padding:.625em 1em}.prose :where(abbr):not(:where(.not-prose,.not-prose *)){cursor:help}.prose :where(kbd):not(:where(.not-prose,.not-prose *)){color:var(--un-prose-code);border:1px solid;padding:.25rem .5rem;font-size:.875em;border-radius:.25rem}.prose :where(details):not(:where(.not-prose,.not-prose *)){margin:1em 0;padding:1.25rem 1.5rem;background:var(--un-prose-bg-soft)}.prose :where(summary):not(:where(.not-prose,.not-prose *)){cursor:pointer;font-weight:600}.prose{color:var(--un-prose-body);max-width:65ch}.container,[container=""]{width:100%}.scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}@media (min-width: 640px){.container,[container=""]{max-width:640px}}@media (min-width: 768px){.container,[container=""]{max-width:768px}}@media (min-width: 1024px){.container,[container=""]{max-width:1024px}}@media (min-width: 1280px){.container,[container=""]{max-width:1280px}}@media (min-width: 1536px){.container,[container=""]{max-width:1536px}}.\[input\:checked\~\&\]{input:checked~&}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none,[pointer-events-none=""]{pointer-events:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.absolute,[absolute=""]{position:absolute}.fixed,[fixed=""]{position:fixed}.relative,[relative=""]{position:relative}.sticky,[sticky=""]{position:sticky}[before~=absolute]:before{position:absolute}.after\:absolute:after{position:absolute}[after~=absolute]:after{position:absolute}.inset-0,[inset-0=""]{top:0;right:0;bottom:0;left:0}[before~=inset-0]:before{top:0;right:0;bottom:0;left:0}[after~=inset-0]:after{top:0;right:0;bottom:0;left:0}.inset-x-0,[inset-x-0=""]{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0,[bottom-0=""]{bottom:0}.bottom-11,[bottom-11=""]{bottom:2.75rem}.bottom-2{bottom:.5rem}.left-0,[left-0=""]{left:0}.left-1\/2,[left~="1/2"]{left:50%}.left-2{left:.5rem}.right--10,[right--10=""]{right:-2.5rem}.right--15,[right--15=""]{right:-3.75rem}.right--5,[right--5=""]{right:-1.25rem}.right-0,[right-0=""],[right~="0"]{right:0}.right-2{right:.5rem}.top--20,[top--20=""]{top:-5rem}.top-\[-32px\]{top:-32px}.top-0,[top-0=""],[top~="0"]{top:0}.top-1\/2,[top~="50%"]{top:50%}.top-2{top:.5rem}[bottom~="[calc(100%+8px)]"]{bottom:calc(100% + 8px)}[bottom~="20%"]{bottom:20%}[bottom~="3"]{bottom:.75rem}[right~="3"]{right:.75rem}[top~="[65dvh]"]{top:65dvh}[top~="[calc(100dvh-12rem)]"]{top:calc(100dvh - 12rem)}[top~="[calc(100dvh-15rem)]"]{top:calc(100dvh - 15rem)}.after\:left-\[2px\]:after{left:2px}.after\:top-\[2px\]:after{top:2px}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2}.line-clamp-3,[line-clamp-3=""]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3}.z--1,[z--1=""]{z-index:-1}.z--2{z-index:-2}.z-0{z-index:0}.z-1,[z-1=""]{z-index:1}.z-10,[z-10=""]{z-index:10}.z-100{z-index:100}.z-2,[z-2=""]{z-index:2}.z-3,[z-3=""]{z-index:3}.z-30,[z-30=""]{z-index:30}.z-4,[z-4=""]{z-index:4}.z-99,[z-99=""]{z-index:99}[z~="20"]{z-index:20}[before~=z-0]:before{z-index:0}[after~=z--2]:after{z-index:-2}.grid,[grid=""],[grid~="~"]{display:grid}.col-span-full{grid-column:1/-1}.auto-cols-\[350px\]{grid-auto-columns:350px}.auto-cols-auto{grid-auto-columns:auto}.grid-auto-rows-\[minmax\(min-content\,max-content\)\]{grid-auto-rows:minmax(min-content,max-content)}.grid-auto-flow-dense{grid-auto-flow:dense}.grid-flow-col{grid-auto-flow:column}.grid-flow-row{grid-auto-flow:row}.cols-\[20px_1fr_60px\],[grid~="cols-[20px_1fr_60px]"]{grid-template-columns:20px 1fr 60px}.grid-cols-\[repeat\(auto-fill\,minmax\(280px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.cols-1,.grid-cols-1,[grid~=cols-1]{grid-template-columns:repeat(1,minmax(0,1fr))}.cols-2,.grid-cols-2,[grid-cols-2=""],[grid~=cols-2]{grid-template-columns:repeat(2,minmax(0,1fr))}.m-0,[m0=""]{margin:0}.m-1,[m-1=""]{margin:.25rem}.m-auto{margin:auto}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-5,[mx-5=""]{margin-left:1.25rem;margin-right:1.25rem}.mx-auto,[mx-auto=""]{margin-left:auto;margin-right:auto}.mx2,[mx2=""]{margin-left:.5rem;margin-right:.5rem}.my{margin-top:1rem;margin-bottom:1rem}.my-0,[my-0=""]{margin-top:0;margin-bottom:0}.my-5,[my-5=""]{margin-top:1.25rem;margin-bottom:1.25rem}.my-auto,[my-auto=""]{margin-top:auto;margin-bottom:auto}.-mb-px{margin-bottom:-1px}.mb-1,[mb-1=""]{margin-bottom:.25rem}.mb-2,.mb2,[mb-2=""],[mb2=""]{margin-bottom:.5rem}.mb-3,[mb-3=""]{margin-bottom:.75rem}.mb-4,[mb-4=""]{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml{margin-left:1rem}.ml-0\.5,[ml-0\.5=""]{margin-left:.125rem}.ml-auto{margin-left:auto}.mr{margin-right:1rem}.mr-0\!{margin-right:0!important}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-auto{margin-right:auto}.ms,[ms=""]{margin-inline-start:1rem}.mt-0\.5{margin-top:.125rem}.mt-1,[mt-1=""]{margin-top:.25rem}.mt-2,[mt-2=""]{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4,[mt-4=""]{margin-top:1rem}.mt-auto{margin-top:auto}[ml~="12"]{margin-left:3rem}[mr~="12"]{margin-right:3rem}[box~=border]{box-sizing:border-box}.inline,[inline=""]{display:inline}.block,[block=""]{display:block}.inline-block,[inline-block=""]{display:inline-block}.contents{display:contents}.size-16,[size-16=""]{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-20,[size-20=""]{width:5rem;height:5rem}.size-24,[size-24=""],[size~="24"]{width:6rem;height:6rem}.size-3,[size-3=""]{width:.75rem;height:.75rem}.size-5{width:1.25rem;height:1.25rem}.size-6,[size-6=""],[size~="6"]{width:1.5rem;height:1.5rem}.size-60,[size-60=""]{width:15rem;height:15rem}.h-0\.5,[h-0\.5=""]{height:.125rem}.h-10{height:2.5rem}.h-100dvh,[h-100dvh=""],[h~="100dvh"]{height:100dvh}.h-12{height:3rem}.h-16{height:4rem}.h-18,[h-18=""]{height:4.5rem}.h-1lh{height:1lh}.h-2,.h2,[h-2=""]{height:.5rem}.h-24,[h-24=""]{height:6rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48,[h-48=""]{height:12rem}.h-5,[h-5=""]{height:1.25rem}.h-6{height:1.5rem}.h-60,[h-60=""]{height:15rem}.h-7,[h-7=""]{height:1.75rem}.h-8,[h-8=""]{height:2rem}.h-fit,[h-fit=""]{height:fit-content}.h-full,[h-full=""]{height:100%}.h1{height:.25rem}.h3{height:.75rem}.max-h-\[10lh\],[max-h~="[10lh]"]{max-height:10lh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100dvh-7lh\)\]{max-height:calc(100dvh - 7lh)}.max-h-60,[max-h-60=""]{max-height:15rem}.max-h-none,[max-h-none=""]{max-height:none}.max-w-6xl{max-width:72rem}.max-w-full,[max-w-full=""]{max-width:100%}.max-w-md{max-width:28rem}.min-h-\[120px\],.min-h-120px,[min-h-120px=""]{min-height:120px}.min-h-\[1lh\],[min-h~="[1lh]"]{min-height:1lh}.min-h-16,[min-h-16=""]{min-height:4rem}.min-h-40px,[min-h-40px=""]{min-height:40px}.min-h-70dvh,[min-h-70dvh=""]{min-height:70dvh}.min-w-\[150px\]{min-width:150px}.min-w-\[160px\]{min-width:160px}.min-w-\[200px\]{min-width:200px}.min-w-0,[min-w-0=""]{min-width:0}.min-w-20,[min-w-20=""]{min-width:5rem}.min-w-20px{min-width:20px}.min-w-50,[min-w-50=""]{min-width:12.5rem}.w-\[92vw\]{width:92vw}.w-0\!{width:0!important}.w-1{width:.25rem}.w-1\/2,[w~="[50%]"]{width:50%}.w-10\%{width:10%}.w-100,[w-100=""]{width:25rem}.w-100vw,[w-100vw=""]{width:100vw}.w-11{width:2.75rem}.w-18,[w-18=""]{width:4.5rem}.w-25\%{width:25%}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-5{width:1.25rem}.w-8,[w-8=""]{width:2rem}.w-90\%{width:90%}.w-95\%{width:95%}.w-fit,[w-fit=""]{width:fit-content}.w-full,[w-full=""],[w~="100%"],[w~=full]{width:100%}[h~="[14px]"]{height:14px}[h~="300"]{height:75rem}[h~="50dvh"]{height:50dvh}[h~=auto]{height:auto}[h~=unset]{height:unset}[max-h~="[300px]"]{max-height:300px}[max-h~="[4.5rem]"]{max-height:4.5rem}[max-h~="[85vh]"]{max-height:85vh}[max-h~="100"]{max-height:25rem}[max-h~="100dvh"]{max-height:100dvh}[max-h~="30vh"]{max-height:30vh}[max-w~="500px"]{max-width:500px}[min-h~="[100px]"]{min-height:100px}[min-h~="100"]{min-height:25rem}[min-h~="120"]{min-height:30rem}[min-w~="1/2"],[min-w~="50%"]{min-width:50%}[min-w~="30%"]{min-width:30%}[min-w~="3em"]{min-width:3em}[min-w~="50vw"]{min-width:50vw}[min-w~="6"]{min-width:1.5rem}[w~="[1px]"]{width:1px}[w~="100dvw"]{width:100dvw}[w~="12.5"]{width:3.125rem}[w~="70%"]{width:70%}[before~=h-full]:before{height:100%}[before~="w-25%"]:before{width:25%}.after\:h-5:after{height:1.25rem}.after\:w-5:after{width:1.25rem}[after~=h-full]:after{height:100%}[after~=w-full]:after{width:100%}.max-w-screen-xl,[max-w-screen-xl=""]{max-width:1280px}.flex,[flex=""],[flex~="~"]{display:flex}.inline-flex,[inline-flex=""],[inline-flex~="~"]{display:inline-flex}.flex-1,[flex-1=""],[flex~="1"]{flex:1 1 0%}.flex-shrink-0,.shrink-0,[shrink-0=""]{flex-shrink:0}.flex-row,[flex-row=""],[flex~=row]{flex-direction:row}[flex~=row-reverse]{flex-direction:row-reverse}.flex-col,[flex-col=""],[flex~=col]{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap,[flex-wrap=""]{flex-wrap:wrap}[perspective~="800"]{-webkit-perspective:800px;perspective:800px}.-translate-x-1\/2,.translate-x--1\/2,.translate-x-\[-50\%\],[transform~="translate-x--1/2"]{--un-translate-x:-50%;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.-translate-y-1\/2,.translate-y-\[-50\%\],[transform~="translate-y-[-50%]"]{--un-translate-y:-50%;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.translate-x-\[50\%\],[transform~="translate-x-[50%]"]{--un-translate-x:50%;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.translate-y--2,[transform~=translate-y--2]{--un-translate-y:-.5rem;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.translate-y-\[-100\%\],[transform~="translate-y-[-100%]"]{--un-translate-y:-100%;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.translate-y-\[50\%\]{--un-translate-y:50%;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.translate-y-2,[translate-y-2=""]{--un-translate-y:.5rem;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.translate-y-4,[translate-y-4=""]{--un-translate-y:1rem;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}[translate-x~="0.5"]{--un-translate-x:.125rem;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}[translate-x~="data-[state=checked]:full"][data-state=checked]{--un-translate-x:100%;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}[translate-y~="[-80%]"]{--un-translate-y:-80%;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}[translate-y~="[0.25lh]"]{--un-translate-y:.25lh;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.peer:checked~.peer-checked\:after\:translate-x-full:after{--un-translate-x:100%;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.\[\&_\.card-cover_img\]\:hover\:translate-y-2:hover .card-cover img,[hover\:translate-y-2=""]:hover{--un-translate-y:.5rem;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.rotate-180{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:180deg;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.scale-100{--un-scale-x:1;--un-scale-y:1;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.scale-125{--un-scale-x:1.25;--un-scale-y:1.25;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.scale-150{--un-scale-x:1.5;--un-scale-y:1.5;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.\[\&_\.card-cover_img\]\:hover\:scale-102:hover .card-cover img{--un-scale-x:1.02;--un-scale-y:1.02;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.hover\:scale-110:hover{--un-scale-x:1.1;--un-scale-y:1.1;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}[hover~=scale-100]:hover{--un-scale-x:1;--un-scale-y:1;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.preserve-3d{transform-style:preserve-3d}.transform,[transform=""]{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-spin{animation:spin 1s linear infinite}.disabled\:cursor-default:disabled{cursor:default}.cursor-pointer,[cursor-pointer=""],[cursor~=pointer]{cursor:pointer}.cursor-not-allowed{cursor:not-allowed}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}[cursor~="disabled:not-allowed"]:disabled{cursor:not-allowed}[disabled\:cursor-not-allowed=""]:disabled{cursor:not-allowed}.cursor-ew-resize,[cursor-ew-resize=""]{cursor:ew-resize}.select-none,[select-none=""]{-webkit-user-select:none;user-select:none}.resize-none,[resize-none=""]{resize:none}.appearance-none,[appearance-none=""]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.place-self-end{place-self:end}.items-start,[items-start=""]{align-items:flex-start}.items-end,[items-end=""]{align-items:flex-end}.items-center,[flex~=items-center],[items-center=""]{align-items:center}.justify-start{justify-content:flex-start}.justify-end,[justify-end=""]{justify-content:flex-end}.justify-center,[flex~=justify-center],[justify-center=""]{justify-content:center}.justify-between,[justify-between=""]{justify-content:space-between}.gap-0\.5,[gap-0\.5=""]{gap:.125rem}.gap-1,[gap-1=""]{gap:.25rem}.gap-1\.5,[gap-1\.5=""]{gap:.375rem}.gap-2,[flex~=gap-2],[gap-2=""]{gap:.5rem}.gap-3,[flex~=gap-3],[gap-3=""]{gap:.75rem}.gap-4,[flex~=gap-4],[gap-4=""],[grid~=gap-4]{gap:1rem}.gap-5,[gap-5=""]{gap:1.25rem}.gap-6,[flex~=gap-6]{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2,[flex~=gap-x-2]{column-gap:.5rem}.gap-y-0,[flex~=gap-y-0]{row-gap:0}.space-x-1>:not([hidden])~:not([hidden]){--un-space-x-reverse:0;margin-left:calc(.25rem * calc(1 - var(--un-space-x-reverse)));margin-right:calc(.25rem * var(--un-space-x-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(.5rem * var(--un-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(1.5rem * calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(1.5rem * var(--un-space-y-reverse))}[divide~=y]>:not([hidden])~:not([hidden]){--un-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--un-divide-y-reverse)));border-bottom-width:calc(1px * var(--un-divide-y-reverse))}[divide~="gray/25"]>:not([hidden])~:not([hidden]){border-color:#9ca3af40}[border~=dashed],[divide~=dashed]>:not([hidden])~:not([hidden]){border-style:dashed}.of-clip,[of-clip=""]{overflow:clip}.of-hidden,.overflow-hidden,[of-hidden=""],[overflow-hidden=""],[overflow~=hidden]{overflow:hidden}.overflow-auto,[overflow-auto=""]{overflow:auto}.overflow-scroll,[overflow-scroll=""]{overflow:scroll}.of-x-scroll,[of-x-scroll=""]{overflow-x:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-scroll,[overflow-y-scroll=""]{overflow-y:scroll}.scroll-smooth,[scroll-smooth=""]{scroll-behavior:smooth}.truncate,[truncate=""]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line,[whitespace-pre-line=""]{white-space:pre-line}.break-words{overflow-wrap:break-word}.b,.border,[border~="~"],[border~="1"]{border-width:1px}.b-2,.border-2,[b-2=""],[border~="2"],[border~="2px"]{border-width:2px}[border~="4"]{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2,[border~=b-2]{border-bottom-width:2px}[border~=l-2]{border-left-width:2px}[border~=r-2]{border-right-width:2px}[border~=t-2]{border-top-width:2px}.\[\&\:checked\+div\]\:border-primary-500:checked+div,.border-primary-500{--un-border-opacity:1;border-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}.border-amber-200{--un-border-opacity:1;border-color:rgb(253 230 138 / var(--un-border-opacity))}.border-neutral-100,[border~=neutral-100]{--un-border-opacity:1;border-color:rgb(245 245 245 / var(--un-border-opacity))}.border-neutral-200,.dark [border~="dark:neutral-200"],[border~=neutral-200]{--un-border-opacity:1;border-color:rgb(229 229 229 / var(--un-border-opacity))}.border-neutral-300,[border~="data-[state=unchecked]:neutral-300"][data-state=unchecked],[border~=neutral-300]{--un-border-opacity:1;border-color:rgb(212 212 212 / var(--un-border-opacity))}.border-neutral-500{--un-border-opacity:1;border-color:rgb(115 115 115 / var(--un-border-opacity))}.border-primary-100,[border~=primary-100]{--un-border-opacity:1;border-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity)) 80%,oklch(100% 0 360 / var(--un-border-opacity)))}.border-primary-200,[border~="data-[state=checked]:primary-200"][data-state=checked]{--un-border-opacity:1;border-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}.border-primary-400,.dark .dark\:\[\&\:checked\+div\]\:border-primary-400:checked+div,.dark .dark\:border-primary-400{--un-border-opacity:1;border-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}.border-red-200{--un-border-opacity:1;border-color:rgb(254 202 202 / var(--un-border-opacity))}.border-white,[border~=white]{--un-border-opacity:1;border-color:rgb(255 255 255 / var(--un-border-opacity))}.dark .dark\:border-amber-800{--un-border-opacity:1;border-color:rgb(146 64 14 / var(--un-border-opacity))}.dark .dark\:border-neutral-600,.dark [border~="dark:neutral-600"]{--un-border-opacity:1;border-color:rgb(82 82 82 / var(--un-border-opacity))}.dark .dark\:border-neutral-700,.dark [border~="dark:neutral-700"]{--un-border-opacity:1;border-color:rgb(64 64 64 / var(--un-border-opacity))}.dark .dark\:border-neutral-800,.dark [border~="dark:neutral-800"],[border~=neutral-800]{--un-border-opacity:1;border-color:rgb(38 38 38 / var(--un-border-opacity))}.dark .dark\:border-neutral-800\/25,.dark [border~="dark:neutral-800/25"]{border-color:#26262640}.dark .dark\:border-neutral-900,.dark [border~="dark:neutral-900"]{--un-border-opacity:1;border-color:rgb(23 23 23 / var(--un-border-opacity))}.dark .dark\:border-primary-600{--un-border-opacity:1;border-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}.dark .dark\:border-primary-800,.dark [border~="dark:primary-800"]{--un-border-opacity:1;border-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}.dark .dark\:border-primary-900,.dark [border~="dark:primary-900"]{--un-border-opacity:1;border-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}.dark .dark\:border-red-800{--un-border-opacity:1;border-color:rgb(153 27 27 / var(--un-border-opacity))}.dark [border~="dark:cyan-500/50"]{border-color:#06b6d480}.dark [border~="dark:neutral-700/30"]{border-color:#4040404d}.dark [border~="dark:primary-400/20"]{border-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2)}.dark [border~="dark:primary-500/50"]{border-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .5)}.dark [border~="dark:violet-500/50"]{border-color:#8b5cf680}[border~="cyan-200/50"]{border-color:#a5f3fc80}[border~="gray/25"]{border-color:#9ca3af40}[border~="neutral-200/50"]{border-color:#e5e5e580}[border~="primary-200/50"]{border-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .5)}[border~=primary-300]{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}[border~="violet-200/50"]{border-color:#ddd6fe80}.peer:checked~.peer-checked\:after\:border-white:after{--un-border-opacity:1;border-color:rgb(255 255 255 / var(--un-border-opacity))}[border~="focus-within:neutral-800"]:focus-within{--un-border-opacity:1;border-color:rgb(38 38 38 / var(--un-border-opacity))}.dark .dark\:hover\:border-primary-400\/30:hover{border-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .3)}.dark .dark\:hover\:border-primary-700:hover{--un-border-opacity:1;border-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}.dark [border~="dark:hover:primary-400/30"]:hover{border-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .3)}.hover\:border-primary-300:hover{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}.hover\:border-primary-500\/30:hover,[border~="hover:primary-500/30"]:hover{border-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .3)}.dark [border~="dark:focus:neutral-600"]:focus{--un-border-opacity:1;border-color:rgb(82 82 82 / var(--un-border-opacity))}.dark [border~="dark:focus:neutral-700"]:focus{--un-border-opacity:1;border-color:rgb(64 64 64 / var(--un-border-opacity))}.dark [border~="dark:focus:primary-400/50"]:focus{border-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .5)}[border~="focus:neutral-200"]:focus{--un-border-opacity:1;border-color:rgb(229 229 229 / var(--un-border-opacity))}[border~="focus:neutral-400"]:focus{--un-border-opacity:1;border-color:rgb(163 163 163 / var(--un-border-opacity))}[border~="focus:primary-100"]:focus{--un-border-opacity:1;border-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity)) 80%,oklch(100% 0 360 / var(--un-border-opacity)))}[border~="focus:primary-300"]:focus{--un-border-opacity:1;border-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-border-opacity))}.rounded,[rounded=""]{border-radius:.25rem}.rounded-2xl,[rounded-2xl=""]{border-radius:1rem}.rounded-full,[rounded-full=""]{border-radius:9999px}.rounded-lg,[border~=rounded-lg],[rounded-lg=""],[rounded~=lg]{border-radius:.5rem}.rounded-md,[rounded-md=""]{border-radius:.375rem}.rounded-sm,[rounded-sm=""]{border-radius:.125rem}.rounded-xl,[rounded-xl=""]{border-radius:.75rem}.after\:rounded-full:after{border-radius:9999px}.rounded-l-lg,[rounded-l-lg=""]{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-xl,[rounded-l-xl=""]{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-lg,[rounded-r-lg=""]{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-r-xl,[rounded-r-xl=""]{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-xl,[rounded-t-xl=""]{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border-none,[border-none=""]{border-style:none}[border~=solid]{border-style:solid}.bg-amber-50{--un-bg-opacity:1;background-color:rgb(255 251 235 / var(--un-bg-opacity))}.bg-amber-50\/80{background-color:#fffbebcc}.bg-black\/50,[bg~="black/50"]{background-color:#00000080}.bg-neutral-100,[bg-neutral-100=""],[bg~=neutral-100]{--un-bg-opacity:1;background-color:rgb(245 245 245 / var(--un-bg-opacity))}.bg-neutral-200,.dark .dark\:bg-neutral-200,[bg-neutral-200=""],[bg~=neutral-200]{--un-bg-opacity:1;background-color:rgb(229 229 229 / var(--un-bg-opacity))}.bg-neutral-300,.dark [bg~="dark:neutral-300"],[bg-neutral-300=""],[bg~="data-[state=unchecked]:neutral-300"][data-state=unchecked]{--un-bg-opacity:1;background-color:rgb(212 212 212 / var(--un-bg-opacity))}.bg-neutral-400,.dark [bg~="dark:neutral-400"],[bg~=neutral-400]{--un-bg-opacity:1;background-color:rgb(163 163 163 / var(--un-bg-opacity))}.bg-neutral-50,[bg~=neutral-50]{--un-bg-opacity:1;background-color:rgb(250 250 250 / var(--un-bg-opacity))}.bg-neutral-600,.dark .dark\:bg-neutral-600{--un-bg-opacity:1;background-color:rgb(82 82 82 / var(--un-bg-opacity))}.bg-neutral-800,.dark .dark\:bg-neutral-800,.dark [bg~="dark:data-[state=unchecked]:neutral-800"][data-state=unchecked],.dark [bg~="dark:neutral-800"]{--un-bg-opacity:1;background-color:rgb(38 38 38 / var(--un-bg-opacity))}.bg-primary{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-100,[bg-primary-100=""],[bg~=primary-100]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity)) 80%,oklch(100% 0 360 / var(--un-bg-opacity)))}.bg-primary-100\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .1) 80%,oklch(100% 0 360 / .1))}.bg-primary-100\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / 1) 80%,oklch(100% 0 360 / 1))}.bg-primary-100\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .2) 80%,oklch(100% 0 360 / .2))}.bg-primary-100\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .3) 80%,oklch(100% 0 360 / .3))}.bg-primary-100\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .4) 80%,oklch(100% 0 360 / .4))}.bg-primary-100\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .05) 80%,oklch(100% 0 360 / .05))}.bg-primary-100\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .5) 80%,oklch(100% 0 360 / .5))}.bg-primary-100\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .6) 80%,oklch(100% 0 360 / .6))}.bg-primary-100\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .7) 80%,oklch(100% 0 360 / .7))}.bg-primary-100\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .8) 80%,oklch(100% 0 360 / .8))}.bg-primary-100\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / .9) 80%,oklch(100% 0 360 / .9))}.bg-primary-200,[bg-primary-200=""]{--un-bg-opacity:1;background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-200\/10{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary-200\/100{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary-200\/20{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary-200\/30{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary-200\/40{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary-200\/5{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary-200\/50{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary-200\/60{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary-200\/70{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary-200\/80{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary-200\/90{background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .9)}.bg-primary-300,[bg-primary-300=""]{--un-bg-opacity:1;background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-300\/10{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary-300\/100{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary-300\/20{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary-300\/30{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary-300\/40{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary-300\/5{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary-300\/50{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary-300\/60{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary-300\/70{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary-300\/80{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary-300\/90{background-color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .9)}.bg-primary-400,.dark .dark\:bg-primary-400,.dark [bg~="dark:primary-400"],[bg-primary-400=""],[bg~="data-[state=checked]:primary-400"][data-state=checked],[bg~=primary-400]{--un-bg-opacity:1;background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-400\/10{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary-400\/100{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary-400\/20,.dark [bg~="dark:primary-400/20"]{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary-400\/30{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary-400\/40{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary-400\/5{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary-400\/50{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary-400\/60{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary-400\/70{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary-400\/80,.dark [bg~="data-[state=checked]:dark:primary-400/80"][data-state=checked]{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary-400\/90{background-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .9)}.bg-primary-50,[bg-primary-50=""],[bg~=primary-50]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity)) 30%,oklch(100% 0 360 / var(--un-bg-opacity)))}.bg-primary-50\/10{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .1) 30%,oklch(100% 0 360 / .1))}.bg-primary-50\/100{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / 1) 30%,oklch(100% 0 360 / 1))}.bg-primary-50\/20{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .2) 30%,oklch(100% 0 360 / .2))}.bg-primary-50\/30{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .3) 30%,oklch(100% 0 360 / .3))}.bg-primary-50\/40{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .4) 30%,oklch(100% 0 360 / .4))}.bg-primary-50\/5{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .05) 30%,oklch(100% 0 360 / .05))}.bg-primary-50\/50{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .5) 30%,oklch(100% 0 360 / .5))}.bg-primary-50\/60{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .6) 30%,oklch(100% 0 360 / .6))}.bg-primary-50\/70{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .7) 30%,oklch(100% 0 360 / .7))}.bg-primary-50\/80{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .8) 30%,oklch(100% 0 360 / .8))}.bg-primary-50\/90{background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-50) calc(var(--chromatic-hue) + 0) / .9) 30%,oklch(100% 0 360 / .9))}.bg-primary-500,.dark [bg~="dark:primary-500"],[bg-primary-500=""],[bg~=primary-500],.peer:checked~.peer-checked\:bg-primary-500{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-500\/10,[bg~="primary-500/10"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary-500\/100{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary-500\/20,[bg~="primary-500/20"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary-500\/30,[bg~="primary-500/30"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary-500\/40,[bg~="primary-500/40"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary-500\/5,[bg~="primary-500/5"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary-500\/50,[bg~="primary-500/50"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary-500\/60,[bg~="primary-500/60"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary-500\/70,[bg~="primary-500/70"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary-500\/80,[bg~="primary-500/80"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary-500\/90,[bg~="primary-500/90"]{background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .9)}.bg-primary-600,[bg-primary-600=""]{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-600\/10{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary-600\/100{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary-600\/20{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary-600\/30{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary-600\/40{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary-600\/5{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary-600\/50{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary-600\/60{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary-600\/70{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary-600\/80{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary-600\/90{background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .9)}.bg-primary-700,.dark .dark\:bg-primary-700,.dark [dark\:bg-primary-700=""],[bg-primary-700=""]{--un-bg-opacity:1;background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-700\/10{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary-700\/100{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary-700\/20{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary-700\/30{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary-700\/40{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary-700\/5{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary-700\/50{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary-700\/60{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary-700\/70{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary-700\/80{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary-700\/90{background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / .9)}.bg-primary-800,[bg-primary-800=""]{--un-bg-opacity:1;background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-800\/10{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary-800\/100{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary-800\/20{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary-800\/30{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary-800\/40{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary-800\/5{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary-800\/50{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary-800\/60{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary-800\/70{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary-800\/80{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary-800\/90{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .9)}.bg-primary-900,.dark .dark\:bg-primary-900,[bg-primary-900=""]{--un-bg-opacity:1;background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-900\/10{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary-900\/100{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary-900\/20,.dark .dark\:bg-primary-900\/20{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary-900\/30,.dark .dark\:bg-primary-900\/30{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary-900\/40,.dark .dark\:bg-primary-900\/40,.dark [bg~="dark:primary-900/40"]{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary-900\/5,.dark .dark\:bg-primary-900\/5{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary-900\/50{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary-900\/60{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary-900\/70{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary-900\/80{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary-900\/90{background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / .9)}.bg-primary-950,.dark .dark\:bg-primary-950,.dark [bg~="dark:primary-950"],[bg-primary-950=""]{--un-bg-opacity:1;background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.bg-primary-950\/10{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary-950\/100{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary-950\/20{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary-950\/30{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary-950\/40{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary-950\/5{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary-950\/50{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary-950\/60{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary-950\/70{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary-950\/80{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary-950\/90{background-color:oklch(29% var(--chromatic-chroma-950) calc(var(--chromatic-hue) + 0) / .9)}.bg-primary\/10{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .1)}.bg-primary\/100{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / 1)}.bg-primary\/20{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .2)}.bg-primary\/30{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .3)}.bg-primary\/40{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .4)}.bg-primary\/5{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .05)}.bg-primary\/50{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .5)}.bg-primary\/60{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .6)}.bg-primary\/70{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .7)}.bg-primary\/80{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .8)}.bg-primary\/90{background-color:oklch(62% var(--chromatic-chroma) calc(var(--chromatic-hue) + 0) / .9)}.bg-red-50{--un-bg-opacity:1;background-color:rgb(254 242 242 / var(--un-bg-opacity))}.bg-red-500{--un-bg-opacity:1;background-color:rgb(239 68 68 / var(--un-bg-opacity))}.bg-red900{--un-bg-opacity:1;background-color:rgb(127 29 29 / var(--un-bg-opacity))}.bg-transparent,.dark [bg~="dark:transparent"],[bg-transparent=""],[bg~=transparent]{background-color:transparent}.bg-white,[bg-white=""],[bg~=white]{--un-bg-opacity:1;background-color:rgb(255 255 255 / var(--un-bg-opacity))}.bg-white\/60,[bg~="white/60"]{background-color:#fff9}.bg-white\/80{background-color:#fffc}.dark .dark\:bg-amber-900\/20{background-color:#78350f33}.dark .dark\:bg-amber-900\/30{background-color:#78350f4d}.dark .dark\:bg-black\/30,.dark [bg~="dark:black/30"]{background-color:#0000004d}.dark .dark\:bg-black\/40{background-color:#0006}.dark .dark\:bg-neutral-700,.dark [bg~="dark:neutral-700"],.dark [dark\:bg-neutral-700=""],[bg~=neutral-700]{--un-bg-opacity:1;background-color:rgb(64 64 64 / var(--un-bg-opacity))}.dark .dark\:bg-neutral-700\/50{background-color:#40404080}.dark .dark\:bg-neutral-800\/50,.dark [bg~="dark:neutral-800/50"]{background-color:#26262680}.dark .dark\:bg-neutral-900,.dark [bg~="dark:neutral-900"]{--un-bg-opacity:1;background-color:rgb(23 23 23 / var(--un-bg-opacity))}.dark .dark\:bg-neutral-900\/20{background-color:#17171733}.dark .dark\:bg-red-400{--un-bg-opacity:1;background-color:rgb(248 113 113 / var(--un-bg-opacity))}.dark .dark\:bg-red-900\/20{background-color:#7f1d1d33}.dark [bg~="dark:[#4e34b9]"]{--un-bg-opacity:1;background-color:rgb(78 52 185 / var(--un-bg-opacity))}.dark [bg~="dark:[#676085]"]{--un-bg-opacity:1;background-color:rgb(103 96 133 / var(--un-bg-opacity))}.dark [bg~="dark:[rgba(0,0,0,0.3)]"]{--un-bg-opacity:.3;background-color:rgba(0,0,0,var(--un-bg-opacity))}.dark [bg~="dark:black/20"],.group:hover [bg~="group-hover:black/20"]{background-color:#0003}.dark [bg~="dark:blue-900"]{--un-bg-opacity:1;background-color:rgb(30 58 138 / var(--un-bg-opacity))}.dark [bg~="dark:complementary-800"]{--un-bg-opacity:1;background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 180) / var(--un-bg-opacity))}.dark [bg~="dark:cyan-900"]{--un-bg-opacity:1;background-color:rgb(22 78 99 / var(--un-bg-opacity))}.dark [bg~="dark:green-600"]{--un-bg-opacity:1;background-color:rgb(22 163 74 / var(--un-bg-opacity))}.dark [bg~="dark:neutral-500"]{--un-bg-opacity:1;background-color:rgb(115 115 115 / var(--un-bg-opacity))}.dark [bg~="dark:neutral-900/50"]{background-color:#17171780}.dark [bg~="dark:neutral-900/70"]{background-color:#171717b3}.dark [bg~="dark:neutral-950"]{--un-bg-opacity:1;background-color:rgb(10 10 10 / var(--un-bg-opacity))}.dark [bg~="dark:orange-900/20"]{background-color:#7c2d1233}.dark [bg~="dark:primary-800/25"]{background-color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / .25)}[bg~="[#cabeff]"]{--un-bg-opacity:1;background-color:rgb(202 190 255 / var(--un-bg-opacity))}[bg~="[#e6e1fc]"]{--un-bg-opacity:1;background-color:rgb(230 225 252 / var(--un-bg-opacity))}[bg~="$bg-color"]{background-color:var(--bg-color)}[bg~="black/0"]{background-color:#0000}[bg~=blue-100]{--un-bg-opacity:1;background-color:rgb(219 234 254 / var(--un-bg-opacity))}[bg~=complementary-100]{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 180) / var(--un-bg-opacity)) 80%,oklch(100% 0 360 / var(--un-bg-opacity)))}[bg~=emerald-500]{--un-bg-opacity:1;background-color:rgb(16 185 129 / var(--un-bg-opacity))}[bg~="gray-200/30"]{background-color:#e5e7eb4d}[bg~=green-500]{--un-bg-opacity:1;background-color:rgb(34 197 94 / var(--un-bg-opacity))}[bg~=inherit]{background-color:inherit}[bg~="neutral-100/70"]{background-color:#f5f5f5b3}[bg~="neutral-200/20"]{background-color:#e5e5e533}[bg~="neutral-200/50"]{background-color:#e5e5e580}[bg~="neutral-50/50"]{background-color:#fafafa80}[bg~=orange-50]{--un-bg-opacity:1;background-color:rgb(255 247 237 / var(--un-bg-opacity))}[bg~="white/70"]{background-color:#ffffffb3}.dark [dark\:bg-neutral-700~="default:"]:default{--un-bg-opacity:1;background-color:rgb(64 64 64 / var(--un-bg-opacity))}.dark [dark\:bg-neutral-700~="checked:"]:checked{--un-bg-opacity:1;background-color:rgb(64 64 64 / var(--un-bg-opacity))}.dark .\[\&_div_span\]\:dark\:hover\:bg-cyan-300:hover div span{--un-bg-opacity:1;background-color:rgb(103 232 249 / var(--un-bg-opacity))}.dark .\[\&_div_span\]\:dark\:hover\:bg-cyan-900:hover div span{--un-bg-opacity:1;background-color:rgb(22 78 99 / var(--un-bg-opacity))}.dark .dark\:hover\:bg-black\/40:hover{background-color:#0006}.dark .dark\:hover\:bg-neutral-500:hover{--un-bg-opacity:1;background-color:rgb(115 115 115 / var(--un-bg-opacity))}.dark .dark\:hover\:bg-neutral-600:hover{--un-bg-opacity:1;background-color:rgb(82 82 82 / var(--un-bg-opacity))}.dark .dark\:hover\:bg-neutral-800:hover{--un-bg-opacity:1;background-color:rgb(38 38 38 / var(--un-bg-opacity))}.dark .dark\:hover\:bg-primary-500:hover{--un-bg-opacity:1;background-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.dark .dark\:hover\:bg-red-500:hover{--un-bg-opacity:1;background-color:rgb(239 68 68 / var(--un-bg-opacity))}.dark [bg~="dark:hover:complementary-700"]:hover{--un-bg-opacity:1;background-color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 180) / var(--un-bg-opacity))}.dark [bg~="dark:hover:neutral-800"]:hover{--un-bg-opacity:1;background-color:rgb(38 38 38 / var(--un-bg-opacity))}.dark [bg~="dark:hover:primary-900"]:hover{--un-bg-opacity:1;background-color:oklch(37% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.dark [dark\:hover\:bg-cyan-300=""]:hover{--un-bg-opacity:1;background-color:rgb(103 232 249 / var(--un-bg-opacity))}.dark [hover~="dark:bg-black/40"]:hover{background-color:#0006}.dark [hover~="dark:bg-neutral-700"]:hover{--un-bg-opacity:1;background-color:rgb(64 64 64 / var(--un-bg-opacity))}.dark [hover~="dark:bg-neutral-700/50"]:hover{background-color:#40404080}.hover\:bg-neutral-100:hover{--un-bg-opacity:1;background-color:rgb(245 245 245 / var(--un-bg-opacity))}.hover\:bg-neutral-200:hover{--un-bg-opacity:1;background-color:rgb(229 229 229 / var(--un-bg-opacity))}.hover\:bg-neutral-300:hover{--un-bg-opacity:1;background-color:rgb(212 212 212 / var(--un-bg-opacity))}.hover\:bg-neutral-400:hover{--un-bg-opacity:1;background-color:rgb(163 163 163 / var(--un-bg-opacity))}.hover\:bg-neutral-50:hover{--un-bg-opacity:1;background-color:rgb(250 250 250 / var(--un-bg-opacity))}.hover\:bg-primary-600:hover{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}.hover\:bg-red-600:hover{--un-bg-opacity:1;background-color:rgb(220 38 38 / var(--un-bg-opacity))}.hover\:bg-white\/80:hover{background-color:#fffc}[bg~="hover:complementary-200"]:hover{--un-bg-opacity:1;background-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 180) / var(--un-bg-opacity))}[bg~="hover:emerald-600"]:hover{--un-bg-opacity:1;background-color:rgb(5 150 105 / var(--un-bg-opacity))}[bg~="hover:neutral-200"]:hover{--un-bg-opacity:1;background-color:rgb(229 229 229 / var(--un-bg-opacity))}[bg~="hover:primary-100"]:hover{--un-bg-opacity:1;background-color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity)) 80%,oklch(100% 0 360 / var(--un-bg-opacity)))}[hover\:bg-neutral-300=""]:hover{--un-bg-opacity:1;background-color:rgb(212 212 212 / var(--un-bg-opacity))}[hover\:bg-primary-600=""]:hover{--un-bg-opacity:1;background-color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / var(--un-bg-opacity))}[hover~=bg-neutral-200]:hover{--un-bg-opacity:1;background-color:rgb(229 229 229 / var(--un-bg-opacity))}[hover~="bg-white/80"]:hover{background-color:#fffc}.dark [bg~="dark:focus:neutral-900"]:focus{--un-bg-opacity:1;background-color:rgb(23 23 23 / var(--un-bg-opacity))}[bg~="focus:neutral-50"]:focus{--un-bg-opacity:1;background-color:rgb(250 250 250 / var(--un-bg-opacity))}.dark [bg~="dark:active:neutral-700"]:active{--un-bg-opacity:1;background-color:rgb(64 64 64 / var(--un-bg-opacity))}[bg~="active:gray-50"]:active{--un-bg-opacity:1;background-color:rgb(249 250 251 / var(--un-bg-opacity))}[bg~="active:neutral-300"]:active{--un-bg-opacity:1;background-color:rgb(212 212 212 / var(--un-bg-opacity))}.dark .dark\:disabled\:bg-neutral-800:disabled{--un-bg-opacity:1;background-color:rgb(38 38 38 / var(--un-bg-opacity))}.disabled\:bg-neutral-100:disabled{--un-bg-opacity:1;background-color:rgb(245 245 245 / var(--un-bg-opacity))}.after\:bg-white:after{--un-bg-opacity:1;background-color:rgb(255 255 255 / var(--un-bg-opacity))}.dark .dark\:from-primary-400\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.dark .dark\:from-primary-400\/20{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.from-primary-500{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-from-opacity, 1)) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.from-primary-500\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.from-primary-500\/20{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.before\:from-primary-500\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.dark .before\:dark\:from-primary-400\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.dark [before~="dark:from-primary-400/0"]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.dark [hover~="before:dark:from-primary-400/20"]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}[before~="from-primary-500/0"]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}[hover~="before:from-primary-500/20"]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.dark .dark\:via-primary-400\/10{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.via-primary-500\/10{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.before\:via-primary-500\/10:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.dark .before\:dark\:via-primary-400\/10:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.dark [hover~="before:dark:via-primary-400/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}[hover~="before:via-primary-500/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.dark .dark\:to-primary-400\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}.dark .dark\:to-transparent,.to-transparent{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.to-primary-400{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / var(--un-to-opacity, 1)) var(--un-gradient-to-position)}.to-primary-500\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}.before\:to-transparent:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.dark .before\:dark\:to-transparent:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.dark [before~="dark:to-primary-400/0"]:before{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}.dark [hover~="before:dark:to-transparent"]:hover:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}[before~="to-primary-500/0"]:before{--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / 0) var(--un-gradient-to-position)}[hover~="before:to-transparent"]:hover:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.bg-gradient-to-r{--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}.before\:bg-gradient-to-r:before{--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}[before~=bg-gradient-to-r]:before{--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}[hover~="before:bg-gradient-to-r"]:hover:before{--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.dark .dark\:fill-neutral-800,.dark [dark\:fill-neutral-800=""]{--un-fill-opacity:1;fill:rgb(38 38 38 / var(--un-fill-opacity))}.fill-white,[fill-white=""]{--un-fill-opacity:1;fill:rgb(255 255 255 / var(--un-fill-opacity))}[stroke-width~="2"]{stroke-width:2px}.object-cover,[object-cover=""]{object-fit:cover}.object-contain,[object-contain=""]{object-fit:contain}.p-1,[p-1=""]{padding:.25rem}.p-1\.5,[p-1\.5=""]{padding:.375rem}.p-2,.p2,[p-2=""],[p~="2"],[p2=""]{padding:.5rem}.p-2\.5{padding:.625rem}.p-3,[p-3=""]{padding:.75rem}.p-4,[p-4=""]{padding:1rem}.p-5,[p-5=""]{padding:1.25rem}.p-6{padding:1.5rem}.p-8,[p-8=""]{padding:2rem}.px,.px-4,[px-4=""],[px=""]{padding-left:1rem;padding-right:1rem}.px-0{padding-left:0;padding-right:0}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10,[px-10=""]{padding-left:2.5rem;padding-right:2.5rem}.px-2,.px2,[px-2=""],[px~="2"],[px2=""]{padding-left:.5rem;padding-right:.5rem}.px-3,[px-3=""]{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py,.py-4,[py~="4"]{padding-top:1rem;padding-bottom:1rem}.py-0\.5,[py-0\.5=""]{padding-top:.125rem;padding-bottom:.125rem}.py-1,.py1,[py-1=""],[py~="1"],[py1=""]{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5,[py-1\.5=""]{padding-top:.375rem;padding-bottom:.375rem}.py-2,[py-2=""]{padding-top:.5rem;padding-bottom:.5rem}.py-3,[py-3=""]{padding-top:.75rem;padding-bottom:.75rem}.py-6,[py-6=""]{padding-top:1.5rem;padding-bottom:1.5rem}[px~="12"]{padding-left:3rem;padding-right:3rem}.pb-0{padding-bottom:0}.pb-2,[pb-2=""]{padding-bottom:.5rem}.pb-4,[pb-4=""]{padding-bottom:1rem}.pb-6,[pb-6=""]{padding-bottom:1.5rem}.pl,.pl-4,[pl-4=""]{padding-left:1rem}.pl-10{padding-left:2.5rem}.pl-3,[pl-3=""]{padding-left:.75rem}.pl-5,[pl-5=""]{padding-left:1.25rem}.pr-\[20px\]{padding-right:20px}.pr-1,[pr-1=""]{padding-right:.25rem}.pr-4,[pr-4=""]{padding-right:1rem}.pt,.pt-4,[pt-4=""]{padding-top:1rem}.pt-0{padding-top:0}.pt-10,[pt-10=""]{padding-top:2.5rem}.pt-2,[pt-2=""]{padding-top:.5rem}.text-center,[text-center=""],[text~=center]{text-align:center}.text-left,[text-left=""]{text-align:left}.text-right,[text-right=""]{text-align:right}.text-wrap,[text-wrap=""]{text-wrap:wrap}.text-nowrap,[text-nowrap=""]{text-wrap:nowrap}.text-2xl,[text-2xl=""],[text~="2xl"]{font-size:1.5rem;line-height:2rem}.text-3xl,[text-3xl=""]{font-size:1.875rem;line-height:2.25rem}.text-5xl,[text-5xl=""]{font-size:3rem;line-height:1}.text-6xl,[text-6xl=""]{font-size:3.75rem;line-height:1}.text-base,[text-base=""],[text~=base]{font-size:1rem;line-height:1.5rem}.text-lg,[text-lg=""],[text~=lg]{font-size:1.125rem;line-height:1.75rem}.text-sm,[text-sm=""],[text~=sm]{font-size:.875rem;line-height:1.25rem}.text-xl,[text-xl=""]{font-size:1.25rem;line-height:1.75rem}.text-xs,[text-xs=""]{font-size:.75rem;line-height:1rem}[text~="4xl"]{font-size:2.25rem;line-height:2.5rem}[text~="60"]{font-size:15rem}.dark .dark\:text-amber-400{--un-text-opacity:1;color:rgb(251 191 36 / var(--un-text-opacity))}.dark .dark\:text-neutral-100,[text~=neutral-100]{--un-text-opacity:1;color:rgb(245 245 245 / var(--un-text-opacity))}.dark .dark\:text-neutral-200,.dark [dark\:text-neutral-200=""]{--un-text-opacity:1;color:rgb(229 229 229 / var(--un-text-opacity))}.dark .dark\:text-neutral-300,.dark [dark\:text-neutral-300=""],.dark [text~="dark:neutral-300"],[text~=neutral-300]{--un-text-opacity:1;color:rgb(212 212 212 / var(--un-text-opacity))}.dark .dark\:text-neutral-400,.dark [dark\:text-neutral-400=""],.dark [text~="dark:neutral-400"],.text-neutral-400,[text-neutral-400=""],[text~=neutral-400]{--un-text-opacity:1;color:rgb(163 163 163 / var(--un-text-opacity))}.dark .dark\:text-neutral-500,.dark [text~="dark:neutral-500"],.text-neutral-500,[text-neutral-500=""],[text~=neutral-500]{--un-text-opacity:1;color:rgb(115 115 115 / var(--un-text-opacity))}.dark .dark\:text-neutral-600,.text-neutral-600,[text~=neutral-600]{--un-text-opacity:1;color:rgb(82 82 82 / var(--un-text-opacity))}.dark .dark\:text-neutral-600\/20,.dark [text~="dark:neutral-600/20"]{color:#52525233}.dark .dark\:text-primary-300,.dark [text~="dark:primary-300"],.text-primary-300,[text~=primary-300]{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-primary-300\/80{color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .8)}.dark .dark\:text-primary-400,.dark [text~="dark:primary-400"],.text-primary-400{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-primary-500,.text-primary-500{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-primary-600,.text-primary-600,[text~=primary-600]{--un-text-opacity:1;color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-red-400{--un-text-opacity:1;color:rgb(248 113 113 / var(--un-text-opacity))}.dark .dark\:text-white,.dark [dark\:text-white=""],.dark [text~="dark:white"],.text-white,[text-white=""],[text~=white]{--un-text-opacity:1;color:rgb(255 255 255 / var(--un-text-opacity))}.dark .dark\:text-white\/50{color:#ffffff80}.dark [text~="dark:cyan-600/90"]{color:#0891b2e6}.dark [text~="dark:gray-200"]{--un-text-opacity:1;color:rgb(229 231 235 / var(--un-text-opacity))}.dark [text~="dark:neutral-600/50"]{color:#52525280}.dark [text~="dark:neutral-900"],.text-neutral-900{--un-text-opacity:1;color:rgb(23 23 23 / var(--un-text-opacity))}.dark [text~="dark:orange-500"]{--un-text-opacity:1;color:rgb(249 115 22 / var(--un-text-opacity))}.dark [text~="dark:primary-100"]{--un-text-opacity:1;color:color-mix(in srgb,oklch(95% var(--chromatic-chroma-100) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity)) 80%,oklch(100% 0 360 / var(--un-text-opacity)))}.dark [text~="dark:primary-300/50"]{color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .5)}.dark [text~="dark:primary-600/90"]{color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .9)}.dark [text~="dark:violet-600/90"]{color:#7c3aede6}.text-amber-500{--un-text-opacity:1;color:rgb(245 158 11 / var(--un-text-opacity))}.text-amber-600{--un-text-opacity:1;color:rgb(217 119 6 / var(--un-text-opacity))}.text-black,[text-black=""]{--un-text-opacity:1;color:rgb(0 0 0 / var(--un-text-opacity))}.text-blue-500{--un-text-opacity:1;color:rgb(59 130 246 / var(--un-text-opacity))}.text-neutral-200\/50,[text~="neutral-200/50"]{color:#e5e5e580}.text-neutral-400\/50,[text~="neutral-400/50"]{color:#a3a3a380}.text-neutral-500\/50,[text~="neutral-500/50"]{color:#73737380}.text-neutral-700,[text-neutral-700=""]{--un-text-opacity:1;color:rgb(64 64 64 / var(--un-text-opacity))}.text-primary-600\/80{color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .8)}.text-primary-700,[text~=primary-700]{--un-text-opacity:1;color:oklch(49% var(--chromatic-chroma-700) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.text-red-500{--un-text-opacity:1;color:rgb(239 68 68 / var(--un-text-opacity))}.text-red-600{--un-text-opacity:1;color:rgb(220 38 38 / var(--un-text-opacity))}.text-transparent{color:transparent}.text-violet-500,[text-violet-500=""]{--un-text-opacity:1;color:rgb(139 92 246 / var(--un-text-opacity))}[text~=complementary-400]{--un-text-opacity:1;color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 180) / var(--un-text-opacity))}[text~=cyan-400]{--un-text-opacity:1;color:rgb(34 211 238 / var(--un-text-opacity))}[text~="cyan-400/90"]{color:#22d3eee6}[text~=gray-700]{--un-text-opacity:1;color:rgb(55 65 81 / var(--un-text-opacity))}[text~=orange-700]{--un-text-opacity:1;color:rgb(194 65 12 / var(--un-text-opacity))}[text~="primary-400/90"]{color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .9)}[text~=primary-800]{--un-text-opacity:1;color:oklch(42% var(--chromatic-chroma-800) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}[text~="violet-400/90"]{color:#a78bfae6}.dark .dark\:hover\:text-neutral-300:hover{--un-text-opacity:1;color:rgb(212 212 212 / var(--un-text-opacity))}.dark [hover~="dark:text-primary-300/80"]:hover{color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .8)}.dark [text~="dark:hover:primary-500"]:hover{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.hover\:text-neutral-700:hover{--un-text-opacity:1;color:rgb(64 64 64 / var(--un-text-opacity))}[hover~="text-primary-600/80"]:hover{color:oklch(54% var(--chromatic-chroma-600) calc(var(--chromatic-hue) + 0) / .8)}[text~="hover:primary-500"]:hover{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.dark .dark\:disabled\:text-neutral-600:disabled{--un-text-opacity:1;color:rgb(82 82 82 / var(--un-text-opacity))}.dark [text~="dark:disabled:neutral-600"]:disabled{--un-text-opacity:1;color:rgb(82 82 82 / var(--un-text-opacity))}.disabled\:text-neutral-400:disabled{--un-text-opacity:1;color:rgb(163 163 163 / var(--un-text-opacity))}[text~="disabled:neutral-400"]:disabled{--un-text-opacity:1;color:rgb(163 163 163 / var(--un-text-opacity))}.dark [text~="placeholder:dark:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.dark [text~="placeholder:dark:primary-300/50"]::placeholder{color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / .5)}[text~="placeholder:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}[text~="placeholder:primary-300"]::placeholder{--un-text-opacity:1;color:oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-text-opacity))}.font-bold,[font-bold=""]{font-weight:700}.font-medium,[font-medium=""]{font-weight:500}.font-semibold,[font-semibold=""]{font-weight:600}.font-thin,[font-thin=""]{font-weight:100}.leading-10,.lh-10{line-height:2.5rem}[leading~="[0.75]"]{line-height:.75}[leading~="[1]"]{line-height:1}.font-cute,[font-cute=""]{font-family:Kiwi Maru}.font-cuteen,[font-cuteen=""]{font-family:Sniglet}.font-jura,[font-jura=""]{font-family:Jura}.font-mono,[font-mono=""]{font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-quicksand,[font-quicksand=""]{font-family:Quicksand}.font-sans,[font-sans=""]{font-family:DM Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.font-italic,.italic,[font-italic=""]{font-style:italic}.underline,[underline=""]{text-decoration-line:underline}.tab,[aria-checked~=tab][aria-checked=true],[tab=""]{-moz-tab-size:4;-o-tab-size:4;tab-size:4}[checked~=tab]:checked{-moz-tab-size:4;-o-tab-size:4;tab-size:4}.text-stroke-1,[text-stroke-1=""]{-webkit-text-stroke-width:1px}.text-shadow{--un-text-shadow:0 0 1px var(--un-text-shadow-color, rgb(0 0 0 / .2)),0 0 1px var(--un-text-shadow-color, rgb(1 0 5 / .1));text-shadow:var(--un-text-shadow)}.\[\&\:checked\+div_\.radio-dot\]\:opacity-100:checked+div .radio-dot,.opacity-100,.group:hover .group-hover\:opacity-100,.group:hover [group-hover\:opacity-100=""]{opacity:1}.op-0,.opacity-0,[opacity-0=""]{opacity:0}.op50,.opacity-50,[op50=""]{opacity:.5}.opacity-25{opacity:.25}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-95,[opacity-95=""]{opacity:.95}[hover~=opacity-100]:hover{opacity:1}.disabled\:opacity-50:disabled{opacity:.5}[disabled\:opacity-50=""]:disabled{opacity:.5}.before\:opacity-100:before{opacity:1}[before~=opacity-0]:before{opacity:0}[hover~="before:opacity-100"]:hover:before{opacity:1}.mix-blend-screen,[mix-blend-screen=""]{mix-blend-mode:screen}.dark .dark\:shadow-lg,.shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark [shadow~="dark:none"]{--un-shadow:0 0 var(--un-shadow-color, rgb(0 0 0 / 0));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-md,[shadow-md=""],[shadow~=md]{--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-sm,[shadow-sm=""],[shadow~=sm]{--un-shadow:var(--un-shadow-inset) 0 1px 2px 0 var(--un-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-xl,[shadow-xl=""]{--un-shadow:var(--un-shadow-inset) 0 20px 25px -5px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 8px 10px -6px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}[shadow~="cyan-200/50"]{--un-shadow-color:rgb(165 243 252 / .5) }[shadow~="primary-200/50"]{--un-shadow-color:oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / .5) }[shadow~="violet-200/50"]{--un-shadow-color:rgb(221 214 254 / .5) }.focus-within\:shadow-neutral-800:focus-within{--un-shadow-opacity:1;--un-shadow-color:rgb(38 38 38 / var(--un-shadow-opacity)) }[shadow~="focus-within:[0_0_0_1px]"]:focus-within{--un-shadow:0 0 0 1px var(--un-shadow-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.dark [hover~="dark:shadow-lg"]:hover{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}[hover~=shadow-md]:hover{--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline{outline-style:solid}.outline-none,[outline-none=""]{outline:2px solid transparent;outline-offset:2px}[outline~="focus-within:none"]:focus-within{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--un-ring-width:2px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.focus\:ring-offset-2:focus{--un-ring-offset-width:2px}.dark .dark\:focus\:ring-neutral-600\/50:focus{--un-ring-color:rgb(82 82 82 / .5) }.dark .dark\:focus\:ring-primary-400\/50:focus{--un-ring-color:oklch(74% var(--chromatic-chroma-400) calc(var(--chromatic-hue) + 0) / .5) }.dark .dark\:focus\:ring-red-500\/50:focus{--un-ring-color:rgb(239 68 68 / .5) }.focus\:ring-black\/10:focus{--un-ring-color:rgb(0 0 0 / .1) }.focus\:ring-neutral-300\/50:focus{--un-ring-color:rgb(212 212 212 / .5) }.focus\:ring-primary-500\/50:focus{--un-ring-color:oklch(62% var(--chromatic-chroma-500) calc(var(--chromatic-hue) + 0) / .5) }.focus\:ring-red-600\/50:focus{--un-ring-color:rgb(220 38 38 / .5) }.dark .dark\:focus\:ring-offset-neutral-900:focus{--un-ring-offset-opacity:1;--un-ring-offset-color:rgb(23 23 23 / var(--un-ring-offset-opacity)) }.focus\:ring-offset-white:focus{--un-ring-offset-opacity:1;--un-ring-offset-color:rgb(255 255 255 / var(--un-ring-offset-opacity)) }.backdrop-blur-sm,[backdrop-blur-sm=""]{--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-xl,[backdrop-blur-xl=""]{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.blur{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.drop-shadow{--un-drop-shadow:drop-shadow(0 1px 2px var(--un-drop-shadow-color, rgb(0 0 0 / .1))) drop-shadow(0 1px 1px var(--un-drop-shadow-color, rgb(0 0 0 / .06)));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}[drop-shadow~=none],.dark [drop-shadow~="dark:hover:none"]:hover{--un-drop-shadow:drop-shadow(0 0 var(--un-drop-shadow-color, rgb(0 0 0 / 0)));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}[drop-shadow~="hover:[0px_4px_4px_rgba(220,220,220,0.4)]"]:hover{--un-drop-shadow:drop-shadow(0px 4px 4px rgba(220,220,220,.4));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}[drop-shadow~="active:[0px_0px_0px_rgba(220,220,220,0.25)]"]:active{--un-drop-shadow:drop-shadow(0px 0px 0px rgba(220,220,220,.25));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.\[\&_\.provider-icon\]\:grayscale-100 .provider-icon,.grayscale-100,[grayscale-100=""]{--un-grayscale:grayscale(1);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.\[\&_\.provider-icon\]\:hover\:grayscale-0:hover .provider-icon{--un-grayscale:grayscale(0);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.filter{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,margin\]{transition-property:width,margin;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all,[transition-all=""],[transition~=all]{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors,[transition-colors=""],[transition~=colors]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity,[transition-opacity=""]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform,[transition~=transform]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[transition~="100"]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}[transition~=border]{transition-property:border;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[transition~="placeholder:all"]::placeholder{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[before~=transition-all]:before{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:transition-all:after{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[after~=transition-all]:after{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200,[duration-200=""],[transition~=duration-200]{transition-duration:.2s}.duration-250,[duration-250=""],[duration~="250"],[transition~=duration-250]{transition-duration:.25s}.duration-300,[transition~=duration-300]{transition-duration:.3s}.duration-400,[transition~=duration-400]{transition-duration:.4s}.duration-500,[duration-500=""],[duration~="500"],[transition~=duration-500]{transition-duration:.5s}[duration~="10"]{transition-duration:10ms}[duration~="1000"]{transition-duration:1s}.placeholder\:duration-250::placeholder{transition-duration:.25s}[placeholder\:duration-250=""]::placeholder{transition-duration:.25s}[transition~="placeholder:duration-250"]::placeholder{transition-duration:.25s}[before~=duration-400]:before{transition-duration:.4s}[after~=duration-400]:after{transition-duration:.4s}[delay~="10"]{transition-delay:10ms}[delay~="11"]{transition-delay:11ms}[delay~="19"]{transition-delay:19ms}[delay~="2"]{transition-delay:2ms}[delay~="20"]{transition-delay:20ms}[delay~="3"]{transition-delay:3ms}[delay~="4"]{transition-delay:4ms}[delay~="5"]{transition-delay:5ms}[delay~="50"]{transition-delay:50ms}[delay~="6"]{transition-delay:6ms}[delay~="7"]{transition-delay:7ms}[delay~="8"]{transition-delay:8ms}[delay~="9"]{transition-delay:9ms}.ease,.ease-in-out,[ease-in-out=""],[transition~=ease-in-out]{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-linear,[ease-linear=""]{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.placeholder\:ease-in-out::placeholder{transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition~="placeholder:ease-in-out"]::placeholder{transition-timing-function:cubic-bezier(.4,0,.2,1)}[before~=ease-in-out]:before{transition-timing-function:cubic-bezier(.4,0,.2,1)}[after~=ease-in-out]:after{transition-timing-function:cubic-bezier(.4,0,.2,1)}.will-change-transform,[will-change-transform=""]{will-change:transform}.after\:content-\[\'\'\]:after{content:""}.content-empty{content:""}[before~=content-empty]:before{content:""}[after~=content-empty]:after{content:""}.hidden,[hidden=""]{display:none}.bg-dotted-\[neutral-200\/60\]{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.6}.bg-dotted-\[neutral-200\/80\]{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.8}.dark .dark\:bg-dotted-\[neutral-700\/25\]{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.25}.dark .dark\:bg-dotted-\[neutral-700\/40\]{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.4}.dark .dark\:hover\:bg-dotted-\[primary-200\/20\]:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}.hover\:bg-dotted-\[primary-300\/50\]:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}.after\:bg-dotted-\[primary-300\/50\]:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}.dark .dark\:after\:bg-dotted-\[primary-200\/20\]:after{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}.dark [hover~="dark:after:bg-dotted-[primary-200/20]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--chromatic-chroma-200) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}[after~="bg-dotted-[neutral-200/80]"]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.8}[hover~="after:bg-dotted-[primary-300/50]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--chromatic-chroma-300) calc(var(--chromatic-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:%alpha}.transition-colors-none{transition-property:color,background-color,border-color,text-color;transition-duration:0s}.placeholder\:transition-colors-none::placeholder{transition-property:color,background-color,border-color,text-color;transition-duration:0s}@media (max-width: 1023.9px){[min-w~="t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var r=(e,t,o)=>c(e,typeof t!="symbol"?t+"":t,o);class s extends Error{constructor(o,a){super(o);r(this,"response");this.name="XSAIError",this.response=a}}const d=e=>e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`),b=e=>Object.fromEntries(Object.entries(e).map(([t,o])=>[d(t),o])),n=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),h=e=>JSON.stringify(b(n({...e,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),m=(e,t)=>n({Authorization:t!==void 0?`Bearer ${t}`:void 0,...e}),w=(e,t)=>{const o=t.toString();return new URL(e,o.endsWith("/")?o:`${o}/`)},p=async e=>{if(!e.ok)throw new s(`Remote sent ${e.status} response: ${await e.text()}`,e);if(!e.body)throw new s("Response body is empty from remote server",e);if(!(e.body instanceof ReadableStream))throw new s(`Expected Response body to be a ReadableStream, but got ${String(e.body)}; Content Type is ${e.headers.get("Content-Type")}`,e);return e},S=async e=>p(e).then(async t=>{const o=await t.text();try{return JSON.parse(o)}catch{throw new Error(`Failed to parse response, response body: ${o}`)}});export{m as a,h as b,n as c,p as d,S as e,b as o,w as r}; diff --git a/assets/index-WGruJeDd.js b/assets/index-WGruJeDd.js deleted file mode 100644 index 85443d9c896b3238b55f72f01fe4deab9f2fa48e..0000000000000000000000000000000000000000 --- a/assets/index-WGruJeDd.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{d as E,be as I,c as f,o as r,u as t,bA as Z,$ as P,cn as W,a0 as Y,e as F,w as q,co as G,b as l,bf as A,W as H,bg as u,a as m,bh as O,ca as K,ci as g,Y as N,c3 as U,c4 as V,cc as Q,b_ as X,c0 as ee,c8 as te,c2 as oe}from"./index-D7HCX4VR.js";/* empty css */import{l as ie,J as ne}from"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{_ as ae,a as le}from"./Model.vue_vue_type_script_setup_true_lang-CrmnRvJ7.js";import"./three-vrm.module-DiGxQJqt.js";import{d as z,e as se}from"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{V as re}from"./browser-CkchkNbv.js";import{_ as de}from"./IconAnimation.vue_vue_type_script_setup_true_lang-z-t1ytxo.js";import{_ as B,a as ce}from"./ColorPalette.vue_vue_type_script_setup_true_lang-Dcu1mOYZ.js";import{u as ue}from"./useIconAnimation-1wS_J1WT.js";import{b as D}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./index-Cynu-bMx.js";const me=["disabled"],h=E({__name:"Live2DModelControlButton",emits:["click"],setup(j){const s=I();return(d,i)=>(r(),f("button",{disabled:t(s).loadingLive2dModel,bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250",rounded:"",onClick:i[0]||(i[0]=p=>d.$emit("click"))},[Z(d.$slots,"default")],8,me))}}),fe={flex:"~ col gap-2"},pe={flex:"","items-center":"","gap-2":""},ve=["disabled","placeholder"],_e={"font-medium":"","font-mono":""},be={flex:"","gap-2":""},ge=["onUpdate:modelValue"],he=["href","download"],xe=E({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(j){const{t:s}=P(),d=W({accept:"application/zip"}),i=I(),{live2dModelFile:p,live2dMotionMap:v,live2dLoadSource:x,loadingLive2dModel:M,availableLive2dMotions:L,live2dModelUrl:k}=Y(i),b=F(k.value);d.onChange(o=>{o&&o.length>0&&(v.value={},p.value=o[0],x.value="file",M.value=!0)}),q(()=>i.loadingLive2dModel,o=>{o||x.value==="file"&&L.value.forEach(e=>{e.motionName in z?v.value[e.fileName]=e.motionName:v.value[e.fileName]=se})});async function y(o,e){if(!Object.keys(e).length)return o;const a=await new ne().loadAsync(o),c=Object.keys(a.files).find($=>$.endsWith("model3.json"));if(!c)throw new Error("model3.json not found");const J=await a.file(c).async("string"),R=JSON.parse(J),C={};Object.entries(e).forEach(([$,S])=>{if(C[S]){C[S].push({File:$});return}C[S]=[{File:$}]}),R.FileReferences.Motions=C,a.file(c,JSON.stringify(R,null,2));const T=await a.generateAsync({type:"blob"});return new File([T],o.name,{type:o.type,lastModified:o.lastModified})}async function _(){const o=await ie.getItem("live2dModel");if(!o)return;const e=await y(o,v.value);p.value=e,x.value="file",M.value=!0}const w=G(p);return(o,e)=>(r(),f("div",fe,[l(t(B),{title:t(s)("settings.live2d.change-model.title"),icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:u(()=>[m("div",pe,[O(m("input",{"onUpdate:modelValue":e[0]||(e[0]=n=>b.value=n),disabled:t(i).loadingLive2dModel,class:"form-control flex-1",border:"neutral-300 dark:neutral-800 solid 1 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out",placeholder:t(s)("settings.live2d.change-model.from-url-placeholder")},null,8,ve),[[K,b.value]]),l(h,{class:"form-control",onClick:e[1]||(e[1]=n=>k.value=b.value)},{default:u(()=>[g(N(t(s)("settings.live2d.change-model.from-url")),1)]),_:1})]),l(h,{class:"form-control place-self-end",onClick:e[2]||(e[2]=n=>t(d).open())},{default:u(()=>[g(N(t(s)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),l(h,{class:"form-control",onClick:e[3]||(e[3]=n=>o.$emit("extractColorsFromModel"))},{default:u(()=>e[4]||(e[4]=[g(" Extract colors from model ")])),_:1,__:[4]}),l(ce,{colors:j.palette.map(n=>({hex:n,name:n}))},null,8,["colors"])]),_:1},8,["title"]),t(i).live2dLoadSource==="file"?(r(),A(t(B),{key:0,title:t(s)("settings.live2d.edit-motion-map.title"),icon:"i-solar:face-scan-circle-bold-duotone"},{default:u(()=>{var n;return[(r(!0),f(U,null,V(t(i).availableLive2dMotions,a=>(r(),f("div",{key:a.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[m("span",_e,N(a.fileName),1),m("div",be,[O(m("select",{"onUpdate:modelValue":c=>t(i).live2dMotionMap[a.fileName]=c},[(r(!0),f(U,null,V(Object.keys(t(z)),c=>(r(),f("option",{key:c},N(c),1))),128))],8,ge),[[Q,t(i).live2dMotionMap[a.fileName]]]),l(h,{class:"form-control",onClick:c=>t(i).live2dCurrentMotion={group:a.motionName,index:a.motionIndex}},{default:u(()=>e[5]||(e[5]=[g(" Play ")])),_:2,__:[5]},1032,["onClick"])])]))),128)),l(h,{onClick:_},{default:u(()=>e[6]||(e[6]=[g(" Save and patch ")])),_:1,__:[6]}),m("a",{"mt-2":"",block:"",href:t(w),download:`${((n=t(i).live2dModelFile)==null?void 0:n.name)||"live2d"}-motion-edited.zip`},[l(h,{"w-full":""},{default:u(()=>e[7]||(e[7]=[g("Export")])),_:1,__:[7]})],8,he)]}),_:1},8,["title"])):H("",!0)]))}}),ye=X(xe,[["__scopeId","data-v-559b50a9"]]),Me={flex:"",class:"flex-col-reverse sm:flex-row"},ke={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},we=E({__name:"index",setup(j){const s=F(),d=F(),{width:i,height:p}=ee(s),v=F([]);async function x(){if(!d.value)return;const y=await d.value.captureFrame();if(!y){console.error("No frame captured");return}const _=URL.createObjectURL(y);try{const o=await new re(_).getPalette();v.value=Object.values(o).map(e=>e==null?void 0:e.hex).filter(e=>typeof e=="string")}finally{URL.revokeObjectURL(_)}}const{iconAnimationStarted:M,showIconAnimation:L,animationIcon:k}=ue("i-solar:people-nearby-bold-duotone"),b=te();return(y,_)=>{const w=oe("motion");return r(),f(U,null,[m("div",Me,[m("div",{ref_key:"live2dContainerRef",ref:s,w:"100% sm:50%",h:"50dvh sm:80dvh"},[l(t(le),{ref_key:"live2dCanvasRef",ref:d,width:t(i),height:t(p),resolution:2,"max-h":"100dvh"},{default:u(({app:o})=>[l(t(ae),{app:o,"mouth-open-size":0,width:t(i),height:t(p),paused:!1,"focus-at":{x:t(b).x.value,y:t(b).y.value}},null,8,["app","width","height","focus-at"])]),_:1},8,["width","height"])],512),l(ye,{w:"100% sm:50%",h:"50dvh sm:80dvh",palette:v.value,onExtractColorsFromModel:x},null,8,["palette"])]),t(L)?(r(),A(de,{key:0,"z-index":-1,icon:t(k),"icon-size":12,duration:1e3,started:t(M),"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((r(),f("div",ke,_[0]||(_[0]=[m("div",{text:"60","i-solar:people-nearby-bold-duotone":""},null,-1)]))),[[w]])],64)}}});typeof D=="function"&&D(we);export{we as default}; diff --git a/assets/index-c2ht1_hO.js b/assets/index-c2ht1_hO.js deleted file mode 100644 index 785d4fe4e5571bb4394b12b9d582d957e03ba9e7..0000000000000000000000000000000000000000 --- a/assets/index-c2ht1_hO.js +++ /dev/null @@ -1,532 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{a4 as Gn,e as W,f as ot,a5 as vs,a6 as Go,a7 as bs,w as Ke,a8 as ws,a9 as ks,U as Ot,u as H,aa as Ts,ab as Nr,ac as Yo,ad as _s,ae as cn,af as Ko,ag as ft,ah as Pe,ai as Fe,aj as xt,ak as pn,al as Ms,am as Es,an as As,ao as vt,ap as ae,aq as Ss,ar as On,as as Is,at as Qr,au as Rs,av as Cs,aw as Nt,ax as qo,ay as Jr,az as Wo,aA as Xo,aB as Zo,aC as Fn,aD as Lt,aE as Bn,aF as Qo,aG as Vt,aH as Ns,aI as tr,aJ as Ls,aK as Jo,aL as Yn,aM as Ht,aN as hn,aO as ea,aP as Ps,aQ as Pt,aR as Ds,aS as Os,aT as Fs,aU as Bs,aV as nr,aW as Et,aX as Dt,aY as $t,aZ as zs,a_ as Us,a$ as js,b0 as ta,b1 as ei,b2 as ti,b3 as zn,b4 as Ei,b5 as Ai,b6 as Si,b7 as Ii,b8 as Vs,b9 as Hs,ba as ni,bb as na,bc as $s,a0 as Ge,bd as rr,d as Be,$ as Zt,be as Wt,bf as Xt,o as J,bg as $e,b as Te,a as O,X as lt,bh as Mt,bi as ri,c as oe,W as at,Y as ve,bj as yt,bk as _t,bl as ii,bm as Kn,bn as ra,bo as Un,bp as Gs,bq as Ri,br as Ys,bs as ia,bt as mn,bu as Ks,bv as oi,bw as qs,bx as oa,by as At,bz as Ws,bA as qn,bB as aa,bC as Xs,bD as Zs,bE as Qs,bF as Js,bG as sa,bH as el,bI as tl,bJ as nl,bK as rl,bL as il,bM as ol,bN as al,bO as ir,bP as Lr,bQ as Pr,bR as Ci,bS as or,bT as sl,bU as ll,bV as ul,bW as cl,bX as fl,a3 as Dr,T as Wn,bY as dl,bZ as pl,b_ as gn,b$ as hl,c0 as la,c1 as ua,_ as jn,c2 as ca,c3 as ai,c4 as si,c5 as ml,c6 as ar,c7 as gl,c8 as yl}from"./index-D7HCX4VR.js";/* empty css */import{d as xl}from"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as Ni,V as vl,a as bl,c as wl,r as kl,b as Or,e as Tl}from"./three-vrm.module-DiGxQJqt.js";import{E as _l,a as Ml,b as El}from"./emotions-DWNSb738.js";import{m as Al,d as Sl}from"./mcp-DgU0tpf-.js";import{getImportUrlBundles as Il}from"./import-url-browser-CPN8ipMD.js";import{s as Gt,c as Li,u as Rl,g as Cl}from"./speech-D8cCufg2.js";import{u as Ln}from"./queue-31IhYt_K.js";import{u as Nl,a as Ll,b as Pl,l as Dl}from"./queues-CIntookp.js";import{l as Ol,u as li}from"./providers-DepZj6_J.js";import{s as Fl}from"./index-Dpfqqu9L.js";import{u as Bl}from"./airi-card-xdAfH1PV.js";import{_ as ui}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import{r as on,_ as zl,a as Ul}from"./Model.vue_vue_type_script_setup_true_lang-CrmnRvJ7.js";import{_ as fa}from"./Screen.vue_vue_type_script_setup_true_lang-CQ37H7oV.js";import{_ as Pi}from"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import{H as jl}from"./HeaderLink-BKV8TZb8.js";import{u as da}from"./consciousness-CZ80YtY5.js";import{_ as pa}from"./Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js";import{b as Di}from"./route-block-B_A1xBdJ.js";import"./duckdb-mvp-CaaD-olE.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";async function*Vl(e,t){const n=e.getReader();try{for(;;){const{done:r,value:i}=await n.read();if(r)return;yield t(i)}}finally{n.releaseLock()}}function Hl(e){const t=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(t);const n=[];for(let i=0;i<700;i+=80)n.push(t[i]);return t.map(i=>i**1.2).map(i=>i*1.2).reduce((i,o)=>i+o,0)/t.length/100}function $l(e){const t=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(t);const n=[];for(let u=0;u<700;u+=80)n.push(t[u]);const r=t.map(u=>u**1.5),i=Math.min(...r),a=Math.max(...r)-i;let s;return a===0?s=r.map(()=>0):s=r.map(u=>(u-i)/a),s.reduce((u,c)=>u+c,0)/t.length}function Gl(e,t="linear"){switch(t){case"linear":return Hl(e);case"minmax":return $l(e)}}const ha=Gn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:Gl})),Yl=Gn("SpeakingStore",()=>{const n=W(0),r=W(!1),i=ot(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function Tn(e,t,n){return t+n<0||t+n>=e.length-1?"":e[t+n]}function Kl(e){let t="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=Tn(r,s,1),u="literal",s++):l==="<"?u="special":l===">"&&(u="literal"),t==="literal"&&u==="special"?n!==""&&(await((i=e.onLiteral)==null?void 0:i.call(e,n)),n=""):t==="special"&&u==="literal"&&n!==""&&(n+=l,await((o=e.onSpecial)==null?void 0:o.call(e,n)),n=""),t==="literal"&&u==="literal"?(await((a=e.onLiteral)==null?void 0:a.call(e,l)),n=""):t==="special"&&u==="literal"?n="":n+=l,t=u}},async end(){var r,i;n!==""&&(t==="literal"?await((r=e.onLiteral)==null?void 0:r.call(e,n)):n.endsWith("|>")&&await((i=e.onSpecial)==null?void 0:i.call(e,n)))}}}const ql=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class yn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yn.prototype.normal={};yn.prototype.property={};yn.prototype.space=void 0;function ma(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yn(n,r,t)}function Fr(e){return e.toLowerCase()}class qe{constructor(t,n){this.attribute=n,this.property=t}}qe.prototype.attribute="";qe.prototype.booleanish=!1;qe.prototype.boolean=!1;qe.prototype.commaOrSpaceSeparated=!1;qe.prototype.commaSeparated=!1;qe.prototype.defined=!1;qe.prototype.mustUseProperty=!1;qe.prototype.number=!1;qe.prototype.overloadedBoolean=!1;qe.prototype.property="";qe.prototype.spaceSeparated=!1;qe.prototype.space=void 0;let Wl=0;const ce=Ft(),Le=Ft(),ga=Ft(),G=Ft(),Re=Ft(),Yt=Ft(),Ze=Ft();function Ft(){return 2**++Wl}const Br=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Le,commaOrSpaceSeparated:Ze,commaSeparated:Yt,number:G,overloadedBoolean:ga,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),sr=Object.keys(Br);class ci extends qe{constructor(t,n,r,i){let o=-1;if(super(t,n),Oi(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Jl.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Fi,nu);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Fi.test(o)){let a=o.replace(Ql,tu);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=ci}return new i(r,t)}function tu(e){return"-"+e.toLowerCase()}function nu(e){return e.charAt(1).toUpperCase()}const ru=ma([ya,Xl,ba,wa,ka],"html"),Ta=ma([ya,Zl,ba,wa,ka],"svg"),Bi={}.hasOwnProperty;function iu(e,t){const n=t||{};function r(i,...o){let a=r.invalid;const s=r.handlers;if(i&&Bi.call(i,e)){const l=String(i[e]);a=Bi.call(s,l)?s[l]:r.unknown}if(a)return a.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const ou=/^>|^->||--!>|"],su=["<",">"];function lu(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return Gt(o,Object.assign({},r.settings.characterReferences,{subset:su}))}}function uu(e,t,n,r){return""}function cu(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function fu(e){return e.join(" ").trim()}const du=/[ \t\n\f\r]/g;function fi(e){return typeof e=="object"?e.type==="text"?zi(e.value):!1:zi(e)}function zi(e){return e.replace(du,"")===""}const De=Ma(1),_a=Ma(-1),pu=[];function Ma(e){return t;function t(n,r,i){const o=n?n.children:pu;let a=(r||0)+e,s=o[a];if(!i)for(;s&&fi(s);)a+=e,s=o[a];return s}}const hu={}.hasOwnProperty;function Ea(e){return t;function t(n,r,i){return hu.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const di=Ea({body:gu,caption:lr,colgroup:lr,dd:bu,dt:vu,head:lr,html:mu,li:xu,optgroup:wu,option:ku,p:yu,rp:Ui,rt:Ui,tbody:_u,td:ji,tfoot:Mu,th:ji,thead:Tu,tr:Eu});function lr(e,t,n){const r=De(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&fi(r.value.charAt(0)))}function mu(e,t,n){const r=De(n,t);return!r||r.type!=="comment"}function gu(e,t,n){const r=De(n,t);return!r||r.type!=="comment"}function yu(e,t,n){const r=De(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function xu(e,t,n){const r=De(n,t);return!r||r.type==="element"&&r.tagName==="li"}function vu(e,t,n){const r=De(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function bu(e,t,n){const r=De(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Ui(e,t,n){const r=De(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function wu(e,t,n){const r=De(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function ku(e,t,n){const r=De(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Tu(e,t,n){const r=De(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function _u(e,t,n){const r=De(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Mu(e,t,n){return!De(n,t)}function Eu(e,t,n){const r=De(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function ji(e,t,n){const r=De(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Au=Ea({body:Ru,colgroup:Cu,head:Iu,html:Su,tbody:Nu});function Su(e){const t=De(e,-1);return!t||t.type!=="comment"}function Iu(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function Ru(e){const t=De(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&fi(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Cu(e,t,n){const r=_a(n,t),i=De(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&di(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Nu(e,t,n){const r=_a(n,t),i=De(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&di(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const _n={name:[[` -\f\r &/=>`.split(""),` -\f\r "&'/=>\``.split("")],[`\0 -\f\r "&'/<=>`.split(""),`\0 -\f\r "&'/<=>\``.split("")]],unquoted:[[` -\f\r &>`.split(""),`\0 -\f\r "&'<=>\``.split("")],[`\0 -\f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Lu(e,t,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let a=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const s=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=Ta);const u=Pu(r,e.properties),c=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,c&&(a=!1),(u||!o||!Au(e,t,n))&&(s.push("<",e.tagName,u?" "+u:""),a&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(c),!a&&(!o||!di(e,t,n))&&s.push(""),s.join("")}function Pu(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const o=Du(e,i,t[i]);o&&n.push(o)}}for(;++rLi(n,e.alternative)&&(a=e.alternative),s=a+Gt(n,Object.assign({},e.settings.characterReferences,{subset:(a==="'"?_n.single:_n.double)[i][o],attribute:!0}))+a),l+(s&&"="+s))}const Ou=["<","&"];function Aa(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Gt(e.value,Object.assign({},r.settings.characterReferences,{subset:Ou}))}function Fu(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Aa(e,t,n,r)}function Bu(e,t,n,r){return r.all(e)}const zu=iu("type",{invalid:Uu,unknown:ju,handlers:{comment:lu,doctype:uu,element:Lu,raw:Fu,root:Bu,text:Aa}});function Uu(e){throw new Error("Expected node, not `"+e+"`")}function ju(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Vu={},Hu={},$u=[];function Gu(e,t){const n=t||Vu,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Yu,all:Ku,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ql,characterReferences:n.characterReferences||Hu,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Ta:ru,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Yu(e,t,n){return zu(e,t,n,this)}function Ku(e){const t=[],n=e&&e.children||$u;let r=-1;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(ct(e,e.length,0,t),e):t}const $i={}.hasOwnProperty;function Qu(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Kt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ut=It(/[A-Za-z]/),Qe=It(/[\dA-Za-z]/),tc=It(/[#-'*+\--9=?A-Z^-~]/);function zr(e){return e!==null&&(e<32||e===127)}const Ur=It(/\d/),nc=It(/[\dA-Fa-f]/),rc=It(/[!-/:-@[-`{-~]/);function se(e){return e!==null&&e<-2}function Ye(e){return e!==null&&(e<0||e===32)}function _e(e){return e===-2||e===-1||e===32}const ic=It(new RegExp("\\p{P}|\\p{S}","u")),oc=It(/\s/);function It(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Jt(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ce(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return _e(l)?(e.enter(n),s(l)):t(l)}function s(l){return _e(l)&&o++a))return;const I=t.events.length;let v=I,g,m;for(;v--;)if(t.events[v][0]==="exit"&&t.events[v][1].type==="chunkFlow"){if(g){m=t.events[v][1].end;break}g=!0}for(k(r),h=I;h_;){const P=n[R];t.containerState=P[1],P[0].exit.call(t,e)}n.length=_}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function cc(e,t,n){return Ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yi(e){if(e===null||Ye(e)||oc(e))return 1;if(ic(e))return 2}function hi(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[n][1].start};Ki(f,-l),Ki(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=nt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=nt(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=nt(u,hi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=nt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=nt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,ct(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&_e(h)?Ce(e,S,"linePrefix",o+1)(h):S(h)}function S(h){return h===null||se(h)?e.check(qi,x,R)(h):(e.enter("codeFlowValue"),_(h))}function _(h){return h===null||se(h)?(e.exit("codeFlowValue"),S(h)):(e.consume(h),_)}function R(h){return e.exit("codeFenced"),t(h)}function P(h,I,v){let g=0;return m;function m(D){return h.enter("lineEnding"),h.consume(D),h.exit("lineEnding"),T}function T(D){return h.enter("codeFencedFence"),_e(D)?Ce(h,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):E(D)}function E(D){return D===s?(h.enter("codeFencedFenceSequence"),F(D)):v(D)}function F(D){return D===s?(g++,h.consume(D),F):g>=a?(h.exit("codeFencedFenceSequence"),_e(D)?Ce(h,j,"whitespace")(D):j(D)):v(D)}function j(D){return D===null||se(D)?(h.exit("codeFencedFence"),I(D)):v(D)}}}function kc(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const ur={name:"codeIndented",tokenize:_c},Tc={partial:!0,tokenize:Mc};function _c(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Ce(e,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):se(u)?e.attempt(Tc,a,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||se(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function Mc(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):se(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Ce(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):se(a)?i(a):n(a)}}const Ec={name:"codeText",previous:Sc,resolve:Ac,tokenize:Ic};function Ac(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse();const i=this.left.slice(t);return i.push(...this.right.slice(this.right.length-r+this.left.length).reverse()),i}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&an(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),an(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),an(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Pa(e,t,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(k){return k===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(k),e.exit(o),p):k===null||k===32||k===41||zr(k)?n(k):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),x(k))}function p(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===62?(e.exit("chunkString"),e.exit(s),p(k)):k===null||k===60||se(k)?n(k):(e.consume(k),k===92?y:d)}function y(k){return k===60||k===62||k===92?(e.consume(k),d):d(k)}function x(k){return!c&&(k===null||k===41||Ye(k))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(k)):c999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):se(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||se(d)||s++>999?(e.exit("chunkString"),c(d)):(e.consume(d),l||(l=!_e(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(e.consume(d),s++,f):f(d)}}function Oa(e,t,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===a?(e.exit(o),l(a)):p===null?n(p):se(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ce(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===a||p===null||se(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:c)}function f(p){return p===a||p===92?(e.consume(p),c):c(p)}}function fn(e,t){let n;return r;function r(i){return se(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_e(i)?Ce(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Fc={name:"definition",tokenize:zc},Bc={partial:!0,tokenize:Uc};function zc(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),a(d)}function a(d){return Da.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=Kt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return Ye(d)?fn(e,u)(d):u(d)}function u(d){return Pa(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(Bc,f,f)(d)}function f(d){return _e(d)?Ce(e,p,"whitespace")(d):p(d)}function p(d){return d===null||se(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function Uc(e,t,n){return r;function r(s){return Ye(s)?fn(e,i)(s):n(s)}function i(s){return Oa(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return _e(s)?Ce(e,a,"whitespace")(s):a(s)}function a(s){return s===null||se(s)?t(s):n(s)}}const jc={name:"hardBreakEscape",tokenize:Vc};function Vc(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return se(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Hc={name:"headingAtx",resolve:$c,tokenize:Gc};function $c(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ct(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Gc(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(e.consume(c),a):c===null||Ye(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||se(c)?(e.exit("atxHeading"),t(c)):_e(c)?Ce(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||Ye(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const Yc=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Xi=["pre","script","style","textarea"],Kc={concrete:!0,name:"htmlFlow",resolveTo:Xc,tokenize:Zc},qc={partial:!0,tokenize:Jc},Wc={partial:!0,tokenize:Qc};function Xc(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Zc(e,t,n){const r=this;let i,o,a,s,l;return u;function u(C){return c(C)}function c(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),f}function f(C){return C===33?(e.consume(C),p):C===47?(e.consume(C),o=!0,x):C===63?(e.consume(C),i=3,r.interrupt?t:M):ut(C)?(e.consume(C),a=String.fromCharCode(C),w):n(C)}function p(C){return C===45?(e.consume(C),i=2,d):C===91?(e.consume(C),i=5,s=0,y):ut(C)?(e.consume(C),i=4,r.interrupt?t:M):n(C)}function d(C){return C===45?(e.consume(C),r.interrupt?t:M):n(C)}function y(C){const he="CDATA[";return C===he.charCodeAt(s++)?(e.consume(C),s===he.length?r.interrupt?t:E:y):n(C)}function x(C){return ut(C)?(e.consume(C),a=String.fromCharCode(C),w):n(C)}function w(C){if(C===null||C===47||C===62||Ye(C)){const he=C===47,we=a.toLowerCase();return!he&&!o&&Xi.includes(we)?(i=1,r.interrupt?t(C):E(C)):Yc.includes(a.toLowerCase())?(i=6,he?(e.consume(C),k):r.interrupt?t(C):E(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?S(C):_(C))}return C===45||Qe(C)?(e.consume(C),a+=String.fromCharCode(C),w):n(C)}function k(C){return C===62?(e.consume(C),r.interrupt?t:E):n(C)}function S(C){return _e(C)?(e.consume(C),S):m(C)}function _(C){return C===47?(e.consume(C),m):C===58||C===95||ut(C)?(e.consume(C),R):_e(C)?(e.consume(C),_):m(C)}function R(C){return C===45||C===46||C===58||C===95||Qe(C)?(e.consume(C),R):P(C)}function P(C){return C===61?(e.consume(C),h):_e(C)?(e.consume(C),P):_(C)}function h(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),l=C,I):_e(C)?(e.consume(C),h):v(C)}function I(C){return C===l?(e.consume(C),l=null,g):C===null||se(C)?n(C):(e.consume(C),I)}function v(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Ye(C)?P(C):(e.consume(C),v)}function g(C){return C===47||C===62||_e(C)?_(C):n(C)}function m(C){return C===62?(e.consume(C),T):n(C)}function T(C){return C===null||se(C)?E(C):_e(C)?(e.consume(C),T):n(C)}function E(C){return C===45&&i===2?(e.consume(C),B):C===60&&i===1?(e.consume(C),X):C===62&&i===4?(e.consume(C),ie):C===63&&i===3?(e.consume(C),M):C===93&&i===5?(e.consume(C),Q):se(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(qc,Ee,F)(C)):C===null||se(C)?(e.exit("htmlFlowData"),F(C)):(e.consume(C),E)}function F(C){return e.check(Wc,j,Ee)(C)}function j(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),D}function D(C){return C===null||se(C)?F(C):(e.enter("htmlFlowData"),E(C))}function B(C){return C===45?(e.consume(C),M):E(C)}function X(C){return C===47?(e.consume(C),a="",re):E(C)}function re(C){if(C===62){const he=a.toLowerCase();return Xi.includes(he)?(e.consume(C),ie):E(C)}return ut(C)&&a.length<8?(e.consume(C),a+=String.fromCharCode(C),re):E(C)}function Q(C){return C===93?(e.consume(C),M):E(C)}function M(C){return C===62?(e.consume(C),ie):C===45&&i===2?(e.consume(C),M):E(C)}function ie(C){return C===null||se(C)?(e.exit("htmlFlowData"),Ee(C)):(e.consume(C),ie)}function Ee(C){return e.exit("htmlFlow"),t(C)}}function Qc(e,t,n){const r=this;return i;function i(a){return se(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Jc(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Xn,t,n)}}const ef={name:"htmlText",tokenize:tf};function tf(e,t,n){const r=this;let i,o,a;return s;function s(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),l}function l(M){return M===33?(e.consume(M),u):M===47?(e.consume(M),P):M===63?(e.consume(M),_):ut(M)?(e.consume(M),v):n(M)}function u(M){return M===45?(e.consume(M),c):M===91?(e.consume(M),o=0,y):ut(M)?(e.consume(M),S):n(M)}function c(M){return M===45?(e.consume(M),d):n(M)}function f(M){return M===null?n(M):M===45?(e.consume(M),p):se(M)?(a=f,X(M)):(e.consume(M),f)}function p(M){return M===45?(e.consume(M),d):f(M)}function d(M){return M===62?B(M):M===45?p(M):f(M)}function y(M){const ie="CDATA[";return M===ie.charCodeAt(o++)?(e.consume(M),o===ie.length?x:y):n(M)}function x(M){return M===null?n(M):M===93?(e.consume(M),w):se(M)?(a=x,X(M)):(e.consume(M),x)}function w(M){return M===93?(e.consume(M),k):x(M)}function k(M){return M===62?B(M):M===93?(e.consume(M),k):x(M)}function S(M){return M===null||M===62?B(M):se(M)?(a=S,X(M)):(e.consume(M),S)}function _(M){return M===null?n(M):M===63?(e.consume(M),R):se(M)?(a=_,X(M)):(e.consume(M),_)}function R(M){return M===62?B(M):_(M)}function P(M){return ut(M)?(e.consume(M),h):n(M)}function h(M){return M===45||Qe(M)?(e.consume(M),h):I(M)}function I(M){return se(M)?(a=I,X(M)):_e(M)?(e.consume(M),I):B(M)}function v(M){return M===45||Qe(M)?(e.consume(M),v):M===47||M===62||Ye(M)?g(M):n(M)}function g(M){return M===47?(e.consume(M),B):M===58||M===95||ut(M)?(e.consume(M),m):se(M)?(a=g,X(M)):_e(M)?(e.consume(M),g):B(M)}function m(M){return M===45||M===46||M===58||M===95||Qe(M)?(e.consume(M),m):T(M)}function T(M){return M===61?(e.consume(M),E):se(M)?(a=T,X(M)):_e(M)?(e.consume(M),T):g(M)}function E(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,F):se(M)?(a=E,X(M)):_e(M)?(e.consume(M),E):(e.consume(M),j)}function F(M){return M===i?(e.consume(M),i=void 0,D):M===null?n(M):se(M)?(a=F,X(M)):(e.consume(M),F)}function j(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Ye(M)?g(M):(e.consume(M),j)}function D(M){return M===47||M===62||Ye(M)?g(M):n(M)}function B(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function X(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),re}function re(M){return _e(M)?Ce(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):Q(M)}function Q(M){return e.enter("htmlTextData"),a(M)}}const mi={name:"labelEnd",resolveAll:af,resolveTo:sf,tokenize:lf},nf={tokenize:uf},rf={tokenize:cf},of={tokenize:ff};function af(e){let t=-1;const n=[];for(;++t=3&&(u===null||se(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),_e(u)?Ce(e,s,"whitespace")(u):s(u))}}const He={continuation:{tokenize:wf},exit:Tf,name:"list",tokenize:bf},xf={partial:!0,tokenize:_f},vf={partial:!0,tokenize:kf};function bf(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(d){const y=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Ur(d)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Pn,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return Ur(d)&&++a<10?(e.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Xn,r.interrupt?n:c,e.attempt(xf,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return _e(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function wf(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Xn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!_e(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vf,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(e,e.attempt(He,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function kf(e,t,n){const r=this;return Ce(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function Tf(e){e.exit(this.containerState.type)}function _f(e,t,n){const r=this;return Ce(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!_e(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Zi={name:"setextUnderline",resolveTo:Mf,tokenize:Ef};function Mf(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Ef(e,t,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),_e(u)?Ce(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||se(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Af={tokenize:Sf};function Sf(e){const t=this,n=e.attempt(Xn,r,e.attempt(this.parser.constructs.flowInitial,i,Ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Nc,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const If={resolveAll:Ba()},Rf=Fa("string"),Cf=Fa("text");function Fa(e){return{resolveAll:Ba(e==="text"?Nf:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(c){return u(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function Gf(e,t){let n=-1;const r=[];let i;for(;++n0){const Ue=ne.tokenStack[ne.tokenStack.length-1];(Ue[1]||to).call(ne,void 0,Ue[0])}for(q.position={start:wt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:wt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function ld(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ud(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ja(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function cd(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ja(e,t);const i={src:Jt(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function fd(e,t){const n={src:Jt(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function dd(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function pd(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ja(e,t);const i={href:Jt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function hd(e,t){const n={href:Jt(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function md(e,t,n){const r=e.all(t),i=n?gd(n):Va(t),o={},a=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function yd(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function wd(e){const t=$a(e),n=Ha(e);if(t&&n)return{start:t,end:n}}function kd(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=$a(t.children[1]),l=Ha(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Td(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(io(t.slice(i),i>0,!1)),o.join("")}function io(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===no||o===ro;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===no||o===ro;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ed(e,t){const n={type:"text",value:Md(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ad(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Sd={blockquote:nd,break:rd,code:id,delete:od,emphasis:ad,footnoteReference:sd,heading:ld,html:ud,imageReference:cd,image:fd,inlineCode:dd,linkReference:pd,link:hd,listItem:md,list:yd,paragraph:xd,root:vd,strong:bd,table:kd,tableCell:_d,tableRow:Td,text:Ed,thematicBreak:Ad,toml:Mn,yaml:Mn,definition:Mn,footnoteDefinition:Mn};function Mn(){}const Ya=-1,Zn=0,Vn=1,Hn=2,gi=3,yi=4,xi=5,vi=6,Ka=7,qa=8,oo=typeof self=="object"?self:globalThis,Id=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Zn:case Ya:return n(a,i);case Vn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Hn:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case gi:return n(new Date(a),i);case yi:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case xi:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case vi:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case Ka:{const{name:s,message:l}=a;return n(new oo[s](l),i)}case qa:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new oo[o](a),i)};return r},ao=e=>Id(new Map,e)(0),Bt="",{toString:Rd}={},{keys:Cd}=Object,sn=e=>{const t=typeof e;if(t!=="object"||!e)return[Zn,t];const n=Rd.call(e).slice(8,-1);switch(n){case"Array":return[Vn,Bt];case"Object":return[Hn,Bt];case"Date":return[gi,Bt];case"RegExp":return[yi,Bt];case"Map":return[xi,Bt];case"Set":return[vi,Bt]}return n.includes("Array")?[Vn,n]:n.includes("Error")?[Ka,n]:[Hn,n]},En=([e,t])=>e===Zn&&(t==="function"||t==="symbol"),Nd=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=sn(a);switch(s){case Zn:{let c=a;switch(l){case"bigint":s=qa,c=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([Ya],a)}return i([s,c],a)}case Vn:{if(l)return i([l,[...a]],a);const c=[],f=i([s,c],a);for(const p of a)c.push(o(p));return f}case Hn:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const c=[],f=i([s,c],a);for(const p of Cd(a))(e||!En(sn(a[p])))&&c.push([o(p),o(a[p])]);return f}case gi:return i([s,a.toISOString()],a);case yi:{const{source:c,flags:f}=a;return i([s,{source:c,flags:f}],a)}case xi:{const c=[],f=i([s,c],a);for(const[p,d]of a)(e||!(En(sn(p))||En(sn(d))))&&c.push([o(p),o(d)]);return f}case vi:{const c=[],f=i([s,c],a);for(const p of a)(e||!En(sn(p)))&&c.push(o(p));return f}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},so=(e,{json:t,lossy:n}={})=>{const r=[];return Nd(!(t||n),!!t,new Map,r)(e),r},$n=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ao(so(e,t)):structuredClone(e):(e,t)=>ao(so(e,t));function Ld(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Pd(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Dd(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ld,r=e.options.footnoteBackLabel||Pd,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l0&&y.push({type:"text",value:" "});let S=typeof n=="string"?n:n(l,d);typeof S=="string"&&(S={type:"text",value:S}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const w=c[c.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const S=w.children[w.children.length-1];S&&S.type==="text"?S.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...y)}else c.push(...y);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(c,!0)};e.patch(u,k),s.push(k)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$n(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` -`}]}}const Wa=function(e){if(e==null)return zd;if(typeof e=="function")return Qn(e);if(typeof e=="object")return Array.isArray(e)?Od(e):Fd(e);if(typeof e=="string")return Bd(e);throw new Error("Expected function, string, or object as test")};function Od(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let d=Xa,y,x,w;if((!t||o(l,u,c[c.length-1]||void 0))&&(d=$d(n(l,c)),d[0]===lo))return d;if("children"in l&&l.children){const k=l;if(k.children&&d[0]!==Vd)for(x=(r?k.children.length:-1)+a,w=c.concat(k);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function uo(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function co(e,t){const n=Kd(e,t),r=n.one(e,void 0),i=Dd(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function Qd(e,t){return e&&"run"in e?async function(n,r){const i=co(n,{file:r,...t});await e.run(i,r)}:function(n,r){return co(n,{file:r,...e||t})}}function fo(e){if(e)throw e}var fr,po;function Jd(){if(po)return fr;po=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},o=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var c=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},s=function(u,c){if(c==="__proto__")if(e.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return fr=function l(){var u,c,f,p,d,y,x=arguments[0],w=1,k=arguments.length,S=!1;for(typeof x=="boolean"&&(S=x,x=arguments[1]||{},w=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});wa.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(u){const c=u;if(s&&n)throw c;return i(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}class We extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=dn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const st={basename:rp,dirname:ip,extname:op,join:ap,sep:"/"};function rp(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xn(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function ip(e){if(xn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function op(e){xn(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function ap(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function lp(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function xn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const up={cwd:cp};function cp(){return"/"}function Gr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function fp(e){if(typeof e=="string")e=new URL(e);else if(!Gr(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return dp(e)}function dp(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[d,...y]=c;const x=r[p][1];$r(x)&&$r(d)&&(d=dr(!0,x,d)),r[p]=[u,d,...y]}}}}const yp=new bi().freeze();function gr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function yr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function mo(e){if(!$r(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function go(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function An(e){return xp(e)?e:new pp(e)}function xp(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vp(e){return typeof e=="string"||bp(e)}function bp(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function wi(){const e=yp().use(td).use(Qd).use(qu);return{process:t=>e.processSync(t).toString()}}function Za(e,t){const n=Go(t??{},{...Ni.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=bs("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const a=H(e);if(!a)return;const s=await navigator.mediaDevices.getUserMedia({audio:{deviceId:a}});r.value=await Ni.MicVAD.new({...n,stream:s}),n.auto&&r.value.start()}return Ke(i,o,{immediate:!0}),Ke(ws(e),o,{immediate:!0}),ks(o),Ot(()=>{r.value&&(r.value.destroy(),r.value=void 0)}),{destroy:()=>{r.value&&(r.value.destroy(),r.value=void 0)},start:()=>{r.value&&r.value.start()}}}function yo(e,t){if(t===Ts)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===Nr||t===Yo){let n=e.getIndex();if(n===null){const a=[],s=e.getAttribute("position");if(s!==void 0){for(let l=0;l=2.0 are supported."));return}const u=new eh(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&s[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}u.setExtensions(a),u.setPlugins(s),u.parse(r,i)}parseAsync(t,n){const r=this;return new Promise(function(i,o){r.parse(t,n,i,o)})}}function kp(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const de={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Tp{constructor(t){this.parser=t,this.name=de.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(t,o.source,a)}}class Fp{constructor(t){this.parser=t,this.name=de.EXT_TEXTURE_WEBP}loadTexture(t){const n=this.name,r=this.parser,i=r.json,o=i.textures[t];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const u=r.options.manager.getHandler(s.uri);u!==null&&(l=u)}return r.loadTextureImage(t,a.source,l)}}class Bp{constructor(t){this.parser=t,this.name=de.EXT_TEXTURE_AVIF}loadTexture(t){const n=this.name,r=this.parser,i=r.json,o=i.textures[t];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const u=r.options.manager.getHandler(s.uri);u!==null&&(l=u)}return r.loadTextureImage(t,a.source,l)}}class zp{constructor(t){this.name=de.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const n=this.parser.json,r=n.bufferViews[t];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(s){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,f=i.byteStride,p=new Uint8Array(s,l,u);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(d){return d.buffer}):a.ready.then(function(){const d=new ArrayBuffer(c*f);return a.decodeGltfBuffer(new Uint8Array(d),c,f,p,i.mode,i.filter),d})})}else return null}}class Up{constructor(t){this.name=de.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const n=this.parser.json,r=n.nodes[t];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==tt.TRIANGLES&&u.mode!==tt.TRIANGLE_STRIP&&u.mode!==tt.TRIANGLE_FAN&&u.mode!==void 0)return null;const a=r.extensions[this.name].attributes,s=[],l={};for(const u in a)s.push(this.parser.getDependency("accessor",a[u]).then(c=>(l[u]=c,l[u])));return s.length<1?null:(s.push(this.parser.createNodeMesh(t)),Promise.all(s).then(u=>{const c=u.pop(),f=c.isGroup?c.children:[c],p=u[0].count,d=[];for(const y of f){const x=new vt,w=new ae,k=new On,S=new ae(1,1,1),_=new Ss(y.geometry,y.material,p);for(let R=0;R0||e.search(/^data\:image\/jpeg/)===0?"image/jpeg":e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?"image/webp":e.search(/\.ktx2($|\?)/i)>0||e.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Jp=new vt;class eh{constructor(t={},n={}){this.json=t,this.extensions={},this.plugins={},this.options=n,this.cache=new kp,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,o=!1,a=-1;if(typeof navigator<"u"){const s=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(s)===!0;const l=s.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=s.indexOf("Firefox")>-1,a=o?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&a<98?this.textureLoader=new Rs(this.options.manager):this.textureLoader=new Cs(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Ko(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Rt(o,s,i),gt(s,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(const l of s.scenes)l.updateMatrixWorld();t(s)})}).catch(n)}_markDefs(){const t=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(const[u,c]of a.children.entries())o(c,s.children[u])};return o(r,i),i.name+="_instance_"+t.uses[n]++,i}_invokeOne(t){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&w.setY(g,h[I*l+1]),l>=3&&w.setZ(g,h[I*l+2]),l>=4&&w.setW(g,h[I*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}w.normalized=y}return w})}loadTexture(t){const n=this.json,r=this.options,o=n.textures[t].source,a=n.images[o];let s=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(t,o,s)}loadTextureImage(t,n,r){const i=this,o=this.json,a=o.textures[t],s=o.images[n],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=a.name||s.name||"",c.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(c.name=s.uri);const p=(o.samplers||{})[a.sampler]||{};return c.magFilter=vo[p.magFilter]||Fn,c.minFilter=vo[p.minFilter]||Jr,c.wrapS=bo[p.wrapS]||Bn,c.wrapT=bo[p.wrapT]||Bn,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==Fn,i.associations.set(c,{textures:t}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(t,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(f=>f.clone());const a=i.images[t],s=self.URL||self.webkitURL;let l=a.uri||"",u=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(f){u=!0;const p=new Blob([f],{type:a.mimeType});return l=s.createObjectURL(p),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(f){return new Promise(function(p,d){let y=p;n.isImageBitmapLoader===!0&&(y=function(x){const w=new zn(x);w.needsUpdate=!0,p(w)}),n.load(cn.resolveURL(f,o.path),y,void 0,d)})}).then(function(f){return u===!0&&s.revokeObjectURL(l),gt(f,a),f.userData.mimeType=a.mimeType||Qp(a.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[t]=c,c}assignTexture(t,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),o.extensions[de.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[de.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[de.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),o.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),t[n]=a,a})}assignFinalMaterial(t){const n=t.geometry;let r=t.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(t.isPoints){const s="PointsMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new Ns,tr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(s,l)),r=l}else if(t.isLine){const s="LineBasicMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new Ls,tr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(s,l)),r=l}if(i||o||a){let s="ClonedMaterial:"+r.uuid+":";i&&(s+="derivative-tangents:"),o&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=r.clone(),o&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(r))),r=l}t.material=r}getMaterialType(){return Jo}loadMaterial(t){const n=this,r=this.json,i=this.extensions,o=r.materials[t];let a;const s={},l=o.extensions||{},u=[];if(l[de.KHR_MATERIALS_UNLIT]){const f=i[de.KHR_MATERIALS_UNLIT];a=f.getMaterialType(),u.push(f.extendParams(s,o,n))}else{const f=o.pbrMetallicRoughness||{};if(s.color=new Fe(1,1,1),s.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;s.color.setRGB(p[0],p[1],p[2],xt),s.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(s,"map",f.baseColorTexture,pn)),s.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,s.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(s,"metalnessMap",f.metallicRoughnessTexture)),u.push(n.assignTexture(s,"roughnessMap",f.metallicRoughnessTexture))),a=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(t)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(t,s)})))}o.doubleSided===!0&&(s.side=Yn);const c=o.alphaMode||br.OPAQUE;if(c===br.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===br.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==Ht&&(u.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new Pe(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;s.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&a!==Ht&&(u.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==Ht){const f=o.emissiveFactor;s.emissive=new Fe().setRGB(f[0],f[1],f[2],xt)}return o.emissiveTexture!==void 0&&a!==Ht&&u.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,pn)),Promise.all(u).then(function(){const f=new a(s);return o.name&&(f.name=o.name),gt(f,o),n.associations.set(f,{materials:t}),o.extensions&&Rt(i,f,o),f})}createUniqueName(t){const n=hn.sanitizeNodeName(t||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(t){const n=this,r=this.extensions,i=this.primitiveCache;function o(s){return r[de.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return wo(l,s,n)})}const a=[];for(let s=0,l=t.length;s0&&Xp(k,o),k.name=n.createUniqueName(o.name||"mesh_"+t),gt(k,o),w.extensions&&Rt(i,k,w),n.assignFinalMaterial(k),f.push(k)}for(let d=0,y=f.length;d1?c=new nr:u.length===1?c=u[0]:c=new Qr,c!==u[0])for(let f=0,p=u.length;f1){const f=i.associations.get(c);i.associations.set(c,{...f})}return i.associations.get(c).nodes=t,c}),this.nodeCache[t]}loadScene(t){const n=this.extensions,r=this.json.scenes[t],i=this,o=new nr;r.name&&(o.name=i.createUniqueName(r.name)),gt(o,r),r.extensions&&Rt(n,o,r);const a=r.nodes||[],s=[];for(let l=0,u=a.length;l{const f=new Map;for(const[p,d]of i.associations)(p instanceof tr||p instanceof zn)&&f.set(p,d);return c.traverse(p=>{const d=i.associations.get(p);d!=null&&f.set(p,d)}),f};return i.associations=u(o),o})}_createAnimationTracks(t,n,r,i,o){const a=[],s=t.name?t.name:t.uuid,l=[];kt[o.path]===kt.weights?t.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(s);let u;switch(kt[o.path]){case kt.weights:u=Ai;break;case kt.rotation:u=Si;break;case kt.translation:case kt.scale:u=Ei;break;default:switch(r.itemSize){case 1:u=Ai;break;case 2:case 3:default:u=Ei;break}break}const c=i.interpolation!==void 0?Kp[i.interpolation]:ei,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew vl(e)),Ct.register(e=>new bl(e)),Ct)}async function nh(e){const r=(await es().loadAsync(e)).userData;if(!r.vrmAnimations){console.warn("No VRM animations found in the .vrma file");return}if(r.vrmAnimations.length===0){console.warn("No VRM animations found in the .vrma file");return}return r.vrmAnimations[0]}async function rh(e,t){if(!e){console.warn("No VRM found");return}if(t)return wl(t,e)}function ih(){const e=W(!1),t=W(0),n=W(0),r=.2,i=1,o=6,a=W(Math.random()*(o-i)+i);function s(l,u){if(l!=null&&l.expressionManager&&(n.value+=u,!e.value&&n.value>=a.value&&(e.value=!0,t.value=0),e.value)){t.value+=u/r;const c=Math.sin(Math.PI*t.value);l.expressionManager.setValue("blink",c),t.value>=1&&(e.value=!1,n.value=0,l.expressionManager.setValue("blink",0),a.value=Math.random()*(o-i)+i)}}return{update:s}}function oh(){let e=-1,t,n=0;function r(){t?t.set(on(-.25,.25),on(-.2,.15),-.65):t=new ae(on(-.25,.25),on(-.2,.15),-.65)}function i(o,a){var s;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=e?(r(),n=0,e=kl()/1e3):t||r(),o.lookAt.target||(o.lookAt.target=new Qr),o.lookAt.target.position.lerp(t,on(.2,.5)),(s=o.lookAt)==null||s.update(a),n+=a)}return{update:i}}async function ah(e,t){const i=(await es().loadAsync(e,a=>{var s;return(s=t==null?void 0:t.onProgress)==null?void 0:s.call(t,a)})).userData;if(!i.vrm)return;const o=i.vrm;if(Or.removeUnnecessaryVertices(o.scene),Or.combineSkeletons(o.scene),o.scene.traverse(a=>{a.frustumCulled=!1}),o.lookAt){const a=new Tl(o.lookAt);a.name="lookAtQuaternionProxy",o.scene.add(a)}return t!=null&&t.scene&&t.scene.add(o.scene),t!=null&&t.position&&o.scene.position.set(...t.position),o}function sh(e){const t=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),a=W(),s=(k,S,_)=>k+(S-k)*_,l=k=>k<.5?4*k*k*k:1-(-2*k+2)**3/2,u=new Map([["happy",{expression:[{name:"happy",value:1,duration:.3},{name:"aa",value:.3}],blendDuration:.3}],["sad",{expression:[{name:"sad",value:1},{name:"oh",value:.2}],blendDuration:.3}],["angry",{expression:[{name:"angry",value:1},{name:"ee",value:.4}],blendDuration:.2}],["surprised",{expression:[{name:"Surprised",value:1},{name:"oh",value:.6}],blendDuration:.1}],["neutral",{expression:[{name:"neutral",value:1}],blendDuration:.5}]]),c=()=>{a.value&&(clearTimeout(a.value),a.value=void 0)},f=k=>{var _;if(c(),!u.has(k)){console.warn(`Emotion ${k} not found`);return}const S=u.get(k);if(t.value=k,n.value=!0,r.value=0,e.expressionManager){const R=Object.keys(e.expressionManager.expressionMap);for(const P of R)e.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const R of S.expression||[]){const P=((_=e.expressionManager)==null?void 0:_.getValue(R.name))||0;i.value.set(R.name,P),o.value.set(R.name,R.value)}};return{currentEmotion:t,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(k,S)=>{c(),f(k),a.value=setTimeout(()=>{f("neutral"),a.value=void 0},S)},update:k=>{var R;if(!n.value||!t.value)return;const _=u.get(t.value).blendDuration||.3;r.value+=k/_,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const I=i.value.get(P)||0,v=s(I,h,l(r.value));(R=e.expressionManager)==null||R.setValue(P,v)}},addEmotionState:(k,S)=>{u.set(k,S)},removeEmotionState:k=>{u.delete(k)},dispose:()=>{c()}}}function lh(e,t){const n=Go(t,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=$s(e,{type:"module"}),a=W(null),s=W(""),l=W([]),u=W(!1),c=W(0),f=W("");return Ke(i,p=>{var d,y,x,w,k,S,_,R;switch(p.status){case"loading":a.value="loading",s.value=p.data,(d=n.onLoading)==null||d.call(n,p.data);break;case"initiate":l.value.push(p),(y=n.onInitiate)==null||y.call(n,p);break;case"progress":l.value=l.value.map(P=>P.file===p.file?{...P,...p}:P),(x=n.onProgress)==null||x.call(n,p);break;case"done":l.value=l.value.filter(P=>P.file!==p.file),(w=n.onDone)==null||w.call(n,p);break;case"ready":a.value="ready",(k=n.onReady)==null||k.call(n);break;case"start":u.value=!0,(S=n.onStart)==null||S.call(n);break;case"update":c.value=p.tps,(_=n.onUpdate)==null||_.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(R=n.onComplete)==null||R.call(n,p.output[0]);break}}),Ot(()=>{o()}),{transcribe:p=>r(p),status:a,loadingMessage:s,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>r({type:"load"}),terminate:o}}const uh=Gn("llm",()=>{async function e(n,r,i,o){const a=o==null?void 0:o.headers;return await Fl({...r.chat(n),maxSteps:10,messages:i.map(s=>({...s,content:s.role==="error"?`User encountered error: ${s.content}`:s.content,role:s.role==="error"?"user":s.role})),headers:a,tools:[...await Al(),...await Sl()],onEvent(s){var l,u;s.type==="tool-call"?(l=o==null?void 0:o.onToolCall)==null||l.call(o,s.toolCall):s.type==="tool-call-result"&&((u=o==null?void 0:o.onToolCallResult)==null||u.call(o,{id:s.id,result:s.result}))}})}async function t(n,r){if(n==="")return[];try{return await Ol({baseURL:n.endsWith("/")?n:`${n}/`,apiKey:r})}catch(i){if(String(i).includes("Failed to construct 'URL': Invalid URL"))return[];throw i}}return{models:t,stream:e}}),St=Gn("chat",()=>{const{stream:e}=uh(),{systemPrompt:t}=Ge(Bl()),n=W(!1),r=W([]),i=W([]),o=W([]),a=W([]),s=W([]),l=W([]),u=W([]),c=W([]);function f(h){r.value.push(h)}function p(h){i.value.push(h)}function d(h){o.value.push(h)}function y(h){a.value.push(h)}function x(h){s.value.push(h)}function w(h){l.value.push(h)}function k(h){u.value.push(h)}function S(h){c.value.push(h)}const _=W([{role:"system",content:t.value}]),R=W({role:"assistant",content:"",slices:[],tool_results:[]});async function P(h,I){var v;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);const g=Kl({onLiteral:async D=>{for(const X of s.value)await X(D);R.value.content+=D;const B=R.value.slices.at(-1);if((B==null?void 0:B.type)==="text"){B.text+=D;return}R.value.slices.push({type:"text",text:D})},onSpecial:async D=>{for(const B of l.value)await B(D)}}),m=Ln({handlers:[async D=>{if(D.data.type==="text"){await g.consume(D.data.text);return}if(D.data.type==="tool-call"){R.value.slices.push(D.data);return}D.data.type==="tool-call-result"&&R.value.tool_results.push(D.data)}]});R.value={role:"assistant",content:"",slices:[],tool_results:[]},_.value.push({role:"user",content:h}),_.value.push(R.value);const T=_.value.slice(0,_.value.length-1).map(D=>{if(D.role==="assistant"){const{slices:B,...X}=D;return X.tool_results=rr(X.tool_results),rr(X)}return rr(D)});for(const D of i.value)await D(h);for(const D of o.value)await D(h);const E=((v=I.providerConfig)==null?void 0:v.headers)||{},F=await e(I.model,I.chatProvider,T,{headers:E,onToolCall(D){m.add({type:"tool-call",toolCall:D})},onToolCallResult(D){m.add({type:"tool-call-result",id:D.id,result:D.result})}});for(const D of a.value)await D(h);let j="";for await(const D of Vl(F.textStream,async B=>B))m.add({type:"text",text:D}),j+=D;await g.end();for(const D of u.value)await D();for(const D of c.value)await D(j);console.debug("LLM output:",j)}catch(g){throw console.error("Error sending message:",g),g}finally{n.value=!1}}return{sending:n,messages:_,streamingMessage:R,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:y,onTokenLiteral:x,onTokenSpecial:w,onStreamEnd:k,onAssistantResponseEnd:S}}),ch={absolute:"",bottom:"3",right:"3"},fh={flex:"~ row","cursor-pointer":""},dh=["checked","aria-checked"],ph={key:0,"min-w":"50vw",z:"(J(),Xt(fa,{relative:""},{default:$e(({width:a,height:s})=>[Te(Ul,{width:a,height:s,resolution:2,"max-h":"100dvh"},{default:$e(({app:l})=>[Te(zl,{app:l,"mouth-open-size":e.mouthOpenSize,width:a,height:s,paused:e.paused,"focus-at":e.focusAt},null,8,["app","mouth-open-size","width","height","paused","focus-at"])]),_:2},1032,["width","height"]),O("div",ch,[O("div",fh,[O("label",{class:lt([n.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Mt(O("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox","appearance-none":"","outline-none":"",hidden:""},null,8,dh),[[ri,n.value]]),o[8]||(o[8]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(H(ui),null,{default:$e(()=>[n.value?(J(),oe("div",ph,[O("div",hh,[O("div",mh,[O("span",null,ve(H(t)("stage.viewers.debug-menu.emotions")),1)]),O("div",gh,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},ve(H(t)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},ve(H(t)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},ve(H(t)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},ve(H(t)("stage.viewers.debug-menu.emotions-btn.happy")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},ve(H(t)("stage.viewers.debug-menu.emotions-btn.awkward")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},ve(H(t)("stage.viewers.debug-menu.emotions-btn.question")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},ve(H(t)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):at("",!0)]),_:1})])]),_:1}))}});var xh=Object.defineProperty,vh=(e,t,n)=>t in e?xh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bh=(e,t,n)=>vh(e,t+"",n);function wh(e){return el()?(tl(e),!0):!1}function ts(e){return typeof e=="function"?e():H(e)}const kh=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Th=Object.prototype.toString,_h=e=>Th.call(e)==="[object Object]",Mh=()=>{},Eh=kh?window:void 0;function Ah(e){var t;const n=ts(e);return(t=n==null?void 0:n.$el)!=null?t:n}function kr(...e){let t,n,r,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,i]=e,t=Eh):[t,n,r,i]=e,!t)return Mh;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=Ke(()=>[Ah(t),ts(i)],([c,f])=>{if(a(),!c)return;const p=_h(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(y=>s(c,d,y,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return wh(u),u}function ns(e,t,n,r){const i=class extends mn{constructor(o={}){const a=Object.entries(e);super({uniforms:a.reduce((s,[l,u])=>{const c=oi.clone({[l]:{value:u}});return{...s,...c}},{}),vertexShader:t,fragmentShader:n}),bh(this,"key",""),a.forEach(([s])=>Object.defineProperty(this,s,{get:()=>this.uniforms[s].value,set:l=>this.uniforms[s].value=l})),Object.assign(this,o)}};return i.key=Dt.generateUUID(),i}ns({color:new Fe("white"),scale:new Pe(1,1),imageBounds:new Pe(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` - varying vec2 vUv; - varying vec2 vPos; - void main() { - gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.); - vUv = uv; - vPos = position.xy; - } - `,` - // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44 - varying vec2 vUv; - varying vec2 vPos; - uniform vec2 scale; - uniform vec2 imageBounds; - uniform float resolution; - uniform vec3 color; - uniform sampler2D map; - uniform float radius; - uniform float zoom; - uniform float grayscale; - uniform float opacity; - const vec3 luma = vec3(.299, 0.587, 0.114); - vec4 toGrayscale(vec4 color, float intensity) { - return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a); - } - vec2 aspect(vec2 size) { - return size / min(size.x, size.y); - } - - const float PI = 3.14159265; - - // from https://iquilezles.org/articles/distfunctions - float udRoundBox( vec2 p, vec2 b, float r ) { - return length(max(abs(p)-b+r,0.0))-r; - } - - void main() { - vec2 s = aspect(scale); - vec2 i = aspect(imageBounds); - float rs = s.x / s.y; - float ri = i.x / i.y; - vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x); - vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new; - vec2 uv = vUv * s / new + offset; - vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5); - - vec2 res = vec2(scale * resolution); - vec2 halfRes = 0.5 * res; - float b = udRoundBox(vUv.xy * res - halfRes, halfRes, resolution * radius); - vec3 a = mix(vec3(1.0,0.0,0.0), vec3(0.0,0.0,0.0), smoothstep(0.0, 1.0, b)); - gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, opacity * a), grayscale); - - #include - #include - } - `);const ki=parseInt(nl.replace(/\D+/g,""));var Sh=Object.defineProperty,Ih=(e,t,n)=>t in e?Sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rh=(e,t,n)=>(Ih(e,t+"",n),n);async function ko(e){const t=await e.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(t)));return`data:${e.type||""};base64,${n}`}let Sn,Tr,zt,In;function _r(e,t=1/0,n=null){Tr||(Tr=new aa(2,2,1,1)),zt||(zt=new mn({uniforms:{blitTexture:new ul(e)},vertexShader:` - varying vec2 vUv; - void main(){ - vUv = uv; - gl_Position = vec4(position.xy * 1.0,0.,.999999); - } - `,fragmentShader:` - uniform sampler2D blitTexture; - varying vec2 vUv; - - void main(){ - gl_FragColor = vec4(vUv.xy, 0, 1); - - #ifdef IS_SRGB - gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) ); - #else - gl_FragColor = texture2D( blitTexture, vUv); - #endif - } - `})),zt.uniforms.blitTexture.value=e,zt.defines.IS_SRGB="colorSpace"in e?e.colorSpace==="srgb":e.encoding===3001,zt.needsUpdate=!0,In||(In=new Pt(Tr,zt),In.frustrumCulled=!1);const r=new Et,i=new Pr;i.add(In),n||(n=Sn=new cl({antialias:!1})),n.setSize(Math.min(e.image.width,t),Math.min(e.image.height,t)),n.clear(),n.render(i,r);const o=new zn(n.domElement);return o.minFilter=e.minFilter,o.magFilter=e.magFilter,o.wrapS=e.wrapS,o.wrapT=e.wrapT,o.name=e.name,Sn&&(Sn.dispose(),Sn=null),o}const To={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class rs{constructor(){this.pluginCallbacks=[],this.register(function(t){return new Uh(t)}),this.register(function(t){return new jh(t)}),this.register(function(t){return new $h(t)}),this.register(function(t){return new Gh(t)}),this.register(function(t){return new Yh(t)}),this.register(function(t){return new Kh(t)}),this.register(function(t){return new Vh(t)}),this.register(function(t){return new Hh(t)}),this.register(function(t){return new qh(t)}),this.register(function(t){return new Wh(t)}),this.register(function(t){return new Xh(t)})}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,n,r,i){const o=new zh,a=[];for(let s=0,l=this.pluginCallbacks.length;se.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<.001)return e.times.length-1;r[r.length-1]=t,r.set(e.times,0),i.set(e.values,0),i.set(o.evaluate(t),e.values.length),a=r.length-1}else for(let s=0;st){r.set(e.times.slice(0,s+1),0),r[s+1]=t,r.set(e.times.slice(s+1),s+2),i.set(e.values.slice(0,(s+1)*n),0),i.set(o.evaluate(t),(s+1)*n),i.set(e.values.slice((s+1)*n),(s+2)*n),a=s+1;break}}return e.times=r,e.values=i,a},mergeMorphTargetTracks:function(e,t){const n=[],r={},i=e.tracks;for(let o=0;o4?a=e.array[i*e.itemSize+o]:(o===0?a=e.getX(i):o===1?a=e.getY(i):o===2?a=e.getZ(i):o===3&&(a=e.getW(i)),e.normalized===!0&&(a=Dt.normalize(a,e.array))),r.min[o]=Math.min(r.min[o],a),r.max[o]=Math.max(r.max[o],a)}return r}function is(e){return Math.ceil(e/4)*4}function Er(e,t=0){const n=is(e.byteLength);if(n!==e.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(e)),t!==0)for(let i=e.byteLength;i"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function So(e,t){if(e.toBlob!==void 0)return new Promise(r=>e.toBlob(r,t));let n;return t==="image/jpeg"?n=.92:t==="image/webp"&&(n=.8),e.convertToBlob({type:t,quality:n})}class zh{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(t){this.plugins=t}async write(t,n,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(t),await Promise.all(this.pending);const i=this,o=i.buffers,a=i.json;r=i.options;const s=i.extensionsUsed,l=i.extensionsRequired,u=new Blob(o,{type:"application/octet-stream"}),c=Object.keys(s),f=Object.keys(l);c.length>0&&(a.extensionsUsed=c),f.length>0&&(a.extensionsRequired=f),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const d=Er(p),y=new DataView(new ArrayBuffer(Eo));y.setUint32(0,d.byteLength,!0),y.setUint32(4,Dh,!0);const x=Er(Oh(JSON.stringify(a)),32),w=new DataView(new ArrayBuffer(Eo));w.setUint32(0,x.byteLength,!0),w.setUint32(4,Ph,!0);const k=new ArrayBuffer(Mo),S=new DataView(k);S.setUint32(0,Nh,!0),S.setUint32(4,Lh,!0);const _=Mo+w.byteLength+x.byteLength+y.byteLength+d.byteLength;S.setUint32(8,_,!0),new Blob([k,w,x,y,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):a.buffers&&a.buffers.length>0?ko(u).then(p=>{a.buffers[0].uri=p,n(a)}):n(a)}serializeUserData(t,n){if(Object.keys(t.userData).length===0)return;const r=this.options,i=this.extensionsUsed;try{const o=JSON.parse(JSON.stringify(t.userData));if(r.includeCustomExtensions&&o.gltfExtensions){n.extensions===void 0&&(n.extensions={});for(const a in o.gltfExtensions)n.extensions[a]=o.gltfExtensions[a],i[a]=!0;delete o.gltfExtensions}Object.keys(o).length>0&&(n.extras=o)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+t.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}getUID(t,n=!1){if(this.uids.has(t)===!1){const r=new Map;r.set(!0,this.uid++),r.set(!1,this.uid++),this.uids.set(t,r)}return this.uids.get(t).get(n)}isNormalizedNormalAttribute(t){if(this.cache.attributesNormalized.has(t))return!1;const n=new ae;for(let r=0,i=t.count;r5e-4)return!1;return!0}createNormalizedNormalAttribute(t){const n=this.cache;if(n.attributesNormalized.has(t))return n.attributesNormalized.get(t);const r=t.clone(),i=new ae;for(let o=0,a=r.count;o4?y=t.array[p*t.itemSize+d]:(d===0?y=t.getX(p):d===1?y=t.getY(p):d===2?y=t.getZ(p):d===3&&(y=t.getW(p)),t.normalized===!0&&(y=Dt.normalize(y,t.array))),n===pe.FLOAT?u.setFloat32(c,y,!0):n===pe.INT?u.setInt32(c,y,!0):n===pe.UNSIGNED_INT?u.setUint32(c,y,!0):n===pe.SHORT?u.setInt16(c,y,!0):n===pe.UNSIGNED_SHORT?u.setUint16(c,y,!0):n===pe.BYTE?u.setInt8(c,y):n===pe.UNSIGNED_BYTE&&u.setUint8(c,y),c+=s}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===pe.ARRAY_BUFFER&&(f.byteStride=t.itemSize*s),this.byteOffset+=l,a.bufferViews.push(f),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(t){const n=this,r=n.json;return r.bufferViews||(r.bufferViews=[]),t.arrayBuffer().then(i=>{const o=Er(i),a={buffer:n.processBuffer(o),byteOffset:n.byteOffset,byteLength:o.byteLength};return n.byteOffset+=o.byteLength,r.bufferViews.push(a)-1})}processAccessor(t,n,r,i){const o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let s;if(t.array.constructor===Float32Array)s=pe.FLOAT;else if(t.array.constructor===Int32Array)s=pe.INT;else if(t.array.constructor===Uint32Array)s=pe.UNSIGNED_INT;else if(t.array.constructor===Int16Array)s=pe.SHORT;else if(t.array.constructor===Uint16Array)s=pe.UNSIGNED_SHORT;else if(t.array.constructor===Int8Array)s=pe.BYTE;else if(t.array.constructor===Uint8Array)s=pe.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+t.array.constructor.name);if(r===void 0&&(r=0),i===void 0&&(i=t.count),i===0)return null;const l=Bh(t,r,i);let u;n!==void 0&&(u=t===n.index?pe.ELEMENT_ARRAY_BUFFER:pe.ARRAY_BUFFER);const c=this.processBufferView(t,s,r,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:s,count:i,max:l.max,min:l.min,type:a[t.itemSize]};return t.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-1}processImage(t,n,r,i="image/png"){if(t!==null){const o=this,a=o.cache,s=o.json,l=o.options,u=o.pending;a.images.has(t)||a.images.set(t,{});const c=a.images.get(t),f=i+":flipY/"+r.toString();if(c[f]!==void 0)return c[f];s.images||(s.images=[]);const p={mimeType:i},d=Ao();d.width=Math.min(t.width,l.maxTextureSize),d.height=Math.min(t.height,l.maxTextureSize);const y=d.getContext("2d");if(r===!0&&(y.translate(0,d.height),y.scale(1,-1)),t.data!==void 0){n!==Lr&&console.error("GLTFExporter: Only RGBAFormat is supported.",n),(t.width>l.maxTextureSize||t.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",t);const w=new Uint8ClampedArray(t.height*t.width*4);for(let k=0;ko.processBufferViewImage(w)).then(w=>{p.bufferView=w})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(So(d,i).then(ko).then(w=>{p.uri=w}));const x=s.images.push(p)-1;return c[f]=x,x}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(t){const n=this.json;n.samplers||(n.samplers=[]);const r={magFilter:Je[t.magFilter],minFilter:Je[t.minFilter],wrapS:Je[t.wrapS],wrapT:Je[t.wrapT]};return n.samplers.push(r)-1}processTexture(t){const n=this.options,r=this.cache,i=this.json;if(r.textures.has(t))return r.textures.get(t);i.textures||(i.textures=[]),t instanceof ir&&(t=_r(t,n.maxTextureSize));let o=t.userData.mimeType;o==="image/webp"&&(o="image/png");const a={sampler:this.processSampler(t),source:this.processImage(t.image,t.format,t.flipY,o)};t.name&&(a.name=t.name),this._invokeAll(function(l){l.writeTexture&&l.writeTexture(t,a)});const s=i.textures.push(a)-1;return r.textures.set(t,s),s}processMaterial(t){const n=this.cache,r=this.json;if(n.materials.has(t))return n.materials.get(t);if(t.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};t.isMeshStandardMaterial!==!0&&t.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const o=t.color.toArray().concat([t.opacity]);if(un(o,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=o),t.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=t.metalness,i.pbrMetallicRoughness.roughnessFactor=t.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),t.metalnessMap||t.roughnessMap){const s=this.buildMetalRoughTexture(t.metalnessMap,t.roughnessMap),l={index:this.processTexture(s),channel:s.channel};this.applyTextureTransform(l,s),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(t.map){const s={index:this.processTexture(t.map),texCoord:t.map.channel};this.applyTextureTransform(s,t.map),i.pbrMetallicRoughness.baseColorTexture=s}if(t.emissive){const s=t.emissive;if(Math.max(s.r,s.g,s.b)>0&&(i.emissiveFactor=t.emissive.toArray()),t.emissiveMap){const l={index:this.processTexture(t.emissiveMap),texCoord:t.emissiveMap.channel};this.applyTextureTransform(l,t.emissiveMap),i.emissiveTexture=l}}if(t.normalMap){const s={index:this.processTexture(t.normalMap),texCoord:t.normalMap.channel};t.normalScale&&t.normalScale.x!==1&&(s.scale=t.normalScale.x),this.applyTextureTransform(s,t.normalMap),i.normalTexture=s}if(t.aoMap){const s={index:this.processTexture(t.aoMap),texCoord:t.aoMap.channel};t.aoMapIntensity!==1&&(s.strength=t.aoMapIntensity),this.applyTextureTransform(s,t.aoMap),i.occlusionTexture=s}t.transparent?i.alphaMode="BLEND":t.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=t.alphaTest),t.side===Yn&&(i.doubleSided=!0),t.name!==""&&(i.name=t.name),this.serializeUserData(t,i),this._invokeAll(function(s){s.writeMaterial&&s.writeMaterial(t,i)});const a=r.materials.push(i)-1;return n.materials.set(t,a),a}processMesh(t){const n=this.cache,r=this.json,i=[t.geometry.uuid];if(Array.isArray(t.material))for(let _=0,R=t.material.length;_=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=a.getAttribute("normal");d!==void 0&&!this.isNormalizedNormalAttribute(d)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let y=null;for(let _ in a.attributes){if(_.slice(0,5)==="morph")continue;const R=a.attributes[_];if(_=p[_]||_.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(_)||(_="_"+_),n.attributes.has(this.getUID(R))){u[_]=n.attributes.get(this.getUID(R));continue}y=null;const P=R.array;_==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),y=new Nt(new Uint16Array(P),R.itemSize,R.normalized));const h=this.processAccessor(y||R,a);h!==null&&(_.startsWith("_")||this.detectMeshQuantization(_,R),u[_]=h,n.attributes.set(this.getUID(R),h))}if(d!==void 0&&a.setAttribute("normal",d),Object.keys(u).length===0)return null;if(t.morphTargetInfluences!==void 0&&t.morphTargetInfluences.length>0){const _=[],R=[],P={};if(t.morphTargetDictionary!==void 0)for(const h in t.morphTargetDictionary)P[t.morphTargetDictionary[h]]=h;for(let h=0;h0&&(l.extras={},l.extras.targetNames=R)}const x=Array.isArray(t.material);if(x&&a.groups.length===0)return null;const w=x?t.material:[t.material],k=x?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let _=0,R=k.length;_0&&(P.targets=f),a.index!==null){let I=this.getUID(a.index);(k[_].start!==void 0||k[_].count!==void 0)&&(I+=":"+k[_].start+":"+k[_].count),n.attributes.has(I)?P.indices=n.attributes.get(I):(P.indices=this.processAccessor(a.index,a,k[_].start,k[_].count),n.attributes.set(I,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(w[k[_].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(_){_.writeMesh&&_.writeMesh(t,l)});const S=r.meshes.push(l)-1;return n.meshes.set(o,S),S}detectMeshQuantization(t,n){if(this.extensionsUsed[Mr])return;let r;switch(n.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}n.normalized&&(r+=" normalized");const i=t.split("_",1)[0];To[i]&&To[i].includes(r)&&(this.extensionsUsed[Mr]=!0,this.extensionsRequired[Mr]=!0)}processCamera(t){const n=this.json;n.cameras||(n.cameras=[]);const r=t.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:t.right*2,ymag:t.top*2,zfar:t.far<=0?.001:t.far,znear:t.near<0?0:t.near}:i.perspective={aspectRatio:t.aspect,yfov:Dt.degToRad(t.fov),zfar:t.far<=0?.001:t.far,znear:t.near<0?0:t.near},t.name!==""&&(i.name=t.type),n.cameras.push(i)-1}processAnimation(t,n){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]),t=rs.Utils.mergeMorphTargetTracks(t.clone(),n);const o=t.tracks,a=[],s=[];for(let l=0;l0){const s=[];for(let l=0,u=t.children.length;l0&&(o.children=s)}this._invokeAll(function(s){s.writeNode&&s.writeNode(t,o)});const a=n.nodes.push(o)-1;return i.set(t,a),a}processScene(t){const n=this.json,r=this.options;n.scenes||(n.scenes=[],n.scene=0);const i={};t.name!==""&&(i.name=t.name),n.scenes.push(i);const o=[];for(let a=0,s=t.children.length;a0&&(i.nodes=o),this.serializeUserData(t,i)}processObjects(t){const n=new Pr;n.name="AuxScene";for(let r=0;r0&&this.processObjects(r);for(let i=0;i0&&(a.range=t.distance)):t.isSpotLight&&(a.type="spot",t.distance>0&&(a.range=t.distance),a.spot={},a.spot.innerConeAngle=(t.penumbra-1)*t.angle*-1,a.spot.outerConeAngle=t.angle),t.decay!==void 0&&t.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),t.target&&(t.target.parent!==t||t.target.position.x!==0||t.target.position.y!==0||t.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),o[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},o[this.name]=!0);const s=i.extensions[this.name].lights;s.push(a),n.extensions=n.extensions||{},n.extensions[this.name]={light:s.length-1}}}let jh=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},Vh=class{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const o={index:n.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(o,e.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const o={index:n.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(e.clearcoatNormalMap){const o={index:n.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};n.applyTextureTransform(o,e.clearcoatNormalMap),i.clearcoatNormalTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Hh=class{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const o={index:n.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(o,e.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const o={index:n.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(o,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},$h=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const o={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(o,e.transmissionMap),i.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Gh=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const o={index:n.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(o,e.thicknessMap),i.thicknessTexture=o}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Yh=class{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const n=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}},Kh=class{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(Ch)&&!e.specularIntensityMap&&!e.specularColorTexture)return;const n=this.writer,r=n.extensionsUsed,i={};if(e.specularIntensityMap){const o={index:n.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(o,e.specularIntensityMap),i.specularTexture=o}if(e.specularColorMap){const o={index:n.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(o,e.specularColorMap),i.specularColorTexture=o}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},qh=class{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(e.sheenRoughnessMap){const o={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(o,e.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(e.sheenColorMap){const o={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(o,e.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Wh=class{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(e.anisotropyMap){const o={index:n.processTexture(e.anisotropyMap)};n.applyTextureTransform(o,e.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Xh=class{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}};var vn=Uint8Array,os=Uint16Array,Zh=Uint32Array,Qh=new vn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Jh=new vn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),as=function(e,t){for(var n=new os(31),r=0;r<31;++r)n[r]=t+=1<>>1|(Ne&21845)<<1;Tt=(Tt&52428)>>>2|(Tt&13107)<<2,Tt=(Tt&61680)>>>4|(Tt&3855)<<4,nm[Ne]=((Tt&65280)>>>8|(Tt&255)<<8)>>>1}var Jn=new vn(288);for(var Ne=0;Ne<144;++Ne)Jn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Jn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Jn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Jn[Ne]=8;var rm=new vn(32);for(var Ne=0;Ne<32;++Ne)rm[Ne]=5;var im=new vn(0),om=typeof TextDecoder<"u"&&new TextDecoder,am=0;try{om.decode(im,{stream:!0}),am=1}catch{}var sm=Object.defineProperty,lm=(e,t,n)=>t in e?sm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,um=(e,t,n)=>(lm(e,t+"",n),n);const ls=class extends Pt{constructor(e,t={}){super(e),this.isReflector=!0,this.type="Reflector",this.camera=new Et;const n=this,r=t.color!==void 0?new Fe(t.color):new Fe(8355711),i=t.textureWidth||512,o=t.textureHeight||512,a=t.clipBias||0,s=t.shader||ls.ReflectorShader,l=t.multisample!==void 0?t.multisample:4,u=new ia,c=new ae,f=new ae,p=new ae,d=new vt,y=new ae(0,0,-1),x=new At,w=new ae,k=new ae,S=new At,_=new vt,R=this.camera,P=new il(i,o,{samples:l,type:ol}),h=new mn({uniforms:oi.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=_,this.material=h,this.onBeforeRender=function(I,v,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),w.subVectors(f,p),w.dot(c)>0)return;w.reflect(c).negate(),w.add(f),d.extractRotation(g.matrixWorld),y.set(0,0,-1),y.applyMatrix4(d),y.add(p),k.subVectors(f,y),k.reflect(c).negate(),k.add(f),R.position.copy(w),R.up.set(0,1,0),R.up.applyMatrix4(d),R.up.reflect(c),R.lookAt(k),R.far=g.far,R.updateMatrixWorld(),R.projectionMatrix.copy(g.projectionMatrix),_.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),_.multiply(R.projectionMatrix),_.multiply(R.matrixWorldInverse),_.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(R.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=R.projectionMatrix;S.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],S.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],S.z=-1,S.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(S)),m.elements[2]=x.x,m.elements[6]=x.y,m.elements[10]=x.z+1-a,m.elements[14]=x.w,n.visible=!1;const T=I.getRenderTarget(),E=I.xr.enabled,F=I.shadowMap.autoUpdate,j=I.toneMapping;let D=!1;"outputColorSpace"in I?D=I.outputColorSpace==="srgb":D=I.outputEncoding===3001,I.xr.enabled=!1,I.shadowMap.autoUpdate=!1,"outputColorSpace"in I?I.outputColorSpace="srgb-linear":I.outputEncoding=3e3,I.toneMapping=al,I.setRenderTarget(P),I.state.buffers.depth.setMask(!0),I.autoClear===!1&&I.clear(),I.render(v,R),I.xr.enabled=E,I.shadowMap.autoUpdate=F,I.toneMapping=j,"outputColorSpace"in I?I.outputColorSpace=D?"srgb":"srgb-linear":I.outputEncoding=D?3001:3e3,I.setRenderTarget(T);const B=g.viewport;B!==void 0&&I.state.viewport(B),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let qr=ls;um(qr,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` - uniform mat4 textureMatrix; - varying vec4 vUv; - - #include - #include - - void main() { - - vUv = textureMatrix * vec4( position, 1.0 ); - - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - - #include - - }`,fragmentShader:` - uniform vec3 color; - uniform sampler2D tDiffuse; - varying vec4 vUv; - - #include - - float blendOverlay( float base, float blend ) { - - return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) ); - - } - - vec3 blendOverlay( vec3 base, vec3 blend ) { - - return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) ); - - } - - void main() { - - #include - - vec4 base = texture2DProj( tDiffuse, vUv ); - gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 ); - - #include - #include <${ki>=154?"colorspace_fragment":"encodings_fragment"}> - - }`});var cm=Object.defineProperty,fm=(e,t,n)=>t in e?cm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,us=(e,t,n)=>(fm(e,typeof t!="symbol"?t+"":t,n),n);const er=new ea,dm=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),cs=new qo(dm,5);er.setIndex([0,1,2,0,2,3]);er.setAttribute("position",new ti(cs,3,0,!1));er.setAttribute("uv",new ti(cs,2,3,!1));const Wr=class extends Pt{constructor(){super(Wr.Geometry,new Ht({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const e=new ae,t=new ae,n=new Ci(new Uint8Array(16*16*3),16,16,Lr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Vt,n.wrapT=Vt;const r=new Ci(new Uint8Array(16*16*3),16,16,Lr);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Vt,r.wrapT=Vt;const i=Wr.Geometry,o=new or({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` - - precision highp float; - - uniform vec3 screenPosition; - uniform vec2 scale; - - attribute vec3 position; - - void main() { - - gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); - - }`,fragmentShader:` - - precision highp float; - - void main() { - - gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); - - }`,depthTest:!0,depthWrite:!1,transparent:!1}),a=new or({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:` - - precision highp float; - - uniform vec3 screenPosition; - uniform vec2 scale; - - attribute vec3 position; - attribute vec2 uv; - - varying vec2 vUV; - - void main() { - - vUV = uv; - - gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); - - }`,fragmentShader:` - - precision highp float; - - uniform sampler2D map; - - varying vec2 vUV; - - void main() { - - gl_FragColor = texture2D( map, vUV ); - - }`,depthTest:!1,depthWrite:!1,transparent:!1}),s=new Pt(i,o),l=[],u=fs.Shader,c=new or({uniforms:{map:{value:null},occlusionMap:{value:r},color:{value:new Fe(16777215)},scale:{value:new Pe},screenPosition:{value:new ae}},vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,blending:sl,transparent:!0,depthWrite:!1}),f=new Pt(i,c);this.addElement=function(w){l.push(w)};const p=new Pe,d=new Pe,y=new ll,x=new At;this.onBeforeRender=function(w,k,S){w.getCurrentViewport(x);const _=x.w/x.z,R=x.z/2,P=x.w/2;let h=16/x.w;if(p.set(h*_,h),y.min.set(x.x,x.y),y.max.set(x.x+(x.z-16),x.y+(x.w-16)),t.setFromMatrixPosition(this.matrixWorld),t.applyMatrix4(S.matrixWorldInverse),!(t.z>0)&&(e.copy(t).applyMatrix4(S.projectionMatrix),d.x=x.x+e.x*R+R-8,d.y=x.y+e.y*P+P-8,y.containsPoint(d))){w.copyFramebufferToTexture(d,n);let I=o.uniforms;I.scale.value=p,I.screenPosition.value=e,w.renderBufferDirect(S,null,i,o,s,null),w.copyFramebufferToTexture(d,r),I=a.uniforms,I.scale.value=p,I.screenPosition.value=e,w.renderBufferDirect(S,null,i,a,s,null);const v=-e.x*2,g=-e.y*2;for(let m=0,T=l.length;mt in e?hm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ds=(e,t,n)=>(mm(e,typeof t!="symbol"?t+"":t,n),n);const Dn={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new ae},up:{value:new ae(0,1,0)}},vertexShader:` - uniform vec3 sunPosition; - uniform float rayleigh; - uniform float turbidity; - uniform float mieCoefficient; - uniform vec3 up; - - varying vec3 vWorldPosition; - varying vec3 vSunDirection; - varying float vSunfade; - varying vec3 vBetaR; - varying vec3 vBetaM; - varying float vSunE; - - // constants for atmospheric scattering - const float e = 2.71828182845904523536028747135266249775724709369995957; - const float pi = 3.141592653589793238462643383279502884197169; - - // wavelength of used primaries, according to preetham - const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 ); - // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function: - // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) - const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 ); - - // mie stuff - // K coefficient for the primaries - const float v = 4.0; - const vec3 K = vec3( 0.686, 0.678, 0.666 ); - // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K - const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 ); - - // earth shadow hack - // cutoffAngle = pi / 1.95; - const float cutoffAngle = 1.6110731556870734; - const float steepness = 1.5; - const float EE = 1000.0; - - float sunIntensity( float zenithAngleCos ) { - zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 ); - return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) ); - } - - vec3 totalMie( float T ) { - float c = ( 0.2 * T ) * 10E-18; - return 0.434 * c * MieConst; - } - - void main() { - - vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); - vWorldPosition = worldPosition.xyz; - - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - gl_Position.z = gl_Position.w; // set z to camera.far - - vSunDirection = normalize( sunPosition ); - - vSunE = sunIntensity( dot( vSunDirection, up ) ); - - vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 ); - - float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) ); - - // extinction (absorbtion + out scattering) - // rayleigh coefficients - vBetaR = totalRayleigh * rayleighCoefficient; - - // mie coefficients - vBetaM = totalMie( turbidity ) * mieCoefficient; - - } - `,fragmentShader:` - varying vec3 vWorldPosition; - varying vec3 vSunDirection; - varying float vSunfade; - varying vec3 vBetaR; - varying vec3 vBetaM; - varying float vSunE; - - uniform float mieDirectionalG; - uniform vec3 up; - - const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 ); - - // constants for atmospheric scattering - const float pi = 3.141592653589793238462643383279502884197169; - - const float n = 1.0003; // refractive index of air - const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius) - - // optical length at zenith for molecules - const float rayleighZenithLength = 8.4E3; - const float mieZenithLength = 1.25E3; - // 66 arc seconds -> degrees, and the cosine of that - const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324; - - // 3.0 / ( 16.0 * pi ) - const float THREE_OVER_SIXTEENPI = 0.05968310365946075; - // 1.0 / ( 4.0 * pi ) - const float ONE_OVER_FOURPI = 0.07957747154594767; - - float rayleighPhase( float cosTheta ) { - return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) ); - } - - float hgPhase( float cosTheta, float g ) { - float g2 = pow( g, 2.0 ); - float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 ); - return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse ); - } - - void main() { - - vec3 direction = normalize( vWorldPosition - cameraPos ); - - // optical length - // cutoff angle at 90 to avoid singularity in next formula. - float zenithAngle = acos( max( 0.0, dot( up, direction ) ) ); - float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) ); - float sR = rayleighZenithLength * inverse; - float sM = mieZenithLength * inverse; - - // combined extinction factor - vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) ); - - // in scattering - float cosTheta = dot( direction, vSunDirection ); - - float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 ); - vec3 betaRTheta = vBetaR * rPhase; - - float mPhase = hgPhase( cosTheta, mieDirectionalG ); - vec3 betaMTheta = vBetaM * mPhase; - - vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) ); - Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) ); - - // nightsky - float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2] - float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2] - vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 ); - vec3 L0 = vec3( 0.1 ) * Fex; - - // composition + solar disc - float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ); - L0 += ( vSunE * 19000.0 * Fex ) * sundisk; - - vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 ); - - vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) ); - - gl_FragColor = vec4( retColor, 1.0 ); - - #include - #include <${ki>=154?"colorspace_fragment":"encodings_fragment"}> - - } - `},ps=new mn({name:"SkyShader",fragmentShader:Dn.fragmentShader,vertexShader:Dn.vertexShader,uniforms:oi.clone(Dn.uniforms),side:Ks,depthWrite:!1});class hs extends Pt{constructor(){super(new rl(1,1,1),ps)}}ds(hs,"SkyShader",Dn);ds(hs,"material",ps);new qs;new ae;new oa(0,0,0,"YXZ");new ae;var gm=Object.defineProperty,ym=(e,t,n)=>t in e?gm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,te=(e,t,n)=>(ym(e,typeof t!="symbol"?t+"":t,n),n);const Rn=new Ys,Io=new ia,xm=Math.cos(70*(Math.PI/180)),Ro=(e,t)=>(e%t+t)%t;class vm extends Gs{constructor(t,n){super(),te(this,"object"),te(this,"domElement"),te(this,"enabled",!0),te(this,"target",new ae),te(this,"minDistance",0),te(this,"maxDistance",1/0),te(this,"minZoom",0),te(this,"maxZoom",1/0),te(this,"minPolarAngle",0),te(this,"maxPolarAngle",Math.PI),te(this,"minAzimuthAngle",-1/0),te(this,"maxAzimuthAngle",1/0),te(this,"enableDamping",!1),te(this,"dampingFactor",.05),te(this,"enableZoom",!0),te(this,"zoomSpeed",1),te(this,"enableRotate",!0),te(this,"rotateSpeed",1),te(this,"enablePan",!0),te(this,"panSpeed",1),te(this,"screenSpacePanning",!0),te(this,"keyPanSpeed",7),te(this,"zoomToCursor",!1),te(this,"autoRotate",!1),te(this,"autoRotateSpeed",2),te(this,"reverseOrbit",!1),te(this,"reverseHorizontalOrbit",!1),te(this,"reverseVerticalOrbit",!1),te(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),te(this,"mouseButtons",{LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN}),te(this,"touches",{ONE:_t.ROTATE,TWO:_t.DOLLY_PAN}),te(this,"target0"),te(this,"position0"),te(this,"zoom0"),te(this,"_domElementKeyEvents",null),te(this,"getPolarAngle"),te(this,"getAzimuthalAngle"),te(this,"setPolarAngle"),te(this,"setAzimuthalAngle"),te(this,"getDistance"),te(this,"getZoomScale"),te(this,"listenToKeyEvents"),te(this,"stopListenToKeyEvents"),te(this,"saveState"),te(this,"reset"),te(this,"update"),te(this,"connect"),te(this,"dispose"),te(this,"dollyIn"),te(this,"dollyOut"),te(this,"getScale"),te(this,"setScale"),this.object=t,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=L=>{let Y=Ro(L,2*Math.PI),Z=c.phi;Z<0&&(Z+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Me=Math.abs(Y-Z);2*Math.PI-Me{let Y=Ro(L,2*Math.PI),Z=c.theta;Z<0&&(Z+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Me=Math.abs(Y-Z);2*Math.PI-Mer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",ne),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ne),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=s.NONE},this.update=(()=>{const L=new ae,Y=new ae(0,1,0),Z=new On().setFromUnitVectors(t.up,Y),Me=Z.clone().invert(),Xe=new ae,it=new On,wn=2*Math.PI;return function(){const Mi=r.object.position;Z.setFromUnitVectors(t.up,Y),Me.copy(Z).invert(),L.copy(Mi).sub(r.target),L.applyQuaternion(Z),c.setFromVector3(L),r.autoRotate&&l===s.NONE&&j(E()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let ht=r.minAzimuthAngle,mt=r.maxAzimuthAngle;isFinite(ht)&&isFinite(mt)&&(ht<-Math.PI?ht+=wn:ht>Math.PI&&(ht-=wn),mt<-Math.PI?mt+=wn:mt>Math.PI&&(mt-=wn),ht<=mt?c.theta=Math.max(ht,Math.min(mt,c.theta)):c.theta=c.theta>(ht+mt)/2?Math.max(ht,c.theta):Math.min(mt,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(d,r.dampingFactor):r.target.add(d),r.zoomToCursor&&g||r.object.isOrthographicCamera?c.radius=C(c.radius):c.radius=C(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Me),Mi.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let tn=!1;if(r.zoomToCursor&&g){let nn=null;if(r.object instanceof Et&&r.object.isPerspectiveCamera){const rn=L.length();nn=C(rn*p);const kn=rn-nn;r.object.position.addScaledVector(I,kn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rn=new ae(v.x,v.y,0);rn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),tn=!0;const kn=new ae(v.x,v.y,0);kn.unproject(r.object),r.object.position.sub(kn).add(rn),r.object.updateMatrixWorld(),nn=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;nn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(nn).add(r.object.position):(Rn.origin.copy(r.object.position),Rn.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Rn.direction))u||8*(1-it.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Xe.copy(r.object.position),it.copy(r.object.quaternion),tn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Ue),r.domElement.addEventListener("pointerdown",Ae),r.domElement.addEventListener("pointercancel",et),r.domElement.addEventListener("wheel",q)},this.dispose=()=>{var L,Y,Z,Me,Xe,it;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",Ue),(Y=r.domElement)==null||Y.removeEventListener("pointerdown",Ae),(Z=r.domElement)==null||Z.removeEventListener("pointercancel",et),(Me=r.domElement)==null||Me.removeEventListener("wheel",q),(Xe=r.domElement)==null||Xe.ownerDocument.removeEventListener("pointermove",ze),(it=r.domElement)==null||it.ownerDocument.removeEventListener("pointerup",et),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ne)};const r=this,i={type:"change"},o={type:"start"},a={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=s.NONE;const u=1e-6,c=new Ri,f=new Ri;let p=1;const d=new ae,y=new Pe,x=new Pe,w=new Pe,k=new Pe,S=new Pe,_=new Pe,R=new Pe,P=new Pe,h=new Pe,I=new ae,v=new Pe;let g=!1;const m=[],T={};function E(){return 2*Math.PI/60/60*r.autoRotateSpeed}function F(){return Math.pow(.95,r.zoomSpeed)}function j(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function D(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const B=(()=>{const L=new ae;return function(Y,Z){L.setFromMatrixColumn(Z,0),L.multiplyScalar(-Y),d.add(L)}})(),X=(()=>{const L=new ae;return function(Y,Z){r.screenSpacePanning===!0?L.setFromMatrixColumn(Z,1):(L.setFromMatrixColumn(Z,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(Y),d.add(L)}})(),re=(()=>{const L=new ae;return function(Y,Z){const Me=r.domElement;if(Me&&r.object instanceof Et&&r.object.isPerspectiveCamera){const Xe=r.object.position;L.copy(Xe).sub(r.target);let it=L.length();it*=Math.tan(r.object.fov/2*Math.PI/180),B(2*Y*it/Me.clientHeight,r.object.matrix),X(2*Z*it/Me.clientHeight,r.object.matrix)}else Me&&r.object instanceof $t&&r.object.isOrthographicCamera?(B(Y*(r.object.right-r.object.left)/r.object.zoom/Me.clientWidth,r.object.matrix),X(Z*(r.object.top-r.object.bottom)/r.object.zoom/Me.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function Q(L){r.object instanceof Et&&r.object.isPerspectiveCamera||r.object instanceof $t&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function M(L){Q(p/L)}function ie(L){Q(p*L)}function Ee(L){if(!r.zoomToCursor||!r.domElement)return;g=!0;const Y=r.domElement.getBoundingClientRect(),Z=L.clientX-Y.left,Me=L.clientY-Y.top,Xe=Y.width,it=Y.height;v.x=Z/Xe*2-1,v.y=-(Me/it)*2+1,I.set(v.x,v.y,1).unproject(r.object).sub(r.object.position).normalize()}function C(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function he(L){y.set(L.clientX,L.clientY)}function we(L){Ee(L),R.set(L.clientX,L.clientY)}function me(L){k.set(L.clientX,L.clientY)}function Oe(L){x.set(L.clientX,L.clientY),w.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(j(2*Math.PI*w.x/Y.clientHeight),D(2*Math.PI*w.y/Y.clientHeight)),y.copy(x),r.update()}function $(L){P.set(L.clientX,L.clientY),h.subVectors(P,R),h.y>0?M(F()):h.y<0&&ie(F()),R.copy(P),r.update()}function b(L){S.set(L.clientX,L.clientY),_.subVectors(S,k).multiplyScalar(r.panSpeed),re(_.x,_.y),k.copy(S),r.update()}function A(L){Ee(L),L.deltaY<0?ie(F()):L.deltaY>0&&M(F()),r.update()}function N(L){let Y=!1;switch(L.code){case r.keys.UP:re(0,r.keyPanSpeed),Y=!0;break;case r.keys.BOTTOM:re(0,-r.keyPanSpeed),Y=!0;break;case r.keys.LEFT:re(r.keyPanSpeed,0),Y=!0;break;case r.keys.RIGHT:re(-r.keyPanSpeed,0),Y=!0;break}Y&&(L.preventDefault(),r.update())}function V(){if(m.length==1)y.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);y.set(L,Y)}}function z(){if(m.length==1)k.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);k.set(L,Y)}}function K(){const L=m[0].pageX-m[1].pageX,Y=m[0].pageY-m[1].pageY,Z=Math.sqrt(L*L+Y*Y);R.set(0,Z)}function ee(){r.enableZoom&&K(),r.enablePan&&z()}function ge(){r.enableZoom&&K(),r.enableRotate&&V()}function ke(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const Z=pt(L),Me=.5*(L.pageX+Z.x),Xe=.5*(L.pageY+Z.y);x.set(Me,Xe)}w.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(j(2*Math.PI*w.x/Y.clientHeight),D(2*Math.PI*w.y/Y.clientHeight)),y.copy(x)}function fe(L){if(m.length==1)S.set(L.pageX,L.pageY);else{const Y=pt(L),Z=.5*(L.pageX+Y.x),Me=.5*(L.pageY+Y.y);S.set(Z,Me)}_.subVectors(S,k).multiplyScalar(r.panSpeed),re(_.x,_.y),k.copy(S)}function ye(L){const Y=pt(L),Z=L.pageX-Y.x,Me=L.pageY-Y.y,Xe=Math.sqrt(Z*Z+Me*Me);P.set(0,Xe),h.set(0,Math.pow(P.y/R.y,r.zoomSpeed)),M(h.y),R.copy(P)}function Ie(L){r.enableZoom&&ye(L),r.enablePan&&fe(L)}function be(L){r.enableZoom&&ye(L),r.enableRotate&&ke(L)}function Ae(L){var Y,Z;r.enabled!==!1&&(m.length===0&&((Y=r.domElement)==null||Y.ownerDocument.addEventListener("pointermove",ze),(Z=r.domElement)==null||Z.ownerDocument.addEventListener("pointerup",et)),dt(L),L.pointerType==="touch"?ue(L):en(L))}function ze(L){r.enabled!==!1&&(L.pointerType==="touch"?xe(L):U(L))}function et(L){var Y,Z,Me;rt(L),m.length===0&&((Y=r.domElement)==null||Y.releasePointerCapture(L.pointerId),(Z=r.domElement)==null||Z.ownerDocument.removeEventListener("pointermove",ze),(Me=r.domElement)==null||Me.ownerDocument.removeEventListener("pointerup",et)),r.dispatchEvent(a),l=s.NONE}function en(L){let Y;switch(L.button){case 0:Y=r.mouseButtons.LEFT;break;case 1:Y=r.mouseButtons.MIDDLE;break;case 2:Y=r.mouseButtons.RIGHT;break;default:Y=-1}switch(Y){case yt.DOLLY:if(r.enableZoom===!1)return;we(L),l=s.DOLLY;break;case yt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;me(L),l=s.PAN}else{if(r.enableRotate===!1)return;he(L),l=s.ROTATE}break;case yt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;he(L),l=s.ROTATE}else{if(r.enablePan===!1)return;me(L),l=s.PAN}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function U(L){if(r.enabled!==!1)switch(l){case s.ROTATE:if(r.enableRotate===!1)return;Oe(L);break;case s.DOLLY:if(r.enableZoom===!1)return;$(L);break;case s.PAN:if(r.enablePan===!1)return;b(L);break}}function q(L){r.enabled===!1||r.enableZoom===!1||l!==s.NONE&&l!==s.ROTATE||(L.preventDefault(),r.dispatchEvent(o),A(L),r.dispatchEvent(a))}function ne(L){r.enabled===!1||r.enablePan===!1||N(L)}function ue(L){switch(bt(L),m.length){case 1:switch(r.touches.ONE){case _t.ROTATE:if(r.enableRotate===!1)return;V(),l=s.TOUCH_ROTATE;break;case _t.PAN:if(r.enablePan===!1)return;z(),l=s.TOUCH_PAN;break;default:l=s.NONE}break;case 2:switch(r.touches.TWO){case _t.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ee(),l=s.TOUCH_DOLLY_PAN;break;case _t.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ge(),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function xe(L){switch(bt(L),l){case s.TOUCH_ROTATE:if(r.enableRotate===!1)return;ke(L),r.update();break;case s.TOUCH_PAN:if(r.enablePan===!1)return;fe(L),r.update();break;case s.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(L),r.update();break;case s.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;be(L),r.update();break;default:l=s.NONE}}function Ue(L){r.enabled!==!1&&L.preventDefault()}function dt(L){m.push(L)}function rt(L){delete T[L.pointerId];for(let Y=0;Y{ie(L),r.update()},this.dollyOut=(L=F())=>{M(L),r.update()},this.getScale=()=>p,this.setScale=L=>{Q(L),r.update()},this.getZoomScale=()=>F(),n!==void 0&&this.connect(n),this.update()}}new vt;new ae;new oa;new ae;var bm=Object.defineProperty,wm=(e,t,n)=>t in e?bm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ti=(e,t,n)=>(wm(e,typeof t!="symbol"?t+"":t,n),n);class ms{constructor(t){Ti(this,"data"),this.data=t}generateShapes(t,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},a=km(t,n,this.data,o);for(let s=0,l=a.length;s - #include - #include - uniform float thickness; - uniform bool screenspace; - uniform vec2 size; - void main() { - #if defined (USE_SKINNING) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - vec4 tNormal = vec4(normal, 0.0); - vec4 tPosition = vec4(transformed, 1.0); - #ifdef USE_INSTANCING - tNormal = instanceMatrix * tNormal; - tPosition = instanceMatrix * tPosition; - #endif - if (screenspace) { - vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness; - gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0); - } else { - vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition; - vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal; - vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0; - clipPosition.xy += offset; - gl_Position = clipPosition; - } - }`,`uniform vec3 color; - uniform float opacity; - void main(){ - gl_FragColor = vec4(color, opacity); - #include - #include - }`);const _m=["args","material-uniforms-color-value"];qr.ReflectorShader;new ae;new ae;new ae;var Ar;/Mac/.test((Ar=globalThis==null?void 0:globalThis.navigator)===null||Ar===void 0?void 0:Ar.platform);const Mm=["target","auto-rotate","auto-rotate-speed","enable-damping","damping-factor","enable-pan","key-pan-speed","keys","max-azimuth-angle","min-azimuth-angle","max-polar-angle","min-polar-angle","min-distance","max-distance","min-zoom","max-zoom","touches","enable-zoom","zoom-speed","enable-rotate","rotate-speed","mouse-buttons","args"],Em=Be({__name:"OrbitControls",props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:_t.ROTATE,TWO:_t.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN})}},emits:["change","start","end"],setup(e,{expose:t,emit:n}){const r=e,i=n,{makeDefault:o,autoRotate:a,autoRotateSpeed:s,enableDamping:l,dampingFactor:u,enablePan:c,keyPanSpeed:f,maxAzimuthAngle:p,minAzimuthAngle:d,maxPolarAngle:y,minPolarAngle:x,minDistance:w,maxDistance:k,minZoom:S,maxZoom:_,enableZoom:R,zoomSpeed:P,enableRotate:h,touches:I,rotateSpeed:v,target:g,mouseButtons:m}=ii(r),{camera:T,renderer:E,extend:F,controls:j,invalidate:D}=Kn(),B=ra(null);F({OrbitControls:vm}),Ke(B,Q=>{X(),Q&&o.value?j.value=Q:j.value=null});function X(){kr(B.value,"change",()=>{i("change",B.value),D()}),kr(B.value,"start",()=>i("start",B.value)),kr(B.value,"end",()=>i("end",B.value))}const{onBeforeRender:re}=Un();return re(({invalidate:Q})=>{B.value&&(l.value||a.value)&&(B.value.update(),a.value&&Q())}),Ot(()=>{B.value&&B.value.dispose()}),t({instance:B}),(Q,M)=>(Q.camera||H(T))&&(Q.domElement||H(E))?(J(),oe("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:B,target:H(g),"auto-rotate":H(a),"auto-rotate-speed":H(s),"enable-damping":H(l),"damping-factor":H(u),"enable-pan":H(c),"key-pan-speed":H(f),keys:Q.keys,"max-azimuth-angle":H(p),"min-azimuth-angle":H(d),"max-polar-angle":H(y),"min-polar-angle":H(x),"min-distance":H(w),"max-distance":H(k),"min-zoom":H(S),"max-zoom":H(_),touches:H(I),"enable-zoom":H(R),"zoom-speed":H(P),"enable-rotate":H(h),"rotate-speed":H(v),"mouse-buttons":H(m),args:[Q.camera||H(T),Q.domElement||H(E).domElement]},null,8,Mm)):at("",!0)}});function Cn(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Co={exports:{}},No;function Am(){return No||(No=1,function(e,t){(function(n){e.exports=n()})(function(){return function n(r,i,o){function a(u,c){if(!i[u]){if(!r[u]){var f=typeof Cn=="function"&&Cn;if(!c&&f)return f(u,!0);if(s)return s(u,!0);throw new Error("Cannot find module '"+u+"'")}c=i[u]={exports:{}},r[u][0].call(c.exports,function(p){var d=r[u][1][p];return a(d||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var s=typeof Cn=="function"&&Cn,l=0;l>16),D((65280&m)>>8),D(255&m);return T==2?D(255&(m=I(v.charAt(g))<<2|I(v.charAt(g+1))>>4)):T==1&&(D((m=I(v.charAt(g))<<10|I(v.charAt(g+1))<<4|I(v.charAt(g+2))>>2)>>8&255),D(255&m)),E},y.fromByteArray=function(v){var g,m,T,E,F=v.length%3,j="";function D(B){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(B)}for(g=0,T=v.length-F;g>18&63)+D(E>>12&63)+D(E>>6&63)+D(63&E);switch(F){case 1:j=(j+=D((m=v[v.length-1])>>2))+D(m<<4&63)+"==";break;case 2:j=(j=(j+=D((m=(v[v.length-2]<<8)+v[v.length-1])>>10))+D(m>>4&63))+D(m<<2&63)+"="}return j}})(i===void 0?this.base64js={}:i)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,r,i){(function(o,a,w,l,u,c,f,p,d){var y=n("base64-js"),x=n("ieee754");function w(b,A,N){if(!(this instanceof w))return new w(b,A,N);var V,z,K,ee,ge=typeof b;if(A==="base64"&&ge=="string")for(b=(ee=b).trim?ee.trim():ee.replace(/^\s+|\s+$/g,"");b.length%4!=0;)b+="=";if(ge=="number")V=re(b);else if(ge=="string")V=w.byteLength(b,A);else{if(ge!="object")throw new Error("First argument needs to be a number, array or string.");V=re(b.length)}if(w._useTypedArrays?z=w._augment(new Uint8Array(V)):((z=this).length=V,z._isBuffer=!0),w._useTypedArrays&&typeof b.byteLength=="number")z._set(b);else if(Q(ee=b)||w.isBuffer(ee)||ee&&typeof ee=="object"&&typeof ee.length=="number")for(K=0;K>8,ee=ee%256,ge.push(ee),ge.push(K);return ge}(A),b,N,V)}function _(b,A,N){var V="";N=Math.min(b.length,N);for(var z=A;z>>0)):(A+1>>0),z}function h(b,A,N,V){if(V||($(typeof N=="boolean","missing or invalid endian"),$(A!=null,"missing offset"),$(A+1>>8*(V?K:1-K)}function T(b,A,N,V,z){if(z||($(A!=null,"missing value"),$(typeof V=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+3>>8*(V?K:3-K)&255}function E(b,A,N,V,z){z||($(A!=null,"missing value"),$(typeof V=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+1this.length&&(V=this.length);var z=(V=b.length-A=this.length))return this[b]},w.prototype.readUInt16LE=function(b,A){return R(this,b,!0,A)},w.prototype.readUInt16BE=function(b,A){return R(this,b,!1,A)},w.prototype.readUInt32LE=function(b,A){return P(this,b,!0,A)},w.prototype.readUInt32BE=function(b,A){return P(this,b,!1,A)},w.prototype.readInt8=function(b,A){if(A||($(b!=null,"missing offset"),$(b=this.length))return 128&this[b]?-1*(255-this[b]+1):this[b]},w.prototype.readInt16LE=function(b,A){return h(this,b,!0,A)},w.prototype.readInt16BE=function(b,A){return h(this,b,!1,A)},w.prototype.readInt32LE=function(b,A){return I(this,b,!0,A)},w.prototype.readInt32BE=function(b,A){return I(this,b,!1,A)},w.prototype.readFloatLE=function(b,A){return v(this,b,!0,A)},w.prototype.readFloatBE=function(b,A){return v(this,b,!1,A)},w.prototype.readDoubleLE=function(b,A){return g(this,b,!0,A)},w.prototype.readDoubleBE=function(b,A){return g(this,b,!1,A)},w.prototype.writeUInt8=function(b,A,N){N||($(b!=null,"missing value"),$(A!=null,"missing offset"),$(A=this.length||(this[A]=b)},w.prototype.writeUInt16LE=function(b,A,N){m(this,b,A,!0,N)},w.prototype.writeUInt16BE=function(b,A,N){m(this,b,A,!1,N)},w.prototype.writeUInt32LE=function(b,A,N){T(this,b,A,!0,N)},w.prototype.writeUInt32BE=function(b,A,N){T(this,b,A,!1,N)},w.prototype.writeInt8=function(b,A,N){N||($(b!=null,"missing value"),$(A!=null,"missing offset"),$(A=this.length||(0<=b?this.writeUInt8(b,A,N):this.writeUInt8(255+b+1,A,N))},w.prototype.writeInt16LE=function(b,A,N){E(this,b,A,!0,N)},w.prototype.writeInt16BE=function(b,A,N){E(this,b,A,!1,N)},w.prototype.writeInt32LE=function(b,A,N){F(this,b,A,!0,N)},w.prototype.writeInt32BE=function(b,A,N){F(this,b,A,!1,N)},w.prototype.writeFloatLE=function(b,A,N){j(this,b,A,!0,N)},w.prototype.writeFloatBE=function(b,A,N){j(this,b,A,!1,N)},w.prototype.writeDoubleLE=function(b,A,N){D(this,b,A,!0,N)},w.prototype.writeDoubleBE=function(b,A,N){D(this,b,A,!1,N)},w.prototype.fill=function(b,A,N){if(A=A||0,N=N||this.length,$(typeof(b=typeof(b=b||0)=="string"?b.charCodeAt(0):b)=="number"&&!isNaN(b),"value is not a number"),$(A<=N,"end < start"),N!==A&&this.length!==0){$(0<=A&&A"},w.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(w._useTypedArrays)return new w(this).buffer;for(var b=new Uint8Array(this.length),A=0,N=b.length;A=A.length||z>=b.length);z++)A[z+N]=b[z];return z}function he(b){try{return decodeURIComponent(b)}catch{return"�"}}function we(b,A){$(typeof b=="number","cannot write a non-number as a number"),$(0<=b,"specified a negative value for writing an unsigned value"),$(b<=A,"value is larger than maximum value for type"),$(Math.floor(b)===b,"value has a fractional component")}function me(b,A,N){$(typeof b=="number","cannot write a non-number as a number"),$(b<=A,"value larger than maximum allowed value"),$(N<=b,"value smaller than minimum allowed value"),$(Math.floor(b)===b,"value has a fractional component")}function Oe(b,A,N){$(typeof b=="number","cannot write a non-number as a number"),$(b<=A,"value larger than maximum allowed value"),$(N<=b,"value smaller than minimum allowed value")}function $(b,A){if(!b)throw new Error(A||"Failed assertion")}w._augment=function(b){return b._isBuffer=!0,b._get=b.get,b._set=b.set,b.get=B.get,b.set=B.set,b.write=B.write,b.toString=B.toString,b.toLocaleString=B.toString,b.toJSON=B.toJSON,b.copy=B.copy,b.slice=B.slice,b.readUInt8=B.readUInt8,b.readUInt16LE=B.readUInt16LE,b.readUInt16BE=B.readUInt16BE,b.readUInt32LE=B.readUInt32LE,b.readUInt32BE=B.readUInt32BE,b.readInt8=B.readInt8,b.readInt16LE=B.readInt16LE,b.readInt16BE=B.readInt16BE,b.readInt32LE=B.readInt32LE,b.readInt32BE=B.readInt32BE,b.readFloatLE=B.readFloatLE,b.readFloatBE=B.readFloatBE,b.readDoubleLE=B.readDoubleLE,b.readDoubleBE=B.readDoubleBE,b.writeUInt8=B.writeUInt8,b.writeUInt16LE=B.writeUInt16LE,b.writeUInt16BE=B.writeUInt16BE,b.writeUInt32LE=B.writeUInt32LE,b.writeUInt32BE=B.writeUInt32BE,b.writeInt8=B.writeInt8,b.writeInt16LE=B.writeInt16LE,b.writeInt16BE=B.writeInt16BE,b.writeInt32LE=B.writeInt32LE,b.writeInt32BE=B.writeInt32BE,b.writeFloatLE=B.writeFloatLE,b.writeFloatBE=B.writeFloatBE,b.writeDoubleLE=B.writeDoubleLE,b.writeDoubleBE=B.writeDoubleBE,b.fill=B.fill,b.inspect=B.inspect,b.toArrayBuffer=B.toArrayBuffer,b}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,r,i){(function(o,a,y,l,u,c,f,p,d){var y=n("buffer").Buffer,x=4,w=new y(x);w.fill(0),r.exports={hash:function(k,S,_,R){for(var P=S(function(m,T){m.length%x!=0&&(E=m.length+(x-m.length%x),m=y.concat([m,w],E));for(var E,F=[],j=T?m.readInt32BE:m.readInt32LE,D=0;D_?X=B(X):X.length<_&&(X=y.concat([X,R],_));for(var Q=new y(_),M=new y(_),ie=0;ie<_;ie++)Q[ie]=54^X[ie],M[ie]=92^X[ie];return re=B(y.concat([Q,re])),B(y.concat([M,re]))}(E,T,D):E(D);return F=null,j?D.toString(j):D}}}function h(){var m=[].slice.call(arguments).join(" ");throw new Error([m,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(` -`))}R.fill(0),i.createHash=function(m){return P(m)},i.createHmac=P,i.randomBytes=function(m,T){if(!T||!T.call)return new y(k(m));try{T.call(this,void 0,new y(k(m)))}catch(E){T(E)}};var I,v=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],g=function(m){i[m]=function(){h("sorry,",m,"is not implemented yet")}};for(I in v)g(v[I])}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){var y=n("./helpers");function x(h,I){h[I>>5]|=128<>>9<<4)]=I;for(var v=1732584193,g=-271733879,m=-1732584194,T=271733878,E=0;E>>32-m,v)}function k(h,I,v,g,m,T,E){return w(I&v|~I&g,h,I,m,T,E)}function S(h,I,v,g,m,T,E){return w(I&g|v&~g,h,I,m,T,E)}function _(h,I,v,g,m,T,E){return w(I^v^g,h,I,m,T,E)}function R(h,I,v,g,m,T,E){return w(v^(I|~g),h,I,m,T,E)}function P(h,I){var v=(65535&h)+(65535&I);return(h>>16)+(I>>16)+(v>>16)<<16|65535&v}r.exports=function(h){return y.hash(h,x,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){r.exports=function(y){for(var x,w=new Array(y),k=0;k>>((3&k)<<3)&255;return w}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){var y=n("./helpers");function x(S,_){S[_>>5]|=128<<24-_%32,S[15+(_+64>>9<<4)]=_;for(var R,P,h,I=Array(80),v=1732584193,g=-271733879,m=-1732584194,T=271733878,E=-1009589776,F=0;F>16)+(_>>16)+(R>>16)<<16|65535&R}function k(S,_){return S<<_|S>>>32-_}r.exports=function(S){return y.hash(S,x,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){function y(_,R){var P=(65535&_)+(65535&R);return(_>>16)+(R>>16)+(P>>16)<<16|65535&P}function x(_,R){var P,h=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),I=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),v=new Array(64);_[R>>5]|=128<<24-R%32,_[15+(R+64>>9<<4)]=R;for(var g,m,T=0;T<_.length;T+=16){for(var E=I[0],F=I[1],j=I[2],D=I[3],B=I[4],X=I[5],re=I[6],Q=I[7],M=0;M<64;M++)v[M]=M<16?_[M+T]:y(y(y((m=v[M-2],k(m,17)^k(m,19)^S(m,10)),v[M-7]),(m=v[M-15],k(m,7)^k(m,18)^S(m,3))),v[M-16]),P=y(y(y(y(Q,k(m=B,6)^k(m,11)^k(m,25)),B&X^~B&re),h[M]),v[M]),g=y(k(g=E,2)^k(g,13)^k(g,22),E&F^E&j^F&j),Q=re,re=X,X=B,B=y(D,P),D=j,j=F,F=E,E=y(P,g);I[0]=y(E,I[0]),I[1]=y(F,I[1]),I[2]=y(j,I[2]),I[3]=y(D,I[3]),I[4]=y(B,I[4]),I[5]=y(X,I[5]),I[6]=y(re,I[6]),I[7]=y(Q,I[7])}return I}var w=n("./helpers"),k=function(_,R){return _>>>R|_<<32-R},S=function(_,R){return _>>>R};r.exports=function(_){return w.hash(_,x,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){i.read=function(y,x,w,k,T){var _,R,P=8*T-k-1,h=(1<>1,v=-7,g=w?T-1:0,m=w?-1:1,T=y[x+g];for(g+=m,_=T&(1<<-v)-1,T>>=-v,v+=P;0>=-v,v+=k;0>1,g=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=k?0:E-1,T=k?1:-1,E=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,R=I):(R=Math.floor(Math.log(x)/Math.LN2),x*(k=Math.pow(2,-R))<1&&(R--,k*=2),2<=(x+=1<=R+v?g/k:g*Math.pow(2,1-v))*k&&(R++,k/=2),I<=R+v?(P=0,R=I):1<=R+v?(P=(x*k-1)*Math.pow(2,S),R+=v):(P=x*Math.pow(2,v-1)*Math.pow(2,S),R=0));8<=S;y[w+m]=255&P,m+=T,P/=256,S-=8);for(R=R<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),Do}var Fo,Bo;function ys(){return Bo||(Bo=1,Fo=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),Fo}var Sr,zo;function Im(){if(zo)return Sr;zo=1;var e=gs();return Sr=e.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),Sr}var Ir,Uo;function Rm(){if(Uo)return Ir;Uo=1;var e=ys();return e=e.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),Ir=e.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),Ir}var Rr,jo;function Cm(){if(jo)return Rr;jo=1,Rr=R;var e=gs(),t=Sm(),n=ys(),r=Im(),i=Rm(),o=999,a=9999,s=0,l=1,u=2,c=3,f=4,p=5,d=6,y=7,x=8,w=9,k=10,S=11,_=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function R(P){var h=0,I=0,v=o,g,m,T=[],E=[],F=1,j=0,D=0,B=!1,X=!1,re="",Q;P=P||{};var M=n,ie=e;P.version==="300 es"&&(M=i,ie=r);for(var Ee={},C={},h=0;h0)continue;be=fe.slice(0,1).join("")}return he(be),D+=be.length,T=T.slice(be.length),T.length}while(!0)}function K(){return/[^a-fA-F0-9]/.test(g)?(he(T.join("")),v=o,h):(T.push(g),m=g,h+1)}function ee(){return g==="."||/[eE]/.test(g)?(T.push(g),v=p,m=g,h+1):g==="x"&&T.length===1&&T[0]==="0"?(v=S,T.push(g),m=g,h+1):/[^\d]/.test(g)?(he(T.join("")),v=o,h):(T.push(g),m=g,h+1)}function ge(){return g==="f"&&(T.push(g),m=g,h+=1),/[eE]/.test(g)||(g==="-"||g==="+")&&/[eE]/.test(m)?(T.push(g),m=g,h+1):/[^\d]/.test(g)?(he(T.join("")),v=o,h):(T.push(g),m=g,h+1)}function ke(){if(/[^\d\w_]/.test(g)){var fe=T.join("");return C[fe]?v=x:Ee[fe]?v=y:v=d,he(T.join("")),v=o,h}return T.push(g),m=g,h+1}}return Rr}var Cr,Vo;function Nm(){if(Vo)return Cr;Vo=1;var e=Cm();Cr=t;function t(n,r){var i=e(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return Cr}Nm();function Lm(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Pm(e){var t=Lm(e,"string");return typeof t=="symbol"?t:String(t)}function Se(e,t,n){return t=Pm(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var le={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},je,Ut;je={},Se(je,"".concat(le.normal),{"#include ":` - vec3 objectNormal = `.concat(le.normal,`; - #ifdef USE_TANGENT - vec3 objectTangent = vec3( tangent.xyz ); - #endif - `)}),Se(je,"".concat(le.position),{"#include ":` - vec3 transformed = `.concat(le.position,`; - `)}),Se(je,"".concat(le.positionRaw),{"#include ":` - vec4 csm_internal_positionUnprojected = `.concat(le.positionRaw,`; - mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix; - #ifdef USE_INSTANCING - csm_internal_unprojectMatrix = csm_internal_unprojectMatrix * instanceMatrix; - #endif - csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected; - vec3 transformed = csm_internal_positionUnprojected.xyz; - `)}),Se(je,"".concat(le.pointSize),{"gl_PointSize = size;":` - gl_PointSize = `.concat(le.pointSize,`; - `)}),Se(je,"".concat(le.diffuseColor),{"#include ":` - #include - diffuseColor = `.concat(le.diffuseColor,`; - `)}),Se(je,"".concat(le.fragColor),{"#include ":` - #include - gl_FragColor = `.concat(le.fragColor,`; - `)}),Se(je,"".concat(le.emissive),{"vec3 totalEmissiveRadiance = emissive;":` - vec3 totalEmissiveRadiance = `.concat(le.emissive,`; - `)}),Se(je,"".concat(le.roughness),{"#include ":` - #include - roughnessFactor = `.concat(le.roughness,`; - `)}),Se(je,"".concat(le.metalness),{"#include ":` - #include - metalnessFactor = `.concat(le.metalness,`; - `)}),Se(je,"".concat(le.ao),{"#include ":` - #include - reflectedLight.indirectDiffuse *= 1. - `.concat(le.ao,`; - `)}),Se(je,"".concat(le.bump),{"#include ":` - #include - - vec3 csm_internal_orthogonal = `.concat(le.bump," - (dot(").concat(le.bump,`, normal) * normal); - vec3 csm_internal_projectedbump = mat3(csm_internal_vModelViewMatrix) * csm_internal_orthogonal; - normal = normalize(normal - csm_internal_projectedbump); - `)}),Se(je,"".concat(le.depthAlpha),{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":` - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity * `.concat(le.depthAlpha,` ); - `),"gl_FragColor = packDepthToRGBA( fragCoordZ );":` - gl_FragColor = packDepthToRGBA( fragCoordZ ); - gl_FragColor.a *= `.concat(le.depthAlpha,`; - `)});Ut={},Se(Ut,"".concat(le.position),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` - gl_Position = projectionMatrix * modelViewMatrix * vec4( `.concat(le.position,`, 1.0 ); - `)}),Se(Ut,"".concat(le.positionRaw),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` - gl_Position = `.concat(le.position,`; - `)}),Se(Ut,"".concat(le.diffuseColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` - gl_FragColor = `.concat(le.diffuseColor,`; - `)}),Se(Ut,"".concat(le.fragColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` - gl_FragColor = `.concat(le.fragColor,`; - `)});var Ve;Ve={},Se(Ve,"".concat(le.position),"*"),Se(Ve,"".concat(le.positionRaw),"*"),Se(Ve,"".concat(le.normal),"*"),Se(Ve,"".concat(le.pointSize),["PointsMaterial"]),Se(Ve,"".concat(le.diffuseColor),"*"),Se(Ve,"".concat(le.fragColor),"*"),Se(Ve,"".concat(le.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ve,"".concat(le.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ve,"".concat(le.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ve,"".concat(le.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Se(Ve,"".concat(le.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Se(Ve,"".concat(le.depthAlpha),"*");var Dm=`void main() { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -}`,Om=`#include - -void main() { - vec2 center = vec2(0., 1.); - float rotation = 0.0; - - - - float size = 0.03; - - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - - gl_Position = projectionMatrix * mvPosition; -}`;const bn=new ae(0,0,0),_i=new ae(0,0,0),Fm=new ae(0,0,0);function Ho(e,t,n){const r=bn.setFromMatrixPosition(e.matrixWorld);r.project(t);const i=n.width/2,o=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*o)+o,r.z]}function Bm(e,t){const n=bn.setFromMatrixPosition(e.matrixWorld),r=_i.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),o=t.getWorldDirection(Fm);return i.angleTo(o)>Math.PI/2}function zm(e,t,n,r){const i=bn.setFromMatrixPosition(e.matrixWorld),o=i.clone();o.project(t),n.setFromCamera(new Pe(o.x,o.y),t);const a=n.intersectObjects(r,!0);if(a.length>0){const s=a[0].distance;return i.distanceTo(n.ray.origin)Math.abs(e)<1e-10?0:e;function xs(e,t,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=Xr(t[i]*e.elements[i])+(i!==15?",":")");return n+r}const Vm=(e=>t=>xs(t,e))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Hm=(e=>(t,n)=>xs(t,e(n),"translate(-50%,-50%)"))(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1]),$m=["geometry","material"];new aa;var Zr={exports:{}},Gm=Zr.exports,$o;function Ym(){return $o||($o=1,function(e,t){(function(n,r){e.exports=r()})(Gm,function(){var n=function(){function r(d){return a.appendChild(d.dom),d}function i(d){for(var y=0;yl+1e3&&(c.update(1e3*u/(d-l),100),l=d,u=0,p)){var y=performance.memory;p.update(y.usedJSHeapSize/1048576,y.jsHeapSizeLimit/1048576)}return d},update:function(){s=this.end()},domElement:a,setMode:i}};return n.Panel=function(r,i,o){var a=1/0,s=0,l=Math.round,u=l(window.devicePixelRatio||1),c=80*u,f=48*u,p=3*u,d=2*u,y=3*u,x=15*u,w=74*u,k=30*u,S=document.createElement("canvas");S.width=c,S.height=f,S.style.cssText="width:80px;height:48px";var _=S.getContext("2d");return _.font="bold "+9*u+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=o,_.fillRect(0,0,c,f),_.fillStyle=i,_.fillText(r,p,d),_.fillRect(y,x,w,k),_.fillStyle=o,_.globalAlpha=.9,_.fillRect(y,x,w,k),{dom:S,update:function(R,P){a=Math.min(a,R),s=Math.max(s,R),_.fillStyle=o,_.globalAlpha=1,_.fillRect(0,0,c,x),_.fillStyle=i,_.fillText(l(R)+" "+r+" ("+l(a)+"-"+l(s)+")",p,d),_.drawImage(S,y+u,x,w-u,k,y,x,w-u,k),_.fillRect(y+w-u,x,u,k),_.fillStyle=o,_.globalAlpha=.9,_.fillRect(y+w-u,x,u,l((1-R/P)*k))}}},n})}(Zr)),Zr.exports}Ym();const Km={key:0,args:[0,1,64]},qm={key:1,args:[.5,1,64]},Wm={key:2},Xm=["tone-mapped","map","side","color"];new Fe(16777215);const jt=Be({__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}){const n=e,r=t,i=W(null);function o(y,x,w){return Math.min(Math.max(y,x),w)}function a(y){const x=y.toString();return x.includes("e-")?Number.parseInt(x.split("e-")[1],10):x.includes(".")?x.split(".")[1].length:0}function s(y,x){const w=a(x),k=10**(w+3);return Number.parseFloat((y*k/k).toFixed(w))}const l=ot(()=>s(o(n.modelValue,n.min,n.max),n.step)),u=ot(()=>{const y=(l.value-n.min)/(n.max-n.min)*100;return{width:`${y}%`,backgroundSize:`${y}% 100%`}});function c(y){if(!i.value)return l.value;const x=i.value.getBoundingClientRect(),k=(y.clientX-x.left)/x.width,S=n.max-n.min,_=n.min+S*k,R=Math.round(_/n.step)*n.step;return Math.min(Math.max(R,n.min),n.max)}function f(y){if(n.disabled)return;const x=c(y);r("update:modelValue",x)}function p(y){if(n.disabled)return;y.preventDefault();const x=c(y);r("update:modelValue",x),window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)}function d(y){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}return Ot(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}),(y,x)=>(J(),oe("span",{ref_key:"sliderRef",ref:i,class:lt(["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:p},[O("span",{style:Dr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),O("span",{role:"slider",class:"slider-thumb",style:Dr({left:`${(l.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))}}),Zm=Be({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:["loadModelProgress","error"],setup(e,{expose:t,emit:n}){const r=e,i=n;let o;const a=W(),s=W(),{scene:l}=Kn(),{onBeforeRender:u}=Un(),c=ih(),f=oh(),p=W();Ke(()=>r.position,([x,w,k])=>{a.value&&a.value.scene.position.set(x,w,k)}),Wn(async()=>{if(l.value)try{const x=await ah(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:S=>i("loadModelProgress",Number.parseFloat((100*(S.loaded/S.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const w=await nh(r.idleAnimation),k=await rh(x,w);if(!k){console.warn("No VRM animation loaded");return}s.value=new dl(x.scene),s.value.clipAction(k).play(),p.value=sh(x),a.value=x,o=u(({delta:S})=>{var _,R,P;(_=s.value)==null||_.update(S),(R=a.value)==null||R.update(S),c.update(a.value,S),f.update(a.value,S),(P=p.value)==null||P.update(S)}).off}catch(x){i("error",x)}}),Ot(()=>{o==null||o(),a.value&&(a.value.scene.removeFromParent(),Or.deepDispose(a.value.scene))}),t({setExpression(x){var w;(w=p.value)==null||w.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:y}=Un();return Ke(()=>r.paused,x=>{x?d():y()}),(x,w)=>qn(x.$slots,"default")}}),Qm=["position"],Jm={absolute:"",bottom:"3",right:"3"},eg={flex:"~ row","cursor-pointer":""},tg=["checked","aria-checked"],ng={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(y)}}),(y,x)=>(J(),Xt(fa,{relative:""},{default:$e(({height:w,width:k})=>[Te(H(pl),{alpha:!0,antialias:!0,width:k,height:w},{default:$e(()=>[Te(H(Em)),O("TresPerspectiveCamera",{position:[a.value,s.value,l.value]},null,8,Qm),x[14]||(x[14]=O("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),x[15]||(x[15]=O("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),Te(Zm,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,f.value],paused:r.paused,onLoadModelProgress:x[0]||(x[0]=S=>i("loadModelProgress",S)),onError:x[1]||(x[1]=S=>i("error",S))},null,8,["model","idle-animation","position","paused"])]),_:2,__:[14,15]},1032,["width","height"]),O("div",Jm,[O("div",eg,[O("label",{class:lt([o.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Mt(O("input",{"onUpdate:modelValue":x[2]||(x[2]=S=>o.value=S),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox","appearance-none":"","outline-none":"",hidden:""},null,8,tg),[[ri,o.value]]),x[16]||(x[16]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(H(ui),null,{default:$e(()=>[o.value?(J(),oe("div",ng,[O("div",rg,[O("div",ig,[O("span",null,ve(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),Te(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:$e(()=>[O("span",og,ve(H(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:$e(()=>[O("div",ag,[x[17]||(x[17]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",sg,[Te(jt,{modelValue:a.value,"onUpdate:modelValue":x[3]||(x[3]=S=>a.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",lg,[O("span",null,ve(a.value),1)]),x[18]||(x[18]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",ug,[Te(jt,{modelValue:s.value,"onUpdate:modelValue":x[4]||(x[4]=S=>s.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",cg,[O("span",null,ve(s.value),1)]),x[19]||(x[19]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",fg,[Te(jt,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=S=>l.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",dg,[O("span",null,ve(l.value),1)])])]),_:1}),Te(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:$e(()=>[O("span",pg,ve(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:$e(()=>[O("div",hg,[x[20]||(x[20]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",mg,[Te(jt,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=S=>u.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",gg,[O("span",null,ve(u.value),1)]),x[21]||(x[21]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",yg,[Te(jt,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=S=>c.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",xg,[O("span",null,ve(c.value),1)]),x[22]||(x[22]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",vg,[Te(jt,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=S=>f.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",bg,[O("span",null,ve(f.value),1)])])]),_:1}),O("div",wg,[O("span",null,ve(H(d)("stage.viewers.debug-menu.emotions")),1)]),O("div",kg,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("neutral")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.neutral")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[10]||(x[10]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("surprised")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[11]||(x[11]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("sad")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[12]||(x[12]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("angry")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[13]||(x[13]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("happy")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):at("",!0)]),_:1})])]),_:1}))}}),_g={relative:""},Mg={"h-full":"","w-full":""},Eg={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"},Ag={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},Sg=["innerHTML"],Ig=Be({__name:"Stage",props:{paused:{type:Boolean,default:!1},focusAt:null},setup(e){const t=W(),n=W(),{stageView:r}=Ge(Wt()),{mouthOpenSize:i}=Ge(Yl()),{audioContext:o,calculateVolume:a}=ha(),{onBeforeMessageComposed:s,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=St(),{process:y}=wi(),x=li(),w=W(),k=W(!1),S=W(!1),_=Ln({handlers:[M=>new Promise(ie=>{const Ee=o.createBufferSource();Ee.buffer=M.data.audioBuffer,Ee.connect(o.destination),Ee.connect(w.value),k.value=!0,Ee.start(0),Ee.onended=()=>{k.value=!1,ie()}})]}),R=Rl(),{ssmlEnabled:P,activeSpeechProvider:h,activeSpeechModel:I,activeSpeechVoice:v,pitch:g}=Ge(R);async function m(M){try{if(!h.value){console.warn("No active speech provider configured");return}if(!v.value){console.warn("No active speech voice configured");return}const ie=x.getProviderInstance(h.value);if(!ie){console.error("Failed to initialize speech provider");return}const Ee=x.getProviderConfig(h.value),C=P.value?R.generateSSML(M.data,v.value,{...Ee,pitch:g.value}):M.data,he=await Cl({...ie.speech(I.value,Ee),input:C,voice:v.value.id}),we=await o.decodeAudioData(he);await _.add({audioBuffer:we,text:M.data})}catch(ie){console.error("Speech generation failed:",ie)}}const T=Ln({handlers:[m]});T.on("add",M=>{console.debug("ttsQueue added",M)});const E=Nl(T),{live2dCurrentMotion:F}=Ge(Wt()),j=Ln({handlers:[async M=>{if(r.value==="3d"){const ie=Ml[M.data];if(!ie)return;await n.value.setExpression(ie)}else r.value==="2d"&&(F.value={group:El[M.data]})}]}),D=Ll(j);D.onHandlerEvent("emotion",M=>{console.debug("emotion detected",M)});const B=Pl();B.onHandlerEvent("delay",M=>{console.debug("delay detected",M)});function X(){requestAnimationFrame(X),k.value&&(i.value=a(w.value,"linear"))}function re(){S.value||(X(),o.resume(),S.value=!0)}function Q(){w.value||(w.value=o.createAnalyser())}return s(async()=>{Q(),re()}),l(async()=>{F.value={group:_l}}),u(async M=>{await E.add(M)}),c(async M=>{await B.add(M),await D.add(M)}),f(async()=>{await B.add(Dl)}),d(async M=>{}),Ot(()=>{S.value=!1}),Wn(async()=>{t.value=xl({connection:{bundles:Il()}}),await t.value.execute("CREATE TABLE memory_test (vec FLOAT[768]);")}),(M,ie)=>(J(),oe("div",_g,[O("div",Mg,[H(r)==="2d"?(J(),Xt(yh,{key:0,"focus-at":e.focusAt,"mouth-open-size":H(i),"min-w":"50% (J(),oe("header",Dg,[O("div",Og,[Te(jl)]),Te(H(hl),{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:$e(()=>n[0]||(n[0]=[O("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1,__:[0]})]))}}),Bg="/assets/worker-BwSRVkNn.js";async function zg(e,t){const n=new ArrayBuffer(44+e.length*2),r=new DataView(n);Nn(r,0,"RIFF"),r.setUint32(4,36+e.length*2,!0),Nn(r,8,"WAVE"),Nn(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),Nn(r,36,"data"),r.setUint32(40,e.length*2,!0),Ug(r,44,e);const i=new Blob([r],{type:"audio/wav"});return new Promise((o,a)=>{const s=new FileReader;s.onload=()=>{const l=s.result.split(",")[1];o(l)},s.onerror=a,s.readAsDataURL(i)})}function Nn(e,t,n){for(let r=0;r{jn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ca("auto-animate");return J(),oe("div",jg,[f[2]||(f[2]=O("div",{"flex-1":""},null,-1)),Mt((J(),oe("div",{ref_key:"chatHistoryRef",ref:t,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=O("div",{"flex-1":""},null,-1)),(J(!0),oe(ai,null,si(H(n),(d,y)=>(J(),oe("div",{key:y,"mb-2":""},[d.role==="error"?(J(),oe("div",Vg,[O("div",Hg,[O("div",$g,[O("div",Gg,[O("span",Yg,ve(H(a)("stage.chat.message.character-name.core-system")),1)]),f[0]||(f[0]=O("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),H(r)&&y===H(n).length-1?(J(),oe("div",Kg)):(J(),oe("div",{key:1,class:"markdown-content break-words text-violet-500",text:"base {if(!T||!T.trim())return;const E=a.getProviderConfig(s.value);await x(T,{chatProvider:a.getProviderInstance(s.value),model:l.value,providerConfig:E})}});async function h(){if(!(!t.value.trim()||o.value))try{const T=a.getProviderConfig(s.value);await x(t.value,{chatProvider:a.getProviderInstance(s.value),model:l.value,providerConfig:T})}catch(T){k.value.pop(),k.value.push({role:"error",content:T.message})}}const{destroy:I,start:v}=Za(y,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:T=>{n.value=!1,g(T)},auto:!1});async function g(T){await S.resume();const E=await zg(T,S.sampleRate);R({type:"generate",data:{audio:E,language:"en"}})}async function m(T){const E=T.target,F=c.value.find(j=>j.deviceId===E.value);if(!F){p.value=void 0;return}p.value=F}return Ke(d,async T=>{T==="false"&&(I(),P())}),Ke(i,async T=>{T&&await f()}),Wn(()=>{v()}),w(async()=>{t.value=""}),(T,E)=>(J(),oe("div",ay,[O("fieldset",sy,[O("label",{class:lt([r.value==="chat"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="chat"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":H(u)}]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-l-lg":"","px-2":""},[Mt(O("input",{"onUpdate:modelValue":E[0]||(E[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[ar,r.value]]),E[7]||(E[7]=O("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",uy,[O("span",cy,ve(H(_)("stage.chat.tabs.chat")),1)])],10,ly),O("label",{class:lt([r.value==="custom"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="custom"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":H(u)}]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","px-2":""},[Mt(O("input",{"onUpdate:modelValue":E[1]||(E[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[ar,r.value]]),E[8]||(E[8]=O("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",dy,[O("span",null,ve(H(_)("stage.chat.tabs.custom")),1)])],10,fy),O("label",{class:lt([r.value==="clothes"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="clothes"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":H(u)}]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-r-lg":"","px-2":""},[Mt(O("input",{"onUpdate:modelValue":E[2]||(E[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[ar,r.value]]),E[9]||(E[9]=O("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",hy,[O("span",null,ve(H(_)("stage.chat.tabs.clothes")),1)])],10,py)]),O("div",my,[O("div",gy,[Te(oy,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"t.value=F),placeholder:H(_)("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:lt({"transition-colors-none placeholder:transition-colors-none":H(u)}),onSubmit:h,onCompositionstart:E[4]||(E[4]=F=>o.value=!0),onCompositionend:E[5]||(E[5]=F=>o.value=!1)},null,8,["modelValue","placeholder","class"])])])]),O("div",xy,[O("div",vy,[Te(H(ui),null,{default:$e(()=>[i.value?(J(),oe("fieldset",by,[(J(!0),oe(ai,null,si(H(c),(F,j)=>(J(),oe("label",{key:j,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[O("input",{type:"radio",name:"audioInput",value:F.deviceId,hidden:"",onChange:m},null,40,wy),O("div",ky,[O("div",Ty,[F.deviceId===H(y)?(J(),oe("div",_y)):at("",!0)]),O("span",{"inline-block":"",class:lt([F.deviceId===H(y)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},ve(F.label),3)])]))),128))])):at("",!0)]),_:1}),O("label",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:lt({"transition-colors-none":H(u)}),text:"complementary-400","h-fit":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":""},[Mt(O("input",{"onUpdate:modelValue":E[6]||(E[6]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[ri,i.value]]),E[10]||(E[10]=O("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),O("div",null,[n.value?(J(),oe("span",Ey,"Listening...")):(J(),oe("span",My,ve(H(_)("settings.microphone")),1))])],2)])])]))}}),Sy=gn(Ay,[["__scopeId","data-v-5b585ca8"]]),Iy={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},Ry={key:0,flex:"",mr:"12"},Cy={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 {jn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ca("auto-animate");return J(),oe("div",Iy,[c[1]||(c[1]=O("div",{"flex-1":""},null,-1)),Mt((J(),oe("div",{ref_key:"chatHistoryRef",ref:t,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":"",class:"chat-history"},[c[0]||(c[0]=O("div",{"flex-1":""},null,-1)),(J(!0),oe(ai,null,si(H(r),(p,d)=>(J(),oe("div",{key:d,"mb-2":""},[p.role==="assistant"?(J(),oe("div",Ry,[O("div",Cy,[O("div",null,[O("span",Ny,ve(H(n)("stage.chat.message.character-name.airi")),1)]),p.content?(J(),oe("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:k=>{n.value=!1,w()},auto:!1});function w(k){alert("Transcription is not implemented yet")}return Ke(s,async k=>{k==="false"&&y()}),f(async()=>{t.value=""}),Wn(()=>{x()}),(k,S)=>(J(),oe("div",null,[O("div",Vy,[Te(jy,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),O("div",Hy,[Te(H(pa),{modelValue:t.value,"onUpdate:modelValue":S[0]||(S[0]=_=>t.value=_),placeholder:H(p)("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:lt({"transition-colors-none placeholder:transition-colors-none":H(u)}),onSubmit:d,onCompositionstart:S[1]||(S[1]=_=>r.value=!0),onCompositionend:S[2]||(S[2]=_=>r.value=!1)},null,8,["modelValue","placeholder","class"])])])]))}}),Gy={class:"relative"},Yy={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},Ky=Be({__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){const t=e,n=W(t.height),r=W(t.amplitude),i=W(t.waveLength),o=W(t.fillColor),a=W(t.direction),s=W(t.movementDirection);function l(f,p,d,y,x){const w=[],S=Math.ceil(f/y)*y,_=1,R=x==="up"?d:p-d;w.push(`M 0 ${R}`);const P=Math.PI*2/y;for(let I=0;I<=S;I+=_){const v=d*Math.sin(P*I),g=x==="up"?R-v:R+v;w.push(`L ${I} ${g}`)}const h=x==="up"?p:0;return w.push(`L ${S} ${h}`),w.push(`L 0 ${h} Z`),w.join(" ")}const u=ot(()=>n.value+r.value*2),c=ot(()=>{const f=` - - `;return`url(data:image/svg+xml;base64,${btoa(f)})`});return Ke(()=>[t.height,t.amplitude,t.waveLength,t.fillColor,t.direction,t.movementDirection],()=>{n.value=t.height,r.value=t.amplitude,i.value=t.waveLength,o.value=t.fillColor,a.value=t.direction,s.value=t.movementDirection},{immediate:!0}),(f,p)=>(J(),oe("div",Gy,[qn(f.$slots,"default",{},void 0,!0),O("div",Yy,[O("div",{class:"wave",style:Dr({background:o.value,height:`${u.value}px`,maskImage:c.value,WebkitMaskImage:c.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/e.animationSpeed}s`,"animation-direction":s.value==="left"?"normal":"reverse"})},null,4)])]))}}),qy=gn(Ky,[["__scopeId","data-v-f58b462e"]]),Wy={relative:"",flex:"~ col","z-2":"","h-100dvh":"","w-100vw":"","of-hidden":""},Xy={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (J(),Xt(Pg,null,{default:$e(()=>[Te(qy,{"fill-color":H(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:$e(()=>[O("div",Wy,[O("div",null,[Te(Fg,{class:"flex",p2:""})]),O("div",Xy,[Te(H(Rg),{"flex-1":"","min-w":"1/2",paused:n.value,"focus-at":{x:H(i).x.value,y:H(i).y.value}},null,8,["paused","focus-at"]),Te(Sy,{class:"flex {const l=w("motion");return n(),a(c,null,[e("div",C,[o[0]||(o[0]=e("div",{bg:"primary-500/10 dark:primary-800/25","rounded-lg":"","p-4":""},[e("div",{"mb-2":"","text-xl":"","font-semibold":"",text:"primary-800 dark:primary-100"}," First time here? "),e("div",{text:"primary-700 dark:primary-300"},[x(" AIRI requires at least one "),e("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]"},[e("div",{"i-solar:chat-square-like-bold-duotone":""}),e("strong",{"font-semibold":""},"Chat")]),x(" 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)),o[1]||(o[1]=e("div",{flex:"~ row items-center gap-2"},[e("div",{"i-solar:chat-square-like-bold-duotone":"",text:"neutral-500 dark:neutral-400 4xl"}),e("div",null,[e("div",null,[e("span",{text:"neutral-300 dark:neutral-500"},"Text generation model providers. e.g. OpenRouter, OpenAI, Ollama.")]),e("div",{flex:"","text-nowrap":"","text-3xl":"","font-semibold":""},[e("div",null," Chat ")])])],-1)),e("div",T,[(n(!0),a(c,null,m(i(u),(t,r)=>s((n(),d(i(p),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:t.localizedName||"Unknown",description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[l]])),128))]),o[2]||(o[2]=e("div",{flex:"~ row items-center gap-2","my-5":""},[e("div",{"i-solar:user-speak-rounded-bold-duotone":"",text:"neutral-500 dark:neutral-400 4xl"}),e("div",null,[e("div",null,[e("span",{text:"neutral-300 dark:neutral-500"},"Speech (text-to-speech) model providers. e.g. ElevenLabs, Azure Speech.")]),e("div",{flex:"","text-nowrap":"","text-3xl":"","font-semibold":""},[e("div",null," Speech ")])])],-1)),e("div",D,[(n(!0),a(c,null,m(i(g),(t,r)=>s((n(),d(i(p),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:(i(u).length+r)*50,title:t.localizedName||"Unknown",description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[l]])),128))]),o[3]||(o[3]=e("div",{flex:"~ row items-center gap-2","my-5":""},[e("div",{"i-solar:microphone-3-bold-duotone":"",text:"neutral-500 dark:neutral-400 4xl"}),e("div",null,[e("div",null,[e("span",{text:"neutral-300 dark:neutral-500"},"Transcription (speech-to-text) model providers. e.g. Whisper.cpp, OpenAI, Azure Speech")]),e("div",{flex:"","text-nowrap":"","text-3xl":"","font-semibold":""},[e("div",null," Transcription ")])])],-1)),e("div",N,[(n(!0),a(c,null,m(i(v),(t,r)=>s((n(),d(i(p),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:(i(u).length+i(g).length+r)*50,title:t.localizedName||"Unknown",description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[l]])),128))])]),i(h)?(n(),d(A,{key:0,"z-index":-1,icon:i(b),"icon-size":12,duration:1e3,started:i(k),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):s((n(),a("div",B,o[4]||(o[4]=[e("div",{text:"60","i-solar:box-minimalistic-bold-duotone":""},null,-1)]))),[[l]])],64)}}});typeof f=="function"&&f(O);export{O as default}; diff --git a/assets/mcp-DgU0tpf-.js b/assets/mcp-DgU0tpf-.js deleted file mode 100644 index a1361e7fbd62b7f003ba4ab3bf0159ca3adc074d..0000000000000000000000000000000000000000 --- a/assets/mcp-DgU0tpf-.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/effect-WSjEuzC9-BvZw3OJz.js","assets/index-D7HCX4VR.js","assets/index-F7nexZWB.css","assets/sury-DmrZ3_Oj-f8xnWriW.js","assets/valibot-CQk-M5rL-DQQQnI60.js","assets/zod-Db63SLXj-D3-l_To2.js"])))=>i.map(i=>d[i]); -import{cT as L}from"./index-D7HCX4VR.js";const Ce="https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies",ut=async(s,e)=>{try{return await s}catch{throw new Error(`xsschema: Missing dependencies "${e}". see ${Ce}`)}},Se=async s=>{switch(s){case"arktype":return L(()=>import("./arktype-C-GObzDh-1xlRyYUo.js"),[]).then(async({getToJsonSchemaFn:e})=>e());case"effect":return L(()=>import("./effect-WSjEuzC9-BvZw3OJz.js"),__vite__mapDeps([0,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"sury":return L(()=>import("./sury-DmrZ3_Oj-f8xnWriW.js"),__vite__mapDeps([3,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"valibot":return L(()=>import("./valibot-CQk-M5rL-DQQQnI60.js"),__vite__mapDeps([4,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"zod":return L(()=>import("./zod-Db63SLXj-D3-l_To2.js"),__vite__mapDeps([5,1,2])).then(async({getToJsonSchemaFn:e})=>e());default:throw new Error(`xsschema: Unsupported schema vendor "${s}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`)}},Oe=async s=>Se(s["~standard"].vendor).then(async e=>e(s)),D=async({description:s,execute:e,name:t,parameters:r})=>{const n=await Oe(r);return{execute:e,function:{description:s,name:t,parameters:{...n,additionalProperties:!1},strict:!0},type:"function"}};var g;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(g||(g={}));var ae;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(ae||(ae={}));const u=g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),C=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},c=g.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class T extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,h=0;for(;ht.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}T.create=s=>new T(s);const X=(s,e)=>{let t;switch(s.code){case c.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,g.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${g.joinValues(s.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${g.joinValues(s.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${g.joinValues(s.options)}, received '${s.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:g.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case c.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case c.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,g.assertNever(s)}return{message:t}};let Ae=X;function Ne(){return Ae}const Ze=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const h=r.filter(f=>!!f).slice().reverse();for(const f of h)o=f(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function d(s,e){const t=Ne(),r=Ze({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===X?void 0:X].filter(n=>!!n)});s.common.issues.push(r)}class k{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return k.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),U=s=>({status:"dirty",value:s}),b=s=>({status:"valid",value:s}),ie=s=>s.status==="aborted",oe=s=>s.status==="dirty",I=s=>s.status==="valid",W=s=>typeof Promise<"u"&&s instanceof Promise;var l;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(l||(l={}));class A{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ce=(s,e)=>{if(I(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new T(s.common.issues);return this._error=t,this._error}}};function _(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:h}=s;return i.code==="invalid_enum_value"?{message:h??o.defaultError}:typeof o.data>"u"?{message:h??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:h??t??o.defaultError}},description:n}}class y{get description(){return this._def.description}_getType(e){return C(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:C(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:C(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(W(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:C(e)},n=this._parseSync({data:e,path:r.path,parent:r});return ce(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:C(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return I(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>I(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:C(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(W(n)?n:Promise.resolve(n));return ce(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(h=>h?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new P({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return O.create(this,this._def)}nullable(){return M.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return w.create(this)}promise(){return G.create(this,this._def)}or(e){return J.create([this,e],this._def)}and(e){return Y.create(this,e,this._def)}transform(e){return new P({..._(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new te({..._(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new Ke({typeName:p.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new se({..._(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ne.create(this,e)}readonly(){return re.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Re=/^c[^\s-]{8,}$/i,Ee=/^[0-9a-z]+$/,Ie=/^[0-9A-HJKMNP-TV-Z]{26}$/i,je=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$e=/^[a-z0-9_-]{21}$/i,Pe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Me=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ve=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Le="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Q;const ze=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,De=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ue=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Be=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,We=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ke="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qe=new RegExp(`^${ke}$`);function be(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Je(s){return new RegExp(`^${be(s)}$`)}function Ye(s){let e=`${ke}T${be(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ge(s,e){return!!((e==="v4"||!e)&&ze.test(s)||(e==="v6"||!e)&&Ue.test(s))}function He(s,e){if(!Pe.test(s))return!1;try{const[t]=s.split("."),r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Qe(s,e){return!!((e==="v4"||!e)&&De.test(s)||(e==="v6"||!e)&&Be.test(s))}class S extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.string,received:a.parsedType}),m}const r=new k;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:c.invalid_string,...l.errToObj(r)})}_addCheck(e){return new S({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...l.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...l.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...l.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...l.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errToObj(t)})}nonempty(e){return this.min(1,l.errToObj(e))}trim(){return new S({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new S({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new S({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew S({checks:[],typeName:p.ZodString,coerce:(s==null?void 0:s.coerce)??!1,..._(s)});function Xe(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class j extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.number,received:a.parsedType}),m}let r;const n=new k;for(const a of this._def.checks)a.kind==="int"?g.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),d(r,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),d(r,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Xe(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),d(r,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),d(r,{code:c.not_finite,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new j({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew j({checks:[],typeName:p.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,..._(s)});class B extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const n=new k;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),d(r,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),d(r,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew B({checks:[],typeName:p.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,..._(s)});class K extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.boolean,received:r.parsedType}),m}return b(e.data)}}K.create=s=>new K({typeName:p.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,..._(s)});class q extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_date}),m}const r=new k;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):g.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew q({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:p.ZodDate,..._(s)});class de extends y{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.symbol,received:r.parsedType}),m}return b(e.data)}}de.create=s=>new de({typeName:p.ZodSymbol,..._(s)});class ue extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.undefined,received:r.parsedType}),m}return b(e.data)}}ue.create=s=>new ue({typeName:p.ZodUndefined,..._(s)});class le extends y{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.null,received:r.parsedType}),m}return b(e.data)}}le.create=s=>new le({typeName:p.ZodNull,..._(s)});class he extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}}he.create=s=>new he({typeName:p.ZodAny,..._(s)});class fe extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}}fe.create=s=>new fe({typeName:p.ZodUnknown,..._(s)});class N extends y{_parse(e){const t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:u.never,received:t.parsedType}),m}}N.create=s=>new N({typeName:p.ZodNever,..._(s)});class me extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.void,received:r.parsedType}),m}return b(e.data)}}me.create=s=>new me({typeName:p.ZodVoid,..._(s)});class w extends y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return d(t,{code:c.invalid_type,expected:u.array,received:t.parsedType}),m;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(d(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new A(t,i,t.path,o)))).then(i=>k.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new A(t,i,t.path,o)));return k.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new w({...this._def,minLength:{value:e,message:l.toString(t)}})}max(e,t){return new w({...this._def,maxLength:{value:e,message:l.toString(t)}})}length(e,t){return new w({...this._def,exactLength:{value:e,message:l.toString(t)}})}nonempty(e){return this.min(1,e)}}w.create=(s,e)=>new w({type:s,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,..._(e)});function E(s){if(s instanceof x){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=O.create(E(r))}return new x({...s._def,shape:()=>e})}else return s instanceof w?new w({...s._def,type:E(s.element)}):s instanceof O?O.create(E(s.unwrap())):s instanceof M?M.create(E(s.unwrap())):s instanceof R?R.create(s.items.map(e=>E(e))):s}class x extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=g.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const f=this._getOrReturnCtx(e);return d(f,{code:c.invalid_type,expected:u.object,received:f.parsedType}),m}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof N&&this._def.unknownKeys==="strip"))for(const f in n.data)i.includes(f)||o.push(f);const h=[];for(const f of i){const v=a[f],V=n.data[f];h.push({key:{status:"valid",value:f},value:v._parse(new A(n,V,n.path,f)),alwaysSet:f in n.data})}if(this._def.catchall instanceof N){const f=this._def.unknownKeys;if(f==="passthrough")for(const v of o)h.push({key:{status:"valid",value:v},value:{status:"valid",value:n.data[v]}});else if(f==="strict")o.length>0&&(d(n,{code:c.unrecognized_keys,keys:o}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const v of o){const V=n.data[v];h.push({key:{status:"valid",value:v},value:f._parse(new A(n,V,n.path,v)),alwaysSet:v in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const f=[];for(const v of h){const V=await v.key,Te=await v.value;f.push({key:V,value:Te,alwaysSet:v.alwaysSet})}return f}).then(f=>k.mergeObjectSync(r,f)):k.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(e){return l.errToObj,new x({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:l.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(e){return new x({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new x({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new x({...this._def,catchall:e})}pick(e){const t={};for(const r of g.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new x({...this._def,shape:()=>t})}omit(e){const t={};for(const r of g.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new x({...this._def,shape:()=>t})}deepPartial(){return E(this)}partial(e){const t={};for(const r of g.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new x({...this._def,shape:()=>t})}required(e){const t={};for(const r of g.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof O;)a=a._def.innerType;t[r]=a}return new x({...this._def,shape:()=>t})}keyof(){return we(g.objectKeys(this.shape))}}x.create=(s,e)=>new x({shape:()=>s,unknownKeys:"strip",catchall:N.create(),typeName:p.ZodObject,..._(e)});x.strictCreate=(s,e)=>new x({shape:()=>s,unknownKeys:"strict",catchall:N.create(),typeName:p.ZodObject,..._(e)});x.lazycreate=(s,e)=>new x({shape:s,unknownKeys:"strip",catchall:N.create(),typeName:p.ZodObject,..._(e)});class J extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new T(o.ctx.common.issues));return d(t,{code:c.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const h of r){const f={...t,common:{...t.common,issues:[]},parent:null},v=h._parseSync({data:t.data,path:t.path,parent:f});if(v.status==="valid")return v;v.status==="dirty"&&!a&&(a={result:v,ctx:f}),f.common.issues.length&&i.push(f.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(h=>new T(h));return d(t,{code:c.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}J.create=(s,e)=>new J({options:s,typeName:p.ZodUnion,..._(e)});function ee(s,e){const t=C(s),r=C(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=g.objectKeys(e),a=g.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const h=ee(s[o],e[o]);if(!h.valid)return{valid:!1};i[o]=h.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(ie(a)||ie(i))return m;const o=ee(a.value,i.value);return o.valid?((oe(a)||oe(i))&&t.dirty(),{status:t.value,value:o.data}):(d(r,{code:c.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Y.create=(s,e,t)=>new Y({left:s,right:e,typeName:p.ZodIntersection,..._(t)});class R extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return d(r,{code:c.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(d(r,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const h=this._def.items[o]||this._def.rest;return h?h._parse(new A(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>k.mergeArray(t,i)):k.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new R({...this._def,rest:e})}}R.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new R({items:s,typeName:p.ZodTuple,rest:null,..._(e)})};class pe extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return d(r,{code:c.invalid_type,expected:u.map,received:r.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,h],f)=>({key:n._parse(new A(r,o,r.path,[f,"key"])),value:a._parse(new A(r,h,r.path,[f,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const h of i){const f=await h.key,v=await h.value;if(f.status==="aborted"||v.status==="aborted")return m;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(f.value,v.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const h of i){const f=h.key,v=h.value;if(f.status==="aborted"||v.status==="aborted")return m;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(f.value,v.value)}return{status:t.value,value:o}}}}pe.create=(s,e,t)=>new pe({valueType:e,keyType:s,typeName:p.ZodMap,..._(t)});class F extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return d(r,{code:c.invalid_type,expected:u.set,received:r.parsedType}),m;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(d(r,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(h){const f=new Set;for(const v of h){if(v.status==="aborted")return m;v.status==="dirty"&&t.dirty(),f.add(v.value)}return{status:t.value,value:f}}const o=[...r.data.values()].map((h,f)=>a._parse(new A(r,h,r.path,f)));return r.common.async?Promise.all(o).then(h=>i(h)):i(o)}min(e,t){return new F({...this._def,minSize:{value:e,message:l.toString(t)}})}max(e,t){return new F({...this._def,maxSize:{value:e,message:l.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}F.create=(s,e)=>new F({valueType:s,minSize:null,maxSize:null,typeName:p.ZodSet,..._(e)});class _e extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(s,e)=>new _e({getter:s,typeName:p.ZodLazy,..._(e)});class ye extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}ye.create=(s,e)=>new ye({value:s,typeName:p.ZodLiteral,..._(e)});function we(s,e){return new $({values:s,typeName:p.ZodEnum,..._(e)})}class $ extends y{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return d(t,{expected:g.joinValues(r),received:t.parsedType,code:c.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return d(t,{received:t.data,code:c.invalid_enum_value,options:r}),m}return b(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return $.create(e,{...this._def,...t})}exclude(e,t=this._def){return $.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}$.create=we;class ge extends y{_parse(e){const t=g.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=g.objectValues(t);return d(r,{expected:g.joinValues(n),received:r.parsedType,code:c.invalid_type}),m}if(this._cache||(this._cache=new Set(g.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=g.objectValues(t);return d(r,{received:r.data,code:c.invalid_enum_value,options:n}),m}return b(e.data)}get enum(){return this._def.values}}ge.create=(s,e)=>new ge({values:s,typeName:p.ZodNativeEnum,..._(e)});class G extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return d(t,{code:c.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return b(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}G.create=(s,e)=>new G({type:s,typeName:p.ZodPromise,..._(e)});class P extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{d(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const h=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return h.status==="aborted"?m:h.status==="dirty"||t.value==="dirty"?U(h.value):h});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?U(o.value):o}}if(n.type==="refinement"){const i=o=>{const h=n.refinement(o,a);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!I(i))return m;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>I(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):m);g.assertNever(n)}}P.create=(s,e,t)=>new P({schema:s,typeName:p.ZodEffects,effect:e,..._(t)});P.createWithPreprocess=(s,e,t)=>new P({schema:e,effect:{type:"preprocess",transform:s},typeName:p.ZodEffects,..._(t)});class O extends y{_parse(e){return this._getType(e)===u.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}O.create=(s,e)=>new O({innerType:s,typeName:p.ZodOptional,..._(e)});class M extends y{_parse(e){return this._getType(e)===u.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}M.create=(s,e)=>new M({innerType:s,typeName:p.ZodNullable,..._(e)});class te extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}te.create=(s,e)=>new te({innerType:s,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class se extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return W(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}se.create=(s,e)=>new se({innerType:s,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class ve extends y{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}ve.create=s=>new ve({typeName:p.ZodNaN,..._(s)});class Ke extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ne extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),U(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new ne({in:e,out:t,typeName:p.ZodPipeline})}}class re extends y{_parse(e){const t=this._def.innerType._parse(e),r=n=>(I(n)&&(n.value=Object.freeze(n.value)),n);return W(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}re.create=(s,e)=>new re({innerType:s,typeName:p.ZodReadonly,..._(e)});var p;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(p||(p={}));const z=S.create,et=j.create,tt=K.create;N.create;const xe=w.create,Z=x.create,st=J.create;Y.create;R.create;$.create;G.create;O.create;M.create;const rt=[D({name:"debug_random_number",description:"Generate a random number between 0 and 1",execute:async()=>new Promise(s=>{setTimeout(()=>{s(Math.random().toString())},1e3)}),parameters:Z({})})],lt=async()=>Promise.all(rt);async function H(s,e={},t){return window.__TAURI_INTERNALS__.invoke(s,e,t)}async function nt(s,e){await H("plugin:mcp|connect_server",{command:s,args:e})}async function at(){await H("plugin:mcp|disconnect_server")}async function it(){return await H("plugin:mcp|list_tools")}async function ot(s,e){return await H("plugin:mcp|call_tool",{name:s,args:e})}const ct=[D({name:"mcp_list_tools",description:"List all tools available on the MCP server",execute:async(s,e)=>await it(),parameters:Z({})}),D({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:s,args:e})=>(await nt(s,e),"success"),parameters:Z({command:z().describe("The command to connect to the MCP server"),args:xe(z()).describe("The arguments to pass to the MCP server")})}),D({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 at(),"success"),parameters:Z({})}),D({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:s,parameters:e})=>{const t=Object.fromEntries(e.map(({name:n,value:a})=>[n,a]));return await ot(s,t)},parameters:Z({name:z().describe("The name of the tool to call"),parameters:xe(Z({name:z().describe("The name of the parameter"),value:st([z(),et(),tt(),Z({})]).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")})})],ht=async()=>Promise.all(ct);export{p as Z,Ce as a,O as b,lt as d,ht as m,ut as t}; diff --git a/assets/memory-0dYqsS07.js b/assets/memory-0dYqsS07.js new file mode 100644 index 0000000000000000000000000000000000000000..5fb6bfc0b367330e9328eebe0f7ef6bfd4ea8c5c --- /dev/null +++ b/assets/memory-0dYqsS07.js @@ -0,0 +1 @@ +import{createBaseVNode as e,createElementBlock as t,defineComponent as n,openBlock as r,resolveDirective as i,withDirectives as a}from"./index-BtAisBe9.js";import{route_block_default as o}from"./route-block-DNPbw0zT.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-2LsRds_J.js b/assets/memory-long-term-2LsRds_J.js deleted file mode 100644 index 384fe600bd1c9362fad39198e9dd6e24f028f265..0000000000000000000000000000000000000000 --- a/assets/memory-long-term-2LsRds_J.js +++ /dev/null @@ -1 +0,0 @@ -import{d as o,c as t,o as n}from"./index-D7HCX4VR.js";import{b as e}from"./route-block-B_A1xBdJ.js";const r=o({__name:"memory-long-term",setup(c){return(m,a)=>(n(),t("div"))}});typeof e=="function"&&e(r);export{r as default}; diff --git a/assets/memory-long-term-C61DZWTO.js b/assets/memory-long-term-C61DZWTO.js new file mode 100644 index 0000000000000000000000000000000000000000..a817e42bd7deb9d7baccebd3ff1601a16058ccff --- /dev/null +++ b/assets/memory-long-term-C61DZWTO.js @@ -0,0 +1 @@ +import{createElementBlock as e,defineComponent as t,openBlock as n}from"./index-BtAisBe9.js";import{route_block_default as r}from"./route-block-DNPbw0zT.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-CzuHUda_.js b/assets/memory-short-term-CzuHUda_.js new file mode 100644 index 0000000000000000000000000000000000000000..4e3ab382e73a6e02f03f64d778b62e9f32dc0a98 --- /dev/null +++ b/assets/memory-short-term-CzuHUda_.js @@ -0,0 +1 @@ +import{createElementBlock as e,defineComponent as t,openBlock as n}from"./index-BtAisBe9.js";import{route_block_default as r}from"./route-block-DNPbw0zT.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/memory-short-term-DP6AuBns.js b/assets/memory-short-term-DP6AuBns.js deleted file mode 100644 index eeb43c25bf68647c961e7bcb3fbf68c3fb233f06..0000000000000000000000000000000000000000 --- a/assets/memory-short-term-DP6AuBns.js +++ /dev/null @@ -1 +0,0 @@ -import{d as o,c as t,o as r}from"./index-D7HCX4VR.js";import{b as e}from"./route-block-B_A1xBdJ.js";const n=o({__name:"memory-short-term",setup(c){return(m,a)=>(r(),t("div"))}});typeof e=="function"&&e(n);export{n as default}; diff --git a/assets/messages-CaQqrW28.js b/assets/messages-CaQqrW28.js deleted file mode 100644 index b8b3b906f2fa9040a7105b0de3043046670675c3..0000000000000000000000000000000000000000 --- a/assets/messages-CaQqrW28.js +++ /dev/null @@ -1 +0,0 @@ -import{u as f}from"./queue-31IhYt_K.js";import{u as g,l as _}from"./queues-CIntookp.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{_ as v}from"./Textarea.vue_vue_type_script_setup_true_lang-l_0OEYvy.js";import{d as x,e as o,c as l,o as u,a as e,b,u as k,Y as p,c3 as h,c4 as w}from"./index-D7HCX4VR.js";import"./emotions-DWNSb738.js";import"./Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},V={flex:"","flex-row":"","gap-2":""},y={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},F=x({__name:"messages",setup(B){const s=o(""),r=o([]),t=o(!1),c=f({handlers:[async i=>{r.value.push(i.data)}]}),d=g(c);async function m(){t.value=!0,d.add(s.value),d.add(_),s.value="",t.value=!1}return(i,a)=>(u(),l("div",S,[e("div",V,[b(k(v),{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=n=>s.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:m},null,8,["modelValue"]),e("button",y,p(t.value?"Processing...":"Send"),1)]),e("div",M,[e("div",Q,[a[1]||(a[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(h,null,w(r.value,n=>(u(),l("div",{key:n},[e("div",null,p(n),1)]))),128))])])]))}});export{F as default}; diff --git a/assets/messages-DDZstpir.js b/assets/messages-DDZstpir.js new file mode 100644 index 0000000000000000000000000000000000000000..cec464b88d4a62db2d5a6e99454f9c0a6a39f25f --- /dev/null +++ b/assets/messages-DDZstpir.js @@ -0,0 +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-BtAisBe9.js";import"./src-bHDRqBSs.js";import"./Basic-BA5ubWIJ.js";import{Textarea_default as u}from"./Textarea-C0dnrt_L.js";import{useQueue as d}from"./queue-BZUURX31.js";import{llmInferenceEndToken as f,useMessageContentQueue as p}from"./queues-U6a2FwNq.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-CVJCqFk5.js b/assets/microsoft-speech-CVJCqFk5.js deleted file mode 100644 index 015d9c8df91fbe934569dded7a4d33fdc928b725..0000000000000000000000000000000000000000 --- a/assets/microsoft-speech-CVJCqFk5.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as B}from"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import{_ as v}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as F,$ as M,a0 as T,e as g,f as b,T as K,w as N,bf as q,o as z,bg as h,b as n,u as o,a as E}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as G}from"./providers-DepZj6_J.js";import{u as H}from"./speech-D8cCufg2.js";import{_ as R,a as j}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-Cn-PwtFl.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";const A={flex:"~ col gap-4"},t="microsoft-speech",C="v1",D=F({__name:"microsoft-speech",setup(I){const{t:r}=M(),P={pitch:0,speed:1,volume:0},a=H(),d=G(),{providers:l}=T(d),m=g(0),V=g(1),_=g(0),p=b({get:()=>{var s;return((s=l.value[t])==null?void 0:s.region)||"eastasia"},set:s=>{l.value[t]||(l.value[t]={region:"eastasia"}),l.value[t].region=s}}),y=b(()=>{var s;return!!((s=l.value[t])!=null&&s.apiKey)}),w=b(()=>a.availableVoices[t]||[]);K(async()=>{await a.loadVoicesForProvider(t)}),N([y,p],async()=>{await a.loadVoicesForProvider(t)});async function U(s,i,e){const c=d.getProviderInstance(t);if(!c)throw new Error("Failed to initialize speech provider");const u=d.getProviderConfig(t),x=u.model||C,S={...u,region:p.value,disableSsml:!e};if(!e&&i){const $=w.value.find(f=>f.id===i);if($){const f=a.generateSSML(s,$,{...u,pitch:m.value});return await a.speech(c,x,f,i,S)}}return await a.speech(c,x,s,i,S)}return(s,i)=>(z(),q(o(j),{"provider-id":t,"default-model":C,"additional-settings":P},{"basic-settings":h(()=>[n(o(B),{modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=e=>p.value=e),label:o(r)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:o(r)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":h(()=>[E("div",A,[n(o(v),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=e=>m.value=e),label:o(r)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,["modelValue","label","description","format-value"]),n(o(v),{modelValue:V.value,"onUpdate:modelValue":i[2]||(i[2]=e=>V.value=e),label:o(r)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),n(o(v),{modelValue:_.value,"onUpdate:modelValue":i[3]||(i[3]=e=>_.value=e),label:o(r)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,["modelValue","label","description","format-value"])])]),playground:h(()=>[n(o(R),{"available-voices":w.value,"generate-speech":U,"api-key-configured":y.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof k=="function"&&k(D);export{D as default}; diff --git a/assets/microsoft-speech-DsX1wfDy.js b/assets/microsoft-speech-DsX1wfDy.js new file mode 100644 index 0000000000000000000000000000000000000000..8c377dd05e36c493db66957d251d41d8cbcc8655 --- /dev/null +++ b/assets/microsoft-speech-DsX1wfDy.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import{FieldInput_default as h,FieldRange_default as g}from"./src-bHDRqBSs.js";import{SpeechPlayground_default as _,SpeechProviderSettings_default as v}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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-CliQVdqf.js b/assets/mistral-ai-CliQVdqf.js deleted file mode 100644 index 716a6594ac2e6ff3038ea7e87303dfbbc1b35d40..0000000000000000000000000000000000000000 --- a/assets/mistral-ai-CliQVdqf.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as U,$,V as k,a0 as y,f as c,T as K,w as h,bf as w,o as x,bg as p,b as l,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{_ as C}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as P}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const a="mistral-ai",B=U({__name:"mistral-ai",setup(I){const{t:u}=$(),b=k(),d=z(),{providers:o}=y(d),n=c(()=>d.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[l(t(P),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var m;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=m=>s.value=m),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/mistral-ai-DsX_I4X6.js b/assets/mistral-ai-DsX_I4X6.js new file mode 100644 index 0000000000000000000000000000000000000000..b4d58e24dda724a5ee1c14b350115795a697d440 --- /dev/null +++ b/assets/mistral-ai-DsX_I4X6.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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-BR8YPV_e.css b/assets/models-BR8YPV_e.css new file mode 100644 index 0000000000000000000000000000000000000000..0b694a2cdc1be9f8063450313dc60a332edf8429 --- /dev/null +++ b/assets/models-BR8YPV_e.css @@ -0,0 +1 @@ +.form-control[data-v-559b50a9]{outline-offset:2px;border-radius:.25rem;outline:2px solid #0000;padding:.25rem .5rem} diff --git a/assets/models-TOMYe-dc.js b/assets/models-TOMYe-dc.js new file mode 100644 index 0000000000000000000000000000000000000000..db91658cbccd6c16dcb987100c248d48951cbcb6 --- /dev/null +++ b/assets/models-TOMYe-dc.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import"./dist-DzeHt4xm.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import{Emotion as P,EmotionNeutralMotionName as F}from"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{Vibrant as I}from"./browser-C4moGI0I.js";import{route_block_default as L}from"./route-block-DNPbw0zT.js";import{ColorPalette_default as R}from"./ColorPalette-DaCdckPj.js";import{IconAnimation_default as z}from"./IconAnimation-B5sfLFsA.js";import{useIconAnimation as B}from"./useIconAnimation-C_Mu172C.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-Brjd2BIv.js b/assets/modules-Brjd2BIv.js new file mode 100644 index 0000000000000000000000000000000000000000..84b2b0bab546db1749e955f415d030c7d487736a --- /dev/null +++ b/assets/modules-Brjd2BIv.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import{IconStatusItem_default as f}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as p}from"./route-block-DNPbw0zT.js";import{IconAnimation_default as m}from"./IconAnimation-B5sfLFsA.js";import{useIconAnimation as h}from"./useIconAnimation-C_Mu172C.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-BL1GQpdJ.js b/assets/moonshot-ai-BL1GQpdJ.js new file mode 100644 index 0000000000000000000000000000000000000000..664bfb049a2d27d495d8974de51b8c8495811565 --- /dev/null +++ b/assets/moonshot-ai-BL1GQpdJ.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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/moonshot-ai-CfBUn2N1.js b/assets/moonshot-ai-CfBUn2N1.js deleted file mode 100644 index 339eecc6d935eb031cd187422ac0be584d3fdbdc..0000000000000000000000000000000000000000 --- a/assets/moonshot-ai-CfBUn2N1.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as U,$,V as h,a0 as k,f as c,T as y,w as K,bf as w,o as x,bg as p,b as l,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{_ as M}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as P}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as R}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const o="moonshot-ai",C=U({__name:"moonshot-ai",setup(I){const{t:u}=$(),b=h(),d=z(),{providers:a}=k(d),n=c(()=>d.getProviderMetadata(o)),r=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),s=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});y(()=>{var e,i;d.initializeProvider(o),r.value=((e=a.value[o])==null?void 0:e.apiKey)||"",s.value=((i=a.value[o])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{a.value[o]={...a.value[o],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:p(()=>[l(t(S),null,{default:p(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var m;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(P),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=m=>s.value=m),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/novita-ai-QK3ydSh2.js b/assets/novita-ai-QK3ydSh2.js deleted file mode 100644 index 24d1466c9f4b64079e1dbf7c36fd2ebf7d09f4b0..0000000000000000000000000000000000000000 --- a/assets/novita-ai-QK3ydSh2.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as U,$,V as k,a0 as y,f as v,T as K,w as h,bf as w,o as x,bg as m,b as l,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{_ as C}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as P}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const o="novita-ai",B=U({__name:"novita-ai",setup(I){const{t:u}=$(),b=k(),d=z(),{providers:a}=y(d),n=v(()=>d.getProviderMetadata(o)),r=v({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),s=v({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});K(()=>{var e,i;d.initializeProvider(o),r.value=((e=a.value[o])==null?void 0:e.apiKey)||"",s.value=((i=a.value[o])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{a.value[o]={...a.value[o],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:m(()=>[l(t(R),null,{default:m(()=>[l(t(P),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/novita-ai-hF2aUTGC.js b/assets/novita-ai-hF2aUTGC.js new file mode 100644 index 0000000000000000000000000000000000000000..8d1ee1c9d064d4ad652492565899df738907d435 --- /dev/null +++ b/assets/novita-ai-hF2aUTGC.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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-3pZYfERA.js b/assets/ollama-3pZYfERA.js deleted file mode 100644 index 00bb7a950f1d946f829c7c90419354a8d96de4ad..0000000000000000000000000000000000000000 --- a/assets/ollama-3pZYfERA.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as w}from"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";import{d as P,cg as x,ch as U,c as g,o as f,b as m,e as K,w as B,c2 as O,a as _,bh as R,ci as S,W as z,Y as M,c3 as D,c4 as I,$ as T,V as F,a0 as A,f as q,T as E,bf as L,bg as k,u as o}from"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as W}from"./providers-DepZj6_J.js";import{_ as Y}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as j}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as G}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as H}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as J}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as C}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";const Q={flex:"~ gap-2"},X=P({__name:"InputKeyValue",props:x({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:["update:propertyKey","update:propertyValue"],setup(v){const a=v,s=U(v,"propertyKey"),p=U(v,"propertyValue");return(r,t)=>(f(),g("div",Q,[m(w,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=i=>s.value=i),placeholder:a.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(w,{modelValue:p.value,"onUpdate:modelValue":t[1]||(t[1]=i=>p.value=i),placeholder:a.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),Z={"max-w-full":""},ee={flex:"~ col gap-2"},le={class:"flex items-center gap-1 text-sm font-medium"},te={key:0,class:"text-red-500"},oe={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},ae={flex:"~ col gap-2"},re=["onClick"],se=P({__name:"FieldKeyValues",props:x({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:x(["remove","add"],["update:modelValue"]),setup(v,{emit:a}){const s=v,p=a,r=U(v,"modelValue"),t=K(""),i=K("");return B([t,i],()=>{p("add",t.value,i.value)}),($,c)=>{const b=O("auto-animate");return f(),g("div",Z,[_("label",ee,[_("div",null,[_("div",le,[S(M(s.label)+" ",1),s.required!==!1?(f(),g("span",te,"*")):z("",!0)]),_("div",oe,M(s.description),1)]),R((f(),g("div",ae,[(f(!0),g(D,null,I(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(X,{"property-key":y.key,"onUpdate:propertyKey":e=>y.key=e,"property-value":y.value,"onUpdate:propertyValue":e=>y.value=e,"key-placeholder":s.keyPlaceholder,"value-placeholder":s.valuePlaceholder,"w-full":""},null,8,["property-key","onUpdate:propertyKey","property-value","onUpdate:propertyValue","key-placeholder","value-placeholder"]),_("button",{onClick:e=>p("remove",l)},c[0]||(c[0]=[_("div",{"i-solar:minus-circle-line-duotone":"",size:"6"},null,-1)]),8,re)]))),128))])),[[b]])])])}}}),u="ollama",ie=P({__name:"ollama",setup(v){const{t:a}=T(),s=F(),p=W(),{providers:r}=A(p),t=q(()=>p.getProviderMetadata(u)),i=q({get:()=>{var l,e,n;return((l=r.value[u])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.call(e).baseUrl)||""},set:l=>{r.value[u]||(r.value[u]={}),r.value[u].baseUrl=l}});E(()=>{var l,e,n,h;p.initializeProvider(u),i.value=((l=r.value[u])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.call(e).baseUrl)||"",(h=r.value[u])!=null&&h.headers||(r.value[u].headers={})});function $(){var l;r.value[u]={...(l=t.value)==null?void 0:l.defaultOptions}}const c=K([{key:"",value:""}]);function b(l,e,n){l&&l.push({key:e,value:n})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return B(c,l=>{l.length>0&&(l[l.length-1].key!==""||l[l.length-1].value!=="")&&l.push({key:"",value:""})},{deep:!0,immediate:!0}),(l,e)=>{var n,h;return f(),L(o(J),{"provider-name":(n=t.value)==null?void 0:n.localizedName,"provider-icon":(h=t.value)==null?void 0:h.icon,"on-back":()=>o(s).back()},{default:k(()=>[m(o(H),null,{default:k(()=>[m(o(G),{title:o(a)("settings.pages.providers.common.section.basic.title"),description:o(a)("settings.pages.providers.common.section.basic.description"),"on-reset":$},{default:k(()=>{var d,V;return[m(o(j),{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=N=>i.value=N),placeholder:((V=(d=t.value)==null?void 0:d.defaultOptions)==null?void 0:V.call(d).baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(o(Y),{title:o(a)("settings.pages.providers.common.section.advanced.title")},{default:k(()=>[m(o(se),{modelValue:c.value,"onUpdate:modelValue":e[1]||(e[1]=d=>c.value=d),label:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(d,V)=>b(c.value,d,V)),onRemove:e[3]||(e[3]=d=>y(d,c.value))},null,8,["modelValue","label","description","key-placeholder","value-placeholder"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof C=="function"&&C(ie);export{ie as default}; diff --git a/assets/ollama-AxPkEHcT.js b/assets/ollama-AxPkEHcT.js new file mode 100644 index 0000000000000000000000000000000000000000..1e1185236ed5f6d965b2b2ee2ab78c1fded39020 --- /dev/null +++ b/assets/ollama-AxPkEHcT.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as p}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import{FieldKeyValues_default as m}from"./src-bHDRqBSs.js";import{ProviderAdvancedSettings_default as h,ProviderBaseUrlInput_default as g,ProviderBasicSettings_default as _,ProviderSettingsContainer_default as v,ProviderSettingsLayout_default as y}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as b}from"./route-block-DNPbw0zT.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-CplbulQn.js b/assets/openai-CplbulQn.js deleted file mode 100644 index ac36c4eba936c3c81b829e812dc3e1f0adbff600..0000000000000000000000000000000000000000 --- a/assets/openai-CplbulQn.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as h,$ as V,V as k,a0 as $,f as c,T as y,w as K,bf as I,o as w,bg as n,b as p,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as x}from"./providers-DepZj6_J.js";import{_ as M}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as R}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as S}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as A}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const e="openai",B=h({__name:"openai",setup(C){const{t:m}=V(),b=k(),v=x(),{providers:a}=$(v),u=c(()=>v.getProviderMetadata(e)),r=c({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),s=c({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),r.value=((o=a.value[e])==null?void 0:o.apiKey)||"",s.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://api.openai.com/v1/"}),K([r,s],()=>{a.value[e]={...a.value[e],apiKey:r.value,baseUrl:s.value||"https://api.openai.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return w(),I(t(A),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=u.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:n(()=>[p(t(z),null,{default:n(()=>[p(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:n(()=>{var l;return[p(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=U=>r.value=U),"provider-name":((l=u.value)==null?void 0:l.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),p(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[p(t(R),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=l=>s.value=l),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/openai-CtCB0lo5.js b/assets/openai-CtCB0lo5.js new file mode 100644 index 0000000000000000000000000000000000000000..0b6db4e1b4a7029fd166d31341ed23580ceaff24 --- /dev/null +++ b/assets/openai-CtCB0lo5.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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-DLCLQ0xM.js b/assets/openai-audio-speech-DLCLQ0xM.js new file mode 100644 index 0000000000000000000000000000000000000000..ff1a43a15c8c94afb951cb72e9c33db7c3b4d436 --- /dev/null +++ b/assets/openai-audio-speech-DLCLQ0xM.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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-speech-naD8VxqX.js b/assets/openai-audio-speech-naD8VxqX.js deleted file mode 100644 index b0d888f4f0a8837490a3a25183690e654880ef49..0000000000000000000000000000000000000000 --- a/assets/openai-audio-speech-naD8VxqX.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as U,$ as V,V as k,a0 as $,f as c,T as y,w as K,bf as I,o as w,bg as n,b as p,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as x}from"./providers-DepZj6_J.js";import{_ as M}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as R}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as S}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as A}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const e="openai",B=U({__name:"openai-audio-speech",setup(C){const{t:m}=V(),b=k(),v=x(),{providers:a}=$(v),u=c(()=>v.getProviderMetadata(e)),r=c({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),s=c({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),r.value=((o=a.value[e])==null?void 0:o.apiKey)||"",s.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://api.openai.com/v1/"}),K([r,s],()=>{a.value[e]={...a.value[e],apiKey:r.value,baseUrl:s.value||"https://api.openai.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return w(),I(t(A),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=u.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:n(()=>[p(t(z),null,{default:n(()=>[p(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:n(()=>{var l;return[p(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=h=>r.value=h),"provider-name":((l=u.value)==null?void 0:l.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),p(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[p(t(R),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=l=>s.value=l),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/openai-audio-transcription-BO8z1O_F.js b/assets/openai-audio-transcription-BO8z1O_F.js new file mode 100644 index 0000000000000000000000000000000000000000..68074430ba53bc4e059ed2ab1107cbb8c0c19d55 --- /dev/null +++ b/assets/openai-audio-transcription-BO8z1O_F.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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/openai-audio-transcription-Chj7B5G_.js b/assets/openai-audio-transcription-Chj7B5G_.js deleted file mode 100644 index 9f03fbca8c5d338d0078a36b7683042ce61db92a..0000000000000000000000000000000000000000 --- a/assets/openai-audio-transcription-Chj7B5G_.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as h,$ as V,V as k,a0 as $,f as c,T as y,w as K,bf as I,o as w,bg as n,b as p,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as x}from"./providers-DepZj6_J.js";import{_ as M}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as R}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as S}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as A}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const e="openai",B=h({__name:"openai-audio-transcription",setup(C){const{t:m}=V(),b=k(),v=x(),{providers:a}=$(v),u=c(()=>v.getProviderMetadata(e)),r=c({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),s=c({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),r.value=((o=a.value[e])==null?void 0:o.apiKey)||"",s.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://api.openai.com/v1/"}),K([r,s],()=>{a.value[e]={...a.value[e],apiKey:r.value,baseUrl:s.value||"https://api.openai.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return w(),I(t(A),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=u.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:n(()=>[p(t(z),null,{default:n(()=>[p(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:n(()=>{var l;return[p(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=U=>r.value=U),"provider-name":((l=u.value)==null?void 0:l.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),p(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[p(t(R),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=l=>s.value=l),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/openrouter-ai-C6wwTszU.js b/assets/openrouter-ai-C6wwTszU.js deleted file mode 100644 index 602acceb3a29e7fe23b3ab3351fd028c1b9b3294..0000000000000000000000000000000000000000 --- a/assets/openrouter-ai-C6wwTszU.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as k,$,V as y,a0 as K,f as _,T as O,w as h,bf as w,o as x,bg as v,b as m,u as i}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{_ as M}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as P}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as R}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const o="openrouter-ai",C=k({__name:"openrouter-ai",setup(I){const{t:c}=$(),g=y(),f=z(),{providers:t}=K(f),l=_(()=>f.getProviderMetadata(o)),n=_({get:()=>{var e;return((e=t.value[o])==null?void 0:e.apiKey)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].apiKey=e}}),p=_({get:()=>{var e,a,r;return((e=t.value[o])==null?void 0:e.baseUrl)||((r=(a=l.value)==null?void 0:a.defaultOptions)==null?void 0:r.call(a).baseUrl)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].baseUrl=e}});O(()=>{var e,a,r,u;f.initializeProvider(o),n.value=((e=t.value[o])==null?void 0:e.apiKey)||"",p.value=((a=t.value[o])==null?void 0:a.baseUrl)||((u=(r=l.value)==null?void 0:r.defaultOptions)==null?void 0:u.call(r).baseUrl)||""}),h([n,p],()=>{var e,a;t.value[o]={...t.value[o],apiKey:n.value,baseUrl:p.value||((a=(e=l.value)==null?void 0:e.defaultOptions)==null?void 0:a.call(e).baseUrl)||""}});function U(){var e;t.value[o]={...(e=l.value)==null?void 0:e.defaultOptions}}return(e,a)=>{var r,u;return x(),w(i(B),{"provider-name":(r=l.value)==null?void 0:r.localizedName,"provider-icon":(u=l.value)==null?void 0:u.icon,"on-back":()=>i(g).back()},{default:v(()=>[m(i(S),null,{default:v(()=>[m(i(R),{title:i(c)("settings.pages.providers.common.section.basic.title"),description:i(c)("settings.pages.providers.common.section.basic.description"),"on-reset":U},{default:v(()=>{var s;return[m(i(N),{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=d=>n.value=d),"provider-name":(s=l.value)==null?void 0:s.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),m(i(M),{title:i(c)("settings.pages.providers.common.section.advanced.title")},{default:v(()=>{var s,d;return[m(i(P),{modelValue:p.value,"onUpdate:modelValue":a[1]||(a[1]=V=>p.value=V),placeholder:((d=(s=l.value)==null?void 0:s.defaultOptions)==null?void 0:d.call(s).baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof b=="function"&&b(C);export{C as default}; diff --git a/assets/openrouter-ai-Cf4Rx59R.js b/assets/openrouter-ai-Cf4Rx59R.js new file mode 100644 index 0000000000000000000000000000000000000000..30410376be47f22c202559aadffbded874dcc79b --- /dev/null +++ b/assets/openrouter-ai-Cf4Rx59R.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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-CzrQCDZR.js b/assets/pages-CzrQCDZR.js new file mode 100644 index 0000000000000000000000000000000000000000..7b6011d87ceadd333fc24b2a2b354016e6a47532 --- /dev/null +++ b/assets/pages-CzrQCDZR.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useAudioContext as te,useChatStore as N,useConsciousnessStore as P,useProvidersStore as F}from"./stores-mOXXrrXB.js";import{HeaderLink_default as I}from"./HeaderLink-zGlOe2Jb.js";import{TransitionVertical_default as ne}from"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import{Basic_default as L}from"./Basic-BA5ubWIJ.js";import{Stage_default as R}from"./components-B-QNW1cA.js";import{useMarkdown as z,useMicVAD as B,useWhisper as re}from"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as V}from"./route-block-DNPbw0zT.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 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/player2-api-de5Xsdxw.js b/assets/player2-api-de5Xsdxw.js deleted file mode 100644 index 6e8f3ffba28c2ac669c4e590c4cf1097737b034d..0000000000000000000000000000000000000000 --- a/assets/player2-api-de5Xsdxw.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as k,$ as U,V as h,a0 as P,f as d,T as S,w as V,a2 as B,bf as $,o as w,bg as n,b as l,u as a}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as x}from"./providers-DepZj6_J.js";import{_ as y}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as C}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as M}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as v}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const o="player2-api",R=k({__name:"player2-api",setup(z){const{t:p}=U(),f=h(),s=x(),{providers:t}=P(s),i=d(()=>s.getProviderMetadata(o)),r=d({get:()=>{var e;return((e=t.value[o])==null?void 0:e.baseUrl)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].baseUrl=e}});S(()=>{var e;s.initializeProvider(o),r.value=((e=t.value[o])==null?void 0:e.baseUrl)||""}),V([r],()=>{t.value[o]={...t.value[o],baseUrl:r.value||""}});function _(){var e;t.value[o]={...(e=i.value)==null?void 0:e.defaultOptions}}return(e,c)=>{var m,u;const b=B("ProviderBasicSettings");return w(),$(a(M),{"provider-name":(m=i.value)==null?void 0:m.localizedName,"provider-icon":(u=i.value)==null?void 0:u.icon,"on-back":()=>a(f).back()},{default:n(()=>[l(a(C),null,{default:n(()=>[l(b,{title:a(p)("settings.pages.providers.common.section.basic.title"),description:a(p)("settings.pages.providers.common.section.basic.description"),"on-reset":_},{default:n(()=>[l(a(y),{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=g=>r.value=g),placeholder:"http://localhost:4315/v1/"},null,8,["modelValue"])]),_:1},8,["title","description"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof v=="function"&&v(R);export{R as default}; diff --git a/assets/polaroid-Ce3gxIqN.js b/assets/polaroid-Ce3gxIqN.js new file mode 100644 index 0000000000000000000000000000000000000000..3fe114f92d233f31e970485b0feba22ccbb88f5a --- /dev/null +++ b/assets/polaroid-Ce3gxIqN.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import{Canvas_default as m,Model_default as h,Screen_default as g}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.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/polaroid-DoRrbv0D.js b/assets/polaroid-DoRrbv0D.js deleted file mode 100644 index bf42789d4ad3ab05814b0c9e06b1d743c6cb0419..0000000000000000000000000000000000000000 --- a/assets/polaroid-DoRrbv0D.js +++ /dev/null @@ -1 +0,0 @@ -import{d as x,e as i,w as y,c as u,o as c,a,b as f,bg as p,u as v,bh as M,cc as b,c3 as k,c4 as C,Y as L}from"./index-D7HCX4VR.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{a as R,_ as N}from"./Model.vue_vue_type_script_setup_true_lang-CrmnRvJ7.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{_ as S}from"./Screen.vue_vue_type_script_setup_true_lang-CQ37H7oV.js";const $={flex:"","flex-col":"","items-center":"","gap-4":""},B={"h-full":"","w-full":""},D=["value"],H=x({__name:"polaroid",setup(E){const s=i(),n=i(),l=i("idle"),r=i([]);function m(t,o){const e=document.createElement("a");e.href=t,e.download=o,document.body.appendChild(e),e.click(),document.body.removeChild(e)}function _(t){var o;(o=n.value)==null||o.setMotion(t)}y(n,t=>{r.value=(t==null?void 0:t.listMotionGroups())||[]},{immediate:!0});function h(){n.value&&(n.value.setMotion(l.value),r.value=n.value.listMotionGroups())}function g(){if(!s.value||!n.value)return;const o=s.value.canvasElement().toDataURL("image/png");m(o,"live2d-screenshot.png")}return(t,o)=>(c(),u("div",$,[a("div",B,[f(v(S),{relative:"","min-h-70dvh":""},{default:p(({width:e,height:d})=>[f(v(R),{ref_key:"live2dCanvasRef",ref:s,width:e,height:d,resolution:3,"rounded-full":""},{default:p(({app:w})=>[f(v(N),{ref_key:"live2dModelRef",ref:n,app:w,width:e,height:d,"focus-at":{x:e/2,y:d/2},onModelLoaded:h},null,8,["app","width","height","focus-at"])]),_:2},1032,["width","height"])]),_:1})]),a("div",null,[M(a("select",{"onUpdate:modelValue":o[0]||(o[0]=e=>l.value=e),"rounded-lg":"","px-3":"","py-2":"",onChange:o[1]||(o[1]=e=>_(l.value))},[(c(!0),u(k,null,C(r.value,e=>(c(),u("option",{key:e.motionIndex,value:e.motionName},L(e.fileName),9,D))),128))],544),[[b,l.value]])]),a("div",{border:"2px solid white",flex:"","items-center":"","justify-center":"","rounded-full":"","p-1":""},[a("button",{"h-18":"","w-18":"","rounded-full":"",bg:"white active:gray-50","outline-none":"","transition-colors":"","duration-200":"","ease-in-out":"",onClick:g})])]))}});export{H as default}; diff --git a/assets/providers-C5vrVlHa.js b/assets/providers-C5vrVlHa.js new file mode 100644 index 0000000000000000000000000000000000000000..999a0e5bf4eab9cd9035bcdcf3818a954ed70ecf --- /dev/null +++ b/assets/providers-C5vrVlHa.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import{IconStatusItem_default as p}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as m}from"./route-block-DNPbw0zT.js";import{IconAnimation_default as h}from"./IconAnimation-B5sfLFsA.js";import{useIconAnimation as g}from"./useIconAnimation-C_Mu172C.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/providers-DepZj6_J.js b/assets/providers-DepZj6_J.js deleted file mode 100644 index a84b5d59ce9666e834b18e39e102ea66d511d4b3..0000000000000000000000000000000000000000 --- a/assets/providers-DepZj6_J.js +++ /dev/null @@ -1 +0,0 @@ -var ue=Object.defineProperty;var ge=(a,i,s)=>i in a?ue(a,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[i]=s;var V=(a,i,s)=>ge(a,typeof i!="symbol"?i+"":i,s);import{a4 as me,c9 as ve,$ as _e,e as A,w as he,f as k,d0 as be}from"./index-D7HCX4VR.js";import{r as fe,a as ye,e as xe,o as W}from"./index-LHmcipjy.js";import{i as H}from"./index-CIqqlMPn.js";const u=async a=>(a.fetch??globalThis.fetch)(fe("models",a.baseURL),{headers:ye(a.headers,a.apiKey),signal:a.abortSignal}).then(xe).then(({data:i})=>i),h=a=>({chat:i=>Object.assign(a,{model:i})}),K=a=>({embed:i=>Object.assign(a,{model:i})}),we=a=>({image:i=>Object.assign(a,{model:i})}),y=a=>({model:()=>a}),ke=a=>({speech:i=>Object.assign(a,{model:i})}),Pe=a=>({transcription:i=>Object.assign(a,{model:i})}),v=(a,i)=>({metadata:{id:a,...i}}),_=(...a)=>Object.assign(a[0],...a.slice(1)),Ke=(a,i="https://api.anthropic.com/v1/")=>_(v("anthropic"),h({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i})),J=(a,i="https://api.deepseek.com/")=>_(v("deepseek"),h({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i})),X=(a,i="https://api.fireworks.ai/inference/v1/")=>_(v("fireworks"),h({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i})),Z=(a,i="https://generativelanguage.googleapis.com/v1beta/openai/")=>_(v("google-generative-ai"),h({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i})),Q=(a,i="https://api.mistral.ai/v1/")=>_(v("mistral"),h({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i})),Y=(a,i="https://api.moonshot.cn/v1/")=>_(v("moonshot"),h({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i})),R=(a,i="https://api.novita.ai/v3/openai/")=>_(v("novita"),h({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i})),g=(a,i="https://api.openai.com/v1/")=>_(v("openai"),h({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),we({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i}),ke({apiKey:a,baseURL:i}),Pe({apiKey:a,baseURL:i})),Ue=(a,i="")=>_(v("openrouter"),{chat:(s,d)=>{const f={apiKey:a,baseURL:i,model:s};return{...d?(({extraHeaders:o,models:b,provider:m})=>{o!=null&&(f.headers??(f.headers={}),Object.assign(f.headers,o));let c;return m!=null&&(c=W(m)),W({models:b,provider:c})})(d):{},...f}}},y({apiKey:a,baseURL:i})),Me=(a,i="https://api.perplexity.ai/")=>_(v("perplexity"),h({apiKey:a,baseURL:i})),ee=(a,i="https://api.together.xyz/v1/")=>_(v("together-ai"),h({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i,fetch:async(...s)=>globalThis.fetch(...s).then(async d=>d.json()).then(d=>Response.json({data:d,object:"list"}))})),Ce=(a,i)=>{const s=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return _(v("workers-ai"),h({apiKey:a,baseURL:s}),K({apiKey:a,baseURL:s}))},ae=(a,i="https://api.x.ai/v1/")=>_(v("xai"),h({apiKey:a,baseURL:i}),y({apiKey:a,baseURL:i})),M=(a="http://localhost:11434/v1/")=>_(v("ollama"),h({baseURL:a}),K({baseURL:a}),y({baseURL:a})),Oe=(a="http://localhost:4315/v1/")=>_(v("player2"),h({baseURL:a})),E=(...a)=>Object.assign(a[0],...a.slice(1));class B extends Error{constructor(s,d){super(s);V(this,"response");this.name="XSAIError",this.response=d}}const Se=a=>a.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`),U=a=>Object.fromEntries(Object.entries(a).map(([i,s])=>[Se(i),s])),Ae=a=>Object.fromEntries(Object.entries(a).filter(([,i])=>i!==void 0)),Te=(a,i)=>Ae({Authorization:i!==void 0?`Bearer ${i}`:void 0,...a}),Ee=(a,i)=>{const s=i.toString();return new URL(a,s.endsWith("/")?s:`${s}/`)},qe=async a=>{if(!a.ok)throw new B(`Remote sent ${a.status} response: ${await a.text()}`,a);if(!a.body)throw new B("Response body is empty from remote server",a);if(!(a.body instanceof ReadableStream))throw new B(`Expected Response body to be a ReadableStream, but got ${String(a.body)}; Content Type is ${a.headers.get("Content-Type")}`,a);return a},Be=async a=>qe(a).then(async i=>{const s=await i.text();try{return JSON.parse(s)}catch{throw new Error(`Failed to parse response, response body: ${s}`)}});var ie=(a,i="http://localhost:5933/v1/")=>{const s=({applyTextNormalization:t,languageCode:o,nextRequestIds:b,nextText:m,previousRequestIds:c,previousText:x,pronunciationDictionaryLocators:w,seed:C,voiceSettings:O})=>({extraBody:U({applyTextNormalization:t,languageCode:o,nextRequestIds:b,nextText:m,previousRequestIds:c,previousText:x,pronunciationDictionaryLocators:w?w.map(q=>U(q)):void 0,seed:C,voiceSettings:U(O??{similarityBoost:.75,stability:.5})})});return E({speech:(t,o)=>({...o?s(o):{},apiKey:a,baseURL:i,model:`elevenlabs/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=elevenlabs",...t?s(t):{},apiKey:a,baseURL:i})})},re=(a,i="http://localhost:5933/v1/")=>{const s=t=>{const{deploymentId:o,region:b,sampleRate:m}=t,c={deploymentId:o,region:b,sampleRate:m};return"disableSsml"in t?c.disableSsml=t.disableSsml:"lang"in t&&(c.lang=t.lang,c.gender=t.gender,c.voice=t.voice),{extraBody:U(c)}};return E({speech:(t,o)=>({...o?s(o):{},apiKey:a,baseURL:i,model:`microsoft/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:`region=${t==null?void 0:t.region}&provider=microsoft`,...t?s(t):{},apiKey:a,baseURL:i})})},te=(a,i="http://localhost:5933/v1/")=>{const s=t=>{var b,m;const o={app:{appid:(b=t.app)==null?void 0:b.appId,token:a}};return typeof t.app<"u"&&(o.app={...t.app,appid:(m=t.app)==null?void 0:m.appId,token:a}),typeof t.user<"u"&&(o.user=t.user),typeof t.audio<"u"&&(o.audio=t.audio),{extraBody:U(o)}};return E({speech:(t,o)=>({...o?s(o):{},apiKey:a,baseURL:i,model:`volcengine/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=volcengine",...t?s(t):{},apiKey:a,baseURL:i})})},ne=(a,i="http://localhost:5933/v1/")=>{const s=t=>{const{sampleRate:o,volume:b,rate:m,pitch:c}=t,x={sampleRate:o,volume:b,rate:m,pitch:c};return Object.keys(x).forEach(w=>x[w]===void 0&&delete x[w]),{extraBody:U(x)}};return E({speech:(t,o)=>({...o?s(o):{},apiKey:a,baseURL:i,model:`alibaba/${t}`})},{voice:t=>{let o=i;return o.endsWith("v1/")?o=o.slice(0,-3):o.endsWith("v1")&&(o=o.slice(0,-2)),{query:"provider=alibaba",...t?s(t):{},apiKey:a,baseURL:o}}})},T=async a=>(a.fetch??globalThis.fetch)(Ee(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:Te({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(Be).then(({voices:i})=>i);const $e=[{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"}],Ge=me("providers",()=>{const a=ve("settings/credentials/providers",{}),{t:i}=_e();async function s(e){try{const r=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to fetch OpenRouter models: ${r.statusText}`);return(await r.json()).data.map(n=>({id:n.id,name:n.name||n.id,provider:"openrouter-ai",description:n.description||"",contextLength:n.context_length,deprecated:!1}))}catch(r){throw console.error("Error fetching OpenRouter models:",r),r}}const d={"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=>Ue(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>s(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 u({...g(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"app-local-candle",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(r=>r.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 u({...g(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"app-local-candle",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(r=>r.ok).catch(()=>!1):!1}},"browser-local-audio-speech":{id:"browser-local-audio-speech",category:"speech",tasks:["text-to-speech","tts"],isAvailableBy:async()=>!!(await H()||"navigator"in globalThis&&globalThis.navigator!=null&&"deviceMemory"in globalThis.navigator&&typeof globalThis.navigator.deviceMemory=="number"&&globalThis.navigator.deviceMemory>=8),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 u({...g(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"browser-local-transformers",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(r=>r.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()=>!!(await H()||"navigator"in globalThis&&globalThis.navigator!=null&&"deviceMemory"in globalThis.navigator&&typeof globalThis.navigator.deviceMemory=="number"&&globalThis.navigator.deviceMemory>=8),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 u({...g(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"browser-local-transformers",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(r=>r.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=>M(e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...M(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>e.baseUrl?fetch(`${e.baseUrl.trim()}models`).then(r=>r.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=>M(e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...M(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.baseUrl}},vllm:{id:"vllm",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=>M(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 u({...g(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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 u({...g(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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 u({...g(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},anthropic:{id:"anthropic",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=>Ke(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=>Z(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...Z(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"google-generative-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},xai:{id:"xai",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=>ae(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...ae(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},deepseek:{id:"deepseek",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=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...J(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},elevenlabs:{id:"elevenlabs",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=>ie(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>$e.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const r=ie(e.apiKey.trim(),e.baseUrl.trim()),l=await T({...r.voice()}),n=l.findIndex(P=>P.name.includes("Aria")),p=l.findIndex(P=>P.name.includes("Bill")),z=n!==-1?n:0,G=p!==-1?p:l.length-1,N=Math.min(z,G),D=Math.max(z,G);return[...l.slice(0,N),...l.slice(D+1),...l.slice(N,D+1)].map(P=>({id:P.id,name:P.name,provider:"elevenlabs",previewURL:P.preview_audio_url,languages:P.languages}))}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"microsoft-speech":{id:"microsoft-speech",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=>re(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"v1",name:"v1",provider:"microsoft-speech",description:"",contextLength:0,deprecated:!1}],listVoices:async e=>{const r=re(e.apiKey.trim(),e.baseUrl.trim());return(await T({...r.voice({region:e.region})})).map(n=>{var p;return{id:n.id,name:n.name,provider:"microsoft-speech",previewURL:n.preview_audio_url,languages:n.languages,gender:(p=n.labels)==null?void 0:p.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=>ne(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=ne(e.apiKey.trim(),e.baseUrl.trim());return(await T({...r.voice()})).map(n=>{var p;return{id:n.id,name:n.name,provider:"alibaba-cloud-model-studio",previewURL:n.preview_audio_url,languages:n.languages,gender:(p=n.labels)==null?void 0:p.gender}})},listModels:async()=>[{id:"cozyvoice-v1",name:"CozyVoice",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1},{id:"cozyvoice-v2",name:"CozyVoice (New)",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},volcengine:{id:"volcengine",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=>te(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=te(e.apiKey.trim(),e.baseUrl.trim());return(await T({...r.voice()})).map(n=>{var p;return{id:n.id,name:n.name,provider:"volcano-engine",previewURL:n.preview_audio_url,languages:n.languages,gender:(p=n.labels)==null?void 0:p.gender}})},listModels:async()=>[{id:"v1",name:"v1",provider:"volcano-engine",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl&&!!e.app&&!!e.app.appId}},"together-ai":{id:"together-ai",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=>ee(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...ee(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"novita-ai":{id:"novita-ai",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=>R(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...R(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"fireworks-ai":{id:"fireworks-ai",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=>X(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...X(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"featherless-ai":{id:"featherless-ai",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 u({...g(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"featherless-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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=>Oe(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(r=>r.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=>Ce(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=>Me(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=>Q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...Q(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"moonshot-ai":{id:"moonshot-ai",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=>Y(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await u({...Y(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}}};async function f(e){const r=a.value[e];if(!r)return!1;const l=d[e];return l?await l.validators.validateProviderConfig(r):!1}const t=A({});function o(e){var r;if(!a.value[e]){const l=d[e],n=((r=l.defaultOptions)==null?void 0:r.call(l))||{};a.value[e]={baseUrl:n.baseUrl||""}}}Object.keys(d).forEach(o);async function b(){await Promise.all(Object.keys(d).map(async e=>{t.value[e]=await f(e)}))}b(),he(a,b,{deep:!0});const m=k(()=>Object.keys(d).filter(e=>t.value[e])),c=A({}),x=A({}),w=A({});async function C(e){const r=a.value[e];if(!r)return[];const l=d[e];if(!l)return[];x.value[e]=!0,w.value[e]=null;try{const n=l.capabilities.listModels?await l.capabilities.listModels(r):[];return c.value[e]=n.map(p=>({id:p.id,name:p.name,description:p.description,contextLength:p.contextLength,deprecated:p.deprecated,provider:e})),c.value[e]}catch(n){return console.error(`Error fetching models for ${e}:`,n),w.value[e]=n instanceof Error?n.message:"Unknown error",[]}finally{x.value[e]=!1}}function O(e){return c.value[e]||[]}const q=k(()=>{const e=[];for(const r of m.value)e.push(...c.value[r]||[]);return e});async function se(){for(const e of m.value)d[e].capabilities.listModels&&await C(e)}function $(e){const r=d[e];if(!r)throw new Error(`Provider metadata for ${e} not found`);return{...r,localizedName:i(r.nameKey,r.name),localizedDescription:i(r.descriptionKey,r.description)}}const I=k(()=>Object.values(d).map(e=>({...e,localizedName:i(e.nameKey,e.name),localizedDescription:i(e.descriptionKey,e.description),configured:t.value[e.id]||!1})));function oe(e){const r=a.value[e];if(!r)throw new Error(`Provider credentials for ${e} not found`);const l=d[e];if(!l)throw new Error(`Provider metadata for ${e} not found`);try{return l.createProvider(r)}catch(n){throw console.error(`Error creating provider instance for ${e}:`,n),n}}const S=be(async()=>{const e=[];for(const r of I.value)await($(r.id).isAvailableBy||(()=>!0))()&&e.push(r);return e},[]),L=k(()=>S.value.filter(e=>e.category==="chat")),j=k(()=>S.value.filter(e=>e.category==="speech")),F=k(()=>S.value.filter(e=>e.category==="transcription")),le=k(()=>L.value.filter(e=>t.value[e.id])),de=k(()=>j.value.filter(e=>t.value[e.id])),ce=k(()=>F.value.filter(e=>t.value[e.id]));function pe(e){return a.value[e]}return{providers:a,getProviderConfig:pe,availableProviders:m,configuredProviders:t,providerMetadata:d,getProviderMetadata:$,allProvidersMetadata:I,initializeProvider:o,validateProvider:f,availableModels:c,isLoadingModels:x,modelLoadError:w,fetchModelsForProvider:C,getModelsForProvider:O,allAvailableModels:q,loadModelsForConfiguredProviders:se,getProviderInstance:oe,availableProvidersMetadata:S,allChatProvidersMetadata:L,allAudioSpeechProvidersMetadata:j,allAudioTranscriptionProvidersMetadata:F,configuredChatProvidersMetadata:le,configuredSpeechProvidersMetadata:de,configuredTranscriptionProvidersMetadata:ce}});export{u as l,Ge as u}; diff --git a/assets/queue-31IhYt_K.js b/assets/queue-31IhYt_K.js deleted file mode 100644 index 1b87154cf8fff53a90c894ac71e80cedf9322cea..0000000000000000000000000000000000000000 --- a/assets/queue-31IhYt_K.js +++ /dev/null @@ -1 +0,0 @@ -import{e as l}from"./index-D7HCX4VR.js";function m(f){const t=l([]),a=l(!1),d={add:[],pick:[],processing:[],error:[],processed:[],done:[]},s={};function c(n,e){d[n].push(e)}function r(n,...e){d[n].forEach(i=>{i(...e)})}function h(n,e){s[n]=s[n]||[],s[n].push(e)}function p(n,...e){(s[n]||[]).forEach(i=>{i(...e)})}async function v(n){t.value.push(n),r("add",n)}function E(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=E();if(n){a.value=!0;for(const e of f.handlers){r("processing",n,e);try{const o=await e({data:n,itemsToBeProcessed:()=>t.value.length,emit:p});r("processed",n,o,e)}catch(o){r("error",n,o,e);continue}}a.value=!1,r("done",n),t.value.length>0&&u()}}return c("add",u),c("done",u),{add:v,on:c,onHandlerEvent:h,queue:t}}export{m as u}; diff --git a/assets/queue-BZUURX31.js b/assets/queue-BZUURX31.js new file mode 100644 index 0000000000000000000000000000000000000000..509527014529b3b181692d78db620b0b0fb77a52 --- /dev/null +++ b/assets/queue-BZUURX31.js @@ -0,0 +1 @@ +import{ref as e}from"./index-BtAisBe9.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-Cq0yk53b.js b/assets/queue-Cq0yk53b.js deleted file mode 100644 index 4c5342edec7cf3f1d536e2607fcd91dcbe07596a..0000000000000000000000000000000000000000 --- a/assets/queue-Cq0yk53b.js +++ /dev/null @@ -1 +0,0 @@ -import{u as o}from"./queue-31IhYt_K.js";import{d as v,e as h,T as k,c as w,o as g,a as I}from"./index-D7HCX4VR.js";const Q=v({__name:"queue",setup(P){function i(e){return new Promise(a=>setTimeout(a,e))}const n=h(""),d=o({handlers:[async e=>{console.log("ready to play speech audio for",e)}]}),u=o({handlers:[async e=>{console.log("ready to stream speech audio for",e),d.add(e.data)}]}),c=o({handlers:[async e=>{const a=[".","?","!"];let s=!1;for(const t of a){if(!e.data.includes(t))continue;const r=e.data.indexOf(t),p=e.data.slice(0,r+1),y=e.data.slice(r+1);n.value+=p,u.add(n.value.trim()),n.value=y,s=!0}s||(n.value+=e.data)}]}),l=["Hello"," N","eko","! I"," am"," an"," AI"," assistant"," trained"," to"," help"," with"," a"," variety"," of"," tasks"," such"," as"," answering"," questions",","," providing"," information",","," giving"," recommendations",","," and"," more",". How"," can"," I"," assist"," you"," today","?","Hello"," N","eko",","," I"," am"," an"," AI"," assistant","."," I"," can"," help"," answer"," questions",","," provide"," information",","," assist"," with"," tasks",","," and"," engage"," in"," conversation","."," How"," can"," I"," assist"," you"," today","?"];async function f(){for(const e of l)await i(100),c.add(e)}async function m(){f()}return k(()=>{m()}),(e,a)=>(g(),w("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; diff --git a/assets/queue-DEVr27WI.js b/assets/queue-DEVr27WI.js new file mode 100644 index 0000000000000000000000000000000000000000..7d25693a16f61108c2c871a6bdf7706c9b6a74fc --- /dev/null +++ b/assets/queue-DEVr27WI.js @@ -0,0 +1 @@ +import{createBaseVNode as e,createElementBlock as t,defineComponent as n,onMounted as r,openBlock as i,ref as a}from"./index-BtAisBe9.js";import{useQueue as o}from"./queue-BZUURX31.js";var s=n({__name:`queue`,setup(n){function s(e){return new Promise(t=>setTimeout(t,e))}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)]))}}),c=s;export{c as default}; \ No newline at end of file diff --git a/assets/queues-CIntookp.js b/assets/queues-CIntookp.js deleted file mode 100644 index 77dd5c1b021badde5021900243d2fc40e4969261..0000000000000000000000000000000000000000 --- a/assets/queues-CIntookp.js +++ /dev/null @@ -1 +0,0 @@ -import{c as i}from"./emotions-DWNSb738.js";import{u as s}from"./queue-31IhYt_K.js";import{e as d}from"./index-D7HCX4VR.js";const l="<|llm_inference_end|>";function y(o){function t(e){for(const n of i)if(e.includes(n))return{ok:!0,emotion:n};return{ok:!1,emotion:""}}return s({handlers:[async e=>{if(i.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:n,emotion:a}=t(e.data);n&&(e.emit("emotion",a),await o.add(a))}}]})}function k(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const n=/<\|DELAY:(\d+)\|>/i.exec(e),a=n==null?void 0:n[1];if(!a)return{ok:!1,delay:0};const r=Number.parseFloat(a);return r<=0||Number.isNaN(r)?{ok:!0,delay:0}:{ok:!0,delay:r}}function t(e){return new Promise(n=>setTimeout(n,e))}return s({handlers:[async e=>{const{ok:n,delay:a}=o(e.data);n&&(e.emit("delay",a),await t(a*1e3))}]})}function p(o){const t=d("");return s({handlers:[async e=>{if(e.data===l){const a=t.value.trim();a&&await o.add(a),t.value="";return}const n=/[.?!]/;for(t.value+=e.data;t.value;){const a=n.exec(t.value);if(!a||typeof a.index>"u")break;const r=t.value.slice(0,a.index+1),u=t.value.slice(a.index+1);await o.add(r),t.value=u}}]})}export{y as a,k as b,l,p as u}; diff --git a/assets/queues-U6a2FwNq.js b/assets/queues-U6a2FwNq.js new file mode 100644 index 0000000000000000000000000000000000000000..81a079aa08c57ca8fe16892792fdbdd8bc822187 --- /dev/null +++ b/assets/queues-U6a2FwNq.js @@ -0,0 +1,4 @@ +import{ref as e}from"./index-BtAisBe9.js";import{useQueue as t}from"./queue-BZUURX31.js";let n=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 r=Object.values(n),i=`Happy`,a=`Sad`,o=`Angry`,s=`Awkward`,c=`Think`,l=`Surprise`,u=`Question`,d=`Idle`,f={[n.Happy]:i,[n.Sad]:a,[n.Angry]:o,[n.Think]:c,[n.Surprise]:l,[n.Awkward]:s,[n.Question]:u,[n.Idle]:d},p={[n.Happy]:`happy`,[n.Sad]:`sad`,[n.Angry]:`angry`,[n.Think]:void 0,[n.Surprise]:`surprised`,[n.Awkward]:void 0,[n.Question]:void 0,[n.Idle]:void 0};function m(e,t){return{role:`system`,content:[e,r.map(e=>`- ${e}`).join(` +`),t].join(` + +`)}}var h=m;const g=`<|llm_inference_end|>`;function _(e){function n(e){for(let t of r){if(!e.includes(t))continue;return{ok:!0,emotion:t}}return{ok:!1,emotion:``}}return t({handlers:[async t=>{if(r.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 v(){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}}function n(e){return new Promise(t=>setTimeout(t,e))}return t({handlers:[async t=>{let{ok:r,delay:i}=e(t.data);r&&(t.emit(`delay`,i),await n(i*1e3))}]})}function y(n){let r=e(``);return t({handlers:[async e=>{if(e.data===g){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{f as EMOTION_EmotionMotionName_value,p as EMOTION_VRMExpressionName_value,n as Emotion,d as EmotionNeutralMotionName,c as EmotionThinkMotionName,g as llmInferenceEndToken,h as system_v2_default,v as useDelayMessageQueue,_ as useEmotionsMessageQueue,y as useMessageContentQueue}; \ No newline at end of file diff --git a/assets/route-block-B_A1xBdJ.js b/assets/route-block-B_A1xBdJ.js deleted file mode 100644 index 29fda6aeea68935b8d924ba9c5f57946d88c3035..0000000000000000000000000000000000000000 --- a/assets/route-block-B_A1xBdJ.js +++ /dev/null @@ -1 +0,0 @@ -const o={};export{o as b}; diff --git a/assets/route-block-DNPbw0zT.js b/assets/route-block-DNPbw0zT.js new file mode 100644 index 0000000000000000000000000000000000000000..ce71688eb3e46d25e69d8cc1280a14809f5e7c1c --- /dev/null +++ b/assets/route-block-DNPbw0zT.js @@ -0,0 +1 @@ +var e={};export{e as route_block_default}; \ No newline at end of file diff --git a/assets/scene-Lh08I5GV.js b/assets/scene-Lh08I5GV.js new file mode 100644 index 0000000000000000000000000000000000000000..9d2a733212076a08b7800e11a2facc0add4b1c0f --- /dev/null +++ b/assets/scene-Lh08I5GV.js @@ -0,0 +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-BtAisBe9.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as l}from"./route-block-DNPbw0zT.js";import{IconAnimation_default as u}from"./IconAnimation-B5sfLFsA.js";import{useIconAnimation as d}from"./useIconAnimation-C_Mu172C.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-B26B-JaW.js b/assets/settings-B26B-JaW.js deleted file mode 100644 index aa238d09565cc2d37b360a167f13cb0ab67a6f53..0000000000000000000000000000000000000000 --- a/assets/settings-B26B-JaW.js +++ /dev/null @@ -1 +0,0 @@ -var rt=Object.defineProperty;var ot=(t,s,e)=>s in t?rt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var m=(t,s,e)=>ot(t,typeof s!="symbol"?s+"":s,e);import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{r as D,w as b,u as A,e as g,f as B,i as at,g as lt,h as y,j as J,n as ut,k as V,l as M,p as l,m as $,q as O,s as S,t as v,v as ct,x as ft,y as pt,z as U,A as dt,B as mt,C as gt,D as ht,E as bt,F as yt,G as vt,H as xt,I as Tt,J as At,K as Ot,L as wt,M as kt,N as Bt,O as Et,P as St,Q as jt,S as Pt,d as Q,T as Vt,U as Ct,c as j,a as k,V as Nt,W,X as Rt,Y as X,o as P,Z as _,_ as Y,$ as Mt,a0 as zt,b as C,R as Dt}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as Lt}from"./providers-DepZj6_J.js";import{H as Ft}from"./HeaderLink-BKV8TZb8.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";const T={};class Ht{constructor(){m(this,"subscriptions",new Set)}add(s){return this.subscriptions.add(s),()=>this.subscriptions.delete(s)}notify(s,e,n){if(this.subscriptions.size)for(const i of this.subscriptions)i(s,e,n)}clear(){this.subscriptions.clear()}}function Z(t){return!Number.isNaN(Number.parseFloat(t))}class $t{constructor(s){m(this,"current");m(this,"prev");m(this,"timeDelta",0);m(this,"lastUpdated",0);m(this,"updateSubscribers",new Ht);m(this,"stopAnimation");m(this,"canTrackVelocity",!1);m(this,"updateAndNotify",s=>{this.prev=this.current,this.current=s;const{delta:e,timestamp:n}=pt();this.lastUpdated!==n&&(this.timeDelta=e,this.lastUpdated=n),U.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});m(this,"scheduleVelocityCheck",()=>U.postRender(this.velocityCheck));m(this,"velocityCheck",({timestamp:s})=>{this.canTrackVelocity||(this.canTrackVelocity=Z(this.current)),s!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=s,this.canTrackVelocity=Z(this.current)}onChange(s){return this.updateSubscribers.add(s)}clearListeners(){this.updateSubscribers.clear()}set(s){this.updateAndNotify(s)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?dt(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(s){return this.stop(),new Promise(e=>{const{stop:n}=s(e);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 Ut(t){return new $t(t)}const{isArray:Wt}=Array;function Xt(){const t=g({}),s=n=>{const i=r=>{t.value[r]&&(t.value[r].stop(),t.value[r].destroy(),delete t.value[r])};n?Wt(n)?n.forEach(i):i(n):Object.keys(t.value).forEach(i)},e=(n,i,r)=>{if(t.value[n])return t.value[n];const o=Ut(i);return o.onChange(a=>r[n]=a),t.value[n]=o,o};return jt(s),{motionValues:t,get:e,stop:s}}function Yt(t){return Array.isArray(t)}function w(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function N(t){return{type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Zt(t){return{type:"spring",stiffness:550,damping:t===0?100:30,restDelta:.01,restSpeed:10}}function R(){return{type:"keyframes",ease:"linear",duration:300}}function It(t){return{type:"keyframes",duration:800,values:t}}const I={default:Zt,x:w,y:w,z:w,rotate:w,rotateX:w,rotateY:w,rotateZ:w,scaleX:N,scaleY:N,scale:N,backgroundColor:R,color:R,opacity:R};function tt(t,s){let e;return Yt(s)?e=It:e=I[t]||I.default,{to:s,...e(s)}}const K={...ut,transform:Math.round},et={color:v,backgroundColor:v,outlineColor:v,fill:v,stroke:v,borderColor:v,borderTopColor:v,borderRightColor:v,borderBottomColor:v,borderLeftColor:v,borderWidth:l,borderTopWidth:l,borderRightWidth:l,borderBottomWidth:l,borderLeftWidth:l,borderRadius:l,radius:l,borderTopLeftRadius:l,borderTopRightRadius:l,borderBottomRightRadius:l,borderBottomLeftRadius:l,width:l,maxWidth:l,height:l,maxHeight:l,size:l,top:l,right:l,bottom:l,left:l,padding:l,paddingTop:l,paddingRight:l,paddingBottom:l,paddingLeft:l,margin:l,marginTop:l,marginRight:l,marginBottom:l,marginLeft:l,rotate:O,rotateX:O,rotateY:O,rotateZ:O,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:O,skewX:O,skewY:O,distance:l,translateX:l,translateY:l,translateZ:l,x:l,y:l,z:l,perspective:l,transformPerspective:l,opacity:V,originX:$,originY:$,originZ:l,zIndex:K,filter:M,WebkitFilter:M,fillOpacity:V,strokeOpacity:V,numOctaves:K},L=t=>et[t];function z(t,s){return s&&typeof t=="number"&&s.transform?s.transform(t):t}function Kt(t,s){let e=L(t);return e!==M&&(e=J),e.getAnimatableNone?e.getAnimatableNone(s):void 0}const qt={linear:St,easeIn:Et,easeInOut:Bt,easeOut:kt,circIn:wt,circInOut:Ot,circOut:At,backIn:Tt,backInOut:xt,backOut:vt,anticipate:yt,bounceIn:bt,bounceInOut:ht,bounceOut:gt};function q(t){if(Array.isArray(t)){const[s,e,n,i]=t;return mt(s,e,n,i)}else if(typeof t=="string")return qt[t];return t}function Gt(t){return Array.isArray(t)&&typeof t[0]!="number"}function G(t,s){return t==="zIndex"?!1:!!(typeof s=="number"||Array.isArray(s)||typeof s=="string"&&J.test(s)&&!s.startsWith("url("))}function Jt(t){return Array.isArray(t.to)&&t.to[0]===null&&(t.to=[...t.to],t.to[0]=t.from),t}function Qt({ease:t,times:s,delay:e,...n}){const i={...n};return s&&(i.offset=s),t&&(i.ease=Gt(t)?t.map(q):q(t)),e&&(i.elapsed=-e),i}function _t(t,s,e){return Array.isArray(s.to)&&(t.duration||(t.duration=800)),Jt(s),te(t)||(t={...t,...tt(e,s.to)}),{...s,...Qt(t)}}function te({delay:t,repeat:s,repeatType:e,repeatDelay:n,from:i,...r}){return!!Object.keys(r).length}function ee(t,s){return t[s]||t.default||t}function se(t,s,e,n,i){const r=ee(n,t);let o=r.from===null||r.from===void 0?s.get():r.from;const a=G(t,e);o==="none"&&a&&typeof e=="string"&&(o=Kt(t,e));const c=G(t,o);function p(f){const d={from:o,to:e,velocity:n.velocity?n.velocity:s.getVelocity(),onUpdate:x=>s.set(x)};return r.type==="inertia"||r.type==="decay"?ct({...d,...r}):ft({..._t(r,d,t),onUpdate:x=>{d.onUpdate(x),r.onUpdate&&r.onUpdate(x)},onComplete:()=>{i&&i(),f&&f()}})}function u(f){return s.set(e),i&&i(),f&&f(),{stop:()=>{}}}return!c||!a||r.type===!1?u:p}function ie(){const{motionValues:t,stop:s,get:e}=Xt();return{motionValues:t,stop:s,push:(i,r,o,a={},c)=>{const p=o[i],u=e(i,p,o);if(a&&a.immediate){u.set(r);return}const f=se(i,u,r,a,c);u.start(f)}}}function ne(t,s={},{motionValues:e,push:n,stop:i}=ie()){const r=A(s),o=g(!1);b(e,f=>{o.value=Object.values(f).filter(d=>d.isAnimating()).length>0},{immediate:!0,deep:!0});const a=f=>{if(!r||!r[f])throw new Error(`The variant ${f} does not exist.`);return r[f]},c=f=>{typeof f=="string"&&(f=a(f));const d=Object.entries(f).map(([h,E])=>{if(h!=="transition")return new Promise(nt=>n(h,E,t,f.transition||tt(h,f[h]),nt))}).filter(Boolean);async function x(){var h,E;await Promise.all(d),(E=(h=f.transition)==null?void 0:h.onComplete)==null||E.call(h)}return Promise.all([x()])};return{isAnimating:o,apply:c,set:f=>{const d=at(f)?f:a(f);Object.entries(d).forEach(([x,h])=>{x!=="transition"&&n(x,h,t,{immediate:!0})})},leave:async f=>{let d;if(r&&(r.leave&&(d=r.leave),!r.leave&&r.initial&&(d=r.initial)),!d){f();return}await c(d),f()},stop:i}}const F=typeof window<"u",re=()=>F&&(window.onpointerdown===null||(T==null?void 0:T.TEST)),oe=()=>F&&(window.ontouchstart===null||(T==null?void 0:T.TEST)),ae=()=>F&&(window.onmousedown===null||(T==null?void 0:T.TEST));function le({target:t,state:s,variants:e,apply:n}){const i=A(e),r=g(!1),o=g(!1),a=g(!1),c=B(()=>{let u=[...Object.keys(s.value||{})];return i&&(i.hovered&&(u=[...u,...Object.keys(i.hovered)]),i.tapped&&(u=[...u,...Object.keys(i.tapped)]),i.focused&&(u=[...u,...Object.keys(i.focused)])),u}),p=B(()=>{const u={};Object.assign(u,s.value),r.value&&i.hovered&&Object.assign(u,i.hovered),o.value&&i.tapped&&Object.assign(u,i.tapped),a.value&&i.focused&&Object.assign(u,i.focused);for(const f in u)c.value.includes(f)||delete u[f];return u});i.hovered&&(y(t,"mouseenter",()=>r.value=!0),y(t,"mouseleave",()=>{r.value=!1,o.value=!1})),i.tapped&&(ae()&&(y(t,"mousedown",()=>o.value=!0),y(t,"mouseup",()=>o.value=!1)),re()&&(y(t,"pointerdown",()=>o.value=!0),y(t,"pointerup",()=>o.value=!1)),oe()&&(y(t,"touchstart",()=>o.value=!0),y(t,"touchend",()=>o.value=!1))),i.focused&&(y(t,"focus",()=>a.value=!0),y(t,"blur",()=>a.value=!1)),b([r,o,a],()=>{n(p.value)})}function ue({set:t,target:s,variants:e,variant:n}){const i=A(e);b(()=>s,()=>{i&&(i.initial&&(t("initial"),n.value="initial"),i.enter&&(n.value="enter"))},{immediate:!0,flush:"pre"})}function ce({state:t,apply:s}){b(t,e=>{e&&s(e)},{immediate:!0})}function fe({target:t,variants:s,variant:e}){const n=A(s);n&&(n.visible||n.visibleOnce)&<(t,([{isIntersecting:i}])=>{n.visible?i?e.value="visible":e.value="initial":n.visibleOnce&&(i&&e.value!=="visibleOnce"?e.value="visibleOnce":e.value||(e.value="initial"))})}function pe(t,s={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){s.lifeCycleHooks&&ue(t),s.syncVariants&&ce(t),s.visibilityHooks&&fe(t),s.eventListeners&&le(t)}function de(t={}){const s=D({...t}),e=g({});return b(s,()=>{const n={};for(const[i,r]of Object.entries(s)){const o=L(i),a=z(r,o);n[i]=a}e.value=n},{immediate:!0,deep:!0}),{state:s,style:e}}function H(t,s){b(()=>Pt(t),e=>{e&&s(e)},{immediate:!0})}const me={x:"translateX",y:"translateY",z:"translateZ"};function ge(t={},s=!0){const e=D({...t}),n=g("");return b(e,i=>{let r="",o=!1;if(s&&(i.x||i.y||i.z)){const a=[i.x||0,i.y||0,i.z||0].map(c=>z(c,l)).join(",");r+=`translate3d(${a}) `,o=!0}for(const[a,c]of Object.entries(i)){if(s&&(a==="x"||a==="y"||a==="z"))continue;const p=L(a),u=z(c,p);r+=`${me[a]||a}(${u}) `}s&&!o&&(r+="translateZ(0px) "),n.value=r.trim()},{immediate:!0,deep:!0}),{state:e,transform:n}}const he=["","X","Y","Z"],be=["perspective","translate","scale","rotate","skew"],st=["transformPerspective","x","y","z"];be.forEach(t=>{he.forEach(s=>{const e=t+s;st.push(e)})});const ye=new Set(st);function it(t){return ye.has(t)}const ve=new Set(["originX","originY","originZ"]);function xe(t){return ve.has(t)}function Te(t,s){let e,n;const{state:i,style:r}=de();return H(t,o=>{n=o;for(const a of Object.keys(et))o.style[a]===null||o.style[a]===""||it(a)||xe(a)||(i[a]=o.style[a]);e&&Object.entries(e).forEach(([a,c])=>o.style[a]=c),s&&s(i)}),b(r,o=>{if(!n){e=o;return}for(const a in o)n.style[a]=o[a]},{immediate:!0}),{style:i}}function Ae(t){const s=t.trim().split(/\) |\)/);if(s.length===1)return{};const e=n=>n.endsWith("px")||n.endsWith("deg")?Number.parseFloat(n):Number.isNaN(Number(n))?Number(n):n;return s.reduce((n,i)=>{if(!i)return n;const[r,o]=i.split("("),c=o.split(",").map(u=>e(u.endsWith(")")?u.replace(")",""):u.trim())),p=c.length===1?c[0]:c;return{...n,[r]:p}},{})}function Oe(t,s){Object.entries(Ae(s)).forEach(([e,n])=>{const i=["x","y","z"];if(e==="translate3d"){if(n===0){i.forEach(r=>t[r]=0);return}n.forEach((r,o)=>t[i[o]]=r);return}if(n=Number.parseFloat(`${n}`),e==="translateX"){t.x=n;return}if(e==="translateY"){t.y=n;return}if(e==="translateZ"){t.z=n;return}t[e]=n})}function we(t,s){let e,n;const{state:i,transform:r}=ge();return H(t,o=>{n=o,o.style.transform&&Oe(i,o.style.transform),e&&(o.style.transform=e),s&&s(i)}),b(r,o=>{if(!n){e=o;return}n.style.transform=o},{immediate:!0}),{transform:i}}function ke(t){return Object.entries(t)}function Be(t,s){const e=D({}),n=o=>Object.entries(o).forEach(([a,c])=>e[a]=c),{style:i}=Te(t,n),{transform:r}=we(t,n);return b(e,o=>{ke(o).forEach(([a,c])=>{const p=it(a)?r:i;p[a]&&p[a]===c||(p[a]=c)})},{immediate:!0,deep:!0}),H(t,()=>s),{motionProperties:e,style:i,transform:r}}function Ee(t={}){const s=A(t),e=g();return{state:B(()=>{if(e.value)return s[e.value]}),variant:e}}function Se(t,s={},e){const{motionProperties:n}=Be(t),{variant:i,state:r}=Ee(s),o=ne(n,s),a={target:t,variant:i,variants:s,state:r,motionProperties:n,...o};return pe(a,e),a}const je={relative:""},Pe={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},Ve={text:"neutral-300 dark:neutral-500","text-nowrap":""},Ce={"text-nowrap":"","text-3xl":"","font-semibold":""},Ne=Q({__name:"PageHeader",props:{title:null,subtitle:null,showBackButton:{type:Boolean,default:!0},disableBackButton:{type:Boolean,default:!1}},setup(t){const s=t,e=Nt(),n=_(),i=g(),r=g(s.title),o=g(s.subtitle),a=g(s.disableBackButton),{apply:c}=Se(i,{initial:{opacity:0,x:10,transition:{duration:250}},enter:{opacity:1,x:0,transition:{duration:250}},leave:{opacity:0,x:-5,transition:{duration:100}}});return Vt(async()=>{await c("initial"),await c("enter")}),Ct(async()=>{await c("leave"),a.value=!0}),b([()=>s.title,()=>s.subtitle,n],async()=>{await c("leave"),await Y(),a.value=s.disableBackButton,r.value=s.title,o.value=s.subtitle,await Y(),await c("initial"),await c("enter")}),(p,u)=>(P(),j("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"},[k("button",{onClick:u[0]||(u[0]=f=>A(e).back())},[a.value?W("",!0):(P(),j("div",{key:0,"i-solar:alt-arrow-left-line-duotone":"","text-2xl":"",class:Rt({"pointer-events-none op-0":!t.showBackButton})},null,2))]),k("h1",je,[o.value?(P(),j("div",Pe,[k("span",Ve,X(o.value),1)])):W("",!0),k("div",Ce,X(r.value),1)])],512))}}),Re={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)"}},Me={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},ze={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},qe=Q({__name:"settings",setup(t){const s=_(),{t:e}=Mt(),n=Lt(),{allProvidersMetadata:i}=zt(n),r=B(()=>{const a={"/settings/airi-card":{subtitle:e("settings.title"),title:e("settings.pages.card.title")},"/settings/appearance":{subtitle:e("settings.title"),title:e("settings.pages.themes.title")},"/settings/appearance/general":{subtitle:e("settings.title"),title:e("settings.pages.themes.general.title")},"/settings/appearance/color-scheme":{subtitle:e("settings.title"),title:e("settings.pages.themes.color-scheme.title")},"/settings/appearance/developer":{subtitle:e("settings.title"),title:e("settings.pages.themes.developer.title")},"/settings/memory":{subtitle:e("settings.title"),title:e("settings.pages.memory.title")},"/settings/models":{subtitle:e("settings.title"),title:e("settings.pages.models.title")},"/settings/modules":{subtitle:e("settings.title"),title:e("settings.pages.modules.title")},"/settings/modules/consciousness":{subtitle:e("settings.title"),title:e("settings.pages.modules.consciousness.title")},"/settings/modules/speech":{subtitle:e("settings.title"),title:e("settings.pages.modules.speech.title")},"/settings/modules/hearing":{subtitle:e("settings.title"),title:e("settings.pages.modules.hearing.title")},"/settings/modules/memory-short-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-short-term.title")},"/settings/modules/memory-long-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-long-term.title")},"/settings/modules/messaging-discord":{subtitle:e("settings.title"),title:e("settings.pages.modules.messaging-discord.title")},"/settings/modules/x":{subtitle:e("settings.title"),title:e("settings.pages.modules.x.title")},"/settings/modules/gaming-minecraft":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-minecraft.title")},"/settings/modules/gaming-factorio":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-factorio.title")},"/settings/providers":{subtitle:e("settings.title"),title:e("settings.pages.providers.title")},"/settings/scene":{subtitle:e("settings.title"),title:e("settings.pages.scene.title")},"/settings":{title:e("settings.title")}};for(const c of i.value)a[`/settings/providers/${c.id}`]={subtitle:e("settings.title"),title:e(c.nameKey)};return a}),o=B(()=>r.value[s.path]);return(a,c)=>{var p,u;return P(),j("div",Re,[k("div",Me,[C(Ft)]),k("div",ze,[C(A(Ne),{title:(p=o.value)==null?void 0:p.title,subtitle:(u=o.value)==null?void 0:u.subtitle},null,8,["title","subtitle"]),C(A(Dt))])])}}});export{qe as default}; diff --git a/assets/settings-BPFawjNr.js b/assets/settings-BPFawjNr.js new file mode 100644 index 0000000000000000000000000000000000000000..1ddce7a9e645cd267dc863f4a069a6c42f5f9792 --- /dev/null +++ b/assets/settings-BPFawjNr.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as ke}from"./stores-mOXXrrXB.js";import{HeaderLink_default as Ae}from"./HeaderLink-zGlOe2Jb.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.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-CGigMZFM.js b/assets/settings-CGigMZFM.js new file mode 100644 index 0000000000000000000000000000000000000000..738f7b7510c0a1873167561ccd2ed27ef635e61d --- /dev/null +++ b/assets/settings-CGigMZFM.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.js";import{IconItem_default as _}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as v}from"./route-block-DNPbw0zT.js";import{IconAnimation_default as y}from"./IconAnimation-B5sfLFsA.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/speech-CDwZYdOU.js b/assets/speech-CDwZYdOU.js deleted file mode 100644 index da7e7cbd8a484dfb02adeacd902b45970a96ae97..0000000000000000000000000000000000000000 --- a/assets/speech-CDwZYdOU.js +++ /dev/null @@ -1 +0,0 @@ -import{d as D,c as d,o as i,X as $,bA as ae,b_ as K,e as V,T as re,w as Z,c3 as Q,c4 as W,a as e,a3 as ce,cg as X,ch as G,bh as O,c6 as me,W as U,Y as y,b as S,u as t,bg as N,f as ve,cJ as pe,ca as ne,bf as Y,$ as fe,a0 as te,U as ge,c2 as xe,b$ as he,bE as F,cc as be}from"./index-D7HCX4VR.js";import{_ as se,a as le,b as ye}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js";import{_ as ke}from"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{_ as we}from"./Textarea.vue_vue_type_script_setup_true_lang-l_0OEYvy.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as _e}from"./providers-DepZj6_J.js";import{u as Se,g as Ve}from"./speech-D8cCufg2.js";import{R as Me,a as Ce}from"./RadioCardSimple-B9zVtorf.js";import{_ as $e}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import{_ as Ue}from"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";import{b as oe}from"./route-block-B_A1xBdJ.js";import"./Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";const Pe=D({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(o){const a=o;return(p,v)=>(i(),d("div",{class:$(["skeleton",a.animation!=="none"?`skeleton-${a.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[ae(p.$slots,"default",{},void 0,!0)],2))}}),j=K(Pe,[["__scopeId","data-v-f404da2a"]]),Le=D({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(o){const a=o,p=V(Array.from({length:a.bars}).fill(0));re(()=>{v()}),Z(()=>a.stream,()=>{v()});function v(){if(!a.stream)return;const m=new(window.AudioContext||window.webkitAudioContext),r=m.createMediaStreamSource(a.stream),g=m.createAnalyser();g.fftSize=2048,r.connect(g);const b=g.frequencyBinCount,M=new Uint8Array(b),h=m.sampleRate/g.fftSize,k=Math.floor(a.minFreq/h),C=Math.floor(a.maxFreq/h),E=C-k,R=Math.floor(E/a.bars),L=()=>{try{requestAnimationFrame(L),g.getByteFrequencyData(M);const B=Array.from({length:a.bars}).fill(0);for(let T=0;Tae(m.$slots,"default",{frequencies:p.value})}}),qe={"h-full":"",flex:"","items-center":"","gap-1":""},Ee=5,Re=D({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(o){const a=o;function p(m,r){return .1+(1-.1)*(m/r)}function v(m,r){const g=p(r,a.frequencies.length);return Math.min(100,Math.max(10,m*100*Ee*g))}return(m,r)=>(i(),d("div",qe,[(i(!0),d(Q,null,W(o.frequencies,(g,b)=>(i(),d("div",{key:b,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:$(o.barsClass),style:ce({height:`${v(g,b)}%`})},null,6)]))),128))]))}}),Te={class:"p-3"},Ae={class:"flex items-start"},ze=["checked","name","value"],Be={class:"relative mr-3 mt-0.5 flex-shrink-0"},Fe={key:0,class:"i-solar:pause-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ne={key:1,class:"i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ie={key:1,class:"mt-auto w-full flex items-center justify-center bg-neutral-50 py-3 text-xs text-neutral-400 italic dark:bg-neutral-800/50 dark:text-neutral-600"},De={class:"flex-1 cursor-pointer"},je={class:"flex items-center"},Oe={key:0,class:"mt-1 flex flex-wrap gap-1"},Qe={key:1,class:"mt-3"},He={relative:""},Je={key:0,class:"h-16 px-3 pb-2"},Ye=D({__name:"VoiceCard",props:X({name:null,voice:null,currentlyPlayingId:null,customInputPlaceholder:{default:"Enter custom voice name"},showVisualizer:{type:Boolean,default:!0},audioStream:{default:null}},{"voice-id":{required:!1,default:""},"voice-idModifiers":{},"custom-voice-name":{required:!1,default:""},"custom-voice-nameModifiers":{}}),emits:X(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(o,{emit:a}){const p=o,v=a,m=G(o,"voice-id"),r=G(o,"custom-voice-name");function g(x){return x.previewURL||x.preview_audio_url}function b(x){var k,C,E;const h=[];if((k=x.labels)!=null&&k.gender&&h.push(x.labels.gender),(C=x.labels)!=null&&C.age&&h.push(x.labels.age),(E=x.labels)!=null&&E.accent&&h.push(x.labels.accent),x.languages&&x.languages.length>0){const R=x.languages.map(L=>L.name).join(", ");h.push(R)}return h}function M(){v("togglePlayback",p.voice)}return(x,h)=>(i(),d("label",{border:"2px solid",class:$(["scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl",[m.value===p.voice.id?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",m.value===p.voice.id?"form_voice-card-active":""]]),transition:"all duration-200 ease-in-out"},[e("div",Te,[e("div",Ae,[O(e("input",{"onUpdate:modelValue":h[0]||(h[0]=k=>m.value=k),checked:m.value===p.voice.id,type:"radio",name:o.name,value:p.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,ze),[[me,m.value]]),e("div",Be,[e("div",{class:$(["size-5 border-2 rounded-full transition-colors duration-200",[m.value===p.voice.id?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[e("div",{class:$(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[m.value===p.voice.id?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),g(o.voice)?(i(),d("button",{key:0,absolute:"","right-0":"",top:"0","z-3":"",class:$(["translate-x-[-50%] translate-y-[50%]",[o.currentlyPlayingId===o.voice.id?"text-white dark:text-white":""]]),onClick:M},[o.currentlyPlayingId===o.voice.id?(i(),d("div",Fe)):(i(),d("div",Ne))],2)):(i(),d("div",Ie," No preview available ")),e("div",De,[e("div",je,[e("span",{class:$(["line-clamp-1 font-medium",[m.value===o.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},y(o.voice.name),3)]),b(o.voice).length>0?(i(),d("div",Oe,[(i(!0),d(Q,null,W(b(o.voice),(k,C)=>(i(),d("span",{key:C,class:$(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[m.value===o.voice.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400":"bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300"]])},y(k),3))),128))])):U("",!0),o.voice.customizable&&m.value===o.voice.id?(i(),d("div",Qe,[S(t(Ue),{modelValue:r.value,"onUpdate:modelValue":h[1]||(h[1]=k=>r.value=k),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:o.customInputPlaceholder},null,8,["modelValue","placeholder"])])):U("",!0),o.voice.description?(i(),d("div",{key:2,class:$(["line-clamp-2 mt-1 text-xs",[m.value===o.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},y(o.voice.description),3)):U("",!0)])])]),e("div",He,[S(t($e),null,{default:N(()=>[o.showVisualizer&&o.currentlyPlayingId===o.voice.id&&o.audioStream?(i(),d("div",Je,[S(t(Le),{stream:o.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:N(({frequencies:k})=>[S(t(Re),{frequencies:k,"bars-class":m.value===o.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):U("",!0)]),_:1})])],2))}}),Ge=K(Ye,[["__scopeId","data-v-a5ae8da9"]]),We={class:"voice-preview-player"},Xe={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Ke=["placeholder"],Ze={class:"mt-4 space-y-2"},et={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},tt={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},st={class:"flex flex-col"},lt={class:"font-medium"},ot={class:"text-sm text-amber-600 dark:text-amber-400"},at={class:"relative"},rt=D({__name:"VoiceCardManySelect",props:X({voices:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search voices..."},searchNoResultsTitle:{default:"No voices found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} voices"},customInputPlaceholder:{default:"Enter custom voice name"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},playButtonText:{default:"Play sample"},pauseButtonText:{default:"Pause"},showVisualizer:{type:Boolean,default:!0}},{"search-query":{required:!1,default:""},"search-queryModifiers":{},"voice-id":{required:!1,default:""},"voice-idModifiers":{}}),emits:["update:search-query","update:voice-id"],setup(o){const a=o,p=V(!1),v=V(),m=V(new Map),r=V(new Map),g=V(new Map),b=V(new Map),M=V(null);function x(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const h=G(o,"search-query"),k=G(o,"voice-id"),C=ve(()=>{if(!h.value)return a.voices;const n=h.value.toLowerCase();return a.voices.filter(l=>{const u=l.name.toLowerCase().includes(n),f=l.description&&l.description.toLowerCase().includes(n),w=l.tags&&l.tags.some(P=>P.toLowerCase().includes(n)),_=l.labels&&Object.values(l.labels).some(P=>typeof P=="string"&&P.toLowerCase().includes(n)),A=l.languages&&l.languages.some(P=>P.name.toLowerCase().includes(n)||P.code.toLowerCase().includes(n));return u||f||w||_||A})});function E(n){return n.previewURL||n.preview_audio_url}function R(n){const l=E(n);if(!l)return null;if(m.value.has(n.id))return m.value.get(n.id)||null;const u=new Audio(l);return u.crossOrigin="anonymous",u.preload="auto",u.addEventListener("ended",()=>{if(v.value===n.id){v.value=void 0;const f=r.value.get(n.id);f&&(f.getTracks().forEach(w=>w.stop()),r.value.delete(n.id))}}),m.value.set(n.id,u),u}function L(n,l){try{if(r.value.has(l))return r.value.get(l)||null;const u=x();if(b.value.has(l)){const A=b.value.get(l),P=u.createMediaStreamDestination();A.connect(P);const H=P.stream;return r.value.set(l,H),H}const f=u.createMediaElementSource(n);b.value.set(l,f),f.connect(u.destination);const w=u.createMediaStreamDestination();f.connect(w);const _=w.stream;return r.value.set(l,_),_}catch(u){return console.error("Failed to create audio stream for visualizer:",u),null}}function B(n){try{if(!E(n))return;const u=R(n);if(!u)return;if(v.value===n.id){u.pause(),v.value=void 0;const f=r.value.get(n.id);f&&(f.getTracks().forEach(w=>w.stop()),r.value.delete(n.id));return}if(v.value){const f=m.value.get(v.value);f&&f.pause();const w=r.value.get(v.value);w&&(w.getTracks().forEach(_=>_.stop()),r.value.delete(v.value))}a.showVisualizer&&!r.value.has(n.id)&&L(u,n.id),u.currentTime=0,u.play().catch(f=>{console.error("Failed to play audio:",f)}),v.value=n.id}catch(l){console.error(l),v.value=void 0}}function T(){m.value.forEach(n=>{n.pause(),n.src=""}),m.value.clear(),r.value.forEach(n=>{n.getTracks().forEach(l=>l.stop())}),r.value.clear(),g.value.forEach(n=>{n.state!=="closed"&&n.close()}),g.value.clear(),b.value.clear(),v.value=void 0}Z(h,()=>{if(v.value){const n=m.value.get(v.value);n&&n.pause();const l=r.value.get(v.value);l&&(l.getTracks().forEach(u=>u.stop()),r.value.delete(v.value)),v.value=void 0}}),pe(T);const q=V("");return(n,l)=>(i(),d("div",We,[o.searchable?(i(),d("div",Xe,[l[4]||(l[4]=e("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[e("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),O(e("input",{"onUpdate:modelValue":l[0]||(l[0]=u=>h.value=u),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:o.searchPlaceholder},null,8,Ke),[[ne,h.value]])])):U("",!0),e("div",Ze,[h.value?(i(),d("div",et,y(o.searchResultsText.replace("{count}",C.value.length.toString()).replace("{total}",o.voices.length.toString())),1)):U("",!0),h.value&&C.value.length===0?(i(),d("div",tt,[l[5]||(l[5]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",st,[e("span",lt,y(o.searchNoResultsTitle),1),e("span",ot,y(o.searchNoResultsDescription.replace("{query}",h.value)),1)])])):U("",!0),e("div",at,[e("div",{class:$(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto scrollbar-none",[p.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(i(!0),d(Q,null,W(C.value,u=>(i(),Y(Ge,{key:u.id,"voice-id":k.value,"onUpdate:voiceId":l[1]||(l[1]=f=>k.value=f),"custom-voice-name":q.value,"onUpdate:customVoiceName":l[2]||(l[2]=f=>q.value=f),name:"voice",voice:u,"currently-playing-id":v.value,"custom-input-placeholder":o.customInputPlaceholder,"show-visualizer":o.showVisualizer,"audio-stream":r.value.get(u.id),onTogglePlayback:B},null,8,["voice-id","custom-voice-name","voice","currently-playing-id","custom-input-placeholder","show-visualizer","audio-stream"]))),128))],2),e("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:$([p.value?"w-full":"mt-4 w-full rounded-lg"])},[e("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:$([p.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:l[3]||(l[3]=u=>p.value=!p.value)},[e("span",null,y(p.value?o.collapseButtonText:o.expandButtonText),1),e("div",{class:$([p.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),nt=K(rt,[["__scopeId","data-v-4dd3b9e2"]]),it={flex:"~ col md:row gap-6"},ut={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},dt={flex:"~ col gap-4"},ct={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},mt={text:"neutral-400 dark:neutral-500"},vt={"max-w-full":""},pt={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},ft={key:1},gt={key:0},xt={flex:"~ col gap-4"},ht={class:"text-lg md:text-2xl"},bt={text:"neutral-400 dark:neutral-400"},yt={key:0,class:"flex items-center justify-center py-4"},kt={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"},wt={class:"flex flex-col"},_t={class:"font-medium"},St={class:"text-sm text-red-600 dark:text-red-400"},Vt={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"},Mt={class:"flex flex-col"},Ct={class:"font-medium"},$t={class:"text-sm text-amber-600 dark:text-amber-400"},Ut={key:0},Pt={flex:"~ col gap-4"},Lt={key:0},qt={class:"flex flex-col gap-4"},Et={flex:"~ row gap-4"},Rt={key:1,class:"space-y-6"},Tt={key:2,class:"flex items-center gap-3 border border-2 border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},At={class:"flex flex-col"},zt={class:"text-sm text-red-600 dark:text-red-400"},Bt={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"},Ft={flex:"~ col gap-4"},Nt={key:4,class:"mt-2 space-y-6"},It={key:0},Dt={flex:"~ col gap-4"},jt={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ot={"w-full":"","rounded-xl":""},Qt={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Ht={class:"inline-flex items-center gap-4"},Jt={flex:"~ col gap-4"},Yt={flex:"~ row","gap-4":""},Gt=["disabled"],Wt={flex:"~ row","items-center":"","gap-2":""},Xt=["src"],Kt={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":""},Zt=D({__name:"speech",setup(o){const{t:a}=fe(),p=_e(),v=Se(),{configuredSpeechProvidersMetadata:m}=te(p),{activeSpeechProvider:r,activeSpeechModel:g,activeSpeechVoice:b,activeSpeechVoiceId:M,pitch:x,isLoadingSpeechProviderVoices:h,supportsModelListing:k,providerModels:C,isLoadingActiveProviderModels:E,activeProviderModelError:R,modelSearchQuery:L,speechProviderError:B,ssmlEnabled:T,availableVoices:q}=te(v),n=V(""),l=V(!1),u=V("Hello, my name is AI Assistant"),f=V(""),w=V(!1),_=V(""),A=V(null),P=V("");re(async()=>{await p.loadModelsForConfiguredProviders(),await v.loadVoicesForProvider(r.value)}),Z(r,async()=>{await p.loadModelsForConfiguredProviders(),await v.loadVoicesForProvider(r.value)});async function H(){if(!u.value.trim()&&!l.value||l.value&&!f.value.trim())return;if(!g.value){console.error("No model selected");return}if(!b.value){console.error("No voice selected");return}const z=p.getProviderInstance(r.value);if(!z){console.error("Failed to initialize speech provider");return}const s=p.getProviderConfig(r.value);w.value=!0,P.value="";try{_.value&&ee();const I=l.value?f.value:v.generateSSML(u.value,b.value,{...s,pitch:x.value}),J=await Ve({...z.speech(g.value,s),input:I,voice:b.value.id});_.value=URL.createObjectURL(new Blob([J])),setTimeout(()=>{A.value&&A.value.play()},100)}catch(I){console.error("Error generating speech:",I),P.value=I instanceof Error?I.message:"An unknown error occurred"}finally{w.value=!1}}function ee(){A.value&&(A.value.pause(),A.value.currentTime=0),_.value&&(URL.revokeObjectURL(_.value),_.value="")}ge(()=>{_.value&&URL.revokeObjectURL(_.value)});function ie(z){b.value={id:z,name:z,description:z,previewURL:z,languages:[{code:"en",title:"English"}],provider:r.value,gender:"male"}}function ue(z){g.value=z}return(z,s)=>{var J;const I=xe("motion");return i(),d(Q,null,[e("div",it,[e("div",ut,[e("div",null,[e("div",dt,[e("div",null,[e("h2",ct,y(t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",mt,[e("span",null,y(t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",vt,[t(m).length>0?(i(),d("fieldset",pt,[(i(!0),d(Q,null,W(t(m),c=>(i(),Y(t(Ce),{id:c.id,key:c.id,modelValue:t(r),"onUpdate:modelValue":s[0]||(s[0]=de=>F(r)?r.value=de:null),name:"speech-provider",value:c.id,title:c.localizedName||"Unknown",description:c.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(i(),d("div",ft,[S(t(he),{class:"flex items-center gap-3 rounded-lg p-4",border:"2 dashed neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-800",transition:"colors duration-200 ease-in-out",to:"/settings/providers"},{default:N(()=>s[13]||(s[13]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Speech Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your speech providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1,__:[13]})]))])]),e("div",null,[t(r)&&t(k)?(i(),d("div",gt,[e("div",xt,[e("div",null,[e("h2",ht,y(t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",bt,[e("span",null,y(t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(E)?(i(),d("div",yt,[s[14]||(s[14]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,y(t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(R)?(i(),d("div",kt,[s[15]||(s[15]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",wt,[e("span",_t,y(t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",St,y(t(R)),1)])])):t(C).length===0&&!t(E)?(i(),d("div",Vt,[s[16]||(s[16]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",Mt,[e("span",Ct,y(t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",$t,y(t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(C).length>0?(i(),Y(t(Me),{key:3,modelValue:t(g),"onUpdate:modelValue":s[1]||(s[1]=c=>F(g)?g.value=c:null),"search-query":t(L),"onUpdate:searchQuery":s[2]||(s[2]=c=>F(L)?L.value=c:null),items:t(C),searchable:!0,"search-placeholder":t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(L)}),"search-results-text":t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(a)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":ue},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):U("",!0)])])):U("",!0)])]),t(r)?(i(),d("div",Ut,[e("div",Pt,[s[27]||(s[27]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Voice Configuration "),e("div",{text:"neutral-400 dark:neutral-500"},[e("span",null,"Customize how your AI assistant speaks")])],-1)),t(h)?(i(),d("div",Lt,[e("div",qt,[S(t(j),{class:"w-full rounded-lg p-2.5 text-sm"},{default:N(()=>s[17]||(s[17]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[17]}),e("div",Et,[S(t(j),{class:"w-full rounded-lg p-4 text-sm"},{default:N(()=>s[18]||(s[18]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[18]}),S(t(j),{class:"w-full rounded-lg p-4 text-sm"},{default:N(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[19]}),S(t(j),{class:"w-full rounded-lg p-4 text-sm"},{default:N(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[20]})]),S(t(j),{class:"w-full rounded-lg p-3 text-sm"},{default:N(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[21]})])])):t(q)[t(r)]&&t(q)[t(r)].length>0?(i(),d("div",Rt,[S(t(nt),{"search-query":n.value,"onUpdate:searchQuery":s[3]||(s[3]=c=>n.value=c),"voice-id":t(M),"onUpdate:voiceId":s[4]||(s[4]=c=>F(M)?M.value=c:null),voices:(J=t(q)[t(r)])==null?void 0:J.map(c=>({id:c.id,name:c.name,description:c.description,previewURL:c.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(a)("settings.pages.modules.speech.sections.section.provider-voice-selection.pause"),"onUpdate:customValue":ie},null,8,["search-query","voice-id","voices","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text","play-button-text","pause-button-text"])])):t(B)?(i(),d("div",Tt,[s[23]||(s[23]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",At,[s[22]||(s[22]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",zt,y(t(B)),1)])])):(i(),d("div",Bt,s[24]||(s[24]=[e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No voices available"),e("span",{class:"text-sm text-amber-600 dark:text-amber-400"}," No voices were found for this provider. You can enter a custom voice name below. ")],-1)]))),e("div",Ft,[S(t(se),{modelValue:t(x),"onUpdate:modelValue":s[5]||(s[5]=c=>F(x)?x.value=c:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":c=>`${c}%`},null,8,["modelValue","format-value"]),S(t(le),{modelValue:t(T),"onUpdate:modelValue":s[6]||(s[6]=c=>F(T)?T.value=c:null),label:"Enable SSML",description:"Enable Speech Synthesis Markup Language for more control over speech output"},null,8,["modelValue"])]),!t(q)[t(r)]||t(q)[t(r)].length===0?(i(),d("div",Nt,[S(t(ke),{modelValue:t(M),"onUpdate:modelValue":s[7]||(s[7]=c=>F(M)?M.value=c:null),type:"text",label:"Voice ID",description:"Enter the voice ID for your custom voice",placeholder:"Enter voice name (e.g., 'Rachel', 'Josh')"},null,8,["modelValue"]),t(r)==="elevenlabs"?(i(),d("div",It,[s[26]||(s[26]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),O(e("select",{"onUpdate:modelValue":s[8]||(s[8]=c=>F(g)?g.value=c:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},s[25]||(s[25]=[e("option",{value:"eleven_monolingual_v1"}," Monolingual v1 ",-1),e("option",{value:"eleven_multilingual_v1"}," Multilingual v1 ",-1),e("option",{value:"eleven_multilingual_v2"}," Multilingual v2 ",-1)]),512),[[be,t(g)]])])):U("",!0),e("div",Dt,[S(t(se),{modelValue:t(x),"onUpdate:modelValue":s[9]||(s[9]=c=>F(x)?x.value=c:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":c=>`${c}%`},null,8,["modelValue","format-value"])])])):U("",!0)])])):U("",!0)]),e("div",jt,[e("div",Ot,[e("h2",Qt,[e("div",Ht,[S(t(ye)),e("div",null,y(t(a)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",Jt,[S(t(le),{modelValue:l.value,"onUpdate:modelValue":s[10]||(s[10]=c=>l.value=c),label:"Use Custom SSML",description:"Enable to input raw SSML instead of plain text"},null,8,["modelValue"]),l.value?O((i(),d("textarea",{key:1,"onUpdate:modelValue":s[12]||(s[12]=c=>f.value=c),placeholder:"Enter SSML text...",border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-48":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","font-mono":"","outline-none":""},null,512)),[[ne,f.value]]):(i(),Y(t(we),{key:0,modelValue:u.value,"onUpdate:modelValue":s[11]||(s[11]=c=>u.value=c),"h-24":"","w-full":"",placeholder:t(a)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder")},null,8,["modelValue","placeholder"])),e("div",Yt,[e("button",{border:"neutral-800 dark:neutral-200 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"",text:"neutral-100 dark:neutral-900","py-2":"","text-sm":"",disabled:w.value||!u.value.trim()&&!l.value||l.value&&!f.value.trim()||!t(b),class:$({"opacity-50 cursor-not-allowed":w.value||!u.value.trim()&&!l.value||l.value&&!f.value.trim()||!t(b)}),bg:"neutral-700 dark:neutral-300",onClick:H},[e("div",Wt,[s[28]||(s[28]=e("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),e("span",null,y(w.value?t(a)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(a)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Gt),_.value?(i(),d("button",{key:0,border:"primary-300 dark:primary-800 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"","py-2":"","text-sm":"",onClick:ee},s[29]||(s[29]=[e("div",{flex:"~ row","items-center":"","gap-2":""},[e("div",{"i-solar:stop-circle-bold-duotone":""}),e("span",null,"Stop")],-1)]))):U("",!0)]),_.value?(i(),d("audio",{key:2,ref_key:"audioPlayer",ref:A,src:_.value,controls:"",class:"mt-2 w-full"},null,8,Xt)):U("",!0)])])])]),O((i(),d("div",Kt,s[30]||(s[30]=[e("div",{text:"60","i-solar:user-speak-rounded-bold-duotone":""},null,-1)]))),[[I]])],64)}}});typeof oe=="function"&&oe(Zt);export{Zt as default}; diff --git a/assets/speech-D8cCufg2.js b/assets/speech-D8cCufg2.js deleted file mode 100644 index e116e4ee613e0c29b3aee887c5d7354881e4030f..0000000000000000000000000000000000000000 --- a/assets/speech-D8cCufg2.js +++ /dev/null @@ -1,2 +0,0 @@ -import{a4 as te,c9 as g,e as b,f as p,w as P,T as re}from"./index-D7HCX4VR.js";import{r as ne,a as ae,b as oe,d as se}from"./index-LHmcipjy.js";import{u as ce}from"./providers-DepZj6_J.js";const ie=/["&'<>`]/g,ue=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,le=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,de=/[|\\{}()[\]^$+*?.]/g,U=new WeakMap;function D(e,t){if(e=e.replace(t.subset?me(t.subset):ie,n),t.subset||t.escapeOnly)return e;return e.replace(ue,r).replace(le,n);function r(a,s,l){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,l.charCodeAt(s+2),t)}function n(a,s,l){return t.format(a.charCodeAt(0),l.charCodeAt(s+1),t)}}function me(e){let t=U.get(e);return t||(t=fe(e),U.set(e,t)),t}function fe(e){const t=[];let r=-1;for(;++r",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},be=["cent","copy","divide","gt","lt","not","para","times"],j={}.hasOwnProperty,L={};let S;for(S in C)j.call(C,S)&&(L[C[S]]=S);const Se=/[^\dA-Za-z]/;function xe(e,t,r,n){const a=String.fromCharCode(e);if(j.call(L,a)){const s=L[a],l="&"+s;return r&&ye.includes(s)&&!be.includes(s)&&(!n||t&&t!==61&&Se.test(String.fromCharCode(t)))?l:l+";"}return""}function Ee(e,t,r){let n=pe(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=xe(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const s=ve(e,t,r.omitOptionalSemicolons);s.length(e.fetch??globalThis.fetch)(ne("audio/speech",e.baseURL),{body:oe(e),headers:ae({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(se).then(async t=>t.arrayBuffer()),qe=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function y(e,t,r){const n=Pe(e);return r?n.replace(r,a):a(n);function a(s){return Ae(s,{subset:t})}}function Pe(e){return String(e||"").replace(qe,"")}const Ce=/]]>/g,Te=[">"];function Le(e){return""}function Me(e){return""}const Re=[" ",` -`," ",'"',"&","'","/","<","=",">"];function x(e){return y(e,Re)}function M(e,t){const r=String(e);let n=t.options.quote||'"';if(t.options.quoteSmart){const a=n==='"'?"'":'"';F(r,n)>F(r,a)&&(n=a)}return n+y(r,["<","&",n])+n}function $e(e,t){const r=x(e.name),n=e.public,a=e.system;let s=""}const Ue={}.hasOwnProperty;function Fe(e,t){const r=x(e.name),n=k(e,t),a=e.attributes||{},s=n?!1:t.options.closeEmptyElements,l=[];let h;for(h in a)if(Ue.call(a,h)){const f=a[h];f!=null&&l.push(x(h)+"="+M(f,t))}return"<"+r+(l.length===0?"":" "+l.join(" "))+(s?(t.options.tightClose?"":" ")+"/":"")+">"+n+(s?"":"")}const Ne=/\?>/g,De=[">"];function je(e){const t=x(e.name)||"x",r=y(e.value,De,Ne);return""}const Ie=["&","<"];function I(e){return y(e.value,Ie)}function ze(e,t){return t.options.allowDangerousXml?e.value:I(e)}const ke={}.hasOwnProperty,N={cdata:Le,comment:Me,doctype:$e,element:Fe,instruction:je,raw:ze,root:k,text:I};function z(e,t){const r=e&&e.type;if(!r)throw new Error("Expected node, not `"+e+"`");if(!ke.call(N,r))throw new Error("Cannot compile unknown node `"+r+"`");const n=N[r];return n(e,t)}function k(e,t){const r=e&&e.children||[];let n=-1;const a=[];for(;++n{const e=ce(),t=g("settings/speech/active-provider",""),r=g("settings/speech/active-model","eleven_multilingual_v2"),n=g("settings/speech/voice",""),a=b(),s=g("settings/speech/pitch",0),l=g("settings/speech/rate",1),h=g("settings/speech/ssml-enabled",!1),f=b(!1),E=b(null),v=b({}),B=g("settings/speech/language","en-US"),w=b(""),H=p(()=>e.availableProviders.filter(o=>O(o)).map(o=>e.getProviderMetadata(o))),V=p(()=>{var o;return((o=e.getProviderMetadata(t.value))==null?void 0:o.capabilities.listModels)!==void 0}),A=p(()=>e.getModelsForProvider(t.value)),Y=p(()=>e.isLoadingModels[t.value]||!1),X=p(()=>e.modelLoadError[t.value]||null),G=p(()=>{if(!w.value.trim())return A.value;const o=w.value.toLowerCase().trim();return A.value.filter(c=>c.name.toLowerCase().includes(o)||c.id.toLowerCase().includes(o)||c.description&&c.description.toLowerCase().includes(o))}),_=p(()=>["elevenlabs","microsoft-speech","azure-speech","google","alibaba-cloud-model-studio","volcengine"].includes(t.value));function O(o){return["elevenlabs","microsoft-speech","azure-speech","google","amazon","alibaba-cloud-model-studio","volcengine"].includes(o)}async function q(o){var c,i;if(!o||!O(o))return[];f.value=!0,E.value=null;try{const u=await((i=(c=e.getProviderMetadata(o).capabilities).listVoices)==null?void 0:i.call(c,e.getProviderConfig(o)))||[];return v.value[o]=u,u}catch(u){return console.error(`Error fetching voices for ${o}:`,u),E.value=u instanceof Error?u.message:"Unknown error",[]}finally{f.value=!1}}function K(o){return v.value[o]||[]}P(t,async o=>{o&&await q(o)}),re(()=>{q(t.value).then(()=>{var o;n.value&&(a.value=(o=v.value[t.value])==null?void 0:o.find(c=>c.id===n.value))})}),P(n,o=>{var c;o&&(a.value=(c=v.value[t.value])==null?void 0:c.find(i=>i.id===o))},{immediate:!0}),P(v,o=>{var c;n.value&&(a.value=(c=o[t.value])==null?void 0:c.find(i=>i.id===n.value))},{immediate:!0});async function Q(o,c,i,u,m={}){return await Oe({...o.speech(c,{...m}),input:i,voice:u})}function Z(o,c,i){var $;const u=i==null?void 0:i.pitch,m=i==null?void 0:i.speed,d=i==null?void 0:i.volume,W={pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},J=T("speak",{version:"1.0",xmlns:"http://www.w3.org/2001/10/synthesis","xml:lang":(($=c.languages[0])==null?void 0:$.code)||"en-US"},[T("voice",{name:c.id,gender:c.gender||"neutral"},[Object.entries(W).filter(([Ve,ee])=>ee!=null).length>0?T("prosody",{pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},[o]):o])]);return Be(J)}return{activeSpeechProvider:t,activeSpeechModel:r,activeSpeechVoice:a,activeSpeechVoiceId:n,pitch:s,rate:l,ssmlEnabled:h,selectedLanguage:B,isLoadingSpeechProviderVoices:f,speechProviderError:E,availableVoices:v,modelSearchQuery:w,availableSpeechProvidersMetadata:H,supportsSSML:_,supportsModelListing:V,providerModels:A,isLoadingActiveProviderModels:Y,activeProviderModelError:X,filteredModels:G,speech:Q,loadVoicesForProvider:q,getVoicesForProvider:K,generateSSML:Z,isSpeechProvider:O}});export{F as c,Oe as g,_e as s,Ke as u}; diff --git a/assets/speech-DzfbHcH_.js b/assets/speech-DzfbHcH_.js new file mode 100644 index 0000000000000000000000000000000000000000..7741b13f226aab1f8bfed969bd07576fccef7758 --- /dev/null +++ b/assets/speech-DzfbHcH_.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{generateSpeech as ce,useProvidersStore as le,useSpeechStore as ue}from"./stores-mOXXrrXB.js";import{Skeleton_default as _}from"./Button-BUWHo0FI.js";import{FieldCheckbox_default as v,FieldInput_default as de,FieldRange_default as y}from"./src-bHDRqBSs.js";import"./Basic-BA5ubWIJ.js";import{Textarea_default as fe}from"./Textarea-C0dnrt_L.js";import{RadioCardManySelect_default as pe,RadioCardSimple_default as me,TestDummyMarker_default as he,VoiceCardManySelect_default as ge}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as b}from"./route-block-DNPbw0zT.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-B8Pazang.css b/assets/src-B8Pazang.css new file mode 100644 index 0000000000000000000000000000000000000000..f362833d317ec0a90046b175aeda39623dd57185 --- /dev/null +++ b/assets/src-B8Pazang.css @@ -0,0 +1 @@ +.form_input-range[data-v-c59a94f0]{--height:2em;min-height:var(--height);-webkit-appearance:none;-moz-appearance:none;appearance:none;--thumb-width:4px;--thumb-height:var(--height);--thumb-box-shadow:0 0 0px #e6e6e6;--thumb-border:none;--thumb-border-radius:999px;--thumb-background:oklch(80% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--thumb-background-hover:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--thumb-background-active:oklch(70% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--track-height:calc(var(--height) - var(--track-value-padding)*2);--track-box-shadow:none;--track-border:solid 2px #eee;--track-border-radius:6px;--track-background:#eee;--track-background-hover:#eee;--track-background-active:#eee;--track-value-background:#fff;--track-value-background-hover:#fff;--track-value-background-active:#fff;--track-value-padding:2px;background:0 0;border-radius:4px;transition:background-color .2s}.dark .form_input-range[data-v-c59a94f0]{--thumb-background:oklch(70% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--thumb-background-hover:oklch(90% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--thumb-background-active:oklch(80% var(--chromatic-chroma-200)calc(var(--chromatic-hue) + 0));--track-border:solid 2px #2c2c2c;--track-background:#2c2c2c;--track-background-hover:#2c2c2c;--track-background-active:#2c2c2c;--track-value-background:#a4a4a4;--track-value-background-hover:#a4a4a4;--track-value-background-active:#a4a4a4}.form_input-range.slider-progress[data-v-c59a94f0]{--range:calc(var(--max) - var(--min));--ratio:calc((var(--value) - var(--min))/var(--range));--sx:calc(.5*0em + var(--ratio)*(100% - 0em))}.form_input-range[data-v-c59a94f0]:focus{outline:none}.form_input-range[data-v-c59a94f0]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:calc(var(--track-height)*.5 - var(--thumb-height)*.5 - 2px);margin-left:calc(0 - var(--track-value-padding));cursor:col-resize;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s ease-in-out}.form_input-range[data-v-c59a94f0]::-webkit-slider-runnable-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);box-shadow:var(--track-box-shadow);cursor:col-resize;transition:box-shadow .2s ease-in-out,border-color .2s ease-in-out;position:relative}.form_input-range[data-v-c59a94f0]::-webkit-slider-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-c59a94f0]:hover::-webkit-slider-runnable-track{background:var(--track-background-hover)}.form_input-range[data-v-c59a94f0]::-webkit-slider-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-c59a94f0]:active::-webkit-slider-runnable-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-c59a94f0]::-webkit-slider-runnable-track{margin-right:calc(0 - var(--track-value-padding));background:linear-gradient(var(--track-value-background),var(--track-value-background))0/var(--sx)100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-c59a94f0]:hover::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover))0/var(--sx)100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-c59a94f0]:active::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active))0/var(--sx)100% no-repeat,var(--track-background-active)}.form_input-range[data-v-c59a94f0]::-moz-range-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);box-shadow:var(--thumb-box-shadow);cursor:col-resize;margin-left:calc(0 - var(--track-value-padding));border:none}.form_input-range[data-v-c59a94f0]::-moz-range-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);box-shadow:var(--track-box-shadow);cursor:col-resize;width:calc(100% - var(--track-value-padding)*2)}.form_input-range[data-v-c59a94f0]::-moz-range-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-c59a94f0]:hover::-moz-range-track{background:var(--track-background-hover)}.form_input-range[data-v-c59a94f0]::-moz-range-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-c59a94f0]:active::-moz-range-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-c59a94f0]::-moz-range-track{background:linear-gradient(var(--track-value-background),var(--track-value-background))0/var(--sx)100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-c59a94f0]:hover::-moz-range-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover))0/var(--sx)100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-c59a94f0]:active::-moz-range-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active))0/var(--sx)100% no-repeat,var(--track-background-active)}.form_input-range[data-v-c59a94f0]::-ms-fill-upper{background:0 0;border-color:#0000}.form_input-range[data-v-c59a94f0]::-ms-fill-lower{background:0 0;border-color:#0000}.form_input-range[data-v-c59a94f0]::-ms-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:0;margin-left:calc(0 - var(--track-value-padding));box-sizing:border-box;cursor:col-resize}.form_input-range[data-v-c59a94f0]::-ms-track{height:var(--track-height);border-radius:var(--track-border-radius);background:var(--track-background);border:var(--track-border);box-shadow:var(--track-box-shadow);box-sizing:border-box;cursor:col-resize}.form_input-range[data-v-c59a94f0]::-ms-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-c59a94f0]:hover::-ms-track{background:var(--track-background-hover)}.form_input-range[data-v-c59a94f0]::-ms-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-c59a94f0]:active::-ms-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-c59a94f0]::-ms-fill-lower{height:var(--track-height);border-radius:var(--track-border-radius)0 0 var(--track-border-radius);background:var(--track-value-background);margin:0;margin-left:calc(var(--track-value-padding));margin-right:calc(0 - var(--track-value-padding));border:none;border-right-width:0}.form_input-range.slider-progress[data-v-c59a94f0]:hover::-ms-fill-lower{background:var(--track-value-background-hover)}.form_input-range.slider-progress[data-v-c59a94f0]:active::-ms-fill-lower{background:var(--track-value-background-active)}.color-hue-range[data-v-ae80cb9d]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(90deg,#ffb2cb,#ffba76,#bedf0d,#00efd2,#90d7ff,#d8bfff,#ffb2cb);background:linear-gradient(90deg,color(display-p3 1.1215 .595378 .781922),color(display-p3 1.09855 .68498 .251398),color(display-p3 .770516 .871468 .284878),color(display-p3 .170102 .947674 .829549),color(display-p3 .372107 .846211 1.22764),color(display-p3 .856305 .680188 1.20214),color(display-p3 1.1215 .595378 .781922));background:linear-gradient(90deg,lab(80.0841% 65.3995 .860357),lab(81.7178% 42.879 86.4545),lab(84.2289% -27.648 80.2367),lab(85.1086% -71.1664 -.472653),lab(82.2823% -19.2763 -62.1951),lab(79.7314% 41.9269 -62.2558),lab(80.0841% 65.3994 .860381));border-radius:.5rem;height:2.5rem}.color-hue-range[data-v-ae80cb9d]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;--un-border-opacity:1;border-width:2px;border-color:rgb(115 115 115/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity));background-color:rgb(38 38 38/var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);width:.25rem;height:3rem;box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-radius:.375rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dark .color-hue-range[data-v-ae80cb9d]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;--un-border-opacity:1;border-width:2px;border-color:rgb(255 255 255/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity));background-color:rgb(212 212 212/var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);width:.25rem;height:3rem;box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-radius:.375rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.color-hue-range[data-v-ae80cb9d]::-moz-range-thumb{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;--un-border-opacity:1;border-width:2px;border-color:rgb(115 115 115/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(82 82 82/var(--un-bg-opacity));background-color:rgb(38 38 38/var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset)0 10px 15px -3px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 4px 6px -4px var(--un-shadow-color,#0000001a);width:.25rem;height:3rem;box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-radius:.375rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dark .color-hue-range[data-v-ae80cb9d]::-moz-range-thumb{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;--un-border-opacity:1;border-width:2px;border-color:rgb(255 255 255/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(245 245 245/var(--un-bg-opacity));background-color:rgb(212 212 212/var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset)0 4px 6px -1px var(--un-shadow-color,#0000001a),var(--un-shadow-inset)0 2px 4px -2px var(--un-shadow-color,#0000001a);width:.25rem;height:3rem;box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-radius:.375rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.resize-observer[data-v-b329ee4c]{z-index:-1;pointer-events:none;opacity:0;background-color:#0000;border:none;width:100%;height:100%;display:block;position:absolute;top:0;left:0;overflow:hidden}.resize-observer[data-v-b329ee4c] object{pointer-events:none;z-index:-1;width:100%;height:100%;display:block;position:absolute;top:0;left:0;overflow:hidden}.v-popper__popper{z-index:10000;outline:none;top:0;left:0}.v-popper__arrow-container{display:none}.v-popper__inner{border:none!important} diff --git a/assets/src-bHDRqBSs.js b/assets/src-bHDRqBSs.js new file mode 100644 index 0000000000000000000000000000000000000000..808c5586ffe718b45d0a1bc64413698970d16af5 --- /dev/null +++ b/assets/src-bHDRqBSs.js @@ -0,0 +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-BtAisBe9.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-PXC-MtyN.js b/assets/stage-PXC-MtyN.js new file mode 100644 index 0000000000000000000000000000000000000000..4039b5dba17bd232287b25e6cf2bb2babd3bf00a --- /dev/null +++ b/assets/stage-PXC-MtyN.js @@ -0,0 +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-BtAisBe9.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-Rs4XkZYw.js b/assets/stage-Rs4XkZYw.js deleted file mode 100644 index 005f6e60d471047bdb4dfa03f1556dfba76c59ec..0000000000000000000000000000000000000000 --- a/assets/stage-Rs4XkZYw.js +++ /dev/null @@ -1 +0,0 @@ -import{d as p,a1 as s,c,b as d,a2 as i,a3 as m,u as e,o as l}from"./index-D7HCX4VR.js";const x=p({__name:"stage",setup(u){const{top:t,right:a,bottom:o,left:n}=s();return(f,_)=>{const r=i("RouterView");return l(),c("main",{text:"gray-700 dark:gray-200","h-full":"","font-cuteen":"",style:m({paddingTop:`${e(t)}px`,paddingRight:`${e(a)}px`,paddingBottom:`${e(o)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; diff --git a/assets/stores-mOXXrrXB.js b/assets/stores-mOXXrrXB.js new file mode 100644 index 0000000000000000000000000000000000000000..3df71203fa87cd129fe82dcae6b70c095b280e10 --- /dev/null +++ b/assets/stores-mOXXrrXB.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{computed as t,computedAsync as n,defineStore as r,defu 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-BtAisBe9.js";import{toJsonSchema as f}from"./index-CISmcbXk-s07e23Qe.js";import{arrayType as p,booleanType as m,numberType as h,objectType as g,stringType as _,unionType as v}from"./types-D50Xq0so.js";import{asyncIteratorFromReadableStream as y,ccount as b,stringifyEntitiesLight as x,useLlmmarkerParser as S}from"./composables-DnqWi3UL.js";import{useQueue as C}from"./queue-BZUURX31.js";import{system_v2_default as w}from"./queues-U6a2FwNq.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-DQi82Mjd.js";import{isWebGPUSupported as ne}from"./webgpu-Cnn5XZ2r.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=r(`AudioContext`,()=>{let e=new AudioContext;return{audioContext:e,calculateVolume:ae}}),se=r(`SpeakingStore`,()=>{let e=30,n=100,r=o(0),i=o(!1),a=t(()=>i.value?(e+(n-e)*r.value)/100:e);return{mouthOpenSize:r,nowSpeaking:i,nowSpeakingAvatarBorderOpacity:a}}),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`}},ce=[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({})})],le=async()=>Promise.all(ce);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,ue;const de=`__TAURI_TO_IPC_KEY__`;function fe(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}var pe=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=fe(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,de)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[de]()}};async function R(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}ue=new WeakMap;async function me(e,t){await R(`plugin:mcp|connect_server`,{command:e,args:t})}async function he(){await R(`plugin:mcp|disconnect_server`)}async function ge(){return await R(`plugin:mcp|list_tools`)}async function _e(e,t){return await R(`plugin:mcp|call_tool`,{name:e,args:t})}const ve=[j({name:`mcp_list_tools`,description:`List all tools available on the MCP server`,execute:async(e,t)=>await ge(),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 me(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 he(),`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 _e(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`)})})],ye=async()=>Promise.all(ve),be=r(`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 ye(),...await le()],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})}),xe=e=>({image:t=>Object.assign(e,{model:t})}),V=e=>({model:()=>e}),Se=e=>({speech:t=>Object.assign(e,{model:t})}),Ce=e=>({transcription:t=>Object.assign(e,{model:t})}),H=(e,t)=>({metadata:{id:e,...t}}),U=(...e)=>Object.assign(e[0],...e.slice(1)),we=(e,t=`https://api.anthropic.com/v1/`)=>U(H(`anthropic`),z({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),Te=(e,t=`https://api.deepseek.com/`)=>U(H(`deepseek`),z({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),Ee=(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})),De=(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})),Oe=(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})),ke=(e,t=`https://api.moonshot.cn/v1/`)=>U(H(`moonshot`),z({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),Ae=(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}),xe({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t}),Se({apiKey:e,baseURL:t}),Ce({apiKey:e,baseURL:t})),je=(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})),Me=(e,t=`https://api.perplexity.ai/`)=>U(H(`perplexity`),z({apiKey:e,baseURL:t})),Ne=(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`}))})),Pe=(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}))},Fe=(e,t=`https://api.x.ai/v1/`)=>U(H(`xai`),z({apiKey:e,baseURL:t}),V({apiKey:e,baseURL:t})),G=(e=`http://localhost:11434/v1/`)=>U(H(`ollama`),z({baseURL:e}),B({baseURL:e}),V({baseURL:e})),Ie=(e=`http://localhost:4315/v1/`)=>U(H(`player2`),z({baseURL:e})),K=(...e)=>Object.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 Le=e=>e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`),J=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[Le(e),t])),Re=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),ze=(e,t)=>Re({Authorization:t===void 0?void 0:`Bearer ${t}`,...e}),Be=(e,t)=>{let n=t.toString();return new URL(e,n.endsWith(`/`)?n:`${n}/`)},Ve=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},He=async e=>Ve(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 Ue=(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)},We=(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)},Ge=(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)},Ke=(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)(Be(e.query?`api/voices?${e.query}`:`api/voices`,e.baseURL),{headers:ze({...e.headers},e.apiKey),method:`GET`,signal:e.abortSignal}).then(He).then(({voices:e})=>e);const qe=[{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=r(`providers`,()=>{let e=u(`settings/credentials/providers`,{}),{t:r}=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=>je(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=>we(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=>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:`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=>Fe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...Fe(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=>Te(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...Te(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=>Ue(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>qe.map(e=>({id:e.model_id,name:e.name,provider:`elevenlabs`,description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{let t=Ue(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=>We(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=We(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=>Ke(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{let t=Ke(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=>Ge(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{let t=Ge(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=>Ne(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await A({...Ne(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=>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:`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=>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:`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=>Ie(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=>Pe(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=>Me(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=>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:`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=>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:`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=t(()=>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=t(()=>{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 t=a[e];if(!t)throw Error(`Provider metadata for ${e} not found`);return{...t,localizedName:r(t.nameKey,t.name),localizedDescription:r(t.descriptionKey,t.description)}}let C=t(()=>Object.values(a).map(e=>({...e,localizedName:r(e.nameKey,e.name),localizedDescription:r(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=n(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=t(()=>T.value.filter(e=>e.category===`chat`)),D=t(()=>T.value.filter(e=>e.category===`speech`)),O=t(()=>T.value.filter(e=>e.category===`transcription`)),k=t(()=>E.value.filter(e=>c.value[e.id])),ee=t(()=>D.value.filter(e=>c.value[e.id])),te=t(()=>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}}),Je=r(`consciousness`,()=>{let e=X(),n=u(`settings/consciousness/active-provider`,``),r=u(`settings/consciousness/active-model`,``),i=u(`settings/consciousness/active-custom-model`,``),a=o({}),s=o(``),c=t(()=>{var t;return(t=e.getProviderMetadata(n.value))?.capabilities.listModels!==void 0}),l=t(()=>e.getModelsForProvider(n.value)),f=t(()=>e.isLoadingModels[n.value]||!1),p=t(()=>e.modelLoadError[n.value]||null),m=t(()=>{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(t){var r;t&&(r=e.getProviderMetadata(n.value))?.capabilities.listModels!==void 0&&e.getModelsForProvider(t).length===0&&await e.fetchModelsForProvider(t)}let _;return d(n,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:n,activeModel:r,customModelName:i,expandedDescriptions:a,modelSearchQuery:s,supportsModelListing:c,providerModels:l,isLoadingActiveProviderModels:f,activeProviderModelError:p,filteredModels:m,resetModelSelection:h,loadModelsForProvider:g}}),Ye=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()),Xe=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function Z(e,t,n){let r=Ze(e);return n?r.replace(n,i):i(r);function i(e){return x(e,{subset:t})}}function Ze(e){return String(e||``).replace(Xe,``)}const Qe=/]]>/g,$e=[`>`];function et(e){return``}function tt(e){return``}const nt=[` `,` +`,` `,`"`,`&`,`'`,`/`,`<`,`=`,`>`];function Q(e){return Z(e,nt)}function rt(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 it(e,t){let n=Q(e.name),r=e.public,i=e.system,a=``}const at={}.hasOwnProperty;function ot(e,t){let n=Q(e.name),r=gt(e,t),i=e.attributes||{},a=r?!1:t.options.closeEmptyElements,o=[],s;for(s in i)if(at.call(i,s)){let e=i[s];e!=null&&o.push(Q(s)+`=`+rt(e,t))}return`<`+n+(o.length===0?``:` `+o.join(` `))+(a?(t.options.tightClose?``:` `)+`/`:``)+`>`+r+(a?``:``)}const st=/\?>/g,ct=[`>`];function lt(e){let t=Q(e.name)||`x`,n=Z(e.value,ct,st);return``}const ut=[`&`,`<`];function dt(e){return Z(e.value,ut)}function ft(e,t){return t.options.allowDangerousXml?e.value:dt(e)}const pt={}.hasOwnProperty,mt={cdata:et,comment:tt,doctype:it,element:ot,instruction:lt,raw:ft,root:gt,text:dt};function ht(e,t){let n=e&&e.type;if(!n)throw Error("Expected node, not `"+e+"`");if(!pt.call(mt,n))throw Error("Cannot compile unknown node `"+n+"`");let r=mt[n],i=r(e,t);return i}function gt(e,t){let n=e&&e.children||[],r=-1,i=[];for(;++r{let e=X(),n=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=t(()=>e.availableProviders.filter(e=>T(e)).map(t=>e.getProviderMetadata(t))),y=t(()=>{var t;return(t=e.getProviderMetadata(n.value))?.capabilities.listModels!==void 0}),b=t(()=>e.getModelsForProvider(n.value)),x=t(()=>e.isLoadingModels[n.value]||!1),S=t(()=>e.modelLoadError[n.value]||null),C=t(()=>{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=t(()=>[`elevenlabs`,`microsoft-speech`,`azure-speech`,`google`,`alibaba-cloud-model-studio`,`volcengine`].includes(n.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(n,async e=>{e&&await E(e)}),a(()=>{E(n.value).then(()=>{var e;i.value&&(s.value=(e=h.value[n.value])?.find(e=>e.id===i.value))})}),d(i,e=>{var t;e&&(s.value=(t=h.value[n.value])?.find(t=>t.id===e))},{immediate:!0}),d(h,e=>{var t;i.value&&(s.value=(t=e[n.value])?.find(e=>e.id===i.value))},{immediate:!0});async function O(e,t,n,r,i={}){let a=await Ye({...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=vt(`speak`,{version:`1.0`,xmlns:`http://www.w3.org/2001/10/synthesis`,"xml:lang":(r=t.languages[0])?.code||`en-US`},[vt(`voice`,{name:t.id,gender:t.gender||`neutral`},[Object.entries(s).filter(([e,t])=>t!=null).length>0?vt(`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 _t(c)}return{activeSpeechProvider:n,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}}),xt=r(`airi-card`,()=>{let e=u(`airi-cards`,new Map),n=u(`airi-card-active-id`,`default`),r=t(()=>e.value.get(n.value)),i=Je(),o=bt(),{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:n,addCard:m,removeCard:h,getCard:g,currentModels:t(()=>({consciousness:{model:c.value},speech:{model:p.value,voice_id:f.value}})),systemPrompt:t(()=>{let e=r.value;if(!e)return``;let t=[e.systemPrompt,e.description,e.personality].filter(Boolean);return t.join(` +`)})}}),St=r(`chat`,()=>{let{stream:e}=be(),{systemPrompt:t}=s(xt()),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 b(e){d.value.push(e)}function x(e){f.value.push(e)}function w(e){p.value.push(e)}let T=o([{role:`system`,content:t.value}]),E=o({role:`assistant`,content:``,slices:[],tool_results:[]});async function D(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);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=C({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:[]},T.value.push({role:`user`,content:t}),T.value.push(E.value);let g=T.value.slice(0,T.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 b=``;for await(let e of y(v.textStream,async e=>e))h.add({type:`text`,text:e}),b+=e;await m.end();for(let e of f.value)await e();for(let e of p.value)await e(b);console.debug(`LLM output:`,b)}catch(e){throw console.error(`Error sending message:`,e),e}finally{n.value=!1}}return{sending:n,messages:T,streamingMessage:E,send:D,onBeforeMessageComposed:m,onAfterMessageComposed:h,onBeforeSend:g,onAfterSend:_,onTokenLiteral:v,onTokenSpecial:b,onStreamEnd:x,onAssistantResponseEnd:w}}),Ct=r(`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}}),wt=globalThis.WebSocket;function Tt(e){return new Promise(t=>setTimeout(t,e))}var Et=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=i(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 Tt(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 wt(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 Dt=r(`server`,()=>{let e=o();a(()=>{e.value=new Et({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{Ye as generateSpeech,xt as useAiriCardStore,oe as useAudioContext,St as useChatStore,Je as useConsciousnessStore,X as useProvidersStore,se as useSpeakingStore,bt as useSpeechStore}; \ No newline at end of file diff --git a/assets/sury-DmrZ3_Oj-DN8QUD-4.js b/assets/sury-DmrZ3_Oj-DN8QUD-4.js new file mode 100644 index 0000000000000000000000000000000000000000..6030f6cc5721654a6d35e0046c9ba910ab4d8a4e --- /dev/null +++ b/assets/sury-DmrZ3_Oj-DN8QUD-4.js @@ -0,0 +1 @@ +import{__vitePreload as e}from"./index-BtAisBe9.js";import{tryImport as t}from"./index-CISmcbXk-s07e23Qe.js";const n=async()=>{let{toJSONSchema:n}=await t(e(()=>import(`./__vite-optional-peer-dep_sury_xsschema-B_lOmKXZ.js`),[]),`sury`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/sury-DmrZ3_Oj-f8xnWriW.js b/assets/sury-DmrZ3_Oj-f8xnWriW.js deleted file mode 100644 index ba2b42c548f99fc0169c8ad08dcebdd33271c8fe..0000000000000000000000000000000000000000 --- a/assets/sury-DmrZ3_Oj-f8xnWriW.js +++ /dev/null @@ -1 +0,0 @@ -import{cT as r}from"./index-D7HCX4VR.js";import{t as a}from"./mcp-DgU0tpf-.js";const s=async()=>{const{toJSONSchema:t}=await a(r(()=>import("./__vite-optional-peer-dep_sury_xsschema-BIHI7g3E.js"),[]),"sury");return o=>t(o)};export{s as getToJsonSchemaFn}; diff --git a/assets/three-vrm.module-DiGxQJqt.js b/assets/three-vrm.module-DiGxQJqt.js deleted file mode 100644 index 93018fcfff0bb9dc66b9aa9a5eff282e09015aed..0000000000000000000000000000000000000000 --- a/assets/three-vrm.module-DiGxQJqt.js +++ /dev/null @@ -1,2775 +0,0 @@ -import{cU as getAugmentedNamespace,ai as Color,ah as Vector2,ap as Vector3,at as Object3D,bx as Euler,a_ as AnimationClip,ar as Quaternion,b5 as NumberKeyframeTrack,aX as MathUtils,b6 as QuaternionKeyframeTrack,ao as Matrix4,cV as Matrix3,aI as Material,bu as BackSide,aV as Group,aM as MeshBasicMaterial,aL as DoubleSide,aQ as Mesh,aJ as LineBasicMaterial,aR as LineSegments,cW as ImageLoader,bt as ShaderMaterial,cX as TangentSpaceNormalMap,bv as UniformsUtils,cY as UniformsLib,aw as BufferAttribute,cZ as DynamicDrawUsage,aO as BufferGeometry,aS as Line,aP as SkinnedMesh,c_ as GLBufferAttribute,aZ as Skeleton,c$ as AxesHelper,bJ as REVISION}from"./index-D7HCX4VR.js";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 f=1;ffetch(r).then(c=>c.arrayBuffer());return defaultModelFetcher.defaultModelFetcher=f,defaultModelFetcher}var frameProcessor={},logging={},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.log=f.LOG_PREFIX=void 0,f.LOG_PREFIX="[VAD]";const r=["error","debug","warn"];function c(l){return(...m)=>{console[l](f.LOG_PREFIX,...m)}}const d=r.reduce((l,m)=>(l[m]=c(m),l),{});f.log=d}(logging)),logging}var messages={},hasRequiredMessages;function requireMessages(){if(hasRequiredMessages)return messages;hasRequiredMessages=1,Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0;var f;return function(r){r.AudioFrame="AUDIO_FRAME",r.SpeechStart="SPEECH_START",r.VADMisfire="VAD_MISFIRE",r.SpeechEnd="SPEECH_END",r.SpeechStop="SPEECH_STOP",r.SpeechRealStart="SPEECH_REAL_START",r.FrameProcessed="FRAME_PROCESSED"}(f||(messages.Message=f={})),messages}var hasRequiredFrameProcessor;function requireFrameProcessor(){if(hasRequiredFrameProcessor)return frameProcessor;hasRequiredFrameProcessor=1,Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const f=requireLogging(),r=requireMessages(),c=[512,1024,1536];frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1};function d(s){c.includes(s.frameSamples)||f.log.warn("You are using an unusual frame size"),(s.positiveSpeechThreshold<0||s.positiveSpeechThreshold>1)&&f.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(s.negativeSpeechThreshold<0||s.negativeSpeechThreshold>s.positiveSpeechThreshold)&&f.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),s.preSpeechPadFrames<0&&f.log.error("preSpeechPadFrames should be positive"),s.redemptionFrames<0&&f.log.error("redemptionFrames should be positive")}frameProcessor.validateOptions=d;const l=s=>{const h=s.reduce((a,o)=>(a.push(a.at(-1)+o.length),a),[0]),p=new Float32Array(h.at(-1));return s.forEach((a,o)=>{const t=h[o];p.set(a,t)}),p};class m{constructor(h,p,a){this.modelProcessFunc=h,this.modelResetFunc=p,this.options=a,this.speaking=!1,this.redemptionCounter=0,this.speechFrameCount=0,this.active=!1,this.speechRealStartFired=!1,this.reset=()=>{this.speaking=!1,this.speechRealStartFired=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0,this.speechFrameCount=0},this.pause=o=>{this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment(o):this.reset()},this.resume=()=>{this.active=!0},this.endSegment=o=>{const t=this.audioBuffer;this.audioBuffer=[];const e=this.speaking;if(this.reset(),e)if(t.reduce((i,u)=>u.isSpeech?i+1:i,0)>=this.options.minSpeechFrames){const i=l(t.map(u=>u.frame));o({msg:r.Message.SpeechEnd,audio:i})}else o({msg:r.Message.VADMisfire});return{}},this.process=async(o,t)=>{if(!this.active)return;const e=await this.modelProcessFunc(o),n=e.isSpeech>=this.options.positiveSpeechThreshold;if(t({probs:e,msg:r.Message.FrameProcessed,frame:o}),this.audioBuffer.push({frame:o,isSpeech:n}),n&&(this.speechFrameCount++,this.redemptionCounter=0),n&&!this.speaking&&(this.speaking=!0,t({msg:r.Message.SpeechStart})),this.speaking&&this.speechFrameCount===this.options.minSpeechFrames&&!this.speechRealStartFired&&(this.speechRealStartFired=!0,t({msg:r.Message.SpeechRealStart})),e.isSpeech=this.options.redemptionFrames){this.redemptionCounter=0,this.speechFrameCount=0,this.speaking=!1,this.speechRealStartFired=!1;const i=this.audioBuffer;if(this.audioBuffer=[],i.reduce((g,b)=>b.isSpeech?g+1:g,0)>=this.options.minSpeechFrames){const g=l(i.map(b=>b.frame));t({msg:r.Message.SpeechEnd,audio:g})}else t({msg:r.Message.VADMisfire})}if(!this.speaking){for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();this.speechFrameCount=0}},this.audioBuffer=[],this.reset()}}return frameProcessor.FrameProcessor=m,frameProcessor}var nonRealTimeVad={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(f,r,c)=>{if(r&&typeof r.init=="function"&&typeof r.createSessionHandler=="function"){const d=backends[f];if(d===void 0)backends[f]={backend:r,priority:c};else{if(d.priority>c)return;if(d.priority===c&&d.backend!==r)throw new Error(`cannot register backend "${f}" using priority ${c}`)}if(c>=0){const l=backendsSortedByPriority.indexOf(f);l!==-1&&backendsSortedByPriority.splice(l,1);for(let m=0;m{const r=f.length===0?backendsSortedByPriority:f,c=[];for(const d of r){const l=backends[d];if(l){if(l.initialized)return l.backend;if(l.aborted)continue;const m=!!l.initPromise;try{return m||(l.initPromise=l.backend.init()),await l.initPromise,l.initialized=!0,l.backend}catch(s){m||c.push({name:d,err:s}),l.aborted=!0}finally{delete l.initPromise}}}throw new Error(`no available backend found. ERR: ${c.map(d=>`[${d.name}] ${d.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(r){if(r!==void 0){if(typeof r!="string"||["verbose","info","warning","error","fatal"].indexOf(r)===-1)throw new Error(`Unsupported logging level: ${r}`);this.logLevelInternal=r}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=f=>{let r=1;for(let c=0;c{const t=document.createElement("canvas"),e=t.getContext("2d");if(!r||!e)return o();const n=new Image;n.crossOrigin="Anonymous",n.src=r,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const i=e.getImageData(0,0,t.width,t.height);if(c!==void 0){if(c.height!==void 0&&c.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(p.height=t.height,c.width!==void 0&&c.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");p.width=t.width}else p.height=t.height,p.width=t.width;a(St.bufferToTensor(i.data,p))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(h!==void 0)return St.bufferToTensor(h,p);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(r){var c,d;const l=document.createElement("canvas").getContext("2d");let m;if(l!=null){const s=this.dims[3],h=this.dims[2],p=this.dims[1],a=r!==void 0&&r.format!==void 0?r.format:"RGB",o=r!==void 0&&((c=r.norm)===null||c===void 0?void 0:c.mean)!==void 0?r.norm.mean:255,t=r!==void 0&&((d=r.norm)===null||d===void 0?void 0:d.bias)!==void 0?r.norm.bias:0,e=h*s;if(r!==void 0){if(r.height!==void 0&&r.height!==h)throw new Error("Image output config height doesn't match tensor height");if(r.width!==void 0&&r.width!==s)throw new Error("Image output config width doesn't match tensor width");if(r.format!==void 0&&p===4&&r.format!=="RGBA"||p===3&&r.format!=="RGB"&&r.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let i=0,u=1,g=2,b=3,y=0,_=e,v=e*2,w=-1;a==="RGBA"?(y=0,_=e,v=e*2,w=e*3):a==="RGB"?(y=0,_=e,v=e*2):a==="RBG"&&(y=0,v=e,_=e*2),m=l.createImageData(s,h);for(let T=0;T"u")throw new Error(`input '${a}' is missing in 'feeds'.`);if(s)for(const a of this.outputNames)l[a]=null;const h=await this.handler.run(r,l,m),p={};for(const a in h)Object.hasOwnProperty.call(h,a)&&(p[a]=new Tensor(h[a].type,h[a].data,h[a].dims));return p}static async create(r,c,d,l){let m,s={};if(typeof r=="string"){if(m=r,typeof c=="object"&&c!==null)s=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(m=r,typeof c=="object"&&c!==null)s=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const t=r;let e=0,n=r.byteLength;if(typeof c=="object"&&c!==null)s=c;else if(typeof c=="number"){if(e=c,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=t.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${t.byteLength}).`);if(n=r.byteLength-e,typeof d=="number"){if(n=d,!Number.isSafeInteger(n))throw new RangeError("'byteLength' must be an integer.");if(n<=0||e+n>t.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${t.byteLength-e}].`);if(typeof l=="object"&&l!==null)s=l;else if(typeof l<"u")throw new TypeError("'options' must be an object.")}else if(typeof d<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof c<"u")throw new TypeError("'options' must be an object.");m=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const p=(s.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),o=await(await resolveBackend(p)).createSessionHandler(m,s);return new fn(o)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! -* ONNX Runtime Web v1.14.0 -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. -*/var hasRequiredOrtWeb_min;function requireOrtWeb_min(){return hasRequiredOrtWeb_min||(hasRequiredOrtWeb_min=1,function(module,exports){(function(f,r){module.exports=r(require$$0)})(self,__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(f,r,c)=>{var d,l=(d=(d=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(m){function s(){return Y.buffer!=te&&Ae(Y.buffer),he}function h(){return Y.buffer!=te&&Ae(Y.buffer),Me}function p(){return Y.buffer!=te&&Ae(Y.buffer),Te}function a(){return Y.buffer!=te&&Ae(Y.buffer),ue}function o(){return Y.buffer!=te&&Ae(Y.buffer),xe}var t,e,n;m=m||{},t||(t=m!==void 0?m:{}),t.ready=new Promise(function(S,O){e=S,n=O});var i,u,g,b,y,_,v=Object.assign({},t),w="./this.program",T=(S,O)=>{throw O},A=typeof window=="object",E=typeof importScripts=="function",x=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",M=t.ENVIRONMENT_IS_PTHREAD||!1,C="";function k(S){return t.locateFile?t.locateFile(S,C):C+S}if(x){let S;C=E?c(908).dirname(C)+"/":"//",_=()=>{y||(b=c(1384),y=c(908))},i=function(O,I){return _(),O=y.normalize(O),b.readFileSync(O,I?void 0:"utf8")},g=O=>((O=i(O,!0)).buffer||(O=new Uint8Array(O)),O),u=(O,I,L)=>{_(),O=y.normalize(O),b.readFile(O,function(B,z){B?L(B):I(z.buffer)})},1{if(je())throw process.exitCode=O,I;I instanceof Ke||U("exiting due to exception: "+I),process.exit(O)},t.inspect=function(){return"[Emscripten Module object]"};try{S=c(9925)}catch(O){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),O}c.g.Worker=S.Worker}else(A||E)&&(E?C=self.location.href:typeof document<"u"&&document.currentScript&&(C=document.currentScript.src),d&&(C=d),C=C.indexOf("blob:")!==0?C.substr(0,C.replace(/[?#].*/,"").lastIndexOf("/")+1):"",x||(i=S=>{var O=new XMLHttpRequest;return O.open("GET",S,!1),O.send(null),O.responseText},E&&(g=S=>{var O=new XMLHttpRequest;return O.open("GET",S,!1),O.responseType="arraybuffer",O.send(null),new Uint8Array(O.response)}),u=(S,O,I)=>{var L=new XMLHttpRequest;L.open("GET",S,!0),L.responseType="arraybuffer",L.onload=()=>{L.status==200||L.status==0&&L.response?O(L.response):I()},L.onerror=I,L.send(null)}));x&&typeof performance>"u"&&(c.g.performance=c(6953).performance);var V=console.log.bind(console),F=console.warn.bind(console);x&&(_(),V=S=>b.writeSync(1,S+` -`),F=S=>b.writeSync(2,S+` -`));var q,D=t.print||V,U=t.printErr||F;Object.assign(t,v),v=null,t.thisProgram&&(w=t.thisProgram),t.quit&&(T=t.quit),t.wasmBinary&&(q=t.wasmBinary);var J=t.noExitRuntime||!1;typeof WebAssembly!="object"&&le("no native wasm support detected");var Y,Z,te,he,Me,Te,ue,xe,_e=!1,Le=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(S,O,I){var L=(O>>>=0)+I;for(I=O;S[I]&&!(I>=L);)++I;if(16(B=(240&B)==224?(15&B)<<12|z<<6|Q:(7&B)<<18|z<<12|Q<<6|63&S[O++])?L+=String.fromCharCode(B):(B-=65536,L+=String.fromCharCode(55296|B>>10,56320|1023&B))}}else L+=String.fromCharCode(B)}return L}function Se(S,O){return(S>>>=0)?ze(h(),S,O):""}function De(S,O,I,L){if(!(0>>=0;L=I+L-1;for(var z=0;z=Q&&(Q=65536+((1023&Q)<<10)|1023&S.charCodeAt(++z)),127>=Q){if(I>=L)break;O[I++>>>0]=Q}else{if(2047>=Q){if(I+1>=L)break;O[I++>>>0]=192|Q>>6}else{if(65535>=Q){if(I+2>=L)break;O[I++>>>0]=224|Q>>12}else{if(I+3>=L)break;O[I++>>>0]=240|Q>>18,O[I++>>>0]=128|Q>>12&63}O[I++>>>0]=128|Q>>6&63}O[I++>>>0]=128|63&Q}}return O[I>>>0]=0,I-B}function Re(S){for(var O=0,I=0;I=L?O++:2047>=L?O+=2:55296<=L&&57343>=L?(O+=4,++I):O+=3}return O}function Ae(S){te=S,t.HEAP8=he=new Int8Array(S),t.HEAP16=new Int16Array(S),t.HEAP32=Te=new Int32Array(S),t.HEAPU8=Me=new Uint8Array(S),t.HEAPU16=new Uint16Array(S),t.HEAPU32=ue=new Uint32Array(S),t.HEAPF32=new Float32Array(S),t.HEAPF64=xe=new Float64Array(S)}M&&(te=t.buffer);var we=t.INITIAL_MEMORY||16777216;if(M)Y=t.wasmMemory,te=t.buffer;else if(t.wasmMemory)Y=t.wasmMemory;else if(!((Y=new WebAssembly.Memory({initial:we/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw U("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"),x&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Y&&(te=Y.buffer),we=te.byteLength,Ae(te);var ke,Ue=[],Be=[],We=[],qe=[];function je(){return J||!1}function Ve(){var S=t.preRun.shift();Ue.unshift(S)}var Ee,$e=0,Ye=null;function le(S){throw M?postMessage({cmd:"onAbort",arg:S}):t.onAbort&&t.onAbort(S),U(S="Aborted("+S+")"),_e=!0,S=new WebAssembly.RuntimeError(S+". Build with -sASSERTIONS for more info."),n(S),S}function pt(){return Ee.startsWith("data:application/octet-stream;base64,")}function ut(){var S=Ee;try{if(S==Ee&&q)return new Uint8Array(q);if(g)return g(S);throw"both async and sync fetching of the wasm failed"}catch(O){le(O)}}Ee="ort-wasm-threaded.wasm",pt()||(Ee=k(Ee));var It={};function Ke(S){this.name="ExitStatus",this.message="Program terminated with exit("+S+")",this.status=S}function He(S){(S=ie.Vb[S])||le(),ie.mc(S)}function lt(S){var O=ie.Cc();if(!O)return 6;ie.ac.push(O),ie.Vb[S.Ub]=O,O.Ub=S.Ub;var I={cmd:"run",start_routine:S.Ic,arg:S.zc,pthread_ptr:S.Ub};return O.$b=()=>{I.time=performance.now(),O.postMessage(I,S.Nc)},O.loaded&&(O.$b(),delete O.$b),0}function Ce(S){if(M)return K(1,1,S);je()||(ie.oc(),t.onExit&&t.onExit(S),_e=!0),T(S,new Ke(S))}function nt(S,O){if(!O&&M)throw Et(S),"unwind";je()||M||(Xt(),Je(We),Yt(0),kt[1].length&&Vt(1,10),kt[2].length&&Vt(2,10),ie.oc()),Ce(S)}var ie={Yb:[],ac:[],qc:[],Vb:{},fc:function(){M&&ie.Ec()},Pc:function(){},Ec:function(){ie.receiveObjectTransfer=ie.Gc,ie.threadInitTLS=ie.pc,ie.setExitStatus=ie.nc,J=!1},nc:function(){},oc:function(){for(var S of Object.values(ie.Vb))ie.mc(S);for(S of ie.Yb)S.terminate();ie.Yb=[]},mc:function(S){var O=S.Ub;delete ie.Vb[O],ie.Yb.push(S),ie.ac.splice(ie.ac.indexOf(S),1),S.Ub=0,Ut(O)},Gc:function(){},pc:function(){ie.qc.forEach(S=>S())},Fc:function(S,O){S.onmessage=I=>{var L=(I=I.data).cmd;if(S.Ub&&(ie.Bc=S.Ub),I.targetThread&&I.targetThread!=Ct()){var B=ie.Vb[I.Qc];B?B.postMessage(I,I.transferList):U('Internal error! Worker sent a message "'+L+'" to target pthread '+I.targetThread+", but that thread no longer exists!")}else L==="processProxyingQueue"?N(I.queue):L==="spawnThread"?lt(I):L==="cleanupThread"?He(I.thread):L==="killThread"?(I=I.thread,L=ie.Vb[I],delete ie.Vb[I],L.terminate(),Ut(I),ie.ac.splice(ie.ac.indexOf(L),1),L.Ub=0):L==="cancelThread"?ie.Vb[I.thread].postMessage({cmd:"cancel"}):L==="loaded"?(S.loaded=!0,O&&O(S),S.$b&&(S.$b(),delete S.$b)):L==="print"?D("Thread "+I.threadId+": "+I.text):L==="printErr"?U("Thread "+I.threadId+": "+I.text):L==="alert"?alert("Thread "+I.threadId+": "+I.text):I.target==="setimmediate"?S.postMessage(I):L==="onAbort"?t.onAbort&&t.onAbort(I.arg):L&&U("worker sent an unknown command "+L);ie.Bc=void 0},S.onerror=I=>{throw U("worker sent an error! "+I.filename+":"+I.lineno+": "+I.message),I},x&&(S.on("message",function(I){S.onmessage({data:I})}),S.on("error",function(I){S.onerror(I)}),S.on("detachedExit",function(){})),S.postMessage({cmd:"load",urlOrBlob:t.mainScriptUrlOrBlob||d,wasmMemory:Y,wasmModule:Z})},yc:function(){var S=k("ort-wasm-threaded.worker.js");ie.Yb.push(new Worker(S))},Cc:function(){return ie.Yb.length==0&&(ie.yc(),ie.Fc(ie.Yb[0])),ie.Yb.pop()}};function Je(S){for(;0>2>>>0];S=p()[S+48>>2>>>0],en(O,O-S),ce(O)};var Xe=[];function ye(S){var O=Xe[S];return O||(S>=Xe.length&&(Xe.length=S+1),Xe[S]=O=ke.get(S)),O}t.invokeEntryPoint=function(S,O){S=ye(S)(O),je()?ie.nc(S):Jt(S)};var rt,ct,it=[],oe=0,re=0;function se(S){this.Zb=S,this.Sb=S-24,this.xc=function(O){a()[this.Sb+4>>2>>>0]=O},this.bc=function(){return a()[this.Sb+4>>2>>>0]},this.wc=function(O){a()[this.Sb+8>>2>>>0]=O},this.Dc=function(){return a()[this.Sb+8>>2>>>0]},this.rc=function(){p()[this.Sb>>2>>>0]=0},this.hc=function(O){O=O?1:0,s()[this.Sb+12>>0>>>0]=O},this.uc=function(){return s()[this.Sb+12>>0>>>0]!=0},this.ic=function(O){O=O?1:0,s()[this.Sb+13>>0>>>0]=O},this.kc=function(){return s()[this.Sb+13>>0>>>0]!=0},this.fc=function(O,I){this.cc(0),this.xc(O),this.wc(I),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(p(),this.Sb>>2,1)},this.Hc=function(){return Atomics.sub(p(),this.Sb>>2,1)===1},this.cc=function(O){a()[this.Sb+16>>2>>>0]=O},this.tc=function(){return a()[this.Sb+16>>2>>>0]},this.vc=function(){if(tn(this.bc()))return a()[this.Zb>>2>>>0];var O=this.tc();return O!==0?O:this.Zb}}function ft(S){return qt(new se(S).Sb)}function et(S,O,I,L){return M?K(3,1,S,O,I,L):mt(S,O,I,L)}function mt(S,O,I,L){if(typeof SharedArrayBuffer>"u")return U("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var B=[];return M&&B.length===0?et(S,O,I,L):(S={Ic:I,Ub:S,zc:L,Nc:B},M?(S.Oc="spawnThread",postMessage(S,B),0):lt(S))}function gt(S,O,I){return M?K(4,1,S,O,I):0}function bt(S,O){if(M)return K(5,1,S,O)}function dt(S,O){if(M)return K(6,1,S,O)}function yt(S,O,I){if(M)return K(7,1,S,O,I)}function _t(S,O,I){return M?K(8,1,S,O,I):0}function vt(S,O){if(M)return K(9,1,S,O)}function wt(S,O,I){if(M)return K(10,1,S,O,I)}function xt(S,O,I,L){if(M)return K(11,1,S,O,I,L)}function ot(S,O,I,L){if(M)return K(12,1,S,O,I,L)}function ht(S,O,I,L){if(M)return K(13,1,S,O,I,L)}function Tt(S){if(M)return K(14,1,S)}function P(S,O){if(M)return K(15,1,S,O)}function R(S,O,I){if(M)return K(16,1,S,O,I)}function N(S){Atomics.store(p(),S>>2,1),Ct()&&Kt(S),Atomics.compareExchange(p(),S>>2,1,0)}function $(S){return a()[S>>>2]+4294967296*p()[S+4>>>2]}function j(S,O,I,L,B,z){return M?K(17,1,S,O,I,L,B,z):-52}function H(S,O,I,L,B,z){if(M)return K(18,1,S,O,I,L,B,z)}function X(S){var O=Re(S)+1,I=$t(O);return I&&De(S,s(),I,O),I}function ee(S,O,I){function L(me){return(me=me.toTimeString().match(/\(([A-Za-z ]+)\)$/))?me[1]:"GMT"}if(M)return K(19,1,S,O,I);var B=new Date().getFullYear(),z=new Date(B,0,1),Q=new Date(B,6,1);B=z.getTimezoneOffset();var ne=Q.getTimezoneOffset(),fe=Math.max(B,ne);p()[S>>2>>>0]=60*fe,p()[O>>2>>>0]=+(B!=ne),S=L(z),O=L(Q),S=X(S),O=X(O),ne>2>>>0]=S,a()[I+4>>2>>>0]=O):(a()[I>>2>>>0]=O,a()[I+4>>2>>>0]=S)}function K(S,O){var I=arguments.length-2,L=arguments;return At(()=>{for(var B=Bt(8*I),z=B>>3,Q=0;Q>>0]=ne}return Zt(S,I,B,O)})}t.executeNotifiedProxyingQueue=N,ct=x?()=>{var S=process.hrtime();return 1e3*S[0]+S[1]/1e6}:M?()=>performance.now()-t.__performance_now_clock_drift:()=>performance.now();var ae,ve=[],Fe={};function Ne(){if(!ae){var S,O={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:w||"./this.program"};for(S in Fe)Fe[S]===void 0?delete O[S]:O[S]=Fe[S];var I=[];for(S in O)I.push(S+"="+O[S]);ae=I}return ae}function G(S,O){if(M)return K(20,1,S,O);var I=0;return Ne().forEach(function(L,B){var z=O+I;for(B=a()[S+4*B>>2>>>0]=z,z=0;z>0>>>0]=L.charCodeAt(z);s()[B>>0>>>0]=0,I+=L.length+1}),0}function ge(S,O){if(M)return K(21,1,S,O);var I=Ne();a()[S>>2>>>0]=I.length;var L=0;return I.forEach(function(B){L+=B.length+1}),a()[O>>2>>>0]=L,0}function Oe(S){return M?K(22,1,S):52}function Qe(S,O,I,L){return M?K(23,1,S,O,I,L):52}function st(S,O,I,L,B){return M?K(24,1,S,O,I,L,B):70}var kt=[null,[],[]];function Vt(S,O){var I=kt[S];O===0||O===10?((S===1?D:U)(ze(I,0)),I.length=0):I.push(O)}function zt(S,O,I,L){if(M)return K(25,1,S,O,I,L);for(var B=0,z=0;z>2>>>0],ne=a()[O+4>>2>>>0];O+=8;for(var fe=0;fe>>0]);B+=ne}return a()[L>>2>>>0]=B,0}var Ge=0;function Dt(S){return S%4==0&&(S%100!=0||S%400==0)}var Ht=[31,29,31,30,31,30,31,31,30,31,30,31],Gt=[31,28,31,30,31,30,31,31,30,31,30,31];function Wt(S,O,I,L){function B(W,be,Pe){for(W=typeof W=="number"?W.toString():W||"";W.lengthOt?-1:0at-W.getDate())){W.setDate(W.getDate()+be);break}be-=at-W.getDate()+1,W.setDate(1),11>Pe?W.setMonth(Pe+1):(W.setMonth(0),W.setFullYear(W.getFullYear()+1))}return Pe=new Date(W.getFullYear()+1,0,4),be=ne(new Date(W.getFullYear(),0,4)),Pe=ne(Pe),0>=Q(be,W)?0>=Q(Pe,W)?W.getFullYear()+1:W.getFullYear():W.getFullYear()-1}var me=p()[L+40>>2>>>0];for(var Ie in L={Lc:p()[L>>2>>>0],Kc:p()[L+4>>2>>>0],dc:p()[L+8>>2>>>0],jc:p()[L+12>>2>>>0],ec:p()[L+16>>2>>>0],Xb:p()[L+20>>2>>>0],Tb:p()[L+24>>2>>>0],Wb:p()[L+28>>2>>>0],Rc:p()[L+32>>2>>>0],Jc:p()[L+36>>2>>>0],Mc:me?Se(me):""},I=Se(I),me={"%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"})I=I.replace(new RegExp(Ie,"g"),me[Ie]);var tt="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Ze="January February March April May June July August September October November December".split(" ");for(Ie in me={"%a":function(W){return tt[W.Tb].substring(0,3)},"%A":function(W){return tt[W.Tb]},"%b":function(W){return Ze[W.ec].substring(0,3)},"%B":function(W){return Ze[W.ec]},"%C":function(W){return z((W.Xb+1900)/100|0,2)},"%d":function(W){return z(W.jc,2)},"%e":function(W){return B(W.jc,2," ")},"%g":function(W){return fe(W).toString().substring(2)},"%G":function(W){return fe(W)},"%H":function(W){return z(W.dc,2)},"%I":function(W){return(W=W.dc)==0?W=12:12W.dc?"AM":"PM"},"%S":function(W){return z(W.Lc,2)},"%t":function(){return" "},"%u":function(W){return W.Tb||7},"%U":function(W){return z(Math.floor((W.Wb+7-W.Tb)/7),2)},"%V":function(W){var be=Math.floor((W.Wb+7-(W.Tb+6)%7)/7);if(2>=(W.Tb+371-W.Wb-2)%7&&be++,be)be==53&&((Pe=(W.Tb+371-W.Wb)%7)==4||Pe==3&&Dt(W.Xb)||(be=1));else{be=52;var Pe=(W.Tb+7-W.Wb-1)%7;(Pe==4||Pe==5&&Dt(W.Xb%400-1))&&be++}return z(be,2)},"%w":function(W){return W.Tb},"%W":function(W){return z(Math.floor((W.Wb+7-(W.Tb+6)%7)/7),2)},"%y":function(W){return(W.Xb+1900).toString().substring(2)},"%Y":function(W){return W.Xb+1900},"%z":function(W){var be=0<=(W=W.Jc);return W=Math.abs(W)/60,(be?"+":"-")+("0000"+(W/60*100+W%60)).slice(-4)},"%Z":function(W){return W.Mc},"%%":function(){return"%"}},I=I.replace(/%%/g,"\0\0"),me)I.includes(Ie)&&(I=I.replace(new RegExp(Ie,"g"),me[Ie](L)));return Ie=function(W){var be=Array(Re(W)+1);return De(W,be,0,be.length),be}(I=I.replace(/\0\0/g,"%")),Ie.length>O?0:(function(W,be){s().set(W,be>>>0)}(Ie,S),Ie.length-1)}ie.fc();var Tn=[null,Ce,Et,et,gt,bt,dt,yt,_t,vt,wt,xt,ot,ht,Tt,P,R,j,H,ee,G,ge,Oe,Qe,st,zt],Sn={b:function(S){return $t(S+24)+24},n:function(S){return(S=new se(S)).uc()||(S.hc(!0),oe--),S.ic(!1),it.push(S),S.sc(),S.vc()},ma:function(S){throw U("Unexpected exception thrown, this is not properly supported - aborting"),_e=!0,S},x:function(){pe(0);var S=it.pop();if(S.Hc()&&!S.kc()){var O=S.Dc();O&&ye(O)(S.Zb),ft(S.Zb)}re=0},e:function(){var S=re;if(!S)return Ge=0;var O=new se(S);O.cc(S);var I=O.bc();if(!I)return Ge=0,S;for(var L=Array.prototype.slice.call(arguments),B=0;BN(L));else if(M)postMessage({targetThread:S,cmd:"processProxyingQueue",queue:L});else{if(!(S=ie.Vb[S]))return;S.postMessage({cmd:"processProxyingQueue",queue:L})}return 1},Ea:function(){return-1},Pa:function(S,O){S=new Date(1e3*$(S)),p()[O>>2>>>0]=S.getUTCSeconds(),p()[O+4>>2>>>0]=S.getUTCMinutes(),p()[O+8>>2>>>0]=S.getUTCHours(),p()[O+12>>2>>>0]=S.getUTCDate(),p()[O+16>>2>>>0]=S.getUTCMonth(),p()[O+20>>2>>>0]=S.getUTCFullYear()-1900,p()[O+24>>2>>>0]=S.getUTCDay(),S=(S.getTime()-Date.UTC(S.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,p()[O+28>>2>>>0]=S},Qa:function(S,O){S=new Date(1e3*$(S)),p()[O>>2>>>0]=S.getSeconds(),p()[O+4>>2>>>0]=S.getMinutes(),p()[O+8>>2>>>0]=S.getHours(),p()[O+12>>2>>>0]=S.getDate(),p()[O+16>>2>>>0]=S.getMonth(),p()[O+20>>2>>>0]=S.getFullYear()-1900,p()[O+24>>2>>>0]=S.getDay();var I=new Date(S.getFullYear(),0,1),L=(S.getTime()-I.getTime())/864e5|0;p()[O+28>>2>>>0]=L,p()[O+36>>2>>>0]=-60*S.getTimezoneOffset(),L=new Date(S.getFullYear(),6,1).getTimezoneOffset(),S=0|(L!=(I=I.getTimezoneOffset())&&S.getTimezoneOffset()==Math.min(I,L)),p()[O+32>>2>>>0]=S},Ra:function(S){var O=new Date(p()[S+20>>2>>>0]+1900,p()[S+16>>2>>>0],p()[S+12>>2>>>0],p()[S+8>>2>>>0],p()[S+4>>2>>>0],p()[S>>2>>>0],0),I=p()[S+32>>2>>>0],L=O.getTimezoneOffset(),B=new Date(O.getFullYear(),0,1),z=new Date(O.getFullYear(),6,1).getTimezoneOffset(),Q=B.getTimezoneOffset(),ne=Math.min(Q,z);return 0>I?p()[S+32>>2>>>0]=+(z!=Q&&ne==L):0>2>>>0]=O.getDay(),I=(O.getTime()-B.getTime())/864e5|0,p()[S+28>>2>>>0]=I,p()[S>>2>>>0]=O.getSeconds(),p()[S+4>>2>>>0]=O.getMinutes(),p()[S+8>>2>>>0]=O.getHours(),p()[S+12>>2>>>0]=O.getDate(),p()[S+16>>2>>>0]=O.getMonth(),O.getTime()/1e3|0},Aa:j,Ba:H,Sa:function S(O,I,L){S.Ac||(S.Ac=!0,ee(O,I,L))},y:function(){le("")},U:function(){if(!x&&!E){var S="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";rt||(rt={}),rt[S]||(rt[S]=1,x&&(S="warning: "+S),U(S))}},ra:function(){return 4294901760},B:ct,Ia:function(S,O,I){h().copyWithin(S>>>0,O>>>0,O+I>>>0)},F:function(){return x?c(3993).cpus().length:navigator.hardwareConcurrency},Da:function(S,O,I){ve.length=O,I>>=3;for(var L=0;L>>0];return(0>S?It[-S-1]:Tn[S]).apply(null,ve)},qa:function(S){var O=h().length;if((S>>>=0)<=O||4294901760=I;I*=2){var L=O*(1+.2/I);L=Math.min(L,S+100663296);var B=Math;L=Math.max(S,L),B=B.min.call(B,4294901760,L+(65536-L%65536)%65536);e:{try{Y.grow(B-te.byteLength+65535>>>16),Ae(Y.buffer);var z=1;break e}catch{}z=void 0}if(z)return!0}return!1},Na:function(){throw"unwind"},Ga:G,Ha:ge,J:nt,I:Oe,S:Qe,ga:st,R:zt,d:function(){return Ge},na:function S(O,I){S.lc||(S.lc=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var B=new Uint8Array(1);return()=>(crypto.getRandomValues(B),B[0])}if(x)try{var z=c(Object(function(){var Q=new Error("Cannot find module 'crypto'");throw Q.code="MODULE_NOT_FOUND",Q}()));return()=>z.randomBytes(1)[0]}catch{}return()=>le("randomDevice")}());for(var L=0;L>0>>>0]=S.lc();return 0},ia:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},ja:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},K:function(S){var O=de();try{return ye(S)()}catch(I){if(ce(O),I!==I+0)throw I;pe(1,0)}},f:function(S,O){var I=de();try{return ye(S)(O)}catch(L){if(ce(I),L!==L+0)throw L;pe(1,0)}},P:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},Q:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},k:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},p:function(S,O,I,L){var B=de();try{return ye(S)(O,I,L)}catch(z){if(ce(B),z!==z+0)throw z;pe(1,0)}},q:function(S,O,I,L,B){var z=de();try{return ye(S)(O,I,L,B)}catch(Q){if(ce(z),Q!==Q+0)throw Q;pe(1,0)}},N:function(S,O,I,L,B,z){var Q=de();try{return ye(S)(O,I,L,B,z)}catch(ne){if(ce(Q),ne!==ne+0)throw ne;pe(1,0)}},s:function(S,O,I,L,B,z){var Q=de();try{return ye(S)(O,I,L,B,z)}catch(ne){if(ce(Q),ne!==ne+0)throw ne;pe(1,0)}},w:function(S,O,I,L,B,z,Q){var ne=de();try{return ye(S)(O,I,L,B,z,Q)}catch(fe){if(ce(ne),fe!==fe+0)throw fe;pe(1,0)}},L:function(S,O,I,L,B,z,Q,ne){var fe=de();try{return ye(S)(O,I,L,B,z,Q,ne)}catch(me){if(ce(fe),me!==me+0)throw me;pe(1,0)}},E:function(S,O,I,L,B,z,Q,ne,fe,me,Ie,tt){var Ze=de();try{return ye(S)(O,I,L,B,z,Q,ne,fe,me,Ie,tt)}catch(W){if(ce(Ze),W!==W+0)throw W;pe(1,0)}},aa:function(S,O,I,L,B,z,Q,ne){var fe=de();try{return dn(S,O,I,L,B,z,Q,ne)}catch(me){if(ce(fe),me!==me+0)throw me;pe(1,0)}},_:function(S,O,I,L,B,z,Q){var ne=de();try{return rn(S,O,I,L,B,z,Q)}catch(fe){if(ce(ne),fe!==fe+0)throw fe;pe(1,0)}},Z:function(S,O,I,L,B){var z=de();try{return hn(S,O,I,L,B)}catch(Q){if(ce(z),Q!==Q+0)throw Q;pe(1,0)}},ca:function(S,O,I,L){var B=de();try{return ln(S,O,I,L)}catch(z){if(ce(B),z!==z+0)throw z;pe(1,0)}},$:function(S){var O=de();try{return nn(S)}catch(I){if(ce(O),I!==I+0)throw I;pe(1,0)}},ba:function(S,O){var I=de();try{return cn(S,O)}catch(L){if(ce(I),L!==L+0)throw L;pe(1,0)}},Y:function(S,O,I){var L=de();try{return on(S,O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},g:function(S){var O=de();try{ye(S)()}catch(I){if(ce(O),I!==I+0)throw I;pe(1,0)}},r:function(S,O){var I=de();try{ye(S)(O)}catch(L){if(ce(I),L!==L+0)throw L;pe(1,0)}},i:function(S,O,I){var L=de();try{ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},ha:function(S,O,I,L){var B=de();try{ye(S)(O,I,L)}catch(z){if(ce(B),z!==z+0)throw z;pe(1,0)}},m:function(S,O,I,L){var B=de();try{ye(S)(O,I,L)}catch(z){if(ce(B),z!==z+0)throw z;pe(1,0)}},v:function(S,O,I,L,B){var z=de();try{ye(S)(O,I,L,B)}catch(Q){if(ce(z),Q!==Q+0)throw Q;pe(1,0)}},u:function(S,O,I,L,B,z){var Q=de();try{ye(S)(O,I,L,B,z)}catch(ne){if(ce(Q),ne!==ne+0)throw ne;pe(1,0)}},O:function(S,O,I,L,B,z,Q){var ne=de();try{ye(S)(O,I,L,B,z,Q)}catch(fe){if(ce(ne),fe!==fe+0)throw fe;pe(1,0)}},A:function(S,O,I,L,B,z,Q,ne){var fe=de();try{ye(S)(O,I,L,B,z,Q,ne)}catch(me){if(ce(fe),me!==me+0)throw me;pe(1,0)}},ka:function(S,O,I,L,B,z,Q,ne,fe){var me=de();try{ye(S)(O,I,L,B,z,Q,ne,fe)}catch(Ie){if(ce(me),Ie!==Ie+0)throw Ie;pe(1,0)}},C:function(S,O,I,L,B,z,Q,ne,fe,me,Ie){var tt=de();try{ye(S)(O,I,L,B,z,Q,ne,fe,me,Ie)}catch(Ze){if(ce(tt),Ze!==Ze+0)throw Ze;pe(1,0)}},D:function(S,O,I,L,B,z,Q,ne,fe,me,Ie,tt,Ze,W,be,Pe){var at=de();try{ye(S)(O,I,L,B,z,Q,ne,fe,me,Ie,tt,Ze,W,be,Pe)}catch(Ot){if(ce(at),Ot!==Ot+0)throw Ot;pe(1,0)}},fa:function(S,O,I,L,B,z,Q,ne){var fe=de();try{sn(S,O,I,L,B,z,Q,ne)}catch(me){if(ce(fe),me!==me+0)throw me;pe(1,0)}},da:function(S,O,I,L,B,z,Q,ne,fe,me,Ie,tt){var Ze=de();try{un(S,O,I,L,B,z,Q,ne,fe,me,Ie,tt)}catch(W){if(ce(Ze),W!==W+0)throw W;pe(1,0)}},ea:function(S,O,I,L,B,z){var Q=de();try{an(S,O,I,L,B,z)}catch(ne){if(ce(Q),ne!==ne+0)throw ne;pe(1,0)}},o:function(S){return S},a:Y||t.wasmMemory,G:function(S){Ge=S},la:Wt,z:function(S,O,I,L){return Wt(S,O,I,L)}};(function(){function S(B,z){t.asm=B.exports,ie.qc.push(t.asm.sb),ke=t.asm.ub,Be.unshift(t.asm.Va),Z=z,M||($e--,t.monitorRunDependencies&&t.monitorRunDependencies($e),$e==0&&Ye&&(B=Ye,Ye=null,B()))}function O(B){S(B.instance,B.module)}function I(B){return function(){if(!q&&(A||E)){if(typeof fetch=="function"&&!Ee.startsWith("file://"))return fetch(Ee,{credentials:"same-origin"}).then(function(z){if(!z.ok)throw"failed to load wasm binary file at '"+Ee+"'";return z.arrayBuffer()}).catch(function(){return ut()});if(u)return new Promise(function(z,Q){u(Ee,function(ne){z(new Uint8Array(ne))},Q)})}return Promise.resolve().then(function(){return ut()})}().then(function(z){return WebAssembly.instantiate(z,L)}).then(function(z){return z}).then(B,function(z){U("failed to asynchronously prepare wasm: "+z),le(z)})}var L={a:Sn};if(M||($e++,t.monitorRunDependencies&&t.monitorRunDependencies($e)),t.instantiateWasm)try{return t.instantiateWasm(L,S)}catch(B){return U("Module.instantiateWasm callback failed with error: "+B),!1}(q||typeof WebAssembly.instantiateStreaming!="function"||pt()||Ee.startsWith("file://")||x||typeof fetch!="function"?I(O):fetch(Ee,{credentials:"same-origin"}).then(function(B){return WebAssembly.instantiateStreaming(B,L).then(O,function(z){return U("wasm streaming compile failed: "+z),U("falling back to ArrayBuffer instantiation"),I(O)})})).catch(n)})(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.Va).apply(null,arguments)},t._OrtInit=function(){return(t._OrtInit=t.asm.Wa).apply(null,arguments)},t._OrtCreateSessionOptions=function(){return(t._OrtCreateSessionOptions=t.asm.Xa).apply(null,arguments)},t._OrtAppendExecutionProvider=function(){return(t._OrtAppendExecutionProvider=t.asm.Ya).apply(null,arguments)},t._OrtAddSessionConfigEntry=function(){return(t._OrtAddSessionConfigEntry=t.asm.Za).apply(null,arguments)},t._OrtReleaseSessionOptions=function(){return(t._OrtReleaseSessionOptions=t.asm._a).apply(null,arguments)},t._OrtCreateSession=function(){return(t._OrtCreateSession=t.asm.$a).apply(null,arguments)},t._OrtReleaseSession=function(){return(t._OrtReleaseSession=t.asm.ab).apply(null,arguments)},t._OrtGetInputCount=function(){return(t._OrtGetInputCount=t.asm.bb).apply(null,arguments)},t._OrtGetOutputCount=function(){return(t._OrtGetOutputCount=t.asm.cb).apply(null,arguments)},t._OrtGetInputName=function(){return(t._OrtGetInputName=t.asm.db).apply(null,arguments)},t._OrtGetOutputName=function(){return(t._OrtGetOutputName=t.asm.eb).apply(null,arguments)},t._OrtFree=function(){return(t._OrtFree=t.asm.fb).apply(null,arguments)},t._OrtCreateTensor=function(){return(t._OrtCreateTensor=t.asm.gb).apply(null,arguments)},t._OrtGetTensorData=function(){return(t._OrtGetTensorData=t.asm.hb).apply(null,arguments)},t._OrtReleaseTensor=function(){return(t._OrtReleaseTensor=t.asm.ib).apply(null,arguments)},t._OrtCreateRunOptions=function(){return(t._OrtCreateRunOptions=t.asm.jb).apply(null,arguments)},t._OrtAddRunConfigEntry=function(){return(t._OrtAddRunConfigEntry=t.asm.kb).apply(null,arguments)},t._OrtReleaseRunOptions=function(){return(t._OrtReleaseRunOptions=t.asm.lb).apply(null,arguments)},t._OrtRun=function(){return(t._OrtRun=t.asm.mb).apply(null,arguments)},t._OrtEndProfiling=function(){return(t._OrtEndProfiling=t.asm.nb).apply(null,arguments)};var Ct=t._pthread_self=function(){return(Ct=t._pthread_self=t.asm.ob).apply(null,arguments)},$t=t._malloc=function(){return($t=t._malloc=t.asm.pb).apply(null,arguments)},qt=t._free=function(){return(qt=t._free=t.asm.qb).apply(null,arguments)},Yt=t._fflush=function(){return(Yt=t._fflush=t.asm.rb).apply(null,arguments)};t.__emscripten_tls_init=function(){return(t.__emscripten_tls_init=t.asm.sb).apply(null,arguments)};var Xt=t.___funcs_on_exit=function(){return(Xt=t.___funcs_on_exit=t.asm.tb).apply(null,arguments)},Qt=t.__emscripten_thread_init=function(){return(Qt=t.__emscripten_thread_init=t.asm.vb).apply(null,arguments)};t.__emscripten_thread_crashed=function(){return(t.__emscripten_thread_crashed=t.asm.wb).apply(null,arguments)};var Lt,Zt=t._emscripten_run_in_main_runtime_thread_js=function(){return(Zt=t._emscripten_run_in_main_runtime_thread_js=t.asm.xb).apply(null,arguments)},Kt=t.__emscripten_proxy_execute_task_queue=function(){return(Kt=t.__emscripten_proxy_execute_task_queue=t.asm.yb).apply(null,arguments)},Ut=t.__emscripten_thread_free_data=function(){return(Ut=t.__emscripten_thread_free_data=t.asm.zb).apply(null,arguments)},Jt=t.__emscripten_thread_exit=function(){return(Jt=t.__emscripten_thread_exit=t.asm.Ab).apply(null,arguments)},pe=t._setThrew=function(){return(pe=t._setThrew=t.asm.Bb).apply(null,arguments)},en=t._emscripten_stack_set_limits=function(){return(en=t._emscripten_stack_set_limits=t.asm.Cb).apply(null,arguments)},de=t.stackSave=function(){return(de=t.stackSave=t.asm.Db).apply(null,arguments)},ce=t.stackRestore=function(){return(ce=t.stackRestore=t.asm.Eb).apply(null,arguments)},Bt=t.stackAlloc=function(){return(Bt=t.stackAlloc=t.asm.Fb).apply(null,arguments)},Nt=t.___cxa_can_catch=function(){return(Nt=t.___cxa_can_catch=t.asm.Gb).apply(null,arguments)},tn=t.___cxa_is_pointer_type=function(){return(tn=t.___cxa_is_pointer_type=t.asm.Hb).apply(null,arguments)},nn=t.dynCall_j=function(){return(nn=t.dynCall_j=t.asm.Ib).apply(null,arguments)},rn=t.dynCall_iiiiij=function(){return(rn=t.dynCall_iiiiij=t.asm.Jb).apply(null,arguments)},on=t.dynCall_jii=function(){return(on=t.dynCall_jii=t.asm.Kb).apply(null,arguments)},sn=t.dynCall_viiiiij=function(){return(sn=t.dynCall_viiiiij=t.asm.Lb).apply(null,arguments)},an=t.dynCall_vjji=function(){return(an=t.dynCall_vjji=t.asm.Mb).apply(null,arguments)},un=t.dynCall_viiijjjii=function(){return(un=t.dynCall_viiijjjii=t.asm.Nb).apply(null,arguments)},ln=t.dynCall_iij=function(){return(ln=t.dynCall_iij=t.asm.Ob).apply(null,arguments)},cn=t.dynCall_ji=function(){return(cn=t.dynCall_ji=t.asm.Pb).apply(null,arguments)},dn=t.dynCall_iiiiiij=function(){return(dn=t.dynCall_iiiiiij=t.asm.Qb).apply(null,arguments)},hn=t.dynCall_iiij=function(){return(hn=t.dynCall_iiij=t.asm.Rb).apply(null,arguments)};function pn(){function S(){if(!Lt&&(Lt=!0,t.calledRun=!0,!_e)&&(M||Je(Be),e(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),!M)){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;){var O=t.postRun.shift();qe.unshift(O)}Je(qe)}}if(!(0<$e))if(M)e(t),M||Je(Be),postMessage({cmd:"loaded"});else{if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Ve();Je(Ue),0<$e||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),S()},1)):S())}}if(t.UTF8ToString=Se,t.stringToUTF8=function(S,O,I){return De(S,h(),O,I)},t.lengthBytesUTF8=Re,t.keepRuntimeAlive=je,t.wasmMemory=Y,t.stackSave=de,t.stackRestore=ce,t.stackAlloc=Bt,t.ExitStatus=Ke,t.PThread=ie,Ye=function S(){Lt||pn(),Lt||(Ye=S)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0{var d,l=(d=(d=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(m){var s,h,p;m=m||{},s||(s=m!==void 0?m:{}),s.ready=new Promise(function(P,R){h=P,p=R});var a,o,t,e,n,i,u=Object.assign({},s),g="./this.program",b=(P,R)=>{throw R},y=typeof window=="object",_=typeof importScripts=="function",v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",w="";v?(w=_?c(908).dirname(w)+"/":"//",i=()=>{n||(e=c(1384),n=c(908))},a=function(P,R){return i(),P=n.normalize(P),e.readFileSync(P,R?void 0:"utf8")},t=P=>((P=a(P,!0)).buffer||(P=new Uint8Array(P)),P),o=(P,R,N)=>{i(),P=n.normalize(P),e.readFile(P,function($,j){$?N($):R(j.buffer)})},1{if(x||0{var R=new XMLHttpRequest;return R.open("GET",P,!1),R.send(null),R.responseText},_&&(t=P=>{var R=new XMLHttpRequest;return R.open("GET",P,!1),R.responseType="arraybuffer",R.send(null),new Uint8Array(R.response)}),o=(P,R,N)=>{var $=new XMLHttpRequest;$.open("GET",P,!0),$.responseType="arraybuffer",$.onload=()=>{$.status==200||$.status==0&&$.response?R($.response):N()},$.onerror=N,$.send(null)});var T,A=s.print||console.log.bind(console),E=s.printErr||console.warn.bind(console);Object.assign(s,u),u=null,s.thisProgram&&(g=s.thisProgram),s.quit&&(b=s.quit),s.wasmBinary&&(T=s.wasmBinary);var x=s.noExitRuntime||!1;typeof WebAssembly!="object"&&Ae("no native wasm support detected");var M,C,k,V,F,q,D=!1,U=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function J(P,R,N){var $=(R>>>=0)+N;for(N=R;P[N]&&!(N>=$);)++N;if(16(j=(240&j)==224?(15&j)<<12|H<<6|X:(7&j)<<18|H<<12|X<<6|63&P[R++])?$+=String.fromCharCode(j):(j-=65536,$+=String.fromCharCode(55296|j>>10,56320|1023&j))}}else $+=String.fromCharCode(j)}return $}function Y(P,R){return(P>>>=0)?J(V,P,R):""}function Z(P,R,N,$){if(!(0<$))return 0;var j=N>>>=0;$=N+$-1;for(var H=0;H=X&&(X=65536+((1023&X)<<10)|1023&P.charCodeAt(++H)),127>=X){if(N>=$)break;R[N++>>>0]=X}else{if(2047>=X){if(N+1>=$)break;R[N++>>>0]=192|X>>6}else{if(65535>=X){if(N+2>=$)break;R[N++>>>0]=224|X>>12}else{if(N+3>=$)break;R[N++>>>0]=240|X>>18,R[N++>>>0]=128|X>>12&63}R[N++>>>0]=128|X>>6&63}R[N++>>>0]=128|63&X}}return R[N>>>0]=0,N-j}function te(P){for(var R=0,N=0;N=$?R++:2047>=$?R+=2:55296<=$&&57343>=$?(R+=4,++N):R+=3}return R}function he(){var P=M.buffer;C=P,s.HEAP8=k=new Int8Array(P),s.HEAP16=new Int16Array(P),s.HEAP32=F=new Int32Array(P),s.HEAPU8=V=new Uint8Array(P),s.HEAPU16=new Uint16Array(P),s.HEAPU32=q=new Uint32Array(P),s.HEAPF32=new Float32Array(P),s.HEAPF64=new Float64Array(P)}var Me,Te=[],ue=[],xe=[],_e=[],Le=0;function ze(){var P=s.preRun.shift();Te.unshift(P)}var Se,De=0,Re=null;function Ae(P){throw s.onAbort&&s.onAbort(P),E(P="Aborted("+P+")"),D=!0,P=new WebAssembly.RuntimeError(P+". Build with -sASSERTIONS for more info."),p(P),P}function we(){return Se.startsWith("data:application/octet-stream;base64,")}if(Se="ort-wasm.wasm",!we()){var ke=Se;Se=s.locateFile?s.locateFile(ke,w):w+ke}function Ue(){var P=Se;try{if(P==Se&&T)return new Uint8Array(T);if(t)return t(P);throw"both async and sync fetching of the wasm failed"}catch(R){Ae(R)}}function Be(P){this.name="ExitStatus",this.message="Program terminated with exit("+P+")",this.status=P}function We(P){for(;0>2>>>0]=R},this.Eb=function(){return q[this.zb+4>>2>>>0]},this.Sb=function(R){q[this.zb+8>>2>>>0]=R},this.Wb=function(){return q[this.zb+8>>2>>>0]},this.Tb=function(){F[this.zb>>2>>>0]=0},this.Ib=function(R){k[this.zb+12>>0>>>0]=R?1:0},this.Pb=function(){return k[this.zb+12>>0>>>0]!=0},this.Jb=function(R){k[this.zb+13>>0>>>0]=R?1:0},this.Lb=function(){return k[this.zb+13>>0>>>0]!=0},this.Rb=function(R,N){this.Fb(0),this.Ub(R),this.Sb(N),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){F[this.zb>>2>>>0]+=1},this.Xb=function(){var R=F[this.zb>>2>>>0];return F[this.zb>>2>>>0]=R-1,R===1},this.Fb=function(R){q[this.zb+16>>2>>>0]=R},this.Ob=function(){return q[this.zb+16>>2>>>0]},this.Qb=function(){if(mt(this.Eb()))return q[this.Db>>2>>>0];var R=this.Ob();return R!==0?R:this.Db}}function $e(P){return rt(new Ee(P).zb)}var Ye=[];function le(P){var R=Ye[P];return R||(P>=Ye.length&&(Ye.length=P+1),Ye[P]=R=Me.get(P)),R}function pt(P){var R=te(P)+1,N=ye(R);return N&&Z(P,k,N,R),N}var ut={};function It(){if(!Ke){var P,R={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:g||"./this.program"};for(P in ut)ut[P]===void 0?delete R[P]:R[P]=ut[P];var N=[];for(P in R)N.push(P+"="+R[P]);Ke=N}return Ke}var Ke,He=[null,[],[]];function lt(P,R){var N=He[P];R===0||R===10?((P===1?A:E)(J(N,0)),N.length=0):N.push(R)}var Ce=0;function nt(P){return P%4==0&&(P%100!=0||P%400==0)}var ie=[31,29,31,30,31,30,31,31,30,31,30,31],Je=[31,28,31,30,31,30,31,31,30,31,30,31];function At(P,R,N,$){function j(G,ge,Oe){for(G=typeof G=="number"?G.toString():G||"";G.lengthst?-1:0Qe-G.getDate())){G.setDate(G.getDate()+ge);break}ge-=Qe-G.getDate()+1,G.setDate(1),11>Oe?G.setMonth(Oe+1):(G.setMonth(0),G.setFullYear(G.getFullYear()+1))}return Oe=new Date(G.getFullYear()+1,0,4),ge=ee(new Date(G.getFullYear(),0,4)),Oe=ee(Oe),0>=X(ge,G)?0>=X(Oe,G)?G.getFullYear()+1:G.getFullYear():G.getFullYear()-1}var ae=F[$+40>>2>>>0];for(var ve in $={$b:F[$>>2>>>0],Zb:F[$+4>>2>>>0],Gb:F[$+8>>2>>>0],Kb:F[$+12>>2>>>0],Hb:F[$+16>>2>>>0],Cb:F[$+20>>2>>>0],Ab:F[$+24>>2>>>0],Bb:F[$+28>>2>>>0],bc:F[$+32>>2>>>0],Yb:F[$+36>>2>>>0],ac:ae?Y(ae):""},N=Y(N),ae={"%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(ve,"g"),ae[ve]);var Fe="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Ne="January February March April May June July August September October November December".split(" ");for(ve in ae={"%a":function(G){return Fe[G.Ab].substring(0,3)},"%A":function(G){return Fe[G.Ab]},"%b":function(G){return Ne[G.Hb].substring(0,3)},"%B":function(G){return Ne[G.Hb]},"%C":function(G){return H((G.Cb+1900)/100|0,2)},"%d":function(G){return H(G.Kb,2)},"%e":function(G){return j(G.Kb,2," ")},"%g":function(G){return K(G).toString().substring(2)},"%G":function(G){return K(G)},"%H":function(G){return H(G.Gb,2)},"%I":function(G){return(G=G.Gb)==0?G=12:12G.Gb?"AM":"PM"},"%S":function(G){return H(G.$b,2)},"%t":function(){return" "},"%u":function(G){return G.Ab||7},"%U":function(G){return H(Math.floor((G.Bb+7-G.Ab)/7),2)},"%V":function(G){var ge=Math.floor((G.Bb+7-(G.Ab+6)%7)/7);if(2>=(G.Ab+371-G.Bb-2)%7&&ge++,ge)ge==53&&((Oe=(G.Ab+371-G.Bb)%7)==4||Oe==3&&nt(G.Cb)||(ge=1));else{ge=52;var Oe=(G.Ab+7-G.Bb-1)%7;(Oe==4||Oe==5&&nt(G.Cb%400-1))&&ge++}return H(ge,2)},"%w":function(G){return G.Ab},"%W":function(G){return H(Math.floor((G.Bb+7-(G.Ab+6)%7)/7),2)},"%y":function(G){return(G.Cb+1900).toString().substring(2)},"%Y":function(G){return G.Cb+1900},"%z":function(G){var ge=0<=(G=G.Yb);return G=Math.abs(G)/60,(ge?"+":"-")+("0000"+(G/60*100+G%60)).slice(-4)},"%Z":function(G){return G.ac},"%%":function(){return"%"}},N=N.replace(/%%/g,"\0\0"),ae)N.includes(ve)&&(N=N.replace(new RegExp(ve,"g"),ae[ve]($)));return ve=function(G){var ge=Array(te(G)+1);return Z(G,ge,0,ge.length),ge}(N=N.replace(/\0\0/g,"%")),ve.length>R?0:(k.set(ve,P>>>0),ve.length-1)}var Et={a:function(P){return ye(P+24)+24},m:function(P){return(P=new Ee(P)).Pb()||(P.Ib(!0),je--),P.Jb(!1),qe.push(P),P.Nb(),P.Qb()},ia:function(P){throw E("Unexpected exception thrown, this is not properly supported - aborting"),D=!0,P},w:function(){oe(0);var P=qe.pop();if(P.Xb()&&!P.Lb()){var R=P.Wb();R&&le(R)(P.Db),$e(P.Db)}Ve=0},d:function(){var P=Ve;if(!P)return Ce=0;var R=new Ee(P);R.Fb(P);var N=R.Eb();if(!N)return Ce=0,P;for(var $=Array.prototype.slice.call(arguments),j=0;j<$.length;j++){var H=$[j];if(H===0||H===N)break;if(et(H,N,R.zb+16))return Ce=H,P}return Ce=N,P},k:function(){var P=Ve;if(!P)return Ce=0;var R=new Ee(P);R.Fb(P);var N=R.Eb();if(!N)return Ce=0,P;for(var $=Array.prototype.slice.call(arguments),j=0;j<$.length;j++){var H=$[j];if(H===0||H===N)break;if(et(H,N,R.zb+16))return Ce=H,P}return Ce=N,P},g:function(){var P=Ve;if(!P)return Ce=0;var R=new Ee(P);R.Fb(P);var N=R.Eb();if(!N)return Ce=0,P;for(var $=Array.prototype.slice.call(arguments),j=0;j<$.length;j++){var H=$[j];if(H===0||H===N)break;if(et(H,N,R.zb+16))return Ce=H,P}return Ce=N,P},s:$e,L:function(){var P=qe.pop();P||Ae("no exception to throw");var R=P.Db;throw P.Lb()||(qe.push(P),P.Jb(!0),P.Ib(!1),je++),Ve=R,R},b:function(P,R,N){throw new Ee(P).Rb(R,N),Ve=P,je++,P},la:function(){return je},i:function(P){throw Ve||(Ve=P),P},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){Ae("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){Ae("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(P,R){P=new Date(1e3*(q[P>>>2]+4294967296*F[P+4>>>2])),F[R>>2>>>0]=P.getUTCSeconds(),F[R+4>>2>>>0]=P.getUTCMinutes(),F[R+8>>2>>>0]=P.getUTCHours(),F[R+12>>2>>>0]=P.getUTCDate(),F[R+16>>2>>>0]=P.getUTCMonth(),F[R+20>>2>>>0]=P.getUTCFullYear()-1900,F[R+24>>2>>>0]=P.getUTCDay(),F[R+28>>2>>>0]=(P.getTime()-Date.UTC(P.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(P,R){P=new Date(1e3*(q[P>>>2]+4294967296*F[P+4>>>2])),F[R>>2>>>0]=P.getSeconds(),F[R+4>>2>>>0]=P.getMinutes(),F[R+8>>2>>>0]=P.getHours(),F[R+12>>2>>>0]=P.getDate(),F[R+16>>2>>>0]=P.getMonth(),F[R+20>>2>>>0]=P.getFullYear()-1900,F[R+24>>2>>>0]=P.getDay();var N=new Date(P.getFullYear(),0,1);F[R+28>>2>>>0]=(P.getTime()-N.getTime())/864e5|0,F[R+36>>2>>>0]=-60*P.getTimezoneOffset();var $=new Date(P.getFullYear(),6,1).getTimezoneOffset();N=N.getTimezoneOffset(),F[R+32>>2>>>0]=0|($!=N&&P.getTimezoneOffset()==Math.min(N,$))},Fa:function(P){var R=new Date(F[P+20>>2>>>0]+1900,F[P+16>>2>>>0],F[P+12>>2>>>0],F[P+8>>2>>>0],F[P+4>>2>>>0],F[P>>2>>>0],0),N=F[P+32>>2>>>0],$=R.getTimezoneOffset(),j=new Date(R.getFullYear(),0,1),H=new Date(R.getFullYear(),6,1).getTimezoneOffset(),X=j.getTimezoneOffset(),ee=Math.min(X,H);return 0>N?F[P+32>>2>>>0]=+(H!=X&&ee==$):0>2>>>0]=R.getDay(),F[P+28>>2>>>0]=(R.getTime()-j.getTime())/864e5|0,F[P>>2>>>0]=R.getSeconds(),F[P+4>>2>>>0]=R.getMinutes(),F[P+8>>2>>>0]=R.getHours(),F[P+12>>2>>>0]=R.getDate(),F[P+16>>2>>>0]=R.getMonth(),R.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function P(R,N,$){P.Vb||(P.Vb=!0,function(j,H,X){function ee(Ne){return(Ne=Ne.toTimeString().match(/\(([A-Za-z ]+)\)$/))?Ne[1]:"GMT"}var K=new Date().getFullYear(),ae=new Date(K,0,1),ve=new Date(K,6,1);K=ae.getTimezoneOffset();var Fe=ve.getTimezoneOffset();F[j>>2>>>0]=60*Math.max(K,Fe),F[H>>2>>>0]=+(K!=Fe),j=ee(ae),H=ee(ve),j=pt(j),H=pt(H),Fe>2>>>0]=j,q[X+4>>2>>>0]=H):(q[X>>2>>>0]=H,q[X+4>>2>>>0]=j)}(R,N,$))},B:function(){Ae("")},ma:function(){return 4294901760},I:v?()=>{var P=process.hrtime();return 1e3*P[0]+P[1]/1e6}:()=>performance.now(),xa:function(P,R,N){V.copyWithin(P>>>0,R>>>0,R+N>>>0)},G:function(P){var R=V.length;if(4294901760<(P>>>=0))return!1;for(var N=1;4>=N;N*=2){var $=R*(1+.2/N);$=Math.min($,P+100663296);var j=Math;$=Math.max(P,$),j=j.min.call(j,4294901760,$+(65536-$%65536)%65536);e:{try{M.grow(j-C.byteLength+65535>>>16),he();var H=1;break e}catch{}H=void 0}if(H)return!0}return!1},va:function(P,R){var N=0;return It().forEach(function($,j){var H=R+N;for(j=q[P+4*j>>2>>>0]=H,H=0;H<$.length;++H)k[j++>>0>>>0]=$.charCodeAt(H);k[j>>0>>>0]=0,N+=$.length+1}),0},wa:function(P,R){var N=It();q[P>>2>>>0]=N.length;var $=0;return N.forEach(function(j){$+=j.length+1}),q[R>>2>>>0]=$,0},ba:function(P){x||0>2>>>0],ee=q[R+4>>2>>>0];R+=8;for(var K=0;K>>0]);j+=ee}return q[$>>2>>>0]=j,0},c:function(){return Ce},ja:function P(R,N){P.Mb||(P.Mb=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var j=new Uint8Array(1);return()=>(crypto.getRandomValues(j),j[0])}if(v)try{var H=c(Object(function(){var X=new Error("Cannot find module 'crypto'");throw X.code="MODULE_NOT_FOUND",X}()));return()=>H.randomBytes(1)[0]}catch{}return()=>Ae("randomDevice")}());for(var $=0;$>0>>>0]=P.Mb();return 0},ea:function(P,R,N){var $=re();try{return le(P)(R,N)}catch(j){if(se($),j!==j+0)throw j;oe(1,0)}},fa:function(P,R,N){var $=re();try{return le(P)(R,N)}catch(j){if(se($),j!==j+0)throw j;oe(1,0)}},J:function(P){var R=re();try{return le(P)()}catch(N){if(se(R),N!==N+0)throw N;oe(1,0)}},e:function(P,R){var N=re();try{return le(P)(R)}catch($){if(se(N),$!==$+0)throw $;oe(1,0)}},N:function(P,R,N){var $=re();try{return le(P)(R,N)}catch(j){if(se($),j!==j+0)throw j;oe(1,0)}},O:function(P,R,N){var $=re();try{return le(P)(R,N)}catch(j){if(se($),j!==j+0)throw j;oe(1,0)}},j:function(P,R,N){var $=re();try{return le(P)(R,N)}catch(j){if(se($),j!==j+0)throw j;oe(1,0)}},o:function(P,R,N,$){var j=re();try{return le(P)(R,N,$)}catch(H){if(se(j),H!==H+0)throw H;oe(1,0)}},p:function(P,R,N,$,j){var H=re();try{return le(P)(R,N,$,j)}catch(X){if(se(H),X!==X+0)throw X;oe(1,0)}},M:function(P,R,N,$,j,H){var X=re();try{return le(P)(R,N,$,j,H)}catch(ee){if(se(X),ee!==ee+0)throw ee;oe(1,0)}},r:function(P,R,N,$,j,H){var X=re();try{return le(P)(R,N,$,j,H)}catch(ee){if(se(X),ee!==ee+0)throw ee;oe(1,0)}},v:function(P,R,N,$,j,H,X){var ee=re();try{return le(P)(R,N,$,j,H,X)}catch(K){if(se(ee),K!==K+0)throw K;oe(1,0)}},K:function(P,R,N,$,j,H,X,ee){var K=re();try{return le(P)(R,N,$,j,H,X,ee)}catch(ae){if(se(K),ae!==ae+0)throw ae;oe(1,0)}},D:function(P,R,N,$,j,H,X,ee,K,ae,ve,Fe){var Ne=re();try{return le(P)(R,N,$,j,H,X,ee,K,ae,ve,Fe)}catch(G){if(se(Ne),G!==G+0)throw G;oe(1,0)}},X:function(P,R,N,$,j,H,X,ee){var K=re();try{return ot(P,R,N,$,j,H,X,ee)}catch(ae){if(se(K),ae!==ae+0)throw ae;oe(1,0)}},V:function(P,R,N,$,j,H,X){var ee=re();try{return bt(P,R,N,$,j,H,X)}catch(K){if(se(ee),K!==K+0)throw K;oe(1,0)}},U:function(P,R,N,$,j){var H=re();try{return ht(P,R,N,$,j)}catch(X){if(se(H),X!==X+0)throw X;oe(1,0)}},Z:function(P,R,N,$){var j=re();try{return wt(P,R,N,$)}catch(H){if(se(j),H!==H+0)throw H;oe(1,0)}},W:function(P){var R=re();try{return gt(P)}catch(N){if(se(R),N!==N+0)throw N;oe(1,0)}},Y:function(P,R){var N=re();try{return xt(P,R)}catch($){if(se(N),$!==$+0)throw $;oe(1,0)}},T:function(P,R,N){var $=re();try{return dt(P,R,N)}catch(j){if(se($),j!==j+0)throw j;oe(1,0)}},f:function(P){var R=re();try{le(P)()}catch(N){if(se(R),N!==N+0)throw N;oe(1,0)}},q:function(P,R){var N=re();try{le(P)(R)}catch($){if(se(N),$!==$+0)throw $;oe(1,0)}},h:function(P,R,N){var $=re();try{le(P)(R,N)}catch(j){if(se($),j!==j+0)throw j;oe(1,0)}},da:function(P,R,N,$){var j=re();try{le(P)(R,N,$)}catch(H){if(se(j),H!==H+0)throw H;oe(1,0)}},l:function(P,R,N,$){var j=re();try{le(P)(R,N,$)}catch(H){if(se(j),H!==H+0)throw H;oe(1,0)}},t:function(P,R,N,$,j){var H=re();try{le(P)(R,N,$,j)}catch(X){if(se(H),X!==X+0)throw X;oe(1,0)}},u:function(P,R,N,$,j,H){var X=re();try{le(P)(R,N,$,j,H)}catch(ee){if(se(X),ee!==ee+0)throw ee;oe(1,0)}},x:function(P,R,N,$,j,H,X){var ee=re();try{le(P)(R,N,$,j,H,X)}catch(K){if(se(ee),K!==K+0)throw K;oe(1,0)}},z:function(P,R,N,$,j,H,X,ee){var K=re();try{le(P)(R,N,$,j,H,X,ee)}catch(ae){if(se(K),ae!==ae+0)throw ae;oe(1,0)}},ga:function(P,R,N,$,j,H,X,ee,K){var ae=re();try{le(P)(R,N,$,j,H,X,ee,K)}catch(ve){if(se(ae),ve!==ve+0)throw ve;oe(1,0)}},A:function(P,R,N,$,j,H,X,ee,K,ae,ve){var Fe=re();try{le(P)(R,N,$,j,H,X,ee,K,ae,ve)}catch(Ne){if(se(Fe),Ne!==Ne+0)throw Ne;oe(1,0)}},C:function(P,R,N,$,j,H,X,ee,K,ae,ve,Fe,Ne,G,ge,Oe){var Qe=re();try{le(P)(R,N,$,j,H,X,ee,K,ae,ve,Fe,Ne,G,ge,Oe)}catch(st){if(se(Qe),st!==st+0)throw st;oe(1,0)}},aa:function(P,R,N,$,j,H,X,ee){var K=re();try{yt(P,R,N,$,j,H,X,ee)}catch(ae){if(se(K),ae!==ae+0)throw ae;oe(1,0)}},_:function(P,R,N,$,j,H,X,ee,K,ae,ve,Fe){var Ne=re();try{vt(P,R,N,$,j,H,X,ee,K,ae,ve,Fe)}catch(G){if(se(Ne),G!==G+0)throw G;oe(1,0)}},$:function(P,R,N,$,j,H){var X=re();try{_t(P,R,N,$,j,H)}catch(ee){if(se(X),ee!==ee+0)throw ee;oe(1,0)}},n:function(P){return P},F:function(P){Ce=P},ha:At,y:function(P,R,N,$){return At(P,R,N,$)}};(function(){function P(j){s.asm=j.exports,M=s.asm.Ka,he(),Me=s.asm.ib,ue.unshift(s.asm.La),De--,s.monitorRunDependencies&&s.monitorRunDependencies(De),De==0&&Re&&(j=Re,Re=null,j())}function R(j){P(j.instance)}function N(j){return function(){if(!T&&(y||_)){if(typeof fetch=="function"&&!Se.startsWith("file://"))return fetch(Se,{credentials:"same-origin"}).then(function(H){if(!H.ok)throw"failed to load wasm binary file at '"+Se+"'";return H.arrayBuffer()}).catch(function(){return Ue()});if(o)return new Promise(function(H,X){o(Se,function(ee){H(new Uint8Array(ee))},X)})}return Promise.resolve().then(function(){return Ue()})}().then(function(H){return WebAssembly.instantiate(H,$)}).then(function(H){return H}).then(j,function(H){E("failed to asynchronously prepare wasm: "+H),Ae(H)})}var $={a:Et};if(De++,s.monitorRunDependencies&&s.monitorRunDependencies(De),s.instantiateWasm)try{return s.instantiateWasm($,P)}catch(j){return E("Module.instantiateWasm callback failed with error: "+j),!1}(T||typeof WebAssembly.instantiateStreaming!="function"||we()||Se.startsWith("file://")||v||typeof fetch!="function"?N(R):fetch(Se,{credentials:"same-origin"}).then(function(j){return WebAssembly.instantiateStreaming(j,$).then(R,function(H){return E("wasm streaming compile failed: "+H),E("falling back to ArrayBuffer instantiation"),N(R)})})).catch(p)})(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.La).apply(null,arguments)},s._OrtInit=function(){return(s._OrtInit=s.asm.Ma).apply(null,arguments)},s._OrtCreateSessionOptions=function(){return(s._OrtCreateSessionOptions=s.asm.Na).apply(null,arguments)},s._OrtAppendExecutionProvider=function(){return(s._OrtAppendExecutionProvider=s.asm.Oa).apply(null,arguments)},s._OrtAddSessionConfigEntry=function(){return(s._OrtAddSessionConfigEntry=s.asm.Pa).apply(null,arguments)},s._OrtReleaseSessionOptions=function(){return(s._OrtReleaseSessionOptions=s.asm.Qa).apply(null,arguments)},s._OrtCreateSession=function(){return(s._OrtCreateSession=s.asm.Ra).apply(null,arguments)},s._OrtReleaseSession=function(){return(s._OrtReleaseSession=s.asm.Sa).apply(null,arguments)},s._OrtGetInputCount=function(){return(s._OrtGetInputCount=s.asm.Ta).apply(null,arguments)},s._OrtGetOutputCount=function(){return(s._OrtGetOutputCount=s.asm.Ua).apply(null,arguments)},s._OrtGetInputName=function(){return(s._OrtGetInputName=s.asm.Va).apply(null,arguments)},s._OrtGetOutputName=function(){return(s._OrtGetOutputName=s.asm.Wa).apply(null,arguments)},s._OrtFree=function(){return(s._OrtFree=s.asm.Xa).apply(null,arguments)},s._OrtCreateTensor=function(){return(s._OrtCreateTensor=s.asm.Ya).apply(null,arguments)},s._OrtGetTensorData=function(){return(s._OrtGetTensorData=s.asm.Za).apply(null,arguments)},s._OrtReleaseTensor=function(){return(s._OrtReleaseTensor=s.asm._a).apply(null,arguments)},s._OrtCreateRunOptions=function(){return(s._OrtCreateRunOptions=s.asm.$a).apply(null,arguments)},s._OrtAddRunConfigEntry=function(){return(s._OrtAddRunConfigEntry=s.asm.ab).apply(null,arguments)},s._OrtReleaseRunOptions=function(){return(s._OrtReleaseRunOptions=s.asm.bb).apply(null,arguments)},s._OrtRun=function(){return(s._OrtRun=s.asm.cb).apply(null,arguments)},s._OrtEndProfiling=function(){return(s._OrtEndProfiling=s.asm.db).apply(null,arguments)};var Xe,ye=s._malloc=function(){return(ye=s._malloc=s.asm.eb).apply(null,arguments)},rt=s._free=function(){return(rt=s._free=s.asm.fb).apply(null,arguments)},ct=s._fflush=function(){return(ct=s._fflush=s.asm.gb).apply(null,arguments)},it=s.___funcs_on_exit=function(){return(it=s.___funcs_on_exit=s.asm.hb).apply(null,arguments)},oe=s._setThrew=function(){return(oe=s._setThrew=s.asm.jb).apply(null,arguments)},re=s.stackSave=function(){return(re=s.stackSave=s.asm.kb).apply(null,arguments)},se=s.stackRestore=function(){return(se=s.stackRestore=s.asm.lb).apply(null,arguments)},ft=s.stackAlloc=function(){return(ft=s.stackAlloc=s.asm.mb).apply(null,arguments)},et=s.___cxa_can_catch=function(){return(et=s.___cxa_can_catch=s.asm.nb).apply(null,arguments)},mt=s.___cxa_is_pointer_type=function(){return(mt=s.___cxa_is_pointer_type=s.asm.ob).apply(null,arguments)},gt=s.dynCall_j=function(){return(gt=s.dynCall_j=s.asm.pb).apply(null,arguments)},bt=s.dynCall_iiiiij=function(){return(bt=s.dynCall_iiiiij=s.asm.qb).apply(null,arguments)},dt=s.dynCall_jii=function(){return(dt=s.dynCall_jii=s.asm.rb).apply(null,arguments)},yt=s.dynCall_viiiiij=function(){return(yt=s.dynCall_viiiiij=s.asm.sb).apply(null,arguments)},_t=s.dynCall_vjji=function(){return(_t=s.dynCall_vjji=s.asm.tb).apply(null,arguments)},vt=s.dynCall_viiijjjii=function(){return(vt=s.dynCall_viiijjjii=s.asm.ub).apply(null,arguments)},wt=s.dynCall_iij=function(){return(wt=s.dynCall_iij=s.asm.vb).apply(null,arguments)},xt=s.dynCall_ji=function(){return(xt=s.dynCall_ji=s.asm.wb).apply(null,arguments)},ot=s.dynCall_iiiiiij=function(){return(ot=s.dynCall_iiiiiij=s.asm.xb).apply(null,arguments)},ht=s.dynCall_iiij=function(){return(ht=s.dynCall_iiij=s.asm.yb).apply(null,arguments)};function Tt(){function P(){if(!Xe&&(Xe=!0,s.calledRun=!0,!D)){if(We(ue),h(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;){var R=s.postRun.shift();_e.unshift(R)}We(_e)}}if(!(0{f.exports=function(r,c){for(var d=new Array(arguments.length-1),l=0,m=2,s=!0;m{var c=r;c.length=function(h){var p=h.length;if(!p)return 0;for(var a=0;--p%4>1&&h.charAt(p)==="=";)++a;return Math.ceil(3*h.length)/4-a};for(var d=new Array(64),l=new Array(123),m=0;m<64;)l[d[m]=m<26?m+65:m<52?m+71:m<62?m-4:m-59|43]=m++;c.encode=function(h,p,a){for(var o,t=null,e=[],n=0,i=0;p>2],o=(3&u)<<4,i=1;break;case 1:e[n++]=d[o|u>>4],o=(15&u)<<2,i=2;break;case 2:e[n++]=d[o|u>>6],e[n++]=d[63&u],i=0}n>8191&&((t||(t=[])).push(String.fromCharCode.apply(String,e)),n=0)}return i&&(e[n++]=d[o],e[n++]=61,i===1&&(e[n++]=61)),t?(n&&t.push(String.fromCharCode.apply(String,e.slice(0,n))),t.join("")):String.fromCharCode.apply(String,e.slice(0,n))};var s="invalid encoding";c.decode=function(h,p,a){for(var o,t=a,e=0,n=0;n1)break;if((i=l[i])===void 0)throw Error(s);switch(e){case 0:o=i,e=1;break;case 1:p[a++]=o<<2|(48&i)>>4,o=i,e=2;break;case 2:p[a++]=(15&o)<<4|(60&i)>>2,o=i,e=3;break;case 3:p[a++]=(3&o)<<6|i,e=0}}if(e===1)throw Error(s);return a-t},c.test=function(h){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(h)}},9211:f=>{function r(){this._listeners={}}f.exports=r,r.prototype.on=function(c,d,l){return(this._listeners[c]||(this._listeners[c]=[])).push({fn:d,ctx:l||this}),this},r.prototype.off=function(c,d){if(c===void 0)this._listeners={};else if(d===void 0)this._listeners[c]=[];else for(var l=this._listeners[c],m=0;m{function r(s){return typeof Float32Array<"u"?function(){var h=new Float32Array([-0]),p=new Uint8Array(h.buffer),a=p[3]===128;function o(i,u,g){h[0]=i,u[g]=p[0],u[g+1]=p[1],u[g+2]=p[2],u[g+3]=p[3]}function t(i,u,g){h[0]=i,u[g]=p[3],u[g+1]=p[2],u[g+2]=p[1],u[g+3]=p[0]}function e(i,u){return p[0]=i[u],p[1]=i[u+1],p[2]=i[u+2],p[3]=i[u+3],h[0]}function n(i,u){return p[3]=i[u],p[2]=i[u+1],p[1]=i[u+2],p[0]=i[u+3],h[0]}s.writeFloatLE=a?o:t,s.writeFloatBE=a?t:o,s.readFloatLE=a?e:n,s.readFloatBE=a?n:e}():function(){function h(a,o,t,e){var n=o<0?1:0;if(n&&(o=-o),o===0)a(1/o>0?0:2147483648,t,e);else if(isNaN(o))a(2143289344,t,e);else if(o>34028234663852886e22)a((n<<31|2139095040)>>>0,t,e);else if(o<11754943508222875e-54)a((n<<31|Math.round(o/1401298464324817e-60))>>>0,t,e);else{var i=Math.floor(Math.log(o)/Math.LN2);a((n<<31|i+127<<23|8388607&Math.round(o*Math.pow(2,-i)*8388608))>>>0,t,e)}}function p(a,o,t){var e=a(o,t),n=2*(e>>31)+1,i=e>>>23&255,u=8388607&e;return i===255?u?NaN:n*(1/0):i===0?1401298464324817e-60*n*u:n*Math.pow(2,i-150)*(u+8388608)}s.writeFloatLE=h.bind(null,c),s.writeFloatBE=h.bind(null,d),s.readFloatLE=p.bind(null,l),s.readFloatBE=p.bind(null,m)}(),typeof Float64Array<"u"?function(){var h=new Float64Array([-0]),p=new Uint8Array(h.buffer),a=p[7]===128;function o(i,u,g){h[0]=i,u[g]=p[0],u[g+1]=p[1],u[g+2]=p[2],u[g+3]=p[3],u[g+4]=p[4],u[g+5]=p[5],u[g+6]=p[6],u[g+7]=p[7]}function t(i,u,g){h[0]=i,u[g]=p[7],u[g+1]=p[6],u[g+2]=p[5],u[g+3]=p[4],u[g+4]=p[3],u[g+5]=p[2],u[g+6]=p[1],u[g+7]=p[0]}function e(i,u){return p[0]=i[u],p[1]=i[u+1],p[2]=i[u+2],p[3]=i[u+3],p[4]=i[u+4],p[5]=i[u+5],p[6]=i[u+6],p[7]=i[u+7],h[0]}function n(i,u){return p[7]=i[u],p[6]=i[u+1],p[5]=i[u+2],p[4]=i[u+3],p[3]=i[u+4],p[2]=i[u+5],p[1]=i[u+6],p[0]=i[u+7],h[0]}s.writeDoubleLE=a?o:t,s.writeDoubleBE=a?t:o,s.readDoubleLE=a?e:n,s.readDoubleBE=a?n:e}():function(){function h(a,o,t,e,n,i){var u=e<0?1:0;if(u&&(e=-e),e===0)a(0,n,i+o),a(1/e>0?0:2147483648,n,i+t);else if(isNaN(e))a(0,n,i+o),a(2146959360,n,i+t);else if(e>17976931348623157e292)a(0,n,i+o),a((u<<31|2146435072)>>>0,n,i+t);else{var g;if(e<22250738585072014e-324)a((g=e/5e-324)>>>0,n,i+o),a((u<<31|g/4294967296)>>>0,n,i+t);else{var b=Math.floor(Math.log(e)/Math.LN2);b===1024&&(b=1023),a(4503599627370496*(g=e*Math.pow(2,-b))>>>0,n,i+o),a((u<<31|b+1023<<20|1048576*g&1048575)>>>0,n,i+t)}}}function p(a,o,t,e,n){var i=a(e,n+o),u=a(e,n+t),g=2*(u>>31)+1,b=u>>>20&2047,y=4294967296*(1048575&u)+i;return b===2047?y?NaN:g*(1/0):b===0?5e-324*g*y:g*Math.pow(2,b-1075)*(y+4503599627370496)}s.writeDoubleLE=h.bind(null,c,0,4),s.writeDoubleBE=h.bind(null,d,4,0),s.readDoubleLE=p.bind(null,l,0,4),s.readDoubleBE=p.bind(null,m,4,0)}(),s}function c(s,h,p){h[p]=255&s,h[p+1]=s>>>8&255,h[p+2]=s>>>16&255,h[p+3]=s>>>24}function d(s,h,p){h[p]=s>>>24,h[p+1]=s>>>16&255,h[p+2]=s>>>8&255,h[p+3]=255&s}function l(s,h){return(s[h]|s[h+1]<<8|s[h+2]<<16|s[h+3]<<24)>>>0}function m(s,h){return(s[h]<<24|s[h+1]<<16|s[h+2]<<8|s[h+3])>>>0}f.exports=r(r)},7199:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(f){}return null}module.exports=inquire},6662:f=>{f.exports=function(r,c,d){var l=d||8192,m=l>>>1,s=null,h=l;return function(p){if(p<1||p>m)return r(p);h+p>l&&(s=r(l),h=0);var a=c.call(s,h,h+=p);return 7&h&&(h=1+(7|h)),a}}},4997:(f,r)=>{var c=r;c.length=function(d){for(var l=0,m=0,s=0;s191&&s<224?p[a++]=(31&s)<<6|63&d[l++]:s>239&&s<365?(s=((7&s)<<18|(63&d[l++])<<12|(63&d[l++])<<6|63&d[l++])-65536,p[a++]=55296+(s>>10),p[a++]=56320+(1023&s)):p[a++]=(15&s)<<12|(63&d[l++])<<6|63&d[l++],a>8191&&((h||(h=[])).push(String.fromCharCode.apply(String,p)),a=0);return h?(a&&h.push(String.fromCharCode.apply(String,p.slice(0,a))),h.join("")):String.fromCharCode.apply(String,p.slice(0,a))},c.write=function(d,l,m){for(var s,h,p=m,a=0;a>6|192,l[m++]=63&s|128):(64512&s)==55296&&(64512&(h=d.charCodeAt(a+1)))==56320?(s=65536+((1023&s)<<10)+(1023&h),++a,l[m++]=s>>18|240,l[m++]=s>>12&63|128,l[m++]=s>>6&63|128,l[m++]=63&s|128):(l[m++]=s>>12|224,l[m++]=s>>6&63|128,l[m++]=63&s|128);return m-p}},3442:(f,r)=>{r.__esModule=!0;var c=function(){function d(l){if(!l)throw new TypeError("Invalid argument; `value` has no value.");this.value=d.EMPTY,l&&d.isGuid(l)&&(this.value=l)}return d.isGuid=function(l){var m=l.toString();return l&&(l instanceof d||d.validator.test(m))},d.create=function(){return new d([d.gen(2),d.gen(1),d.gen(1),d.gen(1),d.gen(3)].join("-"))},d.createEmpty=function(){return new d("emptyguid")},d.parse=function(l){return new d(l)},d.raw=function(){return[d.gen(2),d.gen(1),d.gen(1),d.gen(1),d.gen(3)].join("-")},d.gen=function(l){for(var m="",s=0;s{f.exports=c;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function c(x,M,C){this.low=0|x,this.high=0|M,this.unsigned=!!C}function d(x){return(x&&x.__isLong__)===!0}c.prototype.__isLong__,Object.defineProperty(c.prototype,"__isLong__",{value:!0}),c.isLong=d;var l={},m={};function s(x,M){var C,k,V;return M?(V=0<=(x>>>=0)&&x<256)&&(k=m[x])?k:(C=p(x,(0|x)<0?-1:0,!0),V&&(m[x]=C),C):(V=-128<=(x|=0)&&x<128)&&(k=l[x])?k:(C=p(x,x<0?-1:0,!1),V&&(l[x]=C),C)}function h(x,M){if(isNaN(x))return M?b:g;if(M){if(x<0)return b;if(x>=n)return T}else{if(x<=-i)return A;if(x+1>=i)return w}return x<0?h(-x,M).neg():p(x%e|0,x/e|0,M)}function p(x,M,C){return new c(x,M,C)}c.fromInt=s,c.fromNumber=h,c.fromBits=p;var a=Math.pow;function o(x,M,C){if(x.length===0)throw Error("empty string");if(x==="NaN"||x==="Infinity"||x==="+Infinity"||x==="-Infinity")return g;if(typeof M=="number"?(C=M,M=!1):M=!!M,(C=C||10)<2||360)throw Error("interior hyphen");if(k===0)return o(x.substring(1),M,C).neg();for(var V=h(a(C,8)),F=g,q=0;q>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*e+(this.low>>>0):this.high*e+(this.low>>>0)},E.toString=function(x){if((x=x||10)<2||36>>0).toString(x);if((F=D).isZero())return U+q;for(;U.length<6;)U="0"+U;q=""+U+q}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var x=this.high!=0?this.high:this.low,M=31;M>0&&(x&1<=0},E.isOdd=function(){return(1&this.low)==1},E.isEven=function(){return(1&this.low)==0},E.equals=function(x){return d(x)||(x=t(x)),(this.unsigned===x.unsigned||this.high>>>31!=1||x.high>>>31!=1)&&this.high===x.high&&this.low===x.low},E.eq=E.equals,E.notEquals=function(x){return!this.eq(x)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(x){return this.comp(x)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(x){return this.comp(x)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(x){return this.comp(x)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(x){return this.comp(x)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(x){if(d(x)||(x=t(x)),this.eq(x))return 0;var M=this.isNegative(),C=x.isNegative();return M&&!C?-1:!M&&C?1:this.unsigned?x.high>>>0>this.high>>>0||x.high===this.high&&x.low>>>0>this.low>>>0?-1:1:this.sub(x).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(y)},E.neg=E.negate,E.add=function(x){d(x)||(x=t(x));var M=this.high>>>16,C=65535&this.high,k=this.low>>>16,V=65535&this.low,F=x.high>>>16,q=65535&x.high,D=x.low>>>16,U=0,J=0,Y=0,Z=0;return Y+=(Z+=V+(65535&x.low))>>>16,J+=(Y+=k+D)>>>16,U+=(J+=C+q)>>>16,U+=M+F,p((Y&=65535)<<16|(Z&=65535),(U&=65535)<<16|(J&=65535),this.unsigned)},E.subtract=function(x){return d(x)||(x=t(x)),this.add(x.neg())},E.sub=E.subtract,E.multiply=function(x){if(this.isZero())return g;if(d(x)||(x=t(x)),r)return p(r.mul(this.low,this.high,x.low,x.high),r.get_high(),this.unsigned);if(x.isZero())return g;if(this.eq(A))return x.isOdd()?A:g;if(x.eq(A))return this.isOdd()?A:g;if(this.isNegative())return x.isNegative()?this.neg().mul(x.neg()):this.neg().mul(x).neg();if(x.isNegative())return this.mul(x.neg()).neg();if(this.lt(u)&&x.lt(u))return h(this.toNumber()*x.toNumber(),this.unsigned);var M=this.high>>>16,C=65535&this.high,k=this.low>>>16,V=65535&this.low,F=x.high>>>16,q=65535&x.high,D=x.low>>>16,U=65535&x.low,J=0,Y=0,Z=0,te=0;return Z+=(te+=V*U)>>>16,Y+=(Z+=k*U)>>>16,Z&=65535,Y+=(Z+=V*D)>>>16,J+=(Y+=C*U)>>>16,Y&=65535,J+=(Y+=k*D)>>>16,Y&=65535,J+=(Y+=V*q)>>>16,J+=M*U+C*D+k*q+V*F,p((Z&=65535)<<16|(te&=65535),(J&=65535)<<16|(Y&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(x){if(d(x)||(x=t(x)),x.isZero())throw Error("division by zero");var M,C,k;if(r)return this.unsigned||this.high!==-2147483648||x.low!==-1||x.high!==-1?p((this.unsigned?r.div_u:r.div_s)(this.low,this.high,x.low,x.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:g;if(this.unsigned){if(x.unsigned||(x=x.toUnsigned()),x.gt(this))return b;if(x.gt(this.shru(1)))return _;k=b}else{if(this.eq(A))return x.eq(y)||x.eq(v)?A:x.eq(A)?y:(M=this.shr(1).div(x).shl(1)).eq(g)?x.isNegative()?y:v:(C=this.sub(x.mul(M)),k=M.add(C.div(x)));if(x.eq(A))return this.unsigned?b:g;if(this.isNegative())return x.isNegative()?this.neg().div(x.neg()):this.neg().div(x).neg();if(x.isNegative())return this.div(x.neg()).neg();k=g}for(C=this;C.gte(x);){M=Math.max(1,Math.floor(C.toNumber()/x.toNumber()));for(var V=Math.ceil(Math.log(M)/Math.LN2),F=V<=48?1:a(2,V-48),q=h(M),D=q.mul(x);D.isNegative()||D.gt(C);)D=(q=h(M-=F,this.unsigned)).mul(x);q.isZero()&&(q=y),k=k.add(q),C=C.sub(D)}return k},E.div=E.divide,E.modulo=function(x){return d(x)||(x=t(x)),r?p((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,x.low,x.high),r.get_high(),this.unsigned):this.sub(this.div(x).mul(x))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return p(~this.low,~this.high,this.unsigned)},E.and=function(x){return d(x)||(x=t(x)),p(this.low&x.low,this.high&x.high,this.unsigned)},E.or=function(x){return d(x)||(x=t(x)),p(this.low|x.low,this.high|x.high,this.unsigned)},E.xor=function(x){return d(x)||(x=t(x)),p(this.low^x.low,this.high^x.high,this.unsigned)},E.shiftLeft=function(x){return d(x)&&(x=x.toInt()),(x&=63)==0?this:x<32?p(this.low<>>32-x,this.unsigned):p(0,this.low<>>x|this.high<<32-x,this.high>>x,this.unsigned):p(this.high>>x-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(x){if(d(x)&&(x=x.toInt()),(x&=63)==0)return this;var M=this.high;return x<32?p(this.low>>>x|M<<32-x,M>>>x,this.unsigned):p(x===32?M:M>>>x-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?p(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:p(this.low,this.high,!0)},E.toBytes=function(x){return x?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var x=this.high,M=this.low;return[255&M,M>>>8&255,M>>>16&255,M>>>24,255&x,x>>>8&255,x>>>16&255,x>>>24]},E.toBytesBE=function(){var x=this.high,M=this.low;return[x>>>24,x>>>16&255,x>>>8&255,255&x,M>>>24,M>>>16&255,M>>>8&255,255&M]},c.fromBytes=function(x,M,C){return C?c.fromBytesLE(x,M):c.fromBytesBE(x,M)},c.fromBytesLE=function(x,M){return new c(x[0]|x[1]<<8|x[2]<<16|x[3]<<24,x[4]|x[5]<<8|x[6]<<16|x[7]<<24,M)},c.fromBytesBE=function(x,M){return new c(x[4]<<24|x[5]<<16|x[6]<<8|x[7],x[0]<<24|x[1]<<16|x[2]<<8|x[3],M)}},1446:(f,r,c)=>{var d,l,m,s=c(2100),h=s.Reader,p=s.Writer,a=s.util,o=s.roots.default||(s.roots.default={});o.onnx=((m={}).Version=(d={},(l=Object.create(d))[d[0]="_START_VERSION"]=0,l[d[1]="IR_VERSION_2017_10_10"]=1,l[d[2]="IR_VERSION_2017_10_30"]=2,l[d[3]="IR_VERSION_2017_11_3"]=3,l[d[4]="IR_VERSION_2019_1_22"]=4,l[d[5]="IR_VERSION"]=5,l),m.AttributeProto=function(){function t(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],e)for(var n=Object.keys(e),i=0;i>>3){case 1:u.name=e.string();break;case 21:u.refAttrName=e.string();break;case 13:u.docString=e.string();break;case 20:u.type=e.int32();break;case 2:u.f=e.float();break;case 3:u.i=e.int64();break;case 4:u.s=e.bytes();break;case 5:u.t=o.onnx.TensorProto.decode(e,e.uint32());break;case 6:u.g=o.onnx.GraphProto.decode(e,e.uint32());break;case 7:if(u.floats&&u.floats.length||(u.floats=[]),(7&g)==2)for(var b=e.uint32()+e.pos;e.pos>>0,e.i.high>>>0).toNumber())),e.s!=null&&(typeof e.s=="string"?a.base64.decode(e.s,n.s=a.newBuffer(a.base64.length(e.s)),0):e.s.length&&(n.s=e.s)),e.t!=null){if(typeof e.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");n.t=o.onnx.TensorProto.fromObject(e.t)}if(e.g!=null){if(typeof e.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");n.g=o.onnx.GraphProto.fromObject(e.g)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");n.floats=[];for(var i=0;i>>0,e.ints[i].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(n.strings=[],i=0;i>>0,e.i.high>>>0).toNumber():e.i),e.s!=null&&e.hasOwnProperty("s")&&(i.s=n.bytes===String?a.base64.encode(e.s,0,e.s.length):n.bytes===Array?Array.prototype.slice.call(e.s):e.s),e.t!=null&&e.hasOwnProperty("t")&&(i.t=o.onnx.TensorProto.toObject(e.t,n)),e.g!=null&&e.hasOwnProperty("g")&&(i.g=o.onnx.GraphProto.toObject(e.g,n)),e.floats&&e.floats.length){i.floats=[];for(var g=0;g>>0,e.ints[g].high>>>0).toNumber():e.ints[g];if(e.strings&&e.strings.length)for(i.strings=[],g=0;g>>3){case 1:u.name=e.string();break;case 2:u.type=o.onnx.TypeProto.decode(e,e.uint32());break;case 3:u.docString=e.string();break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(e.type!=null&&e.hasOwnProperty("type")){var n=o.onnx.TypeProto.verify(e.type);if(n)return"type."+n}return e.docString!=null&&e.hasOwnProperty("docString")&&!a.isString(e.docString)?"docString: string expected":null},t.fromObject=function(e){if(e instanceof o.onnx.ValueInfoProto)return e;var n=new o.onnx.ValueInfoProto;if(e.name!=null&&(n.name=String(e.name)),e.type!=null){if(typeof e.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");n.type=o.onnx.TypeProto.fromObject(e.type)}return e.docString!=null&&(n.docString=String(e.docString)),n},t.toObject=function(e,n){n||(n={});var i={};return n.defaults&&(i.name="",i.type=null,i.docString=""),e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.type!=null&&e.hasOwnProperty("type")&&(i.type=o.onnx.TypeProto.toObject(e.type,n)),e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),m.NodeProto=function(){function t(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var n=Object.keys(e),i=0;i>>3){case 1:u.input&&u.input.length||(u.input=[]),u.input.push(e.string());break;case 2:u.output&&u.output.length||(u.output=[]),u.output.push(e.string());break;case 3:u.name=e.string();break;case 4:u.opType=e.string();break;case 7:u.domain=e.string();break;case 5:u.attribute&&u.attribute.length||(u.attribute=[]),u.attribute.push(o.onnx.AttributeProto.decode(e,e.uint32()));break;case 6:u.docString=e.string();break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.input!=null&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var n=0;n>>3){case 1:u.irVersion=e.int64();break;case 8:u.opsetImport&&u.opsetImport.length||(u.opsetImport=[]),u.opsetImport.push(o.onnx.OperatorSetIdProto.decode(e,e.uint32()));break;case 2:u.producerName=e.string();break;case 3:u.producerVersion=e.string();break;case 4:u.domain=e.string();break;case 5:u.modelVersion=e.int64();break;case 6:u.docString=e.string();break;case 7:u.graph=o.onnx.GraphProto.decode(e,e.uint32());break;case 14:u.metadataProps&&u.metadataProps.length||(u.metadataProps=[]),u.metadataProps.push(o.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.irVersion!=null&&e.hasOwnProperty("irVersion")&&!(a.isInteger(e.irVersion)||e.irVersion&&a.isInteger(e.irVersion.low)&&a.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(e.opsetImport!=null&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var n=0;n>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");n.opsetImport=[];for(var i=0;i>>0,e.modelVersion.high>>>0).toNumber())),e.docString!=null&&(n.docString=String(e.docString)),e.graph!=null){if(typeof e.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");n.graph=o.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(n.metadataProps=[],i=0;i>>0,e.irVersion.high>>>0).toNumber():e.irVersion),e.producerName!=null&&e.hasOwnProperty("producerName")&&(i.producerName=e.producerName),e.producerVersion!=null&&e.hasOwnProperty("producerVersion")&&(i.producerVersion=e.producerVersion),e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.modelVersion!=null&&e.hasOwnProperty("modelVersion")&&(typeof e.modelVersion=="number"?i.modelVersion=n.longs===String?String(e.modelVersion):e.modelVersion:i.modelVersion=n.longs===String?a.Long.prototype.toString.call(e.modelVersion):n.longs===Number?new a.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.graph!=null&&e.hasOwnProperty("graph")&&(i.graph=o.onnx.GraphProto.toObject(e.graph,n)),e.opsetImport&&e.opsetImport.length){i.opsetImport=[];for(var g=0;g>>3){case 1:u.key=e.string();break;case 2:u.value=e.string();break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){return typeof e!="object"||e===null?"object expected":e.key!=null&&e.hasOwnProperty("key")&&!a.isString(e.key)?"key: string expected":e.value!=null&&e.hasOwnProperty("value")&&!a.isString(e.value)?"value: string expected":null},t.fromObject=function(e){if(e instanceof o.onnx.StringStringEntryProto)return e;var n=new o.onnx.StringStringEntryProto;return e.key!=null&&(n.key=String(e.key)),e.value!=null&&(n.value=String(e.value)),n},t.toObject=function(e,n){n||(n={});var i={};return n.defaults&&(i.key="",i.value=""),e.key!=null&&e.hasOwnProperty("key")&&(i.key=e.key),e.value!=null&&e.hasOwnProperty("value")&&(i.value=e.value),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),m.TensorAnnotation=function(){function t(e){if(this.quantParameterTensorNames=[],e)for(var n=Object.keys(e),i=0;i>>3){case 1:u.tensorName=e.string();break;case 2:u.quantParameterTensorNames&&u.quantParameterTensorNames.length||(u.quantParameterTensorNames=[]),u.quantParameterTensorNames.push(o.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.tensorName!=null&&e.hasOwnProperty("tensorName")&&!a.isString(e.tensorName))return"tensorName: string expected";if(e.quantParameterTensorNames!=null&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var n=0;n>>3){case 1:u.node&&u.node.length||(u.node=[]),u.node.push(o.onnx.NodeProto.decode(e,e.uint32()));break;case 2:u.name=e.string();break;case 5:u.initializer&&u.initializer.length||(u.initializer=[]),u.initializer.push(o.onnx.TensorProto.decode(e,e.uint32()));break;case 10:u.docString=e.string();break;case 11:u.input&&u.input.length||(u.input=[]),u.input.push(o.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 12:u.output&&u.output.length||(u.output=[]),u.output.push(o.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 13:u.valueInfo&&u.valueInfo.length||(u.valueInfo=[]),u.valueInfo.push(o.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 14:u.quantizationAnnotation&&u.quantizationAnnotation.length||(u.quantizationAnnotation=[]),u.quantizationAnnotation.push(o.onnx.TensorAnnotation.decode(e,e.uint32()));break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.node!=null&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var n=0;n>>3){case 1:if(u.dims&&u.dims.length||(u.dims=[]),(7&g)==2)for(var b=e.uint32()+e.pos;e.pos>>0,e.dims[i].high>>>0).toNumber())}if(e.dataType!=null&&(n.dataType=0|e.dataType),e.segment!=null){if(typeof e.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");n.segment=o.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(n.floatData=[],i=0;i>>0,e.int64Data[i].high>>>0).toNumber())}if(e.name!=null&&(n.name=String(e.name)),e.docString!=null&&(n.docString=String(e.docString)),e.rawData!=null&&(typeof e.rawData=="string"?a.base64.decode(e.rawData,n.rawData=a.newBuffer(a.base64.length(e.rawData)),0):e.rawData.length&&(n.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(n.externalData=[],i=0;i>>0,e.uint64Data[i].high>>>0).toNumber(!0))}return n},t.toObject=function(e,n){n||(n={});var i={};if((n.arrays||n.defaults)&&(i.dims=[],i.floatData=[],i.int32Data=[],i.stringData=[],i.int64Data=[],i.doubleData=[],i.uint64Data=[],i.externalData=[]),n.defaults&&(i.dataType=0,i.segment=null,i.name="",n.bytes===String?i.rawData="":(i.rawData=[],n.bytes!==Array&&(i.rawData=a.newBuffer(i.rawData))),i.docString="",i.dataLocation=n.enums===String?"DEFAULT":0),e.dims&&e.dims.length){i.dims=[];for(var u=0;u>>0,e.dims[u].high>>>0).toNumber():e.dims[u]}if(e.dataType!=null&&e.hasOwnProperty("dataType")&&(i.dataType=e.dataType),e.segment!=null&&e.hasOwnProperty("segment")&&(i.segment=o.onnx.TensorProto.Segment.toObject(e.segment,n)),e.floatData&&e.floatData.length)for(i.floatData=[],u=0;u>>0,e.int64Data[u].high>>>0).toNumber():e.int64Data[u];if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.rawData!=null&&e.hasOwnProperty("rawData")&&(i.rawData=n.bytes===String?a.base64.encode(e.rawData,0,e.rawData.length):n.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length)for(i.doubleData=[],u=0;u>>0,e.uint64Data[u].high>>>0).toNumber(!0):e.uint64Data[u];if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.externalData&&e.externalData.length)for(i.externalData=[],u=0;u>>3){case 1:g.begin=n.int64();break;case 2:g.end=n.int64();break;default:n.skipType(7&b)}}return g},e.decodeDelimited=function(n){return n instanceof h||(n=new h(n)),this.decode(n,n.uint32())},e.verify=function(n){return typeof n!="object"||n===null?"object expected":n.begin!=null&&n.hasOwnProperty("begin")&&!(a.isInteger(n.begin)||n.begin&&a.isInteger(n.begin.low)&&a.isInteger(n.begin.high))?"begin: integer|Long expected":n.end!=null&&n.hasOwnProperty("end")&&!(a.isInteger(n.end)||n.end&&a.isInteger(n.end.low)&&a.isInteger(n.end.high))?"end: integer|Long expected":null},e.fromObject=function(n){if(n instanceof o.onnx.TensorProto.Segment)return n;var i=new o.onnx.TensorProto.Segment;return n.begin!=null&&(a.Long?(i.begin=a.Long.fromValue(n.begin)).unsigned=!1:typeof n.begin=="string"?i.begin=parseInt(n.begin,10):typeof n.begin=="number"?i.begin=n.begin:typeof n.begin=="object"&&(i.begin=new a.LongBits(n.begin.low>>>0,n.begin.high>>>0).toNumber())),n.end!=null&&(a.Long?(i.end=a.Long.fromValue(n.end)).unsigned=!1:typeof n.end=="string"?i.end=parseInt(n.end,10):typeof n.end=="number"?i.end=n.end:typeof n.end=="object"&&(i.end=new a.LongBits(n.end.low>>>0,n.end.high>>>0).toNumber())),i},e.toObject=function(n,i){i||(i={});var u={};if(i.defaults){if(a.Long){var g=new a.Long(0,0,!1);u.begin=i.longs===String?g.toString():i.longs===Number?g.toNumber():g}else u.begin=i.longs===String?"0":0;a.Long?(g=new a.Long(0,0,!1),u.end=i.longs===String?g.toString():i.longs===Number?g.toNumber():g):u.end=i.longs===String?"0":0}return n.begin!=null&&n.hasOwnProperty("begin")&&(typeof n.begin=="number"?u.begin=i.longs===String?String(n.begin):n.begin:u.begin=i.longs===String?a.Long.prototype.toString.call(n.begin):i.longs===Number?new a.LongBits(n.begin.low>>>0,n.begin.high>>>0).toNumber():n.begin),n.end!=null&&n.hasOwnProperty("end")&&(typeof n.end=="number"?u.end=i.longs===String?String(n.end):n.end:u.end=i.longs===String?a.Long.prototype.toString.call(n.end):i.longs===Number?new a.LongBits(n.end.low>>>0,n.end.high>>>0).toNumber():n.end),u},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),t.DataLocation=function(){var e={},n=Object.create(e);return n[e[0]="DEFAULT"]=0,n[e[1]="EXTERNAL"]=1,n}(),t}(),m.TensorShapeProto=function(){function t(e){if(this.dim=[],e)for(var n=Object.keys(e),i=0;i>>3==1?(u.dim&&u.dim.length||(u.dim=[]),u.dim.push(o.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()))):e.skipType(7&g)}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.dim!=null&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var n=0;n>>3){case 1:b.dimValue=i.int64();break;case 2:b.dimParam=i.string();break;case 3:b.denotation=i.string();break;default:i.skipType(7&y)}}return b},e.decodeDelimited=function(i){return i instanceof h||(i=new h(i)),this.decode(i,i.uint32())},e.verify=function(i){if(typeof i!="object"||i===null)return"object expected";var u={};if(i.dimValue!=null&&i.hasOwnProperty("dimValue")&&(u.value=1,!(a.isInteger(i.dimValue)||i.dimValue&&a.isInteger(i.dimValue.low)&&a.isInteger(i.dimValue.high))))return"dimValue: integer|Long expected";if(i.dimParam!=null&&i.hasOwnProperty("dimParam")){if(u.value===1)return"value: multiple values";if(u.value=1,!a.isString(i.dimParam))return"dimParam: string expected"}return i.denotation!=null&&i.hasOwnProperty("denotation")&&!a.isString(i.denotation)?"denotation: string expected":null},e.fromObject=function(i){if(i instanceof o.onnx.TensorShapeProto.Dimension)return i;var u=new o.onnx.TensorShapeProto.Dimension;return i.dimValue!=null&&(a.Long?(u.dimValue=a.Long.fromValue(i.dimValue)).unsigned=!1:typeof i.dimValue=="string"?u.dimValue=parseInt(i.dimValue,10):typeof i.dimValue=="number"?u.dimValue=i.dimValue:typeof i.dimValue=="object"&&(u.dimValue=new a.LongBits(i.dimValue.low>>>0,i.dimValue.high>>>0).toNumber())),i.dimParam!=null&&(u.dimParam=String(i.dimParam)),i.denotation!=null&&(u.denotation=String(i.denotation)),u},e.toObject=function(i,u){u||(u={});var g={};return u.defaults&&(g.denotation=""),i.dimValue!=null&&i.hasOwnProperty("dimValue")&&(typeof i.dimValue=="number"?g.dimValue=u.longs===String?String(i.dimValue):i.dimValue:g.dimValue=u.longs===String?a.Long.prototype.toString.call(i.dimValue):u.longs===Number?new a.LongBits(i.dimValue.low>>>0,i.dimValue.high>>>0).toNumber():i.dimValue,u.oneofs&&(g.value="dimValue")),i.dimParam!=null&&i.hasOwnProperty("dimParam")&&(g.dimParam=i.dimParam,u.oneofs&&(g.value="dimParam")),i.denotation!=null&&i.hasOwnProperty("denotation")&&(g.denotation=i.denotation),g},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),t}(),m.TypeProto=function(){function t(n){if(n)for(var i=Object.keys(n),u=0;u>>3){case 1:g.tensorType=o.onnx.TypeProto.Tensor.decode(n,n.uint32());break;case 6:g.denotation=n.string();break;default:n.skipType(7&b)}}return g},t.decodeDelimited=function(n){return n instanceof h||(n=new h(n)),this.decode(n,n.uint32())},t.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.tensorType!=null&&n.hasOwnProperty("tensorType")){var i=o.onnx.TypeProto.Tensor.verify(n.tensorType);if(i)return"tensorType."+i}return n.denotation!=null&&n.hasOwnProperty("denotation")&&!a.isString(n.denotation)?"denotation: string expected":null},t.fromObject=function(n){if(n instanceof o.onnx.TypeProto)return n;var i=new o.onnx.TypeProto;if(n.tensorType!=null){if(typeof n.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");i.tensorType=o.onnx.TypeProto.Tensor.fromObject(n.tensorType)}return n.denotation!=null&&(i.denotation=String(n.denotation)),i},t.toObject=function(n,i){i||(i={});var u={};return i.defaults&&(u.denotation=""),n.tensorType!=null&&n.hasOwnProperty("tensorType")&&(u.tensorType=o.onnx.TypeProto.Tensor.toObject(n.tensorType,i),i.oneofs&&(u.value="tensorType")),n.denotation!=null&&n.hasOwnProperty("denotation")&&(u.denotation=n.denotation),u},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t.Tensor=function(){function n(i){if(i)for(var u=Object.keys(i),g=0;g>>3){case 1:b.elemType=i.int32();break;case 2:b.shape=o.onnx.TensorShapeProto.decode(i,i.uint32());break;default:i.skipType(7&y)}}return b},n.decodeDelimited=function(i){return i instanceof h||(i=new h(i)),this.decode(i,i.uint32())},n.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")&&!a.isInteger(i.elemType))return"elemType: integer expected";if(i.shape!=null&&i.hasOwnProperty("shape")){var u=o.onnx.TensorShapeProto.verify(i.shape);if(u)return"shape."+u}return null},n.fromObject=function(i){if(i instanceof o.onnx.TypeProto.Tensor)return i;var u=new o.onnx.TypeProto.Tensor;if(i.elemType!=null&&(u.elemType=0|i.elemType),i.shape!=null){if(typeof i.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");u.shape=o.onnx.TensorShapeProto.fromObject(i.shape)}return u},n.toObject=function(i,u){u||(u={});var g={};return u.defaults&&(g.elemType=0,g.shape=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(g.elemType=i.elemType),i.shape!=null&&i.hasOwnProperty("shape")&&(g.shape=o.onnx.TensorShapeProto.toObject(i.shape,u)),g},n.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},n}(),t}(),m.OperatorSetIdProto=function(){function t(e){if(e)for(var n=Object.keys(e),i=0;i>>3){case 1:u.domain=e.string();break;case 2:u.version=e.int64();break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){return typeof e!="object"||e===null?"object expected":e.domain!=null&&e.hasOwnProperty("domain")&&!a.isString(e.domain)?"domain: string expected":e.version!=null&&e.hasOwnProperty("version")&&!(a.isInteger(e.version)||e.version&&a.isInteger(e.version.low)&&a.isInteger(e.version.high))?"version: integer|Long expected":null},t.fromObject=function(e){if(e instanceof o.onnx.OperatorSetIdProto)return e;var n=new o.onnx.OperatorSetIdProto;return e.domain!=null&&(n.domain=String(e.domain)),e.version!=null&&(a.Long?(n.version=a.Long.fromValue(e.version)).unsigned=!1:typeof e.version=="string"?n.version=parseInt(e.version,10):typeof e.version=="number"?n.version=e.version:typeof e.version=="object"&&(n.version=new a.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),n},t.toObject=function(e,n){n||(n={});var i={};if(n.defaults)if(i.domain="",a.Long){var u=new a.Long(0,0,!1);i.version=n.longs===String?u.toString():n.longs===Number?u.toNumber():u}else i.version=n.longs===String?"0":0;return e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?i.version=n.longs===String?String(e.version):e.version:i.version=n.longs===String?a.Long.prototype.toString.call(e.version):n.longs===Number?new a.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),m),f.exports=o},2100:(f,r,c)=>{f.exports=c(9482)},9482:(f,r,c)=>{var d=r;function l(){d.util._configure(),d.Writer._configure(d.BufferWriter),d.Reader._configure(d.BufferReader)}d.build="minimal",d.Writer=c(1173),d.BufferWriter=c(3155),d.Reader=c(1408),d.BufferReader=c(593),d.util=c(9693),d.rpc=c(5994),d.roots=c(5054),d.configure=l,l()},1408:(f,r,c)=>{f.exports=p;var d,l=c(9693),m=l.LongBits,s=l.utf8;function h(u,g){return RangeError("index out of range: "+u.pos+" + "+(g||1)+" > "+u.len)}function p(u){this.buf=u,this.pos=0,this.len=u.length}var a,o=typeof Uint8Array<"u"?function(u){if(u instanceof Uint8Array||Array.isArray(u))return new p(u);throw Error("illegal buffer")}:function(u){if(Array.isArray(u))return new p(u);throw Error("illegal buffer")},t=function(){return l.Buffer?function(u){return(p.create=function(g){return l.Buffer.isBuffer(g)?new d(g):o(g)})(u)}:o};function e(){var u=new m(0,0),g=0;if(!(this.len-this.pos>4)){for(;g<3;++g){if(this.pos>=this.len)throw h(this);if(u.lo=(u.lo|(127&this.buf[this.pos])<<7*g)>>>0,this.buf[this.pos++]<128)return u}return u.lo=(u.lo|(127&this.buf[this.pos++])<<7*g)>>>0,u}for(;g<4;++g)if(u.lo=(u.lo|(127&this.buf[this.pos])<<7*g)>>>0,this.buf[this.pos++]<128)return u;if(u.lo=(u.lo|(127&this.buf[this.pos])<<28)>>>0,u.hi=(u.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return u;if(g=0,this.len-this.pos>4){for(;g<5;++g)if(u.hi=(u.hi|(127&this.buf[this.pos])<<7*g+3)>>>0,this.buf[this.pos++]<128)return u}else for(;g<5;++g){if(this.pos>=this.len)throw h(this);if(u.hi=(u.hi|(127&this.buf[this.pos])<<7*g+3)>>>0,this.buf[this.pos++]<128)return u}throw Error("invalid varint encoding")}function n(u,g){return(u[g-4]|u[g-3]<<8|u[g-2]<<16|u[g-1]<<24)>>>0}function i(){if(this.pos+8>this.len)throw h(this,8);return new m(n(this.buf,this.pos+=4),n(this.buf,this.pos+=4))}p.create=t(),p.prototype._slice=l.Array.prototype.subarray||l.Array.prototype.slice,p.prototype.uint32=(a=4294967295,function(){if(a=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(a=(a|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(a=(a|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(a=(a|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(a=(a|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return a;if((this.pos+=5)>this.len)throw this.pos=this.len,h(this,10);return a}),p.prototype.int32=function(){return 0|this.uint32()},p.prototype.sint32=function(){var u=this.uint32();return u>>>1^-(1&u)|0},p.prototype.bool=function(){return this.uint32()!==0},p.prototype.fixed32=function(){if(this.pos+4>this.len)throw h(this,4);return n(this.buf,this.pos+=4)},p.prototype.sfixed32=function(){if(this.pos+4>this.len)throw h(this,4);return 0|n(this.buf,this.pos+=4)},p.prototype.float=function(){if(this.pos+4>this.len)throw h(this,4);var u=l.float.readFloatLE(this.buf,this.pos);return this.pos+=4,u},p.prototype.double=function(){if(this.pos+8>this.len)throw h(this,4);var u=l.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,u},p.prototype.bytes=function(){var u=this.uint32(),g=this.pos,b=this.pos+u;if(b>this.len)throw h(this,u);return this.pos+=u,Array.isArray(this.buf)?this.buf.slice(g,b):g===b?new this.buf.constructor(0):this._slice.call(this.buf,g,b)},p.prototype.string=function(){var u=this.bytes();return s.read(u,0,u.length)},p.prototype.skip=function(u){if(typeof u=="number"){if(this.pos+u>this.len)throw h(this,u);this.pos+=u}else do if(this.pos>=this.len)throw h(this);while(128&this.buf[this.pos++]);return this},p.prototype.skipType=function(u){switch(u){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(u=7&this.uint32())!=4;)this.skipType(u);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+u+" at offset "+this.pos)}return this},p._configure=function(u){d=u,p.create=t(),d._configure();var g=l.Long?"toLong":"toNumber";l.merge(p.prototype,{int64:function(){return e.call(this)[g](!1)},uint64:function(){return e.call(this)[g](!0)},sint64:function(){return e.call(this).zzDecode()[g](!1)},fixed64:function(){return i.call(this)[g](!0)},sfixed64:function(){return i.call(this)[g](!1)}})}},593:(f,r,c)=>{f.exports=m;var d=c(1408);(m.prototype=Object.create(d.prototype)).constructor=m;var l=c(9693);function m(s){d.call(this,s)}m._configure=function(){l.Buffer&&(m.prototype._slice=l.Buffer.prototype.slice)},m.prototype.string=function(){var s=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+s,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+s,this.len))},m._configure()},5054:f=>{f.exports={}},5994:(f,r,c)=>{r.Service=c(7948)},7948:(f,r,c)=>{f.exports=l;var d=c(9693);function l(m,s,h){if(typeof m!="function")throw TypeError("rpcImpl must be a function");d.EventEmitter.call(this),this.rpcImpl=m,this.requestDelimited=!!s,this.responseDelimited=!!h}(l.prototype=Object.create(d.EventEmitter.prototype)).constructor=l,l.prototype.rpcCall=function m(s,h,p,a,o){if(!a)throw TypeError("request must be specified");var t=this;if(!o)return d.asPromise(m,t,s,h,p,a);if(t.rpcImpl)try{return t.rpcImpl(s,h[t.requestDelimited?"encodeDelimited":"encode"](a).finish(),function(e,n){if(e)return t.emit("error",e,s),o(e);if(n!==null){if(!(n instanceof p))try{n=p[t.responseDelimited?"decodeDelimited":"decode"](n)}catch(i){return t.emit("error",i,s),o(i)}return t.emit("data",n,s),o(null,n)}t.end(!0)})}catch(e){return t.emit("error",e,s),void setTimeout(function(){o(e)},0)}else setTimeout(function(){o(Error("already ended"))},0)},l.prototype.end=function(m){return this.rpcImpl&&(m||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(f,r,c)=>{f.exports=l;var d=c(9693);function l(p,a){this.lo=p>>>0,this.hi=a>>>0}var m=l.zero=new l(0,0);m.toNumber=function(){return 0},m.zzEncode=m.zzDecode=function(){return this},m.length=function(){return 1};var s=l.zeroHash="\0\0\0\0\0\0\0\0";l.fromNumber=function(p){if(p===0)return m;var a=p<0;a&&(p=-p);var o=p>>>0,t=(p-o)/4294967296>>>0;return a&&(t=~t>>>0,o=~o>>>0,++o>4294967295&&(o=0,++t>4294967295&&(t=0))),new l(o,t)},l.from=function(p){if(typeof p=="number")return l.fromNumber(p);if(d.isString(p)){if(!d.Long)return l.fromNumber(parseInt(p,10));p=d.Long.fromString(p)}return p.low||p.high?new l(p.low>>>0,p.high>>>0):m},l.prototype.toNumber=function(p){if(!p&&this.hi>>>31){var a=1+~this.lo>>>0,o=~this.hi>>>0;return a||(o=o+1>>>0),-(a+4294967296*o)}return this.lo+4294967296*this.hi},l.prototype.toLong=function(p){return d.Long?new d.Long(0|this.lo,0|this.hi,!!p):{low:0|this.lo,high:0|this.hi,unsigned:!!p}};var h=String.prototype.charCodeAt;l.fromHash=function(p){return p===s?m:new l((h.call(p,0)|h.call(p,1)<<8|h.call(p,2)<<16|h.call(p,3)<<24)>>>0,(h.call(p,4)|h.call(p,5)<<8|h.call(p,6)<<16|h.call(p,7)<<24)>>>0)},l.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},l.prototype.zzEncode=function(){var p=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^p)>>>0,this.lo=(this.lo<<1^p)>>>0,this},l.prototype.zzDecode=function(){var p=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^p)>>>0,this.hi=(this.hi>>>1^p)>>>0,this},l.prototype.length=function(){var p=this.lo,a=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?a===0?p<16384?p<128?1:2:p<2097152?3:4:a<16384?a<128?5:6:a<2097152?7:8:o<128?9:10}},9693:function(f,r,c){var d=r;function l(s,h,p){for(var a=Object.keys(h),o=0;o0)},d.Buffer=function(){try{var s=d.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),d._Buffer_from=null,d._Buffer_allocUnsafe=null,d.newBuffer=function(s){return typeof s=="number"?d.Buffer?d._Buffer_allocUnsafe(s):new d.Array(s):d.Buffer?d._Buffer_from(s):typeof Uint8Array>"u"?s:new Uint8Array(s)},d.Array=typeof Uint8Array<"u"?Uint8Array:Array,d.Long=d.global.dcodeIO&&d.global.dcodeIO.Long||d.global.Long||d.inquire("long"),d.key2Re=/^true|false|0|1$/,d.key32Re=/^-?(?:0|[1-9][0-9]*)$/,d.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,d.longToHash=function(s){return s?d.LongBits.from(s).toHash():d.LongBits.zeroHash},d.longFromHash=function(s,h){var p=d.LongBits.fromHash(s);return d.Long?d.Long.fromBits(p.lo,p.hi,h):p.toNumber(!!h)},d.merge=l,d.lcFirst=function(s){return s.charAt(0).toLowerCase()+s.substring(1)},d.newError=m,d.ProtocolError=m("ProtocolError"),d.oneOfGetter=function(s){for(var h={},p=0;p-1;--o)if(h[a[o]]===1&&this[a[o]]!==void 0&&this[a[o]]!==null)return a[o]}},d.oneOfSetter=function(s){return function(h){for(var p=0;p{f.exports=t;var d,l=c(9693),m=l.LongBits,s=l.base64,h=l.utf8;function p(y,_,v){this.fn=y,this.len=_,this.next=void 0,this.val=v}function a(){}function o(y){this.head=y.head,this.tail=y.tail,this.len=y.len,this.next=y.states}function t(){this.len=0,this.head=new p(a,0,0),this.tail=this.head,this.states=null}var e=function(){return l.Buffer?function(){return(t.create=function(){return new d})()}:function(){return new t}};function n(y,_,v){_[v]=255&y}function i(y,_){this.len=y,this.next=void 0,this.val=_}function u(y,_,v){for(;y.hi;)_[v++]=127&y.lo|128,y.lo=(y.lo>>>7|y.hi<<25)>>>0,y.hi>>>=7;for(;y.lo>127;)_[v++]=127&y.lo|128,y.lo=y.lo>>>7;_[v++]=y.lo}function g(y,_,v){_[v]=255&y,_[v+1]=y>>>8&255,_[v+2]=y>>>16&255,_[v+3]=y>>>24}t.create=e(),t.alloc=function(y){return new l.Array(y)},l.Array!==Array&&(t.alloc=l.pool(t.alloc,l.Array.prototype.subarray)),t.prototype._push=function(y,_,v){return this.tail=this.tail.next=new p(y,_,v),this.len+=_,this},i.prototype=Object.create(p.prototype),i.prototype.fn=function(y,_,v){for(;y>127;)_[v++]=127&y|128,y>>>=7;_[v]=y},t.prototype.uint32=function(y){return this.len+=(this.tail=this.tail.next=new i((y>>>=0)<128?1:y<16384?2:y<2097152?3:y<268435456?4:5,y)).len,this},t.prototype.int32=function(y){return y<0?this._push(u,10,m.fromNumber(y)):this.uint32(y)},t.prototype.sint32=function(y){return this.uint32((y<<1^y>>31)>>>0)},t.prototype.uint64=function(y){var _=m.from(y);return this._push(u,_.length(),_)},t.prototype.int64=t.prototype.uint64,t.prototype.sint64=function(y){var _=m.from(y).zzEncode();return this._push(u,_.length(),_)},t.prototype.bool=function(y){return this._push(n,1,y?1:0)},t.prototype.fixed32=function(y){return this._push(g,4,y>>>0)},t.prototype.sfixed32=t.prototype.fixed32,t.prototype.fixed64=function(y){var _=m.from(y);return this._push(g,4,_.lo)._push(g,4,_.hi)},t.prototype.sfixed64=t.prototype.fixed64,t.prototype.float=function(y){return this._push(l.float.writeFloatLE,4,y)},t.prototype.double=function(y){return this._push(l.float.writeDoubleLE,8,y)};var b=l.Array.prototype.set?function(y,_,v){_.set(y,v)}:function(y,_,v){for(var w=0;w>>0;if(!_)return this._push(n,1,0);if(l.isString(y)){var v=t.alloc(_=s.length(y));s.decode(y,v,0),y=v}return this.uint32(_)._push(b,_,y)},t.prototype.string=function(y){var _=h.length(y);return _?this.uint32(_)._push(h.write,_,y):this._push(n,1,0)},t.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new p(a,0,0),this.len=0,this},t.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new p(a,0,0),this.len=0),this},t.prototype.ldelim=function(){var y=this.head,_=this.tail,v=this.len;return this.reset().uint32(v),v&&(this.tail.next=y.next,this.tail=_,this.len+=v),this},t.prototype.finish=function(){for(var y=this.head.next,_=this.constructor.alloc(this.len),v=0;y;)y.fn(y.val,_,v),v+=y.len,y=y.next;return _},t._configure=function(y){d=y,t.create=e(),d._configure()}},3155:(f,r,c)=>{f.exports=m;var d=c(1173);(m.prototype=Object.create(d.prototype)).constructor=m;var l=c(9693);function m(){d.call(this)}function s(h,p,a){h.length<40?l.utf8.write(h,p,a):p.utf8Write?p.utf8Write(h,a):p.write(h,a)}m._configure=function(){m.alloc=l._Buffer_allocUnsafe,m.writeBytesBuffer=l.Buffer&&l.Buffer.prototype instanceof Uint8Array&&l.Buffer.prototype.set.name==="set"?function(h,p,a){p.set(h,a)}:function(h,p,a){if(h.copy)h.copy(p,a,0,h.length);else for(var o=0;o>>0;return this.uint32(p),p&&this._push(m.writeBytesBuffer,p,h),this},m.prototype.string=function(h){var p=l.Buffer.byteLength(h);return this.uint32(p),p&&this._push(s,p,h),this},m._configure()},7714:(f,r,c)=>{r.R=void 0;const d=c(6919),l=c(7448);r.R=new class{async init(){}async createSessionHandler(m,s){const h=new d.Session(s);return await h.loadModel(m),new l.OnnxjsSessionHandler(h)}}},4200:(f,r,c)=>{r.c8=r.rX=void 0;const d=c(1670),l=c(5381),m=c(2157),s=c(2306);r.rX=()=>{if((typeof d.env.wasm.initTimeout!="number"||d.env.wasm.initTimeout<0)&&(d.env.wasm.initTimeout=0),typeof d.env.wasm.simd!="boolean"&&(d.env.wasm.simd=!0),typeof d.env.wasm.proxy!="boolean"&&(d.env.wasm.proxy=!1),typeof d.env.wasm.numThreads!="number"||!Number.isInteger(d.env.wasm.numThreads)||d.env.wasm.numThreads<=0){const h=typeof navigator>"u"?(0,l.cpus)().length:navigator.hardwareConcurrency;d.env.wasm.numThreads=Math.min(4,Math.ceil((h||1)/2))}},r.c8=new class{async init(){(0,r.rX)(),await(0,m.initWasm)()}async createSessionHandler(h,p){const a=new s.OnnxruntimeWebAssemblySessionHandler;return await a.loadModel(h,p),Promise.resolve(a)}}},6018:function(f,r,c){var d=this&&this.__createBinding||(Object.create?function(s,h,p,a){a===void 0&&(a=p);var o=Object.getOwnPropertyDescriptor(h,p);o&&!("get"in o?!h.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return h[p]}}),Object.defineProperty(s,a,o)}:function(s,h,p,a){a===void 0&&(a=p),s[a]=h[p]}),l=this&&this.__exportStar||function(s,h){for(var p in s)p==="default"||Object.prototype.hasOwnProperty.call(h,p)||d(h,s,p)};Object.defineProperty(r,"__esModule",{value:!0}),l(c(1670),r);const m=c(1670);{const s=c(7714).R;(0,m.registerBackend)("webgl",s,-10)}{const s=c(4200).c8;(0,m.registerBackend)("cpu",s,10),(0,m.registerBackend)("wasm",s,10),(0,m.registerBackend)("xnnpack",s,9)}},246:(f,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createAttributeWithCacheKey=void 0;class c{constructor(l){Object.assign(this,l)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(l=>`${this[l]}`).join(";")),this._cacheKey}}r.createAttributeWithCacheKey=d=>new c(d)},7778:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Attribute=void 0;const d=c(1446),l=c(9395),m=c(9162),s=c(2517);var h=l.onnxruntime.experimental.fbs;class p{constructor(o){if(this._attributes=new Map,o!=null){for(const t of o)t instanceof d.onnx.AttributeProto?this._attributes.set(t.name,[p.getValue(t),p.getType(t)]):t instanceof h.Attribute&&this._attributes.set(t.name(),[p.getValue(t),p.getType(t)]);if(this._attributes.sizem.Tensor.fromProto(n));if(o instanceof h.Attribute)return e.map(n=>m.Tensor.fromOrtTensor(n))}if(t===d.onnx.AttributeProto.AttributeType.STRING&&o instanceof d.onnx.AttributeProto){const n=e;return(0,s.decodeUtf8String)(n)}return t===d.onnx.AttributeProto.AttributeType.STRINGS&&o instanceof d.onnx.AttributeProto?e.map(s.decodeUtf8String):e}static getValueNoCheck(o){return o instanceof d.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(o):this.getValueNoCheckFromOrtFormat(o)}static getValueNoCheckFromOnnxFormat(o){switch(o.type){case d.onnx.AttributeProto.AttributeType.FLOAT:return o.f;case d.onnx.AttributeProto.AttributeType.INT:return o.i;case d.onnx.AttributeProto.AttributeType.STRING:return o.s;case d.onnx.AttributeProto.AttributeType.TENSOR:return o.t;case d.onnx.AttributeProto.AttributeType.GRAPH:return o.g;case d.onnx.AttributeProto.AttributeType.FLOATS:return o.floats;case d.onnx.AttributeProto.AttributeType.INTS:return o.ints;case d.onnx.AttributeProto.AttributeType.STRINGS:return o.strings;case d.onnx.AttributeProto.AttributeType.TENSORS:return o.tensors;case d.onnx.AttributeProto.AttributeType.GRAPHS:return o.graphs;default:throw new Error(`unsupported attribute type: ${d.onnx.AttributeProto.AttributeType[o.type]}`)}}static getValueNoCheckFromOrtFormat(o){switch(o.type()){case h.AttributeType.FLOAT:return o.f();case h.AttributeType.INT:return o.i();case h.AttributeType.STRING:return o.s();case h.AttributeType.TENSOR:return o.t();case h.AttributeType.GRAPH:return o.g();case h.AttributeType.FLOATS:return o.floatsArray();case h.AttributeType.INTS:{const t=[];for(let e=0;e{Object.defineProperty(r,"__esModule",{value:!0}),r.resolveBackend=r.backend=void 0;const d=c(5038),l=new Map;async function m(s){const h=r.backend;if(h[s]!==void 0&&function(p){const a=p;return"initialize"in a&&typeof a.initialize=="function"&&"createSessionHandler"in a&&typeof a.createSessionHandler=="function"&&"dispose"in a&&typeof a.dispose=="function"}(h[s])){const p=h[s];let a=p.initialize();if(typeof a=="object"&&"then"in a&&(a=await a),a)return l.set(s,p),p}}r.backend={webgl:new d.WebGLBackend},r.resolveBackend=async function s(h){if(!h)return s(["webgl"]);{const p=typeof h=="string"?[h]:h;for(const a of p){const o=l.get(a);if(o)return o;const t=await m(a);if(t)return t}}throw new Error("no available backend to use")}},5038:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WebGLBackend=void 0;const d=c(1670),l=c(6231),m=c(6416),s=c(7305);r.WebGLBackend=class{get contextId(){return d.env.webgl.contextId}set contextId(h){d.env.webgl.contextId=h}get matmulMaxBatchSize(){return d.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(h){d.env.webgl.matmulMaxBatchSize=h}get textureCacheMode(){return d.env.webgl.textureCacheMode}set textureCacheMode(h){d.env.webgl.textureCacheMode=h}get pack(){return d.env.webgl.pack}set pack(h){d.env.webgl.pack=h}get async(){return d.env.webgl.async}set async(h){d.env.webgl.async=h}initialize(){try{return this.glContext=(0,s.createWebGLContext)(this.contextId),typeof this.matmulMaxBatchSize!="number"&&(this.matmulMaxBatchSize=16),typeof this.textureCacheMode!="string"&&(this.textureCacheMode="full"),typeof this.pack!="boolean"&&(this.pack=!1),typeof this.async!="boolean"&&(this.async=!1),l.Logger.setWithEnv(d.env),l.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(h){return l.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${h}`),!1}}createSessionHandler(h){return new m.WebGLSessionHandler(this,h)}dispose(){this.glContext.dispose()}}},5107:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoordsGlslLib=void 0;const d=c(2517),l=c(8520),m=c(5060),s=c(7859),h=c(9390);class p extends l.GlslLib{constructor(o){super(o)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new l.GlslLibRoutine(` - vec2 offsetToCoords(int offset, int width, int height) { - int t = offset / width; - int s = offset - t*width; - vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height); - return coords; - } - `)}}coordsToOffset(){return{coordsToOffset:new l.GlslLibRoutine(` - int coordsToOffset(vec2 coords, int width, int height) { - float s = coords.s * float(width); - float t = coords.t * float(height); - int offset = int(t) * width + int(s); - return offset; - } - `)}}getOutputSamplingSnippet(){const o=this.context.outputTextureLayout;return o.isPacked?this.getPackedOutputSamplingSnippet(o):this.getUnpackedOutputSamplingSnippet(o)}getPackedOutputSamplingSnippet(o){const t=o.unpackedShape,e=[o.width,o.height],n={},i="getOutputCoords";switch(t.length){case 0:n[i]=this.getOutputScalarCoords();break;case 1:n[i]=this.getOutputPacked1DCoords(t,e);break;case 2:n[i]=this.getOutputPacked2DCoords(t,e);break;case 3:n[i]=this.getOutputPacked3DCoords(t,e);break;default:n[i]=this.getOutputPackedNDCoords(t,e)}const u=` - void setOutput(vec4 val) { - ${(0,m.getGlsl)(this.context.glContext.version).output} = val; - } - `;return n.floatTextureSetRGBA=new l.GlslLibRoutine(u),n}getUnpackedOutputSamplingSnippet(o){const t=o.unpackedShape,e=[o.width,o.height],n={},i="getOutputCoords";switch(t.length){case 0:n[i]=this.getOutputScalarCoords();break;case 1:n[i]=this.getOutputUnpacked1DCoords(t,e);break;case 2:n[i]=this.getOutputUnpacked2DCoords(t,e);break;case 3:n[i]=this.getOutputUnpacked3DCoords(t,e);break;case 4:n[i]=this.getOutputUnpacked4DCoords(t,e);break;case 5:n[i]=this.getOutputUnpacked5DCoords(t,e);break;case 6:n[i]=this.getOutputUnpacked6DCoords(t,e);break;default:throw new Error(`Unsupported output dimensionality: ${t.length}`)}const u=` - void setOutput(float val) { - ${(0,m.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0); - } - `;return n.floatTextureSetR=new l.GlslLibRoutine(u),n}getOutputScalarCoords(){return new l.GlslLibRoutine(` - int getOutputCoords() { - return 0; - } - `)}getOutputPacked1DCoords(o,t){const e=t;let n="";return e[0]===1?(n=` - int getOutputCoords() { - return 2 * int(TexCoords.y * ${e[1]}.0); - } - `,new l.GlslLibRoutine(n)):e[1]===1?(n=` - int getOutputCoords() { - return 2 * int(TexCoords.x * ${e[0]}.0); - } - `,new l.GlslLibRoutine(n)):(n=` - int getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${e[0]}, ${e[1]})); - return 2 * (resTexRC.y * ${e[0]} + resTexRC.x); - } - `,new l.GlslLibRoutine(n))}getOutputPacked2DCoords(o,t){let e="";if(d.ArrayUtil.arraysEqual(o,t))return e=` - ivec2 getOutputCoords() { - return 2 * ivec2(TexCoords.xy * vec2(${t[0]}, ${t[1]})); - } - `,new l.GlslLibRoutine(e);const n=t,i=Math.ceil(o[1]/2);return e=` - ivec2 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${n[0]}, ${n[1]})); - - int index = resTexRC.y * ${n[0]} + resTexRC.x; - - // reverse r and c order for packed texture - int r = imod(index, ${i}) * 2; - int c = 2 * (index / ${i}); - - return ivec2(r, c); - } - `,new l.GlslLibRoutine(e)}getOutputPacked3DCoords(o,t){const e=[t[0],t[1]],n=Math.ceil(o[2]/2),i=n*Math.ceil(o[1]/2),u=` - ivec3 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${e[0]}, ${e[1]})); - int index = resTexRC.y * ${e[0]} + resTexRC.x; - - int b = index / ${i}; - index -= b * ${i}; - - // reverse r and c order for packed texture - int r = imod(index, ${n}) * 2; - int c = 2 * (index / ${n}); - - return ivec3(b, r, c); - } - `;return new l.GlslLibRoutine(u)}getOutputPackedNDCoords(o,t){const e=[t[0],t[1]],n=Math.ceil(o[o.length-1]/2),i=n*Math.ceil(o[o.length-2]/2);let u=i,g="",b="b, r, c";for(let _=2;_=0;--b)i[b]=i[b+1]*o[b+1];const u=["r","c","d"],g=i.map((b,y)=>`int ${u[y]} = index / ${b}; ${y===i.length-1?`int ${u[y+1]} = index - ${u[y]} * ${b}`:`index -= ${u[y]} * ${b}`};`).join("");return e=` - ivec3 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${t[0]}, ${t[1]})); - int index = resTexRC.y * ${t[0]} + resTexRC.x; - ${g} - return ivec3(r, c, d); - } - `,new l.GlslLibRoutine(e)}getOutputUnpacked4DCoords(o,t){let e="";const n=o.length;let i=null;n<2&&(i=[]),i=new Array(n-1),i[n-2]=o[n-1];for(let b=n-3;b>=0;--b)i[b]=i[b+1]*o[b+1];const u=["r","c","d","d2"],g=i.map((b,y)=>`int ${u[y]} = index / ${b}; ${y===i.length-1?`int ${u[y+1]} = index - ${u[y]} * ${b}`:`index -= ${u[y]} * ${b}`};`).join("");return e=` - ivec4 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${t[0]}, ${t[1]})); - int index = resTexRC.y * ${t[0]} + resTexRC.x; - ${g} - return ivec4(r, c, d, d2); - } - `,new l.GlslLibRoutine(e)}getOutputUnpacked5DCoords(o,t){let e="";const n=o.length;let i=null;n<2&&(i=[]),i=new Array(n-1),i[n-2]=o[n-1];for(let b=n-3;b>=0;--b)i[b]=i[b+1]*o[b+1];const u=["r","c","d","d2","d3"],g=i.map((b,y)=>`int ${u[y]} = index / ${b}; ${y===i.length-1?`int ${u[y+1]} = index - ${u[y]} * ${b}`:`index -= ${u[y]} * ${b}`};`).join("");return e=` - ivec5 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${t[0]}, ${t[1]})); - int index = resTexRC.y * ${t[0]} + resTexRC.x; - ${g} - return ivec5(r, c, d, d2, d3); - } - `,new l.GlslLibRoutine(e)}getOutputUnpacked6DCoords(o,t){let e="";const n=o.length;let i=null;n<2&&(i=[]),i=new Array(n-1),i[n-2]=o[n-1];for(let b=n-3;b>=0;--b)i[b]=i[b+1]*o[b+1];const u=["r","c","d","d2","d3","d4"],g=i.map((b,y)=>`int ${u[y]} = index / ${b}; ${y===i.length-1?`int ${u[y+1]} = index - ${u[y]} * ${b}`:`index -= ${u[y]} * ${b}`};`).join("");return e=` - ivec6 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${t[0]}, ${t[1]})); - int index = resTexRC.y * ${t[0]} + resTexRC.x; - ${g} - return ivec6(r, c, d, d2, d3, d4); - } - `,new l.GlslLibRoutine(e)}getCommonUtilFuncs(){const o={};let t="uvFromFlat";o[t]=new l.GlslLibRoutine(` - vec2 uvFromFlat(int texNumR, int texNumC, int index) { - int texC = index / texNumR; - int texR = index - texC * texNumR; - // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to - // v. - return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC); - } - `),t="packedUVfrom1D",o[t]=new l.GlslLibRoutine(` - vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { - int texelIndex = index / 2; - int texR = texelIndex / texNumC; - int texC = texelIndex - texR * texNumC; - return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); - } - `),t="packedUVfrom2D",o[t]=new l.GlslLibRoutine(` - vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) { - int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); - int texR = texelIndex / texNumC; - int texC = texelIndex - texR * texNumC; - return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); - } - `),t="packedUVfrom3D",o[t]=new l.GlslLibRoutine(` - vec2 packedUVfrom3D(int texNumR, int texNumC, - int texelsInBatch, int texelsInLogicalRow, int b, - int row, int col) { - int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); - int texR = index / texNumC; - int texC = index - texR * texNumC; - return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); - } - `),t="sampleTexture";const e=(0,m.getGlsl)(this.context.glContext.version);return o[t]=new l.GlslLibRoutine(` - float sampleTexture(sampler2D textureSampler, vec2 uv) { - return ${e.texture2D}(textureSampler, uv).r; - }`),o}getInputsSamplingSnippets(){const o={},t=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((e,n)=>{const i=this.context.inputTextureLayouts[n],u=(0,h.generateShaderFuncNameFromInputSamplerName)(e);i.isPacked?o[u]=this.getPackedSamplerFromInput(u,e,i):o[u]=this.getUnpackedSamplerFromInput(u,e,i);const g=(0,h.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(e);i.unpackedShape.length<=t.unpackedShape.length&&(i.isPacked?o[g]=this.getPackedSamplerAtOutputCoords(g,i,t,e):o[g]=this.getUnpackedSamplerAtOutputCoords(g,i,t,e))}),o}getPackedSamplerAtOutputCoords(o,t,e,n){const i=t.unpackedShape,u=e.unpackedShape,g=n,b=(0,h.generateShaderFuncNameFromInputSamplerName)(g),y=i.length,_=u.length,v=d.BroadcastUtil.getBroadcastDims(i,u),w=(0,h.getCoordsDataType)(_),T=_-y;let A;const E=(0,h.getGlChannels)();A=y===0?"":_<2&&v.length>=1?"coords = 0;":v.map(F=>`coords.${E[F+T]} = 0;`).join(` -`);let x="";x=_<2&&y>0?"coords":i.map((F,q)=>`coords.${E[q+T]}`).join(", ");let M="return outputValue;";const C=d.ShapeUtil.size(i)===1,k=d.ShapeUtil.size(u)===1;if(y!==1||C||k){if(C&&!k)M=_===1?` - return vec4(outputValue.x, outputValue.x, 0., 0.); - `:` - return vec4(outputValue.x); - `;else if(v.length){const F=y-2,q=y-1;v.indexOf(F)>-1&&v.indexOf(q)>-1?M="return vec4(outputValue.x);":v.indexOf(F)>-1?M="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":v.indexOf(q)>-1&&(M="return vec4(outputValue.xx, outputValue.zz);")}}else M=` - return vec4(outputValue.xy, outputValue.xy); - `;const V=` - vec4 ${o}() { - ${w} coords = getOutputCoords(); - - int lastDim = coords.${E[_-1]}; - coords.${E[_-1]} = coords.${E[_-2]}; - coords.${E[_-2]} = lastDim; - - ${A} - vec4 outputValue = ${b}(${x}); - ${M} - } - `;return new l.GlslLibRoutine(V,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(o,t,e,n){const i=[e.width,e.height],u=[t.width,t.height],g=t.unpackedShape.length,b=e.unpackedShape.length,y=t.unpackedShape,_=e.unpackedShape,v=(0,h.generateShaderFuncNameFromInputSamplerName)(n);if(g===b&&d.ArrayUtil.arraysEqual(u,i)){const k=` - float ${o}() { - return sampleTexture(${n}, TexCoords); - } - `;return new l.GlslLibRoutine(k,["coordinates.sampleTexture"])}const w=(0,h.getCoordsDataType)(b),T=d.BroadcastUtil.getBroadcastDims(y,_),A=b-g;let E;const x=(0,h.getGlChannels)();E=g===0?"":b<2&&T.length>=1?"coords = 0;":T.map(k=>`coords.${x[k+A]} = 0;`).join(` -`);let M="";M=b<2&&g>0?"coords":t.unpackedShape.map((k,V)=>`coords.${x[V+A]}`).join(", ");const C=` - float ${o}() { - ${w} coords = getOutputCoords(); - ${E} - return ${v}(${M}); - } - `;return new l.GlslLibRoutine(C,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(o,t,e){switch(e.unpackedShape.length){case 0:return this.getPackedSamplerScalar(o,t);case 1:return this.getPackedSampler1D(o,t,e);case 2:return this.getPackedSampler2D(o,t,e);case 3:return this.getPackedSampler3D(o,t,e);default:return this.getPackedSamplerND(o,t,e)}}getUnpackedSamplerFromInput(o,t,e){const n=e.unpackedShape;switch(n.length){case 0:return this.getUnpackedSamplerScalar(o,t,e);case 1:return this.getUnpackedSampler1D(o,t,e);case 2:return this.getUnpackedSampler2D(o,t,e);case 3:return this.getUnpackedSampler3D(o,t,e);case 4:return this.getUnpackedSampler4D(o,t,e);case 5:return this.getUnpackedSampler5D(o,t,e);case 6:return this.getUnpackedSampler6D(o,t,e);default:throw new Error(`Unsupported dimension ${n.length}-D`)}}getPackedSamplerScalar(o,t){const e=` - vec4 ${o}() { - return ${(0,m.getGlsl)(this.context.glContext.version).texture2D}(${t}, halfCR); - } - `;return new l.GlslLibRoutine(e)}getPackedSampler1D(o,t,e){const n=[e.width,e.height],i=[n[1],n[0]],u=(0,m.getGlsl)(this.context.glContext.version),g=`vec4 ${o}(int index) { - vec2 uv = packedUVfrom1D( - ${i[0]}, ${i[1]}, index); - return ${u.texture2D}(${t}, uv); - }`;return new l.GlslLibRoutine(g,["coordinates.packedUVfrom1D"])}getPackedSampler2D(o,t,e){const n=e.unpackedShape,i=[e.width,e.height],u=(0,m.getGlsl)(this.context.glContext.version),g=i[0],b=i[1];if(i!=null&&d.ArrayUtil.arraysEqual(n,i)){const w=`vec4 ${o}(int row, int col) { - vec2 uv = (vec2(col, row) + halfCR) / vec2(${b}.0, ${g}.0); - return ${u.texture2D}(${t}, uv); - }`;return new l.GlslLibRoutine(w)}const y=i,_=Math.ceil(n[1]/2),v=`vec4 ${o}(int row, int col) { - vec2 uv = packedUVfrom2D(${y[1]}, ${y[0]}, ${_}, row, col); - return ${u.texture2D}(${t}, uv); - }`;return new l.GlslLibRoutine(v,["coordinates.packedUVfrom2D"])}getPackedSampler3D(o,t,e){const n=e.unpackedShape,i=[e.width,e.height],u=[i[0],i[1]],g=(0,m.getGlsl)(this.context.glContext.version);if(n[0]===1){const w=n.slice(1),T=[1,2],A=(0,h.squeezeInputShape)(n,w),E=["b","row","col"],x=JSON.parse(JSON.stringify(e));x.unpackedShape=A;const M=this.getPackedSamplerFromInput(o,t,x),C=`${M.routineBody} - vec4 ${o}(int b, int row, int col) { - return ${o}(${(0,h.getSqueezedParams)(E,T)}); - } `;return new l.GlslLibRoutine(C,M.dependencies)}const b=u[0],y=u[1],_=Math.ceil(n[2]/2),v=`vec4 ${o}(int b, int row, int col) { - vec2 uv = packedUVfrom3D( - ${y}, ${b}, ${_*Math.ceil(n[1]/2)}, ${_}, b, row, col); - return ${g.texture2D}(${t}, uv);}`;return new l.GlslLibRoutine(v,["coordinates.packedUVfrom3D"])}getPackedSamplerND(o,t,e){const n=e.unpackedShape,i=n.length,u=[e.width,e.height],g=(0,m.getGlsl)(this.context.glContext.version),b=[u[0],u[1]],y=b[1],_=b[0],v=Math.ceil(n[i-1]/2);let w=v*Math.ceil(n[i-2]/2),T="int b, int row, int col",A=`b * ${w} + (row / 2) * ${v} + (col / 2)`;for(let x=2;x{const n=this.context.inputTextureLayouts[e],i=(n.unpackedShape.length>0?n.unpackedShape:n.shape).length;let u=`_${t}`;o[u]=new l.GlslLibRoutine(this.getValueFromSingle(t,i,n.width,n.height,!1),[`shapeUtils.indicesToOffset${u}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),u+="_T",o[u]=new l.GlslLibRoutine(this.getValueFromSingle(t,i,n.width,n.height,!0),[`shapeUtils.indicesToOffset${u}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])}),o}getValueFromSingle(o,t,e,n,i){let u=`_${o}`;return i&&(u+="_T"),` - float ${u}(int m[${t}]) { - int offset = indicesToOffset${u}(m); - vec2 coords = offsetToCoords(offset, ${e}, ${n}); - float value = getColorAsFloat(${(0,m.getGlsl)(this.context.glContext.version).texture2D}(${o}, coords)); - return value; - } - `}getPackedValueFrom(o,t,e,n,i){let u=`_${o}_Pack`;return i&&(u+="_T"),` - vec4 ${u}(int m[${t}]) { - int offset = indicesToOffset_${o}(m); - vec2 coords = offsetToCoords(offset, ${e}, ${n}); - return ${(0,m.getGlsl)(this.context.glContext.version).texture2D}(${o}, coords); - } - `}}r.CoordsGlslLib=p},8520:(f,r)=>{var c;Object.defineProperty(r,"__esModule",{value:!0}),r.TopologicalSortGlslRoutines=r.GlslLibRoutineNode=r.GlslLibRoutine=r.GlslLib=r.GlslContext=r.FunctionType=void 0,(c=r.FunctionType||(r.FunctionType={}))[c.ValueBased=0]="ValueBased",c[c.Positional=1]="Positional",r.GlslContext=class{constructor(d,l,m,s){this.glContext=d,this.programInfo=l,this.inputTextureLayouts=m,this.outputTextureLayout=s}},r.GlslLib=class{constructor(d){this.context=d}},r.GlslLibRoutine=class{constructor(d,l){this.routineBody=d,this.dependencies=l}},r.GlslLibRoutineNode=class{constructor(d,l,m){this.name=d,this.dependencies=m||[],l&&(this.routineBody=l)}addDependency(d){d&&this.dependencies.push(d)}},r.TopologicalSortGlslRoutines=class{static returnOrderedNodes(d){if(!d||d.length===0)return[];if(d.length===1)return d;const l=new Set,m=new Set,s=new Array;return this.createOrderedNodes(d,l,m,s),s}static createOrderedNodes(d,l,m,s){for(let h=0;h0)for(let p=0;p{Object.defineProperty(r,"__esModule",{value:!0}),r.EncodingGlslLib=void 0;const d=c(8520);class l extends d.GlslLib{constructor(s){super(s)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new d.GlslLibRoutine(`highp vec4 encode(highp float f) { - return vec4(f, 0.0, 0.0, 0.0); - } - `)}}decodeFloat32(){return{decode:new d.GlslLibRoutine(`highp float decode(highp vec4 rgba) { - return rgba.r; - } - `)}}encodeUint8(){const s=l.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new d.GlslLibRoutine(` - highp vec4 encode(highp float f) { - highp float F = abs(f); - highp float Sign = step(0.0,-f); - highp float Exponent = floor(log2(F)); - highp float Mantissa = (exp2(- Exponent) * F); - Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa)); - highp vec4 rgba; - rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0)); - rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0); - rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0))); - rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0))); - ${s} - rgba = rgba / 255.0; // values need to be normalized to [0,1] - return rgba; - } - `)}}decodeUint8(){const s=l.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new d.GlslLibRoutine(` - highp float decode(highp vec4 rgba) { - rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255] - ${s} - highp float Sign = 1.0 - step(128.0,rgba[0])*2.0; - highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0; - highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000); - highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 )); - return Result; - } - `)}}static isLittleEndian(){const s=new ArrayBuffer(4),h=new Uint32Array(s),p=new Uint8Array(s);if(h[0]=3735928559,p[0]===239)return!0;if(p[0]===222)return!1;throw new Error("unknown endianness")}}r.EncodingGlslLib=l},9894:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FragColorGlslLib=void 0;const d=c(8520),l=c(5060);class m extends d.GlslLib{constructor(h){super(h)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const h=(0,l.getGlsl)(this.context.glContext.version);return{setFragColor:new d.GlslLibRoutine(` - void setFragColor(float value) { - ${h.output} = encode(value); - } - `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new d.GlslLibRoutine(` - float getColorAsFloat(vec4 color) { - return decode(color); - } - `,["encoding.decode"])}}}r.FragColorGlslLib=m},2848:(f,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.replaceInlines=void 0;const c=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;r.replaceInlines=function(d){const l={};let m;for(;(m=c.exec(d))!==null;){const s=m[3].split(",").map(h=>{const p=h.trim().split(" ");return p&&p.length===2?{type:p[0],name:p[1]}:null}).filter(h=>h!==null);l[m[2]]={params:s,body:m[4]}}for(const s in l){const h="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",s),p=new RegExp(h,"gm");for(;(m=p.exec(d))!==null;){const a=m[1],o=m[2],t=m[3].split(","),e=a?`${a} ${o};`:"";let n=l[s].body,i="";l[s].params.forEach((g,b)=>{g&&(i+=`${g.type} ${g.name} = ${t[b]}; -`)}),n=`${i} - ${n}`,n=n.replace("return",`${o} = `);const u=` - ${e} - { - ${n} - } - `;d=d.replace(m[0],u)}}return d.replace(c,"")}},8879:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlslPreprocessor=void 0;const d=c(8520),l=c(2848),m=c(5483),s=c(5060);r.GlslPreprocessor=class{constructor(h,p,a,o){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new d.GlslContext(h,p,a,o),Object.keys(m.glslRegistry).forEach(e=>{const n=new m.glslRegistry[e](this.context);this.libs[e]=n});const t=this.glslLibRoutineDependencyGraph;for(const e in this.libs){const n=this.libs[e].getFunctions();for(const i in n){const u=e+"."+i;let g;t[u]?(g=t[u],g.routineBody=n[i].routineBody):(g=new d.GlslLibRoutineNode(u,n[i].routineBody),t[u]=g);const b=n[i].dependencies;if(b)for(let y=0;y{const o=a.split(".")[1];h.indexOf(o)!==-1&&p.push(this.glslLibRoutineDependencyGraph[a])}),d.TopologicalSortGlslRoutines.returnOrderedNodes(p)}getUniforms(h,p){const a=[];if(h)for(const o of h)a.push(`uniform sampler2D ${o};`);if(p)for(const o of p)a.push(`uniform ${o.type} ${o.name}${o.arrayLength?`[${o.arrayLength}]`:""};`);return a.join(` -`)}}},5483:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.glslRegistry=void 0;const d=c(5107),l=c(7341),m=c(9894),s=c(2655),h=c(3891);r.glslRegistry={encoding:l.EncodingGlslLib,fragcolor:m.FragColorGlslLib,vec:h.VecGlslLib,shapeUtils:s.ShapeUtilsGlslLib,coordinates:d.CoordsGlslLib}},2655:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ShapeUtilsGlslLib=void 0;const d=c(8520);class l extends d.GlslLib{constructor(s){super(s)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const s=this.context.outputTextureLayout.shape.length,h={};return this.context.programInfo.inputNames.forEach((p,a)=>{const o=this.context.inputTextureLayouts[a].unpackedShape;if(o.length<=s){const t=o.length,e=s-t,n=`bcastIndices_${p}`;let i="";for(let g=0;g{const o=this.context.inputTextureLayouts[a].shape;if(!(o.length<2||o.length>s)){const t=o.length,e=s-t,n=`bcastMatmulIndices_${p}`;let i="";for(let g=0;g{const a=this.context.inputTextureLayouts[p].shape,o=this.context.inputTextureLayouts[p].strides,t=a.length;let e=`indicesToOffset_${h}`;s[e]=new d.GlslLibRoutine(l.indexToOffsetSingle(e,t,o)),e=`indicesToOffset_${h}_T`,s[e]=new d.GlslLibRoutine(l.indexToOffsetSingle(e,t,o.slice().reverse()))}),s}static indexToOffsetSingle(s,h,p){let a="";for(let o=h-1;o>=0;--o)a+=` - offset += indices[${o}] * ${p[o]}; - `;return` - int ${s}(int indices[${h}]) { - int offset = 0; - ${a} - return offset; - } - `}offsetToIndices(){const s={};return this.context.programInfo.inputNames.forEach((h,p)=>{const a=this.context.inputTextureLayouts[p].shape,o=this.context.inputTextureLayouts[p].strides,t=a.length;let e=`offsetToIndices_${h}`;s[e]=new d.GlslLibRoutine(l.offsetToIndicesSingle(e,t,o)),e=`offsetToIndices_${h}_T`,s[e]=new d.GlslLibRoutine(l.offsetToIndicesSingle(e,t,o.slice().reverse()))}),s}static offsetToIndicesSingle(s,h,p){const a=[];for(let o=0;o{const a=this.context.inputTextureLayouts[p].shape,o=a.length,t=`incrementIndices_${h}`;let e="";for(let i=0;i= 0; --i) { - if(i > axis) continue; - indices[i] += 1; - if(indices[i] < shape[i]) { - break; - } - indices[i] = 0; - } - } - `;s[t]=new d.GlslLibRoutine(n)}),s}}r.ShapeUtilsGlslLib=l},5060:(f,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getDefaultFragShaderMain=r.getFragShaderPreamble=r.getVertexShaderSource=r.getGlsl=void 0;const c={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},d={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function l(m){return m===1?c:d}r.getGlsl=l,r.getVertexShaderSource=function(m){const s=l(m);return`${s.version} - precision highp float; - ${s.attribute} vec3 position; - ${s.attribute} vec2 textureCoord; - - ${s.varyingVertex} vec2 TexCoords; - - void main() - { - gl_Position = vec4(position, 1.0); - TexCoords = textureCoord; - }`},r.getFragShaderPreamble=function(m){const s=l(m);return`${s.version} - precision highp float; - precision highp int; - precision highp sampler2D; - ${s.varyingFrag} vec2 TexCoords; - ${s.outputDeclaration} - const vec2 halfCR = vec2(0.5, 0.5); - - // Custom vector types to handle higher dimenalities. - struct ivec5 - { - int x; - int y; - int z; - int w; - int u; - }; - - struct ivec6 - { - int x; - int y; - int z; - int w; - int u; - int v; - }; - - int imod(int x, int y) { - return x - y * (x / y); - } - - `},r.getDefaultFragShaderMain=function(m,s){return` - void main() { - int indices[${s}]; - toVec(TexCoords, indices); - vec4 result = vec4(process(indices)); - ${l(m).output} = result; - } - `}},3891:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.VecGlslLib=void 0;const d=c(8520);class l extends d.GlslLib{constructor(s){super(s)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const s=this.context.outputTextureLayout.shape.length,h={add:"+=",sub:"-=",mul:"*=",div:"/="},p={};for(const a in h){const o=`${a}Vec`;let t="";for(let n=0;n{Object.defineProperty(r,"__esModule",{value:!0}),r.WebGLInferenceHandler=void 0;const d=c(6231),l=c(9162),m=c(2517),s=c(2403),h=c(7019),p=c(8710),a=c(5611),o=c(4057),t=c(2039);r.WebGLInferenceHandler=class{constructor(e){this.session=e,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(e,n){return(0,o.calculateTextureWidthAndHeight)(this.session.layoutStrategy,e,n)}executeProgram(e,n){if(n.length{const T=w.map(E=>`${E.unpackedShape.join(",")};${E.width}x${E.height}`).join("_");let A=v.name;return v.cacheHint&&(A+="["+v.cacheHint+"]"),A+=":"+T,A})(e,i);let g=this.session.programManager.getArtifact(u);const b=g?g.programInfo:typeof e.get=="function"?e.get():e,y=(0,o.createTextureLayoutFromTextureType)(this.session.layoutStrategy,b.output.dims,b.output.textureType),_=this.createTextureData(y,b.output.type);return g||(g=this.session.programManager.build(b,i,_),this.session.programManager.setArtifact(u,g)),this.runProgram(g,i,_),_}run(e,n){return this.executeProgram(e,n).tensor}runProgram(e,n,i){for(let u=0;uthis.readTexture(b),async y=>this.readTextureAsync(b),void 0,g),texture:i});return this.setTextureData(b.tensor.dataId,b,e.isPacked),b}getTextureData(e,n=!1){return this.session.isInitializer(e)?this.session.getTextureData(e,n):n?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,n,i=!1){this.session.isInitializer(e)?this.session.setTextureData(e,n,i):(i?this.packedTextureDataCache:this.unpackedTextureDataCache).set(e,n)}isTextureLayoutCached(e,n=!1){return!!this.getTextureData(e.dataId,n)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.unpackedTextureDataCache=new Map}readTexture(e){return e.isPacked?this.readTexture(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,p.encodeAsUint8)(this,e))}async readTextureAsync(e){return e.isPacked?this.readTextureAsync(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,p.encodeAsUint8)(this,e))}pack(e){return this.executeProgram((0,s.createPackProgramInfoLoader)(this,e.tensor),[e.tensor])}unpack(e){return this.executeProgram((0,a.createUnpackProgramInfoLoader)(this,e.tensor),[e.tensor])}}},1640:function(f,r,c){var d=this&&this.__createBinding||(Object.create?function(Y,Z,te,he){he===void 0&&(he=te);var Me=Object.getOwnPropertyDescriptor(Z,te);Me&&!("get"in Me?!Z.__esModule:Me.writable||Me.configurable)||(Me={enumerable:!0,get:function(){return Z[te]}}),Object.defineProperty(Y,he,Me)}:function(Y,Z,te,he){he===void 0&&(he=te),Y[he]=Z[te]}),l=this&&this.__setModuleDefault||(Object.create?function(Y,Z){Object.defineProperty(Y,"default",{enumerable:!0,value:Z})}:function(Y,Z){Y.default=Z}),m=this&&this.__importStar||function(Y){if(Y&&Y.__esModule)return Y;var Z={};if(Y!=null)for(var te in Y)te!=="default"&&Object.prototype.hasOwnProperty.call(Y,te)&&d(Z,Y,te);return l(Z,Y),Z};Object.defineProperty(r,"__esModule",{value:!0}),r.WEBGL_OP_RESOLVE_RULES=void 0;const s=c(2898),h=m(c(7839)),p=c(4196),a=c(2069),o=c(8138),t=c(9663),e=c(5193),n=c(7992),i=c(1253),u=c(4776),g=c(6572),b=c(3346),y=c(5623),_=c(2870),v=c(2143),w=c(4939),T=c(718),A=c(2268),E=c(8117),x=c(2278),M=c(5524),C=c(5975),k=c(3933),V=c(6558),F=c(5723),q=c(3738),D=m(c(4909)),U=c(8428),J=c(9793);r.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",D.abs],["Acos","","7+",D.acos],["Add","","7+",h.add],["And","","7+",h.and],["Asin","","7+",D.asin],["Atan","","7+",D.atan],["AveragePool","","7+",v.averagePool,v.parseAveragePoolAttributes],["BatchNormalization","","7+",s.batchNormalization,s.parseBatchNormalizationAttributes],["Cast","","6+",p.cast,p.parseCastAttributes],["Ceil","","6+",D.ceil],["Clip","","6-10",D.clip,D.parseClipAttributes],["Clip","","11+",D.clipV11],["Concat","","4+",a.concat,a.parseConcatAttributes],["Conv","","1+",o.conv,o.parseConvAttributes],["ConvTranspose","","1+",t.convTranspose,t.parseConvTransposeAttributes],["Cos","","7+",D.cos],["Div","","7+",h.div],["Dropout","","7+",D.identity],["DepthToSpace","","1+",e.depthToSpace,e.parseDepthToSpaceAttributes],["Equal","","7+",h.equal],["Elu","","6+",D.elu,D.parseEluAttributes],["Exp","","6+",D.exp],["Flatten","","1+",n.flatten,n.parseFlattenAttributes],["Floor","","6+",D.floor],["FusedConv","com.microsoft","1+",o.conv,o.parseConvAttributes],["Gather","","1+",i.gather,i.parseGatherAttributes],["Gemm","","7-10",u.gemm,u.parseGemmAttributesV7],["Gemm","","11+",u.gemm,u.parseGemmAttributesV11],["GlobalAveragePool","","1+",v.globalAveragePool,v.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",v.globalMaxPool],["Greater","","7+",h.greater],["Identity","","1+",D.identity],["ImageScaler","","1+",g.imageScaler,g.parseImageScalerAttributes],["InstanceNormalization","","6+",b.instanceNormalization,b.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",D.leakyRelu,D.parseLeakyReluAttributes],["Less","","7+",h.less],["Log","","6+",D.log],["MatMul","","1+",y.matMul,y.parseMatMulAttributes],["MaxPool","","1+",v.maxPool,v.parseMaxPoolAttributes],["Mul","","7+",h.mul],["Neg","","6+",D.neg],["Not","","1+",D.not],["Or","","7+",h.or],["Pad","","2-10",_.padV2,_.parsePadAttributesV2],["Pad","","11+",_.padV11,_.parsePadAttributesV11],["Pow","","7+",h.pow],["PRelu","","7+",h.pRelu],["ReduceLogSum","","1+",w.reduceLogSum,w.parseReduceAttributes],["ReduceMax","","1+",w.reduceMax,w.parseReduceAttributes],["ReduceMean","","1+",w.reduceMean,w.parseReduceAttributes],["ReduceMin","","1+",w.reduceMin,w.parseReduceAttributes],["ReduceProd","","1+",w.reduceProd,w.parseReduceAttributes],["ReduceSum","","1-12",w.reduceSum,w.parseReduceAttributes],["ReduceSumSquare","","1+",w.reduceLogSumSquare,w.parseReduceAttributes],["Relu","","6+",D.relu],["Reshape","","5+",T.reshape],["Resize","","10",A.resize,A.parseResizeAttributesV10],["Resize","","11+",A.resize,A.parseResizeAttributesV11],["Shape","","1+",E.shape],["Sigmoid","","6+",D.sigmoid],["Sin","","7+",D.sin],["Slice","","10+",x.sliceV10],["Slice","","1-9",x.slice,x.parseSliceAttributes],["Softmax","","1-12",M.softmax,M.parseSoftmaxAttributes],["Softmax","","13+",M.softmaxV13,M.parseSoftmaxAttributesV13],["Split","","2-12",C.split,C.parseSplitAttributes],["Sqrt","","6+",D.sqrt],["Squeeze","","1-12",k.squeeze,k.parseSqueezeAttributes],["Squeeze","","13+",k.squeezeV13],["Sub","","7+",h.sub],["Sum","","6+",V.sum],["Tan","","7+",D.tan],["Tanh","","6+",D.tanh],["Tile","","6+",F.tile],["Transpose","","1+",q.transpose,q.parseTransposeAttributes],["Upsample","","7-8",J.upsample,J.parseUpsampleAttributesV7],["Upsample","","9",J.upsample,J.parseUpsampleAttributesV9],["Unsqueeze","","1-12",U.unsqueeze,U.parseUnsqueezeAttributes],["Unsqueeze","","13+",U.unsqueezeV13],["Xor","","7+",h.xor]]},2898:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseBatchNormalizationAttributes=r.batchNormalization=void 0;const d=c(246),l=c(5060),m=c(2039),s={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked]};r.batchNormalization=(a,o,t)=>(p(o),[a.run(Object.assign(Object.assign({},s),{cacheHint:t.cacheKey,get:()=>h(a,o,t)}),o)]),r.parseBatchNormalizationAttributes=a=>{const o=a.attributes.getFloat("epsilon",1e-5),t=a.attributes.getFloat("momentum",.9),e=a.attributes.getInt("spatial",1);return(0,d.createAttributeWithCacheKey)({epsilon:o,momentum:t,spatial:e})};const h=(a,o,t)=>{const e=(0,l.getGlsl)(a.session.backend.glContext.version),n=o[0].dims.length,[i,u]=a.calculateTextureWidthAndHeight(o[1].dims,m.TextureType.unpacked),g=` - float process(int[${n}] indices) { - vec2 position = offsetToCoords(indices[1], ${i}, ${u}); - float scale = getColorAsFloat(${e.texture2D}(Scale, position)); - float mean = getColorAsFloat(${e.texture2D}(Mean, position)); - float variance = getColorAsFloat(${e.texture2D}(Variance, position)); - float b = getColorAsFloat(${e.texture2D}(B, position)); - - return scale * ( (_A(indices) - mean) / sqrt(variance + float(${t.epsilon})) ) + b; - }`;return Object.assign(Object.assign({},s),{output:{dims:o[0].dims,type:o[0].type,textureType:m.TextureType.unpacked},shaderSource:g})},p=a=>{if(!a||a.length!==5)throw new Error("BatchNormalization requires 5 inputs.");const o=a[0],t=a[1],e=a[2],n=a[3],i=a[4];if(o.dims.length<3||t.dims.length!==1||e.dims.length!==1||n.dims.length!==1||i.dims.length!==1)throw new Error("invalid input shape.");if(t.dims[0]!==o.dims[1]||e.dims[0]!==o.dims[1]||n.dims[0]!==o.dims[1]||i.dims[0]!==o.dims[1])throw new Error("invalid input shape.");if(o.type!=="float32"&&o.type!=="float64"||t.type!=="float32"&&t.type!=="float64"||e.type!=="float32"&&e.type!=="float64"||n.type!=="float32"&&n.type!=="float64"||i.type!=="float32"&&i.type!=="float64")throw new Error("invalid input tensor types.")}},7839:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.xor=r.sub=r.pRelu=r.pow=r.or=r.mul=r.less=r.greater=r.equal=r.div=r.and=r.add=r.glslPRelu=r.glslPow=r.glslXor=r.glslOr=r.glslAnd=r.glslLess=r.glslGreater=r.glslEqual=r.glslSub=r.glslMul=r.glslDiv=r.glslAdd=void 0;const d=c(2517),l=c(8520),m=c(5060),s=c(2039);function h(){const w="add_";return{body:` - float ${w}(float a, float b) { - return a + b; - } - vec4 ${w}(vec4 v1, vec4 v2) { - return v1 + v2; - } - `,name:w,type:l.FunctionType.ValueBased}}function p(){const w="div_";return{body:` - float ${w}(float a, float b) { - return a / b; - } - vec4 ${w}(vec4 v1, vec4 v2) { - return v1 / v2; - } - `,name:w,type:l.FunctionType.ValueBased}}function a(){const w="mul_";return{body:` - float ${w}(float a, float b) { - return a * b; - } - vec4 ${w}(vec4 v1, vec4 v2) { - return v1 * v2; - } - `,name:w,type:l.FunctionType.ValueBased}}function o(){const w="sub_";return{body:` - float ${w}(float a, float b) { - return a - b; - } - vec4 ${w}(vec4 v1, vec4 v2) { - return v1 - v2; - } - `,name:w,type:l.FunctionType.ValueBased}}function t(){const w="equal_";return{body:` - float ${w}(float a, float b) { - return float(a == b); - } - vec4 ${w}(vec4 v1, vec4 v2) { - return vec4(equal(v1, v2)); - } - `,name:w,type:l.FunctionType.ValueBased}}function e(){const w="greater_";return{body:` - float ${w}(float a, float b) { - return float(a > b); - } - vec4 ${w}(vec4 v1, vec4 v2) { - return vec4( v1.r > v2.r , - v1.g > v2.g, - v1.b > v2.b, - v1.a > v2.a ); - } - `,name:w,type:l.FunctionType.ValueBased}}function n(){const w="less_";return{body:` - float ${w}(float a, float b) { - return float(a < b); - } - vec4 ${w}(vec4 v1, vec4 v2) { - return vec4( v1.r < v2.r , - v1.g < v2.g, - v1.b < v2.b, - v1.a < v2.a ); - } - `,name:w,type:l.FunctionType.ValueBased}}function i(){const w="and_";return{body:` - float ${w}(float a, float b) { - return float( bool(a) && bool(b) ); - } - vec4 ${w}(vec4 v1, vec4 v2) { - bvec4 b1 = bvec4(v1); - bvec4 b2 = bvec4(v2); - return vec4( b1.r && b2.r , - b1.g && b2.g, - b1.b && b2.b, - b1.a && b2.a ); - } - `,name:w,type:l.FunctionType.ValueBased}}function u(){const w="or_";return{body:` - float ${w}(float a, float b) { - return float( bool(a) || bool(b) ); - } - vec4 ${w}(vec4 v1, vec4 v2) { - bvec4 b1 = bvec4(v1); - bvec4 b2 = bvec4(v2); - return vec4( b1.r || b2.r , - b1.g || b2.g, - b1.b || b2.b, - b1.a || b2.a ); - } - `,name:w,type:l.FunctionType.ValueBased}}function g(){const w="xor_";return{body:` - float ${w}(float a, float b) { - return float( bool(a) ^^ bool(b) ); - } - vec4 ${w}(vec4 v1, vec4 v2) { - bvec4 b1 = bvec4(v1); - bvec4 b2 = bvec4(v2); - return vec4( b1.r ^^ b2.r , - b1.g ^^ b2.g, - b1.b ^^ b2.b, - b1.a ^^ b2.a ); - } - `,name:w,type:l.FunctionType.ValueBased}}function b(){return function(w){const T=`${w}_`;return{body:` - float ${T}(float a, float b) { - return ${w}(a, b); - } - vec4 ${T}(vec4 v1, vec4 v2) { - return ${w}(v1, v2); - } - `,name:T,type:l.FunctionType.ValueBased}}("pow")}function y(){const w="prelu_";return{body:` - float ${w}(float a, float b) { - return a < 0.0 ? a * b: a; - } - vec4 ${w}(vec4 v1, vec4 v2) { - return vec4( - v1.r < 0.0 ? v1.r * v2.r: v1.r, - v1.g < 0.0 ? v1.g * v2.g: v1.g, - v1.b < 0.0 ? v1.b * v2.b: v1.b, - v1.a < 0.0 ? v1.a * v2.a: v1.a - ); - } - `,name:w,type:l.FunctionType.ValueBased}}r.glslAdd=h,r.glslDiv=p,r.glslMul=a,r.glslSub=o,r.glslEqual=t,r.glslGreater=e,r.glslLess=n,r.glslAnd=i,r.glslOr=u,r.glslXor=g,r.glslPow=b,r.glslPRelu=y;const _=(w,T,A,E=T[0].type,x)=>{const M=w.session.pack?s.TextureType.packed:s.TextureType.unpacked;return{name:A.name,inputNames:["A","B"],inputTypes:[M,M],cacheHint:x,get:()=>v(w,T,A,E)}},v=(w,T,A,E=T[0].type)=>{const x=w.session.pack?s.TextureType.packed:s.TextureType.unpacked,M=!d.ShapeUtil.areEqual(T[0].dims,T[1].dims);let C=T[0].dims;const k=w.session.pack;if(M){const q=d.BroadcastUtil.calcShape(T[0].dims,T[1].dims,!1);if(!q)throw new Error("Can't perform binary op on the given tensors");C=q;const D=C.length,U=T[0].dims.length!==0?T[0].dims.length:1,J=T[1].dims.length!==0?T[1].dims.length:1,Y=T[0].dims.length!==0?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",Z=T[1].dims.length!==0?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",te=(0,m.getGlsl)(w.session.backend.glContext.version),he=k?` - ${A.body} - void main() { - vec4 a = getAAtOutCoords(); - vec4 b = getBAtOutCoords(); - vec4 result = ${A.name}(a, b); - ${te.output} = result; - }`:` - ${A.body} - float process(int indices[${D}]) { - int aindices[${U}]; - int bindices[${J}]; - ${Y} - ${Z} - return ${A.name}(_A(aindices), _B(bindices)); - }`;return{name:A.name,inputNames:["A","B"],inputTypes:[x,x],output:{dims:C,type:E,textureType:x},shaderSource:he,hasMain:k}}const V=(0,m.getGlsl)(w.session.backend.glContext.version),F=` - ${A.body} - void main() { - vec4 v1 = ${V.texture2D}(A, TexCoords); - vec4 v2 = ${V.texture2D}(B, TexCoords); - vec4 result = ${A.name}(v1, v2); - ${V.output} = result; - } - `;return{name:A.name,inputNames:["A","B"],inputTypes:[x,x],output:{dims:T[0].dims,type:E,textureType:x},shaderSource:F,hasMain:!0}};r.add=(w,T)=>[w.run(_(w,T,h()),T)],r.and=(w,T)=>[w.run(_(w,T,i(),"bool"),T)],r.div=(w,T)=>[w.run(_(w,T,p()),T)],r.equal=(w,T)=>[w.run(_(w,T,t(),"bool"),T)],r.greater=(w,T)=>[w.run(_(w,T,e(),"bool"),T)],r.less=(w,T)=>[w.run(_(w,T,n(),"bool"),T)],r.mul=(w,T)=>[w.run(_(w,T,a()),T)],r.or=(w,T)=>[w.run(_(w,T,u(),"bool"),T)],r.pow=(w,T)=>[w.run(_(w,T,b()),T)],r.pRelu=(w,T)=>[w.run(_(w,T,y()),T)],r.sub=(w,T)=>[w.run(_(w,T,o()),T)],r.xor=(w,T)=>[w.run(_(w,T,g(),"bool"),T)]},4196:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseCastAttributes=r.cast=void 0;const d=c(2517);r.cast=(m,s,h)=>(l(s),[m.cast(s[0],h)]),r.parseCastAttributes=m=>d.ProtoUtil.tensorDataTypeFromProto(m.attributes.getInt("to"));const l=m=>{if(!m||m.length!==1)throw new Error("Cast requires 1 input.");if(m[0].type==="string")throw new Error("Invalid input type.")}},1163:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createPackedConcatProgramInfoLoader=void 0;const d=c(5060),l=c(2039),m=c(9390),s=c(2827);r.createPackedConcatProgramInfoLoader=(p,a,o)=>{const t=(e=a.length,n=o.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:e},(i,u)=>`X${u}`),inputTypes:Array(e).fill(l.TextureType.packed),cacheHint:n});var e,n;return Object.assign(Object.assign({},t),{get:()=>((i,u,g,b)=>{const y=g[0].dims.slice();if(b>=y.length||b<-1*y.length)throw new Error("axis specified for concat doesn't match input dimensionality");b<0&&(b=y.length+b);const _=y.slice(0);for(let Y=1;YY.dims),x=(0,m.getGlChannels)(v),M=new Array(E.length-1);M[0]=E[0][b];for(let Y=1;Y= ${M[Y-1]}) { - return getChannel( - getX${Y}(${h(x,C,Z)}), - vec2(${h(k,C,Z)})); - }`}const q=M.length,D=M[M.length-1];F+=` - return getChannel( - getX${q}(${h(x,C,D)}), - vec2(${h(k,C,D)}));`;const U=(0,d.getGlsl)(i.session.backend.glContext.version),J=` - ${A} - float getValue(${x.map(Y=>"int "+Y)}) { - ${F} - } - - void main() { - ${T} coords = getOutputCoords(); - int lastDim = coords.${x[v-1]}; - coords.${x[v-1]} = coords.${x[v-2]}; - coords.${x[v-2]} = lastDim; - - vec4 result = vec4(getValue(${w}), 0., 0., 0.); - - ${w[v-1]} = ${w[v-1]} + 1; - if (${w[v-1]} < ${_[v-1]}) { - result.g = getValue(${w}); - } - - ${w[v-2]} = ${w[v-2]} + 1; - if (${w[v-2]} < ${_[v-2]}) { - result.a = getValue(${w}); - } - - ${w[v-1]} = ${w[v-1]} - 1; - if (${w[v-2]} < ${_[v-2]} && - ${w[v-1]} < ${_[v-1]}) { - result.b = getValue(${w}); - } - ${U.output} = result; - } - `;return Object.assign(Object.assign({},u),{output:{dims:_,type:g[0].type,textureType:l.TextureType.packed},shaderSource:J,hasMain:!0})})(p,t,a,o.axis)})};const h=(p,a,o)=>{const t=p.indexOf(a);return p.map((e,n)=>n===t?`${e} - ${o}`:e).join()}},2069:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseConcatAttributes=r.concat=void 0;const d=c(246),l=c(2039),m=c(1163);r.concat=(e,n,i)=>(t(n),e.session.pack&&n[0].dims.length>1?[e.run((0,m.createPackedConcatProgramInfoLoader)(e,n,i),n)]:[e.run(s(e,n,i),n)]);const s=(e,n,i)=>{const u=(g=n.length,b=i.cacheKey,{name:"Concat",inputNames:Array.from({length:g},(y,_)=>`X${_}`),inputTypes:Array(g).fill(l.TextureType.unpacked),cacheHint:b});var g,b;return Object.assign(Object.assign({},u),{get:()=>((y,_,v,w)=>{const T=v[0].dims.slice();if(w>=T.length||w<-1*T.length)throw new Error("axis specified for concat doesn't match input dimensionality");w<0&&(w=T.length+w);const A=T.slice(0);for(let V=1;V`int getTextureWhereDataResides(int index) { - ${e.map((n,i)=>`if(index<${n}) {return ${i};} -`).join("")} - }`,p=e=>h(e),a=(e,n)=>{const i=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${n}]) {`];for(let u=0;u{const n=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let i=0;i(0,d.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis")});const t=e=>{if(!e||e.length<1)throw new Error("too few inputs");const n=e[0].type,i=e[0].dims.length;if(n==="string")throw new Error("string tensor is not supported yet");for(const u of e){if(u.type!==n)throw new Error("input tensors should be one type");if(u.dims.length!==i)throw new Error("input tensors should have the same shape")}}},4770:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createUnpackedGroupedConvProgramInfoLoader=void 0;const d=c(6231),l=c(5060),m=c(2039),s=c(8138),h=c(2823);r.createUnpackedGroupedConvProgramInfoLoader=(p,a,o)=>{const t=(e=a.length>2,n=o.cacheKey,{name:"GroupedConv",inputNames:e?["X","W","Bias"]:["X","W"],inputTypes:e?[m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked]:[m.TextureType.unpacked,m.TextureType.unpacked],cacheHint:n});var e,n;return Object.assign(Object.assign({},t),{get:()=>((i,u,g,b)=>{const y=u.length>2?"value += getBias(output_channel);":"",_=u[0].dims.slice(),v=u[1].dims.slice(),w=v[0]/b.group;d.Logger.verbose("GroupedConv",`autpPad:${b.autoPad}, dilations:${b.dilations}, group:${b.group}, kernelShape:${b.kernelShape}, pads:${b.pads}, strides:${b.strides}`);const T=(0,s.calculateOutputShape)(_,v,b.dilations,b.pads,b.strides),A=(0,l.getGlsl)(i.session.backend.glContext.version),{activationFunction:E,applyActivation:x}=(0,h.getActivationSnippet)(b),M=` - const ivec2 strides = ivec2(${b.strides[0]}, ${b.strides[1]}); - const ivec2 pads = ivec2(${b.pads[0]}, ${b.pads[1]}); - ${E} - void main() { - ivec4 coords = getOutputCoords(); - int batch = coords.x; - int output_channel = coords.y; - ivec2 xRCCorner = coords.zw * strides - pads; - int group_id = output_channel / ${w}; - - float value = 0.0; - for (int wInChannel = 0; wInChannel < ${v[1]}; wInChannel++) { - int input_channel = group_id * ${v[1]} + wInChannel; - for (int wHeight = 0; wHeight < ${v[2]}; wHeight++) { - int xHeight = xRCCorner.x + wHeight * ${b.dilations[0]}; - - if (xHeight < 0 || xHeight >= ${_[2]}) { - continue; - } - - for (int wWidth = 0; wWidth < ${v[3]}; wWidth++) { - int xWidth = xRCCorner.y + wWidth * ${b.dilations[1]}; - if (xWidth < 0 || xWidth >= ${_[3]}) { - continue; - } - - float xVal = getX(batch, input_channel, xWidth, xHeight); - float wVal = getW(output_channel, wInChannel, wWidth, wHeight); - value += xVal*wVal; - } - } - } - ${y} - ${x} - ${A.output} = vec4(value, .0, .0, .0); - } -`;return Object.assign(Object.assign({},g),{output:{dims:T,type:u[0].type,textureType:m.TextureType.unpacked},shaderSource:M,hasMain:!0})})(p,a,t,o)})}},1386:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.conv2DPacked=r.conv2DPackedPointwise=void 0;const d=c(8138),l=c(8555),m=c(708);r.conv2DPackedPointwise=(s,h,p)=>{const a=h[0].dims,o=h[1].dims,t=(0,d.calculateOutputShape)(a,o,p.dilations,p.pads,p.strides),e=s.reshapePacked(h[0],[a[1],a[2]*a[3]]),n=s.reshapePacked(h[1],[o[0],o[1]]),i=h.length>2?[n,e,h[2]]:[n,e],u=s.run((0,m.createPackedMatmulProgramInfoLoader)(s,i,p),i);return s.reshapePacked(u,t)},r.conv2DPacked=(s,h,p)=>{const a=h[0].dims,o=h[1].dims,t=(0,d.calculateOutputShape)(a,o,p.dilations,p.pads,p.strides),e=s.run((0,l.createPackedIm2ColProgramInfoLoader)(s,h[0],h[1],t,p),[h[0]]),n=s.reshapePacked(h[1],[o[0],o[1]*o[2]*o[3]]),i=h.length===3?[n,e,h[2]]:[n,e],u=s.run((0,m.createPackedMatmulProgramInfoLoader)(s,i,p),i);return s.reshapePacked(u,t)}},9663:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseConvTransposeAttributes=r.convTranspose=void 0;const d=c(246),l=c(5060),m=c(2039),s=c(2823),h=(n,i,u,g,b,y)=>(n-1)*i+u+(g-1)*b+1-y,p=(n,i,u,g,b)=>{const y=Math.floor(n/2);i==="SAME_UPPER"?(u[g]=y,u[b]=n-y):i==="SAME_LOWER"&&(u[g]=n-y,u[b]=y)};r.convTranspose=(n,i,u)=>(e(i,u),a(n,i,u));const a=(n,i,u)=>{const g=t(u,i);return[o(n,i,g)]},o=(n,i,u)=>n.run(((g,b,y)=>{const _=(v=b.length>2,w=y.cacheKey,{name:"ConvTranspose",inputNames:v?["X","W","B"]:["X","W"],inputTypes:v?[m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked]:[m.TextureType.unpacked,m.TextureType.unpacked],cacheHint:w});var v,w;return Object.assign(Object.assign({},_),{get:()=>((T,A,E,x)=>{const M=A.length>2?"getB(output_channel)":"0.0",C=A[0].dims,k=A[1].dims,V=k[1],F=k[0]/x.group,q=[A[0].dims[0],A[1].dims[1]*x.group,...x.outputShape],D=(0,l.getGlsl)(T.session.backend.glContext.version),{activationFunction:U,applyActivation:J}=(0,s.getActivationSnippet)(x),Y=` - const ivec2 strides = ivec2(${x.strides[0]}, ${x.strides[1]}); - const ivec2 pads = ivec2(${x.pads[0]}, ${x.pads[1]}); - ${U} - void main() { - ivec4 coords = getOutputCoords(); - int batch = coords.x; - int output_channel = coords.y; - - ivec2 loc = coords.zw + pads; - - int group_id = output_channel / ${V}; - int wOutChannel = output_channel - group_id * ${V}; - - float value = ${M}; - for (int inChannelOffset = 0; inChannelOffset < ${F}; inChannelOffset++) { - int input_channel = group_id * ${F} + inChannelOffset; - for (int wWOff = 0; wWOff < ${k[2]}; wWOff++) { - for (int wHOff = 0; wHOff < ${k[3]}; wHOff++) { - ivec2 wOff = ivec2(wWOff * ${x.dilations[0]}, wHOff * ${x.dilations[1]}); - ivec2 wLoc = loc - wOff; - ivec2 wLocIn = wLoc / strides; - if ( - wLocIn * strides == wLoc && - wLocIn.x >= 0 && wLocIn.x < ${C[2]} && - wLocIn.y >= 0 && wLocIn.y < ${C[3]} - ) { - float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x); - float wVal = getW(input_channel, wOutChannel, wHOff, wWOff); - value += xVal * wVal; - } - } - } - } - ${J} - ${D.output} = vec4(value, .0, .0, .0); - } -`;return Object.assign(Object.assign({},E),{output:{dims:q,type:A[0].type,textureType:m.TextureType.unpacked},shaderSource:Y,hasMain:!0})})(g,b,_,y)})})(n,i,u),i),t=(n,i)=>{const u=n.kernelShape.slice();if(n.kernelShape.length===0)for(let _=2;_{const C=_.length-2,k=M.length===0;for(let V=0;V{const i=n.attributes,u=(0,s.parseInternalActivationAttributes)(i),g=i.getString("auto_pad","NOTSET"),b=i.getInts("dilations",[1,1]),y=i.getInt("group",1),_=i.getInts("kernel_shape",[]),v=i.getInts("output_padding",[0,0]),w=i.getInts("output_shape",[]),T=i.getInts("pads",[0,0,0,0]),A=i.getInts("strides",[1,1]);return(0,d.createAttributeWithCacheKey)(Object.assign({autoPad:g,dilations:b,group:y,kernelShape:_,outputPadding:v,outputShape:w,pads:T,strides:A},u))};const e=(n,i)=>{if(!n||n.length!==2&&n.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(n[0].dims.length!==4||n[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(n[0].dims[1]!==n[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const u=n[1].dims[1]*i.group;if(n.length===3&&(n[2].dims.length!==1||n[2].dims[0]!==u))throw new Error("invalid bias");const g=n[0].dims.length-2;if(i.dilations.length!==g)throw new Error(`dilations should be ${g}D`);if(i.strides.length!==g)throw new Error(`strides should be ${g}D`);if(i.pads.length!==2*g)throw new Error(`pads should be ${2*g}D`);if(i.outputPadding.length!==g)throw new Error(`output_padding should be ${g}D`);if(i.kernelShape.length!==0&&i.kernelShape.length!==n[1].dims.length-2)throw new Error("invalid kernel shape");if(i.outputShape.length!==0&&i.outputShape.length!==n[0].dims.length-2)throw new Error("invalid output shape");if(n[0].type!=="float32"||n[1].type!=="float32")throw new Error("ConvTranspose input(X,W) should be float tensor");if(n.length===3&&n[2].type!=="float32")throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseConvAttributes=r.conv=r.calculateOutputShape=void 0;const d=c(246),l=c(2517),m=c(4770),s=c(1386),h=c(9828),p=c(2823),a=c(3248),o=c(5623);r.calculateOutputShape=(g,b,y,_,v)=>{const w=g[0],T=g.slice(2),A=T.length,E=b[0],x=b.slice(2).map((C,k)=>C+(C-1)*(y[k]-1)),M=T.map((C,k)=>C+_[k]+_[k+A]).map((C,k)=>Math.floor((C-x[k]+v[k])/v[k]));return[w,E].concat(...M)},r.conv=(g,b,y)=>(u(b,y),t(g,b,y));const t=(g,b,y)=>{const _=i(y,b),v=g.session.pack,w=_.kernelShape[0]===1&&_.kernelShape[1]===1;return _.group>1?[g.run((0,m.createUnpackedGroupedConvProgramInfoLoader)(g,b,_),b)]:w&&v?[e(g,b,_)]:v&&b[0].dims.length===4&&b[0].dims[0]===1&&!w?[(0,s.conv2DPacked)(g,b,_)]:[n(g,b,_)]},e=(g,b,y)=>{const _=b[0].dims,v=b[1].dims,w=(0,r.calculateOutputShape)(_,v,y.dilations,y.pads,y.strides),T=g.reshapeUnpacked(b[0],[_[1],_[2]*_[3]]),A=g.reshapeUnpacked(b[1],[v[0],v[1]]),E=b.length>2?[A,T,b[2]]:[A,T],x=g.run((0,o.createMatmulProgramInfoLoader)(E,y),E);return g.reshapeUnpacked(x,w)},n=(g,b,y)=>{const _=b[0].dims,v=b[1].dims,w=(0,r.calculateOutputShape)(_,v,y.dilations,y.pads,y.strides),T=g.run((0,a.createIm2ColProgramInfoLoader)(g,b[0],b[1],w,y),[b[0]]),A=b.length===3?[T,b[1],b[2]]:[T,b[1]];return g.run((0,h.createDotProductProgramInfoLoader)(g,b,w,y),A)},i=(g,b)=>{const y=g.kernelShape.slice();if(g.kernelShape.length===0)for(let w=2;w{const b=g.attributes,y=(0,p.parseInternalActivationAttributes)(b),_=b.getString("auto_pad","NOTSET"),v=b.getInts("dilations",[1,1]),w=b.getInt("group",1),T=b.getInts("kernel_shape",[]),A=b.getInts("pads",[0,0,0,0]),E=b.getInts("strides",[1,1]);return(0,d.createAttributeWithCacheKey)(Object.assign({autoPad:_,dilations:v,group:w,kernelShape:T,pads:A,strides:E},y))};const u=(g,b)=>{if(!g||g.length!==2&&g.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(g[0].dims.length!==4||g[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(g[0].dims[1]!==g[1].dims[1]*b.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(g.length===3&&(g[2].dims.length!==1||g[1].dims[0]!==g[2].dims[0]))throw new Error("invalid bias");const y=g[0].dims.length-2;if(b.dilations.length!==y)throw new Error(`dilations should be ${y}D`);if(b.strides.length!==y)throw new Error(`strides should be ${y}D`);if(b.pads.length!==2*y)throw new Error(`pads should be ${2*y}D`);if(b.kernelShape.length!==0&&b.kernelShape.length!==g[1].dims.length-2)throw new Error("invalid kernel shape");if(g[0].type!=="float32"||g[1].type!=="float32")throw new Error("Conv input(X,W) should be float tensor");if(g.length===3&&g[2].type!=="float32")throw new Error("Conv input(bias) should be float tensor")}},5193:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseDepthToSpaceAttributes=r.depthToSpace=void 0;const d=c(3738);r.depthToSpace=(m,s,h)=>{l(s);const p=h.blocksize,a=p*p,o=h.mode==="DCR"?[0,3,4,1,5,2]:[0,1,4,2,5,3],t=h.mode==="DCR"?[s[0].dims[0],p,p,s[0].dims[1]/a,s[0].dims[2],s[0].dims[3]]:[s[0].dims[0],s[0].dims[1]/a,p,p,s[0].dims[2],s[0].dims[3]],e=m.reshapeUnpacked(s[0],t),n={perm:o,cacheKey:`${o}`},[i]=(0,d.transpose)(m,[e],n),u=[s[0].dims[0],s[0].dims[1]/a,s[0].dims[2]*p,s[0].dims[3]*p];return[m.reshapeUnpacked(i,u)]},r.parseDepthToSpaceAttributes=m=>{const s=m.attributes.getInt("blocksize");if(s<1)throw new Error(`blocksize must be >= 1, but got : ${s} for DepthToSpace`);const h=m.attributes.getString("mode","DCR");if(h!=="DCR"&&h!=="CRD")throw new Error(`unrecognized mode: ${h} for DepthToSpace`);return{mode:h,blocksize:s}};const l=m=>{if(m.length!==1)throw new Error(`DepthToSpace expect 1 inputs, but got ${m.length}`);if(m[0].type==="string"||m[0].dims.length!==4)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDotProductProgramInfoLoader=void 0;const d=c(2517),l=c(5060),m=c(2039),s=c(2823),h=c(3248);r.createDotProductProgramInfoLoader=(p,a,o,t)=>{const e=((n,i)=>({name:"ConvDotProduct",inputNames:n?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:n?[m.TextureType.unpacked,m.TextureType.packedLastDimension,m.TextureType.unpacked]:[m.TextureType.unpacked,m.TextureType.packedLastDimension],cacheKey:i.activationCacheKey}))(a.length>2,t);return Object.assign(Object.assign({},e),{get:()=>((n,i,u,g,b)=>{const y=u[0].dims,_=u[1].dims,v=[_[0],Math.ceil(y[1]*_[2]*_[3]/4)],w=(0,h.calculateIm2ColDims)(y,_,g),[T,A]=n.calculateTextureWidthAndHeight(v,m.TextureType.packedLastDimension),E=d.ShapeUtil.computeStrides(w),[x,M]=n.calculateTextureWidthAndHeight(w,m.TextureType.packedLastDimension),C=g.length,k=u.length<3?"0.0":"_B(b)",V=Math.ceil(y[1]*_[2]*_[3]/4),{activationFunction:F,applyActivation:q}=(0,s.getActivationSnippet)(b),D=(0,l.getGlsl)(n.session.backend.glContext.version),U=` -${F} -float process(int indices[${C}]) { - int b[1]; - b[0] = indices[1]; - int im2col[4]; - im2col[0] = indices[0]; - im2col[1] = indices[2]; - im2col[2] = indices[3]; - int im2colOffset = im2col[0] * ${E[0]} + im2col[1] * ${E[1]} + im2col[2] * ${E[2]}; - int kernelOffset = indices[1] * ${v[1]}; - float value = ${k}; - for (int i = 0; i < ${V}; ++i) { - vec2 im2colCoords = offsetToCoords(im2colOffset, ${x}, ${M}); - vec2 kernelCoords = offsetToCoords(kernelOffset, ${T}, ${A}); - value += dot(${D.texture2D}(Im2Col, im2colCoords), ${D.texture2D}(K, kernelCoords)); - ++im2colOffset; - ++kernelOffset; - } - ${q} - return value; -}`;return Object.assign(Object.assign({},i),{output:{dims:g,type:u[0].type,textureType:m.TextureType.unpacked},shaderSource:U})})(p,e,a,o,t)})}},7992:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseFlattenAttributes=r.flatten=void 0;const d=c(2517);r.flatten=(m,s,h)=>{l(s,h);const p=d.ShapeUtil.flattenShape(s[0].dims,h);return[m.reshapeUnpacked(s[0],p)]},r.parseFlattenAttributes=m=>m.attributes.getInt("axis",1);const l=(m,s)=>{if(!m||m.length!==1)throw new Error("Flatten requires 1 input.");const h=m[0].dims.length;if(h===0)throw new Error("scalar tensor is not supported.");if(s<-h||s>h)throw new Error("Invalid axis");if(m[0].type==="string")throw new Error("string tensor is not supported.")}},2823:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseInternalActivationAttributes=r.getActivationSnippet=void 0;const d=c(2517),l=c(4909);r.getActivationSnippet=function(m){let s;switch(m.activation){case"Relu":s=(0,l.glslRelu)();break;case"Sigmoid":s=(0,l.glslSigmoid)();break;case"Clip":s=(0,l.glslClip)(m.clipMin,m.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const h=s.name;return{activationFunction:s.body,applyActivation:`value = ${h}_(value);`}},r.parseInternalActivationAttributes=m=>{const s=m.getString("activation","");if(s==="Clip"){const[h,p]=m.getFloats("activation_params",[d.MIN_CLIP,d.MAX_CLIP]);return{activation:s,clipMax:p,clipMin:h,activationCacheKey:`${s}:${h},${p}`}}return{activation:s,activationCacheKey:s}}},1253:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseGatherAttributes=r.gather=void 0;const d=c(246),l=c(782),m=c(2517),s=c(2039);r.gather=(o,t,e)=>(a(t,e.axis),[o.run(p(o,t,e),t)]),r.parseGatherAttributes=o=>(0,d.createAttributeWithCacheKey)({axis:o.attributes.getInt("axis",0)});const h={name:"Gather",inputNames:["A","B"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},p=(o,t,e)=>{const n=Object.assign(Object.assign({},h),{cacheHint:e.cacheKey});return Object.assign(Object.assign({},n),{get:()=>((i,u,g,b)=>{const y=g[0].dims.slice(),_=g[1].dims.slice(),v=new Array(y.length+_.length-1);b=m.ShapeUtil.normalizeAxis(b,y.length);const w=[];for(let A=0;A{if(!o||o.length!==2)throw new Error("Gather requires 2 inputs.");const e=o[0].dims.length;if(e<1)throw new Error("Invalid input shape.");if(t<-e||t>e-1)throw new Error("Invalid axis.");if(l.NUMBER_TYPES.indexOf(o[0].type)===-1)throw new Error("Invaid input type.");if(o[1].type!=="int32"&&o[1].type!=="int16")throw new Error("Invaid input type.")}},4776:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseGemmAttributesV11=r.parseGemmAttributesV7=r.gemm=void 0;const d=c(246),l=c(2517),m=c(2039);r.gemm=(o,t,e)=>(a(t,e),[o.run(h(t,e),t)]);const s=(o,t)=>{const e=o.attributes.getInt("transA",0)!==0,n=o.attributes.getInt("transB",0)!==0,i=o.attributes.getFloat("alpha",1),u=o.attributes.getFloat("beta",1);return(0,d.createAttributeWithCacheKey)({transA:e,transB:n,alpha:i,beta:u,isOptionalC:t})};r.parseGemmAttributesV7=o=>s(o,!1),r.parseGemmAttributesV11=o=>s(o,!0);const h=(o,t)=>{const e={name:"Gemm",inputNames:o.length===3?["A","B","C"]:["A","B"],inputTypes:o.length===3?[m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked]:[m.TextureType.unpacked,m.TextureType.unpacked],key:t.cacheKey};return Object.assign(Object.assign({},e),{get:()=>p(e,o,t)})},p=(o,t,e)=>{const n=t[0].dims.slice(),i=t[1].dims.slice(),[u,g]=l.GemmUtil.getShapeOfGemmResult(n,e.transA,i,e.transB,t.length===3?t[2].dims:void 0),b=[u,g];if(!b)throw new Error("Can't use gemm on the given tensors");let y=n[n.length-1],_="";e.transA&&(y=n[0]),e.transA&&e.transB?_="value += _A_T(a) * _B_T(b);":e.transA&&!e.transB?_="value += _A_T(a) * _B(b);":!e.transA&&e.transB?_="value += _A(a) * _B_T(b);":e.transA||e.transB||(_="value += _A(a) * _B(b);");const v=b.length,w=` - float process(int indices[${v}]) { - int a[${v}]; - int b[${v}]; - ${t.length===3?`int c[${t[2].dims.length}];`:""} - - copyVec(indices, a); - copyVec(indices, b); - ${t.length===3?"bcastIndices_C(indices, c);":""} - - float value = 0.0; - for (int k=0; k<${y}; ++k) { - a[${v-1}] = k; - b[${v-2}] = k; - ${_} - } - - value = value * alpha; - ${t.length===3?"value += beta * _C(c);":""} - return value; - }`;return Object.assign(Object.assign({},o),{output:{dims:b,type:t[0].type,textureType:m.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:e.alpha},{name:"beta",type:"float",data:e.beta}],shaderSource:w})},a=(o,t)=>{if(!o)throw new Error("Input is missing");if(t.isOptionalC&&(o.length<2||o.length>3))throw new Error("Invaid input shape.");if(!t.isOptionalC&&o.length!==3)throw new Error("Gemm requires 3 inputs");if(o.length===3&&o[2].dims.length!==1&&o[2].dims.length!==2)throw new Error("Invalid input shape of C");if(o[0].type!=="float32"&&o[0].type!=="float64"||o[1].type!=="float32"&&o[1].type!=="float64"||o.length===3&&o[2].type!=="float32"&&o[2].type!=="float64")throw new Error("Invalid input type.");if(o[0].type!==o[1].type||o.length===3&&o[0].type!==o[2].type)throw new Error("Input types are mismatched")}},8555:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createPackedIm2ColProgramInfoLoader=void 0;const d=c(5060),l=c(2039),m=c(2827);r.createPackedIm2ColProgramInfoLoader=(s,h,p,a,o)=>{const t=(e=o.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[l.TextureType.packed],cacheHint:e});var e;return Object.assign(Object.assign({},t),{get:()=>((n,i,u,g,b,y)=>{const _=u.dims,v=g.dims,w=b.length,T=[v[1]*v[2]*v[3],b[2]*b[3]],A=v[2]*v[3],E=(0,m.unpackFromChannel)(),x=(0,d.getGlsl)(n.session.backend.glContext.version);let M="";for(let k=0;k<=1;k++)for(let V=0;V<=1;V++)M+=` - blockIndex = rc.x + ${V}; - pos = rc.y + ${k}; - - if(blockIndex < ${T[1]} && pos < ${T[0]}) { - offsetY = int(blockIndex / (${b[w-1]})) * ${y.strides[0]} - - ${y.pads[0]}; - d0 = offsetY + ${y.dilations[0]} * (imod(pos, ${A}) / ${v[2]}); - - if(d0 < ${_[2]} && d0 >= 0) { - offsetX = imod(blockIndex, ${b[w-1]}) * ${y.strides[1]} - - ${y.pads[1]}; - d1 = offsetX + ${y.dilations[1]} * imod(imod(pos, ${A}), ${v[2]}); - - if(d1 < ${_[3]} && d1 >= 0) { - - ch = int(float(pos)/ ${A}.); - innerDims = vec2(d0, d1); - result[${2*k+V}] = getChannel( - getA(0, ch, int(innerDims.x), - int(innerDims.y)), innerDims); - } - } - } - - `;const C=` - ${E} - - void main() { - ivec2 rc = getOutputCoords(); - vec4 result = vec4(0.0); - int blockIndex, pos, offsetY, d0, offsetX, d1, ch; - vec2 innerDims; - ${M} - ${x.output} = result; - } - `;return Object.assign(Object.assign({},i),{output:{dims:T,type:u.type,textureType:l.TextureType.packed},shaderSource:C,hasMain:!0})})(s,t,h,p,a,o)})}},3248:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.calculateIm2ColDims=r.createIm2ColProgramInfoLoader=void 0;const d=c(2039);r.createIm2ColProgramInfoLoader=(l,m,s,h,p)=>{const a=(o=p.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[d.TextureType.unpacked],cacheHint:o});var o;return Object.assign(Object.assign({},a),{get:()=>((t,e,n,i,u,g)=>{const b=n.dims,y=i.dims,_=u.length,v=(0,r.calculateIm2ColDims)(b,y,u,4),w=` - const int XC = ${b[1]}; - const int XH = ${b[2]}; - const int XW = ${b[3]}; - const int KH = ${g.kernelShape[0]}; - const int KW = ${g.kernelShape[1]}; - const int dilationH = ${g.dilations[0]}; - const int dilationW = ${g.dilations[1]}; - const int strideH = ${g.strides[0]}; - const int strideW = ${g.strides[1]}; - const int padH = ${g.pads[0]}; - const int padW = ${g.pads[1]}; - const int KHKW = KH*KW; - const int XCKHKW = XC * KHKW; - const int outputChannels = 4; - vec4 process(int indices[${_}]) { - int b = indices[0]; // batch size - int oh = indices[1] * strideH - padH; //output height - int ow = indices[2] * strideW - padW; //output width - int p = indices[3] * outputChannels; //patch - vec4 value = vec4(0.0); - for(int i=0; i < outputChannels; ++i) { - if(p < XCKHKW) { - int patchC = p / KHKW; - int patchH = (p - patchC*KHKW) / KW; - int patchW = (p - patchC*KHKW) - patchH * KW; - int xh2 = oh + patchH * dilationH; - int xw2 = ow + patchW * dilationW; - int x[${b.length}]; - x[0] = b; - x[1] = patchC; - x[2] = xh2; - x[3] = xw2; - if(xh2 >= 0 && - xh2 < XH && - xw2 >= 0 && - xw2 < XW) { - value[i] = _X(x); - } - } - ++p; - } - return value; - } - `;return Object.assign(Object.assign({},e),{output:{dims:v,type:n.type,textureType:d.TextureType.packedLastDimension},shaderSource:w})})(0,a,m,s,h,p)})},r.calculateIm2ColDims=(l,m,s,h=4)=>[s[0],s[2],s[3],Math.ceil(l[1]*m[2]*m[3]/h)]},6572:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseImageScalerAttributes=r.imageScaler=void 0;const d=c(246),l=c(2039);r.imageScaler=(a,o,t)=>(p(o),[a.run(s(a,o,t),o)]),r.parseImageScalerAttributes=a=>{const o=a.attributes.getFloat("scale"),t=a.attributes.getFloats("bias");return(0,d.createAttributeWithCacheKey)({scale:o,bias:t})};const m={name:"ImageScaler",inputNames:["X"],inputTypes:[l.TextureType.unpacked]},s=(a,o,t)=>{const e=Object.assign(Object.assign({},m),{cacheHint:t.cacheKey});return Object.assign(Object.assign({},e),{get:()=>((n,i,u,g)=>{const b=u[0].dims.slice(),y=b.length,_=` - ${h(g.bias.length)} - float process(int indices[${y}]) { - return _X(indices) * scale + getBias(bias, indices[1]); - }`;return Object.assign(Object.assign({},i),{output:{dims:b,type:u[0].type,textureType:l.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:g.bias.length,data:g.bias},{name:"scale",type:"float",data:g.scale}],shaderSource:_})})(0,e,o,t)})},h=a=>{const o=[`float getBias(float bias[${a}], int channel) {`];for(let t=0;t{if(!a||a.length!==1)throw new Error("ImageScaler requires 1 input.");if(a[0].dims.length!==4)throw new Error("Invalid input shape.");if(a[0].type!=="float32"&&a[0].type!=="float64")throw new Error("Invalid input type.")}},3346:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseInstanceNormalizationAttributes=r.instanceNormalization=void 0;const d=c(5060),l=c(2039);r.instanceNormalization=(o,t,e)=>{a(t);const n=o.run(s(t[0]),t);return[o.run(p(o,t[0],e,n.dims),[t[0],n,t[1],t[2]])]},r.parseInstanceNormalizationAttributes=o=>o.attributes.getFloat("epsilon",1e-5);const m={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[l.TextureType.unpacked]},s=o=>Object.assign(Object.assign({},m),{get:()=>((t,e)=>{const n=e.dims.slice(),i=n[1],u=n[2]*n[3],g=[n[0],i],b=` - vec4 process(int[2] indices) { - vec4 v = vec4(0.0); - int a[4]; - a[0] = indices[0]; - a[1] = indices[1]; - float temp = 0.0; - for(int a2=0; a2<${n[2]}; a2++) { - a[2] = a2; - for(int a3=0; a3<${n[3]}; a3++) { - a[3] = a3; - float x = _X(a); - temp += x; - } - } - float mean = temp / float(${u}); - temp = 0.0; - for(int a2=0; a2<${n[2]}; a2++) { - a[2] = a2; - for(int a3=0; a3<${n[3]}; a3++) { - a[3] = a3; - float x = _X(a); - temp += (x - mean) * (x - mean); - } - } - v.r = mean; - v.g = temp / float(${u}); - - return v; - }`;return Object.assign(Object.assign({},t),{output:{dims:g,type:e.type,textureType:l.TextureType.packedLastDimension},shaderSource:b})})(m,o)}),h={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[l.TextureType.unpacked,l.TextureType.packedLastDimension,l.TextureType.unpacked,l.TextureType.unpacked]},p=(o,t,e,n)=>{const i=Object.assign(Object.assign({},h),{cacheHint:`${e}`});return Object.assign(Object.assign({},i),{get:()=>((u,g,b,y,_)=>{const v=(0,d.getGlsl)(u.session.backend.glContext.version),[w,T]=u.calculateTextureWidthAndHeight(_,l.TextureType.packedLastDimension),[A,E]=[w/4,T],x=` - vec4 get_MeanAndVariance(int[2] mv) { - int offset = indicesToOffset_MeanAndVariance(mv); - vec2 coords = offsetToCoords(offset, ${A}, ${E}); - return ${v.texture2D}(MeanAndVariance, coords); - } - - float process(int[4] indices) { - int mv[2]; - mv[0] = indices[0]; - mv[1] = indices[1]; - vec4 mean_and_variance = get_MeanAndVariance(mv); - float mean = mean_and_variance.r; - float variance = mean_and_variance.g; - - int sb[1]; - sb[0] = indices[1]; - float scale = _Scale(sb); - float b = _B(sb); - - return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b; - }`;return Object.assign(Object.assign({},g),{output:{dims:b.dims,type:b.type,textureType:l.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:y}],shaderSource:x})})(o,i,t,e,n)})},a=o=>{if(!o||o.length!==3)throw new Error("InstanceNormalization requires 3 inputs.");const t=o[0],e=o[1],n=o[2];if(t.dims.length<3||e.dims.length!==1||n.dims.length!==1)throw new Error("Invalid input shape.");if(e.dims[0]!==t.dims[1]||n.dims[0]!==t.dims[1])throw new Error("Input shapes are mismatched.");if(t.type!=="float32"&&t.type!=="float64"||e.type!=="float32"&&e.type!=="float64"||n.type!=="float32"&&n.type!=="float64")throw new Error("Invalid input type.");if(o[0].dims.length!==4)throw new Error("Only support 4-D input shape.")}},708:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createPackedMatmulProgramInfoLoader=void 0;const d=c(2517),l=c(5060),m=c(2039),s=c(9390),h=c(2823),p=c(5623);r.createPackedMatmulProgramInfoLoader=(a,o,t)=>{const e=(n=o.length>2,i=t.activationCacheKey,{name:"MatMul (packed)",inputNames:n?["A","B","Bias"]:["A","B"],inputTypes:n?[m.TextureType.packed,m.TextureType.packed,m.TextureType.packed]:[m.TextureType.packed,m.TextureType.packed],cacheHint:i});var n,i;return Object.assign(Object.assign({},e),{get:()=>((u,g,b,y)=>{const _=b.length>2,v=_?"value += getBiasForMatmul();":"",w=b[0].dims,T=b[1].dims,A=d.BroadcastUtil.calcShape(w,T,!0),E=!d.ShapeUtil.areEqual(b[0].dims,b[1].dims);if(!A)throw new Error("Can't use matmul on the given tensors");const x=w[w.length-1],M=Math.ceil(x/2),C=w.length,k=T.length,V=(0,l.getGlsl)(u.session.backend.glContext.version),F=(0,s.getCoordsDataType)(A.length),q=A.length,D=(0,s.getGlChannels)(),{activationFunction:U,applyActivation:J}=(0,h.getActivationSnippet)(y),Y=_?`${(0,p.getBiasForMatmul)(F,D,b[2].dims,A,!0)}`:"",Z=E?`${function(Te,ue,xe,_e){let Le=[],ze=[];const Se=xe[0].dims,De=xe[1].dims,Re=Se.length,Ae=De.length,we=_e.length,ke=we-Re,Ue=we-Ae;Le=Se.map((Ee,$e)=>`coords.${ue[$e+ke]}`),Le[Re-1]="i*2",Le.join(", "),ze=De.map((Ee,$e)=>`coords.${ue[$e+Ue]}`),ze[Ae-2]="i*2",ze.join(", ");const Be=d.BroadcastUtil.getBroadcastDims(Se,_e),We=d.BroadcastUtil.getBroadcastDims(De,_e),qe=Be.map(Ee=>`coords.${ue[Ee+ke]} = 0;`).join(` -`),je=We.map(Ee=>`coords.${ue[Ee+Ue]} = 0;`).join(` -`),Ve=`int lastDim = coords.${ue[we-1]}; - coords.${ue[we-1]} = coords.${ue[we-2]}; - coords.${ue[we-2]} = lastDim;`;return` -vec4 getAAtOutCoordsMatmul(int i) { - ${Te} coords = getOutputCoords(); - ${Ve} - ${qe} - vec4 outputValue = getA(${Le}); - return outputValue; -} - -vec4 getBAtOutCoordsMatmul(int i) { - ${Te} coords = getOutputCoords(); - ${Ve} - ${je} - vec4 outputValue = getB(${ze}); - return outputValue; -}`}(F,D,b,A)}`:"",te=E?"getAAtOutCoordsMatmul(i)":`getA(${function(Te,ue){let xe="";for(let _e=0;_e{Object.defineProperty(r,"__esModule",{value:!0}),r.getBiasForMatmul=r.createMatmulProgramInfoLoader=r.parseMatMulAttributes=r.matMul=void 0;const d=c(2517),l=c(2039),m=c(9390),s=c(2823),h=c(708);function p(t,e){const n=(i=t.length>2,u=e.activationCacheKey,{name:"MatMul",inputNames:i?["A","B","Bias"]:["A","B"],inputTypes:i?[l.TextureType.unpacked,l.TextureType.unpacked,l.TextureType.unpacked]:[l.TextureType.unpacked,l.TextureType.unpacked],cacheHint:u});var i,u;return Object.assign(Object.assign({},n),{get:()=>function(g,b,y){const _=b[0].dims,v=b[1].dims,w=d.BroadcastUtil.calcShape(_,v,!0);if(!w)throw new Error("Can't use matmul on the given tensors");const T=(0,m.getCoordsDataType)(w.length),A=(0,m.getGlChannels)(),{activationFunction:E,applyActivation:x}=(0,s.getActivationSnippet)(y),M=b.length>2,C=M?"value += getBiasForMatmul();":"",k=M?`${o(T,A,b[2].dims,w,!1)}`:"",V=w.length,F=_.length,q=v.length,D=` - ${E} - ${k} - float process(int indices[${V}]) { - int a[${F}]; - int b[${q}]; - bcastMatmulIndices_A(indices, a); - bcastMatmulIndices_B(indices, b); - - float value; - for (int k=0; k<${_[_.length-1]}; ++k) { - a[${F-1}] = k; - b[${q-2}] = k; - value += _A(a) * _B(b); - } - ${C} - ${x} - return value; - }`;return Object.assign(Object.assign({},g),{output:{dims:w,type:b[0].type,textureType:l.TextureType.unpacked},shaderSource:D})}(n,t,e)})}r.matMul=(t,e,n)=>(a(e),t.session.pack?[t.run((0,h.createPackedMatmulProgramInfoLoader)(t,e,n),e)]:[t.run(p(e,n),e)]),r.parseMatMulAttributes=t=>(0,s.parseInternalActivationAttributes)(t.attributes),r.createMatmulProgramInfoLoader=p;const a=t=>{if(!t||t.length!==2)throw new Error("MatMul requires 2 inputs.");if(t[0].dims[t[0].dims.length-1]!==t[1].dims[t[1].dims.length-2])throw new Error("shared dimension does not match.");if(t[0].type!=="float32"&&t[0].type!=="float64"||t[1].type!=="float32"&&t[1].type!=="float64")throw new Error("inputs should be float type");if(t[0].type!==t[1].type)throw new Error("inputs types should match")};function o(t,e,n,i,u){let g="";const b=n.length,y=i.length,_=y-b;g=y<2&&b>0?"coords":n.map((T,A)=>`coords.${e[A+_]}`).join(", ");const v=d.BroadcastUtil.getBroadcastDims(n,i).map(T=>`coords.${e[T+_]} = 0;`).join(` -`);let w="vec4(outputValue.xx, outputValue.yy)";return d.ShapeUtil.size(n)===1&&(w="vec4(outputValue.x)"),u?` -vec4 getBiasForMatmul() { - ${t} coords = getOutputCoords(); - ${v} - vec4 outputValue = getBias(${g}); - return ${w}; -}`:` -float getBiasForMatmul() { - ${t} coords = getOutputCoords(); - ${v} - return getBias(coords.x); -}`}r.getBiasForMatmul=o},2403:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createPackProgramInfoLoader=void 0;const d=c(5060),l=c(2039),m=c(9390),s=c(2827),h={name:"pack",inputNames:["A"],inputTypes:[l.TextureType.unpackedReversed]};r.createPackProgramInfoLoader=(p,a)=>Object.assign(Object.assign({},h),{get:()=>((o,t)=>{const e=(0,d.getGlsl)(o.session.backend.glContext.version),n=t.dims,i=n.length,u=t.dims.length,g=(0,m.getCoordsDataType)(u),b=(0,s.getChannels)("rc",u),y=(_=u,v=b,w=n[n.length-2],T=n[n.length-1],_===0||_===1?"":` - int r = ${v[_-2]}; - int c = ${v[_-1]}; - int rp1 = ${v[_-2]} + 1; - int cp1 = ${v[_-1]} + 1; - bool rEdge = rp1 >= ${T}; - bool cEdge = cp1 >= ${w}; - `);var _,v,w,T;let A;A=i===0?[1,1]:i===1?[n[0],1]:[n[u-1],n[u-2]];const E=function(C,k,V){if(C===0)return"false";if(C===1)return`rc > ${k[0]}`;let F="";for(let q=C-2;q= ${k[q-C+2]}`,q= ${C[0]} ? 0. : getA(rc + 1), - 0, 0`;let F="";if(V>2)for(let q=0;q{Object.defineProperty(r,"__esModule",{value:!0}),r.unpackFromChannel=r.getChannels=r.getVecChannels=void 0;const d=c(9390);function l(m,s){return(0,d.getGlChannels)(s).map(h=>`${m}.${h}`)}r.getVecChannels=l,r.getChannels=function(m,s){return s===1?[m]:l(m,s)},r.unpackFromChannel=function(){return` - float getChannel(vec4 frag, int dim) { - int modCoord = imod(dim, 2); - return modCoord == 0 ? frag.r : frag.g; - } - - float getChannel(vec4 frag, vec2 innerDims) { - vec2 modCoord = mod(innerDims, 2.); - return modCoord.x == 0. ? - (modCoord.y == 0. ? frag.r : frag.g) : - (modCoord.y == 0. ? frag.b : frag.a); - } - `}},2870:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parsePadAttributesV11=r.padV11=r.parsePadAttributesV2=r.padV2=void 0;const d=c(246),l=c(2517),m=c(5060),s=c(2039),h={name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};r.padV2=(g,b,y)=>(o(b),[g.run(Object.assign(Object.assign({},h),{cacheHint:y.cacheKey,get:()=>a(g,b[0],y)}),b)]),r.parsePadAttributesV2=g=>{const b=g.attributes.getString("mode","constant"),y=g.attributes.getFloat("value",0),_=g.attributes.getInts("pads");return(0,d.createAttributeWithCacheKey)({mode:b,value:y,pads:_})},r.padV11=(g,b,y)=>{t(b);const _=p(g,b,y);return(0,r.padV2)(g,[b[0]],_)},r.parsePadAttributesV11=g=>g.attributes.getString("mode","constant");const p=(g,b,y)=>{if(!g.session.isInitializer(b[1].dataId)||b.length>=3&&!g.session.isInitializer(b[2].dataId))throw new Error("dynamic pad attributes are not allowed");const _=Array.from(b[1].integerData),v=b.length>=3?b[2].floatData[0]:0;return(0,d.createAttributeWithCacheKey)({mode:y,pads:_,value:v})},a=(g,b,y)=>{const _=l.ShapeUtil.padShape(b.dims.slice(),y.pads),v=_.length,w=` - ${e(g,b,y)} - float process(int[${v}] indices) { - return padA(indices); - }`;return{name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked],output:{dims:_,type:b.type,textureType:s.TextureType.unpacked},shaderSource:w}},o=g=>{if(!g||g.length!==1)throw new Error("Pad requires 1 input");if(g[0].type!=="float32"&&g[0].type!=="float64")throw new Error("Invalid input type.")},t=g=>{if(!g||g.length!==2&&g.length!==3)throw new Error("Pad requires 2 or 3 inputs");if(g[1].type!=="int32")throw new Error("Invalid input type.");if(g.length>=3&&g[2].type==="string")throw new Error("Invalid input type.")},e=(g,b,y)=>{const _=(0,m.getGlsl)(g.session.backend.glContext.version),[v,w]=g.calculateTextureWidthAndHeight(b.dims,s.TextureType.unpacked),T=l.ShapeUtil.computeStrides(b.dims);switch(y.mode){case"constant":return n(_,b.dims,T,v,w,y.pads,y.value);case"reflect":return i(_,b.dims,T,v,w,y.pads);case"edge":return u(_,b.dims,T,v,w,y.pads);default:throw new Error("Invalid mode")}},n=(g,b,y,_,v,w,T)=>{const A=b.length;let E="";for(let x=A-1;x>=0;--x)E+=` - k = m[${x}] - ${w[x]}; - if (k < 0) return constant; - if (k >= ${b[x]}) return constant; - offset += k * ${y[x]}; - `;return` - float padA(int m[${A}]) { - const float constant = float(${T}); - int offset = 0; - int k = 0; - ${E} - vec2 coords = offsetToCoords(offset, ${_}, ${v}); - float value = getColorAsFloat(${g.texture2D}(A, coords)); - return value; - } - `},i=(g,b,y,_,v,w)=>{const T=b.length;let A="";for(let E=T-1;E>=0;--E)A+=` - k = m[${E}] - ${w[E]}; - if (k < 0) { k = -k; } - { - const int _2n_1 = ${2*(b[E]-1)}; - k = int( mod( float(k), float(_2n_1) ) ) ; - if(k >= ${b[E]}) { k = _2n_1 - k; } - } - offset += k * ${y[E]}; - `;return` - float padA(int m[${T}]) { - int offset = 0; - int k = 0; - ${A} - vec2 coords = offsetToCoords(offset, ${_}, ${v}); - float value = getColorAsFloat(${g.texture2D}(A, coords)); - return value; - } - `},u=(g,b,y,_,v,w)=>{const T=b.length;let A="";for(let E=T-1;E>=0;--E)A+=` - k = m[${E}] - ${w[E]}; - if (k < 0) k = 0; - if (k >= ${b[E]}) k = ${b[E]-1}; - offset += k * ${y[E]}; - `;return` - float padA(int m[${T}]) { - int offset = 0; - int k = 0; - ${A} - vec2 coords = offsetToCoords(offset, ${_}, ${v}); - float value = getColorAsFloat(${g.texture2D}(A, coords)); - return value; - } - `}},2143:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.globalMaxPool=r.parseMaxPoolAttributes=r.maxPool=r.parseGlobalAveragePoolAttributes=r.globalAveragePool=r.parseAveragePoolAttributes=r.averagePool=void 0;const d=c(246),l=c(2517),m=c(2039);r.averagePool=(u,g,b)=>{t(g);const y={name:"AveragePool",inputNames:["X"],inputTypes:[m.TextureType.unpacked],cacheHint:b.cacheKey};return[u.run(Object.assign(Object.assign({},y),{get:()=>s(g,y,!1,b)}),g)]},r.parseAveragePoolAttributes=u=>{const g=u.attributes.getString("auto_pad","NOTSET"),b=u.attributes.getInt("ceil_mode",0),y=u.attributes.getInt("count_include_pad",0)!==0,_=u.attributes.getInts("kernel_shape"),v=u.attributes.getInts("strides",[]),w=u.attributes.getInts("pads",[]);if(b!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,d.createAttributeWithCacheKey)({autoPad:g,ceilMode:b,countIncludePad:y,kernelShape:_,strides:v,pads:w})};const s=(u,g,b,y)=>{const[_,v]=p(u,y,b),w=l.ShapeUtil.size(_.kernelShape);let T="";_.countIncludePad?T+=`value /= float(${w});`:T+=`value /= float(${w} - pad);`;const A=` - ${e(u[0].dims,_,"value += _X(x);",T,"0.0")} - `;return Object.assign(Object.assign({},g),{output:{dims:v,type:u[0].type,textureType:m.TextureType.unpacked},shaderSource:A})};r.globalAveragePool=(u,g,b)=>{t(g);const y={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[m.TextureType.unpacked],cacheHint:`${b.countIncludePad}`};return[u.run(Object.assign(Object.assign({},y),{get:()=>s(g,y,!0,b)}),g)]},r.parseGlobalAveragePoolAttributes=u=>{const g=u.attributes.getInt("count_include_pad",0)!==0;return(0,d.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:g,kernelShape:[],strides:[],pads:[]})},r.maxPool=(u,g,b)=>{t(g);const y={name:"MaxPool",inputNames:["X"],inputTypes:[m.TextureType.unpacked],cacheHint:b.cacheKey};return[u.run(Object.assign(Object.assign({},y),{get:()=>h(g,y,!1,b)}),g)]},r.parseMaxPoolAttributes=u=>{const g=u.attributes.getString("auto_pad","NOTSET"),b=u.attributes.getInt("ceil_mode",0),y=u.attributes.getInts("kernel_shape"),_=u.attributes.getInts("strides",[]),v=u.attributes.getInts("pads",[]),w=u.attributes.getInt("storage_order",0),T=u.attributes.getInts("dilations",[]);if(w!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(b!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,d.createAttributeWithCacheKey)({autoPad:g,ceilMode:b,countIncludePad:!1,kernelShape:y,strides:_,pads:v,storageOrder:w,dilations:T})};const h=(u,g,b,y)=>{const[_,v]=p(u,y,b),w=` - ${e(u[0].dims,_,` - value = max(_X(x), value); - `,"","-1e5")} - `;return Object.assign(Object.assign({},g),{output:{dims:v,type:u[0].type,textureType:m.TextureType.unpacked},shaderSource:w})},p=(u,g,b)=>{const y=u[0].dims.slice(),_=Object.hasOwnProperty.call(g,"dilations"),v=g.kernelShape.slice(),w=g.strides.slice(),T=_?g.dilations.slice():[],A=g.pads.slice();l.PoolConvUtil.adjustPoolAttributes(b,y,v,w,T,A);const E=l.PoolConvUtil.computePoolOutputShape(b,y,w,T,v,A,g.autoPad),x=Object.assign({},g);return _?Object.assign(x,{kernelShape:v,strides:w,pads:A,dilations:T,cacheKey:g.cacheKey}):Object.assign(x,{kernelShape:v,strides:w,pads:A,cacheKey:g.cacheKey}),[x,E]},a={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},o={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[m.TextureType.unpacked]};r.globalMaxPool=(u,g)=>(t(g),[u.run(Object.assign(Object.assign({},o),{get:()=>h(g,o,!0,a)}),g)]);const t=u=>{if(!u||u.length!==1)throw new Error("Pool ops requires 1 input.");if(u[0].type!=="float32"&&u[0].type!=="float64")throw new Error("Invalid input type.")},e=(u,g,b,y,_)=>{const v=u.length;if(g.kernelShape.length<=2){const w=g.kernelShape[g.kernelShape.length-1],T=g.strides[g.strides.length-1],A=g.pads[g.pads.length/2-1],E=g.pads[g.pads.length-1],x=u[v-1];let M="",C="",k="";if(M=A+E!==0?` - for (int i = 0; i < ${w}; i++) { - x[${v} - 1] = indices[${v} - 1] * ${T} - ${A} + i; - if (x[${v} - 1] < 0 || x[${v} - 1] >= ${x}) { - pad++; - continue; - } - ${b} - }`:` - for (int i = 0; i < ${w}; i++) { - x[${v} - 1] = indices[${v} - 1] * ${T} - ${A} + i; - ${b} - }`,g.kernelShape.length===2){const V=g.kernelShape[g.kernelShape.length-2],F=g.strides[g.strides.length-2],q=g.pads[g.pads.length/2-2],D=g.pads[g.pads.length-2],U=u[v-2];C=q+D!==0?` - for (int j = 0; j < ${V}; j++) { - x[${v} - 2] = indices[${v} - 2] * ${F} - ${q} + j; - if (x[${v} - 2] < 0 || x[${v} - 2] >= ${U}) { - pad+= ${w}; - continue; - } - `:` - for (int j = 0; j < ${V}; j++) { - x[${v} - 2] = indices[${v} - 2] * ${F} - ${q} + j; - `,k=` - } - `}return` - float process(int indices[${v}]) { - int x[${v}]; - copyVec(indices, x); - - float value = ${_}; - int pad = 0; - ${C} - ${M} - ${k} - ${y} - return value; - } - `}{const w=l.ShapeUtil.size(g.kernelShape),T=l.ShapeUtil.computeStrides(g.kernelShape),A=T.length,E=g.pads.length,x=i(A),M=n(u,"inputDims"),C=n(g.pads,"pads"),k=n(T,"kernelStrides"),V=n(g.strides,"strides");let F="";return F=g.pads.reduce((q,D)=>q+D)?` - if (x[j] >= inputDims[j] || x[j] < 0) { - pad++; - isPad = true; - break; - } - } - if (!isPad) { - ${b} - }`:` - } - ${b} - `,` - ${x} - float process(int indices[${v}]) { - int x[${v}]; - copyVec(indices, x); - int offset[${A}]; - int pads[${E}]; - int inputDims[${v}]; - int kernelStrides[${A}]; - int strides[${A}]; - ${C} - ${M} - ${V} - ${k} - - float value = ${_}; - int pad = 0; - bool isPad = false; - for (int i = 0; i < ${w}; i++) { - offsetToIndices(i, kernelStrides, offset); - isPad = false; - for (int j = ${v} - ${A}; j < ${v}; j++) { - x[j] = indices[j] * strides[j - ${v} + ${A}] - + offset[j - ${v} + ${A}] - pads[j - 2]; - ${F} - } - ${y} - - return value; - } - `}},n=(u,g)=>{let b="";for(let y=0;y` - void offsetToIndices(int offset, int[${u}] strides, out int[${u}] indices) { - if (${u} == 0) { - return; - } - for (int i = 0; i < ${u} - 1; ++i) { - indices[i] = offset / strides[i]; - offset -= indices[i] * strides[i]; - } - indices[${u} - 1] = offset; - }`},4939:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.reduceLogSumSquare=r.reduceLogSum=r.reduceProd=r.reduceMin=r.reduceMax=r.reduceMean=r.reduceSum=r.parseReduceAttributes=void 0;const d=c(246),l=c(782),m=c(2517),s=c(2039),h=(o,t,e,n,i)=>{a(t);const u={name:n,inputNames:["A"],inputTypes:[s.TextureType.unpacked]};return[o.run(Object.assign(Object.assign({},u),{cacheHint:e.cacheKey,get:()=>p(o,t,e,n,i,u)}),t)]};r.parseReduceAttributes=o=>{const t=o.attributes.getInts("axes",[]),e=o.attributes.getInt("keepdims",1)===1;return(0,d.createAttributeWithCacheKey)({axes:t,keepDims:e})};const p=(o,t,e,n,i,u)=>{const g=[],b=t[0].dims.length||1,y=[],_=m.ShapeUtil.normalizeAxes(e.axes,t[0].dims.length),v=i(t,_);let w=v[1];for(let A=0;A=0||_.length===0?(e.keepDims&&g.push(1),w=` - for(int j${A} = 0; j${A} < ${t[0].dims[A]}; j${A}++) { - inputIdx[${A}] = j${A}; - ${w} - }`):(y.push(`inputIdx[${A}] = outputIdx[${g.length}];`),g.push(t[0].dims[A]));const T=` - float process(int outputIdx[${g.length||1}]) { - float value; // final result - int inputIdx[${b}]; // addressing input data - ${y.join(` -`)} - ${v[0]} // init ops for reduce max/min - ${w} - ${v[2]} // final computation for reduce mean - return value; - }`;return Object.assign(Object.assign({},u),{output:{dims:g,type:t[0].type,textureType:s.TextureType.unpacked},shaderSource:T})},a=o=>{if(!o||o.length!==1)throw new Error("Reduce op requires 1 input.");if(l.NUMBER_TYPES.indexOf(o[0].type)===-1)throw new Error("Invalid input type.")};r.reduceSum=(o,t,e)=>h(o,t,e,"ReduceSum",()=>["value = 0.0;","value += _A(inputIdx);",""]),r.reduceMean=(o,t,e)=>h(o,t,e,"ReduceMean",(n,i)=>{let u=1;for(let g=0;g=0||i.length===0)&&(u*=n[0].dims[g]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${u}.;`]}),r.reduceMax=(o,t,e)=>h(o,t,e,"ReduceMax",(n,i)=>{const u=[];for(let g=0;g=0||i.length===0)&&u.push(`inputIdx[${g}] = 0;`);return[`${u.join(` -`)} -value = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]}),r.reduceMin=(o,t,e)=>h(o,t,e,"ReduceMin",(n,i)=>{const u=[];for(let g=0;g=0||i.length===0)&&u.push(`inputIdx[${g}] = 0;`);return[`${u.join(` -`)} -value = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),r.reduceProd=(o,t,e)=>h(o,t,e,"ReduceProd",()=>["value = 1.0;","value *= _A(inputIdx);",""]),r.reduceLogSum=(o,t,e)=>h(o,t,e,"ReduceLogSum",()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"]),r.reduceLogSumSquare=(o,t,e)=>h(o,t,e,"ReduceLogSumSquare",()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""])},7019:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isReshapeCheap=r.processDims3D=r.createPackedReshape3DProgramInfoLoader=void 0;const d=c(2517),l=c(5060),m=c(2039),s=c(2827);r.createPackedReshape3DProgramInfoLoader=(h,p,a)=>{const o=(t=>({name:"Reshape (packed)",inputTypes:[m.TextureType.packed],inputNames:["A"],cacheHint:`${t}`}))(a);return Object.assign(Object.assign({},o),{get:()=>((t,e,n,i)=>{const u=e.dims,g=i;let b="";for(let v=0;v<4;v++){let w="";switch(v){case 0:w="outputCoords = rc;";break;case 1:w="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:w="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:w="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}b+=` - ${w} - ${v>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""} - int flattenedIndex = getFlattenedIndex(outputCoords); - - ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex); - vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z)); - - result[${v}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims); - - ${v>0?"}":""} - `}const y=(0,l.getGlsl)(t.session.backend.glContext.version),_=` - ${function(v){const w=d.ShapeUtil.computeStrides(v),T=["b","r","c"],A="index";return` - ivec3 inputCoordsFromReshapedOutCoords(int index) { - ${w.map((E,x)=>`int ${T[x]} = ${A} / ${E}; ${x===w.length-1?`int ${T[x+1]} = ${A} - ${T[x]} * ${E}`:`index -= ${T[x]} * ${E}`};`).join("")} - return ivec3(b, r, c); - } - `}(u)} - ${function(v){const w=d.ShapeUtil.computeStrides(v);return` - int getFlattenedIndex(ivec3 coords) { - // reverse y, z order - return coords.x * ${w[0]} + coords.z * ${w[1]} + coords.y; - } -`}(g)} - ${(0,s.unpackFromChannel)()} - - void main() { - ivec3 rc = getOutputCoords(); - - vec4 result = vec4(0.0); - - ivec3 outputCoords; - int rows = ${g[2]}; - int cols = ${g[1]}; - - ${b} - ${y.output} = result; - } - `;return Object.assign(Object.assign({},n),{output:{dims:g,type:e.type,textureType:m.TextureType.packed},shaderSource:_,hasMain:!0})})(h,p,o,a)})},r.processDims3D=function(h){if(h.length===0)return[1,1,1];let p=1;for(let a=0;a1?h[h.length-2]:1,h[h.length-1]]},r.isReshapeCheap=function(h,p){let a=!1;return a=h.length===0||p.length===0||(h.length<2||p.length<2?h[h.length-1]===p[p.length-1]:h[h.length-1]===p[p.length-1]&&h[h.length-2]===p[p.length-2]),a}},718:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.reshape=void 0;const d=c(2517);r.reshape=(l,m)=>{const s=d.ShapeUtil.calculateReshapedDims(m[0].dims,m[1].integerData);return l.session.pack?[l.reshapePacked(m[0],s)]:[l.reshapeUnpacked(m[0],s)]}},2268:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseResizeAttributesV11=r.parseResizeAttributesV10=r.resize=void 0;const d=c(5060),l=c(2039),m=c(9390),s=c(2827),h=c(9793),p={name:"Resize",inputNames:["A"],inputTypes:[l.TextureType.packed]};r.resize=(n,i,u)=>((0,h.validateInputs)(i,u),[n.run(Object.assign(Object.assign({},p),{cacheHint:u.cacheKey,get:()=>a(n,i,u)}),i)]),r.parseResizeAttributesV10=n=>(0,h.parseUpsampleAttributes)(n,10),r.parseResizeAttributesV11=n=>(0,h.parseUpsampleAttributes)(n,11);const a=(n,i,u)=>{const g=(0,d.getGlsl)(n.session.backend.glContext.version),[b,y]=o(i,u);if(b.every(F=>F===1)&&u.coordinateTransformMode!=="tf_crop_and_resize")return Object.assign(Object.assign({},p),{output:{dims:y,type:i[0].type,textureType:l.TextureType.packed},hasMain:!0,shaderSource:`void main() { - vec4 v = ${g.texture2D}(X, TexCoords); - ${g.output} = v; - }`});const _=y.length;if(_<2)throw new Error(`output dimension should be at least 2, but got ${_}`);const v=y[_-2],w=y[_-1],T=i[0].dims;if(_!==T.length)throw new Error(`output dimension should match input ${T.length}, but got ${_}`);const A=T[_-2],E=T[_-1],x=b[_-2],M=b[_-1];let C="";if(u.mode!=="linear")throw new Error(`resize (packed) does not support mode: '${u.mode}'`);switch(u.coordinateTransformMode){case"asymmetric":C=` - vec4 getSourceFracIndex(ivec4 coords) { - return vec4(coords) / scaleWHWH; - } - `;break;case"half_pixel":C=` - vec4 getSourceFracIndex(ivec4 coords) { - return (vec4(coords) + 0.5) / scaleWHWH - 0.5; - } - `;break;case"pytorch_half_pixel":C=` - vec4 getSourceFracIndex(ivec4 coords) { - vec4 fcoords = vec4(coords); - return vec4( - ${w}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0, - ${v}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0, - ${w}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0, - ${v}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0 - ); - } - `;break;case"align_corners":C=` - vec4 getSourceFracIndex(ivec4 coords) { - vec4 resized = vec4(${w}.0 - 1.0, ${v}.0 - 1.0, ${w}.0 - 1.0, - ${v}.0 - 1.0); - vec4 original = vec4(${E}.0 - 1.0, ${A}.0 - 1.0, ${E}.0 - 1.0, - ${A}.0 - 1.0); - vec4 new_scale = original / resized; - return vec4(coords) * new_scale; - } - `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${u.coordinateTransformMode}'`)}const k=(0,m.getCoordsDataType)(_),V=` - const vec2 inputWH = vec2(${A}.0, ${E}.0); - const vec4 scaleWHWH = vec4(float(${x}), float(${M}), float(${x}), float(${M})); - ${(0,s.unpackFromChannel)()} - ${C} - float getAValue(int x10, int r, int c, int d) { - return getChannel(getA(x10, r, c, d), vec2(c, d)); - } - void main() { - ${k} rc = getOutputCoords(); - - int batch = rc[0]; - int depth = rc[1]; - - // retrieve the 4 coordinates that is used in the 4 packed output values. - ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1); - - // calculate the source index in fraction - vec4 sourceFrac = getSourceFracIndex(coords); - - // get the lower and upper bound of the 4 values that will be packed into one texel. - ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy))); - ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw))); - ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy))); - ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw))); - - bool hasNextRow = rc.w < ${v-1}; - bool hasNextCol = rc.z < ${w-1}; - - // pack x00, x01, x10, x11's top-left corner into one vec4 structure - vec4 topLeft = vec4( - getAValue(batch, depth, x00.x, x00.y), - hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0, - hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0, - (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0); - - // pack x00, x01, x10, x11's top-right corner into one vec4 structure - vec4 topRight = vec4( - getAValue(batch, depth, x00.x, x00.w), - hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0, - hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0, - (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0); - - // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure - vec4 bottomLeft = vec4( - getAValue(batch, depth, x00.z, x00.y), - hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0, - hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0, - (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0); - - // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure - vec4 bottomRight = vec4( - getAValue(batch, depth, x00.z, x00.w), - hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0, - hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0, - (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0); - - // calculate the interpolation fraction on u and v direction - vec4 frac = vec4(sourceFrac) - floor(sourceFrac); - vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0)); - - vec4 top = mix(topLeft, topRight, clampFrac.ywyw); - vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw); - vec4 newValue = mix(top, bottom, clampFrac.xxzz); - - ${g.output} = vec4(newValue); - } - `;return Object.assign(Object.assign({},p),{output:{dims:y,type:i[0].type,textureType:l.TextureType.packed},hasMain:!0,shaderSource:V})},o=(n,i)=>{const u=n[0].dims;let g,b=i.scales;if(b.length===0){const _=n[i.scalesInputIdx];if(_&&_.size!==0){if(n[i.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");b=t(_,i.mode,i.isResize)}else{const v=n[i.sizesInputIdx];if(!v||v.size===0)throw new Error("Either scales or sizes MUST be provided as input.");g=Array.from(v.integerData),b=e(g,u,i.mode,i.isResize)}}else if(n[i.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const y=g||u.map((_,v)=>Math.floor(_*b[v]));return[b,y]},t=(n,i,u)=>{const g=Array.from(n.floatData);return(0,h.scalesValidation)(g,i,u),g},e=(n,i,u,g)=>{const b=i.length,y=new Array(b);for(let _=0,v=b;_{Object.defineProperty(r,"__esModule",{value:!0}),r.shape=void 0;const d=c(9162);r.shape=(m,s)=>(l(s),[new d.Tensor([s[0].dims.length],"int32",void 0,void 0,new Int32Array(s[0].dims))]);const l=m=>{if(!m||m.length!==1)throw new Error("Shape requires 1 input.")}},2278:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.sliceV10=r.parseSliceAttributes=r.slice=void 0;const d=c(246),l=c(782),m=c(2517),s=c(2039),h={name:"Slice",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};r.slice=(e,n,i)=>(a(n),[e.run(Object.assign(Object.assign({},h),{cacheHint:i.cacheKey,get:()=>p(e,n[0],i)}),n)]),r.parseSliceAttributes=e=>{const n=e.attributes.getInts("starts"),i=e.attributes.getInts("ends"),u=e.attributes.getInts("axes",[]);return(0,d.createAttributeWithCacheKey)({starts:n,ends:i,axes:u})};const p=(e,n,i)=>{const u=i.axes.length===0?n.dims.slice(0).map((T,A)=>A):i.axes,g=m.ShapeUtil.normalizeAxes(u,n.dims.length),b=i.starts.map((T,A)=>T>n.dims[g[A]]-1?n.dims[g[A]]:m.ShapeUtil.normalizeAxis(T,n.dims[g[A]])),y=i.ends.map((T,A)=>T>n.dims[g[A]]-1?n.dims[g[A]]:m.ShapeUtil.normalizeAxis(T,n.dims[g[A]])),_=n.dims.slice(),v=[];for(let T=0;T0&&v.push(`outputIdx[${g[T]}] += ${b[T]};`);const w=` - float process(int outputIdx[${_.length}]) { - ${v.join(` - `)} - return _A(outputIdx); - }`;return Object.assign(Object.assign({},h),{output:{dims:_,type:n.type,textureType:s.TextureType.unpacked},shaderSource:w})},a=e=>{if(!e||e.length!==1)throw new Error("Slice requires 1 input.");if(l.NUMBER_TYPES.indexOf(e[0].type)===-1)throw new Error("Invalid input type.")};r.sliceV10=(e,n)=>{t(n);const i=o(e,n);return[e.run(Object.assign(Object.assign({},h),{cacheHint:i.cacheKey,get:()=>p(e,n[0],i)}),[n[0]])]};const o=(e,n)=>{if(!e.session.isInitializer(n[1].dataId)||!e.session.isInitializer(n[2].dataId)||n.length>=4&&!e.session.isInitializer(n[3].dataId)||n.length>=5&&!e.session.isInitializer(n[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(n.length>=5&&n[4].integerData.some(b=>b!==1))throw new Error("currently non-1 steps is not supported for Slice");const i=Array.from(n[1].integerData),u=Array.from(n[2].integerData),g=n.length>=4?Array.from(n[3].integerData):[];return{starts:i,ends:u,axes:g,cacheKey:`${g};${i};${u}`}},t=e=>{if(!e||e.length<3||e.length>5)throw new Error("Invalid input number.");if(e[1].type!=="int32"||e[1].dims.length!==1)throw new Error("Invalid input type.");if(e[2].type!=="int32"||e[2].dims.length!==1)throw new Error("Invalid input type.");if(e.length>=4&&(e[3].type!=="int32"||e[3].dims.length!==1))throw new Error("Invalid input type.");if(e.length>=5&&(e[4].type!=="int32"||e[4].dims.length!==1))throw new Error("Invalid input type.")}},5524:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.softmaxV13=r.parseSoftmaxAttributesV13=r.parseSoftmaxAttributes=r.softmax=void 0;const d=c(246),l=c(2517),m=c(5060),s=c(2039),h=c(3738),p={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[s.TextureType.unpacked]},a={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},o={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked]};r.softmax=(g,b,y)=>{u(b);const _=b[0].dims.slice(),v=l.ShapeUtil.normalizeAxis(y.axis,_.length),w=l.ShapeUtil.sizeToDimension(_,v),T=l.ShapeUtil.sizeFromDimension(_,v);return t(g,b,y,w,T)},r.parseSoftmaxAttributes=g=>(0,d.createAttributeWithCacheKey)({axis:g.attributes.getInt("axis",1)}),r.parseSoftmaxAttributesV13=g=>(0,d.createAttributeWithCacheKey)({axis:g.attributes.getInt("axis",-1)}),r.softmaxV13=(g,b,y)=>{u(b);const _=b[0].dims.slice(),v=l.ShapeUtil.normalizeAxis(y.axis,_.length),w=_.length,T=v!==w-1,A=[];let E,x=[],M=[];T&&(x=Array.from({length:w}).map((F,q)=>q),x[v]=w-1,x[w-1]=v,x.map(F=>A.push(_[F])),E=(0,d.createAttributeWithCacheKey)({perm:x}),M=(0,h.transpose)(g,b,E));const C=T?l.ShapeUtil.sizeToDimension(A,w-1):l.ShapeUtil.sizeToDimension(_,w-1),k=T?l.ShapeUtil.sizeFromDimension(A,w-1):l.ShapeUtil.sizeFromDimension(_,w-1),V=t(g,T?M:b,y,C,k);return T?(0,h.transpose)(g,V,E):V};const t=(g,b,y,_,v)=>{const w=e(g,b[0],_,v,[_]),T=g.run(Object.assign(Object.assign({},p),{cacheHint:y.cacheKey,get:()=>w}),b),A=n(g,b[0],_,v,w.output.dims,[_]),E=g.run(Object.assign(Object.assign({},a),{cacheHint:y.cacheKey,get:()=>A}),[b[0],T]),x=i(g,b[0],_,v,w.output.dims,A.output.dims);return[g.run(Object.assign(Object.assign({},o),{cacheHint:y.cacheKey,get:()=>x}),[b[0],T,E])]},e=(g,b,y,_,v)=>{const[w,T]=g.calculateTextureWidthAndHeight(b.dims,s.TextureType.unpacked),A=v.length;if(y<1||_<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(v.length!==1)throw new Error("Dimensionality of the output should be 1");if(v[0]!==y)throw new Error("Shape of the output should be equal to logical row count");const E=(0,m.getGlsl)(g.session.backend.glContext.version),x=` - float process(int[${A}] indices) { - int logical_row_start_offset = indices[0] * ${_}; - - float max = getColorAsFloat(${E.texture2D}(A, offsetToCoords(logical_row_start_offset, ${w}, - ${T} ))); - for(int i=1; i<${_}; ++i) - { - float current = getColorAsFloat(${E.texture2D}(A, offsetToCoords(logical_row_start_offset + i, - ${w}, ${T}))); - if(current > max) - max = current; - } - - return max; - }`;return Object.assign(Object.assign({},p),{output:{dims:v,type:b.type,textureType:s.TextureType.unpacked},shaderSource:x})},n=(g,b,y,_,v,w)=>{const[T,A]=g.calculateTextureWidthAndHeight(b.dims,s.TextureType.unpacked),E=w.length;if(y<1||_<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(w.length!==1)throw new Error("Dimensionality of the output should be 1");if(w[0]!==y)throw new Error("Shape of the output should be equal to logical row count");if(v.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(v[0]!==y)throw new Error("Shape of the intermediate results should be equal to logical row count");const x=` - float process(int[${E}] indices) { - int logical_row_start_offset = indices[0] * ${_}; - - float norm_factor = 0.0; - float max = _Max(indices); - for(int i=0; i<${_}; ++i) - { - norm_factor += exp(getColorAsFloat(${(0,m.getGlsl)(g.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i, - ${T}, ${A}))) - max); - } - - return norm_factor; - }`;return Object.assign(Object.assign({},a),{output:{dims:w,type:b.type,textureType:s.TextureType.unpacked},shaderSource:x})},i=(g,b,y,_,v,w)=>{const[T,A]=g.calculateTextureWidthAndHeight(b.dims,s.TextureType.unpacked),E=b.dims.length;if(y<1||_<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(v.length!==1||w.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(v[0]!==y||w[0]!==y)throw new Error("Shape of the intermediate results should be equal to logical row count");const x=` - float process(int[${E}] indices) { - - // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords) - int offset = coordsToOffset(TexCoords, ${T}, ${A}); - - //determine the logical row for this index - int logical_row_index[1]; - logical_row_index[0] = offset / ${_}; - - float norm_factor = _Norm(logical_row_index); - - // avoid possible division by 0 - // if norm_facor is 0, all elements are zero - // if so, return 0 - if(norm_factor == 0.0) - return 0.0; - - return exp(_A(indices) - _Max(logical_row_index)) / norm_factor; - }`;return Object.assign(Object.assign({},o),{output:{dims:b.dims,type:b.type,textureType:s.TextureType.unpacked},shaderSource:x})},u=g=>{if(!g||g.length!==1)throw new Error("Softmax requires 1 input.");if(g[0].type!=="float32"&&g[0].type!=="float64")throw new Error("Invalid input type")}},5975:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseSplitAttributes=r.split=void 0;const d=c(246),l=c(2517),m=c(2039),s={name:"Split",inputNames:["A"],inputTypes:[m.TextureType.unpacked]};r.split=(o,t,e)=>{a(t);const n=l.ShapeUtil.normalizeAxis(e.axis,t[0].dims.length),i=h(o,t,n,e),u=[];for(let g=0;gp(o,t[0],e,n,g)}),t));return u},r.parseSplitAttributes=o=>{const t=o.attributes.getInt("axis",0),e=o.attributes.getInts("split",[]),n=o.outputs.length;return(0,d.createAttributeWithCacheKey)({axis:t,split:e,numOutputs:n})};const h=(o,t,e,n)=>{const[,i]=l.SplitUtil.splitShape(t[0].dims,e,n.split,n.numOutputs);return i.length},p=(o,t,e,n,i)=>{const[u,g]=l.SplitUtil.splitShape(t.dims,n,e.split,e.numOutputs),b=g[i],y=u[i],_=` - float process(int indices[${y.length}]) { - indices[${n}] += ${b}; - return _A(indices); - } - `;return Object.assign(Object.assign({},s),{cacheHint:`${e.cacheKey}:${i}`,output:{dims:y,type:t.type,textureType:m.TextureType.unpacked},shaderSource:_})},a=o=>{if(!o||o.length!==1)throw new Error("Split requires one input.");if(o[0].type!=="int8"&&o[0].type!=="uint8"&&o[0].type!=="int16"&&o[0].type!=="uint16"&&o[0].type!=="int32"&&o[0].type!=="uint32"&&o[0].type!=="float32"&&o[0].type!=="float64"&&o[0].type!=="bool")throw new Error("Invalid input type.")}},3933:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseSqueezeAttributes=r.squeezeV13=r.squeeze=void 0;const d=c(2517);r.squeeze=(s,h,p)=>{l(h);const a=d.ShapeUtil.squeezeShape(h[0].dims,p);return[s.reshapeUnpacked(h[0],a)]},r.squeezeV13=(s,h)=>(m(h),(0,r.squeeze)(s,[h[0]],Array.from(h[1].integerData))),r.parseSqueezeAttributes=s=>s.attributes.getInts("axes");const l=s=>{if(!s||s.length!==1)throw new Error("Squeeze requires 1 input.");if(s[0].type==="string")throw new Error("invalid input tensor types.")},m=s=>{if(!s||s.length!==2)throw new Error("Squeeze requires 2 inputs.");if(s[1].type!=="int32")throw new Error("Invalid input type.")}},6558:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.sum=void 0;const d=c(5060),l=c(2039);r.sum=(h,p)=>{s(p);const a={name:"Sum",inputNames:p.map((o,t)=>`X${t}`),inputTypes:new Array(p.length).fill(l.TextureType.unpacked)};return[h.run(Object.assign(Object.assign({},a),{get:()=>m(h,p,a)}),p)]};const m=(h,p,a)=>{const o=(0,d.getGlsl)(h.session.backend.glContext.version),t=p[0].dims.slice(),e=` - void main() { - vec4 result = ${p.map((n,i)=>`${o.texture2D}(X${i},TexCoords)`).join(" + ")}; - ${o.output} = result; - } - `;return Object.assign(Object.assign({},a),{output:{dims:t,type:p[0].type,textureType:l.TextureType.unpacked},hasMain:!0,shaderSource:e})},s=h=>{if(!h||h.length===0)throw new Error("Sum requires inputs.");const p=h[0].dims.length;for(let a=1;a{Object.defineProperty(r,"__esModule",{value:!0}),r.tile=void 0;const d=c(782),l=c(2039);r.tile=(h,p)=>{s(p);const a={name:"Tile",inputNames:["A"],inputTypes:[l.TextureType.unpacked]};return[h.run(Object.assign(Object.assign({},a),{get:()=>m(h,p,a)}),p)]};const m=(h,p,a)=>{const o=p[0].dims.slice(),t=new Array(o.length),e=[];for(let u=0;u{if(!h||h.length!==2)throw new Error("Tile requires 2 input.");if(h[1].dims.length!==1)throw new Error("The second input shape must 1 dimension.");if(h[1].dims[0]!==h[0].dims.length)throw new Error("Invalid input shape.");if(d.NUMBER_TYPES.indexOf(h[0].type)===-1)throw new Error("Invalid input type.");if(h[1].type!=="int32"&&h[1].type!=="int16")throw new Error("Invalid repeat type.")}},3738:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseTransposeAttributes=r.transpose=void 0;const d=c(246),l=c(2517),m=c(2039),s={name:"Transpose",inputNames:["A"],inputTypes:[m.TextureType.unpacked]};r.transpose=(e,n,i)=>(t(n),[e.run(Object.assign(Object.assign({},s),{cacheHint:i.cacheKey,get:()=>h(e,n[0],i.perm)}),n)]),r.parseTransposeAttributes=e=>(0,d.createAttributeWithCacheKey)({perm:e.attributes.getInts("perm",[])});const h=(e,n,i)=>{const u=n.dims;i=p(u,i);const g=a(u,i),b=u.length,y=` - ${o("perm",i,b)} - float process(int indices[${b}]) { - int a[${b}]; - perm(a, indices); - return _A(a); - }`;return Object.assign(Object.assign({},s),{output:{dims:g,type:n.type,textureType:m.TextureType.unpacked},shaderSource:y})},p=(e,n)=>(n&&n.length!==e.length&&(n=[...e.keys()].reverse()),n),a=(e,n)=>(n=p(e,n),l.ShapeUtil.sortBasedOnPerm(e,n)),o=(e,n,i)=>{const u=[];u.push(`void ${e}(out int a[${i}], int src[${i}]) {`);for(let g=0;g{if(!e||e.length!==1)throw new Error("Transpose requires 1 input.");if(e[0].type!=="float32"&&e[0].type!=="float64")throw new Error("input should be float tensor")}},8710:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.encodeAsUint8=void 0;const d=c(5060),l=c(2039);r.encodeAsUint8=(m,s)=>{const h=s.shape,p=(0,d.getGlsl)(m.session.backend.glContext.version),a=` - const float FLOAT_MAX = 1.70141184e38; - const float FLOAT_MIN = 1.17549435e-38; - - bool isNaN(float val) { - return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true; - } - - highp vec4 encodeAsUint8(highp float v) { - if (isNaN(v)) { - return vec4(255, 255, 255, 255); - } - - highp float av = abs(v); - - if(av < FLOAT_MIN) { - return vec4(0.0, 0.0, 0.0, 0.0); - } else if(v > FLOAT_MAX) { - return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; - } else if(v < -FLOAT_MAX) { - return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; - } - - highp vec4 c = vec4(0,0,0,0); - - highp float e = floor(log2(av)); - highp float m = exp2(fract(log2(av))) - 1.0; - - c[2] = floor(128.0 * m); - m -= c[2] / 128.0; - c[1] = floor(32768.0 * m); - m -= c[1] / 32768.0; - c[0] = floor(8388608.0 * m); - - highp float ebias = e + 127.0; - c[3] = floor(ebias / 2.0); - ebias -= c[3] * 2.0; - c[2] += floor(ebias) * 128.0; - - c[3] += 128.0 * step(0.0, -v); - - return c / 255.0; - } - - void main() { - float value = ${p.texture2D}(X,TexCoords).r; - ${p.output} = encodeAsUint8(value); - }`,o={name:"Uint8Encode",inputTypes:[l.TextureType.unpacked],inputNames:["X"],output:{dims:h,type:s.tensor.type,textureType:l.TextureType.downloadUint8AsFloat},shaderSource:a,hasMain:!0};return m.executeProgram(o,[s.tensor])}},4909:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tanh=r.tan=r.sqrt=r.sin=r.sigmoid=r.relu=r.not=r.neg=r.log=r.parseLeakyReluAttributes=r.leakyRelu=r.identity=r.floor=r.exp=r.parseEluAttributes=r.elu=r.cos=r.ceil=r.clipV11=r.parseClipAttributes=r.clip=r.atan=r.asin=r.acos=r.abs=r.glslTanh=r.glslTan=r.glslSqrt=r.glslSigmoid=r.glslRelu=r.glslSin=r.glslNot=r.glslNeg=r.glslLog=r.glslLeakyRelu=r.glslIdentity=r.glslClip=r.glslFloor=r.glslExp=r.glslElu=r.glslCos=r.glslCeil=r.glslAtan=r.glslAsin=r.glslAcos=r.glslAbs=void 0;const d=c(246),l=c(2517),m=c(8520),s=c(5060),h=c(2039);function p(){return V("abs")}function a(){return V("acos")}function o(){return V("asin")}function t(){return V("atan")}function e(){return V("ceil")}function n(){return V("cos")}function i(D){const U="elu";return{body:` - const float alpha = float(${D}); - - float ${U}_(float a) { - return a >= 0.0 ? a: (exp(a) - 1.0) * alpha; - } - vec4 ${U}_(vec4 v) { - return vec4(${U}_(v.x), ${U}_(v.y), ${U}_(v.z), ${U}_(v.w)); - } - `,name:U,type:m.FunctionType.ValueBased}}function u(){return V("exp")}function g(){return V("floor")}function b(D,U){const J="clip";return{body:` - const float min = float(${D}); - const float max = float(${U}); - - float ${J}_(float a) { - return clamp(a, min, max); - } - vec4 ${J}_(vec4 v) { - return clamp(v, min, max); - } - `,name:J,type:m.FunctionType.ValueBased}}function y(){const D="indentity";return{body:` - float ${D}_(float a) { - return a; - } - vec4 ${D}_(vec4 v) { - return v; - } - `,name:D,type:m.FunctionType.ValueBased}}function _(D){const U="leakyRelu";return{body:` - const float alpha = float(${D}); - - float ${U}_(float a) { - return a < 0.0 ? a * alpha : a; - } - vec4 ${U}_(vec4 v) { - return vec4(${U}_(v.x), ${U}_(v.y), ${U}_(v.z), ${U}_(v.w)); - } - `,name:U,type:m.FunctionType.ValueBased}}function v(){return V("log")}function w(){const D="neg";return{body:` - float ${D}_(float a) { - return -a; - } - vec4 ${D}_(vec4 v) { - return -v; - } - `,name:D,type:m.FunctionType.ValueBased}}function T(){const D="not";return{body:` - float ${D}_(float a) { - return float( ! bool(a) ); - } - bool ${D}_(bool a) { - return !a; - } - vec4 ${D}_(vec4 v) { - return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w)); - } - bvec4 ${D}_(bvec4 v) { - return bvec4(!v.x, !v.y, !v.z, !v.w); - } - `,name:D,type:m.FunctionType.ValueBased}}function A(){return V("sin")}function E(){const D="relu";return{body:` - float ${D}_(float a) { - return max( a, 0.0 ); - } - vec4 ${D}_(vec4 v) { - return max( v, 0.0 ); - } - `,name:D,type:m.FunctionType.ValueBased}}function x(){const D="sigmoid";return{body:` - float ${D}_(float a) { - return 1.0 / (1.0 + exp(-a)); - } - vec4 ${D}_(vec4 v) { - return 1.0 / (1.0 + exp(-v)); - } - `,name:D,type:m.FunctionType.ValueBased}}function M(){return V("sqrt")}function C(){return V("tan")}function k(){const D="tanh";return{body:` - float ${D}_(float a) { - a = clamp(a, -10., 10.); - a = exp(2.*a); - return (a - 1.) / (a + 1.); - } - vec4 ${D}_(vec4 v) { - v = clamp(v, -10., 10.); - v = exp(2.*v); - return (v - 1.) / (v + 1.); - } - `,name:D,type:m.FunctionType.ValueBased}}function V(D){return{body:` - float ${D}_(float a) { - return ${D}(a); - } - vec4 ${D}_(vec4 v) { - return ${D}(v); - } - `,name:D,type:m.FunctionType.ValueBased}}r.glslAbs=p,r.glslAcos=a,r.glslAsin=o,r.glslAtan=t,r.glslCeil=e,r.glslCos=n,r.glslElu=i,r.glslExp=u,r.glslFloor=g,r.glslClip=b,r.glslIdentity=y,r.glslLeakyRelu=_,r.glslLog=v,r.glslNeg=w,r.glslNot=T,r.glslSin=A,r.glslRelu=E,r.glslSigmoid=x,r.glslSqrt=M,r.glslTan=C,r.glslTanh=k;const F=(D,U,J,Y)=>{const Z=D.session.pack?h.TextureType.packed:h.TextureType.unpacked,te={name:J.name,inputTypes:[Z],inputNames:["A"],cacheHint:Y};return Object.assign(Object.assign({},te),{get:()=>((he,Me,Te,ue)=>{const xe=he.session.pack?h.TextureType.packed:h.TextureType.unpacked,_e=(0,s.getGlsl)(he.session.backend.glContext.version);return Object.assign(Object.assign({},Me),{output:{dims:Te.dims,type:Te.type,textureType:xe},shaderSource:` - ${ue.body} - void main() { - vec4 v = ${_e.texture2D}(A, TexCoords); - v = ${ue.name}_(v); - ${_e.output} = v; - } - `,hasMain:!0})})(D,te,U,J)})};r.abs=(D,U)=>[D.run(F(D,U[0],p()),U)],r.acos=(D,U)=>[D.run(F(D,U[0],a()),U)],r.asin=(D,U)=>[D.run(F(D,U[0],o()),U)],r.atan=(D,U)=>[D.run(F(D,U[0],t()),U)],r.clip=(D,U,J)=>[D.run(F(D,U[0],b(J.min,J.max),J.cacheKey),U)],r.parseClipAttributes=D=>(0,d.createAttributeWithCacheKey)({min:D.attributes.getFloat("min",l.MIN_CLIP),max:D.attributes.getFloat("max",l.MAX_CLIP)}),r.clipV11=(D,U)=>{const J=q(D,U);return(0,r.clip)(D,[U[0]],J)};const q=(D,U)=>{if(U.length>=3&&(!D.session.isInitializer(U[1].dataId)||!D.session.isInitializer(U[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const J=U.length>=3?U[1].numberData[0]:l.MIN_CLIP,Y=U.length>=3?U[2].numberData[0]:l.MAX_CLIP;return(0,d.createAttributeWithCacheKey)({min:J,max:Y})};r.ceil=(D,U)=>[D.run(F(D,U[0],e()),U)],r.cos=(D,U)=>[D.run(F(D,U[0],n()),U)],r.elu=(D,U,J)=>[D.run(F(D,U[0],i(J.alpha),J.cacheKey),U)],r.parseEluAttributes=D=>(0,d.createAttributeWithCacheKey)({alpha:D.attributes.getFloat("alpha",1)}),r.exp=(D,U)=>[D.run(F(D,U[0],u()),U)],r.floor=(D,U)=>[D.run(F(D,U[0],g()),U)],r.identity=(D,U)=>[D.run(F(D,U[0],y()),U)],r.leakyRelu=(D,U,J)=>[D.run(F(D,U[0],_(J.alpha),J.cacheKey),U)],r.parseLeakyReluAttributes=D=>(0,d.createAttributeWithCacheKey)({alpha:D.attributes.getFloat("alpha",.01)}),r.log=(D,U)=>[D.run(F(D,U[0],v()),U)],r.neg=(D,U)=>[D.run(F(D,U[0],w()),U)],r.not=(D,U)=>[D.run(F(D,U[0],T()),U)],r.relu=(D,U)=>[D.run(F(D,U[0],E()),U)],r.sigmoid=(D,U)=>[D.run(F(D,U[0],x()),U)],r.sin=(D,U)=>[D.run(F(D,U[0],A()),U)],r.sqrt=(D,U)=>[D.run(F(D,U[0],M()),U)],r.tan=(D,U)=>[D.run(F(D,U[0],C()),U)],r.tanh=(D,U)=>[D.run(F(D,U[0],k()),U)]},5611:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createUnpackProgramInfoLoader=r.createUnpackProgramInfo=void 0;const d=c(5060),l=c(2039),m=c(9390),s=c(2827),h={name:"unpack",inputNames:["A"],inputTypes:[l.TextureType.packed]};r.createUnpackProgramInfo=(p,a)=>{const o=a.dims.length,t=(0,s.getChannels)("rc",o),e=t.slice(-2),n=(0,m.getCoordsDataType)(o),i=(0,s.unpackFromChannel)(),u=a.dims.length===0?"":function(y,_){if(y===1)return"rc";let v="";for(let w=0;wObject.assign(Object.assign({},h),{get:()=>(0,r.createUnpackProgramInfo)(p,a)})},8428:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseUnsqueezeAttributes=r.unsqueezeV13=r.unsqueeze=void 0;const d=c(2517);r.unsqueeze=(s,h,p)=>{l(h);const a=d.ShapeUtil.unsqueezeShape(h[0].dims,p);return[s.reshapeUnpacked(h[0],a)]},r.unsqueezeV13=(s,h)=>(m(h),(0,r.unsqueeze)(s,[h[0]],Array.from(h[1].integerData))),r.parseUnsqueezeAttributes=s=>s.attributes.getInts("axes");const l=s=>{if(!s||s.length!==1)throw new Error("Unsqueeze requires 1 input.");if(s[0].type==="string")throw new Error("invalid input tensor types.")},m=s=>{if(!s||s.length!==2)throw new Error("Unsqueeze requires 2 inputs.");if(s[1].type!=="int32")throw new Error("Invalid input type.")}},9793:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.scalesValidation=r.validateInputs=r.parseUpsampleAttributes=r.parseUpsampleAttributesV9=r.parseUpsampleAttributesV7=r.upsample=void 0;const d=c(246),l=c(5060),m=c(2039),s={name:"Upsample",inputNames:["X"],inputTypes:[m.TextureType.unpacked]};r.upsample=(p,a,o)=>((0,r.validateInputs)(a,o),[p.run(Object.assign(Object.assign({},s),{cacheHint:o.cacheKey,get:()=>h(p,a,o)}),a)]),r.parseUpsampleAttributesV7=p=>(0,r.parseUpsampleAttributes)(p,7),r.parseUpsampleAttributesV9=p=>(0,r.parseUpsampleAttributes)(p,9),r.parseUpsampleAttributes=(p,a)=>{const o=a>=10,t=p.attributes.getString("mode","nearest");if(t!=="nearest"&&t!=="linear"&&(a<11||t!=="cubic"))throw new Error(`unrecognized mode: ${t}`);let e=[];a<9&&(e=p.attributes.getFloats("scales"),(0,r.scalesValidation)(e,t,o));const n=p.attributes.getFloat("extrapolation_value",0),i=a>10?p.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(i)===-1)throw new Error(`coordinate_transform_mode '${i}' is not supported`);const u=i==="tf_crop_and_resize",g=u,b=t==="nearest"&&a>=11?p.attributes.getString("nearest_mode","round_prefer_floor"):"";if(["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(b)===-1)throw new Error(`nearest_mode '${b}' is not supported`);const y=p.attributes.getFloat("cubic_coeff_a",-.75),_=p.attributes.getInt("exclude_outside",0)!==0;if(_&&t!=="cubic")throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const v=a<11||t==="nearest"&&i==="asymmetric"&&b==="floor";let w=0,T=0,A=0;return a>10?p.inputs.length>2?(w=1,T=2,A=3):(T=1,A=2):a===9&&(T=1),(0,d.createAttributeWithCacheKey)({opset:a,isResize:o,mode:t,scales:e,extrapolationValue:n,coordinateTransformMode:i,useExtrapolation:g,needRoiInput:u,nearestMode:b,cubicCoefficientA:y,excludeOutside:_,useNearest2xOptimization:v,roiInputIdx:w,scalesInputIdx:T,sizesInputIdx:A})};const h=(p,a,o)=>{const t=(0,l.getGlsl)(p.session.backend.glContext.version),[e,n]=p.calculateTextureWidthAndHeight(a[0].dims,m.TextureType.unpacked),i=a[0].dims.map((A,E)=>Math.floor(A*o.scales[E])),[u,g]=p.calculateTextureWidthAndHeight(i,m.TextureType.unpacked),b=i.length,y=new Array(b),_=new Array(b);let v=` - int output_pitches[${b}]; - int input_pitches[${b}]; - `;for(let A=b-1;A>=0;A--)y[A]=A===b-1?1:y[A+1]*i[A+1],_[A]=A===b-1?1:_[A+1]*a[0].dims[A+1],v+=` - output_pitches[${A}] = ${y[A]}; - input_pitches[${A}] = ${_[A]}; - `;const w=` - float getInputFloat(int index) { - vec2 coords = offsetToCoords(index, ${e}, ${n}); - float value = getColorAsFloat(${t.texture2D}(X, coords)); - return value; - } - `,T=o.mode==="nearest"?` - ${w} - float process(int indices[${b}]) { - int input_index = 0; - int output_index = coordsToOffset(TexCoords, ${u}, ${g}); - - ${v} - - int d, m; - for (int dim = 0; dim < ${b}; ++dim) { - d = output_index / output_pitches[dim]; - m = output_index - d * output_pitches[dim]; - output_index = m; - - if (scales[dim] != 1 && d > 0) { - int d2 = d / scales[dim]; - m = d - d2 * scales[dim]; - d = d2; - } - input_index += input_pitches[dim] * d; - } - - return getInputFloat(input_index); - }`:b===4?` - ${w} - float process(int indices[4]) { - int input_index = 0; - int output_index = coordsToOffset(TexCoords, ${u}, ${g}); - - ${v} - - int m; - int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3; - index_of_dim0 = output_index / output_pitches[0]; - m = output_index - index_of_dim0 * output_pitches[0]; - index_of_dim1 = m / output_pitches[1]; - m = m - index_of_dim1 * output_pitches[1]; - index_of_dim2 = m / output_pitches[2]; - m = m - index_of_dim2 * output_pitches[2]; - index_of_dim3 = m; - - int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset; - index_of_input_dim2 = index_of_dim2 / scales[2]; - y_offset = index_of_dim2 - index_of_input_dim2 * scales[2]; - index_of_input_dim3 = index_of_dim3 / scales[3]; - x_offset = index_of_dim3 - index_of_input_dim3 * scales[3]; - - input_index = index_of_dim0 * input_pitches[0] + - index_of_dim1 * input_pitches[1] + - index_of_input_dim2 * input_pitches[2] + - index_of_input_dim3; - - float x00 = getInputFloat(input_index); - float x10, x01, x11; - - bool end_of_dim2 = false; - if (index_of_input_dim2 == (${a[0].dims[2]} - 1)) { - // It's the end in dimension 2 - x01 = x00; - end_of_dim2 = true; - } else { - x01 = getInputFloat(input_index + input_pitches[2]); - } - - if (index_of_input_dim3 == (input_pitches[2] - 1)) { - // It's the end in dimension 3 - x10 = x00; - x11 = x01; - } - else { - x10 = getInputFloat(input_index + 1); - x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1); - } - - float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]); - float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]); - return y0 + float(x_offset) * (y1 - y0) / float(scales[3]); - }`:` - ${w} - float process(int indices[2]) { - int input_index = 0; - int output_index = coordsToOffset(TexCoords, ${u}, ${g}); - - ${v} - - int m; - int index_of_dim0, index_of_dim1; - index_of_dim0 = output_index / output_pitches[0]; - m = output_index - index_of_dim0 * output_pitches[0]; - index_of_dim1 = m; - - int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset; - index_of_input_dim0 = index_of_dim0 / scales[0]; - y_offset = index_of_dim0 - index_of_input_dim0 * scales[0]; - index_of_input_dim1 = index_of_dim1 / scales[1]; - x_offset = index_of_dim1 - index_of_input_dim1 * scales[1]; - - input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1; - - float x00 = getInputFloat(input_index); - float x10, x01, x11; - - bool end_of_dim0 = false; - if (index_of_input_dim0 == (${a[0].dims[0]} - 1)) { - // It's the end in dimension 0 - x01 = x00; - end_of_dim0 = true; - } else { - x01 = getInputFloat(input_index + input_pitches[0]); - } - - if (index_of_input_dim1 == (input_pitches[0] - 1)) { - // It's the end in dimension 1 - x10 = x00; - x11 = x01; - } - else { - x10 = getInputFloat(input_index + 1); - x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1); - } - - float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]); - float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]); - return y0 + float(x_offset) * (y1 - y0) / float(scales[1]); - }`;return Object.assign(Object.assign({},s),{output:{dims:i,type:a[0].type,textureType:m.TextureType.unpacked},shaderSource:T,variables:[{name:"scales",type:"int",arrayLength:o.scales.length,data:o.scales.map(A=>Math.ceil(A))}]})};r.validateInputs=(p,a)=>{if(!p||a.opset<9&&p.length!==1||a.opset>=9&&a.opset<11&&p.length!==2||a.opset>=11&&p.length<2)throw new Error("invalid inputs.");if(a.scales.length>0&&p[0].dims.length!==a.scales.length)throw new Error("Invalid input shape.");if(p[0].type==="string")throw new Error("Invalid input tensor types.")},r.scalesValidation=(p,a,o)=>{if(o){for(const t of p)if(t<=0)throw new Error("Scale value should be greater than 0.")}else for(const t of p)if(t<1)throw new Error("Scale value should be greater than or equal to 1.");if(!(a!=="linear"&&a!=="cubic"||p.length===2||p.length===4&&p[0]===1&&p[1]===1))throw new 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 ${o?"Resize":"Upsample"} opeartor.`)}},1958:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ProgramManager=void 0;const d=c(1670),l=c(6231),m=c(8879),s=c(5060);r.ProgramManager=class{constructor(h,p,a){this.profiler=h,this.glContext=p,this.textureLayoutStrategy=a,this.repo=new Map,this.attributesBound=!1}getArtifact(h){return this.repo.get(h)}setArtifact(h,p){this.repo.set(h,p)}run(h,p,a){var o;this.profiler.event("op",`ProgramManager.run ${(o=h.programInfo.name)!==null&&o!==void 0?o:"unknown kernel"}`,()=>{var t;const e=this.glContext.gl,n=h.program;e.useProgram(n);try{this.bindOutput(a),this.attributesBound||this.bindAttributes(h.attribLocations),this.bindUniforms(h.uniformLocations,(t=h.programInfo.variables)!==null&&t!==void 0?t:[],p)}catch(i){throw l.Logger.error("ProgramManager",h.programInfo.shaderSource),i}this.profiler.event("backend","GlContext.draw()",()=>{this.glContext.draw()})},this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach(h=>this.glContext.deleteProgram(h.program))}build(h,p,a){return this.profiler.event("backend","ProgramManager.build",()=>{const o=new m.GlslPreprocessor(this.glContext,h,p,a),t=o.preprocess(),e=this.compile(t);return{programInfo:h,program:e,uniformLocations:this.getUniformLocations(e,o.context.programInfo.inputNames,o.context.programInfo.variables),attribLocations:this.getAttribLocations(e)}})}compile(h){if(!this.vertexShader){l.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const o=(0,s.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(o,this.glContext.gl.VERTEX_SHADER)}d.env.debug&&l.Logger.verbose("ProrgramManager",`FragShader: -${h} -`);const p=this.glContext.compileShader(h,this.glContext.gl.FRAGMENT_SHADER),a=this.glContext.createProgram(this.vertexShader,p);return this.glContext.deleteShader(p),a}bindOutput(h){const p=h.width,a=h.height;l.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${p}/${a}, shape=${h.shape}, type=${h.tensor.type}`),this.glContext.attachFramebuffer(h.texture,p,a)}bindAttributes(h){const p=h.position,a=h.textureCoord;this.glContext.setVertexAttributes(p,a),this.attributesBound=!0}bindUniforms(h,p,a){var o;const t=this.glContext.gl;let e=0;for(const{name:n,type:i,location:u,arrayLength:g}of h){const b=(o=p.find(y=>y.name===n))===null||o===void 0?void 0:o.data;if(i!=="sampler2D"&&!b)throw new Error(`variable '${n}' does not have data defined in program info`);switch(i){case"sampler2D":this.bindTexture(a[e],u,e),e++;break;case"float":g?t.uniform1fv(u,b):t.uniform1f(u,b);break;case"int":g?t.uniform1iv(u,b):t.uniform1i(u,b);break;default:throw new Error(`Uniform not implemented: ${i}`)}}}bindTexture(h,p,a){this.glContext.bindTextureToUniform(h.texture,a,p)}getAttribLocations(h){return{position:this.getAttribLocation(h,"position"),textureCoord:this.getAttribLocation(h,"textureCoord")}}getUniformLocations(h,p,a){const o=[];if(p)for(const t of p)o.push({name:t,type:"sampler2D",location:this.getUniformLocation(h,t)});if(a)for(const t of a)o.push(Object.assign(Object.assign({},t),{location:this.getUniformLocation(h,t.name)}));return o}getUniformLocation(h,p){const a=this.glContext.gl.getUniformLocation(h,p);if(a===null)throw new Error(`Uniform ${p} not found.`);return a}getAttribLocation(h,p){return this.glContext.gl.getAttribLocation(h,p)}}},6416:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WebGLSessionHandler=void 0;const d=c(6231),l=c(1047),m=c(8316),s=c(1640),h=c(1958),p=c(7859),a=c(5702);r.WebGLSessionHandler=class{constructor(o,t){this.backend=o,this.context=t,this.layoutStrategy=new p.PreferLogicalStrategy(o.glContext.maxTextureSize),this.programManager=new h.ProgramManager(this.context.profiler,o.glContext,this.layoutStrategy),this.textureManager=new a.TextureManager(o.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:o.textureCacheMode==="full"}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=o.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new m.WebGLInferenceHandler(this)}onGraphInitialized(o){const t=o.getValues().filter(e=>e.from===-1&&e.tensor).map(e=>e.tensor.dataId);this.initializers=new Set(t)}isInitializer(o){return!!this.initializers&&this.initializers.has(o)}addInitializer(o){this.initializers.add(o)}getTextureData(o,t){return t?this.packedTextureDataCache.get(o):this.unpackedTextureDataCache.get(o)}setTextureData(o,t,e=!1){d.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),e?this.packedTextureDataCache.set(o,t):this.unpackedTextureDataCache.set(o,t)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(o=>this.textureManager.releaseTexture(o,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(o=>this.textureManager.releaseTexture(o,!0)),this.unpackedTextureDataCache=new Map}resolve(o,t,e){const n=(0,l.resolveOperator)(o,t,s.WEBGL_OP_RESOLVE_RULES);return{impl:n.opImpl,context:n.opInit?n.opInit(o,e):o}}}},7769:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Uint8DataEncoder=r.RGBAFloatDataEncoder=r.RedFloat32DataEncoder=void 0;const d=c(6231);r.RedFloat32DataEncoder=class{constructor(l,m=1){if(m===1)this.internalFormat=l.R32F,this.format=l.RED,this.textureType=l.FLOAT,this.channelSize=m;else{if(m!==4)throw new Error(`Invalid number of channels: ${m}`);this.internalFormat=l.RGBA32F,this.format=l.RGBA,this.textureType=l.FLOAT,this.channelSize=m}}encode(l,m){let s,h;return l.constructor!==Float32Array&&(d.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),h=new Float32Array(l)),m*this.channelSize>l.length?(d.Logger.warning("Encoder","Source data too small. Allocating larger array"),h=l,s=this.allocate(m*this.channelSize),h.forEach((p,a)=>s[a]=p)):(h=l,s=h),s}allocate(l){return new Float32Array(4*l)}decode(l,m){return this.channelSize===1?l.filter((s,h)=>h%4==0).subarray(0,m):l.subarray(0,m)}},r.RGBAFloatDataEncoder=class{constructor(l,m=1,s){if(m!==1&&m!==4)throw new Error(`Invalid number of channels: ${m}`);this.internalFormat=l.RGBA,this.format=l.RGBA,this.channelSize=m,this.textureType=s||l.FLOAT}encode(l,m){let s=l;return this.channelSize===1&&(d.Logger.verbose("Encoder","Exploding into a larger array"),s=this.allocate(m),l.forEach((h,p)=>s[4*p]=h)),s}allocate(l){return new Float32Array(4*l)}decode(l,m){return this.channelSize===1?l.filter((s,h)=>h%4==0).subarray(0,m):l.subarray(0,m)}},r.Uint8DataEncoder=class{constructor(l,m=1){if(this.channelSize=4,m===1)this.internalFormat=l.ALPHA,this.format=l.ALPHA,this.textureType=l.UNSIGNED_BYTE,this.channelSize=m;else{if(m!==4)throw new Error(`Invalid number of channels: ${m}`);this.internalFormat=l.RGBA,this.format=l.RGBA,this.textureType=l.UNSIGNED_BYTE,this.channelSize=m}}encode(l,m){return new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}allocate(l){return new Uint8Array(l*this.channelSize)}decode(l,m){if(l instanceof Uint8Array)return l.subarray(0,m);throw new Error(`Invalid array type: ${l.constructor}`)}}},7859:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getBatchDim=r.sizeToSquarishShape=r.getRowsCols=r.sizeFromShape=r.isInt=r.parseAxisParam=r.squeezeShape=r.PreferLogicalStrategy=r.AlwaysKeepOriginalSizeStrategy=void 0;const d=c(6231),l=c(2517);function m(o,t){const e=[],n=[],i=t!=null&&Array.isArray(t)&&t.length===0,u=t==null||i?null:s(t,o).sort();let g=0;for(let b=0;bb)&&o[b]===1&&(e.push(o[b]),n.push(b)),u[g]<=b&&g++}o[b]!==1&&(e.push(o[b]),n.push(b))}return{newShape:e,keptDims:n}}function s(o,t){const e=t.length;return o=o==null?t.map((n,i)=>i):[].concat(o),(0,l.assert)(o.every(n=>n>=-e&&n`All values in axis param must be in range [-${e}, ${e}) but got axis ${o}`),(0,l.assert)(o.every(h),()=>`All values in axis param must be integers but got axis ${o}`),o.map(n=>n<0?e+n:n)}function h(o){return o%1==0}function p(o){if(o.length===0)return 1;let t=o[0];for(let e=1;e=o.length?1:o.slice(t.breakAxis).reduce((b,y)=>b*y),g=t.breakAxis<=0?1:o.slice(0,t.breakAxis).reduce((b,y)=>b*y);if(!(u>e||g>e))return[u,g];d.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${o}, breakAxis:${t.breakAxis}`)}const n=o.reduce((u,g)=>u*g);let i=Math.floor(Math.sqrt(n));for(;i=e||n%i!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${o}`);return[i,n/i]}},r.PreferLogicalStrategy=class{constructor(o){this.maxTextureSize=o}computeTextureWH(o,t){const e=this.computeTexture(o,t);return t&&t.isPacked&&(e[0]/=2,e[1]/=2),t&&t.reverseWH?[e[1],e[0]]:e}computeTexture(o,t){const e=t&&t.isPacked;if(o.length===0)return e?[2,2]:[1,1];let n=this.maxTextureSize;if(t&&t.breakAxis!==void 0){const g=t.breakAxis>=o.length?1:o.slice(t.breakAxis).reduce((y,_)=>y*_),b=t.breakAxis<=0?1:o.slice(0,t.breakAxis).reduce((y,_)=>y*_);if(!(g>n||b>n))return[g,b];d.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${o}, breakAxis:${t.breakAxis}`)}let i=o.slice(0);e&&(n*=2,i=i.map((g,b)=>b>=i.length-2?i[b]%2==0?i[b]:i[b]+1:i[b]),i.length===1&&(i=[2,i[0]])),i.length!==2&&(i=m(i).newShape);const u=p(i);return i.length<=1&&u<=n?[1,u]:i.length===2&&i[0]<=n&&i[1]<=n?i:i.length===3&&i[0]*i[1]<=n&&i[2]<=n?[i[0]*i[1],i[2]]:i.length===3&&i[0]<=n&&i[1]*i[2]<=n?[i[0],i[1]*i[2]]:i.length===4&&i[0]*i[1]*i[2]<=n&&i[3]<=n?[i[0]*i[1]*i[2],i[3]]:i.length===4&&i[0]<=n&&i[1]*i[2]*i[3]<=n?[i[0],i[1]*i[2]*i[3]]:e?a(u/4).map(g=>2*g):a(u)}},r.squeezeShape=m,r.parseAxisParam=s,r.isInt=h,r.sizeFromShape=p,r.getRowsCols=function(o){if(o.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[o.length>1?o[o.length-2]:1,o[o.length-1]]},r.sizeToSquarishShape=a,r.getBatchDim=function(o,t=2){return p(o.slice(0,o.length-t))}},4057:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createTextureLayoutFromShape=r.calculateTextureWidthAndHeight=r.createTextureLayoutFromTextureType=void 0;const d=c(2517),l=c(2039);r.createTextureLayoutFromTextureType=(m,s,h)=>{const p=h===l.TextureType.unpacked||h===l.TextureType.unpackedReversed?1:4,a=h===l.TextureType.packed,o=h===l.TextureType.unpackedReversed||h===l.TextureType.packed,t=h===l.TextureType.packedLastDimension?s.length-1:void 0,e=h===l.TextureType.packedLastDimension?s.map((n,i)=>i===s.length-1?4*n:n):void 0;return(0,r.createTextureLayoutFromShape)(m,s,p,e,{isPacked:a,reverseWH:o,breakAxis:t})},r.calculateTextureWidthAndHeight=(m,s,h)=>{const p=(0,r.createTextureLayoutFromTextureType)(m,s,h);return[p.width,p.height]},r.createTextureLayoutFromShape=(m,s,h=1,p,a)=>{const o=!(!a||!a.isPacked),[t,e]=m.computeTextureWH(o&&p||s,a),n=s.length;let i=s.slice(0);if(n===0&&(i=[1]),h===1)p=s;else if(o){if(h!==4)throw new Error("a packed texture must be 4-channel");p=s,n>0&&(i[n-1]=Math.ceil(i[n-1]/2)),n>1&&(i[n-2]=Math.ceil(i[n-2]/2))}else if(!p)throw new Error("Unpacked shape is needed when using channels > 1");return{width:t,height:e,channels:h,isPacked:o,shape:i,strides:d.ShapeUtil.computeStrides(i),unpackedShape:p,reversedWH:a&&a.reverseWH}}},5702:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextureManager=void 0;const d=c(6231);r.TextureManager=class{constructor(l,m,s,h){this.glContext=l,this.layoutStrategy=m,this.profiler=s,this.config=h,this.pendingRead=new Map,h.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(l,m,s,h){const p=this.toEncoderType(l),a=this.glContext.getEncoder(p,m.channels||1,h);if(m.isPacked&&h===1)throw new Error("not implemented");const o=m.width,t=m.height;let e,n;if(this.config.reuseTextures){e=`${o}x${t}_${a.format}_${a.internalFormat}_${a.textureType}`,n=this.inUseTextures.get(e),n||(n=[],this.inUseTextures.set(e,n));const u=this.idleTextures.get(e);if(u&&u.length>0){const g=u.pop();return n.push(g),h===1&&this.glContext.updateTexture(g,o,t,a,this.toTextureData(l,s)),g}}d.Logger.verbose("TextureManager",`Creating new texture of size ${m.width}x${m.height}`);const i=this.glContext.allocateTexture(o,t,a,this.toTextureData(l,s));return this.config.reuseTextures&&(n.push(i),this.textureLookup.set(i,e)),i}readTexture(l,m,s){return s||(s=1),this.profiler.event("backend","TextureManager.readTexture",()=>{const h=l.shape.reduce((a,o)=>a*o)*s,p=this.glContext.readTexture(l.texture,l.width,l.height,h,this.toEncoderType(m),s);return this.toTensorData(m,p)})}async readTextureAsync(l,m,s){const h=l.tensor.dataId;if(s||(s=1),this.pendingRead.has(h)){const p=this.pendingRead.get(h);return new Promise(a=>p==null?void 0:p.push(a))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(h,[]);const p=l.shape.reduce((e,n)=>e*n)*s;await this.glContext.createAndWaitForFence();const a=this.glContext.readTexture(l.texture,l.width,l.height,p,this.toEncoderType(m),s),o=this.toTensorData(m,a),t=this.pendingRead.get(h);return this.pendingRead.delete(h),t==null||t.forEach(e=>e(o)),o})}readUint8TextureAsFloat(l){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{const m=l.shape.reduce((h,p)=>h*p),s=this.glContext.readTexture(l.texture,l.width,l.height,4*m,"byte",4);return new Float32Array(s.buffer,s.byteOffset,m)})}releaseTexture(l,m){let s;if(this.config.reuseTextures&&(s=this.textureLookup.get(l.texture),s)){m&&this.textureLookup.delete(s);const h=this.inUseTextures.get(s);if(h){const p=h.indexOf(l.texture);if(p!==-1){h.splice(p,1);let a=this.idleTextures.get(s);a||(a=[],this.idleTextures.set(s,a)),a.push(l.texture)}}}s&&!m||(d.Logger.verbose("TextureManager",`Deleting texture of size ${l.width}x${l.height}`),this.glContext.deleteTexture(l.texture))}toTensorData(l,m){switch(l){case"int16":return m instanceof Int16Array?m:Int16Array.from(m);case"int32":return m instanceof Int32Array?m:Int32Array.from(m);case"int8":return m instanceof Int8Array?m:Int8Array.from(m);case"uint16":return m instanceof Uint16Array?m:Uint16Array.from(m);case"uint32":return m instanceof Uint32Array?m:Uint32Array.from(m);case"uint8":case"bool":return m instanceof Uint8Array?m:Uint8Array.from(m);case"float32":return m instanceof Float32Array?m:Float32Array.from(m);case"float64":return m instanceof Float64Array?m:Float64Array.from(m);default:throw new Error(`TensorData type ${l} is not supported`)}}toTextureData(l,m){if(m)return m instanceof Float32Array?m:new Float32Array(m)}toEncoderType(l){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(f,r)=>{var c;Object.defineProperty(r,"__esModule",{value:!0}),r.TextureType=void 0,(c=r.TextureType||(r.TextureType={}))[c.unpacked=0]="unpacked",c[c.unpackedReversed=1]="unpackedReversed",c[c.packed=2]="packed",c[c.downloadUint8AsFloat=3]="downloadUint8AsFloat",c[c.packedLastDimension=4]="packedLastDimension"},9390:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getGlChannels=r.getCoordsDataType=r.getSqueezedParams=r.squeezeInputShape=r.generateShaderFuncNameFromInputSamplerNameAtOutCoords=r.generateShaderFuncNameFromInputSamplerName=r.repeatedTry=r.getPackedShape=void 0;const d=c(2517);r.getPackedShape=function(l){const m=l.length;return l.slice(0,m-1).concat(l[m-1]/4)},r.repeatedTry=async function(l,m=h=>0,s){return new Promise((h,p)=>{let a=0;const o=()=>{if(l())return void h();a++;const t=m(a);s!=null&&a>=s?p():setTimeout(o,t)};o()})},r.generateShaderFuncNameFromInputSamplerName=function(l){return(0,d.assert)(l!==void 0&&l.length!==0,()=>"empty string found for sampler name"),"get"+l.charAt(0).toUpperCase()+l.slice(1)},r.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(l){return(0,d.assert)(l!==void 0&&l.length!==0,()=>"empty string found for sampler name"),"get"+l.charAt(0).toUpperCase()+l.slice(1)+"AtOutCoords"},r.squeezeInputShape=function(l,m){let s=JSON.parse(JSON.stringify(l));return s=m,s},r.getSqueezedParams=function(l,m){return m.map(s=>l[s]).join(", ")},r.getCoordsDataType=function(l){if(l<=1)return"int";if(l===2)return"ivec2";if(l===3)return"ivec3";if(l===4)return"ivec4";if(l===5)return"ivec5";if(l===6)return"ivec6";throw Error(`GPU for rank ${l} is not yet supported`)},r.getGlChannels=function(l=6){return["x","y","z","w","u","v"].slice(0,l)}},7305:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createNewWebGLContext=r.createWebGLContext=void 0;const d=c(6231),l=c(1713),m={};function s(h){const p=function(){if(typeof document>"u"){if(typeof OffscreenCanvas>"u")throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const t=document.createElement("canvas");return t.width=1,t.height=1,t}();let a;const o={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!h||h==="webgl2")&&(a=p.getContext("webgl2",o),a))try{return new l.WebGLContext(a,2)}catch(t){d.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${t}`)}if((!h||h==="webgl")&&(a=p.getContext("webgl",o)||p.getContext("experimental-webgl",o),a))try{return new l.WebGLContext(a,1)}catch(t){d.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t}`)}throw new Error("WebGL is not supported")}r.createWebGLContext=function h(p){let a;p&&p!=="webgl2"||!("webgl2"in m)?p&&p!=="webgl"||!("webgl"in m)||(a=m.webgl):a=m.webgl2,a=a||s(p),p=p||a.version===1?"webgl":"webgl2";const o=a.gl;return m[p]=a,o.isContextLost()?(delete m[p],h(p)):(o.disable(o.DEPTH_TEST),o.disable(o.STENCIL_TEST),o.disable(o.BLEND),o.disable(o.DITHER),o.disable(o.POLYGON_OFFSET_FILL),o.disable(o.SAMPLE_COVERAGE),o.enable(o.SCISSOR_TEST),o.enable(o.CULL_FACE),o.cullFace(o.BACK),a)},r.createNewWebGLContext=s},1713:function(f,r,c){var d=this&&this.__createBinding||(Object.create?function(o,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(o,n,i)}:function(o,t,e,n){n===void 0&&(n=e),o[n]=t[e]}),l=this&&this.__setModuleDefault||(Object.create?function(o,t){Object.defineProperty(o,"default",{enumerable:!0,value:t})}:function(o,t){o.default=t}),m=this&&this.__importStar||function(o){if(o&&o.__esModule)return o;var t={};if(o!=null)for(var e in o)e!=="default"&&Object.prototype.hasOwnProperty.call(o,e)&&d(t,o,e);return l(t,o),t};Object.defineProperty(r,"__esModule",{value:!0}),r.WebGLContext=r.linearSearchLastTrue=void 0;const s=c(1670),h=m(c(7769)),p=c(9390);function a(o){let t=0;for(;tthis.isTimerResultAvailable(o)),this.getTimerResult(o)}async createAndWaitForFence(){const o=this.createFence(this.gl);return this.pollFence(o)}createFence(o){let t;const e=o,n=e.fenceSync(e.SYNC_GPU_COMMANDS_COMPLETE,0);return o.flush(),t=n===null?()=>!0:()=>{const i=e.clientWaitSync(n,0,0);return i===e.ALREADY_SIGNALED||i===e.CONDITION_SATISFIED},{query:n,isFencePassed:t}}async pollFence(o){return new Promise(t=>{this.addItemToPoll(()=>o.isFencePassed(),()=>t())})}pollItems(){const o=a(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=o;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(o+1)}async addItemToPoll(o,t){this.itemsToPoll.push({isDoneFn:o,resolveFn:t}),this.itemsToPoll.length>1||await(0,p.repeatedTry)(()=>(this.pollItems(),this.itemsToPoll.length===0))}}},1036:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExecutionPlan=void 0;const d=c(6231);class l{constructor(s,h){this.op=s,this.node=h}}r.ExecutionPlan=class{constructor(m,s,h){this.graph=m,this.profiler=h,this.initialize(s)}initialize(m){this.profiler.event("session","ExecutionPlan.initialize",()=>{const s=this.graph.getNodes();if(s.length!==m.length)throw new Error("The size of nodes and OPs do not match.");this._ops=m.map((h,p)=>new l(h,s[p])),this.reset(),this._starter=[],this._ops.forEach((h,p)=>{let a=!0;for(const o of h.node.inputs)if(!this._values[o]&&this.graph.getInputIndices().indexOf(o)===-1){a=!1;break}a&&this._starter.push(p)})})}reset(){this._values=this.graph.getValues().map(m=>m.tensor)}async execute(m,s){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const h=m.createInferenceHandler(),p=this.graph.getInputIndices();if(s.length!==p.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${s.length} expected: ${p.length}`);s.forEach((i,u)=>{const g=p[u];this._values[g]=i});const a=this._starter.slice(0),o=this.graph.getValues(),t=this.graph.getNodes();let e=0;for(;ethis._values[v]);if(g.indexOf(void 0)!==-1)throw new Error(`unresolved input detected: op: ${u.node}`);const b=g;d.Logger.verbose("ExecPlan",`Runing op:${u.node.name} (${b.map((v,w)=>`'${u.node.inputs[w]}': ${v.type}[${v.dims.join(",")}]`).join(", ")})`);const y=await this.profiler.event("node",u.node.name,async()=>u.op.impl(h,b,u.op.context));if(y.length!==u.node.outputs.length)throw new Error("the size of output does not match model definition.");y.forEach((v,w)=>{const T=u.node.outputs[w];if(this._values[T])throw new Error(`output [${T}] already has value: op:${u.node.name}`);this._values[T]=v});const _=new Set;y.forEach((v,w)=>{const T=u.node.outputs[w];for(const A of o[T].to){const E=t[A];let x=!0;for(const M of E.inputs)if(!this._values[M]){x=!1;break}x&&_.add(A)}}),a.push(..._)}const n=[];for(let i=0;i{Object.defineProperty(r,"__esModule",{value:!0}),r.Graph=void 0;const d=c(1446),l=c(7778),m=c(9395),s=c(9162),h=c(2517);var p=m.onnxruntime.experimental.fbs;r.Graph={from:(e,n)=>new t(e,n)};class a{constructor(n){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,n&&(this.type=h.ProtoUtil.tensorValueTypeFromProto(n.type.tensorType))}get from(){return this._from}get to(){return this._to}}class o{constructor(n,i){n instanceof d.onnx.NodeProto?(this.name=n.name,this.opType=n.opType,this.attributes=new l.Attribute(n.attribute)):n instanceof p.Node&&(this.name=i??n.name(),this.opType=n.opType(),this.attributes=new l.Attribute(h.ProtoUtil.tensorAttributesFromORTFormat(n))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class t{constructor(n,i){if(!n)throw new TypeError("graph is empty");this.buildGraph(n),this.transformGraph(i),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(n){if(n instanceof d.onnx.GraphProto)this.buildGraphFromOnnxFormat(n);else{if(!(n instanceof p.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(n)}}buildGraphFromOnnxFormat(n){const i=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const u=new Map;if(!n.input)throw new Error("missing information in graph: input");const g=[];for(const b of n.input){if(i.has(b.name))throw new Error(`duplicated input name: ${b.name}`);const y=this._allData.push(new a(b))-1;i.set(b.name,y),g.push(b.name)}if(!n.initializer)throw new Error("missing information in graph: initializer");for(const b of n.initializer){let y=i.get(b.name);if(y===void 0){const _=new a;_.type={shape:{dims:h.ProtoUtil.tensorDimsFromProto(b.dims)},tensorType:h.ProtoUtil.tensorDataTypeFromProto(b.dataType)},y=this._allData.push(_)-1,i.set(b.name,y)}this._allData[y]._from=-1,this._allData[y].tensor=s.Tensor.fromProto(b)}for(let b=0;b{this._allData[g]._to.forEach(b=>{n.add(b)})});const i=Array.from(n),u=new Array(this._nodes.length).fill("white");for(;i.length>0;){const g=i.pop();u[g]==="gray"?u[g]="black":(i.push(g),u[g]="gray",this._nodes[g].outputs.forEach(b=>{const y=this._allData[b];if(y.tensor!==void 0)throw new Error("node outputs should not be initialized");if(y._from!==g)throw new Error("from property of the Value object doesn't match index of Node being processed");y._to.forEach(_=>{if(u[_]==="gray")throw new Error("model graph is cyclic");u[_]==="white"&&i.push(_)})}))}}transformGraph(n){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),n&&n.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let n=0;for(let i=0;i0&&(this._nodes[i].inputs.forEach(u=>{const g=this._allData[u]._to.indexOf(i+n);g!==-1&&(this._allData[u]._to[g]=i)}),this._nodes[i].outputs.forEach(u=>{this._allData[u]._from&&this._allData[u]._from===i+n&&(this._allData[u]._from=i)})):(n++,this._nodes[i].outputs.forEach(u=>{this._allData[u]._from=-2}),this._nodes.splice(i,1),i--);n=0;for(let i=0;i0){let u=-1;this._allData[i].from!==void 0&&this._allData[i].from!==-1?(u=this._nodes[this._allData[i].from].outputs.indexOf(i+n),u!==-1&&(this._nodes[this._allData[i].from].outputs[u]=i)):(u=this._allInputIndices.indexOf(i+n),u!==-1&&(this._allInputIndices[u]=i)),this._allData[i].to.forEach(g=>{u=this._nodes[g].inputs.indexOf(i+n),u!==-1&&(this._nodes[g].inputs[u]=i)}),this._allData[i].to.length===0&&(u=this._allOutputIndices.indexOf(i+n),u!==-1&&(this._allOutputIndices[u]=i))}}else n++,this._allData.splice(i,1),i--}deleteNode(n){const i=this._nodes[n];if(i.outputs.length>1){for(let v=1;v0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ")}i.executeNode=!1;const u=i.inputs[0],g=i.outputs[0],b=this._allData[g].to,y=this._allData[u].to.indexOf(n);if(y===-1)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[u].to.splice(y,1),this._allData[g]._to=[];const _=this._allOutputIndices.indexOf(g);if(_!==-1&&(this._allOutputIndices[_]=u),b&&b.length>0)for(const v of b){const w=this._nodes[v].inputs.indexOf(g);if(w===-1)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[v].inputs[w]=u,this._allData[u].to.push(v)}}removeAllDropoutNodes(){let n=0;for(const i of this._nodes){if(i.opType==="Dropout"){if(i.inputs.length!==1)throw new Error("Dropout nodes should only contain one input. ");if(i.outputs.length!==1&&i.outputs.length!==2)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(i.outputs.length===2&&this._allData[i.outputs[1]]._to.length!==0)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(n)}n++}}removeAllIdentityNodes(){let n=0;for(const i of this._nodes)i.opType==="Identity"&&this.deleteNode(n),n++}isActivation(n){switch(n.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const n of this._nodes)if(n.opType==="Conv"){const i=this._allData[n.outputs[0]]._to;if(i.length===1&&this.isActivation(this._nodes[i[0]])){const u=this._nodes[i[0]];if(u.opType==="Clip")if(u.inputs.length===1)try{n.attributes.set("activation_params","floats",[u.attributes.getFloat("min"),u.attributes.getFloat("max")])}catch{n.attributes.set("activation_params","floats",[h.MIN_CLIP,h.MAX_CLIP])}else{if(!(u.inputs.length>=3&&this._allData[u.inputs[1]].tensor!==void 0&&this._allData[u.inputs[2]].tensor!==void 0))continue;n.attributes.set("activation_params","floats",[this._allData[u.inputs[1]].tensor.floatData[0],this._allData[u.inputs[2]].tensor.floatData[0]])}n.attributes.set("activation","string",u.opType),this.deleteNode(i[0])}}}}},6231:(f,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.now=r.Profiler=r.Logger=void 0;const c={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},d={none:new class{log(o,t,e){}},console:new class{log(o,t,e){console.log(`${this.color(o)} ${e?"\x1B[35m"+e+"\x1B[0m ":""}${t}`)}color(o){switch(o){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 new Error(`unsupported severity: ${o}`)}}}},l={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let m={"":l};function s(o,t,e,n){if(t===void 0)return i=o,{verbose:s.verbose.bind(null,i),info:s.info.bind(null,i),warning:s.warning.bind(null,i),error:s.error.bind(null,i),fatal:s.fatal.bind(null,i)};if(e===void 0)h(o,t);else if(typeof e=="number"&&n===void 0)h(o,t);else if(typeof e=="string"&&n===void 0)h(o,e,0,t);else{if(typeof e!="string"||typeof n!="number")throw new TypeError("input is valid");h(o,e,0,t)}var i}function h(o,t,e,n){const i=m[n||""]||m[""];c[o]{g.then(async _=>{i&&await i.end(),b(_)},async _=>{i&&await i.end(),y(_)})});if(!u&&i){const b=i.end();if(b&&typeof b.then=="function")return new Promise((y,_)=>{b.then(()=>{y(g)},v=>{_(v)})})}return g}begin(o,t,e){if(!this._started)throw new Error("profiler is not started yet");if(e===void 0){const n=(0,r.now)();return this.flush(n),new p(o,t,n,i=>this.endSync(i))}{const n=e.beginTimer();return new p(o,t,0,async i=>this.end(i),n,e)}}async end(o){const t=await o.checkTimer();this._timingEvents.length=this._flushBatchSize||o-this._flushTime>=this._flushIntervalInMilliseconds){for(const t=this._flushPointer;this._flushPointerperformance.now():Date.now},2644:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Model=void 0;const d=c(5686),l=c(1446),m=c(7070),s=c(9395),h=c(2517);var p=s.onnxruntime.experimental.fbs;r.Model=class{constructor(){}load(a,o,t){if(!t)try{return void this.loadFromOnnxFormat(a,o)}catch(e){if(t!==void 0)throw e}this.loadFromOrtFormat(a,o)}loadFromOnnxFormat(a,o){const t=l.onnx.ModelProto.decode(a);if(h.LongUtil.longToNumber(t.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=t.opsetImport.map(e=>({domain:e.domain,version:h.LongUtil.longToNumber(e.version)})),this._graph=m.Graph.from(t.graph,o)}loadFromOrtFormat(a,o){const t=new d.flatbuffers.ByteBuffer(a),e=p.InferenceSession.getRootAsInferenceSession(t).model();if(h.LongUtil.longToNumber(e.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let n=0;n{Object.defineProperty(r,"__esModule",{value:!0}),r.FLOAT_TYPES=r.INT_TYPES=r.NUMBER_TYPES=void 0,r.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],r.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],r.FLOAT_TYPES=["float32","float64"]},1047:(f,r)=>{function c(d,l){if(l.endsWith("+")){const m=Number.parseInt(l.substring(0,l.length-1),10);return!isNaN(m)&&m<=d}if(l.split("-").length===2){const m=l.split("-"),s=Number.parseInt(m[0],10),h=Number.parseInt(m[1],10);return!isNaN(s)&&!isNaN(h)&&s<=d&&d<=h}return Number.parseInt(l,10)===d}Object.defineProperty(r,"__esModule",{value:!0}),r.resolveOperator=void 0,r.resolveOperator=function(d,l,m){for(const s of m){const h=s[0],p=s[1],a=s[2],o=s[3],t=s[4];if(d.opType===h){for(const e of l)if((e.domain===p||e.domain==="ai.onnx"&&p==="")&&c(e.version,a))return{opImpl:o,opInit:t}}}throw new TypeError(`cannot resolve operator '${d.opType}' with opsets: ${l.map(s=>`${s.domain||"ai.onnx"} v${s.version}`).join(", ")}`)}},9395:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.onnxruntime=void 0;const d=c(5686);var l,m;l=r.onnxruntime||(r.onnxruntime={}),function(s){(function(h){h[h.UNDEFINED=0]="UNDEFINED",h[h.FLOAT=1]="FLOAT",h[h.INT=2]="INT",h[h.STRING=3]="STRING",h[h.TENSOR=4]="TENSOR",h[h.GRAPH=5]="GRAPH",h[h.FLOATS=6]="FLOATS",h[h.INTS=7]="INTS",h[h.STRINGS=8]="STRINGS",h[h.TENSORS=9]="TENSORS",h[h.GRAPHS=10]="GRAPHS",h[h.SPARSE_TENSOR=11]="SPARSE_TENSOR",h[h.SPARSE_TENSORS=12]="SPARSE_TENSORS"})(s.AttributeType||(s.AttributeType={}))}((m=l.experimental||(l.experimental={})).fbs||(m.fbs={})),function(s){(function(h){(function(p){(function(a){a[a.UNKNOWN=0]="UNKNOWN",a[a.VALUE=1]="VALUE",a[a.PARAM=2]="PARAM"})(p.DimensionValueType||(p.DimensionValueType={}))})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){(function(a){a[a.UNDEFINED=0]="UNDEFINED",a[a.FLOAT=1]="FLOAT",a[a.UINT8=2]="UINT8",a[a.INT8=3]="INT8",a[a.UINT16=4]="UINT16",a[a.INT16=5]="INT16",a[a.INT32=6]="INT32",a[a.INT64=7]="INT64",a[a.STRING=8]="STRING",a[a.BOOL=9]="BOOL",a[a.FLOAT16=10]="FLOAT16",a[a.DOUBLE=11]="DOUBLE",a[a.UINT32=12]="UINT32",a[a.UINT64=13]="UINT64",a[a.COMPLEX64=14]="COMPLEX64",a[a.COMPLEX128=15]="COMPLEX128",a[a.BFLOAT16=16]="BFLOAT16"})(p.TensorDataType||(p.TensorDataType={}))})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){(function(a){a[a.Primitive=0]="Primitive",a[a.Fused=1]="Fused"})(p.NodeType||(p.NodeType={}))})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){(function(a){a[a.NONE=0]="NONE",a[a.tensor_type=1]="tensor_type",a[a.sequence_type=2]="sequence_type",a[a.map_type=3]="map_type"})(p.TypeInfoValue||(p.TypeInfoValue={}))})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsShape(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsShape(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}dim(t,e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new s.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}dimLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startShape(t){t.startObject(1)}static addDim(t,e){t.addFieldOffset(0,e,0)}static createDimVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startDimVector(t,e){t.startVector(4,e,4)}static endShape(t){return t.endObject()}static createShape(t,e){return a.startShape(t),a.addDim(t,e),a.endShape(t)}}p.Shape=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimension(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimension(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}value(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new s.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}denotation(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimension(t){t.startObject(2)}static addValue(t,e){t.addFieldOffset(0,e,0)}static addDenotation(t,e){t.addFieldOffset(1,e,0)}static endDimension(t){return t.endObject()}static createDimension(t,e,n){return a.startDimension(t),a.addValue(t,e),a.addDenotation(t,n),a.endDimension(t)}}p.Dimension=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimensionValue(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimensionValue(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}dimType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):s.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}dimParam(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimensionValue(t){t.startObject(3)}static addDimType(t,e){t.addFieldInt8(0,e,s.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static addDimParam(t,e){t.addFieldOffset(2,e,0)}static endDimensionValue(t){return t.endObject()}static createDimensionValue(t,e,n,i){return a.startDimensionValue(t),a.addDimType(t,e),a.addDimValue(t,n),a.addDimParam(t,i),a.endDimensionValue(t)}}p.DimensionValue=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensorTypeAndShape(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensorTypeAndShape(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}elemType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.TensorDataType.UNDEFINED}shape(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startTensorTypeAndShape(t){t.startObject(2)}static addElemType(t,e){t.addFieldInt32(0,e,s.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(t,e){t.addFieldOffset(1,e,0)}static endTensorTypeAndShape(t){return t.endObject()}static createTensorTypeAndShape(t,e,n){return a.startTensorTypeAndShape(t),a.addElemType(t,e),a.addShape(t,n),a.endTensorTypeAndShape(t)}}p.TensorTypeAndShape=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMapType(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMapType(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}keyType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.TensorDataType.UNDEFINED}valueType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startMapType(t){t.startObject(2)}static addKeyType(t,e){t.addFieldInt32(0,e,s.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(t,e){t.addFieldOffset(1,e,0)}static endMapType(t){return t.endObject()}static createMapType(t,e,n){return a.startMapType(t),a.addKeyType(t,e),a.addValueType(t,n),a.endMapType(t)}}p.MapType=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSequenceType(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSequenceType(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}elemType(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new s.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startSequenceType(t){t.startObject(1)}static addElemType(t,e){t.addFieldOffset(0,e,0)}static endSequenceType(t){return t.endObject()}static createSequenceType(t,e){return a.startSequenceType(t),a.addElemType(t,e),a.endSequenceType(t)}}p.SequenceType=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(h.fbs||(h.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(p,a){return this.bb_pos=p,this.bb=a,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(p,a,o,t){return p.prep(4,12),p.writeInt32(t),p.writeInt32(o),p.writeInt32(a),p.offset()}}})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNodeEdge(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNodeEdge(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}nodeIndex(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}inputEdges(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new s.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+n)+12*t,this.bb):null}inputEdgesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}outputEdges(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new s.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+n)+12*t,this.bb):null}outputEdgesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNodeEdge(t){t.startObject(3)}static addNodeIndex(t,e){t.addFieldInt32(0,e,0)}static addInputEdges(t,e){t.addFieldOffset(1,e,0)}static startInputEdgesVector(t,e){t.startVector(12,e,4)}static addOutputEdges(t,e){t.addFieldOffset(2,e,0)}static startOutputEdgesVector(t,e){t.startVector(12,e,4)}static endNodeEdge(t){return t.endObject()}static createNodeEdge(t,e,n,i){return a.startNodeEdge(t),a.addNodeIndex(t,e),a.addInputEdges(t,n),a.addOutputEdges(t,i),a.endNodeEdge(t)}}p.NodeEdge=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNode(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNode(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}sinceVersion(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0}index(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}opType(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.NodeType.Primitive}executionProviderType(t){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null}inputs(t,e){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}attributes(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?(e||new s.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}attributesLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCounts(t){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}inputArgCountsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCountsArray(){let t=this.bb.__offset(this.bb_pos,26);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}implicitInputs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}implicitInputsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNode(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDomain(t,e){t.addFieldOffset(2,e,0)}static addSinceVersion(t,e){t.addFieldInt32(3,e,0)}static addIndex(t,e){t.addFieldInt32(4,e,0)}static addOpType(t,e){t.addFieldOffset(5,e,0)}static addType(t,e){t.addFieldInt32(6,e,s.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(t,e){t.addFieldOffset(7,e,0)}static addInputs(t,e){t.addFieldOffset(8,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(9,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addAttributes(t,e){t.addFieldOffset(10,e,0)}static createAttributesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startAttributesVector(t,e){t.startVector(4,e,4)}static addInputArgCounts(t,e){t.addFieldOffset(11,e,0)}static createInputArgCountsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startInputArgCountsVector(t,e){t.startVector(4,e,4)}static addImplicitInputs(t,e){t.addFieldOffset(12,e,0)}static createImplicitInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startImplicitInputsVector(t,e){t.startVector(4,e,4)}static endNode(t){return t.endObject()}static createNode(t,e,n,i,u,g,b,y,_,v,w,T,A,E){return a.startNode(t),a.addName(t,e),a.addDocString(t,n),a.addDomain(t,i),a.addSinceVersion(t,u),a.addIndex(t,g),a.addOpType(t,b),a.addType(t,y),a.addExecutionProviderType(t,_),a.addInputs(t,v),a.addOutputs(t,w),a.addAttributes(t,T),a.addInputArgCounts(t,A),a.addImplicitInputs(t,E),a.endNode(t)}}p.Node=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsValueInfo(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsValueInfo(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(t){let e=this.bb.__offset(this.bb_pos,8);return e?(t||new s.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startValueInfo(t){t.startObject(3)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldOffset(2,e,0)}static endValueInfo(t){return t.endObject()}static createValueInfo(t,e,n,i){return a.startValueInfo(t),a.addName(t,e),a.addDocString(t,n),a.addType(t,i),a.endValueInfo(t)}}p.ValueInfo=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTypeInfo(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTypeInfo(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}denotation(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}valueType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):s.experimental.fbs.TypeInfoValue.NONE}value(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}static startTypeInfo(t){t.startObject(3)}static addDenotation(t,e){t.addFieldOffset(0,e,0)}static addValueType(t,e){t.addFieldInt8(1,e,s.experimental.fbs.TypeInfoValue.NONE)}static addValue(t,e){t.addFieldOffset(2,e,0)}static endTypeInfo(t){return t.endObject()}static createTypeInfo(t,e,n,i){return a.startTypeInfo(t),a.addDenotation(t,e),a.addValueType(t,n),a.addValue(t,i),a.endTypeInfo(t)}}p.TypeInfo=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsOperatorSetId(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsOperatorSetId(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}domain(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}version(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}static startOperatorSetId(t){t.startObject(2)}static addDomain(t,e){t.addFieldOffset(0,e,0)}static addVersion(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static endOperatorSetId(t){return t.endObject()}static createOperatorSetId(t,e,n){return a.startOperatorSetId(t),a.addDomain(t,e),a.addVersion(t,n),a.endOperatorSetId(t)}}p.OperatorSetId=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensor(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensor(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}dataType(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.TensorDataType.UNDEFINED}rawData(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}rawDataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}rawDataArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}stringData(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringDataLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}static startTensor(t){t.startObject(6)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static addDataType(t,e){t.addFieldInt32(3,e,s.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(t,e){t.addFieldOffset(4,e,0)}static createRawDataVector(t,e){t.startVector(1,e.length,1);for(let n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()}static startRawDataVector(t,e){t.startVector(1,e,1)}static addStringData(t,e){t.addFieldOffset(5,e,0)}static createStringDataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringDataVector(t,e){t.startVector(4,e,4)}static endTensor(t){return t.endObject()}static createTensor(t,e,n,i,u,g,b){return a.startTensor(t),a.addName(t,e),a.addDocString(t,n),a.addDims(t,i),a.addDataType(t,u),a.addRawData(t,g),a.addStringData(t,b),a.endTensor(t)}}p.Tensor=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSparseTensor(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSparseTensor(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}values(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}indices(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSparseTensor(t){t.startObject(3)}static addValues(t,e){t.addFieldOffset(0,e,0)}static addIndices(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startDimsVector(t,e){t.startVector(8,e,8)}static endSparseTensor(t){return t.endObject()}static createSparseTensor(t,e,n,i){return a.startSparseTensor(t),a.addValues(t,e),a.addIndices(t,n),a.addDims(t,i),a.endSparseTensor(t)}}p.SparseTensor=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsAttribute(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsAttribute(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.AttributeType.UNDEFINED}f(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0}i(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}s(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}t(t){let e=this.bb.__offset(this.bb_pos,16);return e?(t||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}g(t){let e=this.bb.__offset(this.bb_pos,18);return e?(t||new s.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}floats(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0}floatsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}floatsArray(){let t=this.bb.__offset(this.bb_pos,20);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ints(t){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}intsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}strings(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}tensors(t,e){let n=this.bb.__offset(this.bb_pos,26);return n?(e||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}tensorsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}graphs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?(e||new s.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}graphsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startAttribute(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldInt32(2,e,s.experimental.fbs.AttributeType.UNDEFINED)}static addF(t,e){t.addFieldFloat32(3,e,0)}static addI(t,e){t.addFieldInt64(4,e,t.createLong(0,0))}static addS(t,e){t.addFieldOffset(5,e,0)}static addT(t,e){t.addFieldOffset(6,e,0)}static addG(t,e){t.addFieldOffset(7,e,0)}static addFloats(t,e){t.addFieldOffset(8,e,0)}static createFloatsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()}static startFloatsVector(t,e){t.startVector(4,e,4)}static addInts(t,e){t.addFieldOffset(9,e,0)}static createIntsVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startIntsVector(t,e){t.startVector(8,e,8)}static addStrings(t,e){t.addFieldOffset(10,e,0)}static createStringsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startStringsVector(t,e){t.startVector(4,e,4)}static addTensors(t,e){t.addFieldOffset(11,e,0)}static createTensorsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startTensorsVector(t,e){t.startVector(4,e,4)}static addGraphs(t,e){t.addFieldOffset(12,e,0)}static createGraphsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startGraphsVector(t,e){t.startVector(4,e,4)}static endAttribute(t){return t.endObject()}static createAttribute(t,e,n,i,u,g,b,y,_,v,w,T,A,E){return a.startAttribute(t),a.addName(t,e),a.addDocString(t,n),a.addType(t,i),a.addF(t,u),a.addI(t,g),a.addS(t,b),a.addT(t,y),a.addG(t,_),a.addFloats(t,v),a.addInts(t,w),a.addStrings(t,T),a.addTensors(t,A),a.addGraphs(t,E),a.endAttribute(t)}}p.Attribute=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsGraph(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsGraph(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}initializers(t,e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}initializersLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeArgs(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new s.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}nodeArgsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}nodes(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new s.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}maxNodeIndex(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}nodeEdges(t,e){let n=this.bb.__offset(this.bb_pos,12);return n?(e||new s.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}nodeEdgesLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}inputs(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}sparseInitializers(t,e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new s.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}sparseInitializersLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startGraph(t){t.startObject(8)}static addInitializers(t,e){t.addFieldOffset(0,e,0)}static createInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInitializersVector(t,e){t.startVector(4,e,4)}static addNodeArgs(t,e){t.addFieldOffset(1,e,0)}static createNodeArgsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeArgsVector(t,e){t.startVector(4,e,4)}static addNodes(t,e){t.addFieldOffset(2,e,0)}static createNodesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodesVector(t,e){t.startVector(4,e,4)}static addMaxNodeIndex(t,e){t.addFieldInt32(3,e,0)}static addNodeEdges(t,e){t.addFieldOffset(4,e,0)}static createNodeEdgesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startNodeEdgesVector(t,e){t.startVector(4,e,4)}static addInputs(t,e){t.addFieldOffset(5,e,0)}static createInputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(6,e,0)}static createOutputsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOutputsVector(t,e){t.startVector(4,e,4)}static addSparseInitializers(t,e){t.addFieldOffset(7,e,0)}static createSparseInitializersVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSparseInitializersVector(t,e){t.startVector(4,e,4)}static endGraph(t){return t.endObject()}static createGraph(t,e,n,i,u,g,b,y,_){return a.startGraph(t),a.addInitializers(t,e),a.addNodeArgs(t,n),a.addNodes(t,i),a.addMaxNodeIndex(t,u),a.addNodeEdges(t,g),a.addInputs(t,b),a.addOutputs(t,y),a.addSparseInitializers(t,_),a.endGraph(t)}}p.Graph=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsModel(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModel(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}irVersion(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}opsetImport(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new s.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}opsetImportLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}producerName(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}producerVersion(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}modelVersion(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}docString(t){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb_pos+e,t):null}graph(t){let e=this.bb.__offset(this.bb_pos,18);return e?(t||new s.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}graphDocString(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb_pos+e,t):null}static startModel(t){t.startObject(9)}static addIrVersion(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addOpsetImport(t,e){t.addFieldOffset(1,e,0)}static createOpsetImportVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startOpsetImportVector(t,e){t.startVector(4,e,4)}static addProducerName(t,e){t.addFieldOffset(2,e,0)}static addProducerVersion(t,e){t.addFieldOffset(3,e,0)}static addDomain(t,e){t.addFieldOffset(4,e,0)}static addModelVersion(t,e){t.addFieldInt64(5,e,t.createLong(0,0))}static addDocString(t,e){t.addFieldOffset(6,e,0)}static addGraph(t,e){t.addFieldOffset(7,e,0)}static addGraphDocString(t,e){t.addFieldOffset(8,e,0)}static endModel(t){return t.endObject()}static createModel(t,e,n,i,u,g,b,y,_,v){return a.startModel(t),a.addIrVersion(t,e),a.addOpsetImport(t,n),a.addProducerName(t,i),a.addProducerVersion(t,u),a.addDomain(t,g),a.addModelVersion(t,b),a.addDocString(t,y),a.addGraph(t,_),a.addGraphDocString(t,v),a.endModel(t)}}p.Model=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKernelCreateInfos(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKernelCreateInfos(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}nodeIndices(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}nodeIndicesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeIndicesArray(){let t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}kernelDefHashes(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}kernelDefHashesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startKernelCreateInfos(t){t.startObject(2)}static addNodeIndices(t,e){t.addFieldOffset(0,e,0)}static createNodeIndicesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startNodeIndicesVector(t,e){t.startVector(4,e,4)}static addKernelDefHashes(t,e){t.addFieldOffset(1,e,0)}static createKernelDefHashesVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startKernelDefHashesVector(t,e){t.startVector(8,e,8)}static endKernelCreateInfos(t){return t.endObject()}static createKernelCreateInfos(t,e,n){return a.startKernelCreateInfos(t),a.addNodeIndices(t,e),a.addKernelDefHashes(t,n),a.endKernelCreateInfos(t)}}p.KernelCreateInfos=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSubGraphSessionState(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSubGraphSessionState(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}graphId(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}sessionState(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startSubGraphSessionState(t){t.startObject(2)}static addGraphId(t,e){t.addFieldOffset(0,e,0)}static addSessionState(t,e){t.addFieldOffset(1,e,0)}static endSubGraphSessionState(t){let e=t.endObject();return t.requiredField(e,4),e}static createSubGraphSessionState(t,e,n){return a.startSubGraphSessionState(t),a.addGraphId(t,e),a.addSessionState(t,n),a.endSubGraphSessionState(t)}}p.SubGraphSessionState=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSessionState(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSessionState(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}kernels(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new s.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}subGraphSessionStates(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new s.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}subGraphSessionStatesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSessionState(t){t.startObject(2)}static addKernels(t,e){t.addFieldOffset(0,e,0)}static addSubGraphSessionStates(t,e){t.addFieldOffset(1,e,0)}static createSubGraphSessionStatesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startSubGraphSessionStatesVector(t,e){t.startVector(4,e,4)}static endSessionState(t){return t.endObject()}static createSessionState(t,e,n){return a.startSessionState(t),a.addKernels(t,e),a.addSubGraphSessionStates(t,n),a.endSessionState(t)}}p.SessionState=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInferenceSession(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInferenceSession(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier("ORTM")}ortVersion(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}model(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}sessionState(t){let e=this.bb.__offset(this.bb_pos,8);return e?(t||new s.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startInferenceSession(t){t.startObject(3)}static addOrtVersion(t,e){t.addFieldOffset(0,e,0)}static addModel(t,e){t.addFieldOffset(1,e,0)}static addSessionState(t,e){t.addFieldOffset(2,e,0)}static endInferenceSession(t){return t.endObject()}static finishInferenceSessionBuffer(t,e){t.finish(e,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(t,e){t.finish(e,"ORTM",!0)}static createInferenceSession(t,e,n,i){return a.startInferenceSession(t),a.addOrtVersion(t,e),a.addModel(t,n),a.addSessionState(t,i),a.endInferenceSession(t)}}p.InferenceSession=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={}))},7448:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OnnxjsSessionHandler=void 0;const d=c(1670),l=c(9162);r.OnnxjsSessionHandler=class{constructor(m){this.session=m,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(m,s,h){const p=new Map;for(const t in m)if(Object.hasOwnProperty.call(m,t)){const e=m[t];p.set(t,new l.Tensor(e.dims,e.type,void 0,void 0,e.data))}const a=await this.session.run(p),o={};return a.forEach((t,e)=>{o[e]=new d.Tensor(t.type,t.data,t.dims)}),o}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Session=void 0;const d=c(7067),l=c(1296),m=c(7091),s=c(1036),h=c(6231),p=c(2644);r.Session=class{constructor(a={}){this._initialized=!1,this.backendHint=a.backendHint,this.profiler=h.Profiler.create(a.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(a,o,t){await this.profiler.event("session","Session.loadModel",async()=>{const e=await(0,m.resolveBackend)(this.backendHint);if(this.sessionHandler=e.createSessionHandler(this.context),this._model=new p.Model,typeof a=="string"){const n=a.endsWith(".ort");if(typeof fetch>"u"){const i=await(0,l.promisify)(d.readFile)(a);this.initialize(i,n)}else{const i=await fetch(a),u=await i.arrayBuffer();this.initialize(new Uint8Array(u),n)}}else if(ArrayBuffer.isView(a))this.initialize(a);else{const n=new Uint8Array(a,o||0,t||a.byteLength);this.initialize(n)}})}initialize(a,o){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const t=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(a,t,o),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new s.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(a){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const o=this.normalizeAndValidateInputs(a),t=await this._executionPlan.execute(this.sessionHandler,o);return this.createOutput(t)})}normalizeAndValidateInputs(a){const o=this._model.graph.getInputNames();if(Array.isArray(a)){if(a.length!==o.length)throw new Error(`incorrect input array length: expected ${o.length} but got ${a.length}`)}else{if(a.size!==o.length)throw new Error(`incorrect input map size: expected ${o.length} but got ${a.size}`);const t=new Array(a.size);let e=0;for(let n=0;ntypeof E=="string")))throw new TypeError("cache should be a string array");A&&(this.cache=new Array(T))}else{if(v!==void 0){const E=e(b);if(!(v instanceof E))throw new TypeError(`cache should be type ${E.name}`)}if(A){const E=new ArrayBuffer(T*function(x){switch(x){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 new Error(`cannot calculate sizeof() on type ${x}`)}}(b));this.cache=function(x,M){return new(e(M))(x)}(E,b)}}}static fromProto(g){if(!g)throw new Error("cannot construct Value from an empty tensor");const b=p.ProtoUtil.tensorDataTypeFromProto(g.dataType),y=p.ProtoUtil.tensorDimsFromProto(g.dims),_=new o(y,b);if(b==="string")g.stringData.forEach((v,w)=>{_.data[w]=(0,p.decodeUtf8String)(v)});else if(g.rawData&&typeof g.rawData.byteLength=="number"&&g.rawData.byteLength>0){const v=_.data,w=new DataView(g.rawData.buffer,g.rawData.byteOffset,g.rawData.byteLength),T=t(g.dataType),A=g.rawData.byteLength/T;if(g.rawData.byteLength%T!=0)throw new Error("invalid buffer length");if(v.length!==A)throw new Error("buffer length mismatch");for(let E=0;E0){const v=_.data,w=new DataView(g.rawDataArray().buffer,g.rawDataArray().byteOffset,g.rawDataLength()),T=t(g.dataType()),A=g.rawDataLength()/T;if(g.rawDataLength()%T!=0)throw new Error("invalid buffer length");if(v.length!==A)throw new Error("buffer length mismatch");for(let E=0;E1&&M>1)return;A[T-E]=Math.max(x,M)}return A}static index(b,y){const _=new Array(y.length);return a.fillIndex(b,y,_),_}static fillIndex(b,y,_){const v=b.length-y.length;for(let w=0;w=0;J--)x[J]=k%T[J],k=Math.floor(k/T[J]);q||(a.fillIndex(x,b.dims,M),V=b.get(M)),D||(a.fillIndex(x,y.dims,C),F=y.get(C)),E.set(x,_(V,F))}}return E}}static isValidBroadcast(b,y){const _=b.length,v=y.length;if(_>v)return!1;for(let w=1;w<=_;w++)if(b[_-w]!==1&&b[_-w]!==y[v-w])return!1;return!0}static getBroadcastDims(b,y){const _=b.length,v=[];for(let w=0;w<_;w++){const T=_-1-w,A=b[T]||1;(y[y.length-1-w]||1)>1&&A===1&&v.unshift(T)}return v}}r.BroadcastUtil=a,r.arrayCopyHelper=function(g,b,y,_,v){if(_<0||_>=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let w=0;wm.default.isLong(y)?y.toNumber():y)}static tensorValueTypeFromProto(b){return{tensorType:o.tensorDataTypeFromProto(b.elemType),shape:{dims:o.tensorDimsFromProto(b.shape.dim.map(y=>y.dimValue))}}}static tensorDimsFromORTFormat(b){const y=[];for(let _=0;_b.length)throw new Error(`invalid dimension of ${y} for sizeFromDimension as Tensor has ${b.length} dimensions.`);return e.getSizeFromDimensionRange(b,y,b.length)}static sizeToDimension(b,y){if(y<0||y>b.length)throw new Error(`invalid dimension of ${y} for sizeToDimension as Tensor has ${b.length} dimensions.`);return e.getSizeFromDimensionRange(b,0,y)}static getSizeFromDimensionRange(b,y,_){let v=1;for(let w=y;w<_;w++){if(b[w]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");v*=b[w]}return v}static computeStrides(b){const y=b.length;if(y===0)return[];if(y===1)return[1];const _=new Array(y);_[y-1]=1,_[y-2]=b[y-1];for(let v=y-3;v>=0;--v)_[v]=_[v+1]*b[v+1];return _}static transpose(b){return b.slice().reverse()}static indicesToOffset(b,y,_){_===void 0&&(_=b.length);let v=0;for(let w=0;w<_;++w)v+=y[w]*b[w];return v}static offsetToIndices(b,y){const _=y.length;if(_===0)return[];if(_===1)return[b*y[0]];const v=new Array(y.length);for(let w=0;w=y)throw new Error("unsupported axis for this operation.");return b<0?b+y:b}static normalizeAxes(b,y){return b.map(_=>this.normalizeAxis(_,y))}static incrementIndex(b,y,_){if(y.length===0||b.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(_===void 0)_=y.length;else if(_<=0||_>y.length)throw new Error("Incorrect axis to increment on");for(let v=_-1;v>=0&&(b[v]++,!(b[v]=b.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");v[E]=b[E]}else v[E]=y[E];T*=v[E]}}const A=e.size(b);if(w!==-1){if(A%T!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${b}] Output shape: [${y}]`);v[w]=A/T}else if(T!==A)throw new Error("reshapedDims and originalDims don't have matching sizes");return v}static sortBasedOnPerm(b,y){return y?y.map(_=>b[_]):b.slice().reverse()}static padShape(b,y){const _=b.length;return b.map((v,w)=>v+y[w]+y[w+_])}static areEqual(b,y){return b.length===y.length&&b.every((_,v)=>_===y[v])}static validateDimsAndCalcSize(b){if(b.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let y=1;for(const _ of b){if(!Number.isInteger(_))throw new TypeError(`Invalid shape: ${_} is not an integer`);if(_<0||_>2147483647)throw new TypeError(`Invalid shape: length ${_} is not allowed`);y*=_}return y}static flattenShape(b,y){y<0&&(y+=b.length);const _=b.reduce((w,T)=>w*T,1),v=b.slice(y).reduce((w,T)=>w*T,1);return[_/v,v]}static squeezeShape(b,y){const _=new Array;y=e.normalizeAxes(y,b.length);for(let v=0;v=0;if(w&&b[v]!==1)throw new Error("squeeze an axis of size different than 1");(y.length===0&&b[v]>1||y.length>0&&!w)&&_.push(b[v])}return _}static unsqueezeShape(b,y){const _=new Array(b.length+y.length);_.fill(0);for(let w=0;w=_.length)throw new Error("'axes' has an out of range axis");if(_[T]!==0)throw new Error("'axes' has a duplicate axis");_[T]=1}let v=0;for(let w=0;w<_.length;w++)_[w]===0&&(_[w]=b[v++]);if(v!==b.length)throw new Error("the unsqueezed dimension could not be established");return _}}r.ShapeUtil=e,r.MathUtil=class{static sqr(g,b,y,_,v){if(_<0||_>=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let w=0;w=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let T=0;T=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let T=0;T=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let w=0;wy.push(F));const A=i.calcReduceShape(T,y,!0),E=e.size(A),x=new h.Tensor(A,b.type),M=e.computeStrides(A),C=e.computeStrides(T),k=new Array(T.length);for(let V=0;V=y.length)return T(b[w]);const x=y[v],M=x>=_.length?1:e.size(_.slice(x+1));for(let C=0;C<_[x];C++)E=C===0?i.calcReduceByAxis(b,y,_,v+1,w,T,A):A(E,i.calcReduceByAxis(b,y,_,v+1,w,T,A)),w+=M;return E}static calcReduceShape(b,y,_){const v=b.slice();for(let w=0;ww!==0)}}r.ReduceUtil=i;class u{static adjustPoolAttributes(b,y,_,v,w,T){if(!b&&_.length!==y.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(b)for(let A=0;A=_.length?_.push(y[A+2]):_[A]=y[A+2];for(let A=0;A<_.length;A++)if(A=_[A]||T[A+_.length]>=_[A])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(b,y,_,v,w,T){if(T){if(w.length!==2*(b.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(y.length!==b.length-2)throw new Error("length of strides should be the length of data dimensions");if(v.length!==b.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let A=0;A{Object.defineProperty(r,"__esModule",{value:!0}),r.iterateExtraOptions=void 0,r.iterateExtraOptions=(c,d,l,m)=>{if(typeof c=="object"&&c!==null){if(l.has(c))throw new Error("Circular reference in options");l.add(c)}Object.entries(c).forEach(([s,h])=>{const p=d?d+s:s;if(typeof h=="object")(0,r.iterateExtraOptions)(h,p+".",l,m);else if(typeof h=="string"||typeof h=="number")m(p,h.toString());else{if(typeof h!="boolean")throw new Error("Can't handle extra config type: "+typeof h);m(p,h?"1":"0")}})}},2157:function(f,r,c){var d,l=this&&this.__createBinding||(Object.create?function(M,C,k,V){V===void 0&&(V=k);var F=Object.getOwnPropertyDescriptor(C,k);F&&!("get"in F?!C.__esModule:F.writable||F.configurable)||(F={enumerable:!0,get:function(){return C[k]}}),Object.defineProperty(M,V,F)}:function(M,C,k,V){V===void 0&&(V=k),M[V]=C[k]}),m=this&&this.__setModuleDefault||(Object.create?function(M,C){Object.defineProperty(M,"default",{enumerable:!0,value:C})}:function(M,C){M.default=C}),s=this&&this.__importStar||function(M){if(M&&M.__esModule)return M;var C={};if(M!=null)for(var k in M)k!=="default"&&Object.prototype.hasOwnProperty.call(M,k)&&l(C,M,k);return m(C,M),C};Object.defineProperty(r,"__esModule",{value:!0}),r.endProfiling=r.run=r.releaseSession=r.createSession=r.createSessionFinalize=r.createSessionAllocate=r.initOrt=r.initWasm=void 0;const h=c(1670),p=s(c(349)),a=c(6361),o=()=>!!h.env.wasm.proxy&&typeof document<"u";let t,e,n,i=!1,u=!1,g=!1;const b=[],y=[],_=[],v=[],w=[],T=[],A=()=>{if(i||!u||g||!t)throw new Error("worker not ready")},E=M=>{switch(M.data.type){case"init-wasm":i=!1,M.data.err?(g=!0,e[1](M.data.err)):(u=!0,e[0]());break;case"init-ort":M.data.err?n[1](M.data.err):n[0]();break;case"create_allocate":M.data.err?b.shift()[1](M.data.err):b.shift()[0](M.data.out);break;case"create_finalize":M.data.err?y.shift()[1](M.data.err):y.shift()[0](M.data.out);break;case"create":M.data.err?_.shift()[1](M.data.err):_.shift()[0](M.data.out);break;case"release":M.data.err?v.shift()[1](M.data.err):v.shift()[0]();break;case"run":M.data.err?w.shift()[1](M.data.err):w.shift()[0](M.data.out);break;case"end-profiling":M.data.err?T.shift()[1](M.data.err):T.shift()[0]()}},x=typeof document<"u"?(d=document==null?void 0:document.currentScript)===null||d===void 0?void 0:d.src:void 0;r.initWasm=async()=>{if(o()){if(u)return;if(i)throw new Error("multiple calls to 'initWasm()' detected.");if(g)throw new Error("previous call to 'initWasm()' failed.");return i=!0,h.env.wasm.wasmPaths===void 0&&x&&x.indexOf("blob:")!==0&&(h.env.wasm.wasmPaths=x.substr(0,+x.lastIndexOf("/")+1)),new Promise((M,C)=>{t==null||t.terminate(),t=c(9710).Z(),t.onmessage=E,e=[M,C];const k={type:"init-wasm",in:h.env.wasm};t.postMessage(k)})}return(0,a.initializeWebAssembly)(h.env.wasm)},r.initOrt=async(M,C)=>{if(o())return A(),new Promise((k,V)=>{n=[k,V];const F={type:"init-ort",in:{numThreads:M,loggingLevel:C}};t.postMessage(F)});p.initOrt(M,C)},r.createSessionAllocate=async M=>o()?(A(),new Promise((C,k)=>{b.push([C,k]);const V={type:"create_allocate",in:{model:M}};t.postMessage(V,[M.buffer])})):p.createSessionAllocate(M),r.createSessionFinalize=async(M,C)=>o()?(A(),new Promise((k,V)=>{y.push([k,V]);const F={type:"create_finalize",in:{modeldata:M,options:C}};t.postMessage(F)})):p.createSessionFinalize(M,C),r.createSession=async(M,C)=>o()?(A(),new Promise((k,V)=>{_.push([k,V]);const F={type:"create",in:{model:M,options:C}};t.postMessage(F,[M.buffer])})):p.createSession(M,C),r.releaseSession=async M=>{if(o())return A(),new Promise((C,k)=>{v.push([C,k]);const V={type:"release",in:M};t.postMessage(V)});p.releaseSession(M)},r.run=async(M,C,k,V,F)=>o()?(A(),new Promise((q,D)=>{w.push([q,D]);const U={type:"run",in:{sessionId:M,inputIndices:C,inputs:k,outputIndices:V,options:F}};t.postMessage(U,p.extractTransferableBuffers(k))})):p.run(M,C,k,V,F),r.endProfiling=async M=>{if(o())return A(),new Promise((C,k)=>{T.push([C,k]);const V={type:"end-profiling",in:M};t.postMessage(V)});p.endProfiling(M)}},586:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.setRunOptions=void 0;const d=c(7967),l=c(4983),m=c(6361);r.setRunOptions=s=>{const h=(0,m.getInstance)();let p=0;const a=[],o=s||{};try{if((s==null?void 0:s.logSeverityLevel)===void 0)o.logSeverityLevel=2;else if(typeof s.logSeverityLevel!="number"||!Number.isInteger(s.logSeverityLevel)||s.logSeverityLevel<0||s.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${s.logSeverityLevel}`);if((s==null?void 0:s.logVerbosityLevel)===void 0)o.logVerbosityLevel=0;else if(typeof s.logVerbosityLevel!="number"||!Number.isInteger(s.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${s.logVerbosityLevel}`);(s==null?void 0:s.terminate)===void 0&&(o.terminate=!1);let t=0;if((s==null?void 0:s.tag)!==void 0&&(t=(0,l.allocWasmString)(s.tag,a)),p=h._OrtCreateRunOptions(o.logSeverityLevel,o.logVerbosityLevel,!!o.terminate,t),p===0)throw new Error("Can't create run options");return(s==null?void 0:s.extra)!==void 0&&(0,d.iterateExtraOptions)(s.extra,"",new WeakSet,(e,n)=>{const i=(0,l.allocWasmString)(e,a),u=(0,l.allocWasmString)(n,a);if(h._OrtAddRunConfigEntry(p,i,u)!==0)throw new Error(`Can't set a run config entry: ${e} - ${n}`)}),[p,a]}catch(t){throw p!==0&&h._OrtReleaseRunOptions(p),a.forEach(h._free),t}}},2306:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OnnxruntimeWebAssemblySessionHandler=void 0;const d=c(2806),l=c(1670),m=c(2850),s=c(2157);let h;r.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(p){const a=await fetch(p),o=await a.arrayBuffer();return(0,s.createSessionAllocate)(new Uint8Array(o))}async loadModel(p,a){if(h||(await(0,s.initOrt)(l.env.wasm.numThreads,(o=>{switch(o){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${o}`)}})(l.env.logLevel)),h=!0),typeof p=="string")if(typeof fetch>"u"){const o=await(0,m.promisify)(d.readFile)(p);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(o,a)}else{const o=await this.createSessionAllocate(p);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSessionFinalize)(o,a)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(p,a)}async dispose(){return(0,s.releaseSession)(this.sessionId)}async run(p,a,o){const t=[],e=[];Object.entries(p).forEach(g=>{const b=g[0],y=g[1],_=this.inputNames.indexOf(b);if(_===-1)throw new Error(`invalid input '${b}'`);t.push(y),e.push(_)});const n=[];Object.entries(a).forEach(g=>{const b=g[0],y=this.outputNames.indexOf(b);if(y===-1)throw new Error(`invalid output '${b}'`);n.push(y)});const i=await(0,s.run)(this.sessionId,e,t.map(g=>[g.type,g.dims,g.data]),n,o),u={};for(let g=0;g{Object.defineProperty(r,"__esModule",{value:!0}),r.setSessionOptions=void 0;const d=c(7967),l=c(4983),m=c(6361);r.setSessionOptions=s=>{const h=(0,m.getInstance)();let p=0;const a=[],o=s||{};(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")})(o);try{(s==null?void 0:s.graphOptimizationLevel)===void 0&&(o.graphOptimizationLevel="all");const t=(i=>{switch(i){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${i}`)}})(o.graphOptimizationLevel);(s==null?void 0:s.enableCpuMemArena)===void 0&&(o.enableCpuMemArena=!0),(s==null?void 0:s.enableMemPattern)===void 0&&(o.enableMemPattern=!0),(s==null?void 0:s.executionMode)===void 0&&(o.executionMode="sequential");const e=(i=>{switch(i){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${i}`)}})(o.executionMode);let n=0;if((s==null?void 0:s.logId)!==void 0&&(n=(0,l.allocWasmString)(s.logId,a)),(s==null?void 0:s.logSeverityLevel)===void 0)o.logSeverityLevel=2;else if(typeof s.logSeverityLevel!="number"||!Number.isInteger(s.logSeverityLevel)||s.logSeverityLevel<0||s.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${s.logSeverityLevel}`);if((s==null?void 0:s.logVerbosityLevel)===void 0)o.logVerbosityLevel=0;else if(typeof s.logVerbosityLevel!="number"||!Number.isInteger(s.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${s.logVerbosityLevel}`);if((s==null?void 0:s.enableProfiling)===void 0&&(o.enableProfiling=!1),p=h._OrtCreateSessionOptions(t,!!o.enableCpuMemArena,!!o.enableMemPattern,e,!!o.enableProfiling,0,n,o.logSeverityLevel,o.logVerbosityLevel),p===0)throw new Error("Can't create session options");return s!=null&&s.executionProviders&&((i,u,g)=>{for(const b of u){let y=typeof b=="string"?b:b.name;switch(y){case"xnnpack":y="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${y}`)}const _=(0,l.allocWasmString)(y,g);if((0,m.getInstance)()._OrtAppendExecutionProvider(i,_)!==0)throw new Error(`Can't append execution provider: ${y}`)}})(p,s.executionProviders,a),(s==null?void 0:s.extra)!==void 0&&(0,d.iterateExtraOptions)(s.extra,"",new WeakSet,(i,u)=>{const g=(0,l.allocWasmString)(i,a),b=(0,l.allocWasmString)(u,a);if(h._OrtAddSessionConfigEntry(p,g,b)!==0)throw new Error(`Can't set a session config entry: ${i} - ${u}`)}),[p,a]}catch(t){throw p!==0&&h._OrtReleaseSessionOptions(p),a.forEach(h._free),t}}},4983:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.allocWasmString=void 0;const d=c(6361);r.allocWasmString=(l,m)=>{const s=(0,d.getInstance)(),h=s.lengthBytesUTF8(l)+1,p=s._malloc(h);return s.stringToUTF8(l,p,h),m.push(p),p}},349:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.extractTransferableBuffers=r.endProfiling=r.run=r.releaseSession=r.createSession=r.createSessionFinalize=r.createSessionAllocate=r.initOrt=void 0;const d=c(586),l=c(4919),m=c(4983),s=c(6361);r.initOrt=(t,e)=>{const n=(0,s.getInstance)()._OrtInit(t,e);if(n!==0)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const h=new Map;r.createSessionAllocate=t=>{const e=(0,s.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},r.createSessionFinalize=(t,e)=>{const n=(0,s.getInstance)();let i=0,u=0,g=[];try{if([u,g]=(0,l.setSessionOptions)(e),i=n._OrtCreateSession(t[0],t[1],u),i===0)throw new Error("Can't create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(u),g.forEach(n._free)}const b=n._OrtGetInputCount(i),y=n._OrtGetOutputCount(i),_=[],v=[],w=[],T=[];for(let A=0;A{const n=(0,r.createSessionAllocate)(t);return(0,r.createSessionFinalize)(n,e)},r.releaseSession=t=>{const e=(0,s.getInstance)(),n=h.get(t);if(!n)throw new Error("invalid session id");const i=n[0],u=n[1],g=n[2];u.forEach(e._OrtFree),g.forEach(e._OrtFree),e._OrtReleaseSession(i),h.delete(t)};const p=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}`)}},a=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}`)}},o=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}`)}};r.run=(t,e,n,i,u)=>{const g=(0,s.getInstance)(),b=h.get(t);if(!b)throw new Error("invalid session id");const y=b[0],_=b[1],v=b[2],w=e.length,T=i.length;let A=0,E=[];const x=[],M=[];try{[A,E]=(0,d.setRunOptions)(u);for(let D=0;Dg.HEAP32[Te++]=xe);const ue=g._OrtCreateTensor(p(U),Z,te,Me,J.length);if(ue===0)throw new Error("Can't create a tensor");x.push(ue)}finally{g.stackRestore(he)}}const C=g.stackSave(),k=g.stackAlloc(4*w),V=g.stackAlloc(4*w),F=g.stackAlloc(4*T),q=g.stackAlloc(4*T);try{let D=k/4,U=V/4,J=F/4,Y=q/4;for(let he=0;hewe*ke);if(xe=a(ze),xe==="string"){const we=[];let ke=_e/4;for(let Ue=0;Ue{const e=(0,s.getInstance)(),n=h.get(t);if(!n)throw new Error("invalid session id");const i=n[0],u=e._OrtEndProfiling(i);if(u===0)throw new Error("Can't get an profile file name");e._OrtFree(u)},r.extractTransferableBuffers=t=>{const e=[];for(const n of t){const i=n[2];!Array.isArray(i)&&i.buffer&&e.push(i.buffer)}return e}},6361:function(f,r,c){var d=this&&this.__createBinding||(Object.create?function(u,g,b,y){y===void 0&&(y=b);var _=Object.getOwnPropertyDescriptor(g,b);_&&!("get"in _?!g.__esModule:_.writable||_.configurable)||(_={enumerable:!0,get:function(){return g[b]}}),Object.defineProperty(u,y,_)}:function(u,g,b,y){y===void 0&&(y=b),u[y]=g[b]}),l=this&&this.__setModuleDefault||(Object.create?function(u,g){Object.defineProperty(u,"default",{enumerable:!0,value:g})}:function(u,g){u.default=g}),m=this&&this.__importStar||function(u){if(u&&u.__esModule)return u;var g={};if(u!=null)for(var b in u)b!=="default"&&Object.prototype.hasOwnProperty.call(u,b)&&d(g,u,b);return l(g,u),g},s=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(r,"__esModule",{value:!0}),r.dispose=r.getInstance=r.initializeWebAssembly=void 0;const h=m(c(6449)),p=s(c(932)),a=c(3474);let o,t=!1,e=!1,n=!1;const i=(u,g)=>g?u?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":u?"ort-wasm-simd.wasm":"ort-wasm.wasm";r.initializeWebAssembly=async u=>{if(t)return Promise.resolve();if(e)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(n)throw new Error("previous call to 'initializeWebAssembly()' failed.");e=!0;const g=u.initTimeout,b=u.numThreads,y=u.simd,_=b>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}})(),v=y&&(()=>{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}})(),w=typeof u.wasmPaths=="string"?u.wasmPaths:void 0,T=i(!1,_),A=i(v,_),E=typeof u.wasmPaths=="object"?u.wasmPaths[A]:void 0;let x=!1;const M=[];if(g>0&&M.push(new Promise(C=>{setTimeout(()=>{x=!0,C()},g)})),M.push(new Promise((C,k)=>{const V=_?a:p.default,F={locateFile:(q,D)=>_&&q.endsWith(".worker.js")&&typeof Blob<"u"?URL.createObjectURL(new Blob([c(4154)],{type:"text/javascript"})):q===T?E??(w??D)+A:D+q};if(_)if(typeof Blob>"u")F.mainScriptUrlOrBlob=h.join("/","ort-wasm-threaded.js");else{const q=`var ortWasmThreaded=(function(){var _scriptDir;return ${V.toString()}})();`;F.mainScriptUrlOrBlob=new Blob([q],{type:"text/javascript"})}V(F).then(q=>{e=!1,t=!0,o=q,C()},q=>{e=!1,n=!0,k(q)})})),await Promise.race(M),x)throw new Error(`WebAssembly backend initializing failed due to timeout: ${g}ms`)},r.getInstance=()=>{if(t&&o)return o;throw new Error("WebAssembly is not initialized yet.")},r.dispose=()=>{var u;!t||e||n||(e=!0,(u=o.PThread)===null||u===void 0||u.terminateAllThreads(),o=void 0,e=!1,t=!1,n=!0)}},9710:(f,r,c)=>{c.d(r,{Z:()=>m});var d=c(477),l=c.n(d);function m(){return l()('/*!\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:f=>{f.exports=function(r,c,d,l){var m=self||window;try{try{var s;try{s=new m.Blob([r])}catch{(s=new(m.BlobBuilder||m.WebKitBlobBuilder||m.MozBlobBuilder||m.MSBlobBuilder)).append(r),s=s.getBlob()}var h=m.URL||m.webkitURL,p=h.createObjectURL(s),a=new m[c](p,d);return h.revokeObjectURL(p),a}catch{return new m[c]("data:application/javascript,".concat(encodeURIComponent(r)),d)}}catch{if(!l)throw Error("Inline worker is not supported");return new m[c](l,d)}}},4154:f=>{f.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:f=>{f.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(f,r,c)=>{c.r(r),c.d(r,{flatbuffers:()=>d});var d={};d.Offset,d.Table,d.SIZEOF_SHORT=2,d.SIZEOF_INT=4,d.FILE_IDENTIFIER_LENGTH=4,d.SIZE_PREFIX_LENGTH=4,d.Encoding={UTF8_BYTES:1,UTF16_STRING:2},d.int32=new Int32Array(2),d.float32=new Float32Array(d.int32.buffer),d.float64=new Float64Array(d.int32.buffer),d.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,d.Long=function(l,m){this.low=0|l,this.high=0|m},d.Long.create=function(l,m){return l==0&&m==0?d.Long.ZERO:new d.Long(l,m)},d.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},d.Long.prototype.equals=function(l){return this.low==l.low&&this.high==l.high},d.Long.ZERO=new d.Long(0,0),d.Builder=function(l){if(l)m=l;else var m=1024;this.bb=d.ByteBuffer.allocate(m),this.space=m,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},d.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},d.Builder.prototype.forceDefaults=function(l){this.force_defaults=l},d.Builder.prototype.dataBuffer=function(){return this.bb},d.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},d.Builder.prototype.prep=function(l,m){l>this.minalign&&(this.minalign=l);for(var s=1+~(this.bb.capacity()-this.space+m)&l-1;this.space=0&&this.vtable[m]==0;m--);for(var s=m+1;m>=0;m--)this.addInt16(this.vtable[m]!=0?l-this.vtable[m]:0);this.addInt16(l-this.object_start);var h=(s+2)*d.SIZEOF_SHORT;this.addInt16(h);var p=0,a=this.space;e:for(m=0;m=0;a--)this.writeInt8(p.charCodeAt(a))}this.prep(this.minalign,d.SIZEOF_INT+h),this.addOffset(l),h&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},d.Builder.prototype.finishSizePrefixed=function(l,m){this.finish(l,m,!0)},d.Builder.prototype.requiredField=function(l,m){var s=this.bb.capacity()-l,h=s-this.bb.readInt32(s);if(this.bb.readInt16(h+m)==0)throw new Error("FlatBuffers: field "+m+" must be set")},d.Builder.prototype.startVector=function(l,m,s){this.notNested(),this.vector_num_elems=m,this.prep(d.SIZEOF_INT,l*m),this.prep(s,l*m)},d.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},d.Builder.prototype.createString=function(l){if(l instanceof Uint8Array)var m=l;else{m=[];for(var s=0;s=56320?p:(p<<10)+l.charCodeAt(s++)+-56613888)<128?m.push(h):(h<2048?m.push(h>>6&31|192):(h<65536?m.push(h>>12&15|224):m.push(h>>18&7|240,h>>12&63|128),m.push(h>>6&63|128)),m.push(63&h|128))}}this.addInt8(0),this.startVector(1,m.length,1),this.bb.setPosition(this.space-=m.length),s=0;for(var a=this.space,o=this.bb.bytes();s>24},d.ByteBuffer.prototype.readUint8=function(l){return this.bytes_[l]},d.ByteBuffer.prototype.readInt16=function(l){return this.readUint16(l)<<16>>16},d.ByteBuffer.prototype.readUint16=function(l){return this.bytes_[l]|this.bytes_[l+1]<<8},d.ByteBuffer.prototype.readInt32=function(l){return this.bytes_[l]|this.bytes_[l+1]<<8|this.bytes_[l+2]<<16|this.bytes_[l+3]<<24},d.ByteBuffer.prototype.readUint32=function(l){return this.readInt32(l)>>>0},d.ByteBuffer.prototype.readInt64=function(l){return new d.Long(this.readInt32(l),this.readInt32(l+4))},d.ByteBuffer.prototype.readUint64=function(l){return new d.Long(this.readUint32(l),this.readUint32(l+4))},d.ByteBuffer.prototype.readFloat32=function(l){return d.int32[0]=this.readInt32(l),d.float32[0]},d.ByteBuffer.prototype.readFloat64=function(l){return d.int32[d.isLittleEndian?0:1]=this.readInt32(l),d.int32[d.isLittleEndian?1:0]=this.readInt32(l+4),d.float64[0]},d.ByteBuffer.prototype.writeInt8=function(l,m){this.bytes_[l]=m},d.ByteBuffer.prototype.writeUint8=function(l,m){this.bytes_[l]=m},d.ByteBuffer.prototype.writeInt16=function(l,m){this.bytes_[l]=m,this.bytes_[l+1]=m>>8},d.ByteBuffer.prototype.writeUint16=function(l,m){this.bytes_[l]=m,this.bytes_[l+1]=m>>8},d.ByteBuffer.prototype.writeInt32=function(l,m){this.bytes_[l]=m,this.bytes_[l+1]=m>>8,this.bytes_[l+2]=m>>16,this.bytes_[l+3]=m>>24},d.ByteBuffer.prototype.writeUint32=function(l,m){this.bytes_[l]=m,this.bytes_[l+1]=m>>8,this.bytes_[l+2]=m>>16,this.bytes_[l+3]=m>>24},d.ByteBuffer.prototype.writeInt64=function(l,m){this.writeInt32(l,m.low),this.writeInt32(l+4,m.high)},d.ByteBuffer.prototype.writeUint64=function(l,m){this.writeUint32(l,m.low),this.writeUint32(l+4,m.high)},d.ByteBuffer.prototype.writeFloat32=function(l,m){d.float32[0]=m,this.writeInt32(l,d.int32[0])},d.ByteBuffer.prototype.writeFloat64=function(l,m){d.float64[0]=m,this.writeInt32(l,d.int32[d.isLittleEndian?0:1]),this.writeInt32(l+4,d.int32[d.isLittleEndian?1:0])},d.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a)))}return h},d.ByteBuffer.prototype.__indirect=function(l){return l+this.readInt32(l)},d.ByteBuffer.prototype.__vector=function(l){return l+this.readInt32(l)+d.SIZEOF_INT},d.ByteBuffer.prototype.__vector_len=function(l){return this.readInt32(l+this.readInt32(l))},d.ByteBuffer.prototype.__has_identifier=function(l){if(l.length!=d.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+d.FILE_IDENTIFIER_LENGTH);for(var m=0;m{var r=f&&f.__esModule?()=>f.default:()=>f;return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=(f,r)=>{for(var c in r)__webpack_require__.o(r,c)&&!__webpack_require__.o(f,c)&&Object.defineProperty(f,c,{enumerable:!0,get:r[c]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(f,r)=>Object.prototype.hasOwnProperty.call(f,r),__webpack_require__.r=f=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(f,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})())}(ortWeb_min)),ortWeb_min.exports}var models={},common={},hasRequiredCommon;function requireCommon(){return hasRequiredCommon||(hasRequiredCommon=1,Object.defineProperty(common,"__esModule",{value:!0})),common}var legacy={},hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var f;Object.defineProperty(legacy,"__esModule",{value:!0}),legacy.SileroLegacy=void 0;const r=requireLogging();class c{constructor(l,m,s,h,p){this.ortInstance=l,this._session=m,this._h=s,this._c=h,this._sr=p,this.reset_state=()=>{const a=Array(128).fill(0);this._h=new this.ortInstance.Tensor("float32",a,[2,1,64]),this._c=new this.ortInstance.Tensor("float32",a,[2,1,64])},this.process=async a=>{var u;const t={input:new this.ortInstance.Tensor("float32",a,[1,a.length]),h:this._h,c:this._c,sr:this._sr},e=await this._session.run(t);this._h=e.hn,this._c=e.cn;const[n]=(u=e.output)==null?void 0:u.data;return{notSpeech:1-n,isSpeech:n}}}}return legacy.SileroLegacy=c,f=c,c.new=async(d,l)=>{r.log.debug("initializing vad");const m=await l(),s=await d.InferenceSession.create(m),h=new d.Tensor("int64",[16000n]),p=Array(2*64).fill(0),a=new d.Tensor("float32",p,[2,1,64]),o=new d.Tensor("float32",p,[2,1,64]);return r.log.debug("vad is initialized"),new f(d,s,a,o,h)},legacy}var v5={},hasRequiredV5;function requireV5(){if(hasRequiredV5)return v5;hasRequiredV5=1;var f;Object.defineProperty(v5,"__esModule",{value:!0}),v5.SileroV5=void 0;const r=requireLogging();function c(l){const m=Array(256).fill(0);return new l.Tensor("float32",m,[2,1,128])}class d{constructor(m,s,h,p){this._session=m,this._state=s,this._sr=h,this.ortInstance=p,this.reset_state=()=>{this._state=c(this.ortInstance)},this.process=async a=>{var u;const t={input:new this.ortInstance.Tensor("float32",a,[1,a.length]),state:this._state,sr:this._sr},e=await this._session.run(t);this._state=e.stateN;const[n]=(u=e.output)==null?void 0:u.data;return{notSpeech:1-n,isSpeech:n}}}}return v5.SileroV5=d,f=d,d.new=async(l,m)=>{r.log.debug("Loading VAD...");const s=await m(),h=await l.InferenceSession.create(s),p=new l.Tensor("int64",[16000n]),a=c(l);return r.log.debug("...finished loading VAD"),new f(h,a,p,l)},v5}var hasRequiredModels;function requireModels(){return hasRequiredModels||(hasRequiredModels=1,function(f){var r=models&&models.__createBinding||(Object.create?function(m,s,h,p){p===void 0&&(p=h);var a=Object.getOwnPropertyDescriptor(s,h);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[h]}}),Object.defineProperty(m,p,a)}:function(m,s,h,p){p===void 0&&(p=h),m[p]=s[h]}),c=models&&models.__exportStar||function(m,s){for(var h in m)h!=="default"&&!Object.prototype.hasOwnProperty.call(s,h)&&r(s,m,h)};Object.defineProperty(f,"__esModule",{value:!0}),f.SileroV5=f.SileroLegacy=void 0,c(requireCommon(),f);var d=requireLegacy();Object.defineProperty(f,"SileroLegacy",{enumerable:!0,get:function(){return d.SileroLegacy}});var l=requireV5();Object.defineProperty(f,"SileroV5",{enumerable:!0,get:function(){return l.SileroV5}})}(models)),models}var resampler={},hasRequiredResampler;function requireResampler(){if(hasRequiredResampler)return resampler;hasRequiredResampler=1,Object.defineProperty(resampler,"__esModule",{value:!0}),resampler.Resampler=void 0;const f=requireLogging();class r{constructor(d){this.options=d,this.process=l=>{const m=[];for(const s of l)for(this.inputBuffer.push(s);this.hasEnoughDataForFrame();){const h=this.generateOutputFrame();m.push(h)}return m},d.nativeSampleRate<16e3&&f.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"),this.inputBuffer=[]}async*stream(d){for(const l of d)for(this.inputBuffer.push(l);this.hasEnoughDataForFrame();)yield this.generateOutputFrame()}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){const d=new Float32Array(this.options.targetFrameSize);let l=0,m=0;for(;li.modelFetcher(i.modelURL),g=await a.SileroLegacy.new(l,u),b=new h.FrameProcessor(g.process,g.reset_state,{frameSamples:i.frameSamples,positiveSpeechThreshold:i.positiveSpeechThreshold,negativeSpeechThreshold:i.negativeSpeechThreshold,redemptionFrames:i.redemptionFrames,preSpeechPadFrames:i.preSpeechPadFrames,minSpeechFrames:i.minSpeechFrames,submitUserSpeechOnPause:i.submitUserSpeechOnPause});return b.resume(),new this(u,l,i,b)}constructor(n,i,u,g){this.modelFetcher=n,this.ort=i,this.options=u,this.frameProcessor=g}async*run(n,i){const u={nativeSampleRate:i,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},g=new o.Resampler(u);let b=0,y=0,_=0,v=[];for await(const A of g.stream(n)){await this.frameProcessor.process(A,E=>{v.push(E)});for(const E of v)switch(E.msg){case p.Message.SpeechStart:b=_*this.options.frameSamples/16;break;case p.Message.SpeechEnd:y=(_+1)*this.options.frameSamples/16,yield{audio:E.audio,start:b,end:y};break}_++}const{msg:w,audio:T}=this.frameProcessor.endSegment(A=>{v.push(A)});for(const A of v)switch(A.msg){case p.Message.SpeechEnd:yield{audio:A.audio,start:b,end:_*this.options.frameSamples/16}}}}f.NonRealTimeVAD=t}(nonRealTimeVad)),nonRealTimeVad}var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1,Object.defineProperty(utils,"__esModule",{value:!0}),utils.audioFileToArray=utils.encodeWAV=utils.arrayBufferToBase64=utils.minFramesForTargetMS=void 0;function f(h,p,a=16e3){return Math.ceil(h*a/1e3/p)}utils.minFramesForTargetMS=f;function r(h){const p=new Uint8Array(h),a=p.byteLength,o=new Array(a);for(var t=0;t{a.addEventListener("loadend",i=>{const u=a.result;p.decodeAudioData(u,g=>{o=g,p.startRendering().then(b=>{console.log("Rendering completed successfully"),n()}).catch(b=>{console.error(`Rendering failed: ${b}`)})},g=>{console.log(`Error with decoding audio data: ${g}`)})}),a.readAsArrayBuffer(h)}),o===null)throw Error("some shit");let t=o,e=new Float32Array(t.length);for(let n=0;n({...b==="v5"?s.defaultV5FrameProcessorOptions:s.defaultLegacyFrameProcessorOptions,onFrameProcessed:(_,v)=>{},onVADMisfire:()=>{h.log.debug("VAD misfire")},onSpeechStart:()=>{h.log.debug("Detected speech start")},onSpeechEnd:()=>{h.log.debug("Detected speech end")},onSpeechRealStart:()=>{h.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:b,workletOptions:{}});f.getDefaultRealTimeVADOptions=i;class u{static async new(y={}){const _={...(0,f.getDefaultRealTimeVADOptions)(y.model??f.DEFAULT_MODEL),...y};(0,s.validateOptions)(_);let v;_.stream===void 0?v=await navigator.mediaDevices.getUserMedia({audio:{..._.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):v=_.stream;const w=new AudioContext,T=new MediaStreamAudioSourceNode(w,{mediaStream:v}),A=await g.new(w,_);return A.receive(T),new u(_,w,v,A,T)}constructor(y,_,v,w,T,A=!1){this.options=y,this.audioContext=_,this.stream=v,this.audioNodeVAD=w,this.sourceNode=T,this.listening=A,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(E=>E.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()},this.setOptions=E=>{this.audioNodeVAD.setFrameProcessorOptions(E)}}}f.MicVAD=u;class g{static async new(y,_={}){const v={...(0,f.getDefaultRealTimeVADOptions)(_.model??f.DEFAULT_MODEL),..._};(0,s.validateOptions)(v),f.ort.env.wasm.wasmPaths=v.onnxWASMBasePath,v.ortConfig!==void 0&&v.ortConfig(f.ort);const w=v.model==="v5"?e:n,T=v.baseAssetPath+w,A=v.model==="v5"?a.SileroV5.new:a.SileroLegacy.new;let E;try{E=await A(f.ort,()=>(0,m.defaultModelFetcher)(T))}catch(C){throw console.error(`Encountered an error while loading model file ${T}`),C}const x=new s.FrameProcessor(E.process,E.reset_state,{frameSamples:v.frameSamples,positiveSpeechThreshold:v.positiveSpeechThreshold,negativeSpeechThreshold:v.negativeSpeechThreshold,redemptionFrames:v.redemptionFrames,preSpeechPadFrames:v.preSpeechPadFrames,minSpeechFrames:v.minSpeechFrames,submitUserSpeechOnPause:v.submitUserSpeechOnPause}),M=new g(y,v,x);return await M.setupAudioNode(),M}constructor(y,_,v){this.ctx=y,this.options=_,this.bufferIndex=0,this.pause=()=>{this.frameProcessor.pause(this.handleFrameProcessorEvent)},this.start=()=>{this.frameProcessor.resume()},this.receive=w=>{w.connect(this.audioNode)},this.processFrame=async w=>{await this.frameProcessor.process(w,this.handleFrameProcessorEvent)},this.handleFrameProcessorEvent=w=>{switch(w.msg){case p.Message.FrameProcessed:this.options.onFrameProcessed(w.probs,w.frame);break;case p.Message.SpeechStart:this.options.onSpeechStart();break;case p.Message.SpeechRealStart:this.options.onSpeechRealStart();break;case p.Message.VADMisfire:this.options.onVADMisfire();break;case p.Message.SpeechEnd:this.options.onSpeechEnd(w.audio);break}},this.destroy=()=>{var w;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:p.Message.SpeechStop}),this.audioNode.disconnect(),(w=this.gainNode)==null||w.disconnect()},this.setFrameProcessorOptions=w=>{this.frameProcessor.options={...this.frameProcessor.options,...w}},this.frameProcessor=v}async setupAudioNode(){if("audioWorklet"in this.ctx&&typeof AudioWorkletNode=="function")try{const w=this.options.baseAssetPath+t;await this.ctx.audioWorklet.addModule(w);const T=this.options.workletOptions??{};T.processorOptions={...T.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,"vad-helper-worklet",T),this.audioNode.port.onmessage=async A=>{var E;switch((E=A.data)==null?void 0:E.message){case p.Message.AudioFrame:let x=A.data.data;x instanceof ArrayBuffer||(x=new ArrayBuffer(A.data.data.byteLength),new Uint8Array(x).set(new Uint8Array(A.data.data)));const M=new Float32Array(x);await this.processFrame(M);break}};return}catch(w){console.log("AudioWorklet setup failed, falling back to ScriptProcessor",w)}this.resampler=new o.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});const _=4096;this.audioNode=this.ctx.createScriptProcessor(_,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let v=!1;this.audioNode.onaudioprocess=async w=>{if(!v){v=!0;try{const T=w.inputBuffer.getChannelData(0);if(w.outputBuffer.getChannelData(0).fill(0),this.resampler){const E=this.resampler.process(T);for(const x of E)await this.processFrame(x)}}catch(T){console.error("Error processing audio:",T)}finally{v=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}}f.AudioNodeVAD=g}(realTimeVad)),realTimeVad}var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.getDefaultRealTimeVADOptions=f.MicVAD=f.DEFAULT_MODEL=f.AudioNodeVAD=f.utils=f.NonRealTimeVAD=f.Message=f.FrameProcessor=f.defaultModelFetcher=f.baseAssetPath=void 0;var r=requireAssetPath();Object.defineProperty(f,"baseAssetPath",{enumerable:!0,get:function(){return r.baseAssetPath}});var c=requireDefaultModelFetcher();Object.defineProperty(f,"defaultModelFetcher",{enumerable:!0,get:function(){return c.defaultModelFetcher}});var d=requireFrameProcessor();Object.defineProperty(f,"FrameProcessor",{enumerable:!0,get:function(){return d.FrameProcessor}});var l=requireMessages();Object.defineProperty(f,"Message",{enumerable:!0,get:function(){return l.Message}});var m=requireNonRealTimeVad();Object.defineProperty(f,"NonRealTimeVAD",{enumerable:!0,get:function(){return m.NonRealTimeVAD}});const s=requireUtils();f.utils={audioFileToArray:s.audioFileToArray,minFramesForTargetMS:s.minFramesForTargetMS,arrayBufferToBase64:s.arrayBufferToBase64,encodeWAV:s.encodeWAV};var h=requireRealTimeVad();Object.defineProperty(f,"AudioNodeVAD",{enumerable:!0,get:function(){return h.AudioNodeVAD}}),Object.defineProperty(f,"DEFAULT_MODEL",{enumerable:!0,get:function(){return h.DEFAULT_MODEL}}),Object.defineProperty(f,"MicVAD",{enumerable:!0,get:function(){return h.MicVAD}}),Object.defineProperty(f,"getDefaultRealTimeVADOptions",{enumerable:!0,get:function(){return h.getDefaultRealTimeVADOptions}})}(dist)),dist}var distExports=requireDist();/*! - * @pixiv/three-vrm-animation v3.4.1 - * The implementation of VRM Animation - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-animation is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - */var __async$1=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),VRMExpressionPresetName$1={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};new Color;new Vector2;new Vector3;new Vector3;var VRMHumanBoneParentMap$1={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function quatInvertCompat$1(f){return f.invert?f.invert():f.inverse(),f}new Vector3;new Vector3;new Vector3;new Vector3;new Vector3;new Vector3(0,1,0);var _position$1=new Vector3,_scale$1=new Vector3;function getWorldQuaternionLite$1(f,r){return f.matrixWorld.decompose(_position$1,r,_scale$1),r}function calcAzimuthAltitude$1(f){return[Math.atan2(-f.z,f.x),Math.atan2(f.y,Math.sqrt(f.x*f.x+f.z*f.z))]}function sanitizeAngle$1(f){const r=Math.round(f/2/Math.PI);return f-2*Math.PI*r}var VEC3_POSITIVE_Z$1=new Vector3(0,0,1),_v3A5$1=new Vector3,_v3B3$1=new Vector3,_v3C$1=new Vector3,_quatA5$1=new Quaternion,_quatB2$1=new Quaternion,_quatC$1=new Quaternion,_quatD$1=new Quaternion,_eulerA$1=new Euler,_VRMLookAt$1=class mn{constructor(r,c){this.offsetFromHeadBone=new Vector3,this.autoUpdate=!0,this.faceFront=new Vector3(0,0,1),this.humanoid=r,this.applier=c,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new Quaternion)}get yaw(){return this._yaw}set yaw(r){this._yaw=r,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(r){this._pitch=r,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new Euler)}getEuler(r){return r.set(MathUtils.DEG2RAD*this._pitch,MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(r){if(this.humanoid!==r.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(r.offsetFromHeadBone),this.applier=r.applier,this.autoUpdate=r.autoUpdate,this.target=r.target,this.faceFront.copy(r.faceFront),this}clone(){return new mn(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(r){const c=this.humanoid.getRawBoneNode("head");return r.copy(this.offsetFromHeadBone).applyMatrix4(c.matrixWorld)}getLookAtWorldQuaternion(r){const c=this.humanoid.getRawBoneNode("head");return getWorldQuaternionLite$1(c,r)}getFaceFrontQuaternion(r){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z$1)<.01)return r.copy(this._restHeadWorldQuaternion).invert();const[c,d]=calcAzimuthAltitude$1(this.faceFront);return _eulerA$1.set(0,.5*Math.PI+c,d,"YZX"),r.setFromEuler(_eulerA$1).premultiply(_quatD$1.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(r){return this.getLookAtWorldQuaternion(_quatB2$1),this.getFaceFrontQuaternion(_quatC$1),r.copy(VEC3_POSITIVE_Z$1).applyQuaternion(_quatB2$1).applyQuaternion(_quatC$1).applyEuler(this.getEuler(_eulerA$1))}lookAt(r){const c=_quatA5$1.copy(this._restHeadWorldQuaternion).multiply(quatInvertCompat$1(this.getLookAtWorldQuaternion(_quatB2$1))),d=this.getLookAtWorldPosition(_v3B3$1),l=_v3C$1.copy(r).sub(d).applyQuaternion(c).normalize(),[m,s]=calcAzimuthAltitude$1(this.faceFront),[h,p]=calcAzimuthAltitude$1(l),a=sanitizeAngle$1(h-m),o=sanitizeAngle$1(s-p);this._yaw=MathUtils.RAD2DEG*a,this._pitch=MathUtils.RAD2DEG*o,this._needsUpdate=!0}update(r){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_v3A5$1)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};_VRMLookAt$1.EULER_ORDER="YXZ";var VRMLookAt$1=_VRMLookAt$1;new Vector3(0,0,1);new Euler(0,0,0,"YXZ");var RAD2DEG=180/Math.PI,_eulerA3=new Euler,VRMLookAtQuaternionProxy=class extends Object3D{constructor(f){super(),this.vrmLookAt=f,this.type="VRMLookAtQuaternionProxy";const r=this.rotation._onChangeCallback;this.rotation._onChange(()=>{r(),this._applyToLookAt()});const c=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{c(),this._applyToLookAt()})}_applyToLookAt(){_eulerA3.setFromQuaternion(this.quaternion,VRMLookAt$1.EULER_ORDER),this.vrmLookAt.yaw=RAD2DEG*_eulerA3.y,this.vrmLookAt.pitch=RAD2DEG*_eulerA3.x}};function createVRMAnimationHumanoidTracks(f,r,c){var d,l;const m=new Map,s=new Map;for(const[h,p]of f.humanoidTracks.rotation.entries()){const a=(d=r.getNormalizedBoneNode(h))==null?void 0:d.name;if(a!=null){const o=new QuaternionKeyframeTrack(`${a}.quaternion`,p.times,p.values.map((t,e)=>c==="0"&&e%2===0?-t:t));s.set(h,o)}}for(const[h,p]of f.humanoidTracks.translation.entries()){const a=(l=r.getNormalizedBoneNode(h))==null?void 0:l.name;if(a!=null){const o=f.restHipsPosition.y,e=r.normalizedRestPose.hips.position[1]/o,n=p.clone();n.values=n.values.map((i,u)=>(c==="0"&&u%3!==1?-i:i)*e),n.name=`${a}.position`,m.set(h,n)}}return{translation:m,rotation:s}}function createVRMAnimationExpressionTracks(f,r){const c=new Map,d=new Map;for(const[l,m]of f.expressionTracks.preset.entries()){const s=r.getExpressionTrackName(l);if(s!=null){const h=m.clone();h.name=s,c.set(l,h)}}for(const[l,m]of f.expressionTracks.custom.entries()){const s=r.getExpressionTrackName(l);if(s!=null){const h=m.clone();h.name=s,d.set(l,h)}}return{preset:c,custom:d}}function createVRMAnimationLookAtTrack(f,r){if(f.lookAtTrack==null)return null;const c=f.lookAtTrack.clone();return c.name=r,c}function createVRMAnimationClip(f,r){const c=[],d=createVRMAnimationHumanoidTracks(f,r.humanoid,r.meta.metaVersion);if(c.push(...d.translation.values()),c.push(...d.rotation.values()),r.expressionManager!=null){const l=createVRMAnimationExpressionTracks(f,r.expressionManager);c.push(...l.preset.values()),c.push(...l.custom.values())}if(r.lookAt!=null){let l=r.scene.children.find(s=>s instanceof VRMLookAtQuaternionProxy);l==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),l=new VRMLookAtQuaternionProxy(r.lookAt),l.name="VRMLookAtQuaternionProxy",r.scene.add(l)):l.name===""&&(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually"),l.name="VRMLookAtQuaternionProxy");const m=createVRMAnimationLookAtTrack(f,`${l.name}.quaternion`);m!=null&&c.push(m)}return new AnimationClip("Clip",f.duration,c)}var VRMAnimation=class{constructor(){this.duration=0,this.restHipsPosition=new Vector3,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function arrayChunk(f,r){const c=f.length,d=[];let l=[],m=0;for(let s=0;s{const b=l.animations[g],y=this._parseAnimation(u,b,p,a);return y.restHipsPosition=e,y});f.userData.vrmAnimations=i})}_createNodeMap(f){var r,c,d,l,m;const s=new Map,h=new Map,p=(r=f.humanoid)==null?void 0:r.humanBones;p&&Object.entries(p).forEach(([e,n])=>{const i=n==null?void 0:n.node;i!=null&&s.set(i,e)});const a=(c=f.expressions)==null?void 0:c.preset;a&&Object.entries(a).forEach(([e,n])=>{const i=n==null?void 0:n.node;i!=null&&h.set(i,e)});const o=(d=f.expressions)==null?void 0:d.custom;o&&Object.entries(o).forEach(([e,n])=>{const{node:i}=n;h.set(i,e)});const t=(m=(l=f.lookAt)==null?void 0:l.node)!=null?m:null;return{humanoidIndexToName:s,expressionsIndexToName:h,lookAtIndex:t}}_createBoneWorldMatrixMap(f,r){return __async$1(this,null,function*(){var c,d;f.scene.updateWorldMatrix(!1,!0);const l=yield f.parser.getDependencies("node"),m=new Map;if(r.humanoid==null)return m;for(const[s,h]of Object.entries(r.humanoid.humanBones)){const p=h==null?void 0:h.node;if(p!=null){const a=l[p];m.set(s,a.matrixWorld),s==="hips"&&m.set("hipsParent",(d=(c=a.parent)==null?void 0:c.matrixWorld)!=null?d:MAT4_IDENTITY)}}return m})}_parseAnimation(f,r,c,d){const l=f.tracks,m=r.channels,s=new VRMAnimation;return s.duration=f.duration,m.forEach((h,p)=>{const{node:a,path:o}=h.target,t=l[p];if(a==null)return;const e=c.humanoidIndexToName.get(a);if(e!=null){let i=VRMHumanBoneParentMap$1[e];for(;i!=null&&d.get(i)==null;)i=VRMHumanBoneParentMap$1[i];if(i==null&&(i="hipsParent"),o==="translation")if(e!=="hips")console.warn(`The loading animation contains a translation track for ${e}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{const u=d.get("hipsParent"),g=arrayChunk(t.values,3).flatMap(y=>_v3A6$1.fromArray(y).applyMatrix4(u).toArray()),b=t.clone();b.values=new Float32Array(g),s.humanoidTracks.translation.set(e,b)}else if(o==="rotation"){const u=d.get(e),g=d.get(i);u.decompose(_v3A6$1,_quatA7$1,_v3A6$1),_quatA7$1.invert(),g.decompose(_v3A6$1,_quatB4$1,_v3A6$1);const b=arrayChunk(t.values,4).flatMap(_=>_quatC2$1.fromArray(_).premultiply(_quatB4$1).multiply(_quatA7$1).toArray()),y=t.clone();y.values=new Float32Array(b),s.humanoidTracks.rotation.set(e,y)}else throw new Error(`Invalid path "${o}"`);return}const n=c.expressionsIndexToName.get(a);if(n!=null){if(o==="translation"){const i=t.times,u=new Float32Array(t.values.length/3);for(let b=0;bnew Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),__async2=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),VRMExpression=class extends Object3D{constructor(f){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${f}`,this.expressionName=f,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(f){this._binds.push(f)}deleteBind(f){const r=this._binds.indexOf(f);r>=0&&this._binds.splice(r,1)}applyWeight(f){var r;let c=this.outputWeight;c*=(r=f==null?void 0:f.multiplier)!=null?r:1,this.isBinary&&c<1&&(c=0),this._binds.forEach(d=>d.applyWeight(c))}clearAppliedWeight(){this._binds.forEach(f=>f.clearAppliedWeight())}};function extractPrimitivesInternal(f,r,c){var d,l;const m=f.parser.json,s=(d=m.nodes)==null?void 0:d[r];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${r}] of glTF but the node doesn't exist`),null;const h=s.mesh;if(h==null)return null;const p=(l=m.meshes)==null?void 0:l[h];if(p==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${h}] of glTF but the mesh doesn't exist`),null;const a=p.primitives.length,o=[];return c.traverse(t=>{o.length{const m=extractPrimitivesInternal(f,l,d);m!=null&&c.set(l,m)}),c})}var VRMExpressionPresetName={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function saturate(f){return Math.max(Math.min(f,1),0)}var VRMExpressionManager=class gn{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){const r={},c=new Set(Object.values(VRMExpressionPresetName));return Object.entries(this._expressionMap).forEach(([d,l])=>{c.has(d)&&(r[d]=l)}),r}get customExpressionMap(){const r={},c=new Set(Object.values(VRMExpressionPresetName));return Object.entries(this._expressionMap).forEach(([d,l])=>{c.has(d)||(r[d]=l)}),r}copy(r){return this._expressions.concat().forEach(d=>{this.unregisterExpression(d)}),r._expressions.forEach(d=>{this.registerExpression(d)}),this.blinkExpressionNames=r.blinkExpressionNames.concat(),this.lookAtExpressionNames=r.lookAtExpressionNames.concat(),this.mouthExpressionNames=r.mouthExpressionNames.concat(),this}clone(){return new gn().copy(this)}getExpression(r){var c;return(c=this._expressionMap[r])!=null?c:null}registerExpression(r){this._expressions.push(r),this._expressionMap[r.expressionName]=r}unregisterExpression(r){const c=this._expressions.indexOf(r);c===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(c,1),delete this._expressionMap[r.expressionName]}getValue(r){var c;const d=this.getExpression(r);return(c=d==null?void 0:d.weight)!=null?c:null}setValue(r,c){const d=this.getExpression(r);d&&(d.weight=saturate(c))}resetValues(){this._expressions.forEach(r=>{r.weight=0})}getExpressionTrackName(r){const c=this.getExpression(r);return c?`${c.name}.weight`:null}update(){const r=this._calculateWeightMultipliers();this._expressions.forEach(c=>{c.clearAppliedWeight()}),this._expressions.forEach(c=>{let d=1;const l=c.expressionName;this.blinkExpressionNames.indexOf(l)!==-1&&(d*=r.blink),this.lookAtExpressionNames.indexOf(l)!==-1&&(d*=r.lookAt),this.mouthExpressionNames.indexOf(l)!==-1&&(d*=r.mouth),c.applyWeight({multiplier:d})})}_calculateWeightMultipliers(){let r=1,c=1,d=1;return this._expressions.forEach(l=>{r-=l.overrideBlinkAmount,c-=l.overrideLookAtAmount,d-=l.overrideMouthAmount}),r=Math.max(0,r),c=Math.max(0,c),d=Math.max(0,d),{blink:r,lookAt:c,mouth:d}}},VRMExpressionMaterialColorType={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",RimColor:"rimColor",OutlineColor:"outlineColor"},v0ExpressionMaterialColorMap={_Color:VRMExpressionMaterialColorType.Color,_EmissionColor:VRMExpressionMaterialColorType.EmissionColor,_ShadeColor:VRMExpressionMaterialColorType.ShadeColor,_RimColor:VRMExpressionMaterialColorType.RimColor,_OutlineColor:VRMExpressionMaterialColorType.OutlineColor},_color=new Color,_VRMExpressionMaterialColorBind=class bn{constructor({material:r,type:c,targetValue:d,targetAlpha:l}){this.material=r,this.type=c,this.targetValue=d,this.targetAlpha=l??1;const m=this._initColorBindState(),s=this._initAlphaBindState();this._state={color:m,alpha:s}}applyWeight(r){const{color:c,alpha:d}=this._state;if(c!=null){const{propertyName:l,deltaValue:m}=c,s=this.material[l];s!=null&&s.add(_color.copy(m).multiplyScalar(r))}if(d!=null){const{propertyName:l,deltaValue:m}=d;this.material[l]!=null&&(this.material[l]+=m*r)}}clearAppliedWeight(){const{color:r,alpha:c}=this._state;if(r!=null){const{propertyName:d,initialValue:l}=r,m=this.material[d];m!=null&&m.copy(l)}if(c!=null){const{propertyName:d,initialValue:l}=c;this.material[d]!=null&&(this.material[d]=l)}}_initColorBindState(){var r,c,d;const{material:l,type:m,targetValue:s}=this,h=this._getPropertyNameMap(),p=(c=(r=h==null?void 0:h[m])==null?void 0:r[0])!=null?c:null;if(p==null)return console.warn(`Tried to add a material color bind to the material ${(d=l.name)!=null?d:"(no name)"}, the type ${m} but the material or the type is not supported.`),null;const o=l[p].clone(),t=new Color(s.r-o.r,s.g-o.g,s.b-o.b);return{propertyName:p,initialValue:o,deltaValue:t}}_initAlphaBindState(){var r,c,d;const{material:l,type:m,targetAlpha:s}=this,h=this._getPropertyNameMap(),p=(c=(r=h==null?void 0:h[m])==null?void 0:r[1])!=null?c:null;if(p==null&&s!==1)return console.warn(`Tried to add a material alpha bind to the material ${(d=l.name)!=null?d:"(no name)"}, the type ${m} but the material or the type does not support alpha.`),null;if(p==null)return null;const a=l[p],o=s-a;return{propertyName:p,initialValue:a,deltaValue:o}}_getPropertyNameMap(){var r,c;return(c=(r=Object.entries(bn._propertyNameMapMap).find(([d])=>this.material[d]===!0))==null?void 0:r[1])!=null?c:null}};_VRMExpressionMaterialColorBind._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var VRMExpressionMaterialColorBind=_VRMExpressionMaterialColorBind,VRMExpressionMorphTargetBind=class{constructor({primitives:f,index:r,weight:c}){this.primitives=f,this.index=r,this.weight=c}applyWeight(f){this.primitives.forEach(r=>{var c;((c=r.morphTargetInfluences)==null?void 0:c[this.index])!=null&&(r.morphTargetInfluences[this.index]+=this.weight*f)})}clearAppliedWeight(){this.primitives.forEach(f=>{var r;((r=f.morphTargetInfluences)==null?void 0:r[this.index])!=null&&(f.morphTargetInfluences[this.index]=0)})}},_v2=new Vector2,_VRMExpressionTextureTransformBind=class yn{constructor({material:r,scale:c,offset:d}){var l,m;this.material=r,this.scale=c,this.offset=d;const s=(l=Object.entries(yn._propertyNamesMap).find(([h])=>r[h]===!0))==null?void 0:l[1];s==null?(console.warn(`Tried to add a texture transform bind to the material ${(m=r.name)!=null?m:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],s.forEach(h=>{var p;const a=(p=r[h])==null?void 0:p.clone();if(!a)return null;r[h]=a;const o=a.offset.clone(),t=a.repeat.clone(),e=d.clone().sub(o),n=c.clone().sub(t);this._properties.push({name:h,initialOffset:o,deltaOffset:e,initialScale:t,deltaScale:n})}))}applyWeight(r){this._properties.forEach(c=>{const d=this.material[c.name];d!==void 0&&(d.offset.add(_v2.copy(c.deltaOffset).multiplyScalar(r)),d.repeat.add(_v2.copy(c.deltaScale).multiplyScalar(r)))})}clearAppliedWeight(){this._properties.forEach(r=>{const c=this.material[r.name];c!==void 0&&(c.offset.copy(r.initialOffset),c.repeat.copy(r.initialScale))})}};_VRMExpressionTextureTransformBind._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var VRMExpressionTextureTransformBind=_VRMExpressionTextureTransformBind,POSSIBLE_SPEC_VERSIONS=new Set(["1.0","1.0-beta"]),_VRMExpressionLoaderPlugin=class _n{get name(){return"VRMExpressionLoaderPlugin"}constructor(r){this.parser=r}afterRoot(r){return __async2(this,null,function*(){r.userData.vrmExpressionManager=yield this._import(r)})}_import(r){return __async2(this,null,function*(){const c=yield this._v1Import(r);if(c)return c;const d=yield this._v0Import(r);return d||null})}_v1Import(r){return __async2(this,null,function*(){var c,d;const l=this.parser.json;if(!(((c=l.extensionsUsed)==null?void 0:c.indexOf("VRMC_vrm"))!==-1))return null;const s=(d=l.extensions)==null?void 0:d.VRMC_vrm;if(!s)return null;const h=s.specVersion;if(!POSSIBLE_SPEC_VERSIONS.has(h))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${h}"`),null;const p=s.expressions;if(!p)return null;const a=new Set(Object.values(VRMExpressionPresetName)),o=new Map;p.preset!=null&&Object.entries(p.preset).forEach(([e,n])=>{if(n!=null){if(!a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${e}" detected. Ignoring the expression`);return}o.set(e,n)}}),p.custom!=null&&Object.entries(p.custom).forEach(([e,n])=>{if(a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${e}". Ignoring the expression`);return}o.set(e,n)});const t=new VRMExpressionManager;return yield Promise.all(Array.from(o.entries()).map(e=>__async2(this,[e],function*([n,i]){var u,g,b,y,_,v,w;const T=new VRMExpression(n);if(r.scene.add(T),T.isBinary=(u=i.isBinary)!=null?u:!1,T.overrideBlink=(g=i.overrideBlink)!=null?g:"none",T.overrideLookAt=(b=i.overrideLookAt)!=null?b:"none",T.overrideMouth=(y=i.overrideMouth)!=null?y:"none",(_=i.morphTargetBinds)==null||_.forEach(A=>__async2(this,null,function*(){var E;if(A.node===void 0||A.index===void 0)return;const x=yield gltfExtractPrimitivesFromNode(r,A.node),M=A.index;if(!x.every(C=>Array.isArray(C.morphTargetInfluences)&&M{const x=E.material;x&&(Array.isArray(x)?A.push(...x):A.push(x))}),(v=i.materialColorBinds)==null||v.forEach(E=>__async2(this,null,function*(){A.filter(M=>{var C;const k=(C=this.parser.associations.get(M))==null?void 0:C.materials;return E.material===k}).forEach(M=>{T.addBind(new VRMExpressionMaterialColorBind({material:M,type:E.type,targetValue:new Color().fromArray(E.targetValue),targetAlpha:E.targetValue[3]}))})})),(w=i.textureTransformBinds)==null||w.forEach(E=>__async2(this,null,function*(){A.filter(M=>{var C;const k=(C=this.parser.associations.get(M))==null?void 0:C.materials;return E.material===k}).forEach(M=>{var C,k;T.addBind(new VRMExpressionTextureTransformBind({material:M,offset:new Vector2().fromArray((C=E.offset)!=null?C:[0,0]),scale:new Vector2().fromArray((k=E.scale)!=null?k:[1,1])}))})}))}t.registerExpression(T)}))),t})}_v0Import(r){return __async2(this,null,function*(){var c;const d=this.parser.json,l=(c=d.extensions)==null?void 0:c.VRM;if(!l)return null;const m=l.blendShapeMaster;if(!m)return null;const s=new VRMExpressionManager,h=m.blendShapeGroups;if(!h)return s;const p=new Set;return yield Promise.all(h.map(a=>__async2(this,null,function*(){var o;const t=a.presetName,e=t!=null&&_n.v0v1PresetNameMap[t]||null,n=e??a.name;if(n==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(p.has(n)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${t} has duplicated entries. Ignoring the expression`);return}p.add(n);const i=new VRMExpression(n);r.scene.add(i),i.isBinary=(o=a.isBinary)!=null?o:!1,a.binds&&a.binds.forEach(g=>__async2(this,null,function*(){var b;if(g.mesh===void 0||g.index===void 0)return;const y=[];(b=d.nodes)==null||b.forEach((v,w)=>{v.mesh===g.mesh&&y.push(w)});const _=g.index;yield Promise.all(y.map(v=>__async2(this,null,function*(){var w;const T=yield gltfExtractPrimitivesFromNode(r,v);if(!T.every(A=>Array.isArray(A.morphTargetInfluences)&&_{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;const b=[];r.scene.traverse(_=>{if(_.material){const v=_.material;Array.isArray(v)?b.push(...v.filter(w=>(w.name===g.materialName||w.name===g.materialName+" (Outline)")&&b.indexOf(w)===-1)):v.name===g.materialName&&b.indexOf(v)===-1&&b.push(v)}});const y=g.propertyName;b.forEach(_=>{if(y==="_MainTex_ST"){const w=new Vector2(g.targetValue[0],g.targetValue[1]),T=new Vector2(g.targetValue[2],g.targetValue[3]);T.y=1-T.y-w.y,i.addBind(new VRMExpressionTextureTransformBind({material:_,scale:w,offset:T}));return}const v=v0ExpressionMaterialColorMap[y];if(v){i.addBind(new VRMExpressionMaterialColorBind({material:_,type:v,targetValue:new Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(y+" is not supported")})}),s.registerExpression(i)}))),s})}};_VRMExpressionLoaderPlugin.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var VRMExpressionLoaderPlugin=_VRMExpressionLoaderPlugin,_VRMFirstPerson=class Mt{constructor(r,c){this._firstPersonOnlyLayer=Mt.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=Mt.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=r,this.meshAnnotations=c}copy(r){if(this.humanoid!==r.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=r.meshAnnotations.map(c=>({meshes:c.meshes.concat(),type:c.type})),this}clone(){return new Mt(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:r=Mt.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:c=Mt.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=r,this._thirdPersonOnlyLayer=c,this.meshAnnotations.forEach(d=>{d.meshes.forEach(l=>{d.type==="firstPersonOnly"?(l.layers.set(this._firstPersonOnlyLayer),l.traverse(m=>m.layers.set(this._firstPersonOnlyLayer))):d.type==="thirdPersonOnly"?(l.layers.set(this._thirdPersonOnlyLayer),l.traverse(m=>m.layers.set(this._thirdPersonOnlyLayer))):d.type==="auto"&&this._createHeadlessModel(l)})}),this._initializedLayers=!0)}_excludeTriangles(r,c,d,l){let m=0;if(c!=null&&c.length>0)for(let s=0;s0&&l.includes(t[0])||o[1]>0&&l.includes(t[1])||o[2]>0&&l.includes(t[2])||o[3]>0&&l.includes(t[3]))continue;const e=c[p],n=d[p];if(e[0]>0&&l.includes(n[0])||e[1]>0&&l.includes(n[1])||e[2]>0&&l.includes(n[2])||e[3]>0&&l.includes(n[3]))continue;const i=c[a],u=d[a];i[0]>0&&l.includes(u[0])||i[1]>0&&l.includes(u[1])||i[2]>0&&l.includes(u[2])||i[3]>0&&l.includes(u[3])||(r[m++]=h,r[m++]=p,r[m++]=a)}return m}_createErasedMesh(r,c){const d=new SkinnedMesh(r.geometry.clone(),r.material);d.name=`${r.name}(erase)`,d.frustumCulled=r.frustumCulled,d.layers.set(this._firstPersonOnlyLayer);const l=d.geometry,m=l.getAttribute("skinIndex"),s=m instanceof GLBufferAttribute?[]:m.array,h=[];for(let u=0;u{this._isEraseTarget(m)&&d.push(s)}),!d.length){c.layers.enable(this._thirdPersonOnlyLayer),c.layers.enable(this._firstPersonOnlyLayer);return}c.layers.set(this._thirdPersonOnlyLayer);const l=this._createErasedMesh(c,d);r.add(l)}_createHeadlessModel(r){if(r.type==="Group")if(r.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(r))r.traverse(c=>c.layers.set(this._thirdPersonOnlyLayer));else{const c=new Group;c.name=`_headless_${r.name}`,c.layers.set(this._firstPersonOnlyLayer),r.parent.add(c),r.children.filter(d=>d.type==="SkinnedMesh").forEach(d=>{const l=d;this._createHeadlessModelForSkinnedMesh(c,l)})}else if(r.type==="SkinnedMesh"){const c=r;this._createHeadlessModelForSkinnedMesh(r.parent,c)}else this._isEraseTarget(r)&&(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(c=>c.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(r){return r===this.humanoid.getRawBoneNode("head")?!0:r.parent?this._isEraseTarget(r.parent):!1}};_VRMFirstPerson.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;_VRMFirstPerson.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var VRMFirstPerson=_VRMFirstPerson,POSSIBLE_SPEC_VERSIONS2=new Set(["1.0","1.0-beta"]),VRMFirstPersonLoaderPlugin=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(f){this.parser=f}afterRoot(f){return __async2(this,null,function*(){const r=f.userData.vrmHumanoid;if(r!==null){if(r===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");f.userData.vrmFirstPerson=yield this._import(f,r)}})}_import(f,r){return __async2(this,null,function*(){if(r==null)return null;const c=yield this._v1Import(f,r);if(c)return c;const d=yield this._v0Import(f,r);return d||null})}_v1Import(f,r){return __async2(this,null,function*(){var c,d;const l=this.parser.json;if(!(((c=l.extensionsUsed)==null?void 0:c.indexOf("VRMC_vrm"))!==-1))return null;const s=(d=l.extensions)==null?void 0:d.VRMC_vrm;if(!s)return null;const h=s.specVersion;if(!POSSIBLE_SPEC_VERSIONS2.has(h))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${h}"`),null;const p=s.firstPerson,a=[],o=yield gltfExtractPrimitivesFromNodes(f);return Array.from(o.entries()).forEach(([t,e])=>{var n,i;const u=(n=p==null?void 0:p.meshAnnotations)==null?void 0:n.find(g=>g.node===t);a.push({meshes:e,type:(i=u==null?void 0:u.type)!=null?i:"auto"})}),new VRMFirstPerson(r,a)})}_v0Import(f,r){return __async2(this,null,function*(){var c;const d=this.parser.json,l=(c=d.extensions)==null?void 0:c.VRM;if(!l)return null;const m=l.firstPerson;if(!m)return null;const s=[],h=yield gltfExtractPrimitivesFromNodes(f);return Array.from(h.entries()).forEach(([p,a])=>{const o=d.nodes[p],t=m.meshAnnotations?m.meshAnnotations.find(e=>e.mesh===o.mesh):void 0;s.push({meshes:a,type:this._convertV0FlagToV1Type(t==null?void 0:t.firstPersonFlag)})}),new VRMFirstPerson(r,s)})}_convertV0FlagToV1Type(f){return f==="FirstPersonOnly"?"firstPersonOnly":f==="ThirdPersonOnly"?"thirdPersonOnly":f==="Both"?"both":"auto"}},_v3A=new Vector3,_v3B=new Vector3,_quatA=new Quaternion,VRMHumanoidHelper=class extends Group{constructor(f){super(),this.vrmHumanoid=f,this._boneAxesMap=new Map,Object.values(f.humanBones).forEach(r=>{const c=new AxesHelper(1);c.matrixAutoUpdate=!1,c.material.depthTest=!1,c.material.depthWrite=!1,this.add(c),this._boneAxesMap.set(r,c)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(f=>{f.geometry.dispose(),f.material.dispose()})}updateMatrixWorld(f){Array.from(this._boneAxesMap.entries()).forEach(([r,c])=>{r.node.updateWorldMatrix(!0,!1),r.node.matrixWorld.decompose(_v3A,_quatA,_v3B);const d=_v3A.set(.1,.1,.1).divide(_v3B);c.matrix.copy(r.node.matrixWorld).scale(d)}),super.updateMatrixWorld(f)}},VRMHumanBoneList=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"],VRMHumanBoneParentMap={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function quatInvertCompat(f){return f.invert?f.invert():f.inverse(),f}var _v3A2=new Vector3,_quatA2=new Quaternion,VRMRig=class{constructor(f){this.humanBones=f,this.restPose=this.getAbsolutePose()}getAbsolutePose(){const f={};return Object.keys(this.humanBones).forEach(r=>{const c=r,d=this.getBoneNode(c);d&&(_v3A2.copy(d.position),_quatA2.copy(d.quaternion),f[c]={position:_v3A2.toArray(),rotation:_quatA2.toArray()})}),f}getPose(){const f={};return Object.keys(this.humanBones).forEach(r=>{const c=r,d=this.getBoneNode(c);if(!d)return;_v3A2.set(0,0,0),_quatA2.identity();const l=this.restPose[c];l!=null&&l.position&&_v3A2.fromArray(l.position).negate(),l!=null&&l.rotation&&quatInvertCompat(_quatA2.fromArray(l.rotation)),_v3A2.add(d.position),_quatA2.premultiply(d.quaternion),f[c]={position:_v3A2.toArray(),rotation:_quatA2.toArray()}}),f}setPose(f){Object.entries(f).forEach(([r,c])=>{const d=r,l=this.getBoneNode(d);if(!l)return;const m=this.restPose[d];m&&(c!=null&&c.position&&(l.position.fromArray(c.position),m.position&&l.position.add(_v3A2.fromArray(m.position))),c!=null&&c.rotation&&(l.quaternion.fromArray(c.rotation),m.rotation&&l.quaternion.multiply(_quatA2.fromArray(m.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([f,r])=>{const c=this.getBoneNode(f);c&&(r!=null&&r.position&&c.position.fromArray(r.position),r!=null&&r.rotation&&c.quaternion.fromArray(r.rotation))})}getBone(f){var r;return(r=this.humanBones[f])!=null?r:void 0}getBoneNode(f){var r,c;return(c=(r=this.humanBones[f])==null?void 0:r.node)!=null?c:null}},_v3A3=new Vector3,_quatA3=new Quaternion,_boneWorldPos=new Vector3,VRMHumanoidRig=class vn extends VRMRig{static _setupTransforms(r){const c=new Object3D;c.name="VRMHumanoidRig";const d={},l={},m={};VRMHumanBoneList.forEach(h=>{var p;const a=r.getBoneNode(h);if(a){const o=new Vector3,t=new Quaternion;a.updateWorldMatrix(!0,!1),a.matrixWorld.decompose(o,t,_v3A3),d[h]=o,l[h]=a.quaternion.clone();const e=new Quaternion;(p=a.parent)==null||p.matrixWorld.decompose(_v3A3,e,_v3A3),m[h]=e}});const s={};return VRMHumanBoneList.forEach(h=>{var p;const a=r.getBoneNode(h);if(a){const o=d[h];let t=h,e;for(;e==null&&(t=VRMHumanBoneParentMap[t],t!=null);)e=d[t];const n=new Object3D;n.name="Normalized_"+a.name,(t?(p=s[t])==null?void 0:p.node:c).add(n),n.position.copy(o),e&&n.position.sub(e),s[h]={node:n}}}),{rigBones:s,root:c,parentWorldRotations:m,boneRotations:l}}constructor(r){const{rigBones:c,root:d,parentWorldRotations:l,boneRotations:m}=vn._setupTransforms(r);super(c),this.original=r,this.root=d,this._parentWorldRotations=l,this._boneRotations=m}update(){VRMHumanBoneList.forEach(r=>{const c=this.original.getBoneNode(r);if(c!=null){const d=this.getBoneNode(r),l=this._parentWorldRotations[r],m=_quatA3.copy(l).invert(),s=this._boneRotations[r];if(c.quaternion.copy(d.quaternion).multiply(l).premultiply(m).multiply(s),r==="hips"){const h=d.getWorldPosition(_boneWorldPos);c.parent.updateWorldMatrix(!0,!1);const p=c.parent.matrixWorld,a=h.applyMatrix4(p.invert());c.position.copy(a)}}})}},VRMHumanoid=class wn{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(r,c){var d;this.autoUpdateHumanBones=(d=c==null?void 0:c.autoUpdateHumanBones)!=null?d:!0,this._rawHumanBones=new VRMRig(r),this._normalizedHumanBones=new VRMHumanoidRig(this._rawHumanBones)}copy(r){return this.autoUpdateHumanBones=r.autoUpdateHumanBones,this._rawHumanBones=new VRMRig(r.humanBones),this._normalizedHumanBones=new VRMHumanoidRig(this._rawHumanBones),this}clone(){return new wn(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(r){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(r)}setRawPose(r){return this._rawHumanBones.setPose(r)}setNormalizedPose(r){return this._normalizedHumanBones.setPose(r)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(r){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(r)}getRawBone(r){return this._rawHumanBones.getBone(r)}getNormalizedBone(r){return this._normalizedHumanBones.getBone(r)}getBoneNode(r){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(r)}getRawBoneNode(r){return this._rawHumanBones.getBoneNode(r)}getNormalizedBoneNode(r){return this._normalizedHumanBones.getBoneNode(r)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},VRMRequiredHumanBoneName={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"},POSSIBLE_SPEC_VERSIONS3=new Set(["1.0","1.0-beta"]),thumbBoneNameMap={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},VRMHumanoidLoaderPlugin=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(f,r){this.parser=f,this.helperRoot=r==null?void 0:r.helperRoot,this.autoUpdateHumanBones=r==null?void 0:r.autoUpdateHumanBones}afterRoot(f){return __async2(this,null,function*(){f.userData.vrmHumanoid=yield this._import(f)})}_import(f){return __async2(this,null,function*(){const r=yield this._v1Import(f);if(r)return r;const c=yield this._v0Import(f);return c||null})}_v1Import(f){return __async2(this,null,function*(){var r,c;const d=this.parser.json;if(!(((r=d.extensionsUsed)==null?void 0:r.indexOf("VRMC_vrm"))!==-1))return null;const m=(c=d.extensions)==null?void 0:c.VRMC_vrm;if(!m)return null;const s=m.specVersion;if(!POSSIBLE_SPEC_VERSIONS3.has(s))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${s}"`),null;const h=m.humanoid;if(!h)return null;const p=h.humanBones.leftThumbIntermediate!=null||h.humanBones.rightThumbIntermediate!=null,a={};h.humanBones!=null&&(yield Promise.all(Object.entries(h.humanBones).map(t=>__async2(this,[t],function*([e,n]){let i=e;const u=n.node;if(p){const b=thumbBoneNameMap[i];b!=null&&(i=b)}const g=yield this.parser.getDependency("node",u);if(g==null){console.warn(`A glTF node bound to the humanoid bone ${i} (index = ${u}) does not exist`);return}a[i]={node:g}}))));const o=new VRMHumanoid(this._ensureRequiredBonesExist(a),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(f.scene.add(o.normalizedHumanBonesRoot),this.helperRoot){const t=new VRMHumanoidHelper(o);this.helperRoot.add(t),t.renderOrder=this.helperRoot.renderOrder}return o})}_v0Import(f){return __async2(this,null,function*(){var r;const d=(r=this.parser.json.extensions)==null?void 0:r.VRM;if(!d)return null;const l=d.humanoid;if(!l)return null;const m={};l.humanBones!=null&&(yield Promise.all(l.humanBones.map(h=>__async2(this,null,function*(){const p=h.bone,a=h.node;if(p==null||a==null)return;const o=yield this.parser.getDependency("node",a);if(o==null){console.warn(`A glTF node bound to the humanoid bone ${p} (index = ${a}) does not exist`);return}const t=thumbBoneNameMap[p],e=t??p;if(m[e]!=null){console.warn(`Multiple bone entries for ${e} detected (index = ${a}), ignoring duplicated entries.`);return}m[e]={node:o}}))));const s=new VRMHumanoid(this._ensureRequiredBonesExist(m),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(f.scene.add(s.normalizedHumanBonesRoot),this.helperRoot){const h=new VRMHumanoidHelper(s);this.helperRoot.add(h),h.renderOrder=this.helperRoot.renderOrder}return s})}_ensureRequiredBonesExist(f){const r=Object.values(VRMRequiredHumanBoneName).filter(c=>f[c]==null);if(r.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${r.join(", ")}`);return f}},FanBufferGeometry=class extends BufferGeometry{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,f=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,f=!0),f&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let f=0;f<64;f++){const r=f/63*this._currentTheta;this._attrPos.setXYZ(f+1,this._currentRadius*Math.sin(r),0,this._currentRadius*Math.cos(r))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<63;f++)this._attrIndex.setXYZ(f*3,0,f+1,f+2);this._attrIndex.needsUpdate=!0}},LineAndSphereBufferGeometry=class extends BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new Vector3,this._currentTail=new Vector3,this._attrPos=new BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,f=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),f=!0),f&&this._buildPosition()}_buildPosition(){for(let f=0;f<32;f++){const r=f/16*Math.PI;this._attrPos.setXYZ(f,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+f,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+f,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<32;f++){const r=(f+1)%32;this._attrIndex.setXY(f*2,f,r),this._attrIndex.setXY(64+f*2,32+f,32+r),this._attrIndex.setXY(128+f*2,64+f,64+r)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},_quatA4=new Quaternion,_quatB=new Quaternion,_v3A4=new Vector3,_v3B2=new Vector3,SQRT_2_OVER_2=Math.sqrt(2)/2,QUAT_XY_CW90=new Quaternion(0,0,-SQRT_2_OVER_2,SQRT_2_OVER_2),VEC3_POSITIVE_Y=new Vector3(0,1,0),VRMLookAtHelper=class extends Group{constructor(f){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=f;{const r=new FanBufferGeometry;r.radius=.5;const c=new MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new Mesh(r,c),this.add(this._meshPitch)}{const r=new FanBufferGeometry;r.radius=.5;const c=new MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new Mesh(r,c),this.add(this._meshYaw)}{const r=new LineAndSphereBufferGeometry;r.radius=.1;const c=new LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new LineSegments(r,c),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(f){const r=MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=r,this._meshYaw.geometry.update();const c=MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=c,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(_v3A4),this.vrmLookAt.getLookAtWorldQuaternion(_quatA4),_quatA4.multiply(this.vrmLookAt.getFaceFrontQuaternion(_quatB)),this._meshYaw.position.copy(_v3A4),this._meshYaw.quaternion.copy(_quatA4),this._meshPitch.position.copy(_v3A4),this._meshPitch.quaternion.copy(_quatA4),this._meshPitch.quaternion.multiply(_quatB.setFromAxisAngle(VEC3_POSITIVE_Y,r)),this._meshPitch.quaternion.multiply(QUAT_XY_CW90);const{target:d,autoUpdate:l}=this.vrmLookAt;d!=null&&l&&(d.getWorldPosition(_v3B2).sub(_v3A4),this._lineTarget.geometry.tail.copy(_v3B2),this._lineTarget.geometry.update(),this._lineTarget.position.copy(_v3A4)),super.updateMatrixWorld(f)}},_position=new Vector3,_scale=new Vector3;function getWorldQuaternionLite(f,r){return f.matrixWorld.decompose(_position,r,_scale),r}function calcAzimuthAltitude(f){return[Math.atan2(-f.z,f.x),Math.atan2(f.y,Math.sqrt(f.x*f.x+f.z*f.z))]}function sanitizeAngle(f){const r=Math.round(f/2/Math.PI);return f-2*Math.PI*r}var VEC3_POSITIVE_Z=new Vector3(0,0,1),_v3A5=new Vector3,_v3B3=new Vector3,_v3C=new Vector3,_quatA5=new Quaternion,_quatB2=new Quaternion,_quatC=new Quaternion,_quatD=new Quaternion,_eulerA=new Euler,_VRMLookAt=class xn{constructor(r,c){this.offsetFromHeadBone=new Vector3,this.autoUpdate=!0,this.faceFront=new Vector3(0,0,1),this.humanoid=r,this.applier=c,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new Quaternion)}get yaw(){return this._yaw}set yaw(r){this._yaw=r,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(r){this._pitch=r,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new Euler)}getEuler(r){return r.set(MathUtils.DEG2RAD*this._pitch,MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(r){if(this.humanoid!==r.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(r.offsetFromHeadBone),this.applier=r.applier,this.autoUpdate=r.autoUpdate,this.target=r.target,this.faceFront.copy(r.faceFront),this}clone(){return new xn(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(r){const c=this.humanoid.getRawBoneNode("head");return r.copy(this.offsetFromHeadBone).applyMatrix4(c.matrixWorld)}getLookAtWorldQuaternion(r){const c=this.humanoid.getRawBoneNode("head");return getWorldQuaternionLite(c,r)}getFaceFrontQuaternion(r){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z)<.01)return r.copy(this._restHeadWorldQuaternion).invert();const[c,d]=calcAzimuthAltitude(this.faceFront);return _eulerA.set(0,.5*Math.PI+c,d,"YZX"),r.setFromEuler(_eulerA).premultiply(_quatD.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(r){return this.getLookAtWorldQuaternion(_quatB2),this.getFaceFrontQuaternion(_quatC),r.copy(VEC3_POSITIVE_Z).applyQuaternion(_quatB2).applyQuaternion(_quatC).applyEuler(this.getEuler(_eulerA))}lookAt(r){const c=_quatA5.copy(this._restHeadWorldQuaternion).multiply(quatInvertCompat(this.getLookAtWorldQuaternion(_quatB2))),d=this.getLookAtWorldPosition(_v3B3),l=_v3C.copy(r).sub(d).applyQuaternion(c).normalize(),[m,s]=calcAzimuthAltitude(this.faceFront),[h,p]=calcAzimuthAltitude(l),a=sanitizeAngle(h-m),o=sanitizeAngle(s-p);this._yaw=MathUtils.RAD2DEG*a,this._pitch=MathUtils.RAD2DEG*o,this._needsUpdate=!0}update(r){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_v3A5)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};_VRMLookAt.EULER_ORDER="YXZ";var VRMLookAt=_VRMLookAt,VEC3_POSITIVE_Z2=new Vector3(0,0,1),_quatA6=new Quaternion,_quatB3=new Quaternion,_eulerA2=new Euler(0,0,0,"YXZ"),VRMLookAtBoneApplier=class{constructor(f,r,c,d,l){this.humanoid=f,this.rangeMapHorizontalInner=r,this.rangeMapHorizontalOuter=c,this.rangeMapVerticalDown=d,this.rangeMapVerticalUp=l,this.faceFront=new Vector3(0,0,1),this._restQuatLeftEye=new Quaternion,this._restQuatRightEye=new Quaternion,this._restLeftEyeParentWorldQuat=new Quaternion,this._restRightEyeParentWorldQuat=new Quaternion;const m=this.humanoid.getRawBoneNode("leftEye"),s=this.humanoid.getRawBoneNode("rightEye");m&&(this._restQuatLeftEye.copy(m.quaternion),getWorldQuaternionLite(m.parent,this._restLeftEyeParentWorldQuat)),s&&(this._restQuatRightEye.copy(s.quaternion),getWorldQuaternionLite(s.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(f,r){const c=this.humanoid.getRawBoneNode("leftEye"),d=this.humanoid.getRawBoneNode("rightEye"),l=this.humanoid.getNormalizedBoneNode("leftEye"),m=this.humanoid.getNormalizedBoneNode("rightEye");c&&(r<0?_eulerA2.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-r):_eulerA2.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(r),f<0?_eulerA2.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-f):_eulerA2.y=MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(f),_quatA6.setFromEuler(_eulerA2),this._getWorldFaceFrontQuat(_quatB3),l.quaternion.copy(_quatB3).multiply(_quatA6).multiply(_quatB3.invert()),_quatA6.copy(this._restLeftEyeParentWorldQuat),c.quaternion.copy(l.quaternion).multiply(_quatA6).premultiply(_quatA6.invert()).multiply(this._restQuatLeftEye)),d&&(r<0?_eulerA2.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-r):_eulerA2.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(r),f<0?_eulerA2.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-f):_eulerA2.y=MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(f),_quatA6.setFromEuler(_eulerA2),this._getWorldFaceFrontQuat(_quatB3),m.quaternion.copy(_quatB3).multiply(_quatA6).multiply(_quatB3.invert()),_quatA6.copy(this._restRightEyeParentWorldQuat),d.quaternion.copy(m.quaternion).multiply(_quatA6).premultiply(_quatA6.invert()).multiply(this._restQuatRightEye))}lookAt(f){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const r=MathUtils.RAD2DEG*f.y,c=MathUtils.RAD2DEG*f.x;this.applyYawPitch(r,c)}_getWorldFaceFrontQuat(f){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z2)<.01)return f.identity();const[r,c]=calcAzimuthAltitude(this.faceFront);return _eulerA2.set(0,.5*Math.PI+r,c,"YZX"),f.setFromEuler(_eulerA2)}};VRMLookAtBoneApplier.type="bone";var VRMLookAtExpressionApplier=class{constructor(f,r,c,d,l){this.expressions=f,this.rangeMapHorizontalInner=r,this.rangeMapHorizontalOuter=c,this.rangeMapVerticalDown=d,this.rangeMapVerticalUp=l}applyYawPitch(f,r){r<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-r))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(r))),f<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-f))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(f)))}lookAt(f){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const r=MathUtils.RAD2DEG*f.y,c=MathUtils.RAD2DEG*f.x;this.applyYawPitch(r,c)}};VRMLookAtExpressionApplier.type="expression";var VRMLookAtRangeMap=class{constructor(f,r){this.inputMaxValue=f,this.outputScale=r}map(f){return this.outputScale*saturate(f/this.inputMaxValue)}},POSSIBLE_SPEC_VERSIONS4=new Set(["1.0","1.0-beta"]),INPUT_MAX_VALUE_MINIMUM=.01,VRMLookAtLoaderPlugin=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(f,r){this.parser=f,this.helperRoot=r==null?void 0:r.helperRoot}afterRoot(f){return __async2(this,null,function*(){const r=f.userData.vrmHumanoid;if(r===null)return;if(r===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");const c=f.userData.vrmExpressionManager;if(c!==null){if(c===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");f.userData.vrmLookAt=yield this._import(f,r,c)}})}_import(f,r,c){return __async2(this,null,function*(){if(r==null||c==null)return null;const d=yield this._v1Import(f,r,c);if(d)return d;const l=yield this._v0Import(f,r,c);return l||null})}_v1Import(f,r,c){return __async2(this,null,function*(){var d,l,m;const s=this.parser.json;if(!(((d=s.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;const p=(l=s.extensions)==null?void 0:l.VRMC_vrm;if(!p)return null;const a=p.specVersion;if(!POSSIBLE_SPEC_VERSIONS4.has(a))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;const o=p.lookAt;if(!o)return null;const t=o.type==="expression"?1:10,e=this._v1ImportRangeMap(o.rangeMapHorizontalInner,t),n=this._v1ImportRangeMap(o.rangeMapHorizontalOuter,t),i=this._v1ImportRangeMap(o.rangeMapVerticalDown,t),u=this._v1ImportRangeMap(o.rangeMapVerticalUp,t);let g;o.type==="expression"?g=new VRMLookAtExpressionApplier(c,e,n,i,u):g=new VRMLookAtBoneApplier(r,e,n,i,u);const b=this._importLookAt(r,g);return b.offsetFromHeadBone.fromArray((m=o.offsetFromHeadBone)!=null?m:[0,.06,0]),b})}_v1ImportRangeMap(f,r){var c,d;let l=(c=f==null?void 0:f.inputMaxValue)!=null?c:90;const m=(d=f==null?void 0:f.outputScale)!=null?d:r;return l(console.error(s),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},VRMCore=class{constructor(f){this.scene=f.scene,this.meta=f.meta,this.humanoid=f.humanoid,this.expressionManager=f.expressionManager,this.firstPerson=f.firstPerson,this.lookAt=f.lookAt}update(f){this.humanoid.update(),this.lookAt&&this.lookAt.update(f),this.expressionManager&&this.expressionManager.update()}},VRM=class extends VRMCore{constructor(f){super(f),this.materials=f.materials,this.springBoneManager=f.springBoneManager,this.nodeConstraintManager=f.nodeConstraintManager}update(f){super.update(f),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(f),this.materials&&this.materials.forEach(r=>{r.update&&r.update(f)})}},__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(f,r,c)=>r in f?__defProp(f,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):f[r]=c,__spreadValues=(f,r)=>{for(var c in r||(r={}))__hasOwnProp.call(r,c)&&__defNormalProp(f,c,r[c]);if(__getOwnPropSymbols)for(var c of __getOwnPropSymbols(r))__propIsEnum.call(r,c)&&__defNormalProp(f,c,r[c]);return f},__async3=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),colorSpaceEncodingMap={"":3e3,srgb:3001};function setTextureColorSpace(f,r){parseInt(REVISION,10)>=152?f.colorSpace=r:f.encoding=colorSpaceEncodingMap[r]}var GLTFMToonMaterialParamsAssignHelper=class{get pending(){return Promise.all(this._pendings)}constructor(f,r){this._parser=f,this._materialParams=r,this._pendings=[]}assignPrimitive(f,r){r!=null&&(this._materialParams[f]=r)}assignColor(f,r,c){r!=null&&(this._materialParams[f]=new Color().fromArray(r),c&&this._materialParams[f].convertSRGBToLinear())}assignTexture(f,r,c){return __async3(this,null,function*(){const d=__async3(this,null,function*(){r!=null&&(yield this._parser.assignTexture(this._materialParams,f,r),c&&setTextureColorSpace(this._materialParams[f],"srgb"))});return this._pendings.push(d),d})}assignTextureByIndex(f,r,c){return __async3(this,null,function*(){return this.assignTexture(f,r!=null?{index:r}:void 0,c)})}},mtoon_default=`// #define PHONG - -varying vec3 vViewPosition; - -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif - -#include - -// #include -#ifdef MTOON_USE_UV - varying vec2 vUv; - - // COMPAT: pre-r151 uses a common uvTransform - #if THREE_VRM_THREE_REVISION < 151 - uniform mat3 uvTransform; - #endif -#endif - -// #include -// COMAPT: pre-r151 uses uv2 for lightMap and aoMap -#if THREE_VRM_THREE_REVISION < 151 - #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; - #endif -#endif - -// #include -// #include -#include -#include -#include -#include -#include -#include -#include - -#ifdef USE_OUTLINEWIDTHMULTIPLYTEXTURE - uniform sampler2D outlineWidthMultiplyTexture; - uniform mat3 outlineWidthMultiplyTextureUvTransform; -#endif - -uniform float outlineWidthFactor; - -void main() { - - // #include - #ifdef MTOON_USE_UV - // COMPAT: pre-r151 uses a common uvTransform - #if THREE_VRM_THREE_REVISION >= 151 - vUv = uv; - #else - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #endif - - // #include - // COMAPT: pre-r151 uses uv2 for lightMap and aoMap - #if THREE_VRM_THREE_REVISION < 151 - #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; - #endif - #endif - - #include - - #include - #include - #include - #include - - // we need this to compute the outline properly - objectNormal = normalize( objectNormal ); - - #include - - #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED - vNormal = normalize( transformedNormal ); - #endif - - #include - - #include - #include - // #include - #include - #include - #include - - vViewPosition = - mvPosition.xyz; - - #ifdef OUTLINE - float worldNormalLength = length( transformedNormal ); - vec3 outlineOffset = outlineWidthFactor * worldNormalLength * objectNormal; - - #ifdef USE_OUTLINEWIDTHMULTIPLYTEXTURE - vec2 outlineWidthMultiplyTextureUv = ( outlineWidthMultiplyTextureUvTransform * vec3( vUv, 1 ) ).xy; - float outlineTex = texture2D( outlineWidthMultiplyTexture, outlineWidthMultiplyTextureUv ).g; - outlineOffset *= outlineTex; - #endif - - #ifdef OUTLINE_WIDTH_SCREEN - outlineOffset *= vViewPosition.z / projectionMatrix[ 1 ].y; - #endif - - gl_Position = projectionMatrix * modelViewMatrix * vec4( outlineOffset + transformed, 1.0 ); - - gl_Position.z += 1E-6 * gl_Position.w; // anti-artifact magic - #endif - - #include - // #include - #include - #include - -}`,mtoon_default2=`// #define PHONG - -uniform vec3 litFactor; - -uniform float opacity; - -uniform vec3 shadeColorFactor; -#ifdef USE_SHADEMULTIPLYTEXTURE - uniform sampler2D shadeMultiplyTexture; - uniform mat3 shadeMultiplyTextureUvTransform; -#endif - -uniform float shadingShiftFactor; -uniform float shadingToonyFactor; - -#ifdef USE_SHADINGSHIFTTEXTURE - uniform sampler2D shadingShiftTexture; - uniform mat3 shadingShiftTextureUvTransform; - uniform float shadingShiftTextureScale; -#endif - -uniform float giEqualizationFactor; - -uniform vec3 parametricRimColorFactor; -#ifdef USE_RIMMULTIPLYTEXTURE - uniform sampler2D rimMultiplyTexture; - uniform mat3 rimMultiplyTextureUvTransform; -#endif -uniform float rimLightingMixFactor; -uniform float parametricRimFresnelPowerFactor; -uniform float parametricRimLiftFactor; - -#ifdef USE_MATCAPTEXTURE - uniform vec3 matcapFactor; - uniform sampler2D matcapTexture; - uniform mat3 matcapTextureUvTransform; -#endif - -uniform vec3 emissive; -uniform float emissiveIntensity; - -uniform vec3 outlineColorFactor; -uniform float outlineLightingMixFactor; - -#ifdef USE_UVANIMATIONMASKTEXTURE - uniform sampler2D uvAnimationMaskTexture; - uniform mat3 uvAnimationMaskTextureUvTransform; -#endif - -uniform float uvAnimationScrollXOffset; -uniform float uvAnimationScrollYOffset; -uniform float uvAnimationRotationPhase; - -#include -#include -#include -#include - -// #include -#if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif - -// #include -// COMAPT: pre-r151 uses uv2 for lightMap and aoMap -#if THREE_VRM_THREE_REVISION < 151 - #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; - #endif -#endif - -#include - -#ifdef USE_MAP - uniform mat3 mapUvTransform; -#endif - -// #include - -#include - -#include -// #include -#include - -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapUvTransform; -#endif - -// #include -// #include -// #include -#include - -// #include -// COMPAT: pre-r151 doesn't have BRDF_Lambert in -#if THREE_VRM_THREE_REVISION < 151 - vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; - } -#endif - -#include - -#include - -// #include -varying vec3 vViewPosition; - -struct MToonMaterial { - vec3 diffuseColor; - vec3 shadeColor; - float shadingShift; -}; - -float linearstep( float a, float b, float t ) { - return clamp( ( t - a ) / ( b - a ), 0.0, 1.0 ); -} - -/** - * Convert NdotL into toon shading factor using shadingShift and shadingToony - */ -float getShading( - const in float dotNL, - const in float shadow, - const in float shadingShift -) { - float shading = dotNL; - shading = shading + shadingShift; - shading = linearstep( -1.0 + shadingToonyFactor, 1.0 - shadingToonyFactor, shading ); - shading *= shadow; - return shading; -} - -/** - * Mix diffuseColor and shadeColor using shading factor and light color - */ -vec3 getDiffuse( - const in MToonMaterial material, - const in float shading, - in vec3 lightColor -) { - #ifdef DEBUG_LITSHADERATE - return vec3( BRDF_Lambert( shading * lightColor ) ); - #endif - - vec3 col = lightColor * BRDF_Lambert( mix( material.shadeColor, material.diffuseColor, shading ) ); - - // The "comment out if you want to PBR absolutely" line - #ifdef V0_COMPAT_SHADE - col = min( col, material.diffuseColor ); - #endif - - return col; -} - -// COMPAT: pre-r156 uses a struct GeometricContext -#if THREE_VRM_THREE_REVISION >= 157 - void RE_Direct_MToon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in MToonMaterial material, const in float shadow, inout ReflectedLight reflectedLight ) { - float dotNL = clamp( dot( geometryNormal, directLight.direction ), -1.0, 1.0 ); - vec3 irradiance = directLight.color; - - // directSpecular will be used for rim lighting, not an actual specular - reflectedLight.directSpecular += irradiance; - - irradiance *= dotNL; - - float shading = getShading( dotNL, shadow, material.shadingShift ); - - // toon shaded diffuse - reflectedLight.directDiffuse += getDiffuse( material, shading, directLight.color ); - } - - void RE_IndirectDiffuse_MToon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in MToonMaterial material, inout ReflectedLight reflectedLight ) { - // indirect diffuse will use diffuseColor, no shadeColor involved - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - - // directSpecular will be used for rim lighting, not an actual specular - reflectedLight.directSpecular += irradiance; - } -#else - void RE_Direct_MToon( const in IncidentLight directLight, const in GeometricContext geometry, const in MToonMaterial material, const in float shadow, inout ReflectedLight reflectedLight ) { - float dotNL = clamp( dot( geometry.normal, directLight.direction ), -1.0, 1.0 ); - vec3 irradiance = directLight.color; - - // directSpecular will be used for rim lighting, not an actual specular - reflectedLight.directSpecular += irradiance; - - irradiance *= dotNL; - - float shading = getShading( dotNL, shadow, material.shadingShift ); - - // toon shaded diffuse - reflectedLight.directDiffuse += getDiffuse( material, shading, directLight.color ); - } - - void RE_IndirectDiffuse_MToon( const in vec3 irradiance, const in GeometricContext geometry, const in MToonMaterial material, inout ReflectedLight reflectedLight ) { - // indirect diffuse will use diffuseColor, no shadeColor involved - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - - // directSpecular will be used for rim lighting, not an actual specular - reflectedLight.directSpecular += irradiance; - } -#endif - -#define RE_Direct RE_Direct_MToon -#define RE_IndirectDiffuse RE_IndirectDiffuse_MToon -#define Material_LightProbeLOD( material ) (0) - -#include -// #include - -// #include -#ifdef USE_NORMALMAP - - uniform sampler2D normalMap; - uniform mat3 normalMapUvTransform; - uniform vec2 normalScale; - -#endif - -// COMPAT: pre-r151 -// USE_NORMALMAP_OBJECTSPACE used to be OBJECTSPACE_NORMALMAP in pre-r151 -#if defined( USE_NORMALMAP_OBJECTSPACE ) || defined( OBJECTSPACE_NORMALMAP ) - - uniform mat3 normalMatrix; - -#endif - -// COMPAT: pre-r151 -// USE_NORMALMAP_TANGENTSPACE used to be TANGENTSPACE_NORMALMAP in pre-r151 -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( TANGENTSPACE_NORMALMAP ) ) - - // Per-Pixel Tangent Space Normal Mapping - // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html - - // three-vrm specific change: it requires \`uv\` as an input in order to support uv scrolls - - // Temporary compat against shader change @ Three.js r126, r151 - #if THREE_VRM_THREE_REVISION >= 151 - - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - - vec3 N = surf_norm; - - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - - return mat3( T * scale, B * scale, N ); - - } - - #else - - vec3 perturbNormal2Arb( vec2 uv, vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - - vec3 N = normalize( surf_norm ); - - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - - // three-vrm specific change: Workaround for the issue that happens when delta of uv = 0.0 - // TODO: Is this still required? Or shall I make a PR about it? - if ( length( T ) == 0.0 || length( B ) == 0.0 ) { - return surf_norm; - } - - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - - } - - #endif - -#endif - -// #include -#include -#include - -// == post correction ========================================================== -void postCorrection() { - #include - #include - #include - #include - #include -} - -// == main procedure =========================================================== -void main() { - #include - - vec2 uv = vec2(0.5, 0.5); - - #if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) - uv = vUv; - - float uvAnimMask = 1.0; - #ifdef USE_UVANIMATIONMASKTEXTURE - vec2 uvAnimationMaskTextureUv = ( uvAnimationMaskTextureUvTransform * vec3( uv, 1 ) ).xy; - uvAnimMask = texture2D( uvAnimationMaskTexture, uvAnimationMaskTextureUv ).b; - #endif - - float uvRotCos = cos( uvAnimationRotationPhase * uvAnimMask ); - float uvRotSin = sin( uvAnimationRotationPhase * uvAnimMask ); - uv = mat2( uvRotCos, -uvRotSin, uvRotSin, uvRotCos ) * ( uv - 0.5 ) + 0.5; - uv = uv + vec2( uvAnimationScrollXOffset, uvAnimationScrollYOffset ) * uvAnimMask; - #endif - - #ifdef DEBUG_UV - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) - gl_FragColor = vec4( uv, 0.0, 1.0 ); - #endif - return; - #endif - - vec4 diffuseColor = vec4( litFactor, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive * emissiveIntensity; - - #include - - // #include - #ifdef USE_MAP - vec2 mapUv = ( mapUvTransform * vec3( uv, 1 ) ).xy; - vec4 sampledDiffuseColor = texture2D( map, mapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); - #endif - diffuseColor *= sampledDiffuseColor; - #endif - - // #include - #if ( defined( USE_COLOR ) && !defined( IGNORE_VERTEX_COLOR ) ) - diffuseColor.rgb *= vColor; - #endif - - // #include - - #include - - // #include - - // #include - float faceDirection = gl_FrontFacing ? 1.0 : -1.0; - - #ifdef FLAT_SHADED - - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); - - #else - - vec3 normal = normalize( vNormal ); - - #ifdef DOUBLE_SIDED - - normal *= faceDirection; - - #endif - - #endif - - #ifdef USE_NORMALMAP - - vec2 normalMapUv = ( normalMapUvTransform * vec3( uv, 1 ) ).xy; - - #endif - - #ifdef USE_NORMALMAP_TANGENTSPACE - - #ifdef USE_TANGENT - - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - - #else - - mat3 tbn = getTangentFrame( - vViewPosition, normal, normalMapUv ); - - #endif - - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - - #endif - - #endif - - #ifdef USE_CLEARCOAT_NORMALMAP - - #ifdef USE_TANGENT - - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - - #else - - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - - #endif - - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - - #endif - - #endif - - // non perturbed normal for clearcoat among others - - vec3 nonPerturbedNormal = normal; - - #ifdef OUTLINE - normal *= -1.0; - #endif - - // #include - - // COMPAT: pre-r151 - // USE_NORMALMAP_OBJECTSPACE used to be OBJECTSPACE_NORMALMAP in pre-r151 - #if defined( USE_NORMALMAP_OBJECTSPACE ) || defined( OBJECTSPACE_NORMALMAP ) - - normal = texture2D( normalMap, normalMapUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals - - #ifdef FLIP_SIDED - - normal = - normal; - - #endif - - #ifdef DOUBLE_SIDED - - normal = normal * faceDirection; - - #endif - - normal = normalize( normalMatrix * normal ); - - // COMPAT: pre-r151 - // USE_NORMALMAP_TANGENTSPACE used to be TANGENTSPACE_NORMALMAP in pre-r151 - #elif defined( USE_NORMALMAP_TANGENTSPACE ) || defined( TANGENTSPACE_NORMALMAP ) - - vec3 mapN = texture2D( normalMap, normalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - - // COMPAT: pre-r151 - #if THREE_VRM_THREE_REVISION >= 151 || defined( USE_TANGENT ) - - normal = normalize( tbn * mapN ); - - #else - - normal = perturbNormal2Arb( uv, -vViewPosition, normal, mapN, faceDirection ); - - #endif - - #endif - - // #include - #ifdef USE_EMISSIVEMAP - vec2 emissiveMapUv = ( emissiveMapUvTransform * vec3( uv, 1 ) ).xy; - totalEmissiveRadiance *= texture2D( emissiveMap, emissiveMapUv ).rgb; - #endif - - #ifdef DEBUG_NORMAL - gl_FragColor = vec4( 0.5 + 0.5 * normal, 1.0 ); - return; - #endif - - // -- MToon: lighting -------------------------------------------------------- - // accumulation - // #include - MToonMaterial material; - - material.diffuseColor = diffuseColor.rgb; - - material.shadeColor = shadeColorFactor; - #ifdef USE_SHADEMULTIPLYTEXTURE - vec2 shadeMultiplyTextureUv = ( shadeMultiplyTextureUvTransform * vec3( uv, 1 ) ).xy; - material.shadeColor *= texture2D( shadeMultiplyTexture, shadeMultiplyTextureUv ).rgb; - #endif - - #if ( defined( USE_COLOR ) && !defined( IGNORE_VERTEX_COLOR ) ) - material.shadeColor.rgb *= vColor; - #endif - - material.shadingShift = shadingShiftFactor; - #ifdef USE_SHADINGSHIFTTEXTURE - vec2 shadingShiftTextureUv = ( shadingShiftTextureUvTransform * vec3( uv, 1 ) ).xy; - material.shadingShift += texture2D( shadingShiftTexture, shadingShiftTextureUv ).r * shadingShiftTextureScale; - #endif - - // #include - - // MToon Specific changes: - // Since we want to take shadows into account of shading instead of irradiance, - // we had to modify the codes that multiplies the results of shadowmap into color of direct lights. - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - vec3 geometryPosition = - vViewPosition; - vec3 geometryNormal = normal; - vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); - - vec3 geometryClearcoatNormal; - - #ifdef USE_CLEARCOAT - - geometryClearcoatNormal = clearcoatNormal; - - #endif - #else - GeometricContext geometry; - - geometry.position = - vViewPosition; - geometry.normal = normal; - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); - - #ifdef USE_CLEARCOAT - - geometry.clearcoatNormal = clearcoatNormal; - - #endif - #endif - - IncidentLight directLight; - - // since these variables will be used in unrolled loop, we have to define in prior - float shadow; - - #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - - pointLight = pointLights[ i ]; - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - getPointLightInfo( pointLight, geometryPosition, directLight ); - #else - getPointLightInfo( pointLight, geometry, directLight ); - #endif - - shadow = 1.0; - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - // COMPAT: pre-r166 - // r166 introduced shadowIntensity - #if THREE_VRM_THREE_REVISION >= 166 - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #else - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - #endif - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); - #else - RE_Direct( directLight, geometry, material, shadow, reflectedLight ); - #endif - - } - #pragma unroll_loop_end - - #endif - - #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - - spotLight = spotLights[ i ]; - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #else - getSpotLightInfo( spotLight, geometry, directLight ); - #endif - - shadow = 1.0; - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - // COMPAT: pre-r166 - // r166 introduced shadowIntensity - #if THREE_VRM_THREE_REVISION >= 166 - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #else - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - #endif - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); - #else - RE_Direct( directLight, geometry, material, shadow, reflectedLight ); - #endif - - } - #pragma unroll_loop_end - - #endif - - #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - - directionalLight = directionalLights[ i ]; - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - getDirectionalLightInfo( directionalLight, directLight ); - #else - getDirectionalLightInfo( directionalLight, geometry, directLight ); - #endif - - shadow = 1.0; - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - // COMPAT: pre-r166 - // r166 introduced shadowIntensity - #if THREE_VRM_THREE_REVISION >= 166 - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #else - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - #endif - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); - #else - RE_Direct( directLight, geometry, material, shadow, reflectedLight ); - #endif - - } - #pragma unroll_loop_end - - #endif - - // #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - - // RectAreaLight rectAreaLight; - - // #pragma unroll_loop_start - // for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - - // rectAreaLight = rectAreaLights[ i ]; - // RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - - // } - // #pragma unroll_loop_end - - // #endif - - #if defined( RE_IndirectDiffuse ) - - vec3 iblIrradiance = vec3( 0.0 ); - - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - - // COMPAT: pre-r156 uses a struct GeometricContext - // COMPAT: pre-r156 doesn't have a define USE_LIGHT_PROBES - #if THREE_VRM_THREE_REVISION >= 157 - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #else - irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); - #endif - - #if ( NUM_HEMI_LIGHTS > 0 ) - - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - #else - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); - #endif - - } - #pragma unroll_loop_end - - #endif - - #endif - - // #if defined( RE_IndirectSpecular ) - - // vec3 radiance = vec3( 0.0 ); - // vec3 clearcoatRadiance = vec3( 0.0 ); - - // #endif - - #include - #include - - // modulation - #include - - vec3 col = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - - #ifdef DEBUG_LITSHADERATE - gl_FragColor = vec4( col, diffuseColor.a ); - postCorrection(); - return; - #endif - - // -- MToon: rim lighting ----------------------------------------- - vec3 viewDir = normalize( vViewPosition ); - - #ifndef PHYSICALLY_CORRECT_LIGHTS - reflectedLight.directSpecular /= PI; - #endif - vec3 rimMix = mix( vec3( 1.0 ), reflectedLight.directSpecular, 1.0 ); - - vec3 rim = parametricRimColorFactor * pow( saturate( 1.0 - dot( viewDir, normal ) + parametricRimLiftFactor ), parametricRimFresnelPowerFactor ); - - #ifdef USE_MATCAPTEXTURE - { - vec3 x = normalize( vec3( viewDir.z, 0.0, -viewDir.x ) ); - vec3 y = cross( viewDir, x ); // guaranteed to be normalized - vec2 sphereUv = 0.5 + 0.5 * vec2( dot( x, normal ), -dot( y, normal ) ); - sphereUv = ( matcapTextureUvTransform * vec3( sphereUv, 1 ) ).xy; - vec3 matcap = texture2D( matcapTexture, sphereUv ).rgb; - rim += matcapFactor * matcap; - } - #endif - - #ifdef USE_RIMMULTIPLYTEXTURE - vec2 rimMultiplyTextureUv = ( rimMultiplyTextureUvTransform * vec3( uv, 1 ) ).xy; - rim *= texture2D( rimMultiplyTexture, rimMultiplyTextureUv ).rgb; - #endif - - col += rimMix * rim; - - // -- MToon: Emission -------------------------------------------------------- - col += totalEmissiveRadiance; - - // #include - - // -- Almost done! ----------------------------------------------------------- - #if defined( OUTLINE ) - col = outlineColorFactor.rgb * mix( vec3( 1.0 ), col, outlineLightingMixFactor ); - #endif - - #ifdef OPAQUE - diffuseColor.a = 1.0; - #endif - - gl_FragColor = vec4( col, diffuseColor.a ); - postCorrection(); -} -`,MToonMaterialDebugMode={None:"none"},MToonMaterialOutlineWidthMode={None:"none",ScreenCoordinates:"screenCoordinates"},encodingColorSpaceMap={3e3:"",3001:"srgb"};function getTextureColorSpace(f){return parseInt(REVISION,10)>=152?f.colorSpace:encodingColorSpaceMap[f.encoding]}var MToonMaterial=class extends ShaderMaterial{constructor(f={}){var r;super({vertexShader:mtoon_default,fragmentShader:mtoon_default2}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=TangentSpaceNormalMap,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=MToonMaterialDebugMode.None,this._outlineWidthMode=MToonMaterialOutlineWidthMode.None,this._isOutline=!1,f.transparentWithZWrite&&(f.depthWrite=!0),delete f.transparentWithZWrite,f.fog=!0,f.lights=!0,f.clipping=!0,this.uniforms=UniformsUtils.merge([UniformsLib.common,UniformsLib.normalmap,UniformsLib.emissivemap,UniformsLib.fog,UniformsLib.lights,{litFactor:{value:new Color(1,1,1)},mapUvTransform:{value:new Matrix3},colorAlpha:{value:1},normalMapUvTransform:{value:new Matrix3},shadeColorFactor:{value:new Color(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new Matrix3},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new Matrix3},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new Color(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new Matrix3},parametricRimColorFactor:{value:new Color(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new Matrix3},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new Color(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new Matrix3},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new Matrix3},outlineWidthFactor:{value:0},outlineColorFactor:{value:new Color(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new Matrix3},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(r=f.uniforms)!=null?r:{}]),this.setValues(f),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([c,d])=>`${c}:${d}`),this.matcapTexture?`matcapTextureColorSpace:${getTextureColorSpace(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${getTextureColorSpace(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${getTextureColorSpace(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=c=>{const d=parseInt(REVISION,10),l=Object.entries(__spreadValues(__spreadValues({},this._generateDefines()),this.defines)).filter(([m,s])=>!!s).map(([m,s])=>`#define ${m} ${s}`).join(` -`)+` -`;c.vertexShader=l+c.vertexShader,c.fragmentShader=l+c.fragmentShader,d<154&&(c.fragmentShader=c.fragmentShader.replace("#include ","#include "))}}get color(){return this.uniforms.litFactor.value}set color(f){this.uniforms.litFactor.value=f}get map(){return this.uniforms.map.value}set map(f){this.uniforms.map.value=f}get normalMap(){return this.uniforms.normalMap.value}set normalMap(f){this.uniforms.normalMap.value=f}get normalScale(){return this.uniforms.normalScale.value}set normalScale(f){this.uniforms.normalScale.value=f}get emissive(){return this.uniforms.emissive.value}set emissive(f){this.uniforms.emissive.value=f}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(f){this.uniforms.emissiveIntensity.value=f}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(f){this.uniforms.emissiveMap.value=f}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(f){this.uniforms.shadeColorFactor.value=f}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(f){this.uniforms.shadeMultiplyTexture.value=f}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(f){this.uniforms.shadingShiftFactor.value=f}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(f){this.uniforms.shadingShiftTexture.value=f}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(f){this.uniforms.shadingShiftTextureScale.value=f}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(f){this.uniforms.shadingToonyFactor.value=f}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(f){this.uniforms.giEqualizationFactor.value=f}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(f){this.uniforms.matcapFactor.value=f}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(f){this.uniforms.matcapTexture.value=f}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(f){this.uniforms.parametricRimColorFactor.value=f}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(f){this.uniforms.rimMultiplyTexture.value=f}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(f){this.uniforms.rimLightingMixFactor.value=f}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(f){this.uniforms.parametricRimFresnelPowerFactor.value=f}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(f){this.uniforms.parametricRimLiftFactor.value=f}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(f){this.uniforms.outlineWidthMultiplyTexture.value=f}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(f){this.uniforms.outlineWidthFactor.value=f}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(f){this.uniforms.outlineColorFactor.value=f}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(f){this.uniforms.outlineLightingMixFactor.value=f}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(f){this.uniforms.uvAnimationMaskTexture.value=f}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(f){this.uniforms.uvAnimationScrollXOffset.value=f}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(f){this.uniforms.uvAnimationScrollYOffset.value=f}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(f){this.uniforms.uvAnimationRotationPhase.value=f}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(f){this._ignoreVertexColor=f,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(f){this._v0CompatShade=f,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(f){this._debugMode=f,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(f){this._outlineWidthMode=f,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(f){this._isOutline=f,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(f){this._uploadUniformsWorkaround(),this._updateUVAnimation(f)}copy(f){return super.copy(f),this.map=f.map,this.normalMap=f.normalMap,this.emissiveMap=f.emissiveMap,this.shadeMultiplyTexture=f.shadeMultiplyTexture,this.shadingShiftTexture=f.shadingShiftTexture,this.matcapTexture=f.matcapTexture,this.rimMultiplyTexture=f.rimMultiplyTexture,this.outlineWidthMultiplyTexture=f.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=f.uvAnimationMaskTexture,this.normalMapType=f.normalMapType,this.uvAnimationScrollXSpeedFactor=f.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=f.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=f.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=f.ignoreVertexColor,this.v0CompatShade=f.v0CompatShade,this.debugMode=f.debugMode,this.outlineWidthMode=f.outlineWidthMode,this.isOutline=f.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(f){this.uniforms.uvAnimationScrollXOffset.value+=f*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=f*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=f*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){const f=parseInt(REVISION,10),r=this.outlineWidthMultiplyTexture!==null,c=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:f,OUTLINE:this._isOutline,MTOON_USE_UV:r||c,MTOON_UVS_VERTEX_ONLY:r&&!c,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode==="normal",DEBUG_LITSHADERATE:this._debugMode==="litShadeRate",DEBUG_UV:this._debugMode==="uv",OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===MToonMaterialOutlineWidthMode.ScreenCoordinates}}_updateTextureMatrix(f,r){f.value&&(f.value.matrixAutoUpdate&&f.value.updateMatrix(),r.value.copy(f.value.matrix))}},POSSIBLE_SPEC_VERSIONS6=new Set(["1.0","1.0-beta"]),_MToonMaterialLoaderPlugin=class Ft{get name(){return Ft.EXTENSION_NAME}constructor(r,c={}){var d,l,m,s;this.parser=r,this.materialType=(d=c.materialType)!=null?d:MToonMaterial,this.renderOrderOffset=(l=c.renderOrderOffset)!=null?l:0,this.v0CompatShade=(m=c.v0CompatShade)!=null?m:!1,this.debugMode=(s=c.debugMode)!=null?s:"none",this._mToonMaterialSet=new Set}beforeRoot(){return __async3(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(r){return __async3(this,null,function*(){r.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(r){return this._getMToonExtension(r)?this.materialType:null}extendMaterialParams(r,c){const d=this._getMToonExtension(r);return d?this._extendMaterialParams(d,c):null}loadMesh(r){return __async3(this,null,function*(){var c;const d=this.parser,m=(c=d.json.meshes)==null?void 0:c[r];if(m==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${r}] of glTF but the mesh doesn't exist`);const s=m.primitives,h=yield d.loadMesh(r);if(s.length===1){const p=h,a=s[0].material;a!=null&&this._setupPrimitive(p,a)}else{const p=h;for(let a=0;a{var s;this._getMToonExtension(m)&&((s=l.extensions)!=null&&s.KHR_materials_unlit)&&delete l.extensions.KHR_materials_unlit})}_getMToonExtension(r){var c,d;const s=(c=this.parser.json.materials)==null?void 0:c[r];if(s==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${r}] of glTF but the material doesn't exist`);return}const h=(d=s.extensions)==null?void 0:d[Ft.EXTENSION_NAME];if(h==null)return;const p=h.specVersion;if(!POSSIBLE_SPEC_VERSIONS6.has(p)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${Ft.EXTENSION_NAME} specVersion "${p}"`);return}return h}_extendMaterialParams(r,c){return __async3(this,null,function*(){var d;delete c.metalness,delete c.roughness;const l=new GLTFMToonMaterialParamsAssignHelper(this.parser,c);l.assignPrimitive("transparentWithZWrite",r.transparentWithZWrite),l.assignColor("shadeColorFactor",r.shadeColorFactor),l.assignTexture("shadeMultiplyTexture",r.shadeMultiplyTexture,!0),l.assignPrimitive("shadingShiftFactor",r.shadingShiftFactor),l.assignTexture("shadingShiftTexture",r.shadingShiftTexture,!0),l.assignPrimitive("shadingShiftTextureScale",(d=r.shadingShiftTexture)==null?void 0:d.scale),l.assignPrimitive("shadingToonyFactor",r.shadingToonyFactor),l.assignPrimitive("giEqualizationFactor",r.giEqualizationFactor),l.assignColor("matcapFactor",r.matcapFactor),l.assignTexture("matcapTexture",r.matcapTexture,!0),l.assignColor("parametricRimColorFactor",r.parametricRimColorFactor),l.assignTexture("rimMultiplyTexture",r.rimMultiplyTexture,!0),l.assignPrimitive("rimLightingMixFactor",r.rimLightingMixFactor),l.assignPrimitive("parametricRimFresnelPowerFactor",r.parametricRimFresnelPowerFactor),l.assignPrimitive("parametricRimLiftFactor",r.parametricRimLiftFactor),l.assignPrimitive("outlineWidthMode",r.outlineWidthMode),l.assignPrimitive("outlineWidthFactor",r.outlineWidthFactor),l.assignTexture("outlineWidthMultiplyTexture",r.outlineWidthMultiplyTexture,!1),l.assignColor("outlineColorFactor",r.outlineColorFactor),l.assignPrimitive("outlineLightingMixFactor",r.outlineLightingMixFactor),l.assignTexture("uvAnimationMaskTexture",r.uvAnimationMaskTexture,!1),l.assignPrimitive("uvAnimationScrollXSpeedFactor",r.uvAnimationScrollXSpeedFactor),l.assignPrimitive("uvAnimationScrollYSpeedFactor",r.uvAnimationScrollYSpeedFactor),l.assignPrimitive("uvAnimationRotationSpeedFactor",r.uvAnimationRotationSpeedFactor),l.assignPrimitive("v0CompatShade",this.v0CompatShade),l.assignPrimitive("debugMode",this.debugMode),yield l.pending})}_setupPrimitive(r,c){const d=this._getMToonExtension(c);if(d){const l=this._parseRenderOrder(d);r.renderOrder=l+this.renderOrderOffset,this._generateOutline(r),this._addToMaterialSet(r);return}}_shouldGenerateOutline(r){return typeof r.outlineWidthMode=="string"&&r.outlineWidthMode!=="none"&&typeof r.outlineWidthFactor=="number"&&r.outlineWidthFactor>0}_generateOutline(r){const c=r.material;if(!(c instanceof Material)||!this._shouldGenerateOutline(c))return;r.material=[c];const d=c.clone();d.name+=" (Outline)",d.isOutline=!0,d.side=BackSide,r.material.push(d);const l=r.geometry,m=l.index?l.index.count:l.attributes.position.count/3;l.addGroup(0,m,0),l.addGroup(0,m,1)}_addToMaterialSet(r){const c=r.material,d=new Set;Array.isArray(c)?c.forEach(l=>d.add(l)):d.add(c);for(const l of d)this._mToonMaterialSet.add(l)}_parseRenderOrder(r){var c;return(r.transparentWithZWrite?0:19)+((c=r.renderQueueOffsetNumber)!=null?c:0)}};_MToonMaterialLoaderPlugin.EXTENSION_NAME="VRMC_materials_mtoon";var MToonMaterialLoaderPlugin=_MToonMaterialLoaderPlugin,__async4=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),_VRMMaterialsHDREmissiveMultiplierLoaderPlugin=class jt{get name(){return jt.EXTENSION_NAME}constructor(r){this.parser=r}extendMaterialParams(r,c){return __async4(this,null,function*(){const d=this._getHDREmissiveMultiplierExtension(r);if(d==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");const l=d.emissiveMultiplier;c.emissiveIntensity=l})}_getHDREmissiveMultiplierExtension(r){var c,d;const s=(c=this.parser.json.materials)==null?void 0:c[r];if(s==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${r}] of glTF but the material doesn't exist`);return}const h=(d=s.extensions)==null?void 0:d[jt.EXTENSION_NAME];if(h!=null)return h}};_VRMMaterialsHDREmissiveMultiplierLoaderPlugin.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var VRMMaterialsHDREmissiveMultiplierLoaderPlugin=_VRMMaterialsHDREmissiveMultiplierLoaderPlugin,__defProp2=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols2=Object.getOwnPropertySymbols,__hasOwnProp2=Object.prototype.hasOwnProperty,__propIsEnum2=Object.prototype.propertyIsEnumerable,__defNormalProp2=(f,r,c)=>r in f?__defProp2(f,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):f[r]=c,__spreadValues2=(f,r)=>{for(var c in r||(r={}))__hasOwnProp2.call(r,c)&&__defNormalProp2(f,c,r[c]);if(__getOwnPropSymbols2)for(var c of __getOwnPropSymbols2(r))__propIsEnum2.call(r,c)&&__defNormalProp2(f,c,r[c]);return f},__spreadProps=(f,r)=>__defProps(f,__getOwnPropDescs(r)),__async5=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())});function gammaEOTF(f){return Math.pow(f,2.2)}var VRMMaterialsV0CompatPlugin=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(f){var r;this.parser=f,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;const c=this.parser.json;c.extensionsUsed=(r=c.extensionsUsed)!=null?r:[],c.extensionsUsed.indexOf("KHR_texture_transform")===-1&&c.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return __async5(this,null,function*(){var f;const r=this.parser.json,c=(f=r.extensions)==null?void 0:f.VRM,d=c==null?void 0:c.materialProperties;d&&(this._populateRenderQueueMap(d),d.forEach((l,m)=>{var s,h;const p=(s=r.materials)==null?void 0:s[m];if(p==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${m}] of glTF but the material doesn't exist`);return}if(l.shader==="VRM/MToon"){const a=this._parseV0MToonProperties(l,p);r.materials[m]=a}else if((h=l.shader)!=null&&h.startsWith("VRM/Unlit")){const a=this._parseV0UnlitProperties(l,p);r.materials[m]=a}else l.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${l.shader}`)}))})}_parseV0MToonProperties(f,r){var c,d,l,m,s,h,p,a,o,t,e,n,i,u,g,b,y,_,v,w,T,A,E,x,M,C,k,V,F,q,D,U,J,Y,Z,te,he,Me,Te,ue,xe,_e,Le,ze,Se,De,Re,Ae,we,ke,Ue,Be,We,qe,je;const Ve=(d=(c=f.keywordMap)==null?void 0:c._ALPHABLEND_ON)!=null?d:!1,$e=((l=f.floatProperties)==null?void 0:l._ZWrite)===1&&Ve,Ye=this._v0ParseRenderQueue(f),le=(s=(m=f.keywordMap)==null?void 0:m._ALPHATEST_ON)!=null?s:!1,pt=Ve?"BLEND":le?"MASK":"OPAQUE",ut=le?(p=(h=f.floatProperties)==null?void 0:h._Cutoff)!=null?p:.5:void 0,Ke=((o=(a=f.floatProperties)==null?void 0:a._CullMode)!=null?o:2)===0,He=this._portTextureTransform(f),lt=((e=(t=f.vectorProperties)==null?void 0:t._Color)!=null?e:[1,1,1,1]).map((ae,ve)=>ve===3?ae:gammaEOTF(ae)),Ce=(n=f.textureProperties)==null?void 0:n._MainTex,nt=Ce!=null?{index:Ce,extensions:__spreadValues2({},He)}:void 0,ie=(u=(i=f.floatProperties)==null?void 0:i._BumpScale)!=null?u:1,Je=(g=f.textureProperties)==null?void 0:g._BumpMap,At=Je!=null?{index:Je,scale:ie,extensions:__spreadValues2({},He)}:void 0,Et=((y=(b=f.vectorProperties)==null?void 0:b._EmissionColor)!=null?y:[0,0,0,1]).map(gammaEOTF),Xe=(_=f.textureProperties)==null?void 0:_._EmissionMap,ye=Xe!=null?{index:Xe,extensions:__spreadValues2({},He)}:void 0,rt=((w=(v=f.vectorProperties)==null?void 0:v._ShadeColor)!=null?w:[.97,.81,.86,1]).map(gammaEOTF),ct=(T=f.textureProperties)==null?void 0:T._ShadeTexture,it=ct!=null?{index:ct,extensions:__spreadValues2({},He)}:void 0;let oe=(E=(A=f.floatProperties)==null?void 0:A._ShadeShift)!=null?E:0,re=(M=(x=f.floatProperties)==null?void 0:x._ShadeToony)!=null?M:.9;re=MathUtils.lerp(re,1,.5+.5*oe),oe=-oe-(1-re);const se=(k=(C=f.floatProperties)==null?void 0:C._IndirectLightIntensity)!=null?k:.1,ft=se?1-se:void 0,et=(V=f.textureProperties)==null?void 0:V._SphereAdd,mt=et!=null?[1,1,1]:void 0,gt=et!=null?{index:et}:void 0,bt=(q=(F=f.floatProperties)==null?void 0:F._RimLightingMix)!=null?q:0,dt=(D=f.textureProperties)==null?void 0:D._RimTexture,yt=dt!=null?{index:dt,extensions:__spreadValues2({},He)}:void 0,_t=((J=(U=f.vectorProperties)==null?void 0:U._RimColor)!=null?J:[0,0,0,1]).map(gammaEOTF),vt=(Z=(Y=f.floatProperties)==null?void 0:Y._RimFresnelPower)!=null?Z:1,wt=(he=(te=f.floatProperties)==null?void 0:te._RimLift)!=null?he:0,xt=["none","worldCoordinates","screenCoordinates"][(Te=(Me=f.floatProperties)==null?void 0:Me._OutlineWidthMode)!=null?Te:0];let ot=(xe=(ue=f.floatProperties)==null?void 0:ue._OutlineWidth)!=null?xe:0;ot=.01*ot;const ht=(_e=f.textureProperties)==null?void 0:_e._OutlineWidthTexture,Tt=ht!=null?{index:ht,extensions:__spreadValues2({},He)}:void 0,P=((ze=(Le=f.vectorProperties)==null?void 0:Le._OutlineColor)!=null?ze:[0,0,0]).map(gammaEOTF),N=((De=(Se=f.floatProperties)==null?void 0:Se._OutlineColorMode)!=null?De:0)===1?(Ae=(Re=f.floatProperties)==null?void 0:Re._OutlineLightingMix)!=null?Ae:1:0,$=(we=f.textureProperties)==null?void 0:we._UvAnimMaskTexture,j=$!=null?{index:$,extensions:__spreadValues2({},He)}:void 0,H=(Ue=(ke=f.floatProperties)==null?void 0:ke._UvAnimScrollX)!=null?Ue:0;let X=(We=(Be=f.floatProperties)==null?void 0:Be._UvAnimScrollY)!=null?We:0;X!=null&&(X=-X);const ee=(je=(qe=f.floatProperties)==null?void 0:qe._UvAnimRotation)!=null?je:0,K={specVersion:"1.0",transparentWithZWrite:$e,renderQueueOffsetNumber:Ye,shadeColorFactor:rt,shadeMultiplyTexture:it,shadingShiftFactor:oe,shadingToonyFactor:re,giEqualizationFactor:ft,matcapFactor:mt,matcapTexture:gt,rimLightingMixFactor:bt,rimMultiplyTexture:yt,parametricRimColorFactor:_t,parametricRimFresnelPowerFactor:vt,parametricRimLiftFactor:wt,outlineWidthMode:xt,outlineWidthFactor:ot,outlineWidthMultiplyTexture:Tt,outlineColorFactor:P,outlineLightingMixFactor:N,uvAnimationMaskTexture:j,uvAnimationScrollXSpeedFactor:H,uvAnimationScrollYSpeedFactor:X,uvAnimationRotationSpeedFactor:ee};return __spreadProps(__spreadValues2({},r),{pbrMetallicRoughness:{baseColorFactor:lt,baseColorTexture:nt},normalTexture:At,emissiveTexture:ye,emissiveFactor:Et,alphaMode:pt,alphaCutoff:ut,doubleSided:Ke,extensions:{VRMC_materials_mtoon:K}})}_parseV0UnlitProperties(f,r){var c,d,l,m,s;const h=f.shader==="VRM/UnlitTransparentZWrite",p=f.shader==="VRM/UnlitTransparent"||h,a=this._v0ParseRenderQueue(f),o=f.shader==="VRM/UnlitCutout",t=p?"BLEND":o?"MASK":"OPAQUE",e=o?(d=(c=f.floatProperties)==null?void 0:c._Cutoff)!=null?d:.5:void 0,n=this._portTextureTransform(f),i=((m=(l=f.vectorProperties)==null?void 0:l._Color)!=null?m:[1,1,1,1]).map(gammaEOTF),u=(s=f.textureProperties)==null?void 0:s._MainTex,g=u!=null?{index:u,extensions:__spreadValues2({},n)}:void 0,b={specVersion:"1.0",transparentWithZWrite:h,renderQueueOffsetNumber:a,shadeColorFactor:i,shadeMultiplyTexture:g};return __spreadProps(__spreadValues2({},r),{pbrMetallicRoughness:{baseColorFactor:i,baseColorTexture:g},alphaMode:t,alphaCutoff:e,extensions:{VRMC_materials_mtoon:b}})}_portTextureTransform(f){var r,c,d,l,m;const s=(r=f.vectorProperties)==null?void 0:r._MainTex;if(s==null)return{};const h=[(c=s==null?void 0:s[0])!=null?c:0,(d=s==null?void 0:s[1])!=null?d:0],p=[(l=s==null?void 0:s[2])!=null?l:1,(m=s==null?void 0:s[3])!=null?m:1];return h[1]=1-p[1]-h[1],{KHR_texture_transform:{offset:h,scale:p}}}_v0ParseRenderQueue(f){var r,c;const d=f.shader==="VRM/UnlitTransparentZWrite",l=((r=f.keywordMap)==null?void 0:r._ALPHABLEND_ON)!=null||f.shader==="VRM/UnlitTransparent"||d,m=((c=f.floatProperties)==null?void 0:c._ZWrite)===1||d;let s=0;if(l){const h=f.renderQueue;h!=null&&(m?s=this._renderQueueMapTransparentZWrite.get(h):s=this._renderQueueMapTransparent.get(h))}return s}_populateRenderQueueMap(f){const r=new Set,c=new Set;f.forEach(d=>{var l,m;const s=d.shader==="VRM/UnlitTransparentZWrite",h=((l=d.keywordMap)==null?void 0:l._ALPHABLEND_ON)!=null||d.shader==="VRM/UnlitTransparent"||s,p=((m=d.floatProperties)==null?void 0:m._ZWrite)===1||s;if(h){const a=d.renderQueue;a!=null&&(p?c.add(a):r.add(a))}}),r.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${r.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),c.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${c.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(r).sort().forEach((d,l)=>{const m=Math.min(Math.max(l-r.size+1,-9),0);this._renderQueueMapTransparent.set(d,m)}),Array.from(c).sort().forEach((d,l)=>{const m=Math.min(Math.max(l,0),9);this._renderQueueMapTransparentZWrite.set(d,m)})}},__async6=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),_v3A6=new Vector3,VRMNodeConstraintHelper=class extends Group{constructor(f){super(),this._attrPosition=new BufferAttribute(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(DynamicDrawUsage);const r=new BufferGeometry;r.setAttribute("position",this._attrPosition);const c=new LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new Line(r,c),this.add(this._line),this.constraint=f}updateMatrixWorld(f){_v3A6.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,_v3A6.x,_v3A6.y,_v3A6.z),this.constraint.source&&_v3A6.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,_v3A6.x,_v3A6.y,_v3A6.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(f)}};function decomposePosition(f,r){return r.set(f.elements[12],f.elements[13],f.elements[14])}var _v3A22=new Vector3,_v3B4=new Vector3;function decomposeRotation(f,r){return f.decompose(_v3A22,r,_v3B4),r}function quatInvertCompat2(f){return f.invert?f.invert():f.inverse(),f}var VRMNodeConstraint=class{constructor(f,r){this.destination=f,this.source=r,this.weight=1}},_v3A32=new Vector3,_v3B22=new Vector3,_v3C2=new Vector3,_quatA7=new Quaternion,_quatB4=new Quaternion,_quatC2=new Quaternion,VRMAimConstraint=class extends VRMNodeConstraint{get aimAxis(){return this._aimAxis}set aimAxis(f){this._aimAxis=f,this._v3AimAxis.set(f==="PositiveX"?1:f==="NegativeX"?-1:0,f==="PositiveY"?1:f==="NegativeY"?-1:0,f==="PositiveZ"?1:f==="NegativeZ"?-1:0)}get dependencies(){const f=new Set([this.source]);return this.destination.parent&&f.add(this.destination.parent),f}constructor(f,r){super(f,r),this._aimAxis="PositiveX",this._v3AimAxis=new Vector3(1,0,0),this._dstRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);const f=_quatA7.identity(),r=_quatB4.identity();this.destination.parent&&(decomposeRotation(this.destination.parent.matrixWorld,f),quatInvertCompat2(r.copy(f)));const c=_v3A32.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(f),d=decomposePosition(this.source.matrixWorld,_v3B22).sub(decomposePosition(this.destination.matrixWorld,_v3C2)).normalize(),l=_quatC2.setFromUnitVectors(c,d).premultiply(r).multiply(f).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(l,this.weight)}};function traverseAncestorsFromRoot(f,r){const c=[f];let d=f.parent;for(;d!==null;)c.unshift(d),d=d.parent;c.forEach(l=>{r(l)})}var VRMNodeConstraintManager=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(f){this._constraints.add(f);let r=this._objectConstraintsMap.get(f.destination);r==null&&(r=new Set,this._objectConstraintsMap.set(f.destination,r)),r.add(f)}deleteConstraint(f){this._constraints.delete(f),this._objectConstraintsMap.get(f.destination).delete(f)}setInitState(){const f=new Set,r=new Set;for(const c of this._constraints)this._processConstraint(c,f,r,d=>d.setInitState())}update(){const f=new Set,r=new Set;for(const c of this._constraints)this._processConstraint(c,f,r,d=>d.update())}_processConstraint(f,r,c,d){if(c.has(f))return;if(r.has(f))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");r.add(f);const l=f.dependencies;for(const m of l)traverseAncestorsFromRoot(m,s=>{const h=this._objectConstraintsMap.get(s);if(h)for(const p of h)this._processConstraint(p,r,c,d)});d(f),c.add(f)}},_quatA22=new Quaternion,_quatB22=new Quaternion,VRMRotationConstraint=class extends VRMNodeConstraint{get dependencies(){return new Set([this.source])}constructor(f,r){super(f,r),this._dstRestQuat=new Quaternion,this._invSrcRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),quatInvertCompat2(this._invSrcRestQuat.copy(this.source.quaternion))}update(){const f=_quatA22.copy(this._invSrcRestQuat).multiply(this.source.quaternion),r=_quatB22.copy(this._dstRestQuat).multiply(f);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}},_v3A42=new Vector3,_quatA32=new Quaternion,_quatB32=new Quaternion,VRMRollConstraint=class extends VRMNodeConstraint{get rollAxis(){return this._rollAxis}set rollAxis(f){this._rollAxis=f,this._v3RollAxis.set(f==="X"?1:0,f==="Y"?1:0,f==="Z"?1:0)}get dependencies(){return new Set([this.source])}constructor(f,r){super(f,r),this._rollAxis="X",this._v3RollAxis=new Vector3(1,0,0),this._dstRestQuat=new Quaternion,this._invDstRestQuat=new Quaternion,this._invSrcRestQuatMulDstRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),quatInvertCompat2(this._invDstRestQuat.copy(this._dstRestQuat)),quatInvertCompat2(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){const f=_quatA32.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),r=_v3A42.copy(this._v3RollAxis).applyQuaternion(f),d=_quatB32.setFromUnitVectors(r,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(f);this.destination.quaternion.copy(this._dstRestQuat).slerp(d,this.weight)}},POSSIBLE_SPEC_VERSIONS7=new Set(["1.0","1.0-beta"]),_VRMNodeConstraintLoaderPlugin=class Rt{get name(){return Rt.EXTENSION_NAME}constructor(r,c){this.parser=r,this.helperRoot=c==null?void 0:c.helperRoot}afterRoot(r){return __async6(this,null,function*(){r.userData.vrmNodeConstraintManager=yield this._import(r)})}_import(r){return __async6(this,null,function*(){var c;const d=this.parser.json;if(!(((c=d.extensionsUsed)==null?void 0:c.indexOf(Rt.EXTENSION_NAME))!==-1))return null;const m=new VRMNodeConstraintManager,s=yield this.parser.getDependencies("node");return s.forEach((h,p)=>{var a;const o=d.nodes[p],t=(a=o==null?void 0:o.extensions)==null?void 0:a[Rt.EXTENSION_NAME];if(t==null)return;const e=t.specVersion;if(!POSSIBLE_SPEC_VERSIONS7.has(e)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${Rt.EXTENSION_NAME} specVersion "${e}"`);return}const n=t.constraint;if(n.roll!=null){const i=this._importRollConstraint(h,s,n.roll);m.addConstraint(i)}else if(n.aim!=null){const i=this._importAimConstraint(h,s,n.aim);m.addConstraint(i)}else if(n.rotation!=null){const i=this._importRotationConstraint(h,s,n.rotation);m.addConstraint(i)}}),r.scene.updateMatrixWorld(),m.setInitState(),m})}_importRollConstraint(r,c,d){const{source:l,rollAxis:m,weight:s}=d,h=c[l],p=new VRMRollConstraint(r,h);if(m!=null&&(p.rollAxis=m),s!=null&&(p.weight=s),this.helperRoot){const a=new VRMNodeConstraintHelper(p);this.helperRoot.add(a)}return p}_importAimConstraint(r,c,d){const{source:l,aimAxis:m,weight:s}=d,h=c[l],p=new VRMAimConstraint(r,h);if(m!=null&&(p.aimAxis=m),s!=null&&(p.weight=s),this.helperRoot){const a=new VRMNodeConstraintHelper(p);this.helperRoot.add(a)}return p}_importRotationConstraint(r,c,d){const{source:l,weight:m}=d,s=c[l],h=new VRMRotationConstraint(r,s);if(m!=null&&(h.weight=m),this.helperRoot){const p=new VRMNodeConstraintHelper(h);this.helperRoot.add(p)}return h}};_VRMNodeConstraintLoaderPlugin.EXTENSION_NAME="VRMC_node_constraint";var VRMNodeConstraintLoaderPlugin=_VRMNodeConstraintLoaderPlugin,__async7=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),VRMSpringBoneColliderShape=class{},_v3A7=new Vector3,_v3B5=new Vector3,VRMSpringBoneColliderShapeCapsule=class extends VRMSpringBoneColliderShape{get type(){return"capsule"}constructor(f){var r,c,d,l;super(),this.offset=(r=f==null?void 0:f.offset)!=null?r:new Vector3(0,0,0),this.tail=(c=f==null?void 0:f.tail)!=null?c:new Vector3(0,0,0),this.radius=(d=f==null?void 0:f.radius)!=null?d:0,this.inside=(l=f==null?void 0:f.inside)!=null?l:!1}calculateCollision(f,r,c,d){_v3A7.setFromMatrixPosition(f),_v3B5.subVectors(this.tail,this.offset).applyMatrix4(f),_v3B5.sub(_v3A7);const l=_v3B5.lengthSq();d.copy(r).sub(_v3A7);const m=_v3B5.dot(d);m<=0||(l<=m||_v3B5.multiplyScalar(m/l),d.sub(_v3B5));const s=d.length(),h=this.inside?this.radius-c-s:s-c-this.radius;return h<0&&(d.multiplyScalar(1/s),this.inside&&d.negate()),h}},_v3A23=new Vector3,_mat3A=new Matrix3,VRMSpringBoneColliderShapePlane=class extends VRMSpringBoneColliderShape{get type(){return"plane"}constructor(f){var r,c;super(),this.offset=(r=f==null?void 0:f.offset)!=null?r:new Vector3(0,0,0),this.normal=(c=f==null?void 0:f.normal)!=null?c:new Vector3(0,0,1)}calculateCollision(f,r,c,d){d.setFromMatrixPosition(f),d.negate().add(r),_mat3A.getNormalMatrix(f),_v3A23.copy(this.normal).applyNormalMatrix(_mat3A).normalize();const l=d.dot(_v3A23)-c;return d.copy(_v3A23),l}},_v3A33=new Vector3,VRMSpringBoneColliderShapeSphere=class extends VRMSpringBoneColliderShape{get type(){return"sphere"}constructor(f){var r,c,d;super(),this.offset=(r=f==null?void 0:f.offset)!=null?r:new Vector3(0,0,0),this.radius=(c=f==null?void 0:f.radius)!=null?c:0,this.inside=(d=f==null?void 0:f.inside)!=null?d:!1}calculateCollision(f,r,c,d){d.subVectors(r,_v3A33.setFromMatrixPosition(f));const l=d.length(),m=this.inside?this.radius-c-l:l-c-this.radius;return m<0&&(d.multiplyScalar(1/l),this.inside&&d.negate()),m}},_v3A43=new Vector3,ColliderShapeCapsuleBufferGeometry=class extends BufferGeometry{constructor(f){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new Vector3,this._currentTail=new Vector3,this._shape=f,this._attrPos=new BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;const r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,f=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),f=!0);const c=_v3A43.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(c)>1e-10&&(this._currentTail.copy(c),f=!0),f&&this._buildPosition()}_buildPosition(){_v3A43.copy(this._currentTail).sub(this._currentOffset);const f=_v3A43.length()/this._currentRadius;for(let d=0;d<=16;d++){const l=d/16*Math.PI;this._attrPos.setXYZ(d,-Math.sin(l),-Math.cos(l),0),this._attrPos.setXYZ(17+d,f+Math.sin(l),Math.cos(l),0),this._attrPos.setXYZ(34+d,-Math.sin(l),0,-Math.cos(l)),this._attrPos.setXYZ(51+d,f+Math.sin(l),0,Math.cos(l))}for(let d=0;d<32;d++){const l=d/16*Math.PI;this._attrPos.setXYZ(68+d,0,Math.sin(l),Math.cos(l)),this._attrPos.setXYZ(100+d,f,Math.sin(l),Math.cos(l))}const r=Math.atan2(_v3A43.y,Math.sqrt(_v3A43.x*_v3A43.x+_v3A43.z*_v3A43.z)),c=-Math.atan2(_v3A43.z,_v3A43.x);this.rotateZ(r),this.rotateY(c),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<34;f++){const r=(f+1)%34;this._attrIndex.setXY(f*2,f,r),this._attrIndex.setXY(68+f*2,34+f,34+r)}for(let f=0;f<32;f++){const r=(f+1)%32;this._attrIndex.setXY(136+f*2,68+f,68+r),this._attrIndex.setXY(200+f*2,100+f,100+r)}this._attrIndex.needsUpdate=!0}},ColliderShapePlaneBufferGeometry=class extends BufferGeometry{constructor(f){super(),this.worldScale=1,this._currentOffset=new Vector3,this._currentNormal=new Vector3,this._shape=f,this._attrPos=new BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),f=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),f=!0),f&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},ColliderShapeSphereBufferGeometry=class extends BufferGeometry{constructor(f){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new Vector3,this._shape=f,this._attrPos=new BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;const r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,f=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),f=!0),f&&this._buildPosition()}_buildPosition(){for(let f=0;f<32;f++){const r=f/16*Math.PI;this._attrPos.setXYZ(f,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+f,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+f,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<32;f++){const r=(f+1)%32;this._attrIndex.setXY(f*2,f,r),this._attrIndex.setXY(64+f*2,32+f,32+r),this._attrIndex.setXY(128+f*2,64+f,64+r)}this._attrIndex.needsUpdate=!0}},_v3A52=new Vector3,VRMSpringBoneColliderHelper=class extends Group{constructor(f){if(super(),this.matrixAutoUpdate=!1,this.collider=f,this.collider.shape instanceof VRMSpringBoneColliderShapeSphere)this._geometry=new ColliderShapeSphereBufferGeometry(this.collider.shape);else if(this.collider.shape instanceof VRMSpringBoneColliderShapeCapsule)this._geometry=new ColliderShapeCapsuleBufferGeometry(this.collider.shape);else if(this.collider.shape instanceof VRMSpringBoneColliderShapePlane)this._geometry=new ColliderShapePlaneBufferGeometry(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");const r=new LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new LineSegments(this._geometry,r),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(f){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);const r=this.matrix.elements;this._geometry.worldScale=_v3A52.set(r[0],r[1],r[2]).length(),this._geometry.update(),super.updateMatrixWorld(f)}},SpringBoneBufferGeometry=class extends BufferGeometry{constructor(f){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new Vector3,this._springBone=f,this._attrPos=new BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;const r=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,f=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),f=!0),f&&this._buildPosition()}_buildPosition(){for(let f=0;f<32;f++){const r=f/16*Math.PI;this._attrPos.setXYZ(f,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+f,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+f,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<32;f++){const r=(f+1)%32;this._attrIndex.setXY(f*2,f,r),this._attrIndex.setXY(64+f*2,32+f,32+r),this._attrIndex.setXY(128+f*2,64+f,64+r)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},_v3A62=new Vector3,VRMSpringBoneJointHelper=class extends Group{constructor(f){super(),this.matrixAutoUpdate=!1,this.springBone=f,this._geometry=new SpringBoneBufferGeometry(this.springBone);const r=new LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new LineSegments(this._geometry,r),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(f){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);const r=this.matrix.elements;this._geometry.worldScale=_v3A62.set(r[0],r[1],r[2]).length(),this._geometry.update(),super.updateMatrixWorld(f)}},VRMSpringBoneCollider=class extends Object3D{constructor(f){super(),this.colliderMatrix=new Matrix4,this.shape=f}updateWorldMatrix(f,r){super.updateWorldMatrix(f,r),updateColliderMatrix(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function updateColliderMatrix(f,r,c){const d=r.elements;f.copy(r),c&&(f.elements[12]=d[0]*c.x+d[4]*c.y+d[8]*c.z+d[12],f.elements[13]=d[1]*c.x+d[5]*c.y+d[9]*c.z+d[13],f.elements[14]=d[2]*c.x+d[6]*c.y+d[10]*c.z+d[14])}var _matA=new Matrix4;function mat4InvertCompat(f){return f.invert?f.invert():f.getInverse(_matA.copy(f)),f}var Matrix4InverseCache=class{constructor(f){this._inverseCache=new Matrix4,this._shouldUpdateInverse=!0,this.matrix=f;const r={set:(c,d,l)=>(this._shouldUpdateInverse=!0,c[d]=l,!0)};this._originalElements=f.elements,f.elements=new Proxy(f.elements,r)}get inverse(){return this._shouldUpdateInverse&&(mat4InvertCompat(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},IDENTITY_MATRIX4=new Matrix4,_v3A72=new Vector3,_v3B23=new Vector3,_worldSpacePosition=new Vector3,_nextTail=new Vector3,_matA2=new Matrix4,VRMSpringBoneJoint=class{constructor(f,r,c={},d=[]){this._currentTail=new Vector3,this._prevTail=new Vector3,this._boneAxis=new Vector3,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new Matrix4,this._initialLocalRotation=new Quaternion,this._initialLocalChildPosition=new Vector3;var l,m,s,h,p,a;this.bone=f,this.bone.matrixAutoUpdate=!1,this.child=r,this.settings={hitRadius:(l=c.hitRadius)!=null?l:0,stiffness:(m=c.stiffness)!=null?m:1,gravityPower:(s=c.gravityPower)!=null?s:0,gravityDir:(p=(h=c.gravityDir)==null?void 0:h.clone())!=null?p:new Vector3(0,-1,0),dragForce:(a=c.dragForce)!=null?a:.4},this.colliderGroups=d}get dependencies(){const f=new Set,r=this.bone.parent;r&&f.add(r);for(let c=0;c{r(l)})}function traverseChildrenUntilConditionMet(f,r){f.children.forEach(c=>{r(c)||traverseChildrenUntilConditionMet(c,r)})}function lowestCommonAncestor(f){var r;const c=new Map;for(const d of f){let l=d;do{const m=((r=c.get(l))!=null?r:0)+1;if(m===f.size)return l;c.set(l,m),l=l.parent}while(l!==null)}return null}var VRMSpringBoneManager=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._isSortedJointsDirty=!1,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){const f=new Set;return this._joints.forEach(r=>{r.colliderGroups.forEach(c=>{f.add(c)})}),Array.from(f)}get colliders(){const f=new Set;return this.colliderGroups.forEach(r=>{r.colliders.forEach(c=>{f.add(c)})}),Array.from(f)}addJoint(f){this._joints.add(f);let r=this._objectSpringBonesMap.get(f.bone);r==null&&(r=new Set,this._objectSpringBonesMap.set(f.bone,r)),r.add(f),this._isSortedJointsDirty=!0}addSpringBone(f){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(f)}deleteJoint(f){this._joints.delete(f),this._objectSpringBonesMap.get(f.bone).delete(f),this._isSortedJointsDirty=!0}deleteSpringBone(f){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(f)}setInitState(){this._sortJoints();for(let f=0;f{var s,h;return((h=(s=this._objectSpringBonesMap.get(m))==null?void 0:s.size)!=null?h:0)>0?!0:(this._ancestors.push(m),!1)})),this._isSortedJointsDirty=!1}_insertJointSort(f,r,c,d,l){if(c.has(f))return;if(r.has(f)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}r.add(f);const m=f.dependencies;for(const s of m){let h=!1,p=null;traverseAncestorsFromRoot2(s,a=>{const o=this._objectSpringBonesMap.get(a);if(o)for(const t of o)h=!0,this._insertJointSort(t,r,c,d,l);else h||(p=a)}),p&&l.add(p)}d.push(f),c.add(f)}_relevantChildrenUpdated(f){var r,c;return((c=(r=this._objectSpringBonesMap.get(f))==null?void 0:r.size)!=null?c:0)>0?!0:(f.updateWorldMatrix(!1,!1),!1)}},EXTENSION_NAME_EXTENDED_COLLIDER="VRMC_springBone_extended_collider",POSSIBLE_SPEC_VERSIONS8=new Set(["1.0","1.0-beta"]),POSSIBLE_SPEC_VERSIONS_EXTENDED_COLLIDERS=new Set(["1.0"]),_VRMSpringBoneLoaderPlugin=class Pt{get name(){return Pt.EXTENSION_NAME}constructor(r,c){var d;this.parser=r,this.jointHelperRoot=c==null?void 0:c.jointHelperRoot,this.colliderHelperRoot=c==null?void 0:c.colliderHelperRoot,this.useExtendedColliders=(d=c==null?void 0:c.useExtendedColliders)!=null?d:!0}afterRoot(r){return __async7(this,null,function*(){r.userData.vrmSpringBoneManager=yield this._import(r)})}_import(r){return __async7(this,null,function*(){const c=yield this._v1Import(r);if(c!=null)return c;const d=yield this._v0Import(r);return d??null})}_v1Import(r){return __async7(this,null,function*(){var c,d,l,m,s;const h=r.parser.json;if(!(((c=h.extensionsUsed)==null?void 0:c.indexOf(Pt.EXTENSION_NAME))!==-1))return null;const a=new VRMSpringBoneManager,o=yield r.parser.getDependencies("node"),t=(d=h.extensions)==null?void 0:d[Pt.EXTENSION_NAME];if(!t)return null;const e=t.specVersion;if(!POSSIBLE_SPEC_VERSIONS8.has(e))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Pt.EXTENSION_NAME} specVersion "${e}"`),null;const n=(l=t.colliders)==null?void 0:l.map((u,g)=>{var b,y,_,v,w,T,A,E,x,M,C,k,V,F,q;const D=o[u.node];if(D==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${g} attempted to use the node #${u.node} but not found`),null;const U=u.shape,J=(b=u.extensions)==null?void 0:b[EXTENSION_NAME_EXTENDED_COLLIDER];if(this.useExtendedColliders&&J!=null){const Y=J.specVersion;if(!POSSIBLE_SPEC_VERSIONS_EXTENDED_COLLIDERS.has(Y))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${EXTENSION_NAME_EXTENDED_COLLIDER} specVersion "${Y}". Fallbacking to the ${Pt.EXTENSION_NAME} definition`);else{const Z=J.shape;if(Z.sphere)return this._importSphereCollider(D,{offset:new Vector3().fromArray((y=Z.sphere.offset)!=null?y:[0,0,0]),radius:(_=Z.sphere.radius)!=null?_:0,inside:(v=Z.sphere.inside)!=null?v:!1});if(Z.capsule)return this._importCapsuleCollider(D,{offset:new Vector3().fromArray((w=Z.capsule.offset)!=null?w:[0,0,0]),radius:(T=Z.capsule.radius)!=null?T:0,tail:new Vector3().fromArray((A=Z.capsule.tail)!=null?A:[0,0,0]),inside:(E=Z.capsule.inside)!=null?E:!1});if(Z.plane)return this._importPlaneCollider(D,{offset:new Vector3().fromArray((x=Z.plane.offset)!=null?x:[0,0,0]),normal:new Vector3().fromArray((M=Z.plane.normal)!=null?M:[0,0,1])})}}if(U.sphere)return this._importSphereCollider(D,{offset:new Vector3().fromArray((C=U.sphere.offset)!=null?C:[0,0,0]),radius:(k=U.sphere.radius)!=null?k:0,inside:!1});if(U.capsule)return this._importCapsuleCollider(D,{offset:new Vector3().fromArray((V=U.capsule.offset)!=null?V:[0,0,0]),radius:(F=U.capsule.radius)!=null?F:0,tail:new Vector3().fromArray((q=U.capsule.tail)!=null?q:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${g} has no valid shape`)}),i=(m=t.colliderGroups)==null?void 0:m.map((u,g)=>{var b;return{colliders:((b=u.colliders)!=null?b:[]).flatMap(_=>{const v=n==null?void 0:n[_];return v??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${g} attempted to use a collider #${_} but not found`),[])}),name:u.name}});return(s=t.springs)==null||s.forEach((u,g)=>{var b;const y=u.joints,_=(b=u.colliderGroups)==null?void 0:b.map(T=>{const A=i==null?void 0:i[T];if(A==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${g} attempted to use a colliderGroup ${T} but not found`);return A}),v=u.center!=null?o[u.center]:void 0;let w;y.forEach(T=>{if(w){const A=w.node,E=o[A],x=T.node,M=o[x],C={hitRadius:w.hitRadius,dragForce:w.dragForce,gravityPower:w.gravityPower,stiffness:w.stiffness,gravityDir:w.gravityDir!=null?new Vector3().fromArray(w.gravityDir):void 0},k=this._importJoint(E,M,C,_);v&&(k.center=v),a.addJoint(k)}w=T})}),a.setInitState(),a})}_v0Import(r){return __async7(this,null,function*(){var c,d,l;const m=r.parser.json;if(!(((c=m.extensionsUsed)==null?void 0:c.indexOf("VRM"))!==-1))return null;const h=(d=m.extensions)==null?void 0:d.VRM,p=h==null?void 0:h.secondaryAnimation;if(!p)return null;const a=p==null?void 0:p.boneGroups;if(!a)return null;const o=new VRMSpringBoneManager,t=yield r.parser.getDependencies("node"),e=(l=p.colliderGroups)==null?void 0:l.map(n=>{var i;const u=t[n.node];return{colliders:((i=n.colliders)!=null?i:[]).map((b,y)=>{var _,v,w;const T=new Vector3(0,0,0);return b.offset&&T.set((_=b.offset.x)!=null?_:0,(v=b.offset.y)!=null?v:0,b.offset.z?-b.offset.z:0),this._importSphereCollider(u,{offset:T,radius:(w=b.radius)!=null?w:0,inside:!1})})}});return a==null||a.forEach((n,i)=>{const u=n.bones;u&&u.forEach(g=>{var b,y,_,v;const w=t[g],T=new Vector3;n.gravityDir?T.set((b=n.gravityDir.x)!=null?b:0,(y=n.gravityDir.y)!=null?y:0,(_=n.gravityDir.z)!=null?_:0):T.set(0,-1,0);const A=n.center!=null?t[n.center]:void 0,E={hitRadius:n.hitRadius,dragForce:n.dragForce,gravityPower:n.gravityPower,stiffness:n.stiffiness,gravityDir:T},x=(v=n.colliderGroups)==null?void 0:v.map(M=>{const C=e==null?void 0:e[M];if(C==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${i} attempted to use a colliderGroup ${M} but not found`);return C});w.traverse(M=>{var C;const k=(C=M.children[0])!=null?C:null,V=this._importJoint(M,k,E,x);A&&(V.center=A),o.addJoint(V)})})}),r.scene.updateMatrixWorld(),o.setInitState(),o})}_importJoint(r,c,d,l){const m=new VRMSpringBoneJoint(r,c,d,l);if(this.jointHelperRoot){const s=new VRMSpringBoneJointHelper(m);this.jointHelperRoot.add(s),s.renderOrder=this.jointHelperRoot.renderOrder}return m}_importSphereCollider(r,c){const d=new VRMSpringBoneColliderShapeSphere(c),l=new VRMSpringBoneCollider(d);if(r.add(l),this.colliderHelperRoot){const m=new VRMSpringBoneColliderHelper(l);this.colliderHelperRoot.add(m),m.renderOrder=this.colliderHelperRoot.renderOrder}return l}_importCapsuleCollider(r,c){const d=new VRMSpringBoneColliderShapeCapsule(c),l=new VRMSpringBoneCollider(d);if(r.add(l),this.colliderHelperRoot){const m=new VRMSpringBoneColliderHelper(l);this.colliderHelperRoot.add(m),m.renderOrder=this.colliderHelperRoot.renderOrder}return l}_importPlaneCollider(r,c){const d=new VRMSpringBoneColliderShapePlane(c),l=new VRMSpringBoneCollider(d);if(r.add(l),this.colliderHelperRoot){const m=new VRMSpringBoneColliderHelper(l);this.colliderHelperRoot.add(m),m.renderOrder=this.colliderHelperRoot.renderOrder}return l}};_VRMSpringBoneLoaderPlugin.EXTENSION_NAME="VRMC_springBone";var VRMSpringBoneLoaderPlugin=_VRMSpringBoneLoaderPlugin,VRMLoaderPlugin=class{get name(){return"VRMLoaderPlugin"}constructor(f,r){var c,d,l,m,s,h,p,a,o,t;this.parser=f;const e=r==null?void 0:r.helperRoot,n=r==null?void 0:r.autoUpdateHumanBones;this.expressionPlugin=(c=r==null?void 0:r.expressionPlugin)!=null?c:new VRMExpressionLoaderPlugin(f),this.firstPersonPlugin=(d=r==null?void 0:r.firstPersonPlugin)!=null?d:new VRMFirstPersonLoaderPlugin(f),this.humanoidPlugin=(l=r==null?void 0:r.humanoidPlugin)!=null?l:new VRMHumanoidLoaderPlugin(f,{helperRoot:e,autoUpdateHumanBones:n}),this.lookAtPlugin=(m=r==null?void 0:r.lookAtPlugin)!=null?m:new VRMLookAtLoaderPlugin(f,{helperRoot:e}),this.metaPlugin=(s=r==null?void 0:r.metaPlugin)!=null?s:new VRMMetaLoaderPlugin(f),this.mtoonMaterialPlugin=(h=r==null?void 0:r.mtoonMaterialPlugin)!=null?h:new MToonMaterialLoaderPlugin(f),this.materialsHDREmissiveMultiplierPlugin=(p=r==null?void 0:r.materialsHDREmissiveMultiplierPlugin)!=null?p:new VRMMaterialsHDREmissiveMultiplierLoaderPlugin(f),this.materialsV0CompatPlugin=(a=r==null?void 0:r.materialsV0CompatPlugin)!=null?a:new VRMMaterialsV0CompatPlugin(f),this.springBonePlugin=(o=r==null?void 0:r.springBonePlugin)!=null?o:new VRMSpringBoneLoaderPlugin(f,{colliderHelperRoot:e,jointHelperRoot:e}),this.nodeConstraintPlugin=(t=r==null?void 0:r.nodeConstraintPlugin)!=null?t:new VRMNodeConstraintLoaderPlugin(f,{helperRoot:e})}beforeRoot(){return __async(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(f){return __async(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(f)})}getMaterialType(f){const r=this.mtoonMaterialPlugin.getMaterialType(f);return r??null}extendMaterialParams(f,r){return __async(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(f,r),yield this.mtoonMaterialPlugin.extendMaterialParams(f,r)})}afterRoot(f){return __async(this,null,function*(){yield this.metaPlugin.afterRoot(f),yield this.humanoidPlugin.afterRoot(f),yield this.expressionPlugin.afterRoot(f),yield this.lookAtPlugin.afterRoot(f),yield this.firstPersonPlugin.afterRoot(f),yield this.springBonePlugin.afterRoot(f),yield this.nodeConstraintPlugin.afterRoot(f),yield this.mtoonMaterialPlugin.afterRoot(f);const r=f.userData.vrmMeta,c=f.userData.vrmHumanoid;if(r&&c){const d=new VRM({scene:f.scene,expressionManager:f.userData.vrmExpressionManager,firstPerson:f.userData.vrmFirstPerson,humanoid:c,lookAt:f.userData.vrmLookAt,meta:r,materials:f.userData.vrmMToonMaterials,springBoneManager:f.userData.vrmSpringBoneManager,nodeConstraintManager:f.userData.vrmNodeConstraintManager});f.userData.vrm=d}})}};function collectMeshes(f){const r=new Set;return f.traverse(c=>{if(!c.isMesh)return;const d=c;r.add(d)}),r}function combineMorph(f,r,c){if(r.size===1){const s=r.values().next().value;if(s.weight===1)return f[s.index]}const d=new Float32Array(f[0].count*3);let l=0;if(c)l=1;else for(const s of r)l+=s.weight;for(const s of r){const h=f[s.index],p=s.weight/l;for(let a=0;ao.getOrCreate(x)).join(","),A=`${v};${b};${T}`;let E=h.get(A);E==null&&(E=_.clone(),remapSkinIndexAttribute(E,w,i),h.set(A,E)),y.geometry.setAttribute("skinIndex",E)}for(const y of n)y.bind(g,new Matrix4)}}function collectSkinnedMeshes(f){const r=new Set;return f.traverse(c=>{if(!c.isSkinnedMesh)return;const d=c;r.add(d)}),r}function listUsedIndices(f,r){const c=new Set;for(let d=0;dc)return!1;return!0}var ObjectIndexDispatcher=class{constructor(){this._objectIndexMap=new Map,this._index=0}get(f){return this._objectIndexMap.get(f)}getOrCreate(f){let r=this._objectIndexMap.get(f);return r==null&&(r=this._index,this._objectIndexMap.set(f,r),this._index++),r}};function shallowCloneBufferGeometry(f){var r,c,d,l;const m=new BufferGeometry;m.name=f.name,m.setIndex(f.index);for(const[s,h]of Object.entries(f.attributes))m.setAttribute(s,h);for(const[s,h]of Object.entries(f.morphAttributes)){const p=s;m.morphAttributes[p]=h.concat()}m.morphTargetsRelative=f.morphTargetsRelative,m.groups=[];for(const s of f.groups)m.addGroup(s.start,s.count,s.materialIndex);return m.boundingSphere=(c=(r=f.boundingSphere)==null?void 0:r.clone())!=null?c:null,m.boundingBox=(l=(d=f.boundingBox)==null?void 0:d.clone())!=null?l:null,m.drawRange.start=f.drawRange.start,m.drawRange.count=f.drawRange.count,m.userData=f.userData,m}function disposeMaterial(f){if(Object.values(f).forEach(r=>{r!=null&&r.isTexture&&r.dispose()}),f.isShaderMaterial){const r=f.uniforms;r&&Object.values(r).forEach(c=>{const d=c.value;d!=null&&d.isTexture&&d.dispose()})}f.dispose()}function dispose(f){const r=f.geometry;r&&r.dispose();const c=f.skeleton;c&&c.dispose();const d=f.material;d&&(Array.isArray(d)?d.forEach(l=>disposeMaterial(l)):d&&disposeMaterial(d))}function deepDispose(f){f.traverse(dispose)}function removeUnnecessaryJoints(f,r){var c,d;console.warn("VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.");const l=(c=r==null?void 0:r.experimentalSameBoneCounts)!=null?c:!1,m=[];f.traverse(p=>{p.type==="SkinnedMesh"&&m.push(p)});const s=new Map;let h=0;for(const p of m){const o=p.geometry.getAttribute("skinIndex");if(s.has(o))continue;const t=new Map,e=new Map;for(let n=0;n{var d,l,m,s;if(!c.isMesh)return;const h=c,p=h.geometry,a=p.index;if(a==null)return;const o=r.get(p);if(o!=null){h.geometry=o;return}const t=Object.values(p.attributes)[0].count,e=new Array(t);let n=0;const i=a.array;for(let v=0;v{y.addGroup(v.start,v.count,v.materialIndex)}),y.boundingBox=(l=(d=p.boundingBox)==null?void 0:d.clone())!=null?l:null,y.boundingSphere=(s=(m=p.boundingSphere)==null?void 0:m.clone())!=null?s:null,y.setDrawRange(p.drawRange.start,p.drawRange.count),y.userData=p.userData,r.set(p,y);{const v=a.array,w=new v.constructor(v.length);for(let T=0;T{const w=p.attributes[v];if(w.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");const T=w.array,{itemSize:A,normalized:E}=w,x=new T.constructor(g.length*A);g.forEach((M,C)=>{for(let k=0;k{for(let q=0;qV===0),y.morphAttributes[T][A]=new BufferAttribute(k,M,C)}}_&&(y.morphAttributes={}),h.geometry=y}),Array.from(r.keys()).forEach(c=>{c.dispose()})}function rotateVRM0(f){var r;((r=f.meta)==null?void 0:r.metaVersion)==="0"&&(f.scene.rotation.y=Math.PI)}var VRMUtils=class{constructor(){}};VRMUtils.combineMorphs=combineMorphs;VRMUtils.combineSkeletons=combineSkeletons;VRMUtils.deepDispose=deepDispose;VRMUtils.removeUnnecessaryJoints=removeUnnecessaryJoints;VRMUtils.removeUnnecessaryVertices=removeUnnecessaryVertices;VRMUtils.rotateVRM0=rotateVRM0;/*! - * @pixiv/three-vrm-core v3.4.1 - * The implementation of core features of VRM, for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-core is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-materials-mtoon v3.4.1 - * MToon (toon material) module for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-materials-mtoon is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.4.1 - * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-materials-hdr-emissive-multiplier is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-materials-v0compat v3.4.1 - * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-materials-v0compat is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-node-constraint v3.4.1 - * Node constraint module for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-node-constraint is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-springbone v3.4.1 - * Spring bone module for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-springbone is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - */export{VRMLoaderPlugin as V,VRMAnimationLoaderPlugin as a,VRMUtils as b,createVRMAnimationClip as c,distExports as d,VRMLookAtQuaternionProxy as e,randomSaccadeInterval as r}; diff --git a/assets/together-ai-BvvRfg0N.js b/assets/together-ai-BvvRfg0N.js new file mode 100644 index 0000000000000000000000000000000000000000..8c286e7f3fa789e728ef6351850c4bc2bde0aec4 --- /dev/null +++ b/assets/together-ai-BvvRfg0N.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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/together-ai-Cyv9-plj.js b/assets/together-ai-Cyv9-plj.js deleted file mode 100644 index fda3b5cbecaf0f756357dec012022c2580553aba..0000000000000000000000000000000000000000 --- a/assets/together-ai-Cyv9-plj.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as h,$ as y,V as U,a0 as $,f as c,T as k,w as K,bf as x,o as z,bg as m,b as l,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as w}from"./providers-DepZj6_J.js";import{_ as C}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as P}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const o="together-ai",B=h({__name:"together-ai",setup(I){const{t:u}=y(),b=U(),d=w(),{providers:a}=$(d),n=c(()=>d.getProviderMetadata(o)),i=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),s=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});k(()=>{var e,r;d.initializeProvider(o),i.value=((e=a.value[o])==null?void 0:e.apiKey)||"",s.value=((r=a.value[o])==null?void 0:r.baseUrl)||""}),K([i,s],()=>{a.value[o]={...a.value[o],apiKey:i.value,baseUrl:s.value||""}});function g(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var v,f;return z(),x(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:m(()=>[l(t(R),null,{default:m(()=>[l(t(P),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(M),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=V=>i.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/types-D50Xq0so.js b/assets/types-D50Xq0so.js new file mode 100644 index 0000000000000000000000000000000000000000..0a76efdab1e5a36fab2e7e9bad258d4117db0a32 --- /dev/null +++ b/assets/types-D50Xq0so.js @@ -0,0 +1 @@ +var e;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(e||={});var t;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(t||={});const n=e.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),r=e=>{let t=typeof e;switch(t){case`undefined`:return n.undefined;case`string`:return n.string;case`number`:return Number.isNaN(e)?n.nan:n.number;case`boolean`:return n.boolean;case`function`:return n.function;case`bigint`:return n.bigint;case`symbol`:return n.symbol;case`object`:return Array.isArray(e)?n.array:e===null?n.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?n.promise:typeof Map<`u`&&e instanceof Map?n.map:typeof Set<`u`&&e instanceof Set?n.set:typeof Date<`u`&&e instanceof Date?n.date:n.object;default:return n.unknown}},i=e.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]);var a=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};a.create=e=>{let t=new a(e);return t};const o=(t,r)=>{let a;switch(t.code){case i.invalid_type:a=t.received===n.undefined?`Required`:`Expected ${t.expected}, received ${t.received}`;break;case i.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case i.unrecognized_keys:a=`Unrecognized key(s) in object: ${e.joinValues(t.keys,`, `)}`;break;case i.invalid_union:a=`Invalid input`;break;case i.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case i.invalid_enum_value:a=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case i.invalid_arguments:a=`Invalid function arguments`;break;case i.invalid_return_type:a=`Invalid function return type`;break;case i.invalid_date:a=`Invalid date`;break;case i.invalid_string:typeof t.validation==`object`?`includes`in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==`number`&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):`startsWith`in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:`endsWith`in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):a=t.validation===`regex`?`Invalid`:`Invalid ${t.validation}`;break;case i.too_small:a=t.type===`array`?`Array must contain ${t.exact?`exactly`:t.inclusive?`at least`:`more than`} ${t.minimum} element(s)`:t.type===`string`?`String must contain ${t.exact?`exactly`:t.inclusive?`at least`:`over`} ${t.minimum} character(s)`:t.type===`number`?`Number must be ${t.exact?`exactly equal to `:t.inclusive?`greater than or equal to `:`greater than `}${t.minimum}`:t.type===`date`?`Date must be ${t.exact?`exactly equal to `:t.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(t.minimum))}`:`Invalid input`;break;case i.too_big:a=t.type===`array`?`Array must contain ${t.exact?`exactly`:t.inclusive?`at most`:`less than`} ${t.maximum} element(s)`:t.type===`string`?`String must contain ${t.exact?`exactly`:t.inclusive?`at most`:`under`} ${t.maximum} character(s)`:t.type===`number`?`Number must be ${t.exact?`exactly`:t.inclusive?`less than or equal to`:`less than`} ${t.maximum}`:t.type===`bigint`?`BigInt must be ${t.exact?`exactly`:t.inclusive?`less than or equal to`:`less than`} ${t.maximum}`:t.type===`date`?`Date must be ${t.exact?`exactly`:t.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(t.maximum))}`:`Invalid input`;break;case i.custom:a=`Invalid input`;break;case i.invalid_intersection_types:a=`Intersection results could not be merged`;break;case i.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case i.not_finite:a=`Number must be finite`;break;default:a=r.defaultError,e.assertNever(t)}return{message:a}};var s=o;let c=s;function l(){return c}const u=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function d(e,t){let n=l(),r=u({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===s?void 0:s].filter(e=>!!e)});e.common.issues.push(r)}var f=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return p;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return p;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}};const p=Object.freeze({status:`aborted`}),m=e=>({status:`dirty`,value:e}),h=e=>({status:`valid`,value:e}),ee=e=>e.status===`aborted`,te=e=>e.status===`dirty`,g=e=>e.status===`valid`,_=e=>typeof Promise<`u`&&e instanceof Promise;var v;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(v||={});var y=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const ne=(e,t)=>{if(g(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new a(e.common.issues);return this._error=t,this._error}}};function b(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:i};let a=(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}};return{errorMap:a,description:i}}var x=class{get description(){return this._def.description}_getType(e){return r(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new f,ctx:{common:e.parent.common,data:e.data,parsedType:r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(_(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)},i=this._parseSync({data:e,path:n.path,parent:n});return ne(n,i)}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return g(n)?{value:n.value}:{issues:t.common.issues}}catch(e){var n;!(e==null||(n=e.message)==null||(n=n.toLowerCase())==null)&&n.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>g(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(_(i)?i:Promise.resolve(i));return ne(n,a)}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let a=e(t),o=()=>r.addIssue({code:i.custom,...n(t)});return typeof Promise<`u`&&a instanceof Promise?a.then(e=>e?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new q({schema:this,typeName:$.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return J.create(this,this._def)}nullable(){return Y.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return K.create(this,this._def)}or(e){return I.create([this,e],this._def)}and(e){return R.create(this,e,this._def)}transform(e){return new q({...b(this._def),schema:this,typeName:$.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new X({...b(this._def),innerType:this,defaultValue:t,typeName:$.ZodDefault})}brand(){return new Ie({typeName:$.ZodBranded,type:this,...b(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Z({...b(this._def),innerType:this,catchValue:t,typeName:$.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Le.create(this,e)}readonly(){return Q.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const re=/^c[^\s-]{8,}$/i,ie=/^[0-9a-z]+$/,ae=/^[0-9A-HJKMNP-TV-Z]{26}$/i,oe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,se=/^[a-z0-9_-]{21}$/i,ce=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,le=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ue=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,de=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;let fe;const pe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,me=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,he=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ge=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ve=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ye=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,be=RegExp(`^${ye}$`);function xe(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Se(e){return RegExp(`^${xe(e)}$`)}function Ce(e){let t=`${ye}T${xe(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function we(e,t){return!!((t===`v4`||!t)&&pe.test(e)||(t===`v6`||!t)&&he.test(e))}function Te(e,t){if(!ce.test(e))return!1;try{let[n]=e.split(`.`),r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Ee(e,t){return!!((t===`v4`||!t)&&me.test(e)||(t===`v6`||!t)&&ge.test(e))}var S=class t extends x{_parse(t){this._def.coerce&&(t.data=String(t.data));let r=this._getType(t);if(r!==n.string){let e=this._getOrReturnCtx(t);return d(e,{code:i.invalid_type,expected:n.string,received:e.parsedType}),p}let a=new f,o;for(let n of this._def.checks)if(n.kind===`min`)t.data.lengthn.value&&(o=this._getOrReturnCtx(t,o),d(o,{code:i.too_big,maximum:n.value,type:`string`,inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind===`length`){let e=t.data.length>n.value,r=t.data.lengthe.test(t),{validation:t,code:i.invalid_string,...v.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:`email`,...v.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...v.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...v.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...v.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...v.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...v.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...v.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...v.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...v.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...v.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...v.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...v.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...v.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...v.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...v.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...v.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...v.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...v.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...v.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...v.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...v.errToObj(t)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew S({checks:[],typeName:$.ZodString,coerce:e?.coerce??!1,...b(e)});function De(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r,a=Number.parseInt(e.toFixed(i).replace(`.`,``)),o=Number.parseInt(t.toFixed(i).replace(`.`,``));return a%o/10**i}var Oe=class t extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));let r=this._getType(t);if(r!==n.number){let e=this._getOrReturnCtx(t);return d(e,{code:i.invalid_type,expected:n.number,received:e.parsedType}),p}let a,o=new f;for(let n of this._def.checks)if(n.kind===`int`)e.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),d(a,{code:i.invalid_type,expected:`integer`,received:`float`,message:n.message}),o.dirty());else if(n.kind===`min`){let e=n.inclusive?t.datan.value:t.data>=n.value;e&&(a=this._getOrReturnCtx(t,a),d(a,{code:i.too_big,maximum:n.value,type:`number`,inclusive:n.inclusive,exact:!1,message:n.message}),o.dirty())}else n.kind===`multipleOf`?De(t.data,n.value)!==0&&(a=this._getOrReturnCtx(t,a),d(a,{code:i.not_multiple_of,multipleOf:n.value,message:n.message}),o.dirty()):n.kind===`finite`?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),d(a,{code:i.not_finite,message:n.message}),o.dirty()):e.assertNever(n);return{status:o.value,value:t.data}}gte(e,t){return this.setLimit(`min`,e,!0,v.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,v.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,v.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,v.toString(t))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:v.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:`int`,message:v.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:v.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:v.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:v.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:v.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuet.kind===`int`||t.kind===`multipleOf`&&e.isInteger(t.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew Oe({checks:[],typeName:$.ZodNumber,coerce:e?.coerce||!1,...b(e)});var C=class t extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}let r=this._getType(t);if(r!==n.bigint)return this._getInvalidInput(t);let a,o=new f;for(let n of this._def.checks)if(n.kind===`min`){let e=n.inclusive?t.datan.value:t.data>=n.value;e&&(a=this._getOrReturnCtx(t,a),d(a,{code:i.too_big,type:`bigint`,maximum:n.value,inclusive:n.inclusive,message:n.message}),o.dirty())}else n.kind===`multipleOf`?t.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),d(a,{code:i.not_multiple_of,multipleOf:n.value,message:n.message}),o.dirty()):e.assertNever(n);return{status:o.value,value:t.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return d(t,{code:i.invalid_type,expected:n.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit(`min`,e,!0,v.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,v.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,v.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,v.toString(t))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:v.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:v.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew C({checks:[],typeName:$.ZodBigInt,coerce:e?.coerce??!1,...b(e)});var w=class extends x{_parse(e){this._def.coerce&&(e.data=!!e.data);let t=this._getType(e);if(t!==n.boolean){let t=this._getOrReturnCtx(e);return d(t,{code:i.invalid_type,expected:n.boolean,received:t.parsedType}),p}return h(e.data)}};w.create=e=>new w({typeName:$.ZodBoolean,coerce:e?.coerce||!1,...b(e)});var T=class t extends x{_parse(t){this._def.coerce&&(t.data=new Date(t.data));let r=this._getType(t);if(r!==n.date){let e=this._getOrReturnCtx(t);return d(e,{code:i.invalid_type,expected:n.date,received:e.parsedType}),p}if(Number.isNaN(t.data.getTime())){let e=this._getOrReturnCtx(t);return d(e,{code:i.invalid_date}),p}let a=new f,o;for(let n of this._def.checks)n.kind===`min`?t.data.getTime()n.value&&(o=this._getOrReturnCtx(t,o),d(o,{code:i.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:`date`}),a.dirty()):e.assertNever(n);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:v.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:v.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew T({checks:[],coerce:e?.coerce||!1,typeName:$.ZodDate,...b(e)});var E=class extends x{_parse(e){let t=this._getType(e);if(t!==n.symbol){let t=this._getOrReturnCtx(e);return d(t,{code:i.invalid_type,expected:n.symbol,received:t.parsedType}),p}return h(e.data)}};E.create=e=>new E({typeName:$.ZodSymbol,...b(e)});var D=class extends x{_parse(e){let t=this._getType(e);if(t!==n.undefined){let t=this._getOrReturnCtx(e);return d(t,{code:i.invalid_type,expected:n.undefined,received:t.parsedType}),p}return h(e.data)}};D.create=e=>new D({typeName:$.ZodUndefined,...b(e)});var O=class extends x{_parse(e){let t=this._getType(e);if(t!==n.null){let t=this._getOrReturnCtx(e);return d(t,{code:i.invalid_type,expected:n.null,received:t.parsedType}),p}return h(e.data)}};O.create=e=>new O({typeName:$.ZodNull,...b(e)});var k=class extends x{constructor(){super(...arguments),this._any=!0}_parse(e){return h(e.data)}};k.create=e=>new k({typeName:$.ZodAny,...b(e)});var A=class extends x{constructor(){super(...arguments),this._unknown=!0}_parse(e){return h(e.data)}};A.create=e=>new A({typeName:$.ZodUnknown,...b(e)});var j=class extends x{_parse(e){let t=this._getOrReturnCtx(e);return d(t,{code:i.invalid_type,expected:n.never,received:t.parsedType}),p}};j.create=e=>new j({typeName:$.ZodNever,...b(e)});var M=class extends x{_parse(e){let t=this._getType(e);if(t!==n.undefined){let t=this._getOrReturnCtx(e);return d(t,{code:i.invalid_type,expected:n.void,received:t.parsedType}),p}return h(e.data)}};M.create=e=>new M({typeName:$.ZodVoid,...b(e)});var N=class e extends x{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==n.array)return d(t,{code:i.invalid_type,expected:n.array,received:t.parsedType}),p;if(a.exactLength!==null){let e=t.data.length>a.exactLength.value,n=t.data.lengtha.maxLength.value&&(d(t,{code:i.too_big,maximum:a.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>a.type._parseAsync(new y(t,e,t.path,n)))).then(e=>f.mergeArray(r,e));let o=[...t.data].map((e,n)=>a.type._parseSync(new y(t,e,t.path,n)));return f.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:v.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:v.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:v.toString(n)}})}nonempty(e){return this.min(1,e)}};N.create=(e,t)=>new N({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray,...b(t)});function P(e){if(e instanceof F){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=J.create(P(r))}return new F({...e._def,shape:()=>t})}else if(e instanceof N)return new N({...e._def,type:P(e.element)});else if(e instanceof J)return J.create(P(e.unwrap()));else if(e instanceof Y)return Y.create(P(e.unwrap()));else if(e instanceof z)return z.create(e.items.map(e=>P(e)));else return e}var F=class t extends x{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=e.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(e){let t=this._getType(e);if(t!==n.object){let t=this._getOrReturnCtx(e);return d(t,{code:i.invalid_type,expected:n.object,received:t.parsedType}),p}let{status:r,ctx:a}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof j&&this._def.unknownKeys===`strip`))for(let e in a.data)s.includes(e)||c.push(e);let l=[];for(let e of s){let t=o[e],n=a.data[e];l.push({key:{status:`valid`,value:e},value:t._parse(new y(a,n,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof j){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of c)l.push({key:{status:`valid`,value:e},value:{status:`valid`,value:a.data[e]}});else if(e===`strict`)c.length>0&&(d(a,{code:i.unrecognized_keys,keys:c}),r.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of c){let n=a.data[t];l.push({key:{status:`valid`,value:t},value:e._parse(new y(a,n,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of l){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>f.mergeObjectSync(r,e)):f.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new t({...this._def,unknownKeys:`strict`,...e===void 0?{}:{errorMap:(t,n)=>{var r,i;let a=(r=(i=this._def).errorMap)?.call(i,t,n).message??n.defaultError;return t.code===`unrecognized_keys`?{message:v.errToObj(e).message??a}:{message:a}}}})}strip(){return new t({...this._def,unknownKeys:`strip`})}passthrough(){return new t({...this._def,unknownKeys:`passthrough`})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){let n=new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:$.ZodObject});return n}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new t({...this._def,catchall:e})}pick(n){let r={};for(let t of e.objectKeys(n))n[t]&&this.shape[t]&&(r[t]=this.shape[t]);return new t({...this._def,shape:()=>r})}omit(n){let r={};for(let t of e.objectKeys(this.shape))n[t]||(r[t]=this.shape[t]);return new t({...this._def,shape:()=>r})}deepPartial(){return P(this)}partial(n){let r={};for(let t of e.objectKeys(this.shape)){let e=this.shape[t];n&&!n[t]?r[t]=e:r[t]=e.optional()}return new t({...this._def,shape:()=>r})}required(n){let r={};for(let t of e.objectKeys(this.shape))if(n&&!n[t])r[t]=this.shape[t];else{let e=this.shape[t],n=e;for(;n instanceof J;)n=n._def.innerType;r[t]=n}return new t({...this._def,shape:()=>r})}keyof(){return Ne(e.objectKeys(this.shape))}};F.create=(e,t)=>new F({shape:()=>e,unknownKeys:`strip`,catchall:j.create(),typeName:$.ZodObject,...b(t)}),F.strictCreate=(e,t)=>new F({shape:()=>e,unknownKeys:`strict`,catchall:j.create(),typeName:$.ZodObject,...b(t)}),F.lazycreate=(e,t)=>new F({shape:e,unknownKeys:`strip`,catchall:j.create(),typeName:$.ZodObject,...b(t)});var I=class extends x{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new a(e.ctx.common.issues));return d(t,{code:i.invalid_union,unionErrors:n}),p}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let o=r.map(e=>new a(e));return d(t,{code:i.invalid_union,unionErrors:o}),p}}get options(){return this._def.options}};I.create=(e,t)=>new I({options:e,typeName:$.ZodUnion,...b(t)});const L=t=>t instanceof H?L(t.schema):t instanceof q?L(t.innerType()):t instanceof U?[t.value]:t instanceof W?t.options:t instanceof G?e.objectValues(t.enum):t instanceof X?L(t._def.innerType):t instanceof D?[void 0]:t instanceof O?[null]:t instanceof J?[void 0,...L(t.unwrap())]:t instanceof Y?[null,...L(t.unwrap())]:t instanceof Ie||t instanceof Q?L(t.unwrap()):t instanceof Z?L(t._def.innerType):[];var ke=class e extends x{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.object)return d(t,{code:i.invalid_type,expected:n.object,received:t.parsedType}),p;let r=this.discriminator,a=t.data[r],o=this.optionsMap.get(a);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(d(t,{code:i.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=L(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:$.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...b(r)})}};function Ae(t,i){let a=r(t),o=r(i);if(t===i)return{valid:!0,data:t};if(a===n.object&&o===n.object){let n=e.objectKeys(i),r=e.objectKeys(t).filter(e=>n.indexOf(e)!==-1),a={...t,...i};for(let e of r){let n=Ae(t[e],i[e]);if(!n.valid)return{valid:!1};a[e]=n.data}return{valid:!0,data:a}}else if(a===n.array&&o===n.array){if(t.length!==i.length)return{valid:!1};let e=[];for(let n=0;n{if(ee(e)||ee(r))return p;let a=Ae(e.value,r.value);return a.valid?((te(e)||te(r))&&t.dirty(),{status:t.value,value:a.data}):(d(n,{code:i.invalid_intersection_types}),p)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};R.create=(e,t,n)=>new R({left:e,right:t,typeName:$.ZodIntersection,...b(n)});var z=class e extends x{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.array)return d(r,{code:i.invalid_type,expected:n.array,received:r.parsedType}),p;if(r.data.lengththis._def.items.length&&(d(r,{code:i.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let o=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new y(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(o).then(e=>f.mergeArray(t,e)):f.mergeArray(t,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};z.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new z({items:e,typeName:$.ZodTuple,rest:null,...b(t)})};var je=class e extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.object)return d(r,{code:i.invalid_type,expected:n.object,received:r.parsedType}),p;let a=[],o=this._def.keyType,s=this._def.valueType;for(let e in r.data)a.push({key:o._parse(new y(r,e,r.path,e)),value:s._parse(new y(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?f.mergeObjectAsync(t,a):f.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof x?new e({keyType:t,valueType:n,typeName:$.ZodRecord,...b(r)}):new e({keyType:S.create(),valueType:t,typeName:$.ZodRecord,...b(n)})}},B=class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.map)return d(r,{code:i.invalid_type,expected:n.map,received:r.parsedType}),p;let a=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([e,t],n)=>({key:a._parse(new y(r,e,r.path,[n,`key`])),value:o._parse(new y(r,t,r.path,[n,`value`]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of s){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return p;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of s){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return p;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};B.create=(e,t,n)=>new B({valueType:t,keyType:e,typeName:$.ZodMap,...b(n)});var V=class e extends x{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.set)return d(r,{code:i.invalid_type,expected:n.set,received:r.parsedType}),p;let a=this._def;a.minSize!==null&&r.data.sizea.maxSize.value&&(d(r,{code:i.too_big,maximum:a.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let o=this._def.valueType;function s(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return p;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let c=[...r.data.values()].map((e,t)=>o._parse(new y(r,e,r.path,t)));return r.common.async?Promise.all(c).then(e=>s(e)):s(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:v.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:v.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};V.create=(e,t)=>new V({valueType:e,minSize:null,maxSize:null,typeName:$.ZodSet,...b(t)});var Me=class e extends x{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.function)return d(t,{code:i.invalid_type,expected:n.function,received:t.parsedType}),p;function r(e,n){return u({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),s].filter(e=>!!e),issueData:{code:i.invalid_arguments,argumentsError:n}})}function o(e,n){return u({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),s].filter(e=>!!e),issueData:{code:i.invalid_return_type,returnTypeError:n}})}let c={errorMap:t.common.contextualErrorMap},f=t.data;if(this._def.returns instanceof K){let e=this;return h(async function(...t){let n=new a([]),i=await e._def.args.parseAsync(t,c).catch(e=>{throw n.addIssue(r(t,e)),n}),s=await Reflect.apply(f,this,i),l=await e._def.returns._def.type.parseAsync(s,c).catch(e=>{throw n.addIssue(o(s,e)),n});return l})}else{let e=this;return h(function(...t){let n=e._def.args.safeParse(t,c);if(!n.success)throw new a([r(t,n.error)]);let i=Reflect.apply(f,this,n.data),s=e._def.returns.safeParse(i,c);if(!s.success)throw new a([o(i,s.error)]);return s.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:z.create(t).rest(A.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){let t=this.parse(e);return t}strictImplement(e){let t=this.parse(e);return t}static create(t,n,r){return new e({args:t||z.create([]).rest(A.create()),returns:n||A.create(),typeName:$.ZodFunction,...b(r)})}},H=class extends x{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.getter();return n._parse({data:t.data,path:t.path,parent:t})}};H.create=(e,t)=>new H({getter:e,typeName:$.ZodLazy,...b(t)});var U=class extends x{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:i.invalid_literal,expected:this._def.value}),p}return{status:`valid`,value:e.data}}get value(){return this._def.value}};U.create=(e,t)=>new U({value:e,typeName:$.ZodLiteral,...b(t)});function Ne(e,t){return new W({values:e,typeName:$.ZodEnum,...b(t)})}var W=class t extends x{_parse(t){if(typeof t.data!=`string`){let n=this._getOrReturnCtx(t),r=this._def.values;return d(n,{expected:e.joinValues(r),received:n.parsedType,code:i.invalid_type}),p}if(this._cache||=new Set(this._def.values),!this._cache.has(t.data)){let e=this._getOrReturnCtx(t),n=this._def.values;return d(e,{received:e.data,code:i.invalid_enum_value,options:n}),p}return h(t.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(t=>!e.includes(t)),{...this._def,...n})}};W.create=Ne;var G=class extends x{_parse(t){let r=e.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==n.string&&a.parsedType!==n.number){let t=e.objectValues(r);return d(a,{expected:e.joinValues(t),received:a.parsedType,code:i.invalid_type}),p}if(this._cache||=new Set(e.getValidEnumValues(this._def.values)),!this._cache.has(t.data)){let t=e.objectValues(r);return d(a,{received:a.data,code:i.invalid_enum_value,options:t}),p}return h(t.data)}get enum(){return this._def.values}};G.create=(e,t)=>new G({values:e,typeName:$.ZodNativeEnum,...b(t)});var K=class extends x{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.promise&&t.common.async===!1)return d(t,{code:i.invalid_type,expected:n.promise,received:t.parsedType}),p;let r=t.parsedType===n.promise?t.data:Promise.resolve(t.data);return h(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};K.create=(e,t)=>new K({type:e,typeName:$.ZodPromise,...b(t)});var q=class extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:e=>{d(r,e),e.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type===`preprocess`){let e=i.transform(r.data,a);if(r.common.async)return Promise.resolve(e).then(async e=>{if(n.value===`aborted`)return p;let t=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return t.status===`aborted`?p:t.status===`dirty`||n.value===`dirty`?m(t.value):t});{if(n.value===`aborted`)return p;let t=this._def.schema._parseSync({data:e,path:r.path,parent:r});return t.status===`aborted`?p:t.status===`dirty`||n.value===`dirty`?m(t.value):t}}if(i.type===`refinement`){let e=e=>{let t=i.refinement(e,a);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(r.common.async===!1){let t=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return t.status===`aborted`?p:(t.status===`dirty`&&n.dirty(),e(t.value),{status:n.value,value:t.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>t.status===`aborted`?p:(t.status===`dirty`&&n.dirty(),e(t.value).then(()=>({status:n.value,value:t.value}))))}if(i.type===`transform`)if(r.common.async===!1){let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!g(e))return p;let t=i.transform(e.value,a);if(t instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:n.value,value:t}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>g(e)?Promise.resolve(i.transform(e.value,a)).then(e=>({status:n.value,value:e})):p);e.assertNever(i)}};q.create=(e,t,n)=>new q({schema:e,typeName:$.ZodEffects,effect:t,...b(n)}),q.createWithPreprocess=(e,t,n)=>new q({schema:t,effect:{type:`preprocess`,transform:e},typeName:$.ZodEffects,...b(n)});var J=class extends x{_parse(e){let t=this._getType(e);return t===n.undefined?h(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};J.create=(e,t)=>new J({innerType:e,typeName:$.ZodOptional,...b(t)});var Y=class extends x{_parse(e){let t=this._getType(e);return t===n.null?h(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Y.create=(e,t)=>new Y({innerType:e,typeName:$.ZodNullable,...b(t)});var X=class extends x{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===n.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};X.create=(e,t)=>new X({innerType:e,typeName:$.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...b(t)});var Z=class extends x{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return _(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new a(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new a(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Z.create=(e,t)=>new Z({innerType:e,typeName:$.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...b(t)});var Pe=class extends x{_parse(e){let t=this._getType(e);if(t!==n.nan){let t=this._getOrReturnCtx(e);return d(t,{code:i.invalid_type,expected:n.nan,received:t.parsedType}),p}return{status:`valid`,value:e.data}}};Pe.create=e=>new Pe({typeName:$.ZodNaN,...b(e)});const Fe=Symbol(`zod_brand`);var Ie=class extends x{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Le=class e extends x{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){let e=async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?p:e.status===`dirty`?(t.dirty(),m(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})};return e()}else{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?p:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:$.ZodPipeline})}},Q=class extends x{_parse(e){let t=this._def.innerType._parse(e),n=e=>(g(e)&&(e.value=Object.freeze(e.value)),e);return _(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};Q.create=(e,t)=>new Q({innerType:e,typeName:$.ZodReadonly,...b(t)});const Re={object:F.lazycreate};var $;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})($||={});const ze=S.create,Be=Oe.create,Ve=Pe.create,He=C.create,Ue=w.create,We=T.create,Ge=E.create,Ke=D.create,qe=O.create,Je=k.create,Ye=A.create,Xe=j.create,Ze=M.create,Qe=N.create,$e=F.create,et=F.strictCreate,tt=I.create,nt=ke.create,rt=R.create,it=z.create,at=je.create,ot=B.create,st=V.create,ct=Me.create,lt=H.create,ut=U.create,dt=W.create,ft=G.create,pt=K.create,mt=q.create,ht=J.create,gt=Y.create,_t=q.createWithPreprocess,vt=Le.create;export{$ as ZodFirstPartyTypeKind,J as ZodOptional,Qe as arrayType,Ue as booleanType,Be as numberType,$e as objectType,ze as stringType,tt as unionType}; \ No newline at end of file diff --git a/assets/useIconAnimation-1wS_J1WT.js b/assets/useIconAnimation-1wS_J1WT.js deleted file mode 100644 index e44ecda527406102e5f94a90a328ad42daacebdb..0000000000000000000000000000000000000000 --- a/assets/useIconAnimation-1wS_J1WT.js +++ /dev/null @@ -1 +0,0 @@ -import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{e as t,be as r,f as u,T as m,U as c}from"./index-D7HCX4VR.js";function v(s){const n=t(!1),o=t(!1),a=t(s),e=r(),i=u(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return m(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),c(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{v as u}; diff --git a/assets/useIconAnimation-C_Mu172C.js b/assets/useIconAnimation-C_Mu172C.js new file mode 100644 index 0000000000000000000000000000000000000000..bb9fc13cf2c7cb446d1c600eadfb2f720f0b0204 --- /dev/null +++ b/assets/useIconAnimation-C_Mu172C.js @@ -0,0 +1 @@ +import{computed as e,onMounted as t,onUnmounted as n,ref as r,useSettings as i}from"./index-BtAisBe9.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-CJamdyqp.js b/assets/valibot-CQk-M5rL-CJamdyqp.js new file mode 100644 index 0000000000000000000000000000000000000000..090fea53b24610356251de595670ef79e1507399 --- /dev/null +++ b/assets/valibot-CQk-M5rL-CJamdyqp.js @@ -0,0 +1 @@ +import{__vitePreload as e}from"./index-BtAisBe9.js";import{tryImport as t}from"./index-CISmcbXk-s07e23Qe.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/valibot-CQk-M5rL-DQQQnI60.js b/assets/valibot-CQk-M5rL-DQQQnI60.js deleted file mode 100644 index 640029aa247fdd5e5eaf7ba0b7aff873c6af0579..0000000000000000000000000000000000000000 --- a/assets/valibot-CQk-M5rL-DQQQnI60.js +++ /dev/null @@ -1 +0,0 @@ -import{cT as r}from"./index-D7HCX4VR.js";import{t as a}from"./mcp-DgU0tpf-.js";const s=async()=>{const{toJsonSchema:o}=await a(r(()=>import("./index-CShXCEpO.js"),[]),"@valibot/to-json-schema");return t=>o(t)};export{s as getToJsonSchemaFn}; diff --git a/assets/vibrant-Dx4HQHCr.js b/assets/vibrant-Dx4HQHCr.js deleted file mode 100644 index bad2837138f48e08cb44092c20d94881b9aef783..0000000000000000000000000000000000000000 --- a/assets/vibrant-Dx4HQHCr.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";import{_ as g}from"./InputFile.vue_vue_type_script_setup_true_lang-M88MYfAL.js";import{V as p}from"./browser-CkchkNbv.js";import{d as v,e as n,w as _,c as r,o,a as s,c3 as b,c4 as h,Y as k,b as w,u as x,W as y,a3 as V}from"./index-D7HCX4VR.js";const j={flex:"","flex-col":"","gap-4":""},C={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},L={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},N={flex:"","gap-2":""},O={"h-60":"",border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","rounded-lg":""},B=["src"],I=v({__name:"vibrant",setup(S){const u=n([]),t=n(),d=n([]),i=n([]);function c(l){const a=new Image;a.src=URL.createObjectURL(l),a.onload=f,t.value=a}async function f(){if(!t.value)return;const a=await new p(t.value).getPalette();d.value=Object.values(a).map(e=>e==null?void 0:e.hex).filter(e=>typeof e=="string"),i.value=Object.values(a).map(e=>JSON.stringify(e))}return _(u,l=>{c(l[0])},{deep:!0}),(l,a)=>(o(),r("div",j,[s("div",C,[(o(!0),r(b,null,h(d.value,(e,m)=>(o(),r("div",{key:m,style:V({backgroundColor:e}),"size-20":"","rounded-full":""},null,4))),128))]),s("div",L,k(i.value),1),s("div",N,[w(x(g),{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value=e),"h-60":"","w-full":""},null,8,["modelValue"])]),s("div",O,[t.value?(o(),r("img",{key:0,src:t.value.src,"h-full":"","w-full":"","object-contain":""},null,8,B)):y("",!0)])]))}});export{I as default}; diff --git a/assets/vibrant-DyoV7uOq.js b/assets/vibrant-DyoV7uOq.js new file mode 100644 index 0000000000000000000000000000000000000000..a68ac94be6338d9aaa287badacd30042f578c203 --- /dev/null +++ b/assets/vibrant-DyoV7uOq.js @@ -0,0 +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-BtAisBe9.js";import"./src-bHDRqBSs.js";import{InputFile_default as p}from"./InputFile-B1bjga7G.js";import{Vibrant as m}from"./browser-C4moGI0I.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-Do3adewX.js b/assets/volcengine-Do3adewX.js deleted file mode 100644 index 5ef6d5f8f6a9740bb300657697991c348986e351..0000000000000000000000000000000000000000 --- a/assets/volcengine-Do3adewX.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as y}from"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import{_ as w}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js";import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as M,e as I,a0 as S,$ as x,f as c,T as k,w as g,bf as F,o as $,bg as v,b as f,u as r,a as B}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as R}from"./providers-DepZj6_J.js";import{u as T}from"./speech-D8cCufg2.js";import{_ as E,a as K}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-Cn-PwtFl.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";const L={flex:"~ col gap-4"},o="volcengine",b="v1",N=M({__name:"volcengine",setup(U){const s=I(1),d=T(),a=R(),{providers:t}=S(a),{t:n}=x(),l=c({get:()=>{var e,i;return((i=(e=t.value[o])==null?void 0:e.app)==null?void 0:i.appId)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].app={appId:e}}}),C=c(()=>{var e;return!!((e=t.value[o])!=null&&e.apiKey)}),P=c(()=>d.availableVoices[o]||[]);async function V(e,i,p){const m=a.getProviderInstance(o);if(!m)throw new Error("Failed to initialize speech provider");const u=a.getProviderConfig(o),h=u.model||b;return await d.speech(m,h,e,i,{...u})}return k(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),g(s,async()=>{const e=a.getProviderConfig(o);e.audio||(e.audio={}),e.audio.speedRatio=s.value}),g([t,l],async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>($(),F(r(K),{"provider-id":o,"default-model":b},{"basic-settings":v(()=>[B("div",L,[f(r(y),{modelValue:l.value,"onUpdate:modelValue":i[0]||(i[0]=p=>l.value=p),label:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.label"),description:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.description"),required:""},null,8,["modelValue","label","description"])])]),"voice-settings":v(()=>[f(r(w),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),label:r(n)("settings.pages.providers.provider.common.fields.field.speed.label"),description:r(n)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"])]),playground:v(()=>[f(r(E),{"available-voices":P.value,"generate-speech":V,"api-key-configured":C.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof _=="function"&&_(N);export{N as default}; diff --git a/assets/volcengine-QjDAu2Dw.js b/assets/volcengine-QjDAu2Dw.js new file mode 100644 index 0000000000000000000000000000000000000000..886249f903ba5ea45eb353af64c1c51b2cf6d845 --- /dev/null +++ b/assets/volcengine-QjDAu2Dw.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as p,useSpeechStore as m}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import{FieldInput_default as h,FieldRange_default as g}from"./src-bHDRqBSs.js";import{SpeechPlayground_default as _,SpeechProviderSettings_default as v}from"./components-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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/webgpu-Cnn5XZ2r.js b/assets/webgpu-Cnn5XZ2r.js new file mode 100644 index 0000000000000000000000000000000000000000..1ffb47f5b2be18d100dbcd23ad9786e8a4ab8a9f --- /dev/null +++ b/assets/webgpu-Cnn5XZ2r.js @@ -0,0 +1 @@ +async function e(){try{if(t())return{supported:!1,isNode:!0,reason:``,fp16Supported:!1};if(typeof navigator>`u`||!navigator.gpu)return{supported:!1,isNode:!1,reason:`WebGPU is not available (navigator.gpu is undefined)`,fp16Supported:!1};let e=await navigator.gpu.requestAdapter();return e?{supported:!0,isNode:!1,reason:``,adapter:e,fp16Supported:e.features.has(`shader-f16`)}:{supported:!1,isNode:!1,reason:`WebGPU is not supported (no adapter found)`,fp16Supported:!1}}catch(e){let t=e instanceof Error?e.toString():String(e);return{supported:!1,isNode:!1,reason:t,fp16Supported:!1}}}function t(){return typeof process<`u`&&`versions`in process&&process.versions!=null&&typeof process.versions==`object`&&`node`in process.versions&&process.versions.node!=null}async function n(){return e().then(e=>e.supported)}export{e as check,n as isWebGPUSupported}; \ No newline at end of file diff --git a/assets/worker-Bq31kV70.js b/assets/worker-Bq31kV70.js new file mode 100644 index 0000000000000000000000000000000000000000..1f4c9073b644115d1594e7718ef3ff1f8f8121b8 --- /dev/null +++ b/assets/worker-Bq31kV70.js @@ -0,0 +1,3568 @@ +(function(){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,n=Object.defineProperty,r=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})};let i=new Map,a=[],o=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=i.get(e);if(r===void 0)i.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=a.indexOf(e);t!==-1&&a.splice(t,1);for(let t=0;t{let t=i.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?a:n,i,o=[],c=new Set;for(let e of r){let t=await s(e);typeof t==`string`?o.push({name:e,err:t}):(i||=t,i===t&&c.add(e))}if(!i)throw Error(`no available backend found. ERR: ${o.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of o)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let l=t.filter(e=>c.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?l:Reflect.get(e,t)})]},l=`1.22.0`,u=`warning`,d={wasm:{},webgl:{},webgpu:{},versions:{common:l},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}`);u=e}},get logLevel(){return u}};Object.defineProperty(d,`logLevel`,{enumerable:!0});let f=d,p=(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,h(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(h(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return h(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},_=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new D({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},v=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new D({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},y=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new D({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},b=(e,t,n)=>new D({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),x=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),S=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),C=!1,w=()=>{if(!C){C=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(x.set(`int64`,BigInt64Array),S.set(BigInt64Array,`int64`)),t&&(x.set(`uint64`,BigUint64Array),S.set(BigUint64Array,`uint64`)),r?(x.set(`float16`,n),S.set(n,`float16`)):x.set(`float16`,Uint16Array)}},T=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new D(e.type,e.data,t);case`cpu-pinned`:return new D({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new D({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new D({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new D({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var D=class{constructor(e,t,n){w();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=x.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=x.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=S.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=T(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 g(e,t)}static fromTexture(e,t){return _(e,t)}static fromGpuBuffer(e,t){return v(e,t)}static fromMLTensor(e,t){return y(e,t)}static fromPinnedBuffer(e,t,n){return b(e,t,n)}toDataURL(e){return p(this,e)}toImageData(e){return m(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 E(this,e)}};let O=D,k=(e,t)=>{(d.trace===void 0?!d.wasm.trace:!d.trace)||console.timeStamp(`${e}::ORT::${t}`)},A=(e,t)=>{var n;let r=(n=Error().stack)?.split(/\r\n|\r|\n/g)||[],i=!1;for(let n=0;n{(d.trace===void 0?!d.wasm.trace:!d.trace)||A(`BEGIN`,e)},te=e=>{(d.trace===void 0?!d.wasm.trace:!d.trace)||A(`END`,e)};var ne=class e{constructor(e){this.handler=e}async run(e,t,n){ee();let r={},i={};if(typeof e!=`object`||!e||e instanceof O||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 O)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 O)&&(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 O?s[e]=t:s[e]=new O(t.type,t.data,t.dims)}return te(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){ee();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,l]=await c(o),u=await s.createInferenceSessionHandler(a,l);return te(),new e(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};let re=ne;var j={};r(j,{InferenceSession:()=>re,TRACE:()=>k,TRACE_FUNC_BEGIN:()=>ee,TRACE_FUNC_END:()=>te,Tensor:()=>O,env:()=>f,registerBackend:()=>o});var ie={};r(ie,{InferenceSession:()=>qe,TRACE:()=>Ve,TRACE_FUNC_BEGIN:()=>Ue,TRACE_FUNC_END:()=>V,Tensor:()=>Be,default:()=>sf,env:()=>ye,registerBackend:()=>F}); +/*! +* ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. +*/ +var ae=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyNames,ce=Object.prototype.hasOwnProperty,le=(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(`Dynamic require of "`+e+`" is not supported`)}),M=(e,t)=>()=>(e&&(t=e(e=0)),t),N=(e,t)=>{for(var n in t)ae(e,n,{get:t[n],enumerable:!0})},ue=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of se(t))!ce.call(e,i)&&i!==n&&ae(e,i,{get:()=>t[i],enumerable:!(r=oe(t,i))||r.enumerable});return e},de=e=>ue(ae({},`__esModule`,{value:!0}),e),fe,P,F,I,L,pe=M(()=>{"use strict";fe=new Map,P=[],F=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=fe.get(e);if(r===void 0)fe.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=P.indexOf(e);t!==-1&&P.splice(t,1);for(let t=0;t{let t=fe.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}}},L=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?P:n,i,a=[],o=new Set;for(let e of r){let t=await I(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)})]}}),me=M(()=>{"use strict";pe()}),he,ge=M(()=>{"use strict";he=`1.22.0-dev.20250409-89f8206ba4`}),_e,R,ve=M(()=>{"use strict";ge(),_e=`warning`,R={wasm:{},webgl:{},webgpu:{},versions:{common:he},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}`);_e=e}},get logLevel(){return _e}},Object.defineProperty(R,`logLevel`,{enumerable:!0})}),ye,be=M(()=>{"use strict";ve(),ye=R}),xe,Se,Ce=M(()=>{"use strict";xe=(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?t.format:`RGB`,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{"use strict";ze(),we=(e,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?t.tensorFormat:`RGB`,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,we(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(we(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return we(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},Ee=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new Re({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},De=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Re({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},Oe=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Re({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},ke=(e,t,n)=>new Re({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),je,Me,Ne,z,Pe=M(()=>{"use strict";je=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),Me=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),Ne=!1,z=()=>{if(!Ne){Ne=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(je.set(`int64`,BigInt64Array),Me.set(BigInt64Array,`int64`)),t&&(je.set(`uint64`,BigUint64Array),Me.set(BigUint64Array,`uint64`)),r?(je.set(`float16`,n),Me.set(n,`float16`)):je.set(`float16`,Uint16Array)}}}),Fe,Ie,Le=M(()=>{"use strict";ze(),Fe=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new Re(e.type,e.data,t);case`cpu-pinned`:return new Re({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new Re({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new Re({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new Re({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Re,ze=M(()=>{"use strict";Ce(),Ae(),Pe(),Le(),Re=class{constructor(e,t,n){z();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=je.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=je.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=Me.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=Fe(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 Ee(e,t)}static fromGpuBuffer(e,t){return De(e,t)}static fromMLTensor(e,t){return Oe(e,t)}static fromPinnedBuffer(e,t,n){return ke(e,t,n)}toDataURL(e){return xe(this,e)}toImageData(e){return Se(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 Ie(this,e)}}}),Be,B=M(()=>{"use strict";ze(),Be=Re}),Ve,He,Ue,V,We=M(()=>{"use strict";ve(),Ve=(e,t)=>{(typeof R.trace>`u`?!R.wasm.trace:!R.trace)||console.timeStamp(`${e}::ORT::${t}`)},He=(e,t)=>{var n;let r=(n=Error().stack)?.split(/\r\n|\r|\n/g)||[],i=!1;for(let n=0;n{(typeof R.trace>`u`?!R.wasm.trace:!R.trace)||He(`BEGIN`,e)},V=e=>{(typeof R.trace>`u`?!R.wasm.trace:!R.trace)||He(`END`,e)}}),Ge,Ke=M(()=>{"use strict";pe(),B(),We(),Ge=class e{constructor(e){this.handler=e}async run(e,t,n){Ue();let r={},i={};if(typeof e!=`object`||!e||e instanceof Be||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 Be)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(typeof n<`u`)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 Be)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)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 Be?s[e]=t:s[e]=new Be(t.type,t.data,t.dims)}return V(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){Ue();let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)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(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)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 L(o),l=await s.createInferenceSessionHandler(a,c);return V(),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}}}),qe,Je=M(()=>{"use strict";Ke(),qe=Ge}),Ye=M(()=>{"use strict";}),Xe=M(()=>{"use strict";}),Ze=M(()=>{"use strict";}),Qe=M(()=>{"use strict";}),$e={};N($e,{InferenceSession:()=>qe,TRACE:()=>Ve,TRACE_FUNC_BEGIN:()=>Ue,TRACE_FUNC_END:()=>V,Tensor:()=>Be,env:()=>ye,registerBackend:()=>F});var et=M(()=>{"use strict";me(),be(),Je(),B(),Ye(),Xe(),We(),Ze(),Qe()}),tt=M(()=>{"use strict";}),nt={};N(nt,{default:()=>at});var rt,it,at,ot=M(()=>{"use strict";var e;kd(),Lt(),Dt(),rt=`ort-wasm-proxy-worker`,it=(e=globalThis.self)?.name===rt,it&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:Ft(n.wasm).then(()=>{_d(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;vd(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=Sd(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;Cd(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:wd(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;Ed(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},Od([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:Dd(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),at=it?null:e=>new Worker(e??gt,{type:`module`,name:rt})}),st={};N(st,{default:()=>ut});var ct,lt,ut,dt,ft=M(()=>{"use strict";var t;lt=(ct=self.location.href,async function(t={}){var n,r,i,a=t,o=new Promise((e,t)=>{r=e,i=t}),s=typeof window==`object`,c=typeof WorkerGlobalScope<`u`,l=c&&(n=self.name)?.startsWith(`em-pthread`);a.mountExternalData=(e,t)=>{e.startsWith(`./`)&&(e=e.substring(2)),(a.Eb||=new Map).set(e,t)},a.unmountExternalData=()=>{delete a.Eb};var u=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let d=e=>async(...t)=>{try{var n;if(a.Fb)throw Error(`Session already started`);let r=a.Fb={dc:t[0],errors:[]},i=await e(...t);if(a.Fb!==r)throw Error(`Session mismatch`);(n=a.Jb)?.flush();let o=r.errors;if(0e),0{if(e===`webgpu`){[a.Jb,a.Ub,a.Yb,a.Kb,a.Xb,a.jb,a.Zb,a.ac,a.Vb,a.Wb,a.$b]=t;let e=a.Jb;a.jsepRegisterBuffer=(t,n,r,i)=>e.registerBuffer(t,n,r,i),a.jsepGetBuffer=t=>e.getBuffer(t),a.jsepCreateDownloader=(t,n,r)=>e.createDownloader(t,n,r),a.jsepOnCreateSession=t=>{e.onCreateSession(t)},a.jsepOnReleaseSession=t=>{e.onReleaseSession(t)},a.jsepOnRunStart=t=>e.onRunStart(t),a.bc=(t,n)=>{e.upload(t,n)}}else if(e===`webnn`){let e=t[0];[a.nc,a.Nb,a.webnnEnsureTensor,a.Ob,a.webnnDownloadTensor]=t.slice(1),a.webnnReleaseTensorId=a.Nb,a.webnnUploadTensor=a.Ob,a.webnnOnRunStart=t=>e.onRunStart(t),a.webnnOnRunEnd=e.onRunEnd.bind(e),a.webnnRegisterMLContext=(t,n)=>{e.registerMLContext(t,n)},a.webnnOnReleaseSession=t=>{e.onReleaseSession(t)},a.webnnCreateMLTensorDownloader=(t,n)=>e.createMLTensorDownloader(t,n),a.webnnRegisterMLTensor=(t,n,r,i)=>e.registerMLTensor(t,n,r,i),a.webnnCreateMLContext=t=>e.createMLContext(t),a.webnnRegisterMLConstant=(t,n,r,i,o,s)=>e.registerMLConstant(t,n,r,i,o,a.Eb,s),a.webnnRegisterGraphInput=e.registerGraphInput.bind(e),a.webnnIsGraphInput=e.isGraphInput.bind(e),a.webnnCreateTemporaryTensor=e.createTemporaryTensor.bind(e),a.webnnIsInt64Supported=e.isInt64Supported.bind(e)}};let f=()=>{let e=(e,t,n)=>(...r)=>{let i=nn,a=t?.();r=e(...r);let o=t?.();return a!==o&&(e=o,n(a),t=n=null),nn==i?r:new Promise((e,t)=>{cn={resolve:e,reject:t}})};(()=>{for(let t of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])a[t]=e(a[t],()=>a[t],e=>a[t]=e)})(),d!==void 0&&(a._OrtRun=d(a._OrtRun),a._OrtRunWithBinding=d(a._OrtRunWithBinding)),f=void 0};a.asyncInit=()=>{f?.()};var p,m,h=Object.assign({},a),g=(e,t)=>{throw t},_=``;(s||c)&&(c?_=self.location.href:typeof document<`u`&&document.currentScript&&(_=document.currentScript.src),ct&&(_=ct),_=_.startsWith(`blob:`)?``:_.slice(0,_.replace(/[?#].*/,``).lastIndexOf(`/`)+1),c&&(m=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),p=async e=>{if(ae(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});var v=console.log.bind(console),y=console.error.bind(console),b=v,x=y;Object.assign(a,h),h=null;var S,C,w,T,E,D,O,k,A,ee,te,ne,re,j=a.wasmBinary,ie=!1,ae=e=>e.startsWith(`file://`);function oe(){return S.buffer!=T.buffer&&I(),T}function se(){return S.buffer!=T.buffer&&I(),E}function ce(){return S.buffer!=T.buffer&&I(),D}function le(){return S.buffer!=T.buffer&&I(),O}function M(){return S.buffer!=T.buffer&&I(),k}function N(){return S.buffer!=T.buffer&&I(),A}function ue(){return S.buffer!=T.buffer&&I(),ee}function de(){return S.buffer!=T.buffer&&I(),re}if(l){let e=function(t){try{var n=t.data,r=n.Bb;if(r===`load`){let t=[];self.onmessage=e=>t.push(e),self.startWorker=()=>{postMessage({Bb:`loaded`});for(let n of t)e(n);self.onmessage=e};for(let e of n.Rb)a[e]&&!a[e].proxy||(a[e]=(...t)=>{postMessage({Bb:`callHandler`,Qb:e,args:t})},e==`print`&&(b=a[e]),e==`printErr`&&(x=a[e]));S=n.kc,I(),P(n.lc)}else if(r===`run`){Le(n.Ab),br(n.Ab,0,0,1,0,0),Pe(),Ht(n.Ab),F||(gr(),F=!0);try{Re(n.fc,n.Hb)}catch(e){if(e!=`unwind`)throw e}}else n.target!==`setimmediate`&&(r===`checkMailbox`?F&&Ut():r&&(x(`worker: received unknown command ${r}`),x(n)))}catch(e){throw xr(),e}};var fe=e,P,F=!1;x=function(...e){e=e.join(` `),console.error(e)},self.alert=function(...e){postMessage({Bb:`alert`,text:e.join(` `),ic:_r()})},self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}function I(){var e=S.buffer;a.HEAP8=T=new Int8Array(e),a.HEAP16=D=new Int16Array(e),a.HEAPU8=E=new Uint8Array(e),a.HEAPU16=O=new Uint16Array(e),a.HEAP32=k=new Int32Array(e),a.HEAPU32=A=new Uint32Array(e),a.HEAPF32=ee=new Float32Array(e),a.HEAPF64=re=new Float64Array(e),a.HEAP64=te=new BigInt64Array(e),a.HEAPU64=ne=new BigUint64Array(e)}function L(){l?startWorker(a):Z.Ca()}l||(S=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),I());var pe,me=0,he=null;function ge(){if(--me==0&&he){var e=he;he=null,e()}}function _e(e){throw x(e=`Aborted(`+e+`)`),ie=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),i(e),e}function R(){return{a:{L:be,Aa:ye,b:Be,$:Ve,A:We,pa:Ge,X:Je,Z:Ye,qa:Xe,na:Ze,ga:Qe,ma:$e,J:et,Y:tt,V:nt,oa:rt,W:it,va:st,E:ht,Q:_t,O:Tt,D:Dt,u:Ot,r:kt,P:At,z:Rt,R:zt,ja:Bt,T:Wt,aa:Kt,M:qt,F:Jt,ia:Ht,sa:Yt,t:Qt,Ba:$t,w:dn,o:pn,l:hn,c:bt,n:W,j:bn,v:G,p:xn,f:Sn,s:Cn,m:wn,e:Tn,k:En,i:Dn,g:On,d:kn,da:An,ea:Pn,fa:Fn,ba:In,ca:Ln,N:Bn,xa:Vn,ua:Wn,h:qn,C:Jn,G:Yn,ta:Hn,x:Xn,ra:Zn,U:Qn,q:zn,y:$n,K:er,S:tr,za:ir,ya:ar,ka:Y,la:sr,_:ke,B:cr,I:lr,ha:ur,H:dr,a:S,wa:De}}}var ve={829644:(e,t,n,r,i)=>{if(a===void 0||!a.Eb)return 1;if((e=V(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=a.Eb.get(e)))return 2;if(t=Number(t>>>0),n=Number(n>>>0),r=Number(r>>>0),t+n>e.byteLength)return 3;try{let o=e.subarray(t,t+n);switch(i){case 0:se().set(o,r>>>0);break;case 1:a.mc?a.mc(r,o):a.bc(r,o);break;default:return 4}return 0}catch{return 4}},830468:(e,t,n)=>{a.Ob(e,se().subarray(t>>>0,t+n>>>0))},830532:()=>a.nc(),830574:e=>{a.Nb(e)},830611:()=>{a.Vb()},830642:()=>{a.Wb()},830671:()=>{a.$b()},830696:e=>a.Ub(e),830729:e=>a.Yb(e),830761:(e,t,n)=>{a.Kb(Number(e),Number(t),Number(n),!0)},830824:(e,t,n)=>{a.Kb(Number(e),Number(t),Number(n))},830881:()=>typeof wasmOffsetConverter<`u`,830938:e=>{a.jb(`Abs`,e,void 0)},830989:e=>{a.jb(`Neg`,e,void 0)},831040:e=>{a.jb(`Floor`,e,void 0)},831093:e=>{a.jb(`Ceil`,e,void 0)},831145:e=>{a.jb(`Reciprocal`,e,void 0)},831203:e=>{a.jb(`Sqrt`,e,void 0)},831255:e=>{a.jb(`Exp`,e,void 0)},831306:e=>{a.jb(`Erf`,e,void 0)},831357:e=>{a.jb(`Sigmoid`,e,void 0)},831412:(e,t,n)=>{a.jb(`HardSigmoid`,e,{alpha:t,beta:n})},831491:e=>{a.jb(`Log`,e,void 0)},831542:e=>{a.jb(`Sin`,e,void 0)},831593:e=>{a.jb(`Cos`,e,void 0)},831644:e=>{a.jb(`Tan`,e,void 0)},831695:e=>{a.jb(`Asin`,e,void 0)},831747:e=>{a.jb(`Acos`,e,void 0)},831799:e=>{a.jb(`Atan`,e,void 0)},831851:e=>{a.jb(`Sinh`,e,void 0)},831903:e=>{a.jb(`Cosh`,e,void 0)},831955:e=>{a.jb(`Asinh`,e,void 0)},832008:e=>{a.jb(`Acosh`,e,void 0)},832061:e=>{a.jb(`Atanh`,e,void 0)},832114:e=>{a.jb(`Tanh`,e,void 0)},832166:e=>{a.jb(`Not`,e,void 0)},832217:(e,t,n)=>{a.jb(`Clip`,e,{min:t,max:n})},832286:e=>{a.jb(`Clip`,e,void 0)},832338:(e,t)=>{a.jb(`Elu`,e,{alpha:t})},832396:e=>{a.jb(`Gelu`,e,void 0)},832448:e=>{a.jb(`Relu`,e,void 0)},832500:(e,t)=>{a.jb(`LeakyRelu`,e,{alpha:t})},832564:(e,t)=>{a.jb(`ThresholdedRelu`,e,{alpha:t})},832634:(e,t)=>{a.jb(`Cast`,e,{to:t})},832692:e=>{a.jb(`Add`,e,void 0)},832743:e=>{a.jb(`Sub`,e,void 0)},832794:e=>{a.jb(`Mul`,e,void 0)},832845:e=>{a.jb(`Div`,e,void 0)},832896:e=>{a.jb(`Pow`,e,void 0)},832947:e=>{a.jb(`Equal`,e,void 0)},833e3:e=>{a.jb(`Greater`,e,void 0)},833055:e=>{a.jb(`GreaterOrEqual`,e,void 0)},833117:e=>{a.jb(`Less`,e,void 0)},833169:e=>{a.jb(`LessOrEqual`,e,void 0)},833228:(e,t,n,r,i)=>{a.jb(`ReduceMean`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},833403:(e,t,n,r,i)=>{a.jb(`ReduceMax`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},833577:(e,t,n,r,i)=>{a.jb(`ReduceMin`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},833751:(e,t,n,r,i)=>{a.jb(`ReduceProd`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},833926:(e,t,n,r,i)=>{a.jb(`ReduceSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834100:(e,t,n,r,i)=>{a.jb(`ReduceL1`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834273:(e,t,n,r,i)=>{a.jb(`ReduceL2`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834446:(e,t,n,r,i)=>{a.jb(`ReduceLogSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834623:(e,t,n,r,i)=>{a.jb(`ReduceSumSquare`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834803:(e,t,n,r,i)=>{a.jb(`ReduceLogSumExp`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},834983:e=>{a.jb(`Where`,e,void 0)},835036:(e,t,n)=>{a.jb(`Transpose`,e,{perm:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[]})},835160:(e,t,n,r)=>{a.jb(`DepthToSpace`,e,{blocksize:t,mode:V(n),format:r?`NHWC`:`NCHW`})},835293:(e,t,n,r)=>{a.jb(`DepthToSpace`,e,{blocksize:t,mode:V(n),format:r?`NHWC`:`NCHW`})},835426:(e,t,n,r,i,o,s,c,l,u,d,f,p,m,h)=>{a.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:r,kernelShape:[i],pads:[o,s],strides:[c],wIsConst:()=>!!oe()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:V(h)})},835859:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:r,kernelShape:Array.from(M().subarray(Number(i)>>>0,2+(Number(i)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!oe()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:V(m)})},836520:(e,t,n,r,i,o,s,c,l,u,d,f,p,m,h)=>{a.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:r,kernelShape:[i],pads:[o,s],strides:[c],wIsConst:()=>!!oe()[u>>>0],outputPadding:d?Array.from(M().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(M().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:V(h)})},836953:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(M().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:r,kernelShape:Array.from(M().subarray(Number(i)>>>0,2+(Number(i)>>>0)>>>0)),pads:Array.from(M().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(M().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!oe()[l>>>0],outputPadding:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:V(m)})},837614:(e,t)=>{a.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},837705:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:r,storage_order:i,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838184:(e,t)=>{a.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},838275:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:r,storage_order:i,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838754:(e,t)=>{a.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},838841:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:r,storage_order:i,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839316:(e,t)=>{a.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},839403:(e,t,n,r,i,o,s,c,l,u,d,f,p,m)=>{a.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:r,storage_order:i,dilations:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(M().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839878:(e,t,n,r,i)=>{a.jb(`Gemm`,e,{alpha:t,beta:n,transA:r,transB:i})},839982:e=>{a.jb(`MatMul`,e,void 0)},840036:(e,t,n,r)=>{a.jb(`ArgMax`,e,{keepDims:!!t,selectLastIndex:!!n,axis:r})},840144:(e,t,n,r)=>{a.jb(`ArgMin`,e,{keepDims:!!t,selectLastIndex:!!n,axis:r})},840252:(e,t)=>{a.jb(`Softmax`,e,{axis:t})},840315:(e,t)=>{a.jb(`Concat`,e,{axis:t})},840375:(e,t,n,r,i)=>{a.jb(`Split`,e,{axis:t,numOutputs:n,splitSizes:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},840531:e=>{a.jb(`Expand`,e,void 0)},840585:(e,t)=>{a.jb(`Gather`,e,{axis:Number(t)})},840656:(e,t)=>{a.jb(`GatherElements`,e,{axis:Number(t)})},840735:(e,t)=>{a.jb(`GatherND`,e,{batch_dims:Number(t)})},840814:(e,t,n,r,i,o,s,c,l,u,d)=>{a.jb(`Resize`,e,{antialias:t,axes:n?Array.from(M().subarray(Number(n)>>>0,Number(r)>>>0)):[],coordinateTransformMode:V(i),cubicCoeffA:o,excludeOutside:s,extrapolationValue:c,keepAspectRatioPolicy:V(l),mode:V(u),nearestMode:V(d)})},841176:(e,t,n,r,i,o,s)=>{a.jb(`Slice`,e,{starts:t?Array.from(M().subarray(Number(t)>>>0,Number(n)>>>0)):[],ends:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[],axes:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[]})},841440:e=>{a.jb(`Tile`,e,void 0)},841492:(e,t,n)=>{a.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841606:(e,t,n)=>{a.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841720:e=>{a.jb(`Range`,e,void 0)},841773:(e,t)=>{a.jb(`Einsum`,e,{equation:V(t)})},841854:(e,t,n,r,i)=>{a.jb(`Pad`,e,{mode:t,value:n,pads:r?Array.from(M().subarray(Number(r)>>>0,Number(i)>>>0)):[]})},841997:(e,t,n,r,i,o)=>{a.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!i,trainingMode:!!r,format:o?`NHWC`:`NCHW`})},842166:(e,t,n,r,i,o)=>{a.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!i,trainingMode:!!r,format:o?`NHWC`:`NCHW`})},842335:(e,t,n)=>{a.jb(`CumSum`,e,{exclusive:Number(t),reverse:Number(n)})},842432:(e,t,n)=>{a.jb(`DequantizeLinear`,e,{axis:t,blockSize:n})},842522:(e,t,n,r,i)=>{a.jb(`GridSample`,e,{align_corners:t,mode:V(n),padding_mode:V(r),format:i?`NHWC`:`NCHW`})},842692:(e,t,n,r,i)=>{a.jb(`GridSample`,e,{align_corners:t,mode:V(n),padding_mode:V(r),format:i?`NHWC`:`NCHW`})},842862:(e,t)=>{a.jb(`ScatterND`,e,{reduction:V(t)})},842947:(e,t,n,r,i,o,s,c,l)=>{a.jb(`Attention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:r,scale:i,doRotary:o,qkvHiddenSizes:s?Array.from(M().subarray(Number(c)>>>0,Number(c)+s>>>0)):[],pastPresentShareBuffer:!!l})},843219:e=>{a.jb(`BiasAdd`,e,void 0)},843274:e=>{a.jb(`BiasSplitGelu`,e,void 0)},843335:e=>{a.jb(`FastGelu`,e,void 0)},843391:(e,t,n,r,i,o,s,c,l,u,d,f,p,m,h,g)=>{a.jb(`Conv`,e,{format:f?`NHWC`:`NCHW`,auto_pad:t,dilations:n?Array.from(M().subarray(Number(n)>>>0,Number(r)>>>0)):[],group:i,kernel_shape:o?Array.from(M().subarray(Number(o)>>>0,Number(s)>>>0)):[],pads:c?Array.from(M().subarray(Number(c)>>>0,Number(l)>>>0)):[],strides:u?Array.from(M().subarray(Number(u)>>>0,Number(d)>>>0)):[],w_is_const:()=>!!oe()[Number(p)>>>0],activation:V(m),activation_params:h?Array.from(ue().subarray(Number(h)>>>0,Number(g)>>>0)):[]})},843975:e=>{a.jb(`Gelu`,e,void 0)},844027:(e,t,n,r,i,o,s,c,l)=>{a.jb(`GroupQueryAttention`,e,{numHeads:t,kvNumHeads:n,scale:r,softcap:i,doRotary:o,rotaryInterleaved:s,smoothSoftmax:c,localWindowSize:l})},844244:(e,t,n,r)=>{a.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!r})},844355:(e,t,n,r)=>{a.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!r})},844466:(e,t,n,r,i,o)=>{a.jb(`MatMulNBits`,e,{k:t,n,accuracyLevel:r,bits:i,blockSize:o})},844593:(e,t,n,r,i,o)=>{a.jb(`MultiHeadAttention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:r,scale:i,doRotary:o})},844752:(e,t)=>{a.jb(`QuickGelu`,e,{alpha:t})},844816:(e,t,n,r,i)=>{a.jb(`RotaryEmbedding`,e,{interleaved:!!t,numHeads:n,rotaryEmbeddingDim:r,scale:i})},844955:(e,t,n)=>{a.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845057:(e,t,n)=>{a.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845159:(e,t,n,r)=>{a.jb(`GatherBlockQuantized`,e,{gatherAxis:t,quantizeAxis:n,blockSize:r})},845280:e=>{a.Zb(e)},845314:(e,t)=>a.ac(Number(e),Number(t),a.Fb.dc,a.Fb.errors)};function ye(e,t,n){return un(async()=>{await a.Xb(Number(e),Number(t),Number(n))})}function be(){return typeof wasmOffsetConverter<`u`}class xe{constructor(t){e.defineProperty(this,`name`,`ExitStatus`),this.message=`Program terminated with exit(${t})`,this.status=t}}var Se=e=>{e.terminate(),e.onmessage=()=>{}},Ce=[],we=e=>{Ae.length==0&&(Ie(),Fe(Ae[0]));var t=Ae.pop();if(!t)return 6;je.push(t),Ne[e.Ab]=t,t.Ab=e.Ab;var n={Bb:`run`,fc:e.ec,Hb:e.Hb,Ab:e.Ab};return t.postMessage(n,e.Mb),0},Te=0,Ee=(e,t,...n)=>{for(var r=2*n.length,i=Ar(),a=kr(8*r),o=a>>>3,s=0;s>>0]=c)}return e=Sr(e,0,r,a,t),Or(i),e};function De(e){if(l)return Ee(0,1,e);if(w=e,!(0{if(w=e,l)throw Oe(e),`unwind`;De(e)},Ae=[],je=[],Me=[],Ne={},z=e=>{var t=e.Ab;delete Ne[t],Ae.push(e),je.splice(je.indexOf(e),1),e.Ab=0,Cr(t)};function Pe(){Me.forEach(e=>e())}var Fe=e=>new Promise(t=>{e.onmessage=n=>{var r=(n=n.data).Bb;if(n.Gb&&n.Gb!=_r()){var i=Ne[n.Gb];i?i.postMessage(n,n.Mb):x(`Internal error! Worker sent a message "${r}" to target pthread ${n.Gb}, but that thread no longer exists!`)}else r===`checkMailbox`?Ut():r===`spawnThread`?we(n):r===`cleanupThread`?z(Ne[n.hc]):r===`loaded`?(e.loaded=!0,t(e)):r===`alert`?alert(`Thread ${n.ic}: ${n.text}`):n.target===`setimmediate`?e.postMessage(n):r===`callHandler`?a[n.Qb](...n.args):r&&x(`worker sent an unknown command ${r}`)},e.onerror=e=>{throw x(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var n,r=[];for(n of[])a.propertyIsEnumerable(n)&&r.push(n);e.postMessage({Bb:`load`,Rb:r,kc:S,lc:C})});function Ie(){var e=new Worker((()=>{let e=URL;return self.location.href>`file:`&&self.location.href<`file;`?new e(`ort.bundle.min.mjs`,self.location.href):new URL(self.location.href)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});Ae.push(e)}var Le=e=>{I();var t=N()[e+52>>>2>>>0];e=N()[e+56>>>2>>>0],Dr(t,t-e),Or(t)},Re=(e,t)=>{Te=0,e=jr(e,t),0>>=0);throw t>>>=0,n>>>=0,N()[r.Ib+16>>>2>>>0]=0,N()[r.Ib+4>>>2>>>0]=t,N()[r.Ib+8>>>2>>>0]=n,e}function B(e,t,n,r){return l?Ee(2,1,e,t,n,r):Ve(e,t,n,r)}function Ve(e,t,n,r){if(e>>>=0,n>>>=0,r>>>=0,u===void 0)return 6;var i=[];return l&&i.length===0?B(e,t>>>=0,n,r):(e={ec:n,Ab:e,Hb:r,Mb:i},l?(e.Bb=`spawnThread`,postMessage(e,i),0):we(e))}var He=typeof TextDecoder<`u`?new TextDecoder:void 0,Ue=(e,t=0,n=NaN)=>{var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},V=(e,t)=>(e>>>=0)?Ue(se(),e,t):``;function We(e,t,n){return l?Ee(3,1,e,t,n):0}function Ge(e,t){if(l)return Ee(4,1,e,t)}var Ke=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},qe=(e,t,n)=>{var r=se();if(t>>>=0,0=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(t>=n)break;r[t++>>>0]=o}else{if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6}else{if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63}r[t++>>>0]=128|o>>6&63}r[t++>>>0]=128|63&o}}r[t>>>0]=0,e=t-i}else e=0;return e};function Je(e,t){if(l)return Ee(5,1,e,t)}function Ye(e,t,n){if(l)return Ee(6,1,e,t,n)}function Xe(e,t,n){return l?Ee(7,1,e,t,n):0}function Ze(e,t){if(l)return Ee(8,1,e,t)}function Qe(e,t,n){if(l)return Ee(9,1,e,t,n)}function $e(e,t,n,r){if(l)return Ee(10,1,e,t,n,r)}function et(e,t,n,r){if(l)return Ee(11,1,e,t,n,r)}function tt(e,t,n,r){if(l)return Ee(12,1,e,t,n,r)}function nt(e){if(l)return Ee(13,1,e)}function rt(e,t){if(l)return Ee(14,1,e,t)}function it(e,t,n){if(l)return Ee(15,1,e,t,n)}var at,ot,st=()=>_e(``),lt=e=>{for(var t=``;se()[e>>>0];)t+=at[se()[e++>>>0]];return t},ut={},dt={},ft={};function pt(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new ot(`type "${r}" must have a positive integer typeid pointer`);if(dt.hasOwnProperty(e)){if(n.Sb)return;throw new ot(`Cannot register type '${r}' twice`)}dt[e]=t,delete ft[e],ut.hasOwnProperty(e)&&(t=ut[e],delete ut[e],t.forEach(e=>e()))}(e,t,n)}var mt=(e,t,n)=>{switch(t){case 1:return n?e=>oe()[e>>>0]:e=>se()[e>>>0];case 2:return n?e=>ce()[e>>>1>>>0]:e=>le()[e>>>1>>>0];case 4:return n?e=>M()[e>>>2>>>0]:e=>N()[e>>>2>>>0];case 8:return n?e=>te[e>>>3]:e=>ne[e>>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function ht(e,t,n){n>>>=0,pt(e>>>=0,{name:t=lt(t>>>0),fromWireType:e=>e,toWireType:function(e,t){if(typeof t!=`bigint`&&typeof t!=`number`)throw t=t===null?`null`:(e=typeof t)==`object`||e===`array`||e===`function`?t.toString():``+t,TypeError(`Cannot convert "${t}" to ${this.name}`);return typeof t==`number`&&(t=BigInt(t)),t},Cb:gt,readValueFromPointer:mt(t,n,t.indexOf(`u`)==-1),Db:null})}var gt=8;function _t(e,t,n,r){pt(e>>>=0,{name:t=lt(t>>>0),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},Cb:gt,readValueFromPointer:function(e){return this.fromWireType(se()[e>>>0])},Db:null})}var vt=[],yt=[];function bt(e){9<(e>>>=0)&&--yt[e+1]==0&&(yt[e]=void 0,vt.push(e))}var xt=e=>{if(!e)throw new ot(`Cannot use deleted val. handle = `+e);return yt[e]},St=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=vt.pop()||yt.length;return yt[t]=e,yt[t+1]=1,t}};function Ct(e){return this.fromWireType(N()[e>>>2>>>0])}var wt={name:`emscripten::val`,fromWireType:e=>{var t=xt(e);return bt(e),t},toWireType:(e,t)=>St(t),Cb:gt,readValueFromPointer:Ct,Db:null};function Tt(e){return pt(e>>>0,wt)}var Et=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(ue()[e>>>2>>>0])};case 8:return function(e){return this.fromWireType(de()[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function Dt(e,t,n){n>>>=0,pt(e>>>=0,{name:t=lt(t>>>0),fromWireType:e=>e,toWireType:(e,t)=>t,Cb:gt,readValueFromPointer:Et(t,n),Db:null})}function Ot(e,t,n,r,i){if(e>>>=0,n>>>=0,t=lt(t>>>0),i===-1&&(i=4294967295),i=e=>e,r===0){var a=32-8*n;i=e=>e<>>a}var o=t.includes(`unsigned`)?function(e,t){return t>>>0}:function(e,t){return t};pt(e,{name:t,fromWireType:i,toWireType:o,Cb:gt,readValueFromPointer:mt(t,n,r!==0),Db:null})}function kt(e,t,n){function r(e){var t=N()[e>>>2>>>0];return e=N()[e+4>>>2>>>0],new i(oe().buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];pt(e>>>=0,{name:n=lt(n>>>0),fromWireType:r,Cb:gt,readValueFromPointer:r},{Sb:!0})}function At(e,t){pt(e>>>=0,{name:t=lt(t>>>0),fromWireType:function(e){for(var t,n=N()[e>>>2>>>0],r=e+4,i=r,a=0;a<=n;++a){var o=r+a;a!=n&&se()[o>>>0]!=0||(i=V(i,o-i),t===void 0?t=i:(t+=`\0`,t+=i),i=o+1)}return vr(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new ot(`Cannot pass non-string to std::string`);var r=n?Ke(t):t.length,i=yr(4+r+1),a=i+4;if(N()[i>>>2>>>0]=r,n)qe(t,a,r+1);else if(n)for(n=0;n>>0]=o}else for(n=0;n>>0]=t[n];return e!==null&&e.push(vr,i),i},Cb:gt,readValueFromPointer:Ct,Db(e){vr(e)}})}var jt=typeof TextDecoder<`u`?new TextDecoder(`utf-16le`):void 0,Mt=(e,t)=>{for(var n=e>>1,r=n+t/2;!(n>=r)&&le()[n>>>0];)++n;if(32<(n<<=1)-e&&jt)return jt.decode(se().slice(e,n));for(n=``,r=0;!(r>=t/2);++r){var i=ce()[e+2*r>>>1>>>0];if(i==0)break;n+=String.fromCharCode(i)}return n},Nt=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return ce()[t>>>1>>>0]=0,t-r},Pt=e=>2*e.length,Ft=(e,t)=>{for(var n=0,r=``;!(n>=t/4);){var i=M()[e+4*n>>>2>>>0];if(i==0)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r},It=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),M()[t>>>2>>>0]=a,(t+=4)+4>n)break}return M()[t>>>2>>>0]=0,t-r},Lt=e=>{for(var t=0,n=0;n=r&&++n,t+=4}return t};function Rt(e,t,n){if(e>>>=0,t>>>=0,n=lt(n>>>=0),t===2)var r=Mt,i=Nt,a=Pt,o=e=>le()[e>>>1>>>0];else t===4&&(r=Ft,i=It,a=Lt,o=e=>N()[e>>>2>>>0]);pt(e,{name:n,fromWireType:e=>{for(var n,i=N()[e>>>2>>>0],a=e+4,s=0;s<=i;++s){var c=e+4+s*t;s!=i&&o(c)!=0||(a=r(a,c-a),n===void 0?n=a:(n+=`\0`,n+=a),a=c+t)}return vr(e),n},toWireType:(e,r)=>{if(typeof r!=`string`)throw new ot(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=yr(4+o+t);return N()[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(vr,s),s},Cb:gt,readValueFromPointer:Ct,Db(e){vr(e)}})}function zt(e,t){pt(e>>>=0,{Tb:!0,name:t=lt(t>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function Bt(e){br(e>>>0,!c,1,!s,131072,!1),Pe()}var Vt=e=>{if(!ie)try{if(e(),!(0>>=0,typeof Atomics.jc==`function`&&(Atomics.jc(M(),e>>>2,e).value.then(Ut),e+=128,Atomics.store(M(),e>>>2,1))}var Ut=()=>{var e=_r();e&&(Ht(e),Vt(Er))};function Wt(e,t){(e>>>=0)==t>>>0?setTimeout(Ut):l?postMessage({Gb:e,Bb:`checkMailbox`}):(e=Ne[e])&&e.postMessage({Bb:`checkMailbox`})}var Gt=[];function Kt(e,t,n,r,i){for(t>>>=0,r/=2,Gt.length=r,n=i>>>0>>>3,i=0;i>>0];return(t?ve[t]:mr[e])(...Gt)}var qt=()=>{Te=0};function Jt(e){e>>>=0,l?postMessage({Bb:`cleanupThread`,hc:e}):z(Ne[e])}function Yt(e){}var Xt=(e,t)=>{var n=dt[e];if(n===void 0)throw e=hr(e),n=lt(e),vr(e),new ot(`${t} has unknown type ${n}`);return n},Zt=(e,t,n)=>{var r=[];return e=e.toWireType(r,n),r.length&&(N()[t>>>2>>>0]=St(r)),e};function Qt(e,t,n){return t>>>=0,n>>>=0,e=xt(e>>>0),t=Xt(t,`emval::as`),Zt(t,n,e)}function $t(e,t){return t>>>=0,e=xt(e>>>0),(t=Xt(t,`emval::as`)).toWireType(null,e)}var en=e=>{try{e()}catch(e){_e(e)}},tn=0,nn=null,rn=0,an=[],H={},on={},sn=0,cn=null,ln=[];function un(e){return function(e){if(!ie){if(tn===0){var t=!1,n=!1;e((e=0)=>{if(!ie&&(rn=e,t=!0,n)){tn=2,en(()=>Pr(nn)),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.resume(),e=!1;try{var r=function(){var e=M()[nn+8>>>2>>>0];return e=Z[on[e]],--Te,e()}()}catch(t){r=t,e=!0}var i=!1;if(!nn){var a=cn;a&&(cn=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(tn=1,nn=function(){var e=yr(65548),t=e+12;N()[e>>>2>>>0]=t,N()[e+4>>>2>>>0]=t+65536,t=an[0];var n=H[t];return n===void 0&&(n=sn++,H[t]=n,on[n]=t),t=n,M()[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.pause(),en(()=>Mr(nn)))}else tn===2?(tn=0,en(Fr),vr(nn),nn=null,ln.forEach(Vt)):_e(`invalid state: ${tn}`);return rn}}(t=>{e().then(t)})}function dn(e){return e>>>=0,un(async()=>{var t=await xt(e);return St(t)})}var fn=[];function pn(e,t,n,r){return n>>>=0,r>>>=0,(e=fn[e>>>0])(null,t=xt(t>>>0),n,r)}var U={},mn=e=>{var t=U[e];return t===void 0?lt(e):t};function hn(e,t,n,r,i){return n>>>=0,r>>>=0,i>>>=0,(e=fn[e>>>0])(t=xt(t>>>0),t[n=mn(n)],r,i)}var gn=()=>typeof globalThis==`object`?globalThis:Function(`return this`)();function W(e){return(e>>>=0)==0?St(gn()):(e=mn(e),St(gn()[e]))}var _n=e=>{var t=fn.length;return fn.push(e),t},vn=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],`parameter `+r);return n},yn=(e,t)=>Object.defineProperty(t,`name`,{value:e});function bn(e,t,n){var r=(t=vn(e,t>>>0)).shift();e--;var i=`return function (obj, func, destructorsRef, args) { +`,a=0,o=[];n===0&&o.push(`obj`);for(var s=[`retType`],c=[r],l=0;le.name).join(`, `)}) => ${r.name}>`,_n(yn(n,e))}function G(e){return e=mn(e>>>0),St(a[e])}function xn(e,t){return t>>>=0,e=xt(e>>>0),t=xt(t),St(e[t])}function Sn(e){9<(e>>>=0)&&(yt[e+1]+=1)}function Cn(){return St([])}function wn(e){e=xt(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function En(){return St({})}function Dn(e){for(var t=xt(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}bt(e)}function On(e,t,n){t>>>=0,n>>>=0,e=xt(e>>>0),t=xt(t),n=xt(n),e[t]=n}function kn(e,t){return t>>>=0,e=(e=Xt(e>>>0,`_emval_take_value`)).readValueFromPointer(t),St(e)}function An(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getUTCSeconds(),M()[t+4>>>2>>>0]=e.getUTCMinutes(),M()[t+8>>>2>>>0]=e.getUTCHours(),M()[t+12>>>2>>>0]=e.getUTCDate(),M()[t+16>>>2>>>0]=e.getUTCMonth(),M()[t+20>>>2>>>0]=e.getUTCFullYear()-1900,M()[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,M()[t+28>>>2>>>0]=e}var jn=e=>e%4==0&&(e%100!=0||e%400==0),Mn=[0,31,60,91,121,152,182,213,244,274,305,335],Nn=[0,31,59,90,120,151,181,212,243,273,304,334];function Pn(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),M()[t>>>2>>>0]=e.getSeconds(),M()[t+4>>>2>>>0]=e.getMinutes(),M()[t+8>>>2>>>0]=e.getHours(),M()[t+12>>>2>>>0]=e.getDate(),M()[t+16>>>2>>>0]=e.getMonth(),M()[t+20>>>2>>>0]=e.getFullYear()-1900,M()[t+24>>>2>>>0]=e.getDay();var n=(jn(e.getFullYear())?Mn:Nn)[e.getMonth()]+e.getDate()-1|0;M()[t+28>>>2>>>0]=n,M()[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),M()[t+32>>>2>>>0]=e}function Fn(e){e>>>=0;var t=new Date(M()[e+20>>>2>>>0]+1900,M()[e+16>>>2>>>0],M()[e+12>>>2>>>0],M()[e+8>>>2>>>0],M()[e+4>>>2>>>0],M()[e>>>2>>>0],0),n=M()[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?M()[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(jn(t.getFullYear())?Mn:Nn)[t.getMonth()]+t.getDate()-1|0,M()[e+28>>>2>>>0]=n,M()[e>>>2>>>0]=t.getSeconds(),M()[e+4>>>2>>>0]=t.getMinutes(),M()[e+8>>>2>>>0]=t.getHours(),M()[e+12>>>2>>>0]=t.getDate(),M()[e+16>>>2>>>0]=t.getMonth(),M()[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function In(e,t,n,r,i,a,o){return l?Ee(16,1,e,t,n,r,i,a,o):-52}function Ln(e,t,n,r,i,a){if(l)return Ee(17,1,e,t,n,r,i,a)}var Rn={},zn=()=>performance.timeOrigin+performance.now();function Bn(e,t){if(l)return Ee(18,1,e,t);if(Rn[e]&&(clearTimeout(Rn[e].id),delete Rn[e]),!t)return 0;var n=setTimeout(()=>{delete Rn[e],Vt(()=>Tr(e,performance.timeOrigin+performance.now()))},t);return Rn[e]={id:n,qc:t},0}function Vn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);N()[e>>>2>>>0]=60*o,M()[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),Un=1;function Wn(e,t,n){if(!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Un)return 52;e=performance.timeOrigin+performance.now()}return te[n>>>0>>>3]=BigInt(Math.round(1e6*e)),0}var Gn=[],Kn=(e,t)=>{Gn.length=0;for(var n;n=se()[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,Gn.push(n==112?N()[t>>>2>>>0]:n==106?te[t>>>3]:n==105?M()[t>>>2>>>0]:de()[t>>>3>>>0]),t+=r?8:4}return Gn};function qn(e,t,n){return e>>>=0,t=Kn(t>>>0,n>>>0),ve[e](...t)}function Jn(e,t,n){return e>>>=0,t=Kn(t>>>0,n>>>0),ve[e](...t)}var Yn=()=>{};function Xn(e,t){return x(V(e>>>0,t>>>0))}var Zn=()=>{throw Te+=1,`unwind`};function Qn(){return 4294901760}var $n=()=>navigator.hardwareConcurrency;function er(){return _e(`Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER`),0}function tr(e){e>>>=0;var t=se().length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-S.buffer.byteLength+65535)/65536|0;try{S.grow(r),I();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}var K=()=>(_e(`Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER`),0),nr={},rr=e=>{e.forEach(e=>{var t=K();t&&(nr[t]=e)})};function ir(){var e=Error().stack.toString().split(` +`);return e[0]==`Error`&&e.shift(),rr(e),nr.Lb=K(),nr.cc=e,nr.Lb}function ar(e,t,n){if(e>>>=0,t>>>=0,nr.Lb==e)var r=nr.cc;else (r=Error().stack.toString().split(` +`))[0]==`Error`&&r.shift(),rr(r);for(var i=3;r[i]&&K()!=e;)++i;for(e=0;e>>2>>>0]=K();return e}var q,or={},J=()=>{if(!q){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in or)or[e]===void 0?delete t[e]:t[e]=or[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);q=n}return q};function Y(e,t){if(l)return Ee(19,1,e,t);e>>>=0,t>>>=0;var n=0;return J().forEach((r,i)=>{var a=t+n;for(i=N()[e+4*i>>>2>>>0]=a,a=0;a>>0]=r.charCodeAt(a);oe()[i>>>0]=0,n+=r.length+1}),0}function sr(e,t){if(l)return Ee(20,1,e,t);e>>>=0,t>>>=0;var n=J();N()[e>>>2>>>0]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),N()[t>>>2>>>0]=r,0}function cr(e){return l?Ee(21,1,e):52}function lr(e,t,n,r){return l?Ee(22,1,e,t,n,r):52}function ur(e,t,n,r){return l?Ee(23,1,e,t,n,r):70}var X=[null,[],[]];function dr(e,t,n,r){if(l)return Ee(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var i=0,a=0;a>>2>>>0],s=N()[t+4>>>2>>>0];t+=8;for(var c=0;c>>0],d=X[e];u===0||u===10?((e===1?b:x)(Ue(d)),d.length=0):d.push(u)}i+=s}return N()[r>>>2>>>0]=i,0}l||function(){for(var e=a.numThreads-1;e--;)Ie();Ce.unshift(()=>{me++,function(e){l?e():Promise.all(Ae.map(Fe)).then(e)}(()=>ge())})}();for(var fr=Array(256),pr=0;256>pr;++pr)fr[pr]=String.fromCharCode(pr);at=fr,ot=a.BindingError=class extends Error{constructor(e){super(e),this.name=`BindingError`}},a.InternalError=class extends Error{constructor(e){super(e),this.name=`InternalError`}},yt.push(0,1,void 0,1,null,1,!0,1,!1,1),a.count_emval_handles=()=>yt.length/2-5-vt.length;var Z,mr=[De,Oe,B,We,Ge,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,In,Ln,Bn,Y,sr,cr,lr,ur,dr];(async function(){function e(e,t){return Z=e.exports,Z=function(){var e=Z,t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`function`?(...e)=>{an.push(n);try{return r(...e)}finally{ie||(an.pop(),nn&&tn===1&&an.length===0&&(tn=0,Te+=1,en(Nr),typeof Fibers<`u`&&Fibers.rc()))}}:r;return t}(),Z=function(){var e=Z,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).Da=t(e.Da),e.fb=n(e.fb),e.hb=t(e.hb),e.tb=t(e.tb),e.ub=n(e.ub),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}(),Me.push(Z.ib),C=t,ge(),Z}me++;var t=R();if(a.instantiateWasm)return new Promise(n=>{a.instantiateWasm(t,(t,r)=>{e(t,r),n(t.exports)})});if(l)return new Promise(t=>{P=n=>{var r=new WebAssembly.Instance(n,R());t(e(r,n))}});pe??=a.locateFile?a.locateFile?a.locateFile(`ort-wasm-simd-threaded.jsep.wasm`,_):_+`ort-wasm-simd-threaded.jsep.wasm`:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+self.location.href).href;try{var n=await async function(e){var t=pe;if(!j&&typeof WebAssembly.instantiateStreaming==`function`&&!ae(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){x(`wasm streaming compile failed: ${e}`),x(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!j)try{var t=await p(e);return new Uint8Array(t)}catch{}if(e==pe&&j)e=new Uint8Array(j);else{if(!m)throw`both async and sync fetching of the wasm failed`;e=m(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){x(`failed to asynchronously prepare wasm: ${e}`),_e(e)}}(t,e)}(t);return e(n.instance,n.module)}catch(e){return i(e),Promise.reject(e)}})();var hr=e=>(hr=Z.Da)(e),gr=()=>(gr=Z.Ea)();a._OrtInit=(e,t)=>(a._OrtInit=Z.Fa)(e,t),a._OrtGetLastError=(e,t)=>(a._OrtGetLastError=Z.Ga)(e,t),a._OrtCreateSessionOptions=(e,t,n,r,i,o,s,c,l,u)=>(a._OrtCreateSessionOptions=Z.Ha)(e,t,n,r,i,o,s,c,l,u),a._OrtAppendExecutionProvider=(e,t,n,r,i)=>(a._OrtAppendExecutionProvider=Z.Ia)(e,t,n,r,i),a._OrtAddFreeDimensionOverride=(e,t,n)=>(a._OrtAddFreeDimensionOverride=Z.Ja)(e,t,n),a._OrtAddSessionConfigEntry=(e,t,n)=>(a._OrtAddSessionConfigEntry=Z.Ka)(e,t,n),a._OrtReleaseSessionOptions=e=>(a._OrtReleaseSessionOptions=Z.La)(e),a._OrtCreateSession=(e,t,n)=>(a._OrtCreateSession=Z.Ma)(e,t,n),a._OrtReleaseSession=e=>(a._OrtReleaseSession=Z.Na)(e),a._OrtGetInputOutputCount=(e,t,n)=>(a._OrtGetInputOutputCount=Z.Oa)(e,t,n),a._OrtGetInputOutputMetadata=(e,t,n,r)=>(a._OrtGetInputOutputMetadata=Z.Pa)(e,t,n,r),a._OrtFree=e=>(a._OrtFree=Z.Qa)(e),a._OrtCreateTensor=(e,t,n,r,i,o)=>(a._OrtCreateTensor=Z.Ra)(e,t,n,r,i,o),a._OrtGetTensorData=(e,t,n,r,i)=>(a._OrtGetTensorData=Z.Sa)(e,t,n,r,i),a._OrtReleaseTensor=e=>(a._OrtReleaseTensor=Z.Ta)(e),a._OrtCreateRunOptions=(e,t,n,r)=>(a._OrtCreateRunOptions=Z.Ua)(e,t,n,r),a._OrtAddRunConfigEntry=(e,t,n)=>(a._OrtAddRunConfigEntry=Z.Va)(e,t,n),a._OrtReleaseRunOptions=e=>(a._OrtReleaseRunOptions=Z.Wa)(e),a._OrtCreateBinding=e=>(a._OrtCreateBinding=Z.Xa)(e),a._OrtBindInput=(e,t,n)=>(a._OrtBindInput=Z.Ya)(e,t,n),a._OrtBindOutput=(e,t,n,r)=>(a._OrtBindOutput=Z.Za)(e,t,n,r),a._OrtClearBoundOutputs=e=>(a._OrtClearBoundOutputs=Z._a)(e),a._OrtReleaseBinding=e=>(a._OrtReleaseBinding=Z.$a)(e),a._OrtRunWithBinding=(e,t,n,r,i)=>(a._OrtRunWithBinding=Z.ab)(e,t,n,r,i),a._OrtRun=(e,t,n,r,i,o,s,c)=>(a._OrtRun=Z.bb)(e,t,n,r,i,o,s,c),a._OrtEndProfiling=e=>(a._OrtEndProfiling=Z.cb)(e),a._JsepOutput=(e,t,n)=>(a._JsepOutput=Z.db)(e,t,n),a._JsepGetNodeName=e=>(a._JsepGetNodeName=Z.eb)(e);var _r=()=>(_r=Z.fb)(),vr=a._free=e=>(vr=a._free=Z.gb)(e),yr=a._malloc=e=>(yr=a._malloc=Z.hb)(e),br=(e,t,n,r,i,a)=>(br=Z.kb)(e,t,n,r,i,a),xr=()=>(xr=Z.lb)(),Sr=(e,t,n,r,i)=>(Sr=Z.mb)(e,t,n,r,i),Cr=e=>(Cr=Z.nb)(e),wr=e=>(wr=Z.ob)(e),Tr=(e,t)=>(Tr=Z.pb)(e,t),Er=()=>(Er=Z.qb)(),Dr=(e,t)=>(Dr=Z.rb)(e,t),Or=e=>(Or=Z.sb)(e),kr=e=>(kr=Z.tb)(e),Ar=()=>(Ar=Z.ub)(),jr=a.dynCall_ii=(e,t)=>(jr=a.dynCall_ii=Z.vb)(e,t),Mr=e=>(Mr=Z.wb)(e),Nr=()=>(Nr=Z.xb)(),Pr=e=>(Pr=Z.yb)(e),Fr=()=>(Fr=Z.zb)();return a.stackSave=()=>Ar(),a.stackRestore=e=>Or(e),a.stackAlloc=e=>kr(e),a.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:oe()[e>>>0]=t;break;case`i16`:ce()[e>>>1>>>0]=t;break;case`i32`:M()[e>>>2>>>0]=t;break;case`i64`:te[e>>>3]=BigInt(t);break;case`float`:ue()[e>>>2>>>0]=t;break;case`double`:de()[e>>>3>>>0]=t;break;case`*`:N()[e>>>2>>>0]=t;break;default:_e(`invalid type for setValue: ${n}`)}},a.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return oe()[e>>>0];case`i16`:return ce()[e>>>1>>>0];case`i32`:return M()[e>>>2>>>0];case`i64`:return te[e>>>3];case`float`:return ue()[e>>>2>>>0];case`double`:return de()[e>>>3>>>0];case`*`:return N()[e>>>2>>>0];default:_e(`invalid type for getValue: ${t}`)}},a.UTF8ToString=V,a.stringToUTF8=qe,a.lengthBytesUTF8=Ke,function e(){if(0{"use strict";tt(),pt=typeof location>`u`?void 0:location.origin,mt=self.location.href>`file:`&&self.location.href<`file;`,ht=()=>{if(mt){let e=URL;return new URL(new e(`ort.bundle.min.mjs`,self.location.href).href,pt).href}return self.location.href},gt=ht(),_t=()=>{if(gt&&!gt.startsWith(`blob:`))return gt.substring(0,gt.lastIndexOf(`/`)+1)},vt=(e,t)=>{try{let n=t??gt;return(n?new URL(e,n):new URL(e)).origin===pt}catch{return!1}},yt=(e,t)=>{let n=t??gt;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},bt=(e,t)=>`${t??`./`}${e}`,xt=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},St=async e=>(await import(e)).default,Ct=(ot(),de(nt)).default,wt=async()=>{if(!gt)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(vt(gt))return[void 0,Ct()];let e=await xt(gt);return[e,Ct(e)]},Tt=(ft(),de(st)).default,Et=async(e,t,n)=>{if(!e&&!t&&Tt&>&&vt(gt))return[void 0,Tt];{let r=`ort-wasm-simd-threaded.jsep.mjs`,i=e??yt(r,t),a=n&&i&&!vt(i,t),o=a?await xt(i):i??bt(r,t);return[a?o:void 0,await St(o)]}}}),Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt=M(()=>{"use strict";Dt(),kt=!1,At=!1,jt=!1,Mt=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return 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}},Nt=()=>{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}},Pt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},Ft=async e=>{if(kt)return Promise.resolve();if(At)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(jt)throw Error(`previous call to 'initializeWebAssembly()' failed.`);At=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!Pt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!Nt())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=Mt();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Et(s,a,n>1),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=_t();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{At=!1,kt=!0,Ot=t,e(),d&&URL.revokeObjectURL(d)},e=>{At=!1,jt=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},It=()=>{if(kt&&Ot)return Ot;throw Error(`WebAssembly is not initialized yet.`)}}),Rt,zt,Bt,Vt=M(()=>{"use strict";Lt(),Rt=(e,t)=>{let n=It(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},zt=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)zt(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},Bt=e=>{let t=It(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),Ht,Ut=M(()=>{"use strict";Lt(),Vt(),Ht=e=>{let t=It(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=Rt(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&Bt(`Can't create run options.`),e?.extra!==void 0&&zt(e.extra,``,new WeakSet,(e,i)=>{let a=Rt(e,r),o=Rt(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&Bt(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),Wt,Gt,Kt,qt,Jt,Yt,Xt=M(()=>{"use strict";Lt(),Vt(),Wt=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},Gt=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},Kt=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},qt=(e,t,n,r)=>{let i=Rt(t,r),a=Rt(n,r);It()._OrtAddSessionConfigEntry(e,i,a)!==0&&Bt(`Can't set a session config entry: ${t} - ${n}.`)},Jt=async(e,t,n)=>{for(let r of t){let t=typeof r==`string`?r:r.name,i=[];switch(t){case`webnn`:if(t=`WEBNN`,typeof r!=`string`){let t=r?.deviceType;t&&qt(e,`deviceType`,t,n)}break;case`webgpu`:if(t=`JS`,typeof r!=`string`){let t=r;if(t?.preferredLayout){if(t.preferredLayout!==`NCHW`&&t.preferredLayout!==`NHWC`)throw Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${t.preferredLayout}`);qt(e,`preferredLayout`,t.preferredLayout,n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${t}`)}let a=Rt(t,n),o=i.length,s=0,c=0;if(o>0){s=It()._malloc(o*It().PTR_SIZE),n.push(s),c=It()._malloc(o*It().PTR_SIZE),n.push(c);for(let e=0;e{let t=It(),n=0,r=[],i=e||{};Kt(i);try{let e=Wt(i.graphOptimizationLevel??`all`),a=Gt(i.executionMode??`sequential`),o=typeof i.logId==`string`?Rt(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log serverity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?Rt(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&Bt(`Can't create session options.`),i.executionProviders&&await Jt(n,i.executionProviders,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);qt(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=Rt(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&Bt(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&zt(i.extra,``,new WeakSet,(e,t)=>{qt(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&Bt(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),Zt,Qt,$t,en,tn,nn,rn,an,H=M(()=>{"use strict";Zt=e=>{switch(e){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`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},Qt=e=>{switch(e){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 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},$t=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},en=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},tn=e=>{switch(e){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: ${e}`)}},nn=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,rn=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,an=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),on,sn=M(()=>{"use strict";tt(),on=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),cn,ln,un,dn,fn,pn,U,mn=M(()=>{"use strict";H(),cn=[`V`,`I`,`W`,`E`,`F`],ln=(e,t)=>{console.log(`[${cn[e]},${new Date().toISOString()}]${t}`)},fn=(e,t)=>{un=e,dn=t},pn=(e,t)=>{let n=tn(e),r=tn(un);n>=r&&ln(n,typeof t==`function`?t():t)},U=(...e)=>{dn&&pn(...e)}}),hn,gn,W,_n,vn,yn,bn,G=M(()=>{"use strict";hn=class{static calcMatMulShape(e,t){return e[1]===t[0]?[e[0],t[1]]:void 0}},gn=class{static calcShape(e,t,n=!1){let r=e.length,i=t.length;if(r===0)return t;if(i===0)return e;let a=Math.max(e.length,t.length),o=Array(a);if(n){if(r<2||i<2)return;let n=hn.calcMatMulShape([e[r-2],e[r-1]],[t[i-2],t[i-1]]);if(n===void 0)return;[o[a-2],o[a-1]]=n}for(let s=n?3:1;s<=a;s++){let n=r-s<0?1:e[r-s],c=i-s<0?1:t[i-s];if(n!==c&&n>1&&c>1)return;let l=Math.max(n,c);if(n&&c)o[a-s]=Math.max(n,c);else{if(l>1)return;o[a-s]=0}}return o}static isValidBroadcast(e,t){let n=e.length,r=t.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(e[n-i]!==1&&e[n-i]!==t[r-i])return!1;return!0}},W=class e{static size(t){return e.getSizeFromDimensionRange(t,0,t.length)}static convertShape(e,t=4){let n=e.length;if(n===0)return[];let r=Array(n),i=n-1;for(;i>=0;){if(e[i]%t===0){r[i]=e[i]/t;break}if(t%e[i]!==0)throw Error(`cannot convert shape`);r[i]=1,t/=e[i],i--}for(i--;i>=0;i--)r[i]=e[i];return r}static sizeFromDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,n,t.length)}static sizeToDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeToDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,0,n)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let i=t;i=0;--r)n[r]=n[r+1]*e[r+1];return n}static normalizeAxis(e,t){if(e<-t&&e>=t)throw Error(`unsupported axis for this operation.`);return e<0?e+t:e}static normalizeAxes(e,t){return e.map(n=>this.normalizeAxis(n,t??e.length))}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){let n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}},_n=class e{static adjustPoolAttributes(e,t,n,r,i,a){if(!e&&n.length!==t.length-2)throw Error(`length of specified kernel shapes should be 2 less than length of input dimensions`);if(e)for(let e=0;e=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e=n[e]||a[e+n.length]>=n[e])throw Error(`pads should be smaller than kernel`)}}static adjustPadsBasedOnAutoPad(t,n,r,i,a,o,s){if(s){if(a.length!==2*(t.length-2))throw Error(`length of pads should be twice the length of data dimensions`);if(n.length!==t.length-2)throw Error(`length of strides should be the length of data dimensions`);if(i.length!==t.length-2)throw Error(`length of kernel shapes should be the length of data dimensions`);for(let c=0;c{"use strict";H(),xn=(e,t)=>new(en(t))(e)}),Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn=M(()=>{"use strict";mn(),Cn=(e,t=!0)=>{if(e.byteLength%8!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 8 (BigInt).`);let n=e.byteLength/8,r=new BigInt64Array(e.buffer,e.byteOffset,n),i=new Int32Array(n);for(let e=0;e2147483647n||t<-2147483648n)throw Error(`Overflow occurred when converting BigInt to Int32 at index ${e}: ${t}`);i[e]=Number(t)}return t?new Uint8Array(i.buffer):i},wn=(e,t=!0)=>{if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (Int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n),i=BigInt64Array.from(r,BigInt);return t?new Uint8Array(i.buffer):i},Tn=1,En=()=>Tn++,Dn=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),On=(e,t)=>{let n=Dn.get(e);if(!n)throw Error(`Unsupported data type.`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},kn=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,shouldConvertInt64toInt32:o=!1}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.shouldConvertInt64toInt32=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return On(this.dataType,this.tensorShape)}destroy(){U(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,t){if(e){let e=await this.mlContext.readTensor(this.mlTensor),n=wn(new Uint8Array(e));if(t){(t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).set(n);return}else return n.buffer}else return t?this.mlContext.readTensor(this.mlTensor,t):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},An=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=t,a=this.tensorManager.getMLContext(e),o=i===`int64`&&!a.opSupportLimits().input.dataTypes.includes(`int64`);if(o&&(i=`int32`,U(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32`)),this.wrapper){if(this.wrapper.canReuseTensor(a,i,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==On(i,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,i,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(t=Cn(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),t.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else U(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor();this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){var t,n;if(this.activeUpload){var r;let t=(r=this.wrapper)?.isInt64ToInt32Converted?wn(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read((t=this.wrapper)?.shouldConvertInt64toInt32,e):this.wrapper.read((n=this.wrapper)?.shouldConvertInt64toInt32)}},jn=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}reserveTensorId(){let e=En();return this.tensorTrackersById.set(e,new An(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){U(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){U(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=En(),o=new kn({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new An(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o=!1){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){U(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, shape: ${n}}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}U(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, shape: ${n}}`);let c=await s.createTensor({dataType:t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new kn({sessionId:e,context:s,tensor:c,dataType:t,shape:n,shouldConvertInt64toInt32:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},Mn=(...e)=>new jn(...e)}),Pn,Fn,In,Ln=M(()=>{"use strict";H(),Lt(),Sn(),Nn(),mn(),Pn=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),Fn=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},In=class{constructor(e){this.tensorManager=Mn(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,fn(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){U(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){U(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)U(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>Fn(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){U(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=Pn.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){U(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=Pn.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!It().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);U(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return xn(n,t)}}registerMLTensor(e,t,n,r){let i=Pn.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return U(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:o?(u=Cn(new Uint8Array(l),!1),i.dataType=`int32`):u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return U(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isInt64Supported(e){var t;return!!(t=this.mlContextBySessionId.get(e))?.opSupportLimits().input.dataTypes.includes(`int64`)}flush(){}}}),Rn=M(()=>{"use strict";}),zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn=M(()=>{"use strict";mn(),Rn(),zn=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),Bn=[],Vn=e=>Math.ceil(Number(e)/16)*16,Hn=e=>{for(let t=0;tUn++,Gn=async(e,t,n,r)=>{let i=Vn(n),a=e.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let o=e.getCommandEncoder();e.endComputePass(),o.copyBufferToBuffer(t,0,a,0,i),e.flush(),await a.mapAsync(GPUMapMode.READ);let s=a.getMappedRange();if(r){let e=r();return e.set(new Uint8Array(s,0,n)),e}else return new Uint8Array(s.slice(0,n))}finally{a.destroy()}},Kn=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[e]of zn)Bn.push(e),this.freeBuffers.set(e,[]),this.freeUniformBuffers.set(e,[]);this.sessionCount=0}upload(e,t){let n=t.buffer,r=t.byteOffset,i=t.byteLength,a=Vn(i),o=this.storageCache.get(e);if(!o)throw Error(`gpu data for uploading does not exist`);if(Number(o.originalSize)!==i)throw Error(`inconsistent data size. gpu data size=${o.originalSize}, data size=${i}`);let s=this.backend.device.createBuffer({mappedAtCreation:!0,size:a,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),c=s.getMappedRange();new Uint8Array(c).set(new Uint8Array(n,r,i)),s.unmap();let l=this.backend.device.createCommandEncoder();l.copyBufferToBuffer(s,0,o.gpuData.buffer,0,a),this.backend.device.queue.submit([l.finish()]),s.destroy(),U(`verbose`,()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,t){let n=this.storageCache.get(e);if(!n)throw Error(`source gpu data for memcpy does not exist`);let r=this.storageCache.get(t);if(!r)throw Error(`destination gpu data for memcpy does not exist`);if(n.originalSize!==r.originalSize)throw Error(`inconsistent source and destination gpu data size`);let i=Vn(n.originalSize),a=this.backend.getCommandEncoder();this.backend.endComputePass(),a.copyBufferToBuffer(n.gpuData.buffer,0,r.gpuData.buffer,0,i)}registerExternalBuffer(e,t,n){let r;if(n){if(r=n[0],e===n[1])return U(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, buffer is the same, skip.`),r;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw Error(`Registering a different external buffer under graph capture mode is not supported yet. + Please use the previous external buffer!`)}else r=Wn();return this.storageCache.set(r,{gpuData:{id:r,type:0,buffer:e},originalSize:t}),U(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, registered.`),r}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),U(`verbose`,()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let n=Hn(e),r,i=(t&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,a=(t&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(i||a){let e=(i?this.freeBuffers:this.freeUniformBuffers).get(n);r=e&&e.length>0?e.pop():this.backend.device.createBuffer({size:n,usage:t})}else r=this.backend.device.createBuffer({size:n,usage:t});let o={id:Wn(),type:0,buffer:r};return this.storageCache.set(o.id,{gpuData:o,originalSize:Number(e)}),U(`verbose`,()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${o.id}`),o}get(e){var t;return(t=this.storageCache.get(e))?.gpuData}release(e){let t=typeof e==`bigint`?Number(e):e,n=this.storageCache.get(t);if(!n){if(this.storageCache.size===0)return 0;throw Error(`releasing data does not exist`)}return U(`verbose`,()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${n.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(n.gpuData.buffer),n.originalSize}async download(e,t){let n=this.storageCache.get(Number(e));if(!n)throw Error(`data does not exist`);await Gn(this.backend,n.gpuData.buffer,n.originalSize,t)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus===`default`){for(let e of this.buffersPending){let t=zn.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let n=this.freeBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let n=this.freeUniformBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let t of this.buffersPending)e.push(t);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let t=this.capturedPendingBuffers.get(e);t&&(t.forEach(e=>{e.destroy()}),this.capturedPendingBuffers.delete(e)),--this.sessionCount,this.sessionCount===0&&(U(`warning`,()=>`[WebGPU] Clearing webgpu buffer cache`),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.storageCache=new Map)}},qn=(...e)=>new Kn(...e)}),Yn,Xn,Zn=M(()=>{"use strict";Yn=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(`;`),this.key}},Xn=e=>new Yn(e)}),Qn,$n,er,tr,K,nr,rr,ir,ar,q,or,J,Y,sr,cr,lr,ur,X=M(()=>{"use strict";H(),G(),Qn=64,$n=(e,t)=>{if(t===3)throw Error(`vec3 has same alignment as vec4, use vec4 instead`);switch(Number(e)){case 10:return t>1?`vec${t}`:`f16`;case 1:return t>1?`vec${t}`:`f32`;case 6:return t>1?`vec${t}`:`i32`;case 12:return t>1?`vec${t}`:`u32`;case 7:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`i32`];case 13:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`u32`];case 9:if(t!==4)throw Error(`bool must be vec4`);return[`u32`,`vec4`];case 22:return`i32`;case 21:return`u32`;default:throw Error(`Unknown data type: ${e}`)}},er=(e,t=1)=>{let n=$n(e,t);return typeof n==`string`?n:n[0]},tr=(e,t=1)=>{let n=$n(e,t);return typeof n==`string`?n:n[1]},K=(...e)=>{let t=[];return e.forEach(e=>{e.length!==0&&t.push({type:12,data:e},{type:12,data:W.computeStrides(e)})}),t},nr=e=>e%4==0?4:e%2==0?2:1,rr=(e=`f32`,t,n=`0`)=>!t||t===1?`${e}(${n})`:`vec${t}<${e}>(${n})`,ir=(e,t,n)=>e===`f32`?n:t===1?`f32(${n})`:`vec${t}(${n})`,ar=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,q=(e,t,n,r)=>e.startsWith(`uniforms.`)&&n>4?typeof t==`string`?r===`f16`?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:r===`f16`?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:n>1?`${e}[${t}]`:e,or=(e,t,n,r,i)=>{let a=typeof n==`number`,o=a?n:n.length,s=[...Array(o).keys()],c=o<2?`u32`:o<=4?`vec${o}`:`array`,l=$n(t,i),u=typeof l==`string`?l:l[1],d=typeof l==`string`?l:l[0],f={indices:c,value:u,storage:d,tensor:t},p=e=>typeof e==`string`?e:`${e}u`,m={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},h=a?`uniforms.`:``,g=`${h}${e}_shape`,_=`${h}${e}_strides`,v=``;for(let e=0;e ${f.indices} { + var indices: ${f.indices}; + var current = offset; + ${v} + return indices; + }`,b=t=>(m.offsetToIndices=!0,o<2?t:`o2i_${e}(${t})`),x=[];if(o>=2)for(let e=o-1;e>=0;e--)x.push(`${q(_,e,o)} * (indices[${e}])`);let S=o<2?``:` + fn i2o_${e}(indices: ${f.indices}) -> u32 { + return ${x.join(`+`)}; + }`,C=t=>(m.indicesToOffset=!0,o<2?t:`i2o_${e}(${t})`),w=(...e)=>o===0?`0u`:`${f.indices}(${e.map(p).join(`,`)})`,T=(e,t)=>o<2?`${e}`:`${q(e,t,o)}`,E=(e,t,n)=>o<2?`${e}=${n};`:`${q(e,t,o)}=${n};`,D={},O=(t,n)=>{m.broadcastedIndicesToOffset=!0;let r=`${n.name}broadcastedIndicesTo${e}Offset`;if(r in D)return`${r}(${t})`;let i=[];for(let e=o-1;e>=0;e--){let t=n.indicesGet(`outputIndices`,e+n.rank-o);i.push(`${T(_,e)} * (${t} % ${T(g,e)})`)}return D[r]=`fn ${r}(outputIndices: ${n.type.indices}) -> u32 { + return ${i.length>0?i.join(`+`):`0u`}; + }`,`${r}(${t})`},k=(t,n)=>(()=>{if(f.storage===f.value)return`${e}[${t}]=${n};`;if(f.storage===`vec2`&&f.value===`i32`)return`${e}[${t}]=vec2(u32(${n}), select(0u, 0xFFFFFFFFu, ${n} < 0));`;if(f.storage===`vec2`&&f.value===`u32`)return`${e}[${t}]=vec2(u32(${n}), 0u);`;if(f.storage===`u32`&&f.value===`vec4`)return`${e}[${t}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${n}));`;throw Error(`not supported combination of storage type ${f.storage} and value type ${f.value} yet`)})(),A=t=>(()=>{if(f.storage===f.value)return`${e}[${t}]`;if(f.storage===`vec2`&&f.value===`i32`)return`i32(${e}[${t}].x)`;if(f.storage===`vec2`&&f.value===`u32`)return`u32(${e}[${t}].x)`;if(f.storage===`u32`&&f.value===`vec4`)return`vec4(bool(${e}[${t}] & 0xFFu), bool(${e}[${t}] & 0xFF00u), bool(${e}[${t}] & 0xFF0000u), bool(${e}[${t}] & 0xFF000000u))`;throw Error(`not supported combination of storage type ${f.storage} and value type ${f.value} yet`)})(),ee=o<2?``:` + fn get_${e}ByIndices(indices: ${f.indices}) -> ${u} { + return ${A(`i2o_${e}(indices)`)}; + }`,te=o<2?``:(()=>{let t=s.map(e=>`d${e}: u32`).join(`, `),n=s.map(e=>`d${e}`).join(`, `);return` + fn get_${e}(${t}) -> ${u} { + return get_${e}ByIndices(${w(n)}); + }`})(),ne=(...t)=>{if(t.length!==o)throw Error(`indices length must be ${o}`);let n=t.map(p).join(`,`);return o===0?A(`0u`):o===1?A(n[0]):(m.get=!0,m.getByIndices=!0,m.indicesToOffset=!0,`get_${e}(${n})`)},re=t=>o<2?A(t):(m.getByIndices=!0,m.indicesToOffset=!0,`get_${e}ByIndices(${t})`),j=o<2?``:` + fn set_${e}ByIndices(indices: ${f.indices}, value: ${u}) { + ${k(`i2o_${e}(indices)`,`value`)} + }`,ie=o<2?``:(()=>{let t=s.map(e=>`d${e}: u32`).join(`, `),n=s.map(e=>`d${e}`).join(`, `);return` + fn set_${e}(${t}, value: ${u}) { + set_${e}ByIndices(${w(n)}, value); + }`})();return{impl:()=>{let e=[],t=!1;return m.offsetToIndices&&(e.push(y),t=!0),m.indicesToOffset&&(e.push(S),t=!0),m.broadcastedIndicesToOffset&&(Object.values(D).forEach(t=>e.push(t)),t=!0),m.set&&(e.push(ie),t=!0),m.setByIndices&&(e.push(j),t=!0),m.get&&(e.push(te),t=!0),m.getByIndices&&(e.push(ee),t=!0),!a&&t&&e.unshift(`const ${g} = ${f.indices}(${n.join(`,`)});`,`const ${_} = ${f.indices}(${W.computeStrides(n).join(`,`)});`),e.join(` +`)},type:f,offsetToIndices:b,indicesToOffset:C,broadcastedIndicesToOffset:O,indices:w,indicesGet:T,indicesSet:E,set:(...t)=>{if(t.length!==o+1)throw Error(`indices length must be ${o}`);let n=t[o];if(typeof n!=`string`)throw Error(`value must be string`);let r=t.slice(0,o).map(p).join(`,`);return o===0?k(`0u`,n):o===1?k(r[0],n):(m.set=!0,m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}(${r}, ${n})`)},setByOffset:k,setByIndices:(t,n)=>o<2?k(t,n):(m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}ByIndices(${t}, ${n});`),get:ne,getByOffset:A,getByIndices:re,usage:r,name:e,strides:_,shape:g,rank:o}},J=(e,t,n,r=1)=>or(e,t,n,`input`,r),Y=(e,t,n,r=1)=>or(e,t,n,`output`,r),sr=(e,t,n)=>or(e,t,n,`atomicOutput`,1),cr=(e,t,n,r=1)=>or(e,t,n,`internal`,r),lr=class{constructor(e,t){this.normalizedDispatchGroup=e,this.limits=t,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e==`number`?`${e}u`:e}) { return; }`}mainStart(e=Qn){let t=typeof e==`number`?e:e[0],n=typeof e==`number`?1:e[1],r=typeof e==`number`?1:e[2];if(t>this.limits.maxComputeWorkgroupSizeX||n>this.limits.maxComputeWorkgroupSizeY||r>this.limits.maxComputeWorkgroupSizeZ)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(t*n*r>this.limits.maxComputeInvocationsPerWorkgroup)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let i=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,a=i?`@builtin(global_invocation_id) global_id : vec3, + @builtin(workgroup_id) workgroup_id : vec3, + @builtin(local_invocation_index) local_idx : u32, + @builtin(local_invocation_id) local_id : vec3`:`@builtin(global_invocation_id) global_id : vec3, + @builtin(local_invocation_id) local_id : vec3, + @builtin(local_invocation_index) local_idx : u32, + @builtin(workgroup_id) workgroup_id : vec3, + @builtin(num_workgroups) num_workgroups : vec3`,o=i?`let global_idx = global_id.x; + let workgroup_index = workgroup_id.x;`:`let workgroup_index = workgroup_id.z * num_workgroups[0] * num_workgroups[1] + + workgroup_id.y * num_workgroups[0] + workgroup_id.x; + let global_idx = workgroup_index * ${t*n*r}u + local_idx;`;return`@compute @workgroup_size(${t}, ${n}, ${r}) + fn main(${a}) { + ${o} + `}appendVariableUniforms(e){e.rank!==0&&(e.shape.startsWith(`uniforms.`)&&this.uniforms.push({name:e.shape.replace(`uniforms.`,``),type:`u32`,length:e.rank}),e.strides.startsWith(`uniforms.`)&&this.uniforms.push({name:e.strides.replace(`uniforms.`,``),type:`u32`,length:e.rank}))}declareVariable(e,t){if(e.usage===`internal`)throw Error(`cannot use internal variable with declareVariable(). use registerInternalVariables() instead.`);this.variables.push(e),this.appendVariableUniforms(e);let n=e.usage===`input`?`read`:`read_write`,r=e.usage===`atomicOutput`?`atomic`:e.type.storage;return`@group(0) @binding(${t}) var ${e.name}: array<${r}>;`}declareVariables(...e){return e.map(e=>this.declareVariable(e,this.variableIndex++)).join(` +`)}registerInternalVariable(e){if(e.usage!==`internal`)throw Error(`cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.`);this.internalVariables.push(e),this.appendVariableUniforms(e)}registerInternalVariables(...e){return e.forEach(e=>this.registerInternalVariable(e)),this}registerUniform(e,t,n=1){return this.uniforms.push({name:e,type:t,length:n}),this}registerUniforms(e){return this.uniforms=this.uniforms.concat(e),this}uniformDeclaration(){if(this.uniforms.length===0)return``;let e=[];for(let{name:t,type:n,length:r}of this.uniforms)if(r&&r>4)n===`f16`?e.push(`@align(16) ${t}:array, ${Math.ceil(r/8)}>`):e.push(`${t}:array, ${Math.ceil(r/4)}>`);else{let i=r==null||r===1?n:`vec${r}<${n}>`;e.push(`${t}:${i}`)}return` + struct Uniforms { ${e.join(`, `)} }; + @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(e=>e.impl()).join(` +`)+this.internalVariables.map(e=>e.impl()).join(` +`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=e=>[12,10,1,6][[`u32`,`f16`,`f32`,`i32`].indexOf(e)];return this.uniforms.map(t=>[e(t.type),t.length??1])}},ur=(e,t)=>new lr(e,t)}),dr,fr,pr,Z,mr,hr,gr,_r,vr,yr=M(()=>{"use strict";H(),G(),Zn(),X(),dr=(e,t)=>{if(!e||e.length!==1)throw Error(`Transpose requires 1 input.`);if(t.length!==0&&t.length!==e[0].dims.length)throw Error(`perm size ${t.length} does not match input rank ${e[0].dims.length}`)},fr=(e,t)=>t.length===0?[...Array(e).keys()].reverse():t,pr=(e,t)=>W.sortBasedOnPerm(e,fr(e.length,t)),Z=(e,t,n,r)=>{let i=`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + var a: ${n.type.indices};`;for(let n=0;n{let n=[],r=[];for(let i=0;i{let n=0;for(let r=0;r{let n=e.dataType,r=e.dims.length,i=fr(r,t),a=pr(e.dims,i),o=e.dims,s=a,c=r<2||hr(i,e.dims),l;if(c)return l=e=>{let t=J(`input`,n,o,4),r=Y(`output`,n,s,4);return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(t,r)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + output[global_idx] = input[global_idx]; + }`},{name:`TransposeCopy`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let t=W.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64/4)},programUniforms:[{type:12,data:Math.ceil(t/4)}]}},getShaderSource:l};let{newShape:u,newPerm:d}=mr(e.dims,i),f=W.areEqual(d,[2,3,1]),p=W.areEqual(d,[3,1,2]);if(u.length===2||f||p){o=f?[u[0],u[1]*u[2]]:p?[u[0]*u[1],u[2]]:u,s=[o[1],o[0]];let t=16;return l=e=>{let r=J(`a`,n,o.length),i=Y(`output`,n,s.length);return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(r,i)} + var tile : array, ${t}>; + ${e.mainStart([t,t,1])} + let stride = (uniforms.output_shape[1] - 1) / ${t} + 1; + let workgroup_id_x = workgroup_index % stride; + let workgroup_id_y = workgroup_index / stride; + let input_col = workgroup_id_y * ${t}u + local_id.x; + let input_row = workgroup_id_x * ${t}u + local_id.y; + if (input_row < uniforms.a_shape[0] && input_col < uniforms.a_shape[1]) { + tile[local_id.y][local_id.x] = ${r.getByIndices(`${r.type.indices}(input_row, input_col)`)}; + } + workgroupBarrier(); + + let output_col = workgroup_id_x * ${t}u + local_id.x; + let output_row = workgroup_id_y * ${t}u + local_id.y; + if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) { + ${i.setByIndices(`${i.type.indices}(output_row, output_col)`,`tile[local_id.x][local_id.y]`)} + } + }`},{name:`TransposeShared`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let n=W.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(s[1]/t),y:Math.ceil(s[0]/t)},programUniforms:[{type:12,data:n},...K(o,s)]}},getShaderSource:l}}return l=e=>{let t=J(`a`,n,o.length),a=Y(`output`,n,s.length);return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(t,a)} + + ${Z(i,r,t,a)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let indices = ${a.offsetToIndices(`global_idx`)}; + let aIndices = perm(indices); + + ${a.setByOffset(`global_idx`,t.getByIndices(`aIndices`))} + }`},{name:`Transpose`,shaderCache:{hint:`${t}`,inputDependencies:[`rank`]},getRunData:()=>{let t=W.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:[{type:12,data:t},...K(o,s)]}},getShaderSource:l}},_r=(e,t)=>{dr(e.inputs,t.perm),e.compute(gr(e.inputs[0],t.perm))},vr=e=>Xn({perm:e.perm})}),br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr=M(()=>{"use strict";H(),G(),X(),mi(),yr(),br={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate * candidate`,logSumExp:`bestValue + exp(candidate)`,l1:`bestValue + abs(candidate)`,l2:`bestValue + candidate * candidate`,logSum:`bestValue + candidate`},xr={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate`,logSumExp:`bestValue + candidate`,l1:`bestValue + candidate`,l2:`bestValue + candidate`,logSum:`bestValue + candidate`},Sr={max:`_A[offset]`,min:`_A[offset]`,mean:`0`,sum:`0`,prod:`1`,sumSquare:`0`,logSumExp:`0`,l1:`0`,l2:`0`,logSum:`0`},Cr={max:`bestValue`,min:`bestValue`,sum:`bestValue`,prod:`bestValue`,sumSquare:`bestValue`,logSumExp:`log(bestValue)`,l1:`bestValue`,l2:`sqrt(bestValue)`,logSum:`log(bestValue)`},wr=(e,t)=>{let n=[];for(let r=t-e;r{let n=[],r=e.length;for(let i=0;ie[t]);return[n,i]},Er=(e,t)=>{let n=e.length+t.length,r=[],i=0;for(let a=0;a{for(let n=0;n{let n=[];if(!Dr(e,t)){for(let r=0;rn.push(e))}return n},kr=(e,t,n,r,i,a,o)=>{let s=n[0].dims,c=W.size(a),l=W.size(o),u=J(`_A`,n[0].dataType,s),d=Y(`output`,i,a),f=64;c===1&&(f=256);let p=` + var aBestValues : array; + `,m=e=>` + ${e.registerUniform(`reduceSize`,`u32`).declareVariables(u,d)} + ${p} + fn DIV_CEIL(a : u32, b : u32) -> u32 { + return ((a - 1u) / b + 1u); + } + ${e.mainStart(f)} + + let outputIndex = global_idx / ${f}; + let offset = outputIndex * uniforms.reduceSize; + + var bestValue = f32(${Sr[r]}); + let Length = uniforms.reduceSize; + for (var k = local_idx; k < Length; k = k + ${f}) { + let candidate = f32(${u.getByOffset(`offset + k`)}); + bestValue = ${br[r]}; + } + aBestValues[local_idx] = bestValue; + workgroupBarrier(); + + var reduceSize = min(Length, ${f}u); + for (var currentSize = reduceSize / 2u; reduceSize > 1u; + currentSize = reduceSize / 2u) { + let interval = DIV_CEIL(reduceSize, 2u); + if (local_idx < currentSize) { + let candidate = aBestValues[local_idx + interval]; + bestValue = ${xr[r]}; + aBestValues[local_idx] = bestValue; + } + reduceSize = interval; + workgroupBarrier(); + } + + if (local_idx == 0u) { + ${d.setByOffset(`outputIndex`,`${r===`mean`?`${d.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${d.type.storage}(${Cr[r]})`}`)}; + } + }`;return{name:e,shaderCache:{hint:`${t};${f}`,inputDependencies:[`type`]},getShaderSource:m,getRunData:()=>({outputs:[{dims:a,dataType:i}],dispatchGroup:{x:c},programUniforms:[{type:12,data:l}]})}},Ar=(e,t,n,r)=>{let i=e.inputs.length===1?n:Gr(e.inputs,n),a=i.axes;a.length===0&&!i.noopWithEmptyAxes&&(a=e.inputs[0].dims.map((e,t)=>t));let o=W.normalizeAxes(a,e.inputs[0].dims.length),s=o,c=e.inputs[0],l=Or(s,e.inputs[0].dims.length);l.length>0&&(c=e.compute(gr(e.inputs[0],l),{inputs:[0],outputs:[-1]})[0],s=wr(s.length,c.dims.length));let[u,d]=Tr(c.dims,s),f=u;i.keepDims&&(f=Er(u,o)),e.compute(kr(t,i.cacheKey,[c],r,e.inputs[0].dataType,f,d),{inputs:[c]})},jr=(e,t)=>{Ar(e,`ReduceMeanShared`,t,`mean`)},Mr=(e,t)=>{Ar(e,`ReduceL1Shared`,t,`l1`)},Nr=(e,t)=>{Ar(e,`ReduceL2Shared`,t,`l2`)},Pr=(e,t)=>{Ar(e,`ReduceLogSumExpShared`,t,`logSumExp`)},Fr=(e,t)=>{Ar(e,`ReduceMaxShared`,t,`max`)},Ir=(e,t)=>{Ar(e,`ReduceMinShared`,t,`min`)},Lr=(e,t)=>{Ar(e,`ReduceProdShared`,t,`prod`)},Rr=(e,t)=>{Ar(e,`ReduceSumShared`,t,`sum`)},zr=(e,t)=>{Ar(e,`ReduceSumSquareShared`,t,`sumSquare`)},Br=(e,t)=>{Ar(e,`ReduceLogSumShared`,t,`logSum`)}}),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=M(()=>{"use strict";H(),G(),Zn(),X(),Vr(),Hr=e=>{if(!e||e.length===0||e.length>2)throw Error(`Reduce op requires 1 or 2 inputs.`);if(e.length===2&&e[1].dims.length!==1)throw Error(`Invalid axes input dims.`)},Ur=e=>[``,``,`var value = ${e.getByIndices(`input_indices`)};`,``],Wr=(e,t,n,r,i,a,o=!1,s=!1)=>{let c=[],l=n[0].dims,u=l.length,d=W.normalizeAxes(i,u),f=!s&&d.length===0;l.forEach((e,t)=>{f||d.indexOf(t)>=0?o&&c.push(1):c.push(e)});let p=c.length,m=W.size(c);return{name:e,shaderCache:t,getShaderSource:e=>{let t=[],i=J(`_A`,n[0].dataType,u),s=Y(`output`,a,p),c=r(i,s,d),m=c[2];for(let e=0,n=0;e=0?(o&&n++,m=`for(var j${e}: u32 = 0; j${e} < ${l[e]}; j${e}++) { + ${c[2].includes(`last_index`)?`let last_index = j${e};`:``} + ${i.indicesSet(`input_indices`,e,`j${e}`)} + ${m} + }`):(t.push(`${i.indicesSet(`input_indices`,e,s.indicesGet(`output_indices`,n))};`),n++);return` + + ${e.registerUniform(`output_size`,`u32`).declareVariables(i,s)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + var input_indices: ${i.type.indices}; + let output_indices = ${s.offsetToIndices(`global_idx`)}; + + ${t.join(` +`)} + ${c[0]} // init ops for reduce max/min + ${c[1]} + ${m} + ${c[3]} + ${c.length===4?s.setByOffset(`global_idx`,`value`):c.slice(4).join(` +`)} + }`},getRunData:()=>({outputs:[{dims:c,dataType:a}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...K(l,c)]})}},Gr=(e,t)=>{let n=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),Xn({axes:n,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},Kr=(e,t,n,r)=>{let i=e.inputs,a=i.length===1?n:Gr(i,n);e.compute(Wr(t,{hint:a.cacheKey,inputDependencies:[`rank`]},[i[0]],a.noopWithEmptyAxes&&a.axes.length===0?Ur:r,a.axes,i[0].dataType,a.keepDims,a.noopWithEmptyAxes),{inputs:[0]})},qr=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceLogSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,`value = log(value);`])},Jr=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceL1`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += abs(${e.getByIndices(`input_indices`)});`,``])},Yr=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceL2`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += (t * t);`,`value = sqrt(value);`])},Xr=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceLogSumExp`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += exp(${e.getByIndices(`input_indices`)});`,`value = log(value);`])},Zr=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceMax`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(e.indicesSet(`input_indices`,t,0));return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = max(value, ${e.getByIndices(`input_indices`)});`,``]})},Qr=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceMean`,t,(t,n,r)=>{let i=1;for(let n=0;n=0||r.length===0)&&(i*=e.inputs[0].dims[n]);return[`var sum = f32(0);`,``,`sum += f32(${t.getByIndices(`input_indices`)});`,`let value = ${n.type.value}(sum / ${i});`]})},$r=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceMin`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(`input_indices[${t}] = 0;`);return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = min(value, ${e.getByIndices(`input_indices`)});`,``]})},ei=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceProd`,t,(e,t)=>[`var value = ${t.type.storage}(1);`,``,`value *= ${e.getByIndices(`input_indices`)};`,``])},ti=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,``])},ni=(e,t)=>{Hr(e.inputs),Kr(e,`ReduceSumSquare`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += t * t;`,``])},ri=(e,t,n)=>{if(t.length===0)return n;let r=1,i=1;for(let n=0;n1024},ii=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Qr(e,t):jr(e,t)},ai=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Jr(e,t):Mr(e,t)},oi=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Yr(e,t):Nr(e,t)},si=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Xr(e,t):Pr(e,t)},ci=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Zr(e,t):Fr(e,t)},li=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?$r(e,t):Ir(e,t)},ui=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ei(e,t):Lr(e,t)},di=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ti(e,t):Rr(e,t)},fi=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?ni(e,t):zr(e,t)},pi=(e,t)=>{ri(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?qr(e,t):Br(e,t)}}),hi,gi,_i,vi,yi=M(()=>{"use strict";H(),Zn(),mi(),hi=e=>{if(!e||e.length===0||e.length>2)throw Error(`ArgMinMaxOp op requires 1 or 2 inputs.`);if(e[0].dataType!==1)throw Error(`Invalid input type.`)},gi=(e,t)=>{hi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)}; +var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`<=`:`<`} value) { + value = ${e.getByIndices(`input_indices`)}; + best_index = i32(last_index); + }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Wr(`ArgMin`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},_i=(e,t)=>{hi(e.inputs);let n=(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)}; +var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`>=`:`>`} value) { + value = ${e.getByIndices(`input_indices`)}; + best_index = i32(last_index); + }`,``,n.setByOffset(`global_idx`,`best_index`)]};e.compute(Wr(`argMax`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],n,[t.axis],7,t.keepDims),{inputs:[0]})},vi=e=>Xn(e)}),bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi=M(()=>{"use strict";H(),G(),Rn(),X(),bi=(e,t)=>{let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5];if(o&&s)throw Error(`Attention cannot have both past and attention_bias`);if(n.dims.length!==3)throw Error(`Input "input" must have 3 dimensions`);let c=n.dims[0],l=n.dims[1],u=n.dims[2];if(i.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimensions`);if(r.dims.length!==2)throw Error(`Input "weights" is expected to have 2 dimensions`);if(r.dims[0]!==u)throw Error(`Input 1 dimension 0 should have same length as dimension 2 of input 0`);if(i.dims[0]!==r.dims[1])throw Error(`Input "bias" dimension 0 should have same length as dimension 1 of input "weights"`);let d=i.dims[0]/3,f=d,p=f;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw Error(`qkv_hidden_sizes attribute should have 3 elements`);for(let e of t.qkvHiddenSizes)if(e%t.numHeads!==0)throw Error(`qkv_hidden_sizes should be divisible by num_heads`);d=t.qkvHiddenSizes[0],f=t.qkvHiddenSizes[1],p=t.qkvHiddenSizes[2]}let m=l;if(d!==f)throw Error(`qkv_hidden_sizes first element should be same as the second`);if(i.dims[0]!==d+f+p)throw Error(`Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes`);let h=0;if(o){if(f!==p)throw Error(`Input "past" expect k_hidden_size == v_hidden_size`);if(o.dims.length!==5)throw Error(`Input "past" must have 5 dimensions`);if(o.dims[0]!==2)throw Error(`Input "past" first dimension must be 2`);if(o.dims[1]!==c)throw Error(`Input "past" second dimension must be batch_size`);if(o.dims[2]!==t.numHeads)throw Error(`Input "past" third dimension must be num_heads`);if(o.dims[4]!==f/t.numHeads)throw Error(`Input "past" fifth dimension must be k_hidden_size / num_heads`);t.pastPresentShareBuffer||(h=o.dims[3])}let g=m+h,_=-1,v=0;if(a)throw Error(`Mask not supported`);if(o)throw Error(`past is not supported`);if(s){if(s.dims.length!==4)throw Error(`Input "attention_bias" must have 4 dimensions`);if(s.dims[0]!==c||s.dims[1]!==t.numHeads||s.dims[2]!==l||s.dims[3]!==g)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:c,sequenceLength:l,pastSequenceLength:h,kvSequenceLength:m,totalSequenceLength:g,maxSequenceLength:_,inputHiddenSize:u,hiddenSize:d,vHiddenSize:p,headSize:Math.floor(d/t.numHeads),vHeadSize:Math.floor(p/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},xi=(e,t,n)=>t&&e?` + let total_sequence_length_input = u32(${t.getByOffset(`0`)}); + let present_sequence_length = max(total_sequence_length_input, uniforms.past_sequence_length); + let is_subsequent_prompt: bool = sequence_length > 1 && sequence_length != total_sequence_length_input; + let is_first_prompt: bool = is_subsequent_prompt == false && sequence_length == total_sequence_length_input; + total_sequence_length = u32(${e?.getByOffset(`batchIdx`)}) + 1; + var past_sequence_length: u32 = 0; + if (is_first_prompt == false) { + past_sequence_length = total_sequence_length - sequence_length; + } + `:` + ${n?`let past_sequence_length = uniforms.past_sequence_length`:``}; + let present_sequence_length = total_sequence_length; + `,Si=(e,t,n,r,i,a,o,s)=>{let c=nr(o?1:a),l=64,u=a/c;u{let n=Y(`x`,e.dataType,e.dims,c),r=[n],i=o?J(`seq_lens`,o.dataType,o.dims):void 0;i&&r.push(i);let a=s?J(`total_sequence_length_input`,s.dataType,s.dims):void 0;a&&r.push(a);let u=tr(e.dataType),d=[{name:`batch_size`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`total_sequence_length`,type:`u32`},{name:`elements_per_thread`,type:`u32`}];return` + var thread_max: array; + var thread_sum: array; + ${t.registerUniforms(d).declareVariables(...r)} + ${t.mainStart([l,1,1])} + let batchIdx = workgroup_id.z / uniforms.num_heads; + let headIdx = workgroup_id.z % uniforms.num_heads; + let sequence_length = uniforms.sequence_length; + var total_sequence_length = uniforms.total_sequence_length; + ${xi(i,a,!1)} + let local_offset = local_idx * uniforms.elements_per_thread; + let offset = (global_idx / ${l}) * uniforms.total_sequence_length + local_offset; + let seq_causal_length = ${o?`u32(past_sequence_length + workgroup_id.y + 1)`:`total_sequence_length`}; + var thread_max_vector = ${m}(-3.402823e+38f); + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + thread_max_vector = max(${m}(x[offset + i]), thread_max_vector); + } + thread_max[local_idx] = ${(()=>{switch(c){case 1:return`thread_max_vector`;case 2:return`max(thread_max_vector.x, thread_max_vector.y)`;case 4:return`max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))`;default:throw Error(`Unsupported components: ${c}`)}})()}; + workgroupBarrier(); + + var max_value = f32(-3.402823e+38f); + for (var i = 0u; i < ${l}; i++) { + max_value = max(thread_max[i], max_value); + } + + var sum_vector = ${m}(0); + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + sum_vector += exp(${m}(x[offset + i]) - max_value); + } + thread_sum[local_idx] = ${(()=>{switch(c){case 1:return`sum_vector`;case 2:return`sum_vector.x + sum_vector.y`;case 4:return`sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w`;default:throw Error(`Unsupported components: ${c}`)}})()}; + workgroupBarrier(); + + var sum: f32 = 0; + for (var i = 0u; i < ${l}; i++) { + sum += thread_sum[i]; + } + + if (sum == 0) { + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + x[offset + i] = ${n.type.value}(${u}(1.0) / ${u}(seq_causal_length)); + } + } else { + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + var f32input = ${m}(x[offset + i]); + x[offset + i] = ${n.type.value}(exp(f32input - max_value) / sum); + } + } + ${o?` + for (var total_seq_id: u32 = seq_causal_length; total_seq_id + local_offset < uniforms.total_sequence_length; total_seq_id++) { + x[offset + total_seq_id] = ${n.type.value}(${u}(0)); + }`:``}; + }`};return{name:`AttentionProbsSoftmax`,shaderCache:{hint:`${l};${p};${c}`,inputDependencies:h},getShaderSource:g,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:i,z:t*n},programUniforms:f})}},Ci=(e,t,n,r,i,a,o,s,c)=>{let l=o+a.kvSequenceLength,u=[a.batchSize,a.numHeads,a.sequenceLength,l],d=e>1&&r,f=a.kvNumHeads?a.kvNumHeads:a.numHeads,p=d?[a.batchSize,f,l,a.headSize]:void 0,m=a.nReps?a.nReps:1,h=a.scale===0?1/Math.sqrt(a.headSize):a.scale,g=nr(a.headSize),_=a.headSize/g,v=12,y={x:Math.ceil(l/v),y:Math.ceil(a.sequenceLength/v),z:a.batchSize*a.numHeads},b=[{type:12,data:a.sequenceLength},{type:12,data:_},{type:12,data:l},{type:12,data:a.numHeads},{type:12,data:a.headSize},{type:1,data:h},{type:12,data:o},{type:12,data:a.kvSequenceLength},{type:12,data:m}],x=d&&r&&W.size(r.dims)>0,S=[`type`,`type`];x&&S.push(`type`),i&&S.push(`type`),s&&S.push(`type`),c&&S.push(`type`);let C=[{dims:u,dataType:t.dataType,gpuDataType:0}];d&&C.push({dims:p,dataType:t.dataType,gpuDataType:0});let w=e=>{let a=J(`q`,t.dataType,t.dims,g),o=J(`key`,n.dataType,n.dims,g),l=[a,o];if(x){let e=J(`past_key`,r.dataType,r.dims,g);l.push(e)}i&&l.push(J(`attention_bias`,i.dataType,i.dims));let f=s?J(`seq_lens`,s.dataType,s.dims):void 0;f&&l.push(f);let h=c?J(`total_sequence_length_input`,c.dataType,c.dims):void 0;h&&l.push(h);let _=Y(`output`,t.dataType,u),y=[_];d&&y.push(Y(`present_key`,t.dataType,p,g));let b=tr(1,g),S=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`alpha`,type:`f32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` + const TILE_SIZE = ${v}u; + + var tileQ: array<${a.type.storage}, ${v*v}>; + var tileK: array<${a.type.storage}, ${v*v}>; + ${e.registerUniforms(S).declareVariables(...l,...y)} + ${e.mainStart([v,v,1])} + // x holds the N and y holds the M + let headIdx = workgroup_id.z % uniforms.num_heads; + let kvHeadIdx = ${m===1?`headIdx`:`headIdx / uniforms.n_reps`}; + let kv_num_heads = ${m===1?`uniforms.num_heads`:`uniforms.num_heads / uniforms.n_reps`}; + let batchIdx = workgroup_id.z / uniforms.num_heads; + let m = workgroup_id.y * TILE_SIZE; + let n = workgroup_id.x * TILE_SIZE; + let sequence_length = uniforms.M; + var total_sequence_length = uniforms.N; + ${xi(f,h,!0)} + let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; + let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; + ${x&&d?`let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;`:``}; + let kOffset = absKvHeadIdx * uniforms.kv_sequence_length * uniforms.K; + ${d?`let presentKeyOffset = absKvHeadIdx * uniforms.N * uniforms.K;`:``} + var value = ${b}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) { + tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x]; + } + if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) { + var idx = TILE_SIZE * local_id.y + local_id.x; + ${x&&d?` + if (n + local_id.y < past_sequence_length) { + tileK[idx] = past_key[pastKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; + } else if (n + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { + tileK[idx] = key[kOffset + (n + local_id.y - past_sequence_length) * uniforms.K + w + local_id.x]; + }`:` + if (n + local_id.y < uniforms.kv_sequence_length) { + tileK[idx] = key[kOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; + }`} + ${d?`if (n + local_id.y < present_sequence_length) { + present_key[presentKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x] = tileK[idx]; + }`:``} + } + workgroupBarrier(); + + for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) { + value += ${b}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]); + } + + workgroupBarrier(); + } + + if (global_id.y < uniforms.M && global_id.x < total_sequence_length) { + let headOffset = workgroup_id.z * uniforms.M * uniforms.N; + let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x; + var sum: f32 = ${(()=>{switch(g){case 1:return`value`;case 2:return`value.x + value.y`;case 4:return`value.x + value.y + value.z + value.w`;default:throw Error(`Unsupported components: ${g}`)}})()}; + output[outputIdx] = ${_.type.value} (sum * uniforms.alpha) + ${i?`attention_bias[outputIdx]`:`0.0`}; + } + }`};return{name:`AttentionProbs`,shaderCache:{hint:`${g};${i!==void 0};${r!==void 0};${e}`,inputDependencies:S},getRunData:()=>({outputs:C,dispatchGroup:y,programUniforms:b}),getShaderSource:w}},wi=(e,t,n,r,i,a,o=void 0,s=void 0)=>{let c=a+i.kvSequenceLength,l=i.nReps?i.nReps:1,u=i.vHiddenSize*l,d=e>1&&r,f=i.kvNumHeads?i.kvNumHeads:i.numHeads,p=d?[i.batchSize,f,c,i.headSize]:void 0,m=[i.batchSize,i.sequenceLength,u],h=12,g={x:Math.ceil(i.vHeadSize/h),y:Math.ceil(i.sequenceLength/h),z:i.batchSize*i.numHeads},_=[{type:12,data:i.sequenceLength},{type:12,data:c},{type:12,data:i.vHeadSize},{type:12,data:i.numHeads},{type:12,data:i.headSize},{type:12,data:u},{type:12,data:a},{type:12,data:i.kvSequenceLength},{type:12,data:l}],v=d&&r&&W.size(r.dims)>0,y=[`type`,`type`];v&&y.push(`type`),o&&y.push(`type`),s&&y.push(`type`);let b=[{dims:m,dataType:t.dataType,gpuDataType:0}];d&&b.push({dims:p,dataType:t.dataType,gpuDataType:0});let x=e=>{let i=J(`probs`,t.dataType,t.dims),a=J(`v`,n.dataType,n.dims),c=[i,a];v&&c.push(J(`past_value`,r.dataType,r.dims));let u=o?J(`seq_lens`,o.dataType,o.dims):void 0;o&&c.push(u);let f=s?J(`total_sequence_length_input`,s.dataType,s.dims):void 0;s&&c.push(f);let g=[Y(`output`,t.dataType,m)];d&&g.push(Y(`present_value`,t.dataType,p));let _=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`v_hidden_size`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}];return` + const TILE_SIZE = ${h}u; + var tileQ: array<${i.type.value}, ${h*h}>; + var tileV: array<${i.type.value}, ${h*h}>; + ${e.registerUniforms(_).declareVariables(...c,...g)} + ${e.mainStart([h,h,1])} + let headIdx = workgroup_id.z % uniforms.num_heads; + let batchIdx = workgroup_id.z / uniforms.num_heads; + let kvHeadIdx = ${l===1?`headIdx`:`headIdx / uniforms.n_reps`}; + let kv_num_heads = ${l===1?`uniforms.num_heads`:`uniforms.num_heads / uniforms.n_reps`}; + let m = global_id.y; + let n = global_id.x; + let sequence_length = uniforms.M; + var total_sequence_length = uniforms.K; + ${xi(u,f,!0)} + let offsetA = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; + let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; // kvHeadIdx is relative to the batch + ${v&&d?`let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;`:``}; + let vOffset = absKvHeadIdx * uniforms.N * uniforms.kv_sequence_length + n; + ${d?`let presentValueOffset = absKvHeadIdx * uniforms.N * uniforms.K + n;`:``} + var value = ${i.type.storage}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (m < uniforms.M && w + local_id.x < uniforms.K) { + tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x]; + } + if (n < uniforms.N && w + local_id.y < uniforms.K) { + var idx = TILE_SIZE * local_id.y + local_id.x; + ${v&&d?` + if (w + local_id.y < past_sequence_length) { + tileV[idx] = past_value[pastValueOffset + (w + local_id.y) * uniforms.N]; + } else if (w + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { + tileV[idx] = v[vOffset + (w + local_id.y - past_sequence_length) * uniforms.N]; + } + `:` + if (w + local_id.y < uniforms.kv_sequence_length) { + tileV[idx] = v[vOffset + (w + local_id.y) * uniforms.N]; + }`} + ${d?` + if (w + local_id.y < present_sequence_length) { + present_value[presentValueOffset + (w + local_id.y) * uniforms.N] = tileV[idx]; + }`:``} + } + workgroupBarrier(); + for (var k: u32 = 0u; k < TILE_SIZE && w+k < total_sequence_length; k++) { + value += tileQ[TILE_SIZE * local_id.y + k] * tileV[TILE_SIZE * k + local_id.x]; + } + workgroupBarrier(); + } + + // we need to transpose output from BNSH_v to BSND_v + if (m < uniforms.M && n < uniforms.N) { + let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size + + headIdx * uniforms.N + n; + output[outputIdx] = value; + } + }`};return{name:`AttentionScore`,shaderCache:{hint:`${r!==void 0};${e}`,inputDependencies:y},getRunData:()=>({outputs:b,dispatchGroup:g,programUniforms:_}),getShaderSource:x}},Ti=(e,t,n,r,i,a,o,s,c,l,u=void 0,d=void 0)=>{let f=Math.min(e.outputCount,1+(o?1:0)+(s?1:0)),p=f>1?l.pastSequenceLength:0,m=p+l.kvSequenceLength,h=c&&W.size(c.dims)>0?c:void 0,g=[t,n];f>1&&o&&W.size(o.dims)>0&&g.push(o),h&&g.push(h),u&&g.push(u),d&&g.push(d);let _=e.compute(Ci(f,t,n,o,h,l,p,u,d),{inputs:g,outputs:f>1?[-1,1]:[-1]})[0];e.compute(Si(_,l.batchSize,l.numHeads,p,l.sequenceLength,m,u,d),{inputs:u&&d?[_,u,d]:[_],outputs:[]});let v=[_,r];f>1&&s&&W.size(s.dims)>0&&v.push(s),u&&v.push(u),d&&v.push(d),e.compute(wi(f,_,r,s,l,p,u,d),{inputs:v,outputs:f>1?[0,2]:[0]})},Ei=(e,t)=>{let n=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],r=t.sequenceLength,i=t.inputHiddenSize,a=t.headSize,o=12,s={x:Math.ceil(t.headSize/o),y:Math.ceil(t.sequenceLength/o),z:t.batchSize*t.numHeads},c=[e.inputs[0],e.inputs[1],e.inputs[2]],l=[{type:12,data:r},{type:12,data:i},{type:12,data:a},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}],u=e=>{let t=Y(`output_q`,c[0].dataType,n),r=Y(`output_k`,c[0].dataType,n),i=Y(`output_v`,c[0].dataType,n),a=J(`input`,c[0].dataType,c[0].dims),s=J(`weight`,c[1].dataType,c[1].dims),l=J(`bias`,c[2].dataType,c[2].dims),u=a.type.storage,d=[{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`ldb`,type:`u32`}];return` + const TILE_SIZE = ${o}u; + var tileInput: array<${u}, ${o*o}>; + var tileWeightQ: array<${u}, ${o*o}>; + var tileWeightK: array<${u}, ${o*o}>; + var tileWeightV: array<${u}, ${o*o}>; + ${e.registerUniforms(d).declareVariables(a,s,l,t,r,i)} + ${e.mainStart([o,o,1])} + let batchIndex = workgroup_id.z / uniforms.num_heads; + let headNumber = workgroup_id.z % uniforms.num_heads; + let m = global_id.y; + let n = global_id.x; + + let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K; + let biasOffsetQ = headNumber * uniforms.head_size; + let biasOffsetK = uniforms.hidden_size + biasOffsetQ; + let biasOffsetV = uniforms.hidden_size + biasOffsetK; + + var valueQ = ${u}(0); + var valueK = ${u}(0); + var valueV = ${u}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (m < uniforms.M && w + local_id.x < uniforms.K) { + tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x]; + } + if (n < uniforms.N && w + local_id.y < uniforms.K) { + let offset = n + (w + local_id.y) * uniforms.ldb; + tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset]; + tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset]; + tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset]; + } + workgroupBarrier(); + for (var k: u32 = 0u; k({outputs:[{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:s,programUniforms:l}),getShaderSource:u},{inputs:c,outputs:[-1,-1,-1]})},Di=(e,t)=>{let n=bi(e.inputs,t),[r,i,a]=Ei(e,n);return Ti(e,r,i,a,e.inputs[4],void 0,void 0,void 0,e.inputs[5],n)}}),ki,Ai,ji,Mi,Ni=M(()=>{"use strict";et(),H(),G(),Zn(),X(),ki=(e,t)=>{if(!e||e.length!==5)throw Error(`BatchNormalization requires 5 inputs`);let n=(e,t,n)=>{let r=t.length;if(r!==e.length)throw Error(`${n}: num dimensions != ${r}`);t.forEach((t,r)=>{if(t!==e[r])throw Error(`${n}: dim[${r}] do not match`)})};if(e[0].dims.length>1){let r=t.format===`NHWC`?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);n(e[1].dims,r,`Invalid input scale`),n(e[2].dims,r,`Invalid input B`),n(e[3].dims,r,`Invalid input mean`),n(e[4].dims,r,`Invalid input var`)}else n(e[1].dims,[1],`Invalid input scale`),n(e[2].dims,[1],`Invalid input B`),n(e[3].dims,[1],`Invalid input mean`),n(e[4].dims,[1],`Invalid input var`)},Ai=(e,t)=>{let{epsilon:n,spatial:r,format:i}=t,a=e[0].dims,o=r?nr(a[a.length-1]):1,s=i===`NHWC`&&a.length>1?o:1,c=W.size(a)/o,l=r,u=l?a.length:a,d=J(`x`,e[0].dataType,e[0].dims,o),f=J(`scale`,e[1].dataType,e[1].dims,s),p=J(`bias`,e[2].dataType,e[2].dims,s),m=J(`inputMean`,e[3].dataType,e[3].dims,s),h=J(`inputVar`,e[4].dataType,e[4].dims,s),g=Y(`y`,e[0].dataType,u,o),_=()=>{let e=``;if(r)e=`let cOffset = ${a.length===1?`0u`:i===`NHWC`?`outputIndices[${a.length-1}] / ${o}`:`outputIndices[1]`};`;else if(i===`NCHW`)e=` + ${g.indicesSet(`outputIndices`,`0`,`0`)} + let cOffset = ${g.indicesToOffset(`outputIndices`)};`;else{e=`var cIndices = ${f.type.indices}(0); + cIndices[0] = outputIndices[${a.length-1}];`;for(let t=1;t` + const epsilon = ${n}; + ${e.registerUniform(`outputSize`,`u32`).declareVariables(d,f,p,m,h,g)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + var outputIndices = ${g.offsetToIndices(`global_idx * ${o}`)}; + ${_()} + let scale = ${f.getByOffset(`cOffset`)}; + let bias = ${p.getByOffset(`cOffset`)}; + let inputMean = ${m.getByOffset(`cOffset`)}; + let inputVar = ${h.getByOffset(`cOffset`)}; + let x = ${d.getByOffset(`global_idx`)}; + let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias; + ${g.setByOffset(`global_idx`,`value`)} + }`;return{name:`BatchNormalization`,shaderCache:{hint:`${t.epsilon}_${t.format}_${r}_${o}`,inputDependencies:l?[`rank`,`type`,`type`,`type`,`type`]:void 0},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l?[{type:12,data:c},...K(a)]:[{type:12,data:c}]})}},ji=e=>Xn(e),Mi=(e,t)=>{let{inputs:n,outputCount:r}=e,i=ji({...t,outputCount:r});if(ye.webgpu.validateInputContent&&ki(n,i),t.trainingMode)throw Error(`BatchNormalization trainingMode is not supported yet.`);e.compute(Ai(n,i))}}),Pi,Fi,Ii,Li=M(()=>{"use strict";G(),X(),Pi=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![320,640,1280].includes(e[0].dims[2]))throw Error(`number of channels should be 320, 640 or 1280`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},Fi=e=>{let t=e[0].dims,n=e[0].dims[2],r=W.size(t)/4,i=e[0].dataType,a=J(`input`,i,t,4),o=J(`bias`,i,[n],4),s=J(`residual`,i,t,4),c=Y(`output`,i,t,4);return{name:`BiasAdd`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(r/64)}}),getShaderSource:e=>` + const channels = ${n}u / 4; + ${e.declareVariables(a,o,s,c)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(r)} + let value = ${a.getByOffset(`global_idx`)} + + ${o.getByOffset(`global_idx % channels`)} + ${s.getByOffset(`global_idx`)}; + ${c.setByOffset(`global_idx`,`value`)} + }`}},Ii=e=>{Pi(e.inputs),e.compute(Fi(e.inputs))}}),Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka=M(()=>{"use strict";H(),G(),Zn(),X(),Ri=(e,t,n,r,i,a,o)=>{let s=Math.ceil(t/4),c=``;c=typeof i==`string`?`${i}(a)`:i(`a`);let l=J(`inputData`,n,[s],4),u=Y(`outputData`,r,[s],4),d=[{name:`vec_size`,type:`u32`}];return o&&d.push(...o),` + ${e.registerUniforms(d).declareVariables(l,u)} + + ${a??``} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + + let a = ${l.getByOffset(`global_idx`)}; + ${u.setByOffset(`global_idx`,c)} + }`},zi=(e,t,n,r,i,a=e.dataType,o,s)=>{let c=[{type:12,data:Math.ceil(W.size(e.dims)/4)}];return o&&c.push(...o),{name:t,shaderCache:{hint:i,inputDependencies:[`type`]},getShaderSource:t=>Ri(t,W.size(e.dims),e.dataType,a,n,r,s),getRunData:t=>({outputs:[{dims:e.dims,dataType:a}],dispatchGroup:{x:Math.ceil(W.size(t[0].dims)/64/4)},programUniforms:c})}},Bi=e=>{e.compute(zi(e.inputs[0],`Abs`,`abs`))},Vi=e=>{e.compute(zi(e.inputs[0],`Acos`,`acos`))},Hi=e=>{e.compute(zi(e.inputs[0],`Acosh`,`acosh`))},Ui=e=>{e.compute(zi(e.inputs[0],`Asin`,`asin`))},Wi=e=>{e.compute(zi(e.inputs[0],`Asinh`,`asinh`))},Gi=e=>{e.compute(zi(e.inputs[0],`Atan`,`atan`))},Ki=e=>{e.compute(zi(e.inputs[0],`Atanh`,`atanh`))},qi=e=>Xn(e),Ji=(e,t)=>{let n;switch(t.to){case 10:n=`vec4`;break;case 1:n=`vec4`;break;case 12:n=`vec4`;break;case 6:n=`vec4`;break;case 9:n=`vec4`;break;default:throw RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${t.to}`)}e.compute(zi(e.inputs[0],`Cast`,n,void 0,t.cacheKey,t.to))},Yi=e=>{let t,n,r=e.length>=2&&e[1].data!==0,i=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:t=r?e[1].getFloat32Array()[0]:-34028234663852886e22,n=i?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:t=r?e[1].getUint16Array()[0]:64511,n=i?e[2].getUint16Array()[0]:31743;break;default:throw Error(`Unsupport data type`)}return Xn({min:t,max:n})},Xi=(e,t)=>{let n=t||Yi(e.inputs),r=tr(e.inputs[0].dataType);e.compute(zi(e.inputs[0],`Clip`,e=>`clamp(${e}, vec4<${r}>(uniforms.min), vec4<${r}>(uniforms.max))`,void 0,n.cacheKey,void 0,[{type:e.inputs[0].dataType,data:n.min},{type:e.inputs[0].dataType,data:n.max}],[{name:`min`,type:r},{name:`max`,type:r}]),{inputs:[0]})},Zi=e=>{e.compute(zi(e.inputs[0],`Ceil`,`ceil`))},Qi=e=>{e.compute(zi(e.inputs[0],`Cos`,`cos`))},$i=e=>{e.compute(zi(e.inputs[0],`Cosh`,`cosh`))},ea=e=>Xn(e),ta=(e,t)=>{let n=tr(e.inputs[0].dataType);e.compute(zi(e.inputs[0],`Elu`,e=>`elu_vf32(${e})`,` + const elu_alpha_ = ${n}(${t.alpha}); + + fn elu_f32(a: ${n}) -> ${n} { + return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0); + } + + fn elu_vf32(v: vec4<${n}>) -> vec4<${n}> { + return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w)); + }`,t.cacheKey))},na=(e=`f32`)=>` +const r0: ${e} = 0.3275911; +const r1: ${e} = 0.254829592; +const r2: ${e} = -0.284496736; +const r3: ${e} = 1.421413741; +const r4: ${e} = -1.453152027; +const r5: ${e} = 1.061405429; + +fn erf_vf32(v: vec4<${e}>) -> vec4<${e}> { + let absv = abs(v); + let x = 1.0 / (1.0 + r0 * absv); + return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv)); +}`,ra=e=>{let t=tr(e.inputs[0].dataType);e.compute(zi(e.inputs[0],`Erf`,e=>`erf_vf32(${e})`,na(t)))},ia=e=>{e.compute(zi(e.inputs[0],`Exp`,`exp`))},aa=e=>{e.compute(zi(e.inputs[0],`Floor`,`floor`))},oa=e=>{let t=tr(e.inputs[0].dataType);e.compute(zi(e.inputs[0],`Gelu`,e=>`0.5 * ${e} * (1.0 + erf_vf32(${e} * 0.7071067811865475))`,na(t)))},sa=(e,t)=>{let n=tr(e.inputs[0].dataType);e.compute(zi(e.inputs[0],`LeakyRelu`,e=>`select(leaky_relu_alpha_ * ${e}, ${e}, ${e} >= vec4<${n}>(0.0))`,`const leaky_relu_alpha_ = ${n}(${t.alpha});`,t.cacheKey))},ca=e=>{e.compute(zi(e.inputs[0],`Not`,e=>`!${e}`))},la=e=>{e.compute(zi(e.inputs[0],`Neg`,e=>`-${e}`))},ua=e=>{e.compute(zi(e.inputs[0],`Reciprocal`,e=>`1.0/${e}`))},da=e=>{let t=tr(e.inputs[0].dataType);e.compute(zi(e.inputs[0],`Relu`,e=>`select(vec4<${t}>(0.0), ${e}, ${e} > vec4<${t}>(0.0))`))},fa=e=>{e.compute(zi(e.inputs[0],`Sigmoid`,e=>`(1.0 / (1.0 + exp(-${e})))`))},pa=e=>Xn(e),ma=(e,t)=>{let n=tr(e.inputs[0].dataType);e.compute(zi(e.inputs[0],`HardSigmoid`,e=>`max(vec4<${n}>(0.0), min(vec4<${n}>(1.0), ${t.alpha} * ${e} + vec4<${n}>(${t.beta})))`,void 0,t.cacheKey))},ha=e=>{e.compute(zi(e.inputs[0],`Sin`,`sin`))},ga=e=>{e.compute(zi(e.inputs[0],`Sinh`,`sinh`))},_a=e=>{e.compute(zi(e.inputs[0],`Sqrt`,`sqrt`))},va=e=>{e.compute(zi(e.inputs[0],`Tan`,`tan`))},ya=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,ba=e=>{e.compute(zi(e.inputs[0],`Tanh`,ya))},xa=(e=`f32`)=>` +const fast_gelu_a: ${e} = 0.5; +const fast_gelu_b: ${e} = 0.7978845608028654; +const fast_gelu_c: ${e} = 0.035677408136300125; + +fn tanh_v(v: vec4<${e}>) -> vec4<${e}> { + return ${ya(`v`)}; +} +`,Sa=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,Ca=e=>{let t=tr(e.inputs[0].dataType);e.compute(zi(e.inputs[0],`FastGelu`,Sa,xa(t),void 0,e.inputs[0].dataType))},wa=(e,t)=>{let n=tr(e.inputs[0].dataType);return e.compute(zi(e.inputs[0],`ThresholdedRelu`,e=>`select(vec4<${n}>(0.0), ${e}, ${e} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${n}>(${t.alpha});`,t.cacheKey)),0},Ta=e=>{e.compute(zi(e.inputs[0],`Log`,`log`))},Ea=(e,t)=>` +const alpha = vec4<${e}>(${t}); +const one = ${e}(1.0); +const zero = ${e}(0.0); + +fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { + let v = x *alpha; + var x1 : vec4<${e}>; + for (var i = 0; i < 4; i = i + 1) { + if (v[i] >= zero) { + x1[i] = one / (one + exp(-v[i])); + } else { + x1[i] = one - one / (one + exp(v[i])); + } + } + return x * x1; +} +`,Da=e=>`quick_gelu_impl(${e})`,Oa=(e,t)=>{let n=tr(e.inputs[0].dataType);e.compute(zi(e.inputs[0],`QuickGelu`,Da,Ea(n,t.alpha),t.cacheKey,e.inputs[0].dataType))}}),Aa,ja,Ma,Na=M(()=>{"use strict";G(),X(),ka(),Aa=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![2560,5120,10240].includes(e[0].dims[2]))throw Error(`hidden state should be 2560, 5120 or 10240`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},ja=e=>{let t=e[0].dims.slice();t[2]/=2;let n=J(`input`,e[0].dataType,e[0].dims,4),r=J(`bias`,e[0].dataType,[e[0].dims[2]],4),i=Y(`output`,e[0].dataType,t,4),a=W.size(t)/4,o=er(e[0].dataType);return{name:`BiasSplitGelu`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)}}),getShaderSource:t=>` + const M_SQRT2 = sqrt(2.0); + const halfChannels = ${e[0].dims[2]/4/2}u; + + ${t.declareVariables(n,r,i)} + + ${na(o)} + + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(a)} + let biasIdx = global_idx % halfChannels; + let batchIndex = global_idx / halfChannels; + let inputOffset = biasIdx + batchIndex * halfChannels * 2; + let valueLeft = input[inputOffset] + bias[biasIdx]; + let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels]; + let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1); + + ${i.setByOffset(`global_idx`,`valueLeft * geluRight`)} + }`}},Ma=e=>{Aa(e.inputs),e.compute(ja(e.inputs))}}),Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa=M(()=>{"use strict";H(),G(),X(),Pa=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f,p;typeof s==`string`?f=p=(e,t)=>`${s}((${e}),(${t}))`:typeof s==`function`?f=p=s:(f=s.scalar,p=s.vector);let m=Y(`outputData`,u,r.length,4),h=J(`aData`,c,t.length,4),g=J(`bData`,l,n.length,4),_;if(i)if(a){let e=W.size(t)===1,r=W.size(n)===1,i=t.length>0&&t[t.length-1]%4==0,a=n.length>0&&n[n.length-1]%4==0;_=e||r?m.setByOffset(`global_idx`,p(e?`${h.type.value}(${h.getByOffset(`0`)}.x)`:h.getByOffset(`global_idx`),r?`${g.type.value}(${g.getByOffset(`0`)}.x)`:g.getByOffset(`global_idx`))):` + let outputIndices = ${m.offsetToIndices(`global_idx * 4u`)}; + let offsetA = ${h.broadcastedIndicesToOffset(`outputIndices`,m)}; + let offsetB = ${g.broadcastedIndicesToOffset(`outputIndices`,m)}; + ${m.setByOffset(`global_idx`,p(o||i?h.getByOffset(`offsetA / 4u`):`${h.type.value}(${h.getByOffset(`offsetA / 4u`)}[offsetA % 4u])`,o||a?g.getByOffset(`offsetB / 4u`):`${g.type.value}(${g.getByOffset(`offsetB / 4u`)}[offsetB % 4u])`))} + `}else _=m.setByOffset(`global_idx`,p(h.getByOffset(`global_idx`),g.getByOffset(`global_idx`)));else{if(!a)throw Error(`no necessary to use scalar implementation for element-wise binary op implementation.`);let e=(e,t,n=``)=>{let r=`aData[indexA${t}][componentA${t}]`,i=`bData[indexB${t}][componentB${t}]`;return` + let outputIndices${t} = ${m.offsetToIndices(`global_idx * 4u + ${t}u`)}; + let offsetA${t} = ${h.broadcastedIndicesToOffset(`outputIndices${t}`,m)}; + let offsetB${t} = ${g.broadcastedIndicesToOffset(`outputIndices${t}`,m)}; + let indexA${t} = offsetA${t} / 4u; + let indexB${t} = offsetB${t} / 4u; + let componentA${t} = offsetA${t} % 4u; + let componentB${t} = offsetB${t} % 4u; + ${e}[${t}] = ${n}(${f(r,i)}); + `};_=u===9?` + var data = vec4(0); + ${e(`data`,0,`u32`)} + ${e(`data`,1,`u32`)} + ${e(`data`,2,`u32`)} + ${e(`data`,3,`u32`)} + outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:` + ${e(`outputData[global_idx]`,0)} + ${e(`outputData[global_idx]`,1)} + ${e(`outputData[global_idx]`,2)} + ${e(`outputData[global_idx]`,3)} + `}return` + ${e.registerUniform(`vec_size`,`u32`).declareVariables(h,g,m)} + + ${d??``} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + ${_} + }`},Fa=(e,t,n,r,i,a,o=n.dataType)=>{let s=n.dims.map(e=>Number(e)??1),c=r.dims.map(e=>Number(e)??1),l=!W.areEqual(s,c),u=s,d=W.size(s),f=!1,p=!1,m=[l];if(l){let e=gn.calcShape(s,c,!1);if(!e)throw Error(`Can't perform binary op on the given tensors`);u=e.slice(),d=W.size(u);let t=W.size(s)===1,n=W.size(c)===1,r=s.length>0&&s[s.length-1]%4==0,i=c.length>0&&c[c.length-1]%4==0;m.push(t),m.push(n),m.push(r),m.push(i);let a=1;for(let e=1;ee.toString()).join(`_`),inputDependencies:[`rank`,`rank`]},getShaderSource:e=>Pa(e,s,c,u,f,l,p,i,n.dataType,r.dataType,o,a),getRunData:()=>({outputs:[{dims:u,dataType:o}],dispatchGroup:{x:Math.ceil(d/64/4)},programUniforms:[{type:12,data:Math.ceil(W.size(u)/4)},...K(s,c,u)]})}},Ia=(e,t,n,r,i,a)=>{e.compute(Fa(t,i??``,e.inputs[0],e.inputs[1],n,r,a))},La=e=>{Ia(e,`Add`,(e,t)=>`${e}+${t}`)},Ra=e=>{Ia(e,`Div`,(e,t)=>`${e}/${t}`)},za=e=>{Ia(e,`Equal`,{scalar:(e,t)=>`u32(${e}==${t})`,vector:(e,t)=>`vec4(${e}==${t})`},void 0,void 0,9)},Ba=e=>{Ia(e,`Mul`,(e,t)=>`${e}*${t}`)},Va=e=>{let t=J(`input`,e.inputs[0].dataType,e.inputs[0].dims).type.value;Ia(e,`Pow`,{scalar:(e,t)=>`pow_custom(${e},${t})`,vector:(e,t)=>`pow_vector_custom(${e},${t})`},` + fn pow_custom(a : ${t}, b : ${t}) -> ${t} { + if (b == ${t}(0.0)) { + return ${t}(1.0); + } else if (a < ${t}(0.0) && f32(b) != floor(f32(b))) { + return ${t}(pow(f32(a), f32(b))); // NaN + } + return select(sign(a), ${t}(1.0), round(f32(abs(b) % ${t}(2.0))) != 1.0) * ${t}(${t===`i32`?`round`:``}(pow(f32(abs(a)), f32(b)))); + } + fn pow_vector_custom(a : vec4<${t}>, b : vec4<${t}>) -> vec4<${t}> { + // TODO: implement vectorized pow + return vec4<${t}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w)); + } + `)},Ha=e=>{Ia(e,`Sub`,(e,t)=>`${e}-${t}`)},Ua=e=>{Ia(e,`Greater`,{scalar:(e,t)=>`u32(${e}>${t})`,vector:(e,t)=>`vec4(${e}>${t})`},void 0,void 0,9)},Wa=e=>{Ia(e,`Less`,{scalar:(e,t)=>`u32(${e}<${t})`,vector:(e,t)=>`vec4(${e}<${t})`},void 0,void 0,9)},Ga=e=>{Ia(e,`GreaterOrEqual`,{scalar:(e,t)=>`u32(${e}>=${t})`,vector:(e,t)=>`vec4(${e}>=${t})`},void 0,void 0,9)},Ka=e=>{Ia(e,`LessOrEqual`,{scalar:(e,t)=>`u32(${e}<=${t})`,vector:(e,t)=>`vec4(${e}<=${t})`},void 0,void 0,9)}}),Ja,Ya,Xa,Za,Qa,$a,eo=M(()=>{"use strict";H(),G(),Zn(),X(),Ja=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);let n=0,r=e[n],i=r.dataType,a=r.dims.length;e.forEach((e,o)=>{if(o!==n){if(e.dataType!==i)throw Error(`input tensors should be one type`);if(e.dims.length!==a)throw Error(`input tensors should have the same shape`);e.dims.forEach((e,n)=>{if(n!==t&&e!==r.dims[n])throw Error(`non concat dimensions must match`)})}})},Ya=(e,t)=>` + fn calculateInputIndex(index: u32) -> u32 { + let sizeInConcatAxis = array(${t}); + for (var i: u32 = 0u; i < ${e}; i += 1u ) { + if (index < sizeInConcatAxis[i]) { + return i; + } + } + return ${e}u; + }`,Xa=(e,t)=>{let n=e.length,r=[];for(let i=0;i{let i=W.size(n),a=Array(e.length),o=Array(e.length),s=0,c=[],l=[],u=[{type:12,data:i}];for(let n=0;n`uniforms.sizeInConcatAxis${e}`).join(`,`),m=t=>` + + ${(()=>{t.registerUniform(`outputSize`,`u32`);for(let n=0;n(${p}); + ${f} -= sizeInConcatAxis[inputIndex - 1u]; + } + + ${Xa(o,d)} + }`;return{name:`Concat`,shaderCache:{hint:`${t}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:n,dataType:r}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:u}),getShaderSource:m}},Qa=(e,t)=>{let n=e.inputs,r=n[0].dims,i=W.normalizeAxis(t.axis,r.length);Ja(n,i);let a=r.slice();a[i]=n.reduce((e,t)=>e+(t.dims.length>i?t.dims[i]:0),0);let o=n.filter(e=>W.size(e.dims)>0);e.compute(Za(o,i,a,n[0].dataType),{inputs:o})},$a=e=>Xn({axis:e.axis})}),to,no,ro,io,ao=M(()=>{"use strict";H(),G(),to=(e,t,n=`f32`)=>{switch(e.activation){case`Relu`:return`value = max(value, ${t}(0.0));`;case`Sigmoid`:return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case`Clip`:return`value = clamp(value, ${t}(${n}(uniforms.clip_min)), ${t}(${n}(uniforms.clip_max)));`;case`HardSigmoid`:return`value = max(${t}(0.0), min(${t}(1.0), ${n}(uniforms.alpha) * value + ${n}(uniforms.beta)));`;case`LeakyRelu`:return`value = select(${n}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case`Tanh`:return`let e2x = exp(-2.0 * abs(value)); + value = sign(value) * (1.0 - e2x) / (1.0 + e2x); + `;case``:return``;default:throw Error(`Unsupported activation ${e.activation}`)}},no=(e,t)=>{e.activation===`Clip`?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===`HardSigmoid`?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===`LeakyRelu`&&t.push({type:1,data:e.alpha})},ro=(e,t)=>{e.activation===`Clip`?t.push({name:`clip_max`,type:`f32`},{name:`clip_min`,type:`f32`}):e.activation===`HardSigmoid`?t.push({name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}):e.activation===`LeakyRelu`&&t.push({name:`alpha`,type:`f32`})},io=e=>{let t=e?.activation||``;if(t===`HardSigmoid`){let[n,r]=e?.activation_params||[.2,.5];return{activation:t,alpha:n,beta:r}}else if(t===`Clip`){let[n,r]=e?.activation_params||[yn,bn];return{activation:t,clipMax:r,clipMin:n}}else if(t===`LeakyRelu`){let[n]=e?.activation_params||[.01];return{activation:t,alpha:n}}return{activation:t}}}),oo,so,co=M(()=>{"use strict";oo=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw Error(`${e}-component is not supported.`)}},so=e=>` + ${e?`value = value + getBiasByOutputCoords(coords);`:``} + `}),lo,uo=M(()=>{"use strict";lo=e=>` +fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 { + return dot(coords, vec4( + shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1)); +} +fn getOutputIndexFromCoords(coords : vec4) -> i32 { + return dot(coords, vec4( + i32(${e}.x), i32(${e}.y), i32(${e}.z), 1)); +} +`}),fo,po,mo=M(()=>{"use strict";H(),G(),X(),ao(),fo=(e,t,n,r,i)=>{let a=r-n;return` + ${Array.from({length:n}).map((n,o)=>` + if (${q(t.shape,o,t.rank)} != 1) { + ${t.indicesSet(e,o,q(i,o+a,r))} + } else { + ${t.indicesSet(e,o,0)} + }`).join(``)} +`},po=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o[o.length-2],l=s[s.length-1],u=o[o.length-1],d=nr(l),f=nr(u),p=nr(c),m=W.size(n)/d/p,h=e.length>2,g=r?r.slice(0,-2):n.slice(0,-2),_=[W.size(g),c,l],v=[{type:12,data:m},{type:12,data:c},{type:12,data:l},{type:12,data:u}];no(t,v),v.push(...K(g,o,s)),h&&v.push(...K(e[2].dims)),v.push(...K(_));let y=r=>{let a=cr(`batch_dims`,e[0].dataType,g.length),c=J(`a`,e[0].dataType,o.length,f),l=J(`b`,e[1].dataType,s.length,d),u=Y(`output`,e[0].dataType,_.length,d),m=er(u.type.tensor),v=to(t,u.type.value,m),y=[c,l],b=``;if(h){let t=i?d:1;y.push(J(`bias`,e[2].dataType,e[2].dims.length,t)),b=`${i?`value += bias[col / ${t}];`:`value += ${u.type.value}(bias[row + i]);`}`}let x=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`}];ro(t,x);let S=()=>{let e=`var a_data: ${c.type.value};`;for(let t=0;t; + for (var k: u32 = 0u; k < uniforms.K; k = k + ${f}) { + ${S()} + } + for (var i = 0u; i < ${p}u; i++) { + var value = values[i]; + ${b} + ${v} + let cur_indices = ${u.type.indices}(batch, row + i, col); + let offset = ${u.indicesToOffset(`cur_indices`)}; + ${u.setByOffset(`offset / ${d}`,`value`)}; + } + } + `};return{name:`MatMulNaive`,shaderCache:{hint:`${t.activation};${d};${f};${p};${i}`,inputDependencies:h?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:v}),getShaderSource:y}}}),ho,go,_o,vo,yo,bo,xo,So,Co=M(()=>{"use strict";H(),G(),X(),ao(),mo(),co(),ho=(e,t)=>e?` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + kStart + inputRow, + globalRowStart / innerElementSize + inputCol${t?`, batchIndices`:``}); + `:` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + globalRow + innerRow, + kStart / innerElementSize + inputCol${t?`, batchIndices`:``}); + `,go=(e,t)=>e?` + let ACached0 = mm_Asub[k * innerElementSize][localRow]; + let ACached1 = mm_Asub[k * innerElementSize + 1][localRow]; + let ACached2 = mm_Asub[k * innerElementSize + 2][localRow]; + ${t===3?``:`let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];`} + for (var i = 0; i < rowPerThread; i = i + 1) { + acc[i] = BCached0 * ACached0[i] + acc[i]; + acc[i] = BCached1 * ACached1[i] + acc[i]; + acc[i] = BCached2 * ACached2[i] + acc[i]; + ${t===3?``:`acc[i] = BCached3 * ACached3[i] + acc[i];`} + }`:` + for (var i = 0; i < rowPerThread; i = i + 1) { + let ACached = mm_Asub[tileRow + i][k]; + acc[i] = BCached0 * ACached.x + acc[i]; + acc[i] = BCached1 * ACached.y + acc[i]; + acc[i] = BCached2 * ACached.z + acc[i]; + ${t===3?``:`acc[i] = BCached3 * ACached.w + acc[i];`} + }`,_o=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32)=>{let c=t[1]*e[1],l=t[0]*e[0],u=i?c:a,d=i?a:c,f=u/t[0],p=a/t[1];if(!((i&&f===4&&e[1]===4||!i&&(f===3||f===4))&&u%t[0]===0&&a%t[1]===0&&e[0]===4))throw Error(`If transposeA ${i} is true, innerElementSize ${f} and workPerThread[1] ${e[1]} must be 4. + Otherwise, innerElementSize ${f} must be 3 or 4. + tileAWidth ${u} must be divisible by workgroupSize[0]${t[0]}. tileInner ${a} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`);return` +var mm_Asub: array, ${u/f}>, ${d}>; +var mm_Bsub: array, ${l/e[0]}>, ${a}>; + +const rowPerThread = ${e[1]}; +const colPerThread = ${e[0]}; +const innerElementSize = ${f}; +const tileInner = ${a}; + +@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]}) +fn main(@builtin(local_invocation_id) localId : vec3, + @builtin(global_invocation_id) globalId : vec3, + @builtin(workgroup_id) workgroupId : vec3) { + let localRow = i32(localId.y); + let tileRow = localRow * rowPerThread; + let tileCol = i32(localId.x); + + let globalRow =i32(globalId.y) * rowPerThread; + let globalCol = i32(globalId.x); + let batch = ${o?`0`:`i32(globalId.z)`}; + ${r?`let batchIndices = ${r.offsetToIndices(`u32(batch)`)};`:``} + let globalRowStart = i32(workgroupId.y) * ${c}; + + let num_tiles = ${o?`${Math.ceil(s/a)}`:`(uniforms.dim_inner - 1) / tileInner + 1`}; + var kStart = ${o?`i32(globalId.z) * ${s}`:`0`}; + + var acc: array, rowPerThread>; + + // Loop over shared dimension. + let tileRowB = localRow * ${p}; + for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let inputRow = tileRow + innerRow; + let inputCol = tileCol; + ${ho(i,r)} + } + + // Load one tile of B into local memory. + for (var innerRow = 0; innerRow < ${p}; innerRow = innerRow + 1) { + let inputRow = tileRowB + innerRow; + let inputCol = tileCol; + mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${r?`, batchIndices`:``}); + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + for (var k = 0; k < tileInner / innerElementSize; k = k + 1) { + let BCached0 = mm_Bsub[k * innerElementSize][tileCol]; + let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol]; + let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol]; + ${f===3?``:`let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];`} + + ${go(i,f)} + } + + workgroupBarrier(); + } + + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); + } +}`},vo=(e,t)=>e?` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + kStart + inputRow, + globalRowStart + inputCol${t?`, batchIndices`:``}); + `:` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + globalRowStart + inputRow, + kStart + inputCol${t?`, batchIndices`:``}); + `,yo=e=>e?`let ACached = mm_Asub[k][tileRow + innerRow];`:`let ACached = mm_Asub[tileRow + innerRow][k];`,bo=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32,c=!1)=>{let l=e[1]*t[1],u=e[0]*t[0],d=i?l:a,f=i?a:l;if(!(f%t[1]===0&&d%t[0]===0&&a%t[1]===0))throw Error(`tileAHight ${f} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${d} must be divisible by workgroupSize[0]${t[0]}, tileInner ${a} must be divisible by workgroupSize[1]${t[1]}`);let p=f/t[1],m=d/t[0],h=a/t[1],g=c?` + let localRow = i32(localId.y); + let localCol = i32(localId.x); + let globalRowStart = i32(workgroupId.y) * ${l}; + let globalColStart = i32(workgroupId.x) * ${u}; + + // Loop over shared dimension. + for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var inputRow = localRow; inputRow < ${f}; inputRow = inputRow + ${t[1]}) { + for (var inputCol = localCol; inputCol < ${d}; inputCol = inputCol + ${t[0]}) { + ${vo(i,r)} + } + } + // Load one tile of B into local memory. + for (var inputRow = localRow; inputRow < ${a}; inputRow = inputRow + ${t[1]}) { + for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${t[0]}) { + mm_Bsub[inputRow][inputCol] = mm_readB(batch, + kStart + inputRow, + globalColStart + inputCol${r?`, batchIndices`:``}); + } + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + var BCached : array<${n}, colPerThread>; + for (var k = 0; k < tileInner; k = k + 1) { + for (var inner = 0; inner < colPerThread; inner = inner + 1) { + BCached[inner] = mm_Bsub[k][localCol + inner * ${t[0]}]; + } + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let ACached = ${i?`mm_Asub[k][localRow + innerRow * ${t[1]}];`:`mm_Asub[localRow + innerRow * ${t[1]}][k];`} + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + acc[innerRow][innerCol] = acc[innerRow][innerCol] + + ACached * BCached[innerCol]; + } + } + } + workgroupBarrier(); + } + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let gRow = globalRowStart + localRow + innerRow * ${t[1]}; + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + let gCol = globalColStart + localCol + innerCol * ${t[0]}; + mm_write(batch, gRow, gCol, acc[innerRow][innerCol]); + } + } + `:` +let tileRow = i32(localId.y) * rowPerThread; +let tileCol = i32(localId.x) * colPerThread; + +let globalRow = i32(globalId.y) * rowPerThread; +let globalCol = i32(globalId.x) * colPerThread; +let globalRowStart = i32(workgroupId.y) * ${l}; + +let tileRowA = i32(localId.y) * ${p}; +let tileColA = i32(localId.x) * ${m}; +let tileRowB = i32(localId.y) * ${h}; +// Loop over shared dimension. +for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var innerRow = 0; innerRow < ${p}; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < ${m}; innerCol = innerCol + 1) { + let inputRow = tileRowA + innerRow; + let inputCol = tileColA + innerCol; + ${vo(i,r)} + } + } + + // Load one tile of B into local memory. + for (var innerRow = 0; innerRow < ${h}; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + let inputRow = tileRowB + innerRow; + let inputCol = tileCol + innerCol; + mm_Bsub[inputRow][inputCol] = mm_readB(batch, + kStart + inputRow, + globalCol + innerCol${r?`, batchIndices`:``}); + } + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + var BCached : array<${n}, colPerThread>; + for (var k = 0; k < tileInner; k = k + 1) { + for (var inner = 0; inner < colPerThread; inner = inner + 1) { + BCached[inner] = mm_Bsub[k][tileCol + inner]; + } + + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + ${yo(i)} + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol]; + } + } + } + + workgroupBarrier(); +} + +for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + mm_write(batch, globalRow + innerRow, globalCol + innerCol, + acc[innerRow][innerCol]); + } +} +`;return` + var mm_Asub : array, ${f}>; + var mm_Bsub : array, ${a}>; + const rowPerThread = ${e[1]}; + const colPerThread = ${e[0]}; + const tileInner = ${a}; + +@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]}) +fn main(@builtin(local_invocation_id) localId : vec3, + @builtin(global_invocation_id) globalId : vec3, + @builtin(workgroup_id) workgroupId : vec3) { + let batch = ${o?`0`:`i32(globalId.z)`}; + ${r?`let batchIndices = ${r.offsetToIndices(`u32(batch)`)};`:``} + let num_tiles = ${o?`${Math.ceil(s/a)}`:`(uniforms.dim_inner - 1) / tileInner + 1`}; + var kStart = ${o?`i32(globalId.z) * ${s}`:`0`}; + + var acc : array, rowPerThread>; + ${g} + } +`},xo=(e,t,n,r,i=!1)=>{let[a,o,s,c]=r,l=er(r[0].type.tensor);return` + fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${oo(e,l)} { + var value = ${oo(e,l)}(0.0); + let col = colIn * ${e}; + if(row < uniforms.dim_a_outer && col < uniforms.dim_inner) + { + var aIndices: ${o.type.indices}; + ${fo(`aIndices`,o,o.rank-2,a.rank,`batchIndices`)} + ${o.indicesSet(`aIndices`,o.rank-2,`u32(row)`)} + ${o.indicesSet(`aIndices`,o.rank-1,`u32(colIn)`)} + value = ${o.getByIndices(`aIndices`)}; + } + return value; + } + + fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${oo(e,l)} { + var value = ${oo(e,l)}(0.0); + let col = colIn * ${e}; + if(row < uniforms.dim_inner && col < uniforms.dim_b_outer) + { + var bIndices: ${s.type.indices}; + ${fo(`bIndices`,s,s.rank-2,a.rank,`batchIndices`)} + ${s.indicesSet(`bIndices`,s.rank-2,`u32(row)`)} + ${s.indicesSet(`bIndices`,s.rank-1,`u32(colIn)`)} + value = ${s.getByIndices(`bIndices`)}; + } + return value; + } + + fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${oo(e,l)}) { + let col = colIn * ${e}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) { + var value = valueIn; + let coords = vec3(batch, row, colIn); + ${t?`value = value + ${i?`bias[colIn]`:`${oo(e,l)}(bias[row])`};`:``} + ${n} + ${c.setByIndices(`vec3(coords)`,`value`)} + } + } + `},So=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o.slice(0,-2),l=s.slice(0,-2),u=r?r.slice(0,-2):n.slice(0,-2),d=W.size(u),f=o[o.length-2],p=o[o.length-1],m=s[s.length-1],h=p%4==0&&m%4==0,g=f<=8?[4,1,1]:[4,4,1],_=[8,8,1],v=[Math.ceil(m/_[0]/g[0]),Math.ceil(f/_[1]/g[1]),Math.ceil(d/_[2]/g[2])],y=h?4:1,b=[...c,f,p/y],x=b.length,S=[...l,p,m/y],C=S.length,w=[d,f,m/y],T=[{type:6,data:f},{type:6,data:m},{type:6,data:p}];no(t,T),T.push(...K(u,b,S));let E=[`rank`,`rank`],D=e.length>2;D&&(T.push(...K(e[2].dims)),E.push(`rank`)),T.push(...K(w));let O=n=>{let r=u.length,a=cr(`batchDims`,e[0].dataType,r,1),o=er(e[0].dataType),s=J(`a`,e[0].dataType,x,y),c=J(`b`,e[1].dataType,C,y),l=Y(`result`,e[0].dataType,w.length,y),d=[s,c];if(D){let t=i?y:1;d.push(J(`bias`,e[2].dataType,e[2].dims.length,t))}let f=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`}];ro(t,f);let p=er(l.type.tensor),m=to(t,l.type.value,p),v=xo(y,D,m,[a,s,c,l],i);return` + ${n.registerUniforms(f).registerInternalVariables(a).declareVariables(...d,l)} + ${v} + ${h?_o(g,_,o,a):bo(g,_,o,a)} + `};return{name:`MatMul`,shaderCache:{hint:`${g};${t.activation};${h};${i}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:v[0],y:v[1],z:v[2]},programUniforms:T}),getShaderSource:O}}}),wo,To,Eo=M(()=>{"use strict";H(),mn(),X(),ao(),co(),uo(),Co(),wo=(e,t,n,r,i=!1,a,o=4,s=4,c=4,l=`f32`)=>{let u=e=>{switch(e){case 1:return`resData = x[xIndex];`;case 3:return`resData = vec3<${l}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return`resData = x[xIndex / 4];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},d=e=>{switch(e){case 1:return`return w[row * i32(uniforms.w_shape[3]) + colIn];`;case 4:return`return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},f=e?` + let coord = vec4(batch, xRow, xCol, xCh); + `:` + let coord = vec4(batch, xCh, xRow, xCol); + `,p=e?` + let coords = vec4( + batch, + row / outWidth, + row % outWidth, + col); + `:` + let coords = vec4( + batch, + row, + col / outWidth, + col % outWidth); + `,m=e?`i32(uniforms.x_shape[1])`:`i32(uniforms.x_shape[2])`,h=e?`i32(uniforms.x_shape[2])`:`i32(uniforms.x_shape[3])`,g=e?`row`:`col`,_=e?`col`:`row`,v=` + let inChannels = i32(uniforms.w_shape[2]); + let outWidth = ${e?`i32(uniforms.result_shape[2])`:`i32(uniforms.result_shape[3])`}; + let outRow = ${g} / outWidth; + let outCol = ${g} % outWidth; + + let WRow = ${_} / (i32(uniforms.w_shape[1]) * inChannels); + let WCol = ${_} / inChannels % i32(uniforms.w_shape[1]); + let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0]; + let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1]; + let xCh = ${_} % inChannels; + var resData = ${oo(o,l)}(0.0); + // The bounds checking is always needed since we use it to pad zero for + // the 'same' padding type. + if (xRow >= 0 && xRow < ${m} && xCol >= 0 && xCol < ${h}) { + ${f} + let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape)); + ${u(o)} + } + return resData;`,y=e?t&&r?` + let col = colIn * ${o}; + ${v}`:` + let col = colIn * ${o}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) { + ${v} + } + return ${oo(o,l)}(0.0);`:r&&n?` + let col = colIn * ${o}; + ${v}`:` + let col = colIn * ${o}; + if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { + ${v} + } + return ${oo(o,l)}(0.0);`,b=e?r&&n?d(s):` + let col = colIn * ${s}; + if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { + ${d(s)} + } + return ${oo(s,l)}(0.0);`:` + let col = colIn * ${s}; + if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) { + ${d(s)} + } + return ${oo(s,l)}(0.0);`,x=oo(c,l),S=oo(e?o:s,l),C=oo(e?s:o,l),w=to(a,x,l);return` + fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${S} { + ${e?y:b} + } + + fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${C} { + ${e?b:y} + } + + fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${x}) { + let col = colIn * ${c}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) + { + var value = valueIn; + let outWidth = ${e?`i32(uniforms.result_shape[2])`:`i32(uniforms.result_shape[3])`}; + ${p} + ${so(i)} + ${w} + setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); + } + }`},To=(e,t,n,r,i,a,o,s,c)=>{let l=t.format===`NHWC`,u=l?e[0].dims[3]:e[0].dims[1],d=n[0],f=l?n[2]:n[3],p=l?n[1]:n[2],m=l?n[3]:n[1],h=l&&(u%4==0||u%3==0)&&m%4==0,g=l?m:f*p,_=l?f*p:m,v=[8,8,1],y=r<=8?[4,1,1]:[4,4,1],b=[Math.ceil(g/v[0]/y[0]),Math.ceil(_/v[1]/y[1]),Math.ceil(d/v[2]/y[2])];U(`verbose`,()=>`[conv2d_mm_webgpu] dispatch = ${b}`);let x=h?l&&u%4!=0?3:4:1,S=v[1]*y[1],C=v[0]*y[0],w=Math.max(v[0]*x,v[1]),T=r%S===0,E=i%C===0,D=a%w===0,O=h?[x,4,4]:[1,1,1],k=[{type:6,data:r},{type:6,data:i},{type:6,data:a},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];no(t,k),k.push(...K(e[0].dims,e[1].dims));let A=[`rank`,`rank`];o&&(k.push(...K(e[2].dims)),A.push(`rank`)),k.push(...K(n));let ee=r=>{let i=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`},{name:`pad`,type:`i32`,length:2},{name:`stride`,type:`i32`,length:2},{name:`dilation`,type:`i32`,length:2}];ro(t,i);let a=h?4:1,c=er(e[0].dataType),u=` + fn setOutputAtIndex(flatIndex : i32, value : ${h?`vec4<${c}>`:c}) { + result[flatIndex] = ${h?`vec4<${c}>`:c}(value); + } + fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${h?`vec4<${c}>`:c}) { + let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3)); + setOutputAtIndex(flatIndex ${h?`/ 4`:``}, value); + }`,d=J(`x`,e[0].dataType,e[0].dims.length,x===3?1:x),f=J(`w`,e[1].dataType,e[1].dims.length,a),p=[d,f],m=Y(`result`,e[0].dataType,n.length,a);if(o){let t=J(`bias`,e[2].dataType,e[2].dims.length,a);p.push(t),u+=` + fn getBiasByOutputCoords(coords : vec4) -> ${h?`vec4<${c}>`:c} { + return bias[coords.${l?`w`:`y`}${h?`/ 4`:``}]; + }`}return` + ${lo(`uniforms.result_strides`)} + //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4, + // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2, + // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 }; + ${r.registerUniforms(i).declareVariables(...p,m)} + ${u} + ${wo(l,T,E,D,o,t,O[0],O[1],O[2],c)} + ${h?_o(y,v,c,void 0,!l,w):bo(y,v,c,void 0,!l,w,!1,void 0,s)}`};return{name:`Conv2DMatMul`,shaderCache:{hint:`${t.cacheKey};${x};${h};${T};${E};${D};${S};${C};${w}`,inputDependencies:A},getRunData:()=>({outputs:[{dims:c?c(n):n,dataType:e[0].dataType}],dispatchGroup:{x:b[0],y:b[1],z:b[2]},programUniforms:k}),getShaderSource:ee}}}),Do,Oo,ko,Ao,jo,Mo,No,Po,Fo=M(()=>{"use strict";H(),mn(),G(),X(),ao(),co(),Do=e=>{let t=1;for(let n=0;ntypeof e==`number`?[e,e,e]:e,ko=(e,t)=>t<=1?e:e+(e-1)*(t-1),Ao=(e,t,n,r=1)=>{let i=ko(t,r);return Math.floor((e[0]*(n-1)-n+i)/2)},jo=(e,t,n,r,i)=>{i??=Ao(e,t[0],r[0]);let a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*i>=t[n]&&(a[n]=Math.trunc((e[n]-t[n]+2*i)/r[n]+1));return a},Mo=(e,t,n,r,i,a,o,s,c,l)=>{let u,d,f,p;if(e===`VALID`&&(e=0),typeof e==`number`){u={top:e,bottom:e,left:e,right:e,front:e,back:e};let m=jo([t,n,r,1],[s,c,l],1,[i,a,o],e);d=m[0],f=m[1],p=m[2]}else if(Array.isArray(e)){if(!e.every((e,t,n)=>e===n[0]))throw Error(`Unsupported padding parameter: ${e}`);u={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let m=jo([t,n,r,1],[s,c,l],1,[i,a,o],e[0]);d=m[0],f=m[1],p=m[2]}else if(e===`SAME_UPPER`){d=Math.ceil(t/i),f=Math.ceil(n/a),p=Math.ceil(r/o);let e=(d-1)*i+s-t,m=(f-1)*a+c-n,h=(p-1)*o+l-r,g=Math.floor(e/2),_=e-g,v=Math.floor(m/2),y=m-v,b=Math.floor(h/2),x=h-b;u={top:v,bottom:y,left:b,right:x,front:g,back:_}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outDepth:d,outHeight:f,outWidth:p}},No=(e,t,n,r,i,a=!1,o=`channelsLast`)=>{let s,c,l,u,d;if(o===`channelsLast`)[s,c,l,u,d]=e;else if(o===`channelsFirst`)[s,d,c,l,u]=e;else throw Error(`Unknown dataFormat ${o}`);let[f,,p,m,h]=t,[g,_,v]=Oo(n),[y,b,x]=Oo(r),S=ko(p,y),C=ko(m,b),w=ko(h,x),{padInfo:T,outDepth:E,outHeight:D,outWidth:O}=Mo(i,c,l,u,g,_,v,S,C,w),k=a?f*d:f,A=[0,0,0,0,0];return o===`channelsFirst`?A=[s,k,E,D,O]:o===`channelsLast`&&(A=[s,E,D,O,k]),{batchSize:s,dataFormat:o,inDepth:c,inHeight:l,inWidth:u,inChannels:d,outDepth:E,outHeight:D,outWidth:O,outChannels:k,padInfo:T,strideDepth:g,strideHeight:_,strideWidth:v,filterDepth:p,filterHeight:m,filterWidth:h,effectiveFilterDepth:S,effectiveFilterHeight:C,effectiveFilterWidth:w,dilationDepth:y,dilationHeight:b,dilationWidth:x,inShape:e,outShape:A,filterShape:t}},Po=(e,t,n,r,i,a)=>{let o=a===`channelsLast`,s=o?e[0].dims[3]:e[0].dims[1],c=!1,l=[64,1,1],u={x:n.map((e,t)=>t)},d=[Math.ceil(Do(u.x.map(e=>n[e]))/l[0]),1,1];U(`verbose`,()=>`[conv3d_naive_webgpu] dispatch = ${d}`);let f=c?o&&s%4!=0?3:4:1,p=W.size(n),m=[{type:12,data:p},{type:12,data:r},{type:12,data:i},{type:12,data:t.strides},{type:12,data:t.dilations}];no(t,m),m.push(...K(e[0].dims,e[1].dims));let h=[`rank`,`rank`],g=e.length===3;g&&(m.push(...K(e[2].dims)),h.push(`rank`)),m.push(...K(n));let _=a=>{let s=[{name:`output_size`,type:`u32`},{name:`filter_dims`,type:`u32`,length:r.length},{name:`pads`,type:`u32`,length:i.length},{name:`strides`,type:`u32`,length:t.strides.length},{name:`dilations`,type:`u32`,length:t.dilations.length}];ro(t,s);let l=c?4:1,u=er(e[0].dataType),d=J(`x`,e[0].dataType,e[0].dims.length,f===3?1:f),p=J(`W`,e[1].dataType,e[1].dims.length,l),m=[d,p],h=Y(`result`,e[0].dataType,n.length,l),_=``;if(g){let t=J(`bias`,e[2].dataType,e[2].dims.length,l);m.push(t),_+=` + fn getBiasByOutputCoords(coords : array) -> ${c?`vec4<${u}>`:u} { + return bias[${o?q(`coords`,4,5):q(`coords`,1,5)}${c?`/ 4`:``}]; + }`}let v=oo(f,u),y=to(t,v,u);return` + ${_} + fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { + let aIndices = array(d0, d1, d2, d3, d4); + return ${d.getByIndices(`aIndices`)}; + } + fn getW(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { + let aIndices = array(d0, d1, d2, d3, d4); + return ${p.getByIndices(`aIndices`)}; + } + ${a.registerUniforms(s).declareVariables(...m,h)} + ${a.mainStart()} + ${a.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let coords = ${h.offsetToIndices(`global_idx`)}; + let batch = ${q(`coords`,0,d.rank)}; + let d2 = ${o?q(`coords`,d.rank-1,d.rank):q(`coords`,1,d.rank)}; + let xFRCCorner = vec3(${o?q(`coords`,1,d.rank):q(`coords`,2,d.rank)}, + ${o?q(`coords`,2,d.rank):q(`coords`,3,d.rank)}, + ${o?q(`coords`,3,d.rank):q(`coords`,4,d.rank)}) * uniforms.strides - uniforms.pads; + let xFCorner = xFRCCorner.x; + let xRCorner = xFRCCorner.y; + let xCCorner = xFRCCorner.z; + let xShapeY = ${o?q(`uniforms.x_shape`,1,d.rank):q(`uniforms.x_shape`,2,d.rank)}; + let xShapeZ = ${o?q(`uniforms.x_shape`,2,d.rank):q(`uniforms.x_shape`,3,d.rank)}; + let xShapeW = ${o?q(`uniforms.x_shape`,3,d.rank):q(`uniforms.x_shape`,4,d.rank)}; + let xShapeU = ${o?q(`uniforms.x_shape`,4,d.rank):q(`uniforms.x_shape`,1,d.rank)}; + let inputDepthNearestVec4 = (xShapeU / 4) * 4; + let inputDepthVec4Remainder = xShapeU % 4; + + var value = 0.0; + for (var wF = 0u; wF < uniforms.filter_dims[0]; wF++) { + let xF = xFCorner + wF * uniforms.dilations[0]; + if (xF < 0 || xF >= xShapeY) { + continue; + } + + for (var wR = 0u; wR < uniforms.filter_dims[1]; wR++) { + let xR = xRCorner + wR * uniforms.dilations[1]; + if (xR < 0 || xR >= xShapeZ) { + continue; + } + + for (var wC = 0u; wC < uniforms.filter_dims[2]; wC++) { + let xC = xCCorner + wC * uniforms.dilations[2]; + if (xC < 0 || xC >= xShapeW) { + continue; + } + + for (var d1 = 0u; d1 < inputDepthNearestVec4; d1 += 4) { + ${o?`let xValues = vec4( + getX(batch, xF, xR, xC, d1), + getX(batch, xF, xR, xC, d1 + 1), + getX(batch, xF, xR, xC, d1 + 2), + getX(batch, xF, xR, xC, d1 + 3)); + `:`let xValues = vec4( + getX(batch, d1, xF, xR, xC), + getX(batch, d1 + 1, xF, xR, xC), + getX(batch, d1 + 2, xF, xR, xC), + getX(batch, d1 + 3, xF, xR, xC)); + `} + let wValues = vec4( + getW(d2, d1, wF, wR, wC), + getW(d2, d1 + 1, wF, wR, wC), + getW(d2, d1 + 2, wF, wR, wC), + getW(d2, d1 + 3, wF, wR, wC)); + value += dot(xValues, wValues); + } + if (inputDepthVec4Remainder == 1) { + ${o?`value += getX(batch, xF, xR, xC, inputDepthNearestVec4) + * getW(d2, inputDepthNearestVec4, wF, wR, wC);`:`value += getX(batch, inputDepthNearestVec4, xF, xR, xC) + * getW(d2, inputDepthNearestVec4, wF, wR, wC);`} + } else if (inputDepthVec4Remainder == 2) { + ${o?`let xValues = vec2( + getX(batch, xF, xR, xC, inputDepthNearestVec4), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)); + `:`let xValues = vec2( + getX(batch, inputDepthNearestVec4, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC)); + `} + let wValues = vec2( + getW(d2, inputDepthNearestVec4, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC)); + value += dot(xValues, wValues); + } else if (inputDepthVec4Remainder == 3) { + ${o?`let xValues = vec3( + getX(batch, xF, xR, xC, inputDepthNearestVec4), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)); + `:`let xValues = vec3( + getX(batch, inputDepthNearestVec4, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 2, xF, xR, xC)); + `} + let wValues = vec3( + getW(d2, inputDepthNearestVec4, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 2, wF, wR, wC)); + value += dot(xValues, wValues); + } + } + } + } + ${g?`value = value + getBiasByOutputCoords(coords)`:``}; + ${y} + result[global_idx] = f32(value); + }`};return{name:`Conv3DNaive`,shaderCache:{hint:`${t.cacheKey};${o};${f};${g}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:d[0],y:d[1],z:d[2]},programUniforms:m}),getShaderSource:_}}}),Io,Lo,Ro=M(()=>{"use strict";H(),G(),X(),ao(),Io=(e,t,n,r)=>{let i=e.length>2,a=i?`value += b[output_channel];`:``,o=e[0].dims,s=e[1].dims,c=t.format===`NHWC`,l=c?n[3]:n[1],u=l/t.group,d=c&&u>=4?nr(l):1,f=W.size(n)/d,p=[{type:12,data:f},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:u}];no(t,p),p.push(...K(o,[s[0],s[1],s[2],s[3]/d]));let m=i?[`rank`,`rank`,`rank`]:[`rank`,`rank`];p.push(...K([n[0],n[1],n[2],n[3]/d]));let h=r=>{let l=Y(`output`,e[0].dataType,n.length,d),u=er(l.type.tensor),f=to(t,l.type.value,u),p=J(`x`,e[0].dataType,o.length),m=J(`w`,e[1].dataType,s.length,d),h=[p,m];i&&h.push(J(`b`,e[2].dataType,e[2].dims,d));let g=[{name:`output_size`,type:`u32`},{name:`dilations`,type:`u32`,length:t.dilations.length},{name:`strides`,type:`u32`,length:2},{name:`pads`,type:`u32`,length:2},{name:`output_channels_per_group`,type:`u32`}];ro(t,g);let _=c?` + for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) { + let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; + + if (xHeight < 0u || xHeight >= uniforms.x_shape[1]) { + continue; + } + + for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[1]; wWidth++) { + let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; + if (xWidth < 0u || xWidth >= uniforms.x_shape[2]) { + continue; + } + + for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[2]; wInChannel++) { + let input_channel = in_channel_offset + wInChannel; + let xVal = ${p.get(`batch`,`xHeight`,`xWidth`,`input_channel`)}; + let wVal = ${m.get(`wHeight`,`wWidth`,`wInChannel`,`output_channel`)}; + value += xVal * wVal; + } + } + } + `:` + for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) { + let input_channel = in_channel_offset + wInChannel; + for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) { + let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; + + if (xHeight < 0u || xHeight >= uniforms.x_shape[2]) { + continue; + } + + for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) { + let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; + if (xWidth < 0u || xWidth >= uniforms.x_shape[3]) { + continue; + } + + let xVal = ${p.get(`batch`,`input_channel`,`xHeight`,`xWidth`)}; + let wVal = ${m.get(`output_channel`,`wInChannel`,`wHeight`,`wWidth`)}; + value += xVal * wVal; + } + } + } + `;return` + ${r.registerUniforms(g).declareVariables(...h,l)} + + ${r.mainStart()} + ${r.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let outputIndices = ${l.offsetToIndices(`global_idx`)}; + let batch: u32 = outputIndices[0]; + let output_channel: u32 = outputIndices[${c?3:1}]; + let xRCCorner: vec2 = vec2(outputIndices[${c?1:2}], outputIndices[${c?2:3}]) * uniforms.strides - uniforms.pads; + let group_id: u32 = output_channel * ${d} / uniforms.output_channels_per_group; + var in_channel_offset = group_id * uniforms.w_shape[${c?2:1}]; + + var value: ${l.type.value} = ${l.type.value}(0); + ${_} + ${a} + ${f} + ${l.setByOffset(`global_idx`,`value`)} + }`};return{name:`GroupedConv`,shaderCache:{hint:`${t.cacheKey}_${d}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},Lo=(e,t,n,r)=>{let i=e.length>2,a=nr(n[3]),o=nr(n[2]),s=W.size(n)/a/o,c=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/a],l=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/a],u=[n[0],n[1],n[2],n[3]/a],d=[{type:12,data:s},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];no(t,d),d.push(...K(c,l,u));let f=(o-1)*t.strides[1]+l[1],p=n=>{let r=Y(`output`,e[0].dataType,u.length,a),s=er(r.type.tensor),d=to(t,r.type.value,s),p=J(`x`,e[0].dataType,c.length,a),m=J(`w`,e[1].dataType,l.length,a),h=[p,m];i&&h.push(J(`b`,e[2].dataType,e[2].dims,a));let g=i?`value += b[output_channel];`:``,_=[{name:`output_size`,type:`u32`},{name:`strides`,type:`i32`,length:2},{name:`pads`,type:`i32`,length:2}];return ro(t,_),` + ${n.registerUniforms(_).declareVariables(...h,r)} + ${n.mainStart()} + ${n.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let width0 = uniforms.output_shape[3]; + let output_channel = global_idx % width0; + var index1 = global_idx / width0; + let width1 = uniforms.output_shape[2] / ${o}u; + let col = (index1 % width1) * ${o}u; + index1 = index1 / width1; + let row = index1 % uniforms.output_shape[1]; + let batch = index1 / uniforms.output_shape[1]; + + let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads; + + var x_vals: array<${p.type.value}, ${f}>; + var values: array<${r.type.value}, ${o}>; + let input_channel = output_channel; + // Use constant instead of uniform can give better performance for w's height/width. + for (var w_height: u32 = 0u; w_height < ${l[0]}; w_height++) { + let x_height = x_corner.x + i32(w_height); + if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) { + for (var i = 0; i < ${f}; i++) { + let x_width = x_corner.y + i; + if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) { + x_vals[i] = ${p.get(`batch`,`u32(x_height)`,`u32(x_width)`,`input_channel`)}; + } else { + x_vals[i] = ${p.type.value}(0); + } + } + for (var w_width: u32 = 0u; w_width < ${l[1]}; w_width++) { + let w_val = ${m.get(`w_height`,`w_width`,`0`,`output_channel`)}; + for (var i = 0u; i < ${o}u; i++) { + values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]); + } + } + } + } + + for (var i = 0u; i < ${o}u; i++) { + var value = values[i]; + ${g} + ${d} + ${r.set(`batch`,`row`,`col + i`,`output_channel`,`value`)}; + } + }`};return{name:`GroupedConv-Vectorize`,shaderCache:{hint:`${t.cacheKey};${a};${o};${f};${l[0]};${l[1]}`,inputDependencies:i?[`rank`,`rank`,`type`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:d}),getShaderSource:p}}}),zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo=M(()=>{"use strict";G(),Eo(),Fo(),Co(),Ro(),ao(),mo(),yr(),zo=(e,t,n,r,i,a)=>{let o=e[0],s=e.slice(a?1:2,a?3:4),c=s.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),d=s.map((e,t)=>e+r[t]+r[t+c]).map((e,t)=>Math.floor((e-u[t]+i[t])/i[t]));return d.splice(0,0,o),d.splice(a?3:1,0,l),d},Bo=[2,3,1,0],Vo=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length>5)throw Error(`greater than 5D is not supported`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[1]*t.group;if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw Error(`invalid bias`);let i=e[0].dims.length-2;if(t.dilations.length!==i)throw Error(`dilations should be ${i}D`);if(t.strides.length!==i)throw Error(`strides should be ${i}D`);if(t.pads.length!==i*2)throw Error(`pads should be ${i*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`)},Ho=(e,t)=>{let n=e.kernelShape.slice();n.length{let t=io(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],i=e.dilations,a=e.group,o=e.kernel_shape,s=e.pads,c=e.strides,l=e.w_is_const();return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},Wo=(e,t,n,r)=>{let i=n.format===`NHWC`,a=zo(t[0].dims,t[1].dims,n.dilations,n.pads,n.strides,i);if(n.group!==1){let o=[t[0]];if(i){let r=e.kernelCustomData.wT??e.compute(gr(t[1],Bo),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),o.push(r)}else o.push(t[1]);t.length===3&&o.push(t[2]),!e.adapterInfo.isArchitecture(`ampere`)&&i&&t[1].dims[0]===n.group&&t[1].dims[1]===1&&n.dilations[0]===1&&n.dilations[1]===1?e.compute(Lo(o,n,a,r),{inputs:o}):e.compute(Io(o,n,a,r),{inputs:o});return}let o=t.length===3,s=t[0].dims[i?1:2],c=t[0].dims[i?2:3],l=t[0].dims[i?3:1],u=t[1].dims[2],d=t[1].dims[3],f=a[i?1:2],p=a[i?2:3],m=a[i?3:1],h=i&&u===s&&d===c&&n.pads[0]===0&&n.pads[1]===0;if(h||u===1&&d===1&&n.dilations[0]===1&&n.dilations[1]===1&&n.strides[0]===1&&n.strides[1]===1&&n.pads[0]===0&&n.pads[1]===0){let u=a[0],d,g,_,v=[];if(i){let r=e.kernelCustomData.wT??e.compute(gr(t[1],Bo),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];if(n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),h){let e=s*c*l;d=t[0].reshape([1,u,e]),g=r.reshape([1,e,m]),_=[1,u,m]}else d=t[0].reshape([u,s*c,l]),g=r.reshape([1,l,m]),_=[u,f*p,m];v.push(d),v.push(g)}else d=t[0].reshape([u,l,s*c]),g=t[1].reshape([1,m,l]),_=[u,m,f*p],v.push(g),v.push(d);o&&v.push(t[2]);let y=_[2],b=v[0].dims[v[0].dims.length-1];y<8&&b<8?e.compute(po(v,n,a,_,i,r),{inputs:v}):e.compute(So(v,n,a,_,i,r),{inputs:v});return}let g=!0,_=e.kernelCustomData.wT??e.compute(gr(t[1],Bo),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=_);let v=[t[0],_];o&&v.push(t[2]);let y=i?f*p:m,b=i?m:f*p,x=u*d*l;e.compute(To(v,n,a,y,b,x,o,g,r),{inputs:v})},Go=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=[0,t.pads[0],0,t.pads[1]],a=[1].concat(t.strides),o=[1].concat(t.dilations),s=[1].concat(t.kernelShape),c=Ho({...t,pads:i,strides:a,dilations:o,kernelShape:s},r);Wo(e,r,c,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},Ko=(e,t,n)=>{let r=n.format===`NHWC`?`channelsLast`:`channelsFirst`,i=Ho(n,t),a=n.autoPad===`NOTSET`?n.pads:n.autoPad,o=No(t[0].dims,t[1].dims,n.strides,n.dilations,a,!1,r);e.compute(Po(t,i,o.outShape,[o.filterDepth,o.filterHeight,o.filterWidth],[o.padInfo.front,o.padInfo.top,o.padInfo.left],r))},qo=(e,t)=>{if(Vo(e.inputs,t),e.inputs[0].dims.length===3)Go(e,t);else if(e.inputs[0].dims.length===5)Ko(e,e.inputs,t);else{let n=Ho(t,e.inputs);Wo(e,e.inputs,n)}}}),Yo,Xo=M(()=>{"use strict";H(),mn(),G(),X(),Yo=(e,t,n)=>{let r=e.length>2,i=t.outputShape,a=t.format===`NHWC`,o=t.group,s=e[1].dims,c=s[2]/o,l=s[3],u=a?nr(c):1,d=a&&l===1&&c>=4,f=d?Math.floor(c/4)*4:Math.floor(c/u)*u,p=c-f,m=a?nr(l):1,h=a?l===1?u:m:1,g=W.size(i)/m,_=[Math.ceil(g/64),1,1];U(`verbose`,()=>`[conv2d_backprop_webgpu] dispatch = ${_}`);let v=[`rank`,`rank`],y=[t.strides[0],t.strides[1]],b=[t.kernelShape[a?1:2],t.kernelShape[a?2:3]],x=[t.dilations[0],t.dilations[1]],S=[b[0]+(t.dilations[0]<=1?0:(t.kernelShape[a?1:2]-1)*(t.dilations[0]-1)),b[1]+(t.dilations[1]<=1?0:(t.kernelShape[a?2:3]-1)*(t.dilations[1]-1))],C=[S[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),S[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],w=[{type:12,data:g},{type:12,data:y},{type:12,data:b},{type:12,data:x},{type:12,data:S},{type:6,data:C},{type:12,data:f},{type:12,data:c},{type:12,data:l},...K(e[0].dims,e[1].dims)];r&&(w.push(...K(e[2].dims)),v.push(`rank`)),w.push(...K(i));let T=t=>{let n=[{name:`output_size`,type:`u32`},{name:`strides`,type:`u32`,length:y.length},{name:`filter_dims`,type:`u32`,length:b.length},{name:`dilations`,type:`u32`,length:b.length},{name:`effective_filter_dims`,type:`u32`,length:S.length},{name:`pads`,type:`i32`,length:C.length},{name:`input_channels_per_group_int`,type:`u32`},{name:`input_channels_per_group`,type:`u32`},{name:`output_channels_per_group`,type:`u32`}],o=er(e[0].dataType),s=a?1:2,c=a?2:3,l=a?3:1,f=J(`W`,e[1].dataType,e[1].dims.length,h),g=J(`Dy`,e[0].dataType,e[0].dims.length,u),_=[g,f];r&&_.push(J(`bias`,e[2].dataType,[i[l]].length,m));let v=Y(`result`,e[0].dataType,i.length,m),x=()=>{let e=``;if(d)u===4?e+=` + let xValue = ${g.getByOffset(`x_offset`)}; + let wValue = ${f.getByOffset(`w_offset`)}; + dotProd = dotProd + dot(xValue, wValue); + x_offset += 1u; + w_offset += 1u;`:u===2?e+=` + dotProd = dotProd + dot(vec4<${o}>(${g.getByOffset(`x_offset`)}, ${g.getByOffset(`x_offset + 1u`)}), vec4<${o}>(${f.getByOffset(`w_offset`)}, ${f.getByOffset(`w_offset + 1u`)})); + x_offset += 2u; + w_offset += 2u;`:u===1&&(e+=` + dotProd = dotProd + dot(vec4<${o}>(${g.getByOffset(`x_offset`)}, ${g.getByOffset(`x_offset + 1u`)}, ${g.getByOffset(`x_offset + 2u`)}, ${g.getByOffset(`x_offset + 3u`)}), vec4<${o}>(${f.getByOffset(`w_offset`)}, ${f.getByOffset(`w_offset + 1u`)}, ${f.getByOffset(`w_offset + 2u`)}, ${f.getByOffset(`w_offset + 3u`)})); + x_offset += 4u; + w_offset += 4u;`);else if(e+=` + let xValue = ${a?g.getByOffset(`${g.indicesToOffset(`${g.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${u}`):g.get(`batch`,`inputChannel`,`idyR`,`idyC`)}; + `,u===1)e+=` + let w_offset = ${f.indicesToOffset(`${f.type.indices}(u32(wRPerm), u32(wCPerm), inputChannel, wOutChannel)`)}; + let wValue = ${f.getByOffset(`w_offset / ${h}`)}; + dotProd = dotProd + xValue * wValue;`;else for(let t=0;t{if(p===0)return``;if(!d)throw Error(`packInputAs4 ${d} is not true.`);let e=``;if(u===1){e+=`dotProd = dotProd`;for(let t=0;t(i32(r), i32(c)) - uniforms.pads; + let dyRCorner = dyCorner.x; + let dyCCorner = dyCorner.y; + let groupId = d1 / uniforms.output_channels_per_group; + let wOutChannel = d1 - groupId * uniforms.output_channels_per_group; + // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). + // ? = to be determined. : = across all values in that axis. + var dotProd = ${v.type.value}(0.0); + var wR: u32 = 0; + if (uniforms.dilations.x == 1) { + // Minimum wR >= 0 that satisfies (dyRCorner + wR) % (uniforms.strides.x) == 0 + wR = u32(((dyRCorner + i32(uniforms.strides.x) - 1) / i32(uniforms.strides.x)) * i32(uniforms.strides.x) - dyRCorner); + } + for (; wR < uniforms.effective_filter_dims.x; wR = wR + 1) { + if (wR % uniforms.dilations.x != 0) { + continue; + } + let dyR = (${o}(dyRCorner) + ${o}(wR)) / ${o}(uniforms.strides[0]); + let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x; + if (dyR < 0.0 || dyR >= ${o}(uniforms.Dy_shape[${s}]) || fract(dyR) > 0.0 || + wRPerm < 0) { + continue; + } + let idyR: u32 = u32(dyR); + var wC: u32 = 0; + if (uniforms.dilations.y == 1) { + // Minimum wC >= 0 that satisfies (dyCCorner + wC) % (uniforms.strides.y) == 0 + wC = u32(((dyCCorner + i32(uniforms.strides.y) - 1) / i32(uniforms.strides.y)) * i32(uniforms.strides.y) - dyCCorner); + } + for (; wC < uniforms.effective_filter_dims.y; wC = wC + 1) { + if (wC % uniforms.dilations.y != 0) { + continue; + } + let dyC = (${o}(dyCCorner) + ${o}(wC)) / ${o}(uniforms.strides.y); + let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y; + if (dyC < 0.0 || dyC >= ${o}(uniforms.Dy_shape[${c}]) || + fract(dyC) > 0.0 || wCPerm < 0) { + continue; + } + let idyC: u32 = u32(dyC); + var inputChannel = groupId * uniforms.input_channels_per_group; + ${d?` + var x_offset = ${g.indicesToOffset(`${g.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${u}; + var w_offset = ${f.indicesToOffset(`${f.type.indices}(wRPerm, wCPerm, inputChannel, wOutChannel)`)} / ${h}; + `:``} + for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group_int; d2 = d2 + ${d?4:u}) { + ${x()} + inputChannel = inputChannel + ${d?4:u}; + } + ${w()} + wC = wC + uniforms.strides.y - 1; + } + wR = wR + uniforms.strides[0] - 1; + } + let value = dotProd${r?` + bias[d1 / ${m}]`:``}; + ${v.setByOffset(`global_idx`,`value`)}; + `;return` + ${t.registerUniforms(n).declareVariables(..._,v)} + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)}; + ${T}}`};return{name:`ConvTranspose2D`,shaderCache:{hint:`${t.cacheKey};${u}${h}${m}${d}${p}`,inputDependencies:v},getRunData:()=>({dispatchGroup:{x:_[0],y:_[1],z:_[2]},outputs:[{dims:n?n(i):i,dataType:e[0].dataType}],programUniforms:w}),getShaderSource:T}}}),Zo,Qo,$o,es,ts,ns,rs,os,ss,cs=M(()=>{"use strict";Xo(),ao(),yr(),Zo=(e,t,n,r,i,a)=>(e-1)*t+n+(r-1)*i+1-a,Qo=(e,t,n,r,i)=>{let a=Math.floor(e/2);t===`SAME_UPPER`?(n[r]=a,n[i]=e-a):t===`SAME_LOWER`&&(n[r]=e-a,n[i]=a)},$o=(e,t,n,r,i,a,o,s,c,l)=>{let u=e.length-2,d=l.length===0;c.length{let n=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((e,t)=>e*t,1)===0){n.length=0;for(let e=2;ee+t,0)===0){let e=t[0].dims.length-2;c=Array(e).fill(1)}let l=e.strides.slice();if(l.reduce((e,t)=>e+t,0)===0){let e=t[0].dims.length-2;l=Array(e).fill(1)}$o(s,n,c,e.autoPad,e.group,i,l,r,o,a);let u=Object.assign({},e);return Object.assign(u,{kernelShape:n,pads:i,outputPadding:o,outputShape:a,dilations:c,strides:l}),u},ts=e=>{let t=io(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][typeof e.autoPad>`u`?0:e.autoPad],i=e.dilations,a=e.group,o=e.kernelShape,s=e.pads,c=e.strides,l=e.wIsConst(),u=e.outputPadding,d=e.outputShape;return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,outputPadding:u,outputShape:d,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},ns=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length!==4&&e[0].dims.length!==3)throw Error(`currently only support 2-dimensional conv`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);let n=e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1],r=e[1].dims[0];if(n!==r)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);let i=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==i))throw Error(`invalid bias`);let a=e[0].dims.length-2;if(t.dilations.reduce((e,t)=>e+t,0)>0&&t.dilations.length!==a)throw Error(`dilations should be ${a}D`);if(t.strides.reduce((e,t)=>e+t,0)>0&&t.strides.length!==a)throw Error(`strides should be ${a}D`);if(t.pads.reduce((e,t)=>e+t,0)>0&&t.pads.length!==a*2)throw Error(`pads should be ${a*2}D`);if(t.outputPadding.length!==a&&t.outputPadding.length!==0)throw Error(`output_padding should be ${a}D`);if(t.kernelShape.reduce((e,t)=>e+t,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`);if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw Error(`invalid output shape`)},rs=(e,t,n,r)=>{let i=e.kernelCustomData.wT??e.compute(gr(t[1],[2,3,0,1]),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=i);let a=[t[0],i];t.length===3&&a.push(t[2]),e.compute(Yo(a,n,r),{inputs:a})},os=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=t.kernelShape;(i.length===0||i[0]===0)&&(i=[e.inputs[1].dims[2]]);let a=t.dilations;(a.length===0||a[0]===0)&&(a=[1]);let o=t.strides;(o.length===0||o[0]===0)&&(o=[1]);let s=t.pads;s.length===0&&(s=[0,0]),s=[0,s[0],0,s[1]],o=[1].concat(o),a=[1].concat(a),i=[1].concat(i);let c=t.outputPadding;c=[0].concat(c);let l=es({...t,pads:s,strides:o,dilations:a,kernelShape:i,outputPadding:c},r);rs(e,r,l,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},ss=(e,t)=>{if(ns(e.inputs,t),e.inputs[0].dims.length===3)os(e,t);else{let n=es(t,e.inputs);rs(e,e.inputs,n)}}}),ls,us,ds,fs=M(()=>{"use strict";H(),G(),Zn(),X(),ls=(e,t,n,r)=>{let i=W.size(t),a=t.length,o=J(`input`,e,a),s=Y(`output`,e,a),c=n.dataType===6?n.getInt32Array()[0]:Number(n.getBigInt64Array()[0]),l=W.normalizeAxis(c,a),u=e=>{let t=` i32(${o.indicesGet(`inputIndices`,`uniforms.axis`)}) `,n=q(`uniforms.input_shape`,`uniforms.axis`,a),i=r.reverse?t+(r.exclusive?` + 1`:``):`0`,c=r.reverse?n:t+(r.exclusive?``:` + 1`);return` + ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axis`,`u32`).declareVariables(o,s)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + var inputIndices = ${s.offsetToIndices(`global_idx`)}; + var sum = ${s.type.value}(0); + let first : i32 = ${i}; + let last : i32 = ${c}; + for (var i : i32 = first; i < last; i++) { + ${o.indicesSet(`inputIndices`,`uniforms.axis`,`u32(i)`)}; + sum = sum + ${o.getByIndices(`inputIndices`)}; + } + ${s.setByOffset(`global_idx`,`sum`)}; + }`};return{name:`CumSum`,shaderCache:{hint:r.cacheKey,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:[{type:12,data:i},{type:12,data:l},...K(t,t)]}),getShaderSource:u}},us=(e,t)=>{let n=e.inputs[0].dims,r=e.inputs[0].dataType,i=e.inputs[1];e.compute(ls(r,n,i,t),{inputs:[0]})},ds=e=>{let t=e.exclusive===1,n=e.reverse===1;return Xn({exclusive:t,reverse:n})}}),ps,ms,hs,gs,_s,vs=M(()=>{"use strict";H(),G(),Zn(),X(),ps=e=>{if(!e||e.length!==1)throw Error(`DepthToSpace requires 1 input.`);if(e[0].dims.length!==4)throw Error(`DepthToSpace requires 4D input.`)},ms=(e,t,n,r)=>{let i=[];i.push(`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + var a: ${n.type.indices};`);for(let r=0;r{let n,r,i,a,o,s,c=t.format===`NHWC`,l=t.blocksize,u=t.mode===`DCR`;c?([n,r,i,a]=e.dims,o=u?[n,r,i,l,l,a/l**2]:[n,r,i,a/l**2,l,l],s=u?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([n,r,i,a]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],o=u?[n,l,l,a/l**2,r,i]:[n,a/l**2,l,l,r,i],s=u?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let d=e.reshape(o),f=d.dims.length,p=e.dataType,m=J(`a`,p,f),h=Y(`output`,p,f),g=e=>` + ${e.registerUniform(`output_size`,`u32`).declareVariables(m,h)} + + ${ms(s,f,m,h)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let indices = ${h.offsetToIndices(`global_idx`)}; + let aIndices = perm(indices); + + ${h.setByOffset(`global_idx`,m.getByIndices(`aIndices`))} + }`;return{name:`DepthToSpace`,shaderCache:{hint:`${e.dims};${t.blocksize};${t.mode}`,inputDependencies:[`rank`]},getRunData:e=>{let t=c?[n,r*l,i*l,a/l**2]:[n,a/l**2,r*l,i*l],o=W.size(t),u=d.dims,f=W.sortBasedOnPerm(u,s);return{outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:[{type:12,data:o},...K(u,f)]}},getShaderSource:g}},gs=(e,t)=>{ps(e.inputs),e.compute(hs(e.inputs[0],t))},_s=e=>Xn({blocksize:e.blocksize,mode:e.mode,format:e.format})}),ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As=M(()=>{"use strict";H(),G(),Zn(),X(),ys=`[a-zA-Z]|\\.\\.\\.`,bs=`(`+ys+`)+`,xs=`^`+bs+`$`,Ss=`(`+bs+`,)*`+bs,Cs=`^`+Ss+`$`,ws=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,t){let n=this.symbolToIndices.get(e);n===void 0?n=[t]:n.push(t),this.symbolToIndices.set(e,n)}},Ts=class{constructor(e,t){var n;this.equation=t,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=[],this.outputDims=[];let[r,i]=t.includes(`->`)?t.split(`->`,2):[t,``];if(!r.match(RegExp(Cs)))throw Error(`Invalid LHS term`);if(r.split(`,`).forEach((t,n)=>{let r=e[n].dims.slice();if(!t.match(RegExp(xs)))throw Error(`Invalid LHS term`);let i=this.processTerm(t,!0,r,n);this.lhs.push(i)}),i===``)i+=[...this.symbolToInfo.entries()].filter(([e,t])=>t.count===1||e===`...`).map(([e])=>e).join(``);else if(!i.match(RegExp(bs)))throw Error(`Invalid RHS`);(n=i.match(RegExp(ys,`g`)))?.forEach(e=>{if(e===`...`)this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let t=this.symbolToInfo.get(e);if(t===void 0)throw Error(`Invalid RHS symbol`);this.outputDims.push(t.dimValue)}}),this.rhs=this.processTerm(i,!1,this.outputDims)}addSymbol(e,t,n){let r=this.symbolToInfo.get(e);if(r!==void 0){if(r.dimValue!==t&&r.count!==1)throw Error(`Dimension mismatch`);r.count++,r.inputIndices.push(n)}else r={count:1,dimValue:t,inputIndices:[n]};this.symbolToInfo.set(e,r)}processTerm(e,t,n,r=-1){let i=n.length,a=!1,o=[],s=0;if(!e.match(RegExp(xs))&&!t&&e!==``)throw Error(`Invalid LHS term`);let c=e.match(RegExp(ys,`g`)),l=new ws(r);return c?.forEach((e,u)=>{if(e===`...`){if(a)throw Error(`Only one ellipsis is allowed per input term`);a=!0;let e=i-c.length+1;if(e<0)throw Error(`Ellipsis out of bounds`);if(o=n.slice(s,s+e),this.hasEllipsis){if(this.ellipsisDims.length!==o.length||this.ellipsisDims.toString()!==o.toString())throw Error(`Ellipsis dimensions mismatch`)}else if(t)this.hasEllipsis=!0,this.ellipsisDims=o;else throw Error(`Ellipsis must be specified in the LHS`);for(let e=0;ee+`_max`,Ds=(e,t,n,r)=>{let i=e.map(e=>e.length).map((e,n)=>J(`input${n}`,t,e)),a=W.size(r),o=Y(`output`,t,r.length),s=[...n.symbolToInfo.keys()].filter(e=>!n.rhs.symbolToIndices.has(e)),c=e=>{let t=[],r=`var prod = 1.0;`,a=`var sum = 0.0;`,c=`sum += prod;`,l=[],u=[],d=[],f=[],p=n.symbolToInfo.size===n.rhs.symbolToIndices.size;n.symbolToInfo.forEach((e,r)=>{if(n.rhs.symbolToIndices.has(r)){var a;let s=(a=n.rhs.symbolToIndices.get(r))?.[0];s!==void 0&&n.lhs.forEach((n,a)=>{if(e.inputIndices.includes(a)){let e=n.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{t.push(`${i[a].indicesSet(`input${a}Indices`,e,o.indicesGet(`outputIndices`,s))}`)})}})}else n.lhs.forEach((t,n)=>{if(e.inputIndices.includes(n)){let e=t.symbolToIndices.get(r);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{l.push(`${i[n].indicesSet(`input${n}Indices`,e,`${r}`)}`)}),f.push(`prod *= ${i[n].getByIndices(`input${n}Indices`)};`)}}),u.push(`for(var ${r}: u32 = 0; ${r} < uniforms.${Es(r)}; ${r}++) {`),d.push(`}`)});let m=p?[...t,`let sum = ${i.map((e,t)=>e.getByIndices(`input${t}Indices`)).join(` * `)};`]:[...t,a,...u,...l,r,...f,c,...d];return` + ${e.registerUniforms(s.map(e=>({name:`${Es(e)}`,type:`u32`}))).registerUniform(`outputSize`,`u32`).declareVariables(...i,o)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + var outputIndices = ${o.offsetToIndices(`global_idx`)}; + ${i.map((e,t)=>`var input${t}Indices: ${i[t].type.indices};`).join(` +`)} + ${m.join(` +`)}; + ${o.setByOffset(`global_idx`,`sum`)}; + }`};return{name:`Einsum`,shaderCache:{hint:n.equation,inputDependencies:e.map(()=>`rank`)},getRunData:()=>{let i=s.filter(e=>n.symbolToInfo.has(e)).map(e=>{var t;return{type:12,data:(t=n.symbolToInfo.get(e))?.dimValue||0}});i.push({type:12,data:a});let o=e.map((e,t)=>[...K(e)]).reduce((e,t)=>e.concat(t),i);return o.push(...K(r)),{outputs:[{dims:r,dataType:t}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:o}},getShaderSource:c}},Os=(e,t)=>{let n=new Ts(e.inputs,t.equation),r=n.outputDims,i=e.inputs.map((e,t)=>e.dims);e.compute(Ds(i,e.inputs[0].dataType,n,r))},ks=e=>{let t=e.equation.replace(/\s+/g,``);return Xn({equation:t})}}),js,Ms,Ns,Ps,Fs,Is=M(()=>{"use strict";H(),G(),X(),js=e=>{if(!e||e.length!==2)throw Error(`Expand requires 2 input.`);let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=n.length{let n=e.length-t.length,r=[];for(let t=0;te.length>t.length?Ms(e,t):Ms(t,e),Ps=e=>{let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=Ns(t,n),i=e[0].dataType,a=i===9||W.size(t)===1,o=i===9||t.length>0&&t[t.length-1]%4==0?4:1,s=a||r.length>0&&r[r.length-1]%4==0?4:1,c=Math.ceil(W.size(r)/s),l=e=>{let n=J(`input`,i,t.length,o),a=Y(`output`,i,r.length,s),c;if(i===9){let e=(e,t,r=``)=>` + let outputIndices${t} = ${a.offsetToIndices(`outputOffset + ${t}u`)}; + let offset${t} = ${n.broadcastedIndicesToOffset(`outputIndices${t}`,a)}; + let index${t} = offset${t} / 4u; + let component${t} = offset${t} % 4u; + ${e}[${t}] = ${r}(${n.getByOffset(`index${t}`)}[component${t}]); + `;c=` + let outputOffset = global_idx * ${s}; + var data = vec4(0); + ${e(`data`,0,`u32`)} + ${e(`data`,1,`u32`)} + ${e(`data`,2,`u32`)} + ${e(`data`,3,`u32`)} + ${a.setByOffset(`global_idx`,`data`)} + }`}else c=` + let outputIndices = ${a.offsetToIndices(`global_idx * ${s}`)}; + let inputOffset = ${n.broadcastedIndicesToOffset(`outputIndices`,a)}; + let data = ${a.type.value}(${n.getByOffset(`inputOffset / ${o}`)}); + ${a.setByOffset(`global_idx`,`data`)} + }`;return` + ${e.registerUniform(`vec_size`,`u32`).declareVariables(n,a)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + ${c}`},u=[{type:12,data:c},...K(t,r)];return{name:`Expand`,shaderCache:{hint:`${r.length};${o}${s}`,inputDependencies:[`rank`]},getShaderSource:l,getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:u})}},Fs=e=>{js(e.inputs),e.compute(Ps(e.inputs),{inputs:[0]})}}),Ls,Rs,zs=M(()=>{"use strict";H(),G(),X(),ka(),Ls=e=>{let t=e[0].dataType,n=W.size(e[0].dims),r=W.size(e[1].dims),i=r%4==0,a=e=>{let n=J(`x`,t,[1],4),r=J(`bias`,t,[1],4),a=Y(`y`,t,[1],4),o=[{name:`output_vec_size`,type:`u32`},{name:`bias_size`,type:`u32`}],s=e=>` + let bias${e}_offset: u32 = (global_idx * 4 + ${e}) % uniforms.bias_size; + let bias${e} = ${r.getByOffset(`bias${e}_offset / 4`)}[bias${e}_offset % 4];`,c=i?` + let bias = ${r.getByOffset(`global_idx % (uniforms.bias_size / 4)`)};`:`${s(0)}${s(1)}${s(2)}${s(3)} + let bias = ${n.type.value}(bias0, bias1, bias2, bias3);`;return`${e.registerUniforms(o).declareVariables(n,r,a)} + + ${xa(tr(t))} + + ${e.mainStart(Qn)} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_vec_size`)} + + let x = ${n.getByOffset(`global_idx`)}; + ${c} + let x_in = x + bias; + ${a.setByOffset(`global_idx`,Sa(`x_in`))} + }`};return{name:`FastGeluWithBias`,shaderCache:{hint:`${i}`,inputDependencies:[`type`,`type`]},getShaderSource:a,getRunData:e=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],programUniforms:[{type:12,data:Math.ceil(n/4)},{type:12,data:r}],dispatchGroup:{x:Math.ceil(n/Qn/4)}})}},Rs=e=>{e.inputs.length<2||W.size(e.inputs[1].dims)===0?Ca(e):e.compute(Ls(e.inputs))}}),Bs,Vs,Hs,Us,Ws=M(()=>{"use strict";H(),G(),Zn(),X(),Bs=e=>{if(!e||e.length!==2)throw Error(`Gather requires 2 inputs.`)},Vs=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=W.normalizeAxis(t.axis,i),o=n.slice(0);o.splice(a,1,...r);let s=n[a],c=e[0].dataType===9?4:1,l=Math.ceil(W.size(o)/c),u=[{type:12,data:l},{type:6,data:s},{type:12,data:a},...K(e[0].dims,e[1].dims,o)],d=t=>{let n=J(`data`,e[0].dataType,e[0].dims.length,c),s=J(`inputIndices`,e[1].dataType,e[1].dims.length),l=Y(`output`,e[0].dataType,o.length,c),u=e=>{let t=r.length,c=`var indicesIndices${e} = ${s.type.indices}(0);`;for(let n=0;n1?`indicesIndices${e}[${n}]`:`indicesIndices${e}`} = ${o.length>1?`outputIndices${e}[uniforms.axis + ${n}]`:`outputIndices${e}`};`;c+=` + var idx${e} = ${s.getByIndices(`indicesIndices${e}`)}; + if (idx${e} < 0) { + idx${e} = idx${e} + uniforms.axisDimLimit; + } + var dataIndices${e} : ${n.type.indices}; + `;for(let n=0,r=0;n1?`dataIndices${e}[${n}]`:`dataIndices${e}`} = u32(idx${e});`,r+=t):(c+=`${i>1?`dataIndices${e}[${n}]`:`dataIndices${e}`} = ${o.length>1?`outputIndices${e}[${r}]`:`outputIndices${e}`};`,r++);return c},d;if(e[0].dataType===9){let e=(e,t,r=``)=>` + let outputIndices${t} = ${l.offsetToIndices(`outputOffset + ${t}u`)}; + ${u(t)}; + let offset${t} = ${n.indicesToOffset(`dataIndices${t}`)}; + let index${t} = offset${t} / 4u; + let component${t} = offset${t} % 4u; + ${e}[${t}] = ${r}(${n.getByOffset(`index${t}`)}[component${t}]); + `;d=` + let outputOffset = global_idx * ${c}; + var value = vec4(0); + ${e(`value`,0,`u32`)} + ${e(`value`,1,`u32`)} + ${e(`value`,2,`u32`)} + ${e(`value`,3,`u32`)} + ${l.setByOffset(`global_idx`,`value`)} + `}else d=` + let outputIndices = ${l.offsetToIndices(`global_idx`)}; + ${u(``)}; + let value = ${n.getByIndices(`dataIndices`)}; + ${l.setByOffset(`global_idx`,`value`)}; + `;return` + ${t.registerUniform(`outputSize`,`u32`).registerUniform(`axisDimLimit`,`i32`).registerUniform(`axis`,`u32`).declareVariables(n,s,l)} + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + ${d} + }`};return{name:`Gather`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:d}},Hs=e=>Xn({axis:e.axis}),Us=(e,t)=>{let n=e.inputs;Bs(n),e.compute(Vs(e.inputs,t))}}),Gs,Ks,qs,Js=M(()=>{"use strict";H(),G(),X(),Gs=(e,t,n,r,i,a,o,s,c)=>{let l=[{type:12,data:a},{type:12,data:r},{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:12,data:s},{type:12,data:c}],u=[a];l.push(...K(t.dims,u));let d=e=>{let r=J(`indices_data`,t.dataType,t.dims.length),a=Y(`input_slice_offsets_data`,12,1,1),o=[r,a],s=[{name:`output_size`,type:`u32`},{name:`batch_dims`,type:`u32`},{name:`input_dims`,type:`u32`,length:i.length},{name:`sizes_from_slice_dims_data`,type:`u32`,length:n.length},{name:`num_slices_per_batch`,type:`u32`},{name:`input_batch_stride`,type:`u32`},{name:`num_slice_dims`,type:`u32`}];return` + ${e.registerUniforms(s).declareVariables(...o)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let batch_idx = global_idx / uniforms.num_slices_per_batch; + let base_offset = batch_idx * uniforms.input_batch_stride; + + let slice_indices_base_offset = global_idx * uniforms.num_slice_dims; + var relative_slice_offset = 0; + for (var dim_idx = 0u; dim_idx < uniforms.num_slice_dims; dim_idx ++) { + var index = i32(indices_data[dim_idx + slice_indices_base_offset].x); + let input_dim_idx = uniforms.batch_dims + dim_idx; + if (index < 0) { + ${i.length===1?`index += i32(uniforms.input_dims);`:`index += i32(uniforms.input_dims[input_dim_idx]);`} + } + ${n.length===1?`relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data);`:`relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data[dim_idx]);`} + } + + input_slice_offsets_data[global_idx] = base_offset + u32(relative_slice_offset); + }`};return e.compute({name:`computeSliceOffsets`,shaderCache:{hint:`${i.length}_${n.length}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:u,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:d},{inputs:[t],outputs:[-1]})[0]},Ks=(e,t)=>{let n=e.inputs,r=n[0].dims,i=n[0].dataType,a=n[1].dims,o=a[a.length-1],s=W.sizeToDimension(a,a.length-1),c=W.sizeFromDimension(r,t.batchDims+o),l=W.sizeToDimension(r,t.batchDims),u=W.sizeFromDimension(r,t.batchDims),d=s/l,f=Array(o),p=c;for(let e=0;er.length)throw Error(`last dimension of indices must not be larger than rank of input tensor`);let g=a.slice(0,-1).concat(r.slice(h)),_=W.size(g),v=[{type:12,data:_},{type:12,data:c},...K(n[0].dims,m.dims,g)],y=e=>{let t=J(`data`,n[0].dataType,n[0].dims.length),r=J(`slice_offsets`,12,m.dims.length),i=Y(`output`,n[0].dataType,g.length);return` + ${e.registerUniform(`output_size`,`u32`).registerUniform(`slice_size`,`u32`).declareVariables(t,r,i)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let slice_offset = slice_offsets[global_idx / uniforms.slice_size]; + output[global_idx] = data[u32(slice_offset) + global_idx % uniforms.slice_size]; + }`};e.compute({name:`GatherND`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:g,dataType:i}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:v}),getShaderSource:y},{inputs:[n[0],m]})},qs=e=>({batchDims:e.batch_dims,cacheKey:``})}),Ys,Xs,Zs,Qs,$s=M(()=>{"use strict";H(),G(),Zn(),X(),Ys=(e,t)=>{if(e.length<3||e.length>4)throw Error(`GatherBlockQuantized requires 3 or 4 inputs.`);let n=W.normalizeAxis(t.quantizeAxis,e[0].dims.length),r=t.blockSize,i=e[0],a=e[2],o=e.length===4?e[3]:void 0;if(a.dims.length!==i.dims.length||!i.dims.map((e,t)=>t===n?Math.ceil(e/r)===a.dims[t]:e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.`);if(o){if(o.dataType!==i.dataType)throw Error(`Zero point must have the same data type as the input tensor.`);if(o.dims.length!==a.dims.length||!o.dims.map((e,t)=>e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.`)}},Xs=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=W.normalizeAxis(t.gatherAxis,i),o=W.normalizeAxis(t.quantizeAxis,i),s=n.slice(0);s.splice(a,1,...r);let c=W.size(s),l=e[2].dataType,u=e[0].dataType===22,d=[{type:12,data:c},{type:12,data:o},{type:12,data:a},{type:12,data:t.blockSize},...K(...e.map((e,t)=>e.dims),s)],f=t=>{let i=J(`data`,e[0].dataType,e[0].dims.length),o=J(`inputIndices`,e[1].dataType,e[1].dims.length),c=J(`scales`,e[2].dataType,e[2].dims.length),d=e.length>3?J(`zeroPoint`,e[3].dataType,e[3].dims.length):void 0,f=Y(`output`,l,s.length),p=[i,o,c];d&&p.push(d);let m=[{name:`output_size`,type:`u32`},{name:`quantize_axis`,type:`u32`},{name:`gather_axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` + ${t.registerUniforms(m).declareVariables(...p,f)} + ${t.mainStart()} + let output_indices = ${f.offsetToIndices(`global_idx`)}; + var indices_indices = ${o.type.indices}(0); + ${r.length>1?` + for (var i: u32 = 0; i < ${r.length}; i++) { + let index = ${f.indicesGet(`output_indices`,`uniforms.gather_axis + i`)}; + ${o.indicesSet(`indices_indices`,`i`,`index`)}; + }`:`indices_indices = ${f.indicesGet(`output_indices`,`uniforms.gather_axis`)};`}; + var data_indices = ${i.type.indices}(0); + for (var i: u32 = 0; i < uniforms.gather_axis; i++) { + let index = ${f.indicesGet(`output_indices`,`i`)}; + ${i.indicesSet(`data_indices`,`i`,`index`)}; + } + var index_from_indices = ${o.getByIndices(`indices_indices`)}; + if (index_from_indices < 0) { + index_from_indices += ${n[a]}; + } + ${i.indicesSet(`data_indices`,`uniforms.gather_axis`,`u32(index_from_indices)`)}; + for (var i = uniforms.gather_axis + 1; i < ${s.length}; i++) { + let index = ${f.indicesGet(`output_indices`,`i + ${r.length} - 1`)}; + ${i.indicesSet(`data_indices`,`i`,`index`)}; + } + let data_offset = ${i.indicesToOffset(`data_indices`)}; + let data_index = data_offset % 8; + // Convert 4-bit packed data to 8-bit packed data. + let packed_4bit_quantized_data = ${i.getByOffset(`data_offset / 8`)}; + let packed_8bit_quantized_data = (packed_4bit_quantized_data >> (4 * (data_index % 2))) & 0x0f0f0f0f; + let quantized_data_vec = ${u?`unpack4xI8`:`unpack4xU8`}(u32(packed_8bit_quantized_data)); + let quantized_data = quantized_data_vec[data_index / 2]; + var scale_indices = data_indices; + let quantize_axis_index = ${c.indicesGet(`data_indices`,`uniforms.quantize_axis`)} / uniforms.block_size; + ${c.indicesSet(`scale_indices`,`uniforms.quantize_axis`,`quantize_axis_index`)}; + var scale = ${c.getByIndices(`scale_indices`)}; + ${d?` + let zero_point_indices = scale_indices; + let zero_point_offset = ${d.indicesToOffset(`zero_point_indices`)}; + let zero_point_index = zero_point_offset % 8; + let packed_4bit_zero_points = ${d.getByOffset(`zero_point_offset / 8`)}; + let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f; + let zero_point_vec = ${u?`unpack4xI8`:`unpack4xU8`}(u32(packed_8bit_zero_points)); + let zero_point = zero_point_vec[zero_point_index / 2];`:`var zero_point = 0`}; + let dequantized_data = ${tr(l)}(quantized_data - zero_point) * scale; + ${f.setByOffset(`global_idx`,`dequantized_data`)}; + }`};return{name:`GatherBlockQuantized`,shaderCache:{hint:`${t.cacheKey};${e.filter((e,t)=>t!==1).map(e=>e.dims.join(`_`)).join(`;`)}`,inputDependencies:Array.from({length:e.length},(e,t)=>`rank`)},getRunData:()=>({outputs:[{dims:s,dataType:l}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:d}),getShaderSource:f}},Zs=(e,t)=>{let n=e.inputs;Ys(n,t),e.compute(Xs(e.inputs,t))},Qs=e=>Xn({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),ec,tc,nc,rc,ic=M(()=>{"use strict";H(),G(),Zn(),X(),ec=e=>{if(!e||e.length!==2)throw Error(`GatherElements requires 2 inputs.`);if(e[0].dims.length<1)throw Error(`GatherElements requires that the data input be rank >= 1.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`GatherElements requires that the data input and + indices input tensors be of same rank.`)},tc=(e,t)=>{let n=e[0].dims,r=e[0].dataType,i=n.length,a=e[1].dims,o=e[1].dataType,s=W.normalizeAxis(t.axis,i),c=n[s],l=a.slice(0),u=W.size(l),d=J(`input`,r,i),f=J(`indicesInput`,o,a.length),p=Y(`output`,r,l.length),m=[{type:12,data:u},{type:6,data:c},{type:12,data:s}];return m.push(...K(n,a,l)),{name:`GatherElements`,shaderCache:{inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:m}),getShaderSource:e=>` + ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axisDimLimit`,`i32`).registerUniform(`axis`,`u32`).declareVariables(d,f,p)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + + let outputIndices = ${p.offsetToIndices(`global_idx`)}; + + var idx = ${f.getByOffset(`global_idx`)}; + if (idx < 0) { + idx = idx + uniforms.axisDimLimit; + } + var inputIndices = ${d.type.indices}(outputIndices); + ${d.indicesSet(`inputIndices`,`uniforms.axis`,`u32(idx)`)}; + let value = ${d.getByIndices(`inputIndices`)}; + + ${p.setByOffset(`global_idx`,`value`)}; + }`}},nc=e=>Xn({axis:e.axis}),rc=(e,t)=>{let n=e.inputs;ec(n),e.compute(tc(e.inputs,t))}}),ac,oc,sc,cc,lc=M(()=>{"use strict";H(),G(),X(),ac=e=>{if(!e)throw Error(`Input is missing`);if(e.length<2||e.length>3)throw Error(`Invaid input number.`);if(e.length===3&&e[2].dims.length>2)throw Error(`Invalid input shape of C`);if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`Input types are mismatched`)},oc=(e,t)=>{let n=e[0].dims.slice(),r=e[1].dims.slice(),[i,a,o]=vn.getShapeOfGemmResult(n,t.transA,r,t.transB,e.length===3?e[2].dims:void 0),s=[i,a];if(!s)throw Error(`Can't use gemm on the given tensors`);let c=16,l=Math.ceil(a/c),u=Math.ceil(i/c),d=!0,f=W.size(s),p=[{type:12,data:d?l:f},{type:12,data:i},{type:12,data:a},{type:12,data:o},{type:1,data:t.alpha},{type:1,data:t.beta}],m=[`type`,`type`];e.length===3&&(p.push(...K(e[2].dims)),m.push(`rank`)),p.push(...K(s));let h=n=>{let r=``;t.transA&&t.transB?r=`value += a[k * uniforms.M + m] * b[n * uniforms.K + k];`:t.transA&&!t.transB?r=`value += a[k * uniforms.M + m] * b[k * uniforms.N + n];`:!t.transA&&t.transB?r=`value += a[m * uniforms.K + k] * b[n * uniforms.K + k];`:!t.transA&&!t.transB&&(r=`value += a[m * uniforms.K + k] * b[k * uniforms.N + n];`);let i=t.alpha===1?``:`value *= uniforms.alpha;`,a=J(`a`,e[0].dataType,e[0].dims),o=J(`b`,e[1].dataType,e[1].dims),c=a.type.value,l=null,u=[a,o];e.length===3&&(l=J(`c`,e[2].dataType,e[2].dims.length),u.push(l));let d=Y(`output`,e[0].dataType,s.length);u.push(d);let f=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}];return` + ${n.registerUniforms(f).declareVariables(...u)} + + ${n.mainStart()} + ${n.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let m = global_idx / uniforms.N; + let n = global_idx % uniforms.N; + + var value = ${c}(0); + for (var k: u32 = 0u; k < uniforms.K; k++) { + ${r} + } + + ${i} + ${l==null?``:`let cOffset = ${l.broadcastedIndicesToOffset(`vec2(m, n)`,d)}; value += ${c}(uniforms.beta) * ${l.getByOffset(`cOffset`)};`} + output[global_idx] = value; + }`},g=n=>{let r=J(`a`,e[0].dataType,e[0].dims),i=J(`b`,e[1].dataType,e[1].dims),a=null,o=[r,i];e.length===3&&(a=J(`c`,e[2].dataType,e[2].dims.length),o.push(a));let l=Y(`output`,e[0].dataType,s.length);o.push(l);let u=[{name:`num_tile_n`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}],d=``,f=``;t.transA&&t.transB?(f=` + var col = tile_row_start + local_id.x; + var row = k_start + local_id.y; + if (col < uniforms.M && row < uniforms.K) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = k_start + local_id.x; + row = tile_col_start + local_id.y; + if (col < uniforms.K && row < uniforms.N) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,d=`value += tile_a[k][local_id.y] * tile_b[local_id.x][k];`):t.transA&&!t.transB?(f=` + var col = tile_row_start + local_id.x; + var row = k_start + local_id.y; + if (col < uniforms.M && row < uniforms.K) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = tile_col_start + local_id.x; + row = k_start + local_id.y; + if (col < uniforms.N && row < uniforms.K) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,d=`value += tile_a[k][local_id.y] * tile_b[k][local_id.x];`):!t.transA&&t.transB?(f=` + var col = k_start + local_id.x; + var row = tile_row_start + local_id.y; + if (col < uniforms.K && row < uniforms.M) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = k_start + local_id.x; + row = tile_col_start + local_id.y; + if (col < uniforms.K && row < uniforms.N) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,d=`value += tile_a[local_id.y][k] * tile_b[local_id.x][k];`):!t.transA&&!t.transB&&(f=` + var col = k_start + local_id.x; + var row = tile_row_start + local_id.y; + if (col < uniforms.K && row < uniforms.M) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = tile_col_start + local_id.x; + row = k_start + local_id.y; + if (col < uniforms.N && row < uniforms.K) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,d=`value += tile_a[local_id.y][k] * tile_b[k][local_id.x];`);let p=t.alpha===1?``:`value *= uniforms.alpha;`;return` + ${n.registerUniforms(u).declareVariables(...o)} + var tile_a: array, ${c}>; + var tile_b: array, ${c}>; + ${n.mainStart([c,c,1])} + let tile_col_start = (workgroup_index % uniforms.num_tile_n) * ${c}; + let tile_row_start = (workgroup_index / uniforms.num_tile_n) * ${c}; + let num_tiles = (uniforms.K - 1) / ${c} + 1; + var k_start = 0u; + var value = ${l.type.value}(0); + for (var t: u32 = 0u; t < num_tiles; t++) { + ${f} + k_start = k_start + ${c}; + workgroupBarrier(); + + for (var k: u32 = 0u; k < ${c}; k++) { + ${d} + } + workgroupBarrier(); + } + + ${p} + let m = tile_row_start + local_id.y; + let n = tile_col_start + local_id.x; + ${a==null?``:`let cOffset = ${a.broadcastedIndicesToOffset(`vec2(m, n)`,l)}; value += ${l.type.value}(uniforms.beta) * ${a.getByOffset(`cOffset`)};`} + if (m < uniforms.M && n < uniforms.N) { + output[m * uniforms.N + n] = value; + } + }`};return d?{name:`GemmShared`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:l*u},programUniforms:p}),getShaderSource:g}:{name:`Gemm`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:h}},sc=e=>{let t=e.transA,n=e.transB,r=e.alpha,i=e.beta;return{transA:t,transB:n,alpha:r,beta:i,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},cc=(e,t)=>{ac(e.inputs),e.compute(oc(e.inputs,t))}}),uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc=M(()=>{"use strict";H(),G(),Zn(),X(),[uc,dc,fc,pc]=[0,1,2,3],mc=e=>{if(e[0].dims.length!==4)throw Error(`only 4-D tensor is supported.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`input dimensions must be equal to grid dimensions`);if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw Error(`grid batch size must match input batch size`)},hc=` + fn gs_get_cubic_coeffs(x: f32) -> vec4 { + let cubic_alpha = -0.75f; + let x_abs = abs(x); + var coeffs: vec4; + coeffs[0] = (((cubic_alpha * (x_abs + 1) - 5 * cubic_alpha) * (x_abs + 1) + 8 * cubic_alpha) * (x_abs + 1) - 4 * cubic_alpha); + coeffs[1] = (((cubic_alpha + 2) * x_abs - (cubic_alpha + 3)) * x_abs * x_abs + 1); + coeffs[2] = (((cubic_alpha + 2) * (1 - x_abs) - (cubic_alpha + 3)) * (1 - x_abs) * (1 - x_abs) + 1); + coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha); + return coeffs; + } +`,gc=e=>` + fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} { + var v: vec4; + var coeffs = gs_get_cubic_coeffs(x); + for (var i = 0; i < 4; i++) { + v[i] = coeffs[0] * p[i][0] + coeffs[1] * p[i][1] + coeffs[2] * p[i][2] + coeffs[3] * p[i][3]; + } + coeffs = gs_get_cubic_coeffs(y); + let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]); + return pixel; + } +`,_c=e=>` + fn gs_denormalize(n: f32, length: i32) -> f32 { + ${e.alignCorners===0?` + // alignCorners: false => [-1, 1] to [-0.5, length - 0.5] + return ((n + 1.0) * f32(length) - 1.0) / 2.0; + `:` + // alignCorners: true => [-1, 1] to [0, length - 1] + return (n + 1.0) / 2.0 * (f32(length - 1)); + `} + } +`,vc=e=>` + ${e.paddingMode===`reflection`?` + fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 { + var dx = 0.0; + var fx = f32(x); + let range = x_max - x_min; + if (fx < x_min) { + dx = x_min - fx; + let n = u32(dx / range); + let r = dx - f32(n) * range; + if (n % 2 == 0) { + fx = x_min + r; + } else { + fx = x_max - r; + } + } else if (fx > x_max) { + dx = fx - x_max; + let n = u32(dx / range); + let r = dx - f32(n) * range; + if (n % 2 == 0) { + fx = x_max - r; + } else { + fx = x_min + r; + } + } + return u32(fx); + }`:``} +`,yc=(e,t,n)=>` + fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4) -> ${t} { + var pixel = ${t}(0); + var indices = vec4(0); + indices[${uc}] = batch; + indices[${dc}] = channel;`+(()=>{switch(n.paddingMode){case`zeros`:return` + if (r >= 0 && r < H && c >=0 && c < W) { + indices[${fc}] = u32(r); + indices[${pc}] = u32(c); + } else { + return ${t}(0); + } + `;case`border`:return` + indices[${fc}] = u32(clamp(r, 0, H - 1)); + indices[${pc}] = u32(clamp(c, 0, W - 1)); + `;case`reflection`:return` + indices[${fc}] = gs_reflect(r, border[1], border[3]); + indices[${pc}] = gs_reflect(c, border[0], border[2]); + `;default:throw Error(`padding mode ${n.paddingMode} is not supported`)}})()+` + return ${e.getByIndices(`indices`)}; + } +`,bc=(e,t,n)=>(()=>{switch(n.mode){case`nearest`:return` + let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${uc}], indices[${dc}], border); + `;case`bilinear`:return` + let x1 = i32(floor(x)); + let y1 = i32(floor(y)); + let x2 = x1 + 1; + let y2 = y1 + 1; + + let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${uc}], indices[${dc}], border); + let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${uc}], indices[${dc}], border); + let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${uc}], indices[${dc}], border); + let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${uc}], indices[${dc}], border); + + let dx2 = ${t}(f32(x2) - x); + let dx1 = ${t}(x - f32(x1)); + let dy2 = ${t}(f32(y2) - y); + let dy1 = ${t}(y - f32(y1)); + let result = dy2 * (dx2 * p11 + dx1 * p12) + dy1 * (dx2 * p21 + dx1 * p22); + `;case`bicubic`:return` + let x0 = i32(floor(x)) - 1; + let y0 = i32(floor(y)) - 1; + var p: mat4x4<${t}>; + for (var h = 0; h < 4; h++) { + for (var w = 0; w < 4; w++) { + p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${uc}], indices[${dc}], border); + } + } + + let dx = x - f32(x0 + 1); + let dy = y - f32(y0 + 1); + let result = gs_bicubic_interpolate(p, dx, dy); + `;default:throw Error(`mode ${n.mode} is not supported`)}})()+`${e.setByOffset(`global_idx`,`result`)}`,xc=(e,t)=>{let n=J(`x`,e[0].dataType,e[0].dims.length),r=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],i=J(`grid`,e[1].dataType,r.length,2),a=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];t.format===`NHWC`&&(a=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[uc,dc,fc,pc]=[0,3,1,2]);let o=Y(`output`,e[0].dataType,a.length),s=n.type.value,c=W.size(a),l=[{type:12,data:c},...K(e[0].dims,r,a)],u=e=>` + ${e.registerUniform(`output_size`,`u32`).declareVariables(n,i,o)} + ${hc} + ${gc(s)} + ${_c(t)} + ${vc(t)} + ${yc(n,s,t)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let H_in = i32(uniforms.x_shape[${fc}]); + let W_in = i32(uniforms.x_shape[${pc}]); + + ${t.alignCorners===0?` + let x_min = -0.5; + let x_max = f32(W_in) - 0.5; + let y_min = -0.5; + let y_max = f32(H_in) - 0.5; + `:` + let x_min = 0.0; + let x_max = f32(W_in) - 1.0; + let y_min = 0.0; + let y_max = f32(H_in) - 1.0; + `}; + let border = vec4(x_min, y_min, x_max, y_max); + + let indices = ${o.offsetToIndices(`global_idx`)}; + var grid_indices = vec3(indices[${uc}], indices[${fc}], indices[${pc}]); + let nxy = ${i.getByIndices(`grid_indices`)}; + var x = gs_denormalize(f32(nxy[0]), W_in); + var y = gs_denormalize(f32(nxy[1]), H_in); + + ${bc(o,s,t)} + }`;return{name:`GridSample`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:[`type`,`type`]},getRunData:e=>{let t=W.size(a);return{outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:l}},getShaderSource:u}},Sc=(e,t)=>{mc(e.inputs),e.compute(xc(e.inputs,t))},Cc=e=>Xn({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),Tc,Ec,Dc,Oc,kc,Ac,jc,Mc=M(()=>{"use strict";H(),G(),Zn(),Rn(),Oi(),X(),yr(),Tc=(e,t)=>e.length>t&&e[t].dims.length>0?e[t]:void 0,Ec=(e,t)=>{let n=e[0],r=Tc(e,1),i=Tc(e,2),a=Tc(e,3),o=Tc(e,4),s=Tc(e,5),c=Tc(e,6),l=Tc(e,7);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let u=n.dims[0],d=n.dims[1],f=n.dims.length===3?n.dims[2]:t.numHeads*n.dims[4],p=d,m=0,h=0,g=Math.floor(f/t.numHeads);if(c&&l&&W.size(c.dims)&&W.size(l.dims)){if(c.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(c.dims[0]!==u||c.dims[1]!==t.numHeads||c.dims[3]!==g)throw Error(`Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(l.dims[0]!==u||l.dims[1]!==t.numHeads||l.dims[3]!==g)throw Error(`Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(c.dims[2]!==l.dims[2])throw Error(`Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)`);if(l.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);m=c.dims[2],h=c.dims[2]}else if(c&&W.size(c.dims)||l&&W.size(l.dims))throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _;if(r&&W.size(r.dims)>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(r.dims[2]!==n.dims[2])throw Error(`Input "query" and "key" shall have same dim 2 (hidden_size)`);_=2,p=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==g)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);_=5,p=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==g)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);_=0,p=r.dims[2]}}else{if(n.dims.length!==5)throw Error(`Input "query" is expected to have 5 dimensions when key is empty`);if(n.dims[2]!==t.numHeads||n.dims[3]!==3)throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}if(a&&W.size(a.dims)>0){if(a.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimension`);if(r&&r.dims.length===5&&r.dims[3]===2)throw Error(`bias is not allowed for packed kv.`)}let v=m+p,y=0;if(o&&W.size(o.dims)>0){y=8;let e=o.dims;throw e.length===1?e[0]===u?y=1:e[0]===3*u+2&&(y=3):e.length===2&&e[0]===u&&e[1]===v&&(y=5),y===8?Error(`Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)`):Error(`Mask not supported`)}let b=!1,x=f;if(i&&W.size(i.dims)>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(p!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);x=i.dims[2]}else{if(p!==i.dims[2])throw Error(`Input "key" and "value" shall have the same dim 2 (kv_sequence_length)`);x=i.dims[1]*i.dims[3],b=!0}}let S=!1;if(o&&W.size(o.dims)>0)throw Error(`Key padding mask is not supported`);if(s&&W.size(s.dims)>0){if(s.dims.length!==4)throw Error(`Input "attention_bias" is expected to have 4 dimensions`);if(s.dims[0]!==u||s.dims[1]!==t.numHeads||s.dims[2]!==d||s.dims[3]!==v)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:u,sequenceLength:d,pastSequenceLength:m,kvSequenceLength:p,totalSequenceLength:v,maxSequenceLength:h,inputHiddenSize:0,hiddenSize:f,vHiddenSize:x,headSize:g,vHeadSize:Math.floor(x/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:y,scale:t.scale,broadcastResPosBias:S,passPastInKv:b,qkvFormat:_}},Dc=e=>Xn({...e}),Oc=Xn({perm:[0,2,1,3]}),kc=(e,t,n,r,i,a,o)=>{let s=[r,i,a],c=W.size(s),l=[{type:12,data:c},{type:12,data:o},{type:12,data:a}],u=e=>{let r=Y(`qkv_with_bias`,t.dataType,s),i=J(`qkv`,t.dataType,s),a=J(`bias`,n.dataType,s),o=[{name:`output_size`,type:`u32`},{name:`bias_offset`,type:`u32`},{name:`hidden_size`,type:`u32`}];return` + ${e.registerUniforms(o).declareVariables(i,a,r)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset; + + qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx]; + }`};return e.compute({name:`MultiHeadAttentionAddBias`,shaderCache:{inputDependencies:[`type`,`type`]},getRunData:()=>({outputs:[{dims:s,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l}),getShaderSource:u},{inputs:[t,n],outputs:[-1]})[0]},Ac=(e,t,n,r,i,a,o,s)=>{let c=a;if(o&&W.size(o.dims)>0){if(r===1)throw Error(`AddBiasReshape is not implemented. Please export your model with packed QKV or KV`);return c=kc(e,a,o,t,r,n*i,s),c=c.reshape([t,r,n,i]),n===1||r===1?c:e.compute(gr(c,Oc.perm),{inputs:[c],outputs:[-1]})[0]}else return a.dims.length===3&&(c=a.reshape([t,r,n,i])),n===1||r===1?c:e.compute(gr(c,Oc.perm),{inputs:[c],outputs:[-1]})[0]},jc=(e,t)=>{let n=Ec(e.inputs,t),r=e.inputs[0],i=Tc(e.inputs,1),a=Tc(e.inputs,2),o=Tc(e.inputs,3),s=Tc(e.inputs,4),c=Tc(e.inputs,5),l=Tc(e.inputs,6),u=Tc(e.inputs,7);if(r.dims.length===5)throw Error(`Packed QKV is not implemented`);if(i?.dims.length===5)throw Error(`Packed KV is not implemented`);let d=i&&a&&i.dims.length===4&&a.dims.length===4,f=Ac(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,r,o,0);if(d)return Ti(e,f,i,a,s,void 0,l,u,c,n);if(!i||!a)throw Error(`key and value must be provided`);let p=Ac(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.headSize,i,o,n.hiddenSize),m=Ac(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.vHeadSize,a,o,2*n.hiddenSize);Ti(e,f,p,m,s,void 0,l,u,c,n)}}),Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc=M(()=>{"use strict";H(),G(),Zn(),X(),Nc=e=>{if(!e||e.length<1)throw Error(`too few inputs`)},Pc=(e,t)=>{let n=[],r=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),r=n.length),Xn({numOutputs:r,axis:t.axis,splitSizes:n})},Fc=e=>` +fn calculateOutputIndex(index: u32) -> u32 { + for (var i: u32 = 0u; i < ${e}u; i += 1u ) { + if (index < ${q(`uniforms.size_in_split_axis`,`i`,e)}) { + return i; + } + } + return ${e}u; +}`,Ic=e=>{let t=e.length,n=[];for(let r=0;r{let n=e[0].dims,r=W.size(n),i=e[0].dataType,a=W.normalizeAxis(t.axis,n.length),o=Array(t.numOutputs),s=J(`input`,i,n.length),c=Array(t.numOutputs),l=[],u=[],d=0,f=[{type:12,data:r}];for(let r=0;r` + ${e.registerUniform(`input_size`,`u32`).registerUniform(`size_in_split_axis`,`u32`,c.length).declareVariables(s,...o)} + ${Fc(c.length)} + ${Ic(o)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.input_size`)} + + var indices = ${s.offsetToIndices(`global_idx`)}; + var index = ${s.indicesGet(`indices`,a)}; + let output_number = calculateOutputIndex(index); + if (output_number != 0) { + index -= ${q(`uniforms.size_in_split_axis`,`output_number - 1u`,c.length)}; + ${s.indicesSet(`indices`,a,`index`)}; + } + writeBufferData(output_number, indices, global_idx); + }`;return{name:`Split`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`]},getShaderSource:p,getRunData:()=>({outputs:l,dispatchGroup:{x:Math.ceil(r/64)},programUniforms:f})}},Rc=(e,t)=>{Nc(e.inputs);let n=e.inputs.length===1?t:Pc(e.inputs,t);e.compute(Lc(e.inputs,n),{inputs:[0]})},zc=e=>{let t=e.axis,n=e.splitSizes,r=e.numOutputs<0?n.length:e.numOutputs;if(r!==n.length)throw Error(`numOutputs and splitSizes lengh must be equal`);return Xn({axis:t,numOutputs:r,splitSizes:n})}}),Vc,Hc,Uc,Wc=M(()=>{"use strict";H(),G(),Zn(),X(),Vc=(e,t)=>{let[n,r,i,a]=e,{numHeads:o,rotaryEmbeddingDim:s}=t;if(n.dims.length!==3&&n.dims.length!==4)throw Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${n.dims.length}`);if(!W.areEqual(r.dims,[])&&!W.areEqual(r.dims,[1])&&r.dims.length!==2)throw Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${r.dims.length}`);if(i.dims.length!==2)throw Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${i.dims.length}`);if(a.dims.length!==2)throw Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${a.dims.length}`);if(!W.areEqual(i.dims,a.dims))throw Error(`Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape`);if(s>0&&o===0)throw Error(`num_heads must be provided if rotary_embedding_dim is specified`);let c=n.dims[0],l=n.dims[n.dims.length-2],u=i.dims[0],d=W.sizeFromDimension(n.dims,1)/l,f=s===0?i.dims[1]*2:d/o;if(s>f)throw Error(`rotary_embedding_dim must be less than or equal to head_size`);if(r.dims.length===2){if(c!==r.dims[0])throw Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${r.dims[0]}`);if(l!==r.dims[1])throw Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${r.dims[1]}`)}if(f/2!==i.dims[1]&&s/2!==i.dims[1])throw Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${i.dims[1]}`);if(l>u)throw Error(`Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported`)},Hc=(e,t)=>{let{interleaved:n,numHeads:r,rotaryEmbeddingDim:i,scale:a}=t,o=e[0].dims[0],s=W.sizeFromDimension(e[0].dims,1),c=e[0].dims[e[0].dims.length-2],l=s/c,u=e[2].dims[1],d=i===0?u*2:l/r,f=[o,c,l/d,d-u],p=W.computeStrides(f),m=[{type:1,data:a},{type:12,data:f},{type:12,data:p},...e[0].dims.length===3?Array({type:12,data:[s,l,d,1]}):[],...e[0].dims.length===4?Array({type:12,data:[s,d,c*d,1]}):[],...K(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],h=t=>{let r=J(`input`,e[0].dataType,e[0].dims.length),i=J(`position_ids`,e[1].dataType,e[1].dims.length),a=J(`cos_cache`,e[2].dataType,e[2].dims.length),o=J(`sin_cache`,e[3].dataType,e[3].dims.length),s=Y(`output`,e[0].dataType,e[0].dims.length);return t.registerUniforms([{name:`scale`,type:`f32`},{name:`global_shape`,type:`u32`,length:f.length},{name:`global_strides`,type:`u32`,length:p.length},{name:`input_output_strides`,type:`u32`,length:p.length}]),` + ${t.declareVariables(r,i,a,o,s)} + + ${t.mainStart(Qn)} + let half_rotary_emb_dim = uniforms.${a.name}_shape[1]; + let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape; + let size = uniforms.global_shape[0] * uniforms.global_strides[0]; + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`size`)} + + if (bsnh[3] < half_rotary_emb_dim) { + let position_ids_idx = + ${i.broadcastedIndicesToOffset(`bsnh.xy`,Y(``,i.type.tensor,2))}; + let position_id = + u32(${i.getByOffset(`position_ids_idx`)}) + select(0, bsnh[1], position_ids_idx == 0); + let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${n}); + let j = i + select(half_rotary_emb_dim, 1, ${n}); + let re = ${r.getByOffset(`i`)} * ${a.get(`position_id`,`bsnh[3]`)} - + ${r.getByOffset(`j`)} * ${o.get(`position_id`,`bsnh[3]`)}; + ${s.setByOffset(`i`,`re`)} + let im = ${r.getByOffset(`i`)} * ${o.get(`position_id`,`bsnh[3]`)} + + ${r.getByOffset(`j`)} * ${a.get(`position_id`,`bsnh[3]`)}; + ${s.setByOffset(`j`,`im`)} + } else { + let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim; + ${s.setByOffset(`k`,r.getByOffset(`k`))} + } + }`};return{name:`RotaryEmbedding`,shaderCache:{hint:Xn({interleaved:n}).cacheKey,inputDependencies:[`rank`,`rank`,`rank`,`rank`]},getShaderSource:h,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(W.size(f)/Qn)},programUniforms:m})}},Uc=(e,t)=>{Vc(e.inputs,t),e.compute(Hc(e.inputs,t))}}),Gc,Kc,qc,Jc,Yc,Xc=M(()=>{"use strict";Zn(),H(),Oi(),Mc(),Bc(),yr(),Wc(),X(),Gc=(e,t)=>{if(t.doRotary&&e.length<=7)throw Error(`cos_cache and sin_cache inputs are required if do_rotary is specified`);let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(t.doRotary!==0&&e.length<=7)throw Error(`cos_cast and sin_cache are expected if do_rotary attribute is non-zero`);if(t.localWindowSize!==-1)throw Error(`Local attention is not supported`);if(t.softcap!==0)throw Error(`Softcap is not supported`);if(t.rotaryInterleaved!==0)throw Error(`Rotary interleaved is not supported`);if(t.smoothSoftmax)throw Error(`Smooth softmax is not supported`);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let s=!1,c=n.dims[0],l=n.dims[1],u=n.dims.length===3?s?n.dims[2]/3:n.dims[2]:t.numHeads*n.dims[4],d=l,f=0,p=!r||r.dims.length===0,m=Math.floor(p?u/(t.numHeads+2*t.kvNumHeads):u/t.numHeads);p&&(u=m*t.numHeads);let h=a&&a.dims.length!==0,g=o&&o.dims.length!==0;if(h&&a.dims.length===4&&a.dims[0]===c&&a.dims[1]!==t.kvNumHeads&&a.dims[2]===t.kvNumHeads&&a.dims[3]===m)throw Error(`BSNH pastKey/pastValue is not supported`);if(h&&g){if(a.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(o.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);f=a.dims[2]}else if(h||g)throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _=1;if(r&&r.dims.length>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(n.dims[2]%r.dims[2]!==0)throw Error(`Dimension 2 of "query" should be a multiple of "key"`);d=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==m)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);d=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==m)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);d=r.dims[2]}}else{if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input "query" is expected to have 3 or 5 dimensions when key is empty`);if(n.dims.length===5&&(n.dims[2]!==t.numHeads||n.dims[3]!==3))throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}let v=0,y=!1,b=t.kvNumHeads?m*t.kvNumHeads:u;if(i&&i.dims.length>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(d!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);b=i.dims[2]}else{if(d!==i.dims[2])throw Error(`Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)`);b=i.dims[1]*i.dims[3],y=!0}}let x=e.length>4?e[5]:void 0;if(x&&x.dims.length!==1&&x.dims[0]!==c)throw Error(`Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size`);return{batchSize:c,sequenceLength:l,pastSequenceLength:f,kvSequenceLength:d,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:u,vHiddenSize:b,headSize:m,vHeadSize:Math.floor(b/t.kvNumHeads),numHeads:t.numHeads,kvNumHeads:t.kvNumHeads,nReps:t.numHeads/t.kvNumHeads,pastPresentShareBuffer:!1,maskType:v,scale:t.scale,broadcastResPosBias:!1,passPastInKv:y,qkvFormat:_}},Kc=Xn({perm:[0,2,1,3]}),qc=(e,t,n)=>{let r=t,i=n.kvNumHeads;return t.dims.length===3&&n.kvSequenceLength!==0&&(r=t.reshape([n.batchSize,n.kvSequenceLength,i,n.headSize]),r=e.compute(gr(r,Kc.perm),{inputs:[r],outputs:[-1]})[0]),r},Jc=(e,t,n,r)=>{let i=7,a=[`type`,`type`],o=[e*t],s=e*t,c=[{type:12,data:s},{type:12,data:t},{type:12,data:e}],l=e=>{let t=J(`seq_lens`,n.dataType,n.dims),a=J(`total_seq_lens`,r.dataType,r.dims),s=Y(`pos_ids`,i,o),c=[{name:`output_size`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`batch_size`,type:`u32`}];return` + ${e.registerUniforms(c).declareVariables(t,a,s)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let total_sequence_length = u32(${a.getByOffset(`0`)}); + let is_subsequent_prompt = uniforms.sequence_length > 1 && uniforms.sequence_length != total_sequence_length; + let is_first_prompt = !is_subsequent_prompt && uniforms.sequence_length == total_sequence_length; + let batch_idx = global_idx / uniforms.sequence_length; + let sequence_idx = i32(global_idx % uniforms.sequence_length); + var pos_id: i32 = 0; + let seqlen = ${t.getByOffset(`batch_idx`)}; + let total_seqlen = seqlen + 1; + if (is_first_prompt) { + if (sequence_idx < total_seqlen) { + pos_id = sequence_idx; + } else { + pos_id = 1; + } + ${s.setByOffset(`global_idx`,`pos_id`)} + } else if (is_subsequent_prompt) { + let past_seqlen = total_seqlen - i32(uniforms.sequence_length); + if (past_seqlen + sequence_idx < total_seqlen) { + pos_id = past_seqlen + sequence_idx; + } else { + pos_id = 1; + } + ${s.setByOffset(`global_idx`,`pos_id`)} + } else if (global_idx < uniforms.batch_size) { + ${s.setByOffset(`global_idx`,`seqlen`)} + }; + } + `};return{name:`GeneratePositionIds`,shaderCache:{hint:`${e};${t}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:c}),getShaderSource:l}},Yc=(e,t)=>{var n;let r=Gc(e.inputs,t);if(e.inputs[0].dims.length===5)throw Error(`Packed QKV is not implemented`);if((n=e.inputs[1])?.dims.length===5)throw Error(`Packed KV is not implemented`);let i=e.inputs[0],a=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,o=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,s=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,c=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,l=e.inputs.length>4?e.inputs[5]:void 0,u=e.inputs.length>5?e.inputs[6]:void 0,d=r.kvNumHeads?r.kvNumHeads:r.numHeads,f=Xn({axis:2,numOutputs:3,splitSizes:[r.numHeads*r.headSize,d*r.headSize,d*r.headSize]}),[p,m,h]=!a&&!o?e.compute(Lc([i],f),{inputs:[i],outputs:[-1,-1,-1]}):[i,a,o],g,_;if(t.doRotary){let n=e.compute(Jc(r.batchSize,r.sequenceLength,l,u),{inputs:[l,u],outputs:[-1]})[0],i=e.inputs[7],a=e.inputs[8],o=Xn({interleaved:t.rotaryInterleaved!==0,numHeads:r.numHeads,rotaryEmbeddingDim:0,scale:t.scale}),s=[p,n,i,a],c=[-1];g=e.compute(Hc(s,o),{inputs:s,outputs:c})[0],s.splice(0,1,m);let d=Xn({interleaved:t.rotaryInterleaved!==0,numHeads:r.kvNumHeads,rotaryEmbeddingDim:0,scale:t.scale});_=e.compute(Hc(s,d),{inputs:s,outputs:c})[0]}let v=Ac(e,r.batchSize,r.numHeads,r.sequenceLength,r.headSize,t.doRotary?g:p,void 0,0),y=qc(e,t.doRotary?_:m,r),b=qc(e,h,r);Ti(e,v,y,b,void 0,void 0,s,c,void 0,r,l,u)}}),Zc,Qc,$c,el,tl=M(()=>{"use strict";H(),G(),yr(),X(),Zc=(e,t,n,r,i,a,o,s)=>{let c=nr(a),l=c===1?`f32`:`vec${c}f`,u=c===1?`vec2f`:`mat2x${c}f`,d=i*o,f=64;d===1&&(f=256);let p=[i,o,a/c],m=[i,o,2],h=[`rank`,`type`,`type`],g=[];g.push(...K(p,m));let _=e=>{let i=J(`x`,t.dataType,3,c),a=J(`scale`,n.dataType,n.dims),o=J(`bias`,r.dataType,r.dims),d=Y(`output`,1,3,2),p=[i,a,o,d];return` + var workgroup_shared : array<${u}, ${f}>; + const workgroup_size = ${f}u; + ${e.declareVariables(...p)} + ${e.mainStart(f)} + let batch = workgroup_index / uniforms.x_shape[1]; + let channel = workgroup_index % uniforms.x_shape[1]; + let hight = uniforms.x_shape[2]; + // initialize workgroup memory + var sum = ${l}(0); + var squared_sum = ${l}(0); + for (var h = local_idx; h < hight; h += workgroup_size) { + let value = ${l}(${i.get(`batch`,`channel`,`h`)}); + sum += value; + squared_sum += value * value; + } + workgroup_shared[local_idx] = ${u}(sum, squared_sum); + workgroupBarrier(); + + for (var currSize = workgroup_size >> 1; currSize > 0; currSize = currSize >> 1) { + if (local_idx < currSize) { + workgroup_shared[local_idx] = workgroup_shared[local_idx] + workgroup_shared[local_idx + currSize]; + } + workgroupBarrier(); + } + if (local_idx == 0) { + let sum_final = ${ar(`workgroup_shared[0][0]`,c)} / f32(hight * ${c}); + let squared_sum_final = ${ar(`workgroup_shared[0][1]`,c)} / f32(hight * ${c}); + + let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${s})); + let channel_scale = inv_std_dev * f32(scale[channel]); + let channel_shift = f32(bias[channel]) - sum_final * channel_scale; + output[workgroup_index] = vec2f(channel_scale, channel_shift); + } + }`};return e.compute({name:`InstanceNormComputeChannelScaleShift`,shaderCache:{hint:`${c};${s};${f}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:m,dataType:1}],dispatchGroup:{x:d},programUniforms:g}),getShaderSource:_},{inputs:[t,n,r],outputs:[-1]})[0]},Qc=(e,t,n)=>{let r=t[0].dims,i=r,a=2,o=r[0],s=r[1],c=W.sizeFromDimension(r,a),l=nr(c),u=W.size(i)/l,d=Zc(e,t[0],t[1],t[2],o,c,s,n.epsilon),f=[o,s,c/l],p=[o,s],m=[`type`,`none`],h=e=>{let n=J(`x`,t[0].dataType,f.length,l),r=J(`scale_shift`,1,p.length,2),i=Y(`output`,t[0].dataType,f.length,l),a=[n,r,i];return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(...a)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let outputIndices = ${i.offsetToIndices(`global_idx`)}; + let batch = outputIndices[0]; + let channel = outputIndices[1]; + let scale_shift = ${r.getByIndices(`vec2(batch, channel)`)}; + let value = ${n.getByOffset(`global_idx`)} * ${i.type.value}(scale_shift.x) + ${i.type.value}(scale_shift.y); + ${i.setByOffset(`global_idx`,`value`)}; + }`};e.compute({name:`InstanceNormalization`,shaderCache:{hint:`${l}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:[{type:12,data:u},...K(f,p,f)]}),getShaderSource:h},{inputs:[t[0],d]})},$c=(e,t,n)=>{let r=t[0].dims,i=r,a=r[0],o=r[r.length-1],s=W.sizeFromDimension(r,1)/o,c=nr(o),l=W.size(i)/c,u=[{type:12,data:s},{type:12,data:Math.floor(o/c)}],d=[`type`,`type`],f=!1,p=[0,r.length-1];for(let e=0;er[p[t]])),h=Zc(e,m,t[1],t[2],a,s,o,n.epsilon),g=e=>{let n=er(t[0].dataType),r=c===1?`vec2f`:`mat${c}x2f`,a=e=>{let t=e===0?`x`:`y`,r=c===1?`f32`:`vec${c}f`;switch(c){case 1:return`${n}(${r}(scale.${t}))`;case 2:return`vec2<${n}>(${r}(scale[0].${t}, scale[1].${t}))`;case 4:return`vec4<${n}>(${r}(scale[0].${t}, scale[1].${t}, scale[2].${t}, scale[3].${t}))`;default:throw Error(`Not supported compoents ${c}`)}},o=J(`input`,t[0].dataType,t[0].dims,c),s=Y(`output`,t[0].dataType,i,c);return` + @group(0) @binding(0) var input : array<${o.type.storage}>; + @group(0) @binding(1) var scale_input : array<${r}>; + @group(0) @binding(2) var output : array<${s.type.storage}>; + struct Uniforms {H: u32, C : u32}; + @group(0) @binding(3) var uniforms: Uniforms; + + ${e.mainStart()} + let current_image_number = global_idx / (uniforms.C * uniforms.H); + let current_channel_number = global_idx % uniforms.C; + + let scale_offset = current_image_number * uniforms.C + current_channel_number; + let scale = scale_input[scale_offset]; + output[global_idx] = fma(input[global_idx], ${a(0)}, ${a(1)}); + }`};e.compute({name:`InstanceNormalizationNHWC`,shaderCache:{hint:`${c}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:g},{inputs:[t[0],h]})},el=(e,t)=>{t.format===`NHWC`?$c(e,e.inputs,t):Qc(e,e.inputs,t)}}),nl,rl,il,al=M(()=>{"use strict";H(),G(),X(),nl=e=>{if(!e||e.length<2)throw Error(`layerNorm requires at least 2 inputs.`)},rl=(e,t,n)=>{let r=t.simplified,i=e[0].dims,a=e[1],o=!r&&e[2],s=i,c=W.normalizeAxis(t.axis,i.length),l=W.sizeToDimension(i,c),u=W.sizeFromDimension(i,c),d=W.size(a.dims),f=o?W.size(o.dims):0;if(d!==u||o&&f!==u)throw Error(`Size of X.shape()[axis:] == ${u}. + Size of scale and bias (if provided) must match this. + Got scale size of ${d} and bias size of ${f}`);let p=[];for(let e=0;e1,v=n>2,y=t=>{let n=er(e[0].dataType),i=[J(`x`,e[0].dataType,e[0].dims,m),J(`scale`,a.dataType,a.dims,m)];o&&i.push(J(`bias`,o.dataType,o.dims,m)),i.push(Y(`output`,e[0].dataType,s,m)),_&&i.push(Y(`mean_data_output`,1,p)),v&&i.push(Y(`inv_std_output`,1,p));let c=[{name:`norm_count`,type:`u32`},{name:`norm_size`,type:`f32`},{name:`norm_size_vectorized`,type:`u32`},{name:`epsilon`,type:`f32`}];return` + ${t.registerUniforms(c).declareVariables(...i)} + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.norm_count`)} + let offset = global_idx * uniforms.norm_size_vectorized; + var mean_vector = ${rr(`f32`,m)}; + var mean_square_vector = ${rr(`f32`,m)}; + + for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) { + let value = ${ir(n,m,`x[h + offset]`)}; + mean_vector += value; + mean_square_vector += value * value; + } + let mean = ${ar(`mean_vector`,m)} / uniforms.norm_size; + let inv_std_dev = inverseSqrt(${ar(`mean_square_vector`,m)} / uniforms.norm_size ${r?``:`- mean * mean`} + uniforms.epsilon); + + for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) { + let f32input = ${ir(n,m,`x[j + offset]`)}; + let f32scale = ${ir(n,m,`scale[j]`)}; + output[j + offset] = ${i[0].type.value}((f32input ${r?``:`- mean`}) * inv_std_dev * f32scale + ${o?`+ ${ir(n,m,`bias[j]`)}`:``} + ); + } + + ${_?`mean_data_output[global_idx] = mean`:``}; + ${v?`inv_std_output[global_idx] = inv_std_dev`:``}; + }`},b=[{dims:s,dataType:e[0].dataType}];return _&&b.push({dims:p,dataType:1}),v&&b.push({dims:p,dataType:1}),{name:`LayerNormalization`,shaderCache:{hint:`${m};${n};${r}`,inputDependencies:h},getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(l/64)},programUniforms:g}),getShaderSource:y}},il=(e,t)=>{nl(e.inputs),e.compute(rl(e.inputs,t,e.outputCount))}}),ol,sl,cl=M(()=>{"use strict";G(),mo(),Co(),ol=e=>{if(!e||e.length!==2)throw Error(`MatMul requires 2 inputs.`);if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw Error(`shared dimension does not match.`)},sl=e=>{ol(e.inputs);let t=gn.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw Error(`Can't use matmul on the given tensors`);let n=t[t.length-1],r=e.inputs[0].dims[e.inputs[0].dims.length-1];if(n<8&&r<8)e.compute(po(e.inputs,{activation:``},t));else{let i=t[t.length-2],a=W.size(e.inputs[0].dims.slice(0,-2)),o=W.size(e.inputs[1].dims.slice(0,-2));if(a!==1&&i===1&&o===1){let i=e.inputs[0].reshape([1,a,r]),o=e.inputs[1].reshape([1,r,n]),s=[1,a,n],c=[i,o];e.compute(So(c,{activation:``},t,s),{inputs:c})}else e.compute(So(e.inputs,{activation:``},t))}}}),ll,ul,dl,fl,pl,ml=M(()=>{"use strict";H(),G(),Zn(),X(),ll=(e,t)=>{if(e.length<3||e.length>4)throw Error(`MatMulNBits requires 3 or 4 inputs`);let n=e[0],r=n.dims.length;if(n.dims[r-1]!==t.k)throw Error(`The last dim of input shape does not match the k value`);let i=Math.floor((t.k+t.blockSize-1)/t.blockSize),a=t.blockSize/8*t.bits,o=e[1];if(!W.areEqual(o.dims,[t.n,i,a]))throw Error(`The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize`);let s=e[2].dims;if(W.size(s)!==t.n*i)throw Error(`scales input size error.`);if(e.length===4){let n=e[3].dims,r=t.bits>4?t.n*i:t.n*Math.floor((i+1)/2);if(W.size(n)!==r)throw Error(`zeroPoints input size error.`)}},ul=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=W.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=nr(t.k),f=nr(l),p=nr(o),m=s.concat([i,o]),h=i>1&&o/p%2==0?2:1,g=W.size(m)/p/h,_=64,v=[],y=[c,i,a/d],b=W.convertShape(e[1].dims).slice();b.splice(-1,1,l/f),v.push(...K(y)),v.push(...K(b)),v.push(...K(e[2].dims)),e.length===4&&v.push(...K(W.convertShape(e[3].dims)));let x=[c,i,o/p];v.push(...K(x));let S=n=>{let r=y.length,i=J(`a`,e[0].dataType,r,d),a=J(`b`,12,b.length,f),o=J(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?J(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let u=x.length,m=Y(`output`,e[0].dataType,u,p),g=er(e[0].dataType),v=(()=>{switch(d){case 1:return`array<${g}, 8>`;case 2:return`mat4x2<${g}>`;case 4:return`mat2x4<${g}>`;default:throw Error(`${d}-component is not supported.`)}})(),S=()=>{let e=` + // reuse a data + var input_offset = ${i.indicesToOffset(`${i.type.indices}(batch, row, word_offset)`)}; + var a_data: ${v}; + for (var j: u32 = 0; j < ${8/d}; j++) { + a_data[j] = ${i.getByOffset(`input_offset`)}; + input_offset++; + } + `;for(let t=0;t> 4) & b_mask); + b_quantized_values = ${v}(${Array.from({length:4},(e,t)=>`${g}(b_value_lower[${t}]), ${g}(b_value_upper[${t}])`).join(`, `)}); + b_dequantized_values = ${d===1?`${v}(${Array.from({length:8},(e,n)=>`(b_quantized_values[${n}] - ${c?`zero_point${t}`:`zero_point`}) * scale${t}`).join(`, `)});`:`(b_quantized_values - ${v}(${Array(8).fill(`${c?`zero_point${t}`:`zero_point`}`).join(`,`)})) * scale${t};`}; + workgroup_shared[local_id.x * ${h} + ${Math.floor(t/p)}]${p>1?`[${t%p}]`:``} += ${Array.from({length:8/d},(e,t)=>`${d===1?`a_data[${t}] * b_dequantized_values[${t}]`:`dot(a_data[${t}], b_dequantized_values[${t}])`}`).join(` + `)}; + `;return e},C=()=>{let e=` + var col_index = col * ${p}; + ${c?` + let zero_point_bytes_per_col = (nBlocksPerCol + 1) / 2; + var zero_point_byte_count: u32; + var zero_point_word_index: u32; + var zero_point_byte_offset: u32; + let zero_point_nibble_offset: u32 = block & 0x1u; + var zero_point_bits_offset: u32; + var zero_point_word: u32;`:` + // The default zero point is 8 for unsigned 4-bit quantization. + let zero_point = ${g}(8);`} + `;for(let t=0;t> 0x1u); + zero_point_word_index = zero_point_byte_count >> 0x2u; + zero_point_byte_offset = zero_point_byte_count & 0x3u; + zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); + zero_point_word = ${c.getByOffset(`zero_point_word_index`)} >> zero_point_bits_offset; + let zero_point${t} = ${g}((zero_point_word) & 0xFu);`:``} + col_index += 1;`;return e},w=()=>{let e=`col_index = col * ${p};`;for(let t=0;t; + var b_value_upper: vec4; + var b_quantized_values: ${v}; + var b_dequantized_values: ${v};`,e};return` + var workgroup_shared: array<${m.type.value}, ${h*_}>; + ${n.declareVariables(...s,m)} + ${n.mainStart([_,1,1])} + let output_indices = ${m.offsetToIndices(`(global_idx / ${_}) * ${h}`)}; + let col = output_indices[2]; + let row = output_indices[1]; + let batch = output_indices[0]; + let nBlocksPerCol = uniforms.b_shape[1]; + + for (var block = local_id.x; block < nBlocksPerCol; block += ${_}) { + //process one block + var word_offset: u32 = block * ${t.blockSize/d}; + ${C()} + for (var word: u32 = 0; word < ${l}; word += ${f}) { + ${w()} + for (var i: u32 = 0; i < ${f}; i++) { + ${S()} + word_offset += ${8/d}; + } + } + } + workgroupBarrier(); + + if (local_id.x < ${h}) { + var output_value: ${m.type.value} = ${m.type.value}(0); + var workgroup_shared_offset: u32 = local_id.x; + for (var b: u32 = 0u; b < ${_}u; b++) { + output_value += workgroup_shared[workgroup_shared_offset]; + workgroup_shared_offset += ${h}; + } + ${m.setByIndices(`${m.type.indices}(batch, row, col + local_id.x)`,`output_value`)}; + } + }`};return{name:`MatMulNBits`,shaderCache:{hint:`${t.blockSize};${t.bits};${d};${f};${p};${h};${_}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:m,dataType:u}],dispatchGroup:{x:g},programUniforms:v}),getShaderSource:S}},dl=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=W.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=nr(t.k),f=nr(l),p=s.concat([i,o]),m=128,h=o%8==0?8:o%4==0?4:1,g=m/h,_=g*f*8,v=_/d,y=_/t.blockSize,b=W.size(p)/h,x=[],S=[c,i,a/d],C=W.convertShape(e[1].dims).slice();C.splice(-1,1,l/f),x.push(...K(S)),x.push(...K(C)),x.push(...K(e[2].dims)),e.length===4&&x.push(...K(W.convertShape(e[3].dims)));let w=[c,i,o];x.push(...K(w));let T=n=>{let r=S.length,i=J(`a`,e[0].dataType,r,d),a=J(`b`,12,C.length,f),o=J(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?J(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let l=w.length,u=Y(`output`,e[0].dataType,l),p=er(e[0].dataType),_=()=>{switch(d){case 1:return` + let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]); + let a_data1 = vec4<${p}>(sub_a[word_offset + 4], sub_a[word_offset + 5], sub_a[word_offset + 6], sub_a[word_offset + 7]);`;case 2:return` + let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1]); + let a_data1 = vec4<${p}>(sub_a[word_offset + 2], sub_a[word_offset + 3]);`;case 4:return` + let a_data0 = sub_a[word_offset]; + let a_data1 = sub_a[word_offset + 1];`;default:throw Error(`${d}-component is not supported.`)}};return` + var sub_a: array<${i.type.value}, ${v}>; + var inter_results: array, ${h}>; + ${n.declareVariables(...s,u)} + ${n.mainStart([g,h,1])} + let output_indices = ${u.offsetToIndices(`workgroup_index * ${h}`)}; + let col = output_indices[2]; + let row = output_indices[1]; + let batch = output_indices[0]; + let n_blocks_per_col = uniforms.b_shape[1]; + let num_tiles = (n_blocks_per_col - 1) / ${y} + 1; + + // Loop over shared dimension. + for (var tile: u32 = 0; tile < num_tiles; tile += 1) { + let a_col_start = tile * ${v}; + // load one tile A data into shared memory. + for (var a_offset = local_idx; a_offset < ${v}; a_offset += ${m}) + { + let a_col = a_col_start + a_offset; + if (a_col < uniforms.a_shape[2]) + { + sub_a[a_offset] = ${i.getByIndices(`${i.type.indices}(batch, row, a_col)`)}; + } else { + sub_a[a_offset] = ${i.type.value}(0); + } + } + workgroupBarrier(); + + // each thread process one block + let b_row = col + local_id.y; + let block = tile * ${y} + local_id.x; + ${c?` + let zero_point_bytes_per_col = (n_blocks_per_col + 1) / 2; + let zero_point_byte_count = b_row * zero_point_bytes_per_col + (block >> 0x1u); + let zero_point_word_index = zero_point_byte_count >> 0x2u; + let zero_point_byte_offset = zero_point_byte_count & 0x3u; + let zero_point_nibble_offset: u32 = block & 0x1u; + let zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); + let zero_point_word = ${c.getByOffset(`zero_point_word_index`)} >> zero_point_bits_offset; + let zero_point = ${p}((zero_point_word) & 0xFu);`:` + // The default zero point is 8 for unsigned 4-bit quantization. + let zero_point = ${p}(8);`} + let scale = ${o.getByOffset(`b_row * n_blocks_per_col + block`)}; + let b_data = ${a.getByIndices(`${a.type.indices}(b_row, block, 0)`)}; + var word_offset = local_id.x * ${t.blockSize/d}; + for (var i: u32 = 0; i < ${f}; i++) { + ${_()} + let b_value = ${f===1?`b_data`:`b_data[i]`}; + let b_value_lower = unpack4xU8(b_value & 0x0F0F0F0Fu); + let b_value_upper = unpack4xU8((b_value >> 4) & 0x0F0F0F0Fu); + let b_quantized_values = mat2x4<${p}>(${Array.from({length:4},(e,t)=>`${p}(b_value_lower[${t}]), ${p}(b_value_upper[${t}])`).join(`, `)}); + let b_dequantized_values = (b_quantized_values - mat2x4<${p}>(${Array(8).fill(`zero_point`).join(`,`)})) * scale; + inter_results[local_id.y][local_id.x] += ${Array.from({length:2},(e,t)=>`${`dot(a_data${t}, b_dequantized_values[${t}])`}`).join(` + `)}; + word_offset += ${8/d}; + } + workgroupBarrier(); + } + + if (local_idx < ${h}) { + var output_value: ${u.type.value} = ${u.type.value}(0); + for (var b = 0u; b < ${g}; b++) { + output_value += inter_results[local_idx][b]; + } + if (col + local_idx < uniforms.output_shape[2]) + { + ${u.setByIndices(`${u.type.indices}(batch, row, col + local_idx)`,`output_value`)} + } + } + }`};return{name:`BlockwiseMatMulNBits32`,shaderCache:{hint:`${t.blockSize};${d};${f};${g};${h}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:p,dataType:u}],dispatchGroup:{x:b},programUniforms:x}),getShaderSource:T}},fl=(e,t)=>{ll(e.inputs,t),t.blockSize===32&&e.adapterInfo.isVendor(`intel`)&&e.adapterInfo.isArchitecture(`gen-12lp`)?e.compute(dl(e.inputs,t)):e.compute(ul(e.inputs,t))},pl=e=>Xn(e)}),hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl=M(()=>{"use strict";H(),G(),X(),hl=e=>{if(!e||e.length<1)throw Error(`Too few inputs`);if(e[0].dataType!==1&&e[0].dataType!==10)throw Error(`Input type must be float or float16.`);if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw Error(`The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].`)}},gl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; + if (k < 0) { + break; + } + if (k >= i32(${q(`uniforms.x_shape`,i,t)})) { + break; + } + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); + `;return` + value = ${e.type.value}(uniforms.constant_value); + for (var i = 0; i < 1; i++) { + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + } + `},_l=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; + if (k < 0) { + k = -k; + } + { + let _2n_1 = 2 * (i32(${q(`uniforms.x_shape`,i,t)}) - 1); + k = k % _2n_1; + if(k >= i32(${q(`uniforms.x_shape`,i,t)})) { + k = _2n_1 - k; + } + } + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); + `;return` + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + `},vl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; + if (k < 0) { + k = 0; + } + if (k >= i32(${q(`uniforms.x_shape`,i,t)})) { + k = i32(${q(`uniforms.x_shape`,i,t)}) - 1; + } + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); + `;return` + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + `},yl=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${q(`uniforms.pads`,i,n)}; + if (k < 0) { + k += i32(${q(`uniforms.x_shape`,i,t)}]); + } + if (k >= i32(${q(`uniforms.x_shape`,i,t)})) { + k -= i32(${q(`uniforms.x_shape`,i,t)}); + } + offset += k * i32(${q(`uniforms.x_strides`,i,t)}); + `;return` + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + `},bl=(e,t,n)=>{switch(n.mode){case 0:return gl(e,t,n.pads.length);case 1:return _l(e,t,n.pads.length);case 2:return vl(e,t,n.pads.length);case 3:return yl(e,t,n.pads.length);default:throw Error(`Invalid mode`)}},xl=(e,t)=>{let n=W.padShape(e[0].dims.slice(),t.pads),r=e[0].dims,i=W.size(n),a=[{type:12,data:i},{type:6,data:t.pads}],o=e.length>=3&&e[2].data;t.mode===0&&a.push({type:o?e[2].dataType:1,data:t.value}),a.push(...K(e[0].dims,n));let s=[`rank`],c=i=>{let a=Y(`output`,e[0].dataType,n.length),s=J(`x`,e[0].dataType,r.length),c=s.type.value,l=bl(a,r.length,t),u=[{name:`output_size`,type:`u32`},{name:`pads`,type:`i32`,length:t.pads.length}];return t.mode===0&&u.push({name:`constant_value`,type:o?c:`f32`}),` + ${i.registerUniforms(u).declareVariables(s,a)} + ${i.mainStart()} + ${i.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let indices = ${a.offsetToIndices(`global_idx`)}; + + var value = ${c}(0); + ${l} + output[global_idx] = value; + }`};return{name:`Pad`,shaderCache:{hint:`${t.mode}${o}`,inputDependencies:s},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(W.size(n)/64)},programUniforms:a}),getShaderSource:c}},Sl=(e,t)=>{if(e.length>1){let n=e[1].getBigInt64Array(),r=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,i=e[0].dims.length,a=new Int32Array(2*i).fill(0);if(e.length>=4){let t=e[3].getBigInt64Array();for(let e=0;ea[Number(t)]=Number(e));let o=[];return a.forEach(e=>o.push(e)),{mode:t.mode,value:r,pads:o}}else return t},Cl=(e,t)=>{hl(e.inputs);let n=Sl(e.inputs,t);e.compute(xl(e.inputs,n),{inputs:[0]})}}),Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl=M(()=>{"use strict";et(),H(),G(),X(),Tl=e=>{if(ye.webgpu.validateInputContent&&(!e||e.length!==1))throw Error(`Pool ops requires 1 input.`)},El=(e,t,n)=>{let r=t.format===`NHWC`,i=e.dims.slice();r&&i.splice(1,0,i.pop());let a=Object.hasOwnProperty.call(t,`dilations`),o=t.kernelShape.slice(),s=t.strides.slice(),c=a?t.dilations.slice():[],l=t.pads.slice();_n.adjustPoolAttributes(n,i,o,s,c,l);let u=_n.computePoolOutputShape(n,i,s,c,o,l,t.autoPad),d=Object.assign({},t);a?Object.assign(d,{kernelShape:o,strides:s,pads:l,dilations:c,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:o,strides:s,pads:l,cacheKey:t.cacheKey});let f=u.slice();return f.push(f.splice(1,1)[0]),[d,r?f:u]},Dl=(e,t)=>{let n=t.format===`NHWC`,r=W.size(e),i=W.size(t.kernelShape),a=[{type:12,data:r},{type:12,data:i}],o=[{name:`outputSize`,type:`u32`},{name:`kernelSize`,type:`u32`}];if(t.kernelShape.length<=2){let e=t.kernelShape[t.kernelShape.length-1],n=t.strides[t.strides.length-1],r=t.pads[t.pads.length/2-1],i=t.pads[t.pads.length-1],s=!!(r+i);a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kw`,type:`u32`},{name:`sw`,type:`u32`},{name:`pwStart`,type:`u32`},{name:`pwEnd`,type:`u32`});let c=!1;if(t.kernelShape.length===2){let e=t.kernelShape[t.kernelShape.length-2],n=t.strides[t.strides.length-2],r=t.pads[t.pads.length/2-2],i=t.pads[t.pads.length-2];c=!!(r+i),a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kh`,type:`u32`},{name:`sh`,type:`u32`},{name:`phStart`,type:`u32`},{name:`phEnd`,type:`u32`})}return[a,o,!0,s,c]}else{if(n)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let e=W.computeStrides(t.kernelShape);a.push({type:12,data:e},{type:12,data:t.pads},{type:12,data:t.strides}),o.push({name:`kernelStrides`,type:`u32`,length:e.length},{name:`pads`,type:`u32`,length:t.pads.length},{name:`strides`,type:`u32`,length:t.strides.length});let r=t.pads.reduce((e,t)=>e+t);return[a,o,!!r,!1,!1]}},Ol=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f=i.format===`NHWC`,p=t.type.value,m=Y(`output`,t.type.tensor,r);if(i.kernelShape.length<=2){let r=``,l=``,h=``,g=n-(f?2:1);if(r=u?` + for (var i: u32 = 0u; i < uniforms.kw; i++) { + xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i; + if (xIndices[${g}] < 0 || xIndices[${g}] + >= uniforms.x_shape[${g}]) { + pad++; + continue; + } + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + }`:` + for (var i: u32 = 0u; i < uniforms.kw; i++) { + xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i; + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + }`,i.kernelShape.length===2){let e=n-(f?3:2);l=d?` + for (var j: u32 = 0u; j < uniforms.kh; j++) { + xIndices[${e}] = indices[${e}] * uniforms.sh - uniforms.phStart + j; + if (xIndices[${e}] < 0 || xIndices[${e}] >= uniforms.x_shape[${e}]) { + pad += i32(uniforms.kw); + continue; + } + `:` + for (var j: u32 = 0u; j < uniforms.kh; j++) { + xIndices[${e}] = indices[${e}] * uniforms.sh - uniforms.phStart + j; + `,h=` + } + `}return` + ${e.registerUniforms(c).declareVariables(t,m)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + + let indices = ${m.offsetToIndices(`global_idx`)}; + var xIndices = ${m.offsetToIndices(`global_idx`)}; + + var value = ${p}(${s}); + var pad = 0; + ${l} + ${r} + ${h} + ${o} + + output[global_idx] = value; + }`}else{if(f)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let r=i.kernelShape.length,u=i.pads.length,d=``;return d=l?` + if (xIndices[j] >= uniforms.x_shape[j]) { + pad++; + isPad = true; + break; + } + } + if (!isPad) { + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + }`:` + } + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + `,` + ${e.registerUniforms(c).declareVariables(t,m)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + let indices = ${m.offsetToIndices(`global_idx`)}; + var xIndices = ${m.offsetToIndices(`global_idx`)}; + + var offsets: array; + + var value = ${p}(${s}); + var pad = 0; + var isPad = false; + + for (var i: u32 = 0u; i < uniforms.kernelSize; i++) { + var offset = i; + for (var j = 0u; j < ${r-1}u; j++) { + offsets[j] = offset / ${q(`uniforms.kernelStrides`,`j`,r)}; + offset -= offsets[j] * ${q(`uniforms.kernelStrides`,`j`,r)}; + } + offsets[${r-1}] = offset; + + isPad = false; + for (var j = ${n-r}u; j < ${n}u; j++) { + xIndices[j] = indices[j] * ${q(`uniforms.strides`,`j - ${n-r}u`,r)} + + offsets[j - ${n-r}u] - ${q(`uniforms.pads`,`j - 2u`,u)}; + ${d} + } + ${o} + + output[global_idx] = value; + }`}},kl=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,Al=e=>`${kl(e)};${e.countIncludePad}`,jl=e=>`${kl(e)};${e.storageOrder};${e.dilations}`,Ml=e=>({format:e.format,autoPad:[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),Nl=(e,t,n,r)=>{let[i,a]=El(t,r,n),o=J(`x`,t.dataType,t.dims.length),s=o.type.value,c=`value += x_val;`,l=``;i.countIncludePad?l+=`value /= ${s}(uniforms.kernelSize);`:l+=`value /= ${s}(i32(uniforms.kernelSize) - pad);`;let[u,d,f,p,m]=Dl(a,i);u.push(...K(t.dims,a));let h=[`rank`];return{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(W.size(a)/64)},programUniforms:u}),getShaderSource:e=>Ol(e,o,t.dims.length,a.length,i,c,l,0,d,f,p,m)}},Pl=e=>{let t=e.count_include_pad!==0,n=Ml(e);if(n.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for AveragePool`);let r={countIncludePad:t,...n,cacheKey:``};return{...r,cacheKey:Al(r)}},Fl=(e,t)=>{Tl(e.inputs),e.compute(Nl(`AveragePool`,e.inputs[0],!1,t))},Il={autoPad:``,ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},Ll=e=>{let t=e.format;return{format:t,...Il,cacheKey:t}},Rl=(e,t)=>{Tl(e.inputs),e.compute(Nl(`GlobalAveragePool`,e.inputs[0],!0,t))},zl=(e,t,n,r)=>{let[i,a]=El(t,r,n),o=` + value = max(x_val, value); + `,s=``,c=J(`x`,t.dataType,t.dims.length),l=[`rank`],[u,d,f,p,m]=Dl(a,i);return u.push(...K(t.dims,a)),{name:e,shaderCache:{hint:`${r.cacheKey};${f};${p};${m}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(W.size(a)/64)},programUniforms:u}),getShaderSource:e=>Ol(e,c,t.dims.length,a.length,i,o,s,t.dataType===10?-65504:-1e5,d,f,p,m)}},Bl=(e,t)=>{Tl(e.inputs),e.compute(zl(`MaxPool`,e.inputs[0],!1,t))},Vl=e=>{let t=e.storage_order,n=e.dilations,r=Ml(e);if(t!==0)throw Error(`column major storage order is not yet supported for MaxPool`);if(r.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for MaxPool`);let i={storageOrder:t,dilations:n,...r,cacheKey:``};return{...i,cacheKey:jl(i)}},Hl=e=>{let t=e.format;return{format:t,...Il,cacheKey:t}},Ul=(e,t)=>{Tl(e.inputs),e.compute(zl(`GlobalMaxPool`,e.inputs[0],!0,t))}}),Gl,Kl,ql,Jl,Yl=M(()=>{"use strict";H(),G(),Zn(),X(),Gl=(e,t)=>{if(e.length<2||e.length>3)throw Error(`DequantizeLinear requires 2 or 3 inputs.`);if(e.length===3&&e[1].dims===e[2].dims)throw Error(`x-scale and x-zero-point must have the same shape.`);if(e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[0].dataType===6&&e.length>2)throw Error(`In the case of dequantizing int32 there is no zero point.`);if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw Error(`scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.`);if(e.length>2){if(e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[1].dims.length!==e[2].dims.length)throw Error(`scale and zero-point inputs must have the same rank.`);if(!e[1].dims.map((t,n)=>t===e[2].dims[n]).reduce((e,t)=>e&&t,!0))throw Error(`scale and zero-point inputs must have the same shape.`)}if(t.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw Error(`blockSize must be set only for block quantization.`);if(!e[1].dims.map((n,r)=>r===t.axis||n===e[0].dims[r]).reduce((e,t)=>e&&t,!0))throw Error(`For block qunatization, scale input shape to match the input shape except for the axis`);if(e[1].dims.length!==e[0].dims.length)throw Error(`For block qunatization the scale input rank must be the same as the x rank.`);let n=e[0].dims[t.axis],r=e[1].dims[t.axis];if(t.blockSizeMath.ceil(n/(r-1)-1))throw Error(`blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].`)}},Kl=(e,t)=>{let n=W.normalizeAxis(t.axis,e[0].dims.length),r=e[0].dataType,i=r===3,a=e[0].dims,o=e[1].dataType,s=W.size(a),c=r===3||r===2,l=c?[Math.ceil(W.size(e[0].dims)/4)]:e[0].dims,u=e[1].dims,d=e.length>2?e[2]:void 0,f=d?c?[Math.ceil(W.size(d.dims)/4)]:d.dims:void 0,p=u.length===0||u.length===1&&u[0]===1,m=p===!1&&u.length===1,h=nr(s),g=p&&(!c||h===4),_=g?h:1,v=g&&!c?h:1,y=J(`input`,c?12:r,l.length,v),b=J(`scale`,o,u.length),x=d?J(`zero_point`,c?12:r,f.length):void 0,S=Y(`output`,o,a.length,_),C=[y,b];x&&C.push(x);let w=[l,u];d&&w.push(f);let T=[{type:12,data:s/_},{type:12,data:n},{type:12,data:t.blockSize},...K(...w,a)],E=e=>{let t=[{name:`output_size`,type:`u32`},{name:`axis`,type:`u32`},{name:`block_size`,type:`u32`}];return` + ${e.registerUniforms(t).declareVariables(...C,S)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let output_indices = ${S.offsetToIndices(`global_idx`)}; + + // Set input x + ${c?` + let input = ${y.getByOffset(`global_idx / 4`)}; + let x_vec = ${i?`unpack4xI8(input)`:`unpack4xU8(input)`}; + let x_value = ${_===1?`x_vec[global_idx % 4]`:`x_vec`};`:`let x_value = ${y.getByOffset(`global_idx`)};`}; + + // Set scale input + ${p?`let scale_value= ${b.getByOffset(`0`)}`:m?` + let scale_index = ${S.indicesGet(`output_indices`,`uniforms.axis`)}; + let scale_value= ${b.getByOffset(`scale_index`)};`:` + var scale_indices: ${b.type.indices} = output_indices; + let index = ${b.indicesGet(`scale_indices`,`uniforms.axis`)} / uniforms.block_size; + ${b.indicesSet(`scale_indices`,`uniforms.axis`,`index`)}; + let scale_value= ${b.getByIndices(`scale_indices`)};`}; + + // Set zero-point input + ${x?p?c?` + let zero_point_input = ${x.getByOffset(`0`)}; + let zero_point_vec = ${i?`unpack4xI8(zero_point_input)`:`unpack4xU8(zero_point_input)`}; + let zero_point_value= zero_point_vec[0]`:`let zero_point_value = ${x.getByOffset(`0`)}`:m?c?` + let zero_point_index = ${S.indicesGet(`output_indices`,`uniforms.axis`)}; + let zero_point_input = ${x.getByOffset(`zero_point_index / 4`)}; + let zero_point_vec = ${i?`unpack4xI8(zero_point_input)`:`unpack4xU8(zero_point_input)`}; + let zero_point_value = zero_point_vec[zero_point_index % 4]`:` + let zero_point_index = ${S.indicesGet(`output_indices`,`uniforms.axis`)}; + let zero_point_value = ${x.getByOffset(`zero_point_index`)};`:c?` + let zero_point_offset = ${b.indicesToOffset(`scale_indices`)}; + let zero_point_input = ${x.getByOffset(`zero_point_offset / 4`)}; + let zero_point_vec = ${i?`unpack4xI8(zero_point_input)`:`unpack4xU8(zero_point_input)`}; + let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${x.getByIndices(`scale_indices`)};`:`let zero_point_value = ${c?i?`i32`:`u32`:y.type.value}(0);`}; + // Compute and write output + ${S.setByOffset(`global_idx`,`${S.type.value}(x_value - zero_point_value) * scale_value`)}; + }`};return{name:`DequantizeLinear`,shaderCache:{hint:t.cacheKey,inputDependencies:x?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getShaderSource:E,getRunData:()=>({outputs:[{dims:a,dataType:o}],dispatchGroup:{x:Math.ceil(s/_/64),y:1,z:1},programUniforms:T})}},ql=(e,t)=>{Gl(e.inputs,t),e.compute(Kl(e.inputs,t))},Jl=e=>Xn({axis:e.axis,blockSize:e.blockSize})}),Xl,Zl,Ql,$l=M(()=>{"use strict";et(),H(),X(),Xl=(e,t,n)=>{let r=e===t,i=et&&n>0;if(r||i||a)throw Error(`Range these inputs' contents are invalid.`)},Zl=(e,t,n,r)=>{let i=Math.abs(Math.ceil((t-e)/n)),a=[i],o=i,s=[{type:12,data:o},{type:r,data:e},{type:r,data:n},...K(a)],c=e=>{let t=Y(`output`,r,a.length),n=t.type.value,i=[{name:`outputSize`,type:`u32`},{name:`start`,type:n},{name:`delta`,type:n}];return` + ${e.registerUniforms(i).declareVariables(t)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + output[global_idx] = uniforms.start + ${n}(global_idx) * uniforms.delta; + }`};return{name:`Range`,shaderCache:{hint:`${r}`},getShaderSource:c,getRunData:()=>({outputs:[{dims:a,dataType:r}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:s})}},Ql=e=>{let t=0,n=0,r=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],n=e.inputs[1].getInt32Array()[0],r=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],n=e.inputs[1].getFloat32Array()[0],r=e.inputs[2].getFloat32Array()[0]),ye.webgpu.validateInputContent&&Xl(t,n,r),e.compute(Zl(t,n,r,e.inputs[0].dataType),{inputs:[]})}}),eu,tu,nu,ru,iu,au,ou=M(()=>{"use strict";H(),G(),Zn(),X(),eu=(e,t,n,r)=>{if(e!==`none`&&r!==`i32`&&r!==`u32`&&r!==`f32`)throw Error(`Input ${r} is not supported with reduction ${e}.`);let i=`{ + var oldValue = 0; + loop { + let newValueF32 =`,a=`; + let newValue = bitcast(newValueF32); + let res = atomicCompareExchangeWeak(&${t}, oldValue, newValue); + if res.exchanged { + break; + } + oldValue = res.old_value; + } + }`;switch(e){case`none`:return`${t}=${n};`;case`add`:return r===`i32`||r===`u32`?`atomicAdd(&${t}, bitcast<${r}>(${n}));`:` + ${i}bitcast<${r}>(oldValue) + (${n})${a}`;case`max`:return r===`i32`||r===`u32`?`atomicMax(&${t}, bitcast<${r}>(${n}));`:` + ${i}max(bitcast(oldValue), (${n}))${a}`;case`min`:return r===`i32`||r===`u32`?`atomicMin(&${t}, bitcast<${r}>(${n}));`:`${i}min(bitcast<${r}>(oldValue), (${n}))${a}`;case`mul`:return`${i}(bitcast<${r}>(oldValue) * (${n}))${a}`;default:throw Error(`Reduction ${e} is not supported.`)}},tu=(e,t)=>`${e===1?` + let element_count_dim = uniforms.output_strides; + let dim_value = uniforms.output_shape;`:` + let element_count_dim = uniforms.output_strides[${t?`i - indices_start`:`i`}]; + let dim_value = uniforms.output_shape[${t?`i - indices_start`:`i`} + uniforms.last_index_dimension];`} + + if (index >= 0) { + if (index >= i32(dim_value)) { + index = i32(dim_value - 1); + } + } else { + if (index < -i32(dim_value)) { + index = 0; + } else { + index += i32(dim_value); + } + } + data_offset += u32((u32(index) * element_count_dim));`,nu=(e,t,n)=>`for (var i = 0u; i < uniforms.num_updates_elements; i++) { + let value = updates[uniforms.num_updates_elements * ${n?`global_idx`:`idx`} + i]; + ${eu(e.reduction,`output[data_offset + i]`,`value`,t)} + }`,ru=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n,a=1,o=Math.ceil(W.size(r)/a),s=r[r.length-1],c=W.sizeFromDimension(n,s),l=W.sizeFromDimension(r,0)/s,u=[{type:12,data:o},{type:12,data:s},{type:12,data:c},...K(e[1].dims,e[2].dims,i)],d=r=>{let o=J(`indices`,e[1].dataType,e[1].dims.length),s=J(`updates`,e[2].dataType,e[2].dims.length,a),c=t.reduction!==`none`&&t.reduction!==``?sr(`output`,e[0].dataType,i.length):Y(`output`,e[0].dataType,i.length,a);return` + ${r.registerUniform(`output_size`,`u32`).registerUniform(`last_index_dimension`,`u32`).registerUniform(`num_updates_elements`,`u32`).declareVariables(o,s,c)} + ${r.mainStart()} + ${r.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + var hasDuplicates = false; + if (${t.reduction===`none`}) { + for (var i = 0; i < ${l}; i = i + 1) { + for (var j = i + 1; j < ${l}; j = j + 1) { + var index_i = i32(indices[i].x); + var index_j = i32(indices[j].x); + if (index_i == index_j) { + hasDuplicates = true; + break; + } + } + if (hasDuplicates) { + break; + } + } + } + + if (${t.reduction===`none`} && hasDuplicates) { + if (global_idx != 0u) { + return; + } + // Process each index-update pair individually when duplicates exist + for (var idx = 0u; idx < ${l}u; idx++) { + var data_offset = 0u; + for (var i = 0u; i < uniforms.last_index_dimension; i++) { + var index = i32(indices[idx * uniforms.last_index_dimension + i].x); + ${tu(n.length,!1)} + } + ${nu(t,c.type.value,!1)} + } + return; + } + + var data_offset = 0u; + var indices_start = uniforms.last_index_dimension * global_idx; + var indices_end = indices_start + uniforms.last_index_dimension; + for (var i = indices_start; i < indices_end; i++) { + var index = i32(indices[i].x); + ${tu(n.length,!0)} + } + ${nu(t,c.type.value,!0)} + }`};return{name:`ScatterND`,shaderCache:{hint:`${t.cacheKey}_${t.reduction}`,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:u}),getShaderSource:d}},iu=e=>Xn({reduction:e.reduction}),au=(e,t)=>{e.compute(ru(e.inputs,t),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du=M(()=>{"use strict";H(),G(),Zn(),X(),su=(e,t)=>{if(e.every(e=>e>0||(()=>{throw Error(`Resize requires scales input values to be positive`)})),e.length>0){if(t.mode===`linear`){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and + one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(t.mode===`cubic`&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw Error(`Resize requires scales input size to be 2 or 4 for cubic mode`)}},cu=(e,t,n)=>{t.every(e=>e>=0&&e{throw Error(`Resize requires axes input values to be positive and less than rank`)}));let r=Array(n).fill(1);return t.forEach((t,n)=>r[t]=e[n]),r},lu=(e,t,n,r,i,a)=>{let[o,s,c]=n>10?[1,2,3]:[-1,e.length>1?1:-1,-1],l=e[0].dims.length;if(o>0&&e.length>o&&e[o].dims.length>0)e[o].getFloat32Array().forEach(e=>a.push(e));else if(t.coordinateTransformMode===`tf_crop_and_resize`)throw Error(`Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize`);if(s>0&&e.length>s&&e[s].dims.length===1&&e[s].dims[0]>0){if(e[s].getFloat32Array().forEach(e=>r.push(e)),r.length!==0&&r.length!==l&&n>=18&&r.length!==t.axes.length)throw Error(`Resize requires scales input size to be same as input rank or axes size for opset 18 and up`);su(r,t),t.axes.length>0&&cu(r,t.axes,l).forEach((e,t)=>r[t]=e)}if(c>0&&e.length>c&&e[c].dims.length===1&&e[c].dims[0]>0&&(e[c].getBigInt64Array().forEach(e=>i.push(Number(e))),i.length!==0&&i.length!==l&&n>=18&&i.length!==t.axes.length))throw Error(`Resize requires sizes input size to be same as input rank or axes size for opset 18 and up`);if(t.axes.length>0){if(r.length!==0&&r.length!==t.axes.length)throw Error(`Resize requires "scales" input size to be of axes rank when axes attributes is specified`);if(i.length!==0&&i.length!==t.axes.length)throw Error(`Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified`)}if(typeof r<`u`&&typeof i<`u`&&r.length>0&&i.length>l)throw Error(`Resize requires only of scales or sizes to be specified`)},uu=(e,t,n,r)=>` + // The whole part and the fractional part are calculated separately due to inaccuracy of floating + // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an + // offset-by-one error later in floor(). + let big = (${e}) * (${t}); + let whole = ${r}(big / (${n})); + let fract = ${r}(big % (${n})) / ${r}(${n}); + return whole + fract; +`,du=(e,t)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32, + lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${t} { `+(()=>{switch(e){case`asymmetric`:return` + if (xScale < 1.0 || floor(xScale) != xScale) { + return ${t}(xResized) / ${t}(xScale); + } else { + ${uu(`xResized`,`lengthOriginal`,`lengthResized`,t)} + } + `;case`pytorch_half_pixel`:return`if (lengthResized > 1) { + return (${t}(xResized) + 0.5) / ${t}(xScale) - 0.5; + } else { + return 0.0; + }`;case`tf_half_pixel_for_nn`:return`return (${t}(xResized) + 0.5) / ${t}(xScale);`;case`align_corners`:return`if (lengthResized == 1) { + return 0.0; + } else { + ${uu(`xResized`,`lengthOriginal - 1`,`lengthResized - 1`,t)} + }`;case`tf_crop_and_resize`:return`if (lengthResized > 1) { + return ${t}(roiStart) * ${t}(lengthOriginal - 1) + + (${t}(xResized) * ${t}(roiEnd - roiStart) * ${t}(lengthOriginal - 1)) / + ${t}(lengthResized - 1); + } else { + return 0.5 * ${t}(roiStart + roiEnd) * ${t}(lengthOriginal - 1); + }`;case`half_pixel_symmetric`:return`const outputWidth = ${t}xScale * ${t}(lengthResized); + const adjustment = ${t}(lengthResized) / outputWidth; + const center = ${t}(lengthOriginal) / 2; + const offset = center * (1 - adjustment); + return offset + ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;case`half_pixel`:return`return ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;default:throw Error(`Coordinate transform mode ${e} is not supported`)}})()+`}`,fu=(e,t,n)=>`fn getNearestPixelFromOriginal(xOriginal: ${n}, isDownSample: bool) -> ${n} {`+(()=>{switch(e){case`round_prefer_ceil`:return`if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }`;case`floor`:return`return floor(xOriginal);`;case`ceil`:return`return ceil(xOriginal);`;case`round_prefer_floor`:return`if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }`;case`simple`:default:if(t<11)return`if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }`;throw Error(`Nearest mode ${e} is not supported`)}})()+`}`,pu=(e,t,n)=>{let r=Array(n).fill(0).concat(Array(n).fill(1)),i=e.length===0?r:e.slice();return t.length>0?(t.forEach((e,a)=>{r[e]=i[a],r[a+n]=i[t.length+a]}),r):i},mu=(e,t,n,r)=>{let i=[];if(n.length>0)if(r.length>0){if(e.forEach(e=>i.push(e)),Math.max(...r)>e.length)throw Error(`axes is out of bound`);r.forEach((e,t)=>i[e]=n[t])}else n.forEach(e=>i.push(e));else{if(t.length===0)throw Error(`Resize requires either scales or sizes.`);i=e.map((e,n)=>Math.round(e*t[n]))}return i},hu=(e,t,n)=>{let r=(()=>{switch(n.keepAspectRatioPolicy){case`not_larger`:return n.axes.length>0?Math.min(...n.axes.map(e=>t[e]),Number.MAX_VALUE):Math.min(...t,Number.MAX_VALUE);case`not_smaller`:return n.axes.length>0?Math.max(...n.axes.map(e=>t[e]),Number.MIN_VALUE):Math.max(...t,Number.MIN_VALUE);default:throw Error(`Keep aspect ratio policy ${n.keepAspectRatioPolicy} is not supported`)}})();t.fill(1,0,t.length);let i=e.slice();return n.axes.length>0?(n.axes.forEach(e=>t[e]=r),n.axes.forEach(n=>i[n]=Math.round(e[n]*t[n]))):(t.fill(r,0,t.length),i.forEach((e,n)=>i[n]=Math.round(e*t[n]))),i},gu=(e,t,n,r,i)=>` + fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${n.length}> { + var original_indices: array<${e.type.value}, ${n.length}>; + for (var i:u32 = 0; i < ${n.length}; i++) { + var output_index = ${e.indicesGet(`output_indices`,`i`)}; + var scale = ${q(`uniforms.scales`,`i`,r)}; + var roi_low = ${q(`uniforms.roi`,`i`,i)}; + var roi_hi = ${q(`uniforms.roi`,`i + ${t.length}`,i)}; + if (scale == 1.0) { + original_indices[i] = ${e.type.value}(output_index); + } else { + var input_shape_i = ${q(`uniforms.input_shape`,`i`,t.length)}; + var output_shape_i = ${q(`uniforms.output_shape`,`i`,n.length)}; + original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, + input_shape_i, roi_low, roi_hi); + } + } + return original_indices; + }`,_u=(e,t,n,r,i,a,o)=>` + fn calculateInputIndicesFromOutputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { + var input_indices: ${e.type.indices}; + for (var i:u32 = 0; i < ${r.length}; i++) { + var output_index = ${t.indicesGet(`output_indices`,`i`)}; + var input_index: u32; + var scale = ${q(`uniforms.scales`,`i`,i)}; + if (scale == 1.0) { + input_index = output_index; + } else { + var roi_low = ${q(`uniforms.roi`,`i`,a)}; + var roi_hi = ${q(`uniforms.roi`,`i + ${n.length}`,a)}; + var input_shape_i = ${q(`uniforms.input_shape`,`i`,n.length)}; + var output_shape_i = ${q(`uniforms.output_shape`,`i`,r.length)}; + var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, + input_shape_i, roi_low, roi_hi); + if (!${o} || (original_idx >= 0 && original_idx < ${t.type.value}(input_shape_i))) { + if (original_idx < 0) { + input_index = 0; + } else if (original_idx > ${t.type.value}(input_shape_i - 1)) { + input_index = input_shape_i - 1; + } else { + input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1)); + } + } else { + input_index = u32(original_idx); + } + } + ${e.indicesSet(`input_indices`,`i`,`input_index`)} + } + return input_indices; + }`,vu=(e,t)=>` + fn checkInputIndices(input_indices: ${e.type.indices}) -> bool { + for (var i:u32 = 0; i < ${t.length}; i++) { + var input_index = ${e.indicesGet(`input_indices`,`i`)}; + if (input_index < 0 || input_index >= ${q(`uniforms.input_shape`,`i`,t.length)}) { + return false; + } + } + return true; + }`,yu=(e,t,n,r)=>e.rank>r?` + ${e.indicesSet(`input_indices`,t,`channel`)}; + ${e.indicesSet(`input_indices`,n,`batch`)}; +`:``,bu=(e,t,n,r,i)=>{let[a,o,s,c]=n.length===2?[-1,0,1,-1]:[0,2,3,1],l=e.type.value;return` + fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${l} { + var input_indices: ${e.type.indices}; + ${e.indicesSet(`input_indices`,o,`max(0, min(row, ${n[o]} - 1))`)}; + ${e.indicesSet(`input_indices`,s,`max(0, min(col, ${n[s]} - 1))`)}; + ${yu(e,c,a,2)} + return ${e.getByIndices(`input_indices`)}; + } + + fn bilinearInterpolation(output_indices: ${t.type.indices}) -> ${l} { + var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); + var row:${l} = originalIndices[${o}]; + var col:${l} = originalIndices[${s}]; + ${r?`if (row < 0 || row > (${n[o]} - 1) || col < 0 || col > (${n[s]} - 1)) { + return ${i}; + }`:``}; + row = max(0, min(row, ${n[o]} - 1)); + col = max(0, min(col, ${n[s]} - 1)); + var row1: u32 = u32(row); + var col1: u32 = u32(col); + var row2: u32 = u32(row + 1); + var col2: u32 = u32(col + 1); + var channel: u32 = ${n.length>2?`u32(originalIndices[${c}])`:`0`}; + var batch: u32 = ${n.length>2?`u32(originalIndices[${a}])`:`0`}; + var x11: ${l} = getInputValue(batch, channel, row1, col1); + var x12: ${l} = getInputValue(batch, channel, row1, col2); + var x21: ${l} = getInputValue(batch, channel, row2, col1); + var x22: ${l} = getInputValue(batch, channel, row2, col2); + var dx1: ${l} = abs(row - ${l}(row1)); + var dx2: ${l} = abs(${l}(row2) - row); + var dy1: ${l} = abs(col - ${l}(col1)); + var dy2: ${l} = abs(${l}(col2) - col); + if (row1 == row2) { + dx1 = 0.5; + dx2 = 0.5; + } + if (col1 == col2) { + dy1 = 0.5; + dy2 = 0.5; + } + return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1); + }`},xu=(e,t,n,r,i,a,o,s,c,l)=>{let u=n.length===2,d=!0,[f,p]=u?[0,1]:d?[2,3]:[1,2],m=e.type.value,h=o=>{let u=o===f?`row`:`col`;return` + fn ${u}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${t.type.indices}) -> ${m} { + var output_index = ${t.indicesGet(`output_indices`,o)}; + var originalIdx: ${m} = getOriginalCoordinateFromResizedCoordinate(output_index, ${i[o]}, + ${r[o]}, ${n[o]}, ${a[o]}, ${a[o]} + ${n.length}); + var fractOriginalIdx: ${m} = originalIdx - floor(originalIdx); + var coefs = getCubicInterpolationCoefs(fractOriginalIdx); + + if (${s} && (originalIdx < 0 || originalIdx > (${n[o]} - 1))) { + return ${c}; + } + var data: array<${m}, 4> = array<${m}, 4>(0.0, 0.0, 0.0, 0.0); + for (var i: i32 = -1; i < 3; i++) { + var ${u}: ${m} = originalIdx + ${m}(i); + if (${u} < 0 || ${u} >= ${n[o]}) { + ${l?`coefs[i + 1] = 0.0; + continue;`:s?`return ${c};`:`${u} = max(0, min(${u}, ${n[o]} - 1));`}; + } + var input_indices_copy: ${e.type.indices} = input_indices; + ${e.indicesSet(`input_indices_copy`,o,`u32(${u})`)}; + data[i + 1] = ${o===f?e.getByIndices(`input_indices_copy`):`rowCubicInterpolation(input_indices_copy, output_indices)`}; + } + return cubicInterpolation1D(data, coefs); + }`};return` + ${h(f)}; + ${h(p)}; + fn getCubicInterpolationCoefs(s: ${m}) -> array<${m}, 4> { + var absS = abs(s); + var coeffs: array<${m}, 4> = array<${m}, 4>(0.0, 0.0, 0.0, 0.0); + var oneMinusAbsS: ${m} = 1.0 - absS; + var twoMinusAbsS: ${m} = 2.0 - absS; + var onePlusAbsS: ${m} = 1.0 + absS; + coeffs[0] = ((${o} * onePlusAbsS - 5 * ${o}) * onePlusAbsS + 8 * ${o}) * onePlusAbsS - 4 * ${o}; + coeffs[1] = ((${o} + 2) * absS - (${o} + 3)) * absS * absS + 1; + coeffs[2] = ((${o} + 2) * oneMinusAbsS - (${o} + 3)) * oneMinusAbsS * oneMinusAbsS + 1; + coeffs[3] = ((${o} * twoMinusAbsS - 5 * ${o}) * twoMinusAbsS + 8 * ${o}) * twoMinusAbsS - 4 * ${o}; + return coeffs; + } + + fn cubicInterpolation1D(x: array<${m}, 4>, coefs: array<${m}, 4>) -> ${m} { + var coefsSum: ${m} = coefs[0] + coefs[1] + coefs[2] + coefs[3]; + return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum; + } + + fn bicubicInterpolation(output_indices: ${t.type.indices}) -> ${m} { + var input_indices: ${e.type.indices} = output_indices; + return colCubicInterpolation(input_indices, output_indices); + } + `},Su=(e,t,n,r,i)=>{let[a,o,s,c,l]=n.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],u=e.type.value;return` + fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${u} { + var input_indices: ${e.type.indices}; + ${e.indicesSet(`input_indices`,o,`max(0, min(depth, ${n[o]} - 1))`)}; + ${e.indicesSet(`input_indices`,s,`max(0, min(height, ${n[s]} - 1))`)}; + ${e.indicesSet(`input_indices`,c,`max(0, min(width, ${n[c]} - 1))`)}; + ${yu(e,l,a,3)} + return ${e.getByIndices(`input_indices`)}; + } + + fn trilinearInterpolation(output_indices: ${t.type.indices}) -> ${u} { + var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); + var depth:${u} = originalIndices[${o}]; + var height:${u} = originalIndices[${s}]; + var width:${u} = originalIndices[${c}]; + ${r?`if (depth < 0 || depth > (${n[o]} - 1) || height < 0 || height > (${n[s]} - 1) || width < 0 || (width > ${n[c]} - 1)) { + return ${i}; + }`:``}; + + depth = max(0, min(depth, ${n[o]} - 1)); + height = max(0, min(height, ${n[s]} - 1)); + width = max(0, min(width, ${n[c]} - 1)); + var depth1: u32 = u32(depth); + var height1: u32 = u32(height); + var width1: u32 = u32(width); + var depth2: u32 = u32(depth + 1); + var height2: u32 = u32(height + 1); + var width2: u32 = u32(width + 1); + var channel: u32 = ${n.length>3?`u32(originalIndices[${l}])`:`0`}; + var batch: u32 = ${n.length>3?`u32(originalIndices[${a}])`:`0`}; + + var x111: ${u} = getInputValue(batch, channel, depth1, height1, width1); + var x112: ${u} = getInputValue(batch, channel, depth1, height1, width2); + var x121: ${u} = getInputValue(batch, channel, depth1, height2, width1); + var x122: ${u} = getInputValue(batch, channel, depth1, height2, width2); + var x211: ${u} = getInputValue(batch, channel, depth2, height1, width1); + var x212: ${u} = getInputValue(batch, channel, depth2, height1, width2); + var x221: ${u} = getInputValue(batch, channel, depth2, height2, width1); + var x222: ${u} = getInputValue(batch, channel, depth2, height2, width2); + var dx1: ${u} = abs(depth - ${u}(depth1)); + var dx2: ${u} = abs(${u}(depth2) - depth); + var dy1: ${u} = abs(height - ${u}(height1)); + var dy2: ${u} = abs(${u}(height2) - height); + var dz1: ${u} = abs(width - ${u}(width1)); + var dz2: ${u} = abs(${u}(width2) - width); + if (depth1 == depth2) { + dx1 = 0.5; + dx2 = 0.5; + } + if (height1 == height2) { + dy1 = 0.5; + dy2 = 0.5; + } + if (width1 == width2) { + dz1 = 0.5; + dz2 = 0.5; + } + return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 + + x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1); + }`},Cu=(e,t,n,r,i,a)=>{let o=e.dims,s=pu(a,t.axes,o.length),c=mu(o,r,i,t.axes),l=r.slice();r.length===0&&(l=o.map((e,t)=>e===0?1:c[t]/e),t.keepAspectRatioPolicy!==`stretch`&&(c=hu(o,l,t)));let u=Y(`output`,e.dataType,c.length),d=J(`input`,e.dataType,o.length),f=W.size(c),p=o.length===c.length&&o.every((e,t)=>e===c[t]),m=t.coordinateTransformMode===`tf_crop_and_resize`,h=t.extrapolationValue,g=d.type.value,_=e=>` + ${p?``:` + ${du(t.coordinateTransformMode,g)}; + ${(()=>{switch(t.mode){case`nearest`:return` + ${vu(d,o)}; + ${fu(t.nearestMode,n,g)}; + ${_u(d,u,o,c,l.length,s.length,m)}; + `;case`linear`:return` + ${gu(u,o,c,l.length,s.length)}; + ${(()=>{if(o.length===2||o.length===4)return`${bu(d,u,o,m,h)}`;if(o.length===3||o.length===5)return`${Su(d,u,o,m,h)}`;throw Error(`Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.`)})()}; + `;case`cubic`:return` + ${(()=>{if(o.length===2||o.length===4)return`${xu(d,u,o,c,l,s,t.cubicCoeffA,m,t.extrapolationValue,t.excludeOutside)}`;throw Error(`Cubic mode only supports input dims 2 and 4 are supported in linear mode.`)})()}; + `;default:throw Error(`Invalid resize mode`)}})()}; + `} + ${e.registerUniform(`output_size`,`u32`).registerUniform(`scales`,`f32`,l.length).registerUniform(`roi`,`f32`,s.length).declareVariables(d,u)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + ${p?`output[global_idx] = input[global_idx];`:` + let output_indices = ${u.offsetToIndices(`global_idx`)}; + var input_indices: ${d.type.indices}; + ${(()=>{switch(t.mode){case`nearest`:return`input_indices = calculateInputIndicesFromOutputIndices(output_indices); + if (checkInputIndices(input_indices)) { + output[global_idx] = ${d.getByIndices(`input_indices`)}; + } else { + output[global_idx] = ${t.extrapolationValue}; + }`;case`linear`:return`output[global_idx] = ${o.length===2||o.length===4?`bilinearInterpolation`:`trilinearInterpolation`}(output_indices);`;case`cubic`:return`output[global_idx] = bicubicInterpolation(output_indices);`;default:throw Error(`Unsupported resize mode: ${t.mode}`)}})()}; +`} + }`;return{name:`Resize`,shaderCache:{hint:`${t.cacheKey}|${n}|${l.length>0?t.mode===`cubic`?l:l.length:``}|${i.length>0?i:``}|${s.length>0?s:``}|${p}|${t.mode===`nearest`?o.length:o}`,inputDependencies:[`rank`]},getShaderSource:_,getRunData:()=>({outputs:[{dims:c,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},{type:1,data:l},{type:1,data:s},...K(o,c)]})}},wu=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},Tu=(e,t)=>{let n=[],r=[],i=[],a=wu(e);if(t.antialias!==0)throw Error(`Only default value (0) for Antialias attribute is supported`);lu(e.inputs,t,a,n,r,i),e.compute(Cu(e.inputs[0],t,a,n,r,i),{inputs:[0]})},Eu=e=>{let t=e.antialias,n=e.axes,r=e.coordinateTransformMode,i=e.cubicCoeffA,a=e.excludeOutside!==0,o=e.extrapolationValue,s=e.keepAspectRatioPolicy,c=e.mode,l=e.nearestMode===``?`simple`:e.nearestMode;return Xn({antialias:t,axes:n,coordinateTransformMode:r,cubicCoeffA:i,excludeOutside:a,extrapolationValue:o,keepAspectRatioPolicy:s,mode:c,nearestMode:l})}}),Ou,ku,Au,ju=M(()=>{"use strict";H(),G(),X(),Ou=e=>{if(!e||e.length<3)throw Error(`layerNorm requires at least 3 inputs.`);let t=e[0],n=e[1],r=e[2];if(t.dataType!==n.dataType||t.dataType!==r.dataType)throw Error(`All inputs must have the same data type`);if(t.dims.length!==3&&t.dims.length!==2)throw Error(`Input must be 2D or 3D`);if(n.dims.length!==3&&n.dims.length!==2)throw Error(`Skip must be 2D or 3D`);let i=t.dims[t.dims.length-1],a=t.dims[t.dims.length-2];if(n.dims[n.dims.length-1]!==i)throw Error(`Skip must have the same hidden size as input`);if(n.dims[n.dims.length-2]!==a)throw Error(`Skip must have the same sequence length as input`);if(r.dims.length!==1)throw Error(`Gamma must be 1D`);if(r.dims[r.dims.length-1]!==i)throw Error(`Gamma must have the same hidden size as input`);if(e.length>3){let t=e[3];if(t.dims.length!==1)throw Error(`Beta must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Beta must have the same hidden size as input`)}if(e.length>4){let t=e[4];if(t.dims.length!==1)throw Error(`Bias must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Bias must have the same hidden size as input`)}},ku=(e,t,n,r)=>{let i=t.simplified,a=e[0].dims,o=W.size(a),s=a,c=o,l=a.slice(-1)[0],u=r?a.slice(0,-1).concat(1):[],d=!i&&e.length>3,f=e.length>4,p=r&&n>1,m=r&&n>2,h=n>3,g=64,_=nr(l),v=[{type:12,data:c},{type:12,data:_},{type:12,data:l},{type:1,data:t.epsilon}],y=t=>{let n=[{name:`output_size`,type:`u32`},{name:`components`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`epsilon`,type:`f32`}],r=[J(`x`,e[0].dataType,e[0].dims,_),J(`skip`,e[1].dataType,e[1].dims,_),J(`gamma`,e[2].dataType,e[2].dims,_)];d&&r.push(J(`beta`,e[3].dataType,e[3].dims,_)),f&&r.push(J(`bias`,e[4].dataType,e[4].dims,_)),r.push(Y(`output`,e[0].dataType,s,_)),p&&r.push(Y(`mean_output`,1,u)),m&&r.push(Y(`inv_std_output`,1,u)),h&&r.push(Y(`input_skip_bias_sum`,e[0].dataType,s,_));let a=er(e[0].dataType),o=er(1,_);return` + + ${t.registerUniforms(n).declareVariables(...r)} + var sum_shared : array<${o}, ${g}>; + var sum_squared_shared : array<${o}, ${g}>; + + ${t.mainStart([g,1,1])} + let ix = local_id.x; + let iy = global_id.x / ${g}; + + let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components; + var stride = hidden_size_vectorized / ${g}; + let offset = ix * stride + iy * hidden_size_vectorized; + let offset1d = stride * ix; + if (ix == ${g-1}) { + stride = hidden_size_vectorized - stride * ix; + } + for (var i: u32 = 0; i < stride; i++) { + let skip_value = skip[offset + i]; + let bias_value = ${f?`bias[offset1d + i]`:a+`(0.0)`}; + let input_value = x[offset + i]; + let value = input_value + skip_value + bias_value; + ${h?`input_skip_bias_sum[offset + i] = value;`:``} + output[offset + i] = value; + let f32_value = ${ir(a,_,`value`)}; + sum_shared[ix] += f32_value; + sum_squared_shared[ix] += f32_value * f32_value; + } + workgroupBarrier(); + + var reduce_size : u32 = ${g}; + for (var curr_size = reduce_size >> 1; curr_size > 0; curr_size = reduce_size >> 1) { + reduce_size = curr_size + (reduce_size & 1); + if (ix < curr_size) { + sum_shared[ix] += sum_shared[ix + reduce_size]; + sum_squared_shared[ix] += sum_squared_shared[ix + reduce_size]; + } + workgroupBarrier(); + } + + let sum = sum_shared[0]; + let square_sum = sum_squared_shared[0]; + let mean = ${ar(`sum`,_)} / f32(uniforms.hidden_size); + let inv_std_dev = inverseSqrt(${ar(`square_sum`,_)} / f32(uniforms.hidden_size) ${i?``:`- mean * mean`} + uniforms.epsilon); + ${p?`mean_output[global_idx] = mean;`:``} + ${m?`inv_std_output[global_idx] = inv_std_dev;`:``} + + for (var i: u32 = 0; i < stride; i++) { + output[offset + i] = (output[offset + i] ${i?``:`- ${a}(mean)`}) * + ${a}(inv_std_dev) * gamma[offset1d + i] + ${d?`+ beta[offset1d + i]`:``}; + } + }`},b=[{dims:s,dataType:e[0].dataType}];return n>1&&b.push({dims:u,dataType:1}),n>2&&b.push({dims:u,dataType:1}),n>3&&b.push({dims:a,dataType:e[0].dataType}),{name:`SkipLayerNormalization`,shaderCache:{hint:`${_};${p};${m};${h}`,inputDependencies:e.map((e,t)=>`type`)},getShaderSource:y,getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(c/l)},programUniforms:v})}},Au=(e,t)=>{Ou(e.inputs);let n=[0];e.outputCount>1&&n.push(-3),e.outputCount>2&&n.push(-3),e.outputCount>3&&n.push(3),e.compute(ku(e.inputs,t,e.outputCount,!1),{outputs:n})}}),Mu,Q,Nu,Pu,Fu,Iu,Lu,Ru,zu=M(()=>{"use strict";H(),G(),Zn(),X(),Mu=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw Error(`axes, starts and ends must have the same length`)}else if(t.starts.length!==t.ends.length)throw Error(`starts and ends must have the same length`);e.slice(1).forEach((t,n)=>{if(e[n+1].dataType!==6&&e[n+1].dataType!==7)throw Error(`Input ${n} must be an array of int32 or int64`)})},Q=(e,t)=>{let n=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(e=>n.push(Number(e)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(e=>n.push(Number(e)));else throw Error(`Input ${t} must be an array of int32 or int64`);return n},Nu=(e,t)=>{if(e.length>1){let t=Q(e,1),n=Q(e,2),r=Q(e,3);return r.length===0&&(r=[...Array(e[0].dims.length).keys()]),Xn({starts:t,ends:n,axes:r})}else return t},Pu=(e,t,n,r,i)=>{let a=e;return e<0&&(a+=n[r[t]]),i[t]<0?Math.max(0,Math.min(a,n[r[t]]-1)):Math.max(0,Math.min(a,n[r[t]]))},Fu=(e,t,n)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { + var input_indices: ${e.type.indices}; + var carry = 0u; + for (var i = ${n.length}; i >= 0; i--) { + let input_shape_i = ${q(`uniforms.input_shape`,`i`,n.length)}; + let steps_i = ${q(`uniforms.steps`,`i`,n.length)}; + let signs_i = ${q(`uniforms.signs`,`i`,n.length)}; + let starts_i = ${q(`uniforms.starts`,`i`,n.length)}; + var output_index = ${t.indicesGet(`output_indices`,`i`)}; + var input_index = output_index * steps_i + starts_i + carry; + carry = input_index / input_shape_i; + input_index = input_index % input_shape_i; + if (signs_i < 0) { + input_index = input_shape_i - input_index - 1u + starts_i; + } + ${e.indicesSet(`input_indices`,`i`,`input_index`)}; + } + return input_indices; + }`,Iu=(e,t)=>{let n=e[0].dims,r=W.size(n),i=t.axes.length>0?W.normalizeAxes(t.axes,n.length):[...Array(n.length).keys()],a=Q(e,4);a.forEach(e=>e!==0||(()=>{throw Error(`step cannot be 0`)})),a.length===0&&(a=Array(i.length).fill(1));let o=t.starts.map((e,t)=>Pu(e,t,n,i,a)),s=t.ends.map((e,t)=>Pu(e,t,n,i,a));if(i.length!==o.length||i.length!==s.length)throw Error(`start, ends and axes should have the same number of elements`);if(i.length!==n.length)for(let e=0;eMath.sign(e));a.forEach((e,t,n)=>{if(e<0){let r=(s[t]-o[t])/e,i=o[t],c=i+r*a[t];o[t]=c,s[t]=i,n[t]=-e}});let l=n.slice(0);i.forEach((e,t)=>{l[e]=Math.ceil((s[e]-o[e])/a[e])});let u={dims:l,dataType:e[0].dataType},d=Y(`output`,e[0].dataType,l.length),f=J(`input`,e[0].dataType,e[0].dims.length),p=W.size(l),m=[{name:`outputSize`,type:`u32`},{name:`starts`,type:`u32`,length:o.length},{name:`signs`,type:`i32`,length:c.length},{name:`steps`,type:`u32`,length:a.length}],h=[{type:12,data:p},{type:12,data:o},{type:6,data:c},{type:12,data:a},...K(e[0].dims,l)],g=e=>` + ${e.registerUniforms(m).declareVariables(f,d)} + ${Fu(f,d,n)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + let output_indices = ${d.offsetToIndices(`global_idx`)}; + let input_indices = calculateInputIndices(output_indices); + ${d.setByOffset(`global_idx`,f.getByIndices(`input_indices`))} + }`;return{name:`Slice`,shaderCache:{hint:`${c.length}_${o.length}_${a.length}`,inputDependencies:[`rank`]},getShaderSource:g,getRunData:()=>({outputs:[u],dispatchGroup:{x:Math.ceil(r/64)},programUniforms:h})}},Lu=(e,t)=>{Mu(e.inputs,t);let n=Nu(e.inputs,t);e.compute(Iu(e.inputs,n),{inputs:[0]})},Ru=e=>{let t=e.starts,n=e.ends,r=e.axes;return Xn({starts:t,ends:n,axes:r})}}),Bu,Vu,Hu,Uu,Wu=M(()=>{"use strict";H(),G(),Zn(),yr(),X(),Bu=e=>{if(!e||e.length!==1)throw Error(`Softmax op requires 1 input.`)},Vu=(e,t)=>{let n=e.inputs[0],r=n.dims,i=W.size(r),a=r.length,o=W.normalizeAxis(t.axis,a),s=ot),l[o]=a-1,l[a-1]=o,c=e.compute(gr(n,l),{inputs:[n],outputs:[-1]})[0]):c=n;let u=c.dims,d=u[a-1],f=i/d,p=nr(d),m=d/p,h=64;f===1&&(h=256);let g=(e,t)=>t===4?`max(max(${e}.x, ${e}.y), max(${e}.z, ${e}.w))`:t===2?`max(${e}.x, ${e}.y)`:t===3?`max(max(${e}.x, ${e}.y), ${e}.z)`:e,_=J(`x`,c.dataType,c.dims,p),v=Y(`result`,c.dataType,c.dims,p),y=_.type.value,b=er(c.dataType)===`f32`?`var threadMax = ${y}(-3.402823e+38f);`:`var threadMax = ${y}(-65504.0h);`,x=e=>` + var rowMaxShared : ${y}; + var rowSumShared : ${y}; + var threadShared : array<${y}, ${h}>; + + fn getValue(row: i32, col: i32, row_stride: i32) -> ${y} { + let index = row * row_stride + col; + return x[index]; + } + + fn setValue(row: i32, col: i32, row_stride: i32, value: ${y}) { + let index = row * row_stride + col; + result[index] = value; + } + ${e.registerUniform(`packedCols`,`i32`).declareVariables(_,v)} + ${e.mainStart(h)} + let gindex = i32(global_idx); + let lindex = i32(local_idx); + const wg = ${h}; + let row = gindex / wg; + let cols = uniforms.packedCols; + let row_stride : i32 = uniforms.packedCols; + + // find the rows max + ${b} + for (var col = lindex; col < cols; col += wg) { + let value = getValue(row, col, row_stride); + threadMax = max(threadMax, value); + } + if (lindex < cols) { + threadShared[lindex] = threadMax; + } + workgroupBarrier(); + + var reduceSize = min(cols, wg); + for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) { + reduceSize = currSize + (reduceSize & 1); + if (lindex < currSize) { + threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]); + } + workgroupBarrier(); + } + if (lindex == 0) { + rowMaxShared = ${y}(${g(`threadShared[0]`,p)}); + } + workgroupBarrier(); + + // find the rows sum + var threadSum = ${y}(0.0); + for (var col = lindex; col < cols; col += wg) { + let subExp = exp(getValue(row, col, row_stride) - rowMaxShared); + threadSum += subExp; + } + threadShared[lindex] = threadSum; + workgroupBarrier(); + + for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) { + if (lindex < currSize) { + threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize]; + } + workgroupBarrier(); + } + if (lindex == 0) { + rowSumShared = ${y}(${ar(`threadShared[0]`,p)}); + } + workgroupBarrier(); + + // calculate final value for each element in the row + for (var col = lindex; col < cols; col += wg) { + let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared; + setValue(row, col, row_stride, value); + } + }`,S=e.compute({name:`Softmax`,shaderCache:{hint:`${p};${h}`,inputDependencies:[`type`]},getRunData:()=>({outputs:[{dims:u,dataType:c.dataType}],dispatchGroup:{x:f},programUniforms:[{type:6,data:m}]}),getShaderSource:x},{inputs:[c],outputs:[s?-1:0]})[0];s&&e.compute(gr(S,l),{inputs:[S]})},Hu=(e,t)=>{Bu(e.inputs),Vu(e,t)},Uu=e=>Xn({axis:e.axis})}),Gu,Ku,qu,Ju,Yu,Xu=M(()=>{"use strict";H(),G(),X(),Gu=e=>Array.from(e.getBigInt64Array(),Number),Ku=e=>{if(!e||e.length!==2)throw Error(`Tile requires 2 inputs.`);if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw Error(`Tile only support float, float16, int32, and uint32 data types`);if(e[1].dataType!==7)throw Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw Error("Tile `repeats` input should be 1-D");if(Gu(e[1]).length!==e[0].dims.length)throw Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},qu=(e,t)=>{let n=[];for(let r=0;r{let n=e[0].dims,r=t??Gu(e[1]),i=qu(n,r),a=W.size(i),o=e[0].dataType,s=J(`input`,o,n.length),c=Y(`output`,o,i.length),l=e=>` + const inputShape = ${s.indices(...n)}; + ${e.registerUniform(`output_size`,`u32`).declareVariables(s,c)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let output_indices = ${c.offsetToIndices(`global_idx`)}; + var input_indices: ${s.type.indices}; + for (var i = 0; i < ${n.length}; i++) { + let input_dim_i = ${s.indicesGet(`uniforms.input_shape`,`i`)}; + let input_dim_value = ${c.indicesGet(`output_indices`,`i`)} % input_dim_i; + + ${s.indicesSet(`input_indices`,`i`,`input_dim_value`)} + } + ${c.setByOffset(`global_idx`,s.getByIndices(`input_indices`))} + }`;return{name:`Tile`,shaderCache:{hint:`${r}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:[{type:12,data:a},...K(e[0].dims,i)]}),getShaderSource:l}},Yu=e=>{Ku(e.inputs),e.compute(Ju(e.inputs),{inputs:[0]})}}),Zu,Qu,$u,ed=M(()=>{"use strict";H(),G(),X(),Zu=(e,t,n,r,i)=>{let a=Y(`output_data`,i,n.length,4),o=J(`a_data`,t[1].dataType,t[1].dims.length,4),s=J(`b_data`,t[2].dataType,t[2].dims.length,4),c=J(`c_data`,t[0].dataType,t[0].dims.length,4),l,u=(e,t,n)=>`select(${t}, ${e}, ${n})`;if(!r)l=a.setByOffset(`global_idx`,u(o.getByOffset(`global_idx`),s.getByOffset(`global_idx`),c.getByOffset(`global_idx`)));else{let e=(e,t,n=``)=>{let r=`a_data[index_a${t}][component_a${t}]`,i=`b_data[index_b${t}][component_b${t}]`,l=`bool(c_data[index_c${t}] & (0xffu << (component_c${t} * 8)))`;return` + let output_indices${t} = ${a.offsetToIndices(`global_idx * 4u + ${t}u`)}; + let offset_a${t} = ${o.broadcastedIndicesToOffset(`output_indices${t}`,a)}; + let offset_b${t} = ${s.broadcastedIndicesToOffset(`output_indices${t}`,a)}; + let offset_c${t} = ${c.broadcastedIndicesToOffset(`output_indices${t}`,a)}; + let index_a${t} = offset_a${t} / 4u; + let index_b${t} = offset_b${t} / 4u; + let index_c${t} = offset_c${t} / 4u; + let component_a${t} = offset_a${t} % 4u; + let component_b${t} = offset_b${t} % 4u; + let component_c${t} = offset_c${t} % 4u; + ${e}[${t}] = ${n}(${u(r,i,l)}); + `};l=i===9?` + var data = vec4(0); + ${e(`data`,0,`u32`)} + ${e(`data`,1,`u32`)} + ${e(`data`,2,`u32`)} + ${e(`data`,3,`u32`)} + output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:` + ${e(`output_data[global_idx]`,0)} + ${e(`output_data[global_idx]`,1)} + ${e(`output_data[global_idx]`,2)} + ${e(`output_data[global_idx]`,3)} + `}return` + ${e.registerUniform(`vec_size`,`u32`).declareVariables(c,o,s,a)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + ${l} + }`},Qu=e=>{let t=e[1].dims,n=e[2].dims,r=e[0].dims,i=e[1].dataType,a=!(W.areEqual(t,n)&&W.areEqual(n,r)),o=t,s=W.size(t);if(a){let e=gn.calcShape(gn.calcShape(t,n,!1),r,!1);if(!e)throw Error(`Can't perform where op on the given tensors`);o=e,s=W.size(o)}let c=Math.ceil(s/4);return{name:`Where`,shaderCache:{inputDependencies:[`rank`,`rank`,`rank`]},getShaderSource:t=>Zu(t,e,o,a,i),getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64/4)},programUniforms:[{type:12,data:c},...K(r,t,n,o)]})}},$u=e=>{e.compute(Qu(e.inputs))}}),td,nd=M(()=>{"use strict";yi(),Oi(),Ni(),Li(),Na(),qa(),eo(),Jo(),cs(),fs(),vs(),As(),Is(),zs(),Ws(),Js(),$s(),ic(),lc(),wc(),Xc(),tl(),al(),cl(),ml(),Mc(),wl(),Wl(),Yl(),$l(),ou(),mi(),Du(),Wc(),ju(),zu(),Wu(),Bc(),Xu(),yr(),ka(),ed(),td=new Map([[`Abs`,[Bi]],[`Acos`,[Vi]],[`Acosh`,[Hi]],[`Add`,[La]],[`ArgMax`,[_i,vi]],[`ArgMin`,[gi,vi]],[`Asin`,[Ui]],[`Asinh`,[Wi]],[`Atan`,[Gi]],[`Atanh`,[Ki]],[`Attention`,[Di]],[`AveragePool`,[Fl,Pl]],[`BatchNormalization`,[Mi]],[`BiasAdd`,[Ii]],[`BiasSplitGelu`,[Ma]],[`Cast`,[Ji,qi]],[`Ceil`,[Zi]],[`Clip`,[Xi]],[`Concat`,[Qa,$a]],[`Conv`,[qo,Uo]],[`ConvTranspose`,[ss,ts]],[`Cos`,[Qi]],[`Cosh`,[$i]],[`CumSum`,[us,ds]],[`DepthToSpace`,[gs,_s]],[`DequantizeLinear`,[ql,Jl]],[`Div`,[Ra]],[`Einsum`,[Os,ks]],[`Elu`,[ta,ea]],[`Equal`,[za]],[`Erf`,[ra]],[`Exp`,[ia]],[`Expand`,[Fs]],[`FastGelu`,[Rs]],[`Floor`,[aa]],[`FusedConv`,[qo,Uo]],[`Gather`,[Us,Hs]],[`GatherElements`,[rc,nc]],[`GatherBlockQuantized`,[Zs,Qs]],[`GatherND`,[Ks,qs]],[`Gelu`,[oa]],[`Gemm`,[cc,sc]],[`GlobalAveragePool`,[Rl,Ll]],[`GlobalMaxPool`,[Ul,Hl]],[`Greater`,[Ua]],[`GreaterOrEqual`,[Ga]],[`GridSample`,[Sc,Cc]],[`GroupQueryAttention`,[Yc]],[`HardSigmoid`,[ma,pa]],[`InstanceNormalization`,[el]],[`LayerNormalization`,[il]],[`LeakyRelu`,[sa,ea]],[`Less`,[Wa]],[`LessOrEqual`,[Ka]],[`Log`,[Ta]],[`MatMul`,[sl]],[`MatMulNBits`,[fl,pl]],[`MaxPool`,[Bl,Vl]],[`Mul`,[Ba]],[`MultiHeadAttention`,[jc,Dc]],[`Neg`,[la]],[`Not`,[ca]],[`Pad`,[Cl]],[`Pow`,[Va]],[`QuickGelu`,[Oa,ea]],[`Range`,[Ql]],[`Reciprocal`,[ua]],[`ReduceMin`,[li]],[`ReduceMean`,[ii]],[`ReduceMax`,[ci]],[`ReduceSum`,[di]],[`ReduceProd`,[ui]],[`ReduceL1`,[ai]],[`ReduceL2`,[oi]],[`ReduceLogSum`,[pi]],[`ReduceLogSumExp`,[si]],[`ReduceSumSquare`,[fi]],[`Relu`,[da]],[`Resize`,[Tu,Eu]],[`RotaryEmbedding`,[Uc]],[`ScatterND`,[au,iu]],[`Sigmoid`,[fa]],[`Sin`,[ha]],[`Sinh`,[ga]],[`Slice`,[Lu,Ru]],[`SkipLayerNormalization`,[Au]],[`Split`,[Rc,zc]],[`Sqrt`,[_a]],[`Softmax`,[Hu,Uu]],[`Sub`,[Ha]],[`Tan`,[va]],[`Tanh`,[ba]],[`ThresholdedRelu`,[wa,ea]],[`Tile`,[Yu]],[`Transpose`,[_r,vr]],[`Where`,[$u]]])}),rd,id=M(()=>{"use strict";et(),mn(),X(),rd=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n,r,i){Ue(e.programInfo.name);let a=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let s=[];for(let e of t)s.push({binding:s.length,resource:{buffer:e.buffer}});for(let e of n)s.push({binding:s.length,resource:{buffer:e.buffer}});i&&s.push({binding:s.length,resource:i});let c=a.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:s,label:e.programInfo.name});if(this.backend.sessionStatus===`capturing`){let t={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:c,dispatchGroup:r};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(t)}o.setPipeline(e.computePipeline),o.setBindGroup(0,c),o.dispatchWorkgroups(...r),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===`at-passes`)&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),V(e.programInfo.name)}dispose(){}build(e,t){Ue(e.name);let n=this.backend.device,r=[];[{feature:`shader-f16`,extension:`f16`},{feature:`subgroups`,extension:`subgroups`}].forEach(e=>{n.features.has(e.feature)&&r.push(`enable ${e.extension};`)});let i=ur(t,this.backend.device.limits),a=e.getShaderSource(i),o=`${r.join(` +`)} +${i.additionalImplementations} +${a}`,s=n.createShaderModule({code:o,label:e.name});U(`verbose`,()=>`[WebGPU] ${e.name} shader code: ${o}`);let c=n.createComputePipeline({compute:{module:s,entryPoint:`main`},layout:`auto`,label:e.name});return V(e.name),{programInfo:e,computePipeline:c,uniformVariablesInfo:i.variablesInfo}}normalizeDispatchGroupSize(e){let t=typeof e==`number`?e:e.x,n=typeof e==`number`?1:e.y||1,r=typeof e==`number`?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=i&&n<=i&&r<=i)return[t,n,r];let a=t*n*r,o=Math.ceil(Math.sqrt(a));if(o>i){if(o=Math.ceil(Math.cbrt(a)),o>i)throw Error(`Total dispatch size exceeds WebGPU maximum.`);return[o,o,o]}else return[o,o,1]}}}),ad={};N(ad,{WebGpuBackend:()=>ld});var od,sd,cd,ld,ud=M(()=>{"use strict";et(),H(),mn(),Sn(),Jn(),nd(),id(),od=(e,t)=>{if(t.length!==e.length)throw Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let n=[];for(let r=0;r{var r,i;let a=e.name;return(r=e.shaderCache)?.hint&&(a+=`[`+e.shaderCache.hint+`]`),a+=`:`+n+`:${od(t,(i=e.shaderCache)?.inputDependencies??Array(t.length).fill(`dims`))}`,a},cd=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},ld=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus=`default`,this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw Error(`currentKernelCustomData(): currentKernelId is null. (should not happen)`);let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,t){this.env=e;let n=[],r={requiredLimits:{maxComputeWorkgroupStorageSize:t.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:t.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:t.limits.maxStorageBufferBindingSize,maxBufferSize:t.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:t.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:t.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:t.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:t.limits.maxComputeWorkgroupSizeZ},requiredFeatures:n},i=e=>t.features.has(e)&&n.push(e)&&!0;i(`chromium-experimental-timestamp-query-inside-passes`)||i(`timestamp-query`),i(`shader-f16`),i(`subgroups`),this.device=await t.requestDevice(r),this.adapterInfo=new cd(t.info||await t.requestAdapterInfo()),this.gpuDataManager=qn(this),this.programManager=new rd(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,fn(e.logLevel,!!e.debug),this.device.onuncapturederror=e=>{e.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${e.error.message}`)},Object.defineProperty(this.env.webgpu,`device`,{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,`adapter`,{value:t,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<`u`&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||=this.device.createCommandEncoder(),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),t={};this.queryType===`at-passes`&&(t.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(t)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;Ue(),this.endComputePass();let e;this.queryType!==`none`&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==`none`&&e.mapAsync(GPUMapMode.READ).then(()=>{let t=new BigUint64Array(e.getMappedRange()),n=this.pendingQueries.get(e);for(let e=0;e`u`&&(this.queryTimeBase=f);let m=Number(f-this.queryTimeBase),h=Number(p-this.queryTimeBase);if(!Number.isSafeInteger(m)||!Number.isSafeInteger(h))throw RangeError(`incorrect timestamp range`);if((r=this.env.webgpu.profiling)?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:u.map(e=>({dims:e.dims,dataType:Qt(e.dataType)})),outputsMetadata:d.map(e=>({dims:e.dims,dataType:Qt(e.dataType)})),kernelId:a,kernelType:s,kernelName:c,programName:l,startTime:m,endTime:h});else{let e=``;u.forEach((t,n)=>{e+=`input[${n}]: [${t.dims}] | ${Qt(t.dataType)}, `});let t=``;d.forEach((e,n)=>{t+=`output[${n}]: [${e.dims}] | ${Qt(e.dataType)}, `}),console.log(`[profiling] kernel "${a}|${s}|${c}|${l}" ${e}${t}execution time: ${h-m} ns`)}Ve(`GPU`,`${l}::${f}::${p}`)}e.unmap(),this.pendingQueries.delete(e)}),V()}run(e,t,n,r,i,a){Ue(e.name);let o=[];for(let e=0;et):n;if(u.length!==s.length)throw Error(`Output size ${u.length} must be equal to ${s.length}.`);let d=[],f=[];for(let e=0;e=a)throw Error(`Invalid output index: ${u[e]}`);if(u[e]===-3)continue;let t=u[e]===-1,n=u[e]===-2,o=t||n?i(s[e].dataType,s[e].dims):r(u[e],s[e].dataType,s[e].dims);if(d.push(o),o.data===0)continue;let c=this.gpuDataManager.get(o.data);if(!c)throw Error(`no GPU data for output: ${o.data}`);if(t&&this.temporaryData.push(c),n){let e=this.kernelPersistentData.get(this.currentKernelId);e||(e=[],this.kernelPersistentData.set(this.currentKernelId,e)),e.push(c)}f.push(c)}if(o.length!==t.length||f.length!==d.length){if(f.length===0)return V(e.name),d;throw Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let p;if(l){let e=0,t=[];l.forEach(n=>{let r=typeof n.data==`number`?[n.data]:n.data;if(r.length===0)return;let i=n.type===10?2:4,a,o;n.type===10?(o=r.length>4?16:r.length>2?8:r.length*i,a=r.length>4?16:i*r.length):(o=r.length<=2?r.length*i:16,a=16),e=Math.ceil(e/o)*o,t.push(e);let s=n.type===10?8:4;e+=r.length>4?Math.ceil(r.length/s)*a:r.length*i});let n=16;e=Math.ceil(e/n)*n;let r=new ArrayBuffer(e);l.forEach((e,n)=>{let i=t[n],a=typeof e.data==`number`?[e.data]:e.data;if(e.type===6)new Int32Array(r,i,a.length).set(a);else if(e.type===12)new Uint32Array(r,i,a.length).set(a);else if(e.type===10)new Uint16Array(r,i,a.length).set(a);else if(e.type===1)new Float32Array(r,i,a.length).set(a);else throw Error(`Unsupported uniform type: ${Qt(e.type)}`)});let i=this.gpuDataManager.create(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(i.buffer,0,r,0,e),this.gpuDataManager.release(i.id),p={offset:0,size:e,buffer:i.buffer}}let m=this.programManager.normalizeDispatchGroupSize(c),h=m[1]===1&&m[2]===1,g=sd(e,t,h),_=this.programManager.getArtifact(g);if(_||(_=this.programManager.build(e,m),this.programManager.setArtifact(g,_),U(`info`,()=>`[artifact] key: ${g}, programName: ${e.name}`)),l&&_.uniformVariablesInfo){if(l.length!==_.uniformVariablesInfo.length)throw Error(`Uniform variables count mismatch: expect ${_.uniformVariablesInfo.length}, got ${l.length} in program "${_.programInfo.name}".`);for(let e=0;e`[ProgramManager] run "${e.name}" (key=${g}) with ${m[0]}x${m[1]}x${m[2]}`),this.queryType!==`none`||this.sessionStatus===`capturing`){let e={kernelId:this.currentKernelId,programName:_.programInfo.name,inputTensorViews:t,outputTensorViews:d};this.pendingKernels.push(e),this.sessionStatus===`capturing`&&this.capturedPendingKernels.get(this.currentSessionId).push(e)}return this.programManager.run(_,o,f,m,p),V(e.name),d}upload(e,t){this.gpuDataManager.upload(e,t)}memcpy(e,t){this.gpuDataManager.memcpy(e,t)}async download(e,t){await this.gpuDataManager.download(e,t)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,t,n,r){let i=td.get(e);if(!i)throw Error(`kernel not implemented: ${e}`);let a={kernelType:e,kernelName:r,kernelEntry:i[0],attributes:[i[1],n]};this.kernels.set(t,a)}releaseKernel(e){let t=this.kernelPersistentData.get(e);if(t){for(let e of t)this.gpuDataManager.release(e.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,t,n){let r=this.kernels.get(e);if(!r)throw Error(`kernel not created: ${e}`);let i=r.kernelType,a=r.kernelName,o=r.kernelEntry,s=r.attributes;if(this.currentKernelId!==null)throw Error(`kernel "[${i}] ${a}" is not allowed to be called recursively`);this.currentKernelId=e,s[0]&&(s[1]=s[0](s[1]),s[0]=void 0),U(`info`,()=>`[WebGPU] Start to run kernel "[${i}] ${a}"...`);let c=this.env.debug;this.temporaryData=[];try{return c&&this.device.pushErrorScope(`validation`),o(t,s[1]),0}catch(e){return n.push(Promise.resolve(`[WebGPU] Kernel "[${i}] ${a}" failed. ${e}`)),1}finally{c&&n.push(this.device.popErrorScope().then(e=>e?`GPU validation error for kernel "[${i}] ${a}": ${e.message}`:null));for(let e of this.temporaryData)this.gpuDataManager.release(e.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,t,n,r){let i=this.sessionExternalDataMapping.get(e);i||(i=new Map,this.sessionExternalDataMapping.set(e,i));let a=i.get(t),o=this.gpuDataManager.registerExternalBuffer(n,r,a);return i.set(t,[o,n]),o}unregisterBuffers(e){let t=this.sessionExternalDataMapping.get(e);t&&(t.forEach(e=>this.gpuDataManager.unregisterExternalBuffer(e[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let t=this.gpuDataManager.get(e);if(!t)throw Error(`no GPU data for buffer: ${e}`);return t.buffer}createDownloader(e,t,n){return async()=>{let r=await Gn(this,e,t);return xn(r.buffer,n)}}writeTimestamp(e){this.queryType===`inside-passes`&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){var e;this.queryType=`none`,((e=this.env.webgpu.profiling)?.mode===`default`||(typeof this.env.trace>`u`?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(`chromium-experimental-timestamp-query-inside-passes`)?this.queryType=`inside-passes`:this.device.features.has(`timestamp-query`)&&(this.queryType=`at-passes`),this.queryType!==`none`&&typeof this.querySet>`u`&&(this.querySet=this.device.createQuerySet({type:`timestamp`,count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){U(`info`,`captureBegin`),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=`capturing`}captureEnd(){U(`info`,`captureEnd`),this.flush(),this.sessionStatus=`default`}replay(){U(`info`,`replay`),this.sessionStatus=`replaying`;let e=this.capturedCommandList.get(this.currentSessionId),t=this.capturedPendingKernels.get(this.currentSessionId),n=e.length;this.pendingKernels=[];for(let r=0;r=this.maxDispatchNumber||this.queryType===`at-passes`)&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=`default`}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),dd={};N(dd,{init:()=>md});var fd,pd,md,hd=M(()=>{"use strict";H(),mn(),G(),Ln(),fd=class e{constructor(e,t,n,r){this.module=e,this.dataType=t,this.data=n,this.dims=r}getFloat32Array(){if(this.dataType!==1)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,e)}getBigInt64Array(){if(this.dataType!==7)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,e)}getInt32Array(){if(this.dataType!==6)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,e)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw Error(`Invalid data type`);let e=W.size(this.dims);return e===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,e)}reshape(t){if(W.size(t)!==W.size(this.dims))throw Error(`Invalid new shape`);return new e(this.module,this.dataType,this.data,t)}},pd=class{constructor(e,t,n){this.module=e,this.backend=t,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=t.adapterInfo;let r=e.PTR_SIZE,i=n/e.PTR_SIZE,a=r===4?`i32`:`i64`;this.opKernelContext=Number(e.getValue(r*i++,a));let o=Number(e.getValue(r*i++,a));this.outputCount=Number(e.getValue(r*i++,a)),this.customDataOffset=Number(e.getValue(r*i++,`*`)),this.customDataSize=Number(e.getValue(r*i++,a));let s=[];for(let t=0;ttypeof e==`number`?this.inputs[e]:e))??this.inputs,i=t?.outputs??[],a=(e,t,n)=>new fd(this.module,t,this.output(e,n),n),o=(e,t)=>{let n=$t(e,t);if(!n)throw Error(`Unsupported data type: ${e}`);let r=n>0?this.backend.gpuDataManager.create(n).id:0;return new fd(this.module,e,r,t)};return this.backend.run(e,r,i,a,o,this.outputCount)}output(e,t){let n=this.module.stackSave();try{let n=this.module.PTR_SIZE,r=n===4?`i32`:`i64`,i=this.module.stackAlloc((1+t.length)*n);this.module.setValue(i,t.length,r);for(let e=0;e{let i=t.jsepInit;if(!i)throw Error(`Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.`);if(e===`webgpu`){let e=(ud(),de(ad)).WebGpuBackend,a=new e;await a.initialize(n,r),i(`webgpu`,[a,e=>a.alloc(Number(e)),e=>a.free(e),(e,n,r,i=!1)=>{if(i)U(`verbose`,()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(e)}, dst=${Number(n)}, size=${Number(r)}`),a.memcpy(Number(e),Number(n));else{U(`verbose`,()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(e)}, gpuDataId=${Number(n)}, size=${Number(r)}`);let i=t.HEAPU8.subarray(Number(e>>>0),Number(e>>>0)+Number(r));a.upload(Number(n),i)}},async(e,n,r)=>{U(`verbose`,()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${e}, dataOffset=${n}, size=${r}`),await a.download(Number(e),()=>t.HEAPU8.subarray(Number(n)>>>0,Number(n+r)>>>0))},(e,n,r)=>a.createKernel(e,Number(n),r,t.UTF8ToString(t._JsepGetNodeName(Number(n)))),e=>a.releaseKernel(e),(e,n,r,i)=>{U(`verbose`,()=>`[WebGPU] jsepRun: sessionHandle=${r}, kernel=${e}, contextDataOffset=${n}`);let o=new pd(t,a,Number(n));return a.computeKernel(Number(e),o,i)},()=>a.captureBegin(),()=>a.captureEnd(),()=>a.replay()])}else{let e=new In(n);i(`webnn`,[e,()=>e.reserveTensorId(),t=>e.releaseTensorId(t),async(t,n,r,i,a)=>e.ensureTensor(t,n,r,i,a),(t,n)=>{e.uploadTensor(t,n)},async(t,n)=>e.downloadTensor(t,n)])}}}),gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd=M(()=>{"use strict";Ut(),Xt(),H(),Lt(),Vt(),sn(),gd=(e,t)=>{It()._OrtInit(e,t)!==0&&Bt(`Can't initialize onnxruntime.`)},_d=async e=>{gd(e.wasm.numThreads,tn(e.logLevel))},vd=async(e,t)=>{var n,r;(n=(r=It()).asyncInit)?.call(r);{let n=(hd(),de(dd)).init;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);let t=e.webgpu.adapter;if(t){if(typeof t.limits!=`object`||typeof t.features!=`object`||typeof t.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let n=e.webgpu.powerPreference;if(n!==void 0&&n!==`low-power`&&n!==`high-performance`)throw Error(`Invalid powerPreference setting: "${n}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(t=await navigator.gpu.requestAdapter({powerPreference:n,forceFallbackAdapter:r}),!t)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}await n(`webgpu`,It(),e,t)}if(t===`webnn`){if(typeof navigator>`u`||!navigator.ml)throw Error(`WebNN is not supported in current environment`);await n(`webnn`,It(),e)}}},yd=new Map,bd=e=>{let t=It(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&Bt(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},xd=(e,t)=>{let n=It(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&Bt(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=It(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},Cd=async(e,t)=>{let n,r,i=It();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=Sd(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{var d,f;if([o,c]=await Yt(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(on(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),(d=i.webgpuOnCreateSession)?.call(i,a),a===0&&Bt(`Can't create a session.`),(f=i.jsepOnCreateSession)?.call(i),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,m]=bd(a),h=!!t?.enableGraphCapture,g=[],_=[],v=[],y=[],b=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`)&&(s=i._OrtCreateBinding(a),s===0&&Bt(`Can't create IO binding.`),x={handle:s,outputPreferredLocations:b,outputPreferredLocationsEncoded:b.map(e=>an(e))}),yd.set(a,[a,l,u,x,h,!1]),[a,g,_,v,y]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&Bt(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&Bt(`Can't release session.`),e}finally{var m;i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&Bt(`Can't release session options.`),c.forEach(e=>i._free(e)),(m=i.unmountExternalData)?.call(i)}},wd=e=>{var t,n,r;let i=It(),a=yd.get(e);if(!a)throw Error(`cannot release session. invalid session id: ${e}`);let[o,s,c,l,u]=a;l&&(u&&i._OrtClearBoundOutputs(l.handle)!==0&&Bt(`Can't clear bound outputs.`),i._OrtReleaseBinding(l.handle)!==0&&Bt(`Can't release IO binding.`)),(t=i.jsepOnReleaseSession)?.call(i,e),(n=i.webnnOnReleaseSession)?.call(i,e),(r=i.webgpuOnReleaseSession)?.call(i,e),s.forEach(e=>i._OrtFree(e)),c.forEach(e=>i._OrtFree(e)),i._OrtReleaseSession(o)!==0&&Bt(`Can't release session.`),yd.delete(e)},Td=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=It(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=$t(Zt(l),u);{let e=s.jsepRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(r,a,t,m)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=$t(Zt(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,Zt(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(Zt(l),p,m,g,u.length,an(f));e===0&&Bt(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},Ed=async(e,t,n,r,i,a)=>{let o=It(),s=o.PTR_SIZE,c=yd.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],S=o.stackSave(),C=o.stackAlloc(h*s),w=o.stackAlloc(h*s),T=o.stackAlloc(g*s),E=o.stackAlloc(g*s);try{var D,O;[_,v]=Ht(a);for(let r=0;re*t,1);d=Qt(a);let _=f?.outputPreferredLocations[r[t]];if(d===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let e=o.jsepGetBuffer;if(!e)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let t=e(p),r=$t(a,g);if(r===void 0||!nn(d))throw Error(`Unsupported data type: ${d}`);u=!0,S.push([d,h,{gpuBuffer:t,download:o.jsepCreateDownloader(t,r,d),dispose:()=>{o._OrtReleaseTensor(n)!==0&&Bt(`Can't release tensor.`)}},`gpu-buffer`])}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsInt64Supported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if($t(a,g)===void 0||!rn(d))throw Error(`Unsupported data type: ${d}`);if(d===`int64`&&!r(e))throw Error(`preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.`);let i=await t(e,p,a,h,!1);u=!0,S.push([d,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(p,d),dispose:()=>{o.webnnReleaseTensorId(p),o._OrtReleaseTensor(n)}},`ml-tensor`])}else{let e=en(d),t=new e(g);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(o.HEAPU8.subarray(p,p+t.byteLength)),S.push([d,h,t,`cpu`])}}finally{var A;o.stackRestore(a),d===`string`&&p&&o._free(p),u||o._OrtReleaseTensor(n),(A=o.webnnOnRunEnd)?.call(o,l)}}return f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&Bt(`Can't clear bound outputs.`),yd.set(e,[l,u,d,f,p,!1])),S}finally{o.stackRestore(S),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},Dd=e=>{let t=It(),n=yd.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&Bt(`Can't get an profile file name.`),t._OrtFree(i)},Od=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd=M(()=>{"use strict";et(),kd(),Lt(),Dt(),Ad=()=>!!ye.wasm.proxy&&typeof document<`u`,Md=!1,Nd=!1,Pd=!1,Ld=new Map,Rd=(e,t)=>{let n=Ld.get(e);n?n.push(t):Ld.set(e,[t])},zd=()=>{if(Md||!Nd||Pd||!jd)throw Error(`worker not ready`)},Bd=e=>{switch(e.data.type){case`init-wasm`:Md=!1,e.data.err?(Pd=!0,Id[1](e.data.err)):(Nd=!0,Id[0]()),Fd&&(URL.revokeObjectURL(Fd),Fd=void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=Ld.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},Vd=async()=>{if(!Nd){if(Md)throw Error(`multiple calls to 'initWasm()' detected.`);if(Pd)throw Error(`previous call to 'initWasm()' failed.`);if(Md=!0,Ad())return new Promise((e,t)=>{jd?.terminate(),wt().then(([n,r])=>{try{jd=r,jd.onerror=e=>t(e),jd.onmessage=Bd,Id=[e,t];let i={type:`init-wasm`,in:ye};!i.in.wasm.wasmPaths&&(n||mt)&&(i.in.wasm.wasmPaths={wasm:new URL(`/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+self.location.href).href}),jd.postMessage(i),Fd=n}catch(e){t(e)}},t)});try{await Ft(ye.wasm),await _d(ye),Nd=!0}catch(e){throw Pd=!0,e}finally{Md=!1}}},Hd=async e=>{if(Ad())return zd(),new Promise((t,n)=>{Rd(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:ye}};jd.postMessage(r)});await vd(ye,e)},Ud=async e=>Ad()?(zd(),new Promise((t,n)=>{Rd(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};jd.postMessage(r,[e.buffer])})):Sd(e),Wd=async(e,t)=>{if(Ad()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return zd(),new Promise((n,r)=>{Rd(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),jd.postMessage(i,a)})}else return Cd(e,t)},Gd=async e=>{if(Ad())return zd(),new Promise((t,n)=>{Rd(`release`,[t,n]);let r={type:`release`,in:e};jd.postMessage(r)});wd(e)},Kd=async(e,t,n,r,i,a)=>{if(Ad()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return zd(),new Promise((i,o)=>{Rd(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};jd.postMessage(c,Od(s))})}else return Ed(e,t,n,r,i,a)},qd=async e=>{if(Ad())return zd(),new Promise((t,n)=>{Rd(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};jd.postMessage(r)});Dd(e)}}),Yd,Xd,Zd,Qd=M(()=>{"use strict";et(),Jd(),H(),tt(),sn(),Yd=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},Xd=e=>{switch(e[3]){case`cpu`:return new Be(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!nn(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return Be.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!rn(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return Be.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},Zd=class{async fetchModelAndCopyToWasmMemory(e){return Ud(await on(e))}async loadModel(e,t){Ue();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Wd(n,t),V()}async dispose(){return Gd(this.sessionId)}async run(e,t,n){Ue();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>Yd(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?Yd(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await Kd(this.sessionId,i,s,o,c,n),u={};for(let e=0;etf,initializeFlags:()=>ef,wasmBackend:()=>nf});var ef,tf,nf,rf=M(()=>{"use strict";et(),Jd(),Qd(),ef=()=>{(typeof ye.wasm.initTimeout!=`number`||ye.wasm.initTimeout<0)&&(ye.wasm.initTimeout=0);let e=ye.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),ye.wasm.simd=!1),typeof ye.wasm.proxy!=`boolean`&&(ye.wasm.proxy=!1),typeof ye.wasm.trace!=`boolean`&&(ye.wasm.trace=!1),typeof ye.wasm.numThreads!=`number`||!Number.isInteger(ye.wasm.numThreads)||ye.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)ye.wasm.numThreads=1;else{let e=typeof navigator>`u`?le(`node:os`).cpus().length:navigator.hardwareConcurrency;ye.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},tf=class{async init(e){ef(),await Vd(),await Hd(e)}async createInferenceSessionHandler(e,t){let n=new Zd;return await n.loadModel(e,t),n}},nf=new tf});et(),et(),et();var af=`1.22.0-dev.20250409-89f8206ba4`,sf=$e;{let e=(rf(),de($d)).wasmBackend;F(`webgpu`,e,5),F(`webnn`,e,5),F(`cpu`,e,10),F(`wasm`,e,10)}Object.defineProperty(ye.versions,`web`,{value:af,enumerable:!0}); +/** +* @license +* Copyright 2021 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*/ +/** +* @license +* Copyright 2020 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*/ +/** +* @license +* Copyright 2019 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*/ +let cf={url:self.location.href};var lf={"onnxruntime-common":e=>{e.exports=j},"onnxruntime-web":e=>{e.exports=ie},"?2ce3":()=>{},"?7a2c":()=>{},"?a42a":()=>{},"?2b25":()=>{},"?569f":()=>{},"?3f59":()=>{},"?154a":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(t,n,r)=>{r.r(n),r.d(n,{Environment:()=>ve,Interpreter:()=>ye,Template:()=>Pe,parse:()=>ce,tokenize:()=>f});var i=Object.freeze({Text:`Text`,NumericLiteral:`NumericLiteral`,BooleanLiteral:`BooleanLiteral`,NullLiteral:`NullLiteral`,StringLiteral:`StringLiteral`,Identifier:`Identifier`,Equals:`Equals`,OpenParen:`OpenParen`,CloseParen:`CloseParen`,OpenStatement:`OpenStatement`,CloseStatement:`CloseStatement`,OpenExpression:`OpenExpression`,CloseExpression:`CloseExpression`,OpenSquareBracket:`OpenSquareBracket`,CloseSquareBracket:`CloseSquareBracket`,OpenCurlyBracket:`OpenCurlyBracket`,CloseCurlyBracket:`CloseCurlyBracket`,Comma:`Comma`,Dot:`Dot`,Colon:`Colon`,Pipe:`Pipe`,CallOperator:`CallOperator`,AdditiveBinaryOperator:`AdditiveBinaryOperator`,MultiplicativeBinaryOperator:`MultiplicativeBinaryOperator`,ComparisonBinaryOperator:`ComparisonBinaryOperator`,UnaryOperator:`UnaryOperator`,Set:`Set`,If:`If`,For:`For`,In:`In`,Is:`Is`,NotIn:`NotIn`,Else:`Else`,EndSet:`EndSet`,EndIf:`EndIf`,ElseIf:`ElseIf`,EndFor:`EndFor`,And:`And`,Or:`Or`,Not:`UnaryOperator`,Macro:`Macro`,EndMacro:`EndMacro`,Break:`Break`,Continue:`Continue`}),a=Object.freeze({set:i.Set,for:i.For,in:i.In,is:i.Is,if:i.If,else:i.Else,endset:i.EndSet,endif:i.EndIf,elif:i.ElseIf,endfor:i.EndFor,and:i.And,or:i.Or,not:i.Not,"not in":i.NotIn,macro:i.Macro,endmacro:i.EndMacro,break:i.Break,continue:i.Continue,true:i.BooleanLiteral,false:i.BooleanLiteral,none:i.NullLiteral,True:i.BooleanLiteral,False:i.BooleanLiteral,None:i.NullLiteral}),o=class{constructor(e,t){this.value=e,this.type=t}};function s(e){return/\w/.test(e)}function c(e){return/[0-9]/.test(e)}var l=[[`{%`,i.OpenStatement],[`%}`,i.CloseStatement],[`{{`,i.OpenExpression],[`}}`,i.CloseExpression],[`(`,i.OpenParen],[`)`,i.CloseParen],[`{`,i.OpenCurlyBracket],[`}`,i.CloseCurlyBracket],[`[`,i.OpenSquareBracket],[`]`,i.CloseSquareBracket],[`,`,i.Comma],[`.`,i.Dot],[`:`,i.Colon],[`|`,i.Pipe],[`<=`,i.ComparisonBinaryOperator],[`>=`,i.ComparisonBinaryOperator],[`==`,i.ComparisonBinaryOperator],[`!=`,i.ComparisonBinaryOperator],[`<`,i.ComparisonBinaryOperator],[`>`,i.ComparisonBinaryOperator],[`+`,i.AdditiveBinaryOperator],[`-`,i.AdditiveBinaryOperator],[`*`,i.MultiplicativeBinaryOperator],[`/`,i.MultiplicativeBinaryOperator],[`%`,i.MultiplicativeBinaryOperator],[`=`,i.Equals]],u=new Map([[`n`,` +`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function d(e,t={}){return e.endsWith(` +`)&&(e=e.slice(0,-1)),e=e.replace(/{#.*?#}/gs,`{##}`),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%]})\n/g,`$1`)),e.replace(/{##}/g,``).replace(/-%}\s*/g,`%}`).replace(/\s*{%-/g,`{%`).replace(/-}}\s*/g,`}}`).replace(/\s*{{-/g,`{{`)}function f(e,t={}){let n=[],r=d(e,t),f=0,p=e=>{let t=``;for(;e(r[f]);){if(r[f]===`\\`){if(++f,f>=r.length)throw SyntaxError(`Unexpected end of input`);let e=r[f++],n=u.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=r[f++],f>=r.length)throw SyntaxError(`Unexpected end of input`)}return t};main:for(;f0){n.push(new o(e,i.Text));continue}}p(e=>/\s/.test(e));let t=r[f];if(t===`-`||t===`+`){var h;let e=(h=n.at(-1))?.type;if(e===i.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case i.Identifier:case i.NumericLiteral:case i.BooleanLiteral:case i.NullLiteral:case i.StringLiteral:case i.CloseParen:case i.CloseSquareBracket:break;default:{++f;let e=p(c);n.push(new o(`${t}${e}`,e.length>0?i.NumericLiteral:i.UnaryOperator));continue}}}for(let[e,t]of l){let i=r.slice(f,f+e.length);if(i===e){n.push(new o(e,t)),f+=e.length;continue main}}if(t===`'`||t===`"`){++f;let e=p(e=>e!==t);n.push(new o(e,i.StringLiteral)),++f;continue}if(c(t)){let e=p(c);n.push(new o(e,i.NumericLiteral));continue}if(s(t)){var g;let e=p(s),t=Object.hasOwn(a,e)?a[e]:i.Identifier;t===i.In&&(g=n.at(-1))?.type===i.Not?(n.pop(),n.push(new o(`not in`,i.NotIn))):n.push(new o(e,t));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var p=class{constructor(){e.defineProperty(this,`type`,`Statement`)}},m=class extends p{constructor(t){super(),e.defineProperty(this,`type`,`Program`),this.body=t}},h=class extends p{constructor(t,n,r){super(),e.defineProperty(this,`type`,`If`),this.test=t,this.body=n,this.alternate=r}},g=class extends p{constructor(t,n,r,i){super(),e.defineProperty(this,`type`,`For`),this.loopvar=t,this.iterable=n,this.body=r,this.defaultBlock=i}},_=class extends p{constructor(...t){super(...t),e.defineProperty(this,`type`,`Break`)}},v=class extends p{constructor(...t){super(...t),e.defineProperty(this,`type`,`Continue`)}},y=class extends p{constructor(t,n,r){super(),e.defineProperty(this,`type`,`Set`),this.assignee=t,this.value=n,this.body=r}},b=class extends p{constructor(t,n,r){super(),e.defineProperty(this,`type`,`Macro`),this.name=t,this.args=n,this.body=r}},x=class extends p{constructor(...t){super(...t),e.defineProperty(this,`type`,`Expression`)}},S=class extends x{constructor(t,n,r){super(),e.defineProperty(this,`type`,`MemberExpression`),this.object=t,this.property=n,this.computed=r}},C=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`CallExpression`),this.callee=t,this.args=n}},w=class extends x{constructor(t){super(),e.defineProperty(this,`type`,`Identifier`),this.value=t}},T=class extends x{constructor(t){super(),e.defineProperty(this,`type`,`Literal`),this.value=t}},E=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`NumericLiteral`)}},D=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`StringLiteral`)}},O=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`BooleanLiteral`)}},k=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`NullLiteral`)}},A=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`ArrayLiteral`)}},ee=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`TupleLiteral`)}},te=class extends T{constructor(...t){super(...t),e.defineProperty(this,`type`,`ObjectLiteral`)}},ne=class extends x{constructor(t,n,r){super(),e.defineProperty(this,`type`,`BinaryExpression`),this.operator=t,this.left=n,this.right=r}},re=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`FilterExpression`),this.operand=t,this.filter=n}},j=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`SelectExpression`),this.iterable=t,this.test=n}},ie=class extends x{constructor(t,n,r){super(),e.defineProperty(this,`type`,`TestExpression`),this.operand=t,this.negate=n,this.test=r}},ae=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`UnaryExpression`),this.operator=t,this.argument=n}},oe=class extends x{constructor(t=void 0,n=void 0,r=void 0){super(),e.defineProperty(this,`type`,`SliceExpression`),this.start=t,this.stop=n,this.step=r}},se=class extends x{constructor(t,n){super(),e.defineProperty(this,`type`,`KeywordArgumentExpression`),this.key=t,this.value=n}};function ce(e){let t=new m([]),n=0;function r(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function a(){switch(e[n].type){case i.Text:return c();case i.OpenStatement:return l();case i.OpenExpression:return u();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function o(...t){return n+t.length<=e.length&&t.some((t,r)=>t!==e[n+r].type)}function s(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function c(){return new D(r(i.Text,`Expected text token`).value)}function l(){r(i.OpenStatement,`Expected opening statement token`);let t;switch(e[n].type){case i.Set:++n,t=d(),r(i.CloseStatement,`Expected closing statement token`);break;case i.If:++n,t=f(),r(i.OpenStatement,`Expected {% token`),r(i.EndIf,`Expected endif token`),r(i.CloseStatement,`Expected %} token`);break;case i.Macro:++n,t=p(),r(i.OpenStatement,`Expected {% token`),r(i.EndMacro,`Expected endmacro token`),r(i.CloseStatement,`Expected %} token`);break;case i.For:++n,t=T(),r(i.OpenStatement,`Expected {% token`),r(i.EndFor,`Expected endfor token`),r(i.CloseStatement,`Expected %} token`);break;case i.Break:++n,r(i.CloseStatement,`Expected closing statement token`),t=new _;break;case i.Continue:++n,r(i.CloseStatement,`Expected closing statement token`),t=new v;break;default:throw SyntaxError(`Unknown statement type: ${e[n].type}`)}return t}function u(){r(i.OpenExpression,`Expected opening expression token`);let e=ce();return r(i.CloseExpression,`Expected closing expression token`),e}function d(){let t=ce();if(s(i.Equals)){++n;let e=ce();return new y(t,e,[])}else{var o,c;let s=[];for(r(i.CloseStatement,`Expected %} token`);!((o=e[n])?.type===i.OpenStatement&&(c=e[n+1])?.type===i.EndSet);){let e=a();s.push(e)}return r(i.OpenStatement,`Expected {% token`),r(i.EndSet,`Expected endset token`),new y(t,null,s)}}function f(){var t,o,c,l,u,d;let p=ce();r(i.CloseStatement,`Expected closing statement token`);let m=[],g=[];for(;!((t=e[n])?.type===i.OpenStatement&&((o=e[n+1])?.type===i.ElseIf||(c=e[n+1])?.type===i.Else||(l=e[n+1])?.type===i.EndIf));)m.push(a());if((u=e[n])?.type===i.OpenStatement&&(d=e[n+1])?.type!==i.EndIf)if(++n,s(i.ElseIf))r(i.ElseIf,`Expected elseif token`),g.push(f());else{var _,v;for(r(i.Else,`Expected else token`),r(i.CloseStatement,`Expected closing statement token`);!((_=e[n])?.type===i.OpenStatement&&(v=e[n+1])?.type===i.EndIf);)g.push(a())}return new h(p,m,g)}function p(){let e=R();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=I();r(i.CloseStatement,`Expected closing statement token`);let n=[];for(;o(i.OpenStatement,i.EndMacro);)n.push(a());return new b(e,t,n)}function x(e=!1){let t=e?R:ce,r=[t()],a=s(i.Comma);for(;a&&(++n,r.push(t()),s(i.Comma)););return a?new ee(r):r[0]}function T(){let e=x(!0);if(!(e instanceof w||e instanceof ee))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);r(i.In,"Expected `in` keyword following loop variable");let t=ce();r(i.CloseStatement,`Expected closing statement token`);let c=[];for(;o(i.OpenStatement,i.EndFor)&&o(i.OpenStatement,i.Else);)c.push(a());let l=[];if(s(i.OpenStatement,i.Else))for(++n,++n,r(i.CloseStatement,`Expected closing statement token`);o(i.OpenStatement,i.EndFor);)l.push(a());return new g(e,t,c,l)}function ce(){return le()}function le(){let e=M();if(s(i.If)){++n;let t=M();if(s(i.Else)){++n;let r=M();return new h(t,[e],[r])}else return new j(e,t)}return e}function M(){let t=N();for(;s(i.Or);){let r=e[n];++n;let i=N();t=new ne(r,t,i)}return t}function N(){let t=ue();for(;s(i.And);){let r=e[n];++n;let i=ue();t=new ne(r,t,i)}return t}function ue(){let t;for(;s(i.Not);){let r=e[n];++n;let i=ue();t=new ae(r,i)}return t??de()}function de(){let t=fe();for(;s(i.ComparisonBinaryOperator)||s(i.In)||s(i.NotIn);){let r=e[n];++n;let i=fe();t=new ne(r,t,i)}return t}function fe(){let t=he();for(;s(i.AdditiveBinaryOperator);){let r=e[n];++n;let i=he();t=new ne(r,t,i)}return t}function P(){let e=me(R());return s(i.OpenParen)?F(e):e}function F(e){let t=new C(e,I());return t=me(t),s(i.OpenParen)&&(t=F(t)),t}function I(){r(i.OpenParen,`Expected opening parenthesis for arguments list`);let e=L();return r(i.CloseParen,`Expected closing parenthesis for arguments list`),e}function L(){let e=[];for(;!s(i.CloseParen);){let t=ce();if(s(i.Equals)){if(++n,!(t instanceof w))throw SyntaxError(`Expected identifier for keyword argument`);let e=ce();t=new se(t,e)}e.push(t),s(i.Comma)&&++n}return e}function pe(){let e=[],t=!1;for(;!s(i.CloseSquareBracket);)s(i.Colon)?(e.push(void 0),++n,t=!0):(e.push(ce()),s(i.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new oe(...e)}return e[0]}function me(t){for(;s(i.Dot)||s(i.OpenSquareBracket);){let a=e[n];++n;let o,s=a.type!==i.Dot;if(s)o=pe(),r(i.CloseSquareBracket,`Expected closing square bracket`);else if(o=R(),o.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new S(t,o,s)}return t}function he(){let t=ge();for(;s(i.MultiplicativeBinaryOperator);){let r=e[n];++n;let i=ge();t=new ne(r,t,i)}return t}function ge(){let e=_e();for(;s(i.Is);){++n;let t=s(i.Not);t&&++n;let r=R();if(r instanceof O?r=new w(r.value.toString()):r instanceof k&&(r=new w(`none`)),!(r instanceof w))throw SyntaxError(`Expected identifier for the test`);e=new ie(e,t,r)}return e}function _e(){let e=P();for(;s(i.Pipe);){++n;let t=R();if(!(t instanceof w))throw SyntaxError(`Expected identifier for the filter`);s(i.OpenParen)&&(t=F(t)),e=new re(e,t)}return e}function R(){let t=e[n];switch(t.type){case i.NumericLiteral:return++n,new E(Number(t.value));case i.StringLiteral:return++n,new D(t.value);case i.BooleanLiteral:return++n,new O(t.value.toLowerCase()===`true`);case i.NullLiteral:return++n,new k(null);case i.Identifier:return++n,new w(t.value);case i.OpenParen:{++n;let t=x();if(e[n].type!==i.CloseParen)throw SyntaxError(`Expected closing parenthesis, got ${e[n].type} instead`);return++n,t}case i.OpenSquareBracket:{++n;let e=[];for(;!s(i.CloseSquareBracket);)e.push(ce()),s(i.Comma)&&++n;return++n,new A(e)}case i.OpenCurlyBracket:{++n;let e=new Map;for(;!s(i.CloseCurlyBracket);){let t=ce();r(i.Colon,`Expected colon between key and value in object literal`);let a=ce();e.set(t,a),s(i.Comma)&&++n}return++n,new te(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}var ue=class extends Error{},de=class extends Error{},fe=class{constructor(t=void 0){e.defineProperty(this,`type`,`RuntimeValue`),e.defineProperty(this,`value`,void 0),e.defineProperty(this,`builtins`,new Map),this.value=t}__bool__(){return new I(!!this.value)}},P=class extends fe{constructor(...t){super(...t),e.defineProperty(this,`type`,`NumericValue`)}},F=class extends fe{constructor(...t){super(...t),e.defineProperty(this,`type`,`StringValue`),e.defineProperty(this,`builtins`,new Map([[`upper`,new ge(()=>new F(this.value.toUpperCase()))],[`lower`,new ge(()=>new F(this.value.toLowerCase()))],[`strip`,new ge(()=>new F(this.value.trim()))],[`title`,new ge(()=>new F(N(this.value)))],[`length`,new P(this.value.length)],[`rstrip`,new ge(()=>new F(this.value.trimEnd()))],[`lstrip`,new ge(()=>new F(this.value.trimStart()))],[`startswith`,new ge(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(!(t instanceof F))throw Error(`startswith() argument must be a string`);return new I(this.value.startsWith(t.value))})],[`endswith`,new ge(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(!(t instanceof F))throw Error(`endswith() argument must be a string`);return new I(this.value.endsWith(t.value))})],[`split`,new ge(e=>{let t=e[0]??new _e;if(!(t instanceof F||t instanceof _e))throw Error(`sep argument must be a string or null`);let n=e[1]??new P(-1);if(!(n instanceof P))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof _e){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new me(r.map(e=>new F(e)))})]]))}},I=class extends fe{constructor(...t){super(...t),e.defineProperty(this,`type`,`BooleanValue`)}},L=class extends fe{constructor(...t){super(...t),e.defineProperty(this,`type`,`ObjectValue`),e.defineProperty(this,`builtins`,new Map([[`get`,new ge(([e,t])=>{if(!(e instanceof F))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new _e})],[`items`,new ge(()=>new me(Array.from(this.value.entries()).map(([e,t])=>new me([new F(e),t]))))]]))}__bool__(){return new I(this.value.size>0)}},pe=class extends L{constructor(...t){super(...t),e.defineProperty(this,`type`,`KeywordArgumentsValue`)}},me=class extends fe{constructor(...t){super(...t),e.defineProperty(this,`type`,`ArrayValue`),e.defineProperty(this,`builtins`,new Map([[`length`,new P(this.value.length)]]))}__bool__(){return new I(this.value.length>0)}},he=class extends me{constructor(...t){super(...t),e.defineProperty(this,`type`,`TupleValue`)}},ge=class extends fe{constructor(...t){super(...t),e.defineProperty(this,`type`,`FunctionValue`)}},_e=class extends fe{constructor(...t){super(...t),e.defineProperty(this,`type`,`NullValue`)}},R=class extends fe{constructor(...t){super(...t),e.defineProperty(this,`type`,`UndefinedValue`)}},ve=class{constructor(t){e.defineProperty(this,`variables`,new Map([[`namespace`,new ge(e=>{if(e.length===0)return new L(new Map);if(e.length!==1||!(e[0]instanceof L))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]])),e.defineProperty(this,`tests`,new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof ge],[`odd`,e=>{if(e.type!==`NumericValue`)throw Error(`Cannot apply test "odd" to type: ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(e.type!==`NumericValue`)throw Error(`Cannot apply test "even" to type: ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e.type===`NumericValue`],[`integer`,e=>e.type===`NumericValue`&&Number.isInteger(e.value)],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e.type===`ObjectValue`],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]])),this.parent=t}set(e,t){return this.declareVariable(e,be(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new R}catch{return new R}}},ye=class{constructor(t){e.defineProperty(this,`global`,void 0),this.global=t??new ve}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new I(n.value==r.value);case`!=`:return new I(n.value!=r.value)}if(n instanceof R||r instanceof R)throw Error(`Cannot perform operation on undefined values`);if(n instanceof _e||r instanceof _e)throw Error(`Cannot perform operation on null values`);if(n instanceof P&&r instanceof P)switch(e.operator.value){case`+`:return new P(n.value+r.value);case`-`:return new P(n.value-r.value);case`*`:return new P(n.value*r.value);case`/`:return new P(n.value/r.value);case`%`:return new P(n.value%r.value);case`<`:return new I(n.value`:return new I(n.value>r.value);case`>=`:return new I(n.value>=r.value);case`<=`:return new I(n.value<=r.value)}else if(n instanceof me&&r instanceof me)switch(e.operator.value){case`+`:return new me(n.value.concat(r.value))}else if(r instanceof me){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new I(t);case`not in`:return new I(!t)}}if(n instanceof F||r instanceof F)switch(e.operator.value){case`+`:return new F(n.value.toString()+r.value.toString())}if(n instanceof F&&r instanceof F)switch(e.operator.value){case`in`:return new I(r.value.includes(n.value));case`not in`:return new I(!r.value.includes(n.value))}if(n instanceof F&&r instanceof L)switch(e.operator.value){case`in`:return new I(r.value.has(n.value));case`not in`:return new I(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);if(e.filter.type===`Identifier`){let t=e.filter;if(t.value===`tojson`)return new F(xe(n));if(n instanceof me)switch(t.value){case`list`:return n;case`first`:return n.value[0];case`last`:return n.value[n.value.length-1];case`length`:return new P(n.value.length);case`reverse`:return new me(n.value.reverse());case`sort`:return new me(n.value.sort((e,t)=>{if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`NumericValue`:return e.value-t.value;case`StringValue`:return e.value.localeCompare(t.value);default:throw Error(`Cannot compare type: ${e.type}`)}}));case`join`:return new F(n.value.map(e=>e.value).join(``));case`string`:return new F(xe(n));default:throw Error(`Unknown ArrayValue filter: ${t.value}`)}else if(n instanceof F)switch(t.value){case`length`:return new P(n.value.length);case`upper`:return new F(n.value.toUpperCase());case`lower`:return new F(n.value.toLowerCase());case`title`:return new F(N(n.value));case`capitalize`:return new F(n.value.charAt(0).toUpperCase()+n.value.slice(1));case`trim`:return new F(n.value.trim());case`indent`:return new F(n.value.split(` +`).map((e,t)=>t===0||e.length===0?e:` `+e).join(` +`));case`join`:case`string`:return n;default:throw Error(`Unknown StringValue filter: ${t.value}`)}else if(n instanceof P)switch(t.value){case`abs`:return new P(Math.abs(n.value));default:throw Error(`Unknown NumericValue filter: ${t.value}`)}else if(n instanceof L)switch(t.value){case`items`:return new me(Array.from(n.value.entries()).map(([e,t])=>new me([new F(e),t])));case`length`:return new P(n.value.size);default:throw Error(`Unknown ObjectValue filter: ${t.value}`)}throw Error(`Cannot apply filter "${t.value}" to type: ${n.type}`)}else if(e.filter.type===`CallExpression`){let r=e.filter;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,e]=this.evaluateArguments(r.args,t),i=e.get(`indent`)??new _e;if(!(i instanceof P||i instanceof _e))throw Error(`If set, indent must be a number`);return new F(xe(n,i.value))}else if(i===`join`){let e;if(n instanceof F)e=Array.from(n.value);else if(n instanceof me)e=n.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${n.type}`);let[a,o]=this.evaluateArguments(r.args,t),s=a.at(0)??o.get(`separator`)??new F(``);if(!(s instanceof F))throw Error(`separator must be a string`);return new F(e.join(s.value))}if(n instanceof me){switch(i){case`selectattr`:case`rejectattr`:{let e=i===`selectattr`;if(n.value.some(e=>!(e instanceof L)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,t)),c;if(o){let e=t.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;let l=n.value.filter(t=>{let n=t.value.get(a.value),r=n?c(n,s):!1;return e?r:!r});return new me(l)}case`map`:{let[,e]=this.evaluateArguments(r.args,t);if(e.has(`attribute`)){let t=e.get(`attribute`);if(!(t instanceof F))throw Error(`attribute must be a string`);let r=e.get(`default`),i=n.value.map(e=>{if(!(e instanceof L))throw Error(`items in map must be an object`);return e.value.get(t.value)??r??new R});return new me(i)}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(n instanceof F){switch(i){case`indent`:{let[e,i]=this.evaluateArguments(r.args,t),a=e.at(0)??i.get(`width`)??new P(4);if(!(a instanceof P))throw Error(`width must be a number`);let o=e.at(1)??i.get(`first`)??new I(!1),s=e.at(2)??i.get(`blank`)??new I(!1),c=n.value.split(` +`),l=` `.repeat(a.value),u=c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e);return new F(u.join(` +`))}}throw Error(`Unknown StringValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${n.type}`)}throw Error(`Unknown filter: ${e.filter.type}`)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new I(e.negate?!i:i)}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new I(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.value)}return new F(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new pe(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof me||e instanceof F))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof P||r instanceof R))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof P||i instanceof R))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof P||a instanceof R))throw Error(`Slice step must be numeric or undefined`);return e instanceof me?new me(M(e.value,r.value,i.value,a.value)):new F(M(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new F(e.property.value);let i;if(n instanceof L){if(!(r instanceof F))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof me||n instanceof F)if(r instanceof P)i=n.value.at(r.value),n instanceof F&&(i=new F(n.value.at(r.value)));else if(r instanceof F)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof F))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof fe?i:new R}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`MemberExpression`){let r=e.assignee,i=this.evaluate(r.object,t);if(!(i instanceof L))throw Error(`Cannot assign to member of non-object`);if(r.property.type!==`Identifier`)throw Error(`Cannot assign to member with non-identifier property`);i.value.set(r.property.value,n)}else throw Error(`Invalid LHS inside assignment expression: ${JSON.stringify(e.assignee)}`);return new _e}evaluateIf(e,t){let n=this.evaluate(e.test,t);return this.evaluateBlock(n.__bool__().value?e.body:e.alternate,t)}evaluateFor(e,t){let n=new ve(t),r,i;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=this.evaluate(t.iterable,n),r=t.test}else i=this.evaluate(e.iterable,n);if(!(i instanceof me))throw Error(`Expected iterable type in for loop: got ${i.type}`);let a=[],o=[];for(let t=0;tt.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new R],[`nextitem`,t{var r;let i=new ve(n);t=t.slice();let a;(r=t.at(-1))?.type===`KeywordArgumentsValue`&&(a=t.pop());for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new he(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof F))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new L(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function be(e){switch(typeof e){case`number`:return new P(e);case`string`:return new F(e);case`boolean`:return new I(e);case`undefined`:return new R;case`object`:return e===null?new _e:Array.isArray(e)?new me(e.map(be)):new L(new Map(Object.entries(e).map(([e,t])=>[e,be(t)])));case`function`:return new ge((t,n)=>{let r=e(...t.map(e=>e.value))??null;return be(r)});default:throw Error(`Cannot convert to runtime value: ${e}`)}}function xe(e,t,n){let r=n??0;switch(e.type){case`NullValue`:case`UndefinedValue`:return`null`;case`NumericValue`:case`StringValue`:case`BooleanValue`:return JSON.stringify(e.value);case`ArrayValue`:case`ObjectValue`:{let n=t?` `.repeat(t):``,i=` +`+n.repeat(r),a=i+n;if(e.type===`ArrayValue`){let n=e.value.map(e=>xe(e,t,r+1));return t?`[${a}${n.join(`,${a}`)}${i}]`:`[${n.join(`, `)}]`}else{let n=Array.from(e.value.entries()).map(([e,n])=>{let i=`"${e}": ${xe(n,t,r+1)}`;return t?`${a}${i}`:i});return t?`{${n.join(`,`)}${i}}`:`{${n.join(`, `)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var Se=` +`,Ce=`{%- `,we=` -%}`,Te={MultiplicativeBinaryOperator:2,AdditiveBinaryOperator:1,ComparisonBinaryOperator:0};function Ee(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t,r=Oe(e.body,0,n);return r.replace(/\n$/,``)}function De(...e){return Ce+e.join(` `)+we}function Oe(e,t,n){return e.map(e=>ke(e,t,n)).join(Se)}function ke(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return Oe(e.body,t,n);case`If`:return Ae(e,t,n);case`For`:return je(e,t,n);case`Set`:return Me(e,t,n);case`Macro`:return Ne(e,t,n);case`Break`:return r+De(`break`);case`Continue`:return r+De(`continue`);default:return r+`{{- `+z(e)+` -}}`}}function Ae(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+De(`if`,z(i[0].test))+Se+Oe(i[0].body,t+1,n);for(let e=1;e0&&(o+=Se+r+De(`else`)+Se+Oe(a.alternate,t+1,n)),o+=Se+r+De(`endif`),o}function je(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${z(t.iterable)} if ${z(t.test)}`}else i=z(e.iterable);let a=r+De(`for`,z(e.loopvar),`in`,i)+Se+Oe(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=Se+r+De(`else`)+Se+Oe(e.defaultBlock,t+1,n)),a+=Se+r+De(`endfor`),a}function Me(e,t,n){let r=n.repeat(t),i=z(e.assignee),a=e.value?z(e.value):``,o=r+De(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+Se+Oe(e.body,t+1,n)+Se+r+De(`endset`)}function Ne(e,t,n){let r=n.repeat(t),i=e.args.map(z).join(`, `);return r+De(`macro`,`${e.name.value}(${i})`)+Se+Oe(e.body,t+1,n)+Se+r+De(`endmacro`)}function z(e,t=-1){switch(e.type){case`Identifier`:return e.value;case`NullLiteral`:return`none`;case`NumericLiteral`:case`BooleanLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=Te[n.operator.type]??0,i=z(n.left,r),a=z(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return rz(e,-1)).join(`, `);return`${z(t.callee,-1)}(${n})`}case`MemberExpression`:{let t=e,n=z(t.object,-1);t.object.type!==`Identifier`&&(n=`(${n})`);let r=z(t.property,-1);return!t.computed&&t.property.type!==`Identifier`&&(r=`(${r})`),t.computed?`${n}[${r}]`:`${n}.${r}`}case`FilterExpression`:{let t=e,n=z(t.operand,1/0);return t.filter.type===`CallExpression`?`${n} | ${z(t.filter,-1)}`:`${n} | ${t.filter.value}`}case`SelectExpression`:{let t=e;return`${z(t.iterable,-1)} | select(${z(t.test,-1)})`}case`TestExpression`:{let t=e;return`${z(t.operand,-1)} is${t.negate?` not`:``} ${t.test.value}`}case`ArrayLiteral`:case`TupleLiteral`:{let t=e.value.map(e=>z(e,-1)),n=e.type===`ArrayLiteral`?`[]`:`()`;return`${n[0]}${t.join(`, `)}${n[1]}`}case`ObjectLiteral`:{let t=Array.from(e.value.entries()).map(([e,t])=>`${z(e,-1)}: ${z(t,-1)}`);return`{ ${t.join(`, `)} }`}case`SliceExpression`:{let t=e,n=t.start?z(t.start,-1):``,r=t.stop?z(t.stop,-1):``,i=t.step?`:${z(t.step,-1)}`:``;return`${n}:${r}${i}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${z(t.value,-1)}`}case`If`:{let t=e,n=z(t.test,-1),r=z(t.body[0],0),i=z(t.alternate[0],-1);return`${r} if ${n} else ${i}`}default:throw Error(`Unknown expression type: ${e.type}`)}}var Pe=class{constructor(t){e.defineProperty(this,`parsed`,void 0);let n=f(t,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=ce(n)}render(e){let t=new ve;if(t.set(`false`,!1),t.set(`true`,!0),t.set(`raise_exception`,e=>{throw Error(e)}),t.set(`range`,le),e)for(let[n,r]of Object.entries(e))t.set(n,r);let n=new ye(t),r=n.run(this.parsed);return r.value}format(e){return Ee(this.parsed,e?.indent||` `)}}},"./src/backends/onnx.js":(e,t,n)=>{var r;n.r(t),n.d(t,{Tensor:()=>s.Tensor,createInferenceSession:()=>g,deviceToExecutionProviders:()=>m,isONNXProxy:()=>y,isONNXTensor:()=>_});var i=n( +/*! ../env.js */ +`./src/env.js`),a=n( +/*! onnxruntime-node */ +`?2ce3`),o=n( +/*! onnxruntime-web */ +`onnxruntime-web`),s=n( +/*! onnxruntime-common */ +`onnxruntime-common`);let c=Object.freeze({auto:null,gpu:null,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,webnn:{name:`webnn`,deviceType:`cpu`},"webnn-npu":{name:`webnn`,deviceType:`npu`},"webnn-gpu":{name:`webnn`,deviceType:`gpu`},"webnn-cpu":{name:`webnn`,deviceType:`cpu`}}),l=[],u,d,f=Symbol.for(`onnxruntime`);if(f in globalThis)d=globalThis[f];else if(i.apis.IS_NODE_ENV){switch(d=a??(r||=n.t(a,2)),process.platform){case`win32`:l.push(`dml`);break;case`linux`:process.arch===`x64`&&l.push(`cuda`);break;case`darwin`:break}l.push(`cpu`),u=[`cpu`]}else d=o,i.apis.IS_WEBNN_AVAILABLE&&l.push(`webnn-npu`,`webnn-gpu`,`webnn-cpu`,`webnn`),i.apis.IS_WEBGPU_AVAILABLE&&l.push(`webgpu`),l.push(`wasm`),u=[`wasm`];let p=d.InferenceSession;function m(e=null){if(!e)return u;switch(e){case`auto`:return l;case`gpu`:return l.filter(e=>[`webgpu`,`cuda`,`dml`,`webnn-gpu`].includes(e))}if(l.includes(e))return[c[e]??e];throw Error(`Unsupported device: "${e}". Should be one of: ${l.join(`, `)}.`)}let h=null;async function g(e,t,n){h&&await h;let r=p.create(e,t);h??=r;let i=await r;return i.config=n,i}function _(e){return e instanceof d.Tensor}let v=d?.env;v?.wasm&&(!(typeof ServiceWorkerGlobalScope<`u`&&self instanceof ServiceWorkerGlobalScope)&&!v.wasm.wasmPaths&&(v.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${i.env.version}/dist/`),v.wasm.proxy=!1),v?.webgpu&&(v.webgpu.powerPreference=`high-performance`);function y(){var e;return v==null||(e=v.wasm)==null?void 0:e.proxy}i.env.backends.onnx=v},"./src/base/feature_extraction_utils.js":(e,t,n)=>{n.r(t),n.d(t,{FeatureExtractor:()=>o,validate_audio_inputs:()=>s});var r=n( +/*! ../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),a=n( +/*! ../utils/hub.js */ +`./src/utils/hub.js`);class o extends i.Callable{constructor(e){super(),this.config=e}static async from_pretrained(e,t){let n=await(0,a.getModelJSON)(e,r.FEATURE_EXTRACTOR_NAME,!0,t);return new this(n)}}function s(e,t){var n;if(!(e instanceof Float32Array||e instanceof Float64Array))throw Error(`${t} expects input to be a Float32Array or a Float64Array, but got ${(e==null||(n=e.constructor)==null?void 0:n.name)??typeof e} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}},"./src/base/image_processors_utils.js":(e,t,n)=>{n.r(t),n.d(t,{ImageProcessor:()=>x,center_to_corners_format:()=>f,post_process_instance_segmentation:()=>b,post_process_object_detection:()=>p,post_process_panoptic_segmentation:()=>y,post_process_semantic_segmentation:()=>m});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),i=n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../utils/maths.js */ +`./src/utils/maths.js`),o=n( +/*! ../utils/image.js */ +`./src/utils/image.js`),s=n( +/*! ../utils/core.js */ +`./src/utils/core.js`),c=n( +/*! ../utils/hub.js */ +`./src/utils/hub.js`),l=n( +/*! ../utils/constants.js */ +`./src/utils/constants.js`);function u(e,t,n=0,r=null){let i=e/t,o=(0,a.bankers_round)(i)*t;return r!==null&&o>r&&(o=Math.floor(i)*t),ot&&i.push(e)}else{let e=(0,a.max)(n.data)[1];if(e===l-1||(o=(0,a.softmax)(n.data),o[e]e*s[(t+1)%2])),d.boxes.push(n),d.classes.push(t),d.scores.push(o[t])}}u.push(d)}return u}function m(e,t=null){let n=e.logits,r=n.dims[0];if(t!==null&&t.length!==r)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let a=[];for(let e=0;eu[n]&&(u[n]=t[n],d[n]=e)}let f=Array(o.dims[0]);for(let e=0;ee!==void 0);a.push({segmentation:l,labels:p})}return a}function h(e,t,n,r){let i=[],o=[],s=[];for(let c=0;cn&&(i.push(u),o.push(p),s.push(d))}return[i,o,s]}function g(e,t,n,r=.5,i=.8){let a=[],o=0,s=0,c=t[n].data;for(let t=0;t=r&&++s;let l=o>0&&s>0;if(l){let e=o/s;l=e>i}return[l,a]}function _(e,t,n,r,a,o=null,s=null){let[c,l]=s??e[0].dims,u=new i.Tensor(`int32`,new Int32Array(c*l),[c,l]),d=[];if(s!==null)for(let t=0;tp[e]&&(f[e]=n,p[e]=i[e])}let m=0,h=u.data;for(let i=0;i200)throw Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(e,t)/Math.min(e,t)}`);let a=Math.round(e/n)*n,o=Math.round(t/n)*n;if(a*o>i){let r=Math.sqrt(e*t/i);a=Math.floor(e/r/n)*n,o=Math.floor(t/r/n)*n}else if(a*oi?c=Math.floor(i*s/r):i>r&&(s=Math.floor(r*c/i)),await e.resize(c,s,{resample:n}))}async crop_margin(e,t=200){let n=e.clone().grayscale(),r=(0,a.min)(n.data)[0],i=(0,a.max)(n.data)[0],o=i-r;if(o===0)return e;let s=t/255,c=n.width,l=n.height,u=0,d=0,f=n.data;for(let e=0;ethis.preprocess(e))),r=(0,i.stack)(n.map(e=>e.pixel_values),0);return{pixel_values:r,original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}static async from_pretrained(e,t){let n=await(0,c.getModelJSON)(e,l.IMAGE_PROCESSOR_NAME,!0,t);return new this(n)}}},"./src/base/processing_utils.js":(t,n,r)=>{r.r(n),r.d(n,{Processor:()=>s});var i=r( +/*! ../utils/constants.js */ +`./src/utils/constants.js`),a=r( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),o=r( +/*! ../utils/hub.js */ +`./src/utils/hub.js`);class s extends a.Callable{constructor(e,t){super(),this.config=e,this.components=t}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(e,t={}){if(!this.tokenizer)throw Error(`Unable to apply chat template without a tokenizer.`);return this.tokenizer.apply_chat_template(e,{tokenize:!1,...t})}batch_decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.batch_decode(...e)}decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.decode(...e)}async _call(e,...t){for(let n of[this.image_processor,this.feature_extractor,this.tokenizer])if(n)return n(e,...t);throw Error(`No image processor, feature extractor, or tokenizer found.`)}static async from_pretrained(e,t){let[n,r]=await Promise.all([this.uses_processor_config?(0,o.getModelJSON)(e,i.PROCESSOR_NAME,!0,t):{},Promise.all(this.classes.filter(e=>e in this).map(async n=>{let r=await this[n].from_pretrained(e,t);return[n.replace(/_class$/,``),r]})).then(Object.fromEntries)]);return new this(n,r)}}e.defineProperty(s,`classes`,[`image_processor_class`,`tokenizer_class`,`feature_extractor_class`]),e.defineProperty(s,`uses_processor_config`,!1)},"./src/configs.js":(t,n,r)=>{r.r(n),r.d(n,{AutoConfig:()=>u,PretrainedConfig:()=>l,getKeyValueShapes:()=>c});var i=r( +/*! ./utils/core.js */ +`./src/utils/core.js`),a=r( +/*! ./utils/hub.js */ +`./src/utils/hub.js`);async function o(e,t){return await(0,a.getModelJSON)(e,`config.json`,!0,t)}function s(e){let t={},n={};switch(e.model_type){case`llava`:case`paligemma`:case`gemma3`:case`florence2`:case`llava_onevision`:case`idefics3`:case`ultravox`:case`smolvlm`:n=s(e.text_config);break;case`moondream1`:n=s(e.phi_config);break;case`musicgen`:n=s(e.decoder);break;case`multi_modality`:n=s(e.language_config);break;case`gpt2`:case`gptj`:case`jais`:case`codegen`:case`gpt_bigcode`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`n_embd`;break;case`gpt_neox`:case`stablelm`:case`opt`:case`falcon`:t.num_heads=`num_attention_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`;break;case`llama`:case`olmo`:case`olmo2`:case`mobilellm`:case`granite`:case`cohere`:case`mistral`:case`starcoder2`:case`qwen2`:case`qwen2_vl`:case`phi`:case`phi3`:case`phi3_v`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`,t.num_attention_heads=`num_attention_heads`;break;case`qwen3`:case`gemma`:case`gemma2`:case`gemma3_text`:case`glm`:case`helium`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.dim_kv=`head_dim`;break;case`openelm`:t.num_heads=`num_kv_heads`,t.num_layers=`num_transformer_layers`,t.dim_kv=`head_dim`;break;case`gpt_neo`:case`donut-swin`:t.num_heads=`num_heads`,t.num_layers=`num_layers`,t.hidden_size=`hidden_size`;break;case`bloom`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`hidden_size`;break;case`mpt`:t.num_heads=`n_heads`,t.num_layers=`n_layers`,t.hidden_size=`d_model`;break;case`exaone`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_layers`,t.dim_kv=`head_dim`,t.num_attention_heads=`num_attention_heads`;break;case`t5`:case`mt5`:case`longt5`:t.num_decoder_layers=`num_decoder_layers`,t.num_decoder_heads=`num_heads`,t.decoder_dim_kv=`d_kv`,t.num_encoder_layers=`num_layers`,t.num_encoder_heads=`num_heads`,t.encoder_dim_kv=`d_kv`;break;case`bart`:case`mbart`:case`marian`:case`whisper`:case`lite-whisper`:case`m2m_100`:case`blenderbot`:case`blenderbot-small`:case`florence2_language`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`d_model`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`d_model`;break;case`speecht5`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`hidden_size`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`hidden_size`;break;case`trocr`:t.num_encoder_layers=t.num_decoder_layers=`decoder_layers`,t.num_encoder_heads=t.num_decoder_heads=`decoder_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`d_model`;break;case`musicgen_decoder`:t.num_encoder_layers=t.num_decoder_layers=`num_hidden_layers`,t.num_encoder_heads=t.num_decoder_heads=`num_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`moonshine`:t.num_decoder_layers=`decoder_num_hidden_layers`,t.num_decoder_heads=`decoder_num_key_value_heads`,t.num_encoder_layers=`encoder_num_hidden_layers`,t.num_encoder_heads=`encoder_num_key_value_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`vision-encoder-decoder`:let r=s(e.decoder),a=`num_decoder_layers`in r,o=(0,i.pick)(e,[`model_type`,`is_encoder_decoder`]);return a?(o.num_decoder_layers=r.num_decoder_layers,o.num_decoder_heads=r.num_decoder_heads,o.decoder_hidden_size=r.decoder_hidden_size,o.num_encoder_layers=r.num_encoder_layers,o.num_encoder_heads=r.num_encoder_heads,o.encoder_hidden_size=r.encoder_hidden_size):(o.num_layers=r.num_layers,o.num_heads=r.num_heads,o.hidden_size=r.hidden_size),o}let r={...n,...(0,i.pick)(e,[`model_type`,`multi_query`,`is_encoder_decoder`])};for(let n in t)r[n]=e[t[n]];return r}function c(e,{prefix:t=`past_key_values`,batch_size:n=1}={}){let r={},i=e.normalized_config;if(i.is_encoder_decoder&&`num_encoder_heads`in i&&`num_decoder_heads`in i){let e=i.encoder_dim_kv??i.encoder_hidden_size/i.num_encoder_heads,a=i.decoder_dim_kv??i.decoder_hidden_size/i.num_decoder_heads,o=[n,i.num_encoder_heads,0,e],s=[n,i.num_decoder_heads,0,a];for(let e=0;e{var r,i;n.r(t),n.d(t,{apis:()=>v,env:()=>w});var a=n( +/*! fs */ +`?569f`),o=n( +/*! path */ +`?3f59`),s=n( +/*! url */ +`?154a`);let c=`3.5.2`,l=typeof window<`u`&&window.document!==void 0,u=typeof self<`u`&&(r=self.constructor)?.name===`DedicatedWorkerGlobalScope`,d=typeof self<`u`&&`caches`in self,f=typeof navigator<`u`&&`gpu`in navigator,p=typeof navigator<`u`&&`ml`in navigator,m=typeof process<`u`,h=m&&((i=process)==null||(i=i.release)==null?void 0:i.name)===`node`,g=!T(a),_=!T(o),v=Object.freeze({IS_BROWSER_ENV:l,IS_WEBWORKER_ENV:u,IS_WEB_CACHE_AVAILABLE:d,IS_WEBGPU_AVAILABLE:f,IS_WEBNN_AVAILABLE:p,IS_PROCESS_AVAILABLE:m,IS_NODE_ENV:h,IS_FS_AVAILABLE:g,IS_PATH_AVAILABLE:_}),y=g&&_,b=`./`;if(y){let e=Object(cf).url;e?b=o.dirname(o.dirname(s.fileURLToPath(e))):typeof __dirname<`u`&&(b=o.dirname(__dirname))}let x=y?o.join(b,`/.cache/`):null,S=`/models/`,C=y?o.join(b,S):S,w={version:c,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(l||u),localModelPath:C,useFS:g,useBrowserCache:d,useFSCache:g,cacheDir:x,useCustomCache:!1,customCache:null};function T(e){return Object.keys(e).length===0}},"./src/generation/configuration_utils.js":(t,n,r)=>{r.r(n),r.d(n,{GenerationConfig:()=>a});var i=r( +/*! ../utils/core.js */ +`./src/utils/core.js`);class a{constructor(t){e.defineProperty(this,`max_length`,20),e.defineProperty(this,`max_new_tokens`,null),e.defineProperty(this,`min_length`,0),e.defineProperty(this,`min_new_tokens`,null),e.defineProperty(this,`early_stopping`,!1),e.defineProperty(this,`max_time`,null),e.defineProperty(this,`do_sample`,!1),e.defineProperty(this,`num_beams`,1),e.defineProperty(this,`num_beam_groups`,1),e.defineProperty(this,`penalty_alpha`,null),e.defineProperty(this,`use_cache`,!0),e.defineProperty(this,`temperature`,1),e.defineProperty(this,`top_k`,50),e.defineProperty(this,`top_p`,1),e.defineProperty(this,`typical_p`,1),e.defineProperty(this,`epsilon_cutoff`,0),e.defineProperty(this,`eta_cutoff`,0),e.defineProperty(this,`diversity_penalty`,0),e.defineProperty(this,`repetition_penalty`,1),e.defineProperty(this,`encoder_repetition_penalty`,1),e.defineProperty(this,`length_penalty`,1),e.defineProperty(this,`no_repeat_ngram_size`,0),e.defineProperty(this,`bad_words_ids`,null),e.defineProperty(this,`force_words_ids`,null),e.defineProperty(this,`renormalize_logits`,!1),e.defineProperty(this,`constraints`,null),e.defineProperty(this,`forced_bos_token_id`,null),e.defineProperty(this,`forced_eos_token_id`,null),e.defineProperty(this,`remove_invalid_values`,!1),e.defineProperty(this,`exponential_decay_length_penalty`,null),e.defineProperty(this,`suppress_tokens`,null),e.defineProperty(this,`streamer`,null),e.defineProperty(this,`begin_suppress_tokens`,null),e.defineProperty(this,`forced_decoder_ids`,null),e.defineProperty(this,`guidance_scale`,null),e.defineProperty(this,`num_return_sequences`,1),e.defineProperty(this,`output_attentions`,!1),e.defineProperty(this,`output_hidden_states`,!1),e.defineProperty(this,`output_scores`,!1),e.defineProperty(this,`return_dict_in_generate`,!1),e.defineProperty(this,`pad_token_id`,null),e.defineProperty(this,`bos_token_id`,null),e.defineProperty(this,`eos_token_id`,null),e.defineProperty(this,`encoder_no_repeat_ngram_size`,0),e.defineProperty(this,`decoder_start_token_id`,null),e.defineProperty(this,`generation_kwargs`,{}),Object.assign(this,(0,i.pick)(t,Object.getOwnPropertyNames(this)))}}},"./src/generation/logits_process.js":(e,t,n)=>{n.r(t),n.d(t,{ClassifierFreeGuidanceLogitsProcessor:()=>v,ForcedBOSTokenLogitsProcessor:()=>l,ForcedEOSTokenLogitsProcessor:()=>u,LogitsProcessor:()=>o,LogitsProcessorList:()=>c,LogitsWarper:()=>s,MinLengthLogitsProcessor:()=>h,MinNewTokensLengthLogitsProcessor:()=>g,NoBadWordsLogitsProcessor:()=>_,NoRepeatNGramLogitsProcessor:()=>p,RepetitionPenaltyLogitsProcessor:()=>m,SuppressTokensAtBeginLogitsProcessor:()=>d,TemperatureLogitsWarper:()=>y,TopKLogitsWarper:()=>x,TopPLogitsWarper:()=>b,WhisperTimeStampLogitsProcessor:()=>f});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),i=n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../utils/maths.js */ +`./src/utils/maths.js`);class o extends r.Callable{_call(e,t){throw Error("`_call` should be implemented in a subclass")}}class s extends r.Callable{_call(e,t){throw Error("`_call` should be implemented in a subclass")}}class c extends r.Callable{constructor(){super(),this.processors=[]}push(e){this.processors.push(e)}extend(e){this.processors.push(...e)}_call(e,t){let n=t;for(let t of this.processors)n=t(e,n);return n}[Symbol.iterator](){return this.processors.values()}}class l extends o{constructor(e){super(),this.bos_token_id=e}_call(e,t){for(let n=0;n=1&&i[i.length-1]>=this.timestamp_begin,s=i.length<2||i[i.length-2]>=this.timestamp_begin;if(o&&(s?r.subarray(this.timestamp_begin).fill(-1/0):r.subarray(0,this.eos_token_id).fill(-1/0)),e[n].length===this.begin_index&&this.max_initial_timestamp_index!==null){let e=this.timestamp_begin+this.max_initial_timestamp_index;r.subarray(e+1).fill(-1/0)}let c=(0,a.log_softmax)(r),l=Math.log(c.subarray(this.timestamp_begin).map(Math.exp).reduce((e,t)=>e+t)),u=(0,a.max)(c.subarray(0,this.timestamp_begin))[0];l>u&&r.subarray(0,this.timestamp_begin).fill(-1/0)}return t}}class p extends o{constructor(e){super(),this.no_repeat_ngram_size=e}getNgrams(e){let t=e.length,n=[];for(let r=0;r1 to use the classifier free guidance processor, got guidance scale ${e}.`);this.guidance_scale=e}_call(e,t){if(t.dims[0]!==2*e.length)throw Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${t.dims[0]} for the logits and ${e.length} for the input ids.`);let n=e.length,r=t.slice([0,n],null),i=t.slice([n,t.dims[0]],null);for(let e=0;e1)throw Error(`\`top_p\` must be a float > 0 and < 1, but is ${e}`);if(!Number.isInteger(n)||n<1)throw Error(`\`min_tokens_to_keep\` must be a positive integer, but is ${n}`);this.top_p=e,this.filter_value=t,this.min_tokens_to_keep=n}}class x extends s{constructor(e,{filter_value:t=-1/0,min_tokens_to_keep:n=1}={}){if(super(),!Number.isInteger(e)||e<0)throw Error(`\`top_k\` must be a positive integer, but is ${e}`);this.top_k=Math.max(e,n),this.filter_value=t}}},"./src/generation/logits_sampler.js":(e,t,n)=>{n.r(t),n.d(t,{LogitsSampler:()=>s});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),i=n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../utils/maths.js */ +`./src/utils/maths.js`),o=n( +/*! ../generation/configuration_utils.js */ +`./src/generation/configuration_utils.js`);class s extends r.Callable{constructor(e){super(),this.generation_config=e}async _call(e){return this.sample(e)}async sample(e){throw Error(`sample should be implemented in subclasses.`)}getLogits(e,t){let n=e.dims.at(-1),r=e.data;if(t===-1)r=r.slice(-n);else{let e=t*n;r=r.slice(e,e+n)}return r}randomSelect(e){let t=0;for(let n=0;n1)return new u(e);if(e.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${e.num_return_sequences}.`);return new c(e)}}class c extends s{async sample(e){let t=(0,a.max)(e.data)[1];return[[BigInt(t),0]]}}class l extends s{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await(0,i.topk)(e,t),o=(0,a.softmax)(n.data);return Array.from({length:this.generation_config.num_beams},()=>{let e=this.randomSelect(o);return[r.data[e],Math.log(o[e])]})}}class u extends s{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await(0,i.topk)(e,t),o=(0,a.softmax)(n.data);return Array.from({length:this.generation_config.num_beams},(e,t)=>[r.data[t],Math.log(o[t])])}}},"./src/generation/stopping_criteria.js":(e,t,n)=>{n.r(t),n.d(t,{EosTokenCriteria:()=>s,InterruptableStoppingCriteria:()=>c,MaxLengthCriteria:()=>o,StoppingCriteria:()=>i,StoppingCriteriaList:()=>a});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`);class i extends r.Callable{_call(e,t){throw Error(`StoppingCriteria needs to be subclassed`)}}class a extends r.Callable{constructor(){super(),this.criteria=[]}push(e){this.criteria.push(e)}extend(e){e instanceof a?e=e.criteria:e instanceof i&&(e=[e]),this.criteria.push(...e)}_call(e,t){let n=Array(e.length).fill(!1);for(let i of this.criteria){var r;let a=i(e,t);for(let e=0;ee.length>=this.max_length)}}class s extends i{constructor(e){super(),Array.isArray(e)||(e=[e]),this.eos_token_id=e}_call(e,t){return e.map(e=>{let t=e.at(-1);return this.eos_token_id.some(e=>t==e)})}}class c extends i{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(e,t){return Array(e.length).fill(this.interrupted)}}},"./src/generation/streamers.js":(e,t,n)=>{n.r(t),n.d(t,{BaseStreamer:()=>o,TextStreamer:()=>c,WhisperTextStreamer:()=>l});var r=n( +/*! ../utils/core.js */ +`./src/utils/core.js`),i=n( +/*! ../tokenizers.js */ +`./src/tokenizers.js`),a=n( +/*! ../env.js */ +`./src/env.js`);class o{put(e){throw Error(`Not implemented`)}end(){throw Error(`Not implemented`)}}let s=a.apis.IS_PROCESS_AVAILABLE?e=>process.stdout.write(e):e=>console.log(e);class c extends o{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,skip_special_tokens:i=!0,decode_kwargs:a={},...o}={}){super(),this.tokenizer=e,this.skip_prompt=t,this.callback_function=n??s,this.token_callback_function=r,this.decode_kwargs={skip_special_tokens:i,...a,...o},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(e){var t;if(e.length>1)throw Error(`TextStreamer only supports batch size of 1`);let n=this.next_tokens_are_prompt;if(n&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;let a=e[0];(t=this.token_callback_function)?.call(this,a),this.token_cache=(0,r.mergeArrays)(this.token_cache,a);let o=this.tokenizer.decode(this.token_cache,this.decode_kwargs),s;n||o.endsWith(` +`)?(s=o.slice(this.print_len),this.token_cache=[],this.print_len=0):o.length>0&&(0,i.is_chinese_char)(o.charCodeAt(o.length-1))?(s=o.slice(this.print_len),this.print_len+=s.length):(s=o.slice(this.print_len,o.lastIndexOf(` `)+1),this.print_len+=s.length),this.on_finalized_text(s,!1)}end(){let e;if(this.token_cache.length>0){let t=this.tokenizer.decode(this.token_cache,this.decode_kwargs);e=t.slice(this.print_len),this.token_cache=[],this.print_len=0}else e=``;this.next_tokens_are_prompt=!0,this.on_finalized_text(e,!0)}on_finalized_text(e,t){var n,r;e.length>0&&(n=this.callback_function)?.call(this,e),t&&this.callback_function===s&&a.apis.IS_PROCESS_AVAILABLE&&(r=this.callback_function)?.call(this,` +`)}}class l extends c{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,on_chunk_start:i=null,on_chunk_end:a=null,on_finalize:o=null,time_precision:s=.02,skip_special_tokens:c=!0,decode_kwargs:l={}}={}){super(e,{skip_prompt:t,skip_special_tokens:c,callback_function:n,token_callback_function:r,decode_kwargs:l}),this.timestamp_begin=e.timestamp_begin,this.on_chunk_start=i,this.on_chunk_end=a,this.on_finalize=o,this.time_precision=s,this.waiting_for_timestamp=!1}put(e){if(e.length>1)throw Error(`WhisperTextStreamer only supports batch size of 1`);let t=e[0];if(t.length===1){let e=Number(t[0])-this.timestamp_begin;if(e>=0){var n,r,i;let a=e*this.time_precision;this.waiting_for_timestamp?(n=this.on_chunk_end)?.call(this,a):(r=this.on_chunk_start)?.call(this,a),this.waiting_for_timestamp=!this.waiting_for_timestamp,(i=this.token_callback_function)?.call(this,t);return}}return super.put(e)}end(){var e;super.end(),(e=this.on_finalize)?.call(this)}}},"./src/models.js":(t,n,r)=>{r.r(n),r.d(n,{ASTForAudioClassification:()=>Tn,ASTModel:()=>wn,ASTPreTrainedModel:()=>Cn,AlbertForMaskedLM:()=>Lt,AlbertForQuestionAnswering:()=>It,AlbertForSequenceClassification:()=>Ft,AlbertModel:()=>Pt,AlbertPreTrainedModel:()=>Nt,AutoModel:()=>tu,AutoModelForAudioClassification:()=>bu,AutoModelForAudioFrameClassification:()=>Su,AutoModelForAudioTextToText:()=>ju,AutoModelForCTC:()=>yu,AutoModelForCausalLM:()=>cu,AutoModelForDepthEstimation:()=>Eu,AutoModelForDocumentQuestionAnswering:()=>Cu,AutoModelForImageClassification:()=>fu,AutoModelForImageFeatureExtraction:()=>ku,AutoModelForImageMatting:()=>wu,AutoModelForImageSegmentation:()=>pu,AutoModelForImageTextToText:()=>Au,AutoModelForImageToImage:()=>Tu,AutoModelForMaskGeneration:()=>vu,AutoModelForMaskedLM:()=>lu,AutoModelForNormalEstimation:()=>Du,AutoModelForObjectDetection:()=>gu,AutoModelForPoseEstimation:()=>Ou,AutoModelForQuestionAnswering:()=>uu,AutoModelForSemanticSegmentation:()=>mu,AutoModelForSeq2SeqLM:()=>iu,AutoModelForSequenceClassification:()=>nu,AutoModelForSpeechSeq2Seq:()=>au,AutoModelForTextToSpectrogram:()=>ou,AutoModelForTextToWaveform:()=>su,AutoModelForTokenClassification:()=>ru,AutoModelForUniversalSegmentation:()=>hu,AutoModelForVision2Seq:()=>du,AutoModelForXVector:()=>xu,AutoModelForZeroShotObjectDetection:()=>_u,BartForConditionalGeneration:()=>Yt,BartForSequenceClassification:()=>Xt,BartModel:()=>Jt,BartPretrainedModel:()=>qt,BaseModelOutput:()=>me,BeitForImageClassification:()=>va,BeitModel:()=>_a,BeitPreTrainedModel:()=>ga,BertForMaskedLM:()=>_e,BertForQuestionAnswering:()=>ye,BertForSequenceClassification:()=>R,BertForTokenClassification:()=>ve,BertModel:()=>ge,BertPreTrainedModel:()=>he,BlenderbotForConditionalGeneration:()=>an,BlenderbotModel:()=>rn,BlenderbotPreTrainedModel:()=>nn,BlenderbotSmallForConditionalGeneration:()=>sn,BlenderbotSmallModel:()=>on,BlenderbotSmallPreTrainedModel:()=>H,BloomForCausalLM:()=>Oi,BloomModel:()=>Di,BloomPreTrainedModel:()=>Ei,CLIPModel:()=>Jn,CLIPPreTrainedModel:()=>qn,CLIPSegForImageSegmentation:()=>sr,CLIPSegModel:()=>Y,CLIPSegPreTrainedModel:()=>J,CLIPTextModel:()=>Yn,CLIPTextModelWithProjection:()=>Xn,CLIPVisionModel:()=>Zn,CLIPVisionModelWithProjection:()=>Qn,CamembertForMaskedLM:()=>We,CamembertForQuestionAnswering:()=>qe,CamembertForSequenceClassification:()=>Ge,CamembertForTokenClassification:()=>Ke,CamembertModel:()=>V,CamembertPreTrainedModel:()=>Ue,CausalLMOutput:()=>Lu,CausalLMOutputWithPast:()=>Ru,ChineseCLIPModel:()=>rr,ChineseCLIPPreTrainedModel:()=>nr,ClapAudioModelWithProjection:()=>ac,ClapModel:()=>rc,ClapPreTrainedModel:()=>nc,ClapTextModelWithProjection:()=>ic,CodeGenForCausalLM:()=>Er,CodeGenModel:()=>Tr,CodeGenPreTrainedModel:()=>wr,CohereForCausalLM:()=>$r,CohereModel:()=>Qr,CoherePreTrainedModel:()=>Zr,ConvBertForMaskedLM:()=>Pe,ConvBertForQuestionAnswering:()=>Le,ConvBertForSequenceClassification:()=>Fe,ConvBertForTokenClassification:()=>Ie,ConvBertModel:()=>z,ConvBertPreTrainedModel:()=>Ne,ConvNextForImageClassification:()=>Mo,ConvNextModel:()=>jo,ConvNextPreTrainedModel:()=>Ao,ConvNextV2ForImageClassification:()=>Fo,ConvNextV2Model:()=>Po,ConvNextV2PreTrainedModel:()=>No,DFineForObjectDetection:()=>za,DFineModel:()=>Ra,DFinePreTrainedModel:()=>La,DPTForDepthEstimation:()=>co,DPTModel:()=>so,DPTPreTrainedModel:()=>oo,DacDecoderModel:()=>ul,DacDecoderOutput:()=>sl,DacEncoderModel:()=>ll,DacEncoderOutput:()=>ol,DacModel:()=>cl,DacPreTrainedModel:()=>al,DebertaForMaskedLM:()=>Xe,DebertaForQuestionAnswering:()=>$e,DebertaForSequenceClassification:()=>Ze,DebertaForTokenClassification:()=>Qe,DebertaModel:()=>Ye,DebertaPreTrainedModel:()=>Je,DebertaV2ForMaskedLM:()=>nt,DebertaV2ForQuestionAnswering:()=>at,DebertaV2ForSequenceClassification:()=>rt,DebertaV2ForTokenClassification:()=>it,DebertaV2Model:()=>tt,DebertaV2PreTrainedModel:()=>et,DecisionTransformerModel:()=>zc,DecisionTransformerPreTrainedModel:()=>Rc,DeiTForImageClassification:()=>Ka,DeiTModel:()=>Ga,DeiTPreTrainedModel:()=>Wa,DepthAnythingForDepthEstimation:()=>uo,DepthAnythingPreTrainedModel:()=>lo,DepthProForDepthEstimation:()=>_o,DepthProPreTrainedModel:()=>go,DetrForObjectDetection:()=>xa,DetrForSegmentation:()=>Sa,DetrModel:()=>ba,DetrObjectDetectionOutput:()=>Ca,DetrPreTrainedModel:()=>ya,DetrSegmentationOutput:()=>wa,Dinov2ForImageClassification:()=>Ro,Dinov2Model:()=>Lo,Dinov2PreTrainedModel:()=>Io,Dinov2WithRegistersForImageClassification:()=>Vo,Dinov2WithRegistersModel:()=>Bo,Dinov2WithRegistersPreTrainedModel:()=>zo,DistilBertForMaskedLM:()=>dt,DistilBertForQuestionAnswering:()=>ut,DistilBertForSequenceClassification:()=>ct,DistilBertForTokenClassification:()=>lt,DistilBertModel:()=>st,DistilBertPreTrainedModel:()=>ot,DonutSwinModel:()=>ko,DonutSwinPreTrainedModel:()=>Oo,EfficientNetForImageClassification:()=>_c,EfficientNetModel:()=>gc,EfficientNetPreTrainedModel:()=>hc,ElectraForMaskedLM:()=>Be,ElectraForQuestionAnswering:()=>He,ElectraForSequenceClassification:()=>B,ElectraForTokenClassification:()=>Ve,ElectraModel:()=>ze,ElectraPreTrainedModel:()=>Re,EsmForMaskedLM:()=>mt,EsmForSequenceClassification:()=>ht,EsmForTokenClassification:()=>gt,EsmModel:()=>pt,EsmPreTrainedModel:()=>ft,ExaoneForCausalLM:()=>Rr,ExaoneModel:()=>Lr,ExaonePreTrainedModel:()=>Ir,FalconForCausalLM:()=>tc,FalconModel:()=>ec,FalconPreTrainedModel:()=>$s,FastViTForImageClassification:()=>ta,FastViTModel:()=>ea,FastViTPreTrainedModel:()=>$i,Florence2ForConditionalGeneration:()=>zn,Florence2PreTrainedModel:()=>Rn,GLPNForDepthEstimation:()=>Do,GLPNModel:()=>Eo,GLPNPreTrainedModel:()=>To,GPT2LMHeadModel:()=>ur,GPT2Model:()=>lr,GPT2PreTrainedModel:()=>cr,GPTBigCodeForCausalLM:()=>Cr,GPTBigCodeModel:()=>Sr,GPTBigCodePreTrainedModel:()=>xr,GPTJForCausalLM:()=>br,GPTJModel:()=>yr,GPTJPreTrainedModel:()=>vr,GPTNeoForCausalLM:()=>mr,GPTNeoModel:()=>Z,GPTNeoPreTrainedModel:()=>pr,GPTNeoXForCausalLM:()=>_r,GPTNeoXModel:()=>gr,GPTNeoXPreTrainedModel:()=>hr,Gemma2ForCausalLM:()=>ai,Gemma2Model:()=>ii,Gemma2PreTrainedModel:()=>ri,Gemma3ForCausalLM:()=>ci,Gemma3Model:()=>si,Gemma3PreTrainedModel:()=>oi,GemmaForCausalLM:()=>ni,GemmaModel:()=>ti,GemmaPreTrainedModel:()=>ei,GlmForCausalLM:()=>Fr,GlmModel:()=>Pr,GlmPreTrainedModel:()=>Nr,GraniteForCausalLM:()=>Xr,GraniteModel:()=>Yr,GranitePreTrainedModel:()=>Jr,GroundingDinoForObjectDetection:()=>Uo,GroundingDinoPreTrainedModel:()=>Ho,GroupViTModel:()=>Qi,GroupViTPreTrainedModel:()=>Zi,HeliumForCausalLM:()=>Mr,HeliumModel:()=>jr,HeliumPreTrainedModel:()=>Ar,HieraForImageClassification:()=>Ya,HieraModel:()=>Ja,HieraPreTrainedModel:()=>qa,HubertForCTC:()=>As,HubertForSequenceClassification:()=>js,HubertModel:()=>ks,HubertPreTrainedModel:()=>Os,IJepaForImageClassification:()=>Bi,IJepaModel:()=>zi,IJepaPreTrainedModel:()=>Ri,Idefics3ForConditionalGeneration:()=>Un,Idefics3PreTrainedModel:()=>Hn,ImageMattingOutput:()=>zu,JAISLMHeadModel:()=>fr,JAISModel:()=>dr,JAISPreTrainedModel:()=>X,JinaCLIPModel:()=>ar,JinaCLIPPreTrainedModel:()=>ir,JinaCLIPTextModel:()=>q,JinaCLIPVisionModel:()=>or,LiteWhisperForConditionalGeneration:()=>kn,LlamaForCausalLM:()=>kr,LlamaModel:()=>Or,LlamaPreTrainedModel:()=>Dr,LlavaForConditionalGeneration:()=>Fn,LlavaOnevisionForConditionalGeneration:()=>In,LlavaPreTrainedModel:()=>Pn,LongT5ForConditionalGeneration:()=>Ut,LongT5Model:()=>Ht,LongT5PreTrainedModel:()=>Vt,M2M100ForConditionalGeneration:()=>ns,M2M100Model:()=>ts,M2M100PreTrainedModel:()=>es,MBartForCausalLM:()=>tn,MBartForConditionalGeneration:()=>$t,MBartForSequenceClassification:()=>en,MBartModel:()=>Qt,MBartPreTrainedModel:()=>Zt,MPNetForMaskedLM:()=>wt,MPNetForQuestionAnswering:()=>Dt,MPNetForSequenceClassification:()=>Tt,MPNetForTokenClassification:()=>Et,MPNetModel:()=>Ct,MPNetPreTrainedModel:()=>St,MT5ForConditionalGeneration:()=>Kt,MT5Model:()=>Gt,MT5PreTrainedModel:()=>Wt,MarianMTModel:()=>$o,MarianModel:()=>Qo,MarianPreTrainedModel:()=>Zo,MaskFormerForInstanceSegmentation:()=>wo,MaskFormerModel:()=>Co,MaskFormerPreTrainedModel:()=>So,MaskedLMOutput:()=>Fu,Metric3DForDepthEstimation:()=>yo,Metric3DPreTrainedModel:()=>vo,Metric3Dv2ForDepthEstimation:()=>xo,Metric3Dv2PreTrainedModel:()=>bo,MgpstrForSceneTextRecognition:()=>Wc,MgpstrModelOutput:()=>Hc,MgpstrPreTrainedModel:()=>Uc,MimiDecoderModel:()=>il,MimiDecoderOutput:()=>tl,MimiEncoderModel:()=>rl,MimiEncoderOutput:()=>el,MimiModel:()=>nl,MimiPreTrainedModel:()=>$c,MistralForCausalLM:()=>Ys,MistralModel:()=>Js,MistralPreTrainedModel:()=>qs,MobileBertForMaskedLM:()=>yt,MobileBertForQuestionAnswering:()=>xt,MobileBertForSequenceClassification:()=>bt,MobileBertModel:()=>vt,MobileBertPreTrainedModel:()=>_t,MobileLLMForCausalLM:()=>Vr,MobileLLMModel:()=>Br,MobileLLMPreTrainedModel:()=>zr,MobileNetV1ForImageClassification:()=>wc,MobileNetV1ForSemanticSegmentation:()=>Tc,MobileNetV1Model:()=>Cc,MobileNetV1PreTrainedModel:()=>Sc,MobileNetV2ForImageClassification:()=>Oc,MobileNetV2ForSemanticSegmentation:()=>kc,MobileNetV2Model:()=>Dc,MobileNetV2PreTrainedModel:()=>Ec,MobileNetV3ForImageClassification:()=>Mc,MobileNetV3ForSemanticSegmentation:()=>Nc,MobileNetV3Model:()=>jc,MobileNetV3PreTrainedModel:()=>Ac,MobileNetV4ForImageClassification:()=>Ic,MobileNetV4ForSemanticSegmentation:()=>Lc,MobileNetV4Model:()=>Fc,MobileNetV4PreTrainedModel:()=>Pc,MobileViTForImageClassification:()=>oa,MobileViTModel:()=>aa,MobileViTPreTrainedModel:()=>ia,MobileViTV2ForImageClassification:()=>la,MobileViTV2Model:()=>ca,MobileViTV2PreTrainedModel:()=>sa,ModelOutput:()=>pe,ModernBertForMaskedLM:()=>Se,ModernBertForSequenceClassification:()=>Ce,ModernBertForTokenClassification:()=>we,ModernBertModel:()=>xe,ModernBertPreTrainedModel:()=>be,Moondream1ForConditionalGeneration:()=>Ln,MoonshineForConditionalGeneration:()=>Mn,MoonshineModel:()=>jn,MoonshinePreTrainedModel:()=>An,MptForCausalLM:()=>ji,MptModel:()=>Ai,MptPreTrainedModel:()=>ki,MultiModalityCausalLM:()=>Vc,MultiModalityPreTrainedModel:()=>Bc,MusicgenForCausalLM:()=>bc,MusicgenForConditionalGeneration:()=>xc,MusicgenModel:()=>yc,MusicgenPreTrainedModel:()=>vc,NomicBertModel:()=>Ee,NomicBertPreTrainedModel:()=>Te,OPTForCausalLM:()=>Pi,OPTModel:()=>Ni,OPTPreTrainedModel:()=>Mi,Olmo2ForCausalLM:()=>qr,Olmo2Model:()=>Kr,Olmo2PreTrainedModel:()=>Gr,OlmoForCausalLM:()=>Wr,OlmoModel:()=>Ur,OlmoPreTrainedModel:()=>Hr,OpenELMForCausalLM:()=>di,OpenELMModel:()=>ui,OpenELMPreTrainedModel:()=>li,OwlViTForObjectDetection:()=>fa,OwlViTModel:()=>da,OwlViTPreTrainedModel:()=>ua,Owlv2ForObjectDetection:()=>ha,Owlv2Model:()=>ma,Owlv2PreTrainedModel:()=>pa,PaliGemmaForConditionalGeneration:()=>Vn,PaliGemmaPreTrainedModel:()=>Bn,PatchTSMixerForPrediction:()=>Xc,PatchTSMixerModel:()=>Yc,PatchTSMixerPreTrainedModel:()=>Jc,PatchTSTForPrediction:()=>qc,PatchTSTModel:()=>Kc,PatchTSTPreTrainedModel:()=>Gc,Phi3ForCausalLM:()=>Ti,Phi3Model:()=>wi,Phi3PreTrainedModel:()=>Ci,Phi3VForCausalLM:()=>Kn,Phi3VPreTrainedModel:()=>Gn,PhiForCausalLM:()=>Si,PhiModel:()=>xi,PhiPreTrainedModel:()=>bi,PreTrainedModel:()=>L,PretrainedMixin:()=>hl,PvtForImageClassification:()=>Gi,PvtModel:()=>Wi,PvtPreTrainedModel:()=>Ui,PyAnnoteForAudioFrameClassification:()=>fs,PyAnnoteModel:()=>ds,PyAnnotePreTrainedModel:()=>us,QuestionAnsweringModelOutput:()=>Iu,Qwen2ForCausalLM:()=>mi,Qwen2Model:()=>pi,Qwen2PreTrainedModel:()=>fi,Qwen2VLForConditionalGeneration:()=>yi,Qwen2VLPreTrainedModel:()=>vi,Qwen3ForCausalLM:()=>_i,Qwen3Model:()=>gi,Qwen3PreTrainedModel:()=>hi,RFDetrForObjectDetection:()=>Fa,RFDetrModel:()=>Pa,RFDetrObjectDetectionOutput:()=>Ia,RFDetrPreTrainedModel:()=>Na,RTDetrForObjectDetection:()=>Da,RTDetrModel:()=>Ea,RTDetrObjectDetectionOutput:()=>Oa,RTDetrPreTrainedModel:()=>Ta,RTDetrV2ForObjectDetection:()=>ja,RTDetrV2Model:()=>Aa,RTDetrV2ObjectDetectionOutput:()=>Ma,RTDetrV2PreTrainedModel:()=>ka,ResNetForImageClassification:()=>Qa,ResNetModel:()=>Za,ResNetPreTrainedModel:()=>Xa,RoFormerForMaskedLM:()=>ke,RoFormerForQuestionAnswering:()=>Me,RoFormerForSequenceClassification:()=>Ae,RoFormerForTokenClassification:()=>je,RoFormerModel:()=>Oe,RoFormerPreTrainedModel:()=>De,RobertaForMaskedLM:()=>un,RobertaForQuestionAnswering:()=>pn,RobertaForSequenceClassification:()=>dn,RobertaForTokenClassification:()=>fn,RobertaModel:()=>ln,RobertaPreTrainedModel:()=>cn,SamImageSegmentationOutput:()=>Xo,SamModel:()=>Yo,SamPreTrainedModel:()=>Jo,SapiensForDepthEstimation:()=>mo,SapiensForNormalEstimation:()=>ho,SapiensForSemanticSegmentation:()=>po,SapiensPreTrainedModel:()=>fo,SegformerForImageClassification:()=>uc,SegformerForSemanticSegmentation:()=>dc,SegformerModel:()=>lc,SegformerPreTrainedModel:()=>cc,Seq2SeqLMOutput:()=>Mu,SequenceClassifierOutput:()=>Q,SiglipModel:()=>er,SiglipPreTrainedModel:()=>$n,SiglipTextModel:()=>tr,SiglipVisionModel:()=>K,SmolVLMForConditionalGeneration:()=>Wn,SnacDecoderModel:()=>ml,SnacEncoderModel:()=>pl,SnacModel:()=>fl,SnacPreTrainedModel:()=>dl,SpeechT5ForSpeechToText:()=>Hs,SpeechT5ForTextToSpeech:()=>Us,SpeechT5HifiGan:()=>Ws,SpeechT5Model:()=>Vs,SpeechT5PreTrainedModel:()=>Bs,SqueezeBertForMaskedLM:()=>At,SqueezeBertForQuestionAnswering:()=>Mt,SqueezeBertForSequenceClassification:()=>jt,SqueezeBertModel:()=>kt,SqueezeBertPreTrainedModel:()=>Ot,StableLmForCausalLM:()=>mc,StableLmModel:()=>pc,StableLmPreTrainedModel:()=>fc,Starcoder2ForCausalLM:()=>Qs,Starcoder2Model:()=>Zs,Starcoder2PreTrainedModel:()=>Xs,StyleTextToSpeech2Model:()=>zs,StyleTextToSpeech2PreTrainedModel:()=>Rs,Swin2SRForImageSuperResolution:()=>ao,Swin2SRModel:()=>io,Swin2SRPreTrainedModel:()=>ro,SwinForImageClassification:()=>to,SwinForSemanticSegmentation:()=>no,SwinModel:()=>eo,SwinPreTrainedModel:()=>$a,T5ForConditionalGeneration:()=>Bt,T5Model:()=>zt,T5PreTrainedModel:()=>Rt,TableTransformerForObjectDetection:()=>Ha,TableTransformerModel:()=>Va,TableTransformerObjectDetectionOutput:()=>Ua,TableTransformerPreTrainedModel:()=>Ba,TokenClassifierOutput:()=>Pu,TrOCRForCausalLM:()=>Ks,TrOCRPreTrainedModel:()=>Gs,UltravoxModel:()=>Qc,UltravoxPreTrainedModel:()=>Zc,UniSpeechForCTC:()=>_s,UniSpeechForSequenceClassification:()=>vs,UniSpeechModel:()=>gs,UniSpeechPreTrainedModel:()=>hs,UniSpeechSatForAudioFrameClassification:()=>Cs,UniSpeechSatForCTC:()=>xs,UniSpeechSatForSequenceClassification:()=>Ss,UniSpeechSatModel:()=>bs,UniSpeechSatPreTrainedModel:()=>ys,ViTForImageClassification:()=>Li,ViTMAEModel:()=>qi,ViTMAEPreTrainedModel:()=>Ki,ViTMSNForImageClassification:()=>Xi,ViTMSNModel:()=>Yi,ViTMSNPreTrainedModel:()=>Ji,ViTModel:()=>Ii,ViTPreTrainedModel:()=>Fi,VisionEncoderDecoderModel:()=>Nn,VitMatteForImageMatting:()=>ra,VitMattePreTrainedModel:()=>na,VitPoseForPoseEstimation:()=>Hi,VitPosePreTrainedModel:()=>Vi,VitsModel:()=>sc,VitsModelOutput:()=>Bu,VitsPreTrainedModel:()=>oc,Wav2Vec2BertForCTC:()=>Es,Wav2Vec2BertForSequenceClassification:()=>Ds,Wav2Vec2BertModel:()=>Ts,Wav2Vec2BertPreTrainedModel:()=>ws,Wav2Vec2ForAudioFrameClassification:()=>ls,Wav2Vec2ForCTC:()=>ss,Wav2Vec2ForSequenceClassification:()=>cs,Wav2Vec2Model:()=>os,Wav2Vec2PreTrainedModel:()=>rs,WavLMForAudioFrameClassification:()=>Ls,WavLMForCTC:()=>Ps,WavLMForSequenceClassification:()=>Fs,WavLMForXVector:()=>Is,WavLMModel:()=>Ns,WavLMPreTrainedModel:()=>Ms,WeSpeakerResNetModel:()=>ms,WeSpeakerResNetPreTrainedModel:()=>ps,WhisperForConditionalGeneration:()=>On,WhisperModel:()=>Dn,WhisperPreTrainedModel:()=>En,XLMForQuestionAnswering:()=>_n,XLMForSequenceClassification:()=>gn,XLMForTokenClassification:()=>W,XLMModel:()=>mn,XLMPreTrainedModel:()=>U,XLMRobertaForMaskedLM:()=>bn,XLMRobertaForQuestionAnswering:()=>Sn,XLMRobertaForSequenceClassification:()=>G,XLMRobertaForTokenClassification:()=>xn,XLMRobertaModel:()=>yn,XLMRobertaPreTrainedModel:()=>vn,XLMWithLMHeadModel:()=>hn,XVectorOutput:()=>Nu,YolosForObjectDetection:()=>Ko,YolosModel:()=>Go,YolosObjectDetectionOutput:()=>qo,YolosPreTrainedModel:()=>Wo});var i=r( +/*! ./configs.js */ +`./src/configs.js`),a=r( +/*! ./backends/onnx.js */ +`./src/backends/onnx.js`),o=r( +/*! ./utils/dtypes.js */ +`./src/utils/dtypes.js`),s=r( +/*! ./utils/generic.js */ +`./src/utils/generic.js`),c=r( +/*! ./utils/core.js */ +`./src/utils/core.js`),l=r( +/*! ./utils/hub.js */ +`./src/utils/hub.js`),u=r( +/*! ./utils/constants.js */ +`./src/utils/constants.js`),d=r( +/*! ./generation/logits_process.js */ +`./src/generation/logits_process.js`),f=r( +/*! ./generation/configuration_utils.js */ +`./src/generation/configuration_utils.js`),p=r( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),m=r( +/*! ./utils/image.js */ +`./src/utils/image.js`),h=r( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),g=r( +/*! ./generation/stopping_criteria.js */ +`./src/generation/stopping_criteria.js`),_=r( +/*! ./generation/logits_sampler.js */ +`./src/generation/logits_sampler.js`),v=r( +/*! ./env.js */ +`./src/env.js`),y=r( +/*! ./models/whisper/generation_whisper.js */ +`./src/models/whisper/generation_whisper.js`),b=r( +/*! ./models/whisper/common_whisper.js */ +`./src/models/whisper/common_whisper.js`);let x={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11},S=new Map,C=new Map,w=new Map;async function T(e,t,n){var r;let s=(r=n.config)?.[`transformers.js_config`]??{},c=n.device??s.device;c&&typeof c!=`string`&&(c.hasOwnProperty(t)?c=c[t]:(console.warn(`device not specified for "${t}". Using the default device.`),c=null));let u=c??(v.apis.IS_NODE_ENV?`cpu`:`wasm`),d=(0,a.deviceToExecutionProviders)(u),f=s.device_config??{};f.hasOwnProperty(u)&&(s={...s,...f[u]});let p=n.dtype??s.dtype;if(typeof p!=`string`&&(p&&p.hasOwnProperty(t)?p=p[t]:(p=o.DEFAULT_DEVICE_DTYPE_MAPPING[u]??o.DATA_TYPES.fp32,console.warn(`dtype not specified for "${t}". Using the default dtype (${p}) for this device (${u}).`))),p===o.DATA_TYPES.auto){let e=s.dtype;typeof e!=`string`&&(e=e?.[t]),p=e&&e!==o.DATA_TYPES.auto&&o.DATA_TYPES.hasOwnProperty(e)?e:o.DEFAULT_DEVICE_DTYPE_MAPPING[u]??o.DATA_TYPES.fp32}let m=p;if(o.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(m)){if(m===o.DATA_TYPES.fp16&&u===`webgpu`&&!await(0,o.isWebGpuFp16Supported)())throw Error(`The device (${u}) does not support fp16.`)}else throw Error(`Invalid dtype: ${m}. Should be one of: ${Object.keys(o.DATA_TYPES).join(`, `)}`);let h=s.kv_cache_dtype,g=h?typeof h==`string`?h:h[m]??`float32`:void 0;if(g&&![`float32`,`float16`].includes(g))throw Error(`Invalid kv_cache_dtype: ${g}. Should be one of: float32, float16`);let _={dtype:m,kv_cache_dtype:g,device:u},y=o.DEFAULT_DTYPE_SUFFIX_MAPPING[m],b=`${t}${y}.onnx`,x=`${n.subfolder??``}/${b}`,S={...n.session_options};S.executionProviders??=d;let C=s.free_dimension_overrides;C?S.freeDimensionOverrides??=C:u.startsWith(`webnn`)&&!S.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${u}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let w=v.apis.IS_NODE_ENV&&v.env.useFSCache,T=(0,l.getModelFile)(e,x,!0,n,w),E=n.use_external_data_format??s.use_external_data_format,D=[];if(E){let r;r=typeof E==`object`?E.hasOwnProperty(b)?E[b]:E.hasOwnProperty(t)?E[t]:!1:E;let i=+r;if(i>l.MAX_EXTERNAL_DATA_CHUNKS)throw Error(`The number of external data chunks (${i}) exceeds the maximum allowed value (${l.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let t=0;t{let o=await(0,l.getModelFile)(e,i,!0,n,w);t(o instanceof Uint8Array?{path:r,data:o}:r)}))}}else S.externalData!==void 0&&(D=S.externalData.map(async t=>{if(typeof t.data==`string`){let r=await(0,l.getModelFile)(e,t.data,!0,n);return{...t,data:r}}return t}));if(D.length>0){let e=await Promise.all(D);v.apis.IS_NODE_ENV||(S.externalData=e)}if(u===`webgpu`){let e=(0,i.getKeyValueShapes)(n.config,{prefix:`present`});if(Object.keys(e).length>0&&!(0,a.isONNXProxy)()){let t={};for(let n in e)t[n]=`gpu-buffer`;S.preferredOutputLocation=t}}let O=await T;return{buffer_or_path:O,session_options:S,session_config:_}}async function E(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let{buffer_or_path:i,session_options:o,session_config:s}=await T(e,t[r],n),c=await(0,a.createInferenceSession)(i,o,s);return[r,c]})))}async function D(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let i=await(0,l.getModelJSON)(e,t[r],!1,n);return[r,i]})))}function O(e,t){let n=Object.create(null),r=[];for(let i of e.inputNames){let e=t[i];if(!(e instanceof p.Tensor)){r.push(i);continue}n[i]=(0,a.isONNXProxy)()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let i=Object.keys(t).length,o=e.inputNames.length;if(i>o){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));console.warn(`WARNING: Too many inputs were provided (${i} > ${o}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}let k=Promise.resolve();async function A(e,t){let n=O(e,t);try{let t=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,t.ort_tensor])),r=()=>e.run(t),i=await(v.apis.IS_BROWSER_ENV||v.apis.IS_WEBWORKER_ENV?k=k.then(r):r());return ee(i)}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw console.error(`An error occurred during model execution: "${e}".`),console.error(`Inputs given to model:`,t),e}}function ee(e){for(let t in e)(0,a.isONNXTensor)(e[t])?e[t]=new p.Tensor(e[t]):typeof e[t]==`object`&&ee(e[t]);return e}function te(e){if(e instanceof p.Tensor)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new p.Tensor(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new p.Tensor(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function ne(e){return new p.Tensor(`bool`,[e],[1])}async function re(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,...a}=t;if(!n){let r=(0,c.pick)(t,e.sessions.model.inputNames);n=(await j(e,r)).last_hidden_state}a.input_ids=i,a.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(a.encoder_attention_mask=t.attention_mask);let o=await ae(e,a,!0);return o}async function j(e,t){let n=e.sessions.model,r=(0,c.pick)(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=(0,p.zeros_like)(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=(0,p.ones)([e[0],e[2],e[3]])}return await A(n,r)}async function ie(e,t){let n=await e.encode(t),r=await e.decode(n);return r}async function ae(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;if(r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=ne(!!i)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids){let t=[`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type)?1:0;a.position_ids=de(a,i,t)}e.addPastKeyValues(a,i);let o=(0,c.pick)(a,r.inputNames);return await A(r,o)}function oe({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;er.dims[1])){if(tt==e.config.image_token_index)){let i=e.config.num_image_tokens;if(!i)throw Error("`num_image_tokens` is missing in the model configuration.");let a=r.dims[1]-(t-i);n.input_ids=r.slice(null,[-a,null]),n.attention_mask=(0,p.ones)([1,t+a])}}}return n}function P(e,t,n,r){return n.past_key_values&&(t=t.map(e=>[e.at(-1)])),{...n,decoder_input_ids:te(t)}}function F(e,...t){return e.config.is_encoder_decoder?P(e,...t):fe(e,...t)}function I(e,t,n,r){let i=!!n.past_key_values;if(r.guidance_scale!==null&&r.guidance_scale>1&&(i?n.input_ids=(0,p.cat)([n.input_ids,n.input_ids],0):(n.input_ids=(0,p.cat)([n.input_ids,(0,p.full_like)(n.input_ids,BigInt(r.pad_token_id))],0),n.attention_mask=(0,p.cat)([n.attention_mask,(0,p.full_like)(n.attention_mask,0n)],0))),(i||!n.pixel_values)&&(n.pixel_values=(0,p.full)([0,0,3,384,384],1)),i){let e=0,t=1,r=e>0?1:0,i=1;n.images_seq_mask=new p.Tensor(`bool`,Array(e+t).fill(!0).fill(!1,0,t),[i,e+t]),n.images_emb_mask=new p.Tensor(`bool`,Array(e).fill(!!r),[i,1,e])}return n}class L extends s.Callable{constructor(t,n,r){super(),e.defineProperty(this,`main_input_name`,`input_ids`),e.defineProperty(this,`forward_params`,[`input_ids`,`attention_mask`]),this.config=t,this.sessions=n,this.configs=r;let i=w.get(this.constructor),a=S.get(i);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,a){case x.DecoderOnly:this.can_generate=!0,this._forward=ae,this._prepare_inputs_for_generation=fe;break;case x.Seq2Seq:case x.Vision2Seq:case x.Musicgen:this.can_generate=!0,this._forward=re,this._prepare_inputs_for_generation=P;break;case x.EncoderDecoder:this._forward=re;break;case x.ImageTextToText:this.can_generate=!0,this._forward=N,this._prepare_inputs_for_generation=F;break;case x.AudioTextToText:this.can_generate=!0,this._forward=M,this._prepare_inputs_for_generation=F;break;case x.Phi3V:this.can_generate=!0,this._prepare_inputs_for_generation=F;break;case x.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=I;break;case x.AutoEncoder:this._forward=ie;break;default:this._forward=j;break}this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){var e;let t=[];for(let n of Object.values(this.sessions))!(n==null||(e=n.handler)==null)&&e.dispose&&t.push(n.handler.dispose());return await Promise.all(t)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:l=null,dtype:d=null,use_external_data_format:f=null,session_options:p={}}={}){let m={progress_callback:t,config:n,cache_dir:r,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:l,dtype:d,use_external_data_format:f,session_options:p},h=w.get(this),g=S.get(h);n=m.config=await i.AutoConfig.from_pretrained(e,m);let _;if(g===x.DecoderOnly)_=await Promise.all([E(e,{model:m.model_file_name??`model`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.Seq2Seq||g===x.Vision2Seq)_=await Promise.all([E(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.MaskGeneration)_=await Promise.all([E(e,{model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`},m)]);else if(g===x.EncoderDecoder)_=await Promise.all([E(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m)]);else if(g===x.ImageTextToText){let t={embed_tokens:`embed_tokens`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};n.is_encoder_decoder&&(t.model=`encoder_model`),_=await Promise.all([E(e,t,m),D(e,{generation_config:`generation_config.json`},m)])}else if(g===x.AudioTextToText){let t={embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,decoder_model_merged:`decoder_model_merged`};_=await Promise.all([E(e,t,m),D(e,{generation_config:`generation_config.json`},m)])}else if(g===x.Musicgen)_=await Promise.all([E(e,{model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.MultiModality)_=await Promise.all([E(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.Phi3V)_=await Promise.all([E(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`},m),D(e,{generation_config:`generation_config.json`},m)]);else if(g===x.AutoEncoder)_=await Promise.all([E(e,{encoder_model:`encoder_model`,decoder_model:`decoder_model`},m)]);else{if(g!==x.EncoderOnly){let e=h??n?.model_type;e!==`custom`&&console.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${u.GITHUB_ISSUE_URL}.`)}_=await Promise.all([E(e,{model:m.model_file_name??`model`},m)])}return new this(n,..._)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){var e;return(e=this.configs)?.generation_config??null}_get_logits_warper(e){let t=new d.LogitsProcessorList;return e.temperature!==null&&e.temperature!==1&&t.push(new d.TemperatureLogitsWarper(e.temperature)),e.top_k!==null&&e.top_k!==0&&t.push(new d.TopKLogitsWarper(e.top_k)),e.top_p!==null&&e.top_p<1&&t.push(new d.TopPLogitsWarper(e.top_p)),t}_get_logits_processor(e,t,n=null){let r=new d.LogitsProcessorList;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new d.RepetitionPenaltyLogitsProcessor(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new d.NoRepeatNGramLogitsProcessor(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new d.NoBadWordsLogitsProcessor(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new d.MinLengthLogitsProcessor(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new d.MinNewTokensLengthLogitsProcessor(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new d.ForcedBOSTokenLogitsProcessor(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new d.ForcedEOSTokenLogitsProcessor(e.max_length,e.forced_eos_token_id)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new d.SuppressTokensAtBeginLogitsProcessor(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new d.ClassifierFreeGuidanceLogitsProcessor(e.guidance_scale)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=f.GenerationConfig){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,(0,c.pick)(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new g.StoppingCriteriaList;return e.max_length!==null&&n.push(new g.MaxLengthCriteria(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new g.EosTokenCriteria(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[El,Al,Tl,bl],t=w.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t.get(r);e&&n.add(e[0])}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=this.getPastKeyValues(t,n.past_key_values),n.input_ids=new p.Tensor(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n:n.attention_mask=(0,p.cat)([n.attention_mask,(0,p.ones)([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=(0,c.pick)(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;let a=r[i];return{inputs_tensor:a,model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...(0,c.pick)(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await j(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=(0,p.cat)([i,(0,p.full_like)(i,0)],0),`attention_mask`in t&&(t.attention_mask=(0,p.cat)([t.attention_mask,(0,p.zeros_like)(t.attention_mask)],0));else if(t.decoder_input_ids){let e=te(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=(0,p.cat)(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof p.Tensor)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=te(o)}return n.decoder_attention_mask=(0,p.ones_like)(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let f=this._get_logits_processor(t,d,n),m=this._get_stopping_criteria(t,r),h=s[c].dims.at(0),g=_.LogitsSampler.getSampler(t),v=Array(h).fill(0),y=u.tolist();i&&i.put(y);let b,x={};for(;;){if(s=this.prepare_inputs_for_generation(y,s,t),b=await this.forward(s),t.output_attentions&&t.return_dict_in_generate){let e=this.getAttentions(b);for(let t in e)t in x||(x[t]=[]),x[t].push(e[t])}let e=b.logits.slice(null,-1,null),n=f(y,e),r=[];for(let e=0;ee))break;s=this._update_model_kwargs_for_generation({generated_input_ids:r,outputs:b,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let S=this.getPastKeyValues(b,s.past_key_values,!0),C=new p.Tensor(`int64`,y.flat(),[y.length,y[0].length]);if(t.return_dict_in_generate)return{sequences:C,past_key_values:S,...x};for(let e of Object.values(b))e.location===`gpu-buffer`&&e.dispose();return C}getPastKeyValues(e,t,n=!1){let r=Object.create(null);for(let i in e)if(i.startsWith(`present`)){let a=i.replace(`present`,`past_key_values`),o=i.includes(`encoder`);if(o&&t?r[a]=t[a]:r[a]=e[i],t&&(!o||n)){let e=t[a];e.location===`gpu-buffer`&&e.dispose()}}return r}getAttentions(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}addPastKeyValues(e,t){if(t)Object.assign(e,t);else{var n,r;let t=this.sessions.decoder_model_merged??this.sessions.model,a=(t==null||(n=t.config)==null?void 0:n.kv_cache_dtype)??`float32`,o=a===`float16`?new p.DataTypeMap.float16:[],s=((r=e[this.main_input_name]??e.attention_mask)==null||(r=r.dims)==null?void 0:r[0])??1,c=(0,i.getKeyValueShapes)(this.config,{batch_size:s});for(let t in c)e[t]=new p.Tensor(a,o,c[t])}}async encode_image({pixel_values:e}){let t=(await A(this.sessions.vision_encoder,{pixel_values:e})).image_features;return this.config.num_image_tokens||(console.warn(`The number of image tokens was not set in the model configuration. Setting it to the number of features detected by the vision encoder (${t.dims[1]}).`),this.config.num_image_tokens=t.dims[1]),t}async encode_text({input_ids:e}){return(await A(this.sessions.embed_tokens,{input_ids:e})).inputs_embeds}async encode_audio({audio_values:e}){return(await A(this.sessions.audio_encoder,{audio_values:e})).audio_features}}class pe{}class me extends pe{constructor({last_hidden_state:e,hidden_states:t=null,attentions:n=null}){super(),this.last_hidden_state=e,this.hidden_states=t,this.attentions=n}}class he extends L{}class ge extends he{}class _e extends he{async _call(e){return new Fu(await super._call(e))}}class R extends he{async _call(e){return new Q(await super._call(e))}}class ve extends he{async _call(e){return new Pu(await super._call(e))}}class ye extends he{async _call(e){return new Iu(await super._call(e))}}class be extends L{}class xe extends be{}class Se extends be{async _call(e){return new Fu(await super._call(e))}}class Ce extends be{async _call(e){return new Q(await super._call(e))}}class we extends be{async _call(e){return new Pu(await super._call(e))}}class Te extends L{}class Ee extends Te{}class De extends L{}class Oe extends De{}class ke extends De{async _call(e){return new Fu(await super._call(e))}}class Ae extends De{async _call(e){return new Q(await super._call(e))}}class je extends De{async _call(e){return new Pu(await super._call(e))}}class Me extends De{async _call(e){return new Iu(await super._call(e))}}class Ne extends L{}class z extends Ne{}class Pe extends Ne{async _call(e){return new Fu(await super._call(e))}}class Fe extends Ne{async _call(e){return new Q(await super._call(e))}}class Ie extends Ne{async _call(e){return new Pu(await super._call(e))}}class Le extends Ne{async _call(e){return new Iu(await super._call(e))}}class Re extends L{}class ze extends Re{}class Be extends Re{async _call(e){return new Fu(await super._call(e))}}class B extends Re{async _call(e){return new Q(await super._call(e))}}class Ve extends Re{async _call(e){return new Pu(await super._call(e))}}class He extends Re{async _call(e){return new Iu(await super._call(e))}}class Ue extends L{}class V extends Ue{}class We extends Ue{async _call(e){return new Fu(await super._call(e))}}class Ge extends Ue{async _call(e){return new Q(await super._call(e))}}class Ke extends Ue{async _call(e){return new Pu(await super._call(e))}}class qe extends Ue{async _call(e){return new Iu(await super._call(e))}}class Je extends L{}class Ye extends Je{}class Xe extends Je{async _call(e){return new Fu(await super._call(e))}}class Ze extends Je{async _call(e){return new Q(await super._call(e))}}class Qe extends Je{async _call(e){return new Pu(await super._call(e))}}class $e extends Je{async _call(e){return new Iu(await super._call(e))}}class et extends L{}class tt extends et{}class nt extends et{async _call(e){return new Fu(await super._call(e))}}class rt extends et{async _call(e){return new Q(await super._call(e))}}class it extends et{async _call(e){return new Pu(await super._call(e))}}class at extends et{async _call(e){return new Iu(await super._call(e))}}class ot extends L{}class st extends ot{}class ct extends ot{async _call(e){return new Q(await super._call(e))}}class lt extends ot{async _call(e){return new Pu(await super._call(e))}}class ut extends ot{async _call(e){return new Iu(await super._call(e))}}class dt extends ot{async _call(e){return new Fu(await super._call(e))}}class ft extends L{}class pt extends ft{}class mt extends ft{async _call(e){return new Fu(await super._call(e))}}class ht extends ft{async _call(e){return new Q(await super._call(e))}}class gt extends ft{async _call(e){return new Pu(await super._call(e))}}class _t extends L{}class vt extends _t{}class yt extends _t{async _call(e){return new Fu(await super._call(e))}}class bt extends _t{async _call(e){return new Q(await super._call(e))}}class xt extends _t{async _call(e){return new Iu(await super._call(e))}}class St extends L{}class Ct extends St{}class wt extends St{async _call(e){return new Fu(await super._call(e))}}class Tt extends St{async _call(e){return new Q(await super._call(e))}}class Et extends St{async _call(e){return new Pu(await super._call(e))}}class Dt extends St{async _call(e){return new Iu(await super._call(e))}}class Ot extends L{}class kt extends Ot{}class At extends Ot{async _call(e){return new Fu(await super._call(e))}}class jt extends Ot{async _call(e){return new Q(await super._call(e))}}class Mt extends Ot{async _call(e){return new Iu(await super._call(e))}}class Nt extends L{}class Pt extends Nt{}class Ft extends Nt{async _call(e){return new Q(await super._call(e))}}class It extends Nt{async _call(e){return new Iu(await super._call(e))}}class Lt extends Nt{async _call(e){return new Fu(await super._call(e))}}class Rt extends L{constructor(...t){super(...t),e.defineProperty(this,`forward_params`,[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`])}}class zt extends Rt{}class Bt extends Rt{}class Vt extends L{}class Ht extends Vt{}class Ut extends Vt{}class Wt extends L{}class Gt extends Wt{}class Kt extends Wt{}class qt extends L{}class Jt extends qt{}class Yt extends qt{}class Xt extends qt{async _call(e){return new Q(await super._call(e))}}class Zt extends L{}class Qt extends Zt{}class $t extends Zt{}class en extends Zt{async _call(e){return new Q(await super._call(e))}}class tn extends Zt{}class nn extends L{}class rn extends nn{}class an extends nn{}class H extends L{}class on extends H{}class sn extends H{}class cn extends L{}class ln extends cn{}class un extends cn{async _call(e){return new Fu(await super._call(e))}}class dn extends cn{async _call(e){return new Q(await super._call(e))}}class fn extends cn{async _call(e){return new Pu(await super._call(e))}}class pn extends cn{async _call(e){return new Iu(await super._call(e))}}class U extends L{}class mn extends U{}class hn extends U{async _call(e){return new Fu(await super._call(e))}}class gn extends U{async _call(e){return new Q(await super._call(e))}}class W extends U{async _call(e){return new Pu(await super._call(e))}}class _n extends U{async _call(e){return new Iu(await super._call(e))}}class vn extends L{}class yn extends vn{}class bn extends vn{async _call(e){return new Fu(await super._call(e))}}class G extends vn{async _call(e){return new Q(await super._call(e))}}class xn extends vn{async _call(e){return new Pu(await super._call(e))}}class Sn extends vn{async _call(e){return new Iu(await super._call(e))}}class Cn extends L{}class wn extends Cn{}class Tn extends Cn{}class En extends L{constructor(...t){super(...t),e.defineProperty(this,`requires_attention_mask`,!1),e.defineProperty(this,`main_input_name`,`input_features`),e.defineProperty(this,`forward_params`,[`input_features`,`attention_mask`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`])}}class Dn extends En{}class On extends En{_prepare_generation_config(e,t){return super._prepare_generation_config(e,t,y.WhisperGenerationConfig)}_retrieve_init_tokens(e){let t=[e.decoder_start_token_id],n=e.language,r=e.task;if(e.is_multilingual){n||(console.warn(`No language specified - defaulting to English (en).`),n=`en`);let i=(0,b.whisper_language_to_code)(n),a=`<|${i}|>`;t.push(e.lang_to_id[a]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new d.LogitsProcessorList,n.push(new d.WhisperTimeStampLogitsProcessor(t,a))),t.begin_suppress_tokens&&(n??=new d.LogitsProcessorList,n.push(new d.SuppressTokensAtBeginLogitsProcessor(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&console.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames)),o}_extract_token_timestamps(e,t,n=null,r=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let i=this.config.median_filter_width;i===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let a=e.cross_attentions,o=Array.from({length:this.config.decoder_layers},(e,t)=>(0,p.cat)(a.map(e=>e[t]),2)),s=(0,p.stack)(t.map(([e,t])=>{if(e>=o.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${o.length}).`);return n?o[e].slice(null,t,null,[0,n]):o[e].slice(null,t)})).transpose(1,0,2,3),[l,u]=(0,p.std_mean)(s,-2,0,!0),d=s.clone();for(let e=0;en[t+1]-n[t]),o=(0,c.mergeArrays)([1],a).map(e=>!!e),s=[];for(let e=0;ee.findIndex(e=>e==i)),s=o.every(e=>e===-1),c=o.every(e=>e!==-1);if(!s&&!c)throw Error(`Every input should contain either 0 or 1 image token.`);if(s)return{inputs_embeds:e,attention_mask:r};let l=[],u=[];for(let n=0;nArray.from({length:e.dims[0]},t=>Array.from({length:e.dims[1]},e=>1))),f=t?t.tolist():[],m=n?n.tolist():[],g=0,_=0;for(let e=0;eu[e][n]==1),n=t.reduce((e,t,n)=>(t==s&&e.push(n),e),[]),r=n.map(e=>t[e+1]),p=r.filter(e=>e==a).length,v=r.filter(e=>e==o).length,y=[],b=0,x=p,S=v;for(let e=0;et>b&&e==a),n=t.findIndex((e,t)=>t>b&&e==o),r=x>0&&e!==-1?e:t.length+1,i=S>0&&n!==-1?n:t.length+1,s,l,u,d;r0?(0,h.max)(y.at(-1))[0]+1:0;y.push(Array.from({length:3*w},(e,t)=>T+t%w));let E=w+T,D=p*v*C,O=Array.from({length:D},(e,t)=>E+Math.floor(t/(v*C))),k=Array.from({length:D},(e,t)=>E+Math.floor(t/C)%v),A=Array.from({length:D},(e,t)=>E+t%C);y.push([O,k,A].flat()),b=s+D}if(b0?(0,h.max)(y.at(-1))[0]+1:0,n=t.length-b;y.push(Array.from({length:3*n},(t,r)=>e+r%n))}let C=y.reduce((e,t)=>e+t.length,0),w=Array(C),T=0;for(let e=0;e<3;++e)for(let t=0;te[n%e.length]),i=Array.from({length:t[0]},(n,r)=>(0,h.max)(e.subarray(t[1]*r,t[1]*(r+1)))[0]+1n+BigInt(t[1]));return[new p.Tensor(`int64`,n,[3,...t]),new p.Tensor(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims,r=BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t)));return[new p.Tensor(`int64`,r,[3,...e.dims]),(0,p.zeros)([t,1])]}}async encode_image({pixel_values:e,image_grid_thw:t}){let n=(await A(this.sessions.vision_encoder,{pixel_values:e,grid_thw:t})).image_features;return n}_merge_input_ids_with_image_features(e){return se({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(t.attention_mask&&!t.position_ids)if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=BigInt(Object.values(t.past_key_values)[0].dims.at(-2)),n=t.rope_deltas.map(t=>e+t);t.position_ids=(0,p.stack)([n,n,n],0)}return t}}class bi extends L{}class xi extends bi{}class Si extends bi{}class Ci extends L{}class wi extends Ci{}class Ti extends Ci{}class Ei extends L{}class Di extends Ei{}class Oi extends Ei{}class ki extends L{}class Ai extends ki{}class ji extends ki{}class Mi extends L{}class Ni extends Mi{}class Pi extends Mi{}class Fi extends L{}class Ii extends Fi{}class Li extends Fi{async _call(e){return new Q(await super._call(e))}}class Ri extends L{}class zi extends Ri{}class Bi extends Ri{async _call(e){return new Q(await super._call(e))}}class Vi extends L{}class Hi extends Vi{}class Ui extends L{}class Wi extends Ui{}class Gi extends Ui{async _call(e){return new Q(await super._call(e))}}class Ki extends L{}class qi extends Ki{}class Ji extends L{}class Yi extends Ji{}class Xi extends Ji{async _call(e){return new Q(await super._call(e))}}class Zi extends L{}class Qi extends Zi{}class $i extends L{}class ea extends $i{}class ta extends $i{async _call(e){return new Q(await super._call(e))}}class na extends L{}class ra extends na{async _call(e){return new zu(await super._call(e))}}class ia extends L{}class aa extends ia{}class oa extends ia{async _call(e){return new Q(await super._call(e))}}class sa extends L{}class ca extends sa{}class la extends sa{async _call(e){return new Q(await super._call(e))}}class ua extends L{}class da extends ua{}class fa extends ua{}class pa extends L{}class ma extends pa{}class ha extends pa{}class ga extends L{}class _a extends ga{}class va extends ga{async _call(e){return new Q(await super._call(e))}}class ya extends L{}class ba extends ya{}class xa extends ya{async _call(e){return new Ca(await super._call(e))}}class Sa extends ya{async _call(e){return new wa(await super._call(e))}}class Ca extends pe{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class wa extends pe{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}}class Ta extends L{}class Ea extends Ta{}class Da extends Ta{async _call(e){return new Oa(await super._call(e))}}class Oa extends pe{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class ka extends L{}class Aa extends ka{}class ja extends ka{async _call(e){return new Ma(await super._call(e))}}class Ma extends Oa{}class Na extends L{}class Pa extends Na{}class Fa extends Na{async _call(e){return new Ia(await super._call(e))}}class Ia extends Oa{}class La extends L{}class Ra extends La{}class za extends La{async _call(e){return new Oa(await super._call(e))}}class Ba extends L{}class Va extends Ba{}class Ha extends Ba{async _call(e){return new Ua(await super._call(e))}}class Ua extends Ca{}class Wa extends L{}class Ga extends Wa{}class Ka extends Wa{async _call(e){return new Q(await super._call(e))}}class qa extends L{}class Ja extends qa{}class Ya extends qa{async _call(e){return new Q(await super._call(e))}}class Xa extends L{}class Za extends Xa{}class Qa extends Xa{async _call(e){return new Q(await super._call(e))}}class $a extends L{}class eo extends $a{}class to extends $a{async _call(e){return new Q(await super._call(e))}}class no extends $a{}class ro extends L{}class io extends ro{}class ao extends ro{}class oo extends L{}class so extends oo{}class co extends oo{}class lo extends L{}class uo extends lo{}class fo extends L{}class po extends fo{}class mo extends fo{}class ho extends fo{}class go extends L{}class _o extends go{}class vo extends L{}class yo extends vo{}class bo extends L{}class xo extends bo{}class So extends L{}class Co extends So{}class wo extends So{}class To extends L{}class Eo extends To{}class Do extends To{}class Oo extends L{}class ko extends Oo{}class Ao extends L{}class jo extends Ao{}class Mo extends Ao{async _call(e){return new Q(await super._call(e))}}class No extends L{}class Po extends No{}class Fo extends No{async _call(e){return new Q(await super._call(e))}}class Io extends L{}class Lo extends Io{}class Ro extends Io{async _call(e){return new Q(await super._call(e))}}class zo extends L{}class Bo extends zo{}class Vo extends zo{async _call(e){return new Q(await super._call(e))}}class Ho extends L{}class Uo extends Ho{}class Wo extends L{}class Go extends Wo{}class Ko extends Wo{async _call(e){return new qo(await super._call(e))}}class qo extends pe{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Jo extends L{}class Yo extends Jo{async get_image_embeddings({pixel_values:e}){return await j(this,{pixel_values:e})}async forward(e){if((!e.image_embeddings||!e.image_positional_embeddings)&&(e={...e,...await this.get_image_embeddings(e)}),!e.input_labels&&e.input_points){let t=e.input_points.dims.slice(0,-1),n=t.reduce((e,t)=>e*t,1);e.input_labels=new p.Tensor(`int64`,new BigInt64Array(n).fill(1n),t)}let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await A(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new Xo(await super._call(e))}}class Xo extends pe{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}}class Zo extends L{}class Qo extends Zo{}class $o extends Zo{}class es extends L{}class ts extends es{}class ns extends es{}class rs extends L{}class os extends rs{}class ss extends rs{async _call(e){return new Lu(await super._call(e))}}class cs extends rs{async _call(e){return new Q(await super._call(e))}}class ls extends rs{async _call(e){return new Pu(await super._call(e))}}class us extends L{}class ds extends us{}class fs extends us{async _call(e){return new Pu(await super._call(e))}}class ps extends L{}class ms extends ps{}class hs extends L{}class gs extends hs{}class _s extends hs{async _call(e){return new Lu(await super._call(e))}}class vs extends hs{async _call(e){return new Q(await super._call(e))}}class ys extends L{}class bs extends ys{}class xs extends ys{async _call(e){return new Lu(await super._call(e))}}class Ss extends ys{async _call(e){return new Q(await super._call(e))}}class Cs extends ys{async _call(e){return new Pu(await super._call(e))}}class ws extends L{}class Ts extends ws{}class Es extends ws{async _call(e){return new Lu(await super._call(e))}}class Ds extends ws{async _call(e){return new Q(await super._call(e))}}class Os extends L{}class ks extends rs{}class As extends rs{async _call(e){return new Lu(await super._call(e))}}class js extends rs{async _call(e){return new Q(await super._call(e))}}class Ms extends L{}class Ns extends Ms{}class Ps extends Ms{async _call(e){return new Lu(await super._call(e))}}class Fs extends Ms{async _call(e){return new Q(await super._call(e))}}class Is extends Ms{async _call(e){return new Nu(await super._call(e))}}class Ls extends Ms{async _call(e){return new Pu(await super._call(e))}}class Rs extends L{}class zs extends Rs{}class Bs extends L{}class Vs extends Bs{}class Hs extends Bs{}class Us extends Bs{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let o={input_ids:e},{encoder_outputs:s,encoder_attention_mask:c}=await j(this,o),l=s.dims[1]/this.config.reduction_factor,u=Math.floor(l*i),d=Math.floor(l*r),f=this.config.num_mel_bins,m=[],h=null,g=null,_=0;for(;;){++_;let e=ne(!!g),r;r=g?g.output_sequence_out:new p.Tensor(`float32`,new Float32Array(f),[1,1,f]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:s};this.addPastKeyValues(i,h),g=await A(this.sessions.decoder_model_merged,i),h=this.getPastKeyValues(g,h);let{prob:a,spectrum:o}=g;if(m.push(o),_>=d&&(Array.from(a.data).filter(e=>e>=n).length>0||_>=u))break}let v=(0,p.cat)(m),{waveform:y}=await A(a.sessions.model,{spectrogram:v});return{spectrogram:v,waveform:y}}}class Ws extends L{constructor(...t){super(...t),e.defineProperty(this,`main_input_name`,`spectrogram`)}}class Gs extends L{}class Ks extends Gs{}class qs extends L{}class Js extends qs{}class Ys extends qs{}class Xs extends L{}class Zs extends Xs{}class Qs extends Xs{}class $s extends L{}class ec extends $s{}class tc extends $s{}class nc extends L{}class rc extends nc{}class ic extends nc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}}class ac extends nc{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`audio_model`})}}class oc extends L{}class sc extends oc{async _call(e){return new Bu(await super._call(e))}}class cc extends L{}class lc extends cc{}class uc extends cc{}class dc extends cc{}class fc extends L{}class pc extends fc{}class mc extends fc{}class hc extends L{}class gc extends hc{}class _c extends hc{async _call(e){return new Q(await super._call(e))}}class vc extends L{}class yc extends vc{}class bc extends vc{}class xc extends L{constructor(...t){super(...t),e.defineProperty(this,`forward_params`,[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`])}_apply_and_filter_by_delay_pattern_mask(e){let[t,n]=e.dims,r=this.config.decoder.num_codebooks,i=n-r,a=0;for(let t=0;t0&&c<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new p.Tensor(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=structuredClone(e);for(let e=0;e=t&&(r[e][t]=BigInt(this.config.decoder.pad_token_id));n.guidance_scale!==null&&n.guidance_scale>1&&(r=r.concat(r));let i=super.prepare_inputs_for_generation(r,t,n);return i}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await A(this.sessions.encodec_decode,{audio_codes:n});return r}}class Sc extends L{}class Cc extends Sc{}class wc extends Sc{async _call(e){return new Q(await super._call(e))}}class Tc extends Sc{}class Ec extends L{}class Dc extends Ec{}class Oc extends Ec{async _call(e){return new Q(await super._call(e))}}class kc extends Ec{}class Ac extends L{}class jc extends Ac{}class Mc extends Ac{async _call(e){return new Q(await super._call(e))}}class Nc extends Ac{}class Pc extends L{}class Fc extends Pc{}class Ic extends Pc{async _call(e){return new Q(await super._call(e))}}class Lc extends Pc{}class Rc extends L{}class zc extends Rc{}class Bc extends L{}class Vc extends Bc{constructor(...t){super(...t),e.defineProperty(this,`forward_params`,[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`]),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds,r=(0,c.pick)(e,t.inputNames);n=await A(t,r)}else{let t=this.sessions.gen_img_embeds,r=(0,c.pick)({image_ids:e.input_ids},t.inputNames);n=await A(t,r)}let r={...e,...n},i=await ae(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await A(a,(0,c.pick)(i,a.inputNames));return{...n,...i,...o}}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=await super.generate(e),r=n.slice(null,[t,null]),i=this.sessions.image_decode,{decoded_image:a}=await A(i,{generated_tokens:r}),o=a.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),s=[];for(let e of o){let t=m.RawImage.fromTensor(e);s.push(t)}return s}}class Hc extends pe{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class Uc extends L{}class Wc extends Uc{async _call(e){return new Hc(await super._call(e))}}class Gc extends L{}class Kc extends Gc{}class qc extends Gc{}class Jc extends L{}class Yc extends Jc{}class Xc extends Jc{}class Zc extends L{constructor(...t){super(...t),e.defineProperty(this,`forward_params`,[`input_ids`,`attention_mask`,`position_ids`,`audio_values`,`past_key_values`])}}class Qc extends Zc{_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return ce({audio_token_id:this.config.ignore_index,...e,audio_features:n})}}class $c extends L{constructor(...t){super(...t),e.defineProperty(this,`main_input_name`,`input_values`),e.defineProperty(this,`forward_params`,[`input_values`])}}class el extends pe{constructor({audio_codes:e}){super(),this.audio_codes=e}}class tl extends pe{constructor({audio_values:e}){super(),this.audio_values=e}}class nl extends $c{async encode(e){return new el(await A(this.sessions.encoder_model,e))}async decode(e){return new tl(await A(this.sessions.decoder_model,e))}}class rl extends $c{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class il extends $c{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class al extends L{constructor(...t){super(...t),e.defineProperty(this,`main_input_name`,`input_values`),e.defineProperty(this,`forward_params`,[`input_values`])}}class ol extends pe{constructor({audio_codes:e}){super(),this.audio_codes=e}}class sl extends pe{constructor({audio_values:e}){super(),this.audio_values=e}}class cl extends al{async encode(e){return new ol(await A(this.sessions.encoder_model,e))}async decode(e){return new sl(await A(this.sessions.decoder_model,e))}}class ll extends al{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class ul extends al{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class dl extends L{constructor(...t){super(...t),e.defineProperty(this,`main_input_name`,`input_values`),e.defineProperty(this,`forward_params`,[`input_values`])}}class fl extends dl{async encode(e){return await A(this.sessions.encoder_model,e)}async decode(e){return await A(this.sessions.decoder_model,e)}}class pl extends dl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class ml extends dl{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class hl{static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:l=null,dtype:u=null,use_external_data_format:d=null,session_options:f={}}={}){let p={progress_callback:t,config:n,cache_dir:r,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:l,dtype:u,use_external_data_format:d,session_options:f};if(p.config=await i.AutoConfig.from_pretrained(e,p),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);let m=p.config.model_type;for(let t of this.MODEL_CLASS_MAPPINGS){let n=t.get(m);if(!n){for(let e of t.values())if(e[0]===m){n=e;break}if(!n)continue}return await n[1].from_pretrained(e,p)}if(this.BASE_IF_FAIL)return eu.has(m)||console.warn(`Unknown model class "${m}", attempting to construct from base class.`),await L.from_pretrained(e,p);throw Error(`Unsupported model type: ${m}`)}}e.defineProperty(hl,`MODEL_CLASS_MAPPINGS`,null),e.defineProperty(hl,`BASE_IF_FAIL`,!1);let gl=new Map([[`bert`,[`BertModel`,ge]],[`modernbert`,[`ModernBertModel`,xe]],[`nomic_bert`,[`NomicBertModel`,Ee]],[`roformer`,[`RoFormerModel`,Oe]],[`electra`,[`ElectraModel`,ze]],[`esm`,[`EsmModel`,pt]],[`convbert`,[`ConvBertModel`,z]],[`camembert`,[`CamembertModel`,V]],[`deberta`,[`DebertaModel`,Ye]],[`deberta-v2`,[`DebertaV2Model`,tt]],[`mpnet`,[`MPNetModel`,Ct]],[`albert`,[`AlbertModel`,Pt]],[`distilbert`,[`DistilBertModel`,st]],[`roberta`,[`RobertaModel`,ln]],[`xlm`,[`XLMModel`,mn]],[`xlm-roberta`,[`XLMRobertaModel`,yn]],[`clap`,[`ClapModel`,rc]],[`clip`,[`CLIPModel`,Jn]],[`clipseg`,[`CLIPSegModel`,Y]],[`chinese_clip`,[`ChineseCLIPModel`,rr]],[`siglip`,[`SiglipModel`,er]],[`jina_clip`,[`JinaCLIPModel`,ar]],[`mobilebert`,[`MobileBertModel`,vt]],[`squeezebert`,[`SqueezeBertModel`,kt]],[`wav2vec2`,[`Wav2Vec2Model`,os]],[`wav2vec2-bert`,[`Wav2Vec2BertModel`,Ts]],[`unispeech`,[`UniSpeechModel`,gs]],[`unispeech-sat`,[`UniSpeechSatModel`,bs]],[`hubert`,[`HubertModel`,ks]],[`wavlm`,[`WavLMModel`,Ns]],[`audio-spectrogram-transformer`,[`ASTModel`,wn]],[`vits`,[`VitsModel`,sc]],[`pyannote`,[`PyAnnoteModel`,ds]],[`wespeaker-resnet`,[`WeSpeakerResNetModel`,ms]],[`detr`,[`DetrModel`,ba]],[`rt_detr`,[`RTDetrModel`,Ea]],[`rt_detr_v2`,[`RTDetrV2Model`,Aa]],[`rf_detr`,[`RFDetrModel`,Pa]],[`d_fine`,[`DFineModel`,Ra]],[`table-transformer`,[`TableTransformerModel`,Va]],[`vit`,[`ViTModel`,Ii]],[`ijepa`,[`IJepaModel`,zi]],[`pvt`,[`PvtModel`,Wi]],[`vit_msn`,[`ViTMSNModel`,Yi]],[`vit_mae`,[`ViTMAEModel`,qi]],[`groupvit`,[`GroupViTModel`,Qi]],[`fastvit`,[`FastViTModel`,ea]],[`mobilevit`,[`MobileViTModel`,aa]],[`mobilevitv2`,[`MobileViTV2Model`,ca]],[`owlvit`,[`OwlViTModel`,da]],[`owlv2`,[`Owlv2Model`,ma]],[`beit`,[`BeitModel`,_a]],[`deit`,[`DeiTModel`,Ga]],[`hiera`,[`HieraModel`,Ja]],[`convnext`,[`ConvNextModel`,jo]],[`convnextv2`,[`ConvNextV2Model`,Po]],[`dinov2`,[`Dinov2Model`,Lo]],[`dinov2_with_registers`,[`Dinov2WithRegistersModel`,Bo]],[`resnet`,[`ResNetModel`,Za]],[`swin`,[`SwinModel`,eo]],[`swin2sr`,[`Swin2SRModel`,io]],[`donut-swin`,[`DonutSwinModel`,ko]],[`yolos`,[`YolosModel`,Go]],[`dpt`,[`DPTModel`,so]],[`glpn`,[`GLPNModel`,Eo]],[`hifigan`,[`SpeechT5HifiGan`,Ws]],[`efficientnet`,[`EfficientNetModel`,gc]],[`decision_transformer`,[`DecisionTransformerModel`,zc]],[`patchtst`,[`PatchTSTForPrediction`,Kc]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,Yc]],[`mobilenet_v1`,[`MobileNetV1Model`,Cc]],[`mobilenet_v2`,[`MobileNetV2Model`,Dc]],[`mobilenet_v3`,[`MobileNetV3Model`,jc]],[`mobilenet_v4`,[`MobileNetV4Model`,Fc]],[`maskformer`,[`MaskFormerModel`,Co]],[`mgp-str`,[`MgpstrForSceneTextRecognition`,Wc]],[`style_text_to_speech_2`,[`StyleTextToSpeech2Model`,zs]]]),_l=new Map([[`t5`,[`T5Model`,zt]],[`longt5`,[`LongT5Model`,Ht]],[`mt5`,[`MT5Model`,Gt]],[`bart`,[`BartModel`,Jt]],[`mbart`,[`MBartModel`,Qt]],[`marian`,[`MarianModel`,Qo]],[`whisper`,[`WhisperModel`,Dn]],[`m2m_100`,[`M2M100Model`,ts]],[`blenderbot`,[`BlenderbotModel`,rn]],[`blenderbot-small`,[`BlenderbotSmallModel`,on]]]),vl=new Map([[`mimi`,[`MimiModel`,nl]],[`dac`,[`DacModel`,cl]],[`snac`,[`SnacModel`,fl]]]),yl=new Map([[`bloom`,[`BloomModel`,Di]],[`jais`,[`JAISModel`,dr]],[`gpt2`,[`GPT2Model`,lr]],[`gptj`,[`GPTJModel`,yr]],[`gpt_bigcode`,[`GPTBigCodeModel`,Sr]],[`gpt_neo`,[`GPTNeoModel`,Z]],[`gpt_neox`,[`GPTNeoXModel`,gr]],[`codegen`,[`CodeGenModel`,Tr]],[`llama`,[`LlamaModel`,Or]],[`exaone`,[`ExaoneModel`,Lr]],[`olmo`,[`OlmoModel`,Ur]],[`olmo2`,[`Olmo2Model`,Kr]],[`mobilellm`,[`MobileLLMModel`,Br]],[`granite`,[`GraniteModel`,Yr]],[`cohere`,[`CohereModel`,Qr]],[`gemma`,[`GemmaModel`,ti]],[`gemma2`,[`Gemma2Model`,ii]],[`gemma3_text`,[`Gemma3Model`,si]],[`helium`,[`HeliumModel`,jr]],[`glm`,[`GlmModel`,Pr]],[`openelm`,[`OpenELMModel`,ui]],[`qwen2`,[`Qwen2Model`,pi]],[`qwen3`,[`Qwen3Model`,gi]],[`phi`,[`PhiModel`,xi]],[`phi3`,[`Phi3Model`,wi]],[`mpt`,[`MptModel`,Ai]],[`opt`,[`OPTModel`,Ni]],[`mistral`,[`MistralModel`,Js]],[`starcoder2`,[`Starcoder2Model`,Zs]],[`falcon`,[`FalconModel`,ec]],[`stablelm`,[`StableLmModel`,pc]]]),bl=new Map([[`speecht5`,[`SpeechT5ForSpeechToText`,Hs]],[`whisper`,[`WhisperForConditionalGeneration`,On]],[`lite-whisper`,[`LiteWhisperForConditionalGeneration`,kn]],[`moonshine`,[`MoonshineForConditionalGeneration`,Mn]]]),xl=new Map([[`speecht5`,[`SpeechT5ForTextToSpeech`,Us]]]),Sl=new Map([[`vits`,[`VitsModel`,sc]],[`musicgen`,[`MusicgenForConditionalGeneration`,xc]]]),Cl=new Map([[`bert`,[`BertForSequenceClassification`,R]],[`modernbert`,[`ModernBertForSequenceClassification`,Ce]],[`roformer`,[`RoFormerForSequenceClassification`,Ae]],[`electra`,[`ElectraForSequenceClassification`,B]],[`esm`,[`EsmForSequenceClassification`,ht]],[`convbert`,[`ConvBertForSequenceClassification`,Fe]],[`camembert`,[`CamembertForSequenceClassification`,Ge]],[`deberta`,[`DebertaForSequenceClassification`,Ze]],[`deberta-v2`,[`DebertaV2ForSequenceClassification`,rt]],[`mpnet`,[`MPNetForSequenceClassification`,Tt]],[`albert`,[`AlbertForSequenceClassification`,Ft]],[`distilbert`,[`DistilBertForSequenceClassification`,ct]],[`roberta`,[`RobertaForSequenceClassification`,dn]],[`xlm`,[`XLMForSequenceClassification`,gn]],[`xlm-roberta`,[`XLMRobertaForSequenceClassification`,G]],[`bart`,[`BartForSequenceClassification`,Xt]],[`mbart`,[`MBartForSequenceClassification`,en]],[`mobilebert`,[`MobileBertForSequenceClassification`,bt]],[`squeezebert`,[`SqueezeBertForSequenceClassification`,jt]]]),wl=new Map([[`bert`,[`BertForTokenClassification`,ve]],[`modernbert`,[`ModernBertForTokenClassification`,we]],[`roformer`,[`RoFormerForTokenClassification`,je]],[`electra`,[`ElectraForTokenClassification`,Ve]],[`esm`,[`EsmForTokenClassification`,gt]],[`convbert`,[`ConvBertForTokenClassification`,Ie]],[`camembert`,[`CamembertForTokenClassification`,Ke]],[`deberta`,[`DebertaForTokenClassification`,Qe]],[`deberta-v2`,[`DebertaV2ForTokenClassification`,it]],[`mpnet`,[`MPNetForTokenClassification`,Et]],[`distilbert`,[`DistilBertForTokenClassification`,lt]],[`roberta`,[`RobertaForTokenClassification`,fn]],[`xlm`,[`XLMForTokenClassification`,W]],[`xlm-roberta`,[`XLMRobertaForTokenClassification`,xn]]]),Tl=new Map([[`t5`,[`T5ForConditionalGeneration`,Bt]],[`longt5`,[`LongT5ForConditionalGeneration`,Ut]],[`mt5`,[`MT5ForConditionalGeneration`,Kt]],[`bart`,[`BartForConditionalGeneration`,Yt]],[`mbart`,[`MBartForConditionalGeneration`,$t]],[`marian`,[`MarianMTModel`,$o]],[`m2m_100`,[`M2M100ForConditionalGeneration`,ns]],[`blenderbot`,[`BlenderbotForConditionalGeneration`,an]],[`blenderbot-small`,[`BlenderbotSmallForConditionalGeneration`,sn]]]),El=new Map([[`bloom`,[`BloomForCausalLM`,Oi]],[`gpt2`,[`GPT2LMHeadModel`,ur]],[`jais`,[`JAISLMHeadModel`,fr]],[`gptj`,[`GPTJForCausalLM`,br]],[`gpt_bigcode`,[`GPTBigCodeForCausalLM`,Cr]],[`gpt_neo`,[`GPTNeoForCausalLM`,mr]],[`gpt_neox`,[`GPTNeoXForCausalLM`,_r]],[`codegen`,[`CodeGenForCausalLM`,Er]],[`llama`,[`LlamaForCausalLM`,kr]],[`exaone`,[`ExaoneForCausalLM`,Rr]],[`olmo`,[`OlmoForCausalLM`,Wr]],[`olmo2`,[`Olmo2ForCausalLM`,qr]],[`mobilellm`,[`MobileLLMForCausalLM`,Vr]],[`granite`,[`GraniteForCausalLM`,Xr]],[`cohere`,[`CohereForCausalLM`,$r]],[`gemma`,[`GemmaForCausalLM`,ni]],[`gemma2`,[`Gemma2ForCausalLM`,ai]],[`gemma3_text`,[`Gemma3ForCausalLM`,ci]],[`helium`,[`HeliumForCausalLM`,Mr]],[`glm`,[`GlmForCausalLM`,Fr]],[`openelm`,[`OpenELMForCausalLM`,di]],[`qwen2`,[`Qwen2ForCausalLM`,mi]],[`qwen3`,[`Qwen3ForCausalLM`,_i]],[`phi`,[`PhiForCausalLM`,Si]],[`phi3`,[`Phi3ForCausalLM`,Ti]],[`mpt`,[`MptForCausalLM`,ji]],[`opt`,[`OPTForCausalLM`,Pi]],[`mbart`,[`MBartForCausalLM`,tn]],[`mistral`,[`MistralForCausalLM`,Ys]],[`starcoder2`,[`Starcoder2ForCausalLM`,Qs]],[`falcon`,[`FalconForCausalLM`,tc]],[`trocr`,[`TrOCRForCausalLM`,Ks]],[`stablelm`,[`StableLmForCausalLM`,mc]],[`phi3_v`,[`Phi3VForCausalLM`,Kn]]]),Dl=new Map([[`multi_modality`,[`MultiModalityCausalLM`,Vc]]]),Ol=new Map([[`bert`,[`BertForMaskedLM`,_e]],[`modernbert`,[`ModernBertForMaskedLM`,Se]],[`roformer`,[`RoFormerForMaskedLM`,ke]],[`electra`,[`ElectraForMaskedLM`,Be]],[`esm`,[`EsmForMaskedLM`,mt]],[`convbert`,[`ConvBertForMaskedLM`,Pe]],[`camembert`,[`CamembertForMaskedLM`,We]],[`deberta`,[`DebertaForMaskedLM`,Xe]],[`deberta-v2`,[`DebertaV2ForMaskedLM`,nt]],[`mpnet`,[`MPNetForMaskedLM`,wt]],[`albert`,[`AlbertForMaskedLM`,Lt]],[`distilbert`,[`DistilBertForMaskedLM`,dt]],[`roberta`,[`RobertaForMaskedLM`,un]],[`xlm`,[`XLMWithLMHeadModel`,hn]],[`xlm-roberta`,[`XLMRobertaForMaskedLM`,bn]],[`mobilebert`,[`MobileBertForMaskedLM`,yt]],[`squeezebert`,[`SqueezeBertForMaskedLM`,At]]]),kl=new Map([[`bert`,[`BertForQuestionAnswering`,ye]],[`roformer`,[`RoFormerForQuestionAnswering`,Me]],[`electra`,[`ElectraForQuestionAnswering`,He]],[`convbert`,[`ConvBertForQuestionAnswering`,Le]],[`camembert`,[`CamembertForQuestionAnswering`,qe]],[`deberta`,[`DebertaForQuestionAnswering`,$e]],[`deberta-v2`,[`DebertaV2ForQuestionAnswering`,at]],[`mpnet`,[`MPNetForQuestionAnswering`,Dt]],[`albert`,[`AlbertForQuestionAnswering`,It]],[`distilbert`,[`DistilBertForQuestionAnswering`,ut]],[`roberta`,[`RobertaForQuestionAnswering`,pn]],[`xlm`,[`XLMForQuestionAnswering`,_n]],[`xlm-roberta`,[`XLMRobertaForQuestionAnswering`,Sn]],[`mobilebert`,[`MobileBertForQuestionAnswering`,xt]],[`squeezebert`,[`SqueezeBertForQuestionAnswering`,Mt]]]),Al=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Nn]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Un]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,Wn]]]),jl=new Map([[`llava`,[`LlavaForConditionalGeneration`,Fn]],[`llava_onevision`,[`LlavaOnevisionForConditionalGeneration`,In]],[`moondream1`,[`Moondream1ForConditionalGeneration`,Ln]],[`florence2`,[`Florence2ForConditionalGeneration`,zn]],[`qwen2-vl`,[`Qwen2VLForConditionalGeneration`,yi]],[`idefics3`,[`Idefics3ForConditionalGeneration`,Un]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,Wn]],[`paligemma`,[`PaliGemmaForConditionalGeneration`,Vn]]]),Ml=new Map([[`ultravox`,[`UltravoxModel`,Qc]]]),Nl=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Nn]]]),Pl=new Map([[`vit`,[`ViTForImageClassification`,Li]],[`ijepa`,[`IJepaForImageClassification`,Bi]],[`pvt`,[`PvtForImageClassification`,Gi]],[`vit_msn`,[`ViTMSNForImageClassification`,Xi]],[`fastvit`,[`FastViTForImageClassification`,ta]],[`mobilevit`,[`MobileViTForImageClassification`,oa]],[`mobilevitv2`,[`MobileViTV2ForImageClassification`,la]],[`beit`,[`BeitForImageClassification`,va]],[`deit`,[`DeiTForImageClassification`,Ka]],[`hiera`,[`HieraForImageClassification`,Ya]],[`convnext`,[`ConvNextForImageClassification`,Mo]],[`convnextv2`,[`ConvNextV2ForImageClassification`,Fo]],[`dinov2`,[`Dinov2ForImageClassification`,Ro]],[`dinov2_with_registers`,[`Dinov2WithRegistersForImageClassification`,Vo]],[`resnet`,[`ResNetForImageClassification`,Qa]],[`swin`,[`SwinForImageClassification`,to]],[`segformer`,[`SegformerForImageClassification`,uc]],[`efficientnet`,[`EfficientNetForImageClassification`,_c]],[`mobilenet_v1`,[`MobileNetV1ForImageClassification`,wc]],[`mobilenet_v2`,[`MobileNetV2ForImageClassification`,Oc]],[`mobilenet_v3`,[`MobileNetV3ForImageClassification`,Mc]],[`mobilenet_v4`,[`MobileNetV4ForImageClassification`,Ic]]]),Fl=new Map([[`detr`,[`DetrForObjectDetection`,xa]],[`rt_detr`,[`RTDetrForObjectDetection`,Da]],[`rt_detr_v2`,[`RTDetrV2ForObjectDetection`,ja]],[`rf_detr`,[`RFDetrForObjectDetection`,Fa]],[`d_fine`,[`DFineForObjectDetection`,za]],[`table-transformer`,[`TableTransformerForObjectDetection`,Ha]],[`yolos`,[`YolosForObjectDetection`,Ko]]]),Il=new Map([[`owlvit`,[`OwlViTForObjectDetection`,fa]],[`owlv2`,[`Owlv2ForObjectDetection`,ha]],[`grounding-dino`,[`GroundingDinoForObjectDetection`,Uo]]]),Ll=new Map([[`detr`,[`DetrForSegmentation`,Sa]],[`clipseg`,[`CLIPSegForImageSegmentation`,sr]]]),Rl=new Map([[`segformer`,[`SegformerForSemanticSegmentation`,dc]],[`sapiens`,[`SapiensForSemanticSegmentation`,po]],[`swin`,[`SwinForSemanticSegmentation`,no]],[`mobilenet_v1`,[`MobileNetV1ForSemanticSegmentation`,Tc]],[`mobilenet_v2`,[`MobileNetV2ForSemanticSegmentation`,kc]],[`mobilenet_v3`,[`MobileNetV3ForSemanticSegmentation`,Nc]],[`mobilenet_v4`,[`MobileNetV4ForSemanticSegmentation`,Lc]]]),zl=new Map([[`detr`,[`DetrForSegmentation`,Sa]],[`maskformer`,[`MaskFormerForInstanceSegmentation`,wo]]]),Bl=new Map([[`sam`,[`SamModel`,Yo]]]),Vl=new Map([[`wav2vec2`,[`Wav2Vec2ForCTC`,ss]],[`wav2vec2-bert`,[`Wav2Vec2BertForCTC`,Es]],[`unispeech`,[`UniSpeechForCTC`,_s]],[`unispeech-sat`,[`UniSpeechSatForCTC`,xs]],[`wavlm`,[`WavLMForCTC`,Ps]],[`hubert`,[`HubertForCTC`,As]]]),Hl=new Map([[`wav2vec2`,[`Wav2Vec2ForSequenceClassification`,cs]],[`wav2vec2-bert`,[`Wav2Vec2BertForSequenceClassification`,Ds]],[`unispeech`,[`UniSpeechForSequenceClassification`,vs]],[`unispeech-sat`,[`UniSpeechSatForSequenceClassification`,Ss]],[`wavlm`,[`WavLMForSequenceClassification`,Fs]],[`hubert`,[`HubertForSequenceClassification`,js]],[`audio-spectrogram-transformer`,[`ASTForAudioClassification`,Tn]]]),Ul=new Map([[`wavlm`,[`WavLMForXVector`,Is]]]),Wl=new Map([[`unispeech-sat`,[`UniSpeechSatForAudioFrameClassification`,Cs]],[`wavlm`,[`WavLMForAudioFrameClassification`,Ls]],[`wav2vec2`,[`Wav2Vec2ForAudioFrameClassification`,ls]],[`pyannote`,[`PyAnnoteForAudioFrameClassification`,fs]]]),Gl=new Map([[`vitmatte`,[`VitMatteForImageMatting`,ra]]]),Kl=new Map([[`patchtst`,[`PatchTSTForPrediction`,qc]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,Xc]]]),ql=new Map([[`swin2sr`,[`Swin2SRForImageSuperResolution`,ao]]]),Jl=new Map([[`dpt`,[`DPTForDepthEstimation`,co]],[`depth_anything`,[`DepthAnythingForDepthEstimation`,uo]],[`glpn`,[`GLPNForDepthEstimation`,Do]],[`sapiens`,[`SapiensForDepthEstimation`,mo]],[`depth_pro`,[`DepthProForDepthEstimation`,_o]],[`metric3d`,[`Metric3DForDepthEstimation`,yo]],[`metric3dv2`,[`Metric3Dv2ForDepthEstimation`,xo]]]),Yl=new Map([[`sapiens`,[`SapiensForNormalEstimation`,ho]]]),Xl=new Map([[`vitpose`,[`VitPoseForPoseEstimation`,Hi]]]),Zl=new Map([[`clip`,[`CLIPVisionModelWithProjection`,Qn]],[`siglip`,[`SiglipVisionModel`,K]],[`jina_clip`,[`JinaCLIPVisionModel`,or]]]),Ql=[[gl,x.EncoderOnly],[_l,x.EncoderDecoder],[yl,x.DecoderOnly],[vl,x.AutoEncoder],[Cl,x.EncoderOnly],[wl,x.EncoderOnly],[Tl,x.Seq2Seq],[bl,x.Seq2Seq],[El,x.DecoderOnly],[Dl,x.MultiModality],[Ol,x.EncoderOnly],[kl,x.EncoderOnly],[Al,x.Vision2Seq],[jl,x.ImageTextToText],[Ml,x.AudioTextToText],[Pl,x.EncoderOnly],[Ll,x.EncoderOnly],[zl,x.EncoderOnly],[Rl,x.EncoderOnly],[Gl,x.EncoderOnly],[Kl,x.EncoderOnly],[ql,x.EncoderOnly],[Jl,x.EncoderOnly],[Yl,x.EncoderOnly],[Xl,x.EncoderOnly],[Fl,x.EncoderOnly],[Il,x.EncoderOnly],[Bl,x.MaskGeneration],[Vl,x.EncoderOnly],[Hl,x.EncoderOnly],[xl,x.Seq2Seq],[Sl,x.EncoderOnly],[Ul,x.EncoderOnly],[Wl,x.EncoderOnly],[Zl,x.EncoderOnly]];for(let[e,t]of Ql)for(let[n,r]of e.values())S.set(n,t),w.set(r,n),C.set(n,r);let $l=[[`MusicgenForConditionalGeneration`,xc,x.Musicgen],[`Phi3VForCausalLM`,Kn,x.Phi3V],[`CLIPTextModelWithProjection`,Xn,x.EncoderOnly],[`SiglipTextModel`,tr,x.EncoderOnly],[`JinaCLIPTextModel`,q,x.EncoderOnly],[`ClapTextModelWithProjection`,ic,x.EncoderOnly],[`ClapAudioModelWithProjection`,ac,x.EncoderOnly],[`DacEncoderModel`,ll,x.EncoderOnly],[`DacDecoderModel`,ul,x.EncoderOnly],[`MimiEncoderModel`,rl,x.EncoderOnly],[`MimiDecoderModel`,il,x.EncoderOnly],[`SnacEncoderModel`,pl,x.EncoderOnly],[`SnacDecoderModel`,ml,x.EncoderOnly]];for(let[e,t,n]of $l)S.set(e,n),w.set(t,e),C.set(e,t);let eu=new Map([[`modnet`,Ll],[`birefnet`,Ll],[`isnet`,Ll],[`ben`,Ll]]);for(let[e,t]of eu.entries())t.set(e,[`PreTrainedModel`,L]),S.set(e,x.EncoderOnly),w.set(L,e),C.set(e,L);class tu extends hl{}e.defineProperty(tu,`MODEL_CLASS_MAPPINGS`,Ql.map(e=>e[0])),e.defineProperty(tu,`BASE_IF_FAIL`,!0);class nu extends hl{}e.defineProperty(nu,`MODEL_CLASS_MAPPINGS`,[Cl]);class ru extends hl{}e.defineProperty(ru,`MODEL_CLASS_MAPPINGS`,[wl]);class iu extends hl{}e.defineProperty(iu,`MODEL_CLASS_MAPPINGS`,[Tl]);class au extends hl{}e.defineProperty(au,`MODEL_CLASS_MAPPINGS`,[bl]);class ou extends hl{}e.defineProperty(ou,`MODEL_CLASS_MAPPINGS`,[xl]);class su extends hl{}e.defineProperty(su,`MODEL_CLASS_MAPPINGS`,[Sl]);class cu extends hl{}e.defineProperty(cu,`MODEL_CLASS_MAPPINGS`,[El]);class lu extends hl{}e.defineProperty(lu,`MODEL_CLASS_MAPPINGS`,[Ol]);class uu extends hl{}e.defineProperty(uu,`MODEL_CLASS_MAPPINGS`,[kl]);class du extends hl{}e.defineProperty(du,`MODEL_CLASS_MAPPINGS`,[Al]);class fu extends hl{}e.defineProperty(fu,`MODEL_CLASS_MAPPINGS`,[Pl]);class pu extends hl{}e.defineProperty(pu,`MODEL_CLASS_MAPPINGS`,[Ll]);class mu extends hl{}e.defineProperty(mu,`MODEL_CLASS_MAPPINGS`,[Rl]);class hu extends hl{}e.defineProperty(hu,`MODEL_CLASS_MAPPINGS`,[zl]);class gu extends hl{}e.defineProperty(gu,`MODEL_CLASS_MAPPINGS`,[Fl]);class _u extends hl{}e.defineProperty(_u,`MODEL_CLASS_MAPPINGS`,[Il]);class vu extends hl{}e.defineProperty(vu,`MODEL_CLASS_MAPPINGS`,[Bl]);class yu extends hl{}e.defineProperty(yu,`MODEL_CLASS_MAPPINGS`,[Vl]);class bu extends hl{}e.defineProperty(bu,`MODEL_CLASS_MAPPINGS`,[Hl]);class xu extends hl{}e.defineProperty(xu,`MODEL_CLASS_MAPPINGS`,[Ul]);class Su extends hl{}e.defineProperty(Su,`MODEL_CLASS_MAPPINGS`,[Wl]);class Cu extends hl{}e.defineProperty(Cu,`MODEL_CLASS_MAPPINGS`,[Nl]);class wu extends hl{}e.defineProperty(wu,`MODEL_CLASS_MAPPINGS`,[Gl]);class Tu extends hl{}e.defineProperty(Tu,`MODEL_CLASS_MAPPINGS`,[ql]);class Eu extends hl{}e.defineProperty(Eu,`MODEL_CLASS_MAPPINGS`,[Jl]);class Du extends hl{}e.defineProperty(Du,`MODEL_CLASS_MAPPINGS`,[Yl]);class Ou extends hl{}e.defineProperty(Ou,`MODEL_CLASS_MAPPINGS`,[Xl]);class ku extends hl{}e.defineProperty(ku,`MODEL_CLASS_MAPPINGS`,[Zl]);class Au extends hl{}e.defineProperty(Au,`MODEL_CLASS_MAPPINGS`,[jl]);class ju extends hl{}e.defineProperty(ju,`MODEL_CLASS_MAPPINGS`,[Ml]);class Mu extends pe{constructor({logits:e,past_key_values:t,encoder_outputs:n,decoder_attentions:r=null,cross_attentions:i=null}){super(),this.logits=e,this.past_key_values=t,this.encoder_outputs=n,this.decoder_attentions=r,this.cross_attentions=i}}class Q extends pe{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}}class Nu extends pe{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}}class Pu extends pe{constructor({logits:e}){super(),this.logits=e}}class Fu extends pe{constructor({logits:e}){super(),this.logits=e}}class Iu extends pe{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}}class Lu extends pe{constructor({logits:e}){super(),this.logits=e}}class Ru extends pe{constructor({logits:e,past_key_values:t}){super(),this.logits=e,this.past_key_values=t}}class zu extends pe{constructor({alphas:e}){super(),this.alphas=e}}class Bu extends pe{constructor({waveform:e,spectrogram:t}){super(),this.waveform=e,this.spectrogram=t}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e);let t=this.config.sampling_rate,n=(0,a.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=(0,a.window_function)(400,`hann`,{periodic:!1}),this.mean=this.config.mean,this.std=this.config.std}async _extract_fbank_features(e,t){return(0,a.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e){(0,r.validate_audio_inputs)(e,`ASTFeatureExtractor`);let t=await this._extract_fbank_features(e,this.config.max_length);if(this.config.do_normalize){let e=this.std*2,n=t.data;for(let t=0;t{n.r(t),n.d(t,{AutoFeatureExtractor:()=>s});var r=n( +/*! ../../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../../utils/hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),o=n( +/*! ../feature_extractors.js */ +`./src/models/feature_extractors.js`);class s{static async from_pretrained(e,t={}){let n=await(0,i.getModelJSON)(e,r.FEATURE_EXTRACTOR_NAME,!0,t),a=n.feature_extractor_type,s=o[a];if(!s)throw Error(`Unknown feature_extractor_type: '${a}'. Please report this at ${r.GITHUB_ISSUE_URL}.`);return new s(n)}}},"./src/models/auto/image_processing_auto.js":(e,t,n)=>{n.r(t),n.d(t,{AutoImageProcessor:()=>s});var r=n( +/*! ../../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../../utils/hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),o=n( +/*! ../image_processors.js */ +`./src/models/image_processors.js`);class s{static async from_pretrained(e,t={}){let n=await(0,i.getModelJSON)(e,r.IMAGE_PROCESSOR_NAME,!0,t),s=n.image_processor_type??n.feature_extractor_type,c=o[s];return c||(s!==void 0&&console.warn(`Image processor type '${s}' not found, assuming base ImageProcessor. Please report this at ${r.GITHUB_ISSUE_URL}.`),c=a.ImageProcessor),new c(n)}}},"./src/models/auto/processing_auto.js":(e,t,n)=>{n.r(t),n.d(t,{AutoProcessor:()=>l});var r=n( +/*! ../../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../../utils/hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),o=n( +/*! ../processors.js */ +`./src/models/processors.js`),s=n( +/*! ../image_processors.js */ +`./src/models/image_processors.js`),c=n( +/*! ../feature_extractors.js */ +`./src/models/feature_extractors.js`);class l{static async from_pretrained(e,t={}){let n=await(0,i.getModelJSON)(e,r.IMAGE_PROCESSOR_NAME,!0,t),{image_processor_type:l,feature_extractor_type:u,processor_class:d}=n;if(d&&o[d])return o[d].from_pretrained(e,t);if(!l&&!u)throw Error("No `image_processor_type` or `feature_extractor_type` found in the config.");let f={};if(l){let e=s[l];if(!e)throw Error(`Unknown image_processor_type: '${l}'.`);f.image_processor=new e(n)}if(u){let e=s[u];if(e)f.image_processor=new e(n);else{let e=c[u];if(!e)throw Error(`Unknown feature_extractor_type: '${u}'.`);f.feature_extractor=new e(n)}}let p={};return new a.Processor(p,f)}}},"./src/models/beit/image_processing_beit.js":(e,t,n)=>{n.r(t),n.d(t,{BeitFeatureExtractor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/bit/image_processing_bit.js":(e,t,n)=>{n.r(t),n.d(t,{BitImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/chinese_clip/image_processing_chinese_clip.js":(e,t,n)=>{n.r(t),n.d(t,{ChineseCLIPFeatureExtractor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/clap/feature_extraction_clap.js":(e,t,n)=>{n.r(t),n.d(t,{ClapFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e),this.mel_filters=(0,a.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,null,`htk`),this.mel_filters_slaney=(0,a.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,`slaney`,`slaney`),this.window=(0,a.window_function)(this.config.fft_window_size,`hann`)}async _get_input_mel(e,t,n,r){let i,a=!1,o=e.length-t;if(o>0)if(n===`rand_trunc`){a=!0;let n=Math.floor(Math.random()*(o+1));e=e.subarray(n,n+t),i=await this._extract_fbank_features(e,this.mel_filters_slaney,this.config.nb_max_samples)}else throw Error(`Truncation strategy "${n}" not implemented`);else{if(o<0){let n=new Float64Array(t);if(n.set(e),r===`repeat`)for(let r=e.length;r{n.r(t),n.d(t,{CLIPFeatureExtractor:()=>a,CLIPImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/convnext/image_processing_convnext.js":(e,t,n)=>{n.r(t),n.d(t,{ConvNextFeatureExtractor:()=>a,ConvNextImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){super(e),this.crop_pct=this.config.crop_pct??224/256}async resize(e){var t;let n=(t=this.size)?.shortest_edge;if(n===void 0)throw Error(`Size dictionary must contain 'shortest_edge' key.`);if(n<384){let t=Math.floor(n/this.crop_pct),[r,i]=this.get_resize_output_image_size(e,{shortest_edge:t});e=await e.resize(r,i,{resample:this.resample}),e=await e.center_crop(n,n)}else e=await e.resize(n,n,{resample:this.resample});return e}}class a extends i{}},"./src/models/dac/feature_extraction_dac.js":(e,t,n)=>{n.r(t),n.d(t,{DacFeatureExtractor:()=>i});var r=n( +/*! ../encodec/feature_extraction_encodec.js */ +`./src/models/encodec/feature_extraction_encodec.js`);class i extends r.EncodecFeatureExtractor{}},"./src/models/deit/image_processing_deit.js":(e,t,n)=>{n.r(t),n.d(t,{DeiTFeatureExtractor:()=>a,DeiTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/detr/image_processing_detr.js":(e,t,n)=>{n.r(t),n.d(t,{DetrFeatureExtractor:()=>o,DetrImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e){let t=await super._call(e),n=[t.pixel_values.dims[0],64,64],r=(0,i.full)(n,1n);return{...t,pixel_mask:r}}post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}post_process_panoptic_segmentation(...e){return(0,r.post_process_panoptic_segmentation)(...e)}post_process_instance_segmentation(...e){return(0,r.post_process_instance_segmentation)(...e)}}class o extends a{}},"./src/models/donut/image_processing_donut.js":(e,t,n)=>{n.r(t),n.d(t,{DonutFeatureExtractor:()=>a,DonutImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{pad_image(e,t,n,r={}){let[i,a,o]=t,s=this.image_mean;Array.isArray(this.image_mean)||(s=Array(o).fill(s));let c=this.image_std;Array.isArray(c)||(c=Array(o).fill(s));let l=s.map((e,t)=>-e/c[t]);return super.pad_image(e,t,n,{center:!0,constant_values:l,...r})}}class a extends i{}},"./src/models/dpt/image_processing_dpt.js":(e,t,n)=>{n.r(t),n.d(t,{DPTFeatureExtractor:()=>a,DPTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/efficientnet/image_processing_efficientnet.js":(e,t,n)=>{n.r(t),n.d(t,{EfficientNetImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){super(e),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(e=>e*e))}}},"./src/models/encodec/feature_extraction_encodec.js":(e,t,n)=>{n.r(t),n.d(t,{EncodecFeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.FeatureExtractor{async _call(e){(0,r.validate_audio_inputs)(e,`EncodecFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=this.config.feature_size;if(e.length%t!==0)throw Error(`The length of the audio data must be a multiple of the number of channels (${t}).`);let n=[1,t,e.length/t];return{input_values:new i.Tensor(`float32`,e,n)}}}},"./src/models/feature_extractors.js":(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>r.ASTFeatureExtractor,ClapFeatureExtractor:()=>a.ClapFeatureExtractor,DacFeatureExtractor:()=>o.DacFeatureExtractor,EncodecFeatureExtractor:()=>i.EncodecFeatureExtractor,ImageFeatureExtractor:()=>h.ImageProcessor,MoonshineFeatureExtractor:()=>s.MoonshineFeatureExtractor,PyAnnoteFeatureExtractor:()=>c.PyAnnoteFeatureExtractor,SeamlessM4TFeatureExtractor:()=>l.SeamlessM4TFeatureExtractor,SnacFeatureExtractor:()=>u.SnacFeatureExtractor,SpeechT5FeatureExtractor:()=>d.SpeechT5FeatureExtractor,Wav2Vec2FeatureExtractor:()=>f.Wav2Vec2FeatureExtractor,WeSpeakerFeatureExtractor:()=>p.WeSpeakerFeatureExtractor,WhisperFeatureExtractor:()=>m.WhisperFeatureExtractor});var r=n( +/*! ./audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js */ +`./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js`),i=n( +/*! ./encodec/feature_extraction_encodec.js */ +`./src/models/encodec/feature_extraction_encodec.js`),a=n( +/*! ./clap/feature_extraction_clap.js */ +`./src/models/clap/feature_extraction_clap.js`),o=n( +/*! ./dac/feature_extraction_dac.js */ +`./src/models/dac/feature_extraction_dac.js`),s=n( +/*! ./moonshine/feature_extraction_moonshine.js */ +`./src/models/moonshine/feature_extraction_moonshine.js`),c=n( +/*! ./pyannote/feature_extraction_pyannote.js */ +`./src/models/pyannote/feature_extraction_pyannote.js`),l=n( +/*! ./seamless_m4t/feature_extraction_seamless_m4t.js */ +`./src/models/seamless_m4t/feature_extraction_seamless_m4t.js`),u=n( +/*! ./snac/feature_extraction_snac.js */ +`./src/models/snac/feature_extraction_snac.js`),d=n( +/*! ./speecht5/feature_extraction_speecht5.js */ +`./src/models/speecht5/feature_extraction_speecht5.js`),f=n( +/*! ./wav2vec2/feature_extraction_wav2vec2.js */ +`./src/models/wav2vec2/feature_extraction_wav2vec2.js`),p=n( +/*! ./wespeaker/feature_extraction_wespeaker.js */ +`./src/models/wespeaker/feature_extraction_wespeaker.js`),m=n( +/*! ./whisper/feature_extraction_whisper.js */ +`./src/models/whisper/feature_extraction_whisper.js`),h=n( +/*! ../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`)},"./src/models/florence2/processing_florence2.js":(t,n,r)=>{r.r(n),r.d(n,{Florence2Processor:()=>s});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class s extends i.Processor{constructor(e,t){super(e,t);let{tasks_answer_post_processing_type:n,task_prompts_without_inputs:r,task_prompts_with_input:i}=this.image_processor.config;this.tasks_answer_post_processing_type=new Map(Object.entries(n??{})),this.task_prompts_without_inputs=new Map(Object.entries(r??{})),this.task_prompts_with_input=new Map(Object.entries(i??{})),this.regexes={quad_boxes:/(.+?)/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(e){typeof e==`string`&&(e=[e]);let t=[];for(let n of e)if(this.task_prompts_without_inputs.has(n))t.push(this.task_prompts_without_inputs.get(n));else{for(let[e,r]of this.task_prompts_with_input)if(n.includes(e)){t.push(r.replaceAll(`{input}`,n).replaceAll(e,``));break}t.length!==e.length&&t.push(n)}return t}post_process_generation(e,t,n){let r=this.tasks_answer_post_processing_type.get(t)??`pure_text`;e=e.replaceAll(``,``).replaceAll(``,``);let i;switch(r){case`pure_text`:i=e;break;case`description_with_bboxes`:case`bboxes`:case`phrase_grounding`:case`ocr`:let a=r===`ocr`?`quad_boxes`:`bboxes`,o=e.matchAll(this.regexes[a]),s=[],c=[];for(let[e,t,...r]of o)s.push(t?t.trim():s.at(-1)??``),c.push(r.map((e,t)=>(Number(e)+.5)/this.size_per_bin*n[t%2]));i={labels:s,[a]:c};break;default:throw Error(`Task "${t}" (of type "${r}") not yet implemented.`)}return{[t]:i}}async _call(e,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=await this.image_processor(e,n),i=t?this.tokenizer(t,n):{};return{...r,...i}}}e.defineProperty(s,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(s,`image_processor_class`,a.AutoImageProcessor)},"./src/models/glpn/image_processing_glpn.js":(e,t,n)=>{n.r(t),n.d(t,{GLPNFeatureExtractor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/grounding_dino/image_processing_grounding_dino.js":(e,t,n)=>{n.r(t),n.d(t,{GroundingDinoImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e){let t=await super._call(e),n=t.pixel_values.dims,r=(0,i.ones)([n[0],n[2],n[3]]);return{...t,pixel_mask:r}}}},"./src/models/grounding_dino/processing_grounding_dino.js":(t,n,r)=>{r.r(n),r.d(n,{GroundingDinoProcessor:()=>l});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);function c(e,t){let n=0,r=e.dims.at(-1)-1,i=e.tolist();i.fill(!1,0,n+1),i.fill(!1,r);let a=t.tolist();return i.map((e,t)=>e?t:null).filter(e=>e!==null).map(e=>a[e])}class l extends i.Processor{async _call(e,t,n={}){let r=e?await this.image_processor(e,n):{},i=t?this.tokenizer(t,n):{};return{...i,...r}}post_process_grounded_object_detection(e,t,{box_threshold:n=.25,text_threshold:r=.25,target_sizes:i=null}={}){let{logits:a,pred_boxes:o}=e,l=a.dims[0];if(i!==null&&i.length!==l)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let u=a.dims.at(1),d=a.sigmoid(),f=d.max(-1).tolist(),p=o.tolist().map(e=>e.map(e=>(0,s.center_to_corners_format)(e))),m=[];for(let e=0;ee.map((e,t)=>e*a[(t+1)%2])));let o=f[e],s=[],l=[],h=[];for(let i=0;i{n.r(t),n.d(t,{Idefics3ImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{constructor(e){super(e),this.do_image_splitting=e.do_image_splitting??!0,this.max_image_size=e.max_image_size}get_resize_for_vision_encoder(e,t){let[n,r]=e.dims.slice(-2),i=r/n;return r>=n?(r=Math.ceil(r/t)*t,n=Math.floor(r/i),n=Math.ceil(n/t)*t):(n=Math.ceil(n/t)*t,r=Math.floor(n*i),r=Math.ceil(r/t)*t),{height:n,width:r}}async _call(e,{do_image_splitting:t=null,return_row_col_info:n=!1}={}){let r;if(!Array.isArray(e))r=[[e]];else{if(e.length===0||!e[0])throw Error(`No images provided.`);r=Array.isArray(e[0])?e:[e]}let a=[],o=[],s=[],c=[],l=[];for(let e of r){let n=await Promise.all(e.map(e=>this.preprocess(e)));c.push(...n.map(e=>e.original_size)),l.push(...n.map(e=>e.reshaped_input_size)),n.forEach(e=>e.pixel_values.unsqueeze_(0));let{longest_edge:r}=this.max_image_size,u;if(t??this.do_image_splitting){let e=Array(n.length),t=Array(n.length);u=await Promise.all(n.map(async(n,a)=>{let o=this.get_resize_for_vision_encoder(n.pixel_values,r),s=await(0,i.interpolate_4d)(n.pixel_values,{size:[o.height,o.width]}),{frames:c,num_splits_h:l,num_splits_w:u}=await this.split_image(s,this.max_image_size);return e[a]=l,t[a]=u,(0,i.cat)(c,0)})),o.push(e),s.push(t)}else{let e=[r,r];u=await Promise.all(n.map(t=>(0,i.interpolate_4d)(t.pixel_values,{size:e}))),o.push(Array(n.length).fill(0)),s.push(Array(n.length).fill(0))}a.push((0,i.cat)(u,0))}let u=a.length,[d,f,p,m]=a[0].dims,h,g;if(u===1)h=a[0].unsqueeze_(0),g=(0,i.full)([u,d,p,m],!0);else{let e=Math.max(...a.map(e=>e.dims.at(0)));g=(0,i.full)([u,e,p,m],!0);let t=g.data,n=e*p*m;for(let r=0;rn||s>r){c=Math.ceil(o/n),l=Math.ceil(s/r);let t=Math.ceil(o/c),u=Math.ceil(s/l);for(let n=0;n{r.r(n),r.d(n,{Idefics3Processor:()=>f});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/image.js */ +`./src/utils/image.js`),c=r( +/*! ../../utils/core.js */ +`./src/utils/core.js`);function l(e,t,n,r,i,a){let o=``;for(let a=0;a`+i.repeat(e);o+=` +`}return o+=`\n${r}${a}`+i.repeat(e)+`${r}`,o}function u(e,t,n,r){return`${t}${r}`+n.repeat(e)+`${t}`}function d(e,t,n,r,i,a){return e===0&&t===0?u(n,r,i,a):l(n,e,t,r,i,a)}class f extends i.Processor{constructor(...t){super(...t),e.defineProperty(this,`fake_image_token`,``),e.defineProperty(this,`image_token`,``),e.defineProperty(this,`global_img_token`,``)}async _call(e,t=null,n={}){n.return_row_col_info??=!0;let r;t&&(r=await this.image_processor(t,n)),Array.isArray(e)||(e=[e]);let i=r.rows??[Array(e.length).fill(0)],a=r.cols??[Array(e.length).fill(0)],o=this.config.image_seq_len,s=[],l=[];for(let t=0;td(e,u[t],o,this.fake_image_token,this.image_token,this.global_img_token)),p=n.split(this.image_token);if(p.length===0)throw Error(`The image token should be present in the text.`);let m=p[0];for(let e=0;e{n.r(t),n.d(t,{BeitFeatureExtractor:()=>r.BeitFeatureExtractor,BitImageProcessor:()=>i.BitImageProcessor,CLIPFeatureExtractor:()=>o.CLIPFeatureExtractor,CLIPImageProcessor:()=>o.CLIPImageProcessor,ChineseCLIPFeatureExtractor:()=>a.ChineseCLIPFeatureExtractor,ConvNextFeatureExtractor:()=>s.ConvNextFeatureExtractor,ConvNextImageProcessor:()=>s.ConvNextImageProcessor,DPTFeatureExtractor:()=>d.DPTFeatureExtractor,DPTImageProcessor:()=>d.DPTImageProcessor,DeiTFeatureExtractor:()=>c.DeiTFeatureExtractor,DeiTImageProcessor:()=>c.DeiTImageProcessor,DetrFeatureExtractor:()=>l.DetrFeatureExtractor,DetrImageProcessor:()=>l.DetrImageProcessor,DonutFeatureExtractor:()=>u.DonutFeatureExtractor,DonutImageProcessor:()=>u.DonutImageProcessor,EfficientNetImageProcessor:()=>f.EfficientNetImageProcessor,GLPNFeatureExtractor:()=>p.GLPNFeatureExtractor,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,Idefics3ImageProcessor:()=>h.Idefics3ImageProcessor,JinaCLIPImageProcessor:()=>_.JinaCLIPImageProcessor,LlavaOnevisionImageProcessor:()=>v.LlavaOnevisionImageProcessor,Mask2FormerImageProcessor:()=>y.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>b.MaskFormerFeatureExtractor,MaskFormerImageProcessor:()=>b.MaskFormerImageProcessor,MobileNetV1FeatureExtractor:()=>x.MobileNetV1FeatureExtractor,MobileNetV1ImageProcessor:()=>x.MobileNetV1ImageProcessor,MobileNetV2FeatureExtractor:()=>S.MobileNetV2FeatureExtractor,MobileNetV2ImageProcessor:()=>S.MobileNetV2ImageProcessor,MobileNetV3FeatureExtractor:()=>C.MobileNetV3FeatureExtractor,MobileNetV3ImageProcessor:()=>C.MobileNetV3ImageProcessor,MobileNetV4FeatureExtractor:()=>w.MobileNetV4FeatureExtractor,MobileNetV4ImageProcessor:()=>w.MobileNetV4ImageProcessor,MobileViTFeatureExtractor:()=>T.MobileViTFeatureExtractor,MobileViTImageProcessor:()=>T.MobileViTImageProcessor,NougatImageProcessor:()=>E.NougatImageProcessor,OwlViTFeatureExtractor:()=>O.OwlViTFeatureExtractor,OwlViTImageProcessor:()=>O.OwlViTImageProcessor,Owlv2ImageProcessor:()=>D.Owlv2ImageProcessor,Phi3VImageProcessor:()=>k.Phi3VImageProcessor,PvtImageProcessor:()=>A.PvtImageProcessor,Qwen2VLImageProcessor:()=>ee.Qwen2VLImageProcessor,RTDetrImageProcessor:()=>te.RTDetrImageProcessor,SamImageProcessor:()=>ne.SamImageProcessor,SegformerFeatureExtractor:()=>re.SegformerFeatureExtractor,SegformerImageProcessor:()=>re.SegformerImageProcessor,SiglipImageProcessor:()=>j.SiglipImageProcessor,SmolVLMImageProcessor:()=>ie.SmolVLMImageProcessor,Swin2SRImageProcessor:()=>ae.Swin2SRImageProcessor,VLMImageProcessor:()=>g.VLMImageProcessor,ViTFeatureExtractor:()=>oe.ViTFeatureExtractor,ViTImageProcessor:()=>oe.ViTImageProcessor,VitMatteImageProcessor:()=>se.VitMatteImageProcessor,VitPoseImageProcessor:()=>ce.VitPoseImageProcessor,YolosFeatureExtractor:()=>le.YolosFeatureExtractor,YolosImageProcessor:()=>le.YolosImageProcessor});var r=n( +/*! ./beit/image_processing_beit.js */ +`./src/models/beit/image_processing_beit.js`),i=n( +/*! ./bit/image_processing_bit.js */ +`./src/models/bit/image_processing_bit.js`),a=n( +/*! ./chinese_clip/image_processing_chinese_clip.js */ +`./src/models/chinese_clip/image_processing_chinese_clip.js`),o=n( +/*! ./clip/image_processing_clip.js */ +`./src/models/clip/image_processing_clip.js`),s=n( +/*! ./convnext/image_processing_convnext.js */ +`./src/models/convnext/image_processing_convnext.js`),c=n( +/*! ./deit/image_processing_deit.js */ +`./src/models/deit/image_processing_deit.js`),l=n( +/*! ./detr/image_processing_detr.js */ +`./src/models/detr/image_processing_detr.js`),u=n( +/*! ./donut/image_processing_donut.js */ +`./src/models/donut/image_processing_donut.js`),d=n( +/*! ./dpt/image_processing_dpt.js */ +`./src/models/dpt/image_processing_dpt.js`),f=n( +/*! ./efficientnet/image_processing_efficientnet.js */ +`./src/models/efficientnet/image_processing_efficientnet.js`),p=n( +/*! ./glpn/image_processing_glpn.js */ +`./src/models/glpn/image_processing_glpn.js`),m=n( +/*! ./grounding_dino/image_processing_grounding_dino.js */ +`./src/models/grounding_dino/image_processing_grounding_dino.js`),h=n( +/*! ./idefics3/image_processing_idefics3.js */ +`./src/models/idefics3/image_processing_idefics3.js`),g=n( +/*! ./janus/image_processing_janus.js */ +`./src/models/janus/image_processing_janus.js`),_=n( +/*! ./jina_clip/image_processing_jina_clip.js */ +`./src/models/jina_clip/image_processing_jina_clip.js`),v=n( +/*! ./llava_onevision/image_processing_llava_onevision.js */ +`./src/models/llava_onevision/image_processing_llava_onevision.js`),y=n( +/*! ./mask2former/image_processing_mask2former.js */ +`./src/models/mask2former/image_processing_mask2former.js`),b=n( +/*! ./maskformer/image_processing_maskformer.js */ +`./src/models/maskformer/image_processing_maskformer.js`),x=n( +/*! ./mobilenet_v1/image_processing_mobilenet_v1.js */ +`./src/models/mobilenet_v1/image_processing_mobilenet_v1.js`),S=n( +/*! ./mobilenet_v2/image_processing_mobilenet_v2.js */ +`./src/models/mobilenet_v2/image_processing_mobilenet_v2.js`),C=n( +/*! ./mobilenet_v3/image_processing_mobilenet_v3.js */ +`./src/models/mobilenet_v3/image_processing_mobilenet_v3.js`),w=n( +/*! ./mobilenet_v4/image_processing_mobilenet_v4.js */ +`./src/models/mobilenet_v4/image_processing_mobilenet_v4.js`),T=n( +/*! ./mobilevit/image_processing_mobilevit.js */ +`./src/models/mobilevit/image_processing_mobilevit.js`),E=n( +/*! ./nougat/image_processing_nougat.js */ +`./src/models/nougat/image_processing_nougat.js`),D=n( +/*! ./owlv2/image_processing_owlv2.js */ +`./src/models/owlv2/image_processing_owlv2.js`),O=n( +/*! ./owlvit/image_processing_owlvit.js */ +`./src/models/owlvit/image_processing_owlvit.js`),k=n( +/*! ./phi3_v/image_processing_phi3_v.js */ +`./src/models/phi3_v/image_processing_phi3_v.js`),A=n( +/*! ./pvt/image_processing_pvt.js */ +`./src/models/pvt/image_processing_pvt.js`),ee=n( +/*! ./qwen2_vl/image_processing_qwen2_vl.js */ +`./src/models/qwen2_vl/image_processing_qwen2_vl.js`),te=n( +/*! ./rt_detr/image_processing_rt_detr.js */ +`./src/models/rt_detr/image_processing_rt_detr.js`),ne=n( +/*! ./sam/image_processing_sam.js */ +`./src/models/sam/image_processing_sam.js`),re=n( +/*! ./segformer/image_processing_segformer.js */ +`./src/models/segformer/image_processing_segformer.js`),j=n( +/*! ./siglip/image_processing_siglip.js */ +`./src/models/siglip/image_processing_siglip.js`),ie=n( +/*! ./smolvlm/image_processing_smolvlm.js */ +`./src/models/smolvlm/image_processing_smolvlm.js`),ae=n( +/*! ./swin2sr/image_processing_swin2sr.js */ +`./src/models/swin2sr/image_processing_swin2sr.js`),oe=n( +/*! ./vit/image_processing_vit.js */ +`./src/models/vit/image_processing_vit.js`),se=n( +/*! ./vitmatte/image_processing_vitmatte.js */ +`./src/models/vitmatte/image_processing_vitmatte.js`),ce=n( +/*! ./vitpose/image_processing_vitpose.js */ +`./src/models/vitpose/image_processing_vitpose.js`),le=n( +/*! ./yolos/image_processing_yolos.js */ +`./src/models/yolos/image_processing_yolos.js`)},"./src/models/janus/image_processing_janus.js":(e,t,n)=>{n.r(t),n.d(t,{VLMImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){super({do_pad:!0,pad_size:{width:e.image_size,height:e.image_size},...e}),this.constant_values=this.config.background_color.map(e=>e*this.rescale_factor)}pad_image(e,t,n,r){return super.pad_image(e,t,n,{constant_values:this.constant_values,center:!0,...r})}}},"./src/models/janus/processing_janus.js":(t,n,r)=>{r.r(n),r.d(n,{VLChatProcessor:()=>u});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/core.js */ +`./src/utils/core.js`),c=r( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),l=r( +/*! ../../utils/image.js */ +`./src/utils/image.js`);class u extends i.Processor{constructor(e,t){super(e,t),this.image_tag=this.config.image_tag,this.image_start_tag=this.config.image_start_tag,this.image_end_tag=this.config.image_end_tag,this.num_image_tokens=this.config.num_image_tokens}async _call(e,{images:t=null,chat_template:n=`default`}={}){t?Array.isArray(t)||(t=[t]):t=await Promise.all(e.filter(e=>e.images).flatMap(e=>e.images).map(e=>l.RawImage.read(e)));let r=this.tokenizer,i=r.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0,chat_template:n}),a=e=>r.encode(e,{add_special_tokens:!1}),o=i.split(this.image_tag),u=o.length-1;if(t.length!==u)throw Error(`Number of images provided (${t.length}) does not match number of "${this.image_tag}" image tags (${u})`);let[d,f,p]=r.model.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]),m=a(o[0]),h=Array(m.length).fill(!1);for(let e=1;e0){let e=await this.image_processor(t);return e.pixel_values.unsqueeze_(0),{..._,...e}}return _}}e.defineProperty(u,`image_processor_class`,a.AutoImageProcessor),e.defineProperty(u,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(u,`uses_processor_config`,!0)},"./src/models/jina_clip/image_processing_jina_clip.js":(e,t,n)=>{n.r(t),n.d(t,{JinaCLIPImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){let{resize_mode:t,fill_color:n,interpolation:r,size:i,...a}=e,o=t===`squash`?{width:i,height:i}:t===`shortest`?{shortest_edge:i}:{longest_edge:i},s=r===`bicubic`?3:2;super({...a,size:o,resample:s,do_center_crop:!0,crop_size:i,do_normalize:!0})}}},"./src/models/jina_clip/processing_jina_clip.js":(t,n,r)=>{r.r(n),r.d(n,{JinaCLIPProcessor:()=>s});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class s extends i.Processor{async _call(e=null,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=e?this.tokenizer(e,n):{},i=t?await this.image_processor(t,n):{};return{...r,...i}}}e.defineProperty(s,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(s,`image_processor_class`,a.AutoImageProcessor)},"./src/models/llava_onevision/image_processing_llava_onevision.js":(e,t,n)=>{n.r(t),n.d(t,{LlavaOnevisionImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/mask2former/image_processing_mask2former.js":(e,t,n)=>{n.r(t),n.d(t,{Mask2FormerImageProcessor:()=>i});var r=n( +/*! ../maskformer/image_processing_maskformer.js */ +`./src/models/maskformer/image_processing_maskformer.js`);class i extends r.MaskFormerImageProcessor{}},"./src/models/maskformer/image_processing_maskformer.js":(e,t,n)=>{n.r(t),n.d(t,{MaskFormerFeatureExtractor:()=>a,MaskFormerImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_panoptic_segmentation(...e){return(0,r.post_process_panoptic_segmentation)(...e)}post_process_instance_segmentation(...e){return(0,r.post_process_instance_segmentation)(...e)}}class a extends i{}},"./src/models/mgp_str/processing_mgp_str.js":(t,n,r)=>{r.r(n),r.d(n,{MgpstrProcessor:()=>l});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/maths.js */ +`./src/utils/maths.js`);let c={char:[`char_decode`,1],bpe:[`bpe_decode`,2],wp:[`wp_decode`,102]};class l extends i.Processor{get char_tokenizer(){return this.components.char_tokenizer}get bpe_tokenizer(){return this.components.bpe_tokenizer}get wp_tokenizer(){return this.components.wp_tokenizer}_decode_helper(e,t){if(!c.hasOwnProperty(t))throw Error(`Format ${t} is not supported.`);let[n,r]=c[t],i=this[n].bind(this),[a,o]=e.dims,l=[],u=[],d=e.tolist();for(let e=0;e0?i.reduce((e,t)=>e*t,1):0;u.push(n),l.push(a)}let f=i(u);return[f,l]}char_decode(e){return this.char_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}bpe_decode(e){return this.bpe_tokenizer.batch_decode(e)}wp_decode(e){return this.wp_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}batch_decode([e,t,n]){let[r,i]=this._decode_helper(e,`char`),[a,o]=this._decode_helper(t,`bpe`),[c,l]=this._decode_helper(n,`wp`),u=[],d=[];for(let e=0;e{n.r(t),n.d(t,{MobileNetV1FeatureExtractor:()=>a,MobileNetV1ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/mobilenet_v2/image_processing_mobilenet_v2.js":(e,t,n)=>{n.r(t),n.d(t,{MobileNetV2FeatureExtractor:()=>a,MobileNetV2ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/mobilenet_v3/image_processing_mobilenet_v3.js":(e,t,n)=>{n.r(t),n.d(t,{MobileNetV3FeatureExtractor:()=>a,MobileNetV3ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/mobilenet_v4/image_processing_mobilenet_v4.js":(e,t,n)=>{n.r(t),n.d(t,{MobileNetV4FeatureExtractor:()=>a,MobileNetV4ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/mobilevit/image_processing_mobilevit.js":(e,t,n)=>{n.r(t),n.d(t,{MobileViTFeatureExtractor:()=>a,MobileViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/moonshine/feature_extraction_moonshine.js":(e,t,n)=>{n.r(t),n.d(t,{MoonshineFeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.FeatureExtractor{async _call(e){(0,r.validate_audio_inputs)(e,`MoonshineFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=[1,e.length];return{input_values:new i.Tensor(`float32`,e,t)}}}},"./src/models/moonshine/processing_moonshine.js":(t,n,r)=>{r.r(n),r.d(n,{MoonshineProcessor:()=>s});var i=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),a=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,a.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,i.AutoFeatureExtractor)},"./src/models/nougat/image_processing_nougat.js":(e,t,n)=>{n.r(t),n.d(t,{NougatImageProcessor:()=>i});var r=n( +/*! ../donut/image_processing_donut.js */ +`./src/models/donut/image_processing_donut.js`);class i extends r.DonutImageProcessor{}},"./src/models/owlv2/image_processing_owlv2.js":(e,t,n)=>{n.r(t),n.d(t,{Owlv2ImageProcessor:()=>i});var r=n( +/*! ../owlvit/image_processing_owlvit.js */ +`./src/models/owlvit/image_processing_owlvit.js`);class i extends r.OwlViTImageProcessor{}},"./src/models/owlvit/image_processing_owlvit.js":(e,t,n)=>{n.r(t),n.d(t,{OwlViTFeatureExtractor:()=>a,OwlViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}}class a extends i{}},"./src/models/owlvit/processing_owlvit.js":(t,n,r)=>{r.r(n),r.d(n,{OwlViTProcessor:()=>s});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class s extends i.Processor{}e.defineProperty(s,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(s,`image_processor_class`,a.AutoImageProcessor)},"./src/models/paligemma/processing_paligemma.js":(t,n,r)=>{r.r(n),r.d(n,{PaliGemmaProcessor:()=>l});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);let s=``;function c(e,t,n,r,i){return`${r.repeat(n*i)}${t}${e}\n`}class l extends i.Processor{async _call(e,t=null,n={}){t||(console.warn(`You are using PaliGemma without a text prefix. It will perform as a picture-captioning model.`),t=``),Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let r=this.tokenizer.bos_token,i=this.image_processor.config.image_seq_length,a;t.some(e=>e.includes(s))?a=t.map(e=>{let t=e.replaceAll(s,s.repeat(i)),n=t.lastIndexOf(s),a=n===-1?0:n+s.length;return t.slice(0,a)+r+t.slice(a)+` +`}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),a=t.map(t=>c(t,r,i,s,e.length)));let o=this.tokenizer(a,n),l=await this.image_processor(e,n);return{...l,...o}}}e.defineProperty(l,`tokenizer_class`,o.AutoTokenizer),e.defineProperty(l,`image_processor_class`,a.AutoImageProcessor),e.defineProperty(l,`uses_processor_config`,!1)},"./src/models/phi3_v/image_processing_phi3_v.js":(e,t,n)=>{n.r(t),n.d(t,{Phi3VImageProcessor:()=>u});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);let a=336,o=[2,3],{ceil:s,floor:c,sqrt:l}=Math;class u extends r.ImageProcessor{constructor(e){super({...e,do_normalize:!0,do_pad:!0,pad_size:`custom`,do_convert_rgb:!0,do_resize:!0}),this._num_crops=e.num_crops}calc_num_image_tokens_from_image_size(e,t){let{num_img_tokens:n}=this.config;return c((c(t/a)*c(e/a)+1)*n+1+(c(t/a)+1)*l(n))}get_resize_output_image_size(e,t){let n=this._num_crops,[r,i]=e.size,a=r/i,o=1;for(;o*Math.ceil(o/a)<=n;)o+=1;--o;let s=Math.floor(o*336),c=Math.floor(s/a);return[s,c]}pad_image(e,t,n,r={}){let[i,o]=t,c=a*s(i/a),l=a*s(o/a),u=[1,1,1].map((e,t)=>(e-this.image_mean[t])/this.image_std[t]);return super.pad_image(e,t,{width:l,height:c},{center:!0,constant_values:u,...r})}async _call(e,{num_crops:t=null}={}){if(this._num_crops=t??=this.config.num_crops,t<4||l(t)%1!=0)throw Error(`num_crops must be a square number >= 4`);Array.isArray(e)||(e=[e]);let n=e.length,r=await Promise.all(e.map(e=>this.preprocess(e))),u=r.map(e=>e.original_size),d=r.map(e=>e.reshaped_input_size),f=[];for(let{pixel_values:e}of r){e.unsqueeze_(0);let[n,r]=e.dims.slice(-2),s=await(0,i.interpolate_4d)(e,{size:[a,a],mode:`bicubic`});if(t>0){let u=[],d=l(t),p=c(r/d),m=c(n/d);for(let t=0;te.map(e=>a*s(e/a))),h=new i.Tensor(`int64`,m.flat(),[n,2]),g=m.map(([e,t])=>this.calc_num_image_tokens_from_image_size(t,e));return{pixel_values:p,original_sizes:u,reshaped_input_sizes:d,image_sizes:h,num_img_tokens:g}}}},"./src/models/phi3_v/processing_phi3_v.js":(t,n,r)=>{r.r(n),r.d(n,{Phi3VProcessor:()=>u});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/image.js */ +`./src/utils/image.js`);let c=`<|image|>`,l=/<\|image_\d+\|>/g;class u extends i.Processor{async _call(e,t=null,{padding:n=!0,truncation:r=!0,num_crops:i=null}={}){Array.isArray(e)||(e=[e]);let a,o;if(t){o=await this.image_processor(t,{num_crops:i});let{num_img_tokens:s}=o,u=e.map((e,t)=>e.split(l).join(c.repeat(s[t])));a=this.tokenizer(u,{padding:n,truncation:r});let d=this.tokenizer.model.convert_tokens_to_ids([c])[0];a.input_ids.map_(e=>e==d?-e:e)}else a=this.tokenizer(e);return{...a,...o}}}e.defineProperty(u,`image_processor_class`,a.AutoImageProcessor),e.defineProperty(u,`tokenizer_class`,o.AutoTokenizer)},"./src/models/processors.js":(e,t,n)=>{n.r(t),n.d(t,{Florence2Processor:()=>r.Florence2Processor,GroundingDinoProcessor:()=>i.GroundingDinoProcessor,Idefics3Processor:()=>a.Idefics3Processor,JinaCLIPProcessor:()=>s.JinaCLIPProcessor,MgpstrProcessor:()=>c.MgpstrProcessor,MoonshineProcessor:()=>l.MoonshineProcessor,OwlViTProcessor:()=>u.OwlViTProcessor,PaliGemmaProcessor:()=>f.PaliGemmaProcessor,Phi3VProcessor:()=>d.Phi3VProcessor,PyAnnoteProcessor:()=>p.PyAnnoteProcessor,Qwen2VLProcessor:()=>m.Qwen2VLProcessor,SamProcessor:()=>h.SamProcessor,SmolVLMProcessor:()=>g.SmolVLMProcessor,SpeechT5Processor:()=>_.SpeechT5Processor,UltravoxProcessor:()=>v.UltravoxProcessor,VLChatProcessor:()=>o.VLChatProcessor,Wav2Vec2Processor:()=>y.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>b.Wav2Vec2ProcessorWithLM,WhisperProcessor:()=>x.WhisperProcessor});var r=n( +/*! ./florence2/processing_florence2.js */ +`./src/models/florence2/processing_florence2.js`),i=n( +/*! ./grounding_dino/processing_grounding_dino.js */ +`./src/models/grounding_dino/processing_grounding_dino.js`),a=n( +/*! ./idefics3/processing_idefics3.js */ +`./src/models/idefics3/processing_idefics3.js`),o=n( +/*! ./janus/processing_janus.js */ +`./src/models/janus/processing_janus.js`),s=n( +/*! ./jina_clip/processing_jina_clip.js */ +`./src/models/jina_clip/processing_jina_clip.js`),c=n( +/*! ./mgp_str/processing_mgp_str.js */ +`./src/models/mgp_str/processing_mgp_str.js`),l=n( +/*! ./moonshine/processing_moonshine.js */ +`./src/models/moonshine/processing_moonshine.js`),u=n( +/*! ./owlvit/processing_owlvit.js */ +`./src/models/owlvit/processing_owlvit.js`),d=n( +/*! ./phi3_v/processing_phi3_v.js */ +`./src/models/phi3_v/processing_phi3_v.js`),f=n( +/*! ./paligemma/processing_paligemma.js */ +`./src/models/paligemma/processing_paligemma.js`),p=n( +/*! ./pyannote/processing_pyannote.js */ +`./src/models/pyannote/processing_pyannote.js`),m=n( +/*! ./qwen2_vl/processing_qwen2_vl.js */ +`./src/models/qwen2_vl/processing_qwen2_vl.js`),h=n( +/*! ./sam/processing_sam.js */ +`./src/models/sam/processing_sam.js`),g=n( +/*! ./smolvlm/processing_smolvlm.js */ +`./src/models/smolvlm/processing_smolvlm.js`),_=n( +/*! ./speecht5/processing_speecht5.js */ +`./src/models/speecht5/processing_speecht5.js`),v=n( +/*! ./ultravox/processing_ultravox.js */ +`./src/models/ultravox/processing_ultravox.js`),y=n( +/*! ./wav2vec2/processing_wav2vec2.js */ +`./src/models/wav2vec2/processing_wav2vec2.js`),b=n( +/*! ./wav2vec2_with_lm/processing_wav2vec2_with_lm.js */ +`./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js`),x=n( +/*! ./whisper/processing_whisper.js */ +`./src/models/whisper/processing_whisper.js`)},"./src/models/pvt/image_processing_pvt.js":(e,t,n)=>{n.r(t),n.d(t,{PvtImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/pyannote/feature_extraction_pyannote.js":(e,t,n)=>{n.r(t),n.d(t,{PyAnnoteFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/maths.js */ +`./src/utils/maths.js`);class o extends r.FeatureExtractor{async _call(e){(0,r.validate_audio_inputs)(e,`PyAnnoteFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=[1,1,e.length];return{input_values:new i.Tensor(`float32`,e,t)}}samples_to_frames(e){return(e-this.config.offset)/this.config.step}post_process_speaker_diarization(e,t){let n=t/this.samples_to_frames(t)/this.config.sampling_rate,r=[];for(let t of e.tolist()){let e=[],i=-1;for(let n=0;n({id:e,start:t*n,end:r*n,confidence:i/(r-t)})))}return r}}},"./src/models/pyannote/processing_pyannote.js":(t,n,r)=>{r.r(n),r.d(n,{PyAnnoteProcessor:()=>o});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ./feature_extraction_pyannote.js */ +`./src/models/pyannote/feature_extraction_pyannote.js`);class o extends i.Processor{async _call(e){return await this.feature_extractor(e)}post_process_speaker_diarization(...e){return this.feature_extractor.post_process_speaker_diarization(...e)}get sampling_rate(){return this.feature_extractor.config.sampling_rate}}e.defineProperty(o,`feature_extractor_class`,a.PyAnnoteFeatureExtractor)},"./src/models/qwen2_vl/image_processing_qwen2_vl.js":(e,t,n)=>{n.r(t),n.d(t,{Qwen2VLImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e,...t){let{pixel_values:n,original_sizes:r,reshaped_input_sizes:a}=await super._call(e,...t),o=n,{temporal_patch_size:s,merge_size:c,patch_size:l}=this.config;o.dims[0]===1&&(o=(0,i.cat)(Array.from({length:s},()=>o),0));let u=o.dims[0]/s,d=o.dims[1],f=Math.floor(o.dims[2]/l),p=Math.floor(o.dims[3]/l),m=o.view(u,s,d,Math.floor(f/c),c,l,Math.floor(p/c),c,l).permute(0,3,6,4,7,2,1,5,8).view(u*f*p,d*s*l*l),h=new i.Tensor(`int64`,[u,f,p],[1,3]);return{pixel_values:m,image_grid_thw:h,original_sizes:r,reshaped_input_sizes:a}}}},"./src/models/qwen2_vl/processing_qwen2_vl.js":(t,n,r)=>{r.r(n),r.d(n,{Qwen2VLProcessor:()=>c});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),o=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),s=r( +/*! ../../utils/image.js */ +`./src/utils/image.js`);class c extends i.Processor{async _call(e,t=null,...n){Array.isArray(e)||(e=[e]);let r,i;if(t&&(r=await this.image_processor(t),i=r.image_grid_thw),i){let t=this.image_processor.config.merge_size**2,n=0,r=i.tolist();e=e.map(e=>{for(;e.includes(`<|image_pad|>`);){let i=Number(r[n++].reduce((e,t)=>e*t,1n));e=e.replace(`<|image_pad|>`,`<|placeholder|>`.repeat(Math.floor(i/t)))}return e.replaceAll(`<|placeholder|>`,`<|image_pad|>`)})}let a=this.tokenizer(e);return{...a,...r}}}e.defineProperty(c,`image_processor_class`,a.AutoImageProcessor),e.defineProperty(c,`tokenizer_class`,o.AutoTokenizer)},"./src/models/rt_detr/image_processing_rt_detr.js":(e,t,n)=>{n.r(t),n.d(t,{RTDetrImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}}},"./src/models/sam/image_processing_sam.js":(e,t,n)=>{n.r(t),n.d(t,{SamImageProcessor:()=>o});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/core.js */ +`./src/utils/core.js`),a=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class o extends r.ImageProcessor{reshape_input_points(e,t,n,r=!1){e=structuredClone(e);let o=(0,i.calculateDimensions)(e);if(o.length===3)r||(o=[1,...o]),e=[e];else if(o.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let r=0;re!==t.dims[n]))throw Error(`The first ${n.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new a.Tensor(`int64`,e.flat(1/0).map(BigInt),n)}async _call(e,{input_points:t=null,input_labels:n=null,input_boxes:r=null}={}){let i=await super._call(e);if(t&&(i.input_points=this.reshape_input_points(t,i.original_sizes,i.reshaped_input_sizes)),n){if(!i.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");i.input_labels=this.add_input_labels(n,i.input_points)}return r&&(i.input_boxes=this.reshape_input_points(r,i.original_sizes,i.reshaped_input_sizes,!0)),i}async post_process_masks(e,t,n,{mask_threshold:r=0,binarize:i=!0,pad_size:o=null}={}){let s=[];o??=this.pad_size;let c=[o.height,o.width];for(let o=0;or&&(t[n]=1);d=new a.Tensor(`bool`,t,d.dims)}s.push(d)}return s}generate_crop_boxes(e,t,{crop_n_layers:n=0,overlap_ratio:r=512/1500,points_per_crop:i=32,crop_n_points_downscale_factor:a=1}={}){}}},"./src/models/sam/processing_sam.js":(t,n,r)=>{r.r(n),r.d(n,{SamProcessor:()=>o});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`);class o extends i.Processor{async _call(...e){return await this.image_processor(...e)}post_process_masks(...e){return this.image_processor.post_process_masks(...e)}reshape_input_points(...e){return this.image_processor.reshape_input_points(...e)}}e.defineProperty(o,`image_processor_class`,a.AutoImageProcessor)},"./src/models/seamless_m4t/feature_extraction_seamless_m4t.js":(e,t,n)=>{n.r(t),n.d(t,{SeamlessM4TFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e);let t=this.config.sampling_rate,n=(0,a.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=(0,a.window_function)(400,`povey`,{periodic:!1})}async _extract_fbank_features(e,t){return e=e.map(e=>e*32768),(0,a.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e,{padding:t=!0,pad_to_multiple_of:n=2,do_normalize_per_mel_bins:a=!0,return_attention_mask:o=!0}={}){(0,r.validate_audio_inputs)(e,`SeamlessM4TFeatureExtractor`);let s=await this._extract_fbank_features(e,this.config.max_length);if(a){let[e,t]=s.dims,n=s.data;for(let r=0;r0){let n=new Float32Array(t*(e+a));n.set(r),n.fill(this.config.padding_value,r.length);let l=e+a;s=new i.Tensor(s.type,n,[l,t]),o&&(c=new i.Tensor(`int64`,new BigInt64Array(l),[1,l]),c.data.fill(1n,0,e))}}let[l,u]=s.dims,d=this.config.stride,f=l%d;if(f!==0)throw Error(`The number of frames (${l}) must be a multiple of the stride (${d}).`);let p=s.view(1,Math.floor(l/d),u*d),m={input_features:p};if(o){let e=p.dims[1],t=new BigInt64Array(e);if(c){let e=c.data;for(let n=1,r=0;n{n.r(t),n.d(t,{SegformerFeatureExtractor:()=>a,SegformerImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_semantic_segmentation(...e){return(0,r.post_process_semantic_segmentation)(...e)}}class a extends i{}},"./src/models/siglip/image_processing_siglip.js":(e,t,n)=>{n.r(t),n.d(t,{SiglipImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}},"./src/models/smolvlm/image_processing_smolvlm.js":(e,t,n)=>{n.r(t),n.d(t,{SmolVLMImageProcessor:()=>r.Idefics3ImageProcessor});var r=n( +/*! ../idefics3/image_processing_idefics3.js */ +`./src/models/idefics3/image_processing_idefics3.js`)},"./src/models/smolvlm/processing_smolvlm.js":(e,t,n)=>{n.r(t),n.d(t,{SmolVLMProcessor:()=>r.Idefics3Processor});var r=n( +/*! ../idefics3/processing_idefics3.js */ +`./src/models/idefics3/processing_idefics3.js`)},"./src/models/snac/feature_extraction_snac.js":(e,t,n)=>{n.r(t),n.d(t,{SnacFeatureExtractor:()=>i});var r=n( +/*! ../dac/feature_extraction_dac.js */ +`./src/models/dac/feature_extraction_dac.js`);class i extends r.DacFeatureExtractor{}},"./src/models/speecht5/feature_extraction_speecht5.js":(e,t,n)=>{n.r(t),n.d(t,{SpeechT5FeatureExtractor:()=>i});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`);class i extends r.FeatureExtractor{}},"./src/models/speecht5/processing_speecht5.js":(t,n,r)=>{r.r(n),r.d(n,{SpeechT5Processor:()=>s});var i=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),a=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`);class s extends i.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,a.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,o.AutoFeatureExtractor)},"./src/models/swin2sr/image_processing_swin2sr.js":(e,t,n)=>{n.r(t),n.d(t,{Swin2SRImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{pad_image(e,t,n,r={}){let[i,a,o]=t;return super.pad_image(e,t,{width:a+(n-a%n)%n,height:i+(n-i%n)%n},{mode:`symmetric`,center:!1,constant_values:-1,...r})}}},"./src/models/ultravox/processing_ultravox.js":(t,n,r)=>{r.r(n),r.d(n,{UltravoxProcessor:()=>s});var i=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),a=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e,t=null,n={}){if(Array.isArray(e))throw Error(`Batched inputs are not supported yet.`);let r={};if(t){let i=t.length,{input_features:a}=await this.feature_extractor(t,{...n,max_length:i}),o=Math.round(i/this.config.encoder_ds_factor+1e-4),s=1+Math.ceil(o/this.config.stack_factor);r.audio_token_len=[s],r.audio_values=a;let c=this.config.audio_placeholder;if(!e.includes(c))throw Error(`The input text does not contain the image token ${c}.`);e=e.replaceAll(c,c.repeat(s))}let i=this.tokenizer(e,{add_special_tokens:!1,...n});return{...i,...r}}}e.defineProperty(s,`tokenizer_class`,a.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,i.AutoFeatureExtractor),e.defineProperty(s,`uses_processor_config`,!0)},"./src/models/vit/image_processing_vit.js":(e,t,n)=>{n.r(t),n.d(t,{ViTFeatureExtractor:()=>a,ViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}},"./src/models/vitmatte/image_processing_vitmatte.js":(e,t,n)=>{n.r(t),n.d(t,{VitMatteImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e,t){Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let n=await Promise.all(e.map(e=>this.preprocess(e))),r=await Promise.all(t.map(e=>this.preprocess(e,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0}))),a=(0,i.stack)(n.map((e,t)=>(0,i.cat)([e.pixel_values,r[t].pixel_values],0)),0);return{pixel_values:a,original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}}},"./src/models/vitpose/image_processing_vitpose.js":(e,t,n)=>{n.r(t),n.d(t,{VitPoseImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_pose_estimation(e,t,{threshold:n=null}={}){let r=e.tolist(),[i,a,o,s]=e.dims,c=[];for(let e=0;e{n.r(t),n.d(t,{Wav2Vec2FeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.FeatureExtractor{_zero_mean_unit_var_norm(e){let t=e.reduce((e,t)=>e+t,0),n=t/e.length,r=e.reduce((e,t)=>e+(t-n)**2,0)/e.length;return e.map(e=>(e-n)/Math.sqrt(r+1e-7))}async _call(e){(0,r.validate_audio_inputs)(e,`Wav2Vec2FeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=e;this.config.do_normalize&&(t=this._zero_mean_unit_var_norm(t));let n=[1,t.length];return{input_values:new i.Tensor(`float32`,t,n),attention_mask:new i.Tensor(`int64`,new BigInt64Array(t.length).fill(1n),n)}}}},"./src/models/wav2vec2/processing_wav2vec2.js":(t,n,r)=>{r.r(n),r.d(n,{Wav2Vec2Processor:()=>s});var i=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),a=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,i.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,a.AutoFeatureExtractor)},"./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js":(t,n,r)=>{r.r(n),r.d(n,{Wav2Vec2ProcessorWithLM:()=>s});var i=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),a=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,i.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,a.AutoFeatureExtractor)},"./src/models/wespeaker/feature_extraction_wespeaker.js":(e,t,n)=>{n.r(t),n.d(t,{WeSpeakerFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e);let t=this.config.sampling_rate,n=(0,a.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=(0,a.window_function)(400,`hamming`,{periodic:!1}),this.min_num_frames=this.config.min_num_frames}async _extract_fbank_features(e){return e=e.map(e=>e*32768),(0,a.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(e){(0,r.validate_audio_inputs)(e,`WeSpeakerFeatureExtractor`);let t=(await this._extract_fbank_features(e)).unsqueeze_(0);if(this.config.fbank_centering_span===null){let e=t.mean(1).data,n=t.data,[r,i,a]=t.dims;for(let t=0;t{n.r(t),n.d(t,{WHISPER_LANGUAGE_MAPPING:()=>i,WHISPER_TO_LANGUAGE_CODE_MAPPING:()=>a,whisper_language_to_code:()=>o});let r=[[`en`,`english`],[`zh`,`chinese`],[`de`,`german`],[`es`,`spanish`],[`ru`,`russian`],[`ko`,`korean`],[`fr`,`french`],[`ja`,`japanese`],[`pt`,`portuguese`],[`tr`,`turkish`],[`pl`,`polish`],[`ca`,`catalan`],[`nl`,`dutch`],[`ar`,`arabic`],[`sv`,`swedish`],[`it`,`italian`],[`id`,`indonesian`],[`hi`,`hindi`],[`fi`,`finnish`],[`vi`,`vietnamese`],[`he`,`hebrew`],[`uk`,`ukrainian`],[`el`,`greek`],[`ms`,`malay`],[`cs`,`czech`],[`ro`,`romanian`],[`da`,`danish`],[`hu`,`hungarian`],[`ta`,`tamil`],[`no`,`norwegian`],[`th`,`thai`],[`ur`,`urdu`],[`hr`,`croatian`],[`bg`,`bulgarian`],[`lt`,`lithuanian`],[`la`,`latin`],[`mi`,`maori`],[`ml`,`malayalam`],[`cy`,`welsh`],[`sk`,`slovak`],[`te`,`telugu`],[`fa`,`persian`],[`lv`,`latvian`],[`bn`,`bengali`],[`sr`,`serbian`],[`az`,`azerbaijani`],[`sl`,`slovenian`],[`kn`,`kannada`],[`et`,`estonian`],[`mk`,`macedonian`],[`br`,`breton`],[`eu`,`basque`],[`is`,`icelandic`],[`hy`,`armenian`],[`ne`,`nepali`],[`mn`,`mongolian`],[`bs`,`bosnian`],[`kk`,`kazakh`],[`sq`,`albanian`],[`sw`,`swahili`],[`gl`,`galician`],[`mr`,`marathi`],[`pa`,`punjabi`],[`si`,`sinhala`],[`km`,`khmer`],[`sn`,`shona`],[`yo`,`yoruba`],[`so`,`somali`],[`af`,`afrikaans`],[`oc`,`occitan`],[`ka`,`georgian`],[`be`,`belarusian`],[`tg`,`tajik`],[`sd`,`sindhi`],[`gu`,`gujarati`],[`am`,`amharic`],[`yi`,`yiddish`],[`lo`,`lao`],[`uz`,`uzbek`],[`fo`,`faroese`],[`ht`,`haitian creole`],[`ps`,`pashto`],[`tk`,`turkmen`],[`nn`,`nynorsk`],[`mt`,`maltese`],[`sa`,`sanskrit`],[`lb`,`luxembourgish`],[`my`,`myanmar`],[`bo`,`tibetan`],[`tl`,`tagalog`],[`mg`,`malagasy`],[`as`,`assamese`],[`tt`,`tatar`],[`haw`,`hawaiian`],[`ln`,`lingala`],[`ha`,`hausa`],[`ba`,`bashkir`],[`jw`,`javanese`],[`su`,`sundanese`]],i=new Map(r),a=new Map([...r.map(([e,t])=>[t,e]),...[[`burmese`,`my`],[`valencian`,`ca`],[`flemish`,`nl`],[`haitian`,`ht`],[`letzeburgesch`,`lb`],[`pushto`,`ps`],[`panjabi`,`pa`],[`moldavian`,`ro`],[`moldovan`,`ro`],[`sinhalese`,`si`],[`castilian`,`es`]]]);function o(e){e=e.toLowerCase();let t=a.get(e);if(t===void 0){let n=e.match(/^<\|([a-z]{2})\|>$/);if(n&&(e=n[1]),i.has(e))t=e;else{let t=e.length===2,n=t?i.keys():i.values();throw Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(Array.from(n))}`)}}return t}},"./src/models/whisper/feature_extraction_whisper.js":(e,t,n)=>{n.r(t),n.d(t,{WhisperFeatureExtractor:()=>s});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`),o=n( +/*! ../../utils/maths.js */ +`./src/utils/maths.js`);class s extends r.FeatureExtractor{constructor(e){var t;super(e),(t=this.config).mel_filters??(t.mel_filters=(0,a.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,`slaney`,`slaney`)),this.window=(0,a.window_function)(this.config.n_fft,`hann`)}async _extract_fbank_features(e){let t=await(0,a.spectrogram)(e,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:`log10`,max_num_frames:Math.min(Math.floor(e.length/this.config.hop_length),this.config.nb_max_frames)}),n=t.data,r=(0,o.max)(n)[0];for(let e=0;ei?(e.length>this.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),n=e.slice(0,i)):(n=new Float32Array(i),n.set(e));let a=await this._extract_fbank_features(n);return{input_features:a.unsqueeze_(0)}}}},"./src/models/whisper/generation_whisper.js":(t,n,r)=>{r.r(n),r.d(n,{WhisperGenerationConfig:()=>a});var i=r( +/*! ../../generation/configuration_utils.js */ +`./src/generation/configuration_utils.js`);class a extends i.GenerationConfig{constructor(...t){super(...t),e.defineProperty(this,`return_timestamps`,null),e.defineProperty(this,`return_token_timestamps`,null),e.defineProperty(this,`num_frames`,null),e.defineProperty(this,`alignment_heads`,null),e.defineProperty(this,`task`,null),e.defineProperty(this,`language`,null),e.defineProperty(this,`no_timestamps_token_id`,null),e.defineProperty(this,`prompt_ids`,null),e.defineProperty(this,`is_multilingual`,null),e.defineProperty(this,`lang_to_id`,null),e.defineProperty(this,`task_to_id`,null),e.defineProperty(this,`max_initial_timestamp_index`,1)}}},"./src/models/whisper/processing_whisper.js":(t,n,r)=>{r.r(n),r.d(n,{WhisperProcessor:()=>s});var i=r( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),a=r( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=r( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class s extends o.Processor{async _call(e){return await this.feature_extractor(e)}}e.defineProperty(s,`tokenizer_class`,a.AutoTokenizer),e.defineProperty(s,`feature_extractor_class`,i.AutoFeatureExtractor)},"./src/models/yolos/image_processing_yolos.js":(e,t,n)=>{n.r(t),n.d(t,{YolosFeatureExtractor:()=>a,YolosImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}}class a extends i{}},"./src/ops/registry.js":(t,n,r)=>{r.r(n),r.d(n,{TensorOpRegistry:()=>l});var i=r( +/*! ../backends/onnx.js */ +`./src/backends/onnx.js`),a=r( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),o=r( +/*! ../env.js */ +`./src/env.js`);let s=o.apis.IS_BROWSER_ENV||o.apis.IS_WEBWORKER_ENV,c=async(e,t,n)=>{let r=await(0,i.createInferenceSession)(new Uint8Array(e),t),o=Promise.resolve();return async e=>{let t=(0,i.isONNXProxy)(),c=Object.fromEntries(Object.entries(e).map(([e,n])=>[e,(t?n.clone():n).ort_tensor])),l=await(o=s?o.then(()=>r.run(c)):r.run(c));return Array.isArray(n)?n.map(e=>new a.Tensor(l[e])):new a.Tensor(l[n])}};class l{static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||=c([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,`y`),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||=c([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||=c([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||=c([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,`c`),this._matmul}static get stft(){return this._stft||=c([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,`o`),this._stft}static get rfft(){return this._rfft||=c([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,`y`),this._rfft}static get top_k(){return this._top_k||=c([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,[`v`,`i`]),this._top_k}static get slice(){return this._slice||=c([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,`y`),this._slice}}e.defineProperty(l,`session_options`,{})},"./src/pipelines.js":(t,n,r)=>{r.r(n),r.d(n,{AudioClassificationPipeline:()=>A,AutomaticSpeechRecognitionPipeline:()=>te,BackgroundRemovalPipeline:()=>ie,DepthEstimationPipeline:()=>N,DocumentQuestionAnsweringPipeline:()=>ce,FeatureExtractionPipeline:()=>O,FillMaskPipeline:()=>x,ImageClassificationPipeline:()=>re,ImageFeatureExtractionPipeline:()=>k,ImageSegmentationPipeline:()=>j,ImageToImagePipeline:()=>M,ImageToTextPipeline:()=>ne,ObjectDetectionPipeline:()=>oe,Pipeline:()=>_,QuestionAnsweringPipeline:()=>b,SummarizationPipeline:()=>C,Text2TextGenerationPipeline:()=>S,TextClassificationPipeline:()=>v,TextGenerationPipeline:()=>E,TextToAudioPipeline:()=>le,TokenClassificationPipeline:()=>y,TranslationPipeline:()=>w,ZeroShotAudioClassificationPipeline:()=>ee,ZeroShotClassificationPipeline:()=>D,ZeroShotImageClassificationPipeline:()=>ae,ZeroShotObjectDetectionPipeline:()=>se,pipeline:()=>fe});var i=r( +/*! ./tokenizers.js */ +`./src/tokenizers.js`),a=r( +/*! ./models.js */ +`./src/models.js`),o=r( +/*! ./models/auto/processing_auto.js */ +`./src/models/auto/processing_auto.js`),s=r( +/*! ./base/processing_utils.js */ +`./src/base/processing_utils.js`),c=r( +/*! ./utils/generic.js */ +`./src/utils/generic.js`),l=r( +/*! ./utils/core.js */ +`./src/utils/core.js`),u=r( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),d=r( +/*! ./utils/audio.js */ +`./src/utils/audio.js`),f=r( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),p=r( +/*! ./utils/image.js */ +`./src/utils/image.js`);async function m(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>p.RawImage.read(e)))}async function h(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?(0,d.read_audio)(e,t):e instanceof Float64Array?new Float32Array(e):e))}function g(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}class _ extends c.Callable{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}}class v extends _{constructor(e){super(e)}async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),i=this.model.config.problem_type===`multi_label_classification`?e=>e.sigmoid():e=>new f.Tensor(`float32`,(0,u.softmax)(e.data),e.dims),a=this.model.config.id2label,o=[];for(let e of r.logits){let n=i(e),r=await(0,f.topk)(n,t),s=r[0].tolist(),c=r[1].tolist(),l=c.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:s[t]}));t===1?o.push(...l):o.push(l)}return Array.isArray(e)||t===1?o:o[0]}}class y extends _{constructor(e){super(e)}async _call(e,{ignore_labels:t=[`O`]}={}){let n=Array.isArray(e),r=this.tokenizer(n?e:[e],{padding:!0,truncation:!0}),i=await this.model(r),a=i.logits,o=this.model.config.id2label,s=[];for(let e=0;ee==this.tokenizer.sep_token_id),f=s[e].map((e,n)=>e==1&&(n===0||n>r&&c.findIndex(e=>e==t[n])===-1)),p=i[e].tolist(),m=a[e].tolist();for(let n=1;ne==t[n])!==-1)&&(p[n]=-1/0,m[n]=-1/0);let h=(0,u.softmax)(p).map((e,t)=>[e,t]),g=(0,u.softmax)(m).map((e,t)=>[e,t]);h[0][0]=0,g[0][0]=0;let _=(0,l.product)(h,g).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]);for(let e=0;ee==this.tokenizer.mask_token_id);if(o===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);let s=r[e][o],c=await(0,f.topk)(new f.Tensor(`float32`,(0,u.softmax)(s.data),s.dims),t),l=c[0].tolist(),d=c[1].tolist();i.push(d.map((e,t)=>{let r=n.slice();return r[o]=e,{score:l[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(r,{skip_special_tokens:!0})}}))}return Array.isArray(e)?i:i[0]}}class S extends _{constructor(t){super(t),e.defineProperty(this,`_key`,`generated_text`)}async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this instanceof w&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}}class C extends S{constructor(t){super(t),e.defineProperty(this,`_key`,`summary_text`)}}class w extends S{constructor(t){super(t),e.defineProperty(this,`_key`,`translation_text`)}}function T(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}class E extends _{constructor(e){super(e)}async _call(e,t={}){let n=!1,r=!1,i;if(typeof e==`string`)i=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))n=!0,i=e;else{if(T(e))e=[e];else if(Array.isArray(e)&&e.every(T))n=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);r=!0,i=e.map(e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0}))}let a=t.add_special_tokens??!1,o=r?!1:t.return_full_text??!0;this.tokenizer.padding_side=`left`;let s=this.tokenizer(i,{add_special_tokens:a,padding:!0,truncation:!0}),c=await this.model.generate({...s,...t}),l=this.tokenizer.batch_decode(c,{skip_special_tokens:!0}),u;!o&&s.input_ids.dims.at(-1)>0&&(u=this.tokenizer.batch_decode(s.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let d=Array.from({length:e.length},e=>[]);for(let t=0;t[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=o?e.map(e=>(0,u.softmax)(e)[1]):(0,u.softmax)(e),i=r.map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:i.map(e=>t[e[1]]),scores:i.map(e=>e[0])})}return i?s:s[0]}}class O extends _{constructor(e){super(e)}async _call(e,{pooling:t=`none`,normalize:n=!1,quantize:r=!1,precision:i=`binary`}={}){let a=this.tokenizer(e,{padding:!0,truncation:!0}),o=await this.model(a),s=o.last_hidden_state??o.logits??o.token_embeddings;if(t!==`none`)if(t===`mean`)s=(0,f.mean_pooling)(s,a.attention_mask);else if(t===`cls`)s=s.slice(null,0);else throw Error(`Pooling method '${t}' not supported.`);return n&&(s=s.normalize(2,-1)),r&&(s=(0,f.quantize_embeddings)(s,i)),s}}class k extends _{constructor(e){super(e)}async _call(e,{pool:t=null}={}){let n=await m(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a;if(t){if(!(`pooler_output`in i))throw Error(`No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.`);a=i.pooler_output}else a=i.last_hidden_state??i.logits??i.image_embeds;return a}}class A extends _{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await h(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=await this.model(n),o=r.logits[0],s=await(0,f.topk)(new f.Tensor(`float32`,(0,u.softmax)(o.data),o.dims),t),c=s[0].tolist(),l=s[1].tolist(),d=l.map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:c[t]}));a.push(d)}return Array.isArray(e)?a:a[0]}}class ee extends _{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await h(e,o),c=[];for(let e of s){let n=await this.processor(e),r=await this.model({...a,...n}),i=(0,u.softmax)(r.logits_per_audio.data);c.push([...i].map((e,n)=>({score:e,label:t[n]})))}return r?c[0]:c}}class te extends _{constructor(e){super(e)}async _call(e,t={}){switch(this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await h(e,r),a=[];for(let e of i){let t=await this.processor(e),n=await this.model(t),r=n.logits[0],i=[];for(let e of r)i.push((0,u.max)(e.data)[1]);let o=this.tokenizer.decode(i);a.push({text:o})}return n?a[0]:a}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!1);let s=!Array.isArray(e);s&&(e=[e]);let c=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,l=this.processor.feature_extractor.config.hop_length,d=this.processor.feature_extractor.config.sampling_rate,f=await h(e,d),p=[];for(let e of f){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=d*r,i=d*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/l);let t=await this.model.generate({inputs:e.input_features,...o});n===`word`?(e.tokens=t.sequences.tolist()[0],e.token_timestamps=t.token_timestamps.tolist()[0].map(e=>(0,u.round)(e,2))):e.tokens=t[0].tolist(),e.stride=e.stride.map(e=>e/d)}let[s,f]=this.tokenizer._decode_asr(t,{time_precision:c,return_timestamps:n,force_full_sequences:i});p.push({text:s,...f})}return s?p[0]:p}async _call_moonshine(e,t){let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await h(e,r),a=[];for(let e of i){let n=await this.processor(e),i=Math.floor(e.length/r)*6,o=await this.model.generate({max_new_tokens:i,...t,...n}),s=this.processor.batch_decode(o,{skip_special_tokens:!0})[0];a.push({text:s})}return n?a[0]:a}}class ne extends _{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e),r=await m(e),{pixel_values:i}=await this.processor(r),a=[];for(let e of i){e.dims=[1,...e.dims];let n=await this.model.generate({inputs:e,...t}),r=this.tokenizer.batch_decode(n,{skip_special_tokens:!0}).map(e=>({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}}class re extends _{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=await m(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a=this.model.config.id2label,o=[];for(let e of i.logits){let n=await(0,f.topk)(new f.Tensor(`float32`,(0,u.softmax)(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist(),s=i.map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(s)}return Array.isArray(e)?o:o[0]}}class j extends _{constructor(e){super(e),this.subtasks_mapping={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`}}async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){let s=Array.isArray(e);if(s&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let c=await m(e),l=c.map(e=>[e.height,e.width]),u=await this.processor(c),{inputNames:d,outputNames:f}=this.model.sessions.model;if(!d.includes(`pixel_values`)){if(d.length!==1)throw Error(`Expected a single input name, but got ${d.length} inputs: ${d}.`);let e=d[0];if(e in u)throw Error(`Input name ${e} already exists in the inputs.`);u[e]=u.pixel_values}let h=await this.model(u),g=null;if(o!==null)g=this.subtasks_mapping[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(this.subtasks_mapping))if(t in this.processor.image_processor){g=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let _=this.model.config.id2label,v=[];if(o)if(o===`panoptic`||o===`instance`){let e=g(h,t,n,r,i,a??l)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;nt<-e||t>1+e)&&i.sigmoid_();let a=await p.RawImage.fromTensor(i.mul_(255).to(`uint8`)).resize(r[1],r[0]);v.push({label:null,score:null,mask:a})}}return v}}class ie extends j{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e);if(n&&e.length!==1)throw Error(`Background removal pipeline currently only supports a batch size of 1.`);let r=await m(e),i=await super._call(e,t),a=r.map((e,t)=>{let n=e.clone();return n.putAlpha(i[t].mask),n});return a}}class ae extends _{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await m(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),c=await this.model({...o,pixel_values:s}),l=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>(0,u.softmax)(e.data),d=[];for(let e of c.logits_per_image){let n=l(e),r=[...n].map((e,n)=>({score:e,label:t[n]}));r.sort((e,t)=>t.score-e.score),d.push(r)}return r?d:d[0]}}class oe extends _{constructor(e){super(e)}async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await m(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),u=this.model.config.id2label,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:g(t,!n)})));return r?d:d[0]}}class se extends _{constructor(e){super(e)}async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await m(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:g(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:g(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}}class ce extends _{constructor(e){super(e)}async _call(e,t,n={}){let r=(await m(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...n}),c=this.tokenizer.batch_decode(s)[0],l=c.match(/(.*?)<\/s_answer>/),u=null;return l&&l.length>=2&&(u=l[1].trim()),[{answer:u}]}}class le extends _{constructor(t){super(t),e.defineProperty(this,`DEFAULT_VOCODER_ID`,`Xenova/speecht5_hifigan`),this.vocoder=t.vocoder??null}async _call(e,{speaker_embeddings:t=null}={}){return this.processor?this._call_text_to_spectrogram(e,{speaker_embeddings:t}):this._call_text_to_waveform(e)}async _call_text_to_waveform(e){let t=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:n}=await this.model(t),r=this.model.config.sampling_rate;return new d.RawAudio(n.data,r)}async _call_text_to_spectrogram(e,{speaker_embeddings:t}){if(this.vocoder||(console.log(`No vocoder specified, using default HifiGan vocoder.`),this.vocoder=await a.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:`fp32`})),(typeof t==`string`||t instanceof URL)&&(t=new Float32Array(await(await fetch(t)).arrayBuffer())),t instanceof Float32Array)t=new f.Tensor(`float32`,t,[1,t.length]);else if(!(t instanceof f.Tensor))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");let{input_ids:n}=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:r}=await this.model.generate_speech(n,t,{vocoder:this.vocoder}),i=this.processor.feature_extractor.config.sampling_rate;return new d.RawAudio(r.data,i)}}class M extends _{constructor(e){super(e)}async _call(e){let t=await m(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(p.RawImage.fromTensor(t))}return i.length>1?i:i[0]}}class N extends _{constructor(e){super(e)}async _call(e){let t=await m(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;e1?i:i[0]}}let ue=Object.freeze({"text-classification":{tokenizer:i.AutoTokenizer,pipeline:v,model:a.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-finetuned-sst-2-english`},type:`text`},"token-classification":{tokenizer:i.AutoTokenizer,pipeline:y,model:a.AutoModelForTokenClassification,default:{model:`Xenova/bert-base-multilingual-cased-ner-hrl`},type:`text`},"question-answering":{tokenizer:i.AutoTokenizer,pipeline:b,model:a.AutoModelForQuestionAnswering,default:{model:`Xenova/distilbert-base-cased-distilled-squad`},type:`text`},"fill-mask":{tokenizer:i.AutoTokenizer,pipeline:x,model:a.AutoModelForMaskedLM,default:{model:`Xenova/bert-base-uncased`},type:`text`},summarization:{tokenizer:i.AutoTokenizer,pipeline:C,model:a.AutoModelForSeq2SeqLM,default:{model:`Xenova/distilbart-cnn-6-6`},type:`text`},translation:{tokenizer:i.AutoTokenizer,pipeline:w,model:a.AutoModelForSeq2SeqLM,default:{model:`Xenova/t5-small`},type:`text`},"text2text-generation":{tokenizer:i.AutoTokenizer,pipeline:S,model:a.AutoModelForSeq2SeqLM,default:{model:`Xenova/flan-t5-small`},type:`text`},"text-generation":{tokenizer:i.AutoTokenizer,pipeline:E,model:a.AutoModelForCausalLM,default:{model:`Xenova/gpt2`},type:`text`},"zero-shot-classification":{tokenizer:i.AutoTokenizer,pipeline:D,model:a.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-mnli`},type:`text`},"audio-classification":{pipeline:A,model:a.AutoModelForAudioClassification,processor:o.AutoProcessor,default:{model:`Xenova/wav2vec2-base-superb-ks`},type:`audio`},"zero-shot-audio-classification":{tokenizer:i.AutoTokenizer,pipeline:ee,model:a.AutoModel,processor:o.AutoProcessor,default:{model:`Xenova/clap-htsat-unfused`},type:`multimodal`},"automatic-speech-recognition":{tokenizer:i.AutoTokenizer,pipeline:te,model:[a.AutoModelForSpeechSeq2Seq,a.AutoModelForCTC],processor:o.AutoProcessor,default:{model:`Xenova/whisper-tiny.en`},type:`multimodal`},"text-to-audio":{tokenizer:i.AutoTokenizer,pipeline:le,model:[a.AutoModelForTextToWaveform,a.AutoModelForTextToSpectrogram],processor:[o.AutoProcessor,null],default:{model:`Xenova/speecht5_tts`},type:`text`},"image-to-text":{tokenizer:i.AutoTokenizer,pipeline:ne,model:a.AutoModelForVision2Seq,processor:o.AutoProcessor,default:{model:`Xenova/vit-gpt2-image-captioning`},type:`multimodal`},"image-classification":{pipeline:re,model:a.AutoModelForImageClassification,processor:o.AutoProcessor,default:{model:`Xenova/vit-base-patch16-224`},type:`multimodal`},"image-segmentation":{pipeline:j,model:[a.AutoModelForImageSegmentation,a.AutoModelForSemanticSegmentation,a.AutoModelForUniversalSegmentation],processor:o.AutoProcessor,default:{model:`Xenova/detr-resnet-50-panoptic`},type:`multimodal`},"background-removal":{pipeline:ie,model:[a.AutoModelForImageSegmentation,a.AutoModelForSemanticSegmentation,a.AutoModelForUniversalSegmentation],processor:o.AutoProcessor,default:{model:`Xenova/modnet`},type:`image`},"zero-shot-image-classification":{tokenizer:i.AutoTokenizer,pipeline:ae,model:a.AutoModel,processor:o.AutoProcessor,default:{model:`Xenova/clip-vit-base-patch32`},type:`multimodal`},"object-detection":{pipeline:oe,model:a.AutoModelForObjectDetection,processor:o.AutoProcessor,default:{model:`Xenova/detr-resnet-50`},type:`multimodal`},"zero-shot-object-detection":{tokenizer:i.AutoTokenizer,pipeline:se,model:a.AutoModelForZeroShotObjectDetection,processor:o.AutoProcessor,default:{model:`Xenova/owlvit-base-patch32`},type:`multimodal`},"document-question-answering":{tokenizer:i.AutoTokenizer,pipeline:ce,model:a.AutoModelForDocumentQuestionAnswering,processor:o.AutoProcessor,default:{model:`Xenova/donut-base-finetuned-docvqa`},type:`multimodal`},"image-to-image":{pipeline:M,model:a.AutoModelForImageToImage,processor:o.AutoProcessor,default:{model:`Xenova/swin2SR-classical-sr-x2-64`},type:`image`},"depth-estimation":{pipeline:N,model:a.AutoModelForDepthEstimation,processor:o.AutoProcessor,default:{model:`Xenova/dpt-large`},type:`image`},"feature-extraction":{tokenizer:i.AutoTokenizer,pipeline:O,model:a.AutoModel,default:{model:`Xenova/all-MiniLM-L6-v2`},type:`text`},"image-feature-extraction":{processor:o.AutoProcessor,pipeline:k,model:[a.AutoModelForImageFeatureExtraction,a.AutoModel],default:{model:`Xenova/vit-base-patch16-224-in21k`},type:`image`}}),de=Object.freeze({"sentiment-analysis":`text-classification`,ner:`token-classification`,asr:`automatic-speech-recognition`,"text-to-speech":`text-to-audio`,embeddings:`feature-extraction`});async function fe(e,t=null,{progress_callback:n=null,config:r=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,device:s=null,dtype:c=null,subfolder:u=`onnx`,use_external_data_format:d=null,model_file_name:f=null,session_options:p={}}={}){e=de[e]??e;let m=ue[e.split(`_`,1)[0]];if(!m)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(ue)}]`);t||(t=m.default.model,console.log(`No model specified. Using default model: "${t}".`));let h={progress_callback:n,config:r,cache_dir:i,local_files_only:a,revision:o,device:s,dtype:c,subfolder:u,use_external_data_format:d,model_file_name:f,session_options:p},g=new Map([[`tokenizer`,m.tokenizer],[`model`,m.model],[`processor`,m.processor]]),_=await P(g,t,h);_.task=e,(0,l.dispatchCallback)(n,{status:`ready`,task:e,model:t});let v=m.pipeline;return new v(_)}async function P(e,t,n){let r=Object.create(null),i=[];for(let[a,o]of e.entries()){if(!o)continue;let e;e=Array.isArray(o)?new Promise(async(e,r)=>{let i;for(let c of o){if(c===null){e(null);return}try{e(await c.from_pretrained(t,n));return}catch(e){var a,s;if((a=e.message)?.includes(`Unsupported model type`))i=e;else if((s=e.message)?.includes(`Could not locate file`))i=e;else{r(e);return}}}r(i)}):o.from_pretrained(t,n),r[a]=e,i.push(e)}await Promise.all(i);for(let[e,t]of Object.entries(r))r[e]=await t;return r}},"./src/tokenizers.js":(t,n,r)=>{r.r(n),r.d(n,{AlbertTokenizer:()=>He,AutoTokenizer:()=>Nt,BartTokenizer:()=>tt,BertTokenizer:()=>Ve,BlenderbotSmallTokenizer:()=>Dt,BlenderbotTokenizer:()=>Et,BloomTokenizer:()=>at,CLIPTokenizer:()=>St,CamembertTokenizer:()=>Xe,CodeGenTokenizer:()=>xt,CodeLlamaTokenizer:()=>ct,CohereTokenizer:()=>jt,ConvBertTokenizer:()=>qe,DebertaTokenizer:()=>We,DebertaV2Tokenizer:()=>Ge,DistilBertTokenizer:()=>Ye,ElectraTokenizer:()=>Qe,EsmTokenizer:()=>pt,FalconTokenizer:()=>dt,GPT2Tokenizer:()=>et,GPTNeoXTokenizer:()=>ft,GemmaTokenizer:()=>ht,Grok1Tokenizer:()=>gt,HerbertTokenizer:()=>Ke,LlamaTokenizer:()=>st,M2M100Tokenizer:()=>yt,MBart50Tokenizer:()=>rt,MBartTokenizer:()=>nt,MPNetTokenizer:()=>ut,MarianTokenizer:()=>wt,MgpstrTokenizer:()=>Mt,MobileBertTokenizer:()=>Ue,NllbTokenizer:()=>vt,NougatTokenizer:()=>kt,PreTrainedTokenizer:()=>B,Qwen2Tokenizer:()=>mt,RoFormerTokenizer:()=>Je,RobertaTokenizer:()=>it,SiglipTokenizer:()=>Ct,SpeechT5Tokenizer:()=>Ot,SqueezeBertTokenizer:()=>V,T5Tokenizer:()=>$e,TokenizerModel:()=>O,VitsTokenizer:()=>At,Wav2Vec2CTCTokenizer:()=>Tt,WhisperTokenizer:()=>bt,XLMRobertaTokenizer:()=>lt,XLMTokenizer:()=>Ze,is_chinese_char:()=>b});var i=r( +/*! ./utils/generic.js */ +`./src/utils/generic.js`),a=r( +/*! ./utils/core.js */ +`./src/utils/core.js`),o=r( +/*! ./utils/hub.js */ +`./src/utils/hub.js`),s=r( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),c=r( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),l=r( +/*! ./utils/data-structures.js */ +`./src/utils/data-structures.js`),u=r( +/*! @huggingface/jinja */ +`./node_modules/@huggingface/jinja/dist/index.js`),d=r( +/*! ./models/whisper/common_whisper.js */ +`./src/models/whisper/common_whisper.js`);async function f(e,t){let n=await Promise.all([(0,o.getModelJSON)(e,`tokenizer.json`,!0,t),(0,o.getModelJSON)(e,`tokenizer_config.json`,!0,t)]);return t.legacy!==null&&(n[1].legacy=t.legacy),n}function p(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return r=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}function x(e,t,n){let r=[],i=0;for(;ithis.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class k extends O{constructor(e){super(e),this.tokens_to_ids=h(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){let t=[];for(let n of e){let e=[...n];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}}class A extends O{constructor(e,t){super(e);let n=e.vocab.length;this.vocab=Array(n),this.scores=Array(n);for(let t=0;t[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,s.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new l.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.chars,n=1,r=0;for(;r{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),te=(0,a.reverseDictionary)(ee);class ne extends O{constructor(e){super(e),this.tokens_to_ids=h(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;let t=Array.isArray(e.merges[0]);this.merges=t?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new l.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new l.PriorityQueue((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):t.push(this.unk_token)}else t.push(this.unk_token)}return t}}class re extends O{constructor(e,t){super(e),this.tokens_to_ids=h(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}}class j extends i.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new P(e);case`Precompiled`:return new z(e);case`Sequence`:return new fe(e);case`Replace`:return new ie(e);case`NFC`:return new oe(e);case`NFD`:return new se(e);case`NFKC`:return new ce(e);case`NFKD`:return new le(e);case`Strip`:return new M(e);case`StripAccents`:return new N(e);case`Lowercase`:return new ue(e);case`Prepend`:return new de(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error(`normalize should be implemented in subclass.`)}_call(e){return this.normalize(e)}}class ie extends j{normalize(e){let t=m(this.config.pattern);return t===null?e:e.replaceAll(t,this.config.content)}}class ae extends j{constructor(...t){super(...t),e.defineProperty(this,`form`,void 0)}normalize(e){return e=e.normalize(this.form),e}}class oe extends ae{constructor(...t){super(...t),e.defineProperty(this,`form`,`NFC`)}}class se extends ae{constructor(...t){super(...t),e.defineProperty(this,`form`,`NFD`)}}class ce extends ae{constructor(...t){super(...t),e.defineProperty(this,`form`,`NFKC`)}}class le extends ae{constructor(...t){super(...t),e.defineProperty(this,`form`,`NFKD`)}}class M extends j{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class N extends j{normalize(e){return e=v(e),e}}class ue extends j{normalize(e){return e=e.toLowerCase(),e}}class de extends j{normalize(e){return e=this.config.prepend+e,e}}class fe extends j{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>j.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class P extends j{_tokenize_chinese_chars(e){let t=[];for(let n=0;nthis.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class I extends F{constructor(e){super(),this.pattern=RegExp(`[^\\s${C}]+|[${C}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class L extends F{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=ee,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e);let n=this.use_regex?e.match(this.pattern)||[]:[e];return n.map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}}class pe extends F{constructor(e){super(),this.config=e,this.pattern=m(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){var n;return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:(n=this.config.behavior)?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):p(e,this.pattern)}}class me extends F{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${C}]+|[${C}]+`,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class he extends F{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class ge extends i.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new ve(e);case`ByteLevel`:return new ye(e);case`RobertaProcessing`:return new R(e);case`BertProcessing`:return new _e(e);case`Sequence`:return new be(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error(`post_process should be implemented in subclass.`)}_call(e,...t){return this.post_process(e,...t)}}class _e extends ge{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:n=!0}={}){n&&(e=(0,a.mergeArrays)([this.cls],e,[this.sep]));let r=Array(e.length).fill(0);if(t!==null){let i=n&&this instanceof R?[this.sep]:[],o=n?[this.sep]:[];e=(0,a.mergeArrays)(e,i,t,o),r=(0,a.mergeArrays)(r,Array(t.length+i.length+o.length).fill(1))}return{tokens:e,token_type_ids:r}}}class R extends _e{}class ve extends ge{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:n=!0}={}){let r=t===null?this.single:this.pair,i=[],o=[];for(let s of r)`SpecialToken`in s?n&&(i.push(s.SpecialToken.id),o.push(s.SpecialToken.type_id)):`Sequence`in s&&(s.Sequence.id===`A`?(i=(0,a.mergeArrays)(i,e),o=(0,a.mergeArrays)(o,Array(e.length).fill(s.Sequence.type_id))):s.Sequence.id===`B`&&(i=(0,a.mergeArrays)(i,t),o=(0,a.mergeArrays)(o,Array(t.length).fill(s.Sequence.type_id))));return{tokens:i,token_type_ids:o}}}class ye extends ge{post_process(e,t=null){return t&&(e=(0,a.mergeArrays)(e,t)),{tokens:e}}}class be extends ge{constructor(e){super(e),this.processors=e.processors.map(e=>ge.fromConfig(e))}post_process(e,t=null,n={}){let r;for(let i of this.processors)if(i instanceof ye){let n=i.post_process(e);if(e=n.tokens,t){let e=i.post_process(t);t=e.tokens}}else{let a=i.post_process(e,t,n);e=a.tokens,r=a.token_type_ids}return{tokens:e,token_type_ids:r}}}class xe extends i.Callable{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(e===null)return null;switch(e.type){case`WordPiece`:return new Ee(e);case`Metaspace`:return new Ne(e);case`ByteLevel`:return new De(e);case`Replace`:return new Se(e);case`ByteFallback`:return new Ce(e);case`Fuse`:return new we(e);case`Strip`:return new Te(e);case`Sequence`:return new ke(e);case`CTC`:return new Oe(e);case`BPEDecoder`:return new Ae(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class Se extends xe{decode_chain(e){let t=m(this.config.pattern);return t===null?e:e.map(e=>e.replaceAll(t,this.config.content))}}class Ce extends xe{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],n=[];for(let r of e){let e=null;if(r.length===6&&r.startsWith(`<0x`)&&r.endsWith(`>`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}}class we extends xe{decode_chain(e){return[e.join(``)]}}class Te extends xe{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n(t!==0&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,``):` `+e),this.cleanup&&(e=_(e)),e))}}class De extends xe{constructor(e){super(e),this.byte_decoder=te,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e])),r=this.text_decoder.decode(n);return r}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}}class Oe extends xe{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token),r=n.join(``);return this.cleanup&&(r=_(r).replaceAll(this.word_delimiter_token,` `).trim()),r}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class ke extends xe{constructor(e){super(e),this.decoders=e.decoders.map(e=>xe.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class Ae extends xe{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,n)=>t.replaceAll(this.suffix,n===e.length-1?``:` `))}}class je extends xe{decode_chain(e){let t=``;for(let n=1;ne.normalize(`NFKC`)).join(`~`)}else e=e.normalize(`NFKC`);return e}}class Pe extends F{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>F.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n.pre_tokenize(e,t),[e])}}class Fe extends F{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class Ie extends F{constructor(e){super()}pre_tokenize_text(e,t){return S(e)}}class Le extends F{constructor(e){super(),this.config=e,this.pattern=m(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content)]}}let Re=[`bos_token`,`eos_token`,`unk_token`,`sep_token`,`pad_token`,`cls_token`,`mask_token`];function ze(e,t,n,r){for(let i of Object.keys(e)){let o=t-e[i].length,s=n(i),c=Array(o).fill(s);e[i]=r===`right`?(0,a.mergeArrays)(e[i],c):(0,a.mergeArrays)(c,e[i])}}function Be(e,t){for(let n of Object.keys(e))e[n].length=t}class B extends i.Callable{constructor(t,n){super(),e.defineProperty(this,`return_token_type_ids`,!1),e.defineProperty(this,`padding_side`,`right`),this._tokenizer_config=n,this.normalizer=j.fromConfig(t.normalizer),this.pre_tokenizer=F.fromConfig(t.pre_tokenizer),this.model=O.fromConfig(t.model,n),this.post_processor=ge.fromConfig(t.post_processor),this.decoder=xe.fromConfig(t.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(let e of t.added_tokens){let t=new D(e);this.added_tokens.push(t),this.model.tokens_to_ids.set(t.content,t.id),this.model.vocab[t.id]=t.content,t.special&&(this.special_tokens.push(t.content),this.all_special_ids.push(t.id))}if(this.additional_special_tokens=n.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_splitter=new l.DictionarySplitter(this.added_tokens.map(e=>e.content)),this.added_tokens_map=new Map(this.added_tokens.map(e=>[e.content,e])),this.mask_token=this.getToken(`mask_token`),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken(`pad_token`,`eos_token`),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken(`sep_token`),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken(`unk_token`),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken(`bos_token`),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken(`eos_token`),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=n.model_max_length,this.remove_space=n.remove_space,this.clean_up_tokenization_spaces=n.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=n.do_lowercase_and_remove_accent??!1,n.padding_side&&(this.padding_side=n.padding_side),this.legacy=!1,this.chat_template=n.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this._tokenizer_config[t];if(!e)continue;if(typeof e==`object`){if(e.__type===`AddedToken`)return e.content;throw Error(`Unknown token: ${e}`)}else return e}return null}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let s=await f(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o});return new this(...s)}_call(e,{text_pair:t=null,add_special_tokens:n=!0,padding:r=!1,truncation:i=null,max_length:a=null,return_tensor:o=!0,return_token_type_ids:l=null}={}){let u=Array.isArray(e),d;if(u){if(e.length===0)throw Error(`text array must be non-empty`);if(t!==null){if(Array.isArray(t)){if(e.length!==t.length)throw Error(`text and text_pair must have the same length`)}else throw Error(`text_pair must also be an array`);d=e.map((e,r)=>this._encode_plus(e,{text_pair:t[r],add_special_tokens:n,return_token_type_ids:l}))}else d=e.map(e=>this._encode_plus(e,{add_special_tokens:n,return_token_type_ids:l}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");d=[this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:l})]}if(a===null?a=this.model_max_length:i===null&&(r===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),a=this.model_max_length):r===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),i=!0)),r===!0&&(a=Math.min((0,s.max)(d.map(e=>e.input_ids.length))[0],a??1/0)),a=Math.min(a,this.model_max_length??1/0),r||i)for(let e=0;ea?i&&Be(d[e],a):r&&ze(d[e],a,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let f={};if(o){if(!(r&&i)&&d.some(e=>{var t;for(let n of Object.keys(e))if(e[n].length!==(t=d[0][n])?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[d.length,d[0].input_ids.length];for(let t of Object.keys(d[0]))f[t]=new c.Tensor(`int64`,BigInt64Array.from(d.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(d[0]))f[e]=d.map(t=>t[e]);if(!u)for(let e of Object.keys(f))f[e]=f[e][0]}return f}_encode_text(e){if(e===null)return null;let t=this.added_tokens_splitter.split(e);for(let e=0;e0&&(t[e-1]=t[e-1].trimEnd()),n.rstrip&&e{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=y(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t}),r=this.model(n);return r});return n}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this._tokenize_helper(e,{pair:t,add_special_tokens:n}),o=this.model.convert_tokens_to_ids(i),s={input_ids:o,attention_mask:Array(o.length).fill(1)};return(r??this.return_token_type_ids)&&a&&(s.token_type_ids=a),s}_tokenize_helper(e,{pair:t=null,add_special_tokens:n=!1}={}){let r=this._encode_text(e),i=this._encode_text(t);return this.post_processor?this.post_processor(r,i,{add_special_tokens:n}):{tokens:(0,a.mergeArrays)(r??[],i??[])}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenize_helper(e,{pair:t,add_special_tokens:n}).tokens}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).input_ids}batch_decode(e,t={}){return e instanceof c.Tensor&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof c.Tensor&&(e=g(e)),!Array.isArray(e)||e.length===0||!(0,a.isIntegralNumber)(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){let r=this.model.convert_ids_to_tokens(e);t&&(r=r.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(r):r.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix,` `),t&&(i=i.trim())),(n??this.clean_up_tokenization_spaces)&&(i=_(i)),i}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,{tools:t=null,documents:n=null,chat_template:r=null,add_generation_prompt:i=!1,tokenize:a=!0,padding:o=!1,truncation:s=!1,max_length:c=null,return_tensor:l=!0,return_dict:d=!1,tokenizer_kwargs:f={},...p}={}){if(r=this.get_chat_template({chat_template:r,tools:t}),typeof r!=`string`)throw Error(`chat_template must be a string, but got ${typeof r}`);let m=this._compiled_template_cache.get(r);m===void 0&&(m=new u.Template(r),this._compiled_template_cache.set(r,m));let h=Object.create(null);for(let e of Re){let t=this.getToken(e);t&&(h[e]=t)}let g=m.render({messages:e,add_generation_prompt:i,tools:t,documents:n,...h,...p});if(a){let e=this._call(g,{add_special_tokens:!1,padding:o,truncation:s,max_length:c,return_tensor:l,...f});return d?e:e.input_ids}return g}}class Ve extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class He extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Ue extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class V extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class We extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Ge extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Ke extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class qe extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Je extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class Ye extends B{}class Xe extends B{}class Ze extends B{constructor(t,n){super(t,n),e.defineProperty(this,`return_token_type_ids`,!0),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class Qe extends B{constructor(...t){super(...t),e.defineProperty(this,`return_token_type_ids`,!0)}}class $e extends B{}class et extends B{}class tt extends B{}class nt extends B{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return _t(this,e,t,n)}}class rt extends nt{}class it extends B{}class at extends B{}let ot=`▁`;class st extends B{constructor(t,n){super(t,n),e.defineProperty(this,`padding_side`,`left`),this.legacy=n.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new Me({replacement:ot,add_prefix_space:!0,prepend_scheme:`first`}))}_encode_text(e){if(e===null)return null;if(this.legacy||e.length===0)return super._encode_text(e);let t=super._encode_text(ot+e.replaceAll(ot,` `));return t.length>1&&t[0]===ot&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}}class ct extends B{}class lt extends B{}class ut extends B{}class dt extends B{}class ft extends B{}class pt extends B{}class mt extends B{}class ht extends B{}class gt extends B{}function _t(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(a)])[0],e._call(t,n)}class vt extends B{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return _t(this,e,t,n)}}class yt extends B{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return _t(this,e,t,n)}}class bt extends B{get timestamp_begin(){return this.model.convert_tokens_to_ids([`<|notimestamps|>`])[0]+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,o=t===`word`;function c(){return{language:a,timestamp:[null,null],text:``}}let l=[],u=c(),f=0,p=this.timestamp_begin,m=1500,h=p+m,g=[],_=[],v=!1,y=null,b=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=o?n.token_timestamps:null,m=null,x=p;if(`stride`in n){let[t,i,a]=n.stride;if(f-=i,y=t-a,i&&(x=i/r+p),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=p){if(m!==null&&(n-p)*r=p&&y<=h){let e=(y-p)*r+f,t=(0,s.round)(e,2);if(m!==null&&y>=m)v=!0;else if(v||g.length>0&&y0?(g.push(S),o&&_.push(C)):g.every(e=>e.length===0)&&(u=c(),g=[],S=[],_=[],C=[])}if(g.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(g,_),r=this.decode(e);u.text=r,o&&(u.words=this.collateWordTimestamps(e,n,a)),l.push(u)}let x=Object.create(null),S=l.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n]<=t[c][m+n]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=`�`,r=[],i=[],a=[],o=[],s=[],c=0;for(let l=0;l=this.model.tokens_to_ids.get(`<|endoftext|>`),f=c.startsWith(` `),p=c.trim(),m=s.test(p);if(d||f||m||i.length===0)i.push(c),a.push(l),o.push(u);else{let e=i.length-1;i[e]+=c,a[e].push(...l),o[e].push(...u)}}return[i,a,o]}mergePunctuations(e,t,n,r,i){let o=structuredClone(e),s=structuredClone(t),c=structuredClone(n),l=o.length-2,u=o.length-1;for(;l>=0;)o[l].startsWith(` `)&&r.includes(o[l].trim())?(o[u]=o[l]+o[u],s[u]=(0,a.mergeArrays)(s[l],s[u]),c[u]=(0,a.mergeArrays)(c[l],c[u]),o[l]=``,s[l]=[],c[l]=[]):u=l,--l;for(l=0,u=1;ue),s.filter(e=>e.length>0),c.filter(e=>e.length>0)]}}class xt extends B{}class St extends B{}class Ct extends B{}class wt extends B{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,a.mergeArrays)([e],super._encode_text(t))}}}class Tt extends B{}class Et extends B{}class Dt extends B{}class Ot extends B{}class kt extends B{}class At extends B{constructor(e,t){super(e,t),this.decoder=new je({})}}class jt extends B{}class Mt extends B{}class Nt{static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){var s;let[c,l]=await f(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o}),u=(s=l.tokenizer_class)?.replace(/Fast$/,``)??`PreTrainedTokenizer`,d=this.TOKENIZER_CLASS_MAPPING[u];return d||(console.warn(`Unknown tokenizer class "${u}", attempting to construct from base class.`),d=B),new d(c,l)}}e.defineProperty(Nt,`TOKENIZER_CLASS_MAPPING`,{T5Tokenizer:$e,DistilBertTokenizer:Ye,CamembertTokenizer:Xe,DebertaTokenizer:We,DebertaV2Tokenizer:Ge,BertTokenizer:Ve,HerbertTokenizer:Ke,ConvBertTokenizer:qe,RoFormerTokenizer:Je,XLMTokenizer:Ze,ElectraTokenizer:Qe,MobileBertTokenizer:Ue,SqueezeBertTokenizer:V,AlbertTokenizer:He,GPT2Tokenizer:et,BartTokenizer:tt,MBartTokenizer:nt,MBart50Tokenizer:rt,RobertaTokenizer:it,WhisperTokenizer:bt,CodeGenTokenizer:xt,CLIPTokenizer:St,SiglipTokenizer:Ct,MarianTokenizer:wt,BloomTokenizer:at,NllbTokenizer:vt,M2M100Tokenizer:yt,LlamaTokenizer:st,CodeLlamaTokenizer:ct,XLMRobertaTokenizer:lt,MPNetTokenizer:ut,FalconTokenizer:dt,GPTNeoXTokenizer:ft,EsmTokenizer:pt,Wav2Vec2CTCTokenizer:Tt,BlenderbotTokenizer:Et,BlenderbotSmallTokenizer:Dt,SpeechT5Tokenizer:Ot,NougatTokenizer:kt,VitsTokenizer:At,Qwen2Tokenizer:mt,GemmaTokenizer:ht,Grok1Tokenizer:gt,CohereTokenizer:jt,MgpstrTokenizer:Mt,PreTrainedTokenizer:B})},"./src/utils/audio.js":(e,t,n)=>{n.r(t),n.d(t,{RawAudio:()=>O,hamming:()=>f,hanning:()=>d,mel_filter_bank:()=>y,read_audio:()=>l,spectrogram:()=>w,window_function:()=>T});var r=n( +/*! ./hub.js */ +`./src/utils/hub.js`),i=n( +/*! ./maths.js */ +`./src/utils/maths.js`),a=n( +/*! ./core.js */ +`./src/utils/core.js`),o=n( +/*! ../env.js */ +`./src/env.js`),s=n( +/*! fs */ +`?7a2c`),c=n( +/*! ./tensor.js */ +`./src/utils/tensor.js`);async function l(e,t){if(typeof AudioContext>`u`)throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");let n=await(await(0,r.getFile)(e)).arrayBuffer(),i=new AudioContext({sampleRate:t});t===void 0&&console.warn(`No sampling rate provided, using default of ${i.sampleRate}Hz.`);let a=await i.decodeAudioData(n),o;if(a.numberOfChannels===2){let e=Math.sqrt(2),t=a.getChannelData(0),n=a.getChannelData(1);o=new Float32Array(t.length);for(let r=0;r2595*Math.log10(1+e/700),kaldi:e=>1127*Math.log(1+e/700),slaney:(e,t=1e3,n=15,r=27/Math.log(6.4))=>e>=t?n+Math.log(e/t)*r:3*e/200};function m(e,t=`htk`){let n=p[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}let h={htk:e=>700*(10**(e/2595)-1),kaldi:e=>700*(Math.exp(e/1127)-1),slaney:(e,t=1e3,n=15,r=Math.log(6.4)/27)=>e>=n?t*Math.exp(r*(e-n)):200*e/3};function g(e,t=`htk`){let n=h[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}function _(e,t){let n=Float64Array.from({length:t.length-1},(e,n)=>t[n+1]-t[n]),r=Array.from({length:e.length},()=>Array(t.length));for(let n=0;nArray(e.length));for(let t=0;te+r*n)}function y(e,t,n,r,i,a=null,o=`htk`,s=!1){if(a!==null&&a!==`slaney`)throw Error(`norm must be one of null or "slaney"`);if(e<2)throw Error(`Require num_frequency_bins: ${e} >= 2`);if(n>r)throw Error(`Require min_frequency: ${n} <= max_frequency: ${r}`);let c=m(n,o),l=m(r,o),u=v(c,l,t+2),d=g(u,o),f;if(s){let t=i/((e-1)*2);f=m(Float64Array.from({length:e},(e,n)=>n*t),o),d=u}else f=v(0,Math.floor(i/2),e);let p=_(f,d);if(a!==null&&a===`slaney`)for(let n=0;na)throw Error(`frame_length (${n}) may not be larger than fft_length (${a})`);if(E!==n)throw Error(`Length of the window (${E}) must equal frame_length (${n})`);if(r<=0)throw Error(`hop_length must be greater than zero`);if(o===null&&f!==null)throw Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(s){if(l!==`reflect`)throw Error(`pad_mode="${l}" not implemented yet.`);let t=Math.floor((a-1)/2)+1;e=b(e,t,t)}let D=Math.floor(1+Math.floor((e.length-n)/r));y!==null&&DD?w&&(A=x):A=k=x);let ee=new i.FFT(a),te=new Float64Array(a),ne=new Float64Array(ee.outputBufferSize),re=new Float32Array(O*A);for(let i=0;i=1;--e)te[e]-=d*te[e-1];te[0]*=1-d}for(let e=0;ee**.85);break;default:throw Error(`Unknown window type ${t}.`)}if(n&&(o=o.subarray(0,e)),r===null)return o;if(e>r)throw Error(`Length of the window (${e}) may not be larger than frame_length (${r})`);return o}function E(e,t){let n=44,r=new ArrayBuffer(n+e.length*4),i=new DataView(r);D(i,0,`RIFF`),i.setUint32(4,36+e.length*4,!0),D(i,8,`WAVE`),D(i,12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,3,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*4,!0),i.setUint16(32,4,!0),i.setUint16(34,32,!0),D(i,36,`data`),i.setUint32(40,e.length*4,!0);for(let t=0;t{let n=await t.arrayBuffer();s.writeFileSync(e,Buffer.from(n))};else throw Error(`Unable to save because filesystem is disabled in this environment.`);await t(e,this.toBlob())}}},"./src/utils/constants.js":(e,t,n)=>{n.r(t),n.d(t,{CHAT_TEMPLATE_NAME:()=>c,CONFIG_NAME:()=>i,FEATURE_EXTRACTOR_NAME:()=>a,GENERATION_CONFIG_NAME:()=>l,GITHUB_ISSUE_URL:()=>r,IMAGE_PROCESSOR_NAME:()=>o,PROCESSOR_NAME:()=>s});let r=`https://github.com/huggingface/transformers.js/issues/new/choose`,i=`config.json`,a=`preprocessor_config.json`,o=a,s=`processor_config.json`,c=`chat_template.json`,l=`generation_config.json`},"./src/utils/core.js":(e,t,n)=>{n.r(t),n.d(t,{calculateDimensions:()=>l,calculateReflectOffset:()=>p,count:()=>_,dispatchCallback:()=>r,escapeRegExp:()=>a,isIntegralNumber:()=>s,isNullishDimension:()=>c,isTypedArray:()=>o,len:()=>g,mergeArrays:()=>d,pick:()=>h,pop:()=>u,product:()=>f,reverseDictionary:()=>i,saveBlob:()=>m});function r(e,t){e&&e(t)}function i(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[t,e]))}function a(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function o(e){var t;return(e==null||(t=e.prototype)==null||(t=t.__proto__)==null||(t=t.constructor)==null?void 0:t.name)===`TypedArray`}function s(e){return Number.isInteger(e)||typeof e==`bigint`}function c(e){return e==null||e===-1}function l(e){let t=[],n=e;for(;Array.isArray(n);)t.push(n.length),n=n[0];return t}function u(e,t,n=void 0){let r=e[t];if(r!==void 0)return delete e[t],r;if(n===void 0)throw Error(`Key ${t} does not exist in object.`);return n}function d(...e){return Array.prototype.concat.apply([],e)}function f(...e){return e.reduce((e,t)=>e.flatMap(e=>t.map(t=>[e,t])))}function p(e,t){return Math.abs((e+t)%(2*t)-t)}function m(e,t){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),r.remove(),URL.revokeObjectURL(n)}function h(e,t){return Object.assign({},...t.map(t=>{if(e[t]!==void 0)return{[t]:e[t]}}))}function g(e){let t=0;for(let n of e)++t;return t}function _(e,t){let n=0;for(let r of e)r===t&&++n;return n}},"./src/utils/data-structures.js":(e,t,n)=>{n.r(t),n.d(t,{CharTrie:()=>i,DictionarySplitter:()=>c,LRUCache:()=>l,PriorityQueue:()=>r,TokenLattice:()=>o});class r{constructor(e=(e,t)=>e>t,t=1/0){this._heap=[],this._comparator=e,this._maxSize=t}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...e){return this.extend(e)}extend(e){for(let t of e)if(this.size0&&this._swap(0,t),this._heap.pop(),this._siftDown(),e}replace(e){let t=this.peek();return this._heap[0]=e,this._siftDown(),t}_parent(e){return(e+1>>>1)-1}_left(e){return(e<<1)+1}_right(e){return e+1<<1}_greater(e,t){return this._comparator(this._heap[e],this._heap[t])}_swap(e,t){let n=this._heap[e];this._heap[e]=this._heap[t],this._heap[t]=n}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(e){for(;e>0&&this._greater(e,this._parent(e));)this._swap(e,this._parent(e)),e=this._parent(e)}_siftDown(){let e=0;for(;this._left(e)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);let r=new s(this.bosTokenId,0,0,0,0),i=new s(this.eosTokenId,1,this.len,0,0);this.nodes.push(r.clone()),this.nodes.push(i.clone()),this.beginNodes[this.len].push(i),this.endNodes[0].push(r)}insert(e,t,n,r){let i=this.nodes.length,a=new s(r,i,e,t,n);this.beginNodes[e].push(a),this.endNodes[e+t].push(a),this.nodes.push(a)}viterbi(){let e=this.len,t=0;for(;t<=e;){if(this.beginNodes[t].length==0)return[];for(let e of this.beginNodes[t]){e.prev=null;let n=0,r=null;for(let i of this.endNodes[t]){let t=i.backtraceScore+e.score;(r===null||t>n)&&(r=i.clone(),n=t)}if(r!==null)e.prev=r,e.backtraceScore=n;else return[]}++t}let n=[],r=this.beginNodes[e][0],i=r.prev;if(i===null)return[];let a=i.clone();for(;a.prev!==null;){n.push(a.clone());let e=a.clone();a=e.prev.clone()}return n.reverse(),n}piece(e){return this.chars.slice(e.pos,e.pos+e.length).join(``)}tokens(){let e=this.viterbi();return e.map(e=>this.piece(e))}tokenIds(){let e=this.viterbi();return e.map(e=>e.tokenId)}}class s{constructor(e,t,n,r,i){this.tokenId=e,this.nodeId=t,this.pos=n,this.length=r,this.score=i,this.prev=null,this.backtraceScore=0}clone(){let e=new s(this.tokenId,this.nodeId,this.pos,this.length,this.score);return e.prev=this.prev,e.backtraceScore=this.backtraceScore,e}}class c{constructor(e){this.trie=this._buildTrie(e)}_buildTrie(e){let t=Object.create(null);for(let i of e){var n,r;let e=t;for(let t=0;tr&&t.push(e.slice(r,i)),t.push(o),i+=o.length,r=i):++i}return rthis.capacity&&this.cache.delete(this.cache.keys().next().value)}clear(){this.cache.clear()}}},"./src/utils/devices.js":(e,t,n)=>{n.r(t),n.d(t,{DEVICE_TYPES:()=>r});let r=Object.freeze({auto:`auto`,gpu:`gpu`,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,webnn:`webnn`,"webnn-npu":`webnn-npu`,"webnn-gpu":`webnn-gpu`,"webnn-cpu":`webnn-cpu`})},"./src/utils/dtypes.js":(e,t,n)=>{n.r(t),n.d(t,{DATA_TYPES:()=>o,DEFAULT_DEVICE_DTYPE_MAPPING:()=>s,DEFAULT_DTYPE_SUFFIX_MAPPING:()=>c,isWebGpuFp16Supported:()=>a});var r=n( +/*! ../env.js */ +`./src/env.js`),i=n( +/*! ./devices.js */ +`./src/utils/devices.js`);let a=function(){let e;return async function(){if(e===void 0)if(!r.apis.IS_WEBGPU_AVAILABLE)e=!1;else try{let t=await navigator.gpu.requestAdapter();e=t.features.has(`shader-f16`)}catch{e=!1}return e}}(),o=Object.freeze({auto:`auto`,fp32:`fp32`,fp16:`fp16`,q8:`q8`,int8:`int8`,uint8:`uint8`,q4:`q4`,bnb4:`bnb4`,q4f16:`q4f16`}),s=Object.freeze({[i.DEVICE_TYPES.wasm]:o.q8}),c=Object.freeze({[o.fp32]:``,[o.fp16]:`_fp16`,[o.int8]:`_int8`,[o.uint8]:`_uint8`,[o.q8]:`_quantized`,[o.q4]:`_q4`,[o.q4f16]:`_q4f16`,[o.bnb4]:`_bnb4`})},"./src/utils/generic.js":(e,t,n)=>{n.r(t),n.d(t,{Callable:()=>r});let r=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}_call(...e){throw Error(`Must implement _call method in subclass`)}}},"./src/utils/hub.js":(e,t,n)=>{n.r(t),n.d(t,{MAX_EXTERNAL_DATA_CHUNKS:()=>s,getFile:()=>p,getModelFile:()=>v,getModelJSON:()=>y});var r=n( +/*! fs */ +`?7a2c`),i=n( +/*! path */ +`?a42a`),a=n( +/*! ../env.js */ +`./src/env.js`),o=n( +/*! ./core.js */ +`./src/utils/core.js`);let s=100,c={txt:`text/plain`,html:`text/html`,css:`text/css`,js:`text/javascript`,json:`application/json`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`};class l{constructor(e){if(this.filePath=e,this.headers=new Headers,this.exists=r.existsSync(e),this.exists){this.status=200,this.statusText=`OK`;let t=r.statSync(e);this.headers.set(`content-length`,t.size.toString()),this.updateContentType();let n=r.createReadStream(e);this.body=new ReadableStream({start(e){n.on(`data`,t=>e.enqueue(t)),n.on(`end`,()=>e.close()),n.on(`error`,t=>e.error(t))},cancel(){n.destroy()}})}else this.status=404,this.statusText=`Not Found`,this.body=null}updateContentType(){let e=this.filePath.toString().split(`.`).pop().toLowerCase();this.headers.set(`content-type`,c[e]??`application/octet-stream`)}clone(){let e=new l(this.filePath);return e.exists=this.exists,e.status=this.status,e.statusText=this.statusText,e.headers=new Headers(this.headers),e}async arrayBuffer(){let e=await r.promises.readFile(this.filePath);return e.buffer}async blob(){let e=await r.promises.readFile(this.filePath);return new Blob([e],{type:this.headers.get(`content-type`)})}async text(){let e=await r.promises.readFile(this.filePath,`utf8`);return e}async json(){return JSON.parse(await this.text())}}function u(e,t=null,n=null){let r;try{r=new URL(e)}catch{return!1}return!(t&&!t.includes(r.protocol)||n&&!n.includes(r.hostname))}let d=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function f(e){return!(!d.test(e)||e.includes(`..`)||e.includes(`--`)||e.endsWith(`.git`)||e.endsWith(`.ipynb`))}async function p(e){var t;if(a.env.useFS&&!u(e,[`http:`,`https:`,`blob:`]))return new l(e instanceof URL?e.protocol===`file:`?e.pathname:e.toString():e);if(typeof process<`u`&&((t=process)==null||(t=t.release)==null?void 0:t.name)===`node`){var n;let t=!!(n={})?.TESTING_REMOTELY,o=a.env.version,s=new Headers;s.set(`User-Agent`,`transformers.js/${o}; is_ci/${t};`);let c=u(e,[`http:`,`https:`],[`huggingface.co`,`hf.co`]);if(c){var r,i;let e=(r={})?.HF_TOKEN??(i={})?.HF_ACCESS_TOKEN;e&&s.set(`Authorization`,`Bearer ${e}`)}return fetch(e,{headers:s})}else return fetch(e)}let m={400:`Bad request error occurred while trying to load file`,401:`Unauthorized access to file`,403:`Forbidden access to file`,404:`Could not locate file`,408:`Request timeout error occurred while trying to load file`,500:`Internal server error error occurred while trying to load file`,502:`Bad gateway error occurred while trying to load file`,503:`Service unavailable error occurred while trying to load file`,504:`Gateway timeout error occurred while trying to load file`};function h(e,t,n){if(!n)return null;let r=m[e]??`Error (${e}) occurred while trying to load file`;throw Error(`${r}: "${t}".`)}class g{constructor(e){this.path=e}async match(e){let t=i.join(this.path,e),n=new l(t);if(n.exists)return n}async put(e,t,n=void 0){let a=i.join(this.path,e);try{let e=t.headers.get(`Content-Length`),o=parseInt(e??`0`),s=0;await r.promises.mkdir(i.dirname(a),{recursive:!0});let c=r.createWriteStream(a),l=t.body.getReader();for(;;){let{done:e,value:t}=await l.read();if(e)break;await new Promise((e,n)=>{c.write(t,t=>{if(t){n(t);return}e()})}),s+=t.length;let r=o?s/o*100:0;n?.({progress:r,loaded:s,total:o})}c.close()}catch(e){try{await r.promises.unlink(a)}catch{}throw e}}}async function _(e,...t){for(let n of t)try{let t=await e.match(n);if(t)return t}catch{continue}}async function v(e,t,n=!0,r={},i=!1){if(!a.env.allowLocalModels){if(r.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!a.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}(0,o.dispatchCallback)(r.progress_callback,{status:`initiate`,name:e,file:t});let s;if(!s&&a.env.useCustomCache){if(!a.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!a.env.customCache.match||!a.env.customCache.put)throw Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");s=a.env.customCache}if(!s&&a.env.useBrowserCache){if(typeof caches>`u`)throw Error(`Browser cache is not available in this environment.`);try{s=await caches.open(`transformers-cache`)}catch(e){console.warn(`An error occurred while opening the browser cache:`,e)}}if(!s&&a.env.useFSCache){if(!a.apis.IS_FS_AVAILABLE)throw Error(`File System Cache is not available in this environment.`);s=new g(r.cache_dir??a.env.cacheDir)}let c=r.revision??`main`,d=x(e,t),m=f(e),v=m?x(a.env.localModelPath,d):d,y=x(a.env.remoteHost,a.env.remotePathTemplate.replaceAll(`{model}`,e).replaceAll(`{revision}`,encodeURIComponent(c)),t),S,C=s instanceof g?c===`main`?d:x(e,c,t):y,w=!1,T;s&&(T=await _(s,v,C));let E=T!==void 0;if(T===void 0){if(a.env.allowLocalModels){let e=u(d,[`http:`,`https:`]);if(e){if(r.local_files_only)throw Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${d}.`);if(!a.env.allowRemoteModels)throw Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${d}.`)}else try{T=await p(v),S=v}catch(e){console.warn(`Unable to load from local path "${v}": "${e}"`)}}if(T===void 0||T.status===404){if(r.local_files_only||!a.env.allowRemoteModels){if(n)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${v}".`);return null}if(!m)throw Error(`Local file missing at "${v}" and download aborted due to invalid model ID "${e}".`);if(T=await p(y),T.status!==200)return h(T.status,y,n);S=C}w=s&&typeof Response<`u`&&T instanceof Response&&T.status===200}(0,o.dispatchCallback)(r.progress_callback,{status:`download`,name:e,file:t});let D;if(!(a.apis.IS_NODE_ENV&&i)){let n;r.progress_callback?E&&typeof navigator<`u`&&/firefox/i.test(navigator.userAgent)?(n=new Uint8Array(await T.arrayBuffer()),(0,o.dispatchCallback)(r.progress_callback,{status:`progress`,name:e,file:t,progress:100,loaded:n.length,total:n.length})):n=await b(T,n=>{(0,o.dispatchCallback)(r.progress_callback,{status:`progress`,name:e,file:t,...n})}):n=new Uint8Array(await T.arrayBuffer()),D=n}if(w&&S&&await s.match(S)===void 0&&(D?await s.put(S,new Response(D,{headers:T.headers})).catch(e=>{console.warn(`Unable to add response to browser cache: ${e}.`)}):await s.put(S,T,r.progress_callback)),(0,o.dispatchCallback)(r.progress_callback,{status:`done`,name:e,file:t}),D){if(!a.apis.IS_NODE_ENV&&i)throw Error(`Cannot return path in a browser environment.`);return D}if(T instanceof l)return T.filePath;let O=await s?.match(S);if(O instanceof l)return O.filePath;if(O instanceof Response)return new Uint8Array(await O.arrayBuffer());if(typeof O==`string`)return O;throw Error(`Unable to get model file path or buffer.`)}async function y(e,t,n=!0,r={}){let i=await v(e,t,n,r,!1);if(i===null)return{};let a=new TextDecoder(`utf-8`),o=a.decode(i);return JSON.parse(o)}async function b(e,t){let n=e.headers.get(`Content-Length`);n===null&&console.warn(`Unable to determine content-length from response headers. Will expand buffer when needed.`);let r=parseInt(n??`0`),i=new Uint8Array(r),a=0,o=e.body.getReader();async function s(){let{done:e,value:n}=await o.read();if(e)return;let c=a+n.length;if(c>r){r=c;let e=new Uint8Array(r);e.set(i),i=e}i.set(n,a),a=c;let l=a/r*100;return t({progress:l,loaded:a,total:r}),s()}return await s(),i}function x(...e){return e=e.map((t,n)=>(n&&(t=t.replace(RegExp(`^/`),``)),n!==e.length-1&&(t=t.replace(RegExp(`/$`),``)),t)),e.join(`/`)}},"./src/utils/image.js":(e,t,n)=>{n.r(t),n.d(t,{RawImage:()=>m,load_image:()=>h});var r=n( +/*! ./core.js */ +`./src/utils/core.js`),i=n( +/*! ./hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../env.js */ +`./src/env.js`),o=n( +/*! ./tensor.js */ +`./src/utils/tensor.js`),s=n( +/*! sharp */ +`?2b25`);let c,l,u,d=a.apis.IS_BROWSER_ENV||a.apis.IS_WEBWORKER_ENV;if(d)c=(e,t)=>{if(!self.OffscreenCanvas)throw Error(`OffscreenCanvas not supported by this browser.`);return new self.OffscreenCanvas(e,t)},u=self.createImageBitmap,l=self.ImageData;else if(s)u=async e=>{let t=await e.metadata(),n=t.channels,{data:r,info:i}=await e.rotate().raw().toBuffer({resolveWithObject:!0}),a=new m(new Uint8ClampedArray(r),i.width,i.height,i.channels);return n!==void 0&&n!==i.channels&&a.convert(n),a};else throw Error(`Unable to load image processing library.`);let f={0:`nearest`,1:`lanczos`,2:`bilinear`,3:`bicubic`,4:`box`,5:`hamming`},p=new Map([[`png`,`image/png`],[`jpg`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`gif`,`image/gif`]]);class m{constructor(e,t,n,r){this.data=e,this.width=t,this.height=n,this.channels=r}get size(){return[this.width,this.height]}static async read(e){if(e instanceof m)return e;if(typeof e==`string`||e instanceof URL)return await this.fromURL(e);if(e instanceof Blob)return await this.fromBlob(e);if(typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas)return this.fromCanvas(e);throw Error(`Unsupported input type: ${typeof e}`)}static fromCanvas(e){if(!d)throw Error(`fromCanvas() is only supported in browser environments.`);let t=e.getContext(`2d`),n=t.getImageData(0,0,e.width,e.height).data;return new m(n,e.width,e.height,4)}static async fromURL(e){let t=await(0,i.getFile)(e);if(t.status!==200)throw Error(`Unable to read image from "${e}" (${t.status} ${t.statusText})`);let n=await t.blob();return this.fromBlob(n)}static async fromBlob(e){if(d){let t=await u(e),n=c(t.width,t.height).getContext(`2d`);return n.drawImage(t,0,0),new this(n.getImageData(0,0,t.width,t.height).data,t.width,t.height,4)}else{let t=s(await e.arrayBuffer());return await u(t)}}static fromTensor(e,t=`CHW`){if(e.dims.length!==3)throw Error(`Tensor should have 3 dimensions, but has ${e.dims.length} dimensions.`);if(t===`CHW`)e=e.transpose(1,2,0);else if(t!==`HWC`)throw Error(`Unsupported channel format: ${t}`);if(!(e.data instanceof Uint8ClampedArray||e.data instanceof Uint8Array))throw Error(`Unsupported tensor type: ${e.type}`);switch(e.dims[2]){case 1:case 2:case 3:case 4:return new m(e.data,e.dims[1],e.dims[0],e.dims[2]);default:throw Error(`Unsupported number of channels: ${e.dims[2]}`)}}grayscale(){if(this.channels===1)return this;let e=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let t=0,n=0;t=0?s=n:u=-n,r>=0?l=r:d=-r,o.drawImage(a,s,l,e,t,u,d,e,t);let f=new m(o.getImageData(0,0,e,t).data,e,t,4);return f.convert(i)}else{let i=this.toSharp();if(n>=0&&r>=0)i=i.extract({left:Math.floor(n),top:Math.floor(r),width:e,height:t});else if(n<=0&&r<=0){let a=Math.floor(-r),o=Math.floor(-n);i=i.extend({top:a,left:o,right:e-this.width-o,bottom:t-this.height-a})}else{let a=[0,0],o=0;r<0?(a[0]=Math.floor(-r),a[1]=t-this.height-a[0]):o=Math.floor(r);let s=[0,0],c=0;n<0?(s[0]=Math.floor(-n),s[1]=e-this.width-s[0]):c=Math.floor(n),i=i.extend({top:a[0],bottom:a[1],left:s[0],right:s[1]}).extract({left:c,top:o,width:e,height:t})}return await u(i)}}async toBlob(e=`image/png`,t=1){if(!d)throw Error(`toBlob() is only supported in browser environments.`);let n=this.toCanvas();return await n.convertToBlob({type:e,quality:t})}toTensor(e=`CHW`){let t=new o.Tensor(`uint8`,new Uint8Array(this.data),[this.height,this.width,this.channels]);if(e!==`HWC`)if(e===`CHW`)t=t.permute(2,0,1);else throw Error(`Unsupported channel format: ${e}`);return t}toCanvas(){if(!d)throw Error(`toCanvas() is only supported in browser environments.`);let e=this.clone().rgba(),t=c(e.width,e.height),n=new l(e.data,e.width,e.height);return t.getContext(`2d`).putImageData(n,0,0),t}split(){let{data:e,width:t,height:n,channels:r}=this,i=e.constructor,a=e.length/r,o=Array.from({length:r},()=>new i(a));for(let t=0;tnew m(e,t,n,1))}_update(e,t,n,r=null){return this.data=e,this.width=t,this.height=n,r!==null&&(this.channels=r),this}clone(){return new m(this.data.slice(),this.width,this.height,this.channels)}convert(e){if(this.channels===e)return this;switch(e){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(e){if(d){if(a.apis.IS_WEBWORKER_ENV)throw Error(`Unable to save an image from a Web Worker.`);let t=e.split(`.`).pop().toLowerCase(),n=p.get(t)??`image/png`,i=await this.toBlob(n);(0,r.saveBlob)(e,i)}else if(a.apis.IS_FS_AVAILABLE){let t=this.toSharp();return await t.toFile(e)}else throw Error(`Unable to save the image because filesystem is disabled in this environment.`)}toSharp(){if(d)throw Error(`toSharp() is only supported in server-side environments.`);return s(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}let h=m.read.bind(m)},"./src/utils/maths.js":(e,t,n)=>{n.r(t),n.d(t,{FFT:()=>h,bankers_round:()=>v,cos_sim:()=>c,dot:()=>s,dynamic_time_warping:()=>y,interpolate_data:()=>r,log_softmax:()=>o,magnitude:()=>l,max:()=>d,medianFilter:()=>g,min:()=>u,permute_data:()=>i,round:()=>_,softmax:()=>a});function r(e,[t,n,r],[i,a],o=`bilinear`,s=!1){let c=a/r,l=i/n,u=new e.constructor(i*a*t),d=n*r,f=i*a;for(let o=0;o=0;--e)i[e]=a,r[e]=t[n[e]],a*=r[e];let a=n.map((e,t)=>i[n.indexOf(t)]),o=new e.constructor(e.length);for(let n=0;n=0;--e)r+=i%t[e]*a[e],i=Math.floor(i/t[e]);o[r]=e[n]}return[o,r]}function a(e){let t=d(e)[0],n=e.map(e=>Math.exp(e-t)),r=n.reduce((e,t)=>e+t,0),i=n.map(e=>e/r);return i}function o(e){let t=d(e)[0],n=0;for(let r=0;re-t-r);return i}function s(e,t){let n=0;for(let r=0;re+t*t,0))}function u(e){if(e.length===0)throw Error(`Array must not be empty`);let t=e[0],n=0;for(let r=1;rt&&(t=e[r],n=r);return[t,n]}function f(e){return e>0&&(e&e-1)==0}class p{constructor(e){if(this.size=e|0,this.size<=1||!f(this.size))throw Error(`FFT size must be a power of two larger than 1`);this._csize=e<<1,this.table=new Float64Array(this.size*2);for(let e=0;ee;e<<=1)++t;this._width=t%2==0?t-1:t,this._bitrev=new Int32Array(1<>>t&3)<>>1);for(let t=0;t>>1]=e[t];return n}toComplexArray(e,t){let n=t||this.createComplexArray();for(let t=0;t>>1],n[t+1]=0;return n}transform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,1)}realTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._realTransform4(e,t,1)}inverseTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,-1);for(let t=0;t>=2;a>=2;a>>=2){o=r/a<<1;let t=o>>>2;for(s=0;s>>1,a>>>1)}else for(s=0,c=0;s>>1,a>>>1,n)}let u=this.table;for(a>>=2;a>=2;a>>=2){o=r/a<<1;let t=o>>>1,i=t>>>1,c=i>>>1;for(s=0;s>>1;for(let t=2;t>1;++t){let n=(t+1-e)**2/2,r=Math.sqrt(s**2+c**2)**n,o=n*Math.atan2(c,s),l=2*t;i[l]=r*Math.cos(o),i[l+1]=r*Math.sin(o),a[l]=i[l],a[l+1]=-i[l+1]}this._slicedChirpBuffer=i.subarray(t,n),this._f=new p(r>>1),this._f.transform(this._chirpBuffer,a)}_transform(e,t,n){let r=this._buffer1,i=this._buffer2,a=this._outBuffer1,o=this._outBuffer2,s=this._chirpBuffer,c=this._slicedChirpBuffer,l=this._a;if(n)for(let e=0;e>1,a=t[i];r[e]=a*c[e],r[n]=a*c[n]}else for(let e=0;e=e.length&&(i=2*(e.length-1)-i),r[a++]=e[i]}r.sort(),n[t]=r[i]}return n}function _(e,t){let n=10**t;return Math.round(e*n)/n}function v(e){let t=Math.round(e),n=Math.abs(e)%1==.5?t%2==0?t:t-1:t;return n}function y(e){let t=e.length,n=e[0].length,r=[t+1,n+1],i=Array.from({length:r[0]},()=>Array(r[1]).fill(1/0));i[0][0]=0;let a=Array.from({length:r[0]},()=>Array(r[1]).fill(-1));for(let t=1;t0||s>0;)switch(c.push(o-1),l.push(s-1),a[o][s]){case 0:--o,--s;break;case 1:--o;break;case 2:--s;break;default:throw Error(`Internal error in dynamic time warping. Unexpected trace[${o}, ${s}]. Please file a bug report.`)}return c.reverse(),l.reverse(),[c,l]}},"./src/utils/tensor.js":(t,n,r)=>{let i;r.r(n),r.d(n,{DataTypeMap:()=>c,Tensor:()=>l,cat:()=>w,full:()=>ee,full_like:()=>te,interpolate:()=>f,interpolate_4d:()=>p,layer_norm:()=>b,matmul:()=>m,mean:()=>O,mean_pooling:()=>y,ones:()=>ne,ones_like:()=>re,permute:()=>d,quantize_embeddings:()=>oe,rand:()=>ae,rfft:()=>h,slice:()=>v,stack:()=>T,std_mean:()=>D,topk:()=>g,zeros:()=>j,zeros_like:()=>ie});var a=r( +/*! ./maths.js */ +`./src/utils/maths.js`),o=r( +/*! ../backends/onnx.js */ +`./src/backends/onnx.js`),s=r( +/*! ../ops/registry.js */ +`./src/ops/registry.js`);let c=Object.freeze({float32:Float32Array,float16:typeof Float16Array<`u`?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array});i=Symbol.iterator;class l{get dims(){return this.ort_tensor.dims}set dims(e){this.ort_tensor.dims=e}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}constructor(...t){return e.defineProperty(this,`ort_tensor`,void 0),(0,o.isONNXTensor)(t[0])?this.ort_tensor=t[0]:this.ort_tensor=new o.Tensor(t[0],t[1],t[2]),new Proxy(this,{get:(e,t)=>{if(typeof t==`string`){let n=Number(t);if(Number.isInteger(n))return e._getitem(n)}return e[t]},set:(e,t,n)=>e[t]=n})}dispose(){this.ort_tensor.dispose()}*[i](){let[e,...t]=this.dims;if(t.length>0){let n=t.reduce((e,t)=>e*t);for(let r=0;r0){let t=n.reduce((e,t)=>e*t);return this._subarray(e,t,n)}else return new l(this.type,[this.data[e]],n)}indexOf(e){let t=this.data;for(let n=0;na)throw Error(`Invalid slice: ${i}`);let o=[Math.max(e,0),Math.min(a,this.dims[r])];n.push(o),t.push(o[1]-o[0])}else throw Error(`Invalid slice: ${i}`)}let r=n.map(([e,t])=>t-e),i=r.reduce((e,t)=>e*t),a=this.data,o=new a.constructor(i),s=this.stride();for(let e=0;e=0;--i){let e=r[i];t+=(a%e+n[i][0])*s[i],a=Math.floor(a/e)}o[e]=a[t]}return new l(this.type,o,t)}permute(...e){return d(this,e)}transpose(...e){return this.permute(...e)}sum(e=null,t=!1){return this.norm(1,e,t)}norm(e=`fro`,t=null,n=!1){if(e===`fro`)e=2;else if(typeof e==`string`)throw Error(`Unsupported norm: ${e}`);let r=this.data,i=(t,n)=>t+n**e;if(t===null){let t=r.reduce(i,0)**(1/e);return new l(this.type,[t],[])}let[a,o,s]=E(i,this,t,n);if(e!==1)for(let t=0;t=0;--r){let e=this.dims[r];if(r!==t){let t=i%e;n+=t*a,a*=this.dims[r]}i=Math.floor(i/e)}r[e]/=i[n]}return this}normalize(e=2,t=1){return this.clone().normalize_(e,t)}stride(){return k(this.dims)}squeeze(e=null){return new l(this.type,this.data,x(this.dims,e))}squeeze_(e=null){return this.dims=x(this.dims,e),this}unsqueeze(e=null){return new l(this.type,this.data,S(this.dims,e))}unsqueeze_(e=null){return this.dims=S(this.dims,e),this}flatten_(e=0,t=-1){t=(t+this.dims.length)%this.dims.length;let n=this.dims.slice(0,e),r=this.dims.slice(e,t+1),i=this.dims.slice(t+1);return this.dims=[...n,r.reduce((e,t)=>e*t,1),...i],this}flatten(e=0,t=-1){return this.clone().flatten_(e,t)}view(...e){let t=-1;for(let n=0;nr===t?e:e*n,1);e[t]=n.length/r}return new l(this.type,n,e)}neg_(){let e=this.data;for(let t=0;te?1:0;return new l(`bool`,t,this.dims)}lt(e){let t=new Uint8Array(this.data.length),n=this.data;for(let r=0;rMath.min(e,t),this,e,t,1/0);return new l(n,r,i)}max(e=null,t=!1){if(e===null){let e=(0,a.max)(this.data)[0];return new l(this.type,[e],[])}let[n,r,i]=E((e,t)=>Math.max(e,t),this,e,t,-1/0);return new l(n,r,i)}argmin(e=null,t=!1){if(e!==null)throw Error("`dim !== null` not yet implemented.");let n=(0,a.min)(this.data)[1];return new l(`int64`,[BigInt(n)],[])}argmax(e=null,t=!1){if(e!==null)throw Error("`dim !== null` not yet implemented.");let n=(0,a.max)(this.data)[1];return new l(`int64`,[BigInt(n)],[])}to(e){if(this.type===e)return this;if(!c.hasOwnProperty(e))throw Error(`Unsupported type: ${e}`);let t,n=[`int64`,`uint64`].includes(this.type),r=[`int64`,`uint64`].includes(e);return n&&!r?t=Number:!n&&r&&(t=BigInt),new l(e,c[e].from(this.data,t),this.dims)}}function u(e,t){let n=e.length,r=t.reduce((e,t)=>e*t);if(n!==r)throw Error(`cannot reshape array of size ${n} into shape (${t})`);let i=e;for(let e=t.length-1;e>=0;e--)i=i.reduce((n,r)=>{let i=n[n.length-1];return i.lengthnew l(`int64`,e,[e.length]);async function v(e,t,n,r,i){let a=await s.TensorOpRegistry.slice;return await a({x:e,s:_(t),e:_(n),a:_(r),t:_(i??Array(r.length).fill(1))})}function y(e,t){let n=e.data,r=t.data,i=[e.dims[0],e.dims[2]],a=new n.constructor(i[0]*i[1]),[o,s,c]=e.dims,u=0;for(let e=0;ee!==1):typeof t==`number`?e[t]===1&&e.splice(t,1):Array.isArray(t)&&(e=e.filter((e,n)=>e!==1||!t.includes(n))),e}function S(e,t){return t=C(t,e.length+1),e=e.slice(),e.splice(t,0,1),e}function C(e,t,n=null,r=!0){if(e<-t||e>=t){if(r)throw Error(`IndexError: index ${e} is out of bounds for dimension${n===null?``:` `+n} with size ${t}`);return e<-t?0:t}return e<0&&(e=(e%t+t)%t),e}function w(e,t=0){t=C(t,e[0].dims.length);let n=e[0].dims.slice();n[t]=e.reduce((e,n)=>e+n.dims[t],0);let r=n.reduce((e,t)=>e*t,1),i=new e[0].data.constructor(r),a=e[0].type;if(t===0){let t=0;for(let n of e){let e=n.data;i.set(e,t),t+=e.length}}else{let r=0;for(let a=0;a=0;--i){let e=s[i],l=o%e;i===t&&(l+=r),a+=l*c,c*=n[i],o=Math.floor(o/e)}i[a]=o[e]}r+=s[t]}}return new l(a,i,n)}function T(e,t=0){return w(e.map(e=>e.unsqueeze(t)),t)}function E(e,t,n=null,r=!1,i=null){let a=t.data,o=t.dims;n=C(n,o.length);let s=o.slice();s[n]=1;let c=new a.constructor(a.length/o[n]);i!==null&&c.fill(i);for(let t=0;t=0;--e){let t=o[e];if(e!==n){let n=i%t;r+=n*a,a*=s[e]}i=Math.floor(i/t)}c[r]=e(c[r],a[t],t,r)}return r||s.splice(n,1),[t.type,c,s]}function D(e,t=null,n=1,r=!1){let i=e.data,a=e.dims;if(t===null){let t=i.reduce((e,t)=>e+t,0),r=t/i.length,a=Math.sqrt(i.reduce((e,t)=>e+(t-r)**2,0)/(i.length-n)),o=new l(e.type,[r],[]),s=new l(e.type,[a],[]);return[s,o]}t=C(t,a.length);let o=O(e,t,r),s=o.data,[c,u,d]=E((e,t,n,r)=>e+(t-s[r])**2,e,t,r);for(let e=0;ee+t,0);return new l(e.type,[t/i.length],[])}t=C(t,r.length);let[a,o,s]=E((e,t)=>e+t,e,t,n);if(r[t]!==1)for(let e=0;e=0;--n)t[n]=r,r*=e[n];return t}function A(e,t,n,r){let i=e.reduce((e,t)=>e*t,1);return new l(n,new r(i).fill(t),e)}function ee(e,t){let n,r;if(typeof t==`number`)n=`float32`,r=Float32Array;else if(typeof t==`bigint`)n=`int64`,r=BigInt64Array;else if(typeof t==`boolean`)n=`bool`,r=Uint8Array;else throw Error(`Unsupported data type: ${typeof t}`);return A(e,t,n,r)}function te(e,t){return ee(e.dims,t)}function ne(e){return A(e,1n,`int64`,BigInt64Array)}function re(e){return ne(e.dims)}function j(e){return A(e,0n,`int64`,BigInt64Array)}function ie(e){return j(e.dims)}function ae(e){let t=e.reduce((e,t)=>e*t,1);return new l(`float32`,Float32Array.from({length:t},()=>Math.random()),e)}function oe(e,t){if(e.dims.length!==2)throw Error(`The tensor must have 2 dimensions`);if(e.dims.at(-1)%8!=0)throw Error(`The last dimension of the tensor must be a multiple of 8`);if(![`binary`,`ubinary`].includes(t))throw Error(`The precision must be either 'binary' or 'ubinary'`);let n=t===`binary`,r=n?`int8`:`uint8`,i=n?Int8Array:Uint8Array,a=e.data,o=new i(a.length/8);for(let e=0;e0?1:0,r=Math.floor(e/8),i=e%8;o[r]|=t<<7-i,n&&i===0&&(o[r]-=128)}return new l(r,o,[e.dims[0],e.dims[1]/8])}},"./src/utils/video.js":(e,t,n)=>{n.r(t),n.d(t,{RawVideo:()=>o,RawVideoFrame:()=>a,load_video:()=>s});var r=n( +/*! ./image.js */ +`./src/utils/image.js`),i=n( +/*! ../env.js */ +`./src/env.js`);class a{constructor(e,t){this.image=e,this.timestamp=t}}class o{constructor(e,t){e.length>0&&e[0]instanceof r.RawImage&&(e=e.map((n,r)=>new a(n,(r+1)/(e.length+1)*t))),this.frames=e,this.duration=t}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function s(e,{num_frames:t=null,fps:n=null}={}){if(!i.apis.IS_BROWSER_ENV)throw Error("`load_video` is currently only supported in browser environments.");if(t==null&&n==null)throw Error(`Either num_frames or fps must be provided.`);let s=[],c=document.createElement(`video`);if(c.crossOrigin=`anonymous`,c.muted=!0,typeof e==`string`)c.src=e;else if(e instanceof Blob)c.src=URL.createObjectURL(e);else if(e instanceof HTMLVideoElement)c.src=e.src;else throw Error(`Invalid URL or video element provided.`);if(await new Promise(e=>c.onloadedmetadata=e),c.seekable.start(0)===c.seekable.end(0)){let e=await fetch(c.src),t=await e.blob();c.src=URL.createObjectURL(t),await new Promise(e=>c.onloadedmetadata=e)}let l=c.duration,u,d;t==null?(d=1/n,u=Math.floor(l/d)):(u=t,d=t===1?0:l/(t-1));let f=[];for(let e=0;e{c.onseeked=e}),m.drawImage(c,0,0,p.width,p.height);let t=m.getImageData(0,0,p.width,p.height),n=new r.RawImage(t.data,p.width,p.height,4),i=new a(n,e);s.push(i)}return c.remove(),new o(s,l)}}},uf={};function df(e){var t=uf[e];if(t!==void 0)return t.exports;var n=uf[e]={exports:{}};return lf[e](n,n.exports,df),n.exports}(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t;df.t=function(n,r){if(r&1&&(n=this(n)),r&8||typeof n==`object`&&n&&(r&4&&n.__esModule||r&16&&typeof n.then==`function`))return n;var i=Object.create(null);df.r(i);var a={};t||=[null,e({}),e([]),e(e)];for(var o=r&2&&n;typeof o==`object`&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,df.d(i,a),i}})(),df.d=(e,t)=>{for(var n in t)df.o(t,n)&&!df.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},df.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),df.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})};var $={};(()=>{df.r($),df.d($,{ASTFeatureExtractor:()=>d.ASTFeatureExtractor,ASTForAudioClassification:()=>n.ASTForAudioClassification,ASTModel:()=>n.ASTModel,ASTPreTrainedModel:()=>n.ASTPreTrainedModel,AlbertForMaskedLM:()=>n.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>n.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>n.AlbertForSequenceClassification,AlbertModel:()=>n.AlbertModel,AlbertPreTrainedModel:()=>n.AlbertPreTrainedModel,AlbertTokenizer:()=>r.AlbertTokenizer,AudioClassificationPipeline:()=>t.AudioClassificationPipeline,AutoConfig:()=>i.AutoConfig,AutoFeatureExtractor:()=>f.AutoFeatureExtractor,AutoImageProcessor:()=>h.AutoImageProcessor,AutoModel:()=>n.AutoModel,AutoModelForAudioClassification:()=>n.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>n.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>n.AutoModelForAudioTextToText,AutoModelForCTC:()=>n.AutoModelForCTC,AutoModelForCausalLM:()=>n.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>n.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>n.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>n.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>n.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>n.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>n.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>n.AutoModelForImageTextToText,AutoModelForImageToImage:()=>n.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>n.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>n.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>n.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>n.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>n.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>n.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>n.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>n.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>n.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>n.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>n.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>n.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>n.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>n.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>n.AutoModelForVision2Seq,AutoModelForXVector:()=>n.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>n.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>v.AutoProcessor,AutoTokenizer:()=>r.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>t.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>t.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>n.BartForConditionalGeneration,BartForSequenceClassification:()=>n.BartForSequenceClassification,BartModel:()=>n.BartModel,BartPretrainedModel:()=>n.BartPretrainedModel,BartTokenizer:()=>r.BartTokenizer,BaseModelOutput:()=>n.BaseModelOutput,BaseStreamer:()=>y.BaseStreamer,BeitFeatureExtractor:()=>m.BeitFeatureExtractor,BeitForImageClassification:()=>n.BeitForImageClassification,BeitModel:()=>n.BeitModel,BeitPreTrainedModel:()=>n.BeitPreTrainedModel,BertForMaskedLM:()=>n.BertForMaskedLM,BertForQuestionAnswering:()=>n.BertForQuestionAnswering,BertForSequenceClassification:()=>n.BertForSequenceClassification,BertForTokenClassification:()=>n.BertForTokenClassification,BertModel:()=>n.BertModel,BertPreTrainedModel:()=>n.BertPreTrainedModel,BertTokenizer:()=>r.BertTokenizer,BitImageProcessor:()=>m.BitImageProcessor,BlenderbotForConditionalGeneration:()=>n.BlenderbotForConditionalGeneration,BlenderbotModel:()=>n.BlenderbotModel,BlenderbotPreTrainedModel:()=>n.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>n.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>n.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>n.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>r.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>r.BlenderbotTokenizer,BloomForCausalLM:()=>n.BloomForCausalLM,BloomModel:()=>n.BloomModel,BloomPreTrainedModel:()=>n.BloomPreTrainedModel,BloomTokenizer:()=>r.BloomTokenizer,CLIPFeatureExtractor:()=>m.CLIPFeatureExtractor,CLIPImageProcessor:()=>m.CLIPImageProcessor,CLIPModel:()=>n.CLIPModel,CLIPPreTrainedModel:()=>n.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>n.CLIPSegForImageSegmentation,CLIPSegModel:()=>n.CLIPSegModel,CLIPSegPreTrainedModel:()=>n.CLIPSegPreTrainedModel,CLIPTextModel:()=>n.CLIPTextModel,CLIPTextModelWithProjection:()=>n.CLIPTextModelWithProjection,CLIPTokenizer:()=>r.CLIPTokenizer,CLIPVisionModel:()=>n.CLIPVisionModel,CLIPVisionModelWithProjection:()=>n.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>n.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>n.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>n.CamembertForSequenceClassification,CamembertForTokenClassification:()=>n.CamembertForTokenClassification,CamembertModel:()=>n.CamembertModel,CamembertPreTrainedModel:()=>n.CamembertPreTrainedModel,CamembertTokenizer:()=>r.CamembertTokenizer,CausalLMOutput:()=>n.CausalLMOutput,CausalLMOutputWithPast:()=>n.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>m.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>n.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>n.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>n.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>d.ClapFeatureExtractor,ClapModel:()=>n.ClapModel,ClapPreTrainedModel:()=>n.ClapPreTrainedModel,ClapTextModelWithProjection:()=>n.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>x.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>n.CodeGenForCausalLM,CodeGenModel:()=>n.CodeGenModel,CodeGenPreTrainedModel:()=>n.CodeGenPreTrainedModel,CodeGenTokenizer:()=>r.CodeGenTokenizer,CodeLlamaTokenizer:()=>r.CodeLlamaTokenizer,CohereForCausalLM:()=>n.CohereForCausalLM,CohereModel:()=>n.CohereModel,CoherePreTrainedModel:()=>n.CoherePreTrainedModel,CohereTokenizer:()=>r.CohereTokenizer,ConvBertForMaskedLM:()=>n.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>n.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>n.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>n.ConvBertForTokenClassification,ConvBertModel:()=>n.ConvBertModel,ConvBertPreTrainedModel:()=>n.ConvBertPreTrainedModel,ConvBertTokenizer:()=>r.ConvBertTokenizer,ConvNextFeatureExtractor:()=>m.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>n.ConvNextForImageClassification,ConvNextImageProcessor:()=>m.ConvNextImageProcessor,ConvNextModel:()=>n.ConvNextModel,ConvNextPreTrainedModel:()=>n.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>n.ConvNextV2ForImageClassification,ConvNextV2Model:()=>n.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>n.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>n.DFineForObjectDetection,DFineModel:()=>n.DFineModel,DFinePreTrainedModel:()=>n.DFinePreTrainedModel,DPTFeatureExtractor:()=>m.DPTFeatureExtractor,DPTForDepthEstimation:()=>n.DPTForDepthEstimation,DPTImageProcessor:()=>m.DPTImageProcessor,DPTModel:()=>n.DPTModel,DPTPreTrainedModel:()=>n.DPTPreTrainedModel,DacDecoderModel:()=>n.DacDecoderModel,DacDecoderOutput:()=>n.DacDecoderOutput,DacEncoderModel:()=>n.DacEncoderModel,DacEncoderOutput:()=>n.DacEncoderOutput,DacFeatureExtractor:()=>d.DacFeatureExtractor,DacModel:()=>n.DacModel,DacPreTrainedModel:()=>n.DacPreTrainedModel,DataTypeMap:()=>c.DataTypeMap,DebertaForMaskedLM:()=>n.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>n.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>n.DebertaForSequenceClassification,DebertaForTokenClassification:()=>n.DebertaForTokenClassification,DebertaModel:()=>n.DebertaModel,DebertaPreTrainedModel:()=>n.DebertaPreTrainedModel,DebertaTokenizer:()=>r.DebertaTokenizer,DebertaV2ForMaskedLM:()=>n.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>n.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>n.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>n.DebertaV2ForTokenClassification,DebertaV2Model:()=>n.DebertaV2Model,DebertaV2PreTrainedModel:()=>n.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>r.DebertaV2Tokenizer,DecisionTransformerModel:()=>n.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>n.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>m.DeiTFeatureExtractor,DeiTForImageClassification:()=>n.DeiTForImageClassification,DeiTImageProcessor:()=>m.DeiTImageProcessor,DeiTModel:()=>n.DeiTModel,DeiTPreTrainedModel:()=>n.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>n.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>n.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>t.DepthEstimationPipeline,DepthProForDepthEstimation:()=>n.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>n.DepthProPreTrainedModel,DetrFeatureExtractor:()=>m.DetrFeatureExtractor,DetrForObjectDetection:()=>n.DetrForObjectDetection,DetrForSegmentation:()=>n.DetrForSegmentation,DetrImageProcessor:()=>m.DetrImageProcessor,DetrModel:()=>n.DetrModel,DetrObjectDetectionOutput:()=>n.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>n.DetrPreTrainedModel,DetrSegmentationOutput:()=>n.DetrSegmentationOutput,Dinov2ForImageClassification:()=>n.Dinov2ForImageClassification,Dinov2Model:()=>n.Dinov2Model,Dinov2PreTrainedModel:()=>n.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>n.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>n.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>n.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>n.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>n.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>n.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>n.DistilBertForTokenClassification,DistilBertModel:()=>n.DistilBertModel,DistilBertPreTrainedModel:()=>n.DistilBertPreTrainedModel,DistilBertTokenizer:()=>r.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>t.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>m.DonutFeatureExtractor,DonutImageProcessor:()=>m.DonutImageProcessor,DonutSwinModel:()=>n.DonutSwinModel,DonutSwinPreTrainedModel:()=>n.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>n.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>m.EfficientNetImageProcessor,EfficientNetModel:()=>n.EfficientNetModel,EfficientNetPreTrainedModel:()=>n.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>n.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>n.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>n.ElectraForSequenceClassification,ElectraForTokenClassification:()=>n.ElectraForTokenClassification,ElectraModel:()=>n.ElectraModel,ElectraPreTrainedModel:()=>n.ElectraPreTrainedModel,ElectraTokenizer:()=>r.ElectraTokenizer,EncodecFeatureExtractor:()=>d.EncodecFeatureExtractor,EosTokenCriteria:()=>b.EosTokenCriteria,EsmForMaskedLM:()=>n.EsmForMaskedLM,EsmForSequenceClassification:()=>n.EsmForSequenceClassification,EsmForTokenClassification:()=>n.EsmForTokenClassification,EsmModel:()=>n.EsmModel,EsmPreTrainedModel:()=>n.EsmPreTrainedModel,EsmTokenizer:()=>r.EsmTokenizer,ExaoneForCausalLM:()=>n.ExaoneForCausalLM,ExaoneModel:()=>n.ExaoneModel,ExaonePreTrainedModel:()=>n.ExaonePreTrainedModel,FFT:()=>l.FFT,FalconForCausalLM:()=>n.FalconForCausalLM,FalconModel:()=>n.FalconModel,FalconPreTrainedModel:()=>n.FalconPreTrainedModel,FalconTokenizer:()=>r.FalconTokenizer,FastViTForImageClassification:()=>n.FastViTForImageClassification,FastViTModel:()=>n.FastViTModel,FastViTPreTrainedModel:()=>n.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>t.FeatureExtractionPipeline,FeatureExtractor:()=>u.FeatureExtractor,FillMaskPipeline:()=>t.FillMaskPipeline,Florence2ForConditionalGeneration:()=>n.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>n.Florence2PreTrainedModel,Florence2Processor:()=>_.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>x.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>x.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>m.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>n.GLPNForDepthEstimation,GLPNModel:()=>n.GLPNModel,GLPNPreTrainedModel:()=>n.GLPNPreTrainedModel,GPT2LMHeadModel:()=>n.GPT2LMHeadModel,GPT2Model:()=>n.GPT2Model,GPT2PreTrainedModel:()=>n.GPT2PreTrainedModel,GPT2Tokenizer:()=>r.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>n.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>n.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>n.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>n.GPTJForCausalLM,GPTJModel:()=>n.GPTJModel,GPTJPreTrainedModel:()=>n.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>n.GPTNeoForCausalLM,GPTNeoModel:()=>n.GPTNeoModel,GPTNeoPreTrainedModel:()=>n.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>n.GPTNeoXForCausalLM,GPTNeoXModel:()=>n.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>n.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>r.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>n.Gemma2ForCausalLM,Gemma2Model:()=>n.Gemma2Model,Gemma2PreTrainedModel:()=>n.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>n.Gemma3ForCausalLM,Gemma3Model:()=>n.Gemma3Model,Gemma3PreTrainedModel:()=>n.Gemma3PreTrainedModel,GemmaForCausalLM:()=>n.GemmaForCausalLM,GemmaModel:()=>n.GemmaModel,GemmaPreTrainedModel:()=>n.GemmaPreTrainedModel,GemmaTokenizer:()=>r.GemmaTokenizer,GlmForCausalLM:()=>n.GlmForCausalLM,GlmModel:()=>n.GlmModel,GlmPreTrainedModel:()=>n.GlmPreTrainedModel,GraniteForCausalLM:()=>n.GraniteForCausalLM,GraniteModel:()=>n.GraniteModel,GranitePreTrainedModel:()=>n.GranitePreTrainedModel,Grok1Tokenizer:()=>r.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>n.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>n.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>_.GroundingDinoProcessor,GroupViTModel:()=>n.GroupViTModel,GroupViTPreTrainedModel:()=>n.GroupViTPreTrainedModel,HeliumForCausalLM:()=>n.HeliumForCausalLM,HeliumModel:()=>n.HeliumModel,HeliumPreTrainedModel:()=>n.HeliumPreTrainedModel,HerbertTokenizer:()=>r.HerbertTokenizer,HieraForImageClassification:()=>n.HieraForImageClassification,HieraModel:()=>n.HieraModel,HieraPreTrainedModel:()=>n.HieraPreTrainedModel,HubertForCTC:()=>n.HubertForCTC,HubertForSequenceClassification:()=>n.HubertForSequenceClassification,HubertModel:()=>n.HubertModel,HubertPreTrainedModel:()=>n.HubertPreTrainedModel,IJepaForImageClassification:()=>n.IJepaForImageClassification,IJepaModel:()=>n.IJepaModel,IJepaPreTrainedModel:()=>n.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>n.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>m.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>n.Idefics3PreTrainedModel,Idefics3Processor:()=>_.Idefics3Processor,ImageClassificationPipeline:()=>t.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>t.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>d.ImageFeatureExtractor,ImageMattingOutput:()=>n.ImageMattingOutput,ImageProcessor:()=>p.ImageProcessor,ImageSegmentationPipeline:()=>t.ImageSegmentationPipeline,ImageToImagePipeline:()=>t.ImageToImagePipeline,ImageToTextPipeline:()=>t.ImageToTextPipeline,InterruptableStoppingCriteria:()=>b.InterruptableStoppingCriteria,JAISLMHeadModel:()=>n.JAISLMHeadModel,JAISModel:()=>n.JAISModel,JAISPreTrainedModel:()=>n.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>m.JinaCLIPImageProcessor,JinaCLIPModel:()=>n.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>n.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>_.JinaCLIPProcessor,JinaCLIPTextModel:()=>n.JinaCLIPTextModel,JinaCLIPVisionModel:()=>n.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>n.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>n.LlamaForCausalLM,LlamaModel:()=>n.LlamaModel,LlamaPreTrainedModel:()=>n.LlamaPreTrainedModel,LlamaTokenizer:()=>r.LlamaTokenizer,LlavaForConditionalGeneration:()=>n.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>n.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>m.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>n.LlavaPreTrainedModel,LogitsProcessor:()=>x.LogitsProcessor,LogitsProcessorList:()=>x.LogitsProcessorList,LogitsWarper:()=>x.LogitsWarper,LongT5ForConditionalGeneration:()=>n.LongT5ForConditionalGeneration,LongT5Model:()=>n.LongT5Model,LongT5PreTrainedModel:()=>n.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>n.M2M100ForConditionalGeneration,M2M100Model:()=>n.M2M100Model,M2M100PreTrainedModel:()=>n.M2M100PreTrainedModel,M2M100Tokenizer:()=>r.M2M100Tokenizer,MBart50Tokenizer:()=>r.MBart50Tokenizer,MBartForCausalLM:()=>n.MBartForCausalLM,MBartForConditionalGeneration:()=>n.MBartForConditionalGeneration,MBartForSequenceClassification:()=>n.MBartForSequenceClassification,MBartModel:()=>n.MBartModel,MBartPreTrainedModel:()=>n.MBartPreTrainedModel,MBartTokenizer:()=>r.MBartTokenizer,MPNetForMaskedLM:()=>n.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>n.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>n.MPNetForSequenceClassification,MPNetForTokenClassification:()=>n.MPNetForTokenClassification,MPNetModel:()=>n.MPNetModel,MPNetPreTrainedModel:()=>n.MPNetPreTrainedModel,MPNetTokenizer:()=>r.MPNetTokenizer,MT5ForConditionalGeneration:()=>n.MT5ForConditionalGeneration,MT5Model:()=>n.MT5Model,MT5PreTrainedModel:()=>n.MT5PreTrainedModel,MarianMTModel:()=>n.MarianMTModel,MarianModel:()=>n.MarianModel,MarianPreTrainedModel:()=>n.MarianPreTrainedModel,MarianTokenizer:()=>r.MarianTokenizer,Mask2FormerImageProcessor:()=>m.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>m.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>n.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>m.MaskFormerImageProcessor,MaskFormerModel:()=>n.MaskFormerModel,MaskFormerPreTrainedModel:()=>n.MaskFormerPreTrainedModel,MaskedLMOutput:()=>n.MaskedLMOutput,MaxLengthCriteria:()=>b.MaxLengthCriteria,Metric3DForDepthEstimation:()=>n.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>n.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>n.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>n.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>n.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>n.MgpstrModelOutput,MgpstrPreTrainedModel:()=>n.MgpstrPreTrainedModel,MgpstrProcessor:()=>_.MgpstrProcessor,MgpstrTokenizer:()=>r.MgpstrTokenizer,MimiDecoderModel:()=>n.MimiDecoderModel,MimiDecoderOutput:()=>n.MimiDecoderOutput,MimiEncoderModel:()=>n.MimiEncoderModel,MimiEncoderOutput:()=>n.MimiEncoderOutput,MimiModel:()=>n.MimiModel,MimiPreTrainedModel:()=>n.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>x.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>x.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>n.MistralForCausalLM,MistralModel:()=>n.MistralModel,MistralPreTrainedModel:()=>n.MistralPreTrainedModel,MobileBertForMaskedLM:()=>n.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>n.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>n.MobileBertForSequenceClassification,MobileBertModel:()=>n.MobileBertModel,MobileBertPreTrainedModel:()=>n.MobileBertPreTrainedModel,MobileBertTokenizer:()=>r.MobileBertTokenizer,MobileLLMForCausalLM:()=>n.MobileLLMForCausalLM,MobileLLMModel:()=>n.MobileLLMModel,MobileLLMPreTrainedModel:()=>n.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>m.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>n.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>n.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>m.MobileNetV1ImageProcessor,MobileNetV1Model:()=>n.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>n.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>m.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>n.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>n.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>m.MobileNetV2ImageProcessor,MobileNetV2Model:()=>n.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>n.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>m.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>n.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>n.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>m.MobileNetV3ImageProcessor,MobileNetV3Model:()=>n.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>n.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>m.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>n.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>n.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>m.MobileNetV4ImageProcessor,MobileNetV4Model:()=>n.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>n.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>m.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>n.MobileViTForImageClassification,MobileViTImageProcessor:()=>m.MobileViTImageProcessor,MobileViTModel:()=>n.MobileViTModel,MobileViTPreTrainedModel:()=>n.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>n.MobileViTV2ForImageClassification,MobileViTV2Model:()=>n.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>n.MobileViTV2PreTrainedModel,ModelOutput:()=>n.ModelOutput,ModernBertForMaskedLM:()=>n.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>n.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>n.ModernBertForTokenClassification,ModernBertModel:()=>n.ModernBertModel,ModernBertPreTrainedModel:()=>n.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>n.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>d.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>n.MoonshineForConditionalGeneration,MoonshineModel:()=>n.MoonshineModel,MoonshinePreTrainedModel:()=>n.MoonshinePreTrainedModel,MoonshineProcessor:()=>_.MoonshineProcessor,MptForCausalLM:()=>n.MptForCausalLM,MptModel:()=>n.MptModel,MptPreTrainedModel:()=>n.MptPreTrainedModel,MultiModalityCausalLM:()=>n.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>n.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>n.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>n.MusicgenForConditionalGeneration,MusicgenModel:()=>n.MusicgenModel,MusicgenPreTrainedModel:()=>n.MusicgenPreTrainedModel,NllbTokenizer:()=>r.NllbTokenizer,NoBadWordsLogitsProcessor:()=>x.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>x.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>n.NomicBertModel,NomicBertPreTrainedModel:()=>n.NomicBertPreTrainedModel,NougatImageProcessor:()=>m.NougatImageProcessor,NougatTokenizer:()=>r.NougatTokenizer,OPTForCausalLM:()=>n.OPTForCausalLM,OPTModel:()=>n.OPTModel,OPTPreTrainedModel:()=>n.OPTPreTrainedModel,ObjectDetectionPipeline:()=>t.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>n.Olmo2ForCausalLM,Olmo2Model:()=>n.Olmo2Model,Olmo2PreTrainedModel:()=>n.Olmo2PreTrainedModel,OlmoForCausalLM:()=>n.OlmoForCausalLM,OlmoModel:()=>n.OlmoModel,OlmoPreTrainedModel:()=>n.OlmoPreTrainedModel,OpenELMForCausalLM:()=>n.OpenELMForCausalLM,OpenELMModel:()=>n.OpenELMModel,OpenELMPreTrainedModel:()=>n.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>m.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>n.OwlViTForObjectDetection,OwlViTImageProcessor:()=>m.OwlViTImageProcessor,OwlViTModel:()=>n.OwlViTModel,OwlViTPreTrainedModel:()=>n.OwlViTPreTrainedModel,OwlViTProcessor:()=>_.OwlViTProcessor,Owlv2ForObjectDetection:()=>n.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>m.Owlv2ImageProcessor,Owlv2Model:()=>n.Owlv2Model,Owlv2PreTrainedModel:()=>n.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>n.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>n.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>_.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>n.PatchTSMixerForPrediction,PatchTSMixerModel:()=>n.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>n.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>n.PatchTSTForPrediction,PatchTSTModel:()=>n.PatchTSTModel,PatchTSTPreTrainedModel:()=>n.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>n.Phi3ForCausalLM,Phi3Model:()=>n.Phi3Model,Phi3PreTrainedModel:()=>n.Phi3PreTrainedModel,Phi3VForCausalLM:()=>n.Phi3VForCausalLM,Phi3VImageProcessor:()=>m.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>n.Phi3VPreTrainedModel,Phi3VProcessor:()=>_.Phi3VProcessor,PhiForCausalLM:()=>n.PhiForCausalLM,PhiModel:()=>n.PhiModel,PhiPreTrainedModel:()=>n.PhiPreTrainedModel,Pipeline:()=>t.Pipeline,PreTrainedModel:()=>n.PreTrainedModel,PreTrainedTokenizer:()=>r.PreTrainedTokenizer,PretrainedConfig:()=>i.PretrainedConfig,PretrainedMixin:()=>n.PretrainedMixin,Processor:()=>g.Processor,PvtForImageClassification:()=>n.PvtForImageClassification,PvtImageProcessor:()=>m.PvtImageProcessor,PvtModel:()=>n.PvtModel,PvtPreTrainedModel:()=>n.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>d.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>n.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>n.PyAnnoteModel,PyAnnotePreTrainedModel:()=>n.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>_.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>n.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>t.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>n.Qwen2ForCausalLM,Qwen2Model:()=>n.Qwen2Model,Qwen2PreTrainedModel:()=>n.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>r.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>n.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>m.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>n.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>_.Qwen2VLProcessor,Qwen3ForCausalLM:()=>n.Qwen3ForCausalLM,Qwen3Model:()=>n.Qwen3Model,Qwen3PreTrainedModel:()=>n.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>n.RFDetrForObjectDetection,RFDetrModel:()=>n.RFDetrModel,RFDetrObjectDetectionOutput:()=>n.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>n.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>n.RTDetrForObjectDetection,RTDetrImageProcessor:()=>m.RTDetrImageProcessor,RTDetrModel:()=>n.RTDetrModel,RTDetrObjectDetectionOutput:()=>n.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>n.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>n.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>n.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>n.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>n.RTDetrV2PreTrainedModel,RawAudio:()=>a.RawAudio,RawImage:()=>o.RawImage,RawVideo:()=>s.RawVideo,RawVideoFrame:()=>s.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>x.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>n.ResNetForImageClassification,ResNetModel:()=>n.ResNetModel,ResNetPreTrainedModel:()=>n.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>n.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>n.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>n.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>n.RoFormerForTokenClassification,RoFormerModel:()=>n.RoFormerModel,RoFormerPreTrainedModel:()=>n.RoFormerPreTrainedModel,RoFormerTokenizer:()=>r.RoFormerTokenizer,RobertaForMaskedLM:()=>n.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>n.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>n.RobertaForSequenceClassification,RobertaForTokenClassification:()=>n.RobertaForTokenClassification,RobertaModel:()=>n.RobertaModel,RobertaPreTrainedModel:()=>n.RobertaPreTrainedModel,RobertaTokenizer:()=>r.RobertaTokenizer,SamImageProcessor:()=>m.SamImageProcessor,SamImageSegmentationOutput:()=>n.SamImageSegmentationOutput,SamModel:()=>n.SamModel,SamPreTrainedModel:()=>n.SamPreTrainedModel,SamProcessor:()=>_.SamProcessor,SapiensForDepthEstimation:()=>n.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>n.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>n.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>n.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>m.SegformerFeatureExtractor,SegformerForImageClassification:()=>n.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>n.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>m.SegformerImageProcessor,SegformerModel:()=>n.SegformerModel,SegformerPreTrainedModel:()=>n.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>n.Seq2SeqLMOutput,SequenceClassifierOutput:()=>n.SequenceClassifierOutput,SiglipImageProcessor:()=>m.SiglipImageProcessor,SiglipModel:()=>n.SiglipModel,SiglipPreTrainedModel:()=>n.SiglipPreTrainedModel,SiglipTextModel:()=>n.SiglipTextModel,SiglipTokenizer:()=>r.SiglipTokenizer,SiglipVisionModel:()=>n.SiglipVisionModel,SmolVLMForConditionalGeneration:()=>n.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>m.SmolVLMImageProcessor,SmolVLMProcessor:()=>_.SmolVLMProcessor,SnacDecoderModel:()=>n.SnacDecoderModel,SnacEncoderModel:()=>n.SnacEncoderModel,SnacFeatureExtractor:()=>d.SnacFeatureExtractor,SnacModel:()=>n.SnacModel,SnacPreTrainedModel:()=>n.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>d.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>n.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>n.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>n.SpeechT5HifiGan,SpeechT5Model:()=>n.SpeechT5Model,SpeechT5PreTrainedModel:()=>n.SpeechT5PreTrainedModel,SpeechT5Processor:()=>_.SpeechT5Processor,SpeechT5Tokenizer:()=>r.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>n.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>n.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>n.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>n.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>n.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>r.SqueezeBertTokenizer,StableLmForCausalLM:()=>n.StableLmForCausalLM,StableLmModel:()=>n.StableLmModel,StableLmPreTrainedModel:()=>n.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>n.Starcoder2ForCausalLM,Starcoder2Model:()=>n.Starcoder2Model,Starcoder2PreTrainedModel:()=>n.Starcoder2PreTrainedModel,StoppingCriteria:()=>b.StoppingCriteria,StoppingCriteriaList:()=>b.StoppingCriteriaList,StyleTextToSpeech2Model:()=>n.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>n.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>t.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>x.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>n.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>m.Swin2SRImageProcessor,Swin2SRModel:()=>n.Swin2SRModel,Swin2SRPreTrainedModel:()=>n.Swin2SRPreTrainedModel,SwinForImageClassification:()=>n.SwinForImageClassification,SwinForSemanticSegmentation:()=>n.SwinForSemanticSegmentation,SwinModel:()=>n.SwinModel,SwinPreTrainedModel:()=>n.SwinPreTrainedModel,T5ForConditionalGeneration:()=>n.T5ForConditionalGeneration,T5Model:()=>n.T5Model,T5PreTrainedModel:()=>n.T5PreTrainedModel,T5Tokenizer:()=>r.T5Tokenizer,TableTransformerForObjectDetection:()=>n.TableTransformerForObjectDetection,TableTransformerModel:()=>n.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>n.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>n.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>x.TemperatureLogitsWarper,Tensor:()=>c.Tensor,Text2TextGenerationPipeline:()=>t.Text2TextGenerationPipeline,TextClassificationPipeline:()=>t.TextClassificationPipeline,TextGenerationPipeline:()=>t.TextGenerationPipeline,TextStreamer:()=>y.TextStreamer,TextToAudioPipeline:()=>t.TextToAudioPipeline,TokenClassificationPipeline:()=>t.TokenClassificationPipeline,TokenClassifierOutput:()=>n.TokenClassifierOutput,TokenizerModel:()=>r.TokenizerModel,TopKLogitsWarper:()=>x.TopKLogitsWarper,TopPLogitsWarper:()=>x.TopPLogitsWarper,TrOCRForCausalLM:()=>n.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>n.TrOCRPreTrainedModel,TranslationPipeline:()=>t.TranslationPipeline,UltravoxModel:()=>n.UltravoxModel,UltravoxPreTrainedModel:()=>n.UltravoxPreTrainedModel,UltravoxProcessor:()=>_.UltravoxProcessor,UniSpeechForCTC:()=>n.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>n.UniSpeechForSequenceClassification,UniSpeechModel:()=>n.UniSpeechModel,UniSpeechPreTrainedModel:()=>n.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>n.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>n.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>n.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>n.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>n.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>_.VLChatProcessor,VLMImageProcessor:()=>m.VLMImageProcessor,ViTFeatureExtractor:()=>m.ViTFeatureExtractor,ViTForImageClassification:()=>n.ViTForImageClassification,ViTImageProcessor:()=>m.ViTImageProcessor,ViTMAEModel:()=>n.ViTMAEModel,ViTMAEPreTrainedModel:()=>n.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>n.ViTMSNForImageClassification,ViTMSNModel:()=>n.ViTMSNModel,ViTMSNPreTrainedModel:()=>n.ViTMSNPreTrainedModel,ViTModel:()=>n.ViTModel,ViTPreTrainedModel:()=>n.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>n.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>n.VitMatteForImageMatting,VitMatteImageProcessor:()=>m.VitMatteImageProcessor,VitMattePreTrainedModel:()=>n.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>n.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>m.VitPoseImageProcessor,VitPosePreTrainedModel:()=>n.VitPosePreTrainedModel,VitsModel:()=>n.VitsModel,VitsModelOutput:()=>n.VitsModelOutput,VitsPreTrainedModel:()=>n.VitsPreTrainedModel,VitsTokenizer:()=>r.VitsTokenizer,Wav2Vec2BertForCTC:()=>n.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>n.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>n.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>n.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>r.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>d.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>n.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>n.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>n.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>n.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>n.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>_.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>_.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>n.WavLMForAudioFrameClassification,WavLMForCTC:()=>n.WavLMForCTC,WavLMForSequenceClassification:()=>n.WavLMForSequenceClassification,WavLMForXVector:()=>n.WavLMForXVector,WavLMModel:()=>n.WavLMModel,WavLMPreTrainedModel:()=>n.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>d.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>n.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>n.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>d.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>n.WhisperForConditionalGeneration,WhisperModel:()=>n.WhisperModel,WhisperPreTrainedModel:()=>n.WhisperPreTrainedModel,WhisperProcessor:()=>_.WhisperProcessor,WhisperTextStreamer:()=>y.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>x.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>r.WhisperTokenizer,XLMForQuestionAnswering:()=>n.XLMForQuestionAnswering,XLMForSequenceClassification:()=>n.XLMForSequenceClassification,XLMForTokenClassification:()=>n.XLMForTokenClassification,XLMModel:()=>n.XLMModel,XLMPreTrainedModel:()=>n.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>n.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>n.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>n.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>n.XLMRobertaForTokenClassification,XLMRobertaModel:()=>n.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>n.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>r.XLMRobertaTokenizer,XLMTokenizer:()=>r.XLMTokenizer,XLMWithLMHeadModel:()=>n.XLMWithLMHeadModel,XVectorOutput:()=>n.XVectorOutput,YolosFeatureExtractor:()=>m.YolosFeatureExtractor,YolosForObjectDetection:()=>n.YolosForObjectDetection,YolosImageProcessor:()=>m.YolosImageProcessor,YolosModel:()=>n.YolosModel,YolosObjectDetectionOutput:()=>n.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>n.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>t.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>t.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>t.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>t.ZeroShotObjectDetectionPipeline,bankers_round:()=>l.bankers_round,cat:()=>c.cat,cos_sim:()=>l.cos_sim,dot:()=>l.dot,dynamic_time_warping:()=>l.dynamic_time_warping,env:()=>e.env,full:()=>c.full,full_like:()=>c.full_like,getKeyValueShapes:()=>i.getKeyValueShapes,hamming:()=>a.hamming,hanning:()=>a.hanning,interpolate:()=>c.interpolate,interpolate_4d:()=>c.interpolate_4d,interpolate_data:()=>l.interpolate_data,is_chinese_char:()=>r.is_chinese_char,layer_norm:()=>c.layer_norm,load_image:()=>o.load_image,load_video:()=>s.load_video,log_softmax:()=>l.log_softmax,magnitude:()=>l.magnitude,matmul:()=>c.matmul,max:()=>l.max,mean:()=>c.mean,mean_pooling:()=>c.mean_pooling,medianFilter:()=>l.medianFilter,mel_filter_bank:()=>a.mel_filter_bank,min:()=>l.min,ones:()=>c.ones,ones_like:()=>c.ones_like,permute:()=>c.permute,permute_data:()=>l.permute_data,pipeline:()=>t.pipeline,quantize_embeddings:()=>c.quantize_embeddings,rand:()=>c.rand,read_audio:()=>a.read_audio,rfft:()=>c.rfft,round:()=>l.round,slice:()=>c.slice,softmax:()=>l.softmax,spectrogram:()=>a.spectrogram,stack:()=>c.stack,std_mean:()=>c.std_mean,topk:()=>c.topk,window_function:()=>a.window_function,zeros:()=>c.zeros,zeros_like:()=>c.zeros_like});var e=df( +/*! ./env.js */ +`./src/env.js`),t=df( +/*! ./pipelines.js */ +`./src/pipelines.js`),n=df( +/*! ./models.js */ +`./src/models.js`),r=df( +/*! ./tokenizers.js */ +`./src/tokenizers.js`),i=df( +/*! ./configs.js */ +`./src/configs.js`),a=df( +/*! ./utils/audio.js */ +`./src/utils/audio.js`),o=df( +/*! ./utils/image.js */ +`./src/utils/image.js`),s=df( +/*! ./utils/video.js */ +`./src/utils/video.js`),c=df( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),l=df( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),u=df( +/*! ./base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),d=df( +/*! ./models/feature_extractors.js */ +`./src/models/feature_extractors.js`),f=df( +/*! ./models/auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),p=df( +/*! ./base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),m=df( +/*! ./models/image_processors.js */ +`./src/models/image_processors.js`),h=df( +/*! ./models/auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),g=df( +/*! ./base/processing_utils.js */ +`./src/base/processing_utils.js`),_=df( +/*! ./models/processors.js */ +`./src/models/processors.js`),v=df( +/*! ./models/auto/processing_auto.js */ +`./src/models/auto/processing_auto.js`),y=df( +/*! ./generation/streamers.js */ +`./src/generation/streamers.js`),b=df( +/*! ./generation/stopping_criteria.js */ +`./src/generation/stopping_criteria.js`),x=df( +/*! ./generation/logits_process.js */ +`./src/generation/logits_process.js`)})();var ff=$.ASTFeatureExtractor,pf=$.ASTForAudioClassification,mf=$.ASTModel,hf=$.ASTPreTrainedModel,gf=$.AlbertForMaskedLM,_f=$.AlbertForQuestionAnswering,vf=$.AlbertForSequenceClassification,yf=$.AlbertModel,bf=$.AlbertPreTrainedModel,xf=$.AlbertTokenizer,Sf=$.AudioClassificationPipeline,Cf=$.AutoConfig,wf=$.AutoFeatureExtractor,Tf=$.AutoImageProcessor,Ef=$.AutoModel,Df=$.AutoModelForAudioClassification,Of=$.AutoModelForAudioFrameClassification,kf=$.AutoModelForAudioTextToText,Af=$.AutoModelForCTC,jf=$.AutoModelForCausalLM,Mf=$.AutoModelForDepthEstimation,Nf=$.AutoModelForDocumentQuestionAnswering,Pf=$.AutoModelForImageClassification,Ff=$.AutoModelForImageFeatureExtraction,If=$.AutoModelForImageMatting,Lf=$.AutoModelForImageSegmentation,Rf=$.AutoModelForImageTextToText,zf=$.AutoModelForImageToImage,Bf=$.AutoModelForMaskGeneration,Vf=$.AutoModelForMaskedLM,Hf=$.AutoModelForNormalEstimation,Uf=$.AutoModelForObjectDetection,Wf=$.AutoModelForPoseEstimation,Gf=$.AutoModelForQuestionAnswering,Kf=$.AutoModelForSemanticSegmentation,qf=$.AutoModelForSeq2SeqLM,Jf=$.AutoModelForSequenceClassification,Yf=$.AutoModelForSpeechSeq2Seq,Xf=$.AutoModelForTextToSpectrogram,Zf=$.AutoModelForTextToWaveform,Qf=$.AutoModelForTokenClassification,$f=$.AutoModelForUniversalSegmentation,ep=$.AutoModelForVision2Seq,tp=$.AutoModelForXVector,np=$.AutoModelForZeroShotObjectDetection,rp=$.AutoProcessor,ip=$.AutoTokenizer,ap=$.AutomaticSpeechRecognitionPipeline,op=$.BackgroundRemovalPipeline,sp=$.BartForConditionalGeneration,cp=$.BartForSequenceClassification,lp=$.BartModel,up=$.BartPretrainedModel,dp=$.BartTokenizer,fp=$.BaseModelOutput,pp=$.BaseStreamer,mp=$.BeitFeatureExtractor,hp=$.BeitForImageClassification,gp=$.BeitModel,_p=$.BeitPreTrainedModel,vp=$.BertForMaskedLM,yp=$.BertForQuestionAnswering,bp=$.BertForSequenceClassification,xp=$.BertForTokenClassification,Sp=$.BertModel,Cp=$.BertPreTrainedModel,wp=$.BertTokenizer,Tp=$.BitImageProcessor,Ep=$.BlenderbotForConditionalGeneration,Dp=$.BlenderbotModel,Op=$.BlenderbotPreTrainedModel,kp=$.BlenderbotSmallForConditionalGeneration,Ap=$.BlenderbotSmallModel,jp=$.BlenderbotSmallPreTrainedModel,Mp=$.BlenderbotSmallTokenizer,Np=$.BlenderbotTokenizer,Pp=$.BloomForCausalLM,Fp=$.BloomModel,Ip=$.BloomPreTrainedModel,Lp=$.BloomTokenizer,Rp=$.CLIPFeatureExtractor,zp=$.CLIPImageProcessor,Bp=$.CLIPModel,Vp=$.CLIPPreTrainedModel,Hp=$.CLIPSegForImageSegmentation,Up=$.CLIPSegModel,Wp=$.CLIPSegPreTrainedModel,Gp=$.CLIPTextModel,Kp=$.CLIPTextModelWithProjection,qp=$.CLIPTokenizer,Jp=$.CLIPVisionModel,Yp=$.CLIPVisionModelWithProjection,Xp=$.CamembertForMaskedLM,Zp=$.CamembertForQuestionAnswering,Qp=$.CamembertForSequenceClassification,$p=$.CamembertForTokenClassification,em=$.CamembertModel,tm=$.CamembertPreTrainedModel,nm=$.CamembertTokenizer,rm=$.CausalLMOutput,im=$.CausalLMOutputWithPast,am=$.ChineseCLIPFeatureExtractor,om=$.ChineseCLIPModel,sm=$.ChineseCLIPPreTrainedModel,cm=$.ClapAudioModelWithProjection,lm=$.ClapFeatureExtractor,um=$.ClapModel,dm=$.ClapPreTrainedModel,fm=$.ClapTextModelWithProjection,pm=$.ClassifierFreeGuidanceLogitsProcessor,mm=$.CodeGenForCausalLM,hm=$.CodeGenModel,gm=$.CodeGenPreTrainedModel,_m=$.CodeGenTokenizer,vm=$.CodeLlamaTokenizer,ym=$.CohereForCausalLM,bm=$.CohereModel,xm=$.CoherePreTrainedModel,Sm=$.CohereTokenizer,Cm=$.ConvBertForMaskedLM,wm=$.ConvBertForQuestionAnswering,Tm=$.ConvBertForSequenceClassification,Em=$.ConvBertForTokenClassification,Dm=$.ConvBertModel,Om=$.ConvBertPreTrainedModel,km=$.ConvBertTokenizer,Am=$.ConvNextFeatureExtractor,jm=$.ConvNextForImageClassification,Mm=$.ConvNextImageProcessor,Nm=$.ConvNextModel,Pm=$.ConvNextPreTrainedModel,Fm=$.ConvNextV2ForImageClassification,Im=$.ConvNextV2Model,Lm=$.ConvNextV2PreTrainedModel,Rm=$.DFineForObjectDetection,zm=$.DFineModel,Bm=$.DFinePreTrainedModel,Vm=$.DPTFeatureExtractor,Hm=$.DPTForDepthEstimation,Um=$.DPTImageProcessor,Wm=$.DPTModel,Gm=$.DPTPreTrainedModel,Km=$.DacDecoderModel,qm=$.DacDecoderOutput,Jm=$.DacEncoderModel,Ym=$.DacEncoderOutput,Xm=$.DacFeatureExtractor,Zm=$.DacModel,Qm=$.DacPreTrainedModel,$m=$.DataTypeMap,eh=$.DebertaForMaskedLM,th=$.DebertaForQuestionAnswering,nh=$.DebertaForSequenceClassification,rh=$.DebertaForTokenClassification,ih=$.DebertaModel,ah=$.DebertaPreTrainedModel,oh=$.DebertaTokenizer,sh=$.DebertaV2ForMaskedLM,ch=$.DebertaV2ForQuestionAnswering,lh=$.DebertaV2ForSequenceClassification,uh=$.DebertaV2ForTokenClassification,dh=$.DebertaV2Model,fh=$.DebertaV2PreTrainedModel,ph=$.DebertaV2Tokenizer,mh=$.DecisionTransformerModel,hh=$.DecisionTransformerPreTrainedModel,gh=$.DeiTFeatureExtractor,_h=$.DeiTForImageClassification,vh=$.DeiTImageProcessor,yh=$.DeiTModel,bh=$.DeiTPreTrainedModel,xh=$.DepthAnythingForDepthEstimation,Sh=$.DepthAnythingPreTrainedModel,Ch=$.DepthEstimationPipeline,wh=$.DepthProForDepthEstimation,Th=$.DepthProPreTrainedModel,Eh=$.DetrFeatureExtractor,Dh=$.DetrForObjectDetection,Oh=$.DetrForSegmentation,kh=$.DetrImageProcessor,Ah=$.DetrModel,jh=$.DetrObjectDetectionOutput,Mh=$.DetrPreTrainedModel,Nh=$.DetrSegmentationOutput,Ph=$.Dinov2ForImageClassification,Fh=$.Dinov2Model,Ih=$.Dinov2PreTrainedModel,Lh=$.Dinov2WithRegistersForImageClassification,Rh=$.Dinov2WithRegistersModel,zh=$.Dinov2WithRegistersPreTrainedModel,Bh=$.DistilBertForMaskedLM,Vh=$.DistilBertForQuestionAnswering,Hh=$.DistilBertForSequenceClassification,Uh=$.DistilBertForTokenClassification,Wh=$.DistilBertModel,Gh=$.DistilBertPreTrainedModel,Kh=$.DistilBertTokenizer,qh=$.DocumentQuestionAnsweringPipeline,Jh=$.DonutFeatureExtractor,Yh=$.DonutImageProcessor,Xh=$.DonutSwinModel,Zh=$.DonutSwinPreTrainedModel,Qh=$.EfficientNetForImageClassification,$h=$.EfficientNetImageProcessor,eg=$.EfficientNetModel,tg=$.EfficientNetPreTrainedModel,ng=$.ElectraForMaskedLM,rg=$.ElectraForQuestionAnswering,ig=$.ElectraForSequenceClassification,ag=$.ElectraForTokenClassification,og=$.ElectraModel,sg=$.ElectraPreTrainedModel,cg=$.ElectraTokenizer,lg=$.EncodecFeatureExtractor,ug=$.EosTokenCriteria,dg=$.EsmForMaskedLM,fg=$.EsmForSequenceClassification,pg=$.EsmForTokenClassification,mg=$.EsmModel,hg=$.EsmPreTrainedModel,gg=$.EsmTokenizer,_g=$.ExaoneForCausalLM,vg=$.ExaoneModel,yg=$.ExaonePreTrainedModel,bg=$.FFT,xg=$.FalconForCausalLM,Sg=$.FalconModel,Cg=$.FalconPreTrainedModel,wg=$.FalconTokenizer,Tg=$.FastViTForImageClassification,Eg=$.FastViTModel,Dg=$.FastViTPreTrainedModel,Og=$.FeatureExtractionPipeline,kg=$.FeatureExtractor,Ag=$.FillMaskPipeline,jg=$.Florence2ForConditionalGeneration,Mg=$.Florence2PreTrainedModel,Ng=$.Florence2Processor,Pg=$.ForcedBOSTokenLogitsProcessor,Fg=$.ForcedEOSTokenLogitsProcessor,Ig=$.GLPNFeatureExtractor,Lg=$.GLPNForDepthEstimation,Rg=$.GLPNModel,zg=$.GLPNPreTrainedModel,Bg=$.GPT2LMHeadModel,Vg=$.GPT2Model,Hg=$.GPT2PreTrainedModel,Ug=$.GPT2Tokenizer,Wg=$.GPTBigCodeForCausalLM,Gg=$.GPTBigCodeModel,Kg=$.GPTBigCodePreTrainedModel,qg=$.GPTJForCausalLM,Jg=$.GPTJModel,Yg=$.GPTJPreTrainedModel,Xg=$.GPTNeoForCausalLM,Zg=$.GPTNeoModel,Qg=$.GPTNeoPreTrainedModel,$g=$.GPTNeoXForCausalLM,e_=$.GPTNeoXModel,t_=$.GPTNeoXPreTrainedModel,n_=$.GPTNeoXTokenizer,r_=$.Gemma2ForCausalLM,i_=$.Gemma2Model,a_=$.Gemma2PreTrainedModel,o_=$.Gemma3ForCausalLM,s_=$.Gemma3Model,c_=$.Gemma3PreTrainedModel,l_=$.GemmaForCausalLM,u_=$.GemmaModel,d_=$.GemmaPreTrainedModel,f_=$.GemmaTokenizer,p_=$.GlmForCausalLM,m_=$.GlmModel,h_=$.GlmPreTrainedModel,g_=$.GraniteForCausalLM,__=$.GraniteModel,v_=$.GranitePreTrainedModel,y_=$.Grok1Tokenizer,b_=$.GroundingDinoForObjectDetection,x_=$.GroundingDinoImageProcessor,S_=$.GroundingDinoPreTrainedModel,C_=$.GroundingDinoProcessor,w_=$.GroupViTModel,T_=$.GroupViTPreTrainedModel,E_=$.HeliumForCausalLM,D_=$.HeliumModel,O_=$.HeliumPreTrainedModel,k_=$.HerbertTokenizer,A_=$.HieraForImageClassification,j_=$.HieraModel,M_=$.HieraPreTrainedModel,N_=$.HubertForCTC,P_=$.HubertForSequenceClassification,F_=$.HubertModel,I_=$.HubertPreTrainedModel,L_=$.IJepaForImageClassification,R_=$.IJepaModel,z_=$.IJepaPreTrainedModel,B_=$.Idefics3ForConditionalGeneration,V_=$.Idefics3ImageProcessor,H_=$.Idefics3PreTrainedModel,U_=$.Idefics3Processor,W_=$.ImageClassificationPipeline,G_=$.ImageFeatureExtractionPipeline,K_=$.ImageFeatureExtractor,q_=$.ImageMattingOutput,J_=$.ImageProcessor,Y_=$.ImageSegmentationPipeline,X_=$.ImageToImagePipeline,Z_=$.ImageToTextPipeline,Q_=$.InterruptableStoppingCriteria,$_=$.JAISLMHeadModel,ev=$.JAISModel,tv=$.JAISPreTrainedModel,nv=$.JinaCLIPImageProcessor,rv=$.JinaCLIPModel,iv=$.JinaCLIPPreTrainedModel,av=$.JinaCLIPProcessor,ov=$.JinaCLIPTextModel,sv=$.JinaCLIPVisionModel,cv=$.LiteWhisperForConditionalGeneration,lv=$.LlamaForCausalLM,uv=$.LlamaModel,dv=$.LlamaPreTrainedModel,fv=$.LlamaTokenizer,pv=$.LlavaForConditionalGeneration,mv=$.LlavaOnevisionForConditionalGeneration,hv=$.LlavaOnevisionImageProcessor,gv=$.LlavaPreTrainedModel,_v=$.LogitsProcessor,vv=$.LogitsProcessorList,yv=$.LogitsWarper,bv=$.LongT5ForConditionalGeneration,xv=$.LongT5Model,Sv=$.LongT5PreTrainedModel,Cv=$.M2M100ForConditionalGeneration,wv=$.M2M100Model,Tv=$.M2M100PreTrainedModel,Ev=$.M2M100Tokenizer,Dv=$.MBart50Tokenizer,Ov=$.MBartForCausalLM,kv=$.MBartForConditionalGeneration,Av=$.MBartForSequenceClassification,jv=$.MBartModel,Mv=$.MBartPreTrainedModel,Nv=$.MBartTokenizer,Pv=$.MPNetForMaskedLM,Fv=$.MPNetForQuestionAnswering,Iv=$.MPNetForSequenceClassification,Lv=$.MPNetForTokenClassification,Rv=$.MPNetModel,zv=$.MPNetPreTrainedModel,Bv=$.MPNetTokenizer,Vv=$.MT5ForConditionalGeneration,Hv=$.MT5Model,Uv=$.MT5PreTrainedModel,Wv=$.MarianMTModel,Gv=$.MarianModel,Kv=$.MarianPreTrainedModel,qv=$.MarianTokenizer,Jv=$.Mask2FormerImageProcessor,Yv=$.MaskFormerFeatureExtractor,Xv=$.MaskFormerForInstanceSegmentation,Zv=$.MaskFormerImageProcessor,Qv=$.MaskFormerModel,$v=$.MaskFormerPreTrainedModel,ey=$.MaskedLMOutput,ty=$.MaxLengthCriteria,ny=$.Metric3DForDepthEstimation,ry=$.Metric3DPreTrainedModel,iy=$.Metric3Dv2ForDepthEstimation,ay=$.Metric3Dv2PreTrainedModel,oy=$.MgpstrForSceneTextRecognition,sy=$.MgpstrModelOutput,cy=$.MgpstrPreTrainedModel,ly=$.MgpstrProcessor,uy=$.MgpstrTokenizer,dy=$.MimiDecoderModel,fy=$.MimiDecoderOutput,py=$.MimiEncoderModel,my=$.MimiEncoderOutput,hy=$.MimiModel,gy=$.MimiPreTrainedModel,_y=$.MinLengthLogitsProcessor,vy=$.MinNewTokensLengthLogitsProcessor,yy=$.MistralForCausalLM,by=$.MistralModel,xy=$.MistralPreTrainedModel,Sy=$.MobileBertForMaskedLM,Cy=$.MobileBertForQuestionAnswering,wy=$.MobileBertForSequenceClassification,Ty=$.MobileBertModel,Ey=$.MobileBertPreTrainedModel,Dy=$.MobileBertTokenizer,Oy=$.MobileLLMForCausalLM,ky=$.MobileLLMModel,Ay=$.MobileLLMPreTrainedModel,jy=$.MobileNetV1FeatureExtractor,My=$.MobileNetV1ForImageClassification,Ny=$.MobileNetV1ForSemanticSegmentation,Py=$.MobileNetV1ImageProcessor,Fy=$.MobileNetV1Model,Iy=$.MobileNetV1PreTrainedModel,Ly=$.MobileNetV2FeatureExtractor,Ry=$.MobileNetV2ForImageClassification,zy=$.MobileNetV2ForSemanticSegmentation,By=$.MobileNetV2ImageProcessor,Vy=$.MobileNetV2Model,Hy=$.MobileNetV2PreTrainedModel,Uy=$.MobileNetV3FeatureExtractor,Wy=$.MobileNetV3ForImageClassification,Gy=$.MobileNetV3ForSemanticSegmentation,Ky=$.MobileNetV3ImageProcessor,qy=$.MobileNetV3Model,Jy=$.MobileNetV3PreTrainedModel,Yy=$.MobileNetV4FeatureExtractor,Xy=$.MobileNetV4ForImageClassification,Zy=$.MobileNetV4ForSemanticSegmentation,Qy=$.MobileNetV4ImageProcessor,$y=$.MobileNetV4Model,eb=$.MobileNetV4PreTrainedModel,tb=$.MobileViTFeatureExtractor,nb=$.MobileViTForImageClassification,rb=$.MobileViTImageProcessor,ib=$.MobileViTModel,ab=$.MobileViTPreTrainedModel,ob=$.MobileViTV2ForImageClassification,sb=$.MobileViTV2Model,cb=$.MobileViTV2PreTrainedModel,lb=$.ModelOutput,ub=$.ModernBertForMaskedLM,db=$.ModernBertForSequenceClassification,fb=$.ModernBertForTokenClassification,pb=$.ModernBertModel,mb=$.ModernBertPreTrainedModel,hb=$.Moondream1ForConditionalGeneration,gb=$.MoonshineFeatureExtractor,_b=$.MoonshineForConditionalGeneration,vb=$.MoonshineModel,yb=$.MoonshinePreTrainedModel,bb=$.MoonshineProcessor,xb=$.MptForCausalLM,Sb=$.MptModel,Cb=$.MptPreTrainedModel,wb=$.MultiModalityCausalLM,Tb=$.MultiModalityPreTrainedModel,Eb=$.MusicgenForCausalLM,Db=$.MusicgenForConditionalGeneration,Ob=$.MusicgenModel,kb=$.MusicgenPreTrainedModel,Ab=$.NllbTokenizer,jb=$.NoBadWordsLogitsProcessor,Mb=$.NoRepeatNGramLogitsProcessor,Nb=$.NomicBertModel,Pb=$.NomicBertPreTrainedModel,Fb=$.NougatImageProcessor,Ib=$.NougatTokenizer,Lb=$.OPTForCausalLM,Rb=$.OPTModel,zb=$.OPTPreTrainedModel,Bb=$.ObjectDetectionPipeline,Vb=$.Olmo2ForCausalLM,Hb=$.Olmo2Model,Ub=$.Olmo2PreTrainedModel,Wb=$.OlmoForCausalLM,Gb=$.OlmoModel,Kb=$.OlmoPreTrainedModel,qb=$.OpenELMForCausalLM,Jb=$.OpenELMModel,Yb=$.OpenELMPreTrainedModel,Xb=$.OwlViTFeatureExtractor,Zb=$.OwlViTForObjectDetection,Qb=$.OwlViTImageProcessor,$b=$.OwlViTModel,ex=$.OwlViTPreTrainedModel,tx=$.OwlViTProcessor,nx=$.Owlv2ForObjectDetection,rx=$.Owlv2ImageProcessor,ix=$.Owlv2Model,ax=$.Owlv2PreTrainedModel,ox=$.PaliGemmaForConditionalGeneration,sx=$.PaliGemmaPreTrainedModel,cx=$.PaliGemmaProcessor,lx=$.PatchTSMixerForPrediction,ux=$.PatchTSMixerModel,dx=$.PatchTSMixerPreTrainedModel,fx=$.PatchTSTForPrediction,px=$.PatchTSTModel,mx=$.PatchTSTPreTrainedModel,hx=$.Phi3ForCausalLM,gx=$.Phi3Model,_x=$.Phi3PreTrainedModel,vx=$.Phi3VForCausalLM,yx=$.Phi3VImageProcessor,bx=$.Phi3VPreTrainedModel,xx=$.Phi3VProcessor,Sx=$.PhiForCausalLM,Cx=$.PhiModel,wx=$.PhiPreTrainedModel,Tx=$.Pipeline,Ex=$.PreTrainedModel,Dx=$.PreTrainedTokenizer,Ox=$.PretrainedConfig,kx=$.PretrainedMixin,Ax=$.Processor,jx=$.PvtForImageClassification,Mx=$.PvtImageProcessor,Nx=$.PvtModel,Px=$.PvtPreTrainedModel,Fx=$.PyAnnoteFeatureExtractor,Ix=$.PyAnnoteForAudioFrameClassification,Lx=$.PyAnnoteModel,Rx=$.PyAnnotePreTrainedModel,zx=$.PyAnnoteProcessor,Bx=$.QuestionAnsweringModelOutput,Vx=$.QuestionAnsweringPipeline,Hx=$.Qwen2ForCausalLM,Ux=$.Qwen2Model,Wx=$.Qwen2PreTrainedModel,Gx=$.Qwen2Tokenizer,Kx=$.Qwen2VLForConditionalGeneration,qx=$.Qwen2VLImageProcessor,Jx=$.Qwen2VLPreTrainedModel,Yx=$.Qwen2VLProcessor,Xx=$.Qwen3ForCausalLM,Zx=$.Qwen3Model,Qx=$.Qwen3PreTrainedModel,$x=$.RFDetrForObjectDetection,eS=$.RFDetrModel,tS=$.RFDetrObjectDetectionOutput,nS=$.RFDetrPreTrainedModel,rS=$.RTDetrForObjectDetection,iS=$.RTDetrImageProcessor,aS=$.RTDetrModel,oS=$.RTDetrObjectDetectionOutput,sS=$.RTDetrPreTrainedModel,cS=$.RTDetrV2ForObjectDetection,lS=$.RTDetrV2Model,uS=$.RTDetrV2ObjectDetectionOutput,dS=$.RTDetrV2PreTrainedModel,fS=$.RawAudio,pS=$.RawImage,mS=$.RawVideo,hS=$.RawVideoFrame,gS=$.RepetitionPenaltyLogitsProcessor,_S=$.ResNetForImageClassification,vS=$.ResNetModel,yS=$.ResNetPreTrainedModel,bS=$.RoFormerForMaskedLM,xS=$.RoFormerForQuestionAnswering,SS=$.RoFormerForSequenceClassification,CS=$.RoFormerForTokenClassification,wS=$.RoFormerModel,TS=$.RoFormerPreTrainedModel,ES=$.RoFormerTokenizer,DS=$.RobertaForMaskedLM,OS=$.RobertaForQuestionAnswering,kS=$.RobertaForSequenceClassification,AS=$.RobertaForTokenClassification,jS=$.RobertaModel,MS=$.RobertaPreTrainedModel,NS=$.RobertaTokenizer,PS=$.SamImageProcessor,FS=$.SamImageSegmentationOutput,IS=$.SamModel,LS=$.SamPreTrainedModel,RS=$.SamProcessor,zS=$.SapiensForDepthEstimation,BS=$.SapiensForNormalEstimation,VS=$.SapiensForSemanticSegmentation,HS=$.SapiensPreTrainedModel,US=$.SeamlessM4TFeatureExtractor,WS=$.SegformerFeatureExtractor,GS=$.SegformerForImageClassification,KS=$.SegformerForSemanticSegmentation,qS=$.SegformerImageProcessor,JS=$.SegformerModel,YS=$.SegformerPreTrainedModel,XS=$.Seq2SeqLMOutput,ZS=$.SequenceClassifierOutput,QS=$.SiglipImageProcessor,$S=$.SiglipModel,eC=$.SiglipPreTrainedModel,tC=$.SiglipTextModel,nC=$.SiglipTokenizer,rC=$.SiglipVisionModel,iC=$.SmolVLMForConditionalGeneration,aC=$.SmolVLMImageProcessor,oC=$.SmolVLMProcessor,sC=$.SnacDecoderModel,cC=$.SnacEncoderModel,lC=$.SnacFeatureExtractor,uC=$.SnacModel,dC=$.SnacPreTrainedModel,fC=$.SpeechT5FeatureExtractor,pC=$.SpeechT5ForSpeechToText,mC=$.SpeechT5ForTextToSpeech,hC=$.SpeechT5HifiGan,gC=$.SpeechT5Model,_C=$.SpeechT5PreTrainedModel,vC=$.SpeechT5Processor,yC=$.SpeechT5Tokenizer,bC=$.SqueezeBertForMaskedLM,xC=$.SqueezeBertForQuestionAnswering,SC=$.SqueezeBertForSequenceClassification,CC=$.SqueezeBertModel,wC=$.SqueezeBertPreTrainedModel,TC=$.SqueezeBertTokenizer,EC=$.StableLmForCausalLM,DC=$.StableLmModel,OC=$.StableLmPreTrainedModel,kC=$.Starcoder2ForCausalLM,AC=$.Starcoder2Model,jC=$.Starcoder2PreTrainedModel,MC=$.StoppingCriteria,NC=$.StoppingCriteriaList,PC=$.StyleTextToSpeech2Model,FC=$.StyleTextToSpeech2PreTrainedModel,IC=$.SummarizationPipeline,LC=$.SuppressTokensAtBeginLogitsProcessor,RC=$.Swin2SRForImageSuperResolution,zC=$.Swin2SRImageProcessor,BC=$.Swin2SRModel,VC=$.Swin2SRPreTrainedModel,HC=$.SwinForImageClassification,UC=$.SwinForSemanticSegmentation,WC=$.SwinModel,GC=$.SwinPreTrainedModel,KC=$.T5ForConditionalGeneration,qC=$.T5Model,JC=$.T5PreTrainedModel,YC=$.T5Tokenizer,XC=$.TableTransformerForObjectDetection,ZC=$.TableTransformerModel,QC=$.TableTransformerObjectDetectionOutput,$C=$.TableTransformerPreTrainedModel,ew=$.TemperatureLogitsWarper,tw=$.Tensor,nw=$.Text2TextGenerationPipeline,rw=$.TextClassificationPipeline,iw=$.TextGenerationPipeline,aw=$.TextStreamer,ow=$.TextToAudioPipeline,sw=$.TokenClassificationPipeline,cw=$.TokenClassifierOutput,lw=$.TokenizerModel,uw=$.TopKLogitsWarper,dw=$.TopPLogitsWarper,fw=$.TrOCRForCausalLM,pw=$.TrOCRPreTrainedModel,mw=$.TranslationPipeline,hw=$.UltravoxModel,gw=$.UltravoxPreTrainedModel,_w=$.UltravoxProcessor,vw=$.UniSpeechForCTC,yw=$.UniSpeechForSequenceClassification,bw=$.UniSpeechModel,xw=$.UniSpeechPreTrainedModel,Sw=$.UniSpeechSatForAudioFrameClassification,Cw=$.UniSpeechSatForCTC,ww=$.UniSpeechSatForSequenceClassification,Tw=$.UniSpeechSatModel,Ew=$.UniSpeechSatPreTrainedModel,Dw=$.VLChatProcessor,Ow=$.VLMImageProcessor,kw=$.ViTFeatureExtractor,Aw=$.ViTForImageClassification,jw=$.ViTImageProcessor,Mw=$.ViTMAEModel,Nw=$.ViTMAEPreTrainedModel,Pw=$.ViTMSNForImageClassification,Fw=$.ViTMSNModel,Iw=$.ViTMSNPreTrainedModel,Lw=$.ViTModel,Rw=$.ViTPreTrainedModel,zw=$.VisionEncoderDecoderModel,Bw=$.VitMatteForImageMatting,Vw=$.VitMatteImageProcessor,Hw=$.VitMattePreTrainedModel,Uw=$.VitPoseForPoseEstimation,Ww=$.VitPoseImageProcessor,Gw=$.VitPosePreTrainedModel,Kw=$.VitsModel,qw=$.VitsModelOutput,Jw=$.VitsPreTrainedModel,Yw=$.VitsTokenizer,Xw=$.Wav2Vec2BertForCTC,Zw=$.Wav2Vec2BertForSequenceClassification,Qw=$.Wav2Vec2BertModel,$w=$.Wav2Vec2BertPreTrainedModel,eT=$.Wav2Vec2CTCTokenizer,tT=$.Wav2Vec2FeatureExtractor,nT=$.Wav2Vec2ForAudioFrameClassification,rT=$.Wav2Vec2ForCTC,iT=$.Wav2Vec2ForSequenceClassification,aT=$.Wav2Vec2Model,oT=$.Wav2Vec2PreTrainedModel,sT=$.Wav2Vec2Processor,cT=$.Wav2Vec2ProcessorWithLM,lT=$.WavLMForAudioFrameClassification,uT=$.WavLMForCTC,dT=$.WavLMForSequenceClassification,fT=$.WavLMForXVector,pT=$.WavLMModel,mT=$.WavLMPreTrainedModel,hT=$.WeSpeakerFeatureExtractor,gT=$.WeSpeakerResNetModel,_T=$.WeSpeakerResNetPreTrainedModel,vT=$.WhisperFeatureExtractor,yT=$.WhisperForConditionalGeneration,bT=$.WhisperModel,xT=$.WhisperPreTrainedModel,ST=$.WhisperProcessor,CT=$.WhisperTextStreamer,wT=$.WhisperTimeStampLogitsProcessor,TT=$.WhisperTokenizer,ET=$.XLMForQuestionAnswering,DT=$.XLMForSequenceClassification,OT=$.XLMForTokenClassification,kT=$.XLMModel,AT=$.XLMPreTrainedModel,jT=$.XLMRobertaForMaskedLM,MT=$.XLMRobertaForQuestionAnswering,NT=$.XLMRobertaForSequenceClassification,PT=$.XLMRobertaForTokenClassification,FT=$.XLMRobertaModel,IT=$.XLMRobertaPreTrainedModel,LT=$.XLMRobertaTokenizer,RT=$.XLMTokenizer,zT=$.XLMWithLMHeadModel,BT=$.XVectorOutput,VT=$.YolosFeatureExtractor,HT=$.YolosForObjectDetection,UT=$.YolosImageProcessor,WT=$.YolosModel,GT=$.YolosObjectDetectionOutput,KT=$.YolosPreTrainedModel,qT=$.ZeroShotAudioClassificationPipeline,JT=$.ZeroShotClassificationPipeline,YT=$.ZeroShotImageClassificationPipeline,XT=$.ZeroShotObjectDetectionPipeline,ZT=$.bankers_round,QT=$.cat,$T=$.cos_sim,eE=$.dot,tE=$.dynamic_time_warping,nE=$.env,rE=$.full,iE=$.full_like,aE=$.getKeyValueShapes,oE=$.hamming,sE=$.hanning,cE=$.interpolate,lE=$.interpolate_4d,uE=$.interpolate_data,dE=$.is_chinese_char,fE=$.layer_norm,pE=$.load_image,mE=$.load_video,hE=$.log_softmax,gE=$.magnitude,_E=$.matmul,vE=$.max,yE=$.mean,bE=$.mean_pooling,xE=$.medianFilter,SE=$.mel_filter_bank,CE=$.min,wE=$.ones,TE=$.ones_like,EE=$.permute,DE=$.permute_data,OE=$.pipeline,kE=$.quantize_embeddings,AE=$.rand,jE=$.read_audio,ME=$.rfft,NE=$.round,PE=$.slice,FE=$.softmax,IE=$.spectrogram,LE=$.stack,RE=$.std_mean,zE=$.topk,BE=$.window_function,VE=$.zeros,HE=$.zeros_like;let UE=64;var WE=(t=class{static async getInstance(e){return this.model_id=`onnx-community/whisper-large-v3-turbo`,this.tokenizer??=ip.from_pretrained(this.model_id,{progress_callback:e}),this.processor??=rp.from_pretrained(this.model_id,{progress_callback:e}),this.model??=yT.from_pretrained(this.model_id,{dtype:{encoder_model:`fp16`,decoder_model_merged:`q4`},device:`webgpu`,progress_callback:e}),Promise.all([this.tokenizer,this.processor,this.model])}},e.defineProperty(t,`model_id`,null),e.defineProperty(t,`tokenizer`,void 0),e.defineProperty(t,`processor`,void 0),e.defineProperty(t,`model`,void 0),t);async function GE(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e{o??=performance.now();let t;s++>0&&(t=s/(performance.now()-o)*1e3),globalThis.postMessage({status:`update`,output:e,tps:t,numTokens:s})},l=new aw(r,{skip_prompt:!0,decode_kwargs:{skip_special_tokens:!0},callback_function:c}),u=await i(n),d=await a.generate({...u,max_new_tokens:UE,language:t,streamer:l}),f=r.batch_decode(d,{skip_special_tokens:!0});globalThis.postMessage({status:`complete`,output:f}),KE=!1}async function JE(){globalThis.postMessage({status:`loading`,data:`Loading model...`});let[e,t,n]=await WE.getInstance(e=>{globalThis.postMessage(e)});globalThis.postMessage({status:`loading`,data:`Compiling shaders and warming up model...`}),await n.generate({input_features:rE([1,128,3e3],0),max_new_tokens:1}),globalThis.postMessage({status:`ready`})}globalThis.addEventListener(`message`,async e=>{let{type:t,data:n}=e.data;switch(t){case`load`:JE();break;case`generate`:qE(n);break}})})(); \ No newline at end of file diff --git a/assets/worker-BwSRVkNn.js b/assets/worker-BwSRVkNn.js deleted file mode 100644 index d040bf2cd4f8d7fcb6078d20dd68de41b2d7cd59..0000000000000000000000000000000000000000 --- a/assets/worker-BwSRVkNn.js +++ /dev/null @@ -1,2888 +0,0 @@ -var rT=Object.defineProperty;var sT=(Cs,jr,Ln)=>jr in Cs?rT(Cs,jr,{enumerable:!0,configurable:!0,writable:!0,value:Ln}):Cs[jr]=Ln;var Y=(Cs,jr,Ln)=>sT(Cs,typeof jr!="symbol"?jr+"":jr,Ln);(function(){"use strict";const Cs=new Map,jr=[],Ln=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=Cs.get(e);if(s===void 0)Cs.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){const o=jr.indexOf(e);o!==-1&&jr.splice(o,1);for(let n=0;n{const r=Cs.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{const t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},K0=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?jr:t;let o;const n=[],i=new Set;for(const l of s){const u=await G0(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);const a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]},H0="1.22.0";let Ec="warning";const ds={wasm:{},webgl:{},webgpu:{},versions:{common:H0},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);Ec=e}},get logLevel(){return Ec}};Object.defineProperty(ds,"logLevel",{enumerable:!0});const q0=ds,Q0=(e,r)=>{const t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];const s=t.getContext("2d");if(s!=null){let o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);const i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,u;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));const p=n*o;let c=0,d=p,_=p*2,f=-1;i==="RGBA"?(c=0,d=p,_=p*2,f=p*3):i==="RGB"?(c=0,d=p,_=p*2):i==="RBG"&&(c=0,_=p,d=p*2);for(let T=0;T{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));const c=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const d=4;let _=0,f=1,T=2,k=3,g=0,w=c,S=c*2,E=-1;a==="RGBA"?(g=0,w=c,S=c*2,E=c*3):a==="RGB"?(g=0,w=c,S=c*2):a==="RBG"&&(g=0,S=c,w=c*2),s=t.createImageData(o,n);for(let v=0;v{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");const{height:t,width:s}=r,o=r.norm??{mean:255,bias:0};let n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3);let c=4,d=0,_=1,f=2,T=3,k=0,g=u,w=u*2,S=-1;a==="RGB"&&(c=3,d=0,_=1,f=2,T=-1),l==="RGBA"?S=u*3:l==="RBG"?(k=0,w=u,g=u*2):l==="BGR"&&(w=0,g=u,k=u*2);for(let v=0;v{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let i,a=r??{};const l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){const p=l();p.width=e.width,p.height=e.height;const c=u(p);if(c!=null){let d=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=r.resizedHeight,_=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=d,a.width=_}else a.tensorFormat="RGBA",a.height=d,a.width=_;c.drawImage(e,0,0),i=c.getImageData(0,0,_,d).data}else throw new Error("Can not access image data")}else if(s){let p,c;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,c=r.resizedWidth):(p=e.height,c=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=c,r!==void 0){const d=l();d.width=c,d.height=p;const _=u(d);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,c,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");const p=l();p.width=e.width,p.height=e.height;const c=u(p);if(c!=null){const d=e.height,_=e.width;return c.drawImage(e,0,0,_,d),i=c.getImageData(0,0,_,d).data,a.height=d,a.width=_,ga(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,c)=>{const d=l(),_=u(d);if(!e||!_)return c();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{d.width=f.width,d.height=f.height,_.drawImage(f,0,0,d.width,d.height);const T=_.getImageData(0,0,d.width,d.height);a.height=d.height,a.width=d.width,p(ga(T.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return ga(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Y0=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new Zr({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Z0=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Zr({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},ev=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Zr({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},tv=(e,r,t)=>new Zr({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),zn=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ti=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let Pc=!1;const rv=()=>{if(!Pc){Pc=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(zn.set("int64",BigInt64Array),ti.set(BigInt64Array,"int64")),r&&(zn.set("uint64",BigUint64Array),ti.set(BigUint64Array,"uint64")),s?(zn.set("float16",t),ti.set(t,"float16")):zn.set("float16",Uint16Array)}},sv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Zr(e.type,e.data,r);case"cpu-pinned":return new Zr({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Zr({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Zr({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Zr({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let Zr=class{constructor(r,t,s){rv();let o,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,o=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=zn.get(o);if(!a)throw new TypeError(`unsupported type "${o}" to create tensor from pinned buffer`);if(!(r.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=r.data;break}case"texture":{if(o!=="float32")throw new TypeError(`unsupported type "${o}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint64"&&o!=="int8"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from MLTensor`);this.mlTensorData=r.mlTensor,this.downloader=r.download,this.disposer=r.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,l;if(typeof r=="string")if(o=r,l=s,r==="string"){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");a=t}else{const u=zn.get(r);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&u===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${u.name} as data.`);r==="uint64"||r==="int64"?a=u.from(t,BigInt):a=u.from(t)}else if(t instanceof u)a=t;else if(t instanceof Uint8ClampedArray)if(r==="uint8")a=Uint8Array.from(t);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(r==="float16"&&t instanceof Uint16Array&&u!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${o} tensor's data must be type of ${u}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const u=typeof r[0];if(u==="string")o="string",a=r;else if(u==="boolean")o="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(r instanceof Uint8ClampedArray)o="uint8",a=Uint8Array.from(r);else{const u=ti.get(r.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);o=u,a=r}if(l===void 0)l=[a.length];else if(!Array.isArray(l))throw new TypeError("A tensor's dims must be a number array");n=l,this.cpuData=a,this.dataLocation="cpu"}const i=sv(n);if(this.cpuData&&i!==this.cpuData.length&&!((o==="uint4"||o==="int4")&&Math.ceil(i/2)===this.cpuData.length))throw new Error(`Tensor's size(${i}) does not match data length(${this.cpuData.length}).`);this.type=o,this.dims=n,this.size=i}static async fromImage(r,t){return J0(r,t)}static fromTexture(r,t){return Y0(r,t)}static fromGpuBuffer(r,t){return Z0(r,t)}static fromMLTensor(r,t){return ev(r,t)}static fromPinnedBuffer(r,t,s){return tv(r,t,s)}toDataURL(r){return Q0(this,r)}toImageData(r){return X0(this,r)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(r){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;const t=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=t,r&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(r){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return nv(this,r)}};const Bn=Zr,Cc=(e,r)=>{(typeof ds.trace>"u"?!ds.wasm.trace:!ds.trace)||console.timeStamp(`${e}::ORT::${r}`)},Sc=(e,r)=>{var o;const t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof ds.trace>"u"?!ds.wasm.trace:!ds.trace)||Sc("BEGIN",e)},Ma=e=>{(typeof ds.trace>"u"?!ds.wasm.trace:!ds.trace)||Sc("END",e)};var ov=Object.freeze({__proto__:null,InferenceSession:class V0{constructor(r){this.handler=r}async run(r,t,s){wa();const o={};let n={};if(typeof r!="object"||r===null||r instanceof Bn||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof Bn)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(const u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1;const p=Object.getOwnPropertyNames(t);for(const c of this.outputNames)if(p.indexOf(c)!==-1){const d=t[c];(d===null||d instanceof Bn)&&(u=!0,i=!1,o[c]=d)}if(u){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(const u of this.outputNames)o[u]=null;const a=await this.handler.run(r,o,n),l={};for(const u in a)if(Object.hasOwnProperty.call(a,u)){const p=a[u];p instanceof Bn?l[u]=p:l[u]=new Bn(p.type,p.data,p.dims)}return Ma(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){wa();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const p=r;let c=0,d=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(c=t,!Number.isSafeInteger(c))throw new RangeError("'byteOffset' must be an integer.");if(c<0||c>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(d=r.byteLength-c,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||c+d>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-c}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,c,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await K0(i),u=await a.createInferenceSessionHandler(n,l);return Ma(),new V0(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}},TRACE:Cc,TRACE_FUNC_BEGIN:wa,TRACE_FUNC_END:Ma,Tensor:Bn,env:q0,registerBackend:Ln});/*! - * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - */var ba=Object.defineProperty,iv=Object.getOwnPropertyDescriptor,av=Object.getOwnPropertyNames,lv=Object.prototype.hasOwnProperty,uv=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),je=(e,r)=>()=>(e&&(r=e(e=0)),r),Rn=(e,r)=>{for(var t in r)ba(e,t,{get:r[t],enumerable:!0})},cv=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of av(r))!lv.call(e,o)&&o!==t&&ba(e,o,{get:()=>r[o],enumerable:!(s=iv(r,o))||s.enumerable});return e},io=e=>cv(ba({},"__esModule",{value:!0}),e),ao,Vs,rn,$c,kc,Ic=je(()=>{ao=new Map,Vs=[],rn=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){let s=ao.get(e);if(s===void 0)ao.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){let o=Vs.indexOf(e);o!==-1&&Vs.splice(o,1);for(let n=0;n{let r=ao.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{let t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},kc=async e=>{let r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?Vs:t,o,n=[],i=new Set;for(let l of s){let u=await $c(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(let{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);let a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]}}),dv=je(()=>{Ic()}),Ac,pv=je(()=>{Ac="1.22.0-dev.20250409-89f8206ba4"}),ya,es,Fc=je(()=>{pv(),ya="warning",es={wasm:{},webgl:{},webgpu:{},versions:{common:Ac},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);ya=e}},get logLevel(){return ya}},Object.defineProperty(es,"logLevel",{enumerable:!0})}),Xt,hv=je(()=>{Fc(),Xt=es}),Oc,Dc,mv=je(()=>{Oc=(e,r)=>{let t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];let s=t.getContext("2d");if(s!=null){let o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);let i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm,l,u;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));let p=n*o,c=0,d=p,_=p*2,f=-1;i==="RGBA"?(c=0,d=p,_=p*2,f=p*3):i==="RGB"?(c=0,d=p,_=p*2):i==="RBG"&&(c=0,_=p,d=p*2);for(let T=0;T{let t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);let a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm,u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));let c=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let d=4,_=0,f=1,T=2,k=3,g=0,w=c,S=c*2,E=-1;a==="RGBA"?(g=0,w=c,S=c*2,E=c*3):a==="RGB"?(g=0,w=c,S=c*2):a==="RBG"&&(g=0,S=c,w=c*2),s=t.createImageData(o,n);for(let v=0;v{xa(),ri=(e,r)=>{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:t,width:s}=r,o=r.norm??{mean:255,bias:0},n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];let a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3),c=4,d=0,_=1,f=2,T=3,k=0,g=u,w=u*2,S=-1;a==="RGB"&&(c=3,d=0,_=1,f=2,T=-1),l==="RGBA"?S=u*3:l==="RBG"?(k=0,w=u,g=u*2):l==="BGR"&&(w=0,g=u,k=u*2);for(let E=0;E{let t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string",i,a=r??{},l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){let p=l();p.width=e.width,p.height=e.height;let c=u(p);if(c!=null){let d=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=r.resizedHeight,_=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=d,a.width=_}else a.tensorFormat="RGBA",a.height=d,a.width=_;c.drawImage(e,0,0),i=c.getImageData(0,0,_,d).data}else throw new Error("Can not access image data")}else if(s){let p,c;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,c=r.resizedWidth):(p=e.height,c=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=c,r!==void 0){let d=l();d.width=c,d.height=p;let _=u(d);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,c,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");let p=l();p.width=e.width,p.height=e.height;let c=u(p);if(c!=null){let d=e.height,_=e.width;return c.drawImage(e,0,0,_,d),i=c.getImageData(0,0,_,d).data,a.height=d,a.width=_,ri(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,c)=>{let d=l(),_=u(d);if(!e||!_)return c();let f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{d.width=f.width,d.height=f.height,_.drawImage(f,0,0,d.width,d.height);let T=_.getImageData(0,0,d.width,d.height);a.height=d.height,a.width=d.width,p(ri(T.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return ri(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},zc=(e,r)=>{let{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new Kr({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Bc=(e,r)=>{let{dataType:t,dims:s,download:o,dispose:n}=r;return new Kr({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Rc=(e,r)=>{let{dataType:t,dims:s,download:o,dispose:n}=r;return new Kr({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},jc=(e,r,t)=>new Kr({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]})}),sn,lo,va,Nc,_v=je(()=>{sn=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),lo=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),va=!1,Nc=()=>{if(!va){va=!0;let e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(sn.set("int64",BigInt64Array),lo.set(BigInt64Array,"int64")),r&&(sn.set("uint64",BigUint64Array),lo.set(BigUint64Array,"uint64")),s?(sn.set("float16",t),lo.set(t,"float16")):sn.set("float16",Uint16Array)}}}),Vc,Uc,gv=je(()=>{xa(),Vc=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Kr(e.type,e.data,r);case"cpu-pinned":return new Kr({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Kr({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Kr({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Kr({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Kr,xa=je(()=>{mv(),fv(),_v(),gv(),Kr=class{constructor(e,r,t){Nc();let s,o;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,s=e.type,o=e.dims,e.location){case"cpu-pinned":{let i=sn.get(s);if(!i)throw new TypeError(`unsupported type "${s}" to create tensor from pinned buffer`);if(!(e.data instanceof i))throw new TypeError(`buffer should be of type ${i.name}`);this.cpuData=e.data;break}case"texture":{if(s!=="float32")throw new TypeError(`unsupported type "${s}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint64"&&s!=="int8"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let i,a;if(typeof e=="string")if(s=e,a=t,e==="string"){if(!Array.isArray(r))throw new TypeError("A string tensor's data must be a string array.");i=r}else{let l=sn.get(e);if(l===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(r)){if(e==="float16"&&l===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${l.name} as data.`);e==="uint64"||e==="int64"?i=l.from(r,BigInt):i=l.from(r)}else if(r instanceof l)i=r;else if(r instanceof Uint8ClampedArray)if(e==="uint8")i=Uint8Array.from(r);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(e==="float16"&&r instanceof Uint16Array&&l!==Uint16Array)i=new globalThis.Float16Array(r.buffer,r.byteOffset,r.length);else throw new TypeError(`A ${s} tensor's data must be type of ${l}`)}else if(a=r,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let l=typeof e[0];if(l==="string")s="string",i=e;else if(l==="boolean")s="bool",i=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${l}.`)}else if(e instanceof Uint8ClampedArray)s="uint8",i=Uint8Array.from(e);else{let l=lo.get(e.constructor);if(l===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);s=l,i=e}if(a===void 0)a=[i.length];else if(!Array.isArray(a))throw new TypeError("A tensor's dims must be a number array");o=a,this.cpuData=i,this.dataLocation="cpu"}let n=Vc(o);if(this.cpuData&&n!==this.cpuData.length&&!((s==="uint4"||s==="int4")&&Math.ceil(n/2)===this.cpuData.length))throw new Error(`Tensor's size(${n}) does not match data length(${this.cpuData.length}).`);this.type=s,this.dims=o,this.size=n}static async fromImage(e,r){return Lc(e,r)}static fromTexture(e,r){return zc(e,r)}static fromGpuBuffer(e,r){return Bc(e,r)}static fromMLTensor(e,r){return Rc(e,r)}static fromPinnedBuffer(e,r,t){return jc(e,r,t)}toDataURL(e){return Oc(this,e)}toImageData(e){return Dc(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(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 new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let r=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=r,e&&this.disposer&&(this.disposer(),this.disposer=void 0),r}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Uc(this,e)}}}),ps,Wc=je(()=>{xa(),ps=Kr}),uo,Ta,hs,ts,Gc=je(()=>{Fc(),uo=(e,r)=>{(typeof es.trace>"u"?!es.wasm.trace:!es.trace)||console.timeStamp(`${e}::ORT::${r}`)},Ta=(e,r)=>{var o;let t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[],s=!1;for(let n=0;n{(typeof es.trace>"u"?!es.wasm.trace:!es.trace)||Ta("BEGIN",e)},ts=e=>{(typeof es.trace>"u"?!es.wasm.trace:!es.trace)||Ta("END",e)}}),Kc,wv=je(()=>{Ic(),Wc(),Gc(),Kc=class U0{constructor(r){this.handler=r}async run(r,t,s){hs();let o={},n={};if(typeof r!="object"||r===null||r instanceof ps||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof ps)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(let u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1,p=Object.getOwnPropertyNames(t);for(let c of this.outputNames)if(p.indexOf(c)!==-1){let d=t[c];(d===null||d instanceof ps)&&(u=!0,i=!1,o[c]=d)}if(u){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(let u of this.outputNames)o[u]=null;let a=await this.handler.run(r,o,n),l={};for(let u in a)if(Object.hasOwnProperty.call(a,u)){let p=a[u];p instanceof ps?l[u]=p:l[u]=new ps(p.type,p.data,p.dims)}return ts(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){hs();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){let p=r,c=0,d=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(c=t,!Number.isSafeInteger(c))throw new RangeError("'byteOffset' must be an integer.");if(c<0||c>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(d=r.byteLength-c,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||c+d>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-c}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,c,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[a,l]=await kc(i),u=await a.createInferenceSessionHandler(n,l);return ts(),new U0(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}}),Ea,Mv=je(()=>{wv(),Ea=Kc}),bv=je(()=>{}),yv=je(()=>{}),vv=je(()=>{}),xv=je(()=>{}),Hc={};Rn(Hc,{InferenceSession:()=>Ea,TRACE:()=>uo,TRACE_FUNC_BEGIN:()=>hs,TRACE_FUNC_END:()=>ts,Tensor:()=>ps,env:()=>Xt,registerBackend:()=>rn});var ms=je(()=>{dv(),hv(),Mv(),Wc(),bv(),yv(),Gc(),vv(),xv()}),Pa=je(()=>{}),qc={};Rn(qc,{default:()=>Qc});var Ca,Sa,Qc,Tv=je(()=>{var e;$g(),nn(),La(),Ca="ort-wasm-proxy-worker",Sa=((e=globalThis.self)==null?void 0:e.name)===Ca,Sa&&(self.onmessage=r=>{let{type:t,in:s}=r.data;try{switch(t){case"init-wasm":Ra(s.wasm).then(()=>{Yl(s).then(()=>{postMessage({type:t})},o=>{postMessage({type:t,err:o})})},o=>{postMessage({type:t,err:o})});break;case"init-ep":{let{epName:o,env:n}=s;Zl(n,o).then(()=>{postMessage({type:t})},i=>{postMessage({type:t,err:i})});break}case"copy-from":{let{buffer:o}=s,n=yi(o);postMessage({type:t,out:n});break}case"create":{let{model:o,options:n}=s;tu(o,n).then(i=>{postMessage({type:t,out:i})},i=>{postMessage({type:t,err:i})});break}case"release":ru(s),postMessage({type:t});break;case"run":{let{sessionId:o,inputIndices:n,inputs:i,outputIndices:a,options:l}=s;nu(o,n,i,a,new Array(a.length).fill(null),l).then(u=>{u.some(p=>p[3]!=="cpu")?postMessage({type:t,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:t,out:u},iu([...i,...u]))},u=>{postMessage({type:t,err:u})});break}case"end-profiling":ou(s),postMessage({type:t});break;default:}}catch(o){postMessage({type:t,err:o})}}),Qc=Sa?null:r=>new Worker(r??Hr,{type:"module",name:Ca})}),Xc={};Rn(Xc,{default:()=>Jc});var $a,ka,Jc,Yc,Ev=je(()=>{var e,r;ka=($a=self.location.href,async function(t={}){var ro;var s,o,n=t,i=new Promise((h,x)=>{s=h,o=x}),a=typeof window=="object",l=typeof WorkerGlobalScope<"u",u=l&&((ro=self.name)==null?void 0:ro.startsWith("em-pthread"));n.mountExternalData=(h,x)=>{h.startsWith("./")&&(h=h.substring(2)),(n.Eb||(n.Eb=new Map)).set(h,x)},n.unmountExternalData=()=>{delete n.Eb};var p=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let c=h=>async(...x)=>{var I;try{if(n.Fb)throw Error("Session already started");let L=n.Fb={dc:x[0],errors:[]},N=await h(...x);if(n.Fb!==L)throw Error("Session mismatch");(I=n.Jb)==null||I.flush();let ue=L.errors;if(0Le),0{if(h==="webgpu"){[n.Jb,n.Ub,n.Yb,n.Kb,n.Xb,n.jb,n.Zb,n.ac,n.Vb,n.Wb,n.$b]=x;let I=n.Jb;n.jsepRegisterBuffer=(L,N,ue,Te)=>I.registerBuffer(L,N,ue,Te),n.jsepGetBuffer=L=>I.getBuffer(L),n.jsepCreateDownloader=(L,N,ue)=>I.createDownloader(L,N,ue),n.jsepOnCreateSession=L=>{I.onCreateSession(L)},n.jsepOnReleaseSession=L=>{I.onReleaseSession(L)},n.jsepOnRunStart=L=>I.onRunStart(L),n.bc=(L,N)=>{I.upload(L,N)}}else if(h==="webnn"){let I=x[0];[n.nc,n.Nb,n.webnnEnsureTensor,n.Ob,n.webnnDownloadTensor]=x.slice(1),n.webnnReleaseTensorId=n.Nb,n.webnnUploadTensor=n.Ob,n.webnnOnRunStart=L=>I.onRunStart(L),n.webnnOnRunEnd=I.onRunEnd.bind(I),n.webnnRegisterMLContext=(L,N)=>{I.registerMLContext(L,N)},n.webnnOnReleaseSession=L=>{I.onReleaseSession(L)},n.webnnCreateMLTensorDownloader=(L,N)=>I.createMLTensorDownloader(L,N),n.webnnRegisterMLTensor=(L,N,ue,Te)=>I.registerMLTensor(L,N,ue,Te),n.webnnCreateMLContext=L=>I.createMLContext(L),n.webnnRegisterMLConstant=(L,N,ue,Te,Le,Ke)=>I.registerMLConstant(L,N,ue,Te,Le,n.Eb,Ke),n.webnnRegisterGraphInput=I.registerGraphInput.bind(I),n.webnnIsGraphInput=I.isGraphInput.bind(I),n.webnnCreateTemporaryTensor=I.createTemporaryTensor.bind(I),n.webnnIsInt64Supported=I.isInt64Supported.bind(I)}};let d=()=>{let h=(x,I,L)=>(...N)=>{let ue=Zt,Te=I==null?void 0:I();N=x(...N);let Le=I==null?void 0:I();return Te!==Le&&(x=Le,L(Te),I=L=null),Zt!=ue?new Promise((Ke,tt)=>{Jr={resolve:Ke,reject:tt}}):N};(()=>{for(let x of["_OrtAppendExecutionProvider","_OrtCreateSession","_OrtRun","_OrtRunWithBinding","_OrtBindInput"])n[x]=h(n[x],()=>n[x],I=>n[x]=I)})(),c!==void 0&&(n._OrtRun=c(n._OrtRun),n._OrtRunWithBinding=c(n._OrtRunWithBinding)),d=void 0};n.asyncInit=()=>{d==null||d()};var _,f,T=Object.assign({},n),k=(h,x)=>{throw x},g="";(a||l)&&(l?g=self.location.href:typeof document<"u"&&document.currentScript&&(g=document.currentScript.src),$a&&(g=$a),g=g.startsWith("blob:")?"":g.slice(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1),l&&(f=h=>{var x=new XMLHttpRequest;return x.open("GET",h,!1),x.responseType="arraybuffer",x.send(null),new Uint8Array(x.response)}),_=async h=>{if(V(h))return new Promise((I,L)=>{var N=new XMLHttpRequest;N.open("GET",h,!0),N.responseType="arraybuffer",N.onload=()=>{N.status==200||N.status==0&&N.response?I(N.response):L(N.status)},N.onerror=L,N.send(null)});var x=await fetch(h,{credentials:"same-origin"});if(x.ok)return x.arrayBuffer();throw Error(x.status+" : "+x.url)});var w=console.log.bind(console),S=console.error.bind(console),E=w,v=S;Object.assign(n,T),T=null;var M,y,C,F,z,K,q,R,Z,H,J,Q,se,fe=n.wasmBinary,ae=!1,V=h=>h.startsWith("file://");function A(){return M.buffer!=F.buffer&&re(),F}function U(){return M.buffer!=F.buffer&&re(),z}function ee(){return M.buffer!=F.buffer&&re(),K}function _e(){return M.buffer!=F.buffer&&re(),q}function le(){return M.buffer!=F.buffer&&re(),R}function ye(){return M.buffer!=F.buffer&&re(),Z}function ze(){return M.buffer!=F.buffer&&re(),H}function Ue(){return M.buffer!=F.buffer&&re(),se}if(u){let h=function(x){try{var I=x.data,L=I.Bb;if(L==="load"){let N=[];self.onmessage=ue=>N.push(ue),self.startWorker=()=>{postMessage({Bb:"loaded"});for(let ue of N)h(ue);self.onmessage=h};for(let ue of I.Rb)n[ue]&&!n[ue].proxy||(n[ue]=(...Te)=>{postMessage({Bb:"callHandler",Qb:ue,args:Te})},ue=="print"&&(E=n[ue]),ue=="printErr"&&(v=n[ue]));M=I.kc,re(),pe(I.lc)}else if(L==="run"){B(I.Ab),Jn(I.Ab,0,0,1,0,0),rs(),xe(I.Ab),W||(Uo(),W=!0);try{te(I.fc,I.Hb)}catch(N){if(N!="unwind")throw N}}else I.target!=="setimmediate"&&(L==="checkMailbox"?W&&Re():L&&(v(`worker: received unknown command ${L}`),v(I)))}catch(N){throw Yn(),N}};var pe,W=!1;v=function(...x){x=x.join(" "),console.error(x)},self.alert=function(...x){postMessage({Bb:"alert",text:x.join(" "),ic:Pn()})},self.onunhandledrejection=x=>{throw x.reason||x},self.onmessage=h}function re(){var h=M.buffer;n.HEAP8=F=new Int8Array(h),n.HEAP16=K=new Int16Array(h),n.HEAPU8=z=new Uint8Array(h),n.HEAPU16=q=new Uint16Array(h),n.HEAP32=R=new Int32Array(h),n.HEAPU32=Z=new Uint32Array(h),n.HEAPF32=H=new Float32Array(h),n.HEAPF64=se=new Float64Array(h),n.HEAP64=J=new BigInt64Array(h),n.HEAPU64=Q=new BigUint64Array(h)}function G(){u?startWorker(n):ct.Ca()}u||(M=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),re());var be,we=0,Se=null;function Ce(){if(--we==0&&Se){var h=Se;Se=null,h()}}function $e(h){throw v(h="Aborted("+h+")"),ae=!0,h=new WebAssembly.RuntimeError(h+". Build with -sASSERTIONS for more info."),o(h),h}function Fe(){return{a:{L:qe,Aa:He,b:Oe,$:vt,A:rt,pa:jt,X:Jt,Z:Or,qa:ss,na:ys,ga:ns,ma:$s,J:Vr,Y:ks,V:Qr,oa:vs,W:Is,va:Fs,E:it,Q:os,O:fn,D:gn,u:wn,r:Mn,P:Os,z:j,R:X,ja:ie,T:Qe,aa:Ye,M:_t,F:Ot,ia:xe,sa:At,t:mr,Ba:Mr,w:br,o:dr,l:us,c:as,n:Ti,j:qs,v:Ci,p:Si,f:$i,s:ki,m:Ii,e:Eo,k:Ai,i:Fi,g:Po,d:Oi,da:Co,ea:Li,fa:$o,ba:ko,ca:Tn,N:Io,xa:Bi,ua:ji,h:Ao,C:Ni,G:Fo,ta:Ri,x:Ns,ra:Vi,U:pu,q:zi,y:Ui,K:hu,S:Wi,za:Gi,ya:Ki,ka:Lo,la:zo,_:St,B:Qn,I:Bo,ha:Ro,H:No,a:M,wa:Ie}}}var Be={829644:(h,x,I,L,N)=>{if(n===void 0||!n.Eb)return 1;if((h=ut(Number(h>>>0))).startsWith("./")&&(h=h.substring(2)),!(h=n.Eb.get(h)))return 2;if(x=Number(x>>>0),I=Number(I>>>0),L=Number(L>>>0),x+I>h.byteLength)return 3;try{let ue=h.subarray(x,x+I);switch(N){case 0:U().set(ue,L>>>0);break;case 1:n.mc?n.mc(L,ue):n.bc(L,ue);break;default:return 4}return 0}catch{return 4}},830468:(h,x,I)=>{n.Ob(h,U().subarray(x>>>0,x+I>>>0))},830532:()=>n.nc(),830574:h=>{n.Nb(h)},830611:()=>{n.Vb()},830642:()=>{n.Wb()},830671:()=>{n.$b()},830696:h=>n.Ub(h),830729:h=>n.Yb(h),830761:(h,x,I)=>{n.Kb(Number(h),Number(x),Number(I),!0)},830824:(h,x,I)=>{n.Kb(Number(h),Number(x),Number(I))},830881:()=>typeof wasmOffsetConverter<"u",830938:h=>{n.jb("Abs",h,void 0)},830989:h=>{n.jb("Neg",h,void 0)},831040:h=>{n.jb("Floor",h,void 0)},831093:h=>{n.jb("Ceil",h,void 0)},831145:h=>{n.jb("Reciprocal",h,void 0)},831203:h=>{n.jb("Sqrt",h,void 0)},831255:h=>{n.jb("Exp",h,void 0)},831306:h=>{n.jb("Erf",h,void 0)},831357:h=>{n.jb("Sigmoid",h,void 0)},831412:(h,x,I)=>{n.jb("HardSigmoid",h,{alpha:x,beta:I})},831491:h=>{n.jb("Log",h,void 0)},831542:h=>{n.jb("Sin",h,void 0)},831593:h=>{n.jb("Cos",h,void 0)},831644:h=>{n.jb("Tan",h,void 0)},831695:h=>{n.jb("Asin",h,void 0)},831747:h=>{n.jb("Acos",h,void 0)},831799:h=>{n.jb("Atan",h,void 0)},831851:h=>{n.jb("Sinh",h,void 0)},831903:h=>{n.jb("Cosh",h,void 0)},831955:h=>{n.jb("Asinh",h,void 0)},832008:h=>{n.jb("Acosh",h,void 0)},832061:h=>{n.jb("Atanh",h,void 0)},832114:h=>{n.jb("Tanh",h,void 0)},832166:h=>{n.jb("Not",h,void 0)},832217:(h,x,I)=>{n.jb("Clip",h,{min:x,max:I})},832286:h=>{n.jb("Clip",h,void 0)},832338:(h,x)=>{n.jb("Elu",h,{alpha:x})},832396:h=>{n.jb("Gelu",h,void 0)},832448:h=>{n.jb("Relu",h,void 0)},832500:(h,x)=>{n.jb("LeakyRelu",h,{alpha:x})},832564:(h,x)=>{n.jb("ThresholdedRelu",h,{alpha:x})},832634:(h,x)=>{n.jb("Cast",h,{to:x})},832692:h=>{n.jb("Add",h,void 0)},832743:h=>{n.jb("Sub",h,void 0)},832794:h=>{n.jb("Mul",h,void 0)},832845:h=>{n.jb("Div",h,void 0)},832896:h=>{n.jb("Pow",h,void 0)},832947:h=>{n.jb("Equal",h,void 0)},833e3:h=>{n.jb("Greater",h,void 0)},833055:h=>{n.jb("GreaterOrEqual",h,void 0)},833117:h=>{n.jb("Less",h,void 0)},833169:h=>{n.jb("LessOrEqual",h,void 0)},833228:(h,x,I,L,N)=>{n.jb("ReduceMean",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},833403:(h,x,I,L,N)=>{n.jb("ReduceMax",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},833577:(h,x,I,L,N)=>{n.jb("ReduceMin",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},833751:(h,x,I,L,N)=>{n.jb("ReduceProd",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},833926:(h,x,I,L,N)=>{n.jb("ReduceSum",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834100:(h,x,I,L,N)=>{n.jb("ReduceL1",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834273:(h,x,I,L,N)=>{n.jb("ReduceL2",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834446:(h,x,I,L,N)=>{n.jb("ReduceLogSum",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834623:(h,x,I,L,N)=>{n.jb("ReduceSumSquare",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834803:(h,x,I,L,N)=>{n.jb("ReduceLogSumExp",h,{keepDims:!!x,noopWithEmptyAxes:!!I,axes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},834983:h=>{n.jb("Where",h,void 0)},835036:(h,x,I)=>{n.jb("Transpose",h,{perm:x?Array.from(le().subarray(Number(x)>>>0,Number(I)>>>0)):[]})},835160:(h,x,I,L)=>{n.jb("DepthToSpace",h,{blocksize:x,mode:ut(I),format:L?"NHWC":"NCHW"})},835293:(h,x,I,L)=>{n.jb("DepthToSpace",h,{blocksize:x,mode:ut(I),format:L?"NHWC":"NCHW"})},835426:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt,kt,Wt,yr,Ls)=>{n.jb("ConvTranspose",h,{format:Ke?"NHWC":"NCHW",autoPad:x,dilations:[I],group:L,kernelShape:[N],pads:[ue,Te],strides:[Le],wIsConst:()=>!!A()[tt>>>0],outputPadding:bt?Array.from(le().subarray(Number(bt)>>>0,Number(kt)>>>0)):[],outputShape:Wt?Array.from(le().subarray(Number(Wt)>>>0,Number(yr)>>>0)):[],activation:ut(Ls)})},835859:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt,kt,Wt,yr)=>{n.jb("ConvTranspose",h,{format:Le?"NHWC":"NCHW",autoPad:x,dilations:Array.from(le().subarray(Number(I)>>>0,2+(Number(I)>>>0)>>>0)),group:L,kernelShape:Array.from(le().subarray(Number(N)>>>0,2+(Number(N)>>>0)>>>0)),pads:Array.from(le().subarray(Number(ue)>>>0,4+(Number(ue)>>>0)>>>0)),strides:Array.from(le().subarray(Number(Te)>>>0,2+(Number(Te)>>>0)>>>0)),wIsConst:()=>!!A()[Ke>>>0],outputPadding:tt?Array.from(le().subarray(Number(tt)>>>0,Number(bt)>>>0)):[],outputShape:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[],activation:ut(yr)})},836520:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt,kt,Wt,yr,Ls)=>{n.jb("ConvTranspose",h,{format:Ke?"NHWC":"NCHW",autoPad:x,dilations:[I],group:L,kernelShape:[N],pads:[ue,Te],strides:[Le],wIsConst:()=>!!A()[tt>>>0],outputPadding:bt?Array.from(le().subarray(Number(bt)>>>0,Number(kt)>>>0)):[],outputShape:Wt?Array.from(le().subarray(Number(Wt)>>>0,Number(yr)>>>0)):[],activation:ut(Ls)})},836953:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt,kt,Wt,yr)=>{n.jb("ConvTranspose",h,{format:Le?"NHWC":"NCHW",autoPad:x,dilations:Array.from(le().subarray(Number(I)>>>0,2+(Number(I)>>>0)>>>0)),group:L,kernelShape:Array.from(le().subarray(Number(N)>>>0,2+(Number(N)>>>0)>>>0)),pads:Array.from(le().subarray(Number(ue)>>>0,4+(Number(ue)>>>0)>>>0)),strides:Array.from(le().subarray(Number(Te)>>>0,2+(Number(Te)>>>0)>>>0)),wIsConst:()=>!!A()[Ke>>>0],outputPadding:tt?Array.from(le().subarray(Number(tt)>>>0,Number(bt)>>>0)):[],outputShape:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[],activation:ut(yr)})},837614:(h,x)=>{n.jb("GlobalAveragePool",h,{format:x?"NHWC":"NCHW"})},837705:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt,kt,Wt,yr)=>{n.jb("AveragePool",h,{format:yr?"NHWC":"NCHW",auto_pad:x,ceil_mode:I,count_include_pad:L,storage_order:N,dilations:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],kernel_shape:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],pads:tt?Array.from(le().subarray(Number(tt)>>>0,Number(bt)>>>0)):[],strides:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[]})},838184:(h,x)=>{n.jb("GlobalAveragePool",h,{format:x?"NHWC":"NCHW"})},838275:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt,kt,Wt,yr)=>{n.jb("AveragePool",h,{format:yr?"NHWC":"NCHW",auto_pad:x,ceil_mode:I,count_include_pad:L,storage_order:N,dilations:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],kernel_shape:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],pads:tt?Array.from(le().subarray(Number(tt)>>>0,Number(bt)>>>0)):[],strides:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[]})},838754:(h,x)=>{n.jb("GlobalMaxPool",h,{format:x?"NHWC":"NCHW"})},838841:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt,kt,Wt,yr)=>{n.jb("MaxPool",h,{format:yr?"NHWC":"NCHW",auto_pad:x,ceil_mode:I,count_include_pad:L,storage_order:N,dilations:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],kernel_shape:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],pads:tt?Array.from(le().subarray(Number(tt)>>>0,Number(bt)>>>0)):[],strides:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[]})},839316:(h,x)=>{n.jb("GlobalMaxPool",h,{format:x?"NHWC":"NCHW"})},839403:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt,kt,Wt,yr)=>{n.jb("MaxPool",h,{format:yr?"NHWC":"NCHW",auto_pad:x,ceil_mode:I,count_include_pad:L,storage_order:N,dilations:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],kernel_shape:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],pads:tt?Array.from(le().subarray(Number(tt)>>>0,Number(bt)>>>0)):[],strides:kt?Array.from(le().subarray(Number(kt)>>>0,Number(Wt)>>>0)):[]})},839878:(h,x,I,L,N)=>{n.jb("Gemm",h,{alpha:x,beta:I,transA:L,transB:N})},839982:h=>{n.jb("MatMul",h,void 0)},840036:(h,x,I,L)=>{n.jb("ArgMax",h,{keepDims:!!x,selectLastIndex:!!I,axis:L})},840144:(h,x,I,L)=>{n.jb("ArgMin",h,{keepDims:!!x,selectLastIndex:!!I,axis:L})},840252:(h,x)=>{n.jb("Softmax",h,{axis:x})},840315:(h,x)=>{n.jb("Concat",h,{axis:x})},840375:(h,x,I,L,N)=>{n.jb("Split",h,{axis:x,numOutputs:I,splitSizes:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},840531:h=>{n.jb("Expand",h,void 0)},840585:(h,x)=>{n.jb("Gather",h,{axis:Number(x)})},840656:(h,x)=>{n.jb("GatherElements",h,{axis:Number(x)})},840735:(h,x)=>{n.jb("GatherND",h,{batch_dims:Number(x)})},840814:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt)=>{n.jb("Resize",h,{antialias:x,axes:I?Array.from(le().subarray(Number(I)>>>0,Number(L)>>>0)):[],coordinateTransformMode:ut(N),cubicCoeffA:ue,excludeOutside:Te,extrapolationValue:Le,keepAspectRatioPolicy:ut(Ke),mode:ut(tt),nearestMode:ut(bt)})},841176:(h,x,I,L,N,ue,Te)=>{n.jb("Slice",h,{starts:x?Array.from(le().subarray(Number(x)>>>0,Number(I)>>>0)):[],ends:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[],axes:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[]})},841440:h=>{n.jb("Tile",h,void 0)},841492:(h,x,I)=>{n.jb("InstanceNormalization",h,{epsilon:x,format:I?"NHWC":"NCHW"})},841606:(h,x,I)=>{n.jb("InstanceNormalization",h,{epsilon:x,format:I?"NHWC":"NCHW"})},841720:h=>{n.jb("Range",h,void 0)},841773:(h,x)=>{n.jb("Einsum",h,{equation:ut(x)})},841854:(h,x,I,L,N)=>{n.jb("Pad",h,{mode:x,value:I,pads:L?Array.from(le().subarray(Number(L)>>>0,Number(N)>>>0)):[]})},841997:(h,x,I,L,N,ue)=>{n.jb("BatchNormalization",h,{epsilon:x,momentum:I,spatial:!!N,trainingMode:!!L,format:ue?"NHWC":"NCHW"})},842166:(h,x,I,L,N,ue)=>{n.jb("BatchNormalization",h,{epsilon:x,momentum:I,spatial:!!N,trainingMode:!!L,format:ue?"NHWC":"NCHW"})},842335:(h,x,I)=>{n.jb("CumSum",h,{exclusive:Number(x),reverse:Number(I)})},842432:(h,x,I)=>{n.jb("DequantizeLinear",h,{axis:x,blockSize:I})},842522:(h,x,I,L,N)=>{n.jb("GridSample",h,{align_corners:x,mode:ut(I),padding_mode:ut(L),format:N?"NHWC":"NCHW"})},842692:(h,x,I,L,N)=>{n.jb("GridSample",h,{align_corners:x,mode:ut(I),padding_mode:ut(L),format:N?"NHWC":"NCHW"})},842862:(h,x)=>{n.jb("ScatterND",h,{reduction:ut(x)})},842947:(h,x,I,L,N,ue,Te,Le,Ke)=>{n.jb("Attention",h,{numHeads:x,isUnidirectional:I,maskFilterValue:L,scale:N,doRotary:ue,qkvHiddenSizes:Te?Array.from(le().subarray(Number(Le)>>>0,Number(Le)+Te>>>0)):[],pastPresentShareBuffer:!!Ke})},843219:h=>{n.jb("BiasAdd",h,void 0)},843274:h=>{n.jb("BiasSplitGelu",h,void 0)},843335:h=>{n.jb("FastGelu",h,void 0)},843391:(h,x,I,L,N,ue,Te,Le,Ke,tt,bt,kt,Wt,yr,Ls,qi)=>{n.jb("Conv",h,{format:kt?"NHWC":"NCHW",auto_pad:x,dilations:I?Array.from(le().subarray(Number(I)>>>0,Number(L)>>>0)):[],group:N,kernel_shape:ue?Array.from(le().subarray(Number(ue)>>>0,Number(Te)>>>0)):[],pads:Le?Array.from(le().subarray(Number(Le)>>>0,Number(Ke)>>>0)):[],strides:tt?Array.from(le().subarray(Number(tt)>>>0,Number(bt)>>>0)):[],w_is_const:()=>!!A()[Number(Wt)>>>0],activation:ut(yr),activation_params:Ls?Array.from(ze().subarray(Number(Ls)>>>0,Number(qi)>>>0)):[]})},843975:h=>{n.jb("Gelu",h,void 0)},844027:(h,x,I,L,N,ue,Te,Le,Ke)=>{n.jb("GroupQueryAttention",h,{numHeads:x,kvNumHeads:I,scale:L,softcap:N,doRotary:ue,rotaryInterleaved:Te,smoothSoftmax:Le,localWindowSize:Ke})},844244:(h,x,I,L)=>{n.jb("LayerNormalization",h,{axis:x,epsilon:I,simplified:!!L})},844355:(h,x,I,L)=>{n.jb("LayerNormalization",h,{axis:x,epsilon:I,simplified:!!L})},844466:(h,x,I,L,N,ue)=>{n.jb("MatMulNBits",h,{k:x,n:I,accuracyLevel:L,bits:N,blockSize:ue})},844593:(h,x,I,L,N,ue)=>{n.jb("MultiHeadAttention",h,{numHeads:x,isUnidirectional:I,maskFilterValue:L,scale:N,doRotary:ue})},844752:(h,x)=>{n.jb("QuickGelu",h,{alpha:x})},844816:(h,x,I,L,N)=>{n.jb("RotaryEmbedding",h,{interleaved:!!x,numHeads:I,rotaryEmbeddingDim:L,scale:N})},844955:(h,x,I)=>{n.jb("SkipLayerNormalization",h,{epsilon:x,simplified:!!I})},845057:(h,x,I)=>{n.jb("SkipLayerNormalization",h,{epsilon:x,simplified:!!I})},845159:(h,x,I,L)=>{n.jb("GatherBlockQuantized",h,{gatherAxis:x,quantizeAxis:I,blockSize:L})},845280:h=>{n.Zb(h)},845314:(h,x)=>n.ac(Number(h),Number(x),n.Fb.dc,n.Fb.errors)};function He(h,x,I){return Lr(async()=>{await n.Xb(Number(h),Number(x),Number(I))})}function qe(){return typeof wasmOffsetConverter<"u"}class ke{constructor(x){Y(this,"name","ExitStatus");this.message=`Program terminated with exit(${x})`,this.status=x}}var Ve=h=>{h.terminate(),h.onmessage=()=>{}},Ze=[],nt=h=>{Vt.length==0&&(oe(),D(Vt[0]));var x=Vt.pop();if(!x)return 6;Rt.push(x),ir[h.Ab]=x,x.Ab=h.Ab;var I={Bb:"run",fc:h.ec,Hb:h.Hb,Ab:h.Ab};return x.postMessage(I,h.Mb),0},lt=0,Ge=(h,x,...I)=>{for(var L=2*I.length,N=kn(),ue=eo(8*L),Te=ue>>>3,Le=0;Le>>0]=Ke)}return h=Wo(h,0,L,ue,x),$n(N),h};function Ie(h){if(u)return Ge(0,1,h);if(C=h,!(0{if(C=h,u)throw pt(h),"unwind";Ie(h)},Vt=[],Rt=[],gr=[],ir={},Mt=h=>{var x=h.Ab;delete ir[x],Vt.push(h),Rt.splice(Rt.indexOf(h),1),h.Ab=0,Go(x)};function rs(){gr.forEach(h=>h())}var D=h=>new Promise(x=>{h.onmessage=N=>{var ue=(N=N.data).Bb;if(N.Gb&&N.Gb!=Pn()){var Te=ir[N.Gb];Te?Te.postMessage(N,N.Mb):v(`Internal error! Worker sent a message "${ue}" to target pthread ${N.Gb}, but that thread no longer exists!`)}else ue==="checkMailbox"?Re():ue==="spawnThread"?nt(N):ue==="cleanupThread"?Mt(ir[N.hc]):ue==="loaded"?(h.loaded=!0,x(h)):ue==="alert"?alert(`Thread ${N.ic}: ${N.text}`):N.target==="setimmediate"?h.postMessage(N):ue==="callHandler"?n[N.Qb](...N.args):ue&&v(`worker sent an unknown command ${ue}`)},h.onerror=N=>{throw v(`worker sent an error! ${N.filename}:${N.lineno}: ${N.message}`),N};var I,L=[];for(I of[])n.propertyIsEnumerable(I)&&L.push(I);h.postMessage({Bb:"load",Rb:L,kc:M,lc:y})});function oe(){var h=new Worker((()=>{let x=URL;return self.location.href>"file:"&&self.location.href<"file;"?new x("ort.bundle.min.mjs",self.location.href):new URL(self.location.href)})(),{type:"module",workerData:"em-pthread",name:"em-pthread"});Vt.push(h)}var B=h=>{re();var x=ye()[h+52>>>2>>>0];h=ye()[h+56>>>2>>>0],Zn(x,x-h),$n(x)},te=(h,x)=>{lt=0,h=qo(h,x),0>>=0);throw x>>>=0,I>>>=0,ye()[L.Ib+16>>>2>>>0]=0,ye()[L.Ib+4>>>2>>>0]=x,ye()[L.Ib+8>>>2>>>0]=I,h}function ve(h,x,I,L){return u?Ge(2,1,h,x,I,L):vt(h,x,I,L)}function vt(h,x,I,L){if(h>>>=0,I>>>=0,L>>>=0,p===void 0)return 6;var N=[];return u&&N.length===0?ve(h,x>>>=0,I,L):(h={ec:I,Ab:h,Hb:L,Mb:N},u?(h.Bb="spawnThread",postMessage(h,N),0):nt(h))}var Ft=typeof TextDecoder<"u"?new TextDecoder:void 0,ht=(h,x=0,I=NaN)=>{var L=(x>>>=0)+I;for(I=x;h[I]&&!(I>=L);)++I;if(16(N=(240&N)==224?(15&N)<<12|ue<<6|Te:(7&N)<<18|ue<<12|Te<<6|63&h[x++])?L+=String.fromCharCode(N):(N-=65536,L+=String.fromCharCode(55296|N>>10,56320|1023&N))}}else L+=String.fromCharCode(N)}return L},ut=(h,x)=>(h>>>=0)?ht(U(),h,x):"";function rt(h,x,I){return u?Ge(3,1,h,x,I):0}function jt(h,x){if(u)return Ge(4,1,h,x)}var Ht=h=>{for(var x=0,I=0;I=L?x++:2047>=L?x+=2:55296<=L&&57343>=L?(x+=4,++I):x+=3}return x},wr=(h,x,I)=>{var L=U();if(x>>>=0,0=Te&&(Te=65536+((1023&Te)<<10)|1023&h.charCodeAt(++ue)),127>=Te){if(x>=I)break;L[x++>>>0]=Te}else{if(2047>=Te){if(x+1>=I)break;L[x++>>>0]=192|Te>>6}else{if(65535>=Te){if(x+2>=I)break;L[x++>>>0]=224|Te>>12}else{if(x+3>=I)break;L[x++>>>0]=240|Te>>18,L[x++>>>0]=128|Te>>12&63}L[x++>>>0]=128|Te>>6&63}L[x++>>>0]=128|63&Te}}L[x>>>0]=0,h=x-N}else h=0;return h};function Jt(h,x){if(u)return Ge(5,1,h,x)}function Or(h,x,I){if(u)return Ge(6,1,h,x,I)}function ss(h,x,I){return u?Ge(7,1,h,x,I):0}function ys(h,x){if(u)return Ge(8,1,h,x)}function ns(h,x,I){if(u)return Ge(9,1,h,x,I)}function $s(h,x,I,L){if(u)return Ge(10,1,h,x,I,L)}function Vr(h,x,I,L){if(u)return Ge(11,1,h,x,I,L)}function ks(h,x,I,L){if(u)return Ge(12,1,h,x,I,L)}function Qr(h){if(u)return Ge(13,1,h)}function vs(h,x){if(u)return Ge(14,1,h,x)}function Is(h,x,I){if(u)return Ge(15,1,h,x,I)}var As,ar,Fs=()=>$e(""),Er=h=>{for(var x="";U()[h>>>0];)x+=As[U()[h++>>>0]];return x},xs={},Br={};function Ae(h,x,I={}){return function(L,N,ue={}){var Te=N.name;if(!L)throw new ar(`type "${Te}" must have a positive integer typeid pointer`);if(Br.hasOwnProperty(L)){if(ue.Sb)return;throw new ar(`Cannot register type '${Te}' twice`)}Br[L]=N,xs.hasOwnProperty(L)&&(N=xs[L],delete xs[L],N.forEach(Le=>Le()))}(h,x,I)}var Je=(h,x,I)=>{switch(x){case 1:return I?L=>A()[L>>>0]:L=>U()[L>>>0];case 2:return I?L=>ee()[L>>>1>>>0]:L=>_e()[L>>>1>>>0];case 4:return I?L=>le()[L>>>2>>>0]:L=>ye()[L>>>2>>>0];case 8:return I?L=>J[L>>>3]:L=>Q[L>>>3];default:throw new TypeError(`invalid integer width (${x}): ${h}`)}};function it(h,x,I){I>>>=0,Ae(h>>>=0,{name:x=Er(x>>>0),fromWireType:L=>L,toWireType:function(L,N){if(typeof N!="bigint"&&typeof N!="number")throw N=N===null?"null":(L=typeof N)=="object"||L==="array"||L==="function"?N.toString():""+N,new TypeError(`Cannot convert "${N}" to ${this.name}`);return typeof N=="number"&&(N=BigInt(N)),N},Cb:Nt,readValueFromPointer:Je(x,I,x.indexOf("u")==-1),Db:null})}var Nt=8;function os(h,x,I,L){Ae(h>>>=0,{name:x=Er(x>>>0),fromWireType:function(N){return!!N},toWireType:function(N,ue){return ue?I:L},Cb:Nt,readValueFromPointer:function(N){return this.fromWireType(U()[N>>>0])},Db:null})}var is=[],ur=[];function as(h){9<(h>>>=0)&&--ur[h+1]==0&&(ur[h]=void 0,is.push(h))}var cr=h=>{if(!h)throw new ar("Cannot use deleted val. handle = "+h);return ur[h]},hr=h=>{switch(h){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let x=is.pop()||ur.length;return ur[x]=h,ur[x+1]=1,x}};function ls(h){return this.fromWireType(ye()[h>>>2>>>0])}var Ts={name:"emscripten::val",fromWireType:h=>{var x=cr(h);return as(h),x},toWireType:(h,x)=>hr(x),Cb:Nt,readValueFromPointer:ls,Db:null};function fn(h){return Ae(h>>>0,Ts)}var _n=(h,x)=>{switch(x){case 4:return function(I){return this.fromWireType(ze()[I>>>2>>>0])};case 8:return function(I){return this.fromWireType(Ue()[I>>>3>>>0])};default:throw new TypeError(`invalid float width (${x}): ${h}`)}};function gn(h,x,I){I>>>=0,Ae(h>>>=0,{name:x=Er(x>>>0),fromWireType:L=>L,toWireType:(L,N)=>N,Cb:Nt,readValueFromPointer:_n(x,I),Db:null})}function wn(h,x,I,L,N){if(h>>>=0,I>>>=0,x=Er(x>>>0),N===-1&&(N=4294967295),N=Le=>Le,L===0){var ue=32-8*I;N=Le=>Le<>>ue}var Te=x.includes("unsigned")?function(Le,Ke){return Ke>>>0}:function(Le,Ke){return Ke};Ae(h,{name:x,fromWireType:N,toWireType:Te,Cb:Nt,readValueFromPointer:Je(x,I,L!==0),Db:null})}function Mn(h,x,I){function L(ue){var Te=ye()[ue>>>2>>>0];return ue=ye()[ue+4>>>2>>>0],new N(A().buffer,ue,Te)}var N=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][x];Ae(h>>>=0,{name:I=Er(I>>>0),fromWireType:L,Cb:Nt,readValueFromPointer:L},{Sb:!0})}function Os(h,x){Ae(h>>>=0,{name:x=Er(x>>>0),fromWireType:function(I){for(var L,N=ye()[I>>>2>>>0],ue=I+4,Te=ue,Le=0;Le<=N;++Le){var Ke=ue+Le;Le!=N&&U()[Ke>>>0]!=0||(Te=ut(Te,Ke-Te),L===void 0?L=Te:(L+="\0",L+=Te),Te=Ke+1)}return Gr(I),L},toWireType:function(I,L){L instanceof ArrayBuffer&&(L=new Uint8Array(L));var N=typeof L=="string";if(!(N||L instanceof Uint8Array||L instanceof Uint8ClampedArray||L instanceof Int8Array))throw new ar("Cannot pass non-string to std::string");var ue=N?Ht(L):L.length,Te=Cn(4+ue+1),Le=Te+4;if(ye()[Te>>>2>>>0]=ue,N)wr(L,Le,ue+1);else if(N)for(N=0;N>>0]=Ke}else for(N=0;N>>0]=L[N];return I!==null&&I.push(Gr,Te),Te},Cb:Nt,readValueFromPointer:ls,Db(I){Gr(I)}})}var Hs=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,bn=(h,x)=>{for(var I=h>>1,L=I+x/2;!(I>=L)&&_e()[I>>>0];)++I;if(32<(I<<=1)-h&&Hs)return Hs.decode(U().slice(h,I));for(I="",L=0;!(L>=x/2);++L){var N=ee()[h+2*L>>>1>>>0];if(N==0)break;I+=String.fromCharCode(N)}return I},yn=(h,x,I)=>{if(I??(I=2147483647),2>I)return 0;var L=x;I=(I-=2)<2*h.length?I/2:h.length;for(var N=0;N>>1>>>0]=ue,x+=2}return ee()[x>>>1>>>0]=0,x-L},vn=h=>2*h.length,Ds=(h,x)=>{for(var I=0,L="";!(I>=x/4);){var N=le()[h+4*I>>>2>>>0];if(N==0)break;++I,65536<=N?(N-=65536,L+=String.fromCharCode(55296|N>>10,56320|1023&N)):L+=String.fromCharCode(N)}return L},de=(h,x,I)=>{if(x>>>=0,I??(I=2147483647),4>I)return 0;var L=x;I=L+I-4;for(var N=0;N=ue&&(ue=65536+((1023&ue)<<10)|1023&h.charCodeAt(++N)),le()[x>>>2>>>0]=ue,(x+=4)+4>I)break}return le()[x>>>2>>>0]=0,x-L},$=h=>{for(var x=0,I=0;I=L&&++I,x+=4}return x};function j(h,x,I){if(h>>>=0,x>>>=0,I=Er(I>>>=0),x===2)var L=bn,N=yn,ue=vn,Te=Le=>_e()[Le>>>1>>>0];else x===4&&(L=Ds,N=de,ue=$,Te=Le=>ye()[Le>>>2>>>0]);Ae(h,{name:I,fromWireType:Le=>{for(var Ke,tt=ye()[Le>>>2>>>0],bt=Le+4,kt=0;kt<=tt;++kt){var Wt=Le+4+kt*x;kt!=tt&&Te(Wt)!=0||(bt=L(bt,Wt-bt),Ke===void 0?Ke=bt:(Ke+="\0",Ke+=bt),bt=Wt+x)}return Gr(Le),Ke},toWireType:(Le,Ke)=>{if(typeof Ke!="string")throw new ar(`Cannot pass non-string to C++ string type ${I}`);var tt=ue(Ke),bt=Cn(4+tt+x);return ye()[bt>>>2>>>0]=tt/x,N(Ke,bt+4,tt+x),Le!==null&&Le.push(Gr,bt),bt},Cb:Nt,readValueFromPointer:ls,Db(Le){Gr(Le)}})}function X(h,x){Ae(h>>>=0,{Tb:!0,name:x=Er(x>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function ie(h){Jn(h>>>0,!l,1,!a,131072,!1),rs()}var ce=h=>{if(!ae)try{if(h(),!(0>>=0,typeof Atomics.jc=="function"&&(Atomics.jc(le(),h>>>2,h).value.then(Re),h+=128,Atomics.store(le(),h>>>2,1))}var Re=()=>{var h=Pn();h&&(xe(h),ce(Ho))};function Qe(h,x){(h>>>=0)==x>>>0?setTimeout(Re):u?postMessage({Gb:h,Bb:"checkMailbox"}):(h=ir[h])&&h.postMessage({Bb:"checkMailbox"})}var We=[];function Ye(h,x,I,L,N){for(x>>>=0,L/=2,We.length=L,I=N>>>0>>>3,N=0;N>>0];return(x?Be[x]:Hi[h])(...We)}var _t=()=>{lt=0};function Ot(h){h>>>=0,u?postMessage({Bb:"cleanupThread",hc:h}):Mt(ir[h])}function At(h){}var Yt=(h,x)=>{var I=Br[h];if(I===void 0)throw h=Xn(h),I=Er(h),Gr(h),new ar(`${x} has unknown type ${I}`);return I},Ut=(h,x,I)=>{var L=[];return h=h.toWireType(L,I),L.length&&(ye()[x>>>2>>>0]=hr(L)),h};function mr(h,x,I){return x>>>=0,I>>>=0,h=cr(h>>>0),x=Yt(x,"emval::as"),Ut(x,I,h)}function Mr(h,x){return x>>>=0,h=cr(h>>>0),(x=Yt(x,"emval::as")).toWireType(null,h)}var Pr=h=>{try{h()}catch(x){$e(x)}},Cr=0,Zt=null,Es=0,Kt=[],fr={},Dr={},Xr=0,Jr=null,Ir=[];function Lr(h){return function(x){if(!ae){if(Cr===0){var I=!1,L=!1;x((N=0)=>{if(!ae&&(Es=N,I=!0,L)){Cr=2,Pr(()=>Xo(Zt)),typeof MainLoop<"u"&&MainLoop.Pb&&MainLoop.resume(),N=!1;try{var ue=function(){var Ke=le()[Zt+8>>>2>>>0];return Ke=ct[Dr[Ke]],--lt,Ke()}()}catch(Ke){ue=Ke,N=!0}var Te=!1;if(!Zt){var Le=Jr;Le&&(Jr=null,(N?Le.reject:Le.resolve)(ue),Te=!0)}if(N&&!Te)throw ue}}),L=!0,I||(Cr=1,Zt=function(){var N=Cn(65548),ue=N+12;ye()[N>>>2>>>0]=ue,ye()[N+4>>>2>>>0]=ue+65536,ue=Kt[0];var Te=fr[ue];return Te===void 0&&(Te=Xr++,fr[ue]=Te,Dr[Te]=ue),ue=Te,le()[N+8>>>2>>>0]=ue,N}(),typeof MainLoop<"u"&&MainLoop.Pb&&MainLoop.pause(),Pr(()=>Qo(Zt)))}else Cr===2?(Cr=0,Pr(Jo),Gr(Zt),Zt=null,Ir.forEach(ce)):$e(`invalid state: ${Cr}`);return Es}}(x=>{h().then(x)})}function br(h){return h>>>=0,Lr(async()=>{var x=await cr(h);return hr(x)})}var er=[];function dr(h,x,I,L){return I>>>=0,L>>>=0,(h=er[h>>>0])(null,x=cr(x>>>0),I,L)}var pr={},Ar=h=>{var x=pr[h];return x===void 0?Er(h):x};function us(h,x,I,L,N){return I>>>=0,L>>>=0,N>>>=0,(h=er[h>>>0])(x=cr(x>>>0),x[I=Ar(I)],L,N)}var xn=()=>typeof globalThis=="object"?globalThis:Function("return this")();function Ti(h){return(h>>>=0)==0?hr(xn()):(h=Ar(h),hr(xn()[h]))}var Ei=h=>{var x=er.length;return er.push(h),x},Pi=(h,x)=>{for(var I=Array(h),L=0;L>>2>>>0],"parameter "+L);return I},To=(h,x)=>Object.defineProperty(x,"name",{value:h});function qs(h,x,I){var L=(x=Pi(h,x>>>0)).shift();h--;var N=`return function (obj, func, destructorsRef, args) { -`,ue=0,Te=[];I===0&&Te.push("obj");for(var Le=["retType"],Ke=[L],tt=0;ttbt.name).join(", ")}) => ${L.name}>`,Ei(To(I,h))}function Ci(h){return h=Ar(h>>>0),hr(n[h])}function Si(h,x){return x>>>=0,h=cr(h>>>0),x=cr(x),hr(h[x])}function $i(h){9<(h>>>=0)&&(ur[h+1]+=1)}function ki(){return hr([])}function Ii(h){h=cr(h>>>0);for(var x=Array(h.length),I=0;I>>0))}function Ai(){return hr({})}function Fi(h){for(var x=cr(h>>>=0);x.length;){var I=x.pop();x.pop()(I)}as(h)}function Po(h,x,I){x>>>=0,I>>>=0,h=cr(h>>>0),x=cr(x),I=cr(I),h[x]=I}function Oi(h,x){return x>>>=0,h=(h=Yt(h>>>0,"_emval_take_value")).readValueFromPointer(x),hr(h)}function Co(h,x){h=-9007199254740992>h||9007199254740992>>=0,h=new Date(1e3*h),le()[x>>>2>>>0]=h.getUTCSeconds(),le()[x+4>>>2>>>0]=h.getUTCMinutes(),le()[x+8>>>2>>>0]=h.getUTCHours(),le()[x+12>>>2>>>0]=h.getUTCDate(),le()[x+16>>>2>>>0]=h.getUTCMonth(),le()[x+20>>>2>>>0]=h.getUTCFullYear()-1900,le()[x+24>>>2>>>0]=h.getUTCDay(),h=(h.getTime()-Date.UTC(h.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,le()[x+28>>>2>>>0]=h}var So=h=>h%4==0&&(h%100!=0||h%400==0),Kn=[0,31,60,91,121,152,182,213,244,274,305,335],Di=[0,31,59,90,120,151,181,212,243,273,304,334];function Li(h,x){h=-9007199254740992>h||9007199254740992>>=0,h=new Date(1e3*h),le()[x>>>2>>>0]=h.getSeconds(),le()[x+4>>>2>>>0]=h.getMinutes(),le()[x+8>>>2>>>0]=h.getHours(),le()[x+12>>>2>>>0]=h.getDate(),le()[x+16>>>2>>>0]=h.getMonth(),le()[x+20>>>2>>>0]=h.getFullYear()-1900,le()[x+24>>>2>>>0]=h.getDay();var I=(So(h.getFullYear())?Kn:Di)[h.getMonth()]+h.getDate()-1|0;le()[x+28>>>2>>>0]=I,le()[x+36>>>2>>>0]=-60*h.getTimezoneOffset(),I=new Date(h.getFullYear(),6,1).getTimezoneOffset();var L=new Date(h.getFullYear(),0,1).getTimezoneOffset();h=0|(I!=L&&h.getTimezoneOffset()==Math.min(L,I)),le()[x+32>>>2>>>0]=h}function $o(h){h>>>=0;var x=new Date(le()[h+20>>>2>>>0]+1900,le()[h+16>>>2>>>0],le()[h+12>>>2>>>0],le()[h+8>>>2>>>0],le()[h+4>>>2>>>0],le()[h>>>2>>>0],0),I=le()[h+32>>>2>>>0],L=x.getTimezoneOffset(),N=new Date(x.getFullYear(),6,1).getTimezoneOffset(),ue=new Date(x.getFullYear(),0,1).getTimezoneOffset(),Te=Math.min(ue,N);return 0>I?le()[h+32>>>2>>>0]=+(N!=ue&&Te==L):0>>2>>>0]=x.getDay(),I=(So(x.getFullYear())?Kn:Di)[x.getMonth()]+x.getDate()-1|0,le()[h+28>>>2>>>0]=I,le()[h>>>2>>>0]=x.getSeconds(),le()[h+4>>>2>>>0]=x.getMinutes(),le()[h+8>>>2>>>0]=x.getHours(),le()[h+12>>>2>>>0]=x.getDate(),le()[h+16>>>2>>>0]=x.getMonth(),le()[h+20>>>2>>>0]=x.getYear(),h=x.getTime(),BigInt(isNaN(h)?-1:h/1e3)}function ko(h,x,I,L,N,ue,Te){return u?Ge(16,1,h,x,I,L,N,ue,Te):-52}function Tn(h,x,I,L,N,ue){if(u)return Ge(17,1,h,x,I,L,N,ue)}var Qs={},zi=()=>performance.timeOrigin+performance.now();function Io(h,x){if(u)return Ge(18,1,h,x);if(Qs[h]&&(clearTimeout(Qs[h].id),delete Qs[h]),!x)return 0;var I=setTimeout(()=>{delete Qs[h],ce(()=>Ko(h,performance.timeOrigin+performance.now()))},x);return Qs[h]={id:I,qc:x},0}function Bi(h,x,I,L){h>>>=0,x>>>=0,I>>>=0,L>>>=0;var N=new Date().getFullYear(),ue=new Date(N,0,1).getTimezoneOffset();N=new Date(N,6,1).getTimezoneOffset();var Te=Math.max(ue,N);ye()[h>>>2>>>0]=60*Te,le()[x>>>2>>>0]=+(ue!=N),h=(x=Le=>{var Ke=Math.abs(Le);return`UTC${0<=Le?"-":"+"}${String(Math.floor(Ke/60)).padStart(2,"0")}${String(Ke%60).padStart(2,"0")}`})(ue),x=x(N),NDate.now();function ji(h,x,I){return 0<=h&&3>=h?(h===0?h=Date.now():h=performance.timeOrigin+performance.now(),J[I>>>0>>>3]=BigInt(Math.round(1e6*h)),0):28}var Hn=[],En=(h,x)=>{Hn.length=0;for(var I;I=U()[h++>>>0];){var L=I!=105;x+=(L&=I!=112)&&x%8?4:0,Hn.push(I==112?ye()[x>>>2>>>0]:I==106?J[x>>>3]:I==105?le()[x>>>2>>>0]:Ue()[x>>>3>>>0]),x+=L?8:4}return Hn};function Ao(h,x,I){return h>>>=0,x=En(x>>>0,I>>>0),Be[h](...x)}function Ni(h,x,I){return h>>>=0,x=En(x>>>0,I>>>0),Be[h](...x)}var Fo=()=>{};function Ns(h,x){return v(ut(h>>>0,x>>>0))}var Vi=()=>{throw lt+=1,"unwind"};function pu(){return 4294901760}var Ui=()=>navigator.hardwareConcurrency;function hu(){return $e("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}function Wi(h){h>>>=0;var x=U().length;if(h<=x||4294901760=I;I*=2){var L=x*(1+.2/I);L=Math.min(L,h+100663296);e:{L=(Math.min(4294901760,65536*Math.ceil(Math.max(h,L)/65536))-M.buffer.byteLength+65535)/65536|0;try{M.grow(L),re();var N=1;break e}catch{}N=void 0}if(N)return!0}return!1}var Xs=()=>($e("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),Js={},Oo=h=>{h.forEach(x=>{Xs()})};function Gi(){var h=Error().stack.toString().split(` -`);return h[0]=="Error"&&h.shift(),Oo(h),Js.Lb=Xs(),Js.cc=h,Js.Lb}function Ki(h,x,I){if(h>>>=0,x>>>=0,Js.Lb==h)var L=Js.cc;else(L=Error().stack.toString().split(` -`))[0]=="Error"&&L.shift(),Oo(L);for(var N=3;L[N]&&Xs()!=h;)++N;for(h=0;h>>2>>>0]=Xs();return h}var qn,Ys={},Do=()=>{if(!qn){var h,x={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:"./this.program"};for(h in Ys)Ys[h]===void 0?delete x[h]:x[h]=Ys[h];var I=[];for(h in x)I.push(`${h}=${x[h]}`);qn=I}return qn};function Lo(h,x){if(u)return Ge(19,1,h,x);h>>>=0,x>>>=0;var I=0;return Do().forEach((L,N)=>{var ue=x+I;for(N=ye()[h+4*N>>>2>>>0]=ue,ue=0;ue>>0]=L.charCodeAt(ue);A()[N>>>0]=0,I+=L.length+1}),0}function zo(h,x){if(u)return Ge(20,1,h,x);h>>>=0,x>>>=0;var I=Do();ye()[h>>>2>>>0]=I.length;var L=0;return I.forEach(N=>L+=N.length+1),ye()[x>>>2>>>0]=L,0}function Qn(h){return u?Ge(21,1,h):52}function Bo(h,x,I,L){return u?Ge(22,1,h,x,I,L):52}function Ro(h,x,I,L){return u?Ge(23,1,h,x,I,L):70}var jo=[null,[],[]];function No(h,x,I,L){if(u)return Ge(24,1,h,x,I,L);x>>>=0,I>>>=0,L>>>=0;for(var N=0,ue=0;ue>>2>>>0],Le=ye()[x+4>>>2>>>0];x+=8;for(var Ke=0;Ke>>0],bt=jo[h];tt===0||tt===10?((h===1?E:v)(ht(bt)),bt.length=0):bt.push(tt)}N+=Le}return ye()[L>>>2>>>0]=N,0}u||function(){for(var h=n.numThreads-1;h--;)oe();Ze.unshift(()=>{we++,function(x){u?x():Promise.all(Vt.map(D)).then(x)}(()=>Ce())})}();for(var Vo=Array(256),Zs=0;256>Zs;++Zs)Vo[Zs]=String.fromCharCode(Zs);As=Vo,ar=n.BindingError=class extends Error{constructor(h){super(h),this.name="BindingError"}},n.InternalError=class extends Error{constructor(h){super(h),this.name="InternalError"}},ur.push(0,1,void 0,1,null,1,!0,1,!1,1),n.count_emval_handles=()=>ur.length/2-5-is.length;var ct,Hi=[Ie,pt,ve,rt,jt,Jt,Or,ss,ys,ns,$s,Vr,ks,Qr,vs,Is,ko,Tn,Io,Lo,zo,Qn,Bo,Ro,No];(async function(){function h(L,N){return ct=L.exports,ct=function(){var ue=ct,Te={};for(let[Le,Ke]of Object.entries(ue))Te[Le]=typeof Ke=="function"?(...tt)=>{Kt.push(Le);try{return Ke(...tt)}finally{ae||(Kt.pop(),Zt&&Cr===1&&Kt.length===0&&(Cr=0,lt+=1,Pr(to),typeof Fibers<"u"&&Fibers.rc()))}}:Ke;return Te}(),ct=function(){var ue=ct,Te=Ke=>tt=>Ke(tt)>>>0,Le=Ke=>()=>Ke()>>>0;return(ue=Object.assign({},ue)).Da=Te(ue.Da),ue.fb=Le(ue.fb),ue.hb=Te(ue.hb),ue.tb=Te(ue.tb),ue.ub=Le(ue.ub),ue.__cxa_get_exception_ptr=Te(ue.__cxa_get_exception_ptr),ue}(),gr.push(ct.ib),y=N,Ce(),ct}we++;var x=Fe();if(n.instantiateWasm)return new Promise(L=>{n.instantiateWasm(x,(N,ue)=>{h(N,ue),L(N.exports)})});if(u)return new Promise(L=>{pe=N=>{var ue=new WebAssembly.Instance(N,Fe());L(h(ue,N))}});be??(be=n.locateFile?n.locateFile?n.locateFile("ort-wasm-simd-threaded.jsep.wasm",g):g+"ort-wasm-simd-threaded.jsep.wasm":new URL("/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",self.location.href).href);try{var I=await async function(L){var N=be;if(!fe&&typeof WebAssembly.instantiateStreaming=="function"&&!V(N))try{var ue=fetch(N,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(ue,L)}catch(Te){v(`wasm streaming compile failed: ${Te}`),v("falling back to ArrayBuffer instantiation")}return async function(Te,Le){try{var Ke=await async function(tt){if(!fe)try{var bt=await _(tt);return new Uint8Array(bt)}catch{}if(tt==be&&fe)tt=new Uint8Array(fe);else{if(!f)throw"both async and sync fetching of the wasm failed";tt=f(tt)}return tt}(Te);return await WebAssembly.instantiate(Ke,Le)}catch(tt){v(`failed to asynchronously prepare wasm: ${tt}`),$e(tt)}}(N,L)}(x);return h(I.instance,I.module)}catch(L){return o(L),Promise.reject(L)}})();var Xn=h=>(Xn=ct.Da)(h),Uo=()=>(Uo=ct.Ea)();n._OrtInit=(h,x)=>(n._OrtInit=ct.Fa)(h,x),n._OrtGetLastError=(h,x)=>(n._OrtGetLastError=ct.Ga)(h,x),n._OrtCreateSessionOptions=(h,x,I,L,N,ue,Te,Le,Ke,tt)=>(n._OrtCreateSessionOptions=ct.Ha)(h,x,I,L,N,ue,Te,Le,Ke,tt),n._OrtAppendExecutionProvider=(h,x,I,L,N)=>(n._OrtAppendExecutionProvider=ct.Ia)(h,x,I,L,N),n._OrtAddFreeDimensionOverride=(h,x,I)=>(n._OrtAddFreeDimensionOverride=ct.Ja)(h,x,I),n._OrtAddSessionConfigEntry=(h,x,I)=>(n._OrtAddSessionConfigEntry=ct.Ka)(h,x,I),n._OrtReleaseSessionOptions=h=>(n._OrtReleaseSessionOptions=ct.La)(h),n._OrtCreateSession=(h,x,I)=>(n._OrtCreateSession=ct.Ma)(h,x,I),n._OrtReleaseSession=h=>(n._OrtReleaseSession=ct.Na)(h),n._OrtGetInputOutputCount=(h,x,I)=>(n._OrtGetInputOutputCount=ct.Oa)(h,x,I),n._OrtGetInputOutputMetadata=(h,x,I,L)=>(n._OrtGetInputOutputMetadata=ct.Pa)(h,x,I,L),n._OrtFree=h=>(n._OrtFree=ct.Qa)(h),n._OrtCreateTensor=(h,x,I,L,N,ue)=>(n._OrtCreateTensor=ct.Ra)(h,x,I,L,N,ue),n._OrtGetTensorData=(h,x,I,L,N)=>(n._OrtGetTensorData=ct.Sa)(h,x,I,L,N),n._OrtReleaseTensor=h=>(n._OrtReleaseTensor=ct.Ta)(h),n._OrtCreateRunOptions=(h,x,I,L)=>(n._OrtCreateRunOptions=ct.Ua)(h,x,I,L),n._OrtAddRunConfigEntry=(h,x,I)=>(n._OrtAddRunConfigEntry=ct.Va)(h,x,I),n._OrtReleaseRunOptions=h=>(n._OrtReleaseRunOptions=ct.Wa)(h),n._OrtCreateBinding=h=>(n._OrtCreateBinding=ct.Xa)(h),n._OrtBindInput=(h,x,I)=>(n._OrtBindInput=ct.Ya)(h,x,I),n._OrtBindOutput=(h,x,I,L)=>(n._OrtBindOutput=ct.Za)(h,x,I,L),n._OrtClearBoundOutputs=h=>(n._OrtClearBoundOutputs=ct._a)(h),n._OrtReleaseBinding=h=>(n._OrtReleaseBinding=ct.$a)(h),n._OrtRunWithBinding=(h,x,I,L,N)=>(n._OrtRunWithBinding=ct.ab)(h,x,I,L,N),n._OrtRun=(h,x,I,L,N,ue,Te,Le)=>(n._OrtRun=ct.bb)(h,x,I,L,N,ue,Te,Le),n._OrtEndProfiling=h=>(n._OrtEndProfiling=ct.cb)(h),n._JsepOutput=(h,x,I)=>(n._JsepOutput=ct.db)(h,x,I),n._JsepGetNodeName=h=>(n._JsepGetNodeName=ct.eb)(h);var Pn=()=>(Pn=ct.fb)(),Gr=n._free=h=>(Gr=n._free=ct.gb)(h),Cn=n._malloc=h=>(Cn=n._malloc=ct.hb)(h),Jn=(h,x,I,L,N,ue)=>(Jn=ct.kb)(h,x,I,L,N,ue),Yn=()=>(Yn=ct.lb)(),Wo=(h,x,I,L,N)=>(Wo=ct.mb)(h,x,I,L,N),Go=h=>(Go=ct.nb)(h),Sn=h=>(Sn=ct.ob)(h),Ko=(h,x)=>(Ko=ct.pb)(h,x),Ho=()=>(Ho=ct.qb)(),Zn=(h,x)=>(Zn=ct.rb)(h,x),$n=h=>($n=ct.sb)(h),eo=h=>(eo=ct.tb)(h),kn=()=>(kn=ct.ub)(),qo=n.dynCall_ii=(h,x)=>(qo=n.dynCall_ii=ct.vb)(h,x),Qo=h=>(Qo=ct.wb)(h),to=()=>(to=ct.xb)(),Xo=h=>(Xo=ct.yb)(h),Jo=()=>(Jo=ct.zb)();return n.stackSave=()=>kn(),n.stackRestore=h=>$n(h),n.stackAlloc=h=>eo(h),n.setValue=function(h,x,I="i8"){switch(I.endsWith("*")&&(I="*"),I){case"i1":case"i8":A()[h>>>0]=x;break;case"i16":ee()[h>>>1>>>0]=x;break;case"i32":le()[h>>>2>>>0]=x;break;case"i64":J[h>>>3]=BigInt(x);break;case"float":ze()[h>>>2>>>0]=x;break;case"double":Ue()[h>>>3>>>0]=x;break;case"*":ye()[h>>>2>>>0]=x;break;default:$e(`invalid type for setValue: ${I}`)}},n.getValue=function(h,x="i8"){switch(x.endsWith("*")&&(x="*"),x){case"i1":case"i8":return A()[h>>>0];case"i16":return ee()[h>>>1>>>0];case"i32":return le()[h>>>2>>>0];case"i64":return J[h>>>3];case"float":return ze()[h>>>2>>>0];case"double":return Ue()[h>>>3>>>0];case"*":return ye()[h>>>2>>>0];default:$e(`invalid type for getValue: ${x}`)}},n.UTF8ToString=ut,n.stringToUTF8=wr,n.lengthBytesUTF8=Ht,function h(){if(0{Pa(),Ia=typeof location>"u"?void 0:location.origin,Aa=self.location.href>"file:"&&self.location.href<"file;",Zc=()=>{{if(Aa){let e=URL;return new URL(new e("ort.bundle.min.mjs",self.location.href).href,Ia).href}return self.location.href}},Hr=Zc(),ed=()=>{if(Hr&&!Hr.startsWith("blob:"))return Hr.substring(0,Hr.lastIndexOf("/")+1)},si=(e,r)=>{try{let t=r??Hr;return(t?new URL(e,t):new URL(e)).origin===Ia}catch{return!1}},td=(e,r)=>{let t=r??Hr;try{return(t?new URL(e,t):new URL(e)).href}catch{return}},rd=(e,r)=>`${r??"./"}${e}`,Fa=async e=>{let r=await(await fetch(e,{credentials:"same-origin"})).blob();return URL.createObjectURL(r)},sd=async e=>(await import(e)).default,Oa=(Tv(),io(qc)).default,nd=async()=>{if(!Hr)throw new Error("Failed to load proxy worker: cannot determine the script source URL.");if(si(Hr))return[void 0,Oa()];let e=await Fa(Hr);return[e,Oa(e)]},Da=(Ev(),io(Xc)).default,od=async(e,r,t)=>{if(!e&&!r&&Da&&Hr&&si(Hr))return[void 0,Da];{let s="ort-wasm-simd-threaded.jsep.mjs",o=e??td(s,r),n=t&&o&&!si(o,r),i=n?await Fa(o):o??rd(s,r);return[n?i:void 0,await sd(i)]}}}),za,ni,co,Ba,id,ad,ld,Ra,Qt,nn=je(()=>{La(),ni=!1,co=!1,Ba=!1,id=()=>{if(typeof SharedArrayBuffer>"u")return!1;try{return 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}},ad=()=>{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}},ld=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},Ra=async e=>{if(ni)return Promise.resolve();if(co)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(Ba)throw new Error("previous call to 'initializeWebAssembly()' failed.");co=!0;let r=e.initTimeout,t=e.numThreads;if(e.simd!==!1){if(e.simd==="relaxed"){if(!ld())throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.")}else if(!ad())throw new Error("WebAssembly SIMD is not supported in the current environment.")}let s=id();t>1&&!s&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+t+", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info."),console.warn("WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading."),e.numThreads=t=1);let o=e.wasmPaths,n=typeof o=="string"?o:void 0,i=o==null?void 0:o.mjs,a=(i==null?void 0:i.href)??i,l=o==null?void 0:o.wasm,u=(l==null?void 0:l.href)??l,p=e.wasmBinary,[c,d]=await od(a,n,t>1),_=!1,f=[];if(r>0&&f.push(new Promise(T=>{setTimeout(()=>{_=!0,T()},r)})),f.push(new Promise((T,k)=>{let g={numThreads:t};if(p)g.wasmBinary=p;else if(u||n)g.locateFile=w=>u??n+w;else if(a&&a.indexOf("blob:")!==0)g.locateFile=w=>new URL(w,a).href;else if(c){let w=ed();w&&(g.locateFile=S=>w+S)}d(g).then(w=>{co=!1,ni=!0,za=w,T(),c&&URL.revokeObjectURL(c)},w=>{co=!1,Ba=!0,k(w)})})),await Promise.race(f),_)throw new Error(`WebAssembly backend initializing failed due to timeout: ${r}ms`)},Qt=()=>{if(ni&&za)return za;throw new Error("WebAssembly is not initialized yet.")}}),fs,oi,Gt,ja=je(()=>{nn(),fs=(e,r)=>{let t=Qt(),s=t.lengthBytesUTF8(e)+1,o=t._malloc(s);return t.stringToUTF8(e,o,s),r.push(o),o},oi=(e,r,t,s)=>{if(typeof e=="object"&&e!==null){if(t.has(e))throw new Error("Circular reference in options");t.add(e)}Object.entries(e).forEach(([o,n])=>{let i=r?r+o:o;if(typeof n=="object")oi(n,i+".",t,s);else if(typeof n=="string"||typeof n=="number")s(i,n.toString());else if(typeof n=="boolean")s(i,n?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof n}`)})},Gt=e=>{let r=Qt(),t=r.stackSave();try{let s=r.PTR_SIZE,o=r.stackAlloc(2*s);r._OrtGetLastError(o,o+s);let n=Number(r.getValue(o,s===4?"i32":"i64")),i=r.getValue(o+s,"*"),a=i?r.UTF8ToString(i):"";throw new Error(`${e} ERROR_CODE: ${n}, ERROR_MESSAGE: ${a}`)}finally{r.stackRestore(t)}}}),ud,Pv=je(()=>{nn(),ja(),ud=e=>{let r=Qt(),t=0,s=[],o=e||{};try{if((e==null?void 0:e.logSeverityLevel)===void 0)o.logSeverityLevel=2;else if(typeof e.logSeverityLevel!="number"||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if((e==null?void 0:e.logVerbosityLevel)===void 0)o.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!="number"||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);(e==null?void 0:e.terminate)===void 0&&(o.terminate=!1);let n=0;return(e==null?void 0:e.tag)!==void 0&&(n=fs(e.tag,s)),t=r._OrtCreateRunOptions(o.logSeverityLevel,o.logVerbosityLevel,!!o.terminate,n),t===0&&Gt("Can't create run options."),(e==null?void 0:e.extra)!==void 0&&oi(e.extra,"",new WeakSet,(i,a)=>{let l=fs(i,s),u=fs(a,s);r._OrtAddRunConfigEntry(t,l,u)!==0&&Gt(`Can't set a run config entry: ${i} - ${a}.`)}),[t,s]}catch(n){throw t!==0&&r._OrtReleaseRunOptions(t),s.forEach(i=>r._free(i)),n}}}),cd,dd,pd,po,hd,md,Cv=je(()=>{nn(),ja(),cd=e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}},dd=e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}},pd=e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});let r=e.extra.session;r.use_ort_model_bytes_directly||(r.use_ort_model_bytes_directly="1"),e.executionProviders&&e.executionProviders.some(t=>(typeof t=="string"?t:t.name)==="webgpu")&&(e.enableMemPattern=!1)},po=(e,r,t,s)=>{let o=fs(r,s),n=fs(t,s);Qt()._OrtAddSessionConfigEntry(e,o,n)!==0&&Gt(`Can't set a session config entry: ${r} - ${t}.`)},hd=async(e,r,t)=>{for(let s of r){let o=typeof s=="string"?s:s.name,n=[];switch(o){case"webnn":if(o="WEBNN",typeof s!="string"){let p=s==null?void 0:s.deviceType;p&&po(e,"deviceType",p,t)}break;case"webgpu":if(o="JS",typeof s!="string"){let p=s;if(p!=null&&p.preferredLayout){if(p.preferredLayout!=="NCHW"&&p.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${p.preferredLayout}`);po(e,"preferredLayout",p.preferredLayout,t)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${o}`)}let i=fs(o,t),a=n.length,l=0,u=0;if(a>0){l=Qt()._malloc(a*Qt().PTR_SIZE),t.push(l),u=Qt()._malloc(a*Qt().PTR_SIZE),t.push(u);for(let p=0;p{let r=Qt(),t=0,s=[],o=e||{};pd(o);try{let n=cd(o.graphOptimizationLevel??"all"),i=dd(o.executionMode??"sequential"),a=typeof o.logId=="string"?fs(o.logId,s):0,l=o.logSeverityLevel??2;if(!Number.isInteger(l)||l<0||l>4)throw new Error(`log serverity level is not valid: ${l}`);let u=o.logVerbosityLevel??0;if(!Number.isInteger(u)||u<0||u>4)throw new Error(`log verbosity level is not valid: ${u}`);let p=typeof o.optimizedModelFilePath=="string"?fs(o.optimizedModelFilePath,s):0;if(t=r._OrtCreateSessionOptions(n,!!o.enableCpuMemArena,!!o.enableMemPattern,i,!!o.enableProfiling,0,a,l,u,p),t===0&&Gt("Can't create session options."),o.executionProviders&&await hd(t,o.executionProviders,s),o.enableGraphCapture!==void 0){if(typeof o.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${o.enableGraphCapture}`);po(t,"enableGraphCapture",o.enableGraphCapture.toString(),s)}if(o.freeDimensionOverrides)for(let[c,d]of Object.entries(o.freeDimensionOverrides)){if(typeof c!="string")throw new Error(`free dimension override name must be a string: ${c}`);if(typeof d!="number"||!Number.isInteger(d)||d<0)throw new Error(`free dimension override value must be a non-negative integer: ${d}`);let _=fs(c,s);r._OrtAddFreeDimensionOverride(t,_,d)!==0&&Gt(`Can't set a free dimension override: ${c} - ${d}.`)}return o.extra!==void 0&&oi(o.extra,"",new WeakSet,(c,d)=>{po(t,c,d,s)}),[t,s]}catch(n){throw t!==0&&r._OrtReleaseSessionOptions(t)!==0&&Gt("Can't release session options."),s.forEach(i=>r._free(i)),n}}}),jn,zs,on,Na,ii,Va,Ua,Wa,ft=je(()=>{jn=e=>{switch(e){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"float16":return 10;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;case"int4":return 22;case"uint4":return 21;default:throw new Error(`unsupported data type: ${e}`)}},zs=e=>{switch(e){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 10:return"float16";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";case 22:return"int4";case 21:return"uint4";default:throw new Error(`unsupported data type: ${e}`)}},on=(e,r)=>{let t=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],s=typeof r=="number"?r:r.reduce((o,n)=>o*n,1);return t>0?Math.ceil(s*t):void 0},Na=e=>{switch(e){case"float16":return typeof Float16Array<"u"&&Float16Array.from?Float16Array:Uint16Array;case"float32":return Float32Array;case"uint8":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"bool":return Uint8Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}},ii=e=>{switch(e){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${e}`)}},Va=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",Ua=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint64"||e==="int8"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",Wa=e=>{switch(e){case"none":return 0;case"cpu":return 1;case"cpu-pinned":return 2;case"texture":return 3;case"gpu-buffer":return 4;case"ml-tensor":return 5;default:throw new Error(`unsupported data location: ${e}`)}}}),Ga,fd=je(()=>{Pa(),Ga=async e=>{if(typeof e=="string"){let r=await fetch(e);if(!r.ok)throw new Error(`failed to load external data file: ${e}`);let t=r.headers.get("Content-Length"),s=t?parseInt(t,10):0;if(s<1073741824)return new Uint8Array(await r.arrayBuffer());{if(!r.body)throw new Error(`failed to load external data file: ${e}, no response body.`);let o=r.body.getReader(),n;try{n=new ArrayBuffer(s)}catch(a){if(a instanceof RangeError){let l=Math.ceil(s/65536);n=new WebAssembly.Memory({initial:l,maximum:l}).buffer}else throw a}let i=0;for(;;){let{done:a,value:l}=await o.read();if(a)break;let u=l.byteLength;new Uint8Array(n,i,u).set(l),i+=u}return new Uint8Array(n,0,s)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),_d,gd,wd,Md,Ka,bd,It,Bs=je(()=>{ft(),_d=["V","I","W","E","F"],gd=(e,r)=>{console.log(`[${_d[e]},${new Date().toISOString()}]${r}`)},Ka=(e,r)=>{wd=e,Md=r},bd=(e,r)=>{let t=ii(e),s=ii(wd);t>=s&&gd(t,typeof r=="function"?r():r)},It=(...e)=>{Md&&bd(...e)}}),yd,Nn,Me,ai,vd,xd,Td,yt=je(()=>{yd=class{static calcMatMulShape(e,r){return e[1]!==r[0]?void 0:[e[0],r[1]]}},Nn=class{static calcShape(e,r,t=!1){let s=e.length,o=r.length;if(s===0)return r;if(o===0)return e;let n=Math.max(e.length,r.length),i=new Array(n);if(t){if(s<2||o<2)return;let a=yd.calcMatMulShape([e[s-2],e[s-1]],[r[o-2],r[o-1]]);if(a===void 0)return;[i[n-2],i[n-1]]=a}for(let a=t?3:1;a<=n;a++){let l=s-a<0?1:e[s-a],u=o-a<0?1:r[o-a];if(l!==u&&l>1&&u>1)return;let p=Math.max(l,u);if(l&&u)i[n-a]=Math.max(l,u);else{if(p>1)return;i[n-a]=0}}return i}static isValidBroadcast(e,r){let t=e.length,s=r.length;if(t>s)return!1;for(let o=1;o<=t;o++)if(e[t-o]!==1&&e[t-o]!==r[s-o])return!1;return!0}},Me=class _a{static size(r){return _a.getSizeFromDimensionRange(r,0,r.length)}static convertShape(r,t=4){let s=r.length;if(s===0)return[];let o=new Array(s),n=s-1;for(;n>=0;){if(r[n]%t===0){o[n]=r[n]/t;break}if(t%r[n]!==0)throw new Error("cannot convert shape");o[n]=1,t/=r[n],n--}for(n--;n>=0;n--)o[n]=r[n];return o}static sizeFromDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${r.length} dimensions.`);return _a.getSizeFromDimensionRange(r,t,r.length)}static sizeToDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${r.length} dimensions.`);return _a.getSizeFromDimensionRange(r,0,t)}static getSizeFromDimensionRange(r,t,s){let o=1;for(let n=t;n=0;--o)s[o]=s[o+1]*r[o+1];return s}static normalizeAxis(r,t){if(r<-t&&r>=t)throw new Error("unsupported axis for this operation.");return r<0?r+t:r}static normalizeAxes(r,t){return r.map(s=>this.normalizeAxis(s,t??r.length))}static sortBasedOnPerm(r,t){return t?t.map(s=>r[s]):r.slice().reverse()}static padShape(r,t){let s=r.length;return r.map((o,n)=>o+t[n]+t[n+s])}static areEqual(r,t){return r.length!==t.length?!1:r.every((s,o)=>s===t[o])}},ai=class ei{static adjustPoolAttributes(r,t,s,o,n,i){if(!r&&s.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(r)for(let a=0;a=s.length?s.push(t[a+2]):s[a]=t[a+2];for(let a=0;a=s[a]||i[a+s.length]>=s[a])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(r,t,s,o,n,i,a){if(a){if(n.length!==2*(r.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==r.length-2)throw new Error("length of strides should be the length of data dimensions");if(o.length!==r.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let l=0;l{ft(),Ha=(e,r)=>new(Na(r))(e)}),qa,Qa,Pd,Xa,Cd,Ja,Ya,Za,Sd,$d,Sv=je(()=>{Bs(),qa=(e,r=!0)=>{if(e.byteLength%8!==0)throw new Error("Invalid Uint8Array length - must be a multiple of 8 (BigInt).");let t=e.byteLength/8,s=new BigInt64Array(e.buffer,e.byteOffset,t),o=new Int32Array(t);for(let n=0;n2147483647n||i<-2147483648n)throw new Error(`Overflow occurred when converting BigInt to Int32 at index ${n}: ${i}`);o[n]=Number(i)}return r?new Uint8Array(o.buffer):o},Qa=(e,r=!0)=>{if(e.byteLength%4!==0)throw new Error("Invalid Uint8Array length - must be a multiple of 4 (Int32).");let t=e.byteLength/4,s=new Int32Array(e.buffer,e.byteOffset,t),o=BigInt64Array.from(s,BigInt);return r?new Uint8Array(o.buffer):o},Pd=1,Xa=()=>Pd++,Cd=new Map([["float32",32],["float16",16],["int32",32],["uint32",32],["int64",64],["uint64",64],["int8",8],["uint8",8],["int4",4],["uint4",4]]),Ja=(e,r)=>{let t=Cd.get(e);if(!t)throw new Error("Unsupported data type.");return r.length>0?Math.ceil(r.reduce((s,o)=>s*o)*t/8):0},Ya=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:r,context:t,tensor:s,dataType:o,shape:n,shouldConvertInt64toInt32:i=!1}=e;this.sessionId=r,this.mlContext=t,this.mlTensor=s,this.dataType=o,this.tensorShape=n,this.shouldConvertInt64toInt32=i}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return Ja(this.dataType,this.tensorShape)}destroy(){It("verbose",()=>"[WebNN] TensorWrapper.destroy"),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,r){if(e){let t=await this.mlContext.readTensor(this.mlTensor),s=Qa(new Uint8Array(t));if(r){(r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).set(s);return}else return s.buffer}else return r?this.mlContext.readTensor(this.mlTensor,r):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,r,t){return this.mlContext===e&&this.dataType===r&&this.tensorShape.length===t.length&&this.tensorShape.every((s,o)=>s===t[o])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},Za=class{constructor(e,r){this.tensorManager=e,this.wrapper=r}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,r,t,s){let o=r,n=this.tensorManager.getMLContext(e),i=o==="int64"&&!n.opSupportLimits().input.dataTypes.includes("int64");if(i&&(o="int32",It("verbose",()=>"[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32")),this.wrapper){if(this.wrapper.canReuseTensor(n,o,t))return this.wrapper.tensor;if(s){if(this.wrapper.byteLength!==Ja(o,t))throw new Error("Unable to copy data to tensor with different size.");this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let a=typeof MLTensorUsage>"u"?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,o,t,a,!0,!0,i),s&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let r=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(r=qa(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),r.byteLength===this.wrapper.byteLength){this.wrapper.write(r);return}else It("verbose",()=>"Data size does not match tensor size. Releasing tensor."),this.releaseTensor();this.activeUpload?this.activeUpload.set(r):this.activeUpload=new Uint8Array(r)}async download(e){var r,t,s;if(this.activeUpload){let o=(r=this.wrapper)!=null&&r.isInt64ToInt32Converted?Qa(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(o):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(o);return}else return o.buffer}if(!this.wrapper)throw new Error("Tensor has not been created.");return e?this.wrapper.read((t=this.wrapper)==null?void 0:t.shouldConvertInt64toInt32,e):this.wrapper.read((s=this.wrapper)==null?void 0:s.shouldConvertInt64toInt32)}},Sd=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let r=this.backend.getMLContext(e);if(!r)throw new Error("MLContext not found for session.");return r}reserveTensorId(){let e=Xa();return this.tensorTrackersById.set(e,new Za(this)),e}releaseTensorId(e){let r=this.tensorTrackersById.get(e);r&&(this.tensorTrackersById.delete(e),r.tensorWrapper&&this.releaseTensor(r.tensorWrapper))}async ensureTensor(e,r,t,s,o){It("verbose",()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${r}, dataType: ${t}, shape: ${s}, copyOld: ${o}}`);let n=this.tensorTrackersById.get(r);if(!n)throw new Error("Tensor not found.");return n.ensureTensor(e,t,s,o)}upload(e,r){let t=this.tensorTrackersById.get(e);if(!t)throw new Error("Tensor not found.");t.upload(r)}async download(e,r){It("verbose",()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${r==null?void 0:r.byteLength}}`);let t=this.tensorTrackersById.get(e);if(!t)throw new Error("Tensor not found.");return t.download(r)}releaseTensorsForSession(e){for(let r of this.freeTensors)r.sessionId===e&&r.destroy();this.freeTensors=this.freeTensors.filter(r=>r.sessionId!==e)}registerTensor(e,r,t,s){let o=this.getMLContext(e),n=Xa(),i=new Ya({sessionId:e,context:o,tensor:r,dataType:t,shape:s});return this.tensorTrackersById.set(n,new Za(this,i)),this.externalTensors.add(i),n}async getCachedTensor(e,r,t,s,o,n,i=!1){let a=this.getMLContext(e);for(let[u,p]of this.freeTensors.entries())if(p.canReuseTensor(a,r,t)){It("verbose",()=>`[WebNN] Reusing tensor {dataType: ${r}, shape: ${t}}`);let c=this.freeTensors.splice(u,1)[0];return c.sessionId=e,c}It("verbose",()=>`[WebNN] MLContext.createTensor {dataType: ${r}, shape: ${t}}`);let l=await a.createTensor({dataType:r,shape:t,dimensions:t,usage:s,writable:o,readable:n});return new Ya({sessionId:e,context:a,tensor:l,dataType:r,shape:t,shouldConvertInt64toInt32:i})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},$d=(...e)=>new Sd(...e)}),li,kd,Id,$v=je(()=>{ft(),nn(),Ed(),Sv(),Bs(),li=new Map([[1,"float32"],[10,"float16"],[6,"int32"],[12,"uint32"],[7,"int64"],[13,"uint64"],[22,"int4"],[21,"uint4"],[3,"int8"],[2,"uint8"],[9,"uint8"]]),kd=(e,r)=>{if(e===r)return!0;if(e===void 0||r===void 0)return!1;let t=Object.keys(e).sort(),s=Object.keys(r).sort();return t.length===s.length&&t.every((o,n)=>o===s[n]&&e[o]===r[o])},Id=class{constructor(e){this.tensorManager=$d(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,Ka(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw new Error("No active session");return this.activeSessionId}onRunStart(e){It("verbose",()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){It("verbose",()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let r=this.temporarySessionTensorIds.get(e);if(r){for(let t of r)It("verbose",()=>`[WebNN] releasing temporary tensor {tensorId: ${t}}`),this.tensorManager.releaseTensorId(t);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(s=>s.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let s=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:s}),s}}else if(e===void 0){let t=this.mlContextCache.findIndex(s=>s.options===void 0&&s.gpuDevice===void 0);if(t!==-1)return this.mlContextCache[t].mlContext;{let s=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:s}),s}}let r=this.mlContextCache.findIndex(t=>kd(t.options,e));if(r!==-1)return this.mlContextCache[r].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,r){this.mlContextBySessionId.set(e,r);let t=this.sessionIdsByMLContext.get(r);t||(t=new Set,this.sessionIdsByMLContext.set(r,t)),t.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let r=this.mlContextBySessionId.get(e);if(!r)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let t=this.sessionIdsByMLContext.get(r);if(t.delete(e),t.size===0){this.sessionIdsByMLContext.delete(r);let s=this.mlContextCache.findIndex(o=>o.mlContext===r);s!==-1&&this.mlContextCache.splice(s,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){It("verbose",()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,r,t,s,o){let n=li.get(t);if(!n)throw new Error(`Unsupported ONNX data type: ${t}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,r,n,s,o)}async createTemporaryTensor(e,r,t){It("verbose",()=>`[WebNN] createTemporaryTensor {onnxDataType: ${r}, shape: ${t}}`);let s=li.get(r);if(!s)throw new Error(`Unsupported ONNX data type: ${r}`);let o=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,o,s,t,!1);let n=this.temporarySessionTensorIds.get(e);return n?n.push(o):this.temporarySessionTensorIds.set(e,[o]),o}uploadTensor(e,r){if(!Qt().shouldTransferToMLTensor)throw new Error("Trying to upload to a MLTensor while shouldTransferToMLTensor is false");It("verbose",()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${r.byteLength}}`),this.tensorManager.upload(e,r)}async downloadTensor(e,r){return this.tensorManager.download(e,r)}createMLTensorDownloader(e,r){return async()=>{let t=await this.tensorManager.download(e);return Ha(t,r)}}registerMLTensor(e,r,t,s){let o=li.get(t);if(!o)throw new Error(`Unsupported ONNX data type: ${t}`);let n=this.tensorManager.registerTensor(e,r,o,s);return It("verbose",()=>`[WebNN] registerMLTensor {tensor: ${r}, dataType: ${o}, dimensions: ${s}} -> {tensorId: ${n}}`),n}registerMLConstant(e,r,t,s,o,n,i=!1){if(!n)throw new Error("External mounted files are not available.");let a=e;e.startsWith("./")&&(a=e.substring(2));let l=n.get(a);if(!l)throw new Error(`File with name ${a} not found in preloaded files.`);if(r+t>l.byteLength)throw new Error("Out of bounds: data offset and length exceed the external file data size.");let u=l.slice(r,r+t).buffer,p;switch(o.dataType){case"float32":p=new Float32Array(u);break;case"float16":p=typeof Float16Array<"u"&&Float16Array.from?new Float16Array(u):new Uint16Array(u);break;case"int32":p=new Int32Array(u);break;case"uint32":p=new Uint32Array(u);break;case"int64":i?(p=qa(new Uint8Array(u),!1),o.dataType="int32"):p=new BigInt64Array(u);break;case"uint64":p=new BigUint64Array(u);break;case"int8":p=new Int8Array(u);break;case"int4":case"uint4":case"uint8":p=new Uint8Array(u);break;default:throw new Error(`Unsupported data type: ${o.dataType} in creating WebNN Constant from external data.`)}return It("verbose",()=>`[WebNN] registerMLConstant {dataType: ${o.dataType}, shape: ${o.shape}}} ${i?"(Note: it was int64 data type and registered to int32 as workaround)":""}`),s.constant(o,p)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,r){let t=this.sessionGraphInputs.get(e);return t?t.includes(r):!1}isInt64Supported(e){var r;return!!((r=this.mlContextBySessionId.get(e))!=null&&r.opSupportLimits().input.dataTypes.includes("int64"))}flush(){}}}),el=je(()=>{}),tl,ui,ci,Ad,Fd,rl,sl,Od,Dd,kv=je(()=>{Bs(),el(),tl=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),ui=[],ci=e=>Math.ceil(Number(e)/16)*16,Ad=e=>{for(let r=0;rFd++,sl=async(e,r,t,s)=>{let o=ci(t),n=e.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let i=e.getCommandEncoder();e.endComputePass(),i.copyBufferToBuffer(r,0,n,0,o),e.flush(),await n.mapAsync(GPUMapMode.READ);let a=n.getMappedRange();if(s){let l=s();return l.set(new Uint8Array(a,0,t)),l}else return new Uint8Array(a.slice(0,t))}finally{n.destroy()}},Od=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[r]of tl)ui.push(r),this.freeBuffers.set(r,[]),this.freeUniformBuffers.set(r,[]);this.sessionCount=0}upload(e,r){let t=r.buffer,s=r.byteOffset,o=r.byteLength,n=ci(o),i=this.storageCache.get(e);if(!i)throw new Error("gpu data for uploading does not exist");if(Number(i.originalSize)!==o)throw new Error(`inconsistent data size. gpu data size=${i.originalSize}, data size=${o}`);let a=this.backend.device.createBuffer({mappedAtCreation:!0,size:n,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),l=a.getMappedRange();new Uint8Array(l).set(new Uint8Array(t,s,o)),a.unmap();let u=this.backend.device.createCommandEncoder();u.copyBufferToBuffer(a,0,i.gpuData.buffer,0,n),this.backend.device.queue.submit([u.finish()]),a.destroy(),It("verbose",()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,r){let t=this.storageCache.get(e);if(!t)throw new Error("source gpu data for memcpy does not exist");let s=this.storageCache.get(r);if(!s)throw new Error("destination gpu data for memcpy does not exist");if(t.originalSize!==s.originalSize)throw new Error("inconsistent source and destination gpu data size");let o=ci(t.originalSize),n=this.backend.getCommandEncoder();this.backend.endComputePass(),n.copyBufferToBuffer(t.gpuData.buffer,0,s.gpuData.buffer,0,o)}registerExternalBuffer(e,r,t){let s;if(t){if(s=t[0],e===t[1])return It("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${s}, buffer is the same, skip.`),s;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw new Error(`Registering a different external buffer under graph capture mode is not supported yet. - Please use the previous external buffer!`)}else s=rl();return this.storageCache.set(s,{gpuData:{id:s,type:0,buffer:e},originalSize:r}),It("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${s}, registered.`),s}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),It("verbose",()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,r=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let t=Ad(e),s,o=(r&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,n=(r&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(o||n){let a=(o?this.freeBuffers:this.freeUniformBuffers).get(t);a?a.length>0?s=a.pop():s=this.backend.device.createBuffer({size:t,usage:r}):s=this.backend.device.createBuffer({size:t,usage:r})}else s=this.backend.device.createBuffer({size:t,usage:r});let i={id:rl(),type:0,buffer:s};return this.storageCache.set(i.id,{gpuData:i,originalSize:Number(e)}),It("verbose",()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${i.id}`),i}get(e){var r;return(r=this.storageCache.get(e))==null?void 0:r.gpuData}release(e){let r=typeof e=="bigint"?Number(e):e,t=this.storageCache.get(r);if(!t){if(this.storageCache.size===0)return 0;throw new Error("releasing data does not exist")}return It("verbose",()=>`[WebGPU] GpuDataManager.release(id=${r}), gpuDataId=${t.gpuData.id}`),this.storageCache.delete(r),this.buffersPending.push(t.gpuData.buffer),t.originalSize}async download(e,r){let t=this.storageCache.get(Number(e));if(!t)throw new Error("data does not exist");await sl(this.backend,t.gpuData.buffer,t.originalSize,r)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus==="default"){for(let e of this.buffersPending){let r=tl.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let t=this.freeBuffers.get(e.size)||[];r===void 0||t.length>=r?e.destroy():t.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let t=this.freeUniformBuffers.get(e.size)||[];r===void 0||t.length>=r?e.destroy():t.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let r of this.buffersPending)e.push(r);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let r=this.capturedPendingBuffers.get(e);r&&(r.forEach(t=>{t.destroy()}),this.capturedPendingBuffers.delete(e)),this.sessionCount-=1,this.sessionCount===0&&(It("warning",()=>"[WebGPU] Clearing webgpu buffer cache"),this.storageCache.forEach(t=>{t.gpuData.buffer.destroy()}),this.storageCache=new Map)}},Dd=(...e)=>new Od(...e)}),Ld,zt,or=je(()=>{Ld=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||(this.key=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(";")),this.key}},zt=e=>new Ld(e)}),Vn,di,Tr,zr,at,sr,nl,Un,Us,st,ho,Pe,et,zd,ol,Bd,Rd,Tt=je(()=>{ft(),yt(),Vn=64,di=(e,r)=>{if(r===3)throw new Error("vec3 has same alignment as vec4, use vec4 instead");switch(Number(e)){case 10:return r>1?`vec${r}`:"f16";case 1:return r>1?`vec${r}`:"f32";case 6:return r>1?`vec${r}`:"i32";case 12:return r>1?`vec${r}`:"u32";case 7:if(r>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2","i32"];case 13:if(r>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2","u32"];case 9:if(r!==4)throw new Error("bool must be vec4");return["u32","vec4"];case 22:return"i32";case 21:return"u32";default:throw new Error(`Unknown data type: ${e}`)}},Tr=(e,r=1)=>{let t=di(e,r);return typeof t=="string"?t:t[0]},zr=(e,r=1)=>{let t=di(e,r);return typeof t=="string"?t:t[1]},at=(...e)=>{let r=[];return e.forEach(t=>{t.length!==0&&r.push({type:12,data:t},{type:12,data:Me.computeStrides(t)})}),r},sr=e=>e%4===0?4:e%2===0?2:1,nl=(e="f32",r,t="0")=>!r||r===1?`${e}(${t})`:`vec${r}<${e}>(${t})`,Un=(e,r,t)=>e==="f32"?t:r===1?`f32(${t})`:`vec${r}(${t})`,Us=(e,r)=>r===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:r===2?`(${e}.x + ${e}.y)`:r===3?`(${e}.x + ${e}.y + ${e}.z)`:e,st=(e,r,t,s)=>e.startsWith("uniforms.")&&t>4?typeof r=="string"?s==="f16"?`${e}[(${r}) / 8][(${r}) % 8 / 4][(${r}) % 8 % 4]`:`${e}[(${r}) / 4][(${r}) % 4]`:s==="f16"?`${e}[${Math.floor(r/8)}][${Math.floor(r%8/4)}][${r%8%4}]`:`${e}[${Math.floor(r/4)}][${r%4}]`:t>1?`${e}[${r}]`:e,ho=(e,r,t,s,o)=>{let n=typeof t=="number",i=n?t:t.length,a=[...new Array(i).keys()],l=i<2?"u32":i<=4?`vec${i}`:`array`,u=di(r,o),p=typeof u=="string"?u:u[1],c=typeof u=="string"?u:u[0],d={indices:l,value:p,storage:c,tensor:r},_=V=>typeof V=="string"?V:`${V}u`,f={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},T=n?"uniforms.":"",k=`${T}${e}_shape`,g=`${T}${e}_strides`,w="";for(let V=0;V ${d.indices} { - var indices: ${d.indices}; - var current = offset; - ${w} - return indices; - }`,E=V=>(f.offsetToIndices=!0,i<2?V:`o2i_${e}(${V})`),v=[];if(i>=2)for(let V=i-1;V>=0;V--)v.push(`${st(g,V,i)} * (indices[${V}])`);let M=i<2?"":` - fn i2o_${e}(indices: ${d.indices}) -> u32 { - return ${v.join("+")}; - }`,y=V=>(f.indicesToOffset=!0,i<2?V:`i2o_${e}(${V})`),C=(...V)=>i===0?"0u":`${d.indices}(${V.map(_).join(",")})`,F=(V,A)=>i<2?`${V}`:`${st(V,A,i)}`,z=(V,A,U)=>i<2?`${V}=${U};`:`${st(V,A,i)}=${U};`,K={},q=(V,A)=>{f.broadcastedIndicesToOffset=!0;let U=`${A.name}broadcastedIndicesTo${e}Offset`;if(U in K)return`${U}(${V})`;let ee=[];for(let _e=i-1;_e>=0;_e--){let le=A.indicesGet("outputIndices",_e+A.rank-i);ee.push(`${F(g,_e)} * (${le} % ${F(k,_e)})`)}return K[U]=`fn ${U}(outputIndices: ${A.type.indices}) -> u32 { - return ${ee.length>0?ee.join("+"):"0u"}; - }`,`${U}(${V})`},R=(V,A)=>(()=>{if(d.storage===d.value)return`${e}[${V}]=${A};`;if(d.storage==="vec2"&&d.value==="i32")return`${e}[${V}]=vec2(u32(${A}), select(0u, 0xFFFFFFFFu, ${A} < 0));`;if(d.storage==="vec2"&&d.value==="u32")return`${e}[${V}]=vec2(u32(${A}), 0u);`;if(d.storage==="u32"&&d.value==="vec4")return`${e}[${V}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${A}));`;throw new Error(`not supported combination of storage type ${d.storage} and value type ${d.value} yet`)})(),Z=V=>(()=>{if(d.storage===d.value)return`${e}[${V}]`;if(d.storage==="vec2"&&d.value==="i32")return`i32(${e}[${V}].x)`;if(d.storage==="vec2"&&d.value==="u32")return`u32(${e}[${V}].x)`;if(d.storage==="u32"&&d.value==="vec4")return`vec4(bool(${e}[${V}] & 0xFFu), bool(${e}[${V}] & 0xFF00u), bool(${e}[${V}] & 0xFF0000u), bool(${e}[${V}] & 0xFF000000u))`;throw new Error(`not supported combination of storage type ${d.storage} and value type ${d.value} yet`)})(),H=i<2?"":` - fn get_${e}ByIndices(indices: ${d.indices}) -> ${p} { - return ${Z(`i2o_${e}(indices)`)}; - }`,J=i<2?"":(()=>{let V=a.map(U=>`d${U}: u32`).join(", "),A=a.map(U=>`d${U}`).join(", ");return` - fn get_${e}(${V}) -> ${p} { - return get_${e}ByIndices(${C(A)}); - }`})(),Q=(...V)=>{if(V.length!==i)throw new Error(`indices length must be ${i}`);let A=V.map(_).join(",");return i===0?Z("0u"):i===1?Z(A[0]):(f.get=!0,f.getByIndices=!0,f.indicesToOffset=!0,`get_${e}(${A})`)},se=V=>i<2?Z(V):(f.getByIndices=!0,f.indicesToOffset=!0,`get_${e}ByIndices(${V})`),fe=i<2?"":` - fn set_${e}ByIndices(indices: ${d.indices}, value: ${p}) { - ${R(`i2o_${e}(indices)`,"value")} - }`,ae=i<2?"":(()=>{let V=a.map(U=>`d${U}: u32`).join(", "),A=a.map(U=>`d${U}`).join(", ");return` - fn set_${e}(${V}, value: ${p}) { - set_${e}ByIndices(${C(A)}, value); - }`})();return{impl:()=>{let V=[],A=!1;return f.offsetToIndices&&(V.push(S),A=!0),f.indicesToOffset&&(V.push(M),A=!0),f.broadcastedIndicesToOffset&&(Object.values(K).forEach(U=>V.push(U)),A=!0),f.set&&(V.push(ae),A=!0),f.setByIndices&&(V.push(fe),A=!0),f.get&&(V.push(J),A=!0),f.getByIndices&&(V.push(H),A=!0),!n&&A&&V.unshift(`const ${k} = ${d.indices}(${t.join(",")});`,`const ${g} = ${d.indices}(${Me.computeStrides(t).join(",")});`),V.join(` -`)},type:d,offsetToIndices:E,indicesToOffset:y,broadcastedIndicesToOffset:q,indices:C,indicesGet:F,indicesSet:z,set:(...V)=>{if(V.length!==i+1)throw new Error(`indices length must be ${i}`);let A=V[i];if(typeof A!="string")throw new Error("value must be string");let U=V.slice(0,i).map(_).join(",");return i===0?R("0u",A):i===1?R(U[0],A):(f.set=!0,f.setByIndices=!0,f.indicesToOffset=!0,`set_${e}(${U}, ${A})`)},setByOffset:R,setByIndices:(V,A)=>i<2?R(V,A):(f.setByIndices=!0,f.indicesToOffset=!0,`set_${e}ByIndices(${V}, ${A});`),get:Q,getByOffset:Z,getByIndices:se,usage:s,name:e,strides:g,shape:k,rank:i}},Pe=(e,r,t,s=1)=>ho(e,r,t,"input",s),et=(e,r,t,s=1)=>ho(e,r,t,"output",s),zd=(e,r,t)=>ho(e,r,t,"atomicOutput",1),ol=(e,r,t,s=1)=>ho(e,r,t,"internal",s),Bd=class{constructor(e,r){this.normalizedDispatchGroup=e,this.limits=r,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e=="number"?`${e}u`:e}) { return; }`}mainStart(e=Vn){let r=typeof e=="number"?e:e[0],t=typeof e=="number"?1:e[1],s=typeof e=="number"?1:e[2];if(r>this.limits.maxComputeWorkgroupSizeX||t>this.limits.maxComputeWorkgroupSizeY||s>this.limits.maxComputeWorkgroupSizeZ)throw new Error(`workgroup size [${r}, ${t}, ${s}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(r*t*s>this.limits.maxComputeInvocationsPerWorkgroup)throw new Error(`workgroup size [${r}, ${t}, ${s}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let o=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,n=o?`@builtin(global_invocation_id) global_id : vec3, - @builtin(workgroup_id) workgroup_id : vec3, - @builtin(local_invocation_index) local_idx : u32, - @builtin(local_invocation_id) local_id : vec3`:`@builtin(global_invocation_id) global_id : vec3, - @builtin(local_invocation_id) local_id : vec3, - @builtin(local_invocation_index) local_idx : u32, - @builtin(workgroup_id) workgroup_id : vec3, - @builtin(num_workgroups) num_workgroups : vec3`,i=o?`let global_idx = global_id.x; - let workgroup_index = workgroup_id.x;`:`let workgroup_index = workgroup_id.z * num_workgroups[0] * num_workgroups[1] + - workgroup_id.y * num_workgroups[0] + workgroup_id.x; - let global_idx = workgroup_index * ${r*t*s}u + local_idx;`;return`@compute @workgroup_size(${r}, ${t}, ${s}) - fn main(${n}) { - ${i} - `}appendVariableUniforms(e){e.rank!==0&&(e.shape.startsWith("uniforms.")&&this.uniforms.push({name:e.shape.replace("uniforms.",""),type:"u32",length:e.rank}),e.strides.startsWith("uniforms.")&&this.uniforms.push({name:e.strides.replace("uniforms.",""),type:"u32",length:e.rank}))}declareVariable(e,r){if(e.usage==="internal")throw new Error("cannot use internal variable with declareVariable(). use registerInternalVariables() instead.");this.variables.push(e),this.appendVariableUniforms(e);let t=e.usage==="input"?"read":"read_write",s=e.usage==="atomicOutput"?"atomic":e.type.storage;return`@group(0) @binding(${r}) var ${e.name}: array<${s}>;`}declareVariables(...e){return e.map(r=>this.declareVariable(r,this.variableIndex++)).join(` -`)}registerInternalVariable(e){if(e.usage!=="internal")throw new Error("cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.");this.internalVariables.push(e),this.appendVariableUniforms(e)}registerInternalVariables(...e){return e.forEach(r=>this.registerInternalVariable(r)),this}registerUniform(e,r,t=1){return this.uniforms.push({name:e,type:r,length:t}),this}registerUniforms(e){return this.uniforms=this.uniforms.concat(e),this}uniformDeclaration(){if(this.uniforms.length===0)return"";let e=[];for(let{name:r,type:t,length:s}of this.uniforms)if(s&&s>4)t==="f16"?e.push(`@align(16) ${r}:array, ${Math.ceil(s/8)}>`):e.push(`${r}:array, ${Math.ceil(s/4)}>`);else{let o=s==null||s===1?t:`vec${s}<${t}>`;e.push(`${r}:${o}`)}return` - struct Uniforms { ${e.join(", ")} }; - @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(e=>e.impl()).join(` -`)+this.internalVariables.map(e=>e.impl()).join(` -`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=r=>[12,10,1,6][["u32","f16","f32","i32"].indexOf(r)];return this.uniforms.map(r=>[e(r.type),r.length??1])}},Rd=(e,r)=>new Bd(e,r)}),jd,il,Nd,Vd,Ud,Wd,qr,Gd,Kd,Ws=je(()=>{ft(),yt(),or(),Tt(),jd=(e,r)=>{if(!e||e.length!==1)throw new Error("Transpose requires 1 input.");if(r.length!==0&&r.length!==e[0].dims.length)throw new Error(`perm size ${r.length} does not match input rank ${e[0].dims.length}`)},il=(e,r)=>r.length!==0?r:[...new Array(e).keys()].reverse(),Nd=(e,r)=>Me.sortBasedOnPerm(e,il(e.length,r)),Vd=(e,r,t,s)=>{let o=`fn perm(i: ${s.type.indices}) -> ${t.type.indices} { - var a: ${t.type.indices};`;for(let n=0;n{let t=[],s=[];for(let o=0;o{let t=0;for(let s=0;s{let t=e.dataType,s=e.dims.length,o=il(s,r),n=Nd(e.dims,o),i=e.dims,a=n,l=s<2||Wd(o,e.dims),u;if(l)return u=f=>{let T=Pe("input",t,i,4),k=et("output",t,a,4);return` - ${f.registerUniform("output_size","u32").declareVariables(T,k)} - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - output[global_idx] = input[global_idx]; - }`},{name:"TransposeCopy",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let f=Me.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64/4)},programUniforms:[{type:12,data:Math.ceil(f/4)}]}},getShaderSource:u};let{newShape:p,newPerm:c}=Ud(e.dims,o),d=Me.areEqual(c,[2,3,1]),_=Me.areEqual(c,[3,1,2]);if(p.length===2||d||_){i=d?[p[0],p[1]*p[2]]:_?[p[0]*p[1],p[2]]:p,a=[i[1],i[0]];let f=16;return u=T=>{let k=Pe("a",t,i.length),g=et("output",t,a.length);return` - ${T.registerUniform("output_size","u32").declareVariables(k,g)} - var tile : array, ${f}>; - ${T.mainStart([f,f,1])} - let stride = (uniforms.output_shape[1] - 1) / ${f} + 1; - let workgroup_id_x = workgroup_index % stride; - let workgroup_id_y = workgroup_index / stride; - let input_col = workgroup_id_y * ${f}u + local_id.x; - let input_row = workgroup_id_x * ${f}u + local_id.y; - if (input_row < uniforms.a_shape[0] && input_col < uniforms.a_shape[1]) { - tile[local_id.y][local_id.x] = ${k.getByIndices(`${k.type.indices}(input_row, input_col)`)}; - } - workgroupBarrier(); - - let output_col = workgroup_id_x * ${f}u + local_id.x; - let output_row = workgroup_id_y * ${f}u + local_id.y; - if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) { - ${g.setByIndices(`${g.type.indices}(output_row, output_col)`,"tile[local_id.x][local_id.y]")} - } - }`},{name:"TransposeShared",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let T=Me.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(a[1]/f),y:Math.ceil(a[0]/f)},programUniforms:[{type:12,data:T},...at(i,a)]}},getShaderSource:u}}return u=f=>{let T=Pe("a",t,i.length),k=et("output",t,a.length);return` - ${f.registerUniform("output_size","u32").declareVariables(T,k)} - - ${Vd(o,s,T,k)} - - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let indices = ${k.offsetToIndices("global_idx")}; - let aIndices = perm(indices); - - ${k.setByOffset("global_idx",T.getByIndices("aIndices"))} - }`},{name:"Transpose",shaderCache:{hint:`${r}`,inputDependencies:["rank"]},getRunData:()=>{let f=Me.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},...at(i,a)]}},getShaderSource:u}},Gd=(e,r)=>{jd(e.inputs,r.perm),e.compute(qr(e.inputs[0],r.perm))},Kd=e=>zt({perm:e.perm})}),Hd,qd,Qd,Xd,Jd,Yd,Zd,ep,tp,rp,_s,sp,np,op,ip,ap,lp,up,cp,dp,pp,Iv=je(()=>{ft(),yt(),Tt(),ll(),Ws(),Hd={max:"select(bestValue, candidate, candidate > bestValue)",min:"select(bestValue, candidate, candidate < bestValue)",mean:"bestValue + candidate",sum:"bestValue + candidate",prod:"bestValue * candidate",sumSquare:"bestValue + candidate * candidate",logSumExp:"bestValue + exp(candidate)",l1:"bestValue + abs(candidate)",l2:"bestValue + candidate * candidate",logSum:"bestValue + candidate"},qd={max:"select(bestValue, candidate, candidate > bestValue)",min:"select(bestValue, candidate, candidate < bestValue)",mean:"bestValue + candidate",sum:"bestValue + candidate",prod:"bestValue * candidate",sumSquare:"bestValue + candidate",logSumExp:"bestValue + candidate",l1:"bestValue + candidate",l2:"bestValue + candidate",logSum:"bestValue + candidate"},Qd={max:"_A[offset]",min:"_A[offset]",mean:"0",sum:"0",prod:"1",sumSquare:"0",logSumExp:"0",l1:"0",l2:"0",logSum:"0"},Xd={max:"bestValue",min:"bestValue",sum:"bestValue",prod:"bestValue",sumSquare:"bestValue",logSumExp:"log(bestValue)",l1:"bestValue",l2:"sqrt(bestValue)",logSum:"log(bestValue)"},Jd=(e,r)=>{let t=[];for(let s=r-e;s{let t=[],s=e.length;for(let n=0;ne[n]);return[t,o]},Zd=(e,r)=>{let t=e.length+r.length,s=[],o=0;for(let n=0;n{for(let t=0;t{let t=[];if(!ep(e,r)){for(let s=0;st.push(s))}return t},rp=(e,r,t,s,o,n,i)=>{let a=t[0].dims,l=Me.size(n),u=Me.size(i),p=Pe("_A",t[0].dataType,a),c=et("output",o,n),d=64;l===1&&(d=256);let _=` - var aBestValues : array; - `,f=T=>` - ${T.registerUniform("reduceSize","u32").declareVariables(p,c)} - ${_} - fn DIV_CEIL(a : u32, b : u32) -> u32 { - return ((a - 1u) / b + 1u); - } - ${T.mainStart(d)} - - let outputIndex = global_idx / ${d}; - let offset = outputIndex * uniforms.reduceSize; - - var bestValue = f32(${Qd[s]}); - let Length = uniforms.reduceSize; - for (var k = local_idx; k < Length; k = k + ${d}) { - let candidate = f32(${p.getByOffset("offset + k")}); - bestValue = ${Hd[s]}; - } - aBestValues[local_idx] = bestValue; - workgroupBarrier(); - - var reduceSize = min(Length, ${d}u); - for (var currentSize = reduceSize / 2u; reduceSize > 1u; - currentSize = reduceSize / 2u) { - let interval = DIV_CEIL(reduceSize, 2u); - if (local_idx < currentSize) { - let candidate = aBestValues[local_idx + interval]; - bestValue = ${qd[s]}; - aBestValues[local_idx] = bestValue; - } - reduceSize = interval; - workgroupBarrier(); - } - - if (local_idx == 0u) { - ${c.setByOffset("outputIndex",`${s==="mean"?`${c.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${c.type.storage}(${Xd[s]})`}`)}; - } - }`;return{name:e,shaderCache:{hint:`${r};${d}`,inputDependencies:["type"]},getShaderSource:f,getRunData:()=>({outputs:[{dims:n,dataType:o}],dispatchGroup:{x:l},programUniforms:[{type:12,data:u}]})}},_s=(e,r,t,s)=>{let o=e.inputs.length===1?t:al(e.inputs,t),n=o.axes;n.length===0&&!o.noopWithEmptyAxes&&(n=e.inputs[0].dims.map((_,f)=>f));let i=Me.normalizeAxes(n,e.inputs[0].dims.length),a=i,l=e.inputs[0],u=tp(a,e.inputs[0].dims.length);u.length>0&&(l=e.compute(qr(e.inputs[0],u),{inputs:[0],outputs:[-1]})[0],a=Jd(a.length,l.dims.length));let[p,c]=Yd(l.dims,a),d=p;o.keepDims&&(d=Zd(p,i)),e.compute(rp(r,o.cacheKey,[l],s,e.inputs[0].dataType,d,c),{inputs:[l]})},sp=(e,r)=>{_s(e,"ReduceMeanShared",r,"mean")},np=(e,r)=>{_s(e,"ReduceL1Shared",r,"l1")},op=(e,r)=>{_s(e,"ReduceL2Shared",r,"l2")},ip=(e,r)=>{_s(e,"ReduceLogSumExpShared",r,"logSumExp")},ap=(e,r)=>{_s(e,"ReduceMaxShared",r,"max")},lp=(e,r)=>{_s(e,"ReduceMinShared",r,"min")},up=(e,r)=>{_s(e,"ReduceProdShared",r,"prod")},cp=(e,r)=>{_s(e,"ReduceSumShared",r,"sum")},dp=(e,r)=>{_s(e,"ReduceSumSquareShared",r,"sumSquare")},pp=(e,r)=>{_s(e,"ReduceLogSumShared",r,"logSum")}}),gs,hp,pi,al,ws,mp,fp,_p,gp,wp,Mp,bp,yp,vp,xp,Ms,Tp,Ep,Pp,Cp,Sp,$p,kp,Ip,Ap,Fp,ll=je(()=>{ft(),yt(),or(),Tt(),Iv(),gs=e=>{if(!e||e.length===0||e.length>2)throw new Error("Reduce op requires 1 or 2 inputs.");if(e.length===2&&e[1].dims.length!==1)throw new Error("Invalid axes input dims.")},hp=e=>["","",`var value = ${e.getByIndices("input_indices")};`,""],pi=(e,r,t,s,o,n,i=!1,a=!1)=>{let l=[],u=t[0].dims,p=u.length,c=Me.normalizeAxes(o,p),d=!a&&c.length===0;u.forEach((T,k)=>{d||c.indexOf(k)>=0?i&&l.push(1):l.push(T)});let _=l.length,f=Me.size(l);return{name:e,shaderCache:r,getShaderSource:T=>{let k=[],g=Pe("_A",t[0].dataType,p),w=et("output",n,_),S=s(g,w,c),E=S[2];for(let v=0,M=0;v=0?(i&&M++,E=`for(var j${v}: u32 = 0; j${v} < ${u[v]}; j${v}++) { - ${S[2].includes("last_index")?`let last_index = j${v};`:""} - ${g.indicesSet("input_indices",v,`j${v}`)} - ${E} - }`):(k.push(`${g.indicesSet("input_indices",v,w.indicesGet("output_indices",M))};`),M++);return` - - ${T.registerUniform("output_size","u32").declareVariables(g,w)} - - ${T.mainStart()} - ${T.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - var input_indices: ${g.type.indices}; - let output_indices = ${w.offsetToIndices("global_idx")}; - - ${k.join(` -`)} - ${S[0]} // init ops for reduce max/min - ${S[1]} - ${E} - ${S[3]} - ${S.length===4?w.setByOffset("global_idx","value"):S.slice(4).join(` -`)} - }`},getRunData:()=>({outputs:[{dims:l,dataType:n}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},...at(u,l)]})}},al=(e,r)=>{let t=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(s=>t.push(Number(s))),zt({axes:t,keepDims:r.keepDims,noopWithEmptyAxes:r.noopWithEmptyAxes})},ws=(e,r,t,s)=>{let o=e.inputs,n=o.length===1?t:al(o,t);e.compute(pi(r,{hint:n.cacheKey,inputDependencies:["rank"]},[o[0]],n.noopWithEmptyAxes&&n.axes.length===0?hp:s,n.axes,o[0].dataType,n.keepDims,n.noopWithEmptyAxes),{inputs:[0]})},mp=(e,r)=>{gs(e.inputs),ws(e,"ReduceLogSum",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += ${t.getByIndices("input_indices")};`,"value = log(value);"])},fp=(e,r)=>{gs(e.inputs),ws(e,"ReduceL1",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += abs(${t.getByIndices("input_indices")});`,""])},_p=(e,r)=>{gs(e.inputs),ws(e,"ReduceL2",r,(t,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,"",`t = ${t.getByIndices("input_indices")}; value += (t * t);`,"value = sqrt(value);"])},gp=(e,r)=>{gs(e.inputs),ws(e,"ReduceLogSumExp",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += exp(${t.getByIndices("input_indices")});`,"value = log(value);"])},wp=(e,r)=>{gs(e.inputs),ws(e,"ReduceMax",r,(t,s,o)=>{let n=[];for(let i=0;i=0||o.length===0)&&n.push(t.indicesSet("input_indices",i,0));return[`${n.join(` -`)}`,`var value = ${t.getByIndices("input_indices")};`,`value = max(value, ${t.getByIndices("input_indices")});`,""]})},Mp=(e,r)=>{gs(e.inputs),ws(e,"ReduceMean",r,(t,s,o)=>{let n=1;for(let i=0;i=0||o.length===0)&&(n*=e.inputs[0].dims[i]);return["var sum = f32(0);","",`sum += f32(${t.getByIndices("input_indices")});`,`let value = ${s.type.value}(sum / ${n});`]})},bp=(e,r)=>{gs(e.inputs),ws(e,"ReduceMin",r,(t,s,o)=>{let n=[];for(let i=0;i=0||o.length===0)&&n.push(`input_indices[${i}] = 0;`);return[`${n.join(` -`)}`,`var value = ${t.getByIndices("input_indices")};`,`value = min(value, ${t.getByIndices("input_indices")});`,""]})},yp=(e,r)=>{gs(e.inputs),ws(e,"ReduceProd",r,(t,s)=>[`var value = ${s.type.storage}(1);`,"",`value *= ${t.getByIndices("input_indices")};`,""])},vp=(e,r)=>{gs(e.inputs),ws(e,"ReduceSum",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += ${t.getByIndices("input_indices")};`,""])},xp=(e,r)=>{gs(e.inputs),ws(e,"ReduceSumSquare",r,(t,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,"",`t = ${t.getByIndices("input_indices")}; value += t * t;`,""])},Ms=(e,r,t)=>{if(r.length===0)return t;let s=1,o=1;for(let n=0;n1024},Tp=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?Mp(e,r):sp(e,r)},Ep=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?fp(e,r):np(e,r)},Pp=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?_p(e,r):op(e,r)},Cp=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?gp(e,r):ip(e,r)},Sp=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?wp(e,r):ap(e,r)},$p=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?bp(e,r):lp(e,r)},kp=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?yp(e,r):up(e,r)},Ip=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?vp(e,r):cp(e,r)},Ap=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?xp(e,r):dp(e,r)},Fp=(e,r)=>{Ms(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?mp(e,r):pp(e,r)}}),ul,Op,Dp,cl,Av=je(()=>{ft(),or(),ll(),ul=e=>{if(!e||e.length===0||e.length>2)throw new Error("ArgMinMaxOp op requires 1 or 2 inputs.");if(e[0].dataType!==1)throw new Error("Invalid input type.")},Op=(e,r)=>{ul(e.inputs);let t=(s,o,n)=>{let i=[];for(let a=0;a=0||n.length===0)&&i.push(`input_indices[${a}] = 0;`);return[`${i.join(` -`)}`,`var value = ${s.getByIndices("input_indices")}; -var best_index : i32 = 0;`,`if (${s.getByIndices("input_indices")} ${r.selectLastIndex>0?"<=":"<"} value) { - value = ${s.getByIndices("input_indices")}; - best_index = i32(last_index); - }`,"",o.setByOffset("global_idx","best_index")]};e.compute(pi("ArgMin",{hint:r.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},Dp=(e,r)=>{ul(e.inputs);let t=(s,o,n)=>{let i=[];for(let a=0;a=0||n.length===0)&&i.push(`input_indices[${a}] = 0;`);return[`${i.join(` -`)}`,`var value = ${s.getByIndices("input_indices")}; -var best_index : i32 = 0;`,`if (${s.getByIndices("input_indices")} ${r.selectLastIndex>0?">=":">"} value) { - value = ${s.getByIndices("input_indices")}; - best_index = i32(last_index); - }`,"",o.setByOffset("global_idx","best_index")]};e.compute(pi("argMax",{hint:r.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},cl=e=>zt(e)}),Lp,hi,zp,Bp,Rp,mo,jp,Np,dl=je(()=>{ft(),yt(),el(),Tt(),Lp=(e,r)=>{let t=e[0],s=e[1],o=e[2],n=e[3],i=e[4],a=e[5];if(i&&a)throw new Error("Attention cannot have both past and attention_bias");if(t.dims.length!==3)throw new Error('Input "input" must have 3 dimensions');let l=t.dims[0],u=t.dims[1],p=t.dims[2];if(o.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimensions');if(s.dims.length!==2)throw new Error('Input "weights" is expected to have 2 dimensions');if(s.dims[0]!==p)throw new Error("Input 1 dimension 0 should have same length as dimension 2 of input 0");if(o.dims[0]!==s.dims[1])throw new Error('Input "bias" dimension 0 should have same length as dimension 1 of input "weights"');let c=o.dims[0]/3,d=c,_=d;if(r.qkvHiddenSizes.length>0){if(r.qkvHiddenSizes.length!==3)throw new Error("qkv_hidden_sizes attribute should have 3 elements");for(let S of r.qkvHiddenSizes)if(S%r.numHeads!==0)throw new Error("qkv_hidden_sizes should be divisible by num_heads");c=r.qkvHiddenSizes[0],d=r.qkvHiddenSizes[1],_=r.qkvHiddenSizes[2]}let f=u;if(c!==d)throw new Error("qkv_hidden_sizes first element should be same as the second");if(o.dims[0]!==c+d+_)throw new Error('Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes');let T=0;if(i){if(d!==_)throw new Error('Input "past" expect k_hidden_size == v_hidden_size');if(i.dims.length!==5)throw new Error('Input "past" must have 5 dimensions');if(i.dims[0]!==2)throw new Error('Input "past" first dimension must be 2');if(i.dims[1]!==l)throw new Error('Input "past" second dimension must be batch_size');if(i.dims[2]!==r.numHeads)throw new Error('Input "past" third dimension must be num_heads');if(i.dims[4]!==d/r.numHeads)throw new Error('Input "past" fifth dimension must be k_hidden_size / num_heads');r.pastPresentShareBuffer||(T=i.dims[3])}let k=f+T,g=-1,w=0;if(n)throw new Error("Mask not supported");if(i)throw new Error("past is not supported");if(a){if(a.dims.length!==4)throw new Error('Input "attention_bias" must have 4 dimensions');if(a.dims[0]!==l||a.dims[1]!==r.numHeads||a.dims[2]!==u||a.dims[3]!==k)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:l,sequenceLength:u,pastSequenceLength:T,kvSequenceLength:f,totalSequenceLength:k,maxSequenceLength:g,inputHiddenSize:p,hiddenSize:c,vHiddenSize:_,headSize:Math.floor(c/r.numHeads),vHeadSize:Math.floor(_/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:w,scale:r.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},hi=(e,r,t)=>r&&e?` - let total_sequence_length_input = u32(${r.getByOffset("0")}); - let present_sequence_length = max(total_sequence_length_input, uniforms.past_sequence_length); - let is_subsequent_prompt: bool = sequence_length > 1 && sequence_length != total_sequence_length_input; - let is_first_prompt: bool = is_subsequent_prompt == false && sequence_length == total_sequence_length_input; - total_sequence_length = u32(${e==null?void 0:e.getByOffset("batchIdx")}) + 1; - var past_sequence_length: u32 = 0; - if (is_first_prompt == false) { - past_sequence_length = total_sequence_length - sequence_length; - } - `:` - ${t?"let past_sequence_length = uniforms.past_sequence_length":""}; - let present_sequence_length = total_sequence_length; - `,zp=(e,r,t,s,o,n,i,a)=>{let l=sr(i?1:n),u=64,p=n/l;p{let w=et("x",e.dataType,e.dims,l),S=[w],E=i?Pe("seq_lens",i.dataType,i.dims):void 0;E&&S.push(E);let v=a?Pe("total_sequence_length_input",a.dataType,a.dims):void 0;v&&S.push(v);let M=zr(e.dataType),y=[{name:"batch_size",type:"u32"},{name:"num_heads",type:"u32"},{name:"past_sequence_length",type:"u32"},{name:"sequence_length",type:"u32"},{name:"total_sequence_length",type:"u32"},{name:"elements_per_thread",type:"u32"}];return` - var thread_max: array; - var thread_sum: array; - ${g.registerUniforms(y).declareVariables(...S)} - ${g.mainStart([u,1,1])} - let batchIdx = workgroup_id.z / uniforms.num_heads; - let headIdx = workgroup_id.z % uniforms.num_heads; - let sequence_length = uniforms.sequence_length; - var total_sequence_length = uniforms.total_sequence_length; - ${hi(E,v,!1)} - let local_offset = local_idx * uniforms.elements_per_thread; - let offset = (global_idx / ${u}) * uniforms.total_sequence_length + local_offset; - let seq_causal_length = ${i?"u32(past_sequence_length + workgroup_id.y + 1)":"total_sequence_length"}; - var thread_max_vector = ${f}(-3.402823e+38f); - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - thread_max_vector = max(${f}(x[offset + i]), thread_max_vector); - } - thread_max[local_idx] = ${(()=>{switch(l){case 1:return"thread_max_vector";case 2:return"max(thread_max_vector.x, thread_max_vector.y)";case 4:return"max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))";default:throw new Error(`Unsupported components: ${l}`)}})()}; - workgroupBarrier(); - - var max_value = f32(-3.402823e+38f); - for (var i = 0u; i < ${u}; i++) { - max_value = max(thread_max[i], max_value); - } - - var sum_vector = ${f}(0); - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - sum_vector += exp(${f}(x[offset + i]) - max_value); - } - thread_sum[local_idx] = ${(()=>{switch(l){case 1:return"sum_vector";case 2:return"sum_vector.x + sum_vector.y";case 4:return"sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w";default:throw new Error(`Unsupported components: ${l}`)}})()}; - workgroupBarrier(); - - var sum: f32 = 0; - for (var i = 0u; i < ${u}; i++) { - sum += thread_sum[i]; - } - - if (sum == 0) { - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - x[offset + i] = ${w.type.value}(${M}(1.0) / ${M}(seq_causal_length)); - } - } else { - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - var f32input = ${f}(x[offset + i]); - x[offset + i] = ${w.type.value}(exp(f32input - max_value) / sum); - } - } - ${i?` - for (var total_seq_id: u32 = seq_causal_length; total_seq_id + local_offset < uniforms.total_sequence_length; total_seq_id++) { - x[offset + total_seq_id] = ${w.type.value}(${M}(0)); - }`:""}; - }`};return{name:"AttentionProbsSoftmax",shaderCache:{hint:`${u};${_};${l}`,inputDependencies:T},getShaderSource:k,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:o,z:r*t},programUniforms:d})}},Bp=(e,r,t,s,o,n,i,a,l)=>{let u=i+n.kvSequenceLength,p=[n.batchSize,n.numHeads,n.sequenceLength,u],c=e>1&&s,d=n.kvNumHeads?n.kvNumHeads:n.numHeads,_=c?[n.batchSize,d,u,n.headSize]:void 0,f=n.nReps?n.nReps:1,T=n.scale===0?1/Math.sqrt(n.headSize):n.scale,k=sr(n.headSize),g=n.headSize/k,w=12,S={x:Math.ceil(u/w),y:Math.ceil(n.sequenceLength/w),z:n.batchSize*n.numHeads},E=[{type:12,data:n.sequenceLength},{type:12,data:g},{type:12,data:u},{type:12,data:n.numHeads},{type:12,data:n.headSize},{type:1,data:T},{type:12,data:i},{type:12,data:n.kvSequenceLength},{type:12,data:f}],v=c&&s&&Me.size(s.dims)>0,M=["type","type"];v&&M.push("type"),o&&M.push("type"),a&&M.push("type"),l&&M.push("type");let y=[{dims:p,dataType:r.dataType,gpuDataType:0}];c&&y.push({dims:_,dataType:r.dataType,gpuDataType:0});let C=F=>{let z=Pe("q",r.dataType,r.dims,k),K=Pe("key",t.dataType,t.dims,k),q=[z,K];if(v){let fe=Pe("past_key",s.dataType,s.dims,k);q.push(fe)}o&&q.push(Pe("attention_bias",o.dataType,o.dims));let R=a?Pe("seq_lens",a.dataType,a.dims):void 0;R&&q.push(R);let Z=l?Pe("total_sequence_length_input",l.dataType,l.dims):void 0;Z&&q.push(Z);let H=et("output",r.dataType,p),J=[H];c&&J.push(et("present_key",r.dataType,_,k));let Q=zr(1,k),se=[{name:"M",type:"u32"},{name:"K",type:"u32"},{name:"N",type:"u32"},{name:"num_heads",type:"u32"},{name:"head_size",type:"u32"},{name:"alpha",type:"f32"},{name:"past_sequence_length",type:"u32"},{name:"kv_sequence_length",type:"u32"},{name:"n_reps",type:"u32"}];return` - const TILE_SIZE = ${w}u; - - var tileQ: array<${z.type.storage}, ${w*w}>; - var tileK: array<${z.type.storage}, ${w*w}>; - ${F.registerUniforms(se).declareVariables(...q,...J)} - ${F.mainStart([w,w,1])} - // x holds the N and y holds the M - let headIdx = workgroup_id.z % uniforms.num_heads; - let kvHeadIdx = ${f===1?"headIdx":"headIdx / uniforms.n_reps"}; - let kv_num_heads = ${f===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"}; - let batchIdx = workgroup_id.z / uniforms.num_heads; - let m = workgroup_id.y * TILE_SIZE; - let n = workgroup_id.x * TILE_SIZE; - let sequence_length = uniforms.M; - var total_sequence_length = uniforms.N; - ${hi(R,Z,!0)} - let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; - let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; - ${v&&c?"let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;":""}; - let kOffset = absKvHeadIdx * uniforms.kv_sequence_length * uniforms.K; - ${c?"let presentKeyOffset = absKvHeadIdx * uniforms.N * uniforms.K;":""} - var value = ${Q}(0); - for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { - if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) { - tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x]; - } - if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) { - var idx = TILE_SIZE * local_id.y + local_id.x; - ${v&&c?` - if (n + local_id.y < past_sequence_length) { - tileK[idx] = past_key[pastKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; - } else if (n + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { - tileK[idx] = key[kOffset + (n + local_id.y - past_sequence_length) * uniforms.K + w + local_id.x]; - }`:` - if (n + local_id.y < uniforms.kv_sequence_length) { - tileK[idx] = key[kOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; - }`} - ${c?`if (n + local_id.y < present_sequence_length) { - present_key[presentKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x] = tileK[idx]; - }`:""} - } - workgroupBarrier(); - - for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) { - value += ${Q}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]); - } - - workgroupBarrier(); - } - - if (global_id.y < uniforms.M && global_id.x < total_sequence_length) { - let headOffset = workgroup_id.z * uniforms.M * uniforms.N; - let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x; - var sum: f32 = ${(()=>{switch(k){case 1:return"value";case 2:return"value.x + value.y";case 4:return"value.x + value.y + value.z + value.w";default:throw new Error(`Unsupported components: ${k}`)}})()}; - output[outputIdx] = ${H.type.value} (sum * uniforms.alpha) + ${o?"attention_bias[outputIdx]":"0.0"}; - } - }`};return{name:"AttentionProbs",shaderCache:{hint:`${k};${o!==void 0};${s!==void 0};${e}`,inputDependencies:M},getRunData:()=>({outputs:y,dispatchGroup:S,programUniforms:E}),getShaderSource:C}},Rp=(e,r,t,s,o,n,i=void 0,a=void 0)=>{let l=n+o.kvSequenceLength,u=o.nReps?o.nReps:1,p=o.vHiddenSize*u,c=e>1&&s,d=o.kvNumHeads?o.kvNumHeads:o.numHeads,_=c?[o.batchSize,d,l,o.headSize]:void 0,f=[o.batchSize,o.sequenceLength,p],T=12,k={x:Math.ceil(o.vHeadSize/T),y:Math.ceil(o.sequenceLength/T),z:o.batchSize*o.numHeads},g=[{type:12,data:o.sequenceLength},{type:12,data:l},{type:12,data:o.vHeadSize},{type:12,data:o.numHeads},{type:12,data:o.headSize},{type:12,data:p},{type:12,data:n},{type:12,data:o.kvSequenceLength},{type:12,data:u}],w=c&&s&&Me.size(s.dims)>0,S=["type","type"];w&&S.push("type"),i&&S.push("type"),a&&S.push("type");let E=[{dims:f,dataType:r.dataType,gpuDataType:0}];c&&E.push({dims:_,dataType:r.dataType,gpuDataType:0});let v=M=>{let y=Pe("probs",r.dataType,r.dims),C=Pe("v",t.dataType,t.dims),F=[y,C];w&&F.push(Pe("past_value",s.dataType,s.dims));let z=i?Pe("seq_lens",i.dataType,i.dims):void 0;i&&F.push(z);let K=a?Pe("total_sequence_length_input",a.dataType,a.dims):void 0;a&&F.push(K);let q=[et("output",r.dataType,f)];c&&q.push(et("present_value",r.dataType,_));let R=[{name:"M",type:"u32"},{name:"K",type:"u32"},{name:"N",type:"u32"},{name:"num_heads",type:"u32"},{name:"head_size",type:"u32"},{name:"v_hidden_size",type:"u32"},{name:"past_sequence_length",type:"u32"},{name:"kv_sequence_length",type:"u32"},{name:"n_reps",type:"u32"}];return` - const TILE_SIZE = ${T}u; - var tileQ: array<${y.type.value}, ${T*T}>; - var tileV: array<${y.type.value}, ${T*T}>; - ${M.registerUniforms(R).declareVariables(...F,...q)} - ${M.mainStart([T,T,1])} - let headIdx = workgroup_id.z % uniforms.num_heads; - let batchIdx = workgroup_id.z / uniforms.num_heads; - let kvHeadIdx = ${u===1?"headIdx":"headIdx / uniforms.n_reps"}; - let kv_num_heads = ${u===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"}; - let m = global_id.y; - let n = global_id.x; - let sequence_length = uniforms.M; - var total_sequence_length = uniforms.K; - ${hi(z,K,!0)} - let offsetA = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; - let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; // kvHeadIdx is relative to the batch - ${w&&c?"let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;":""}; - let vOffset = absKvHeadIdx * uniforms.N * uniforms.kv_sequence_length + n; - ${c?"let presentValueOffset = absKvHeadIdx * uniforms.N * uniforms.K + n;":""} - var value = ${y.type.storage}(0); - for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { - if (m < uniforms.M && w + local_id.x < uniforms.K) { - tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x]; - } - if (n < uniforms.N && w + local_id.y < uniforms.K) { - var idx = TILE_SIZE * local_id.y + local_id.x; - ${w&&c?` - if (w + local_id.y < past_sequence_length) { - tileV[idx] = past_value[pastValueOffset + (w + local_id.y) * uniforms.N]; - } else if (w + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { - tileV[idx] = v[vOffset + (w + local_id.y - past_sequence_length) * uniforms.N]; - } - `:` - if (w + local_id.y < uniforms.kv_sequence_length) { - tileV[idx] = v[vOffset + (w + local_id.y) * uniforms.N]; - }`} - ${c?` - if (w + local_id.y < present_sequence_length) { - present_value[presentValueOffset + (w + local_id.y) * uniforms.N] = tileV[idx]; - }`:""} - } - workgroupBarrier(); - for (var k: u32 = 0u; k < TILE_SIZE && w+k < total_sequence_length; k++) { - value += tileQ[TILE_SIZE * local_id.y + k] * tileV[TILE_SIZE * k + local_id.x]; - } - workgroupBarrier(); - } - - // we need to transpose output from BNSH_v to BSND_v - if (m < uniforms.M && n < uniforms.N) { - let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size - + headIdx * uniforms.N + n; - output[outputIdx] = value; - } - }`};return{name:"AttentionScore",shaderCache:{hint:`${s!==void 0};${e}`,inputDependencies:S},getRunData:()=>({outputs:E,dispatchGroup:k,programUniforms:g}),getShaderSource:v}},mo=(e,r,t,s,o,n,i,a,l,u,p=void 0,c=void 0)=>{let d=Math.min(e.outputCount,1+(i?1:0)+(a?1:0)),_=d>1?u.pastSequenceLength:0,f=_+u.kvSequenceLength,T=l&&Me.size(l.dims)>0?l:void 0,k=[r,t];d>1&&i&&Me.size(i.dims)>0&&k.push(i),T&&k.push(T),p&&k.push(p),c&&k.push(c);let g=e.compute(Bp(d,r,t,i,T,u,_,p,c),{inputs:k,outputs:d>1?[-1,1]:[-1]})[0];e.compute(zp(g,u.batchSize,u.numHeads,_,u.sequenceLength,f,p,c),{inputs:p&&c?[g,p,c]:[g],outputs:[]});let w=[g,s];d>1&&a&&Me.size(a.dims)>0&&w.push(a),p&&w.push(p),c&&w.push(c),e.compute(Rp(d,g,s,a,u,_,p,c),{inputs:w,outputs:d>1?[0,2]:[0]})},jp=(e,r)=>{let t=[r.batchSize,r.numHeads,r.sequenceLength,r.headSize],s=r.sequenceLength,o=r.inputHiddenSize,n=r.headSize,i=12,a={x:Math.ceil(r.headSize/i),y:Math.ceil(r.sequenceLength/i),z:r.batchSize*r.numHeads},l=[e.inputs[0],e.inputs[1],e.inputs[2]],u=[{type:12,data:s},{type:12,data:o},{type:12,data:n},{type:12,data:r.numHeads},{type:12,data:r.headSize},{type:12,data:r.hiddenSize},{type:12,data:r.hiddenSize+r.hiddenSize+r.vHiddenSize}],p=c=>{let d=et("output_q",l[0].dataType,t),_=et("output_k",l[0].dataType,t),f=et("output_v",l[0].dataType,t),T=Pe("input",l[0].dataType,l[0].dims),k=Pe("weight",l[1].dataType,l[1].dims),g=Pe("bias",l[2].dataType,l[2].dims),w=T.type.storage,S=[{name:"M",type:"u32"},{name:"K",type:"u32"},{name:"N",type:"u32"},{name:"num_heads",type:"u32"},{name:"head_size",type:"u32"},{name:"hidden_size",type:"u32"},{name:"ldb",type:"u32"}];return` - const TILE_SIZE = ${i}u; - var tileInput: array<${w}, ${i*i}>; - var tileWeightQ: array<${w}, ${i*i}>; - var tileWeightK: array<${w}, ${i*i}>; - var tileWeightV: array<${w}, ${i*i}>; - ${c.registerUniforms(S).declareVariables(T,k,g,d,_,f)} - ${c.mainStart([i,i,1])} - let batchIndex = workgroup_id.z / uniforms.num_heads; - let headNumber = workgroup_id.z % uniforms.num_heads; - let m = global_id.y; - let n = global_id.x; - - let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K; - let biasOffsetQ = headNumber * uniforms.head_size; - let biasOffsetK = uniforms.hidden_size + biasOffsetQ; - let biasOffsetV = uniforms.hidden_size + biasOffsetK; - - var valueQ = ${w}(0); - var valueK = ${w}(0); - var valueV = ${w}(0); - for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { - if (m < uniforms.M && w + local_id.x < uniforms.K) { - tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x]; - } - if (n < uniforms.N && w + local_id.y < uniforms.K) { - let offset = n + (w + local_id.y) * uniforms.ldb; - tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset]; - tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset]; - tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset]; - } - workgroupBarrier(); - for (var k: u32 = 0u; k({outputs:[{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:a,programUniforms:u}),getShaderSource:p},{inputs:l,outputs:[-1,-1,-1]})},Np=(e,r)=>{let t=Lp(e.inputs,r),[s,o,n]=jp(e,t);return mo(e,s,o,n,e.inputs[4],void 0,void 0,void 0,e.inputs[5],t)}}),Vp,Up,Wp,Gp,Fv=je(()=>{ms(),ft(),yt(),or(),Tt(),Vp=(e,r)=>{if(!e||e.length!==5)throw new Error("BatchNormalization requires 5 inputs");let t=(s,o,n)=>{let i=o.length;if(i!==s.length)throw new Error(`${n}: num dimensions != ${i}`);o.forEach((a,l)=>{if(a!==s[l])throw new Error(`${n}: dim[${l}] do not match`)})};if(e[0].dims.length>1){let s=r.format==="NHWC"?r.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,r.spatial?2:void 0);t(e[1].dims,s,"Invalid input scale"),t(e[2].dims,s,"Invalid input B"),t(e[3].dims,s,"Invalid input mean"),t(e[4].dims,s,"Invalid input var")}else t(e[1].dims,[1],"Invalid input scale"),t(e[2].dims,[1],"Invalid input B"),t(e[3].dims,[1],"Invalid input mean"),t(e[4].dims,[1],"Invalid input var")},Up=(e,r)=>{let{epsilon:t,spatial:s,format:o}=r,n=e[0].dims,i=s?sr(n[n.length-1]):1,a=o==="NHWC"&&n.length>1?i:1,l=Me.size(n)/i,u=s,p=u?n.length:n,c=Pe("x",e[0].dataType,e[0].dims,i),d=Pe("scale",e[1].dataType,e[1].dims,a),_=Pe("bias",e[2].dataType,e[2].dims,a),f=Pe("inputMean",e[3].dataType,e[3].dims,a),T=Pe("inputVar",e[4].dataType,e[4].dims,a),k=et("y",e[0].dataType,p,i),g=()=>{let S="";if(s)S=`let cOffset = ${n.length===1?"0u":o==="NHWC"?`outputIndices[${n.length-1}] / ${i}`:"outputIndices[1]"};`;else if(o==="NCHW")S=` - ${k.indicesSet("outputIndices","0","0")} - let cOffset = ${k.indicesToOffset("outputIndices")};`;else{S=`var cIndices = ${d.type.indices}(0); - cIndices[0] = outputIndices[${n.length-1}];`;for(let E=1;E` - const epsilon = ${t}; - ${S.registerUniform("outputSize","u32").declareVariables(c,d,_,f,T,k)} - ${S.mainStart()} - ${S.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - var outputIndices = ${k.offsetToIndices(`global_idx * ${i}`)}; - ${g()} - let scale = ${d.getByOffset("cOffset")}; - let bias = ${_.getByOffset("cOffset")}; - let inputMean = ${f.getByOffset("cOffset")}; - let inputVar = ${T.getByOffset("cOffset")}; - let x = ${c.getByOffset("global_idx")}; - let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias; - ${k.setByOffset("global_idx","value")} - }`;return{name:"BatchNormalization",shaderCache:{hint:`${r.epsilon}_${r.format}_${s}_${i}`,inputDependencies:u?["rank","type","type","type","type"]:void 0},getShaderSource:w,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u?[{type:12,data:l},...at(n)]:[{type:12,data:l}]})}},Wp=e=>zt(e),Gp=(e,r)=>{let{inputs:t,outputCount:s}=e,o=Wp({...r,outputCount:s});if(Xt.webgpu.validateInputContent&&Vp(t,o),r.trainingMode)throw new Error("BatchNormalization trainingMode is not supported yet.");e.compute(Up(t,o))}}),Kp,Hp,qp,Ov=je(()=>{yt(),Tt(),Kp=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![320,640,1280].includes(e[0].dims[2]))throw new Error("number of channels should be 320, 640 or 1280");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},Hp=e=>{let r=e[0].dims,t=e[0].dims[2],s=Me.size(r)/4,o=e[0].dataType,n=Pe("input",o,r,4),i=Pe("bias",o,[t],4),a=Pe("residual",o,r,4),l=et("output",o,r,4);return{name:"BiasAdd",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)}}),getShaderSource:u=>` - const channels = ${t}u / 4; - ${u.declareVariables(n,i,a,l)} - - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes(s)} - let value = ${n.getByOffset("global_idx")} - + ${i.getByOffset("global_idx % channels")} + ${a.getByOffset("global_idx")}; - ${l.setByOffset("global_idx","value")} - }`}},qp=e=>{Kp(e.inputs),e.compute(Hp(e.inputs))}}),Qp,Dt,Xp,Jp,Yp,Zp,eh,th,rh,sh,nh,oh,ih,ah,lh,uh,fo,ch,mi,dh,ph,hh,mh,fh,_h,gh,wh,Mh,bh,yh,vh,xh,Th,Eh,Ph,pl,Ch,hl,ml,Sh,$h,kh,Ih,Ah,Fh,fl=je(()=>{ft(),yt(),or(),Tt(),Qp=(e,r,t,s,o,n,i)=>{let a=Math.ceil(r/4),l="";typeof o=="string"?l=`${o}(a)`:l=o("a");let u=Pe("inputData",t,[a],4),p=et("outputData",s,[a],4),c=[{name:"vec_size",type:"u32"}];return i&&c.push(...i),` - ${e.registerUniforms(c).declareVariables(u,p)} - - ${n??""} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - - let a = ${u.getByOffset("global_idx")}; - ${p.setByOffset("global_idx",l)} - }`},Dt=(e,r,t,s,o,n=e.dataType,i,a)=>{let l=[{type:12,data:Math.ceil(Me.size(e.dims)/4)}];return i&&l.push(...i),{name:r,shaderCache:{hint:o,inputDependencies:["type"]},getShaderSource:u=>Qp(u,Me.size(e.dims),e.dataType,n,t,s,a),getRunData:u=>({outputs:[{dims:e.dims,dataType:n}],dispatchGroup:{x:Math.ceil(Me.size(u[0].dims)/64/4)},programUniforms:l})}},Xp=e=>{e.compute(Dt(e.inputs[0],"Abs","abs"))},Jp=e=>{e.compute(Dt(e.inputs[0],"Acos","acos"))},Yp=e=>{e.compute(Dt(e.inputs[0],"Acosh","acosh"))},Zp=e=>{e.compute(Dt(e.inputs[0],"Asin","asin"))},eh=e=>{e.compute(Dt(e.inputs[0],"Asinh","asinh"))},th=e=>{e.compute(Dt(e.inputs[0],"Atan","atan"))},rh=e=>{e.compute(Dt(e.inputs[0],"Atanh","atanh"))},sh=e=>zt(e),nh=(e,r)=>{let t;switch(r.to){case 10:t="vec4";break;case 1:t="vec4";break;case 12:t="vec4";break;case 6:t="vec4";break;case 9:t="vec4";break;default:throw new RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${r.to}`)}e.compute(Dt(e.inputs[0],"Cast",t,void 0,r.cacheKey,r.to))},oh=e=>{let r,t,s=e.length>=2&&e[1].data!==0,o=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:r=s?e[1].getFloat32Array()[0]:-34028234663852886e22,t=o?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:r=s?e[1].getUint16Array()[0]:64511,t=o?e[2].getUint16Array()[0]:31743;break;default:throw new Error("Unsupport data type")}return zt({min:r,max:t})},ih=(e,r)=>{let t=r||oh(e.inputs),s=zr(e.inputs[0].dataType);e.compute(Dt(e.inputs[0],"Clip",o=>`clamp(${o}, vec4<${s}>(uniforms.min), vec4<${s}>(uniforms.max))`,void 0,t.cacheKey,void 0,[{type:e.inputs[0].dataType,data:t.min},{type:e.inputs[0].dataType,data:t.max}],[{name:"min",type:s},{name:"max",type:s}]),{inputs:[0]})},ah=e=>{e.compute(Dt(e.inputs[0],"Ceil","ceil"))},lh=e=>{e.compute(Dt(e.inputs[0],"Cos","cos"))},uh=e=>{e.compute(Dt(e.inputs[0],"Cosh","cosh"))},fo=e=>zt(e),ch=(e,r)=>{let t=zr(e.inputs[0].dataType);e.compute(Dt(e.inputs[0],"Elu",s=>`elu_vf32(${s})`,` - const elu_alpha_ = ${t}(${r.alpha}); - - fn elu_f32(a: ${t}) -> ${t} { - return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0); - } - - fn elu_vf32(v: vec4<${t}>) -> vec4<${t}> { - return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w)); - }`,r.cacheKey))},mi=(e="f32")=>` -const r0: ${e} = 0.3275911; -const r1: ${e} = 0.254829592; -const r2: ${e} = -0.284496736; -const r3: ${e} = 1.421413741; -const r4: ${e} = -1.453152027; -const r5: ${e} = 1.061405429; - -fn erf_vf32(v: vec4<${e}>) -> vec4<${e}> { - let absv = abs(v); - let x = 1.0 / (1.0 + r0 * absv); - return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv)); -}`,dh=e=>{let r=zr(e.inputs[0].dataType);e.compute(Dt(e.inputs[0],"Erf",t=>`erf_vf32(${t})`,mi(r)))},ph=e=>{e.compute(Dt(e.inputs[0],"Exp","exp"))},hh=e=>{e.compute(Dt(e.inputs[0],"Floor","floor"))},mh=e=>{let r=zr(e.inputs[0].dataType);e.compute(Dt(e.inputs[0],"Gelu",t=>`0.5 * ${t} * (1.0 + erf_vf32(${t} * 0.7071067811865475))`,mi(r)))},fh=(e,r)=>{let t=zr(e.inputs[0].dataType);e.compute(Dt(e.inputs[0],"LeakyRelu",s=>`select(leaky_relu_alpha_ * ${s}, ${s}, ${s} >= vec4<${t}>(0.0))`,`const leaky_relu_alpha_ = ${t}(${r.alpha});`,r.cacheKey))},_h=e=>{e.compute(Dt(e.inputs[0],"Not",r=>`!${r}`))},gh=e=>{e.compute(Dt(e.inputs[0],"Neg",r=>`-${r}`))},wh=e=>{e.compute(Dt(e.inputs[0],"Reciprocal",r=>`1.0/${r}`))},Mh=e=>{let r=zr(e.inputs[0].dataType);e.compute(Dt(e.inputs[0],"Relu",t=>`select(vec4<${r}>(0.0), ${t}, ${t} > vec4<${r}>(0.0))`))},bh=e=>{e.compute(Dt(e.inputs[0],"Sigmoid",r=>`(1.0 / (1.0 + exp(-${r})))`))},yh=e=>zt(e),vh=(e,r)=>{let t=zr(e.inputs[0].dataType);e.compute(Dt(e.inputs[0],"HardSigmoid",s=>`max(vec4<${t}>(0.0), min(vec4<${t}>(1.0), ${r.alpha} * ${s} + vec4<${t}>(${r.beta})))`,void 0,r.cacheKey))},xh=e=>{e.compute(Dt(e.inputs[0],"Sin","sin"))},Th=e=>{e.compute(Dt(e.inputs[0],"Sinh","sinh"))},Eh=e=>{e.compute(Dt(e.inputs[0],"Sqrt","sqrt"))},Ph=e=>{e.compute(Dt(e.inputs[0],"Tan","tan"))},pl=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,Ch=e=>{e.compute(Dt(e.inputs[0],"Tanh",pl))},hl=(e="f32")=>` -const fast_gelu_a: ${e} = 0.5; -const fast_gelu_b: ${e} = 0.7978845608028654; -const fast_gelu_c: ${e} = 0.035677408136300125; - -fn tanh_v(v: vec4<${e}>) -> vec4<${e}> { - return ${pl("v")}; -} -`,ml=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,Sh=e=>{let r=zr(e.inputs[0].dataType);e.compute(Dt(e.inputs[0],"FastGelu",ml,hl(r),void 0,e.inputs[0].dataType))},$h=(e,r)=>{let t=zr(e.inputs[0].dataType);return e.compute(Dt(e.inputs[0],"ThresholdedRelu",s=>`select(vec4<${t}>(0.0), ${s}, ${s} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${t}>(${r.alpha});`,r.cacheKey)),0},kh=e=>{e.compute(Dt(e.inputs[0],"Log","log"))},Ih=(e,r)=>` -const alpha = vec4<${e}>(${r}); -const one = ${e}(1.0); -const zero = ${e}(0.0); - -fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { - let v = x *alpha; - var x1 : vec4<${e}>; - for (var i = 0; i < 4; i = i + 1) { - if (v[i] >= zero) { - x1[i] = one / (one + exp(-v[i])); - } else { - x1[i] = one - one / (one + exp(v[i])); - } - } - return x * x1; -} -`,Ah=e=>`quick_gelu_impl(${e})`,Fh=(e,r)=>{let t=zr(e.inputs[0].dataType);e.compute(Dt(e.inputs[0],"QuickGelu",Ah,Ih(t,r.alpha),r.cacheKey,e.inputs[0].dataType))}}),Oh,Dh,Lh,Dv=je(()=>{yt(),Tt(),fl(),Oh=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![2560,5120,10240].includes(e[0].dims[2]))throw new Error("hidden state should be 2560, 5120 or 10240");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},Dh=e=>{let r=e[0].dims.slice();r[2]=r[2]/2;let t=Pe("input",e[0].dataType,e[0].dims,4),s=Pe("bias",e[0].dataType,[e[0].dims[2]],4),o=et("output",e[0].dataType,r,4),n=Me.size(r)/4,i=Tr(e[0].dataType);return{name:"BiasSplitGelu",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)}}),getShaderSource:a=>` - const M_SQRT2 = sqrt(2.0); - const halfChannels = ${e[0].dims[2]/4/2}u; - - ${a.declareVariables(t,s,o)} - - ${mi(i)} - - ${a.mainStart()} - ${a.guardAgainstOutOfBoundsWorkgroupSizes(n)} - let biasIdx = global_idx % halfChannels; - let batchIndex = global_idx / halfChannels; - let inputOffset = biasIdx + batchIndex * halfChannels * 2; - let valueLeft = input[inputOffset] + bias[biasIdx]; - let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels]; - let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1); - - ${o.setByOffset("global_idx","valueLeft * geluRight")} - }`}},Lh=e=>{Oh(e.inputs),e.compute(Dh(e.inputs))}}),zh,Bh,bs,Rh,jh,Nh,Vh,Uh,Wh,Gh,Kh,Hh,qh,Lv=je(()=>{ft(),yt(),Tt(),zh=(e,r,t,s,o,n,i,a,l,u,p,c)=>{let d,_;typeof a=="string"?d=_=(w,S)=>`${a}((${w}),(${S}))`:typeof a=="function"?d=_=a:(d=a.scalar,_=a.vector);let f=et("outputData",p,s.length,4),T=Pe("aData",l,r.length,4),k=Pe("bData",u,t.length,4),g;if(o)if(n){let w=Me.size(r)===1,S=Me.size(t)===1,E=r.length>0&&r[r.length-1]%4===0,v=t.length>0&&t[t.length-1]%4===0;w||S?g=f.setByOffset("global_idx",_(w?`${T.type.value}(${T.getByOffset("0")}.x)`:T.getByOffset("global_idx"),S?`${k.type.value}(${k.getByOffset("0")}.x)`:k.getByOffset("global_idx"))):g=` - let outputIndices = ${f.offsetToIndices("global_idx * 4u")}; - let offsetA = ${T.broadcastedIndicesToOffset("outputIndices",f)}; - let offsetB = ${k.broadcastedIndicesToOffset("outputIndices",f)}; - ${f.setByOffset("global_idx",_(i||E?T.getByOffset("offsetA / 4u"):`${T.type.value}(${T.getByOffset("offsetA / 4u")}[offsetA % 4u])`,i||v?k.getByOffset("offsetB / 4u"):`${k.type.value}(${k.getByOffset("offsetB / 4u")}[offsetB % 4u])`))} - `}else g=f.setByOffset("global_idx",_(T.getByOffset("global_idx"),k.getByOffset("global_idx")));else{if(!n)throw new Error("no necessary to use scalar implementation for element-wise binary op implementation.");let w=(S,E,v="")=>{let M=`aData[indexA${E}][componentA${E}]`,y=`bData[indexB${E}][componentB${E}]`;return` - let outputIndices${E} = ${f.offsetToIndices(`global_idx * 4u + ${E}u`)}; - let offsetA${E} = ${T.broadcastedIndicesToOffset(`outputIndices${E}`,f)}; - let offsetB${E} = ${k.broadcastedIndicesToOffset(`outputIndices${E}`,f)}; - let indexA${E} = offsetA${E} / 4u; - let indexB${E} = offsetB${E} / 4u; - let componentA${E} = offsetA${E} % 4u; - let componentB${E} = offsetB${E} % 4u; - ${S}[${E}] = ${v}(${d(M,y)}); - `};p===9?g=` - var data = vec4(0); - ${w("data",0,"u32")} - ${w("data",1,"u32")} - ${w("data",2,"u32")} - ${w("data",3,"u32")} - outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:g=` - ${w("outputData[global_idx]",0)} - ${w("outputData[global_idx]",1)} - ${w("outputData[global_idx]",2)} - ${w("outputData[global_idx]",3)} - `}return` - ${e.registerUniform("vec_size","u32").declareVariables(T,k,f)} - - ${c??""} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - ${g} - }`},Bh=(e,r,t,s,o,n,i=t.dataType)=>{let a=t.dims.map(T=>Number(T)??1),l=s.dims.map(T=>Number(T)??1),u=!Me.areEqual(a,l),p=a,c=Me.size(a),d=!1,_=!1,f=[u];if(u){let T=Nn.calcShape(a,l,!1);if(!T)throw new Error("Can't perform binary op on the given tensors");p=T.slice(),c=Me.size(p);let k=Me.size(a)===1,g=Me.size(l)===1,w=a.length>0&&a[a.length-1]%4===0,S=l.length>0&&l[l.length-1]%4===0;f.push(k),f.push(g),f.push(w),f.push(S);let E=1;for(let v=1;vT.toString()).join("_"),inputDependencies:["rank","rank"]},getShaderSource:T=>zh(T,a,l,p,d,u,_,o,t.dataType,s.dataType,i,n),getRunData:()=>({outputs:[{dims:p,dataType:i}],dispatchGroup:{x:Math.ceil(c/64/4)},programUniforms:[{type:12,data:Math.ceil(Me.size(p)/4)},...at(a,l,p)]})}},bs=(e,r,t,s,o,n)=>{e.compute(Bh(r,o??"",e.inputs[0],e.inputs[1],t,s,n))},Rh=e=>{bs(e,"Add",(r,t)=>`${r}+${t}`)},jh=e=>{bs(e,"Div",(r,t)=>`${r}/${t}`)},Nh=e=>{bs(e,"Equal",{scalar:(r,t)=>`u32(${r}==${t})`,vector:(r,t)=>`vec4(${r}==${t})`},void 0,void 0,9)},Vh=e=>{bs(e,"Mul",(r,t)=>`${r}*${t}`)},Uh=e=>{let r=Pe("input",e.inputs[0].dataType,e.inputs[0].dims).type.value;bs(e,"Pow",{scalar:(t,s)=>`pow_custom(${t},${s})`,vector:(t,s)=>`pow_vector_custom(${t},${s})`},` - fn pow_custom(a : ${r}, b : ${r}) -> ${r} { - if (b == ${r}(0.0)) { - return ${r}(1.0); - } else if (a < ${r}(0.0) && f32(b) != floor(f32(b))) { - return ${r}(pow(f32(a), f32(b))); // NaN - } - return select(sign(a), ${r}(1.0), round(f32(abs(b) % ${r}(2.0))) != 1.0) * ${r}(${r==="i32"?"round":""}(pow(f32(abs(a)), f32(b)))); - } - fn pow_vector_custom(a : vec4<${r}>, b : vec4<${r}>) -> vec4<${r}> { - // TODO: implement vectorized pow - return vec4<${r}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w)); - } - `)},Wh=e=>{bs(e,"Sub",(r,t)=>`${r}-${t}`)},Gh=e=>{bs(e,"Greater",{scalar:(r,t)=>`u32(${r}>${t})`,vector:(r,t)=>`vec4(${r}>${t})`},void 0,void 0,9)},Kh=e=>{bs(e,"Less",{scalar:(r,t)=>`u32(${r}<${t})`,vector:(r,t)=>`vec4(${r}<${t})`},void 0,void 0,9)},Hh=e=>{bs(e,"GreaterOrEqual",{scalar:(r,t)=>`u32(${r}>=${t})`,vector:(r,t)=>`vec4(${r}>=${t})`},void 0,void 0,9)},qh=e=>{bs(e,"LessOrEqual",{scalar:(r,t)=>`u32(${r}<=${t})`,vector:(r,t)=>`vec4(${r}<=${t})`},void 0,void 0,9)}}),Qh,Xh,Jh,Yh,Zh,em,zv=je(()=>{ft(),yt(),or(),Tt(),Qh=(e,r)=>{if(!e||e.length<1)throw new Error("too few inputs");let t=0,s=e[t],o=s.dataType,n=s.dims.length;e.forEach((i,a)=>{if(a!==t){if(i.dataType!==o)throw new Error("input tensors should be one type");if(i.dims.length!==n)throw new Error("input tensors should have the same shape");i.dims.forEach((l,u)=>{if(u!==r&&l!==s.dims[u])throw new Error("non concat dimensions must match")})}})},Xh=(e,r)=>` - fn calculateInputIndex(index: u32) -> u32 { - let sizeInConcatAxis = array(${r}); - for (var i: u32 = 0u; i < ${e}; i += 1u ) { - if (index < sizeInConcatAxis[i]) { - return i; - } - } - return ${e}u; - }`,Jh=(e,r)=>{let t=e.length,s=[];for(let o=0;o{let o=Me.size(t),n=new Array(e.length),i=new Array(e.length),a=0,l=[],u=[],p=[{type:12,data:o}];for(let T=0;T`uniforms.sizeInConcatAxis${T}`).join(","),f=T=>` - - ${(()=>{T.registerUniform("outputSize","u32");for(let k=0;k(${_}); - ${d} -= sizeInConcatAxis[inputIndex - 1u]; - } - - ${Jh(i,c)} - }`;return{name:"Concat",shaderCache:{hint:`${r}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:t,dataType:s}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:p}),getShaderSource:f}},Zh=(e,r)=>{let t=e.inputs,s=t[0].dims,o=Me.normalizeAxis(r.axis,s.length);Qh(t,o);let n=s.slice();n[o]=t.reduce((a,l)=>a+(l.dims.length>o?l.dims[o]:0),0);let i=t.filter(a=>Me.size(a.dims)>0);e.compute(Yh(i,o,n,t[0].dataType),{inputs:i})},em=e=>zt({axis:e.axis})}),an,ln,un,_l,cn=je(()=>{ft(),yt(),an=(e,r,t="f32")=>{switch(e.activation){case"Relu":return`value = max(value, ${r}(0.0));`;case"Sigmoid":return`value = (${r}(1.0) / (${r}(1.0) + exp(-value)));`;case"Clip":return`value = clamp(value, ${r}(${t}(uniforms.clip_min)), ${r}(${t}(uniforms.clip_max)));`;case"HardSigmoid":return`value = max(${r}(0.0), min(${r}(1.0), ${t}(uniforms.alpha) * value + ${t}(uniforms.beta)));`;case"LeakyRelu":return`value = select(${t}(uniforms.alpha) * value, value, value >= ${r}(0.0));`;case"Tanh":return`let e2x = exp(-2.0 * abs(value)); - value = sign(value) * (1.0 - e2x) / (1.0 + e2x); - `;case"":return"";default:throw new Error(`Unsupported activation ${e.activation}`)}},ln=(e,r)=>{e.activation==="Clip"?r.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation==="HardSigmoid"?r.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation==="LeakyRelu"&&r.push({type:1,data:e.alpha})},un=(e,r)=>{e.activation==="Clip"?r.push({name:"clip_max",type:"f32"},{name:"clip_min",type:"f32"}):e.activation==="HardSigmoid"?r.push({name:"alpha",type:"f32"},{name:"beta",type:"f32"}):e.activation==="LeakyRelu"&&r.push({name:"alpha",type:"f32"})},_l=e=>{let r=(e==null?void 0:e.activation)||"";if(r==="HardSigmoid"){let[t,s]=(e==null?void 0:e.activation_params)||[.2,.5];return{activation:r,alpha:t,beta:s}}else if(r==="Clip"){let[t,s]=(e==null?void 0:e.activation_params)||[xd,Td];return{activation:r,clipMax:s,clipMin:t}}else if(r==="LeakyRelu"){let[t]=(e==null?void 0:e.activation_params)||[.01];return{activation:r,alpha:t}}return{activation:r}}}),kr,tm,gl=je(()=>{kr=(e,r)=>{switch(e){case 1:return r;case 2:return`vec2<${r}>`;case 3:return`vec3<${r}>`;case 4:return`vec4<${r}>`;default:throw new Error(`${e}-component is not supported.`)}},tm=e=>` - ${e?"value = value + getBiasByOutputCoords(coords);":""} - `}),rm,Bv=je(()=>{rm=e=>` -fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 { - return dot(coords, vec4( - shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1)); -} -fn getOutputIndexFromCoords(coords : vec4) -> i32 { - return dot(coords, vec4( - i32(${e}.x), i32(${e}.y), i32(${e}.z), 1)); -} -`}),_o,wl,Ml=je(()=>{ft(),yt(),Tt(),cn(),_o=(e,r,t,s,o)=>{let n=s-t;return` - ${Array.from({length:t}).map((i,a)=>` - if (${st(r.shape,a,r.rank)} != 1) { - ${r.indicesSet(e,a,st(o,a+n,s))} - } else { - ${r.indicesSet(e,a,0)} - }`).join("")} -`},wl=(e,r,t,s,o=!1,n)=>{let i=e[0].dims,a=e[1].dims,l=i[i.length-2],u=a[a.length-1],p=i[i.length-1],c=sr(u),d=sr(p),_=sr(l),f=Me.size(t)/c/_,T=e.length>2,k=s?s.slice(0,-2):t.slice(0,-2),g=[Me.size(k),l,u],w=[{type:12,data:f},{type:12,data:l},{type:12,data:u},{type:12,data:p}];ln(r,w),w.push(...at(k,i,a)),T&&w.push(...at(e[2].dims)),w.push(...at(g));let S=E=>{let v=ol("batch_dims",e[0].dataType,k.length),M=Pe("a",e[0].dataType,i.length,d),y=Pe("b",e[1].dataType,a.length,c),C=et("output",e[0].dataType,g.length,c),F=Tr(C.type.tensor),z=an(r,C.type.value,F),K=[M,y],q="";if(T){let H=o?c:1;K.push(Pe("bias",e[2].dataType,e[2].dims.length,H)),q=`${o?`value += bias[col / ${H}];`:`value += ${C.type.value}(bias[row + i]);`}`}let R=[{name:"output_size",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"}];un(r,R);let Z=()=>{let H=`var a_data: ${M.type.value};`;for(let J=0;J; - for (var k: u32 = 0u; k < uniforms.K; k = k + ${d}) { - ${Z()} - } - for (var i = 0u; i < ${_}u; i++) { - var value = values[i]; - ${q} - ${z} - let cur_indices = ${C.type.indices}(batch, row + i, col); - let offset = ${C.indicesToOffset("cur_indices")}; - ${C.setByOffset(`offset / ${c}`,"value")}; - } - } - `};return{name:"MatMulNaive",shaderCache:{hint:`${r.activation};${c};${d};${_};${o}`,inputDependencies:T?["rank","rank","rank"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:n?n(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:w}),getShaderSource:S}}}),sm,nm,bl,yl,om,vl,im,fi,xl=je(()=>{ft(),yt(),Tt(),cn(),Ml(),gl(),sm=(e,r)=>e?` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - kStart + inputRow, - globalRowStart / innerElementSize + inputCol${r?", batchIndices":""}); - `:` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - globalRow + innerRow, - kStart / innerElementSize + inputCol${r?", batchIndices":""}); - `,nm=(e,r)=>e?` - let ACached0 = mm_Asub[k * innerElementSize][localRow]; - let ACached1 = mm_Asub[k * innerElementSize + 1][localRow]; - let ACached2 = mm_Asub[k * innerElementSize + 2][localRow]; - ${r===3?"":"let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];"} - for (var i = 0; i < rowPerThread; i = i + 1) { - acc[i] = BCached0 * ACached0[i] + acc[i]; - acc[i] = BCached1 * ACached1[i] + acc[i]; - acc[i] = BCached2 * ACached2[i] + acc[i]; - ${r===3?"":"acc[i] = BCached3 * ACached3[i] + acc[i];"} - }`:` - for (var i = 0; i < rowPerThread; i = i + 1) { - let ACached = mm_Asub[tileRow + i][k]; - acc[i] = BCached0 * ACached.x + acc[i]; - acc[i] = BCached1 * ACached.y + acc[i]; - acc[i] = BCached2 * ACached.z + acc[i]; - ${r===3?"":"acc[i] = BCached3 * ACached.w + acc[i];"} - }`,bl=(e,r,t="f32",s,o=!1,n=32,i=!1,a=32)=>{let l=r[1]*e[1],u=r[0]*e[0],p=o?l:n,c=o?n:l,d=p/r[0],_=n/r[1];if(!((o&&d===4&&e[1]===4||!o&&(d===3||d===4))&&p%r[0]===0&&n%r[1]===0&&e[0]===4))throw new Error(`If transposeA ${o} is true, innerElementSize ${d} and workPerThread[1] ${e[1]} must be 4. - Otherwise, innerElementSize ${d} must be 3 or 4. - tileAWidth ${p} must be divisible by workgroupSize[0]${r[0]}. tileInner ${n} must be divisible by workgroupSize[1] ${r[1]}. colPerThread ${e[0]} must be 4.`);return` -var mm_Asub: array, ${p/d}>, ${c}>; -var mm_Bsub: array, ${u/e[0]}>, ${n}>; - -const rowPerThread = ${e[1]}; -const colPerThread = ${e[0]}; -const innerElementSize = ${d}; -const tileInner = ${n}; - -@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]}) -fn main(@builtin(local_invocation_id) localId : vec3, - @builtin(global_invocation_id) globalId : vec3, - @builtin(workgroup_id) workgroupId : vec3) { - let localRow = i32(localId.y); - let tileRow = localRow * rowPerThread; - let tileCol = i32(localId.x); - - let globalRow =i32(globalId.y) * rowPerThread; - let globalCol = i32(globalId.x); - let batch = ${i?"0":"i32(globalId.z)"}; - ${s?`let batchIndices = ${s.offsetToIndices("u32(batch)")};`:""} - let globalRowStart = i32(workgroupId.y) * ${l}; - - let num_tiles = ${i?`${Math.ceil(a/n)}`:"(uniforms.dim_inner - 1) / tileInner + 1"}; - var kStart = ${i?`i32(globalId.z) * ${a}`:"0"}; - - var acc: array, rowPerThread>; - - // Loop over shared dimension. - let tileRowB = localRow * ${_}; - for (var t = 0; t < num_tiles; t = t + 1) { - // Load one tile of A into local memory. - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - let inputRow = tileRow + innerRow; - let inputCol = tileCol; - ${sm(o,s)} - } - - // Load one tile of B into local memory. - for (var innerRow = 0; innerRow < ${_}; innerRow = innerRow + 1) { - let inputRow = tileRowB + innerRow; - let inputCol = tileCol; - mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${s?", batchIndices":""}); - } - kStart = kStart + tileInner; - workgroupBarrier(); - - // Compute acc values for a single thread. - for (var k = 0; k < tileInner / innerElementSize; k = k + 1) { - let BCached0 = mm_Bsub[k * innerElementSize][tileCol]; - let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol]; - let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol]; - ${d===3?"":"let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];"} - - ${nm(o,d)} - } - - workgroupBarrier(); - } - - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); - } -}`},yl=(e,r)=>e?` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - kStart + inputRow, - globalRowStart + inputCol${r?", batchIndices":""}); - `:` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - globalRowStart + inputRow, - kStart + inputCol${r?", batchIndices":""}); - `,om=e=>e?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];",vl=(e,r,t="f32",s,o=!1,n=32,i=!1,a=32,l=!1)=>{let u=e[1]*r[1],p=e[0]*r[0],c=o?u:n,d=o?n:u;if(!(d%r[1]===0&&c%r[0]===0&&n%r[1]===0))throw new Error(`tileAHight ${d} must be divisible by workgroupSize[1]${r[1]}, tileAWidth ${c} must be divisible by workgroupSize[0]${r[0]}, tileInner ${n} must be divisible by workgroupSize[1]${r[1]}`);let _=d/r[1],f=c/r[0],T=n/r[1],k=l?` - let localRow = i32(localId.y); - let localCol = i32(localId.x); - let globalRowStart = i32(workgroupId.y) * ${u}; - let globalColStart = i32(workgroupId.x) * ${p}; - - // Loop over shared dimension. - for (var t = 0; t < num_tiles; t = t + 1) { - // Load one tile of A into local memory. - for (var inputRow = localRow; inputRow < ${d}; inputRow = inputRow + ${r[1]}) { - for (var inputCol = localCol; inputCol < ${c}; inputCol = inputCol + ${r[0]}) { - ${yl(o,s)} - } - } - // Load one tile of B into local memory. - for (var inputRow = localRow; inputRow < ${n}; inputRow = inputRow + ${r[1]}) { - for (var inputCol = localCol; inputCol < ${p}; inputCol = inputCol + ${r[0]}) { - mm_Bsub[inputRow][inputCol] = mm_readB(batch, - kStart + inputRow, - globalColStart + inputCol${s?", batchIndices":""}); - } - } - kStart = kStart + tileInner; - workgroupBarrier(); - - // Compute acc values for a single thread. - var BCached : array<${t}, colPerThread>; - for (var k = 0; k < tileInner; k = k + 1) { - for (var inner = 0; inner < colPerThread; inner = inner + 1) { - BCached[inner] = mm_Bsub[k][localCol + inner * ${r[0]}]; - } - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - let ACached = ${o?`mm_Asub[k][localRow + innerRow * ${r[1]}];`:`mm_Asub[localRow + innerRow * ${r[1]}][k];`} - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - acc[innerRow][innerCol] = acc[innerRow][innerCol] + - ACached * BCached[innerCol]; - } - } - } - workgroupBarrier(); - } - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - let gRow = globalRowStart + localRow + innerRow * ${r[1]}; - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - let gCol = globalColStart + localCol + innerCol * ${r[0]}; - mm_write(batch, gRow, gCol, acc[innerRow][innerCol]); - } - } - `:` -let tileRow = i32(localId.y) * rowPerThread; -let tileCol = i32(localId.x) * colPerThread; - -let globalRow = i32(globalId.y) * rowPerThread; -let globalCol = i32(globalId.x) * colPerThread; -let globalRowStart = i32(workgroupId.y) * ${u}; - -let tileRowA = i32(localId.y) * ${_}; -let tileColA = i32(localId.x) * ${f}; -let tileRowB = i32(localId.y) * ${T}; -// Loop over shared dimension. -for (var t = 0; t < num_tiles; t = t + 1) { - // Load one tile of A into local memory. - for (var innerRow = 0; innerRow < ${_}; innerRow = innerRow + 1) { - for (var innerCol = 0; innerCol < ${f}; innerCol = innerCol + 1) { - let inputRow = tileRowA + innerRow; - let inputCol = tileColA + innerCol; - ${yl(o,s)} - } - } - - // Load one tile of B into local memory. - for (var innerRow = 0; innerRow < ${T}; innerRow = innerRow + 1) { - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - let inputRow = tileRowB + innerRow; - let inputCol = tileCol + innerCol; - mm_Bsub[inputRow][inputCol] = mm_readB(batch, - kStart + inputRow, - globalCol + innerCol${s?", batchIndices":""}); - } - } - kStart = kStart + tileInner; - workgroupBarrier(); - - // Compute acc values for a single thread. - var BCached : array<${t}, colPerThread>; - for (var k = 0; k < tileInner; k = k + 1) { - for (var inner = 0; inner < colPerThread; inner = inner + 1) { - BCached[inner] = mm_Bsub[k][tileCol + inner]; - } - - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - ${om(o)} - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol]; - } - } - } - - workgroupBarrier(); -} - -for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - mm_write(batch, globalRow + innerRow, globalCol + innerCol, - acc[innerRow][innerCol]); - } -} -`;return` - var mm_Asub : array, ${d}>; - var mm_Bsub : array, ${n}>; - const rowPerThread = ${e[1]}; - const colPerThread = ${e[0]}; - const tileInner = ${n}; - -@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]}) -fn main(@builtin(local_invocation_id) localId : vec3, - @builtin(global_invocation_id) globalId : vec3, - @builtin(workgroup_id) workgroupId : vec3) { - let batch = ${i?"0":"i32(globalId.z)"}; - ${s?`let batchIndices = ${s.offsetToIndices("u32(batch)")};`:""} - let num_tiles = ${i?`${Math.ceil(a/n)}`:"(uniforms.dim_inner - 1) / tileInner + 1"}; - var kStart = ${i?`i32(globalId.z) * ${a}`:"0"}; - - var acc : array, rowPerThread>; - ${k} - } -`},im=(e,r,t,s,o=!1)=>{let[n,i,a,l]=s,u=Tr(s[0].type.tensor);return` - fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${n.type.indices}) -> ${kr(e,u)} { - var value = ${kr(e,u)}(0.0); - let col = colIn * ${e}; - if(row < uniforms.dim_a_outer && col < uniforms.dim_inner) - { - var aIndices: ${i.type.indices}; - ${_o("aIndices",i,i.rank-2,n.rank,"batchIndices")} - ${i.indicesSet("aIndices",i.rank-2,"u32(row)")} - ${i.indicesSet("aIndices",i.rank-1,"u32(colIn)")} - value = ${i.getByIndices("aIndices")}; - } - return value; - } - - fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${n.type.indices}) -> ${kr(e,u)} { - var value = ${kr(e,u)}(0.0); - let col = colIn * ${e}; - if(row < uniforms.dim_inner && col < uniforms.dim_b_outer) - { - var bIndices: ${a.type.indices}; - ${_o("bIndices",a,a.rank-2,n.rank,"batchIndices")} - ${a.indicesSet("bIndices",a.rank-2,"u32(row)")} - ${a.indicesSet("bIndices",a.rank-1,"u32(colIn)")} - value = ${a.getByIndices("bIndices")}; - } - return value; - } - - fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${kr(e,u)}) { - let col = colIn * ${e}; - if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) { - var value = valueIn; - let coords = vec3(batch, row, colIn); - ${r?`value = value + ${o?"bias[colIn]":`${kr(e,u)}(bias[row])`};`:""} - ${t} - ${l.setByIndices("vec3(coords)","value")} - } - } - `},fi=(e,r,t,s,o=!1,n)=>{let i=e[0].dims,a=e[1].dims,l=i.slice(0,-2),u=a.slice(0,-2),p=s?s.slice(0,-2):t.slice(0,-2),c=Me.size(p),d=i[i.length-2],_=i[i.length-1],f=a[a.length-1],T=_%4===0&&f%4===0,k=d<=8?[4,1,1]:[4,4,1],g=[8,8,1],w=[Math.ceil(f/g[0]/k[0]),Math.ceil(d/g[1]/k[1]),Math.ceil(c/g[2]/k[2])],S=T?4:1,E=[...l,d,_/S],v=E.length,M=[...u,_,f/S],y=M.length,C=[c,d,f/S],F=[{type:6,data:d},{type:6,data:f},{type:6,data:_}];ln(r,F),F.push(...at(p,E,M));let z=["rank","rank"],K=e.length>2;K&&(F.push(...at(e[2].dims)),z.push("rank")),F.push(...at(C));let q=R=>{let Z=p.length,H=ol("batchDims",e[0].dataType,Z,1),J=Tr(e[0].dataType),Q=Pe("a",e[0].dataType,v,S),se=Pe("b",e[1].dataType,y,S),fe=et("result",e[0].dataType,C.length,S),ae=[Q,se];if(K){let _e=o?S:1;ae.push(Pe("bias",e[2].dataType,e[2].dims.length,_e))}let V=[{name:"dim_a_outer",type:"i32"},{name:"dim_b_outer",type:"i32"},{name:"dim_inner",type:"i32"}];un(r,V);let A=Tr(fe.type.tensor),U=an(r,fe.type.value,A),ee=im(S,K,U,[H,Q,se,fe],o);return` - ${R.registerUniforms(V).registerInternalVariables(H).declareVariables(...ae,fe)} - ${ee} - ${T?bl(k,g,J,H):vl(k,g,J,H)} - `};return{name:"MatMul",shaderCache:{hint:`${k};${r.activation};${T};${o}`,inputDependencies:z},getRunData:()=>({outputs:[{dims:n?n(t):t,dataType:e[0].dataType}],dispatchGroup:{x:w[0],y:w[1],z:w[2]},programUniforms:F}),getShaderSource:q}}}),am,lm,Rv=je(()=>{ft(),Bs(),Tt(),cn(),gl(),Bv(),xl(),am=(e,r,t,s,o=!1,n,i=4,a=4,l=4,u="f32")=>{let p=F=>{switch(F){case 1:return"resData = x[xIndex];";case 3:return`resData = vec3<${u}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return"resData = x[xIndex / 4];";default:throw new Error(`innerElementSize ${F} is not supported.`)}},c=F=>{switch(F){case 1:return"return w[row * i32(uniforms.w_shape[3]) + colIn];";case 4:return"return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];";default:throw new Error(`innerElementSize ${F} is not supported.`)}},d=e?` - let coord = vec4(batch, xRow, xCol, xCh); - `:` - let coord = vec4(batch, xCh, xRow, xCol); - `,_=e?` - let coords = vec4( - batch, - row / outWidth, - row % outWidth, - col); - `:` - let coords = vec4( - batch, - row, - col / outWidth, - col % outWidth); - `,f=e?"i32(uniforms.x_shape[1])":"i32(uniforms.x_shape[2])",T=e?"i32(uniforms.x_shape[2])":"i32(uniforms.x_shape[3])",k=e?"row":"col",g=e?"col":"row",w=` - let inChannels = i32(uniforms.w_shape[2]); - let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"}; - let outRow = ${k} / outWidth; - let outCol = ${k} % outWidth; - - let WRow = ${g} / (i32(uniforms.w_shape[1]) * inChannels); - let WCol = ${g} / inChannels % i32(uniforms.w_shape[1]); - let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0]; - let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1]; - let xCh = ${g} % inChannels; - var resData = ${kr(i,u)}(0.0); - // The bounds checking is always needed since we use it to pad zero for - // the 'same' padding type. - if (xRow >= 0 && xRow < ${f} && xCol >= 0 && xCol < ${T}) { - ${d} - let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape)); - ${p(i)} - } - return resData;`,S=e?r&&s?` - let col = colIn * ${i}; - ${w}`:` - let col = colIn * ${i}; - if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) { - ${w} - } - return ${kr(i,u)}(0.0);`:s&&t?` - let col = colIn * ${i}; - ${w}`:` - let col = colIn * ${i}; - if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { - ${w} - } - return ${kr(i,u)}(0.0);`,E=e?s&&t?c(a):` - let col = colIn * ${a}; - if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { - ${c(a)} - } - return ${kr(a,u)}(0.0);`:` - let col = colIn * ${a}; - if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) { - ${c(a)} - } - return ${kr(a,u)}(0.0);`,v=kr(l,u),M=kr(e?i:a,u),y=kr(e?a:i,u),C=an(n,v,u);return` - fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${M} { - ${e?S:E} - } - - fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${y} { - ${e?E:S} - } - - fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${v}) { - let col = colIn * ${l}; - if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) - { - var value = valueIn; - let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"}; - ${_} - ${tm(o)} - ${C} - setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); - } - }`},lm=(e,r,t,s,o,n,i,a,l)=>{let u=r.format==="NHWC",p=u?e[0].dims[3]:e[0].dims[1],c=t[0],d=u?t[2]:t[3],_=u?t[1]:t[2],f=u?t[3]:t[1],T=u&&(p%4===0||p%3===0)&&f%4===0,k=u?f:d*_,g=u?d*_:f,w=[8,8,1],S=s<=8?[4,1,1]:[4,4,1],E=[Math.ceil(k/w[0]/S[0]),Math.ceil(g/w[1]/S[1]),Math.ceil(c/w[2]/S[2])];It("verbose",()=>`[conv2d_mm_webgpu] dispatch = ${E}`);let v=T?u&&p%4!==0?3:4:1,M=w[1]*S[1],y=w[0]*S[0],C=Math.max(w[0]*v,w[1]),F=s%M===0,z=o%y===0,K=n%C===0,q=T?[v,4,4]:[1,1,1],R=[{type:6,data:s},{type:6,data:o},{type:6,data:n},{type:6,data:[r.pads[0],r.pads[1]]},{type:6,data:r.strides},{type:6,data:r.dilations}];ln(r,R),R.push(...at(e[0].dims,e[1].dims));let Z=["rank","rank"];i&&(R.push(...at(e[2].dims)),Z.push("rank")),R.push(...at(t));let H=J=>{let Q=[{name:"dim_a_outer",type:"i32"},{name:"dim_b_outer",type:"i32"},{name:"dim_inner",type:"i32"},{name:"pad",type:"i32",length:2},{name:"stride",type:"i32",length:2},{name:"dilation",type:"i32",length:2}];un(r,Q);let se=T?4:1,fe=Tr(e[0].dataType),ae=` - fn setOutputAtIndex(flatIndex : i32, value : ${T?`vec4<${fe}>`:fe}) { - result[flatIndex] = ${T?`vec4<${fe}>`:fe}(value); - } - fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${T?`vec4<${fe}>`:fe}) { - let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3)); - setOutputAtIndex(flatIndex ${T?"/ 4":""}, value); - }`,V=Pe("x",e[0].dataType,e[0].dims.length,v===3?1:v),A=Pe("w",e[1].dataType,e[1].dims.length,se),U=[V,A],ee=et("result",e[0].dataType,t.length,se);if(i){let _e=Pe("bias",e[2].dataType,e[2].dims.length,se);U.push(_e),ae+=` - fn getBiasByOutputCoords(coords : vec4) -> ${T?`vec4<${fe}>`:fe} { - return bias[coords.${u?"w":"y"}${T?"/ 4":""}]; - }`}return` - ${rm("uniforms.result_strides")} - //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4, - // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2, - // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 }; - ${J.registerUniforms(Q).declareVariables(...U,ee)} - ${ae} - ${am(u,F,z,K,i,r,q[0],q[1],q[2],fe)} - ${T?bl(S,w,fe,void 0,!u,C):vl(S,w,fe,void 0,!u,C,!1,void 0,a)}`};return{name:"Conv2DMatMul",shaderCache:{hint:`${r.cacheKey};${v};${T};${F};${z};${K};${M};${y};${C}`,inputDependencies:Z},getRunData:()=>({outputs:[{dims:l?l(t):t,dataType:e[0].dataType}],dispatchGroup:{x:E[0],y:E[1],z:E[2]},programUniforms:R}),getShaderSource:H}}}),um,Tl,go,cm,El,dm,pm,hm,jv=je(()=>{ft(),Bs(),yt(),Tt(),cn(),gl(),um=e=>{let r=1;for(let t=0;ttypeof e=="number"?[e,e,e]:e,go=(e,r)=>r<=1?e:e+(e-1)*(r-1),cm=(e,r,t,s=1)=>{let o=go(r,s);return Math.floor((e[0]*(t-1)-t+o)/2)},El=(e,r,t,s,o)=>{o==null&&(o=cm(e,r[0],s[0]));let n=[0,0,0,t];for(let i=0;i<3;i++)e[i]+2*o>=r[i]&&(n[i]=Math.trunc((e[i]-r[i]+2*o)/s[i]+1));return n},dm=(e,r,t,s,o,n,i,a,l,u)=>{let p,c,d,_;if(e==="VALID"&&(e=0),typeof e=="number"){p={top:e,bottom:e,left:e,right:e,front:e,back:e};let f=El([r,t,s,1],[a,l,u],1,[o,n,i],e);c=f[0],d=f[1],_=f[2]}else if(Array.isArray(e)){if(!e.every((T,k,g)=>T===g[0]))throw Error(`Unsupported padding parameter: ${e}`);p={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let f=El([r,t,s,1],[a,l,u],1,[o,n,i],e[0]);c=f[0],d=f[1],_=f[2]}else if(e==="SAME_UPPER"){c=Math.ceil(r/o),d=Math.ceil(t/n),_=Math.ceil(s/i);let f=(c-1)*o+a-r,T=(d-1)*n+l-t,k=(_-1)*i+u-s,g=Math.floor(f/2),w=f-g,S=Math.floor(T/2),E=T-S,v=Math.floor(k/2),M=k-v;p={top:S,bottom:E,left:v,right:M,front:g,back:w}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:p,outDepth:c,outHeight:d,outWidth:_}},pm=(e,r,t,s,o,n=!1,i="channelsLast")=>{let a,l,u,p,c;if(i==="channelsLast")[a,l,u,p,c]=e;else if(i==="channelsFirst")[a,c,l,u,p]=e;else throw new Error(`Unknown dataFormat ${i}`);let[d,,_,f,T]=r,[k,g,w]=Tl(t),[S,E,v]=Tl(s),M=go(_,S),y=go(f,E),C=go(T,v),{padInfo:F,outDepth:z,outHeight:K,outWidth:q}=dm(o,l,u,p,k,g,w,M,y,C),R=n?d*c:d,Z=[0,0,0,0,0];return i==="channelsFirst"?Z=[a,R,z,K,q]:i==="channelsLast"&&(Z=[a,z,K,q,R]),{batchSize:a,dataFormat:i,inDepth:l,inHeight:u,inWidth:p,inChannels:c,outDepth:z,outHeight:K,outWidth:q,outChannels:R,padInfo:F,strideDepth:k,strideHeight:g,strideWidth:w,filterDepth:_,filterHeight:f,filterWidth:T,effectiveFilterDepth:M,effectiveFilterHeight:y,effectiveFilterWidth:C,dilationDepth:S,dilationHeight:E,dilationWidth:v,inShape:e,outShape:Z,filterShape:r}},hm=(e,r,t,s,o,n)=>{let i=n==="channelsLast";i?e[0].dims[3]:e[0].dims[1];let a=[64,1,1],l={x:t.map((k,g)=>g)},u=[Math.ceil(um(l.x.map(k=>t[k]))/a[0]),1,1];It("verbose",()=>`[conv3d_naive_webgpu] dispatch = ${u}`);let p=1,c=Me.size(t),d=[{type:12,data:c},{type:12,data:s},{type:12,data:o},{type:12,data:r.strides},{type:12,data:r.dilations}];ln(r,d),d.push(...at(e[0].dims,e[1].dims));let _=["rank","rank"],f=e.length===3;f&&(d.push(...at(e[2].dims)),_.push("rank")),d.push(...at(t));let T=k=>{let g=[{name:"output_size",type:"u32"},{name:"filter_dims",type:"u32",length:s.length},{name:"pads",type:"u32",length:o.length},{name:"strides",type:"u32",length:r.strides.length},{name:"dilations",type:"u32",length:r.dilations.length}];un(r,g);let w=1,S=Tr(e[0].dataType),E=Pe("x",e[0].dataType,e[0].dims.length,p),v=Pe("W",e[1].dataType,e[1].dims.length,w),M=[E,v],y=et("result",e[0].dataType,t.length,w),C="";if(f){let K=Pe("bias",e[2].dataType,e[2].dims.length,w);M.push(K),C+=` - fn getBiasByOutputCoords(coords : array) -> ${S} { - return bias[${i?st("coords",4,5):st("coords",1,5)}]; - }`}let F=kr(p,S),z=an(r,F,S);return` - ${C} - fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { - let aIndices = array(d0, d1, d2, d3, d4); - return ${E.getByIndices("aIndices")}; - } - fn getW(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { - let aIndices = array(d0, d1, d2, d3, d4); - return ${v.getByIndices("aIndices")}; - } - ${k.registerUniforms(g).declareVariables(...M,y)} - ${k.mainStart()} - ${k.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let coords = ${y.offsetToIndices("global_idx")}; - let batch = ${st("coords",0,E.rank)}; - let d2 = ${i?st("coords",E.rank-1,E.rank):st("coords",1,E.rank)}; - let xFRCCorner = vec3(${i?st("coords",1,E.rank):st("coords",2,E.rank)}, - ${i?st("coords",2,E.rank):st("coords",3,E.rank)}, - ${i?st("coords",3,E.rank):st("coords",4,E.rank)}) * uniforms.strides - uniforms.pads; - let xFCorner = xFRCCorner.x; - let xRCorner = xFRCCorner.y; - let xCCorner = xFRCCorner.z; - let xShapeY = ${i?st("uniforms.x_shape",1,E.rank):st("uniforms.x_shape",2,E.rank)}; - let xShapeZ = ${i?st("uniforms.x_shape",2,E.rank):st("uniforms.x_shape",3,E.rank)}; - let xShapeW = ${i?st("uniforms.x_shape",3,E.rank):st("uniforms.x_shape",4,E.rank)}; - let xShapeU = ${i?st("uniforms.x_shape",4,E.rank):st("uniforms.x_shape",1,E.rank)}; - let inputDepthNearestVec4 = (xShapeU / 4) * 4; - let inputDepthVec4Remainder = xShapeU % 4; - - var value = 0.0; - for (var wF = 0u; wF < uniforms.filter_dims[0]; wF++) { - let xF = xFCorner + wF * uniforms.dilations[0]; - if (xF < 0 || xF >= xShapeY) { - continue; - } - - for (var wR = 0u; wR < uniforms.filter_dims[1]; wR++) { - let xR = xRCorner + wR * uniforms.dilations[1]; - if (xR < 0 || xR >= xShapeZ) { - continue; - } - - for (var wC = 0u; wC < uniforms.filter_dims[2]; wC++) { - let xC = xCCorner + wC * uniforms.dilations[2]; - if (xC < 0 || xC >= xShapeW) { - continue; - } - - for (var d1 = 0u; d1 < inputDepthNearestVec4; d1 += 4) { - ${i?`let xValues = vec4( - getX(batch, xF, xR, xC, d1), - getX(batch, xF, xR, xC, d1 + 1), - getX(batch, xF, xR, xC, d1 + 2), - getX(batch, xF, xR, xC, d1 + 3)); - `:`let xValues = vec4( - getX(batch, d1, xF, xR, xC), - getX(batch, d1 + 1, xF, xR, xC), - getX(batch, d1 + 2, xF, xR, xC), - getX(batch, d1 + 3, xF, xR, xC)); - `} - let wValues = vec4( - getW(d2, d1, wF, wR, wC), - getW(d2, d1 + 1, wF, wR, wC), - getW(d2, d1 + 2, wF, wR, wC), - getW(d2, d1 + 3, wF, wR, wC)); - value += dot(xValues, wValues); - } - if (inputDepthVec4Remainder == 1) { - ${i?`value += getX(batch, xF, xR, xC, inputDepthNearestVec4) - * getW(d2, inputDepthNearestVec4, wF, wR, wC);`:`value += getX(batch, inputDepthNearestVec4, xF, xR, xC) - * getW(d2, inputDepthNearestVec4, wF, wR, wC);`} - } else if (inputDepthVec4Remainder == 2) { - ${i?`let xValues = vec2( - getX(batch, xF, xR, xC, inputDepthNearestVec4), - getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)); - `:`let xValues = vec2( - getX(batch, inputDepthNearestVec4, xF, xR, xC), - getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC)); - `} - let wValues = vec2( - getW(d2, inputDepthNearestVec4, wF, wR, wC), - getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC)); - value += dot(xValues, wValues); - } else if (inputDepthVec4Remainder == 3) { - ${i?`let xValues = vec3( - getX(batch, xF, xR, xC, inputDepthNearestVec4), - getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1), - getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)); - `:`let xValues = vec3( - getX(batch, inputDepthNearestVec4, xF, xR, xC), - getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC), - getX(batch, inputDepthNearestVec4 + 2, xF, xR, xC)); - `} - let wValues = vec3( - getW(d2, inputDepthNearestVec4, wF, wR, wC), - getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC), - getW(d2, inputDepthNearestVec4 + 2, wF, wR, wC)); - value += dot(xValues, wValues); - } - } - } - } - ${f?"value = value + getBiasByOutputCoords(coords)":""}; - ${z} - result[global_idx] = f32(value); - }`};return{name:"Conv3DNaive",shaderCache:{hint:`${r.cacheKey};${i};${p};${f}`,inputDependencies:_},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:u[0],y:u[1],z:u[2]},programUniforms:d}),getShaderSource:T}}}),mm,fm,Nv=je(()=>{ft(),yt(),Tt(),cn(),mm=(e,r,t,s)=>{let o=e.length>2,n=o?"value += b[output_channel];":"",i=e[0].dims,a=e[1].dims,l=r.format==="NHWC",u=l?t[3]:t[1],p=u/r.group,c=l&&p>=4?sr(u):1,d=Me.size(t)/c,_=[{type:12,data:d},{type:12,data:r.dilations},{type:12,data:[r.strides[0],r.strides[1]]},{type:12,data:[r.pads[0],r.pads[1]]},{type:12,data:p}];ln(r,_),_.push(...at(i,[a[0],a[1],a[2],a[3]/c]));let f=o?["rank","rank","rank"]:["rank","rank"];_.push(...at([t[0],t[1],t[2],t[3]/c]));let T=k=>{let g=et("output",e[0].dataType,t.length,c),w=Tr(g.type.tensor),S=an(r,g.type.value,w),E=Pe("x",e[0].dataType,i.length),v=Pe("w",e[1].dataType,a.length,c),M=[E,v];o&&M.push(Pe("b",e[2].dataType,e[2].dims,c));let y=[{name:"output_size",type:"u32"},{name:"dilations",type:"u32",length:r.dilations.length},{name:"strides",type:"u32",length:2},{name:"pads",type:"u32",length:2},{name:"output_channels_per_group",type:"u32"}];un(r,y);let C=l?` - for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) { - let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; - - if (xHeight < 0u || xHeight >= uniforms.x_shape[1]) { - continue; - } - - for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[1]; wWidth++) { - let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; - if (xWidth < 0u || xWidth >= uniforms.x_shape[2]) { - continue; - } - - for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[2]; wInChannel++) { - let input_channel = in_channel_offset + wInChannel; - let xVal = ${E.get("batch","xHeight","xWidth","input_channel")}; - let wVal = ${v.get("wHeight","wWidth","wInChannel","output_channel")}; - value += xVal * wVal; - } - } - } - `:` - for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) { - let input_channel = in_channel_offset + wInChannel; - for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) { - let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; - - if (xHeight < 0u || xHeight >= uniforms.x_shape[2]) { - continue; - } - - for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) { - let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; - if (xWidth < 0u || xWidth >= uniforms.x_shape[3]) { - continue; - } - - let xVal = ${E.get("batch","input_channel","xHeight","xWidth")}; - let wVal = ${v.get("output_channel","wInChannel","wHeight","wWidth")}; - value += xVal * wVal; - } - } - } - `;return` - ${k.registerUniforms(y).declareVariables(...M,g)} - - ${k.mainStart()} - ${k.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let outputIndices = ${g.offsetToIndices("global_idx")}; - let batch: u32 = outputIndices[0]; - let output_channel: u32 = outputIndices[${l?3:1}]; - let xRCCorner: vec2 = vec2(outputIndices[${l?1:2}], outputIndices[${l?2:3}]) * uniforms.strides - uniforms.pads; - let group_id: u32 = output_channel * ${c} / uniforms.output_channels_per_group; - var in_channel_offset = group_id * uniforms.w_shape[${l?2:1}]; - - var value: ${g.type.value} = ${g.type.value}(0); - ${C} - ${n} - ${S} - ${g.setByOffset("global_idx","value")} - }`};return{name:"GroupedConv",shaderCache:{hint:`${r.cacheKey}_${c}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:s?s(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:_}),getShaderSource:T}},fm=(e,r,t,s)=>{let o=e.length>2,n=sr(t[3]),i=sr(t[2]),a=Me.size(t)/n/i,l=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/n],u=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/n],p=[t[0],t[1],t[2],t[3]/n],c=[{type:12,data:a},{type:6,data:[r.strides[0],r.strides[1]]},{type:6,data:[r.pads[0],r.pads[1]]}];ln(r,c),c.push(...at(l,u,p));let d=(i-1)*r.strides[1]+u[1],_=f=>{let T=et("output",e[0].dataType,p.length,n),k=Tr(T.type.tensor),g=an(r,T.type.value,k),w=Pe("x",e[0].dataType,l.length,n),S=Pe("w",e[1].dataType,u.length,n),E=[w,S];o&&E.push(Pe("b",e[2].dataType,e[2].dims,n));let v=o?"value += b[output_channel];":"",M=[{name:"output_size",type:"u32"},{name:"strides",type:"i32",length:2},{name:"pads",type:"i32",length:2}];return un(r,M),` - ${f.registerUniforms(M).declareVariables(...E,T)} - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let width0 = uniforms.output_shape[3]; - let output_channel = global_idx % width0; - var index1 = global_idx / width0; - let width1 = uniforms.output_shape[2] / ${i}u; - let col = (index1 % width1) * ${i}u; - index1 = index1 / width1; - let row = index1 % uniforms.output_shape[1]; - let batch = index1 / uniforms.output_shape[1]; - - let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads; - - var x_vals: array<${w.type.value}, ${d}>; - var values: array<${T.type.value}, ${i}>; - let input_channel = output_channel; - // Use constant instead of uniform can give better performance for w's height/width. - for (var w_height: u32 = 0u; w_height < ${u[0]}; w_height++) { - let x_height = x_corner.x + i32(w_height); - if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) { - for (var i = 0; i < ${d}; i++) { - let x_width = x_corner.y + i; - if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) { - x_vals[i] = ${w.get("batch","u32(x_height)","u32(x_width)","input_channel")}; - } else { - x_vals[i] = ${w.type.value}(0); - } - } - for (var w_width: u32 = 0u; w_width < ${u[1]}; w_width++) { - let w_val = ${S.get("w_height","w_width","0","output_channel")}; - for (var i = 0u; i < ${i}u; i++) { - values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]); - } - } - } - } - - for (var i = 0u; i < ${i}u; i++) { - var value = values[i]; - ${v} - ${g} - ${T.set("batch","row","col + i","output_channel","value")}; - } - }`};return{name:"GroupedConv-Vectorize",shaderCache:{hint:`${r.cacheKey};${n};${i};${d};${u[0]};${u[1]}`,inputDependencies:o?["rank","rank","type"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:s?s(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:c}),getShaderSource:_}}}),_m,_i,gm,gi,Pl,Cl,wm,Mm,Sl,Vv=je(()=>{yt(),Rv(),jv(),xl(),Nv(),cn(),Ml(),Ws(),_m=(e,r,t,s,o,n)=>{let i=e[0],a=e.slice(n?1:2,n?3:4),l=a.length,u=r[0],p=r.slice(2).map((d,_)=>d+(d-1)*(t[_]-1)),c=a.map((d,_)=>d+s[_]+s[_+l]).map((d,_)=>Math.floor((d-p[_]+o[_])/o[_]));return c.splice(0,0,i),c.splice(n?3:1,0,u),c},_i=[2,3,1,0],gm=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length>5)throw new Error("greater than 5D is not supported");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let t=e[0].dims[r.format==="NHWC"?e[0].dims.length-1:1],s=e[1].dims[1]*r.group;if(t!==s)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");let o=e[0].dims.length-2;if(r.dilations.length!==o)throw new Error(`dilations should be ${o}D`);if(r.strides.length!==o)throw new Error(`strides should be ${o}D`);if(r.pads.length!==o*2)throw new Error(`pads should be ${o*2}D`);if(r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape")},gi=(e,r)=>{let t=e.kernelShape.slice();t.length{let r=_l(e),t=e.format,s=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],o=e.dilations,n=e.group,i=e.kernel_shape,a=e.pads,l=e.strides,u=e.w_is_const();return{autoPad:s,format:t,dilations:o,group:n,kernelShape:i,pads:a,strides:l,wIsConst:u,...r,cacheKey:`${e.format};${r.activation};`}},Cl=(e,r,t,s)=>{let o=t.format==="NHWC",n=_m(r[0].dims,r[1].dims,t.dilations,t.pads,t.strides,o);if(t.group!==1){let M=[r[0]];if(o){let y=e.kernelCustomData.wT??e.compute(qr(r[1],_i),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=y),M.push(y)}else M.push(r[1]);r.length===3&&M.push(r[2]),!e.adapterInfo.isArchitecture("ampere")&&o&&r[1].dims[0]===t.group&&r[1].dims[1]===1&&t.dilations[0]===1&&t.dilations[1]===1?e.compute(fm(M,t,n,s),{inputs:M}):e.compute(mm(M,t,n,s),{inputs:M});return}let i=r.length===3,a=r[0].dims[o?1:2],l=r[0].dims[o?2:3],u=r[0].dims[o?3:1],p=r[1].dims[2],c=r[1].dims[3],d=n[o?1:2],_=n[o?2:3],f=n[o?3:1],T=o&&p===a&&c===l&&t.pads[0]===0&&t.pads[1]===0;if(T||p===1&&c===1&&t.dilations[0]===1&&t.dilations[1]===1&&t.strides[0]===1&&t.strides[1]===1&&t.pads[0]===0&&t.pads[1]===0){let M=n[0],y,C,F,z=[];if(o){let R=e.kernelCustomData.wT??e.compute(qr(r[1],_i),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];if(t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=R),T){let Z=a*l*u;y=r[0].reshape([1,M,Z]),C=R.reshape([1,Z,f]),F=[1,M,f]}else y=r[0].reshape([M,a*l,u]),C=R.reshape([1,u,f]),F=[M,d*_,f];z.push(y),z.push(C)}else y=r[0].reshape([M,u,a*l]),C=r[1].reshape([1,f,u]),F=[M,f,d*_],z.push(C),z.push(y);i&&z.push(r[2]);let K=F[2],q=z[0].dims[z[0].dims.length-1];K<8&&q<8?e.compute(wl(z,t,n,F,o,s),{inputs:z}):e.compute(fi(z,t,n,F,o,s),{inputs:z});return}let k=!0,g=e.kernelCustomData.wT??e.compute(qr(r[1],_i),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=g);let w=[r[0],g];i&&w.push(r[2]);let S=o?d*_:f,E=o?f:d*_,v=p*c*u;e.compute(lm(w,t,n,S,E,v,i,k,s),{inputs:w})},wm=(e,r)=>{let t=r.format==="NHWC",s=[e.inputs[0].reshape(t?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&s.push(e.inputs[2]);let o=[0,r.pads[0],0,r.pads[1]],n=[1].concat(r.strides),i=[1].concat(r.dilations),a=[1].concat(r.kernelShape),l=gi({...r,pads:o,strides:n,dilations:i,kernelShape:a},s);Cl(e,s,l,u=>t?[u[0],u[2],u[3]]:[u[0],u[1],u[3]])},Mm=(e,r,t)=>{let s=t.format==="NHWC"?"channelsLast":"channelsFirst",o=gi(t,r),n=t.autoPad==="NOTSET"?t.pads:t.autoPad,i=pm(r[0].dims,r[1].dims,t.strides,t.dilations,n,!1,s);e.compute(hm(r,o,i.outShape,[i.filterDepth,i.filterHeight,i.filterWidth],[i.padInfo.front,i.padInfo.top,i.padInfo.left],s))},Sl=(e,r)=>{if(gm(e.inputs,r),e.inputs[0].dims.length===3)wm(e,r);else if(e.inputs[0].dims.length===5)Mm(e,e.inputs,r);else{let t=gi(r,e.inputs);Cl(e,e.inputs,t)}}}),bm,Uv=je(()=>{ft(),Bs(),yt(),Tt(),bm=(e,r,t)=>{let s=e.length>2,o=r.outputShape,n=r.format==="NHWC",i=r.group,a=e[1].dims,l=a[2]/i,u=a[3],p=n?sr(l):1,c=n&&u===1&&l>=4,d=c?Math.floor(l/4)*4:Math.floor(l/p)*p,_=l-d,f=n?sr(u):1,T=n?u===1?p:f:1,k=Me.size(o)/f,g=[Math.ceil(k/64),1,1];It("verbose",()=>`[conv2d_backprop_webgpu] dispatch = ${g}`);let w=["rank","rank"],S=[r.strides[0],r.strides[1]],E=[r.kernelShape[n?1:2],r.kernelShape[n?2:3]],v=[r.dilations[0],r.dilations[1]],M=[E[0]+(r.dilations[0]<=1?0:(r.kernelShape[n?1:2]-1)*(r.dilations[0]-1)),E[1]+(r.dilations[1]<=1?0:(r.kernelShape[n?2:3]-1)*(r.dilations[1]-1))],y=[M[0]-1-Math.floor((r.pads[0]+r.pads[2])/2),M[1]-1-Math.floor((r.pads[1]+r.pads[3])/2)],C=[{type:12,data:k},{type:12,data:S},{type:12,data:E},{type:12,data:v},{type:12,data:M},{type:6,data:y},{type:12,data:d},{type:12,data:l},{type:12,data:u},...at(e[0].dims,e[1].dims)];s&&(C.push(...at(e[2].dims)),w.push("rank")),C.push(...at(o));let F=z=>{let K=[{name:"output_size",type:"u32"},{name:"strides",type:"u32",length:S.length},{name:"filter_dims",type:"u32",length:E.length},{name:"dilations",type:"u32",length:E.length},{name:"effective_filter_dims",type:"u32",length:M.length},{name:"pads",type:"i32",length:y.length},{name:"input_channels_per_group_int",type:"u32"},{name:"input_channels_per_group",type:"u32"},{name:"output_channels_per_group",type:"u32"}],q=Tr(e[0].dataType),R=n?1:2,Z=n?2:3,H=n?3:1,J=Pe("W",e[1].dataType,e[1].dims.length,T),Q=Pe("Dy",e[0].dataType,e[0].dims.length,p),se=[Q,J];s&&se.push(Pe("bias",e[2].dataType,[o[H]].length,f));let fe=et("result",e[0].dataType,o.length,f),ae=()=>{let U="";if(c)p===4?U+=` - let xValue = ${Q.getByOffset("x_offset")}; - let wValue = ${J.getByOffset("w_offset")}; - dotProd = dotProd + dot(xValue, wValue); - x_offset += 1u; - w_offset += 1u;`:p===2?U+=` - dotProd = dotProd + dot(vec4<${q}>(${Q.getByOffset("x_offset")}, ${Q.getByOffset("x_offset + 1u")}), vec4<${q}>(${J.getByOffset("w_offset")}, ${J.getByOffset("w_offset + 1u")})); - x_offset += 2u; - w_offset += 2u;`:p===1&&(U+=` - dotProd = dotProd + dot(vec4<${q}>(${Q.getByOffset("x_offset")}, ${Q.getByOffset("x_offset + 1u")}, ${Q.getByOffset("x_offset + 2u")}, ${Q.getByOffset("x_offset + 3u")}), vec4<${q}>(${J.getByOffset("w_offset")}, ${J.getByOffset("w_offset + 1u")}, ${J.getByOffset("w_offset + 2u")}, ${J.getByOffset("w_offset + 3u")})); - x_offset += 4u; - w_offset += 4u;`);else if(U+=` - let xValue = ${n?Q.getByOffset(`${Q.indicesToOffset(`${Q.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p}`):Q.get("batch","inputChannel","idyR","idyC")}; - `,p===1)U+=` - let w_offset = ${J.indicesToOffset(`${J.type.indices}(u32(wRPerm), u32(wCPerm), inputChannel, wOutChannel)`)}; - let wValue = ${J.getByOffset(`w_offset / ${T}`)}; - dotProd = dotProd + xValue * wValue;`;else for(let ee=0;ee{if(_===0)return"";if(!c)throw new Error(`packInputAs4 ${c} is not true.`);let U="";if(p===1){U+="dotProd = dotProd";for(let ee=0;ee<_;ee++)U+=` - + ${Q.getByOffset(`x_offset + ${ee}`)} * ${J.getByOffset(`w_offset + ${ee}`)}`;U+=";"}else if(p===2){if(_!==2)throw new Error(`Invalid inputChannelsRemainder ${_}.`);U+=` - let xValue = ${Q.getByOffset("x_offset")}; - let wValue = ${J.getByOffset("w_offset")}; - dotProd = dotProd + dot(xValue, wValue);`}return U},A=` - let outputIndices = ${fe.offsetToIndices(`global_idx * ${f}`)}; - let batch = ${fe.indicesGet("outputIndices",0)}; - let d1 = ${fe.indicesGet("outputIndices",H)}; - let r = ${fe.indicesGet("outputIndices",R)}; - let c = ${fe.indicesGet("outputIndices",Z)}; - let dyCorner = vec2(i32(r), i32(c)) - uniforms.pads; - let dyRCorner = dyCorner.x; - let dyCCorner = dyCorner.y; - let groupId = d1 / uniforms.output_channels_per_group; - let wOutChannel = d1 - groupId * uniforms.output_channels_per_group; - // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). - // ? = to be determined. : = across all values in that axis. - var dotProd = ${fe.type.value}(0.0); - var wR: u32 = 0; - if (uniforms.dilations.x == 1) { - // Minimum wR >= 0 that satisfies (dyRCorner + wR) % (uniforms.strides.x) == 0 - wR = u32(((dyRCorner + i32(uniforms.strides.x) - 1) / i32(uniforms.strides.x)) * i32(uniforms.strides.x) - dyRCorner); - } - for (; wR < uniforms.effective_filter_dims.x; wR = wR + 1) { - if (wR % uniforms.dilations.x != 0) { - continue; - } - let dyR = (${q}(dyRCorner) + ${q}(wR)) / ${q}(uniforms.strides[0]); - let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x; - if (dyR < 0.0 || dyR >= ${q}(uniforms.Dy_shape[${R}]) || fract(dyR) > 0.0 || - wRPerm < 0) { - continue; - } - let idyR: u32 = u32(dyR); - var wC: u32 = 0; - if (uniforms.dilations.y == 1) { - // Minimum wC >= 0 that satisfies (dyCCorner + wC) % (uniforms.strides.y) == 0 - wC = u32(((dyCCorner + i32(uniforms.strides.y) - 1) / i32(uniforms.strides.y)) * i32(uniforms.strides.y) - dyCCorner); - } - for (; wC < uniforms.effective_filter_dims.y; wC = wC + 1) { - if (wC % uniforms.dilations.y != 0) { - continue; - } - let dyC = (${q}(dyCCorner) + ${q}(wC)) / ${q}(uniforms.strides.y); - let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y; - if (dyC < 0.0 || dyC >= ${q}(uniforms.Dy_shape[${Z}]) || - fract(dyC) > 0.0 || wCPerm < 0) { - continue; - } - let idyC: u32 = u32(dyC); - var inputChannel = groupId * uniforms.input_channels_per_group; - ${c?` - var x_offset = ${Q.indicesToOffset(`${Q.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p}; - var w_offset = ${J.indicesToOffset(`${J.type.indices}(wRPerm, wCPerm, inputChannel, wOutChannel)`)} / ${T}; - `:""} - for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group_int; d2 = d2 + ${c?4:p}) { - ${ae()} - inputChannel = inputChannel + ${c?4:p}; - } - ${V()} - wC = wC + uniforms.strides.y - 1; - } - wR = wR + uniforms.strides[0] - 1; - } - let value = dotProd${s?` + bias[d1 / ${f}]`:""}; - ${fe.setByOffset("global_idx","value")}; - `;return` - ${z.registerUniforms(K).declareVariables(...se,fe)} - ${z.mainStart()} - ${z.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}; - ${A}}`};return{name:"ConvTranspose2D",shaderCache:{hint:`${r.cacheKey};${p}${T}${f}${c}${_}`,inputDependencies:w},getRunData:()=>({dispatchGroup:{x:g[0],y:g[1],z:g[2]},outputs:[{dims:t?t(o):o,dataType:e[0].dataType}],programUniforms:C}),getShaderSource:F}}}),ym,vm,xm,$l,Tm,Em,kl,Pm,Cm,Wv=je(()=>{Uv(),cn(),Ws(),ym=(e,r,t,s,o,n)=>(e-1)*r+t+(s-1)*o+1-n,vm=(e,r,t,s,o)=>{let n=Math.floor(e/2);r==="SAME_UPPER"?(t[s]=n,t[o]=e-n):r==="SAME_LOWER"&&(t[s]=e-n,t[o]=n)},xm=(e,r,t,s,o,n,i,a,l,u)=>{let p=e.length-2,c=u.length===0;l.length{let t=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((c,d)=>c*d,1)===0){t.length=0;for(let c=2;cc+d,0)===0){let c=r[0].dims.length-2;l=new Array(c).fill(1)}let u=e.strides.slice();if(u.reduce((c,d)=>c+d,0)===0){let c=r[0].dims.length-2;u=new Array(c).fill(1)}xm(a,t,l,e.autoPad,e.group,o,u,s,i,n);let p=Object.assign({},e);return Object.assign(p,{kernelShape:t,pads:o,outputPadding:i,outputShape:n,dilations:l,strides:u}),p},Tm=e=>{let r=_l(e),t=e.format,s=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][typeof e.autoPad>"u"?0:e.autoPad],o=e.dilations,n=e.group,i=e.kernelShape,a=e.pads,l=e.strides,u=e.wIsConst(),p=e.outputPadding,c=e.outputShape;return{autoPad:s,format:t,dilations:o,group:n,kernelShape:i,outputPadding:p,outputShape:c,pads:a,strides:l,wIsConst:u,...r,cacheKey:`${e.format};${r.activation};`}},Em=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error("currently only support 2-dimensional conv");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let t=e[0].dims[r.format==="NHWC"?e[0].dims.length-1:1],s=e[1].dims[0];if(t!==s)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");let o=e[1].dims[1]*r.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==o))throw new Error("invalid bias");let n=e[0].dims.length-2;if(r.dilations.reduce((i,a)=>i+a,0)>0&&r.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(r.strides.reduce((i,a)=>i+a,0)>0&&r.strides.length!==n)throw new Error(`strides should be ${n}D`);if(r.pads.reduce((i,a)=>i+a,0)>0&&r.pads.length!==n*2)throw new Error(`pads should be ${n*2}D`);if(r.outputPadding.length!==n&&r.outputPadding.length!==0)throw new Error(`output_padding should be ${n}D`);if(r.kernelShape.reduce((i,a)=>i+a,0)>0&&r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(r.outputShape.length!==0&&r.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape")},kl=(e,r,t,s)=>{let o=e.kernelCustomData.wT??e.compute(qr(r[1],[2,3,0,1]),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=o);let n=[r[0],o];r.length===3&&n.push(r[2]),e.compute(bm(n,t,s),{inputs:n})},Pm=(e,r)=>{let t=r.format==="NHWC",s=[e.inputs[0].reshape(t?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&s.push(e.inputs[2]);let o=r.kernelShape;(o.length===0||o[0]===0)&&(o=[e.inputs[1].dims[2]]);let n=r.dilations;(n.length===0||n[0]===0)&&(n=[1]);let i=r.strides;(i.length===0||i[0]===0)&&(i=[1]);let a=r.pads;a.length===0&&(a=[0,0]),a=[0,a[0],0,a[1]],i=[1].concat(i),n=[1].concat(n),o=[1].concat(o);let l=r.outputPadding;l=[0].concat(l);let u=$l({...r,pads:a,strides:i,dilations:n,kernelShape:o,outputPadding:l},s);kl(e,s,u,p=>t?[p[0],p[2],p[3]]:[p[0],p[1],p[3]])},Cm=(e,r)=>{if(Em(e.inputs,r),e.inputs[0].dims.length===3)Pm(e,r);else{let t=$l(r,e.inputs);kl(e,e.inputs,t)}}}),Sm,$m,km,Gv=je(()=>{ft(),yt(),or(),Tt(),Sm=(e,r,t,s)=>{let o=Me.size(r),n=r.length,i=Pe("input",e,n),a=et("output",e,n),l=t.dataType===6?t.getInt32Array()[0]:Number(t.getBigInt64Array()[0]),u=Me.normalizeAxis(l,n),p=c=>{let d=` i32(${i.indicesGet("inputIndices","uniforms.axis")}) `,_=st("uniforms.input_shape","uniforms.axis",n),f=s.reverse?d+(s.exclusive?" + 1":""):"0",T=s.reverse?_:d+(s.exclusive?"":" + 1");return` - ${c.registerUniform("outputSize","u32").registerUniform("axis","u32").declareVariables(i,a)} - ${c.mainStart()} - ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - var inputIndices = ${a.offsetToIndices("global_idx")}; - var sum = ${a.type.value}(0); - let first : i32 = ${f}; - let last : i32 = ${T}; - for (var i : i32 = first; i < last; i++) { - ${i.indicesSet("inputIndices","uniforms.axis","u32(i)")}; - sum = sum + ${i.getByIndices("inputIndices")}; - } - ${a.setByOffset("global_idx","sum")}; - }`};return{name:"CumSum",shaderCache:{hint:s.cacheKey,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:r,dataType:e}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:[{type:12,data:o},{type:12,data:u},...at(r,r)]}),getShaderSource:p}},$m=(e,r)=>{let t=e.inputs[0].dims,s=e.inputs[0].dataType,o=e.inputs[1];e.compute(Sm(s,t,o,r),{inputs:[0]})},km=e=>{let r=e.exclusive===1,t=e.reverse===1;return zt({exclusive:r,reverse:t})}}),Im,Am,Fm,Om,Dm,Kv=je(()=>{ft(),yt(),or(),Tt(),Im=e=>{if(!e||e.length!==1)throw new Error("DepthToSpace requires 1 input.");if(e[0].dims.length!==4)throw new Error("DepthToSpace requires 4D input.")},Am=(e,r,t,s)=>{let o=[];o.push(`fn perm(i: ${s.type.indices}) -> ${t.type.indices} { - var a: ${t.type.indices};`);for(let n=0;n{let t,s,o,n,i,a,l=r.format==="NHWC",u=r.blocksize,p=r.mode==="DCR";l?([t,s,o,n]=e.dims,i=p?[t,s,o,u,u,n/u**2]:[t,s,o,n/u**2,u,u],a=p?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([t,s,o,n]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],i=p?[t,u,u,n/u**2,s,o]:[t,n/u**2,u,u,s,o],a=p?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let c=e.reshape(i),d=c.dims.length,_=e.dataType,f=Pe("a",_,d),T=et("output",_,d),k=g=>` - ${g.registerUniform("output_size","u32").declareVariables(f,T)} - - ${Am(a,d,f,T)} - - ${g.mainStart()} - ${g.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let indices = ${T.offsetToIndices("global_idx")}; - let aIndices = perm(indices); - - ${T.setByOffset("global_idx",f.getByIndices("aIndices"))} - }`;return{name:"DepthToSpace",shaderCache:{hint:`${e.dims};${r.blocksize};${r.mode}`,inputDependencies:["rank"]},getRunData:g=>{let w=l?[t,s*u,o*u,n/u**2]:[t,n/u**2,s*u,o*u],S=Me.size(w),E=c.dims,v=Me.sortBasedOnPerm(E,a);return{outputs:[{dims:w,dataType:g[0].dataType}],dispatchGroup:{x:Math.ceil(S/64)},programUniforms:[{type:12,data:S},...at(E,v)]}},getShaderSource:k}},Om=(e,r)=>{Im(e.inputs),e.compute(Fm(e.inputs[0],r))},Dm=e=>zt({blocksize:e.blocksize,mode:e.mode,format:e.format})}),wi,wo,Il,Lm,zm,Bm,Rm,Al,jm,Nm,Vm,Hv=je(()=>{ft(),yt(),or(),Tt(),wi="[a-zA-Z]|\\.\\.\\.",wo="("+wi+")+",Il="^"+wo+"$",Lm="("+wo+",)*"+wo,zm="^"+Lm+"$",Bm=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,r){let t=this.symbolToIndices.get(e);t===void 0?t=[r]:t.push(r),this.symbolToIndices.set(e,t)}},Rm=class{constructor(e,r){var o;this.equation=r,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=new Array,this.outputDims=[];let[t,s]=r.includes("->")?r.split("->",2):[r,""];if(!t.match(RegExp(zm)))throw new Error("Invalid LHS term");if(t.split(",").forEach((n,i)=>{let a=e[i].dims.slice();if(!n.match(RegExp(Il)))throw new Error("Invalid LHS term");let l=this.processTerm(n,!0,a,i);this.lhs.push(l)}),s==="")s+=[...this.symbolToInfo.entries()].filter(([n,i])=>i.count===1||n==="...").map(([n])=>n).join("");else if(!s.match(RegExp(wo)))throw new Error("Invalid RHS");(o=s.match(RegExp(wi,"g")))==null||o.forEach(n=>{if(n==="...")this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let i=this.symbolToInfo.get(n);if(i===void 0)throw new Error("Invalid RHS symbol");this.outputDims.push(i.dimValue)}}),this.rhs=this.processTerm(s,!1,this.outputDims)}addSymbol(e,r,t){let s=this.symbolToInfo.get(e);if(s!==void 0){if(s.dimValue!==r&&s.count!==1)throw new Error("Dimension mismatch");s.count++,s.inputIndices.push(t)}else s={count:1,dimValue:r,inputIndices:[t]};this.symbolToInfo.set(e,s)}processTerm(e,r,t,s=-1){let o=t.length,n=!1,i=[],a=0;if(!e.match(RegExp(Il))&&!r&&e!=="")throw new Error("Invalid LHS term");let l=e.match(RegExp(wi,"g")),u=new Bm(s);return l==null||l.forEach((p,c)=>{if(p==="..."){if(n)throw new Error("Only one ellipsis is allowed per input term");n=!0;let d=o-l.length+1;if(d<0)throw new Error("Ellipsis out of bounds");if(i=t.slice(a,a+d),this.hasEllipsis){if(this.ellipsisDims.length!==i.length||this.ellipsisDims.toString()!==i.toString())throw new Error("Ellipsis dimensions mismatch")}else if(r)this.hasEllipsis=!0,this.ellipsisDims=i;else throw new Error("Ellipsis must be specified in the LHS");for(let _=0;_e+"_max",jm=(e,r,t,s)=>{let o=e.map(u=>u.length).map((u,p)=>Pe(`input${p}`,r,u)),n=Me.size(s),i=et("output",r,s.length),a=[...t.symbolToInfo.keys()].filter(u=>!t.rhs.symbolToIndices.has(u)),l=u=>{let p=[],c="var prod = 1.0;",d="var sum = 0.0;",_="sum += prod;",f=[],T=[],k=[],g=[],w=t.symbolToInfo.size===t.rhs.symbolToIndices.size;t.symbolToInfo.forEach((E,v)=>{var M;if(t.rhs.symbolToIndices.has(v)){let y=(M=t.rhs.symbolToIndices.get(v))==null?void 0:M[0];y!==void 0&&t.lhs.forEach((C,F)=>{if(E.inputIndices.includes(F)){let z=C.symbolToIndices.get(v);if(z===void 0)throw new Error("Invalid symbol error");z.forEach(K=>{p.push(`${o[F].indicesSet(`input${F}Indices`,K,i.indicesGet("outputIndices",y))}`)})}})}else t.lhs.forEach((y,C)=>{if(E.inputIndices.includes(C)){let F=y.symbolToIndices.get(v);if(F===void 0)throw new Error("Invalid symbol error");F.forEach(z=>{f.push(`${o[C].indicesSet(`input${C}Indices`,z,`${v}`)}`)}),g.push(`prod *= ${o[C].getByIndices(`input${C}Indices`)};`)}}),T.push(`for(var ${v}: u32 = 0; ${v} < uniforms.${Al(v)}; ${v}++) {`),k.push("}")});let S=w?[...p,`let sum = ${o.map((E,v)=>E.getByIndices(`input${v}Indices`)).join(" * ")};`]:[...p,d,...T,...f,c,...g,_,...k];return` - ${u.registerUniforms(a.map(E=>({name:`${Al(E)}`,type:"u32"}))).registerUniform("outputSize","u32").declareVariables(...o,i)} - - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - var outputIndices = ${i.offsetToIndices("global_idx")}; - ${o.map((E,v)=>`var input${v}Indices: ${o[v].type.indices};`).join(` -`)} - ${S.join(` -`)}; - ${i.setByOffset("global_idx","sum")}; - }`};return{name:"Einsum",shaderCache:{hint:t.equation,inputDependencies:e.map(()=>"rank")},getRunData:()=>{let u=a.filter(c=>t.symbolToInfo.has(c)).map(c=>{var d;return{type:12,data:((d=t.symbolToInfo.get(c))==null?void 0:d.dimValue)||0}});u.push({type:12,data:n});let p=e.map((c,d)=>[...at(c)]).reduce((c,d)=>c.concat(d),u);return p.push(...at(s)),{outputs:[{dims:s,dataType:r}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:p}},getShaderSource:l}},Nm=(e,r)=>{let t=new Rm(e.inputs,r.equation),s=t.outputDims,o=e.inputs.map((n,i)=>n.dims);e.compute(jm(o,e.inputs[0].dataType,t,s))},Vm=e=>{let r=e.equation.replace(/\s+/g,"");return zt({equation:r})}}),Um,Fl,Wm,Gm,Km,qv=je(()=>{ft(),yt(),Tt(),Um=e=>{if(!e||e.length!==2)throw new Error("Expand requires 2 input.");let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),s=t.length{let t=e.length-r.length,s=[];for(let o=0;oe.length>r.length?Fl(e,r):Fl(r,e),Gm=e=>{let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),s=Wm(r,t),o=e[0].dataType,n=o===9||Me.size(r)===1,i=o===9||r.length>0&&r[r.length-1]%4===0?4:1,a=n||s.length>0&&s[s.length-1]%4===0?4:1,l=Math.ceil(Me.size(s)/a),u=c=>{let d=Pe("input",o,r.length,i),_=et("output",o,s.length,a),f;if(o===9){let T=(k,g,w="")=>` - let outputIndices${g} = ${_.offsetToIndices(`outputOffset + ${g}u`)}; - let offset${g} = ${d.broadcastedIndicesToOffset(`outputIndices${g}`,_)}; - let index${g} = offset${g} / 4u; - let component${g} = offset${g} % 4u; - ${k}[${g}] = ${w}(${d.getByOffset(`index${g}`)}[component${g}]); - `;f=` - let outputOffset = global_idx * ${a}; - var data = vec4(0); - ${T("data",0,"u32")} - ${T("data",1,"u32")} - ${T("data",2,"u32")} - ${T("data",3,"u32")} - ${_.setByOffset("global_idx","data")} - }`}else f=` - let outputIndices = ${_.offsetToIndices(`global_idx * ${a}`)}; - let inputOffset = ${d.broadcastedIndicesToOffset("outputIndices",_)}; - let data = ${_.type.value}(${d.getByOffset(`inputOffset / ${i}`)}); - ${_.setByOffset("global_idx","data")} - }`;return` - ${c.registerUniform("vec_size","u32").declareVariables(d,_)} - ${c.mainStart()} - ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - ${f}`},p=[{type:12,data:l},...at(r,s)];return{name:"Expand",shaderCache:{hint:`${s.length};${i}${a}`,inputDependencies:["rank"]},getShaderSource:u,getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:p})}},Km=e=>{Um(e.inputs),e.compute(Gm(e.inputs),{inputs:[0]})}}),Hm,qm,Qv=je(()=>{ft(),yt(),Tt(),fl(),Hm=e=>{let r=e[0].dataType,t=Me.size(e[0].dims),s=Me.size(e[1].dims),o=s%4===0,n=i=>{let a=Pe("x",r,[1],4),l=Pe("bias",r,[1],4),u=et("y",r,[1],4),p=[{name:"output_vec_size",type:"u32"},{name:"bias_size",type:"u32"}],c=_=>` - let bias${_}_offset: u32 = (global_idx * 4 + ${_}) % uniforms.bias_size; - let bias${_} = ${l.getByOffset(`bias${_}_offset / 4`)}[bias${_}_offset % 4];`,d=o?` - let bias = ${l.getByOffset("global_idx % (uniforms.bias_size / 4)")};`:`${c(0)}${c(1)}${c(2)}${c(3)} - let bias = ${a.type.value}(bias0, bias1, bias2, bias3);`;return`${i.registerUniforms(p).declareVariables(a,l,u)} - - ${hl(zr(r))} - - ${i.mainStart(Vn)} - ${i.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_vec_size")} - - let x = ${a.getByOffset("global_idx")}; - ${d} - let x_in = x + bias; - ${u.setByOffset("global_idx",ml("x_in"))} - }`};return{name:"FastGeluWithBias",shaderCache:{hint:`${o}`,inputDependencies:["type","type"]},getShaderSource:n,getRunData:i=>({outputs:[{dims:i[0].dims,dataType:i[0].dataType}],programUniforms:[{type:12,data:Math.ceil(t/4)},{type:12,data:s}],dispatchGroup:{x:Math.ceil(t/Vn/4)}})}},qm=e=>{e.inputs.length<2||Me.size(e.inputs[1].dims)===0?Sh(e):e.compute(Hm(e.inputs))}}),Qm,Xm,Jm,Ym,Xv=je(()=>{ft(),yt(),or(),Tt(),Qm=e=>{if(!e||e.length!==2)throw new Error("Gather requires 2 inputs.")},Xm=(e,r)=>{let t=e[0].dims,s=e[1].dims,o=t.length,n=Me.normalizeAxis(r.axis,o),i=t.slice(0);i.splice(n,1,...s);let a=t[n],l=e[0].dataType===9?4:1,u=Math.ceil(Me.size(i)/l),p=[{type:12,data:u},{type:6,data:a},{type:12,data:n},...at(e[0].dims,e[1].dims,i)],c=d=>{let _=Pe("data",e[0].dataType,e[0].dims.length,l),f=Pe("inputIndices",e[1].dataType,e[1].dims.length),T=et("output",e[0].dataType,i.length,l),k=w=>{let S=s.length,E=`var indicesIndices${w} = ${f.type.indices}(0);`;for(let v=0;v1?`indicesIndices${w}[${v}]`:`indicesIndices${w}`} = ${i.length>1?`outputIndices${w}[uniforms.axis + ${v}]`:`outputIndices${w}`};`;E+=` - var idx${w} = ${f.getByIndices(`indicesIndices${w}`)}; - if (idx${w} < 0) { - idx${w} = idx${w} + uniforms.axisDimLimit; - } - var dataIndices${w} : ${_.type.indices}; - `;for(let v=0,M=0;v1?`dataIndices${w}[${v}]`:`dataIndices${w}`} = u32(idx${w});`,M+=S):(E+=`${o>1?`dataIndices${w}[${v}]`:`dataIndices${w}`} = ${i.length>1?`outputIndices${w}[${M}]`:`outputIndices${w}`};`,M++);return E},g;if(e[0].dataType===9){let w=(S,E,v="")=>` - let outputIndices${E} = ${T.offsetToIndices(`outputOffset + ${E}u`)}; - ${k(E)}; - let offset${E} = ${_.indicesToOffset(`dataIndices${E}`)}; - let index${E} = offset${E} / 4u; - let component${E} = offset${E} % 4u; - ${S}[${E}] = ${v}(${_.getByOffset(`index${E}`)}[component${E}]); - `;g=` - let outputOffset = global_idx * ${l}; - var value = vec4(0); - ${w("value",0,"u32")} - ${w("value",1,"u32")} - ${w("value",2,"u32")} - ${w("value",3,"u32")} - ${T.setByOffset("global_idx","value")} - `}else g=` - let outputIndices = ${T.offsetToIndices("global_idx")}; - ${k("")}; - let value = ${_.getByIndices("dataIndices")}; - ${T.setByOffset("global_idx","value")}; - `;return` - ${d.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(_,f,T)} - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - ${g} - }`};return{name:"Gather",shaderCache:{hint:r.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:p}),getShaderSource:c}},Jm=e=>zt({axis:e.axis}),Ym=(e,r)=>{let t=e.inputs;Qm(t),e.compute(Xm(e.inputs,r))}}),Zm,ef,tf,Jv=je(()=>{ft(),yt(),Tt(),Zm=(e,r,t,s,o,n,i,a,l)=>{let u=[{type:12,data:n},{type:12,data:s},{type:12,data:o},{type:12,data:t},{type:12,data:i},{type:12,data:a},{type:12,data:l}],p=[n];u.push(...at(r.dims,p));let c=d=>{let _=Pe("indices_data",r.dataType,r.dims.length),f=et("input_slice_offsets_data",12,1,1),T=[_,f],k=[{name:"output_size",type:"u32"},{name:"batch_dims",type:"u32"},{name:"input_dims",type:"u32",length:o.length},{name:"sizes_from_slice_dims_data",type:"u32",length:t.length},{name:"num_slices_per_batch",type:"u32"},{name:"input_batch_stride",type:"u32"},{name:"num_slice_dims",type:"u32"}];return` - ${d.registerUniforms(k).declareVariables(...T)} - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let batch_idx = global_idx / uniforms.num_slices_per_batch; - let base_offset = batch_idx * uniforms.input_batch_stride; - - let slice_indices_base_offset = global_idx * uniforms.num_slice_dims; - var relative_slice_offset = 0; - for (var dim_idx = 0u; dim_idx < uniforms.num_slice_dims; dim_idx ++) { - var index = i32(indices_data[dim_idx + slice_indices_base_offset].x); - let input_dim_idx = uniforms.batch_dims + dim_idx; - if (index < 0) { - ${o.length===1?"index += i32(uniforms.input_dims);":"index += i32(uniforms.input_dims[input_dim_idx]);"} - } - ${t.length===1?"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data);":"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data[dim_idx]);"} - } - - input_slice_offsets_data[global_idx] = base_offset + u32(relative_slice_offset); - }`};return e.compute({name:"computeSliceOffsets",shaderCache:{hint:`${o.length}_${t.length}`,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:p,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:u}),getShaderSource:c},{inputs:[r],outputs:[-1]})[0]},ef=(e,r)=>{let t=e.inputs,s=t[0].dims,o=t[0].dataType,n=t[1].dims,i=n[n.length-1],a=Me.sizeToDimension(n,n.length-1),l=Me.sizeFromDimension(s,r.batchDims+i),u=Me.sizeToDimension(s,r.batchDims),p=Me.sizeFromDimension(s,r.batchDims),c=a/u,d=new Array(i),_=l;for(let E=0;Es.length)throw new Error("last dimension of indices must not be larger than rank of input tensor");let k=n.slice(0,-1).concat(s.slice(T)),g=Me.size(k),w=[{type:12,data:g},{type:12,data:l},...at(t[0].dims,f.dims,k)],S=E=>{let v=Pe("data",t[0].dataType,t[0].dims.length),M=Pe("slice_offsets",12,f.dims.length),y=et("output",t[0].dataType,k.length);return` - ${E.registerUniform("output_size","u32").registerUniform("slice_size","u32").declareVariables(v,M,y)} - ${E.mainStart()} - ${E.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let slice_offset = slice_offsets[global_idx / uniforms.slice_size]; - output[global_idx] = data[u32(slice_offset) + global_idx % uniforms.slice_size]; - }`};e.compute({name:"GatherND",shaderCache:{hint:r.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:k,dataType:o}],dispatchGroup:{x:Math.ceil(g/64)},programUniforms:w}),getShaderSource:S},{inputs:[t[0],f]})},tf=e=>({batchDims:e.batch_dims,cacheKey:""})}),rf,sf,nf,of,Yv=je(()=>{ft(),yt(),or(),Tt(),rf=(e,r)=>{if(e.length<3||e.length>4)throw new Error("GatherBlockQuantized requires 3 or 4 inputs.");let t=Me.normalizeAxis(r.quantizeAxis,e[0].dims.length),s=r.blockSize,o=e[0],n=e[2],i=e.length===4?e[3]:void 0;if(n.dims.length!==o.dims.length||!o.dims.map((a,l)=>l===t?Math.ceil(a/s)===n.dims[l]:a===n.dims[l]).reduce((a,l)=>a&&l,!0))throw new Error("Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.");if(i){if(i.dataType!==o.dataType)throw new Error("Zero point must have the same data type as the input tensor.");if(i.dims.length!==n.dims.length||!i.dims.map((a,l)=>a===n.dims[l]).reduce((a,l)=>a&&l,!0))throw new Error("Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.")}},sf=(e,r)=>{let t=e[0].dims,s=e[1].dims,o=t.length,n=Me.normalizeAxis(r.gatherAxis,o),i=Me.normalizeAxis(r.quantizeAxis,o),a=t.slice(0);a.splice(n,1,...s);let l=Me.size(a),u=e[2].dataType,p=e[0].dataType===22,c=[{type:12,data:l},{type:12,data:i},{type:12,data:n},{type:12,data:r.blockSize},...at(...e.map((_,f)=>_.dims),a)],d=_=>{let f=Pe("data",e[0].dataType,e[0].dims.length),T=Pe("inputIndices",e[1].dataType,e[1].dims.length),k=Pe("scales",e[2].dataType,e[2].dims.length),g=e.length>3?Pe("zeroPoint",e[3].dataType,e[3].dims.length):void 0,w=et("output",u,a.length),S=[f,T,k];g&&S.push(g);let E=[{name:"output_size",type:"u32"},{name:"quantize_axis",type:"u32"},{name:"gather_axis",type:"u32"},{name:"block_size",type:"u32"}];return` - ${_.registerUniforms(E).declareVariables(...S,w)} - ${_.mainStart()} - let output_indices = ${w.offsetToIndices("global_idx")}; - var indices_indices = ${T.type.indices}(0); - ${s.length>1?` - for (var i: u32 = 0; i < ${s.length}; i++) { - let index = ${w.indicesGet("output_indices","uniforms.gather_axis + i")}; - ${T.indicesSet("indices_indices","i","index")}; - }`:`indices_indices = ${w.indicesGet("output_indices","uniforms.gather_axis")};`}; - var data_indices = ${f.type.indices}(0); - for (var i: u32 = 0; i < uniforms.gather_axis; i++) { - let index = ${w.indicesGet("output_indices","i")}; - ${f.indicesSet("data_indices","i","index")}; - } - var index_from_indices = ${T.getByIndices("indices_indices")}; - if (index_from_indices < 0) { - index_from_indices += ${t[n]}; - } - ${f.indicesSet("data_indices","uniforms.gather_axis","u32(index_from_indices)")}; - for (var i = uniforms.gather_axis + 1; i < ${a.length}; i++) { - let index = ${w.indicesGet("output_indices",`i + ${s.length} - 1`)}; - ${f.indicesSet("data_indices","i","index")}; - } - let data_offset = ${f.indicesToOffset("data_indices")}; - let data_index = data_offset % 8; - // Convert 4-bit packed data to 8-bit packed data. - let packed_4bit_quantized_data = ${f.getByOffset("data_offset / 8")}; - let packed_8bit_quantized_data = (packed_4bit_quantized_data >> (4 * (data_index % 2))) & 0x0f0f0f0f; - let quantized_data_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_quantized_data)); - let quantized_data = quantized_data_vec[data_index / 2]; - var scale_indices = data_indices; - let quantize_axis_index = ${k.indicesGet("data_indices","uniforms.quantize_axis")} / uniforms.block_size; - ${k.indicesSet("scale_indices","uniforms.quantize_axis","quantize_axis_index")}; - var scale = ${k.getByIndices("scale_indices")}; - ${g?` - let zero_point_indices = scale_indices; - let zero_point_offset = ${g.indicesToOffset("zero_point_indices")}; - let zero_point_index = zero_point_offset % 8; - let packed_4bit_zero_points = ${g.getByOffset("zero_point_offset / 8")}; - let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f; - let zero_point_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_zero_points)); - let zero_point = zero_point_vec[zero_point_index / 2];`:"var zero_point = 0"}; - let dequantized_data = ${zr(u)}(quantized_data - zero_point) * scale; - ${w.setByOffset("global_idx","dequantized_data")}; - }`};return{name:"GatherBlockQuantized",shaderCache:{hint:`${r.cacheKey};${e.filter((_,f)=>f!==1).map(_=>_.dims.join("_")).join(";")}`,inputDependencies:Array.from({length:e.length},(_,f)=>"rank")},getRunData:()=>({outputs:[{dims:a,dataType:u}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:c}),getShaderSource:d}},nf=(e,r)=>{let t=e.inputs;rf(t,r),e.compute(sf(e.inputs,r))},of=e=>zt({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),af,lf,uf,cf,Zv=je(()=>{ft(),yt(),or(),Tt(),af=e=>{if(!e||e.length!==2)throw new Error("GatherElements requires 2 inputs.");if(e[0].dims.length<1)throw new Error("GatherElements requires that the data input be rank >= 1.");if(e[0].dims.length!==e[1].dims.length)throw new Error(`GatherElements requires that the data input and - indices input tensors be of same rank.`)},lf=(e,r)=>{let t=e[0].dims,s=e[0].dataType,o=t.length,n=e[1].dims,i=e[1].dataType,a=Me.normalizeAxis(r.axis,o),l=t[a],u=n.slice(0),p=Me.size(u),c=Pe("input",s,o),d=Pe("indicesInput",i,n.length),_=et("output",s,u.length),f=[{type:12,data:p},{type:6,data:l},{type:12,data:a}];return f.push(...at(t,n,u)),{name:"GatherElements",shaderCache:{inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:u,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:f}),getShaderSource:T=>` - ${T.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(c,d,_)} - ${T.mainStart()} - ${T.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - - let outputIndices = ${_.offsetToIndices("global_idx")}; - - var idx = ${d.getByOffset("global_idx")}; - if (idx < 0) { - idx = idx + uniforms.axisDimLimit; - } - var inputIndices = ${c.type.indices}(outputIndices); - ${c.indicesSet("inputIndices","uniforms.axis","u32(idx)")}; - let value = ${c.getByIndices("inputIndices")}; - - ${_.setByOffset("global_idx","value")}; - }`}},uf=e=>zt({axis:e.axis}),cf=(e,r)=>{let t=e.inputs;af(t),e.compute(lf(e.inputs,r))}}),df,pf,hf,mf,ex=je(()=>{ft(),yt(),Tt(),df=e=>{if(!e)throw new Error("Input is missing");if(e.length<2||e.length>3)throw new Error("Invaid input number.");if(e.length===3&&e[2].dims.length>2)throw new Error("Invalid input shape of C");if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("Input types are mismatched")},pf=(e,r)=>{let t=e[0].dims.slice(),s=e[1].dims.slice(),[o,n,i]=vd.getShapeOfGemmResult(t,r.transA,s,r.transB,e.length===3?e[2].dims:void 0),a=[o,n];if(!a)throw new Error("Can't use gemm on the given tensors");let l=16,u=Math.ceil(n/l),p=Math.ceil(o/l),c=!0,d=Me.size(a),_=[{type:12,data:c?u:d},{type:12,data:o},{type:12,data:n},{type:12,data:i},{type:1,data:r.alpha},{type:1,data:r.beta}],f=["type","type"];e.length===3&&(_.push(...at(e[2].dims)),f.push("rank")),_.push(...at(a));let T=g=>{let w="";r.transA&&r.transB?w="value += a[k * uniforms.M + m] * b[n * uniforms.K + k];":r.transA&&!r.transB?w="value += a[k * uniforms.M + m] * b[k * uniforms.N + n];":!r.transA&&r.transB?w="value += a[m * uniforms.K + k] * b[n * uniforms.K + k];":!r.transA&&!r.transB&&(w="value += a[m * uniforms.K + k] * b[k * uniforms.N + n];");let S=r.alpha===1?"":"value *= uniforms.alpha;",E=Pe("a",e[0].dataType,e[0].dims),v=Pe("b",e[1].dataType,e[1].dims),M=E.type.value,y=null,C=[E,v];e.length===3&&(y=Pe("c",e[2].dataType,e[2].dims.length),C.push(y));let F=et("output",e[0].dataType,a.length);C.push(F);let z=[{name:"output_size",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"},{name:"alpha",type:"f32"},{name:"beta",type:"f32"}];return` - ${g.registerUniforms(z).declareVariables(...C)} - - ${g.mainStart()} - ${g.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let m = global_idx / uniforms.N; - let n = global_idx % uniforms.N; - - var value = ${M}(0); - for (var k: u32 = 0u; k < uniforms.K; k++) { - ${w} - } - - ${S} - ${y!=null?`let cOffset = ${y.broadcastedIndicesToOffset("vec2(m, n)",F)}; value += ${M}(uniforms.beta) * ${y.getByOffset("cOffset")};`:""} - output[global_idx] = value; - }`},k=g=>{let w=Pe("a",e[0].dataType,e[0].dims),S=Pe("b",e[1].dataType,e[1].dims),E=null,v=[w,S];e.length===3&&(E=Pe("c",e[2].dataType,e[2].dims.length),v.push(E));let M=et("output",e[0].dataType,a.length);v.push(M);let y=[{name:"num_tile_n",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"},{name:"alpha",type:"f32"},{name:"beta",type:"f32"}],C="",F="";r.transA&&r.transB?(F=` - var col = tile_row_start + local_id.x; - var row = k_start + local_id.y; - if (col < uniforms.M && row < uniforms.K) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; - } else { - tile_a[local_id.y][local_id.x] = ${w.type.value}(0); - } - - col = k_start + local_id.x; - row = tile_col_start + local_id.y; - if (col < uniforms.K && row < uniforms.N) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; - } else { - tile_b[local_id.y][local_id.x] = ${S.type.value}(0); - } - `,C="value += tile_a[k][local_id.y] * tile_b[local_id.x][k];"):r.transA&&!r.transB?(F=` - var col = tile_row_start + local_id.x; - var row = k_start + local_id.y; - if (col < uniforms.M && row < uniforms.K) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; - } else { - tile_a[local_id.y][local_id.x] = ${w.type.value}(0); - } - - col = tile_col_start + local_id.x; - row = k_start + local_id.y; - if (col < uniforms.N && row < uniforms.K) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; - } else { - tile_b[local_id.y][local_id.x] = ${S.type.value}(0); - } - `,C="value += tile_a[k][local_id.y] * tile_b[k][local_id.x];"):!r.transA&&r.transB?(F=` - var col = k_start + local_id.x; - var row = tile_row_start + local_id.y; - if (col < uniforms.K && row < uniforms.M) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; - } else { - tile_a[local_id.y][local_id.x] = ${w.type.value}(0); - } - - col = k_start + local_id.x; - row = tile_col_start + local_id.y; - if (col < uniforms.K && row < uniforms.N) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; - } else { - tile_b[local_id.y][local_id.x] = ${S.type.value}(0); - } - `,C="value += tile_a[local_id.y][k] * tile_b[local_id.x][k];"):!r.transA&&!r.transB&&(F=` - var col = k_start + local_id.x; - var row = tile_row_start + local_id.y; - if (col < uniforms.K && row < uniforms.M) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; - } else { - tile_a[local_id.y][local_id.x] = ${w.type.value}(0); - } - - col = tile_col_start + local_id.x; - row = k_start + local_id.y; - if (col < uniforms.N && row < uniforms.K) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; - } else { - tile_b[local_id.y][local_id.x] = ${S.type.value}(0); - } - `,C="value += tile_a[local_id.y][k] * tile_b[k][local_id.x];");let z=r.alpha===1?"":"value *= uniforms.alpha;";return` - ${g.registerUniforms(y).declareVariables(...v)} - var tile_a: array, ${l}>; - var tile_b: array, ${l}>; - ${g.mainStart([l,l,1])} - let tile_col_start = (workgroup_index % uniforms.num_tile_n) * ${l}; - let tile_row_start = (workgroup_index / uniforms.num_tile_n) * ${l}; - let num_tiles = (uniforms.K - 1) / ${l} + 1; - var k_start = 0u; - var value = ${M.type.value}(0); - for (var t: u32 = 0u; t < num_tiles; t++) { - ${F} - k_start = k_start + ${l}; - workgroupBarrier(); - - for (var k: u32 = 0u; k < ${l}; k++) { - ${C} - } - workgroupBarrier(); - } - - ${z} - let m = tile_row_start + local_id.y; - let n = tile_col_start + local_id.x; - ${E!=null?`let cOffset = ${E.broadcastedIndicesToOffset("vec2(m, n)",M)}; value += ${M.type.value}(uniforms.beta) * ${E.getByOffset("cOffset")};`:""} - if (m < uniforms.M && n < uniforms.N) { - output[m * uniforms.N + n] = value; - } - }`};return c?{name:"GemmShared",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:u*p},programUniforms:_}),getShaderSource:k}:{name:"Gemm",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:_}),getShaderSource:T}},hf=e=>{let r=e.transA,t=e.transB,s=e.alpha,o=e.beta;return{transA:r,transB:t,alpha:s,beta:o,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},mf=(e,r)=>{df(e.inputs),e.compute(pf(e.inputs,r))}}),Ss,Rs,dn,pn,ff,_f,gf,wf,Mf,bf,yf,vf,xf,Tf,tx=je(()=>{ft(),yt(),or(),Tt(),[Ss,Rs,dn,pn]=[0,1,2,3],ff=e=>{if(e[0].dims.length!==4)throw new Error("only 4-D tensor is supported.");if(e[0].dims.length!==e[1].dims.length)throw new Error("input dimensions must be equal to grid dimensions");if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw new Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw new Error("grid batch size must match input batch size")},_f=` - fn gs_get_cubic_coeffs(x: f32) -> vec4 { - let cubic_alpha = -0.75f; - let x_abs = abs(x); - var coeffs: vec4; - coeffs[0] = (((cubic_alpha * (x_abs + 1) - 5 * cubic_alpha) * (x_abs + 1) + 8 * cubic_alpha) * (x_abs + 1) - 4 * cubic_alpha); - coeffs[1] = (((cubic_alpha + 2) * x_abs - (cubic_alpha + 3)) * x_abs * x_abs + 1); - coeffs[2] = (((cubic_alpha + 2) * (1 - x_abs) - (cubic_alpha + 3)) * (1 - x_abs) * (1 - x_abs) + 1); - coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha); - return coeffs; - } -`,gf=e=>` - fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} { - var v: vec4; - var coeffs = gs_get_cubic_coeffs(x); - for (var i = 0; i < 4; i++) { - v[i] = coeffs[0] * p[i][0] + coeffs[1] * p[i][1] + coeffs[2] * p[i][2] + coeffs[3] * p[i][3]; - } - coeffs = gs_get_cubic_coeffs(y); - let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]); - return pixel; - } -`,wf=e=>` - fn gs_denormalize(n: f32, length: i32) -> f32 { - ${e.alignCorners===0?` - // alignCorners: false => [-1, 1] to [-0.5, length - 0.5] - return ((n + 1.0) * f32(length) - 1.0) / 2.0; - `:` - // alignCorners: true => [-1, 1] to [0, length - 1] - return (n + 1.0) / 2.0 * (f32(length - 1)); - `} - } -`,Mf=e=>` - ${e.paddingMode==="reflection"?` - fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 { - var dx = 0.0; - var fx = f32(x); - let range = x_max - x_min; - if (fx < x_min) { - dx = x_min - fx; - let n = u32(dx / range); - let r = dx - f32(n) * range; - if (n % 2 == 0) { - fx = x_min + r; - } else { - fx = x_max - r; - } - } else if (fx > x_max) { - dx = fx - x_max; - let n = u32(dx / range); - let r = dx - f32(n) * range; - if (n % 2 == 0) { - fx = x_max - r; - } else { - fx = x_min + r; - } - } - return u32(fx); - }`:""} -`,bf=(e,r,t)=>` - fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4) -> ${r} { - var pixel = ${r}(0); - var indices = vec4(0); - indices[${Ss}] = batch; - indices[${Rs}] = channel;`+(()=>{switch(t.paddingMode){case"zeros":return` - if (r >= 0 && r < H && c >=0 && c < W) { - indices[${dn}] = u32(r); - indices[${pn}] = u32(c); - } else { - return ${r}(0); - } - `;case"border":return` - indices[${dn}] = u32(clamp(r, 0, H - 1)); - indices[${pn}] = u32(clamp(c, 0, W - 1)); - `;case"reflection":return` - indices[${dn}] = gs_reflect(r, border[1], border[3]); - indices[${pn}] = gs_reflect(c, border[0], border[2]); - `;default:throw new Error(`padding mode ${t.paddingMode} is not supported`)}})()+` - return ${e.getByIndices("indices")}; - } -`,yf=(e,r,t)=>(()=>{switch(t.mode){case"nearest":return` - let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${Ss}], indices[${Rs}], border); - `;case"bilinear":return` - let x1 = i32(floor(x)); - let y1 = i32(floor(y)); - let x2 = x1 + 1; - let y2 = y1 + 1; - - let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${Ss}], indices[${Rs}], border); - let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${Ss}], indices[${Rs}], border); - let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${Ss}], indices[${Rs}], border); - let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${Ss}], indices[${Rs}], border); - - let dx2 = ${r}(f32(x2) - x); - let dx1 = ${r}(x - f32(x1)); - let dy2 = ${r}(f32(y2) - y); - let dy1 = ${r}(y - f32(y1)); - let result = dy2 * (dx2 * p11 + dx1 * p12) + dy1 * (dx2 * p21 + dx1 * p22); - `;case"bicubic":return` - let x0 = i32(floor(x)) - 1; - let y0 = i32(floor(y)) - 1; - var p: mat4x4<${r}>; - for (var h = 0; h < 4; h++) { - for (var w = 0; w < 4; w++) { - p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${Ss}], indices[${Rs}], border); - } - } - - let dx = x - f32(x0 + 1); - let dy = y - f32(y0 + 1); - let result = gs_bicubic_interpolate(p, dx, dy); - `;default:throw new Error(`mode ${t.mode} is not supported`)}})()+`${e.setByOffset("global_idx","result")}`,vf=(e,r)=>{let t=Pe("x",e[0].dataType,e[0].dims.length),s=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],o=Pe("grid",e[1].dataType,s.length,2),n=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];r.format==="NHWC"&&(n=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[Ss,Rs,dn,pn]=[0,3,1,2]);let i=et("output",e[0].dataType,n.length),a=t.type.value,l=Me.size(n),u=[{type:12,data:l},...at(e[0].dims,s,n)],p=c=>` - ${c.registerUniform("output_size","u32").declareVariables(t,o,i)} - ${_f} - ${gf(a)} - ${wf(r)} - ${Mf(r)} - ${bf(t,a,r)} - - ${c.mainStart()} - ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let H_in = i32(uniforms.x_shape[${dn}]); - let W_in = i32(uniforms.x_shape[${pn}]); - - ${r.alignCorners===0?` - let x_min = -0.5; - let x_max = f32(W_in) - 0.5; - let y_min = -0.5; - let y_max = f32(H_in) - 0.5; - `:` - let x_min = 0.0; - let x_max = f32(W_in) - 1.0; - let y_min = 0.0; - let y_max = f32(H_in) - 1.0; - `}; - let border = vec4(x_min, y_min, x_max, y_max); - - let indices = ${i.offsetToIndices("global_idx")}; - var grid_indices = vec3(indices[${Ss}], indices[${dn}], indices[${pn}]); - let nxy = ${o.getByIndices("grid_indices")}; - var x = gs_denormalize(f32(nxy[0]), W_in); - var y = gs_denormalize(f32(nxy[1]), H_in); - - ${yf(i,a,r)} - }`;return{name:"GridSample",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:["type","type"]},getRunData:c=>{let d=Me.size(n);return{outputs:[{dims:n,dataType:c[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:u}},getShaderSource:p}},xf=(e,r)=>{ff(e.inputs),e.compute(vf(e.inputs,r))},Tf=e=>zt({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),Nr,Ef,Pf,Ol,Cf,Mo,Sf,$f=je(()=>{ft(),yt(),or(),el(),dl(),Tt(),Ws(),Nr=(e,r)=>e.length>r&&e[r].dims.length>0?e[r]:void 0,Ef=(e,r)=>{let t=e[0],s=Nr(e,1),o=Nr(e,2),n=Nr(e,3),i=Nr(e,4),a=Nr(e,5),l=Nr(e,6),u=Nr(e,7);if(t.dims.length!==3&&t.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let p=t.dims[0],c=t.dims[1],d=t.dims.length===3?t.dims[2]:r.numHeads*t.dims[4],_=c,f=0,T=0,k=Math.floor(d/r.numHeads);if(l&&u&&Me.size(l.dims)&&Me.size(u.dims)){if(l.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(l.dims[0]!==p||l.dims[1]!==r.numHeads||l.dims[3]!==k)throw new Error('Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)');if(u.dims[0]!==p||u.dims[1]!==r.numHeads||u.dims[3]!==k)throw new Error('Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)');if(l.dims[2]!==u.dims[2])throw new Error('Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)');if(u.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');f=l.dims[2],T=l.dims[2]}else if(l&&Me.size(l.dims)||u&&Me.size(u.dims))throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let g;if(s&&Me.size(s.dims)>0){if(t.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(s.dims.length<3||s.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(t.dims[0]!==s.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(s.dims.length===3){if(s.dims[2]!==t.dims[2])throw new Error('Input "query" and "key" shall have same dim 2 (hidden_size)');g=2,_=s.dims[1]}else if(s.dims.length===5){if(s.dims[2]!==r.numHeads||s.dims[3]!==2||s.dims[4]!==k)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(o)throw new Error('Expect "value" be none when "key" has packed kv format.');g=5,_=s.dims[1]}else{if(s.dims[1]!==r.numHeads||s.dims[3]!==k)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');g=0,_=s.dims[2]}}else{if(t.dims.length!==5)throw new Error('Input "query" is expected to have 5 dimensions when key is empty');if(t.dims[2]!==r.numHeads||t.dims[3]!==3)throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');g=3}if(n&&Me.size(n.dims)>0){if(n.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimension');if(s&&s.dims.length===5&&s.dims[3]===2)throw new Error("bias is not allowed for packed kv.")}let w=f+_,S=0;if(i&&Me.size(i.dims)>0){S=8;let y=i.dims;throw y.length===1?y[0]===p?S=1:y[0]===3*p+2&&(S=3):y.length===2&&y[0]===p&&y[1]===w&&(S=5),S===8?new Error('Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)'):new Error("Mask not supported")}let E=!1,v=d;if(o&&Me.size(o.dims)>0){if(o.dims.length!==3&&o.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(t.dims[0]!==o.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(o.dims.length===3){if(_!==o.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');v=o.dims[2]}else{if(_!==o.dims[2])throw new Error('Input "key" and "value" shall have the same dim 2 (kv_sequence_length)');v=o.dims[1]*o.dims[3],E=!0}}let M=!1;if(i&&Me.size(i.dims)>0)throw new Error("Key padding mask is not supported");if(a&&Me.size(a.dims)>0){if(a.dims.length!==4)throw new Error('Input "attention_bias" is expected to have 4 dimensions');if(a.dims[0]!==p||a.dims[1]!==r.numHeads||a.dims[2]!==c||a.dims[3]!==w)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:p,sequenceLength:c,pastSequenceLength:f,kvSequenceLength:_,totalSequenceLength:w,maxSequenceLength:T,inputHiddenSize:0,hiddenSize:d,vHiddenSize:v,headSize:k,vHeadSize:Math.floor(v/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:S,scale:r.scale,broadcastResPosBias:M,passPastInKv:E,qkvFormat:g}},Pf=e=>zt({...e}),Ol=zt({perm:[0,2,1,3]}),Cf=(e,r,t,s,o,n,i)=>{let a=[s,o,n],l=Me.size(a),u=[{type:12,data:l},{type:12,data:i},{type:12,data:n}],p=c=>{let d=et("qkv_with_bias",r.dataType,a),_=Pe("qkv",r.dataType,a),f=Pe("bias",t.dataType,a),T=[{name:"output_size",type:"u32"},{name:"bias_offset",type:"u32"},{name:"hidden_size",type:"u32"}];return` - ${c.registerUniforms(T).declareVariables(_,f,d)} - ${c.mainStart()} - ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset; - - qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx]; - }`};return e.compute({name:"MultiHeadAttentionAddBias",shaderCache:{inputDependencies:["type","type"]},getRunData:()=>({outputs:[{dims:a,dataType:r.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:p},{inputs:[r,t],outputs:[-1]})[0]},Mo=(e,r,t,s,o,n,i,a)=>{let l=n;if(i&&Me.size(i.dims)>0){if(s===1)throw new Error("AddBiasReshape is not implemented. Please export your model with packed QKV or KV");return l=Cf(e,n,i,r,s,t*o,a),l=l.reshape([r,s,t,o]),t===1||s===1?l:e.compute(qr(l,Ol.perm),{inputs:[l],outputs:[-1]})[0]}else return n.dims.length===3&&(l=n.reshape([r,s,t,o])),t===1||s===1?l:e.compute(qr(l,Ol.perm),{inputs:[l],outputs:[-1]})[0]},Sf=(e,r)=>{let t=Ef(e.inputs,r),s=e.inputs[0],o=Nr(e.inputs,1),n=Nr(e.inputs,2),i=Nr(e.inputs,3),a=Nr(e.inputs,4),l=Nr(e.inputs,5),u=Nr(e.inputs,6),p=Nr(e.inputs,7);if(s.dims.length===5)throw new Error("Packed QKV is not implemented");if((o==null?void 0:o.dims.length)===5)throw new Error("Packed KV is not implemented");let c=o&&n&&o.dims.length===4&&n.dims.length===4,d=Mo(e,t.batchSize,t.numHeads,t.sequenceLength,t.headSize,s,i,0);if(c)return mo(e,d,o,n,a,void 0,u,p,l,t);if(!o||!n)throw new Error("key and value must be provided");let _=Mo(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.headSize,o,i,t.hiddenSize),f=Mo(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.vHeadSize,n,i,2*t.hiddenSize);mo(e,d,_,f,a,void 0,u,p,l,t)}}),kf,If,Af,Ff,Dl,Of,Df,Lf=je(()=>{ft(),yt(),or(),Tt(),kf=e=>{if(!e||e.length<1)throw new Error("too few inputs")},If=(e,r)=>{let t=[],s=r.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(o=>t.push(Number(o))),s=t.length),zt({numOutputs:s,axis:r.axis,splitSizes:t})},Af=e=>` -fn calculateOutputIndex(index: u32) -> u32 { - for (var i: u32 = 0u; i < ${e}u; i += 1u ) { - if (index < ${st("uniforms.size_in_split_axis","i",e)}) { - return i; - } - } - return ${e}u; -}`,Ff=e=>{let r=e.length,t=[];for(let s=0;s{let t=e[0].dims,s=Me.size(t),o=e[0].dataType,n=Me.normalizeAxis(r.axis,t.length),i=new Array(r.numOutputs),a=Pe("input",o,t.length),l=new Array(r.numOutputs),u=[],p=[],c=0,d=[{type:12,data:s}];for(let f=0;f` - ${f.registerUniform("input_size","u32").registerUniform("size_in_split_axis","u32",l.length).declareVariables(a,...i)} - ${Af(l.length)} - ${Ff(i)} - - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.input_size")} - - var indices = ${a.offsetToIndices("global_idx")}; - var index = ${a.indicesGet("indices",n)}; - let output_number = calculateOutputIndex(index); - if (output_number != 0) { - index -= ${st("uniforms.size_in_split_axis","output_number - 1u",l.length)}; - ${a.indicesSet("indices",n,"index")}; - } - writeBufferData(output_number, indices, global_idx); - }`;return{name:"Split",shaderCache:{hint:r.cacheKey,inputDependencies:["rank"]},getShaderSource:_,getRunData:()=>({outputs:u,dispatchGroup:{x:Math.ceil(s/64)},programUniforms:d})}},Of=(e,r)=>{kf(e.inputs);let t=e.inputs.length===1?r:If(e.inputs,r);e.compute(Dl(e.inputs,t),{inputs:[0]})},Df=e=>{let r=e.axis,t=e.splitSizes,s=e.numOutputs<0?t.length:e.numOutputs;if(s!==t.length)throw new Error("numOutputs and splitSizes lengh must be equal");return zt({axis:r,numOutputs:s,splitSizes:t})}}),zf,Mi,Bf,Rf=je(()=>{ft(),yt(),or(),Tt(),zf=(e,r)=>{let[t,s,o,n]=e,{numHeads:i,rotaryEmbeddingDim:a}=r;if(t.dims.length!==3&&t.dims.length!==4)throw new Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${t.dims.length}`);if(!Me.areEqual(s.dims,[])&&!Me.areEqual(s.dims,[1])&&s.dims.length!==2)throw new Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${s.dims.length}`);if(o.dims.length!==2)throw new Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${o.dims.length}`);if(n.dims.length!==2)throw new Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${n.dims.length}`);if(!Me.areEqual(o.dims,n.dims))throw new Error("Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape");if(a>0&&i===0)throw new Error("num_heads must be provided if rotary_embedding_dim is specified");let l=t.dims[0],u=t.dims[t.dims.length-2],p=o.dims[0],c=Me.sizeFromDimension(t.dims,1)/u,d=a===0?o.dims[1]*2:c/i;if(a>d)throw new Error("rotary_embedding_dim must be less than or equal to head_size");if(s.dims.length===2){if(l!==s.dims[0])throw new Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${s.dims[0]}`);if(u!==s.dims[1])throw new Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${s.dims[1]}`)}if(d/2!==o.dims[1]&&a/2!==o.dims[1])throw new Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${o.dims[1]}`);if(u>p)throw new Error("Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported")},Mi=(e,r)=>{let{interleaved:t,numHeads:s,rotaryEmbeddingDim:o,scale:n}=r,i=e[0].dims[0],a=Me.sizeFromDimension(e[0].dims,1),l=e[0].dims[e[0].dims.length-2],u=a/l,p=e[2].dims[1],c=o===0?p*2:u/s,d=new Array(i,l,u/c,c-p),_=Me.computeStrides(d),f=[{type:1,data:n},{type:12,data:d},{type:12,data:_},...e[0].dims.length===3?new Array({type:12,data:[a,u,c,1]}):[],...e[0].dims.length===4?new Array({type:12,data:[a,c,l*c,1]}):[],...at(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],T=k=>{let g=Pe("input",e[0].dataType,e[0].dims.length),w=Pe("position_ids",e[1].dataType,e[1].dims.length),S=Pe("cos_cache",e[2].dataType,e[2].dims.length),E=Pe("sin_cache",e[3].dataType,e[3].dims.length),v=et("output",e[0].dataType,e[0].dims.length);return k.registerUniforms([{name:"scale",type:"f32"},{name:"global_shape",type:"u32",length:d.length},{name:"global_strides",type:"u32",length:_.length},{name:"input_output_strides",type:"u32",length:_.length}]),` - ${k.declareVariables(g,w,S,E,v)} - - ${k.mainStart(Vn)} - let half_rotary_emb_dim = uniforms.${S.name}_shape[1]; - let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape; - let size = uniforms.global_shape[0] * uniforms.global_strides[0]; - ${k.guardAgainstOutOfBoundsWorkgroupSizes("size")} - - if (bsnh[3] < half_rotary_emb_dim) { - let position_ids_idx = - ${w.broadcastedIndicesToOffset("bsnh.xy",et("",w.type.tensor,2))}; - let position_id = - u32(${w.getByOffset("position_ids_idx")}) + select(0, bsnh[1], position_ids_idx == 0); - let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${t}); - let j = i + select(half_rotary_emb_dim, 1, ${t}); - let re = ${g.getByOffset("i")} * ${S.get("position_id","bsnh[3]")} - - ${g.getByOffset("j")} * ${E.get("position_id","bsnh[3]")}; - ${v.setByOffset("i","re")} - let im = ${g.getByOffset("i")} * ${E.get("position_id","bsnh[3]")} + - ${g.getByOffset("j")} * ${S.get("position_id","bsnh[3]")}; - ${v.setByOffset("j","im")} - } else { - let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim; - ${v.setByOffset("k",g.getByOffset("k"))} - } - }`};return{name:"RotaryEmbedding",shaderCache:{hint:zt({interleaved:t}).cacheKey,inputDependencies:["rank","rank","rank","rank"]},getShaderSource:T,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Me.size(d)/Vn)},programUniforms:f})}},Bf=(e,r)=>{zf(e.inputs,r),e.compute(Mi(e.inputs,r))}}),jf,Nf,Ll,Vf,Uf,rx=je(()=>{or(),ft(),dl(),$f(),Lf(),Ws(),Rf(),Tt(),jf=(e,r)=>{if(r.doRotary&&e.length<=7)throw new Error("cos_cache and sin_cache inputs are required if do_rotary is specified");let t=e[0],s=e[1],o=e[2],n=e[3],i=e[4];if(r.doRotary!==0&&e.length<=7)throw new Error("cos_cast and sin_cache are expected if do_rotary attribute is non-zero");if(r.localWindowSize!==-1)throw new Error("Local attention is not supported");if(r.softcap!==0)throw new Error("Softcap is not supported");if(r.rotaryInterleaved!==0)throw new Error("Rotary interleaved is not supported");if(r.smoothSoftmax)throw new Error("Smooth softmax is not supported");if(t.dims.length!==3&&t.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let a=!1,l=t.dims[0],u=t.dims[1],p=t.dims.length===3?a?t.dims[2]/3:t.dims[2]:r.numHeads*t.dims[4],c=u,d=0,_=!s||s.dims.length===0,f=Math.floor(_?p/(r.numHeads+2*r.kvNumHeads):p/r.numHeads);_&&(p=f*r.numHeads);let T=n&&n.dims.length!==0,k=i&&i.dims.length!==0;if(T&&n.dims.length===4&&n.dims[0]===l&&n.dims[1]!==r.kvNumHeads&&n.dims[2]===r.kvNumHeads&&n.dims[3]===f)throw new Error("BSNH pastKey/pastValue is not supported");if(T&&k){if(n.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(i.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');d=n.dims[2]}else if(T||k)throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let g=1;if(s&&s.dims.length>0){if(t.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(s.dims.length<3||s.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(t.dims[0]!==s.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(s.dims.length===3){if(t.dims[2]%s.dims[2]!==0)throw new Error('Dimension 2 of "query" should be a multiple of "key"');c=s.dims[1]}else if(s.dims.length===5){if(s.dims[2]!==r.numHeads||s.dims[3]!==2||s.dims[4]!==f)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(o)throw new Error('Expect "value" be none when "key" has packed kv format.');c=s.dims[1]}else{if(s.dims[1]!==r.numHeads||s.dims[3]!==f)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');c=s.dims[2]}}else{if(t.dims.length!==3&&t.dims.length!==5)throw new Error('Input "query" is expected to have 3 or 5 dimensions when key is empty');if(t.dims.length===5&&(t.dims[2]!==r.numHeads||t.dims[3]!==3))throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');g=3}let w=0,S=!1,E=r.kvNumHeads?f*r.kvNumHeads:p;if(o&&o.dims.length>0){if(o.dims.length!==3&&o.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(t.dims[0]!==o.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(o.dims.length===3){if(c!==o.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');E=o.dims[2]}else{if(c!==o.dims[2])throw new Error('Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)');E=o.dims[1]*o.dims[3],S=!0}}let v=e.length>4?e[5]:void 0;if(v&&v.dims.length!==1&&v.dims[0]!==l)throw new Error('Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size');return{batchSize:l,sequenceLength:u,pastSequenceLength:d,kvSequenceLength:c,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:p,vHiddenSize:E,headSize:f,vHeadSize:Math.floor(E/r.kvNumHeads),numHeads:r.numHeads,kvNumHeads:r.kvNumHeads,nReps:r.numHeads/r.kvNumHeads,pastPresentShareBuffer:!1,maskType:w,scale:r.scale,broadcastResPosBias:!1,passPastInKv:S,qkvFormat:g}},Nf=zt({perm:[0,2,1,3]}),Ll=(e,r,t)=>{let s=r,o=t.kvNumHeads;return r.dims.length===3&&t.kvSequenceLength!==0&&(s=r.reshape([t.batchSize,t.kvSequenceLength,o,t.headSize]),s=e.compute(qr(s,Nf.perm),{inputs:[s],outputs:[-1]})[0]),s},Vf=(e,r,t,s)=>{let o=7,n=["type","type"],i=[e*r],a=e*r,l=[{type:12,data:a},{type:12,data:r},{type:12,data:e}],u=p=>{let c=Pe("seq_lens",t.dataType,t.dims),d=Pe("total_seq_lens",s.dataType,s.dims),_=et("pos_ids",o,i),f=[{name:"output_size",type:"u32"},{name:"sequence_length",type:"u32"},{name:"batch_size",type:"u32"}];return` - ${p.registerUniforms(f).declareVariables(c,d,_)} - ${p.mainStart()} - ${p.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let total_sequence_length = u32(${d.getByOffset("0")}); - let is_subsequent_prompt = uniforms.sequence_length > 1 && uniforms.sequence_length != total_sequence_length; - let is_first_prompt = !is_subsequent_prompt && uniforms.sequence_length == total_sequence_length; - let batch_idx = global_idx / uniforms.sequence_length; - let sequence_idx = i32(global_idx % uniforms.sequence_length); - var pos_id: i32 = 0; - let seqlen = ${c.getByOffset("batch_idx")}; - let total_seqlen = seqlen + 1; - if (is_first_prompt) { - if (sequence_idx < total_seqlen) { - pos_id = sequence_idx; - } else { - pos_id = 1; - } - ${_.setByOffset("global_idx","pos_id")} - } else if (is_subsequent_prompt) { - let past_seqlen = total_seqlen - i32(uniforms.sequence_length); - if (past_seqlen + sequence_idx < total_seqlen) { - pos_id = past_seqlen + sequence_idx; - } else { - pos_id = 1; - } - ${_.setByOffset("global_idx","pos_id")} - } else if (global_idx < uniforms.batch_size) { - ${_.setByOffset("global_idx","seqlen")} - }; - } - `};return{name:"GeneratePositionIds",shaderCache:{hint:`${e};${r}`,inputDependencies:n},getRunData:()=>({outputs:[{dims:i,dataType:o}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:u}},Uf=(e,r)=>{var E;let t=jf(e.inputs,r);if(e.inputs[0].dims.length===5)throw new Error("Packed QKV is not implemented");if(((E=e.inputs[1])==null?void 0:E.dims.length)===5)throw new Error("Packed KV is not implemented");let s=e.inputs[0],o=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,n=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,i=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,a=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,l=e.inputs.length>4?e.inputs[5]:void 0,u=e.inputs.length>5?e.inputs[6]:void 0,p=t.kvNumHeads?t.kvNumHeads:t.numHeads,c=zt({axis:2,numOutputs:3,splitSizes:[t.numHeads*t.headSize,p*t.headSize,p*t.headSize]}),[d,_,f]=!o&&!n?e.compute(Dl([s],c),{inputs:[s],outputs:[-1,-1,-1]}):[s,o,n],T,k;if(r.doRotary){let v=e.compute(Vf(t.batchSize,t.sequenceLength,l,u),{inputs:[l,u],outputs:[-1]})[0],M=e.inputs[7],y=e.inputs[8],C=zt({interleaved:r.rotaryInterleaved!==0,numHeads:t.numHeads,rotaryEmbeddingDim:0,scale:r.scale}),F=[d,v,M,y],z=[-1];T=e.compute(Mi(F,C),{inputs:F,outputs:z})[0],F.splice(0,1,_);let K=zt({interleaved:r.rotaryInterleaved!==0,numHeads:t.kvNumHeads,rotaryEmbeddingDim:0,scale:r.scale});k=e.compute(Mi(F,K),{inputs:F,outputs:z})[0]}let g=Mo(e,t.batchSize,t.numHeads,t.sequenceLength,t.headSize,r.doRotary?T:d,void 0,0),w=Ll(e,r.doRotary?k:_,t),S=Ll(e,f,t);mo(e,g,w,S,void 0,void 0,i,a,void 0,t,l,u)}}),zl,Wf,Gf,Kf,sx=je(()=>{ft(),yt(),Ws(),Tt(),zl=(e,r,t,s,o,n,i,a)=>{let l=sr(n),u=l===1?"f32":`vec${l}f`,p=l===1?"vec2f":`mat2x${l}f`,c=o*i,d=64;c===1&&(d=256);let _=[o,i,n/l],f=[o,i,2],T=["rank","type","type"],k=[];k.push(...at(_,f));let g=w=>{let S=Pe("x",r.dataType,3,l),E=Pe("scale",t.dataType,t.dims),v=Pe("bias",s.dataType,s.dims),M=et("output",1,3,2),y=[S,E,v,M];return` - var workgroup_shared : array<${p}, ${d}>; - const workgroup_size = ${d}u; - ${w.declareVariables(...y)} - ${w.mainStart(d)} - let batch = workgroup_index / uniforms.x_shape[1]; - let channel = workgroup_index % uniforms.x_shape[1]; - let hight = uniforms.x_shape[2]; - // initialize workgroup memory - var sum = ${u}(0); - var squared_sum = ${u}(0); - for (var h = local_idx; h < hight; h += workgroup_size) { - let value = ${u}(${S.get("batch","channel","h")}); - sum += value; - squared_sum += value * value; - } - workgroup_shared[local_idx] = ${p}(sum, squared_sum); - workgroupBarrier(); - - for (var currSize = workgroup_size >> 1; currSize > 0; currSize = currSize >> 1) { - if (local_idx < currSize) { - workgroup_shared[local_idx] = workgroup_shared[local_idx] + workgroup_shared[local_idx + currSize]; - } - workgroupBarrier(); - } - if (local_idx == 0) { - let sum_final = ${Us("workgroup_shared[0][0]",l)} / f32(hight * ${l}); - let squared_sum_final = ${Us("workgroup_shared[0][1]",l)} / f32(hight * ${l}); - - let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${a})); - let channel_scale = inv_std_dev * f32(scale[channel]); - let channel_shift = f32(bias[channel]) - sum_final * channel_scale; - output[workgroup_index] = vec2f(channel_scale, channel_shift); - } - }`};return e.compute({name:"InstanceNormComputeChannelScaleShift",shaderCache:{hint:`${l};${a};${d}`,inputDependencies:T},getRunData:()=>({outputs:[{dims:f,dataType:1}],dispatchGroup:{x:c},programUniforms:k}),getShaderSource:g},{inputs:[r,t,s],outputs:[-1]})[0]},Wf=(e,r,t)=>{let s=r[0].dims,o=s,n=2,i=s[0],a=s[1],l=Me.sizeFromDimension(s,n),u=sr(l),p=Me.size(o)/u,c=zl(e,r[0],r[1],r[2],i,l,a,t.epsilon),d=[i,a,l/u],_=[i,a],f=["type","none"],T=k=>{let g=Pe("x",r[0].dataType,d.length,u),w=Pe("scale_shift",1,_.length,2),S=et("output",r[0].dataType,d.length,u),E=[g,w,S];return` - ${k.registerUniform("output_size","u32").declareVariables(...E)} - ${k.mainStart()} - ${k.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let outputIndices = ${S.offsetToIndices("global_idx")}; - let batch = outputIndices[0]; - let channel = outputIndices[1]; - let scale_shift = ${w.getByIndices("vec2(batch, channel)")}; - let value = ${g.getByOffset("global_idx")} * ${S.type.value}(scale_shift.x) + ${S.type.value}(scale_shift.y); - ${S.setByOffset("global_idx","value")}; - }`};e.compute({name:"InstanceNormalization",shaderCache:{hint:`${u}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:o,dataType:r[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:[{type:12,data:p},...at(d,_,d)]}),getShaderSource:T},{inputs:[r[0],c]})},Gf=(e,r,t)=>{let s=r[0].dims,o=s,n=s[0],i=s[s.length-1],a=Me.sizeFromDimension(s,1)/i,l=sr(i),u=Me.size(o)/l,p=[{type:12,data:a},{type:12,data:Math.floor(i/l)}],c=["type","type"],d=!1,_=[0,s.length-1];for(let g=0;gs[_[w]])),T=zl(e,f,r[1],r[2],n,a,i,t.epsilon),k=g=>{let w=Tr(r[0].dataType),S=l===1?"vec2f":`mat${l}x2f`,E=y=>{let C=y===0?"x":"y",F=l===1?"f32":`vec${l}f`;switch(l){case 1:return`${w}(${F}(scale.${C}))`;case 2:return`vec2<${w}>(${F}(scale[0].${C}, scale[1].${C}))`;case 4:return`vec4<${w}>(${F}(scale[0].${C}, scale[1].${C}, scale[2].${C}, scale[3].${C}))`;default:throw new Error(`Not supported compoents ${l}`)}},v=Pe("input",r[0].dataType,r[0].dims,l),M=et("output",r[0].dataType,o,l);return` - @group(0) @binding(0) var input : array<${v.type.storage}>; - @group(0) @binding(1) var scale_input : array<${S}>; - @group(0) @binding(2) var output : array<${M.type.storage}>; - struct Uniforms {H: u32, C : u32}; - @group(0) @binding(3) var uniforms: Uniforms; - - ${g.mainStart()} - let current_image_number = global_idx / (uniforms.C * uniforms.H); - let current_channel_number = global_idx % uniforms.C; - - let scale_offset = current_image_number * uniforms.C + current_channel_number; - let scale = scale_input[scale_offset]; - output[global_idx] = fma(input[global_idx], ${E(0)}, ${E(1)}); - }`};e.compute({name:"InstanceNormalizationNHWC",shaderCache:{hint:`${l}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:o,dataType:r[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:p}),getShaderSource:k},{inputs:[r[0],T]})},Kf=(e,r)=>{r.format==="NHWC"?Gf(e,e.inputs,r):Wf(e,e.inputs,r)}}),Hf,qf,Qf,nx=je(()=>{ft(),yt(),Tt(),Hf=e=>{if(!e||e.length<2)throw new Error("layerNorm requires at least 2 inputs.")},qf=(e,r,t)=>{let s=r.simplified,o=e[0].dims,n=e[1],i=!s&&e[2],a=o,l=Me.normalizeAxis(r.axis,o.length),u=Me.sizeToDimension(o,l),p=Me.sizeFromDimension(o,l),c=Me.size(n.dims),d=i?Me.size(i.dims):0;if(c!==p||i&&d!==p)throw new Error(`Size of X.shape()[axis:] == ${p}. - Size of scale and bias (if provided) must match this. - Got scale size of ${c} and bias size of ${d}`);let _=[];for(let v=0;v1,w=t>2,S=v=>{let M=Tr(e[0].dataType),y=[Pe("x",e[0].dataType,e[0].dims,f),Pe("scale",n.dataType,n.dims,f)];i&&y.push(Pe("bias",i.dataType,i.dims,f)),y.push(et("output",e[0].dataType,a,f)),g&&y.push(et("mean_data_output",1,_)),w&&y.push(et("inv_std_output",1,_));let C=[{name:"norm_count",type:"u32"},{name:"norm_size",type:"f32"},{name:"norm_size_vectorized",type:"u32"},{name:"epsilon",type:"f32"}];return` - ${v.registerUniforms(C).declareVariables(...y)} - ${v.mainStart()} - ${v.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.norm_count")} - let offset = global_idx * uniforms.norm_size_vectorized; - var mean_vector = ${nl("f32",f)}; - var mean_square_vector = ${nl("f32",f)}; - - for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) { - let value = ${Un(M,f,"x[h + offset]")}; - mean_vector += value; - mean_square_vector += value * value; - } - let mean = ${Us("mean_vector",f)} / uniforms.norm_size; - let inv_std_dev = inverseSqrt(${Us("mean_square_vector",f)} / uniforms.norm_size ${s?"":"- mean * mean"} + uniforms.epsilon); - - for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) { - let f32input = ${Un(M,f,"x[j + offset]")}; - let f32scale = ${Un(M,f,"scale[j]")}; - output[j + offset] = ${y[0].type.value}((f32input ${s?"":"- mean"}) * inv_std_dev * f32scale - ${i?`+ ${Un(M,f,"bias[j]")}`:""} - ); - } - - ${g?"mean_data_output[global_idx] = mean":""}; - ${w?"inv_std_output[global_idx] = inv_std_dev":""}; - }`},E=[{dims:a,dataType:e[0].dataType}];return g&&E.push({dims:_,dataType:1}),w&&E.push({dims:_,dataType:1}),{name:"LayerNormalization",shaderCache:{hint:`${f};${t};${s}`,inputDependencies:T},getRunData:()=>({outputs:E,dispatchGroup:{x:Math.ceil(u/64)},programUniforms:k}),getShaderSource:S}},Qf=(e,r)=>{Hf(e.inputs),e.compute(qf(e.inputs,r,e.outputCount))}}),Xf,Jf,ox=je(()=>{yt(),Ml(),xl(),Xf=e=>{if(!e||e.length!==2)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.")},Jf=e=>{Xf(e.inputs);let r=Nn.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!r)throw new Error("Can't use matmul on the given tensors");let t=r[r.length-1],s=e.inputs[0].dims[e.inputs[0].dims.length-1];if(t<8&&s<8)e.compute(wl(e.inputs,{activation:""},r));else{let o=r[r.length-2],n=Me.size(e.inputs[0].dims.slice(0,-2)),i=Me.size(e.inputs[1].dims.slice(0,-2));if(n!==1&&o===1&&i===1){let a=e.inputs[0].reshape([1,n,s]),l=e.inputs[1].reshape([1,s,t]),u=[1,n,t],p=[a,l];e.compute(fi(p,{activation:""},r,u),{inputs:p})}else e.compute(fi(e.inputs,{activation:""},r))}}}),Yf,Zf,e_,t_,r_,ix=je(()=>{ft(),yt(),or(),Tt(),Yf=(e,r)=>{if(e.length<3||e.length>4)throw new Error("MatMulNBits requires 3 or 4 inputs");let t=e[0],s=t.dims.length;if(t.dims[s-1]!==r.k)throw new Error("The last dim of input shape does not match the k value");let o=Math.floor((r.k+r.blockSize-1)/r.blockSize),n=r.blockSize/8*r.bits,i=e[1];if(!Me.areEqual(i.dims,[r.n,o,n]))throw new Error("The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize");let a=e[2].dims;if(Me.size(a)!==r.n*o)throw new Error("scales input size error.");if(e.length===4){let l=e[3].dims,u=r.bits>4?r.n*o:r.n*Math.floor((o+1)/2);if(Me.size(l)!==u)throw new Error("zeroPoints input size error.")}},Zf=(e,r)=>{let t=e[0].dims,s=t.length,o=t[s-2],n=r.k,i=r.n,a=t.slice(0,s-2),l=Me.size(a),u=e[1].dims[2]/4,p=e[0].dataType,c=sr(r.k),d=sr(u),_=sr(i),f=a.concat([o,i]),T=o>1&&i/_%2===0?2:1,k=Me.size(f)/_/T,g=64,w=[],S=[l,o,n/c],E=Me.convertShape(e[1].dims).slice();E.splice(-1,1,u/d),w.push(...at(S)),w.push(...at(E)),w.push(...at(e[2].dims)),e.length===4&&w.push(...at(Me.convertShape(e[3].dims)));let v=[l,o,i/_];w.push(...at(v));let M=y=>{let C=S.length,F=Pe("a",e[0].dataType,C,c),z=Pe("b",12,E.length,d),K=Pe("scales",e[2].dataType,e[2].dims.length),q=[F,z,K],R=e.length===4?Pe("zero_points",12,e[3].dims.length):void 0;R&&q.push(R);let Z=v.length,H=et("output",e[0].dataType,Z,_),J=Tr(e[0].dataType),Q=(()=>{switch(c){case 1:return`array<${J}, 8>`;case 2:return`mat4x2<${J}>`;case 4:return`mat2x4<${J}>`;default:throw new Error(`${c}-component is not supported.`)}})(),se=()=>{let V=` - // reuse a data - var input_offset = ${F.indicesToOffset(`${F.type.indices}(batch, row, word_offset)`)}; - var a_data: ${Q}; - for (var j: u32 = 0; j < ${8/c}; j++) { - a_data[j] = ${F.getByOffset("input_offset")}; - input_offset++; - } - `;for(let A=0;A<_*T;A++)V+=` - b_value = ${d===1?`b${A}_data`:`b${A}_data[i]`}; - b_value_lower = unpack4xU8(b_value & b_mask); - b_value_upper = unpack4xU8((b_value >> 4) & b_mask); - b_quantized_values = ${Q}(${Array.from({length:4},(U,ee)=>`${J}(b_value_lower[${ee}]), ${J}(b_value_upper[${ee}])`).join(", ")}); - b_dequantized_values = ${c===1?`${Q}(${Array.from({length:8},(U,ee)=>`(b_quantized_values[${ee}] - ${R?`zero_point${A}`:"zero_point"}) * scale${A}`).join(", ")});`:`(b_quantized_values - ${Q}(${Array(8).fill(`${R?`zero_point${A}`:"zero_point"}`).join(",")})) * scale${A};`}; - workgroup_shared[local_id.x * ${T} + ${Math.floor(A/_)}]${_>1?`[${A%_}]`:""} += ${Array.from({length:8/c},(U,ee)=>`${c===1?`a_data[${ee}] * b_dequantized_values[${ee}]`:`dot(a_data[${ee}], b_dequantized_values[${ee}])`}`).join(" + ")}; - `;return V},fe=()=>{let V=` - var col_index = col * ${_}; - ${R?` - let zero_point_bytes_per_col = (nBlocksPerCol + 1) / 2; - var zero_point_byte_count: u32; - var zero_point_word_index: u32; - var zero_point_byte_offset: u32; - let zero_point_nibble_offset: u32 = block & 0x1u; - var zero_point_bits_offset: u32; - var zero_point_word: u32;`:` - // The default zero point is 8 for unsigned 4-bit quantization. - let zero_point = ${J}(8);`} - `;for(let A=0;A<_*T;A++)V+=` - let scale${A} = ${K.getByOffset("col_index * nBlocksPerCol + block")}; - ${R?` - zero_point_byte_count = col_index * zero_point_bytes_per_col + (block >> 0x1u); - zero_point_word_index = zero_point_byte_count >> 0x2u; - zero_point_byte_offset = zero_point_byte_count & 0x3u; - zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); - zero_point_word = ${R.getByOffset("zero_point_word_index")} >> zero_point_bits_offset; - let zero_point${A} = ${J}((zero_point_word) & 0xFu);`:""} - col_index += 1;`;return V},ae=()=>{let V=`col_index = col * ${_};`;for(let A=0;A<_*T;A++)V+=` - let b${A}_data = ${z.getByIndices(`${z.type.indices}(col_index, block, word)`)}; - col_index += 1;`;return V+=` - var b_value: u32; - let b_mask: u32 = 0x0F0F0F0Fu; - var b_value_lower: vec4; - var b_value_upper: vec4; - var b_quantized_values: ${Q}; - var b_dequantized_values: ${Q};`,V};return` - var workgroup_shared: array<${H.type.value}, ${T*g}>; - ${y.declareVariables(...q,H)} - ${y.mainStart([g,1,1])} - let output_indices = ${H.offsetToIndices(`(global_idx / ${g}) * ${T}`)}; - let col = output_indices[2]; - let row = output_indices[1]; - let batch = output_indices[0]; - let nBlocksPerCol = uniforms.b_shape[1]; - - for (var block = local_id.x; block < nBlocksPerCol; block += ${g}) { - //process one block - var word_offset: u32 = block * ${r.blockSize/c}; - ${fe()} - for (var word: u32 = 0; word < ${u}; word += ${d}) { - ${ae()} - for (var i: u32 = 0; i < ${d}; i++) { - ${se()} - word_offset += ${8/c}; - } - } - } - workgroupBarrier(); - - if (local_id.x < ${T}) { - var output_value: ${H.type.value} = ${H.type.value}(0); - var workgroup_shared_offset: u32 = local_id.x; - for (var b: u32 = 0u; b < ${g}u; b++) { - output_value += workgroup_shared[workgroup_shared_offset]; - workgroup_shared_offset += ${T}; - } - ${H.setByIndices(`${H.type.indices}(batch, row, col + local_id.x)`,"output_value")}; - } - }`};return{name:"MatMulNBits",shaderCache:{hint:`${r.blockSize};${r.bits};${c};${d};${_};${T};${g}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:f,dataType:p}],dispatchGroup:{x:k},programUniforms:w}),getShaderSource:M}},e_=(e,r)=>{let t=e[0].dims,s=t.length,o=t[s-2],n=r.k,i=r.n,a=t.slice(0,s-2),l=Me.size(a),u=e[1].dims[2]/4,p=e[0].dataType,c=sr(r.k),d=sr(u),_=a.concat([o,i]),f=128,T=i%8===0?8:i%4===0?4:1,k=f/T,g=k*d*8,w=g/c,S=g/r.blockSize,E=Me.size(_)/T,v=[],M=[l,o,n/c],y=Me.convertShape(e[1].dims).slice();y.splice(-1,1,u/d),v.push(...at(M)),v.push(...at(y)),v.push(...at(e[2].dims)),e.length===4&&v.push(...at(Me.convertShape(e[3].dims)));let C=[l,o,i];v.push(...at(C));let F=z=>{let K=M.length,q=Pe("a",e[0].dataType,K,c),R=Pe("b",12,y.length,d),Z=Pe("scales",e[2].dataType,e[2].dims.length),H=[q,R,Z],J=e.length===4?Pe("zero_points",12,e[3].dims.length):void 0;J&&H.push(J);let Q=C.length,se=et("output",e[0].dataType,Q),fe=Tr(e[0].dataType),ae=()=>{switch(c){case 1:return` - let a_data0 = vec4<${fe}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]); - let a_data1 = vec4<${fe}>(sub_a[word_offset + 4], sub_a[word_offset + 5], sub_a[word_offset + 6], sub_a[word_offset + 7]);`;case 2:return` - let a_data0 = vec4<${fe}>(sub_a[word_offset], sub_a[word_offset + 1]); - let a_data1 = vec4<${fe}>(sub_a[word_offset + 2], sub_a[word_offset + 3]);`;case 4:return` - let a_data0 = sub_a[word_offset]; - let a_data1 = sub_a[word_offset + 1];`;default:throw new Error(`${c}-component is not supported.`)}};return` - var sub_a: array<${q.type.value}, ${w}>; - var inter_results: array, ${T}>; - ${z.declareVariables(...H,se)} - ${z.mainStart([k,T,1])} - let output_indices = ${se.offsetToIndices(`workgroup_index * ${T}`)}; - let col = output_indices[2]; - let row = output_indices[1]; - let batch = output_indices[0]; - let n_blocks_per_col = uniforms.b_shape[1]; - let num_tiles = (n_blocks_per_col - 1) / ${S} + 1; - - // Loop over shared dimension. - for (var tile: u32 = 0; tile < num_tiles; tile += 1) { - let a_col_start = tile * ${w}; - // load one tile A data into shared memory. - for (var a_offset = local_idx; a_offset < ${w}; a_offset += ${f}) - { - let a_col = a_col_start + a_offset; - if (a_col < uniforms.a_shape[2]) - { - sub_a[a_offset] = ${q.getByIndices(`${q.type.indices}(batch, row, a_col)`)}; - } else { - sub_a[a_offset] = ${q.type.value}(0); - } - } - workgroupBarrier(); - - // each thread process one block - let b_row = col + local_id.y; - let block = tile * ${S} + local_id.x; - ${J?` - let zero_point_bytes_per_col = (n_blocks_per_col + 1) / 2; - let zero_point_byte_count = b_row * zero_point_bytes_per_col + (block >> 0x1u); - let zero_point_word_index = zero_point_byte_count >> 0x2u; - let zero_point_byte_offset = zero_point_byte_count & 0x3u; - let zero_point_nibble_offset: u32 = block & 0x1u; - let zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); - let zero_point_word = ${J.getByOffset("zero_point_word_index")} >> zero_point_bits_offset; - let zero_point = ${fe}((zero_point_word) & 0xFu);`:` - // The default zero point is 8 for unsigned 4-bit quantization. - let zero_point = ${fe}(8);`} - let scale = ${Z.getByOffset("b_row * n_blocks_per_col + block")}; - let b_data = ${R.getByIndices(`${R.type.indices}(b_row, block, 0)`)}; - var word_offset = local_id.x * ${r.blockSize/c}; - for (var i: u32 = 0; i < ${d}; i++) { - ${ae()} - let b_value = ${d===1?"b_data":"b_data[i]"}; - let b_value_lower = unpack4xU8(b_value & 0x0F0F0F0Fu); - let b_value_upper = unpack4xU8((b_value >> 4) & 0x0F0F0F0Fu); - let b_quantized_values = mat2x4<${fe}>(${Array.from({length:4},(V,A)=>`${fe}(b_value_lower[${A}]), ${fe}(b_value_upper[${A}])`).join(", ")}); - let b_dequantized_values = (b_quantized_values - mat2x4<${fe}>(${Array(8).fill("zero_point").join(",")})) * scale; - inter_results[local_id.y][local_id.x] += ${Array.from({length:2},(V,A)=>`${`dot(a_data${A}, b_dequantized_values[${A}])`}`).join(" + ")}; - word_offset += ${8/c}; - } - workgroupBarrier(); - } - - if (local_idx < ${T}) { - var output_value: ${se.type.value} = ${se.type.value}(0); - for (var b = 0u; b < ${k}; b++) { - output_value += inter_results[local_idx][b]; - } - if (col + local_idx < uniforms.output_shape[2]) - { - ${se.setByIndices(`${se.type.indices}(batch, row, col + local_idx)`,"output_value")} - } - } - }`};return{name:"BlockwiseMatMulNBits32",shaderCache:{hint:`${r.blockSize};${c};${d};${k};${T}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:_,dataType:p}],dispatchGroup:{x:E},programUniforms:v}),getShaderSource:F}},t_=(e,r)=>{Yf(e.inputs,r),r.blockSize===32&&e.adapterInfo.isVendor("intel")&&e.adapterInfo.isArchitecture("gen-12lp")?e.compute(e_(e.inputs,r)):e.compute(Zf(e.inputs,r))},r_=e=>zt(e)}),s_,n_,o_,i_,a_,l_,u_,c_,d_,ax=je(()=>{ft(),yt(),Tt(),s_=e=>{if(!e||e.length<1)throw new Error("Too few inputs");if(e[0].dataType!==1&&e[0].dataType!==10)throw new Error("Input type must be float or float16.");if(e.length>=2){let r=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(r=e[3].dims[0]*2===e[1].dims[0]),!r)throw new Error("The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].")}},n_=(e,r,t)=>{let s="";for(let o=r-1;o>=0;--o)s+=` - k = i32(${e.indicesGet("indices",o)}) - ${st("uniforms.pads",o,t)}; - if (k < 0) { - break; - } - if (k >= i32(${st("uniforms.x_shape",o,r)})) { - break; - } - offset += k * i32(${st("uniforms.x_strides",o,r)}); - `;return` - value = ${e.type.value}(uniforms.constant_value); - for (var i = 0; i < 1; i++) { - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - } - `},o_=(e,r,t)=>{let s="";for(let o=r-1;o>=0;--o)s+=` - k = i32(${e.indicesGet("indices",o)}) - ${st("uniforms.pads",o,t)}; - if (k < 0) { - k = -k; - } - { - let _2n_1 = 2 * (i32(${st("uniforms.x_shape",o,r)}) - 1); - k = k % _2n_1; - if(k >= i32(${st("uniforms.x_shape",o,r)})) { - k = _2n_1 - k; - } - } - offset += k * i32(${st("uniforms.x_strides",o,r)}); - `;return` - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - `},i_=(e,r,t)=>{let s="";for(let o=r-1;o>=0;--o)s+=` - k = i32(${e.indicesGet("indices",o)}) - ${st("uniforms.pads",o,t)}; - if (k < 0) { - k = 0; - } - if (k >= i32(${st("uniforms.x_shape",o,r)})) { - k = i32(${st("uniforms.x_shape",o,r)}) - 1; - } - offset += k * i32(${st("uniforms.x_strides",o,r)}); - `;return` - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - `},a_=(e,r,t)=>{let s="";for(let o=r-1;o>=0;--o)s+=` - k = i32(${e.indicesGet("indices",o)}) - ${st("uniforms.pads",o,t)}; - if (k < 0) { - k += i32(${st("uniforms.x_shape",o,r)}]); - } - if (k >= i32(${st("uniforms.x_shape",o,r)})) { - k -= i32(${st("uniforms.x_shape",o,r)}); - } - offset += k * i32(${st("uniforms.x_strides",o,r)}); - `;return` - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - `},l_=(e,r,t)=>{switch(t.mode){case 0:return n_(e,r,t.pads.length);case 1:return o_(e,r,t.pads.length);case 2:return i_(e,r,t.pads.length);case 3:return a_(e,r,t.pads.length);default:throw new Error("Invalid mode")}},u_=(e,r)=>{let t=Me.padShape(e[0].dims.slice(),r.pads),s=e[0].dims,o=Me.size(t),n=[{type:12,data:o},{type:6,data:r.pads}],i=e.length>=3&&e[2].data;r.mode===0&&n.push({type:i?e[2].dataType:1,data:r.value}),n.push(...at(e[0].dims,t));let a=["rank"],l=u=>{let p=et("output",e[0].dataType,t.length),c=Pe("x",e[0].dataType,s.length),d=c.type.value,_=l_(p,s.length,r),f=[{name:"output_size",type:"u32"},{name:"pads",type:"i32",length:r.pads.length}];return r.mode===0&&f.push({name:"constant_value",type:i?d:"f32"}),` - ${u.registerUniforms(f).declareVariables(c,p)} - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let indices = ${p.offsetToIndices("global_idx")}; - - var value = ${d}(0); - ${_} - output[global_idx] = value; - }`};return{name:"Pad",shaderCache:{hint:`${r.mode}${i}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Me.size(t)/64)},programUniforms:n}),getShaderSource:l}},c_=(e,r)=>{if(e.length>1){let t=e[1].getBigInt64Array(),s=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,o=e[0].dims.length,n=new Int32Array(2*o).fill(0);if(e.length>=4){let a=e[3].getBigInt64Array();for(let l=0;ln[Number(l)]=Number(a));let i=[];return n.forEach(a=>i.push(a)),{mode:r.mode,value:s,pads:i}}else return r},d_=(e,r)=>{s_(e.inputs);let t=c_(e.inputs,r);e.compute(u_(e.inputs,t),{inputs:[0]})}}),bo,Bl,Rl,jl,Nl,p_,h_,Vl,Ul,m_,f_,Wl,__,g_,Gl,w_,M_,b_,y_,lx=je(()=>{ms(),ft(),yt(),Tt(),bo=e=>{if(Xt.webgpu.validateInputContent&&(!e||e.length!==1))throw new Error("Pool ops requires 1 input.")},Bl=(e,r,t)=>{let s=r.format==="NHWC",o=e.dims.slice();s&&o.splice(1,0,o.pop());let n=Object.hasOwnProperty.call(r,"dilations"),i=r.kernelShape.slice(),a=r.strides.slice(),l=n?r.dilations.slice():[],u=r.pads.slice();ai.adjustPoolAttributes(t,o,i,a,l,u);let p=ai.computePoolOutputShape(t,o,a,l,i,u,r.autoPad),c=Object.assign({},r);n?Object.assign(c,{kernelShape:i,strides:a,pads:u,dilations:l,cacheKey:r.cacheKey}):Object.assign(c,{kernelShape:i,strides:a,pads:u,cacheKey:r.cacheKey});let d=p.slice();return d.push(d.splice(1,1)[0]),[c,s?d:p]},Rl=(e,r)=>{let t=r.format==="NHWC",s=Me.size(e),o=Me.size(r.kernelShape),n=[{type:12,data:s},{type:12,data:o}],i=[{name:"outputSize",type:"u32"},{name:"kernelSize",type:"u32"}];if(r.kernelShape.length<=2){let a=r.kernelShape[r.kernelShape.length-1],l=r.strides[r.strides.length-1],u=r.pads[r.pads.length/2-1],p=r.pads[r.pads.length-1],c=!!(u+p);n.push({type:12,data:a},{type:12,data:l},{type:12,data:u},{type:12,data:p}),i.push({name:"kw",type:"u32"},{name:"sw",type:"u32"},{name:"pwStart",type:"u32"},{name:"pwEnd",type:"u32"});let d=!1;if(r.kernelShape.length===2){let _=r.kernelShape[r.kernelShape.length-2],f=r.strides[r.strides.length-2],T=r.pads[r.pads.length/2-2],k=r.pads[r.pads.length-2];d=!!(T+k),n.push({type:12,data:_},{type:12,data:f},{type:12,data:T},{type:12,data:k}),i.push({name:"kh",type:"u32"},{name:"sh",type:"u32"},{name:"phStart",type:"u32"},{name:"phEnd",type:"u32"})}return[n,i,!0,c,d]}else{if(t)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let a=Me.computeStrides(r.kernelShape);n.push({type:12,data:a},{type:12,data:r.pads},{type:12,data:r.strides}),i.push({name:"kernelStrides",type:"u32",length:a.length},{name:"pads",type:"u32",length:r.pads.length},{name:"strides",type:"u32",length:r.strides.length});let l=r.pads.reduce((u,p)=>u+p);return[n,i,!!l,!1,!1]}},jl=(e,r,t,s,o,n,i,a,l,u,p,c)=>{let d=o.format==="NHWC",_=r.type.value,f=et("output",r.type.tensor,s);if(o.kernelShape.length<=2){let T="",k="",g="",w=t-(d?2:1);if(p?T=` - for (var i: u32 = 0u; i < uniforms.kw; i++) { - xIndices[${w}] = indices[${w}] * uniforms.sw - uniforms.pwStart + i; - if (xIndices[${w}] < 0 || xIndices[${w}] - >= uniforms.x_shape[${w}]) { - pad++; - continue; - } - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - }`:T=` - for (var i: u32 = 0u; i < uniforms.kw; i++) { - xIndices[${w}] = indices[${w}] * uniforms.sw - uniforms.pwStart + i; - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - }`,o.kernelShape.length===2){let S=t-(d?3:2);c?k=` - for (var j: u32 = 0u; j < uniforms.kh; j++) { - xIndices[${S}] = indices[${S}] * uniforms.sh - uniforms.phStart + j; - if (xIndices[${S}] < 0 || xIndices[${S}] >= uniforms.x_shape[${S}]) { - pad += i32(uniforms.kw); - continue; - } - `:k=` - for (var j: u32 = 0u; j < uniforms.kh; j++) { - xIndices[${S}] = indices[${S}] * uniforms.sh - uniforms.phStart + j; - `,g=` - } - `}return` - ${e.registerUniforms(l).declareVariables(r,f)} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - - let indices = ${f.offsetToIndices("global_idx")}; - var xIndices = ${f.offsetToIndices("global_idx")}; - - var value = ${_}(${a}); - var pad = 0; - ${k} - ${T} - ${g} - ${i} - - output[global_idx] = value; - }`}else{if(d)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let T=o.kernelShape.length,k=o.pads.length,g="";return u?g=` - if (xIndices[j] >= uniforms.x_shape[j]) { - pad++; - isPad = true; - break; - } - } - if (!isPad) { - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - }`:g=` - } - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - `,` - ${e.registerUniforms(l).declareVariables(r,f)} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - let indices = ${f.offsetToIndices("global_idx")}; - var xIndices = ${f.offsetToIndices("global_idx")}; - - var offsets: array; - - var value = ${_}(${a}); - var pad = 0; - var isPad = false; - - for (var i: u32 = 0u; i < uniforms.kernelSize; i++) { - var offset = i; - for (var j = 0u; j < ${T-1}u; j++) { - offsets[j] = offset / ${st("uniforms.kernelStrides","j",T)}; - offset -= offsets[j] * ${st("uniforms.kernelStrides","j",T)}; - } - offsets[${T-1}] = offset; - - isPad = false; - for (var j = ${t-T}u; j < ${t}u; j++) { - xIndices[j] = indices[j] * ${st("uniforms.strides",`j - ${t-T}u`,T)} - + offsets[j - ${t-T}u] - ${st("uniforms.pads","j - 2u",k)}; - ${g} - } - ${i} - - output[global_idx] = value; - }`}},Nl=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,p_=e=>`${Nl(e)};${e.countIncludePad}`,h_=e=>`${Nl(e)};${e.storageOrder};${e.dilations}`,Vl=e=>({format:e.format,autoPad:["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),Ul=(e,r,t,s)=>{let[o,n]=Bl(r,s,t),i=Pe("x",r.dataType,r.dims.length),a=i.type.value,l="value += x_val;",u="";o.countIncludePad?u+=`value /= ${a}(uniforms.kernelSize);`:u+=`value /= ${a}(i32(uniforms.kernelSize) - pad);`;let[p,c,d,_,f]=Rl(n,o);p.push(...at(r.dims,n));let T=["rank"];return{name:e,shaderCache:{hint:`${s.cacheKey};${d};${_};${f}`,inputDependencies:T},getRunData:()=>({outputs:[{dims:n,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(Me.size(n)/64)},programUniforms:p}),getShaderSource:k=>jl(k,i,r.dims.length,n.length,o,l,u,0,c,d,_,f)}},m_=e=>{let r=e.count_include_pad!==0,t=Vl(e);if(t.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");let s={countIncludePad:r,...t,cacheKey:""};return{...s,cacheKey:p_(s)}},f_=(e,r)=>{bo(e.inputs),e.compute(Ul("AveragePool",e.inputs[0],!1,r))},Wl={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},__=e=>{let r=e.format;return{format:r,...Wl,cacheKey:r}},g_=(e,r)=>{bo(e.inputs),e.compute(Ul("GlobalAveragePool",e.inputs[0],!0,r))},Gl=(e,r,t,s)=>{let[o,n]=Bl(r,s,t),i=` - value = max(x_val, value); - `,a="",l=Pe("x",r.dataType,r.dims.length),u=["rank"],[p,c,d,_,f]=Rl(n,o);return p.push(...at(r.dims,n)),{name:e,shaderCache:{hint:`${s.cacheKey};${d};${_};${f}`,inputDependencies:u},getRunData:()=>({outputs:[{dims:n,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(Me.size(n)/64)},programUniforms:p}),getShaderSource:T=>jl(T,l,r.dims.length,n.length,o,i,a,r.dataType===10?-65504:-1e5,c,d,_,f)}},w_=(e,r)=>{bo(e.inputs),e.compute(Gl("MaxPool",e.inputs[0],!1,r))},M_=e=>{let r=e.storage_order,t=e.dilations,s=Vl(e);if(r!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(s.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");let o={storageOrder:r,dilations:t,...s,cacheKey:""};return{...o,cacheKey:h_(o)}},b_=e=>{let r=e.format;return{format:r,...Wl,cacheKey:r}},y_=(e,r)=>{bo(e.inputs),e.compute(Gl("GlobalMaxPool",e.inputs[0],!0,r))}}),v_,x_,T_,E_,ux=je(()=>{ft(),yt(),or(),Tt(),v_=(e,r)=>{if(e.length<2||e.length>3)throw new Error("DequantizeLinear requires 2 or 3 inputs.");if(e.length===3&&e[1].dims===e[2].dims)throw new Error("x-scale and x-zero-point must have the same shape.");if(e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("x and x-zero-point must have the same data type.");if(e[0].dataType===6&&e.length>2)throw new Error("In the case of dequantizing int32 there is no zero point.");if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw new Error("scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.");if(e.length>2){if(e[0].dataType!==e[2].dataType)throw new Error("x and x-zero-point must have the same data type.");if(e[1].dims.length!==e[2].dims.length)throw new Error("scale and zero-point inputs must have the same rank.");if(!e[1].dims.map((t,s)=>t===e[2].dims[s]).reduce((t,s)=>t&&s,!0))throw new Error("scale and zero-point inputs must have the same shape.")}if(r.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw new Error("blockSize must be set only for block quantization.");if(!e[1].dims.map((o,n)=>n===r.axis||o===e[0].dims[n]).reduce((o,n)=>o&&n,!0))throw new Error("For block qunatization, scale input shape to match the input shape except for the axis");if(e[1].dims.length!==e[0].dims.length)throw new Error("For block qunatization the scale input rank must be the same as the x rank.");let t=e[0].dims[r.axis],s=e[1].dims[r.axis];if(r.blockSizeMath.ceil(t/(s-1)-1))throw new Error("blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].")}},x_=(e,r)=>{let t=Me.normalizeAxis(r.axis,e[0].dims.length),s=e[0].dataType,o=s===3,n=e[0].dims,i=e[1].dataType,a=Me.size(n),l=s===3||s===2,u=l?[Math.ceil(Me.size(e[0].dims)/4)]:e[0].dims,p=e[1].dims,c=e.length>2?e[2]:void 0,d=c?l?[Math.ceil(Me.size(c.dims)/4)]:c.dims:void 0,_=p.length===0||p.length===1&&p[0]===1,f=_===!1&&p.length===1,T=sr(a),k=_&&(!l||T===4),g=k?T:1,w=k&&!l?T:1,S=Pe("input",l?12:s,u.length,w),E=Pe("scale",i,p.length),v=c?Pe("zero_point",l?12:s,d.length):void 0,M=et("output",i,n.length,g),y=[S,E];v&&y.push(v);let C=[u,p];c&&C.push(d);let F=[{type:12,data:a/g},{type:12,data:t},{type:12,data:r.blockSize},...at(...C,n)],z=K=>{let q=[{name:"output_size",type:"u32"},{name:"axis",type:"u32"},{name:"block_size",type:"u32"}];return` - ${K.registerUniforms(q).declareVariables(...y,M)} - ${K.mainStart()} - ${K.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let output_indices = ${M.offsetToIndices("global_idx")}; - - // Set input x - ${l?` - let input = ${S.getByOffset("global_idx / 4")}; - let x_vec = ${o?"unpack4xI8(input)":"unpack4xU8(input)"}; - let x_value = ${g===1?"x_vec[global_idx % 4]":"x_vec"};`:`let x_value = ${S.getByOffset("global_idx")};`}; - - // Set scale input - ${_?`let scale_value= ${E.getByOffset("0")}`:f?` - let scale_index = ${M.indicesGet("output_indices","uniforms.axis")}; - let scale_value= ${E.getByOffset("scale_index")};`:` - var scale_indices: ${E.type.indices} = output_indices; - let index = ${E.indicesGet("scale_indices","uniforms.axis")} / uniforms.block_size; - ${E.indicesSet("scale_indices","uniforms.axis","index")}; - let scale_value= ${E.getByIndices("scale_indices")};`}; - - // Set zero-point input - ${v?_?l?` - let zero_point_input = ${v.getByOffset("0")}; - let zero_point_vec = ${o?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; - let zero_point_value= zero_point_vec[0]`:`let zero_point_value = ${v.getByOffset("0")}`:f?l?` - let zero_point_index = ${M.indicesGet("output_indices","uniforms.axis")}; - let zero_point_input = ${v.getByOffset("zero_point_index / 4")}; - let zero_point_vec = ${o?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; - let zero_point_value = zero_point_vec[zero_point_index % 4]`:` - let zero_point_index = ${M.indicesGet("output_indices","uniforms.axis")}; - let zero_point_value = ${v.getByOffset("zero_point_index")};`:l?` - let zero_point_offset = ${E.indicesToOffset("scale_indices")}; - let zero_point_input = ${v.getByOffset("zero_point_offset / 4")}; - let zero_point_vec = ${o?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; - let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${v.getByIndices("scale_indices")};`:`let zero_point_value = ${l?o?"i32":"u32":S.type.value}(0);`}; - // Compute and write output - ${M.setByOffset("global_idx",`${M.type.value}(x_value - zero_point_value) * scale_value`)}; - }`};return{name:"DequantizeLinear",shaderCache:{hint:r.cacheKey,inputDependencies:v?["rank","rank","rank"]:["rank","rank"]},getShaderSource:z,getRunData:()=>({outputs:[{dims:n,dataType:i}],dispatchGroup:{x:Math.ceil(a/g/64),y:1,z:1},programUniforms:F})}},T_=(e,r)=>{v_(e.inputs,r),e.compute(x_(e.inputs,r))},E_=e=>zt({axis:e.axis,blockSize:e.blockSize})}),P_,C_,S_,cx=je(()=>{ms(),ft(),Tt(),P_=(e,r,t)=>{let s=e===r,o=er&&t>0;if(s||o||n)throw new Error("Range these inputs' contents are invalid.")},C_=(e,r,t,s)=>{let o=Math.abs(Math.ceil((r-e)/t)),n=[o],i=o,a=[{type:12,data:i},{type:s,data:e},{type:s,data:t},...at(n)],l=u=>{let p=et("output",s,n.length),c=p.type.value,d=[{name:"outputSize",type:"u32"},{name:"start",type:c},{name:"delta",type:c}];return` - ${u.registerUniforms(d).declareVariables(p)} - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - output[global_idx] = uniforms.start + ${c}(global_idx) * uniforms.delta; - }`};return{name:"Range",shaderCache:{hint:`${s}`},getShaderSource:l,getRunData:()=>({outputs:[{dims:n,dataType:s}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:a})}},S_=e=>{let r=0,t=0,s=0;e.inputs[0].dataType===6?(r=e.inputs[0].getInt32Array()[0],t=e.inputs[1].getInt32Array()[0],s=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(r=e.inputs[0].getFloat32Array()[0],t=e.inputs[1].getFloat32Array()[0],s=e.inputs[2].getFloat32Array()[0]),Xt.webgpu.validateInputContent&&P_(r,t,s),e.compute(C_(r,t,s,e.inputs[0].dataType),{inputs:[]})}}),$_,Kl,Hl,k_,I_,A_,dx=je(()=>{ft(),yt(),or(),Tt(),$_=(e,r,t,s)=>{if(e!=="none"&&s!=="i32"&&s!=="u32"&&s!=="f32")throw new Error(`Input ${s} is not supported with reduction ${e}.`);let o=`{ - var oldValue = 0; - loop { - let newValueF32 =`,n=`; - let newValue = bitcast(newValueF32); - let res = atomicCompareExchangeWeak(&${r}, oldValue, newValue); - if res.exchanged { - break; - } - oldValue = res.old_value; - } - }`;switch(e){case"none":return`${r}=${t};`;case"add":return s==="i32"||s==="u32"?`atomicAdd(&${r}, bitcast<${s}>(${t}));`:` - ${o}bitcast<${s}>(oldValue) + (${t})${n}`;case"max":return s==="i32"||s==="u32"?`atomicMax(&${r}, bitcast<${s}>(${t}));`:` - ${o}max(bitcast(oldValue), (${t}))${n}`;case"min":return s==="i32"||s==="u32"?`atomicMin(&${r}, bitcast<${s}>(${t}));`:`${o}min(bitcast<${s}>(oldValue), (${t}))${n}`;case"mul":return`${o}(bitcast<${s}>(oldValue) * (${t}))${n}`;default:throw new Error(`Reduction ${e} is not supported.`)}},Kl=(e,r)=>`${e===1?` - let element_count_dim = uniforms.output_strides; - let dim_value = uniforms.output_shape;`:` - let element_count_dim = uniforms.output_strides[${r?"i - indices_start":"i"}]; - let dim_value = uniforms.output_shape[${r?"i - indices_start":"i"} + uniforms.last_index_dimension];`} - - if (index >= 0) { - if (index >= i32(dim_value)) { - index = i32(dim_value - 1); - } - } else { - if (index < -i32(dim_value)) { - index = 0; - } else { - index += i32(dim_value); - } - } - data_offset += u32((u32(index) * element_count_dim));`,Hl=(e,r,t)=>`for (var i = 0u; i < uniforms.num_updates_elements; i++) { - let value = updates[uniforms.num_updates_elements * ${t?"global_idx":"idx"} + i]; - ${$_(e.reduction,"output[data_offset + i]","value",r)} - }`,k_=(e,r)=>{let t=e[0].dims,s=e[1].dims,o=t,n=1,i=Math.ceil(Me.size(s)/n),a=s[s.length-1],l=Me.sizeFromDimension(t,a),u=Me.sizeFromDimension(s,0)/a,p=[{type:12,data:i},{type:12,data:a},{type:12,data:l},...at(e[1].dims,e[2].dims,o)],c=d=>{let _=Pe("indices",e[1].dataType,e[1].dims.length),f=Pe("updates",e[2].dataType,e[2].dims.length,n),T=r.reduction!=="none"&&r.reduction!==""?zd("output",e[0].dataType,o.length):et("output",e[0].dataType,o.length,n);return` - ${d.registerUniform("output_size","u32").registerUniform("last_index_dimension","u32").registerUniform("num_updates_elements","u32").declareVariables(_,f,T)} - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - var hasDuplicates = false; - if (${r.reduction==="none"}) { - for (var i = 0; i < ${u}; i = i + 1) { - for (var j = i + 1; j < ${u}; j = j + 1) { - var index_i = i32(indices[i].x); - var index_j = i32(indices[j].x); - if (index_i == index_j) { - hasDuplicates = true; - break; - } - } - if (hasDuplicates) { - break; - } - } - } - - if (${r.reduction==="none"} && hasDuplicates) { - if (global_idx != 0u) { - return; - } - // Process each index-update pair individually when duplicates exist - for (var idx = 0u; idx < ${u}u; idx++) { - var data_offset = 0u; - for (var i = 0u; i < uniforms.last_index_dimension; i++) { - var index = i32(indices[idx * uniforms.last_index_dimension + i].x); - ${Kl(t.length,!1)} - } - ${Hl(r,T.type.value,!1)} - } - return; - } - - var data_offset = 0u; - var indices_start = uniforms.last_index_dimension * global_idx; - var indices_end = indices_start + uniforms.last_index_dimension; - for (var i = indices_start; i < indices_end; i++) { - var index = i32(indices[i].x); - ${Kl(t.length,!0)} - } - ${Hl(r,T.type.value,!0)} - }`};return{name:"ScatterND",shaderCache:{hint:`${r.cacheKey}_${r.reduction}`,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:p}),getShaderSource:c}},I_=e=>zt({reduction:e.reduction}),A_=(e,r)=>{e.compute(k_(e.inputs,r),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),F_,O_,D_,ql,L_,z_,B_,R_,j_,N_,V_,U_,Ql,W_,G_,K_,H_,q_,Q_,X_,px=je(()=>{ft(),yt(),or(),Tt(),F_=(e,r)=>{if(e.every(t=>t>0||(()=>{throw new Error("Resize requires scales input values to be positive")})),e.length>0){if(r.mode==="linear"){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw new Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and - one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(r.mode==="cubic"&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw new Error("Resize requires scales input size to be 2 or 4 for cubic mode")}},O_=(e,r,t)=>{r.every(o=>o>=0&&o{throw new Error("Resize requires axes input values to be positive and less than rank")}));let s=new Array(t).fill(1);return r.forEach((o,n)=>s[o]=e[n]),s},D_=(e,r,t,s,o,n)=>{let[i,a,l]=t>10?[1,2,3]:[-1,e.length>1?1:-1,-1],u=e[0].dims.length;if(i>0&&e.length>i&&e[i].dims.length>0)e[i].getFloat32Array().forEach(p=>n.push(p));else if(r.coordinateTransformMode==="tf_crop_and_resize")throw new Error("Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize");if(a>0&&e.length>a&&e[a].dims.length===1&&e[a].dims[0]>0){if(e[a].getFloat32Array().forEach(p=>s.push(p)),s.length!==0&&s.length!==u&&t>=18&&s.length!==r.axes.length)throw new Error("Resize requires scales input size to be same as input rank or axes size for opset 18 and up");F_(s,r),r.axes.length>0&&O_(s,r.axes,u).forEach((p,c)=>s[c]=p)}if(l>0&&e.length>l&&e[l].dims.length===1&&e[l].dims[0]>0&&(e[l].getBigInt64Array().forEach(p=>o.push(Number(p))),o.length!==0&&o.length!==u&&t>=18&&o.length!==r.axes.length))throw new Error("Resize requires sizes input size to be same as input rank or axes size for opset 18 and up");if(r.axes.length>0){if(s.length!==0&&s.length!==r.axes.length)throw new Error('Resize requires "scales" input size to be of axes rank when axes attributes is specified');if(o.length!==0&&o.length!==r.axes.length)throw new Error('Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified')}if(typeof s<"u"&&typeof o<"u"&&s.length>0&&o.length>u)throw new Error("Resize requires only of scales or sizes to be specified")},ql=(e,r,t,s)=>` - // The whole part and the fractional part are calculated separately due to inaccuracy of floating - // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an - // offset-by-one error later in floor(). - let big = (${e}) * (${r}); - let whole = ${s}(big / (${t})); - let fract = ${s}(big % (${t})) / ${s}(${t}); - return whole + fract; -`,L_=(e,r)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32, - lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${r} { `+(()=>{switch(e){case"asymmetric":return` - if (xScale < 1.0 || floor(xScale) != xScale) { - return ${r}(xResized) / ${r}(xScale); - } else { - ${ql("xResized","lengthOriginal","lengthResized",r)} - } - `;case"pytorch_half_pixel":return`if (lengthResized > 1) { - return (${r}(xResized) + 0.5) / ${r}(xScale) - 0.5; - } else { - return 0.0; - }`;case"tf_half_pixel_for_nn":return`return (${r}(xResized) + 0.5) / ${r}(xScale);`;case"align_corners":return`if (lengthResized == 1) { - return 0.0; - } else { - ${ql("xResized","lengthOriginal - 1","lengthResized - 1",r)} - }`;case"tf_crop_and_resize":return`if (lengthResized > 1) { - return ${r}(roiStart) * ${r}(lengthOriginal - 1) + - (${r}(xResized) * ${r}(roiEnd - roiStart) * ${r}(lengthOriginal - 1)) / - ${r}(lengthResized - 1); - } else { - return 0.5 * ${r}(roiStart + roiEnd) * ${r}(lengthOriginal - 1); - }`;case"half_pixel_symmetric":return`const outputWidth = ${r}xScale * ${r}(lengthResized); - const adjustment = ${r}(lengthResized) / outputWidth; - const center = ${r}(lengthOriginal) / 2; - const offset = center * (1 - adjustment); - return offset + ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;case"half_pixel":return`return ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;default:throw new Error(`Coordinate transform mode ${e} is not supported`)}})()+"}",z_=(e,r,t)=>`fn getNearestPixelFromOriginal(xOriginal: ${t}, isDownSample: bool) -> ${t} {`+(()=>{switch(e){case"round_prefer_ceil":return"if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }";case"floor":return"return floor(xOriginal);";case"ceil":return"return ceil(xOriginal);";case"round_prefer_floor":return"if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }";case"simple":default:if(r<11)return"if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }";throw new Error(`Nearest mode ${e} is not supported`)}})()+"}",B_=(e,r,t)=>{let s=new Array(t).fill(0).concat(new Array(t).fill(1)),o=e.length===0?s:e.slice();return r.length>0?(r.forEach((n,i)=>{s[n]=o[i],s[i+t]=o[r.length+i]}),s):o},R_=(e,r,t,s)=>{let o=[];if(t.length>0)if(s.length>0){if(e.forEach(n=>o.push(n)),Math.max(...s)>e.length)throw new Error("axes is out of bound");s.forEach((n,i)=>o[n]=t[i])}else t.forEach(n=>o.push(n));else{if(r.length===0)throw new Error("Resize requires either scales or sizes.");o=e.map((n,i)=>Math.round(n*r[i]))}return o},j_=(e,r,t)=>{let s=(()=>{switch(t.keepAspectRatioPolicy){case"not_larger":return t.axes.length>0?Math.min(...t.axes.map(n=>r[n]),Number.MAX_VALUE):Math.min(...r,Number.MAX_VALUE);case"not_smaller":return t.axes.length>0?Math.max(...t.axes.map(n=>r[n]),Number.MIN_VALUE):Math.max(...r,Number.MIN_VALUE);default:throw new Error(`Keep aspect ratio policy ${t.keepAspectRatioPolicy} is not supported`)}})();r.fill(1,0,r.length);let o=e.slice();return t.axes.length>0?(t.axes.forEach(n=>r[n]=s),t.axes.forEach(n=>o[n]=Math.round(e[n]*r[n]))):(r.fill(s,0,r.length),o.forEach((n,i)=>o[i]=Math.round(n*r[i]))),o},N_=(e,r,t,s,o)=>` - fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${t.length}> { - var original_indices: array<${e.type.value}, ${t.length}>; - for (var i:u32 = 0; i < ${t.length}; i++) { - var output_index = ${e.indicesGet("output_indices","i")}; - var scale = ${st("uniforms.scales","i",s)}; - var roi_low = ${st("uniforms.roi","i",o)}; - var roi_hi = ${st("uniforms.roi",`i + ${r.length}`,o)}; - if (scale == 1.0) { - original_indices[i] = ${e.type.value}(output_index); - } else { - var input_shape_i = ${st("uniforms.input_shape","i",r.length)}; - var output_shape_i = ${st("uniforms.output_shape","i",t.length)}; - original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, - input_shape_i, roi_low, roi_hi); - } - } - return original_indices; - }`,V_=(e,r,t,s,o,n,i)=>` - fn calculateInputIndicesFromOutputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} { - var input_indices: ${e.type.indices}; - for (var i:u32 = 0; i < ${s.length}; i++) { - var output_index = ${r.indicesGet("output_indices","i")}; - var input_index: u32; - var scale = ${st("uniforms.scales","i",o)}; - if (scale == 1.0) { - input_index = output_index; - } else { - var roi_low = ${st("uniforms.roi","i",n)}; - var roi_hi = ${st("uniforms.roi",`i + ${t.length}`,n)}; - var input_shape_i = ${st("uniforms.input_shape","i",t.length)}; - var output_shape_i = ${st("uniforms.output_shape","i",s.length)}; - var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, - input_shape_i, roi_low, roi_hi); - if (!${i} || (original_idx >= 0 && original_idx < ${r.type.value}(input_shape_i))) { - if (original_idx < 0) { - input_index = 0; - } else if (original_idx > ${r.type.value}(input_shape_i - 1)) { - input_index = input_shape_i - 1; - } else { - input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1)); - } - } else { - input_index = u32(original_idx); - } - } - ${e.indicesSet("input_indices","i","input_index")} - } - return input_indices; - }`,U_=(e,r)=>` - fn checkInputIndices(input_indices: ${e.type.indices}) -> bool { - for (var i:u32 = 0; i < ${r.length}; i++) { - var input_index = ${e.indicesGet("input_indices","i")}; - if (input_index < 0 || input_index >= ${st("uniforms.input_shape","i",r.length)}) { - return false; - } - } - return true; - }`,Ql=(e,r,t,s)=>e.rank>s?` - ${e.indicesSet("input_indices",r,"channel")}; - ${e.indicesSet("input_indices",t,"batch")}; -`:"",W_=(e,r,t,s,o)=>{let[n,i,a,l]=t.length===2?[-1,0,1,-1]:[0,2,3,1],u=e.type.value;return` - fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${u} { - var input_indices: ${e.type.indices}; - ${e.indicesSet("input_indices",i,`max(0, min(row, ${t[i]} - 1))`)}; - ${e.indicesSet("input_indices",a,`max(0, min(col, ${t[a]} - 1))`)}; - ${Ql(e,l,n,2)} - return ${e.getByIndices("input_indices")}; - } - - fn bilinearInterpolation(output_indices: ${r.type.indices}) -> ${u} { - var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); - var row:${u} = originalIndices[${i}]; - var col:${u} = originalIndices[${a}]; - ${s?`if (row < 0 || row > (${t[i]} - 1) || col < 0 || col > (${t[a]} - 1)) { - return ${o}; - }`:""}; - row = max(0, min(row, ${t[i]} - 1)); - col = max(0, min(col, ${t[a]} - 1)); - var row1: u32 = u32(row); - var col1: u32 = u32(col); - var row2: u32 = u32(row + 1); - var col2: u32 = u32(col + 1); - var channel: u32 = ${t.length>2?`u32(originalIndices[${l}])`:"0"}; - var batch: u32 = ${t.length>2?`u32(originalIndices[${n}])`:"0"}; - var x11: ${u} = getInputValue(batch, channel, row1, col1); - var x12: ${u} = getInputValue(batch, channel, row1, col2); - var x21: ${u} = getInputValue(batch, channel, row2, col1); - var x22: ${u} = getInputValue(batch, channel, row2, col2); - var dx1: ${u} = abs(row - ${u}(row1)); - var dx2: ${u} = abs(${u}(row2) - row); - var dy1: ${u} = abs(col - ${u}(col1)); - var dy2: ${u} = abs(${u}(col2) - col); - if (row1 == row2) { - dx1 = 0.5; - dx2 = 0.5; - } - if (col1 == col2) { - dy1 = 0.5; - dy2 = 0.5; - } - return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1); - }`},G_=(e,r,t,s,o,n,i,a,l,u)=>{let p=t.length===2,[c,d]=p?[0,1]:[2,3],_=e.type.value,f=T=>{let k=T===c?"row":"col";return` - fn ${k}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${r.type.indices}) -> ${_} { - var output_index = ${r.indicesGet("output_indices",T)}; - var originalIdx: ${_} = getOriginalCoordinateFromResizedCoordinate(output_index, ${o[T]}, - ${s[T]}, ${t[T]}, ${n[T]}, ${n[T]} + ${t.length}); - var fractOriginalIdx: ${_} = originalIdx - floor(originalIdx); - var coefs = getCubicInterpolationCoefs(fractOriginalIdx); - - if (${a} && (originalIdx < 0 || originalIdx > (${t[T]} - 1))) { - return ${l}; - } - var data: array<${_}, 4> = array<${_}, 4>(0.0, 0.0, 0.0, 0.0); - for (var i: i32 = -1; i < 3; i++) { - var ${k}: ${_} = originalIdx + ${_}(i); - if (${k} < 0 || ${k} >= ${t[T]}) { - ${u?`coefs[i + 1] = 0.0; - continue;`:a?`return ${l};`:`${k} = max(0, min(${k}, ${t[T]} - 1));`}; - } - var input_indices_copy: ${e.type.indices} = input_indices; - ${e.indicesSet("input_indices_copy",T,`u32(${k})`)}; - data[i + 1] = ${T===c?e.getByIndices("input_indices_copy"):"rowCubicInterpolation(input_indices_copy, output_indices)"}; - } - return cubicInterpolation1D(data, coefs); - }`};return` - ${f(c)}; - ${f(d)}; - fn getCubicInterpolationCoefs(s: ${_}) -> array<${_}, 4> { - var absS = abs(s); - var coeffs: array<${_}, 4> = array<${_}, 4>(0.0, 0.0, 0.0, 0.0); - var oneMinusAbsS: ${_} = 1.0 - absS; - var twoMinusAbsS: ${_} = 2.0 - absS; - var onePlusAbsS: ${_} = 1.0 + absS; - coeffs[0] = ((${i} * onePlusAbsS - 5 * ${i}) * onePlusAbsS + 8 * ${i}) * onePlusAbsS - 4 * ${i}; - coeffs[1] = ((${i} + 2) * absS - (${i} + 3)) * absS * absS + 1; - coeffs[2] = ((${i} + 2) * oneMinusAbsS - (${i} + 3)) * oneMinusAbsS * oneMinusAbsS + 1; - coeffs[3] = ((${i} * twoMinusAbsS - 5 * ${i}) * twoMinusAbsS + 8 * ${i}) * twoMinusAbsS - 4 * ${i}; - return coeffs; - } - - fn cubicInterpolation1D(x: array<${_}, 4>, coefs: array<${_}, 4>) -> ${_} { - var coefsSum: ${_} = coefs[0] + coefs[1] + coefs[2] + coefs[3]; - return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum; - } - - fn bicubicInterpolation(output_indices: ${r.type.indices}) -> ${_} { - var input_indices: ${e.type.indices} = output_indices; - return colCubicInterpolation(input_indices, output_indices); - } - `},K_=(e,r,t,s,o)=>{let[n,i,a,l,u]=t.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],p=e.type.value;return` - fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${p} { - var input_indices: ${e.type.indices}; - ${e.indicesSet("input_indices",i,`max(0, min(depth, ${t[i]} - 1))`)}; - ${e.indicesSet("input_indices",a,`max(0, min(height, ${t[a]} - 1))`)}; - ${e.indicesSet("input_indices",l,`max(0, min(width, ${t[l]} - 1))`)}; - ${Ql(e,u,n,3)} - return ${e.getByIndices("input_indices")}; - } - - fn trilinearInterpolation(output_indices: ${r.type.indices}) -> ${p} { - var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); - var depth:${p} = originalIndices[${i}]; - var height:${p} = originalIndices[${a}]; - var width:${p} = originalIndices[${l}]; - ${s?`if (depth < 0 || depth > (${t[i]} - 1) || height < 0 || height > (${t[a]} - 1) || width < 0 || (width > ${t[l]} - 1)) { - return ${o}; - }`:""}; - - depth = max(0, min(depth, ${t[i]} - 1)); - height = max(0, min(height, ${t[a]} - 1)); - width = max(0, min(width, ${t[l]} - 1)); - var depth1: u32 = u32(depth); - var height1: u32 = u32(height); - var width1: u32 = u32(width); - var depth2: u32 = u32(depth + 1); - var height2: u32 = u32(height + 1); - var width2: u32 = u32(width + 1); - var channel: u32 = ${t.length>3?`u32(originalIndices[${u}])`:"0"}; - var batch: u32 = ${t.length>3?`u32(originalIndices[${n}])`:"0"}; - - var x111: ${p} = getInputValue(batch, channel, depth1, height1, width1); - var x112: ${p} = getInputValue(batch, channel, depth1, height1, width2); - var x121: ${p} = getInputValue(batch, channel, depth1, height2, width1); - var x122: ${p} = getInputValue(batch, channel, depth1, height2, width2); - var x211: ${p} = getInputValue(batch, channel, depth2, height1, width1); - var x212: ${p} = getInputValue(batch, channel, depth2, height1, width2); - var x221: ${p} = getInputValue(batch, channel, depth2, height2, width1); - var x222: ${p} = getInputValue(batch, channel, depth2, height2, width2); - var dx1: ${p} = abs(depth - ${p}(depth1)); - var dx2: ${p} = abs(${p}(depth2) - depth); - var dy1: ${p} = abs(height - ${p}(height1)); - var dy2: ${p} = abs(${p}(height2) - height); - var dz1: ${p} = abs(width - ${p}(width1)); - var dz2: ${p} = abs(${p}(width2) - width); - if (depth1 == depth2) { - dx1 = 0.5; - dx2 = 0.5; - } - if (height1 == height2) { - dy1 = 0.5; - dy2 = 0.5; - } - if (width1 == width2) { - dz1 = 0.5; - dz2 = 0.5; - } - return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 + - x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1); - }`},H_=(e,r,t,s,o,n)=>{let i=e.dims,a=B_(n,r.axes,i.length),l=R_(i,s,o,r.axes),u=s.slice();s.length===0&&(u=i.map((w,S)=>w===0?1:l[S]/w),r.keepAspectRatioPolicy!=="stretch"&&(l=j_(i,u,r)));let p=et("output",e.dataType,l.length),c=Pe("input",e.dataType,i.length),d=Me.size(l),_=i.length===l.length&&i.every((w,S)=>w===l[S]),f=r.coordinateTransformMode==="tf_crop_and_resize",T=r.extrapolationValue,k=c.type.value,g=w=>` - ${_?"":` - ${L_(r.coordinateTransformMode,k)}; - ${(()=>{switch(r.mode){case"nearest":return` - ${U_(c,i)}; - ${z_(r.nearestMode,t,k)}; - ${V_(c,p,i,l,u.length,a.length,f)}; - `;case"linear":return` - ${N_(p,i,l,u.length,a.length)}; - ${(()=>{if(i.length===2||i.length===4)return`${W_(c,p,i,f,T)}`;if(i.length===3||i.length===5)return`${K_(c,p,i,f,T)}`;throw Error("Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.")})()}; - `;case"cubic":return` - ${(()=>{if(i.length===2||i.length===4)return`${G_(c,p,i,l,u,a,r.cubicCoeffA,f,r.extrapolationValue,r.excludeOutside)}`;throw Error("Cubic mode only supports input dims 2 and 4 are supported in linear mode.")})()}; - `;default:throw Error("Invalid resize mode")}})()}; - `} - ${w.registerUniform("output_size","u32").registerUniform("scales","f32",u.length).registerUniform("roi","f32",a.length).declareVariables(c,p)} - ${w.mainStart()} - ${w.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - ${_?"output[global_idx] = input[global_idx];":` - let output_indices = ${p.offsetToIndices("global_idx")}; - var input_indices: ${c.type.indices}; - ${(()=>{switch(r.mode){case"nearest":return`input_indices = calculateInputIndicesFromOutputIndices(output_indices); - if (checkInputIndices(input_indices)) { - output[global_idx] = ${c.getByIndices("input_indices")}; - } else { - output[global_idx] = ${r.extrapolationValue}; - }`;case"linear":return`output[global_idx] = ${i.length===2||i.length===4?"bilinearInterpolation":"trilinearInterpolation"}(output_indices);`;case"cubic":return"output[global_idx] = bicubicInterpolation(output_indices);";default:throw Error(`Unsupported resize mode: ${r.mode}`)}})()}; -`} - }`;return{name:"Resize",shaderCache:{hint:`${r.cacheKey}|${t}|${u.length>0?r.mode==="cubic"?u:u.length:""}|${o.length>0?o:""}|${a.length>0?a:""}|${_}|${r.mode==="nearest"?i.length:i}`,inputDependencies:["rank"]},getShaderSource:g,getRunData:()=>({outputs:[{dims:l,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:[{type:12,data:d},{type:1,data:u},{type:1,data:a},...at(i,l)]})}},q_=e=>{let r=e.customDataBuffer;return new Uint32Array(r,r.byteOffset,1)[0]},Q_=(e,r)=>{let t=[],s=[],o=[],n=q_(e);if(r.antialias!==0)throw Error("Only default value (0) for Antialias attribute is supported");D_(e.inputs,r,n,t,s,o),e.compute(H_(e.inputs[0],r,n,t,s,o),{inputs:[0]})},X_=e=>{let r=e.antialias,t=e.axes,s=e.coordinateTransformMode,o=e.cubicCoeffA,n=e.excludeOutside!==0,i=e.extrapolationValue,a=e.keepAspectRatioPolicy,l=e.mode,u=e.nearestMode===""?"simple":e.nearestMode;return zt({antialias:r,axes:t,coordinateTransformMode:s,cubicCoeffA:o,excludeOutside:n,extrapolationValue:i,keepAspectRatioPolicy:a,mode:l,nearestMode:u})}}),J_,Y_,Z_,hx=je(()=>{ft(),yt(),Tt(),J_=e=>{if(!e||e.length<3)throw new Error("layerNorm requires at least 3 inputs.");let r=e[0],t=e[1],s=e[2];if(r.dataType!==t.dataType||r.dataType!==s.dataType)throw new Error("All inputs must have the same data type");if(r.dims.length!==3&&r.dims.length!==2)throw new Error("Input must be 2D or 3D");if(t.dims.length!==3&&t.dims.length!==2)throw new Error("Skip must be 2D or 3D");let o=r.dims[r.dims.length-1],n=r.dims[r.dims.length-2];if(t.dims[t.dims.length-1]!==o)throw new Error("Skip must have the same hidden size as input");if(t.dims[t.dims.length-2]!==n)throw new Error("Skip must have the same sequence length as input");if(s.dims.length!==1)throw new Error("Gamma must be 1D");if(s.dims[s.dims.length-1]!==o)throw new Error("Gamma must have the same hidden size as input");if(e.length>3){let i=e[3];if(i.dims.length!==1)throw new Error("Beta must be 1D");if(i.dims[i.dims.length-1]!==o)throw new Error("Beta must have the same hidden size as input")}if(e.length>4){let i=e[4];if(i.dims.length!==1)throw new Error("Bias must be 1D");if(i.dims[i.dims.length-1]!==o)throw new Error("Bias must have the same hidden size as input")}},Y_=(e,r,t,s)=>{let o=r.simplified,n=e[0].dims,i=Me.size(n),a=n,l=i,u=n.slice(-1)[0],p=s?n.slice(0,-1).concat(1):[],c=!o&&e.length>3,d=e.length>4,_=s&&t>1,f=s&&t>2,T=t>3,k=64,g=sr(u),w=[{type:12,data:l},{type:12,data:g},{type:12,data:u},{type:1,data:r.epsilon}],S=v=>{let M=[{name:"output_size",type:"u32"},{name:"components",type:"u32"},{name:"hidden_size",type:"u32"},{name:"epsilon",type:"f32"}],y=[Pe("x",e[0].dataType,e[0].dims,g),Pe("skip",e[1].dataType,e[1].dims,g),Pe("gamma",e[2].dataType,e[2].dims,g)];c&&y.push(Pe("beta",e[3].dataType,e[3].dims,g)),d&&y.push(Pe("bias",e[4].dataType,e[4].dims,g)),y.push(et("output",e[0].dataType,a,g)),_&&y.push(et("mean_output",1,p)),f&&y.push(et("inv_std_output",1,p)),T&&y.push(et("input_skip_bias_sum",e[0].dataType,a,g));let C=Tr(e[0].dataType),F=Tr(1,g);return` - - ${v.registerUniforms(M).declareVariables(...y)} - var sum_shared : array<${F}, ${k}>; - var sum_squared_shared : array<${F}, ${k}>; - - ${v.mainStart([k,1,1])} - let ix = local_id.x; - let iy = global_id.x / ${k}; - - let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components; - var stride = hidden_size_vectorized / ${k}; - let offset = ix * stride + iy * hidden_size_vectorized; - let offset1d = stride * ix; - if (ix == ${k-1}) { - stride = hidden_size_vectorized - stride * ix; - } - for (var i: u32 = 0; i < stride; i++) { - let skip_value = skip[offset + i]; - let bias_value = ${d?"bias[offset1d + i]":C+"(0.0)"}; - let input_value = x[offset + i]; - let value = input_value + skip_value + bias_value; - ${T?"input_skip_bias_sum[offset + i] = value;":""} - output[offset + i] = value; - let f32_value = ${Un(C,g,"value")}; - sum_shared[ix] += f32_value; - sum_squared_shared[ix] += f32_value * f32_value; - } - workgroupBarrier(); - - var reduce_size : u32 = ${k}; - for (var curr_size = reduce_size >> 1; curr_size > 0; curr_size = reduce_size >> 1) { - reduce_size = curr_size + (reduce_size & 1); - if (ix < curr_size) { - sum_shared[ix] += sum_shared[ix + reduce_size]; - sum_squared_shared[ix] += sum_squared_shared[ix + reduce_size]; - } - workgroupBarrier(); - } - - let sum = sum_shared[0]; - let square_sum = sum_squared_shared[0]; - let mean = ${Us("sum",g)} / f32(uniforms.hidden_size); - let inv_std_dev = inverseSqrt(${Us("square_sum",g)} / f32(uniforms.hidden_size) ${o?"":"- mean * mean"} + uniforms.epsilon); - ${_?"mean_output[global_idx] = mean;":""} - ${f?"inv_std_output[global_idx] = inv_std_dev;":""} - - for (var i: u32 = 0; i < stride; i++) { - output[offset + i] = (output[offset + i] ${o?"":`- ${C}(mean)`}) * - ${C}(inv_std_dev) * gamma[offset1d + i] - ${c?"+ beta[offset1d + i]":""}; - } - }`},E=[{dims:a,dataType:e[0].dataType}];return t>1&&E.push({dims:p,dataType:1}),t>2&&E.push({dims:p,dataType:1}),t>3&&E.push({dims:n,dataType:e[0].dataType}),{name:"SkipLayerNormalization",shaderCache:{hint:`${g};${_};${f};${T}`,inputDependencies:e.map((v,M)=>"type")},getShaderSource:S,getRunData:()=>({outputs:E,dispatchGroup:{x:Math.ceil(l/u)},programUniforms:w})}},Z_=(e,r)=>{J_(e.inputs);let t=[0];e.outputCount>1&&t.push(-3),e.outputCount>2&&t.push(-3),e.outputCount>3&&t.push(3),e.compute(Y_(e.inputs,r,e.outputCount,!1),{outputs:t})}}),eg,yo,tg,Xl,rg,sg,ng,og,mx=je(()=>{ft(),yt(),or(),Tt(),eg=(e,r)=>{if(!e||e.length<1)throw new Error("too few inputs");if(r.axes.length!==0){if(r.axes.length!==r.starts.length||r.axes.length!==r.ends.length)throw new Error("axes, starts and ends must have the same length")}else if(r.starts.length!==r.ends.length)throw new Error("starts and ends must have the same length");e.slice(1).forEach((t,s)=>{if(e[s+1].dataType!==6&&e[s+1].dataType!==7)throw new Error(`Input ${s} must be an array of int32 or int64`)})},yo=(e,r)=>{let t=[];if(e.length>r)if(e[r].dataType===7)e[r].getBigInt64Array().forEach(s=>t.push(Number(s)));else if(e[r].dataType===6)e[r].getInt32Array().forEach(s=>t.push(Number(s)));else throw new Error(`Input ${r} must be an array of int32 or int64`);return t},tg=(e,r)=>{if(e.length>1){let t=yo(e,1),s=yo(e,2),o=yo(e,3);return o.length===0&&(o=[...Array(e[0].dims.length).keys()]),zt({starts:t,ends:s,axes:o})}else return r},Xl=(e,r,t,s,o)=>{let n=e;return e<0&&(n+=t[s[r]]),o[r]<0?Math.max(0,Math.min(n,t[s[r]]-1)):Math.max(0,Math.min(n,t[s[r]]))},rg=(e,r,t)=>`fn calculateInputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} { - var input_indices: ${e.type.indices}; - var carry = 0u; - for (var i = ${t.length}; i >= 0; i--) { - let input_shape_i = ${st("uniforms.input_shape","i",t.length)}; - let steps_i = ${st("uniforms.steps","i",t.length)}; - let signs_i = ${st("uniforms.signs","i",t.length)}; - let starts_i = ${st("uniforms.starts","i",t.length)}; - var output_index = ${r.indicesGet("output_indices","i")}; - var input_index = output_index * steps_i + starts_i + carry; - carry = input_index / input_shape_i; - input_index = input_index % input_shape_i; - if (signs_i < 0) { - input_index = input_shape_i - input_index - 1u + starts_i; - } - ${e.indicesSet("input_indices","i","input_index")}; - } - return input_indices; - }`,sg=(e,r)=>{let t=e[0].dims,s=Me.size(t),o=r.axes.length>0?Me.normalizeAxes(r.axes,t.length):[...Array(t.length).keys()],n=yo(e,4);n.forEach(g=>g!==0||(()=>{throw new Error("step cannot be 0")})),n.length===0&&(n=Array(o.length).fill(1));let i=r.starts.map((g,w)=>Xl(g,w,t,o,n)),a=r.ends.map((g,w)=>Xl(g,w,t,o,n));if(o.length!==i.length||o.length!==a.length)throw new Error("start, ends and axes should have the same number of elements");if(o.length!==t.length)for(let g=0;gMath.sign(g));n.forEach((g,w,S)=>{if(g<0){let E=(a[w]-i[w])/g,v=i[w],M=v+E*n[w];i[w]=M,a[w]=v,S[w]=-g}});let u=t.slice(0);o.forEach((g,w)=>{u[g]=Math.ceil((a[g]-i[g])/n[g])});let p={dims:u,dataType:e[0].dataType},c=et("output",e[0].dataType,u.length),d=Pe("input",e[0].dataType,e[0].dims.length),_=Me.size(u),f=[{name:"outputSize",type:"u32"},{name:"starts",type:"u32",length:i.length},{name:"signs",type:"i32",length:l.length},{name:"steps",type:"u32",length:n.length}],T=[{type:12,data:_},{type:12,data:i},{type:6,data:l},{type:12,data:n},...at(e[0].dims,u)],k=g=>` - ${g.registerUniforms(f).declareVariables(d,c)} - ${rg(d,c,t)} - ${g.mainStart()} - ${g.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - let output_indices = ${c.offsetToIndices("global_idx")}; - let input_indices = calculateInputIndices(output_indices); - ${c.setByOffset("global_idx",d.getByIndices("input_indices"))} - }`;return{name:"Slice",shaderCache:{hint:`${l.length}_${i.length}_${n.length}`,inputDependencies:["rank"]},getShaderSource:k,getRunData:()=>({outputs:[p],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:T})}},ng=(e,r)=>{eg(e.inputs,r);let t=tg(e.inputs,r);e.compute(sg(e.inputs,t),{inputs:[0]})},og=e=>{let r=e.starts,t=e.ends,s=e.axes;return zt({starts:r,ends:t,axes:s})}}),ig,ag,lg,ug,fx=je(()=>{ft(),yt(),or(),Ws(),Tt(),ig=e=>{if(!e||e.length!==1)throw new Error("Softmax op requires 1 input.")},ag=(e,r)=>{let t=e.inputs[0],s=t.dims,o=Me.size(s),n=s.length,i=Me.normalizeAxis(r.axis,n),a=iC),u[i]=n-1,u[n-1]=i,l=e.compute(qr(t,u),{inputs:[t],outputs:[-1]})[0]):l=t;let p=l.dims,c=p[n-1],d=o/c,_=sr(c),f=c/_,T=64;d===1&&(T=256);let k=(y,C)=>C===4?`max(max(${y}.x, ${y}.y), max(${y}.z, ${y}.w))`:C===2?`max(${y}.x, ${y}.y)`:C===3?`max(max(${y}.x, ${y}.y), ${y}.z)`:y,g=Pe("x",l.dataType,l.dims,_),w=et("result",l.dataType,l.dims,_),S=g.type.value,E=Tr(l.dataType)==="f32"?`var threadMax = ${S}(-3.402823e+38f);`:`var threadMax = ${S}(-65504.0h);`,v=y=>` - var rowMaxShared : ${S}; - var rowSumShared : ${S}; - var threadShared : array<${S}, ${T}>; - - fn getValue(row: i32, col: i32, row_stride: i32) -> ${S} { - let index = row * row_stride + col; - return x[index]; - } - - fn setValue(row: i32, col: i32, row_stride: i32, value: ${S}) { - let index = row * row_stride + col; - result[index] = value; - } - ${y.registerUniform("packedCols","i32").declareVariables(g,w)} - ${y.mainStart(T)} - let gindex = i32(global_idx); - let lindex = i32(local_idx); - const wg = ${T}; - let row = gindex / wg; - let cols = uniforms.packedCols; - let row_stride : i32 = uniforms.packedCols; - - // find the rows max - ${E} - for (var col = lindex; col < cols; col += wg) { - let value = getValue(row, col, row_stride); - threadMax = max(threadMax, value); - } - if (lindex < cols) { - threadShared[lindex] = threadMax; - } - workgroupBarrier(); - - var reduceSize = min(cols, wg); - for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) { - reduceSize = currSize + (reduceSize & 1); - if (lindex < currSize) { - threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]); - } - workgroupBarrier(); - } - if (lindex == 0) { - rowMaxShared = ${S}(${k("threadShared[0]",_)}); - } - workgroupBarrier(); - - // find the rows sum - var threadSum = ${S}(0.0); - for (var col = lindex; col < cols; col += wg) { - let subExp = exp(getValue(row, col, row_stride) - rowMaxShared); - threadSum += subExp; - } - threadShared[lindex] = threadSum; - workgroupBarrier(); - - for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) { - if (lindex < currSize) { - threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize]; - } - workgroupBarrier(); - } - if (lindex == 0) { - rowSumShared = ${S}(${Us("threadShared[0]",_)}); - } - workgroupBarrier(); - - // calculate final value for each element in the row - for (var col = lindex; col < cols; col += wg) { - let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared; - setValue(row, col, row_stride, value); - } - }`,M=e.compute({name:"Softmax",shaderCache:{hint:`${_};${T}`,inputDependencies:["type"]},getRunData:()=>({outputs:[{dims:p,dataType:l.dataType}],dispatchGroup:{x:d},programUniforms:[{type:6,data:f}]}),getShaderSource:v},{inputs:[l],outputs:[a?-1:0]})[0];a&&e.compute(qr(M,u),{inputs:[M]})},lg=(e,r)=>{ig(e.inputs),ag(e,r)},ug=e=>zt({axis:e.axis})}),Jl,cg,dg,pg,hg,_x=je(()=>{ft(),yt(),Tt(),Jl=e=>Array.from(e.getBigInt64Array(),Number),cg=e=>{if(!e||e.length!==2)throw new Error("Tile requires 2 inputs.");if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw new Error("Tile only support float, float16, int32, and uint32 data types");if(e[1].dataType!==7)throw new Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw new Error("Tile `repeats` input should be 1-D");if(Jl(e[1]).length!==e[0].dims.length)throw new Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},dg=(e,r)=>{let t=[];for(let s=0;s{let t=e[0].dims,s=r??Jl(e[1]),o=dg(t,s),n=Me.size(o),i=e[0].dataType,a=Pe("input",i,t.length),l=et("output",i,o.length),u=p=>` - const inputShape = ${a.indices(...t)}; - ${p.registerUniform("output_size","u32").declareVariables(a,l)} - ${p.mainStart()} - ${p.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let output_indices = ${l.offsetToIndices("global_idx")}; - var input_indices: ${a.type.indices}; - for (var i = 0; i < ${t.length}; i++) { - let input_dim_i = ${a.indicesGet("uniforms.input_shape","i")}; - let input_dim_value = ${l.indicesGet("output_indices","i")} % input_dim_i; - - ${a.indicesSet("input_indices","i","input_dim_value")} - } - ${l.setByOffset("global_idx",a.getByIndices("input_indices"))} - }`;return{name:"Tile",shaderCache:{hint:`${s}`,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:[{type:12,data:n},...at(e[0].dims,o)]}),getShaderSource:u}},hg=e=>{cg(e.inputs),e.compute(pg(e.inputs),{inputs:[0]})}}),mg,fg,_g,gx=je(()=>{ft(),yt(),Tt(),mg=(e,r,t,s,o)=>{let n=et("output_data",o,t.length,4),i=Pe("a_data",r[1].dataType,r[1].dims.length,4),a=Pe("b_data",r[2].dataType,r[2].dims.length,4),l=Pe("c_data",r[0].dataType,r[0].dims.length,4),u,p=(c,d,_)=>`select(${d}, ${c}, ${_})`;if(!s)u=n.setByOffset("global_idx",p(i.getByOffset("global_idx"),a.getByOffset("global_idx"),l.getByOffset("global_idx")));else{let c=(d,_,f="")=>{let T=`a_data[index_a${_}][component_a${_}]`,k=`b_data[index_b${_}][component_b${_}]`,g=`bool(c_data[index_c${_}] & (0xffu << (component_c${_} * 8)))`;return` - let output_indices${_} = ${n.offsetToIndices(`global_idx * 4u + ${_}u`)}; - let offset_a${_} = ${i.broadcastedIndicesToOffset(`output_indices${_}`,n)}; - let offset_b${_} = ${a.broadcastedIndicesToOffset(`output_indices${_}`,n)}; - let offset_c${_} = ${l.broadcastedIndicesToOffset(`output_indices${_}`,n)}; - let index_a${_} = offset_a${_} / 4u; - let index_b${_} = offset_b${_} / 4u; - let index_c${_} = offset_c${_} / 4u; - let component_a${_} = offset_a${_} % 4u; - let component_b${_} = offset_b${_} % 4u; - let component_c${_} = offset_c${_} % 4u; - ${d}[${_}] = ${f}(${p(T,k,g)}); - `};o===9?u=` - var data = vec4(0); - ${c("data",0,"u32")} - ${c("data",1,"u32")} - ${c("data",2,"u32")} - ${c("data",3,"u32")} - output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:u=` - ${c("output_data[global_idx]",0)} - ${c("output_data[global_idx]",1)} - ${c("output_data[global_idx]",2)} - ${c("output_data[global_idx]",3)} - `}return` - ${e.registerUniform("vec_size","u32").declareVariables(l,i,a,n)} - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - ${u} - }`},fg=e=>{let r=e[1].dims,t=e[2].dims,s=e[0].dims,o=e[1].dataType,n=!(Me.areEqual(r,t)&&Me.areEqual(t,s)),i=r,a=Me.size(r);if(n){let u=Nn.calcShape(Nn.calcShape(r,t,!1),s,!1);if(!u)throw new Error("Can't perform where op on the given tensors");i=u,a=Me.size(i)}let l=Math.ceil(a/4);return{name:"Where",shaderCache:{inputDependencies:["rank","rank","rank"]},getShaderSource:u=>mg(u,e,i,n,o),getRunData:()=>({outputs:[{dims:i,dataType:o}],dispatchGroup:{x:Math.ceil(a/64/4)},programUniforms:[{type:12,data:l},...at(s,r,t,i)]})}},_g=e=>{e.compute(fg(e.inputs))}}),gg,wx=je(()=>{Av(),dl(),Fv(),Ov(),Dv(),Lv(),zv(),Vv(),Wv(),Gv(),Kv(),Hv(),qv(),Qv(),Xv(),Jv(),Yv(),Zv(),ex(),tx(),rx(),sx(),nx(),ox(),ix(),$f(),ax(),lx(),ux(),cx(),dx(),ll(),px(),Rf(),hx(),mx(),fx(),Lf(),_x(),Ws(),fl(),gx(),gg=new Map([["Abs",[Xp]],["Acos",[Jp]],["Acosh",[Yp]],["Add",[Rh]],["ArgMax",[Dp,cl]],["ArgMin",[Op,cl]],["Asin",[Zp]],["Asinh",[eh]],["Atan",[th]],["Atanh",[rh]],["Attention",[Np]],["AveragePool",[f_,m_]],["BatchNormalization",[Gp]],["BiasAdd",[qp]],["BiasSplitGelu",[Lh]],["Cast",[nh,sh]],["Ceil",[ah]],["Clip",[ih]],["Concat",[Zh,em]],["Conv",[Sl,Pl]],["ConvTranspose",[Cm,Tm]],["Cos",[lh]],["Cosh",[uh]],["CumSum",[$m,km]],["DepthToSpace",[Om,Dm]],["DequantizeLinear",[T_,E_]],["Div",[jh]],["Einsum",[Nm,Vm]],["Elu",[ch,fo]],["Equal",[Nh]],["Erf",[dh]],["Exp",[ph]],["Expand",[Km]],["FastGelu",[qm]],["Floor",[hh]],["FusedConv",[Sl,Pl]],["Gather",[Ym,Jm]],["GatherElements",[cf,uf]],["GatherBlockQuantized",[nf,of]],["GatherND",[ef,tf]],["Gelu",[mh]],["Gemm",[mf,hf]],["GlobalAveragePool",[g_,__]],["GlobalMaxPool",[y_,b_]],["Greater",[Gh]],["GreaterOrEqual",[Hh]],["GridSample",[xf,Tf]],["GroupQueryAttention",[Uf]],["HardSigmoid",[vh,yh]],["InstanceNormalization",[Kf]],["LayerNormalization",[Qf]],["LeakyRelu",[fh,fo]],["Less",[Kh]],["LessOrEqual",[qh]],["Log",[kh]],["MatMul",[Jf]],["MatMulNBits",[t_,r_]],["MaxPool",[w_,M_]],["Mul",[Vh]],["MultiHeadAttention",[Sf,Pf]],["Neg",[gh]],["Not",[_h]],["Pad",[d_]],["Pow",[Uh]],["QuickGelu",[Fh,fo]],["Range",[S_]],["Reciprocal",[wh]],["ReduceMin",[$p]],["ReduceMean",[Tp]],["ReduceMax",[Sp]],["ReduceSum",[Ip]],["ReduceProd",[kp]],["ReduceL1",[Ep]],["ReduceL2",[Pp]],["ReduceLogSum",[Fp]],["ReduceLogSumExp",[Cp]],["ReduceSumSquare",[Ap]],["Relu",[Mh]],["Resize",[Q_,X_]],["RotaryEmbedding",[Bf]],["ScatterND",[A_,I_]],["Sigmoid",[bh]],["Sin",[xh]],["Sinh",[Th]],["Slice",[ng,og]],["SkipLayerNormalization",[Z_]],["Split",[Of,Df]],["Sqrt",[Eh]],["Softmax",[lg,ug]],["Sub",[Wh]],["Tan",[Ph]],["Tanh",[Ch]],["ThresholdedRelu",[$h,fo]],["Tile",[hg]],["Transpose",[Gd,Kd]],["Where",[_g]]])}),wg,Mx=je(()=>{ms(),Bs(),Tt(),wg=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,r){this.repo.set(e,r)}run(e,r,t,s,o){hs(e.programInfo.name);let n=this.backend.device,i=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let a=[];for(let u of r)a.push({binding:a.length,resource:{buffer:u.buffer}});for(let u of t)a.push({binding:a.length,resource:{buffer:u.buffer}});o&&a.push({binding:a.length,resource:o});let l=n.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:a,label:e.programInfo.name});if(this.backend.sessionStatus==="capturing"){let u={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:l,dispatchGroup:s};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(u)}i.setPipeline(e.computePipeline),i.setBindGroup(0,l),i.dispatchWorkgroups(...s),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType==="at-passes")&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),ts(e.programInfo.name)}dispose(){}build(e,r){hs(e.name);let t=this.backend.device,s=[];[{feature:"shader-f16",extension:"f16"},{feature:"subgroups",extension:"subgroups"}].forEach(u=>{t.features.has(u.feature)&&s.push(`enable ${u.extension};`)});let o=Rd(r,this.backend.device.limits),n=e.getShaderSource(o),i=`${s.join(` -`)} -${o.additionalImplementations} -${n}`,a=t.createShaderModule({code:i,label:e.name});It("verbose",()=>`[WebGPU] ${e.name} shader code: ${i}`);let l=t.createComputePipeline({compute:{module:a,entryPoint:"main"},layout:"auto",label:e.name});return ts(e.name),{programInfo:e,computePipeline:l,uniformVariablesInfo:o.variablesInfo}}normalizeDispatchGroupSize(e){let r=typeof e=="number"?e:e.x,t=typeof e=="number"?1:e.y||1,s=typeof e=="number"?1:e.z||1,o=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(r<=o&&t<=o&&s<=o)return[r,t,s];let n=r*t*s,i=Math.ceil(Math.sqrt(n));if(i>o){if(i=Math.ceil(Math.cbrt(n)),i>o)throw new Error("Total dispatch size exceeds WebGPU maximum.");return[i,i,i]}else return[i,i,1]}}}),Mg={};Rn(Mg,{WebGpuBackend:()=>xg});var bg,yg,vg,xg,bx=je(()=>{ms(),ft(),Bs(),Ed(),kv(),wx(),Mx(),bg=(e,r)=>{if(r.length!==e.length)throw new Error(`inputDependencies length ${r.length} is not equal to inputTensors length ${e.length}.`);let t=[];for(let s=0;s{var o,n;let s=e.name;return(o=e.shaderCache)!=null&&o.hint&&(s+="["+e.shaderCache.hint+"]"),s+=":"+t+`:${bg(r,((n=e.shaderCache)==null?void 0:n.inputDependencies)??new Array(r.length).fill("dims"))}`,s},vg=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},xg=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus="default",this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw new Error("currentKernelCustomData(): currentKernelId is null. (should not happen)");let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,r){this.env=e;let t=[],s={requiredLimits:{maxComputeWorkgroupStorageSize:r.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:r.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:r.limits.maxStorageBufferBindingSize,maxBufferSize:r.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:r.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:r.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:r.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:r.limits.maxComputeWorkgroupSizeZ},requiredFeatures:t},o=n=>r.features.has(n)&&t.push(n)&&!0;o("chromium-experimental-timestamp-query-inside-passes")||o("timestamp-query"),o("shader-f16"),o("subgroups"),this.device=await r.requestDevice(s),this.adapterInfo=new vg(r.info||await r.requestAdapterInfo()),this.gpuDataManager=Dd(this),this.programManager=new wg(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,Ka(e.logLevel,!!e.debug),this.device.onuncapturederror=n=>{n.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${n.error.message}`)},Object.defineProperty(this.env.webgpu,"device",{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,"adapter",{value:r,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<"u"&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder()),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),r={};this.queryType==="at-passes"&&(r.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(r)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;hs(),this.endComputePass();let e;this.queryType!=="none"&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!=="none"&&e.mapAsync(GPUMapMode.READ).then(()=>{var s;let r=new BigUint64Array(e.getMappedRange()),t=this.pendingQueries.get(e);for(let o=0;o"u"&&(this.queryTimeBase=_);let T=Number(_-this.queryTimeBase),k=Number(f-this.queryTimeBase);if(!Number.isSafeInteger(T)||!Number.isSafeInteger(k))throw new RangeError("incorrect timestamp range");if((s=this.env.webgpu.profiling)!=null&&s.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:c.map(g=>({dims:g.dims,dataType:zs(g.dataType)})),outputsMetadata:d.map(g=>({dims:g.dims,dataType:zs(g.dataType)})),kernelId:i,kernelType:l,kernelName:u,programName:p,startTime:T,endTime:k});else{let g="";c.forEach((S,E)=>{g+=`input[${E}]: [${S.dims}] | ${zs(S.dataType)}, `});let w="";d.forEach((S,E)=>{w+=`output[${E}]: [${S.dims}] | ${zs(S.dataType)}, `}),console.log(`[profiling] kernel "${i}|${l}|${u}|${p}" ${g}${w}execution time: ${k-T} ns`)}uo("GPU",`${p}::${_}::${f}`)}e.unmap(),this.pendingQueries.delete(e)}),ts()}run(e,r,t,s,o,n){hs(e.name);let i=[];for(let w=0;wS):t;if(p.length!==a.length)throw new Error(`Output size ${p.length} must be equal to ${a.length}.`);let c=[],d=[];for(let w=0;w=n)throw new Error(`Invalid output index: ${p[w]}`);if(p[w]===-3)continue;let S=p[w]===-1,E=p[w]===-2,v=S||E?o(a[w].dataType,a[w].dims):s(p[w],a[w].dataType,a[w].dims);if(c.push(v),v.data===0)continue;let M=this.gpuDataManager.get(v.data);if(!M)throw new Error(`no GPU data for output: ${v.data}`);if(S&&this.temporaryData.push(M),E){let y=this.kernelPersistentData.get(this.currentKernelId);y||(y=[],this.kernelPersistentData.set(this.currentKernelId,y)),y.push(M)}d.push(M)}if(i.length!==r.length||d.length!==c.length){if(d.length===0)return ts(e.name),c;throw new Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let _;if(u){let w=0,S=[];u.forEach(y=>{let C=typeof y.data=="number"?[y.data]:y.data;if(C.length===0)return;let F=y.type===10?2:4,z,K;y.type===10?(K=C.length>4?16:C.length>2?8:C.length*F,z=C.length>4?16:F*C.length):(K=C.length<=2?C.length*F:16,z=16),w=Math.ceil(w/K)*K,S.push(w);let q=y.type===10?8:4;w+=C.length>4?Math.ceil(C.length/q)*z:C.length*F});let E=16;w=Math.ceil(w/E)*E;let v=new ArrayBuffer(w);u.forEach((y,C)=>{let F=S[C],z=typeof y.data=="number"?[y.data]:y.data;if(y.type===6)new Int32Array(v,F,z.length).set(z);else if(y.type===12)new Uint32Array(v,F,z.length).set(z);else if(y.type===10)new Uint16Array(v,F,z.length).set(z);else if(y.type===1)new Float32Array(v,F,z.length).set(z);else throw new Error(`Unsupported uniform type: ${zs(y.type)}`)});let M=this.gpuDataManager.create(w,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(M.buffer,0,v,0,w),this.gpuDataManager.release(M.id),_={offset:0,size:w,buffer:M.buffer}}let f=this.programManager.normalizeDispatchGroupSize(l),T=f[1]===1&&f[2]===1,k=yg(e,r,T),g=this.programManager.getArtifact(k);if(g||(g=this.programManager.build(e,f),this.programManager.setArtifact(k,g),It("info",()=>`[artifact] key: ${k}, programName: ${e.name}`)),u&&g.uniformVariablesInfo){if(u.length!==g.uniformVariablesInfo.length)throw new Error(`Uniform variables count mismatch: expect ${g.uniformVariablesInfo.length}, got ${u.length} in program "${g.programInfo.name}".`);for(let w=0;w`[ProgramManager] run "${e.name}" (key=${k}) with ${f[0]}x${f[1]}x${f[2]}`),this.queryType!=="none"||this.sessionStatus==="capturing"){let w={kernelId:this.currentKernelId,programName:g.programInfo.name,inputTensorViews:r,outputTensorViews:c};this.pendingKernels.push(w),this.sessionStatus==="capturing"&&this.capturedPendingKernels.get(this.currentSessionId).push(w)}return this.programManager.run(g,i,d,f,_),ts(e.name),c}upload(e,r){this.gpuDataManager.upload(e,r)}memcpy(e,r){this.gpuDataManager.memcpy(e,r)}async download(e,r){await this.gpuDataManager.download(e,r)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,r,t,s){let o=gg.get(e);if(!o)throw new Error(`kernel not implemented: ${e}`);let n={kernelType:e,kernelName:s,kernelEntry:o[0],attributes:[o[1],t]};this.kernels.set(r,n)}releaseKernel(e){let r=this.kernelPersistentData.get(e);if(r){for(let t of r)this.gpuDataManager.release(t.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,r,t){let s=this.kernels.get(e);if(!s)throw new Error(`kernel not created: ${e}`);let o=s.kernelType,n=s.kernelName,i=s.kernelEntry,a=s.attributes;if(this.currentKernelId!==null)throw new Error(`kernel "[${o}] ${n}" is not allowed to be called recursively`);this.currentKernelId=e,a[0]&&(a[1]=a[0](a[1]),a[0]=void 0),It("info",()=>`[WebGPU] Start to run kernel "[${o}] ${n}"...`);let l=this.env.debug;this.temporaryData=[];try{return l&&this.device.pushErrorScope("validation"),i(r,a[1]),0}catch(u){return t.push(Promise.resolve(`[WebGPU] Kernel "[${o}] ${n}" failed. ${u}`)),1}finally{l&&t.push(this.device.popErrorScope().then(u=>u?`GPU validation error for kernel "[${o}] ${n}": ${u.message}`:null));for(let u of this.temporaryData)this.gpuDataManager.release(u.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,r,t,s){let o=this.sessionExternalDataMapping.get(e);o||(o=new Map,this.sessionExternalDataMapping.set(e,o));let n=o.get(r),i=this.gpuDataManager.registerExternalBuffer(t,s,n);return o.set(r,[i,t]),i}unregisterBuffers(e){let r=this.sessionExternalDataMapping.get(e);r&&(r.forEach(t=>this.gpuDataManager.unregisterExternalBuffer(t[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let r=this.gpuDataManager.get(e);if(!r)throw new Error(`no GPU data for buffer: ${e}`);return r.buffer}createDownloader(e,r,t){return async()=>{let s=await sl(this,e,r);return Ha(s.buffer,t)}}writeTimestamp(e){this.queryType==="inside-passes"&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){var e;this.queryType="none",(((e=this.env.webgpu.profiling)==null?void 0:e.mode)==="default"||(typeof this.env.trace>"u"?this.env.wasm.trace:this.env.trace))&&(this.device.features.has("chromium-experimental-timestamp-query-inside-passes")?this.queryType="inside-passes":this.device.features.has("timestamp-query")&&(this.queryType="at-passes"),this.queryType!=="none"&&typeof this.querySet>"u"&&(this.querySet=this.device.createQuerySet({type:"timestamp",count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){It("info","captureBegin"),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus="capturing"}captureEnd(){It("info","captureEnd"),this.flush(),this.sessionStatus="default"}replay(){It("info","replay"),this.sessionStatus="replaying";let e=this.capturedCommandList.get(this.currentSessionId),r=this.capturedPendingKernels.get(this.currentSessionId),t=e.length;this.pendingKernels=[];for(let s=0;s=this.maxDispatchNumber||this.queryType==="at-passes")&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus="default"}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),Tg={};Rn(Tg,{init:()=>Pg});var bi,Eg,Pg,yx=je(()=>{ft(),Bs(),yt(),$v(),bi=class W0{constructor(r,t,s,o){this.module=r,this.dataType=t,this.data=s,this.dims=o}getFloat32Array(){if(this.dataType!==1)throw new Error("Invalid data type");let r=Me.size(this.dims);return r===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,r)}getBigInt64Array(){if(this.dataType!==7)throw new Error("Invalid data type");let r=Me.size(this.dims);return r===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,r)}getInt32Array(){if(this.dataType!==6)throw new Error("Invalid data type");let r=Me.size(this.dims);return r===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,r)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw new Error("Invalid data type");let r=Me.size(this.dims);return r===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,r)}reshape(r){if(Me.size(r)!==Me.size(this.dims))throw new Error("Invalid new shape");return new W0(this.module,this.dataType,this.data,r)}},Eg=class{constructor(e,r,t){this.module=e,this.backend=r,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=r.adapterInfo;let s=e.PTR_SIZE,o=t/e.PTR_SIZE,n=s===4?"i32":"i64";this.opKernelContext=Number(e.getValue(s*o++,n));let i=Number(e.getValue(s*o++,n));this.outputCount=Number(e.getValue(s*o++,n)),this.customDataOffset=Number(e.getValue(s*o++,"*")),this.customDataSize=Number(e.getValue(s*o++,n));let a=[];for(let l=0;ltypeof a=="number"?this.inputs[a]:a))??this.inputs,s=(r==null?void 0:r.outputs)??[],o=(a,l,u)=>new bi(this.module,l,this.output(a,u),u),n=(a,l)=>{let u=on(a,l);if(!u)throw new Error(`Unsupported data type: ${a}`);let p=u>0?this.backend.gpuDataManager.create(u).id:0;return new bi(this.module,a,p,l)};return this.backend.run(e,t,s,o,n,this.outputCount)}output(e,r){let t=this.module.stackSave();try{let s=this.module.PTR_SIZE,o=s===4?"i32":"i64",n=this.module.stackAlloc((1+r.length)*s);this.module.setValue(n,r.length,o);for(let i=0;i{let o=r.jsepInit;if(!o)throw new Error("Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.");if(e==="webgpu"){let n=(bx(),io(Mg)).WebGpuBackend,i=new n;await i.initialize(t,s),o("webgpu",[i,a=>i.alloc(Number(a)),a=>i.free(a),(a,l,u,p=!1)=>{if(p)It("verbose",()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(a)}, dst=${Number(l)}, size=${Number(u)}`),i.memcpy(Number(a),Number(l));else{It("verbose",()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(a)}, gpuDataId=${Number(l)}, size=${Number(u)}`);let c=r.HEAPU8.subarray(Number(a>>>0),Number(a>>>0)+Number(u));i.upload(Number(l),c)}},async(a,l,u)=>{It("verbose",()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${a}, dataOffset=${l}, size=${u}`),await i.download(Number(a),()=>r.HEAPU8.subarray(Number(l)>>>0,Number(l+u)>>>0))},(a,l,u)=>i.createKernel(a,Number(l),u,r.UTF8ToString(r._JsepGetNodeName(Number(l)))),a=>i.releaseKernel(a),(a,l,u,p)=>{It("verbose",()=>`[WebGPU] jsepRun: sessionHandle=${u}, kernel=${a}, contextDataOffset=${l}`);let c=new Eg(r,i,Number(l));return i.computeKernel(Number(a),c,p)},()=>i.captureBegin(),()=>i.captureEnd(),()=>i.replay()])}else{let n=new Id(t);o("webnn",[n,()=>n.reserveTensorId(),i=>n.releaseTensorId(i),async(i,a,l,u,p)=>n.ensureTensor(i,a,l,u,p),(i,a)=>{n.uploadTensor(i,a)},async(i,a)=>n.downloadTensor(i,a)])}}}),Cg,Yl,Zl,Gs,Sg,eu,yi,tu,ru,su,nu,ou,iu,$g=je(()=>{Pv(),Cv(),ft(),nn(),ja(),fd(),Cg=(e,r)=>{Qt()._OrtInit(e,r)!==0&&Gt("Can't initialize onnxruntime.")},Yl=async e=>{Cg(e.wasm.numThreads,ii(e.logLevel))},Zl=async(e,r)=>{var t,s;(s=(t=Qt()).asyncInit)==null||s.call(t);{let o=(yx(),io(Tg)).init;if(r==="webgpu"){if(typeof navigator>"u"||!navigator.gpu)throw new Error("WebGPU is not supported in current environment");let n=e.webgpu.adapter;if(n){if(typeof n.limits!="object"||typeof n.features!="object"||typeof n.requestDevice!="function")throw new Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let i=e.webgpu.powerPreference;if(i!==void 0&&i!=="low-power"&&i!=="high-performance")throw new Error(`Invalid powerPreference setting: "${i}"`);let a=e.webgpu.forceFallbackAdapter;if(a!==void 0&&typeof a!="boolean")throw new Error(`Invalid forceFallbackAdapter setting: "${a}"`);if(n=await navigator.gpu.requestAdapter({powerPreference:i,forceFallbackAdapter:a}),!n)throw new Error('Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.')}await o("webgpu",Qt(),e,n)}if(r==="webnn"){if(typeof navigator>"u"||!navigator.ml)throw new Error("WebNN is not supported in current environment");await o("webnn",Qt(),e)}}},Gs=new Map,Sg=e=>{let r=Qt(),t=r.stackSave();try{let s=r.PTR_SIZE,o=r.stackAlloc(2*s);r._OrtGetInputOutputCount(e,o,o+s)!==0&&Gt("Can't get session input/output count.");let n=s===4?"i32":"i64";return[Number(r.getValue(o,n)),Number(r.getValue(o+s,n))]}finally{r.stackRestore(t)}},eu=(e,r)=>{let t=Qt(),s=t.stackSave(),o=0;try{let n=t.PTR_SIZE,i=t.stackAlloc(2*n);t._OrtGetInputOutputMetadata(e,r,i,i+n)!==0&&Gt("Can't get session input/output metadata.");let a=Number(t.getValue(i,"*"));o=Number(t.getValue(i+n,"*"));let l=t.HEAP32[o/4];if(l===0)return[a,0];let u=t.HEAPU32[o/4+1],p=[];for(let c=0;c{let r=Qt(),t=r._malloc(e.byteLength);if(t===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return r.HEAPU8.set(e,t),[t,e.byteLength]},tu=async(e,r)=>{var c,d,_,f;let t,s,o=Qt();Array.isArray(e)?[t,s]=e:e.buffer===o.HEAPU8.buffer?[t,s]=[e.byteOffset,e.byteLength]:[t,s]=yi(e);let n=0,i=0,a=0,l=[],u=[],p=[];try{if([i,l]=await md(r),(r==null?void 0:r.externalData)&&o.mountExternalData){let C=[];for(let F of r.externalData){let z=typeof F=="string"?F:F.path;C.push(Ga(typeof F=="string"?F:F.data).then(K=>{o.mountExternalData(z,K)}))}await Promise.all(C)}for(let C of(r==null?void 0:r.executionProviders)??[])if((typeof C=="string"?C:C.name)==="webnn"){if(o.shouldTransferToMLTensor=!1,typeof C!="string"){let F=C,z=F==null?void 0:F.context,K=F==null?void 0:F.gpuDevice,q=F==null?void 0:F.deviceType,R=F==null?void 0:F.powerPreference;z?o.currentContext=z:K?o.currentContext=await o.webnnCreateMLContext(K):o.currentContext=await o.webnnCreateMLContext({deviceType:q,powerPreference:R})}else o.currentContext=await o.webnnCreateMLContext();break}n=await o._OrtCreateSession(t,s,i),(c=o.webgpuOnCreateSession)==null||c.call(o,n),n===0&&Gt("Can't create a session."),(d=o.jsepOnCreateSession)==null||d.call(o),o.currentContext&&(o.webnnRegisterMLContext(n,o.currentContext),o.currentContext=void 0,o.shouldTransferToMLTensor=!0);let[T,k]=Sg(n),g=!!(r!=null&&r.enableGraphCapture),w=[],S=[],E=[],v=[],M=[];for(let C=0;CC==="gpu-buffer"||C==="ml-tensor")&&(a=o._OrtCreateBinding(n),a===0&&Gt("Can't create IO binding."),y={handle:a,outputPreferredLocations:M,outputPreferredLocationsEncoded:M.map(C=>Wa(C))}),Gs.set(n,[n,u,p,y,g,!1]),[n,w,S,E,v]}catch(T){throw u.forEach(k=>o._OrtFree(k)),p.forEach(k=>o._OrtFree(k)),a!==0&&o._OrtReleaseBinding(a)!==0&&Gt("Can't release IO binding."),n!==0&&o._OrtReleaseSession(n)!==0&&Gt("Can't release session."),T}finally{o._free(t),i!==0&&o._OrtReleaseSessionOptions(i)!==0&&Gt("Can't release session options."),l.forEach(T=>o._free(T)),(f=o.unmountExternalData)==null||f.call(o)}},ru=e=>{var l,u,p;let r=Qt(),t=Gs.get(e);if(!t)throw new Error(`cannot release session. invalid session id: ${e}`);let[s,o,n,i,a]=t;i&&(a&&r._OrtClearBoundOutputs(i.handle)!==0&&Gt("Can't clear bound outputs."),r._OrtReleaseBinding(i.handle)!==0&&Gt("Can't release IO binding.")),(l=r.jsepOnReleaseSession)==null||l.call(r,e),(u=r.webnnOnReleaseSession)==null||u.call(r,e),(p=r.webgpuOnReleaseSession)==null||p.call(r,e),o.forEach(c=>r._OrtFree(c)),n.forEach(c=>r._OrtFree(c)),r._OrtReleaseSession(s)!==0&&Gt("Can't release session."),Gs.delete(e)},su=async(e,r,t,s,o,n,i=!1)=>{if(!e){r.push(0);return}let a=Qt(),l=a.PTR_SIZE,u=e[0],p=e[1],c=e[3],d=c,_,f;if(u==="string"&&(c==="gpu-buffer"||c==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(i&&c!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${n} when enableGraphCapture is true.`);if(c==="gpu-buffer"){let g=e[2].gpuBuffer;f=on(jn(u),p);{let w=a.jsepRegisterBuffer;if(!w)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');_=w(s,n,g,f)}}else if(c==="ml-tensor"){let g=e[2].mlTensor;f=on(jn(u),p);let w=a.webnnRegisterMLTensor;if(!w)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');_=w(s,g,jn(u),p)}else{let g=e[2];if(Array.isArray(g)){f=l*g.length,_=a._malloc(f),t.push(_);for(let w=0;wa.setValue(k+S*l,w,l===4?"i32":"i64"));let g=a._OrtCreateTensor(jn(u),_,f,k,p.length,Wa(d));g===0&&Gt(`Can't create tensor for input/output. session=${s}, index=${n}.`),r.push(g)}finally{a.stackRestore(T)}},nu=async(e,r,t,s,o,n)=>{var K,q,R,Z;let i=Qt(),a=i.PTR_SIZE,l=Gs.get(e);if(!l)throw new Error(`cannot run inference. invalid session id: ${e}`);let u=l[0],p=l[1],c=l[2],d=l[3],_=l[4],f=l[5],T=r.length,k=s.length,g=0,w=[],S=[],E=[],v=[],M=i.stackSave(),y=i.stackAlloc(T*a),C=i.stackAlloc(T*a),F=i.stackAlloc(k*a),z=i.stackAlloc(k*a);try{[g,w]=ud(n);for(let Q=0;QW*re,1);A=zs(_e);let pe=d==null?void 0:d.outputPreferredLocations[s[Q]];if(A==="string"){if(pe==="gpu-buffer"||pe==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let W=[];for(let re=0;re0){let W=i.jsepGetBuffer;if(!W)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let re=W(U),G=on(_e,Ue);if(G===void 0||!Va(A))throw new Error(`Unsupported data type: ${A}`);V=!0,J.push([A,ze,{gpuBuffer:re,download:i.jsepCreateDownloader(re,G,A),dispose:()=>{i._OrtReleaseTensor(se)!==0&&Gt("Can't release tensor.")}},"gpu-buffer"])}else if(pe==="ml-tensor"&&Ue>0){let W=i.webnnEnsureTensor,re=i.webnnIsInt64Supported;if(!W||!re)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(on(_e,Ue)===void 0||!Ua(A))throw new Error(`Unsupported data type: ${A}`);if(A==="int64"&&!re(e))throw new Error('preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.');let G=await W(e,U,_e,ze,!1);V=!0,J.push([A,ze,{mlTensor:G,download:i.webnnCreateMLTensorDownloader(U,A),dispose:()=>{i.webnnReleaseTensorId(U),i._OrtReleaseTensor(se)}},"ml-tensor"])}else{let W=Na(A),re=new W(Ue);new Uint8Array(re.buffer,re.byteOffset,re.byteLength).set(i.HEAPU8.subarray(U,U+re.byteLength)),J.push([A,ze,re,"cpu"])}}finally{i.stackRestore(fe),A==="string"&&U&&i._free(U),V||i._OrtReleaseTensor(se),(Z=i.webnnOnRunEnd)==null||Z.call(i,u)}}return d&&!_&&(i._OrtClearBoundOutputs(d.handle)!==0&&Gt("Can't clear bound outputs."),Gs.set(e,[u,p,c,d,_,!1])),J}finally{i.stackRestore(M),S.forEach(H=>i._OrtReleaseTensor(H)),E.forEach(H=>i._OrtReleaseTensor(H)),v.forEach(H=>i._free(H)),g!==0&&i._OrtReleaseRunOptions(g),w.forEach(H=>i._free(H))}},ou=e=>{let r=Qt(),t=Gs.get(e);if(!t)throw new Error("invalid session id");let s=t[0],o=r._OrtEndProfiling(s);o===0&&Gt("Can't get an profile file name."),r._OrtFree(o)},iu=e=>{let r=[];for(let t of e){let s=t[2];!Array.isArray(s)&&"buffer"in s&&r.push(s.buffer)}return r}}),Ks,Wr,Wn,vo,xo,vi,au,xi,hn,mn,kg,Ig,Ag,Fg,Og,Dg,Lg,zg,Bg=je(()=>{ms(),$g(),nn(),La(),Ks=()=>!!Xt.wasm.proxy&&typeof document<"u",Wn=!1,vo=!1,xo=!1,xi=new Map,hn=(e,r)=>{let t=xi.get(e);t?t.push(r):xi.set(e,[r])},mn=()=>{if(Wn||!vo||xo||!Wr)throw new Error("worker not ready")},kg=e=>{switch(e.data.type){case"init-wasm":Wn=!1,e.data.err?(xo=!0,au[1](e.data.err)):(vo=!0,au[0]()),vi&&(URL.revokeObjectURL(vi),vi=void 0);break;case"init-ep":case"copy-from":case"create":case"release":case"run":case"end-profiling":{let r=xi.get(e.data.type);e.data.err?r.shift()[1](e.data.err):r.shift()[0](e.data.out);break}}},Ig=async()=>{if(!vo){if(Wn)throw new Error("multiple calls to 'initWasm()' detected.");if(xo)throw new Error("previous call to 'initWasm()' failed.");if(Wn=!0,Ks())return new Promise((e,r)=>{Wr==null||Wr.terminate(),nd().then(([t,s])=>{try{Wr=s,Wr.onerror=n=>r(n),Wr.onmessage=kg,au=[e,r];let o={type:"init-wasm",in:Xt};!o.in.wasm.wasmPaths&&(t||Aa)&&(o.in.wasm.wasmPaths={wasm:new URL("/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",self.location.href).href}),Wr.postMessage(o),vi=t}catch(o){r(o)}},r)});try{await Ra(Xt.wasm),await Yl(Xt),vo=!0}catch(e){throw xo=!0,e}finally{Wn=!1}}},Ag=async e=>{if(Ks())return mn(),new Promise((r,t)=>{hn("init-ep",[r,t]);let s={type:"init-ep",in:{epName:e,env:Xt}};Wr.postMessage(s)});await Zl(Xt,e)},Fg=async e=>Ks()?(mn(),new Promise((r,t)=>{hn("copy-from",[r,t]);let s={type:"copy-from",in:{buffer:e}};Wr.postMessage(s,[e.buffer])})):yi(e),Og=async(e,r)=>{if(Ks()){if(r!=null&&r.preferredOutputLocation)throw new Error('session option "preferredOutputLocation" is not supported for proxy.');return mn(),new Promise((t,s)=>{hn("create",[t,s]);let o={type:"create",in:{model:e,options:{...r}}},n=[];e instanceof Uint8Array&&n.push(e.buffer),Wr.postMessage(o,n)})}else return tu(e,r)},Dg=async e=>{if(Ks())return mn(),new Promise((r,t)=>{hn("release",[r,t]);let s={type:"release",in:e};Wr.postMessage(s)});ru(e)},Lg=async(e,r,t,s,o,n)=>{if(Ks()){if(t.some(i=>i[3]!=="cpu"))throw new Error("input tensor on GPU is not supported for proxy.");if(o.some(i=>i))throw new Error("pre-allocated output tensor is not supported for proxy.");return mn(),new Promise((i,a)=>{hn("run",[i,a]);let l=t,u={type:"run",in:{sessionId:e,inputIndices:r,inputs:l,outputIndices:s,options:n}};Wr.postMessage(u,iu(l))})}else return nu(e,r,t,s,o,n)},zg=async e=>{if(Ks())return mn(),new Promise((r,t)=>{hn("end-profiling",[r,t]);let s={type:"end-profiling",in:e};Wr.postMessage(s)});ou(e)}}),lu,Rg,jg,vx=je(()=>{ms(),Bg(),ft(),Pa(),fd(),lu=(e,r)=>{switch(e.location){case"cpu":return[e.type,e.dims,e.data,"cpu"];case"gpu-buffer":return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},"gpu-buffer"];case"ml-tensor":return[e.type,e.dims,{mlTensor:e.mlTensor},"ml-tensor"];default:throw new Error(`invalid data location: ${e.location} for ${r()}`)}},Rg=e=>{switch(e[3]){case"cpu":return new ps(e[0],e[2],e[1]);case"gpu-buffer":{let r=e[0];if(!Va(r))throw new Error(`not supported data type: ${r} for deserializing GPU tensor`);let{gpuBuffer:t,download:s,dispose:o}=e[2];return ps.fromGpuBuffer(t,{dataType:r,dims:e[1],download:s,dispose:o})}case"ml-tensor":{let r=e[0];if(!Ua(r))throw new Error(`not supported data type: ${r} for deserializing MLTensor tensor`);let{mlTensor:t,download:s,dispose:o}=e[2];return ps.fromMLTensor(t,{dataType:r,dims:e[1],download:s,dispose:o})}default:throw new Error(`invalid data location: ${e[3]}`)}},jg=class{async fetchModelAndCopyToWasmMemory(e){return Fg(await Ga(e))}async loadModel(e,r){hs();let t;typeof e=="string"?t=await this.fetchModelAndCopyToWasmMemory(e):t=e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Og(t,r),ts()}async dispose(){return Dg(this.sessionId)}async run(e,r,t){hs();let s=[],o=[];Object.entries(e).forEach(c=>{let d=c[0],_=c[1],f=this.inputNames.indexOf(d);if(f===-1)throw new Error(`invalid input '${d}'`);s.push(_),o.push(f)});let n=[],i=[];Object.entries(r).forEach(c=>{let d=c[0],_=c[1],f=this.outputNames.indexOf(d);if(f===-1)throw new Error(`invalid output '${d}'`);n.push(_),i.push(f)});let a=s.map((c,d)=>lu(c,()=>`input "${this.inputNames[o[d]]}"`)),l=n.map((c,d)=>c?lu(c,()=>`output "${this.outputNames[i[d]]}"`):null),u=await Lg(this.sessionId,o,a,i,l,t),p={};for(let c=0;ccu,initializeFlags:()=>uu,wasmBackend:()=>Vg});var uu,cu,Vg,xx=je(()=>{ms(),Bg(),vx(),uu=()=>{(typeof Xt.wasm.initTimeout!="number"||Xt.wasm.initTimeout<0)&&(Xt.wasm.initTimeout=0);let e=Xt.wasm.simd;if(typeof e!="boolean"&&e!==void 0&&e!=="fixed"&&e!=="relaxed"&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),Xt.wasm.simd=!1),typeof Xt.wasm.proxy!="boolean"&&(Xt.wasm.proxy=!1),typeof Xt.wasm.trace!="boolean"&&(Xt.wasm.trace=!1),typeof Xt.wasm.numThreads!="number"||!Number.isInteger(Xt.wasm.numThreads)||Xt.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)Xt.wasm.numThreads=1;else{let r=typeof navigator>"u"?uv("node:os").cpus().length:navigator.hardwareConcurrency;Xt.wasm.numThreads=Math.min(4,Math.ceil((r||1)/2))}},cu=class{async init(e){uu(),await Ig(),await Ag(e)}async createInferenceSessionHandler(e,r){let t=new jg;return await t.loadModel(e,r),t}},Vg=new cu});ms(),ms(),ms();var Tx="1.22.0-dev.20250409-89f8206ba4",Ex=Hc;{let e=(xx(),io(Ng)).wasmBackend;rn("webgpu",e,5),rn("webnn",e,5),rn("cpu",e,10),rn("wasm",e,10)}Object.defineProperty(Xt.versions,"web",{value:Tx,enumerable:!0});/** -* @license -* Copyright 2021 Google LLC. All Rights Reserved. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================================= -*//** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - *//** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */var Px=Object.freeze({__proto__:null,get InferenceSession(){return Ea},get TRACE(){return uo},get TRACE_FUNC_BEGIN(){return hs},get TRACE_FUNC_END(){return ts},get Tensor(){return ps},default:Ex,get env(){return Xt},get registerBackend(){return rn}}),js={},Cx={"onnxruntime-common":e=>{e.exports=ov},"onnxruntime-web":e=>{e.exports=Px},"?2ce3":()=>{},"?7a2c":()=>{},"?a42a":()=>{},"?2b25":()=>{},"?569f":()=>{},"?3f59":()=>{},"?154a":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(e,r,t)=>{t.r(r),t.d(r,{Environment:()=>Be,Interpreter:()=>He,Template:()=>rs,parse:()=>U,tokenize:()=>c});var s=Object.freeze({Text:"Text",NumericLiteral:"NumericLiteral",BooleanLiteral:"BooleanLiteral",NullLiteral:"NullLiteral",StringLiteral:"StringLiteral",Identifier:"Identifier",Equals:"Equals",OpenParen:"OpenParen",CloseParen:"CloseParen",OpenStatement:"OpenStatement",CloseStatement:"CloseStatement",OpenExpression:"OpenExpression",CloseExpression:"CloseExpression",OpenSquareBracket:"OpenSquareBracket",CloseSquareBracket:"CloseSquareBracket",OpenCurlyBracket:"OpenCurlyBracket",CloseCurlyBracket:"CloseCurlyBracket",Comma:"Comma",Dot:"Dot",Colon:"Colon",Pipe:"Pipe",CallOperator:"CallOperator",AdditiveBinaryOperator:"AdditiveBinaryOperator",MultiplicativeBinaryOperator:"MultiplicativeBinaryOperator",ComparisonBinaryOperator:"ComparisonBinaryOperator",UnaryOperator:"UnaryOperator",Set:"Set",If:"If",For:"For",In:"In",Is:"Is",NotIn:"NotIn",Else:"Else",EndSet:"EndSet",EndIf:"EndIf",ElseIf:"ElseIf",EndFor:"EndFor",And:"And",Or:"Or",Not:"UnaryOperator",Macro:"Macro",EndMacro:"EndMacro",Break:"Break",Continue:"Continue"}),o=Object.freeze({set:s.Set,for:s.For,in:s.In,is:s.Is,if:s.If,else:s.Else,endset:s.EndSet,endif:s.EndIf,elif:s.ElseIf,endfor:s.EndFor,and:s.And,or:s.Or,not:s.Not,"not in":s.NotIn,macro:s.Macro,endmacro:s.EndMacro,break:s.Break,continue:s.Continue,true:s.BooleanLiteral,false:s.BooleanLiteral,none:s.NullLiteral,True:s.BooleanLiteral,False:s.BooleanLiteral,None:s.NullLiteral}),n=class{constructor(D,oe){this.value=D,this.type=oe}};function i(D){return/\w/.test(D)}function a(D){return/[0-9]/.test(D)}var l=[["{%",s.OpenStatement],["%}",s.CloseStatement],["{{",s.OpenExpression],["}}",s.CloseExpression],["(",s.OpenParen],[")",s.CloseParen],["{",s.OpenCurlyBracket],["}",s.CloseCurlyBracket],["[",s.OpenSquareBracket],["]",s.CloseSquareBracket],[",",s.Comma],[".",s.Dot],[":",s.Colon],["|",s.Pipe],["<=",s.ComparisonBinaryOperator],[">=",s.ComparisonBinaryOperator],["==",s.ComparisonBinaryOperator],["!=",s.ComparisonBinaryOperator],["<",s.ComparisonBinaryOperator],[">",s.ComparisonBinaryOperator],["+",s.AdditiveBinaryOperator],["-",s.AdditiveBinaryOperator],["*",s.MultiplicativeBinaryOperator],["/",s.MultiplicativeBinaryOperator],["%",s.MultiplicativeBinaryOperator],["=",s.Equals]],u=new Map([["n",` -`],["t"," "],["r","\r"],["b","\b"],["f","\f"],["v","\v"],["'","'"],['"','"'],["\\","\\"]]);function p(D,oe={}){return D.endsWith(` -`)&&(D=D.slice(0,-1)),D=D.replace(/{#.*?#}/gs,"{##}"),oe.lstrip_blocks&&(D=D.replace(/^[ \t]*({[#%])/gm,"$1")),oe.trim_blocks&&(D=D.replace(/([#%]})\n/g,"$1")),D.replace(/{##}/g,"").replace(/-%}\s*/g,"%}").replace(/\s*{%-/g,"{%").replace(/-}}\s*/g,"}}").replace(/\s*{{-/g,"{{")}function c(D,oe={}){var ve,vt,Ft;const B=[],te=p(D,oe);let me=0;const Oe=ht=>{let ut="";for(;ht(te[me]);){if(te[me]==="\\"){if(++me,me>=te.length)throw new SyntaxError("Unexpected end of input");const rt=te[me++],jt=u.get(rt);if(jt===void 0)throw new SyntaxError(`Unexpected escaped character: ${rt}`);ut+=jt;continue}if(ut+=te[me++],me>=te.length)throw new SyntaxError("Unexpected end of input")}return ut};e:for(;me0){B.push(new n(rt,s.Text));continue}}Oe(rt=>/\s/.test(rt));const ut=te[me];if(ut==="-"||ut==="+"){const rt=(vt=B.at(-1))==null?void 0:vt.type;if(rt===s.Text||rt===void 0)throw new SyntaxError(`Unexpected character: ${ut}`);switch(rt){case s.Identifier:case s.NumericLiteral:case s.BooleanLiteral:case s.NullLiteral:case s.StringLiteral:case s.CloseParen:case s.CloseSquareBracket:break;default:{++me;const jt=Oe(a);B.push(new n(`${ut}${jt}`,jt.length>0?s.NumericLiteral:s.UnaryOperator));continue}}}for(const[rt,jt]of l)if(te.slice(me,me+rt.length)===rt){B.push(new n(rt,jt)),me+=rt.length;continue e}if(ut==="'"||ut==='"'){++me;const rt=Oe(jt=>jt!==ut);B.push(new n(rt,s.StringLiteral)),++me;continue}if(a(ut)){const rt=Oe(a);B.push(new n(rt,s.NumericLiteral));continue}if(i(ut)){const rt=Oe(i),jt=Object.hasOwn(o,rt)?o[rt]:s.Identifier;jt===s.In&&((Ft=B.at(-1))==null?void 0:Ft.type)===s.Not?(B.pop(),B.push(new n("not in",s.NotIn))):B.push(new n(rt,jt));continue}throw new SyntaxError(`Unexpected character: ${ut}`)}return B}var d=class{constructor(){Y(this,"type","Statement")}},_=class extends d{constructor(oe){super();Y(this,"type","Program");this.body=oe}},f=class extends d{constructor(oe,B,te){super();Y(this,"type","If");this.test=oe,this.body=B,this.alternate=te}},T=class extends d{constructor(oe,B,te,me){super();Y(this,"type","For");this.loopvar=oe,this.iterable=B,this.body=te,this.defaultBlock=me}},k=class extends d{constructor(){super(...arguments);Y(this,"type","Break")}},g=class extends d{constructor(){super(...arguments);Y(this,"type","Continue")}},w=class extends d{constructor(oe,B,te){super();Y(this,"type","Set");this.assignee=oe,this.value=B,this.body=te}},S=class extends d{constructor(oe,B,te){super();Y(this,"type","Macro");this.name=oe,this.args=B,this.body=te}},E=class extends d{constructor(){super(...arguments);Y(this,"type","Expression")}},v=class extends E{constructor(oe,B,te){super();Y(this,"type","MemberExpression");this.object=oe,this.property=B,this.computed=te}},M=class extends E{constructor(oe,B){super();Y(this,"type","CallExpression");this.callee=oe,this.args=B}},y=class extends E{constructor(oe){super();Y(this,"type","Identifier");this.value=oe}},C=class extends E{constructor(oe){super();Y(this,"type","Literal");this.value=oe}},F=class extends C{constructor(){super(...arguments);Y(this,"type","NumericLiteral")}},z=class extends C{constructor(){super(...arguments);Y(this,"type","StringLiteral")}},K=class extends C{constructor(){super(...arguments);Y(this,"type","BooleanLiteral")}},q=class extends C{constructor(){super(...arguments);Y(this,"type","NullLiteral")}},R=class extends C{constructor(){super(...arguments);Y(this,"type","ArrayLiteral")}},Z=class extends C{constructor(){super(...arguments);Y(this,"type","TupleLiteral")}},H=class extends C{constructor(){super(...arguments);Y(this,"type","ObjectLiteral")}},J=class extends E{constructor(oe,B,te){super();Y(this,"type","BinaryExpression");this.operator=oe,this.left=B,this.right=te}},Q=class extends E{constructor(oe,B){super();Y(this,"type","FilterExpression");this.operand=oe,this.filter=B}},se=class extends E{constructor(oe,B){super();Y(this,"type","SelectExpression");this.iterable=oe,this.test=B}},fe=class extends E{constructor(oe,B,te){super();Y(this,"type","TestExpression");this.operand=oe,this.negate=B,this.test=te}},ae=class extends E{constructor(oe,B){super();Y(this,"type","UnaryExpression");this.operator=oe,this.argument=B}},V=class extends E{constructor(oe=void 0,B=void 0,te=void 0){super();Y(this,"type","SliceExpression");this.start=oe,this.stop=B,this.step=te}},A=class extends E{constructor(oe,B){super();Y(this,"type","KeywordArgumentExpression");this.key=oe,this.value=B}};function U(D){const oe=new _([]);let B=0;function te(Ae,Je){const it=D[B++];if(!it||it.type!==Ae)throw new Error(`Parser Error: ${Je}. ${it.type} !== ${Ae}.`);return it}function me(){switch(D[B].type){case s.Text:return vt();case s.OpenStatement:return Ft();case s.OpenExpression:return ht();default:throw new SyntaxError(`Unexpected token type: ${D[B].type}`)}}function Oe(...Ae){return B+Ae.length<=D.length&&Ae.some((Je,it)=>Je!==D[B+it].type)}function ve(...Ae){return B+Ae.length<=D.length&&Ae.every((Je,it)=>Je===D[B+it].type)}function vt(){return new z(te(s.Text,"Expected text token").value)}function Ft(){te(s.OpenStatement,"Expected opening statement token");let Ae;switch(D[B].type){case s.Set:++B,Ae=ut(),te(s.CloseStatement,"Expected closing statement token");break;case s.If:++B,Ae=rt(),te(s.OpenStatement,"Expected {% token"),te(s.EndIf,"Expected endif token"),te(s.CloseStatement,"Expected %} token");break;case s.Macro:++B,Ae=jt(),te(s.OpenStatement,"Expected {% token"),te(s.EndMacro,"Expected endmacro token"),te(s.CloseStatement,"Expected %} token");break;case s.For:++B,Ae=wr(),te(s.OpenStatement,"Expected {% token"),te(s.EndFor,"Expected endfor token"),te(s.CloseStatement,"Expected %} token");break;case s.Break:++B,te(s.CloseStatement,"Expected closing statement token"),Ae=new k;break;case s.Continue:++B,te(s.CloseStatement,"Expected closing statement token"),Ae=new g;break;default:throw new SyntaxError(`Unknown statement type: ${D[B].type}`)}return Ae}function ht(){te(s.OpenExpression,"Expected opening expression token");const Ae=Jt();return te(s.CloseExpression,"Expected closing expression token"),Ae}function ut(){var Je,it;const Ae=Jt();if(ve(s.Equals)){++B;const Nt=Jt();return new w(Ae,Nt,[])}else{const Nt=[];for(te(s.CloseStatement,"Expected %} token");!(((Je=D[B])==null?void 0:Je.type)===s.OpenStatement&&((it=D[B+1])==null?void 0:it.type)===s.EndSet);){const os=me();Nt.push(os)}return te(s.OpenStatement,"Expected {% token"),te(s.EndSet,"Expected endset token"),new w(Ae,null,Nt)}}function rt(){var Nt,os,is,ur,as,cr,hr,ls;const Ae=Jt();te(s.CloseStatement,"Expected closing statement token");const Je=[],it=[];for(;!(((Nt=D[B])==null?void 0:Nt.type)===s.OpenStatement&&(((os=D[B+1])==null?void 0:os.type)===s.ElseIf||((is=D[B+1])==null?void 0:is.type)===s.Else||((ur=D[B+1])==null?void 0:ur.type)===s.EndIf));)Je.push(me());if(((as=D[B])==null?void 0:as.type)===s.OpenStatement&&((cr=D[B+1])==null?void 0:cr.type)!==s.EndIf)if(++B,ve(s.ElseIf))te(s.ElseIf,"Expected elseif token"),it.push(rt());else for(te(s.Else,"Expected else token"),te(s.CloseStatement,"Expected closing statement token");!(((hr=D[B])==null?void 0:hr.type)===s.OpenStatement&&((ls=D[B+1])==null?void 0:ls.type)===s.EndIf);)it.push(me());return new f(Ae,Je,it)}function jt(){const Ae=Br();if(Ae.type!=="Identifier")throw new SyntaxError("Expected identifier following macro statement");const Je=vs();te(s.CloseStatement,"Expected closing statement token");const it=[];for(;Oe(s.OpenStatement,s.EndMacro);)it.push(me());return new S(Ae,Je,it)}function Ht(Ae=!1){const Je=Ae?Br:Jt,it=[Je()],Nt=ve(s.Comma);for(;Nt&&(++B,it.push(Je()),!!ve(s.Comma)););return Nt?new Z(it):it[0]}function wr(){const Ae=Ht(!0);if(!(Ae instanceof y||Ae instanceof Z))throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${Ae.type} instead`);te(s.In,"Expected `in` keyword following loop variable");const Je=Jt();te(s.CloseStatement,"Expected closing statement token");const it=[];for(;Oe(s.OpenStatement,s.EndFor)&&Oe(s.OpenStatement,s.Else);)it.push(me());const Nt=[];if(ve(s.OpenStatement,s.Else))for(++B,++B,te(s.CloseStatement,"Expected closing statement token");Oe(s.OpenStatement,s.EndFor);)Nt.push(me());return new T(Ae,Je,it,Nt)}function Jt(){return Or()}function Or(){const Ae=ss();if(ve(s.If)){++B;const Je=ss();if(ve(s.Else)){++B;const it=ss();return new f(Je,[Ae],[it])}else return new se(Ae,Je)}return Ae}function ss(){let Ae=ys();for(;ve(s.Or);){const Je=D[B];++B;const it=ys();Ae=new J(Je,Ae,it)}return Ae}function ys(){let Ae=ns();for(;ve(s.And);){const Je=D[B];++B;const it=ns();Ae=new J(Je,Ae,it)}return Ae}function ns(){let Ae;for(;ve(s.Not);){const Je=D[B];++B;const it=ns();Ae=new ae(Je,it)}return Ae??$s()}function $s(){let Ae=Vr();for(;ve(s.ComparisonBinaryOperator)||ve(s.In)||ve(s.NotIn);){const Je=D[B];++B;const it=Vr();Ae=new J(Je,Ae,it)}return Ae}function Vr(){let Ae=Fs();for(;ve(s.AdditiveBinaryOperator);){const Je=D[B];++B;const it=Fs();Ae=new J(Je,Ae,it)}return Ae}function ks(){const Ae=ar(Br());return ve(s.OpenParen)?Qr(Ae):Ae}function Qr(Ae){let Je=new M(Ae,vs());return Je=ar(Je),ve(s.OpenParen)&&(Je=Qr(Je)),Je}function vs(){te(s.OpenParen,"Expected opening parenthesis for arguments list");const Ae=Is();return te(s.CloseParen,"Expected closing parenthesis for arguments list"),Ae}function Is(){const Ae=[];for(;!ve(s.CloseParen);){let Je=Jt();if(ve(s.Equals)){if(++B,!(Je instanceof y))throw new SyntaxError("Expected identifier for keyword argument");const it=Jt();Je=new A(Je,it)}Ae.push(Je),ve(s.Comma)&&++B}return Ae}function As(){const Ae=[];let Je=!1;for(;!ve(s.CloseSquareBracket);)ve(s.Colon)?(Ae.push(void 0),++B,Je=!0):(Ae.push(Jt()),ve(s.Colon)&&(++B,Je=!0));if(Ae.length===0)throw new SyntaxError("Expected at least one argument for member/slice expression");if(Je){if(Ae.length>3)throw new SyntaxError("Expected 0-3 arguments for slice expression");return new V(...Ae)}return Ae[0]}function ar(Ae){for(;ve(s.Dot)||ve(s.OpenSquareBracket);){const Je=D[B];++B;let it;const Nt=Je.type!==s.Dot;if(Nt)it=As(),te(s.CloseSquareBracket,"Expected closing square bracket");else if(it=Br(),it.type!=="Identifier")throw new SyntaxError("Expected identifier following dot operator");Ae=new v(Ae,it,Nt)}return Ae}function Fs(){let Ae=Er();for(;ve(s.MultiplicativeBinaryOperator);){const Je=D[B];++B;const it=Er();Ae=new J(Je,Ae,it)}return Ae}function Er(){let Ae=xs();for(;ve(s.Is);){++B;const Je=ve(s.Not);Je&&++B;let it=Br();if(it instanceof K?it=new y(it.value.toString()):it instanceof q&&(it=new y("none")),!(it instanceof y))throw new SyntaxError("Expected identifier for the test");Ae=new fe(Ae,Je,it)}return Ae}function xs(){let Ae=ks();for(;ve(s.Pipe);){++B;let Je=Br();if(!(Je instanceof y))throw new SyntaxError("Expected identifier for the filter");ve(s.OpenParen)&&(Je=Qr(Je)),Ae=new Q(Ae,Je)}return Ae}function Br(){const Ae=D[B];switch(Ae.type){case s.NumericLiteral:return++B,new F(Number(Ae.value));case s.StringLiteral:return++B,new z(Ae.value);case s.BooleanLiteral:return++B,new K(Ae.value.toLowerCase()==="true");case s.NullLiteral:return++B,new q(null);case s.Identifier:return++B,new y(Ae.value);case s.OpenParen:{++B;const Je=Ht();if(D[B].type!==s.CloseParen)throw new SyntaxError(`Expected closing parenthesis, got ${D[B].type} instead`);return++B,Je}case s.OpenSquareBracket:{++B;const Je=[];for(;!ve(s.CloseSquareBracket);)Je.push(Jt()),ve(s.Comma)&&++B;return++B,new R(Je)}case s.OpenCurlyBracket:{++B;const Je=new Map;for(;!ve(s.CloseCurlyBracket);){const it=Jt();te(s.Colon,"Expected colon between key and value in object literal");const Nt=Jt();Je.set(it,Nt),ve(s.Comma)&&++B}return++B,new H(Je)}default:throw new SyntaxError(`Unexpected token: ${Ae.type}`)}}for(;B=0?(oe=(oe??(oe=0))<0?Math.max(D.length+oe,0):Math.min(oe,D.length),B=(B??(B=D.length))<0?Math.max(D.length+B,0):Math.min(B,D.length)):(oe=(oe??(oe=D.length-1))<0?Math.max(D.length+oe,-1):Math.min(oe,D.length-1),B=(B??(B=-1))<-1?Math.max(D.length+B,-1):Math.min(B,D.length-1));const Oe=[];for(let ve=oe;me*veoe.toUpperCase())}var ye=class extends Error{},ze=class extends Error{},Ue=class{constructor(D=void 0){Y(this,"type","RuntimeValue");Y(this,"value");Y(this,"builtins",new Map);this.value=D}__bool__(){return new re(!!this.value)}},pe=class extends Ue{constructor(){super(...arguments);Y(this,"type","NumericValue")}},W=class extends Ue{constructor(){super(...arguments);Y(this,"type","StringValue");Y(this,"builtins",new Map([["upper",new Ce(()=>new W(this.value.toUpperCase()))],["lower",new Ce(()=>new W(this.value.toLowerCase()))],["strip",new Ce(()=>new W(this.value.trim()))],["title",new Ce(()=>new W(le(this.value)))],["length",new pe(this.value.length)],["rstrip",new Ce(()=>new W(this.value.trimEnd()))],["lstrip",new Ce(()=>new W(this.value.trimStart()))],["startswith",new Ce(oe=>{if(oe.length===0)throw new Error("startswith() requires at least one argument");const B=oe[0];if(!(B instanceof W))throw new Error("startswith() argument must be a string");return new re(this.value.startsWith(B.value))})],["endswith",new Ce(oe=>{if(oe.length===0)throw new Error("endswith() requires at least one argument");const B=oe[0];if(!(B instanceof W))throw new Error("endswith() argument must be a string");return new re(this.value.endsWith(B.value))})],["split",new Ce(oe=>{const B=oe[0]??new $e;if(!(B instanceof W||B instanceof $e))throw new Error("sep argument must be a string or null");const te=oe[1]??new pe(-1);if(!(te instanceof pe))throw new Error("maxsplit argument must be a number");let me=[];if(B instanceof $e){const Oe=this.value.trimStart();for(const{0:ve,index:vt}of Oe.matchAll(/\S+/g)){if(te.value!==-1&&me.length>=te.value&&vt!==void 0){me.push(ve+Oe.slice(vt+ve.length));break}me.push(ve)}}else{if(B.value==="")throw new Error("empty separator");me=this.value.split(B.value),te.value!==-1&&me.length>te.value&&me.push(me.splice(te.value).join(B.value))}return new we(me.map(Oe=>new W(Oe)))})]]))}},re=class extends Ue{constructor(){super(...arguments);Y(this,"type","BooleanValue")}},G=class extends Ue{constructor(){super(...arguments);Y(this,"type","ObjectValue");Y(this,"builtins",new Map([["get",new Ce(([oe,B])=>{if(!(oe instanceof W))throw new Error(`Object key must be a string: got ${oe.type}`);return this.value.get(oe.value)??B??new $e})],["items",new Ce(()=>new we(Array.from(this.value.entries()).map(([oe,B])=>new we([new W(oe),B]))))]]))}__bool__(){return new re(this.value.size>0)}},be=class extends G{constructor(){super(...arguments);Y(this,"type","KeywordArgumentsValue")}},we=class extends Ue{constructor(){super(...arguments);Y(this,"type","ArrayValue");Y(this,"builtins",new Map([["length",new pe(this.value.length)]]))}__bool__(){return new re(this.value.length>0)}},Se=class extends we{constructor(){super(...arguments);Y(this,"type","TupleValue")}},Ce=class extends Ue{constructor(){super(...arguments);Y(this,"type","FunctionValue")}},$e=class extends Ue{constructor(){super(...arguments);Y(this,"type","NullValue")}},Fe=class extends Ue{constructor(){super(...arguments);Y(this,"type","UndefinedValue")}},Be=class{constructor(D){Y(this,"variables",new Map([["namespace",new Ce(D=>{if(D.length===0)return new G(new Map);if(D.length!==1||!(D[0]instanceof G))throw new Error("`namespace` expects either zero arguments or a single object argument");return D[0]})]]));Y(this,"tests",new Map([["boolean",D=>D.type==="BooleanValue"],["callable",D=>D instanceof Ce],["odd",D=>{if(D.type!=="NumericValue")throw new Error(`Cannot apply test "odd" to type: ${D.type}`);return D.value%2!==0}],["even",D=>{if(D.type!=="NumericValue")throw new Error(`Cannot apply test "even" to type: ${D.type}`);return D.value%2===0}],["false",D=>D.type==="BooleanValue"&&!D.value],["true",D=>D.type==="BooleanValue"&&D.value],["none",D=>D.type==="NullValue"],["string",D=>D.type==="StringValue"],["number",D=>D.type==="NumericValue"],["integer",D=>D.type==="NumericValue"&&Number.isInteger(D.value)],["iterable",D=>D.type==="ArrayValue"||D.type==="StringValue"],["mapping",D=>D.type==="ObjectValue"],["lower",D=>{const oe=D.value;return D.type==="StringValue"&&oe===oe.toLowerCase()}],["upper",D=>{const oe=D.value;return D.type==="StringValue"&&oe===oe.toUpperCase()}],["none",D=>D.type==="NullValue"],["defined",D=>D.type!=="UndefinedValue"],["undefined",D=>D.type==="UndefinedValue"],["equalto",(D,oe)=>D.value===oe.value],["eq",(D,oe)=>D.value===oe.value]]));this.parent=D}set(D,oe){return this.declareVariable(D,qe(oe))}declareVariable(D,oe){if(this.variables.has(D))throw new SyntaxError(`Variable already declared: ${D}`);return this.variables.set(D,oe),oe}setVariable(D,oe){return this.variables.set(D,oe),oe}resolve(D){if(this.variables.has(D))return this;if(this.parent)return this.parent.resolve(D);throw new Error(`Unknown variable: ${D}`)}lookupVariable(D){try{return this.resolve(D).variables.get(D)??new Fe}catch{return new Fe}}},He=class{constructor(D){Y(this,"global");this.global=D??new Be}run(D){return this.evaluate(D,this.global)}evaluateBinaryExpression(D,oe){const B=this.evaluate(D.left,oe);switch(D.operator.value){case"and":return B.__bool__().value?this.evaluate(D.right,oe):B;case"or":return B.__bool__().value?B:this.evaluate(D.right,oe)}const te=this.evaluate(D.right,oe);switch(D.operator.value){case"==":return new re(B.value==te.value);case"!=":return new re(B.value!=te.value)}if(B instanceof Fe||te instanceof Fe)throw new Error("Cannot perform operation on undefined values");if(B instanceof $e||te instanceof $e)throw new Error("Cannot perform operation on null values");if(B instanceof pe&&te instanceof pe)switch(D.operator.value){case"+":return new pe(B.value+te.value);case"-":return new pe(B.value-te.value);case"*":return new pe(B.value*te.value);case"/":return new pe(B.value/te.value);case"%":return new pe(B.value%te.value);case"<":return new re(B.value":return new re(B.value>te.value);case">=":return new re(B.value>=te.value);case"<=":return new re(B.value<=te.value)}else if(B instanceof we&&te instanceof we)switch(D.operator.value){case"+":return new we(B.value.concat(te.value))}else if(te instanceof we){const me=te.value.find(Oe=>Oe.value===B.value)!==void 0;switch(D.operator.value){case"in":return new re(me);case"not in":return new re(!me)}}if(B instanceof W||te instanceof W)switch(D.operator.value){case"+":return new W(B.value.toString()+te.value.toString())}if(B instanceof W&&te instanceof W)switch(D.operator.value){case"in":return new re(te.value.includes(B.value));case"not in":return new re(!te.value.includes(B.value))}if(B instanceof W&&te instanceof G)switch(D.operator.value){case"in":return new re(te.value.has(B.value));case"not in":return new re(!te.value.has(B.value))}throw new SyntaxError(`Unknown operator "${D.operator.value}" between ${B.type} and ${te.type}`)}evaluateArguments(D,oe){const B=[],te=new Map;for(const me of D)if(me.type==="KeywordArgumentExpression"){const Oe=me;te.set(Oe.key.value,this.evaluate(Oe.value,oe))}else{if(te.size>0)throw new Error("Positional arguments must come before keyword arguments");B.push(this.evaluate(me,oe))}return[B,te]}evaluateFilterExpression(D,oe){const B=this.evaluate(D.operand,oe);if(D.filter.type==="Identifier"){const te=D.filter;if(te.value==="tojson")return new W(ke(B));if(B instanceof we)switch(te.value){case"list":return B;case"first":return B.value[0];case"last":return B.value[B.value.length-1];case"length":return new pe(B.value.length);case"reverse":return new we(B.value.reverse());case"sort":return new we(B.value.sort((me,Oe)=>{if(me.type!==Oe.type)throw new Error(`Cannot compare different types: ${me.type} and ${Oe.type}`);switch(me.type){case"NumericValue":return me.value-Oe.value;case"StringValue":return me.value.localeCompare(Oe.value);default:throw new Error(`Cannot compare type: ${me.type}`)}}));case"join":return new W(B.value.map(me=>me.value).join(""));case"string":return new W(ke(B));default:throw new Error(`Unknown ArrayValue filter: ${te.value}`)}else if(B instanceof W)switch(te.value){case"length":return new pe(B.value.length);case"upper":return new W(B.value.toUpperCase());case"lower":return new W(B.value.toLowerCase());case"title":return new W(le(B.value));case"capitalize":return new W(B.value.charAt(0).toUpperCase()+B.value.slice(1));case"trim":return new W(B.value.trim());case"indent":return new W(B.value.split(` -`).map((me,Oe)=>Oe===0||me.length===0?me:" "+me).join(` -`));case"join":case"string":return B;default:throw new Error(`Unknown StringValue filter: ${te.value}`)}else if(B instanceof pe)switch(te.value){case"abs":return new pe(Math.abs(B.value));default:throw new Error(`Unknown NumericValue filter: ${te.value}`)}else if(B instanceof G)switch(te.value){case"items":return new we(Array.from(B.value.entries()).map(([me,Oe])=>new we([new W(me),Oe])));case"length":return new pe(B.value.size);default:throw new Error(`Unknown ObjectValue filter: ${te.value}`)}throw new Error(`Cannot apply filter "${te.value}" to type: ${B.type}`)}else if(D.filter.type==="CallExpression"){const te=D.filter;if(te.callee.type!=="Identifier")throw new Error(`Unknown filter: ${te.callee.type}`);const me=te.callee.value;if(me==="tojson"){const[,Oe]=this.evaluateArguments(te.args,oe),ve=Oe.get("indent")??new $e;if(!(ve instanceof pe||ve instanceof $e))throw new Error("If set, indent must be a number");return new W(ke(B,ve.value))}else if(me==="join"){let Oe;if(B instanceof W)Oe=Array.from(B.value);else if(B instanceof we)Oe=B.value.map(ht=>ht.value);else throw new Error(`Cannot apply filter "${me}" to type: ${B.type}`);const[ve,vt]=this.evaluateArguments(te.args,oe),Ft=ve.at(0)??vt.get("separator")??new W("");if(!(Ft instanceof W))throw new Error("separator must be a string");return new W(Oe.join(Ft.value))}if(B instanceof we){switch(me){case"selectattr":case"rejectattr":{const Oe=me==="selectattr";if(B.value.some(rt=>!(rt instanceof G)))throw new Error(`\`${me}\` can only be applied to array of objects`);if(te.args.some(rt=>rt.type!=="StringLiteral"))throw new Error(`arguments of \`${me}\` must be strings`);const[ve,vt,Ft]=te.args.map(rt=>this.evaluate(rt,oe));let ht;if(vt){const rt=oe.tests.get(vt.value);if(!rt)throw new Error(`Unknown test: ${vt.value}`);ht=rt}else ht=(...rt)=>rt[0].__bool__().value;const ut=B.value.filter(rt=>{const jt=rt.value.get(ve.value),Ht=jt?ht(jt,Ft):!1;return Oe?Ht:!Ht});return new we(ut)}case"map":{const[,Oe]=this.evaluateArguments(te.args,oe);if(Oe.has("attribute")){const ve=Oe.get("attribute");if(!(ve instanceof W))throw new Error("attribute must be a string");const vt=Oe.get("default"),Ft=B.value.map(ht=>{if(!(ht instanceof G))throw new Error("items in map must be an object");return ht.value.get(ve.value)??vt??new Fe});return new we(Ft)}else throw new Error("`map` expressions without `attribute` set are not currently supported.")}}throw new Error(`Unknown ArrayValue filter: ${me}`)}else if(B instanceof W){switch(me){case"indent":{const[Oe,ve]=this.evaluateArguments(te.args,oe),vt=Oe.at(0)??ve.get("width")??new pe(4);if(!(vt instanceof pe))throw new Error("width must be a number");const Ft=Oe.at(1)??ve.get("first")??new re(!1),ht=Oe.at(2)??ve.get("blank")??new re(!1),ut=B.value.split(` -`),rt=" ".repeat(vt.value),jt=ut.map((Ht,wr)=>!Ft.value&&wr===0||!ht.value&&Ht.length===0?Ht:rt+Ht);return new W(jt.join(` -`))}}throw new Error(`Unknown StringValue filter: ${me}`)}else throw new Error(`Cannot apply filter "${me}" to type: ${B.type}`)}throw new Error(`Unknown filter: ${D.filter.type}`)}evaluateTestExpression(D,oe){const B=this.evaluate(D.operand,oe),te=oe.tests.get(D.test.value);if(!te)throw new Error(`Unknown test: ${D.test.value}`);const me=te(B);return new re(D.negate?!me:me)}evaluateUnaryExpression(D,oe){const B=this.evaluate(D.argument,oe);switch(D.operator.value){case"not":return new re(!B.value);default:throw new SyntaxError(`Unknown operator: ${D.operator.value}`)}}evalProgram(D,oe){return this.evaluateBlock(D.body,oe)}evaluateBlock(D,oe){let B="";for(const te of D){const me=this.evaluate(te,oe);me.type!=="NullValue"&&me.type!=="UndefinedValue"&&(B+=me.value)}return new W(B)}evaluateIdentifier(D,oe){return oe.lookupVariable(D.value)}evaluateCallExpression(D,oe){const[B,te]=this.evaluateArguments(D.args,oe);te.size>0&&B.push(new be(te));const me=this.evaluate(D.callee,oe);if(me.type!=="FunctionValue")throw new Error(`Cannot call something that is not a function: got ${me.type}`);return me.value(B,oe)}evaluateSliceExpression(D,oe,B){if(!(D instanceof we||D instanceof W))throw new Error("Slice object must be an array or string");const te=this.evaluate(oe.start,B),me=this.evaluate(oe.stop,B),Oe=this.evaluate(oe.step,B);if(!(te instanceof pe||te instanceof Fe))throw new Error("Slice start must be numeric or undefined");if(!(me instanceof pe||me instanceof Fe))throw new Error("Slice stop must be numeric or undefined");if(!(Oe instanceof pe||Oe instanceof Fe))throw new Error("Slice step must be numeric or undefined");return D instanceof we?new we(_e(D.value,te.value,me.value,Oe.value)):new W(_e(Array.from(D.value),te.value,me.value,Oe.value).join(""))}evaluateMemberExpression(D,oe){const B=this.evaluate(D.object,oe);let te;if(D.computed){if(D.property.type==="SliceExpression")return this.evaluateSliceExpression(B,D.property,oe);te=this.evaluate(D.property,oe)}else te=new W(D.property.value);let me;if(B instanceof G){if(!(te instanceof W))throw new Error(`Cannot access property with non-string: got ${te.type}`);me=B.value.get(te.value)??B.builtins.get(te.value)}else if(B instanceof we||B instanceof W)if(te instanceof pe)me=B.value.at(te.value),B instanceof W&&(me=new W(B.value.at(te.value)));else if(te instanceof W)me=B.builtins.get(te.value);else throw new Error(`Cannot access property with non-string/non-number: got ${te.type}`);else{if(!(te instanceof W))throw new Error(`Cannot access property with non-string: got ${te.type}`);me=B.builtins.get(te.value)}return me instanceof Ue?me:new Fe}evaluateSet(D,oe){const B=D.value?this.evaluate(D.value,oe):this.evaluateBlock(D.body,oe);if(D.assignee.type==="Identifier"){const te=D.assignee.value;oe.setVariable(te,B)}else if(D.assignee.type==="MemberExpression"){const te=D.assignee,me=this.evaluate(te.object,oe);if(!(me instanceof G))throw new Error("Cannot assign to member of non-object");if(te.property.type!=="Identifier")throw new Error("Cannot assign to member with non-identifier property");me.value.set(te.property.value,B)}else throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(D.assignee)}`);return new $e}evaluateIf(D,oe){const B=this.evaluate(D.test,oe);return this.evaluateBlock(B.__bool__().value?D.body:D.alternate,oe)}evaluateFor(D,oe){const B=new Be(oe);let te,me;if(D.iterable.type==="SelectExpression"){const ht=D.iterable;me=this.evaluate(ht.iterable,B),te=ht.test}else me=this.evaluate(D.iterable,B);if(!(me instanceof we))throw new Error(`Expected iterable type in for loop: got ${me.type}`);const Oe=[],ve=[];for(let ht=0;htHt.setVariable(D.loopvar.value,rt);else if(D.loopvar.type==="TupleLiteral"){const Ht=D.loopvar;if(rt.type!=="ArrayValue")throw new Error(`Cannot unpack non-iterable type: ${rt.type}`);const wr=rt;if(Ht.value.length!==wr.value.length)throw new Error(`Too ${Ht.value.length>wr.value.length?"few":"many"} items to unpack`);jt=Jt=>{for(let Or=0;Or0?Oe[ht-1]:new Fe],["nextitem",ht{var ve;const me=new Be(te);B=B.slice();let Oe;((ve=B.at(-1))==null?void 0:ve.type)==="KeywordArgumentsValue"&&(Oe=B.pop());for(let vt=0;vtthis.evaluate(B,oe)));case"TupleLiteral":return new Se(D.value.map(B=>this.evaluate(B,oe)));case"ObjectLiteral":{const B=new Map;for(const[te,me]of D.value){const Oe=this.evaluate(te,oe);if(!(Oe instanceof W))throw new Error(`Object keys must be strings: got ${Oe.type}`);B.set(Oe.value,this.evaluate(me,oe))}return new G(B)}case"Identifier":return this.evaluateIdentifier(D,oe);case"CallExpression":return this.evaluateCallExpression(D,oe);case"MemberExpression":return this.evaluateMemberExpression(D,oe);case"UnaryExpression":return this.evaluateUnaryExpression(D,oe);case"BinaryExpression":return this.evaluateBinaryExpression(D,oe);case"FilterExpression":return this.evaluateFilterExpression(D,oe);case"TestExpression":return this.evaluateTestExpression(D,oe);default:throw new SyntaxError(`Unknown node type: ${D.type}`)}}};function qe(D){switch(typeof D){case"number":return new pe(D);case"string":return new W(D);case"boolean":return new re(D);case"undefined":return new Fe;case"object":return D===null?new $e:Array.isArray(D)?new we(D.map(qe)):new G(new Map(Object.entries(D).map(([oe,B])=>[oe,qe(B)])));case"function":return new Ce((oe,B)=>{const te=D(...oe.map(me=>me.value))??null;return qe(te)});default:throw new Error(`Cannot convert to runtime value: ${D}`)}}function ke(D,oe,B){const te=B??0;switch(D.type){case"NullValue":case"UndefinedValue":return"null";case"NumericValue":case"StringValue":case"BooleanValue":return JSON.stringify(D.value);case"ArrayValue":case"ObjectValue":{const me=oe?" ".repeat(oe):"",Oe=` -`+me.repeat(te),ve=Oe+me;if(D.type==="ArrayValue"){const vt=D.value.map(Ft=>ke(Ft,oe,te+1));return oe?`[${ve}${vt.join(`,${ve}`)}${Oe}]`:`[${vt.join(", ")}]`}else{const vt=Array.from(D.value.entries()).map(([Ft,ht])=>{const ut=`"${Ft}": ${ke(ht,oe,te+1)}`;return oe?`${ve}${ut}`:ut});return oe?`{${vt.join(",")}${Oe}}`:`{${vt.join(", ")}}`}}default:throw new Error(`Cannot convert to JSON: ${D.type}`)}}var Ve=` -`,Ze="{%- ",nt=" -%}",lt={MultiplicativeBinaryOperator:2,AdditiveBinaryOperator:1,ComparisonBinaryOperator:0};function Ge(D,oe=" "){const B=typeof oe=="number"?" ".repeat(oe):oe;return pt(D.body,0,B).replace(/\n$/,"")}function Ie(...D){return Ze+D.join(" ")+nt}function pt(D,oe,B){return D.map(te=>St(te,oe,B)).join(Ve)}function St(D,oe,B){const te=B.repeat(oe);switch(D.type){case"Program":return pt(D.body,oe,B);case"If":return Vt(D,oe,B);case"For":return Rt(D,oe,B);case"Set":return gr(D,oe,B);case"Macro":return ir(D,oe,B);case"Break":return te+Ie("break");case"Continue":return te+Ie("continue");default:return te+"{{- "+Mt(D)+" -}}"}}function Vt(D,oe,B){const te=B.repeat(oe),me=[];let Oe=D;for(;Oe&&(me.push({test:Oe.test,body:Oe.body}),Oe.alternate.length===1&&Oe.alternate[0].type==="If");)Oe=Oe.alternate[0];let ve=te+Ie("if",Mt(me[0].test))+Ve+pt(me[0].body,oe+1,B);for(let vt=1;vt0&&(ve+=Ve+te+Ie("else")+Ve+pt(Oe.alternate,oe+1,B)),ve+=Ve+te+Ie("endif"),ve}function Rt(D,oe,B){const te=B.repeat(oe);let me="";if(D.iterable.type==="SelectExpression"){const ve=D.iterable;me=`${Mt(ve.iterable)} if ${Mt(ve.test)}`}else me=Mt(D.iterable);let Oe=te+Ie("for",Mt(D.loopvar),"in",me)+Ve+pt(D.body,oe+1,B);return D.defaultBlock.length>0&&(Oe+=Ve+te+Ie("else")+Ve+pt(D.defaultBlock,oe+1,B)),Oe+=Ve+te+Ie("endfor"),Oe}function gr(D,oe,B){const te=B.repeat(oe),me=Mt(D.assignee),Oe=D.value?Mt(D.value):"",ve=te+Ie("set",`${me}${D.value?" = "+Oe:""}`);return D.body.length===0?ve:ve+Ve+pt(D.body,oe+1,B)+Ve+te+Ie("endset")}function ir(D,oe,B){const te=B.repeat(oe),me=D.args.map(Mt).join(", ");return te+Ie("macro",`${D.name.value}(${me})`)+Ve+pt(D.body,oe+1,B)+Ve+te+Ie("endmacro")}function Mt(D,oe=-1){switch(D.type){case"Identifier":return D.value;case"NullLiteral":return"none";case"NumericLiteral":case"BooleanLiteral":return`${D.value}`;case"StringLiteral":return JSON.stringify(D.value);case"BinaryExpression":{const B=D,te=lt[B.operator.type]??0,me=Mt(B.left,te),Oe=Mt(B.right,te+1),ve=`${me} ${B.operator.value} ${Oe}`;return teMt(me,-1)).join(", ");return`${Mt(B.callee,-1)}(${te})`}case"MemberExpression":{const B=D;let te=Mt(B.object,-1);B.object.type!=="Identifier"&&(te=`(${te})`);let me=Mt(B.property,-1);return!B.computed&&B.property.type!=="Identifier"&&(me=`(${me})`),B.computed?`${te}[${me}]`:`${te}.${me}`}case"FilterExpression":{const B=D,te=Mt(B.operand,1/0);return B.filter.type==="CallExpression"?`${te} | ${Mt(B.filter,-1)}`:`${te} | ${B.filter.value}`}case"SelectExpression":{const B=D;return`${Mt(B.iterable,-1)} | select(${Mt(B.test,-1)})`}case"TestExpression":{const B=D;return`${Mt(B.operand,-1)} is${B.negate?" not":""} ${B.test.value}`}case"ArrayLiteral":case"TupleLiteral":{const B=D.value.map(me=>Mt(me,-1)),te=D.type==="ArrayLiteral"?"[]":"()";return`${te[0]}${B.join(", ")}${te[1]}`}case"ObjectLiteral":return`{ ${Array.from(D.value.entries()).map(([te,me])=>`${Mt(te,-1)}: ${Mt(me,-1)}`).join(", ")} }`;case"SliceExpression":{const B=D,te=B.start?Mt(B.start,-1):"",me=B.stop?Mt(B.stop,-1):"",Oe=B.step?`:${Mt(B.step,-1)}`:"";return`${te}:${me}${Oe}`}case"KeywordArgumentExpression":{const B=D;return`${B.key.value}=${Mt(B.value,-1)}`}case"If":{const B=D,te=Mt(B.test,-1),me=Mt(B.body[0],0),Oe=Mt(B.alternate[0],-1);return`${me} if ${te} else ${Oe}`}default:throw new Error(`Unknown expression type: ${D.type}`)}}var rs=class{constructor(D){Y(this,"parsed");const oe=c(D,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=U(oe)}render(D){const oe=new Be;if(oe.set("false",!1),oe.set("true",!0),oe.set("raise_exception",me=>{throw new Error(me)}),oe.set("range",ee),D)for(const[me,Oe]of Object.entries(D))oe.set(me,Oe);return new He(oe).run(this.parsed).value}format(D){return Ge(this.parsed,(D==null?void 0:D.indent)||" ")}}},"./src/backends/onnx.js":(e,r,t)=>{var s;t.r(r),t.d(r,{Tensor:()=>a.Tensor,createInferenceSession:()=>k,deviceToExecutionProviders:()=>f,isONNXProxy:()=>S,isONNXTensor:()=>g});var o=t("./src/env.js"),n=t("?2ce3"),i=t("onnxruntime-web"),a=t("onnxruntime-common");const l=Object.freeze({auto:null,gpu:null,cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:{name:"webnn",deviceType:"cpu"},"webnn-npu":{name:"webnn",deviceType:"npu"},"webnn-gpu":{name:"webnn",deviceType:"gpu"},"webnn-cpu":{name:"webnn",deviceType:"cpu"}}),u=[];let p,c;const d=Symbol.for("onnxruntime");if(d in globalThis)c=globalThis[d];else if(o.apis.IS_NODE_ENV){switch(c=n??(s||(s=t.t(n,2))),process.platform){case"win32":u.push("dml");break;case"linux":process.arch==="x64"&&u.push("cuda");break}u.push("cpu"),p=["cpu"]}else c=i,o.apis.IS_WEBNN_AVAILABLE&&u.push("webnn-npu","webnn-gpu","webnn-cpu","webnn"),o.apis.IS_WEBGPU_AVAILABLE&&u.push("webgpu"),u.push("wasm"),p=["wasm"];const _=c.InferenceSession;function f(E=null){if(!E)return p;switch(E){case"auto":return u;case"gpu":return u.filter(v=>["webgpu","cuda","dml","webnn-gpu"].includes(v))}if(u.includes(E))return[l[E]??E];throw new Error(`Unsupported device: "${E}". Should be one of: ${u.join(", ")}.`)}let T=null;async function k(E,v,M){T&&await T;const y=_.create(E,v);T??(T=y);const C=await y;return C.config=M,C}function g(E){return E instanceof c.Tensor}const w=c==null?void 0:c.env;w!=null&&w.wasm&&(!(typeof ServiceWorkerGlobalScope<"u"&&self instanceof ServiceWorkerGlobalScope)&&!w.wasm.wasmPaths&&(w.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${o.env.version}/dist/`),w.wasm.proxy=!1),w!=null&&w.webgpu&&(w.webgpu.powerPreference="high-performance");function S(){var E;return(E=w==null?void 0:w.wasm)==null?void 0:E.proxy}o.env.backends.onnx=w},"./src/base/feature_extraction_utils.js":(e,r,t)=>{t.r(r),t.d(r,{FeatureExtractor:()=>i,validate_audio_inputs:()=>a});var s=t("./src/utils/constants.js"),o=t("./src/utils/generic.js"),n=t("./src/utils/hub.js");class i extends o.Callable{constructor(u){super(),this.config=u}static async from_pretrained(u,p){const c=await(0,n.getModelJSON)(u,s.FEATURE_EXTRACTOR_NAME,!0,p);return new this(c)}}function a(l,u){var p;if(!(l instanceof Float32Array||l instanceof Float64Array))throw new Error(`${u} expects input to be a Float32Array or a Float64Array, but got ${((p=l==null?void 0:l.constructor)==null?void 0:p.name)??typeof l} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}},"./src/base/image_processors_utils.js":(e,r,t)=>{t.r(r),t.d(r,{ImageProcessor:()=>E,center_to_corners_format:()=>c,post_process_instance_segmentation:()=>S,post_process_object_detection:()=>d,post_process_panoptic_segmentation:()=>w,post_process_semantic_segmentation:()=>_});var s=t("./src/utils/generic.js"),o=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");t("./src/utils/image.js");var i=t("./src/utils/core.js"),a=t("./src/utils/hub.js"),l=t("./src/utils/constants.js");function u(v,M,y=0,C=null){const F=v/M;let z=(0,n.bankers_round)(F)*M;return C!==null&&z>C&&(z=Math.floor(F)*M),zM&&A.push(ee)}else{let ee=(0,n.max)(V.data)[1];if(ee===R-1||(U=(0,n.softmax)(V.data),U[ee]le*J[(ye+1)%2])),Q.boxes.push(_e),Q.classes.push(ee),Q.scores.push(U[ee])}}Z.push(Q)}return Z}function _(v,M=null){const y=v.logits,C=y.dims[0];if(M!==null&&M.length!==C)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const F=[];for(let z=0;zJ[A]&&(J[A]=V[A],Q[A]=ae)}const se=new Array(q.dims[0]);for(let ae=0;aeae!==void 0);F.push({segmentation:H,labels:fe})}return F}function f(v,M,y,C){const F=[],z=[],K=[];for(let q=0;qy&&(F.push(Z),z.push(Q),K.push(H))}return[F,z,K]}function T(v,M,y,C=.5,F=.8){const z=[];let K=0,q=0;const R=M[y].data;for(let H=0;H=C&&++q;let Z=K>0&&q>0;return Z&&(Z=K/q>F),[Z,z]}function k(v,M,y,C,F,z=null,K=null){const[q,R]=K??v[0].dims,Z=new o.Tensor("int32",new Int32Array(q*R),[q,R]),H=[];if(K!==null)for(let ae=0;aeQ[U]&&(J[U]=ae,Q[U]=A[U])}let se=0;const fe=Z.data;for(let ae=0;ae200)throw new Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(v,M)/Math.min(v,M)}`);let z=Math.round(v/y)*y,K=Math.round(M/y)*y;if(z*K>F){const q=Math.sqrt(v*M/F);z=Math.floor(v/q/y)*y,K=Math.floor(M/q/y)*y}else if(z*Kz?Z=Math.floor(z*R/F):z>F&&(R=Math.floor(F*Z/z)),await M.resize(Z,R,{resample:C}))}async crop_margin(M,y=200){const C=M.clone().grayscale(),F=(0,n.min)(C.data)[0],K=(0,n.max)(C.data)[0]-F;if(K===0)return M;const q=y/255;let R=C.width,Z=C.height,H=0,J=0;const Q=C.data;for(let se=0;sethis.preprocess(z)));return{pixel_values:(0,o.stack)(C.map(z=>z.pixel_values),0),original_sizes:C.map(z=>z.original_size),reshaped_input_sizes:C.map(z=>z.reshaped_input_size)}}static async from_pretrained(M,y){const C=await(0,a.getModelJSON)(M,l.IMAGE_PROCESSOR_NAME,!0,y);return new this(C)}}},"./src/base/processing_utils.js":(e,r,t)=>{t.r(r),t.d(r,{Processor:()=>i});var s=t("./src/utils/constants.js"),o=t("./src/utils/generic.js"),n=t("./src/utils/hub.js");class i extends o.Callable{constructor(l,u){super(),this.config=l,this.components=u}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(l,u={}){if(!this.tokenizer)throw new Error("Unable to apply chat template without a tokenizer.");return this.tokenizer.apply_chat_template(l,{tokenize:!1,...u})}batch_decode(...l){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.batch_decode(...l)}decode(...l){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.decode(...l)}async _call(l,...u){for(const p of[this.image_processor,this.feature_extractor,this.tokenizer])if(p)return p(l,...u);throw new Error("No image processor, feature extractor, or tokenizer found.")}static async from_pretrained(l,u){const[p,c]=await Promise.all([this.uses_processor_config?(0,n.getModelJSON)(l,s.PROCESSOR_NAME,!0,u):{},Promise.all(this.classes.filter(d=>d in this).map(async d=>{const _=await this[d].from_pretrained(l,u);return[d.replace(/_class$/,""),_]})).then(Object.fromEntries)]);return new this(p,c)}}Y(i,"classes",["image_processor_class","tokenizer_class","feature_extractor_class"]),Y(i,"uses_processor_config",!1)},"./src/configs.js":(e,r,t)=>{t.r(r),t.d(r,{AutoConfig:()=>u,PretrainedConfig:()=>l,getKeyValueShapes:()=>a});var s=t("./src/utils/core.js"),o=t("./src/utils/hub.js");async function n(p,c){return await(0,o.getModelJSON)(p,"config.json",!0,c)}function i(p){const c={};let d={};switch(p.model_type){case"llava":case"paligemma":case"gemma3":case"florence2":case"llava_onevision":case"idefics3":case"ultravox":case"smolvlm":d=i(p.text_config);break;case"moondream1":d=i(p.phi_config);break;case"musicgen":d=i(p.decoder);break;case"multi_modality":d=i(p.language_config);break;case"gpt2":case"gptj":case"jais":case"codegen":case"gpt_bigcode":c.num_heads="n_head",c.num_layers="n_layer",c.hidden_size="n_embd";break;case"gpt_neox":case"stablelm":case"opt":case"falcon":c.num_heads="num_attention_heads",c.num_layers="num_hidden_layers",c.hidden_size="hidden_size";break;case"llama":case"olmo":case"olmo2":case"mobilellm":case"granite":case"cohere":case"mistral":case"starcoder2":case"qwen2":case"qwen2_vl":case"phi":case"phi3":case"phi3_v":c.num_heads="num_key_value_heads",c.num_layers="num_hidden_layers",c.hidden_size="hidden_size",c.num_attention_heads="num_attention_heads";break;case"qwen3":case"gemma":case"gemma2":case"gemma3_text":case"glm":case"helium":c.num_heads="num_key_value_heads",c.num_layers="num_hidden_layers",c.dim_kv="head_dim";break;case"openelm":c.num_heads="num_kv_heads",c.num_layers="num_transformer_layers",c.dim_kv="head_dim";break;case"gpt_neo":case"donut-swin":c.num_heads="num_heads",c.num_layers="num_layers",c.hidden_size="hidden_size";break;case"bloom":c.num_heads="n_head",c.num_layers="n_layer",c.hidden_size="hidden_size";break;case"mpt":c.num_heads="n_heads",c.num_layers="n_layers",c.hidden_size="d_model";break;case"exaone":c.num_heads="num_key_value_heads",c.num_layers="num_layers",c.dim_kv="head_dim",c.num_attention_heads="num_attention_heads";break;case"t5":case"mt5":case"longt5":c.num_decoder_layers="num_decoder_layers",c.num_decoder_heads="num_heads",c.decoder_dim_kv="d_kv",c.num_encoder_layers="num_layers",c.num_encoder_heads="num_heads",c.encoder_dim_kv="d_kv";break;case"bart":case"mbart":case"marian":case"whisper":case"lite-whisper":case"m2m_100":case"blenderbot":case"blenderbot-small":case"florence2_language":c.num_decoder_layers="decoder_layers",c.num_decoder_heads="decoder_attention_heads",c.decoder_hidden_size="d_model",c.num_encoder_layers="encoder_layers",c.num_encoder_heads="encoder_attention_heads",c.encoder_hidden_size="d_model";break;case"speecht5":c.num_decoder_layers="decoder_layers",c.num_decoder_heads="decoder_attention_heads",c.decoder_hidden_size="hidden_size",c.num_encoder_layers="encoder_layers",c.num_encoder_heads="encoder_attention_heads",c.encoder_hidden_size="hidden_size";break;case"trocr":c.num_encoder_layers=c.num_decoder_layers="decoder_layers",c.num_encoder_heads=c.num_decoder_heads="decoder_attention_heads",c.encoder_hidden_size=c.decoder_hidden_size="d_model";break;case"musicgen_decoder":c.num_encoder_layers=c.num_decoder_layers="num_hidden_layers",c.num_encoder_heads=c.num_decoder_heads="num_attention_heads",c.encoder_hidden_size=c.decoder_hidden_size="hidden_size";break;case"moonshine":c.num_decoder_layers="decoder_num_hidden_layers",c.num_decoder_heads="decoder_num_key_value_heads",c.num_encoder_layers="encoder_num_hidden_layers",c.num_encoder_heads="encoder_num_key_value_heads",c.encoder_hidden_size=c.decoder_hidden_size="hidden_size";break;case"vision-encoder-decoder":const f=i(p.decoder),T="num_decoder_layers"in f,k=(0,s.pick)(p,["model_type","is_encoder_decoder"]);return T?(k.num_decoder_layers=f.num_decoder_layers,k.num_decoder_heads=f.num_decoder_heads,k.decoder_hidden_size=f.decoder_hidden_size,k.num_encoder_layers=f.num_encoder_layers,k.num_encoder_heads=f.num_encoder_heads,k.encoder_hidden_size=f.encoder_hidden_size):(k.num_layers=f.num_layers,k.num_heads=f.num_heads,k.hidden_size=f.hidden_size),k}const _={...d,...(0,s.pick)(p,["model_type","multi_query","is_encoder_decoder"])};for(const f in c)_[f]=p[c[f]];return _}function a(p,{prefix:c="past_key_values",batch_size:d=1}={}){const _={},f=p.normalized_config;if(f.is_encoder_decoder&&"num_encoder_heads"in f&&"num_decoder_heads"in f){const T=f.encoder_dim_kv??f.encoder_hidden_size/f.num_encoder_heads,k=f.decoder_dim_kv??f.decoder_hidden_size/f.num_decoder_heads,g=[d,f.num_encoder_heads,0,T],w=[d,f.num_decoder_heads,0,k];for(let S=0;S{var C,F;t.r(r),t.d(r,{apis:()=>k,env:()=>M});var s=t("?569f"),o=t("?3f59"),n=t("?154a");const i="3.5.2",a=typeof window<"u"&&typeof window.document<"u",l=typeof self<"u"&&((C=self.constructor)==null?void 0:C.name)==="DedicatedWorkerGlobalScope",u=typeof self<"u"&&"caches"in self,p=typeof navigator<"u"&&"gpu"in navigator,c=typeof navigator<"u"&&"ml"in navigator,d=typeof process<"u",_=d&&((F=process==null?void 0:process.release)==null?void 0:F.name)==="node",f=!y(s),T=!y(o),k=Object.freeze({IS_BROWSER_ENV:a,IS_WEBWORKER_ENV:l,IS_WEB_CACHE_AVAILABLE:u,IS_WEBGPU_AVAILABLE:p,IS_WEBNN_AVAILABLE:c,IS_PROCESS_AVAILABLE:d,IS_NODE_ENV:_,IS_FS_AVAILABLE:f,IS_PATH_AVAILABLE:T}),g=f&&T;let w="./";if(g){const z=Object({url:self.location.href}).url;z?w=o.dirname(o.dirname(n.fileURLToPath(z))):typeof __dirname<"u"&&(w=o.dirname(__dirname))}const S=g?o.join(w,"/.cache/"):null,E="/models/",v=g?o.join(w,E):E,M={version:i,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:"https://huggingface.co/",remotePathTemplate:"{model}/resolve/{revision}/",allowLocalModels:!(a||l),localModelPath:v,useFS:f,useBrowserCache:u,useFSCache:f,cacheDir:S,useCustomCache:!1,customCache:null};function y(z){return Object.keys(z).length===0}},"./src/generation/configuration_utils.js":(e,r,t)=>{t.r(r),t.d(r,{GenerationConfig:()=>o});var s=t("./src/utils/core.js");class o{constructor(i){Y(this,"max_length",20);Y(this,"max_new_tokens",null);Y(this,"min_length",0);Y(this,"min_new_tokens",null);Y(this,"early_stopping",!1);Y(this,"max_time",null);Y(this,"do_sample",!1);Y(this,"num_beams",1);Y(this,"num_beam_groups",1);Y(this,"penalty_alpha",null);Y(this,"use_cache",!0);Y(this,"temperature",1);Y(this,"top_k",50);Y(this,"top_p",1);Y(this,"typical_p",1);Y(this,"epsilon_cutoff",0);Y(this,"eta_cutoff",0);Y(this,"diversity_penalty",0);Y(this,"repetition_penalty",1);Y(this,"encoder_repetition_penalty",1);Y(this,"length_penalty",1);Y(this,"no_repeat_ngram_size",0);Y(this,"bad_words_ids",null);Y(this,"force_words_ids",null);Y(this,"renormalize_logits",!1);Y(this,"constraints",null);Y(this,"forced_bos_token_id",null);Y(this,"forced_eos_token_id",null);Y(this,"remove_invalid_values",!1);Y(this,"exponential_decay_length_penalty",null);Y(this,"suppress_tokens",null);Y(this,"streamer",null);Y(this,"begin_suppress_tokens",null);Y(this,"forced_decoder_ids",null);Y(this,"guidance_scale",null);Y(this,"num_return_sequences",1);Y(this,"output_attentions",!1);Y(this,"output_hidden_states",!1);Y(this,"output_scores",!1);Y(this,"return_dict_in_generate",!1);Y(this,"pad_token_id",null);Y(this,"bos_token_id",null);Y(this,"eos_token_id",null);Y(this,"encoder_no_repeat_ngram_size",0);Y(this,"decoder_start_token_id",null);Y(this,"generation_kwargs",{});Object.assign(this,(0,s.pick)(i,Object.getOwnPropertyNames(this)))}}},"./src/generation/logits_process.js":(e,r,t)=>{t.r(r),t.d(r,{ClassifierFreeGuidanceLogitsProcessor:()=>g,ForcedBOSTokenLogitsProcessor:()=>l,ForcedEOSTokenLogitsProcessor:()=>u,LogitsProcessor:()=>n,LogitsProcessorList:()=>a,LogitsWarper:()=>i,MinLengthLogitsProcessor:()=>f,MinNewTokensLengthLogitsProcessor:()=>T,NoBadWordsLogitsProcessor:()=>k,NoRepeatNGramLogitsProcessor:()=>d,RepetitionPenaltyLogitsProcessor:()=>_,SuppressTokensAtBeginLogitsProcessor:()=>p,TemperatureLogitsWarper:()=>w,TopKLogitsWarper:()=>E,TopPLogitsWarper:()=>S,WhisperTimeStampLogitsProcessor:()=>c});var s=t("./src/utils/generic.js");t("./src/utils/tensor.js");var o=t("./src/utils/maths.js");class n extends s.Callable{_call(M,y){throw Error("`_call` should be implemented in a subclass")}}class i extends s.Callable{_call(M,y){throw Error("`_call` should be implemented in a subclass")}}class a extends s.Callable{constructor(){super(),this.processors=[]}push(M){this.processors.push(M)}extend(M){this.processors.push(...M)}_call(M,y){let C=y;for(const F of this.processors)C=F(M,C);return C}[Symbol.iterator](){return this.processors.values()}}class l extends n{constructor(M){super(),this.bos_token_id=M}_call(M,y){for(let C=0;C=1&&z[z.length-1]>=this.timestamp_begin,q=z.length<2||z[z.length-2]>=this.timestamp_begin;if(K&&(q?F.subarray(this.timestamp_begin).fill(-1/0):F.subarray(0,this.eos_token_id).fill(-1/0)),M[C].length===this.begin_index&&this.max_initial_timestamp_index!==null){const J=this.timestamp_begin+this.max_initial_timestamp_index;F.subarray(J+1).fill(-1/0)}const R=(0,o.log_softmax)(F),Z=Math.log(R.subarray(this.timestamp_begin).map(Math.exp).reduce((J,Q)=>J+Q)),H=(0,o.max)(R.subarray(0,this.timestamp_begin))[0];Z>H&&F.subarray(0,this.timestamp_begin).fill(-1/0)}return y}}class d extends n{constructor(M){super(),this.no_repeat_ngram_size=M}getNgrams(M){const y=M.length,C=[];for(let z=0;z1 to use the classifier free guidance processor, got guidance scale ${M}.`);this.guidance_scale=M}_call(M,y){if(y.dims[0]!==2*M.length)throw new Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${y.dims[0]} for the logits and ${M.length} for the input ids.`);const C=M.length,F=y.slice([0,C],null),z=y.slice([C,y.dims[0]],null);for(let K=0;K1)throw new Error(`\`top_p\` must be a float > 0 and < 1, but is ${M}`);if(!Number.isInteger(C)||C<1)throw new Error(`\`min_tokens_to_keep\` must be a positive integer, but is ${C}`);this.top_p=M,this.filter_value=y,this.min_tokens_to_keep=C}}class E extends i{constructor(M,{filter_value:y=-1/0,min_tokens_to_keep:C=1}={}){if(super(),!Number.isInteger(M)||M<0)throw new Error(`\`top_k\` must be a positive integer, but is ${M}`);this.top_k=Math.max(M,C),this.filter_value=y}}},"./src/generation/logits_sampler.js":(e,r,t)=>{t.r(r),t.d(r,{LogitsSampler:()=>i});var s=t("./src/utils/generic.js"),o=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");t("./src/generation/configuration_utils.js");class i extends s.Callable{constructor(c){super(),this.generation_config=c}async _call(c){return this.sample(c)}async sample(c){throw Error("sample should be implemented in subclasses.")}getLogits(c,d){let _=c.dims.at(-1),f=c.data;if(d===-1)f=f.slice(-_);else{let T=d*_;f=f.slice(T,T+_)}return f}randomSelect(c){let d=0;for(let f=0;f1)return new u(c);if(c.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${c.num_return_sequences}.`);return new a(c)}}class a extends i{async sample(c){const d=(0,n.max)(c.data)[1];return[[BigInt(d),0]]}}class l extends i{async sample(c){let d=c.dims.at(-1);this.generation_config.top_k>0&&(d=Math.min(this.generation_config.top_k,d));const[_,f]=await(0,o.topk)(c,d),T=(0,n.softmax)(_.data);return Array.from({length:this.generation_config.num_beams},()=>{const k=this.randomSelect(T);return[f.data[k],Math.log(T[k])]})}}class u extends i{async sample(c){let d=c.dims.at(-1);this.generation_config.top_k>0&&(d=Math.min(this.generation_config.top_k,d));const[_,f]=await(0,o.topk)(c,d),T=(0,n.softmax)(_.data);return Array.from({length:this.generation_config.num_beams},(k,g)=>[f.data[g],Math.log(T[g])])}}},"./src/generation/stopping_criteria.js":(e,r,t)=>{t.r(r),t.d(r,{EosTokenCriteria:()=>a,InterruptableStoppingCriteria:()=>l,MaxLengthCriteria:()=>i,StoppingCriteria:()=>o,StoppingCriteriaList:()=>n});var s=t("./src/utils/generic.js");class o extends s.Callable{_call(p,c){throw Error("StoppingCriteria needs to be subclassed")}}class n extends s.Callable{constructor(){super(),this.criteria=[]}push(p){this.criteria.push(p)}extend(p){p instanceof n?p=p.criteria:p instanceof o&&(p=[p]),this.criteria.push(...p)}_call(p,c){const d=new Array(p.length).fill(!1);for(const _ of this.criteria){const f=_(p,c);for(let T=0;Tc.length>=this.max_length)}}class a extends o{constructor(p){super(),Array.isArray(p)||(p=[p]),this.eos_token_id=p}_call(p,c){return p.map(d=>{const _=d.at(-1);return this.eos_token_id.some(f=>_==f)})}}class l extends o{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(p,c){return new Array(p.length).fill(this.interrupted)}}},"./src/generation/streamers.js":(e,r,t)=>{t.r(r),t.d(r,{BaseStreamer:()=>i,TextStreamer:()=>l,WhisperTextStreamer:()=>u});var s=t("./src/utils/core.js"),o=t("./src/tokenizers.js"),n=t("./src/env.js");class i{put(c){throw Error("Not implemented")}end(){throw Error("Not implemented")}}const a=n.apis.IS_PROCESS_AVAILABLE?p=>process.stdout.write(p):p=>console.log(p);class l extends i{constructor(c,{skip_prompt:d=!1,callback_function:_=null,token_callback_function:f=null,skip_special_tokens:T=!0,decode_kwargs:k={},...g}={}){super(),this.tokenizer=c,this.skip_prompt=d,this.callback_function=_??a,this.token_callback_function=f,this.decode_kwargs={skip_special_tokens:T,...k,...g},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(c){var k;if(c.length>1)throw Error("TextStreamer only supports batch size of 1");const d=this.next_tokens_are_prompt;if(d&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;const _=c[0];(k=this.token_callback_function)==null||k.call(this,_),this.token_cache=(0,s.mergeArrays)(this.token_cache,_);const f=this.tokenizer.decode(this.token_cache,this.decode_kwargs);let T;d||f.endsWith(` -`)?(T=f.slice(this.print_len),this.token_cache=[],this.print_len=0):f.length>0&&(0,o.is_chinese_char)(f.charCodeAt(f.length-1))?(T=f.slice(this.print_len),this.print_len+=T.length):(T=f.slice(this.print_len,f.lastIndexOf(" ")+1),this.print_len+=T.length),this.on_finalized_text(T,!1)}end(){let c;this.token_cache.length>0?(c=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len),this.token_cache=[],this.print_len=0):c="",this.next_tokens_are_prompt=!0,this.on_finalized_text(c,!0)}on_finalized_text(c,d){var _,f;c.length>0&&((_=this.callback_function)==null||_.call(this,c)),d&&this.callback_function===a&&n.apis.IS_PROCESS_AVAILABLE&&((f=this.callback_function)==null||f.call(this,` -`))}}class u extends l{constructor(c,{skip_prompt:d=!1,callback_function:_=null,token_callback_function:f=null,on_chunk_start:T=null,on_chunk_end:k=null,on_finalize:g=null,time_precision:w=.02,skip_special_tokens:S=!0,decode_kwargs:E={}}={}){super(c,{skip_prompt:d,skip_special_tokens:S,callback_function:_,token_callback_function:f,decode_kwargs:E}),this.timestamp_begin=c.timestamp_begin,this.on_chunk_start=T,this.on_chunk_end=k,this.on_finalize=g,this.time_precision=w,this.waiting_for_timestamp=!1}put(c){var _,f,T;if(c.length>1)throw Error("WhisperTextStreamer only supports batch size of 1");const d=c[0];if(d.length===1){const k=Number(d[0])-this.timestamp_begin;if(k>=0){const g=k*this.time_precision;this.waiting_for_timestamp?(_=this.on_chunk_end)==null||_.call(this,g):(f=this.on_chunk_start)==null||f.call(this,g),this.waiting_for_timestamp=!this.waiting_for_timestamp,(T=this.token_callback_function)==null||T.call(this,d);return}}return super.put(c)}end(){var c;super.end(),(c=this.on_finalize)==null||c.call(this)}}},"./src/models.js":(e,r,t)=>{t.r(r),t.d(r,{ASTForAudioClassification:()=>Fi,ASTModel:()=>Ai,ASTPreTrainedModel:()=>Eo,AlbertForMaskedLM:()=>X,AlbertForQuestionAnswering:()=>j,AlbertForSequenceClassification:()=>$,AlbertModel:()=>de,AlbertPreTrainedModel:()=>Ds,AutoModel:()=>wc,AutoModelForAudioClassification:()=>P0,AutoModelForAudioFrameClassification:()=>S0,AutoModelForAudioTextToText:()=>z0,AutoModelForCTC:()=>E0,AutoModelForCausalLM:()=>m0,AutoModelForDepthEstimation:()=>A0,AutoModelForDocumentQuestionAnswering:()=>$0,AutoModelForImageClassification:()=>w0,AutoModelForImageFeatureExtraction:()=>D0,AutoModelForImageMatting:()=>k0,AutoModelForImageSegmentation:()=>M0,AutoModelForImageTextToText:()=>L0,AutoModelForImageToImage:()=>I0,AutoModelForMaskGeneration:()=>T0,AutoModelForMaskedLM:()=>f0,AutoModelForNormalEstimation:()=>F0,AutoModelForObjectDetection:()=>v0,AutoModelForPoseEstimation:()=>O0,AutoModelForQuestionAnswering:()=>_0,AutoModelForSemanticSegmentation:()=>b0,AutoModelForSeq2SeqLM:()=>c0,AutoModelForSequenceClassification:()=>l0,AutoModelForSpeechSeq2Seq:()=>d0,AutoModelForTextToSpectrogram:()=>p0,AutoModelForTextToWaveform:()=>h0,AutoModelForTokenClassification:()=>u0,AutoModelForUniversalSegmentation:()=>y0,AutoModelForVision2Seq:()=>g0,AutoModelForXVector:()=>C0,AutoModelForZeroShotObjectDetection:()=>x0,BartForConditionalGeneration:()=>Ut,BartForSequenceClassification:()=>mr,BartModel:()=>Yt,BartPretrainedModel:()=>At,BaseModelOutput:()=>we,BeitForImageClassification:()=>Ww,BeitModel:()=>Uw,BeitPreTrainedModel:()=>Du,BertForMaskedLM:()=>$e,BertForQuestionAnswering:()=>He,BertForSequenceClassification:()=>Fe,BertForTokenClassification:()=>Be,BertModel:()=>Ce,BertPreTrainedModel:()=>Se,BlenderbotForConditionalGeneration:()=>Dr,BlenderbotModel:()=>fr,BlenderbotPreTrainedModel:()=>Kt,BlenderbotSmallForConditionalGeneration:()=>Ir,BlenderbotSmallModel:()=>Jr,BlenderbotSmallPreTrainedModel:()=>Xr,BloomForCausalLM:()=>pw,BloomModel:()=>dw,BloomPreTrainedModel:()=>xu,CLIPModel:()=>Vi,CLIPPreTrainedModel:()=>Ns,CLIPSegForImageSegmentation:()=>Ro,CLIPSegModel:()=>Bo,CLIPSegPreTrainedModel:()=>Qn,CLIPTextModel:()=>pu,CLIPTextModelWithProjection:()=>Ui,CLIPVisionModel:()=>hu,CLIPVisionModelWithProjection:()=>Wi,CamembertForMaskedLM:()=>rt,CamembertForQuestionAnswering:()=>wr,CamembertForSequenceClassification:()=>jt,CamembertForTokenClassification:()=>Ht,CamembertModel:()=>ut,CamembertPreTrainedModel:()=>ht,CausalLMOutput:()=>In,CausalLMOutputWithPast:()=>Jx,ChineseCLIPModel:()=>qn,ChineseCLIPPreTrainedModel:()=>Ki,ClapAudioModelWithProjection:()=>Wb,ClapModel:()=>Vb,ClapPreTrainedModel:()=>ta,ClapTextModelWithProjection:()=>Ub,CodeGenForCausalLM:()=>eo,CodeGenModel:()=>$n,CodeGenPreTrainedModel:()=>Zn,CohereForCausalLM:()=>Kg,CohereModel:()=>Gg,CoherePreTrainedModel:()=>mu,ConvBertForMaskedLM:()=>rs,ConvBertForQuestionAnswering:()=>B,ConvBertForSequenceClassification:()=>D,ConvBertForTokenClassification:()=>oe,ConvBertModel:()=>Mt,ConvBertPreTrainedModel:()=>ir,ConvNextForImageClassification:()=>BM,ConvNextModel:()=>zM,ConvNextPreTrainedModel:()=>Xu,ConvNextV2ForImageClassification:()=>jM,ConvNextV2Model:()=>RM,ConvNextV2PreTrainedModel:()=>Ju,DFineForObjectDetection:()=>sM,DFineModel:()=>rM,DFinePreTrainedModel:()=>Nu,DPTForDepthEstimation:()=>MM,DPTModel:()=>wM,DPTPreTrainedModel:()=>Hu,DacDecoderModel:()=>Ay,DacDecoderOutput:()=>$y,DacEncoderModel:()=>Iy,DacEncoderOutput:()=>Sy,DacModel:()=>ky,DacPreTrainedModel:()=>la,DebertaForMaskedLM:()=>ss,DebertaForQuestionAnswering:()=>$s,DebertaForSequenceClassification:()=>ys,DebertaForTokenClassification:()=>ns,DebertaModel:()=>Or,DebertaPreTrainedModel:()=>Jt,DebertaV2ForMaskedLM:()=>Qr,DebertaV2ForQuestionAnswering:()=>As,DebertaV2ForSequenceClassification:()=>vs,DebertaV2ForTokenClassification:()=>Is,DebertaV2Model:()=>ks,DebertaV2PreTrainedModel:()=>Vr,DecisionTransformerModel:()=>dy,DecisionTransformerPreTrainedModel:()=>cy,DeiTForImageClassification:()=>lM,DeiTModel:()=>aM,DeiTPreTrainedModel:()=>Uu,DepthAnythingForDepthEstimation:()=>yM,DepthAnythingPreTrainedModel:()=>bM,DepthProForDepthEstimation:()=>PM,DepthProPreTrainedModel:()=>EM,DetrForObjectDetection:()=>Kw,DetrForSegmentation:()=>Lu,DetrModel:()=>Gw,DetrObjectDetectionOutput:()=>zu,DetrPreTrainedModel:()=>Qi,DetrSegmentationOutput:()=>Hw,Dinov2ForImageClassification:()=>VM,Dinov2Model:()=>NM,Dinov2PreTrainedModel:()=>Yu,Dinov2WithRegistersForImageClassification:()=>WM,Dinov2WithRegistersModel:()=>UM,Dinov2WithRegistersPreTrainedModel:()=>Zu,DistilBertForMaskedLM:()=>Ae,DistilBertForQuestionAnswering:()=>Br,DistilBertForSequenceClassification:()=>Er,DistilBertForTokenClassification:()=>xs,DistilBertModel:()=>Fs,DistilBertPreTrainedModel:()=>ar,DonutSwinModel:()=>LM,DonutSwinPreTrainedModel:()=>DM,EfficientNetForImageClassification:()=>Jb,EfficientNetModel:()=>Xb,EfficientNetPreTrainedModel:()=>uc,ElectraForMaskedLM:()=>Oe,ElectraForQuestionAnswering:()=>Ft,ElectraForSequenceClassification:()=>ve,ElectraForTokenClassification:()=>vt,ElectraModel:()=>me,ElectraPreTrainedModel:()=>te,EsmForMaskedLM:()=>Nt,EsmForSequenceClassification:()=>os,EsmForTokenClassification:()=>is,EsmModel:()=>it,EsmPreTrainedModel:()=>Je,ExaoneForCausalLM:()=>N,ExaoneModel:()=>L,ExaonePreTrainedModel:()=>I,FalconForCausalLM:()=>Nb,FalconModel:()=>jb,FalconPreTrainedModel:()=>ic,FastViTForImageClassification:()=>Aw,FastViTModel:()=>Iw,FastViTPreTrainedModel:()=>ku,Florence2ForConditionalGeneration:()=>Bi,Florence2PreTrainedModel:()=>Io,GLPNForDepthEstimation:()=>OM,GLPNModel:()=>FM,GLPNPreTrainedModel:()=>Qu,GPT2LMHeadModel:()=>Vo,GPT2Model:()=>No,GPT2PreTrainedModel:()=>jo,GPTBigCodeForCausalLM:()=>Ho,GPTBigCodeModel:()=>Ko,GPTBigCodePreTrainedModel:()=>Sn,GPTJForCausalLM:()=>Go,GPTJModel:()=>Wo,GPTJPreTrainedModel:()=>Yn,GPTNeoForCausalLM:()=>Pn,GPTNeoModel:()=>Uo,GPTNeoPreTrainedModel:()=>Xn,GPTNeoXForCausalLM:()=>Jn,GPTNeoXModel:()=>Cn,GPTNeoXPreTrainedModel:()=>Gr,Gemma2ForCausalLM:()=>Xg,Gemma2Model:()=>Qg,Gemma2PreTrainedModel:()=>_u,Gemma3ForCausalLM:()=>Yg,Gemma3Model:()=>Jg,Gemma3PreTrainedModel:()=>gu,GemmaForCausalLM:()=>qg,GemmaModel:()=>Hg,GemmaPreTrainedModel:()=>fu,GlmForCausalLM:()=>x,GlmModel:()=>h,GlmPreTrainedModel:()=>ro,GraniteForCausalLM:()=>Wg,GraniteModel:()=>qi,GranitePreTrainedModel:()=>Ls,GroundingDinoForObjectDetection:()=>KM,GroundingDinoPreTrainedModel:()=>GM,GroupViTModel:()=>kw,GroupViTPreTrainedModel:()=>$w,HeliumForCausalLM:()=>Jo,HeliumModel:()=>Xo,HeliumPreTrainedModel:()=>to,HieraForImageClassification:()=>cM,HieraModel:()=>uM,HieraPreTrainedModel:()=>Wu,HubertForCTC:()=>vb,HubertForSequenceClassification:()=>xb,HubertModel:()=>yb,HubertPreTrainedModel:()=>zx,IJepaForImageClassification:()=>bw,IJepaModel:()=>Mw,IJepaPreTrainedModel:()=>Cu,Idefics3ForConditionalGeneration:()=>En,Idefics3PreTrainedModel:()=>Hn,ImageMattingOutput:()=>R0,JAISLMHeadModel:()=>Hi,JAISModel:()=>ct,JAISPreTrainedModel:()=>Zs,JinaCLIPModel:()=>Do,JinaCLIPPreTrainedModel:()=>Ys,JinaCLIPTextModel:()=>Lo,JinaCLIPVisionModel:()=>zo,LiteWhisperForConditionalGeneration:()=>So,LlamaForCausalLM:()=>Qo,LlamaModel:()=>qo,LlamaPreTrainedModel:()=>kn,LlavaForConditionalGeneration:()=>Tn,LlavaOnevisionForConditionalGeneration:()=>Qs,LlavaPreTrainedModel:()=>ko,LongT5ForConditionalGeneration:()=>We,LongT5Model:()=>Qe,LongT5PreTrainedModel:()=>Re,M2M100ForConditionalGeneration:()=>rb,M2M100Model:()=>tb,M2M100PreTrainedModel:()=>rc,MBartForCausalLM:()=>Es,MBartForConditionalGeneration:()=>Cr,MBartForSequenceClassification:()=>Zt,MBartModel:()=>Pr,MBartPreTrainedModel:()=>Mr,MPNetForMaskedLM:()=>_n,MPNetForQuestionAnswering:()=>Mn,MPNetForSequenceClassification:()=>gn,MPNetForTokenClassification:()=>wn,MPNetModel:()=>fn,MPNetPreTrainedModel:()=>Ts,MT5ForConditionalGeneration:()=>Ot,MT5Model:()=>_t,MT5PreTrainedModel:()=>Ye,MarianMTModel:()=>eb,MarianModel:()=>ZM,MarianPreTrainedModel:()=>tc,MaskFormerForInstanceSegmentation:()=>AM,MaskFormerModel:()=>IM,MaskFormerPreTrainedModel:()=>qu,MaskedLMOutput:()=>Fr,Metric3DForDepthEstimation:()=>SM,Metric3DPreTrainedModel:()=>CM,Metric3Dv2ForDepthEstimation:()=>kM,Metric3Dv2PreTrainedModel:()=>$M,MgpstrForSceneTextRecognition:()=>_y,MgpstrModelOutput:()=>my,MgpstrPreTrainedModel:()=>fy,MimiDecoderModel:()=>Cy,MimiDecoderOutput:()=>Ty,MimiEncoderModel:()=>Py,MimiEncoderOutput:()=>xy,MimiModel:()=>Ey,MimiPreTrainedModel:()=>aa,MistralForCausalLM:()=>zb,MistralModel:()=>Lb,MistralPreTrainedModel:()=>nc,MobileBertForMaskedLM:()=>cr,MobileBertForQuestionAnswering:()=>ls,MobileBertForSequenceClassification:()=>hr,MobileBertModel:()=>as,MobileBertPreTrainedModel:()=>ur,MobileLLMForCausalLM:()=>Le,MobileLLMModel:()=>Te,MobileLLMPreTrainedModel:()=>ue,MobileNetV1ForImageClassification:()=>Zb,MobileNetV1ForSemanticSegmentation:()=>ey,MobileNetV1Model:()=>Yb,MobileNetV1PreTrainedModel:()=>sa,MobileNetV2ForImageClassification:()=>ry,MobileNetV2ForSemanticSegmentation:()=>sy,MobileNetV2Model:()=>ty,MobileNetV2PreTrainedModel:()=>na,MobileNetV3ForImageClassification:()=>oy,MobileNetV3ForSemanticSegmentation:()=>iy,MobileNetV3Model:()=>ny,MobileNetV3PreTrainedModel:()=>oa,MobileNetV4ForImageClassification:()=>ly,MobileNetV4ForSemanticSegmentation:()=>uy,MobileNetV4Model:()=>ay,MobileNetV4PreTrainedModel:()=>ia,MobileViTForImageClassification:()=>Lw,MobileViTModel:()=>Dw,MobileViTPreTrainedModel:()=>Iu,MobileViTV2ForImageClassification:()=>Bw,MobileViTV2Model:()=>zw,MobileViTV2PreTrainedModel:()=>Au,ModelOutput:()=>be,ModernBertForMaskedLM:()=>Ve,ModernBertForSequenceClassification:()=>Ze,ModernBertForTokenClassification:()=>nt,ModernBertModel:()=>ke,ModernBertPreTrainedModel:()=>qe,Moondream1ForConditionalGeneration:()=>zi,MoonshineForConditionalGeneration:()=>Li,MoonshineModel:()=>Di,MoonshinePreTrainedModel:()=>Kn,MptForCausalLM:()=>mw,MptModel:()=>hw,MptPreTrainedModel:()=>Tu,MultiModalityCausalLM:()=>hy,MultiModalityPreTrainedModel:()=>py,MusicgenForCausalLM:()=>Nx,MusicgenForConditionalGeneration:()=>dc,MusicgenModel:()=>jx,MusicgenPreTrainedModel:()=>cc,NomicBertModel:()=>Ge,NomicBertPreTrainedModel:()=>lt,OPTForCausalLM:()=>_w,OPTModel:()=>fw,OPTPreTrainedModel:()=>Eu,Olmo2ForCausalLM:()=>yr,Olmo2Model:()=>Wt,Olmo2PreTrainedModel:()=>kt,OlmoForCausalLM:()=>bt,OlmoModel:()=>tt,OlmoPreTrainedModel:()=>Ke,OpenELMForCausalLM:()=>ew,OpenELMModel:()=>Zg,OpenELMPreTrainedModel:()=>wu,OwlViTForObjectDetection:()=>jw,OwlViTModel:()=>Rw,OwlViTPreTrainedModel:()=>Fu,Owlv2ForObjectDetection:()=>Vw,Owlv2Model:()=>Nw,Owlv2PreTrainedModel:()=>Ou,PaliGemmaForConditionalGeneration:()=>ji,PaliGemmaPreTrainedModel:()=>Ri,PatchTSMixerForPrediction:()=>by,PatchTSMixerModel:()=>My,PatchTSMixerPreTrainedModel:()=>hc,PatchTSTForPrediction:()=>wy,PatchTSTModel:()=>gy,PatchTSTPreTrainedModel:()=>pc,Phi3ForCausalLM:()=>cw,Phi3Model:()=>uw,Phi3PreTrainedModel:()=>vu,Phi3VForCausalLM:()=>Fo,Phi3VPreTrainedModel:()=>Ni,PhiForCausalLM:()=>lw,PhiModel:()=>aw,PhiPreTrainedModel:()=>yu,PreTrainedModel:()=>G,PretrainedMixin:()=>Lt,PvtForImageClassification:()=>Tw,PvtModel:()=>xw,PvtPreTrainedModel:()=>Su,PyAnnoteForAudioFrameClassification:()=>lb,PyAnnoteModel:()=>ab,PyAnnotePreTrainedModel:()=>sc,QuestionAnsweringModelOutput:()=>Rr,Qwen2ForCausalLM:()=>rw,Qwen2Model:()=>tw,Qwen2PreTrainedModel:()=>Mu,Qwen2VLForConditionalGeneration:()=>iw,Qwen2VLPreTrainedModel:()=>ow,Qwen3ForCausalLM:()=>nw,Qwen3Model:()=>sw,Qwen3PreTrainedModel:()=>bu,RFDetrForObjectDetection:()=>eM,RFDetrModel:()=>Zw,RFDetrObjectDetectionOutput:()=>tM,RFDetrPreTrainedModel:()=>ju,RTDetrForObjectDetection:()=>Qw,RTDetrModel:()=>qw,RTDetrObjectDetectionOutput:()=>Yo,RTDetrPreTrainedModel:()=>Bu,RTDetrV2ForObjectDetection:()=>Jw,RTDetrV2Model:()=>Xw,RTDetrV2ObjectDetectionOutput:()=>Yw,RTDetrV2PreTrainedModel:()=>Ru,ResNetForImageClassification:()=>pM,ResNetModel:()=>dM,ResNetPreTrainedModel:()=>Gu,RoFormerForMaskedLM:()=>St,RoFormerForQuestionAnswering:()=>gr,RoFormerForSequenceClassification:()=>Vt,RoFormerForTokenClassification:()=>Rt,RoFormerModel:()=>pt,RoFormerPreTrainedModel:()=>Ie,RobertaForMaskedLM:()=>er,RobertaForQuestionAnswering:()=>Ar,RobertaForSequenceClassification:()=>dr,RobertaForTokenClassification:()=>pr,RobertaModel:()=>br,RobertaPreTrainedModel:()=>Lr,SamImageSegmentationOutput:()=>YM,SamModel:()=>JM,SamPreTrainedModel:()=>XM,SapiensForDepthEstimation:()=>xM,SapiensForNormalEstimation:()=>TM,SapiensForSemanticSegmentation:()=>vM,SapiensPreTrainedModel:()=>Ji,SegformerForImageClassification:()=>Kb,SegformerForSemanticSegmentation:()=>Hb,SegformerModel:()=>Rx,SegformerPreTrainedModel:()=>ra,Seq2SeqLMOutput:()=>Xx,SequenceClassifierOutput:()=>xt,SiglipModel:()=>Js,SiglipPreTrainedModel:()=>Xs,SiglipTextModel:()=>Oo,SiglipVisionModel:()=>Gi,SmolVLMForConditionalGeneration:()=>Ao,SnacDecoderModel:()=>Dy,SnacEncoderModel:()=>Oy,SnacModel:()=>Fy,SnacPreTrainedModel:()=>ua,SpeechT5ForSpeechToText:()=>Ib,SpeechT5ForTextToSpeech:()=>Ab,SpeechT5HifiGan:()=>Fb,SpeechT5Model:()=>Bx,SpeechT5PreTrainedModel:()=>ea,SqueezeBertForMaskedLM:()=>bn,SqueezeBertForQuestionAnswering:()=>vn,SqueezeBertForSequenceClassification:()=>yn,SqueezeBertModel:()=>Hs,SqueezeBertPreTrainedModel:()=>Os,StableLmForCausalLM:()=>Qb,StableLmModel:()=>qb,StableLmPreTrainedModel:()=>lc,Starcoder2ForCausalLM:()=>Rb,Starcoder2Model:()=>Bb,Starcoder2PreTrainedModel:()=>oc,StyleTextToSpeech2Model:()=>kb,StyleTextToSpeech2PreTrainedModel:()=>$b,Swin2SRForImageSuperResolution:()=>gM,Swin2SRModel:()=>_M,Swin2SRPreTrainedModel:()=>Ku,SwinForImageClassification:()=>mM,SwinForSemanticSegmentation:()=>fM,SwinModel:()=>hM,SwinPreTrainedModel:()=>Xi,T5ForConditionalGeneration:()=>xe,T5Model:()=>ce,T5PreTrainedModel:()=>ie,TableTransformerForObjectDetection:()=>oM,TableTransformerModel:()=>nM,TableTransformerObjectDetectionOutput:()=>iM,TableTransformerPreTrainedModel:()=>Vu,TokenClassifierOutput:()=>Sr,TrOCRForCausalLM:()=>Db,TrOCRPreTrainedModel:()=>Ob,UltravoxModel:()=>vy,UltravoxPreTrainedModel:()=>yy,UniSpeechForCTC:()=>pb,UniSpeechForSequenceClassification:()=>hb,UniSpeechModel:()=>db,UniSpeechPreTrainedModel:()=>Yi,UniSpeechSatForAudioFrameClassification:()=>gb,UniSpeechSatForCTC:()=>fb,UniSpeechSatForSequenceClassification:()=>_b,UniSpeechSatModel:()=>mb,UniSpeechSatPreTrainedModel:()=>Zo,ViTForImageClassification:()=>ww,ViTMAEModel:()=>Pw,ViTMAEPreTrainedModel:()=>Ew,ViTMSNForImageClassification:()=>Sw,ViTMSNModel:()=>Cw,ViTMSNPreTrainedModel:()=>$u,ViTModel:()=>gw,ViTPreTrainedModel:()=>Pu,VisionEncoderDecoderModel:()=>$o,VitMatteForImageMatting:()=>Ow,VitMattePreTrainedModel:()=>Fw,VitPoseForPoseEstimation:()=>vw,VitPosePreTrainedModel:()=>yw,VitsModel:()=>ac,VitsModelOutput:()=>j0,VitsPreTrainedModel:()=>Gb,Wav2Vec2BertForCTC:()=>Mb,Wav2Vec2BertForSequenceClassification:()=>bb,Wav2Vec2BertModel:()=>wb,Wav2Vec2BertPreTrainedModel:()=>Zi,Wav2Vec2ForAudioFrameClassification:()=>ib,Wav2Vec2ForCTC:()=>nb,Wav2Vec2ForSequenceClassification:()=>ob,Wav2Vec2Model:()=>sb,Wav2Vec2PreTrainedModel:()=>en,WavLMForAudioFrameClassification:()=>Sb,WavLMForCTC:()=>Eb,WavLMForSequenceClassification:()=>Pb,WavLMForXVector:()=>Cb,WavLMModel:()=>Tb,WavLMPreTrainedModel:()=>so,WeSpeakerResNetModel:()=>cb,WeSpeakerResNetPreTrainedModel:()=>ub,WhisperForConditionalGeneration:()=>Co,WhisperModel:()=>Oi,WhisperPreTrainedModel:()=>Po,XLMForQuestionAnswering:()=>To,XLMForSequenceClassification:()=>Ei,XLMForTokenClassification:()=>Pi,XLMModel:()=>xn,XLMPreTrainedModel:()=>us,XLMRobertaForMaskedLM:()=>Si,XLMRobertaForQuestionAnswering:()=>Ii,XLMRobertaForSequenceClassification:()=>$i,XLMRobertaForTokenClassification:()=>ki,XLMRobertaModel:()=>Ci,XLMRobertaPreTrainedModel:()=>qs,XLMWithLMHeadModel:()=>Ti,XVectorOutput:()=>B0,YolosForObjectDetection:()=>qM,YolosModel:()=>HM,YolosObjectDetectionOutput:()=>QM,YolosPreTrainedModel:()=>ec});var s=t("./src/configs.js"),o=t("./src/backends/onnx.js"),n=t("./src/utils/dtypes.js"),i=t("./src/utils/generic.js"),a=t("./src/utils/core.js"),l=t("./src/utils/hub.js"),u=t("./src/utils/constants.js"),p=t("./src/generation/logits_process.js"),c=t("./src/generation/configuration_utils.js"),d=t("./src/utils/tensor.js"),_=t("./src/utils/image.js"),f=t("./src/utils/maths.js"),T=t("./src/generation/stopping_criteria.js"),k=t("./src/generation/logits_sampler.js"),g=t("./src/env.js"),w=t("./src/models/whisper/generation_whisper.js"),S=t("./src/models/whisper/common_whisper.js");const E={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11},v=new Map,M=new Map,y=new Map;async function C(b,P,O){var $r;let ne=(($r=O.config)==null?void 0:$r["transformers.js_config"])??{},ge=O.device??ne.device;ge&&typeof ge!="string"&&(ge.hasOwnProperty(P)?ge=ge[P]:(console.warn(`device not specified for "${P}". Using the default device.`),ge=null));const he=ge??(g.apis.IS_NODE_ENV?"cpu":"wasm"),Ee=(0,o.deviceToExecutionProviders)(he),De=ne.device_config??{};De.hasOwnProperty(he)&&(ne={...ne,...De[he]});let Ne=O.dtype??ne.dtype;if(typeof Ne!="string"&&(Ne&&Ne.hasOwnProperty(P)?Ne=Ne[P]:(Ne=n.DEFAULT_DEVICE_DTYPE_MAPPING[he]??n.DATA_TYPES.fp32,console.warn(`dtype not specified for "${P}". Using the default dtype (${Ne}) for this device (${he}).`))),Ne===n.DATA_TYPES.auto){let Ct=ne.dtype;typeof Ct!="string"&&(Ct=Ct==null?void 0:Ct[P]),Ct&&Ct!==n.DATA_TYPES.auto&&n.DATA_TYPES.hasOwnProperty(Ct)?Ne=Ct:Ne=n.DEFAULT_DEVICE_DTYPE_MAPPING[he]??n.DATA_TYPES.fp32}const Xe=Ne;if(n.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(Xe)){if(Xe===n.DATA_TYPES.fp16&&he==="webgpu"&&!await(0,n.isWebGpuFp16Supported)())throw new Error(`The device (${he}) does not support fp16.`)}else throw new Error(`Invalid dtype: ${Xe}. Should be one of: ${Object.keys(n.DATA_TYPES).join(", ")}`);const mt=ne.kv_cache_dtype,wt=mt?typeof mt=="string"?mt:mt[Xe]??"float32":void 0;if(wt&&!["float32","float16"].includes(wt))throw new Error(`Invalid kv_cache_dtype: ${wt}. Should be one of: float32, float16`);const dt={dtype:Xe,kv_cache_dtype:wt,device:he},Pt=n.DEFAULT_DTYPE_SUFFIX_MAPPING[Xe],gt=`${P}${Pt}.onnx`,Et=`${O.subfolder??""}/${gt}`,ot={...O.session_options};ot.executionProviders??(ot.executionProviders=Ee);const $t=ne.free_dimension_overrides;$t?ot.freeDimensionOverrides??(ot.freeDimensionOverrides=$t):he.startsWith("webnn")&&!ot.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${he}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);const qt=g.apis.IS_NODE_ENV&&g.env.useFSCache,tr=(0,l.getModelFile)(b,Et,!0,O,qt),lr=O.use_external_data_format??ne.use_external_data_format;let nr=[];if(lr){let Ct;typeof lr=="object"?lr.hasOwnProperty(gt)?Ct=lr[gt]:lr.hasOwnProperty(P)?Ct=lr[P]:Ct=!1:Ct=lr;const vr=+Ct;if(vr>l.MAX_EXTERNAL_DATA_CHUNKS)throw new Error(`The number of external data chunks (${vr}) exceeds the maximum allowed value (${l.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let Yr=0;Yr{const Fn=await(0,l.getModelFile)(b,Ur,!0,O,qt);cs(Fn instanceof Uint8Array?{path:An,data:Fn}:An)}))}}else ot.externalData!==void 0&&(nr=ot.externalData.map(async Ct=>{if(typeof Ct.data=="string"){const vr=await(0,l.getModelFile)(b,Ct.data,!0,O);return{...Ct,data:vr}}return Ct}));if(nr.length>0){const Ct=await Promise.all(nr);g.apis.IS_NODE_ENV||(ot.externalData=Ct)}if(he==="webgpu"){const Ct=(0,s.getKeyValueShapes)(O.config,{prefix:"present"});if(Object.keys(Ct).length>0&&!(0,o.isONNXProxy)()){const vr={};for(const Yr in Ct)vr[Yr]="gpu-buffer";ot.preferredOutputLocation=vr}}return{buffer_or_path:await tr,session_options:ot,session_config:dt}}async function F(b,P,O){return Object.fromEntries(await Promise.all(Object.keys(P).map(async ne=>{const{buffer_or_path:ge,session_options:he,session_config:Ee}=await C(b,P[ne],O),De=await(0,o.createInferenceSession)(ge,he,Ee);return[ne,De]})))}async function z(b,P,O){return Object.fromEntries(await Promise.all(Object.keys(P).map(async ne=>{const ge=await(0,l.getModelJSON)(b,P[ne],!1,O);return[ne,ge]})))}function K(b,P){const O=Object.create(null),ne=[];for(const Ee of b.inputNames){const De=P[Ee];if(!(De instanceof d.Tensor)){ne.push(Ee);continue}O[Ee]=(0,o.isONNXProxy)()?De.clone():De}if(ne.length>0)throw new Error(`An error occurred during model execution: "Missing the following inputs: ${ne.join(", ")}.`);const ge=Object.keys(P).length,he=b.inputNames.length;if(ge>he){let Ee=Object.keys(P).filter(De=>!b.inputNames.includes(De));console.warn(`WARNING: Too many inputs were provided (${ge} > ${he}). The following inputs will be ignored: "${Ee.join(", ")}".`)}return O}let q=Promise.resolve();async function R(b,P){const O=K(b,P);try{const ne=Object.fromEntries(Object.entries(O).map(([Ee,De])=>[Ee,De.ort_tensor])),ge=()=>b.run(ne),he=await(g.apis.IS_BROWSER_ENV||g.apis.IS_WEBWORKER_ENV?q=q.then(ge):ge());return Z(he)}catch(ne){const ge=Object.fromEntries(Object.entries(O).map(([he,Ee])=>{const De={type:Ee.type,dims:Ee.dims,location:Ee.location};return De.location!=="gpu-buffer"&&(De.data=Ee.data),[he,De]}));throw console.error(`An error occurred during model execution: "${ne}".`),console.error("Inputs given to model:",ge),ne}}function Z(b){for(let P in b)(0,o.isONNXTensor)(b[P])?b[P]=new d.Tensor(b[P]):typeof b[P]=="object"&&Z(b[P]);return b}function H(b){if(b instanceof d.Tensor)return b;if(b.length===0)throw Error("items must be non-empty");if(Array.isArray(b[0])){if(b.some(P=>P.length!==b[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new d.Tensor("int64",BigInt64Array.from(b.flat().map(P=>BigInt(P))),[b.length,b[0].length])}else return new d.Tensor("int64",BigInt64Array.from(b.map(P=>BigInt(P))),[1,b.length])}function J(b){return new d.Tensor("bool",[b],[1])}async function Q(b,P){let{encoder_outputs:O,input_ids:ne,decoder_input_ids:ge,...he}=P;if(!O){const De=(0,a.pick)(P,b.sessions.model.inputNames);O=(await se(b,De)).last_hidden_state}return he.input_ids=ge,he.encoder_hidden_states=O,b.sessions.decoder_model_merged.inputNames.includes("encoder_attention_mask")&&(he.encoder_attention_mask=P.attention_mask),await ae(b,he,!0)}async function se(b,P){const O=b.sessions.model,ne=(0,a.pick)(P,O.inputNames);if(O.inputNames.includes("inputs_embeds")&&!ne.inputs_embeds){if(!P.input_ids)throw new Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");ne.inputs_embeds=await b.encode_text({input_ids:P.input_ids})}if(O.inputNames.includes("token_type_ids")&&!ne.token_type_ids){if(!ne.input_ids)throw new Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");ne.token_type_ids=(0,d.zeros_like)(ne.input_ids)}if(O.inputNames.includes("pixel_mask")&&!ne.pixel_mask){if(!ne.pixel_values)throw new Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");const ge=ne.pixel_values.dims;ne.pixel_mask=(0,d.ones)([ge[0],ge[2],ge[3]])}return await R(O,ne)}async function fe(b,P){const O=await b.encode(P);return await b.decode(O)}async function ae(b,P,O=!1){const ne=b.sessions[O?"decoder_model_merged":"model"],{past_key_values:ge,...he}=P;if(ne.inputNames.includes("use_cache_branch")&&(he.use_cache_branch=J(!!ge)),ne.inputNames.includes("position_ids")&&he.attention_mask&&!he.position_ids){const De=["paligemma","gemma3_text","gemma3"].includes(b.config.model_type)?1:0;he.position_ids=ze(he,ge,De)}b.addPastKeyValues(he,ge);const Ee=(0,a.pick)(he,ne.inputNames);return await R(ne,Ee)}function V({modality_token_id:b,inputs_embeds:P,modality_features:O,input_ids:ne,attention_mask:ge}){const he=ne.tolist().map(Xe=>Xe.reduce((mt,wt,dt)=>(wt==b&&mt.push(dt),mt),[])),Ee=he.reduce((Xe,mt)=>Xe+mt.length,0),De=O.dims[0];if(Ee!==De)throw new Error(`Number of tokens and features do not match: tokens: ${Ee}, features ${De}`);let Ne=0;for(let Xe=0;Xehe.dims[1])){if(geDe==b.config.image_token_index)){const De=b.config.num_image_tokens;if(!De)throw new Error("`num_image_tokens` is missing in the model configuration.");const Ne=he.dims[1]-(ge-De);O.input_ids=he.slice(null,[-Ne,null]),O.attention_mask=(0,d.ones)([1,ge+Ne])}}}return O}function pe(b,P,O,ne){return O.past_key_values&&(P=P.map(ge=>[ge.at(-1)])),{...O,decoder_input_ids:H(P)}}function W(b,...P){return b.config.is_encoder_decoder?pe(b,...P):Ue(b,...P)}function re(b,P,O,ne){const ge=!!O.past_key_values;return ne.guidance_scale!==null&&ne.guidance_scale>1&&(ge?O.input_ids=(0,d.cat)([O.input_ids,O.input_ids],0):(O.input_ids=(0,d.cat)([O.input_ids,(0,d.full_like)(O.input_ids,BigInt(ne.pad_token_id))],0),O.attention_mask=(0,d.cat)([O.attention_mask,(0,d.full_like)(O.attention_mask,0n)],0))),(ge||!O.pixel_values)&&(O.pixel_values=(0,d.full)([0,0,3,384,384],1)),ge&&(O.images_seq_mask=new d.Tensor("bool",new Array(1).fill(!0).fill(!1,0,1),[1,1]),O.images_emb_mask=new d.Tensor("bool",new Array(0).fill(!1),[1,1,0])),O}class G extends i.Callable{constructor(O,ne,ge){super();Y(this,"main_input_name","input_ids");Y(this,"forward_params",["input_ids","attention_mask"]);this.config=O,this.sessions=ne,this.configs=ge;const he=y.get(this.constructor),Ee=v.get(he);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,Ee){case E.DecoderOnly:this.can_generate=!0,this._forward=ae,this._prepare_inputs_for_generation=Ue;break;case E.Seq2Seq:case E.Vision2Seq:case E.Musicgen:this.can_generate=!0,this._forward=Q,this._prepare_inputs_for_generation=pe;break;case E.EncoderDecoder:this._forward=Q;break;case E.ImageTextToText:this.can_generate=!0,this._forward=le,this._prepare_inputs_for_generation=W;break;case E.AudioTextToText:this.can_generate=!0,this._forward=_e,this._prepare_inputs_for_generation=W;break;case E.Phi3V:this.can_generate=!0,this._prepare_inputs_for_generation=W;break;case E.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=re;break;case E.AutoEncoder:this._forward=fe;break;default:this._forward=se;break}this.can_generate&&this.forward_params.push("past_key_values"),this.custom_config=this.config["transformers.js_config"]??{}}async dispose(){var ne;const O=[];for(const ge of Object.values(this.sessions))(ne=ge==null?void 0:ge.handler)!=null&&ne.dispose&&O.push(ge.handler.dispose());return await Promise.all(O)}static async from_pretrained(O,{progress_callback:ne=null,config:ge=null,cache_dir:he=null,local_files_only:Ee=!1,revision:De="main",model_file_name:Ne=null,subfolder:Xe="onnx",device:mt=null,dtype:wt=null,use_external_data_format:dt=null,session_options:Pt={}}={}){let gt={progress_callback:ne,config:ge,cache_dir:he,local_files_only:Ee,revision:De,model_file_name:Ne,subfolder:Xe,device:mt,dtype:wt,use_external_data_format:dt,session_options:Pt};const Et=y.get(this),ot=v.get(Et);ge=gt.config=await s.AutoConfig.from_pretrained(O,gt);let $t;if(ot===E.DecoderOnly)$t=await Promise.all([F(O,{model:gt.model_file_name??"model"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(ot===E.Seq2Seq||ot===E.Vision2Seq)$t=await Promise.all([F(O,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(ot===E.MaskGeneration)$t=await Promise.all([F(O,{model:"vision_encoder",prompt_encoder_mask_decoder:"prompt_encoder_mask_decoder"},gt)]);else if(ot===E.EncoderDecoder)$t=await Promise.all([F(O,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},gt)]);else if(ot===E.ImageTextToText){const qt={embed_tokens:"embed_tokens",vision_encoder:"vision_encoder",decoder_model_merged:"decoder_model_merged"};ge.is_encoder_decoder&&(qt.model="encoder_model"),$t=await Promise.all([F(O,qt,gt),z(O,{generation_config:"generation_config.json"},gt)])}else if(ot===E.AudioTextToText){const qt={embed_tokens:"embed_tokens",audio_encoder:"audio_encoder",decoder_model_merged:"decoder_model_merged"};$t=await Promise.all([F(O,qt,gt),z(O,{generation_config:"generation_config.json"},gt)])}else if(ot===E.Musicgen)$t=await Promise.all([F(O,{model:"text_encoder",decoder_model_merged:"decoder_model_merged",encodec_decode:"encodec_decode"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(ot===E.MultiModality)$t=await Promise.all([F(O,{prepare_inputs_embeds:"prepare_inputs_embeds",model:"language_model",lm_head:"lm_head",gen_head:"gen_head",gen_img_embeds:"gen_img_embeds",image_decode:"image_decode"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(ot===E.Phi3V)$t=await Promise.all([F(O,{prepare_inputs_embeds:"prepare_inputs_embeds",model:"model",vision_encoder:"vision_encoder"},gt),z(O,{generation_config:"generation_config.json"},gt)]);else if(ot===E.AutoEncoder)$t=await Promise.all([F(O,{encoder_model:"encoder_model",decoder_model:"decoder_model"},gt)]);else{if(ot!==E.EncoderOnly){const qt=Et??(ge==null?void 0:ge.model_type);qt!=="custom"&&console.warn(`Model type for '${qt}' not found, assuming encoder-only architecture. Please report this at ${u.GITHUB_ISSUE_URL}.`)}$t=await Promise.all([F(O,{model:gt.model_file_name??"model"},gt)])}return new this(ge,...$t)}async _call(O){return await this.forward(O)}async forward(O){return await this._forward(this,O)}get generation_config(){var O;return((O=this.configs)==null?void 0:O.generation_config)??null}_get_logits_warper(O){const ne=new p.LogitsProcessorList;return O.temperature!==null&&O.temperature!==1&&ne.push(new p.TemperatureLogitsWarper(O.temperature)),O.top_k!==null&&O.top_k!==0&&ne.push(new p.TopKLogitsWarper(O.top_k)),O.top_p!==null&&O.top_p<1&&ne.push(new p.TopPLogitsWarper(O.top_p)),ne}_get_logits_processor(O,ne,ge=null){const he=new p.LogitsProcessorList;if(O.repetition_penalty!==null&&O.repetition_penalty!==1&&he.push(new p.RepetitionPenaltyLogitsProcessor(O.repetition_penalty)),O.no_repeat_ngram_size!==null&&O.no_repeat_ngram_size>0&&he.push(new p.NoRepeatNGramLogitsProcessor(O.no_repeat_ngram_size)),O.bad_words_ids!==null&&he.push(new p.NoBadWordsLogitsProcessor(O.bad_words_ids,O.eos_token_id)),O.min_length!==null&&O.eos_token_id!==null&&O.min_length>0&&he.push(new p.MinLengthLogitsProcessor(O.min_length,O.eos_token_id)),O.min_new_tokens!==null&&O.eos_token_id!==null&&O.min_new_tokens>0&&he.push(new p.MinNewTokensLengthLogitsProcessor(ne,O.min_new_tokens,O.eos_token_id)),O.forced_bos_token_id!==null&&he.push(new p.ForcedBOSTokenLogitsProcessor(O.forced_bos_token_id)),O.forced_eos_token_id!==null&&he.push(new p.ForcedEOSTokenLogitsProcessor(O.max_length,O.forced_eos_token_id)),O.begin_suppress_tokens!==null){const Ee=ne>1||O.forced_bos_token_id===null?ne:ne+1;he.push(new p.SuppressTokensAtBeginLogitsProcessor(O.begin_suppress_tokens,Ee))}return O.guidance_scale!==null&&O.guidance_scale>1&&he.push(new p.ClassifierFreeGuidanceLogitsProcessor(O.guidance_scale)),ge!==null&&he.extend(ge),he}_prepare_generation_config(O,ne,ge=c.GenerationConfig){const he={...this.config};for(const De of["decoder","generator","text_config"])De in he&&Object.assign(he,he[De]);const Ee=new ge(he);return Object.assign(Ee,this.generation_config??{}),O&&Object.assign(Ee,O),ne&&Object.assign(Ee,(0,a.pick)(ne,Object.getOwnPropertyNames(Ee))),Ee}_get_stopping_criteria(O,ne=null){const ge=new T.StoppingCriteriaList;return O.max_length!==null&&ge.push(new T.MaxLengthCriteria(O.max_length,this.config.max_position_embeddings??null)),O.eos_token_id!==null&&ge.push(new T.EosTokenCriteria(O.eos_token_id)),ne&&ge.extend(ne),ge}_validate_model_class(){if(!this.can_generate){const O=[_c,gc,fc,mc],ne=y.get(this.constructor),ge=new Set,he=this.config.model_type;for(const De of O){const Ne=De.get(he);Ne&&ge.add(Ne[0])}let Ee=`The current model class (${ne}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw ge.size>0&&(Ee+=` Please use the following class instead: ${[...ge].join(", ")}`),Error(Ee)}}prepare_inputs_for_generation(...O){return this._prepare_inputs_for_generation(this,...O)}_update_model_kwargs_for_generation({generated_input_ids:O,outputs:ne,model_inputs:ge,is_encoder_decoder:he}){return ge.past_key_values=this.getPastKeyValues(ne,ge.past_key_values),ge.input_ids=new d.Tensor("int64",O.flat(),[O.length,1]),he||(ge.attention_mask=(0,d.cat)([ge.attention_mask,(0,d.ones)([ge.attention_mask.dims[0],1])],1)),ge.position_ids=null,ge}_prepare_model_inputs({inputs:O,bos_token_id:ne,model_kwargs:ge}){const he=(0,a.pick)(ge,this.forward_params),Ee=this.main_input_name;if(Ee in he){if(O)throw new Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else he[Ee]=O;return{inputs_tensor:he[Ee],model_inputs:he,model_input_name:Ee}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:O,model_inputs:ne,model_input_name:ge,generation_config:he}){if(this.sessions.model.inputNames.includes("inputs_embeds")&&!ne.inputs_embeds&&"_prepare_inputs_embeds"in this){const{input_ids:De,pixel_values:Ne,attention_mask:Xe,...mt}=ne,wt=await this._prepare_inputs_embeds(ne);ne={...mt,...(0,a.pick)(wt,["inputs_embeds","attention_mask"])}}let{last_hidden_state:Ee}=await se(this,ne);if(he.guidance_scale!==null&&he.guidance_scale>1)Ee=(0,d.cat)([Ee,(0,d.full_like)(Ee,0)],0),"attention_mask"in ne&&(ne.attention_mask=(0,d.cat)([ne.attention_mask,(0,d.zeros_like)(ne.attention_mask)],0));else if(ne.decoder_input_ids){const De=H(ne.decoder_input_ids).dims[0];if(De!==Ee.dims[0]){if(Ee.dims[0]!==1)throw new Error(`The encoder outputs have a different batch size (${Ee.dims[0]}) than the decoder inputs (${De}).`);Ee=(0,d.cat)(Array.from({length:De},()=>Ee),0)}}return ne.encoder_outputs=Ee,ne}_prepare_decoder_input_ids_for_generation({batch_size:O,model_input_name:ne,model_kwargs:ge,decoder_start_token_id:he,bos_token_id:Ee,generation_config:De}){let{decoder_input_ids:Ne,...Xe}=ge;if(!(Ne instanceof d.Tensor)){if(Ne)Array.isArray(Ne[0])||(Ne=Array.from({length:O},()=>Ne));else if(he??(he=Ee),this.config.model_type==="musicgen")Ne=Array.from({length:O*this.config.decoder.num_codebooks},()=>[he]);else if(Array.isArray(he)){if(he.length!==O)throw new Error(`\`decoder_start_token_id\` expcted to have length ${O} but got ${he.length}`);Ne=he}else Ne=Array.from({length:O},()=>[he]);Ne=H(Ne)}return ge.decoder_attention_mask=(0,d.ones_like)(Ne),{input_ids:Ne,model_inputs:Xe}}async generate({inputs:O=null,generation_config:ne=null,logits_processor:ge=null,stopping_criteria:he=null,streamer:Ee=null,...De}){this._validate_model_class(),ne=this._prepare_generation_config(ne,De);let{inputs_tensor:Ne,model_inputs:Xe,model_input_name:mt}=this._prepare_model_inputs({inputs:O,model_kwargs:De});const wt=this.config.is_encoder_decoder;wt&&("encoder_outputs"in Xe||(Xe=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:Ne,model_inputs:Xe,model_input_name:mt,generation_config:ne})));let dt;wt?{input_ids:dt,model_inputs:Xe}=this._prepare_decoder_input_ids_for_generation({batch_size:Xe[mt].dims.at(0),model_input_name:mt,model_kwargs:Xe,decoder_start_token_id:ne.decoder_start_token_id,bos_token_id:ne.bos_token_id,generation_config:ne}):dt=Xe[mt];let Pt=dt.dims.at(-1);ne.max_new_tokens!==null&&(ne.max_length=Pt+ne.max_new_tokens);const gt=this._get_logits_processor(ne,Pt,ge),Et=this._get_stopping_criteria(ne,he),ot=Xe[mt].dims.at(0),$t=k.LogitsSampler.getSampler(ne),qt=new Array(ot).fill(0),tr=dt.tolist();Ee&&Ee.put(tr);let lr,nr={};for(;;){if(Xe=this.prepare_inputs_for_generation(tr,Xe,ne),lr=await this.forward(Xe),ne.output_attentions&&ne.return_dict_in_generate){const Ur=this.getAttentions(lr);for(const cs in Ur)cs in nr||(nr[cs]=[]),nr[cs].push(Ur[cs])}const Ct=lr.logits.slice(null,-1,null),vr=gt(tr,Ct),Yr=[];for(let Ur=0;UrUr))break;Xe=this._update_model_kwargs_for_generation({generated_input_ids:Yr,outputs:lr,model_inputs:Xe,is_encoder_decoder:wt})}Ee&&Ee.end();const _r=this.getPastKeyValues(lr,Xe.past_key_values,!0),$r=new d.Tensor("int64",tr.flat(),[tr.length,tr[0].length]);if(ne.return_dict_in_generate)return{sequences:$r,past_key_values:_r,...nr};for(const Ct of Object.values(lr))Ct.location==="gpu-buffer"&&Ct.dispose();return $r}getPastKeyValues(O,ne,ge=!1){const he=Object.create(null);for(const Ee in O)if(Ee.startsWith("present")){const De=Ee.replace("present","past_key_values"),Ne=Ee.includes("encoder");if(Ne&&ne?he[De]=ne[De]:he[De]=O[Ee],ne&&(!Ne||ge)){const Xe=ne[De];Xe.location==="gpu-buffer"&&Xe.dispose()}}return he}getAttentions(O){const ne={};for(const ge of["cross_attentions","encoder_attentions","decoder_attentions"])for(const he in O)he.startsWith(ge)&&(ge in ne||(ne[ge]=[]),ne[ge].push(O[he]));return ne}addPastKeyValues(O,ne){var ge,he,Ee;if(ne)Object.assign(O,ne);else{const De=this.sessions.decoder_model_merged??this.sessions.model,Ne=((ge=De==null?void 0:De.config)==null?void 0:ge.kv_cache_dtype)??"float32",Xe=Ne==="float16"?new d.DataTypeMap.float16:[],mt=((Ee=(he=O[this.main_input_name]??O.attention_mask)==null?void 0:he.dims)==null?void 0:Ee[0])??1,wt=(0,s.getKeyValueShapes)(this.config,{batch_size:mt});for(const dt in wt)O[dt]=new d.Tensor(Ne,Xe,wt[dt])}}async encode_image({pixel_values:O}){const ne=(await R(this.sessions.vision_encoder,{pixel_values:O})).image_features;return this.config.num_image_tokens||(console.warn(`The number of image tokens was not set in the model configuration. Setting it to the number of features detected by the vision encoder (${ne.dims[1]}).`),this.config.num_image_tokens=ne.dims[1]),ne}async encode_text({input_ids:O}){return(await R(this.sessions.embed_tokens,{input_ids:O})).inputs_embeds}async encode_audio({audio_values:O}){return(await R(this.sessions.audio_encoder,{audio_values:O})).audio_features}}class be{}class we extends be{constructor({last_hidden_state:P,hidden_states:O=null,attentions:ne=null}){super(),this.last_hidden_state=P,this.hidden_states=O,this.attentions=ne}}class Se extends G{}class Ce extends Se{}class $e extends Se{async _call(P){return new Fr(await super._call(P))}}class Fe extends Se{async _call(P){return new xt(await super._call(P))}}class Be extends Se{async _call(P){return new Sr(await super._call(P))}}class He extends Se{async _call(P){return new Rr(await super._call(P))}}class qe extends G{}class ke extends qe{}class Ve extends qe{async _call(P){return new Fr(await super._call(P))}}class Ze extends qe{async _call(P){return new xt(await super._call(P))}}class nt extends qe{async _call(P){return new Sr(await super._call(P))}}class lt extends G{}class Ge extends lt{}class Ie extends G{}class pt extends Ie{}class St extends Ie{async _call(P){return new Fr(await super._call(P))}}class Vt extends Ie{async _call(P){return new xt(await super._call(P))}}class Rt extends Ie{async _call(P){return new Sr(await super._call(P))}}class gr extends Ie{async _call(P){return new Rr(await super._call(P))}}class ir extends G{}class Mt extends ir{}class rs extends ir{async _call(P){return new Fr(await super._call(P))}}class D extends ir{async _call(P){return new xt(await super._call(P))}}class oe extends ir{async _call(P){return new Sr(await super._call(P))}}class B extends ir{async _call(P){return new Rr(await super._call(P))}}class te extends G{}class me extends te{}class Oe extends te{async _call(P){return new Fr(await super._call(P))}}class ve extends te{async _call(P){return new xt(await super._call(P))}}class vt extends te{async _call(P){return new Sr(await super._call(P))}}class Ft extends te{async _call(P){return new Rr(await super._call(P))}}class ht extends G{}class ut extends ht{}class rt extends ht{async _call(P){return new Fr(await super._call(P))}}class jt extends ht{async _call(P){return new xt(await super._call(P))}}class Ht extends ht{async _call(P){return new Sr(await super._call(P))}}class wr extends ht{async _call(P){return new Rr(await super._call(P))}}class Jt extends G{}class Or extends Jt{}class ss extends Jt{async _call(P){return new Fr(await super._call(P))}}class ys extends Jt{async _call(P){return new xt(await super._call(P))}}class ns extends Jt{async _call(P){return new Sr(await super._call(P))}}class $s extends Jt{async _call(P){return new Rr(await super._call(P))}}class Vr extends G{}class ks extends Vr{}class Qr extends Vr{async _call(P){return new Fr(await super._call(P))}}class vs extends Vr{async _call(P){return new xt(await super._call(P))}}class Is extends Vr{async _call(P){return new Sr(await super._call(P))}}class As extends Vr{async _call(P){return new Rr(await super._call(P))}}class ar extends G{}class Fs extends ar{}class Er extends ar{async _call(P){return new xt(await super._call(P))}}class xs extends ar{async _call(P){return new Sr(await super._call(P))}}class Br extends ar{async _call(P){return new Rr(await super._call(P))}}class Ae extends ar{async _call(P){return new Fr(await super._call(P))}}class Je extends G{}class it extends Je{}class Nt extends Je{async _call(P){return new Fr(await super._call(P))}}class os extends Je{async _call(P){return new xt(await super._call(P))}}class is extends Je{async _call(P){return new Sr(await super._call(P))}}class ur extends G{}class as extends ur{}class cr extends ur{async _call(P){return new Fr(await super._call(P))}}class hr extends ur{async _call(P){return new xt(await super._call(P))}}class ls extends ur{async _call(P){return new Rr(await super._call(P))}}class Ts extends G{}class fn extends Ts{}class _n extends Ts{async _call(P){return new Fr(await super._call(P))}}class gn extends Ts{async _call(P){return new xt(await super._call(P))}}class wn extends Ts{async _call(P){return new Sr(await super._call(P))}}class Mn extends Ts{async _call(P){return new Rr(await super._call(P))}}class Os extends G{}class Hs extends Os{}class bn extends Os{async _call(P){return new Fr(await super._call(P))}}class yn extends Os{async _call(P){return new xt(await super._call(P))}}class vn extends Os{async _call(P){return new Rr(await super._call(P))}}class Ds extends G{}class de extends Ds{}class $ extends Ds{async _call(P){return new xt(await super._call(P))}}class j extends Ds{async _call(P){return new Rr(await super._call(P))}}class X extends Ds{async _call(P){return new Fr(await super._call(P))}}class ie extends G{constructor(){super(...arguments);Y(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class ce extends ie{}class xe extends ie{}class Re extends G{}class Qe extends Re{}class We extends Re{}class Ye extends G{}class _t extends Ye{}class Ot extends Ye{}class At extends G{}class Yt extends At{}class Ut extends At{}class mr extends At{async _call(P){return new xt(await super._call(P))}}class Mr extends G{}class Pr extends Mr{}class Cr extends Mr{}class Zt extends Mr{async _call(P){return new xt(await super._call(P))}}class Es extends Mr{}class Kt extends G{}class fr extends Kt{}class Dr extends Kt{}class Xr extends G{}class Jr extends Xr{}class Ir extends Xr{}class Lr extends G{}class br extends Lr{}class er extends Lr{async _call(P){return new Fr(await super._call(P))}}class dr extends Lr{async _call(P){return new xt(await super._call(P))}}class pr extends Lr{async _call(P){return new Sr(await super._call(P))}}class Ar extends Lr{async _call(P){return new Rr(await super._call(P))}}class us extends G{}class xn extends us{}class Ti extends us{async _call(P){return new Fr(await super._call(P))}}class Ei extends us{async _call(P){return new xt(await super._call(P))}}class Pi extends us{async _call(P){return new Sr(await super._call(P))}}class To extends us{async _call(P){return new Rr(await super._call(P))}}class qs extends G{}class Ci extends qs{}class Si extends qs{async _call(P){return new Fr(await super._call(P))}}class $i extends qs{async _call(P){return new xt(await super._call(P))}}class ki extends qs{async _call(P){return new Sr(await super._call(P))}}class Ii extends qs{async _call(P){return new Rr(await super._call(P))}}class Eo extends G{}class Ai extends Eo{}class Fi extends Eo{}class Po extends G{constructor(){super(...arguments);Y(this,"requires_attention_mask",!1);Y(this,"main_input_name","input_features");Y(this,"forward_params",["input_features","attention_mask","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class Oi extends Po{}class Co extends Po{_prepare_generation_config(P,O){return super._prepare_generation_config(P,O,w.WhisperGenerationConfig)}_retrieve_init_tokens(P){const O=[P.decoder_start_token_id];let ne=P.language;const ge=P.task;if(P.is_multilingual){ne||(console.warn("No language specified - defaulting to English (en)."),ne="en");const Ee=`<|${(0,S.whisper_language_to_code)(ne)}|>`;O.push(P.lang_to_id[Ee]),O.push(P.task_to_id[ge??"transcribe"])}else if(ne||ge)throw new Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!P.return_timestamps&&P.no_timestamps_token_id&&O.at(-1)!==P.no_timestamps_token_id?O.push(P.no_timestamps_token_id):P.return_timestamps&&O.at(-1)===P.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),O.pop()),O.filter(he=>he!=null)}async generate({inputs:P=null,generation_config:O=null,logits_processor:ne=null,stopping_criteria:ge=null,...he}){O=this._prepare_generation_config(O,he);const Ee=he.decoder_input_ids??this._retrieve_init_tokens(O);if(O.return_timestamps&&(ne??(ne=new p.LogitsProcessorList),ne.push(new p.WhisperTimeStampLogitsProcessor(O,Ee))),O.begin_suppress_tokens&&(ne??(ne=new p.LogitsProcessorList),ne.push(new p.SuppressTokensAtBeginLogitsProcessor(O.begin_suppress_tokens,Ee.length))),O.return_token_timestamps){if(!O.alignment_heads)throw new Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");O.task==="translate"&&console.warn("Token-level timestamps may not be reliable for task 'translate'."),O.output_attentions=!0,O.return_dict_in_generate=!0}const De=await super.generate({inputs:P,generation_config:O,logits_processor:ne,decoder_input_ids:Ee,...he});return O.return_token_timestamps&&(De.token_timestamps=this._extract_token_timestamps(De,O.alignment_heads,O.num_frames)),De}_extract_token_timestamps(P,O,ne=null,ge=.02){if(!P.cross_attentions)throw new Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");ne==null&&console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let he=this.config.median_filter_width;he===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),he=7);const Ee=P.cross_attentions,De=Array.from({length:this.config.decoder_layers},(Et,ot)=>(0,d.cat)(Ee.map($t=>$t[ot]),2)),Ne=(0,d.stack)(O.map(([Et,ot])=>{if(Et>=De.length)throw new Error(`Layer index ${Et} is out of bounds for cross attentions (length ${De.length}).`);return ne?De[Et].slice(null,ot,null,[0,ne]):De[Et].slice(null,ot)})).transpose(1,0,2,3),[Xe,mt]=(0,d.std_mean)(Ne,-2,0,!0),wt=Ne.clone();for(let Et=0;Et$t[$r+1]-$t[$r]),lr=(0,a.mergeArrays)([1],tr).map(_r=>!!_r),nr=[];for(let _r=0;_rdt.findIndex(Pt=>Pt==he)),Ne=De.every(dt=>dt===-1),Xe=De.every(dt=>dt!==-1);if(!Ne&&!Xe)throw new Error("Every input should contain either 0 or 1 image token.");if(Ne)return{inputs_embeds:P,attention_mask:ge};const mt=[],wt=[];for(let dt=0;dtArray.from({length:P.dims[0]},tr=>Array.from({length:P.dims[1]},lr=>1))),gt=O?O.tolist():[],Et=ne?ne.tolist():[];let ot=0,$t=0;for(let qt=0;qtdt[qt][xr]==1),nr=tr.reduce((rr,xr,tn)=>(xr==Ne&&rr.push(tn),rr),[]).map(rr=>tr[rr+1]),_r=nr.filter(rr=>rr==Ee).length,$r=nr.filter(rr=>rr==De).length;let Ct=[],vr=0,Yr=_r,An=$r;for(let rr=0;rrPs>vr&&Dn==Ee),tn=tr.findIndex((Dn,Ps)=>Ps>vr&&Dn==De),On=Yr>0&&xr!==-1?xr:tr.length+1,oo=An>0&&tn!==-1?tn:tr.length+1;let ha,Mc,bc,yc;On0?(0,f.max)(Ct.at(-1))[0]+1:0;Ct.push(Array.from({length:3*xc},(Dn,Ps)=>N0+Ps%xc));const Tc=xc+N0,fa=Yx*vc*ma,Zx=Array.from({length:fa},(Dn,Ps)=>Tc+Math.floor(Ps/(vc*ma))),eT=Array.from({length:fa},(Dn,Ps)=>Tc+Math.floor(Ps/ma)%vc),tT=Array.from({length:fa},(Dn,Ps)=>Tc+Ps%ma);Ct.push([Zx,eT,tT].flat()),vr=ha+fa}if(vr0?(0,f.max)(Ct.at(-1))[0]+1:0,xr=tr.length-vr;Ct.push(Array.from({length:3*xr},(tn,On)=>rr+On%xr))}const Ur=Ct.reduce((rr,xr)=>rr+xr.length,0),cs=new Array(Ur);let ca=0;for(let rr=0;rr<3;++rr)for(let xr=0;xrwt[ot%wt.length]),gt=Array.from({length:dt[0]},(Et,ot)=>(0,f.max)(wt.subarray(dt[1]*ot,dt[1]*(ot+1)))[0]+1n+BigInt(dt[1]));return[new d.Tensor("int64",Pt,[3,...dt]),new d.Tensor("int64",gt,[gt.length,1])]}else{const[wt,dt]=P.dims,Pt=BigInt64Array.from({length:3*wt*dt},(gt,Et)=>BigInt(Math.floor(Et%dt/wt)));return[new d.Tensor("int64",Pt,[3,...P.dims]),(0,d.zeros)([wt,1])]}}async encode_image({pixel_values:P,image_grid_thw:O}){return(await R(this.sessions.vision_encoder,{pixel_values:P,grid_thw:O})).image_features}_merge_input_ids_with_image_features(P){return A({image_token_id:this.config.image_token_id,...P})}prepare_inputs_for_generation(P,O,ne){if(O.attention_mask&&!O.position_ids)if(!O.past_key_values)[O.position_ids,O.rope_deltas]=this.get_rope_index(O.input_ids,O.image_grid_thw,O.video_grid_thw,O.attention_mask);else{O.pixel_values=null;const ge=BigInt(Object.values(O.past_key_values)[0].dims.at(-2)),he=O.rope_deltas.map(Ee=>ge+Ee);O.position_ids=(0,d.stack)([he,he,he],0)}return O}}class yu extends G{}class aw extends yu{}class lw extends yu{}class vu extends G{}class uw extends vu{}class cw extends vu{}class xu extends G{}class dw extends xu{}class pw extends xu{}class Tu extends G{}class hw extends Tu{}class mw extends Tu{}class Eu extends G{}class fw extends Eu{}class _w extends Eu{}class Pu extends G{}class gw extends Pu{}class ww extends Pu{async _call(P){return new xt(await super._call(P))}}class Cu extends G{}class Mw extends Cu{}class bw extends Cu{async _call(P){return new xt(await super._call(P))}}class yw extends G{}class vw extends yw{}class Su extends G{}class xw extends Su{}class Tw extends Su{async _call(P){return new xt(await super._call(P))}}class Ew extends G{}class Pw extends Ew{}class $u extends G{}class Cw extends $u{}class Sw extends $u{async _call(P){return new xt(await super._call(P))}}class $w extends G{}class kw extends $w{}class ku extends G{}class Iw extends ku{}class Aw extends ku{async _call(P){return new xt(await super._call(P))}}class Fw extends G{}class Ow extends Fw{async _call(P){return new R0(await super._call(P))}}class Iu extends G{}class Dw extends Iu{}class Lw extends Iu{async _call(P){return new xt(await super._call(P))}}class Au extends G{}class zw extends Au{}class Bw extends Au{async _call(P){return new xt(await super._call(P))}}class Fu extends G{}class Rw extends Fu{}class jw extends Fu{}class Ou extends G{}class Nw extends Ou{}class Vw extends Ou{}class Du extends G{}class Uw extends Du{}class Ww extends Du{async _call(P){return new xt(await super._call(P))}}class Qi extends G{}class Gw extends Qi{}class Kw extends Qi{async _call(P){return new zu(await super._call(P))}}class Lu extends Qi{async _call(P){return new Hw(await super._call(P))}}class zu extends be{constructor({logits:P,pred_boxes:O}){super(),this.logits=P,this.pred_boxes=O}}class Hw extends be{constructor({logits:P,pred_boxes:O,pred_masks:ne}){super(),this.logits=P,this.pred_boxes=O,this.pred_masks=ne}}class Bu extends G{}class qw extends Bu{}class Qw extends Bu{async _call(P){return new Yo(await super._call(P))}}class Yo extends be{constructor({logits:P,pred_boxes:O}){super(),this.logits=P,this.pred_boxes=O}}class Ru extends G{}class Xw extends Ru{}class Jw extends Ru{async _call(P){return new Yw(await super._call(P))}}class Yw extends Yo{}class ju extends G{}class Zw extends ju{}class eM extends ju{async _call(P){return new tM(await super._call(P))}}class tM extends Yo{}class Nu extends G{}class rM extends Nu{}class sM extends Nu{async _call(P){return new Yo(await super._call(P))}}class Vu extends G{}class nM extends Vu{}class oM extends Vu{async _call(P){return new iM(await super._call(P))}}class iM extends zu{}class Uu extends G{}class aM extends Uu{}class lM extends Uu{async _call(P){return new xt(await super._call(P))}}class Wu extends G{}class uM extends Wu{}class cM extends Wu{async _call(P){return new xt(await super._call(P))}}class Gu extends G{}class dM extends Gu{}class pM extends Gu{async _call(P){return new xt(await super._call(P))}}class Xi extends G{}class hM extends Xi{}class mM extends Xi{async _call(P){return new xt(await super._call(P))}}class fM extends Xi{}class Ku extends G{}class _M extends Ku{}class gM extends Ku{}class Hu extends G{}class wM extends Hu{}class MM extends Hu{}class bM extends G{}class yM extends bM{}class Ji extends G{}class vM extends Ji{}class xM extends Ji{}class TM extends Ji{}class EM extends G{}class PM extends EM{}class CM extends G{}class SM extends CM{}class $M extends G{}class kM extends $M{}class qu extends G{}class IM extends qu{}class AM extends qu{}class Qu extends G{}class FM extends Qu{}class OM extends Qu{}class DM extends G{}class LM extends DM{}class Xu extends G{}class zM extends Xu{}class BM extends Xu{async _call(P){return new xt(await super._call(P))}}class Ju extends G{}class RM extends Ju{}class jM extends Ju{async _call(P){return new xt(await super._call(P))}}class Yu extends G{}class NM extends Yu{}class VM extends Yu{async _call(P){return new xt(await super._call(P))}}class Zu extends G{}class UM extends Zu{}class WM extends Zu{async _call(P){return new xt(await super._call(P))}}class GM extends G{}class KM extends GM{}class ec extends G{}class HM extends ec{}class qM extends ec{async _call(P){return new QM(await super._call(P))}}class QM extends be{constructor({logits:P,pred_boxes:O}){super(),this.logits=P,this.pred_boxes=O}}class XM extends G{}class JM extends XM{async get_image_embeddings({pixel_values:P}){return await se(this,{pixel_values:P})}async forward(P){if((!P.image_embeddings||!P.image_positional_embeddings)&&(P={...P,...await this.get_image_embeddings(P)}),!P.input_labels&&P.input_points){const ne=P.input_points.dims.slice(0,-1),ge=ne.reduce((he,Ee)=>he*Ee,1);P.input_labels=new d.Tensor("int64",new BigInt64Array(ge).fill(1n),ne)}const O={image_embeddings:P.image_embeddings,image_positional_embeddings:P.image_positional_embeddings};return P.input_points&&(O.input_points=P.input_points),P.input_labels&&(O.input_labels=P.input_labels),P.input_boxes&&(O.input_boxes=P.input_boxes),await R(this.sessions.prompt_encoder_mask_decoder,O)}async _call(P){return new YM(await super._call(P))}}class YM extends be{constructor({iou_scores:P,pred_masks:O}){super(),this.iou_scores=P,this.pred_masks=O}}class tc extends G{}class ZM extends tc{}class eb extends tc{}class rc extends G{}class tb extends rc{}class rb extends rc{}class en extends G{}class sb extends en{}class nb extends en{async _call(P){return new In(await super._call(P))}}class ob extends en{async _call(P){return new xt(await super._call(P))}}class ib extends en{async _call(P){return new Sr(await super._call(P))}}class sc extends G{}class ab extends sc{}class lb extends sc{async _call(P){return new Sr(await super._call(P))}}class ub extends G{}class cb extends ub{}class Yi extends G{}class db extends Yi{}class pb extends Yi{async _call(P){return new In(await super._call(P))}}class hb extends Yi{async _call(P){return new xt(await super._call(P))}}class Zo extends G{}class mb extends Zo{}class fb extends Zo{async _call(P){return new In(await super._call(P))}}class _b extends Zo{async _call(P){return new xt(await super._call(P))}}class gb extends Zo{async _call(P){return new Sr(await super._call(P))}}class Zi extends G{}class wb extends Zi{}class Mb extends Zi{async _call(P){return new In(await super._call(P))}}class bb extends Zi{async _call(P){return new xt(await super._call(P))}}class zx extends G{}class yb extends en{}class vb extends en{async _call(P){return new In(await super._call(P))}}class xb extends en{async _call(P){return new xt(await super._call(P))}}class so extends G{}class Tb extends so{}class Eb extends so{async _call(P){return new In(await super._call(P))}}class Pb extends so{async _call(P){return new xt(await super._call(P))}}class Cb extends so{async _call(P){return new B0(await super._call(P))}}class Sb extends so{async _call(P){return new Sr(await super._call(P))}}class $b extends G{}class kb extends $b{}class ea extends G{}class Bx extends ea{}class Ib extends ea{}class Ab extends ea{async generate_speech(P,O,{threshold:ne=.5,minlenratio:ge=0,maxlenratio:he=20,vocoder:Ee=null}={}){const De={input_ids:P},{encoder_outputs:Ne,encoder_attention_mask:Xe}=await se(this,De),mt=Ne.dims[1]/this.config.reduction_factor,wt=Math.floor(mt*he),dt=Math.floor(mt*ge),Pt=this.config.num_mel_bins;let gt=[],Et=null,ot=null,$t=0;for(;;){++$t;const lr=J(!!ot);let nr;ot?nr=ot.output_sequence_out:nr=new d.Tensor("float32",new Float32Array(Pt),[1,1,Pt]);let _r={use_cache_branch:lr,output_sequence:nr,encoder_attention_mask:Xe,speaker_embeddings:O,encoder_hidden_states:Ne};this.addPastKeyValues(_r,Et),ot=await R(this.sessions.decoder_model_merged,_r),Et=this.getPastKeyValues(ot,Et);const{prob:$r,spectrum:Ct}=ot;if(gt.push(Ct),$t>=dt&&(Array.from($r.data).filter(vr=>vr>=ne).length>0||$t>=wt))break}const qt=(0,d.cat)(gt),{waveform:tr}=await R(Ee.sessions.model,{spectrogram:qt});return{spectrogram:qt,waveform:tr}}}class Fb extends G{constructor(){super(...arguments);Y(this,"main_input_name","spectrogram")}}class Ob extends G{}class Db extends Ob{}class nc extends G{}class Lb extends nc{}class zb extends nc{}class oc extends G{}class Bb extends oc{}class Rb extends oc{}class ic extends G{}class jb extends ic{}class Nb extends ic{}class ta extends G{}class Vb extends ta{}class Ub extends ta{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"text_model"})}}class Wb extends ta{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"audio_model"})}}class Gb extends G{}class ac extends Gb{async _call(P){return new j0(await super._call(P))}}class ra extends G{}class Rx extends ra{}class Kb extends ra{}class Hb extends ra{}class lc extends G{}class qb extends lc{}class Qb extends lc{}class uc extends G{}class Xb extends uc{}class Jb extends uc{async _call(P){return new xt(await super._call(P))}}class cc extends G{}class jx extends cc{}class Nx extends cc{}class dc extends G{constructor(){super(...arguments);Y(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}_apply_and_filter_by_delay_pattern_mask(O){const[ne,ge]=O.dims,he=this.config.decoder.num_codebooks,Ee=ge-he;let De=0;for(let mt=0;mt0&&Pt<=Ee&&(O.data[De++]=O.data[mt])}const Ne=Math.floor(ne/he),Xe=De/(Ne*he);return new d.Tensor(O.type,O.data.slice(0,De),[Ne,he,Xe])}prepare_inputs_for_generation(O,ne,ge){let he=structuredClone(O);for(let De=0;De=Ne&&(he[De][Ne]=BigInt(this.config.decoder.pad_token_id));return ge.guidance_scale!==null&&ge.guidance_scale>1&&(he=he.concat(he)),super.prepare_inputs_for_generation(he,ne,ge)}async generate(O){const ne=await super.generate(O),ge=this._apply_and_filter_by_delay_pattern_mask(ne).unsqueeze_(0),{audio_values:he}=await R(this.sessions.encodec_decode,{audio_codes:ge});return he}}class sa extends G{}class Yb extends sa{}class Zb extends sa{async _call(P){return new xt(await super._call(P))}}class ey extends sa{}class na extends G{}class ty extends na{}class ry extends na{async _call(P){return new xt(await super._call(P))}}class sy extends na{}class oa extends G{}class ny extends oa{}class oy extends oa{async _call(P){return new xt(await super._call(P))}}class iy extends oa{}class ia extends G{}class ay extends ia{}class ly extends ia{async _call(P){return new xt(await super._call(P))}}class uy extends ia{}class cy extends G{}class dy extends cy{}class py extends G{}class hy extends py{constructor(...O){super(...O);Y(this,"forward_params",["input_ids","pixel_values","images_seq_mask","images_emb_mask","attention_mask","position_ids","past_key_values"]);this._generation_mode="text"}async forward(O){const ne=this._generation_mode??"text";let ge;if(ne==="text"||!O.past_key_values){const Xe=this.sessions.prepare_inputs_embeds,mt=(0,a.pick)(O,Xe.inputNames);ge=await R(Xe,mt)}else{const Xe=this.sessions.gen_img_embeds,mt=(0,a.pick)({image_ids:O.input_ids},Xe.inputNames);ge=await R(Xe,mt)}const he={...O,...ge},Ee=await ae(this,he),De=this.sessions[ne==="text"?"lm_head":"gen_head"];if(!De)throw new Error(`Unable to find "${De}" generation head`);const Ne=await R(De,(0,a.pick)(Ee,De.inputNames));return{...ge,...Ee,...Ne}}async generate(O){return this._generation_mode="text",super.generate(O)}async generate_images(O){this._generation_mode="image";const ne=(O.inputs??O[this.main_input_name]).dims[1],he=(await super.generate(O)).slice(null,[ne,null]),Ee=this.sessions.image_decode,{decoded_image:De}=await R(Ee,{generated_tokens:he}),Ne=De.add_(1).mul_(255/2).clamp_(0,255).to("uint8"),Xe=[];for(const mt of Ne){const wt=_.RawImage.fromTensor(mt);Xe.push(wt)}return Xe}}class my extends be{constructor({char_logits:P,bpe_logits:O,wp_logits:ne}){super(),this.char_logits=P,this.bpe_logits=O,this.wp_logits=ne}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class fy extends G{}class _y extends fy{async _call(P){return new my(await super._call(P))}}class pc extends G{}class gy extends pc{}class wy extends pc{}class hc extends G{}class My extends hc{}class by extends hc{}class yy extends G{constructor(){super(...arguments);Y(this,"forward_params",["input_ids","attention_mask","position_ids","audio_values","past_key_values"])}}class vy extends yy{_merge_input_ids_with_audio_features(P){const O=P.audio_features.dims.at(-1),ne=P.audio_features.view(-1,O);return U({audio_token_id:this.config.ignore_index,...P,audio_features:ne})}}class aa extends G{constructor(){super(...arguments);Y(this,"main_input_name","input_values");Y(this,"forward_params",["input_values"])}}class xy extends be{constructor({audio_codes:P}){super(),this.audio_codes=P}}class Ty extends be{constructor({audio_values:P}){super(),this.audio_values=P}}class Ey extends aa{async encode(P){return new xy(await R(this.sessions.encoder_model,P))}async decode(P){return new Ty(await R(this.sessions.decoder_model,P))}}class Py extends aa{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"encoder_model"})}}class Cy extends aa{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"decoder_model"})}}class la extends G{constructor(){super(...arguments);Y(this,"main_input_name","input_values");Y(this,"forward_params",["input_values"])}}class Sy extends be{constructor({audio_codes:P}){super(),this.audio_codes=P}}class $y extends be{constructor({audio_values:P}){super(),this.audio_values=P}}class ky extends la{async encode(P){return new Sy(await R(this.sessions.encoder_model,P))}async decode(P){return new $y(await R(this.sessions.decoder_model,P))}}class Iy extends la{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"encoder_model"})}}class Ay extends la{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"decoder_model"})}}class ua extends G{constructor(){super(...arguments);Y(this,"main_input_name","input_values");Y(this,"forward_params",["input_values"])}}class Fy extends ua{async encode(P){return await R(this.sessions.encoder_model,P)}async decode(P){return await R(this.sessions.decoder_model,P)}}class Oy extends ua{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"encoder_model"})}}class Dy extends ua{static async from_pretrained(P,O={}){return super.from_pretrained(P,{...O,model_file_name:O.model_file_name??"decoder_model"})}}class Lt{static async from_pretrained(P,{progress_callback:O=null,config:ne=null,cache_dir:ge=null,local_files_only:he=!1,revision:Ee="main",model_file_name:De=null,subfolder:Ne="onnx",device:Xe=null,dtype:mt=null,use_external_data_format:wt=null,session_options:dt={}}={}){const Pt={progress_callback:O,config:ne,cache_dir:ge,local_files_only:he,revision:Ee,model_file_name:De,subfolder:Ne,device:Xe,dtype:mt,use_external_data_format:wt,session_options:dt};if(Pt.config=await s.AutoConfig.from_pretrained(P,Pt),!this.MODEL_CLASS_MAPPINGS)throw new Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);const gt=Pt.config.model_type;for(const Et of this.MODEL_CLASS_MAPPINGS){let ot=Et.get(gt);if(!ot){for(const $t of Et.values())if($t[0]===gt){ot=$t;break}if(!ot)continue}return await ot[1].from_pretrained(P,Pt)}if(this.BASE_IF_FAIL)return a0.has(gt)||console.warn(`Unknown model class "${gt}", attempting to construct from base class.`),await G.from_pretrained(P,Pt);throw Error(`Unsupported model type: ${gt}`)}}Y(Lt,"MODEL_CLASS_MAPPINGS",null),Y(Lt,"BASE_IF_FAIL",!1);const Vx=new Map([["bert",["BertModel",Ce]],["modernbert",["ModernBertModel",ke]],["nomic_bert",["NomicBertModel",Ge]],["roformer",["RoFormerModel",pt]],["electra",["ElectraModel",me]],["esm",["EsmModel",it]],["convbert",["ConvBertModel",Mt]],["camembert",["CamembertModel",ut]],["deberta",["DebertaModel",Or]],["deberta-v2",["DebertaV2Model",ks]],["mpnet",["MPNetModel",fn]],["albert",["AlbertModel",de]],["distilbert",["DistilBertModel",Fs]],["roberta",["RobertaModel",br]],["xlm",["XLMModel",xn]],["xlm-roberta",["XLMRobertaModel",Ci]],["clap",["ClapModel",Vb]],["clip",["CLIPModel",Vi]],["clipseg",["CLIPSegModel",Bo]],["chinese_clip",["ChineseCLIPModel",qn]],["siglip",["SiglipModel",Js]],["jina_clip",["JinaCLIPModel",Do]],["mobilebert",["MobileBertModel",as]],["squeezebert",["SqueezeBertModel",Hs]],["wav2vec2",["Wav2Vec2Model",sb]],["wav2vec2-bert",["Wav2Vec2BertModel",wb]],["unispeech",["UniSpeechModel",db]],["unispeech-sat",["UniSpeechSatModel",mb]],["hubert",["HubertModel",yb]],["wavlm",["WavLMModel",Tb]],["audio-spectrogram-transformer",["ASTModel",Ai]],["vits",["VitsModel",ac]],["pyannote",["PyAnnoteModel",ab]],["wespeaker-resnet",["WeSpeakerResNetModel",cb]],["detr",["DetrModel",Gw]],["rt_detr",["RTDetrModel",qw]],["rt_detr_v2",["RTDetrV2Model",Xw]],["rf_detr",["RFDetrModel",Zw]],["d_fine",["DFineModel",rM]],["table-transformer",["TableTransformerModel",nM]],["vit",["ViTModel",gw]],["ijepa",["IJepaModel",Mw]],["pvt",["PvtModel",xw]],["vit_msn",["ViTMSNModel",Cw]],["vit_mae",["ViTMAEModel",Pw]],["groupvit",["GroupViTModel",kw]],["fastvit",["FastViTModel",Iw]],["mobilevit",["MobileViTModel",Dw]],["mobilevitv2",["MobileViTV2Model",zw]],["owlvit",["OwlViTModel",Rw]],["owlv2",["Owlv2Model",Nw]],["beit",["BeitModel",Uw]],["deit",["DeiTModel",aM]],["hiera",["HieraModel",uM]],["convnext",["ConvNextModel",zM]],["convnextv2",["ConvNextV2Model",RM]],["dinov2",["Dinov2Model",NM]],["dinov2_with_registers",["Dinov2WithRegistersModel",UM]],["resnet",["ResNetModel",dM]],["swin",["SwinModel",hM]],["swin2sr",["Swin2SRModel",_M]],["donut-swin",["DonutSwinModel",LM]],["yolos",["YolosModel",HM]],["dpt",["DPTModel",wM]],["glpn",["GLPNModel",FM]],["hifigan",["SpeechT5HifiGan",Fb]],["efficientnet",["EfficientNetModel",Xb]],["decision_transformer",["DecisionTransformerModel",dy]],["patchtst",["PatchTSTForPrediction",gy]],["patchtsmixer",["PatchTSMixerForPrediction",My]],["mobilenet_v1",["MobileNetV1Model",Yb]],["mobilenet_v2",["MobileNetV2Model",ty]],["mobilenet_v3",["MobileNetV3Model",ny]],["mobilenet_v4",["MobileNetV4Model",ay]],["maskformer",["MaskFormerModel",IM]],["mgp-str",["MgpstrForSceneTextRecognition",_y]],["style_text_to_speech_2",["StyleTextToSpeech2Model",kb]]]),Ux=new Map([["t5",["T5Model",ce]],["longt5",["LongT5Model",Qe]],["mt5",["MT5Model",_t]],["bart",["BartModel",Yt]],["mbart",["MBartModel",Pr]],["marian",["MarianModel",ZM]],["whisper",["WhisperModel",Oi]],["m2m_100",["M2M100Model",tb]],["blenderbot",["BlenderbotModel",fr]],["blenderbot-small",["BlenderbotSmallModel",Jr]]]),Wx=new Map([["mimi",["MimiModel",Ey]],["dac",["DacModel",ky]],["snac",["SnacModel",Fy]]]),Gx=new Map([["bloom",["BloomModel",dw]],["jais",["JAISModel",ct]],["gpt2",["GPT2Model",No]],["gptj",["GPTJModel",Wo]],["gpt_bigcode",["GPTBigCodeModel",Ko]],["gpt_neo",["GPTNeoModel",Uo]],["gpt_neox",["GPTNeoXModel",Cn]],["codegen",["CodeGenModel",$n]],["llama",["LlamaModel",qo]],["exaone",["ExaoneModel",L]],["olmo",["OlmoModel",tt]],["olmo2",["Olmo2Model",Wt]],["mobilellm",["MobileLLMModel",Te]],["granite",["GraniteModel",qi]],["cohere",["CohereModel",Gg]],["gemma",["GemmaModel",Hg]],["gemma2",["Gemma2Model",Qg]],["gemma3_text",["Gemma3Model",Jg]],["helium",["HeliumModel",Xo]],["glm",["GlmModel",h]],["openelm",["OpenELMModel",Zg]],["qwen2",["Qwen2Model",tw]],["qwen3",["Qwen3Model",sw]],["phi",["PhiModel",aw]],["phi3",["Phi3Model",uw]],["mpt",["MptModel",hw]],["opt",["OPTModel",fw]],["mistral",["MistralModel",Lb]],["starcoder2",["Starcoder2Model",Bb]],["falcon",["FalconModel",jb]],["stablelm",["StableLmModel",qb]]]),mc=new Map([["speecht5",["SpeechT5ForSpeechToText",Ib]],["whisper",["WhisperForConditionalGeneration",Co]],["lite-whisper",["LiteWhisperForConditionalGeneration",So]],["moonshine",["MoonshineForConditionalGeneration",Li]]]),Ly=new Map([["speecht5",["SpeechT5ForTextToSpeech",Ab]]]),zy=new Map([["vits",["VitsModel",ac]],["musicgen",["MusicgenForConditionalGeneration",dc]]]),By=new Map([["bert",["BertForSequenceClassification",Fe]],["modernbert",["ModernBertForSequenceClassification",Ze]],["roformer",["RoFormerForSequenceClassification",Vt]],["electra",["ElectraForSequenceClassification",ve]],["esm",["EsmForSequenceClassification",os]],["convbert",["ConvBertForSequenceClassification",D]],["camembert",["CamembertForSequenceClassification",jt]],["deberta",["DebertaForSequenceClassification",ys]],["deberta-v2",["DebertaV2ForSequenceClassification",vs]],["mpnet",["MPNetForSequenceClassification",gn]],["albert",["AlbertForSequenceClassification",$]],["distilbert",["DistilBertForSequenceClassification",Er]],["roberta",["RobertaForSequenceClassification",dr]],["xlm",["XLMForSequenceClassification",Ei]],["xlm-roberta",["XLMRobertaForSequenceClassification",$i]],["bart",["BartForSequenceClassification",mr]],["mbart",["MBartForSequenceClassification",Zt]],["mobilebert",["MobileBertForSequenceClassification",hr]],["squeezebert",["SqueezeBertForSequenceClassification",yn]]]),Ry=new Map([["bert",["BertForTokenClassification",Be]],["modernbert",["ModernBertForTokenClassification",nt]],["roformer",["RoFormerForTokenClassification",Rt]],["electra",["ElectraForTokenClassification",vt]],["esm",["EsmForTokenClassification",is]],["convbert",["ConvBertForTokenClassification",oe]],["camembert",["CamembertForTokenClassification",Ht]],["deberta",["DebertaForTokenClassification",ns]],["deberta-v2",["DebertaV2ForTokenClassification",Is]],["mpnet",["MPNetForTokenClassification",wn]],["distilbert",["DistilBertForTokenClassification",xs]],["roberta",["RobertaForTokenClassification",pr]],["xlm",["XLMForTokenClassification",Pi]],["xlm-roberta",["XLMRobertaForTokenClassification",ki]]]),fc=new Map([["t5",["T5ForConditionalGeneration",xe]],["longt5",["LongT5ForConditionalGeneration",We]],["mt5",["MT5ForConditionalGeneration",Ot]],["bart",["BartForConditionalGeneration",Ut]],["mbart",["MBartForConditionalGeneration",Cr]],["marian",["MarianMTModel",eb]],["m2m_100",["M2M100ForConditionalGeneration",rb]],["blenderbot",["BlenderbotForConditionalGeneration",Dr]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",Ir]]]),_c=new Map([["bloom",["BloomForCausalLM",pw]],["gpt2",["GPT2LMHeadModel",Vo]],["jais",["JAISLMHeadModel",Hi]],["gptj",["GPTJForCausalLM",Go]],["gpt_bigcode",["GPTBigCodeForCausalLM",Ho]],["gpt_neo",["GPTNeoForCausalLM",Pn]],["gpt_neox",["GPTNeoXForCausalLM",Jn]],["codegen",["CodeGenForCausalLM",eo]],["llama",["LlamaForCausalLM",Qo]],["exaone",["ExaoneForCausalLM",N]],["olmo",["OlmoForCausalLM",bt]],["olmo2",["Olmo2ForCausalLM",yr]],["mobilellm",["MobileLLMForCausalLM",Le]],["granite",["GraniteForCausalLM",Wg]],["cohere",["CohereForCausalLM",Kg]],["gemma",["GemmaForCausalLM",qg]],["gemma2",["Gemma2ForCausalLM",Xg]],["gemma3_text",["Gemma3ForCausalLM",Yg]],["helium",["HeliumForCausalLM",Jo]],["glm",["GlmForCausalLM",x]],["openelm",["OpenELMForCausalLM",ew]],["qwen2",["Qwen2ForCausalLM",rw]],["qwen3",["Qwen3ForCausalLM",nw]],["phi",["PhiForCausalLM",lw]],["phi3",["Phi3ForCausalLM",cw]],["mpt",["MptForCausalLM",mw]],["opt",["OPTForCausalLM",_w]],["mbart",["MBartForCausalLM",Es]],["mistral",["MistralForCausalLM",zb]],["starcoder2",["Starcoder2ForCausalLM",Rb]],["falcon",["FalconForCausalLM",Nb]],["trocr",["TrOCRForCausalLM",Db]],["stablelm",["StableLmForCausalLM",Qb]],["phi3_v",["Phi3VForCausalLM",Fo]]]),Kx=new Map([["multi_modality",["MultiModalityCausalLM",hy]]]),jy=new Map([["bert",["BertForMaskedLM",$e]],["modernbert",["ModernBertForMaskedLM",Ve]],["roformer",["RoFormerForMaskedLM",St]],["electra",["ElectraForMaskedLM",Oe]],["esm",["EsmForMaskedLM",Nt]],["convbert",["ConvBertForMaskedLM",rs]],["camembert",["CamembertForMaskedLM",rt]],["deberta",["DebertaForMaskedLM",ss]],["deberta-v2",["DebertaV2ForMaskedLM",Qr]],["mpnet",["MPNetForMaskedLM",_n]],["albert",["AlbertForMaskedLM",X]],["distilbert",["DistilBertForMaskedLM",Ae]],["roberta",["RobertaForMaskedLM",er]],["xlm",["XLMWithLMHeadModel",Ti]],["xlm-roberta",["XLMRobertaForMaskedLM",Si]],["mobilebert",["MobileBertForMaskedLM",cr]],["squeezebert",["SqueezeBertForMaskedLM",bn]]]),Ny=new Map([["bert",["BertForQuestionAnswering",He]],["roformer",["RoFormerForQuestionAnswering",gr]],["electra",["ElectraForQuestionAnswering",Ft]],["convbert",["ConvBertForQuestionAnswering",B]],["camembert",["CamembertForQuestionAnswering",wr]],["deberta",["DebertaForQuestionAnswering",$s]],["deberta-v2",["DebertaV2ForQuestionAnswering",As]],["mpnet",["MPNetForQuestionAnswering",Mn]],["albert",["AlbertForQuestionAnswering",j]],["distilbert",["DistilBertForQuestionAnswering",Br]],["roberta",["RobertaForQuestionAnswering",Ar]],["xlm",["XLMForQuestionAnswering",To]],["xlm-roberta",["XLMRobertaForQuestionAnswering",Ii]],["mobilebert",["MobileBertForQuestionAnswering",ls]],["squeezebert",["SqueezeBertForQuestionAnswering",vn]]]),gc=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",$o]],["idefics3",["Idefics3ForConditionalGeneration",En]],["smolvlm",["SmolVLMForConditionalGeneration",Ao]]]),Vy=new Map([["llava",["LlavaForConditionalGeneration",Tn]],["llava_onevision",["LlavaOnevisionForConditionalGeneration",Qs]],["moondream1",["Moondream1ForConditionalGeneration",zi]],["florence2",["Florence2ForConditionalGeneration",Bi]],["qwen2-vl",["Qwen2VLForConditionalGeneration",iw]],["idefics3",["Idefics3ForConditionalGeneration",En]],["smolvlm",["SmolVLMForConditionalGeneration",Ao]],["paligemma",["PaliGemmaForConditionalGeneration",ji]]]),Uy=new Map([["ultravox",["UltravoxModel",vy]]]),Hx=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",$o]]]),Wy=new Map([["vit",["ViTForImageClassification",ww]],["ijepa",["IJepaForImageClassification",bw]],["pvt",["PvtForImageClassification",Tw]],["vit_msn",["ViTMSNForImageClassification",Sw]],["fastvit",["FastViTForImageClassification",Aw]],["mobilevit",["MobileViTForImageClassification",Lw]],["mobilevitv2",["MobileViTV2ForImageClassification",Bw]],["beit",["BeitForImageClassification",Ww]],["deit",["DeiTForImageClassification",lM]],["hiera",["HieraForImageClassification",cM]],["convnext",["ConvNextForImageClassification",BM]],["convnextv2",["ConvNextV2ForImageClassification",jM]],["dinov2",["Dinov2ForImageClassification",VM]],["dinov2_with_registers",["Dinov2WithRegistersForImageClassification",WM]],["resnet",["ResNetForImageClassification",pM]],["swin",["SwinForImageClassification",mM]],["segformer",["SegformerForImageClassification",Kb]],["efficientnet",["EfficientNetForImageClassification",Jb]],["mobilenet_v1",["MobileNetV1ForImageClassification",Zb]],["mobilenet_v2",["MobileNetV2ForImageClassification",ry]],["mobilenet_v3",["MobileNetV3ForImageClassification",oy]],["mobilenet_v4",["MobileNetV4ForImageClassification",ly]]]),Gy=new Map([["detr",["DetrForObjectDetection",Kw]],["rt_detr",["RTDetrForObjectDetection",Qw]],["rt_detr_v2",["RTDetrV2ForObjectDetection",Jw]],["rf_detr",["RFDetrForObjectDetection",eM]],["d_fine",["DFineForObjectDetection",sM]],["table-transformer",["TableTransformerForObjectDetection",oM]],["yolos",["YolosForObjectDetection",qM]]]),Ky=new Map([["owlvit",["OwlViTForObjectDetection",jw]],["owlv2",["Owlv2ForObjectDetection",Vw]],["grounding-dino",["GroundingDinoForObjectDetection",KM]]]),no=new Map([["detr",["DetrForSegmentation",Lu]],["clipseg",["CLIPSegForImageSegmentation",Ro]]]),Hy=new Map([["segformer",["SegformerForSemanticSegmentation",Hb]],["sapiens",["SapiensForSemanticSegmentation",vM]],["swin",["SwinForSemanticSegmentation",fM]],["mobilenet_v1",["MobileNetV1ForSemanticSegmentation",ey]],["mobilenet_v2",["MobileNetV2ForSemanticSegmentation",sy]],["mobilenet_v3",["MobileNetV3ForSemanticSegmentation",iy]],["mobilenet_v4",["MobileNetV4ForSemanticSegmentation",uy]]]),qy=new Map([["detr",["DetrForSegmentation",Lu]],["maskformer",["MaskFormerForInstanceSegmentation",AM]]]),Qy=new Map([["sam",["SamModel",JM]]]),Xy=new Map([["wav2vec2",["Wav2Vec2ForCTC",nb]],["wav2vec2-bert",["Wav2Vec2BertForCTC",Mb]],["unispeech",["UniSpeechForCTC",pb]],["unispeech-sat",["UniSpeechSatForCTC",fb]],["wavlm",["WavLMForCTC",Eb]],["hubert",["HubertForCTC",vb]]]),Jy=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",ob]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",bb]],["unispeech",["UniSpeechForSequenceClassification",hb]],["unispeech-sat",["UniSpeechSatForSequenceClassification",_b]],["wavlm",["WavLMForSequenceClassification",Pb]],["hubert",["HubertForSequenceClassification",xb]],["audio-spectrogram-transformer",["ASTForAudioClassification",Fi]]]),Yy=new Map([["wavlm",["WavLMForXVector",Cb]]]),Zy=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",gb]],["wavlm",["WavLMForAudioFrameClassification",Sb]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",ib]],["pyannote",["PyAnnoteForAudioFrameClassification",lb]]]),e0=new Map([["vitmatte",["VitMatteForImageMatting",Ow]]]),qx=new Map([["patchtst",["PatchTSTForPrediction",wy]],["patchtsmixer",["PatchTSMixerForPrediction",by]]]),t0=new Map([["swin2sr",["Swin2SRForImageSuperResolution",gM]]]),r0=new Map([["dpt",["DPTForDepthEstimation",MM]],["depth_anything",["DepthAnythingForDepthEstimation",yM]],["glpn",["GLPNForDepthEstimation",OM]],["sapiens",["SapiensForDepthEstimation",xM]],["depth_pro",["DepthProForDepthEstimation",PM]],["metric3d",["Metric3DForDepthEstimation",SM]],["metric3dv2",["Metric3Dv2ForDepthEstimation",kM]]]),s0=new Map([["sapiens",["SapiensForNormalEstimation",TM]]]),n0=new Map([["vitpose",["VitPoseForPoseEstimation",vw]]]),o0=new Map([["clip",["CLIPVisionModelWithProjection",Wi]],["siglip",["SiglipVisionModel",Gi]],["jina_clip",["JinaCLIPVisionModel",zo]]]),i0=[[Vx,E.EncoderOnly],[Ux,E.EncoderDecoder],[Gx,E.DecoderOnly],[Wx,E.AutoEncoder],[By,E.EncoderOnly],[Ry,E.EncoderOnly],[fc,E.Seq2Seq],[mc,E.Seq2Seq],[_c,E.DecoderOnly],[Kx,E.MultiModality],[jy,E.EncoderOnly],[Ny,E.EncoderOnly],[gc,E.Vision2Seq],[Vy,E.ImageTextToText],[Uy,E.AudioTextToText],[Wy,E.EncoderOnly],[no,E.EncoderOnly],[qy,E.EncoderOnly],[Hy,E.EncoderOnly],[e0,E.EncoderOnly],[qx,E.EncoderOnly],[t0,E.EncoderOnly],[r0,E.EncoderOnly],[s0,E.EncoderOnly],[n0,E.EncoderOnly],[Gy,E.EncoderOnly],[Ky,E.EncoderOnly],[Qy,E.MaskGeneration],[Xy,E.EncoderOnly],[Jy,E.EncoderOnly],[Ly,E.Seq2Seq],[zy,E.EncoderOnly],[Yy,E.EncoderOnly],[Zy,E.EncoderOnly],[o0,E.EncoderOnly]];for(const[b,P]of i0)for(const[O,ne]of b.values())v.set(O,P),y.set(ne,O),M.set(O,ne);const Qx=[["MusicgenForConditionalGeneration",dc,E.Musicgen],["Phi3VForCausalLM",Fo,E.Phi3V],["CLIPTextModelWithProjection",Ui,E.EncoderOnly],["SiglipTextModel",Oo,E.EncoderOnly],["JinaCLIPTextModel",Lo,E.EncoderOnly],["ClapTextModelWithProjection",Ub,E.EncoderOnly],["ClapAudioModelWithProjection",Wb,E.EncoderOnly],["DacEncoderModel",Iy,E.EncoderOnly],["DacDecoderModel",Ay,E.EncoderOnly],["MimiEncoderModel",Py,E.EncoderOnly],["MimiDecoderModel",Cy,E.EncoderOnly],["SnacEncoderModel",Oy,E.EncoderOnly],["SnacDecoderModel",Dy,E.EncoderOnly]];for(const[b,P,O]of Qx)v.set(b,O),y.set(P,b),M.set(b,P);const a0=new Map([["modnet",no],["birefnet",no],["isnet",no],["ben",no]]);for(const[b,P]of a0.entries())P.set(b,["PreTrainedModel",G]),v.set(b,E.EncoderOnly),y.set(G,b),M.set(b,G);class wc extends Lt{}Y(wc,"MODEL_CLASS_MAPPINGS",i0.map(P=>P[0])),Y(wc,"BASE_IF_FAIL",!0);class l0 extends Lt{}Y(l0,"MODEL_CLASS_MAPPINGS",[By]);class u0 extends Lt{}Y(u0,"MODEL_CLASS_MAPPINGS",[Ry]);class c0 extends Lt{}Y(c0,"MODEL_CLASS_MAPPINGS",[fc]);class d0 extends Lt{}Y(d0,"MODEL_CLASS_MAPPINGS",[mc]);class p0 extends Lt{}Y(p0,"MODEL_CLASS_MAPPINGS",[Ly]);class h0 extends Lt{}Y(h0,"MODEL_CLASS_MAPPINGS",[zy]);class m0 extends Lt{}Y(m0,"MODEL_CLASS_MAPPINGS",[_c]);class f0 extends Lt{}Y(f0,"MODEL_CLASS_MAPPINGS",[jy]);class _0 extends Lt{}Y(_0,"MODEL_CLASS_MAPPINGS",[Ny]);class g0 extends Lt{}Y(g0,"MODEL_CLASS_MAPPINGS",[gc]);class w0 extends Lt{}Y(w0,"MODEL_CLASS_MAPPINGS",[Wy]);class M0 extends Lt{}Y(M0,"MODEL_CLASS_MAPPINGS",[no]);class b0 extends Lt{}Y(b0,"MODEL_CLASS_MAPPINGS",[Hy]);class y0 extends Lt{}Y(y0,"MODEL_CLASS_MAPPINGS",[qy]);class v0 extends Lt{}Y(v0,"MODEL_CLASS_MAPPINGS",[Gy]);class x0 extends Lt{}Y(x0,"MODEL_CLASS_MAPPINGS",[Ky]);class T0 extends Lt{}Y(T0,"MODEL_CLASS_MAPPINGS",[Qy]);class E0 extends Lt{}Y(E0,"MODEL_CLASS_MAPPINGS",[Xy]);class P0 extends Lt{}Y(P0,"MODEL_CLASS_MAPPINGS",[Jy]);class C0 extends Lt{}Y(C0,"MODEL_CLASS_MAPPINGS",[Yy]);class S0 extends Lt{}Y(S0,"MODEL_CLASS_MAPPINGS",[Zy]);class $0 extends Lt{}Y($0,"MODEL_CLASS_MAPPINGS",[Hx]);class k0 extends Lt{}Y(k0,"MODEL_CLASS_MAPPINGS",[e0]);class I0 extends Lt{}Y(I0,"MODEL_CLASS_MAPPINGS",[t0]);class A0 extends Lt{}Y(A0,"MODEL_CLASS_MAPPINGS",[r0]);class F0 extends Lt{}Y(F0,"MODEL_CLASS_MAPPINGS",[s0]);class O0 extends Lt{}Y(O0,"MODEL_CLASS_MAPPINGS",[n0]);class D0 extends Lt{}Y(D0,"MODEL_CLASS_MAPPINGS",[o0]);class L0 extends Lt{}Y(L0,"MODEL_CLASS_MAPPINGS",[Vy]);class z0 extends Lt{}Y(z0,"MODEL_CLASS_MAPPINGS",[Uy]);class Xx extends be{constructor({logits:P,past_key_values:O,encoder_outputs:ne,decoder_attentions:ge=null,cross_attentions:he=null}){super(),this.logits=P,this.past_key_values=O,this.encoder_outputs=ne,this.decoder_attentions=ge,this.cross_attentions=he}}class xt extends be{constructor({logits:P,...O}){super(),this.logits=P;const ne=Object.values(O);ne.length>0&&(this.attentions=ne)}}class B0 extends be{constructor({logits:P,embeddings:O}){super(),this.logits=P,this.embeddings=O}}class Sr extends be{constructor({logits:P}){super(),this.logits=P}}class Fr extends be{constructor({logits:P}){super(),this.logits=P}}class Rr extends be{constructor({start_logits:P,end_logits:O}){super(),this.start_logits=P,this.end_logits=O}}class In extends be{constructor({logits:P}){super(),this.logits=P}}class Jx extends be{constructor({logits:P,past_key_values:O}){super(),this.logits=P,this.past_key_values=O}}class R0 extends be{constructor({alphas:P}){super(),this.alphas=P}}class j0 extends be{constructor({waveform:P,spectrogram:O}){super(),this.waveform=P,this.spectrogram=O}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,r,t)=>{t.r(r),t.d(r,{ASTFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var o=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a);const l=this.config.sampling_rate,u=(0,o.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(l/2),l,null,"kaldi",!0);this.mel_filters=u,this.window=(0,o.window_function)(400,"hann",{periodic:!1}),this.mean=this.config.mean,this.std=this.config.std}async _extract_fbank_features(a,l){return(0,o.spectrogram)(a,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:l,transpose:!0})}async _call(a){(0,s.validate_audio_inputs)(a,"ASTFeatureExtractor");const l=await this._extract_fbank_features(a,this.config.max_length);if(this.config.do_normalize){const u=this.std*2,p=l.data;for(let c=0;c{t.r(r),t.d(r,{AutoFeatureExtractor:()=>i});var s=t("./src/utils/constants.js"),o=t("./src/utils/hub.js");t("./src/base/feature_extraction_utils.js");var n=t("./src/models/feature_extractors.js");class i{static async from_pretrained(l,u={}){const p=await(0,o.getModelJSON)(l,s.FEATURE_EXTRACTOR_NAME,!0,u),c=p.feature_extractor_type,d=n[c];if(!d)throw new Error(`Unknown feature_extractor_type: '${c}'. Please report this at ${s.GITHUB_ISSUE_URL}.`);return new d(p)}}},"./src/models/auto/image_processing_auto.js":(e,r,t)=>{t.r(r),t.d(r,{AutoImageProcessor:()=>a});var s=t("./src/utils/constants.js"),o=t("./src/utils/hub.js"),n=t("./src/base/image_processors_utils.js"),i=t("./src/models/image_processors.js");class a{static async from_pretrained(u,p={}){const c=await(0,o.getModelJSON)(u,s.IMAGE_PROCESSOR_NAME,!0,p),d=c.image_processor_type??c.feature_extractor_type;let _=i[d];return _||(d!==void 0&&console.warn(`Image processor type '${d}' not found, assuming base ImageProcessor. Please report this at ${s.GITHUB_ISSUE_URL}.`),_=n.ImageProcessor),new _(c)}}},"./src/models/auto/processing_auto.js":(e,r,t)=>{t.r(r),t.d(r,{AutoProcessor:()=>u});var s=t("./src/utils/constants.js"),o=t("./src/utils/hub.js"),n=t("./src/base/processing_utils.js"),i=t("./src/models/processors.js"),a=t("./src/models/image_processors.js"),l=t("./src/models/feature_extractors.js");class u{static async from_pretrained(c,d={}){const _=await(0,o.getModelJSON)(c,s.IMAGE_PROCESSOR_NAME,!0,d),{image_processor_type:f,feature_extractor_type:T,processor_class:k}=_;if(k&&i[k])return i[k].from_pretrained(c,d);if(!f&&!T)throw new Error("No `image_processor_type` or `feature_extractor_type` found in the config.");const g={};if(f){const S=a[f];if(!S)throw new Error(`Unknown image_processor_type: '${f}'.`);g.image_processor=new S(_)}if(T){const S=a[T];if(S)g.image_processor=new S(_);else{const E=l[T];if(!E)throw new Error(`Unknown feature_extractor_type: '${T}'.`);g.feature_extractor=new E(_)}}const w={};return new n.Processor(w,g)}}},"./src/models/beit/image_processing_beit.js":(e,r,t)=>{t.r(r),t.d(r,{BeitFeatureExtractor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/bit/image_processing_bit.js":(e,r,t)=>{t.r(r),t.d(r,{BitImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/chinese_clip/image_processing_chinese_clip.js":(e,r,t)=>{t.r(r),t.d(r,{ChineseCLIPFeatureExtractor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/clap/feature_extraction_clap.js":(e,r,t)=>{t.r(r),t.d(r,{ClapFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var o=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a),this.mel_filters=(0,o.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,null,"htk"),this.mel_filters_slaney=(0,o.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,"slaney","slaney"),this.window=(0,o.window_function)(this.config.fft_window_size,"hann")}async _get_input_mel(a,l,u,p){let c;const d=a.length-l;if(d>0)if(u==="rand_trunc"){const _=Math.floor(Math.random()*(d+1));a=a.subarray(_,_+l),c=await this._extract_fbank_features(a,this.mel_filters_slaney,this.config.nb_max_samples)}else throw new Error(`Truncation strategy "${u}" not implemented`);else{if(d<0){let _=new Float64Array(l);if(_.set(a),p==="repeat")for(let f=a.length;f{t.r(r),t.d(r,{CLIPFeatureExtractor:()=>n,CLIPImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/convnext/image_processing_convnext.js":(e,r,t)=>{t.r(r),t.d(r,{ConvNextFeatureExtractor:()=>n,ConvNextImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{constructor(a){super(a),this.crop_pct=this.config.crop_pct??224/256}async resize(a){var u;const l=(u=this.size)==null?void 0:u.shortest_edge;if(l===void 0)throw new Error("Size dictionary must contain 'shortest_edge' key.");if(l<384){const p=Math.floor(l/this.crop_pct),[c,d]=this.get_resize_output_image_size(a,{shortest_edge:p});a=await a.resize(c,d,{resample:this.resample}),a=await a.center_crop(l,l)}else a=await a.resize(l,l,{resample:this.resample});return a}}class n extends o{}},"./src/models/dac/feature_extraction_dac.js":(e,r,t)=>{t.r(r),t.d(r,{DacFeatureExtractor:()=>o});var s=t("./src/models/encodec/feature_extraction_encodec.js");class o extends s.EncodecFeatureExtractor{}},"./src/models/deit/image_processing_deit.js":(e,r,t)=>{t.r(r),t.d(r,{DeiTFeatureExtractor:()=>n,DeiTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/detr/image_processing_detr.js":(e,r,t)=>{t.r(r),t.d(r,{DetrFeatureExtractor:()=>i,DetrImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(l){const u=await super._call(l),p=[u.pixel_values.dims[0],64,64],c=(0,o.full)(p,1n);return{...u,pixel_mask:c}}post_process_object_detection(...l){return(0,s.post_process_object_detection)(...l)}post_process_panoptic_segmentation(...l){return(0,s.post_process_panoptic_segmentation)(...l)}post_process_instance_segmentation(...l){return(0,s.post_process_instance_segmentation)(...l)}}class i extends n{}},"./src/models/donut/image_processing_donut.js":(e,r,t)=>{t.r(r),t.d(r,{DonutFeatureExtractor:()=>n,DonutImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{pad_image(a,l,u,p={}){const[c,d,_]=l;let f=this.image_mean;Array.isArray(this.image_mean)||(f=new Array(_).fill(f));let T=this.image_std;Array.isArray(T)||(T=new Array(_).fill(f));const k=f.map((g,w)=>-g/T[w]);return super.pad_image(a,l,u,{center:!0,constant_values:k,...p})}}class n extends o{}},"./src/models/dpt/image_processing_dpt.js":(e,r,t)=>{t.r(r),t.d(r,{DPTFeatureExtractor:()=>n,DPTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/efficientnet/image_processing_efficientnet.js":(e,r,t)=>{t.r(r),t.d(r,{EfficientNetImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{constructor(i){super(i),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(a=>a*a))}}},"./src/models/encodec/feature_extraction_encodec.js":(e,r,t)=>{t.r(r),t.d(r,{EncodecFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{async _call(a){(0,s.validate_audio_inputs)(a,"EncodecFeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));const l=this.config.feature_size;if(a.length%l!==0)throw new Error(`The length of the audio data must be a multiple of the number of channels (${l}).`);const u=[1,l,a.length/l];return{input_values:new o.Tensor("float32",a,u)}}}},"./src/models/feature_extractors.js":(e,r,t)=>{t.r(r),t.d(r,{ASTFeatureExtractor:()=>s.ASTFeatureExtractor,ClapFeatureExtractor:()=>n.ClapFeatureExtractor,DacFeatureExtractor:()=>i.DacFeatureExtractor,EncodecFeatureExtractor:()=>o.EncodecFeatureExtractor,ImageFeatureExtractor:()=>T.ImageProcessor,MoonshineFeatureExtractor:()=>a.MoonshineFeatureExtractor,PyAnnoteFeatureExtractor:()=>l.PyAnnoteFeatureExtractor,SeamlessM4TFeatureExtractor:()=>u.SeamlessM4TFeatureExtractor,SnacFeatureExtractor:()=>p.SnacFeatureExtractor,SpeechT5FeatureExtractor:()=>c.SpeechT5FeatureExtractor,Wav2Vec2FeatureExtractor:()=>d.Wav2Vec2FeatureExtractor,WeSpeakerFeatureExtractor:()=>_.WeSpeakerFeatureExtractor,WhisperFeatureExtractor:()=>f.WhisperFeatureExtractor});var s=t("./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js"),o=t("./src/models/encodec/feature_extraction_encodec.js"),n=t("./src/models/clap/feature_extraction_clap.js"),i=t("./src/models/dac/feature_extraction_dac.js"),a=t("./src/models/moonshine/feature_extraction_moonshine.js"),l=t("./src/models/pyannote/feature_extraction_pyannote.js"),u=t("./src/models/seamless_m4t/feature_extraction_seamless_m4t.js"),p=t("./src/models/snac/feature_extraction_snac.js"),c=t("./src/models/speecht5/feature_extraction_speecht5.js"),d=t("./src/models/wav2vec2/feature_extraction_wav2vec2.js"),_=t("./src/models/wespeaker/feature_extraction_wespeaker.js"),f=t("./src/models/whisper/feature_extraction_whisper.js"),T=t("./src/base/image_processors_utils.js")},"./src/models/florence2/processing_florence2.js":(e,r,t)=>{t.r(r),t.d(r,{Florence2Processor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class i extends s.Processor{constructor(l,u){super(l,u);const{tasks_answer_post_processing_type:p,task_prompts_without_inputs:c,task_prompts_with_input:d}=this.image_processor.config;this.tasks_answer_post_processing_type=new Map(Object.entries(p??{})),this.task_prompts_without_inputs=new Map(Object.entries(c??{})),this.task_prompts_with_input=new Map(Object.entries(d??{})),this.regexes={quad_boxes:/(.+?)/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(l){typeof l=="string"&&(l=[l]);const u=[];for(const p of l)if(this.task_prompts_without_inputs.has(p))u.push(this.task_prompts_without_inputs.get(p));else{for(const[c,d]of this.task_prompts_with_input)if(p.includes(c)){u.push(d.replaceAll("{input}",p).replaceAll(c,""));break}u.length!==l.length&&u.push(p)}return u}post_process_generation(l,u,p){const c=this.tasks_answer_post_processing_type.get(u)??"pure_text";l=l.replaceAll("","").replaceAll("","");let d;switch(c){case"pure_text":d=l;break;case"description_with_bboxes":case"bboxes":case"phrase_grounding":case"ocr":const _=c==="ocr"?"quad_boxes":"bboxes",f=l.matchAll(this.regexes[_]),T=[],k=[];for(const[g,w,...S]of f)T.push(w?w.trim():T.at(-1)??""),k.push(S.map((E,v)=>(Number(E)+.5)/this.size_per_bin*p[v%2]));d={labels:T,[_]:k};break;default:throw new Error(`Task "${u}" (of type "${c}") not yet implemented.`)}return{[u]:d}}async _call(l,u=null,p={}){if(!l&&!u)throw new Error("Either text or images must be provided");const c=await this.image_processor(l,p),d=u?this.tokenizer(u,p):{};return{...c,...d}}}Y(i,"tokenizer_class",n.AutoTokenizer),Y(i,"image_processor_class",o.AutoImageProcessor)},"./src/models/glpn/image_processing_glpn.js":(e,r,t)=>{t.r(r),t.d(r,{GLPNFeatureExtractor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/grounding_dino/image_processing_grounding_dino.js":(e,r,t)=>{t.r(r),t.d(r,{GroundingDinoImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a){const l=await super._call(a),u=l.pixel_values.dims,p=(0,o.ones)([u[0],u[2],u[3]]);return{...l,pixel_mask:p}}}},"./src/models/grounding_dino/processing_grounding_dino.js":(e,r,t)=>{t.r(r),t.d(r,{GroundingDinoProcessor:()=>l});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),i=t("./src/base/image_processors_utils.js");function a(u,p){const d=u.dims.at(-1)-1,_=u.tolist();_.fill(!1,0,1),_.fill(!1,d);const f=p.tolist();return _.map((T,k)=>T?k:null).filter(T=>T!==null).map(T=>f[T])}class l extends s.Processor{async _call(p,c,d={}){const _=p?await this.image_processor(p,d):{};return{...c?this.tokenizer(c,d):{},..._}}post_process_grounded_object_detection(p,c,{box_threshold:d=.25,text_threshold:_=.25,target_sizes:f=null}={}){const{logits:T,pred_boxes:k}=p,g=T.dims[0];if(f!==null&&f.length!==g)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const w=T.dims.at(1),S=T.sigmoid(),E=S.max(-1).tolist(),v=k.tolist().map(y=>y.map(C=>(0,i.center_to_corners_format)(C))),M=[];for(let y=0;yR.map((Z,H)=>Z*C[(H+1)%2])));const F=E[y],z=[],K=[],q=[];for(let R=0;R{t.r(r),t.d(r,{Idefics3ImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{constructor(a){super(a),this.do_image_splitting=a.do_image_splitting??!0,this.max_image_size=a.max_image_size}get_resize_for_vision_encoder(a,l){let[u,p]=a.dims.slice(-2);const c=p/u;return p>=u?(p=Math.ceil(p/l)*l,u=Math.floor(p/c),u=Math.ceil(u/l)*l):(u=Math.ceil(u/l)*l,p=Math.floor(u*c),p=Math.ceil(p/l)*l),{height:u,width:p}}async _call(a,{do_image_splitting:l=null,return_row_col_info:u=!1}={}){let p;if(!Array.isArray(a))p=[[a]];else{if(a.length===0||!a[0])throw new Error("No images provided.");Array.isArray(a[0])?p=a:p=[a]}let c=[],d=[],_=[];const f=[],T=[];for(const y of p){let C=await Promise.all(y.map(K=>this.preprocess(K)));f.push(...C.map(K=>K.original_size)),T.push(...C.map(K=>K.reshaped_input_size)),C.forEach(K=>K.pixel_values.unsqueeze_(0));const{longest_edge:F}=this.max_image_size;let z;if(l??this.do_image_splitting){let K=new Array(C.length),q=new Array(C.length);z=await Promise.all(C.map(async(R,Z)=>{const H=this.get_resize_for_vision_encoder(R.pixel_values,F),J=await(0,o.interpolate_4d)(R.pixel_values,{size:[H.height,H.width]}),{frames:Q,num_splits_h:se,num_splits_w:fe}=await this.split_image(J,this.max_image_size);return K[Z]=se,q[Z]=fe,(0,o.cat)(Q,0)})),d.push(K),_.push(q)}else{const K=[F,F];z=await Promise.all(C.map(q=>(0,o.interpolate_4d)(q.pixel_values,{size:K}))),d.push(new Array(C.length).fill(0)),_.push(new Array(C.length).fill(0))}c.push((0,o.cat)(z,0))}const k=c.length,[g,w,S,E]=c[0].dims;let v,M;if(k===1)v=c[0].unsqueeze_(0),M=(0,o.full)([k,g,S,E],!0);else{const y=Math.max(...c.map(z=>z.dims.at(0)));M=(0,o.full)([k,y,S,E],!0);const C=M.data,F=y*S*E;for(let z=0;zu||_>p){f=Math.ceil(d/u),T=Math.ceil(_/p);const k=Math.ceil(d/f),g=Math.ceil(_/T);for(let E=0;E{t.r(r),t.d(r,{Idefics3Processor:()=>p});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");var i=t("./src/utils/core.js");function a(c,d,_,f,T,k){let g="";for(let w=0;w`+T.repeat(c);g+=` -`}return g+=` -${f}${k}`+T.repeat(c)+`${f}`,g}function l(c,d,_,f){return`${d}${f}`+_.repeat(c)+`${d}`}function u(c,d,_,f,T,k){return c===0&&d===0?l(_,f,T,k):a(_,c,d,f,T,k)}class p extends s.Processor{constructor(){super(...arguments);Y(this,"fake_image_token","");Y(this,"image_token","");Y(this,"global_img_token","")}async _call(_,f=null,T={}){T.return_row_col_info??(T.return_row_col_info=!0);let k;f&&(k=await this.image_processor(f,T)),Array.isArray(_)||(_=[_]);const g=k.rows??[new Array(_.length).fill(0)],w=k.cols??[new Array(_.length).fill(0)],S=this.config.image_seq_len,E=[],v=[];for(let y=0;y<_.length;++y){const C=_[y],F=g[y],z=w[y];E.push((0,i.count)(C,this.image_token));const K=F.map((Z,H)=>u(Z,z[H],S,this.fake_image_token,this.image_token,this.global_img_token)),q=C.split(this.image_token);if(q.length===0)throw new Error("The image token should be present in the text.");let R=q[0];for(let Z=0;Z{t.r(r),t.d(r,{BeitFeatureExtractor:()=>s.BeitFeatureExtractor,BitImageProcessor:()=>o.BitImageProcessor,CLIPFeatureExtractor:()=>i.CLIPFeatureExtractor,CLIPImageProcessor:()=>i.CLIPImageProcessor,ChineseCLIPFeatureExtractor:()=>n.ChineseCLIPFeatureExtractor,ConvNextFeatureExtractor:()=>a.ConvNextFeatureExtractor,ConvNextImageProcessor:()=>a.ConvNextImageProcessor,DPTFeatureExtractor:()=>c.DPTFeatureExtractor,DPTImageProcessor:()=>c.DPTImageProcessor,DeiTFeatureExtractor:()=>l.DeiTFeatureExtractor,DeiTImageProcessor:()=>l.DeiTImageProcessor,DetrFeatureExtractor:()=>u.DetrFeatureExtractor,DetrImageProcessor:()=>u.DetrImageProcessor,DonutFeatureExtractor:()=>p.DonutFeatureExtractor,DonutImageProcessor:()=>p.DonutImageProcessor,EfficientNetImageProcessor:()=>d.EfficientNetImageProcessor,GLPNFeatureExtractor:()=>_.GLPNFeatureExtractor,GroundingDinoImageProcessor:()=>f.GroundingDinoImageProcessor,Idefics3ImageProcessor:()=>T.Idefics3ImageProcessor,JinaCLIPImageProcessor:()=>g.JinaCLIPImageProcessor,LlavaOnevisionImageProcessor:()=>w.LlavaOnevisionImageProcessor,Mask2FormerImageProcessor:()=>S.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>E.MaskFormerFeatureExtractor,MaskFormerImageProcessor:()=>E.MaskFormerImageProcessor,MobileNetV1FeatureExtractor:()=>v.MobileNetV1FeatureExtractor,MobileNetV1ImageProcessor:()=>v.MobileNetV1ImageProcessor,MobileNetV2FeatureExtractor:()=>M.MobileNetV2FeatureExtractor,MobileNetV2ImageProcessor:()=>M.MobileNetV2ImageProcessor,MobileNetV3FeatureExtractor:()=>y.MobileNetV3FeatureExtractor,MobileNetV3ImageProcessor:()=>y.MobileNetV3ImageProcessor,MobileNetV4FeatureExtractor:()=>C.MobileNetV4FeatureExtractor,MobileNetV4ImageProcessor:()=>C.MobileNetV4ImageProcessor,MobileViTFeatureExtractor:()=>F.MobileViTFeatureExtractor,MobileViTImageProcessor:()=>F.MobileViTImageProcessor,NougatImageProcessor:()=>z.NougatImageProcessor,OwlViTFeatureExtractor:()=>q.OwlViTFeatureExtractor,OwlViTImageProcessor:()=>q.OwlViTImageProcessor,Owlv2ImageProcessor:()=>K.Owlv2ImageProcessor,Phi3VImageProcessor:()=>R.Phi3VImageProcessor,PvtImageProcessor:()=>Z.PvtImageProcessor,Qwen2VLImageProcessor:()=>H.Qwen2VLImageProcessor,RTDetrImageProcessor:()=>J.RTDetrImageProcessor,SamImageProcessor:()=>Q.SamImageProcessor,SegformerFeatureExtractor:()=>se.SegformerFeatureExtractor,SegformerImageProcessor:()=>se.SegformerImageProcessor,SiglipImageProcessor:()=>fe.SiglipImageProcessor,SmolVLMImageProcessor:()=>ae.SmolVLMImageProcessor,Swin2SRImageProcessor:()=>V.Swin2SRImageProcessor,VLMImageProcessor:()=>k.VLMImageProcessor,ViTFeatureExtractor:()=>A.ViTFeatureExtractor,ViTImageProcessor:()=>A.ViTImageProcessor,VitMatteImageProcessor:()=>U.VitMatteImageProcessor,VitPoseImageProcessor:()=>ee.VitPoseImageProcessor,YolosFeatureExtractor:()=>_e.YolosFeatureExtractor,YolosImageProcessor:()=>_e.YolosImageProcessor});var s=t("./src/models/beit/image_processing_beit.js"),o=t("./src/models/bit/image_processing_bit.js"),n=t("./src/models/chinese_clip/image_processing_chinese_clip.js"),i=t("./src/models/clip/image_processing_clip.js"),a=t("./src/models/convnext/image_processing_convnext.js"),l=t("./src/models/deit/image_processing_deit.js"),u=t("./src/models/detr/image_processing_detr.js"),p=t("./src/models/donut/image_processing_donut.js"),c=t("./src/models/dpt/image_processing_dpt.js"),d=t("./src/models/efficientnet/image_processing_efficientnet.js"),_=t("./src/models/glpn/image_processing_glpn.js"),f=t("./src/models/grounding_dino/image_processing_grounding_dino.js"),T=t("./src/models/idefics3/image_processing_idefics3.js"),k=t("./src/models/janus/image_processing_janus.js"),g=t("./src/models/jina_clip/image_processing_jina_clip.js"),w=t("./src/models/llava_onevision/image_processing_llava_onevision.js"),S=t("./src/models/mask2former/image_processing_mask2former.js"),E=t("./src/models/maskformer/image_processing_maskformer.js"),v=t("./src/models/mobilenet_v1/image_processing_mobilenet_v1.js"),M=t("./src/models/mobilenet_v2/image_processing_mobilenet_v2.js"),y=t("./src/models/mobilenet_v3/image_processing_mobilenet_v3.js"),C=t("./src/models/mobilenet_v4/image_processing_mobilenet_v4.js"),F=t("./src/models/mobilevit/image_processing_mobilevit.js"),z=t("./src/models/nougat/image_processing_nougat.js"),K=t("./src/models/owlv2/image_processing_owlv2.js"),q=t("./src/models/owlvit/image_processing_owlvit.js"),R=t("./src/models/phi3_v/image_processing_phi3_v.js"),Z=t("./src/models/pvt/image_processing_pvt.js"),H=t("./src/models/qwen2_vl/image_processing_qwen2_vl.js"),J=t("./src/models/rt_detr/image_processing_rt_detr.js"),Q=t("./src/models/sam/image_processing_sam.js"),se=t("./src/models/segformer/image_processing_segformer.js"),fe=t("./src/models/siglip/image_processing_siglip.js"),ae=t("./src/models/smolvlm/image_processing_smolvlm.js"),V=t("./src/models/swin2sr/image_processing_swin2sr.js"),A=t("./src/models/vit/image_processing_vit.js"),U=t("./src/models/vitmatte/image_processing_vitmatte.js"),ee=t("./src/models/vitpose/image_processing_vitpose.js"),_e=t("./src/models/yolos/image_processing_yolos.js")},"./src/models/janus/image_processing_janus.js":(e,r,t)=>{t.r(r),t.d(r,{VLMImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{constructor(i){super({do_pad:!0,pad_size:{width:i.image_size,height:i.image_size},...i}),this.constant_values=this.config.background_color.map(a=>a*this.rescale_factor)}pad_image(i,a,l,u){return super.pad_image(i,a,l,{constant_values:this.constant_values,center:!0,...u})}}},"./src/models/janus/processing_janus.js":(e,r,t)=>{t.r(r),t.d(r,{VLChatProcessor:()=>u});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),i=t("./src/utils/core.js"),a=t("./src/utils/tensor.js"),l=t("./src/utils/image.js");class u extends s.Processor{constructor(c,d){super(c,d),this.image_tag=this.config.image_tag,this.image_start_tag=this.config.image_start_tag,this.image_end_tag=this.config.image_end_tag,this.num_image_tokens=this.config.num_image_tokens}async _call(c,{images:d=null,chat_template:_="default"}={}){d?Array.isArray(d)||(d=[d]):d=await Promise.all(c.filter(z=>z.images).flatMap(z=>z.images).map(z=>l.RawImage.read(z)));const f=this.tokenizer,T=f.apply_chat_template(c,{tokenize:!1,add_generation_prompt:!0,chat_template:_}),k=z=>f.encode(z,{add_special_tokens:!1}),g=T.split(this.image_tag),w=g.length-1;if(d.length!==w)throw new Error(`Number of images provided (${d.length}) does not match number of "${this.image_tag}" image tags (${w})`);const[S,E,v]=f.model.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]);let M=k(g[0]),y=new Array(M.length).fill(!1);for(let z=1;z0){const z=await this.image_processor(d);return z.pixel_values.unsqueeze_(0),{...F,...z}}return F}}Y(u,"image_processor_class",o.AutoImageProcessor),Y(u,"tokenizer_class",n.AutoTokenizer),Y(u,"uses_processor_config",!0)},"./src/models/jina_clip/image_processing_jina_clip.js":(e,r,t)=>{t.r(r),t.d(r,{JinaCLIPImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{constructor(i){const{resize_mode:a,fill_color:l,interpolation:u,size:p,...c}=i,d=a==="squash"?{width:p,height:p}:a==="shortest"?{shortest_edge:p}:{longest_edge:p},_=u==="bicubic"?3:2;super({...c,size:d,resample:_,do_center_crop:!0,crop_size:p,do_normalize:!0})}}},"./src/models/jina_clip/processing_jina_clip.js":(e,r,t)=>{t.r(r),t.d(r,{JinaCLIPProcessor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class i extends s.Processor{async _call(l=null,u=null,p={}){if(!l&&!u)throw new Error("Either text or images must be provided");const c=l?this.tokenizer(l,p):{},d=u?await this.image_processor(u,p):{};return{...c,...d}}}Y(i,"tokenizer_class",n.AutoTokenizer),Y(i,"image_processor_class",o.AutoImageProcessor)},"./src/models/llava_onevision/image_processing_llava_onevision.js":(e,r,t)=>{t.r(r),t.d(r,{LlavaOnevisionImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/mask2former/image_processing_mask2former.js":(e,r,t)=>{t.r(r),t.d(r,{Mask2FormerImageProcessor:()=>o});var s=t("./src/models/maskformer/image_processing_maskformer.js");class o extends s.MaskFormerImageProcessor{}},"./src/models/maskformer/image_processing_maskformer.js":(e,r,t)=>{t.r(r),t.d(r,{MaskFormerFeatureExtractor:()=>n,MaskFormerImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_panoptic_segmentation(...a){return(0,s.post_process_panoptic_segmentation)(...a)}post_process_instance_segmentation(...a){return(0,s.post_process_instance_segmentation)(...a)}}class n extends o{}},"./src/models/mgp_str/processing_mgp_str.js":(e,r,t)=>{t.r(r),t.d(r,{MgpstrProcessor:()=>l});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),i=t("./src/utils/maths.js");const a={char:["char_decode",1],bpe:["bpe_decode",2],wp:["wp_decode",102]};class l extends s.Processor{get char_tokenizer(){return this.components.char_tokenizer}get bpe_tokenizer(){return this.components.bpe_tokenizer}get wp_tokenizer(){return this.components.wp_tokenizer}_decode_helper(p,c){if(!a.hasOwnProperty(c))throw new Error(`Format ${c} is not supported.`);const[d,_]=a[c],f=this[d].bind(this),[T,k]=p.dims,g=[],w=[],S=p.tolist();for(let v=0;v0?C.reduce((z,K)=>z*K,1):0;w.push(y),g.push(F)}return[f(w),g]}char_decode(p){return this.char_tokenizer.batch_decode(p).map(c=>c.replaceAll(" ",""))}bpe_decode(p){return this.bpe_tokenizer.batch_decode(p)}wp_decode(p){return this.wp_tokenizer.batch_decode(p).map(c=>c.replaceAll(" ",""))}batch_decode([p,c,d]){const[_,f]=this._decode_helper(p,"char"),[T,k]=this._decode_helper(c,"bpe"),[g,w]=this._decode_helper(d,"wp"),S=[],E=[];for(let v=0;v<_.length;++v){const[M,y]=(0,i.max)([f[v],k[v],w[v]]);S.push([_[v],T[v],g[v]][y]),E.push(M)}return{generated_text:S,scores:E,char_preds:_,bpe_preds:T,wp_preds:g}}static async from_pretrained(...p){const c=await super.from_pretrained(...p),d=await n.AutoTokenizer.from_pretrained("Xenova/gpt2"),_=await n.AutoTokenizer.from_pretrained("Xenova/bert-base-uncased");return c.components={image_processor:c.image_processor,char_tokenizer:c.tokenizer,bpe_tokenizer:d,wp_tokenizer:_},c}async _call(p,c=null){const d=await this.image_processor(p);return c&&(d.labels=this.tokenizer(c).input_ids),d}}Y(l,"tokenizer_class",n.AutoTokenizer),Y(l,"image_processor_class",o.AutoImageProcessor)},"./src/models/mobilenet_v1/image_processing_mobilenet_v1.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV1FeatureExtractor:()=>n,MobileNetV1ImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/mobilenet_v2/image_processing_mobilenet_v2.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV2FeatureExtractor:()=>n,MobileNetV2ImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/mobilenet_v3/image_processing_mobilenet_v3.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV3FeatureExtractor:()=>n,MobileNetV3ImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/mobilenet_v4/image_processing_mobilenet_v4.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV4FeatureExtractor:()=>n,MobileNetV4ImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/mobilevit/image_processing_mobilevit.js":(e,r,t)=>{t.r(r),t.d(r,{MobileViTFeatureExtractor:()=>n,MobileViTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/moonshine/feature_extraction_moonshine.js":(e,r,t)=>{t.r(r),t.d(r,{MoonshineFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{async _call(a){(0,s.validate_audio_inputs)(a,"MoonshineFeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));const l=[1,a.length];return{input_values:new o.Tensor("float32",a,l)}}}},"./src/models/moonshine/processing_moonshine.js":(e,r,t)=>{t.r(r),t.d(r,{MoonshineProcessor:()=>i});var s=t("./src/models/auto/feature_extraction_auto.js"),o=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",o.AutoTokenizer),Y(i,"feature_extractor_class",s.AutoFeatureExtractor)},"./src/models/nougat/image_processing_nougat.js":(e,r,t)=>{t.r(r),t.d(r,{NougatImageProcessor:()=>o});var s=t("./src/models/donut/image_processing_donut.js");class o extends s.DonutImageProcessor{}},"./src/models/owlv2/image_processing_owlv2.js":(e,r,t)=>{t.r(r),t.d(r,{Owlv2ImageProcessor:()=>o});var s=t("./src/models/owlvit/image_processing_owlvit.js");class o extends s.OwlViTImageProcessor{}},"./src/models/owlvit/image_processing_owlvit.js":(e,r,t)=>{t.r(r),t.d(r,{OwlViTFeatureExtractor:()=>n,OwlViTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_object_detection(...a){return(0,s.post_process_object_detection)(...a)}}class n extends o{}},"./src/models/owlvit/processing_owlvit.js":(e,r,t)=>{t.r(r),t.d(r,{OwlViTProcessor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class i extends s.Processor{}Y(i,"tokenizer_class",n.AutoTokenizer),Y(i,"image_processor_class",o.AutoImageProcessor)},"./src/models/paligemma/processing_paligemma.js":(e,r,t)=>{t.r(r),t.d(r,{PaliGemmaProcessor:()=>l});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");const i="";function a(u,p,c,d,_){return`${d.repeat(c*_)}${p}${u} -`}class l extends s.Processor{async _call(p,c=null,d={}){c||(console.warn("You are using PaliGemma without a text prefix. It will perform as a picture-captioning model."),c=""),Array.isArray(p)||(p=[p]),Array.isArray(c)||(c=[c]);const _=this.tokenizer.bos_token,f=this.image_processor.config.image_seq_length;let T;c.some(w=>w.includes(i))?T=c.map(w=>{const S=w.replaceAll(i,i.repeat(f)),E=S.lastIndexOf(i),v=E===-1?0:E+i.length;return S.slice(0,v)+_+S.slice(v)+` -`}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),T=c.map(w=>a(w,_,f,i,p.length)));const k=this.tokenizer(T,d);return{...await this.image_processor(p,d),...k}}}Y(l,"tokenizer_class",n.AutoTokenizer),Y(l,"image_processor_class",o.AutoImageProcessor),Y(l,"uses_processor_config",!1)},"./src/models/phi3_v/image_processing_phi3_v.js":(e,r,t)=>{t.r(r),t.d(r,{Phi3VImageProcessor:()=>p});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");const n=336,i=[2,3],{ceil:a,floor:l,sqrt:u}=Math;class p extends s.ImageProcessor{constructor(d){super({...d,do_normalize:!0,do_pad:!0,pad_size:"custom",do_convert_rgb:!0,do_resize:!0}),this._num_crops=d.num_crops}calc_num_image_tokens_from_image_size(d,_){const{num_img_tokens:f}=this.config;return l((l(_/n)*l(d/n)+1)*f+1+(l(_/n)+1)*u(f))}get_resize_output_image_size(d,_){const f=this._num_crops,[T,k]=d.size;let g=T/k,w=1;for(;w*Math.ceil(w/g)<=f;)w+=1;w-=1;const S=Math.floor(w*336),E=Math.floor(S/g);return[S,E]}pad_image(d,_,f,T={}){const[k,g]=_,w=n*a(k/n),S=n*a(g/n),E=[1,1,1].map((v,M)=>(v-this.image_mean[M])/this.image_std[M]);return super.pad_image(d,_,{width:S,height:w},{center:!0,constant_values:E,...T})}async _call(d,{num_crops:_=null}={}){if(this._num_crops=_??(_=this.config.num_crops),_<4||u(_)%1!==0)throw new Error("num_crops must be a square number >= 4");Array.isArray(d)||(d=[d]);const f=d.length,T=await Promise.all(d.map(y=>this.preprocess(y))),k=T.map(y=>y.original_size),g=T.map(y=>y.reshaped_input_size),w=[];for(const{pixel_values:y}of T){y.unsqueeze_(0);const[C,F]=y.dims.slice(-2),z=await(0,o.interpolate_4d)(y,{size:[n,n],mode:"bicubic"});if(_>0){const K=[],q=u(_),R=l(F/q),Z=l(C/q);for(let J=0;Jy.map(C=>n*a(C/n))),v=new o.Tensor("int64",E.flat(),[f,2]),M=E.map(([y,C])=>this.calc_num_image_tokens_from_image_size(C,y));return{pixel_values:S,original_sizes:k,reshaped_input_sizes:g,image_sizes:v,num_img_tokens:M}}}},"./src/models/phi3_v/processing_phi3_v.js":(e,r,t)=>{t.r(r),t.d(r,{Phi3VProcessor:()=>l});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");const i="<|image|>",a=/<\|image_\d+\|>/g;class l extends s.Processor{async _call(p,c=null,{padding:d=!0,truncation:_=!0,num_crops:f=null}={}){Array.isArray(p)||(p=[p]);let T,k;if(c){k=await this.image_processor(c,{num_crops:f});const{num_img_tokens:g}=k,w=p.map((E,v)=>E.split(a).join(i.repeat(g[v])));T=this.tokenizer(w,{padding:d,truncation:_});const S=this.tokenizer.model.convert_tokens_to_ids([i])[0];T.input_ids.map_(E=>E==S?-E:E)}else T=this.tokenizer(p);return{...T,...k}}}Y(l,"image_processor_class",o.AutoImageProcessor),Y(l,"tokenizer_class",n.AutoTokenizer)},"./src/models/processors.js":(e,r,t)=>{t.r(r),t.d(r,{Florence2Processor:()=>s.Florence2Processor,GroundingDinoProcessor:()=>o.GroundingDinoProcessor,Idefics3Processor:()=>n.Idefics3Processor,JinaCLIPProcessor:()=>a.JinaCLIPProcessor,MgpstrProcessor:()=>l.MgpstrProcessor,MoonshineProcessor:()=>u.MoonshineProcessor,OwlViTProcessor:()=>p.OwlViTProcessor,PaliGemmaProcessor:()=>d.PaliGemmaProcessor,Phi3VProcessor:()=>c.Phi3VProcessor,PyAnnoteProcessor:()=>_.PyAnnoteProcessor,Qwen2VLProcessor:()=>f.Qwen2VLProcessor,SamProcessor:()=>T.SamProcessor,SmolVLMProcessor:()=>k.SmolVLMProcessor,SpeechT5Processor:()=>g.SpeechT5Processor,UltravoxProcessor:()=>w.UltravoxProcessor,VLChatProcessor:()=>i.VLChatProcessor,Wav2Vec2Processor:()=>S.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>E.Wav2Vec2ProcessorWithLM,WhisperProcessor:()=>v.WhisperProcessor});var s=t("./src/models/florence2/processing_florence2.js"),o=t("./src/models/grounding_dino/processing_grounding_dino.js"),n=t("./src/models/idefics3/processing_idefics3.js"),i=t("./src/models/janus/processing_janus.js"),a=t("./src/models/jina_clip/processing_jina_clip.js"),l=t("./src/models/mgp_str/processing_mgp_str.js"),u=t("./src/models/moonshine/processing_moonshine.js"),p=t("./src/models/owlvit/processing_owlvit.js"),c=t("./src/models/phi3_v/processing_phi3_v.js"),d=t("./src/models/paligemma/processing_paligemma.js"),_=t("./src/models/pyannote/processing_pyannote.js"),f=t("./src/models/qwen2_vl/processing_qwen2_vl.js"),T=t("./src/models/sam/processing_sam.js"),k=t("./src/models/smolvlm/processing_smolvlm.js"),g=t("./src/models/speecht5/processing_speecht5.js"),w=t("./src/models/ultravox/processing_ultravox.js"),S=t("./src/models/wav2vec2/processing_wav2vec2.js"),E=t("./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js"),v=t("./src/models/whisper/processing_whisper.js")},"./src/models/pvt/image_processing_pvt.js":(e,r,t)=>{t.r(r),t.d(r,{PvtImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/pyannote/feature_extraction_pyannote.js":(e,r,t)=>{t.r(r),t.d(r,{PyAnnoteFeatureExtractor:()=>i});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");class i extends s.FeatureExtractor{async _call(l){(0,s.validate_audio_inputs)(l,"PyAnnoteFeatureExtractor"),l instanceof Float64Array&&(l=new Float32Array(l));const u=[1,1,l.length];return{input_values:new o.Tensor("float32",l,u)}}samples_to_frames(l){return(l-this.config.offset)/this.config.step}post_process_speaker_diarization(l,u){const p=u/this.samples_to_frames(u)/this.config.sampling_rate,c=[];for(const d of l.tolist()){const _=[];let f=-1;for(let T=0;T({id:T,start:k*p,end:g*p,confidence:w/(g-k)})))}return c}}},"./src/models/pyannote/processing_pyannote.js":(e,r,t)=>{t.r(r),t.d(r,{PyAnnoteProcessor:()=>n});var s=t("./src/base/processing_utils.js"),o=t("./src/models/pyannote/feature_extraction_pyannote.js");class n extends s.Processor{async _call(a){return await this.feature_extractor(a)}post_process_speaker_diarization(...a){return this.feature_extractor.post_process_speaker_diarization(...a)}get sampling_rate(){return this.feature_extractor.config.sampling_rate}}Y(n,"feature_extractor_class",o.PyAnnoteFeatureExtractor)},"./src/models/qwen2_vl/image_processing_qwen2_vl.js":(e,r,t)=>{t.r(r),t.d(r,{Qwen2VLImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a,...l){const{pixel_values:u,original_sizes:p,reshaped_input_sizes:c}=await super._call(a,...l);let d=u;const{temporal_patch_size:_,merge_size:f,patch_size:T}=this.config;d.dims[0]===1&&(d=(0,o.cat)(Array.from({length:_},()=>d),0));const k=d.dims[0]/_,g=d.dims[1],w=Math.floor(d.dims[2]/T),S=Math.floor(d.dims[3]/T),E=d.view(k,_,g,Math.floor(w/f),f,T,Math.floor(S/f),f,T).permute(0,3,6,4,7,2,1,5,8).view(k*w*S,g*_*T*T),v=new o.Tensor("int64",[k,w,S],[1,3]);return{pixel_values:E,image_grid_thw:v,original_sizes:p,reshaped_input_sizes:c}}}},"./src/models/qwen2_vl/processing_qwen2_vl.js":(e,r,t)=>{t.r(r),t.d(r,{Qwen2VLProcessor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");class i extends s.Processor{async _call(l,u=null,...p){Array.isArray(l)||(l=[l]);let c,d;if(u&&(c=await this.image_processor(u),d=c.image_grid_thw),d){let f=this.image_processor.config.merge_size**2,T=0;const k=d.tolist();l=l.map(g=>{for(;g.includes("<|image_pad|>");){const w=Number(k[T++].reduce((S,E)=>S*E,1n));g=g.replace("<|image_pad|>","<|placeholder|>".repeat(Math.floor(w/f)))}return g.replaceAll("<|placeholder|>","<|image_pad|>")})}return{...this.tokenizer(l),...c}}}Y(i,"image_processor_class",o.AutoImageProcessor),Y(i,"tokenizer_class",n.AutoTokenizer)},"./src/models/rt_detr/image_processing_rt_detr.js":(e,r,t)=>{t.r(r),t.d(r,{RTDetrImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_object_detection(...i){return(0,s.post_process_object_detection)(...i)}}},"./src/models/sam/image_processing_sam.js":(e,r,t)=>{t.r(r),t.d(r,{SamImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/core.js"),n=t("./src/utils/tensor.js");class i extends s.ImageProcessor{reshape_input_points(l,u,p,c=!1){l=structuredClone(l);let d=(0,o.calculateDimensions)(l);if(d.length===3)c||(d=[1,...d]),l=[l];else if(d.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let _=0;_c!==u.dims[d]))throw Error(`The first ${p.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new n.Tensor("int64",l.flat(1/0).map(BigInt),p)}async _call(l,{input_points:u=null,input_labels:p=null,input_boxes:c=null}={}){const d=await super._call(l);if(u&&(d.input_points=this.reshape_input_points(u,d.original_sizes,d.reshaped_input_sizes)),p){if(!d.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");d.input_labels=this.add_input_labels(p,d.input_points)}return c&&(d.input_boxes=this.reshape_input_points(c,d.original_sizes,d.reshaped_input_sizes,!0)),d}async post_process_masks(l,u,p,{mask_threshold:c=0,binarize:d=!0,pad_size:_=null}={}){const f=[];_=_??this.pad_size;const T=[_.height,_.width];for(let k=0;kc&&(v[M]=1);S=new n.Tensor("bool",v,S.dims)}f.push(S)}return f}generate_crop_boxes(l,u,{crop_n_layers:p=0,overlap_ratio:c=512/1500,points_per_crop:d=32,crop_n_points_downscale_factor:_=1}={}){}}},"./src/models/sam/processing_sam.js":(e,r,t)=>{t.r(r),t.d(r,{SamProcessor:()=>n});var s=t("./src/base/processing_utils.js"),o=t("./src/models/auto/image_processing_auto.js");class n extends s.Processor{async _call(...a){return await this.image_processor(...a)}post_process_masks(...a){return this.image_processor.post_process_masks(...a)}reshape_input_points(...a){return this.image_processor.reshape_input_points(...a)}}Y(n,"image_processor_class",o.AutoImageProcessor)},"./src/models/seamless_m4t/feature_extraction_seamless_m4t.js":(e,r,t)=>{t.r(r),t.d(r,{SeamlessM4TFeatureExtractor:()=>i});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js"),n=t("./src/utils/audio.js");class i extends s.FeatureExtractor{constructor(l){super(l);const u=this.config.sampling_rate,p=(0,n.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(u/2),u,null,"kaldi",!0);this.mel_filters=p,this.window=(0,n.window_function)(400,"povey",{periodic:!1})}async _extract_fbank_features(l,u){return l=l.map(p=>p*32768),(0,n.spectrogram)(l,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:u,transpose:!0})}async _call(l,{padding:u=!0,pad_to_multiple_of:p=2,do_normalize_per_mel_bins:c=!0,return_attention_mask:d=!0}={}){(0,s.validate_audio_inputs)(l,"SeamlessM4TFeatureExtractor");let _=await this._extract_fbank_features(l,this.config.max_length);if(c){const[v,M]=_.dims,y=_.data;for(let C=0;C0){const F=new Float32Array(M*(v+C));F.set(y),F.fill(this.config.padding_value,y.length);const z=v+C;_=new o.Tensor(_.type,F,[z,M]),d&&(f=new o.Tensor("int64",new BigInt64Array(z),[1,z]),f.data.fill(1n,0,v))}}const[T,k]=_.dims,g=this.config.stride;if(T%g!==0)throw new Error(`The number of frames (${T}) must be a multiple of the stride (${g}).`);const S=_.view(1,Math.floor(T/g),k*g),E={input_features:S};if(d){const v=S.dims[1],M=new BigInt64Array(v);if(f){const y=f.data;for(let C=1,F=0;C{t.r(r),t.d(r,{SegformerFeatureExtractor:()=>n,SegformerImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_semantic_segmentation(...a){return(0,s.post_process_semantic_segmentation)(...a)}}class n extends o{}},"./src/models/siglip/image_processing_siglip.js":(e,r,t)=>{t.r(r),t.d(r,{SiglipImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}},"./src/models/smolvlm/image_processing_smolvlm.js":(e,r,t)=>{t.r(r),t.d(r,{SmolVLMImageProcessor:()=>s.Idefics3ImageProcessor});var s=t("./src/models/idefics3/image_processing_idefics3.js")},"./src/models/smolvlm/processing_smolvlm.js":(e,r,t)=>{t.r(r),t.d(r,{SmolVLMProcessor:()=>s.Idefics3Processor});var s=t("./src/models/idefics3/processing_idefics3.js")},"./src/models/snac/feature_extraction_snac.js":(e,r,t)=>{t.r(r),t.d(r,{SnacFeatureExtractor:()=>o});var s=t("./src/models/dac/feature_extraction_dac.js");class o extends s.DacFeatureExtractor{}},"./src/models/speecht5/feature_extraction_speecht5.js":(e,r,t)=>{t.r(r),t.d(r,{SpeechT5FeatureExtractor:()=>o});var s=t("./src/base/feature_extraction_utils.js");class o extends s.FeatureExtractor{}},"./src/models/speecht5/processing_speecht5.js":(e,r,t)=>{t.r(r),t.d(r,{SpeechT5Processor:()=>i});var s=t("./src/base/processing_utils.js"),o=t("./src/tokenizers.js"),n=t("./src/models/auto/feature_extraction_auto.js");class i extends s.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",o.AutoTokenizer),Y(i,"feature_extractor_class",n.AutoFeatureExtractor)},"./src/models/swin2sr/image_processing_swin2sr.js":(e,r,t)=>{t.r(r),t.d(r,{Swin2SRImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{pad_image(i,a,l,u={}){const[p,c,d]=a;return super.pad_image(i,a,{width:c+(l-c%l)%l,height:p+(l-p%l)%l},{mode:"symmetric",center:!1,constant_values:-1,...u})}}},"./src/models/ultravox/processing_ultravox.js":(e,r,t)=>{t.r(r),t.d(r,{UltravoxProcessor:()=>i});var s=t("./src/models/auto/feature_extraction_auto.js"),o=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l,u=null,p={}){if(Array.isArray(l))throw new Error("Batched inputs are not supported yet.");let c={};if(u){const _=u.length,{input_features:f}=await this.feature_extractor(u,{...p,max_length:_}),T=Math.round(_/this.config.encoder_ds_factor+1e-4),k=1+Math.ceil(T/this.config.stack_factor);c.audio_token_len=[k],c.audio_values=f;const g=this.config.audio_placeholder;if(!l.includes(g))throw new Error(`The input text does not contain the image token ${g}.`);l=l.replaceAll(g,g.repeat(k))}return{...this.tokenizer(l,{add_special_tokens:!1,...p}),...c}}}Y(i,"tokenizer_class",o.AutoTokenizer),Y(i,"feature_extractor_class",s.AutoFeatureExtractor),Y(i,"uses_processor_config",!0)},"./src/models/vit/image_processing_vit.js":(e,r,t)=>{t.r(r),t.d(r,{ViTFeatureExtractor:()=>n,ViTImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{}class n extends o{}},"./src/models/vitmatte/image_processing_vitmatte.js":(e,r,t)=>{t.r(r),t.d(r,{VitMatteImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),o=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a,l){Array.isArray(a)||(a=[a]),Array.isArray(l)||(l=[l]);const u=await Promise.all(a.map(d=>this.preprocess(d))),p=await Promise.all(l.map(d=>this.preprocess(d,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:(0,o.stack)(u.map((d,_)=>(0,o.cat)([d.pixel_values,p[_].pixel_values],0)),0),original_sizes:u.map(d=>d.original_size),reshaped_input_sizes:u.map(d=>d.reshaped_input_size)}}}},"./src/models/vitpose/image_processing_vitpose.js":(e,r,t)=>{t.r(r),t.d(r,{VitPoseImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_pose_estimation(i,a,{threshold:l=null}={}){const u=i.tolist(),[p,c,d,_]=i.dims,f=[];for(let T=0;T{t.r(r),t.d(r,{Wav2Vec2FeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),o=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{_zero_mean_unit_var_norm(a){const u=a.reduce((c,d)=>c+d,0)/a.length,p=a.reduce((c,d)=>c+(d-u)**2,0)/a.length;return a.map(c=>(c-u)/Math.sqrt(p+1e-7))}async _call(a){(0,s.validate_audio_inputs)(a,"Wav2Vec2FeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));let l=a;this.config.do_normalize&&(l=this._zero_mean_unit_var_norm(l));const u=[1,l.length];return{input_values:new o.Tensor("float32",l,u),attention_mask:new o.Tensor("int64",new BigInt64Array(l.length).fill(1n),u)}}}},"./src/models/wav2vec2/processing_wav2vec2.js":(e,r,t)=>{t.r(r),t.d(r,{Wav2Vec2Processor:()=>i});var s=t("./src/tokenizers.js"),o=t("./src/models/auto/feature_extraction_auto.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",s.AutoTokenizer),Y(i,"feature_extractor_class",o.AutoFeatureExtractor)},"./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js":(e,r,t)=>{t.r(r),t.d(r,{Wav2Vec2ProcessorWithLM:()=>i});var s=t("./src/tokenizers.js"),o=t("./src/models/auto/feature_extraction_auto.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",s.AutoTokenizer),Y(i,"feature_extractor_class",o.AutoFeatureExtractor)},"./src/models/wespeaker/feature_extraction_wespeaker.js":(e,r,t)=>{t.r(r),t.d(r,{WeSpeakerFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var o=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a);const l=this.config.sampling_rate,u=(0,o.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(l/2),l,null,"kaldi",!0);this.mel_filters=u,this.window=(0,o.window_function)(400,"hamming",{periodic:!1}),this.min_num_frames=this.config.min_num_frames}async _extract_fbank_features(a){return a=a.map(l=>l*32768),(0,o.spectrogram)(a,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(a){(0,s.validate_audio_inputs)(a,"WeSpeakerFeatureExtractor");const l=(await this._extract_fbank_features(a)).unsqueeze_(0);if(this.config.fbank_centering_span===null){const u=l.mean(1).data,p=l.data,[c,d,_]=l.dims;for(let f=0;f{t.r(r),t.d(r,{WHISPER_LANGUAGE_MAPPING:()=>o,WHISPER_TO_LANGUAGE_CODE_MAPPING:()=>n,whisper_language_to_code:()=>i});const s=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],o=new Map(s),n=new Map([...s.map(([a,l])=>[l,a]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);function i(a){a=a.toLowerCase();let l=n.get(a);if(l===void 0){const u=a.match(/^<\|([a-z]{2})\|>$/);if(u&&(a=u[1]),o.has(a))l=a;else{const c=a.length===2?o.keys():o.values();throw new Error(`Language "${a}" is not supported. Must be one of: ${JSON.stringify(Array.from(c))}`)}}return l}},"./src/models/whisper/feature_extraction_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperFeatureExtractor:()=>i});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var o=t("./src/utils/audio.js"),n=t("./src/utils/maths.js");class i extends s.FeatureExtractor{constructor(l){var u;super(l),(u=this.config).mel_filters??(u.mel_filters=(0,o.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,"slaney","slaney")),this.window=(0,o.window_function)(this.config.n_fft,"hann")}async _extract_fbank_features(l){const u=await(0,o.spectrogram)(l,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:"log10",max_num_frames:Math.min(Math.floor(l.length/this.config.hop_length),this.config.nb_max_frames)}),p=u.data,c=(0,n.max)(p)[0];for(let d=0;dc?(l.length>this.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),p=l.slice(0,c)):(p=new Float32Array(c),p.set(l)),{input_features:(await this._extract_fbank_features(p)).unsqueeze_(0)}}}},"./src/models/whisper/generation_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperGenerationConfig:()=>o});var s=t("./src/generation/configuration_utils.js");class o extends s.GenerationConfig{constructor(){super(...arguments);Y(this,"return_timestamps",null);Y(this,"return_token_timestamps",null);Y(this,"num_frames",null);Y(this,"alignment_heads",null);Y(this,"task",null);Y(this,"language",null);Y(this,"no_timestamps_token_id",null);Y(this,"prompt_ids",null);Y(this,"is_multilingual",null);Y(this,"lang_to_id",null);Y(this,"task_to_id",null);Y(this,"max_initial_timestamp_index",1)}}},"./src/models/whisper/processing_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperProcessor:()=>i});var s=t("./src/models/auto/feature_extraction_auto.js"),o=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class i extends n.Processor{async _call(l){return await this.feature_extractor(l)}}Y(i,"tokenizer_class",o.AutoTokenizer),Y(i,"feature_extractor_class",s.AutoFeatureExtractor)},"./src/models/yolos/image_processing_yolos.js":(e,r,t)=>{t.r(r),t.d(r,{YolosFeatureExtractor:()=>n,YolosImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js");class o extends s.ImageProcessor{post_process_object_detection(...a){return(0,s.post_process_object_detection)(...a)}}class n extends o{}},"./src/ops/registry.js":(e,r,t)=>{t.r(r),t.d(r,{TensorOpRegistry:()=>l});var s=t("./src/backends/onnx.js"),o=t("./src/utils/tensor.js"),n=t("./src/env.js");const i=n.apis.IS_BROWSER_ENV||n.apis.IS_WEBWORKER_ENV,a=async(u,p,c)=>{const d=await(0,s.createInferenceSession)(new Uint8Array(u),p);let _=Promise.resolve();return async f=>{const T=(0,s.isONNXProxy)(),k=Object.fromEntries(Object.entries(f).map(([w,S])=>[w,(T?S.clone():S).ort_tensor])),g=await(_=i?_.then(()=>d.run(k)):d.run(k));return Array.isArray(c)?c.map(w=>new o.Tensor(g[w])):new o.Tensor(g[c])}};class l{static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||(this._nearest_interpolate_4d=a([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,"y")),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||(this._bilinear_interpolate_4d=a([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||(this._bicubic_interpolate_4d=a([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||(this._matmul=a([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,"c")),this._matmul}static get stft(){return this._stft||(this._stft=a([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,"o")),this._stft}static get rfft(){return this._rfft||(this._rfft=a([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,"y")),this._rfft}static get top_k(){return this._top_k||(this._top_k=a([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,["v","i"])),this._top_k}static get slice(){return this._slice||(this._slice=a([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,"y")),this._slice}}Y(l,"session_options",{})},"./src/pipelines.js":(e,r,t)=>{t.r(r),t.d(r,{AudioClassificationPipeline:()=>q,AutomaticSpeechRecognitionPipeline:()=>Z,BackgroundRemovalPipeline:()=>se,DepthEstimationPipeline:()=>_e,DocumentQuestionAnsweringPipeline:()=>A,FeatureExtractionPipeline:()=>z,FillMaskPipeline:()=>S,ImageClassificationPipeline:()=>J,ImageFeatureExtractionPipeline:()=>K,ImageSegmentationPipeline:()=>Q,ImageToImagePipeline:()=>ee,ImageToTextPipeline:()=>H,ObjectDetectionPipeline:()=>ae,Pipeline:()=>T,QuestionAnsweringPipeline:()=>w,SummarizationPipeline:()=>v,Text2TextGenerationPipeline:()=>E,TextClassificationPipeline:()=>k,TextGenerationPipeline:()=>C,TextToAudioPipeline:()=>U,TokenClassificationPipeline:()=>g,TranslationPipeline:()=>M,ZeroShotAudioClassificationPipeline:()=>R,ZeroShotClassificationPipeline:()=>F,ZeroShotImageClassificationPipeline:()=>fe,ZeroShotObjectDetectionPipeline:()=>V,pipeline:()=>ze});var s=t("./src/tokenizers.js"),o=t("./src/models.js"),n=t("./src/models/auto/processing_auto.js");t("./src/base/processing_utils.js");var i=t("./src/utils/generic.js"),a=t("./src/utils/core.js"),l=t("./src/utils/maths.js"),u=t("./src/utils/audio.js"),p=t("./src/utils/tensor.js"),c=t("./src/utils/image.js");async function d(pe){return Array.isArray(pe)||(pe=[pe]),await Promise.all(pe.map(W=>c.RawImage.read(W)))}async function _(pe,W){return Array.isArray(pe)||(pe=[pe]),await Promise.all(pe.map(re=>typeof re=="string"||re instanceof URL?(0,u.read_audio)(re,W):re instanceof Float64Array?new Float32Array(re):re))}function f(pe,W){W&&(pe=pe.map(Se=>Se|0));const[re,G,be,we]=pe;return{xmin:re,ymin:G,xmax:be,ymax:we}}class T extends i.Callable{constructor({task:W,model:re,tokenizer:G=null,processor:be=null}){super(),this.task=W,this.model=re,this.tokenizer=G,this.processor=be}async dispose(){await this.model.dispose()}}class k extends T{constructor(W){super(W)}async _call(W,{top_k:re=1}={}){const G=this.tokenizer(W,{padding:!0,truncation:!0}),be=await this.model(G),we=this.model.config.problem_type==="multi_label_classification"?$e=>$e.sigmoid():$e=>new p.Tensor("float32",(0,l.softmax)($e.data),$e.dims),Se=this.model.config.id2label,Ce=[];for(const $e of be.logits){const Fe=we($e),Be=await(0,p.topk)(Fe,re),He=Be[0].tolist(),ke=Be[1].tolist().map((Ve,Ze)=>({label:Se?Se[Ve]:`LABEL_${Ve}`,score:He[Ze]}));re===1?Ce.push(...ke):Ce.push(ke)}return Array.isArray(W)||re===1?Ce:Ce[0]}}class g extends T{constructor(W){super(W)}async _call(W,{ignore_labels:re=["O"]}={}){const G=Array.isArray(W),be=this.tokenizer(G?W:[W],{padding:!0,truncation:!0}),Se=(await this.model(be)).logits,Ce=this.model.config.id2label,$e=[];for(let Fe=0;FeIe==this.tokenizer.sep_token_id);$e[He].map((Ie,pt)=>Ie==1&&(pt===0||pt>ke&&Fe.findIndex(St=>St==qe[pt])===-1));const Ve=we[He].tolist(),Ze=Se[He].tolist();for(let Ie=1;Iept==qe[Ie])!==-1)&&(Ve[Ie]=-1/0,Ze[Ie]=-1/0);const nt=(0,l.softmax)(Ve).map((Ie,pt)=>[Ie,pt]),lt=(0,l.softmax)(Ze).map((Ie,pt)=>[Ie,pt]);nt[0][0]=0,lt[0][0]=0;const Ge=(0,a.product)(nt,lt).filter(Ie=>Ie[0][1]<=Ie[1][1]).map(Ie=>[Ie[0][1],Ie[1][1],Ie[0][0]*Ie[1][0]]).sort((Ie,pt)=>pt[2]-Ie[2]);for(let Ie=0;IeVe==this.tokenizer.mask_token_id);if(Fe===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);const Be=be[Ce][Fe],He=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(Be.data),Be.dims),re),qe=He[0].tolist(),ke=He[1].tolist();we.push(ke.map((Ve,Ze)=>{const nt=$e.slice();return nt[Fe]=Ve,{score:qe[Ze],token:Number(Ve),token_str:this.tokenizer.decode([Ve]),sequence:this.tokenizer.decode(nt,{skip_special_tokens:!0})}}))}return Array.isArray(W)?we:we[0]}}class E extends T{constructor(re){super(re);Y(this,"_key","generated_text")}async _call(re,G={}){Array.isArray(re)||(re=[re]),this.model.config.prefix&&(re=re.map(Fe=>this.model.config.prefix+Fe));const be=this.model.config.task_specific_params;be&&be[this.task]&&be[this.task].prefix&&(re=re.map(Fe=>be[this.task].prefix+Fe));const we=this.tokenizer,Se={padding:!0,truncation:!0};let Ce;this instanceof M&&"_build_translation_inputs"in we?Ce=we._build_translation_inputs(re,Se,G):Ce=we(re,Se);const $e=await this.model.generate({...Ce,...G});return we.batch_decode($e,{skip_special_tokens:!0}).map(Fe=>({[this._key]:Fe}))}}class v extends E{constructor(re){super(re);Y(this,"_key","summary_text")}}class M extends E{constructor(re){super(re);Y(this,"_key","translation_text")}}function y(pe){return Array.isArray(pe)&&pe.every(W=>"role"in W&&"content"in W)}class C extends T{constructor(W){super(W)}async _call(W,re={}){let G=!1,be=!1,we;if(typeof W=="string")we=W=[W];else if(Array.isArray(W)&&W.every(ke=>typeof ke=="string"))G=!0,we=W;else{if(y(W))W=[W];else if(Array.isArray(W)&&W.every(y))G=!0;else throw new Error("Input must be a string, an array of strings, a Chat, or an array of Chats");be=!0,we=W.map(ke=>this.tokenizer.apply_chat_template(ke,{tokenize:!1,add_generation_prompt:!0}))}const Se=re.add_special_tokens??!1,Ce=be?!1:re.return_full_text??!0;this.tokenizer.padding_side="left";const $e=this.tokenizer(we,{add_special_tokens:Se,padding:!0,truncation:!0}),Fe=await this.model.generate({...$e,...re}),Be=this.tokenizer.batch_decode(Fe,{skip_special_tokens:!0});let He;!Ce&&$e.input_ids.dims.at(-1)>0&&(He=this.tokenizer.batch_decode($e.input_ids,{skip_special_tokens:!0}).map(ke=>ke.length));const qe=Array.from({length:W.length},ke=>[]);for(let ke=0;ke[re.toLowerCase(),G])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn("Could not find 'entailment' in label2id mapping. Using 2 as entailment_id."),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn("Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id."),this.contradiction_id=0)}async _call(W,re,{hypothesis_template:G="This example is {}.",multi_label:be=!1}={}){const we=Array.isArray(W);we||(W=[W]),Array.isArray(re)||(re=[re]);const Se=re.map(Fe=>G.replace("{}",Fe)),Ce=be||re.length===1,$e=[];for(const Fe of W){const Be=[];for(const ke of Se){const Ve=this.tokenizer(Fe,{text_pair:ke,padding:!0,truncation:!0}),Ze=await this.model(Ve);Ce?Be.push([Ze.logits.data[this.contradiction_id],Ze.logits.data[this.entailment_id]]):Be.push(Ze.logits.data[this.entailment_id])}const qe=(Ce?Be.map(ke=>(0,l.softmax)(ke)[1]):(0,l.softmax)(Be)).map((ke,Ve)=>[ke,Ve]).sort((ke,Ve)=>Ve[0]-ke[0]);$e.push({sequence:Fe,labels:qe.map(ke=>re[ke[1]]),scores:qe.map(ke=>ke[0])})}return we?$e:$e[0]}}class z extends T{constructor(W){super(W)}async _call(W,{pooling:re="none",normalize:G=!1,quantize:be=!1,precision:we="binary"}={}){const Se=this.tokenizer(W,{padding:!0,truncation:!0}),Ce=await this.model(Se);let $e=Ce.last_hidden_state??Ce.logits??Ce.token_embeddings;if(re!=="none")if(re==="mean")$e=(0,p.mean_pooling)($e,Se.attention_mask);else if(re==="cls")$e=$e.slice(null,0);else throw Error(`Pooling method '${re}' not supported.`);return G&&($e=$e.normalize(2,-1)),be&&($e=(0,p.quantize_embeddings)($e,we)),$e}}class K extends T{constructor(W){super(W)}async _call(W,{pool:re=null}={}){const G=await d(W),{pixel_values:be}=await this.processor(G),we=await this.model({pixel_values:be});let Se;if(re){if(!("pooler_output"in we))throw Error("No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.");Se=we.pooler_output}else Se=we.last_hidden_state??we.logits??we.image_embeds;return Se}}class q extends T{constructor(W){super(W)}async _call(W,{top_k:re=5}={}){const G=this.processor.feature_extractor.config.sampling_rate,be=await _(W,G),we=this.model.config.id2label,Se=[];for(const Ce of be){const $e=await this.processor(Ce),Be=(await this.model($e)).logits[0],He=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(Be.data),Be.dims),re),qe=He[0].tolist(),Ve=He[1].tolist().map((Ze,nt)=>({label:we?we[Ze]:`LABEL_${Ze}`,score:qe[nt]}));Se.push(Ve)}return Array.isArray(W)?Se:Se[0]}}class R extends T{constructor(W){super(W)}async _call(W,re,{hypothesis_template:G="This is a sound of {}."}={}){const be=!Array.isArray(W);be&&(W=[W]);const we=re.map(Be=>G.replace("{}",Be)),Se=this.tokenizer(we,{padding:!0,truncation:!0}),Ce=this.processor.feature_extractor.config.sampling_rate,$e=await _(W,Ce),Fe=[];for(const Be of $e){const He=await this.processor(Be),qe=await this.model({...Se,...He}),ke=(0,l.softmax)(qe.logits_per_audio.data);Fe.push([...ke].map((Ve,Ze)=>({score:Ve,label:re[Ze]})))}return be?Fe[0]:Fe}}class Z extends T{constructor(W){super(W)}async _call(W,re={}){switch(this.model.config.model_type){case"whisper":case"lite-whisper":return this._call_whisper(W,re);case"wav2vec2":case"wav2vec2-bert":case"unispeech":case"unispeech-sat":case"hubert":return this._call_wav2vec2(W,re);case"moonshine":return this._call_moonshine(W,re);default:throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(W,re){re.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),re.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');const G=!Array.isArray(W);G&&(W=[W]);const be=this.processor.feature_extractor.config.sampling_rate,we=await _(W,be),Se=[];for(const Ce of we){const $e=await this.processor(Ce),Be=(await this.model($e)).logits[0],He=[];for(const ke of Be)He.push((0,l.max)(ke.data)[1]);const qe=this.tokenizer.decode(He);Se.push({text:qe})}return G?Se[0]:Se}async _call_whisper(W,re){const G=re.return_timestamps??!1,be=re.chunk_length_s??0,we=re.force_full_sequences??!1;let Se=re.stride_length_s??null;const Ce={...re};G==="word"&&(Ce.return_token_timestamps=!0,Ce.return_timestamps=!1);const $e=!Array.isArray(W);$e&&(W=[W]);const Fe=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,Be=this.processor.feature_extractor.config.hop_length,He=this.processor.feature_extractor.config.sampling_rate,qe=await _(W,He),ke=[];for(const Ve of qe){let Ze=[];if(be>0){if(Se===null)Se=be/6;else if(be<=Se)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");const Ge=He*be,Ie=He*Se,pt=Ge-2*Ie;let St=0;for(;;){const Vt=St+Ge,Rt=Ve.subarray(St,Vt),gr=await this.processor(Rt),ir=St===0,Mt=Vt>=Ve.length;if(Ze.push({stride:[Rt.length,ir?0:Ie,Mt?0:Ie],input_features:gr.input_features,is_last:Mt}),Mt)break;St+=pt}}else Ze=[{stride:[Ve.length,0,0],input_features:(await this.processor(Ve)).input_features,is_last:!0}];for(const Ge of Ze){Ce.num_frames=Math.floor(Ge.stride[0]/Be);const Ie=await this.model.generate({inputs:Ge.input_features,...Ce});G==="word"?(Ge.tokens=Ie.sequences.tolist()[0],Ge.token_timestamps=Ie.token_timestamps.tolist()[0].map(pt=>(0,l.round)(pt,2))):Ge.tokens=Ie[0].tolist(),Ge.stride=Ge.stride.map(pt=>pt/He)}const[nt,lt]=this.tokenizer._decode_asr(Ze,{time_precision:Fe,return_timestamps:G,force_full_sequences:we});ke.push({text:nt,...lt})}return $e?ke[0]:ke}async _call_moonshine(W,re){const G=!Array.isArray(W);G&&(W=[W]);const be=this.processor.feature_extractor.config.sampling_rate,we=await _(W,be),Se=[];for(const Ce of we){const $e=await this.processor(Ce),Fe=Math.floor(Ce.length/be)*6,Be=await this.model.generate({max_new_tokens:Fe,...re,...$e}),He=this.processor.batch_decode(Be,{skip_special_tokens:!0})[0];Se.push({text:He})}return G?Se[0]:Se}}class H extends T{constructor(W){super(W)}async _call(W,re={}){const G=Array.isArray(W),be=await d(W),{pixel_values:we}=await this.processor(be),Se=[];for(const Ce of we){Ce.dims=[1,...Ce.dims];const $e=await this.model.generate({inputs:Ce,...re}),Fe=this.tokenizer.batch_decode($e,{skip_special_tokens:!0}).map(Be=>({generated_text:Be.trim()}));Se.push(Fe)}return G?Se:Se[0]}}class J extends T{constructor(W){super(W)}async _call(W,{top_k:re=5}={}){const G=await d(W),{pixel_values:be}=await this.processor(G),we=await this.model({pixel_values:be}),Se=this.model.config.id2label,Ce=[];for(const $e of we.logits){const Fe=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)($e.data),$e.dims),re),Be=Fe[0].tolist(),qe=Fe[1].tolist().map((ke,Ve)=>({label:Se?Se[ke]:`LABEL_${ke}`,score:Be[Ve]}));Ce.push(qe)}return Array.isArray(W)?Ce:Ce[0]}}class Q extends T{constructor(W){super(W),this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(W,{threshold:re=.5,mask_threshold:G=.5,overlap_mask_area_threshold:be=.8,label_ids_to_fuse:we=null,target_sizes:Se=null,subtask:Ce=null}={}){if(Array.isArray(W)&&W.length!==1)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");const Fe=await d(W),Be=Fe.map(Ge=>[Ge.height,Ge.width]),He=await this.processor(Fe),{inputNames:qe,outputNames:ke}=this.model.sessions.model;if(!qe.includes("pixel_values")){if(qe.length!==1)throw Error(`Expected a single input name, but got ${qe.length} inputs: ${qe}.`);const Ge=qe[0];if(Ge in He)throw Error(`Input name ${Ge} already exists in the inputs.`);He[Ge]=He.pixel_values}const Ve=await this.model(He);let Ze=null;if(Ce!==null)Ze=this.subtasks_mapping[Ce];else if(this.processor.image_processor){for(const[Ge,Ie]of Object.entries(this.subtasks_mapping))if(Ie in this.processor.image_processor){Ze=this.processor.image_processor[Ie].bind(this.processor.image_processor),Ce=Ge;break}}const nt=this.model.config.id2label,lt=[];if(Ce)if(Ce==="panoptic"||Ce==="instance"){const Ge=Ze(Ve,re,G,be,we,Se??Be)[0],Ie=Ge.segmentation;for(const pt of Ge.segments_info){const St=new Uint8ClampedArray(Ie.data.length);for(let Rt=0;Rtgr<-1e-5||gr>1+1e-5)&&Vt.sigmoid_();const Rt=await c.RawImage.fromTensor(Vt.mul_(255).to("uint8")).resize(St[1],St[0]);lt.push({label:null,score:null,mask:Rt})}}return lt}}class se extends Q{constructor(W){super(W)}async _call(W,re={}){if(Array.isArray(W)&&W.length!==1)throw Error("Background removal pipeline currently only supports a batch size of 1.");const be=await d(W),we=await super._call(W,re);return be.map((Ce,$e)=>{const Fe=Ce.clone();return Fe.putAlpha(we[$e].mask),Fe})}}class fe extends T{constructor(W){super(W)}async _call(W,re,{hypothesis_template:G="This is a photo of {}"}={}){const be=Array.isArray(W),we=await d(W),Se=re.map(qe=>G.replace("{}",qe)),Ce=this.tokenizer(Se,{padding:this.model.config.model_type==="siglip"?"max_length":!0,truncation:!0}),{pixel_values:$e}=await this.processor(we),Fe=await this.model({...Ce,pixel_values:$e}),Be=this.model.config.model_type==="siglip"?qe=>qe.sigmoid().data:qe=>(0,l.softmax)(qe.data),He=[];for(const qe of Fe.logits_per_image){const Ve=[...Be(qe)].map((Ze,nt)=>({score:Ze,label:re[nt]}));Ve.sort((Ze,nt)=>nt.score-Ze.score),He.push(Ve)}return be?He:He[0]}}class ae extends T{constructor(W){super(W)}async _call(W,{threshold:re=.9,percentage:G=!1}={}){const be=Array.isArray(W);if(be&&W.length!==1)throw Error("Object detection pipeline currently only supports a batch size of 1.");const we=await d(W),Se=G?null:we.map(ke=>[ke.height,ke.width]),{pixel_values:Ce,pixel_mask:$e}=await this.processor(we),Fe=await this.model({pixel_values:Ce,pixel_mask:$e}),Be=this.processor.image_processor.post_process_object_detection(Fe,re,Se),He=this.model.config.id2label,qe=Be.map(ke=>ke.boxes.map((Ve,Ze)=>({score:ke.scores[Ze],label:He[ke.classes[Ze]],box:f(Ve,!G)})));return be?qe:qe[0]}}class V extends T{constructor(W){super(W)}async _call(W,re,{threshold:G=.1,top_k:be=null,percentage:we=!1}={}){const Se=Array.isArray(W),Ce=await d(W),$e=this.tokenizer(re,{padding:!0,truncation:!0}),Fe=await this.processor(Ce),Be=[];for(let He=0;He({score:lt.scores[Ie],label:lt.labels[Ie],box:f(Ge,!we)}))}else{const lt=this.processor.image_processor.post_process_object_detection(Ze,G,ke,!0)[0];nt=lt.boxes.map((Ge,Ie)=>({score:lt.scores[Ie],label:re[lt.classes[Ie]],box:f(Ge,!we)}))}nt.sort((lt,Ge)=>Ge.score-lt.score),be!==null&&(nt=nt.slice(0,be)),Be.push(nt)}return Se?Be:Be[0]}}class A extends T{constructor(W){super(W)}async _call(W,re,G={}){const be=(await d(W))[0],{pixel_values:we}=await this.processor(be),Se=`${re}`,Ce=this.tokenizer(Se,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,$e=await this.model.generate({inputs:we,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:Ce,...G}),Be=this.tokenizer.batch_decode($e)[0].match(/(.*?)<\/s_answer>/);let He=null;return Be&&Be.length>=2&&(He=Be[1].trim()),[{answer:He}]}}class U extends T{constructor(re){super(re);Y(this,"DEFAULT_VOCODER_ID","Xenova/speecht5_hifigan");this.vocoder=re.vocoder??null}async _call(re,{speaker_embeddings:G=null}={}){return this.processor?this._call_text_to_spectrogram(re,{speaker_embeddings:G}):this._call_text_to_waveform(re)}async _call_text_to_waveform(re){const G=this.tokenizer(re,{padding:!0,truncation:!0}),{waveform:be}=await this.model(G),we=this.model.config.sampling_rate;return new u.RawAudio(be.data,we)}async _call_text_to_spectrogram(re,{speaker_embeddings:G}){if(this.vocoder||(console.log("No vocoder specified, using default HifiGan vocoder."),this.vocoder=await o.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:"fp32"})),(typeof G=="string"||G instanceof URL)&&(G=new Float32Array(await(await fetch(G)).arrayBuffer())),G instanceof Float32Array)G=new p.Tensor("float32",G,[1,G.length]);else if(!(G instanceof p.Tensor))throw new Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");const{input_ids:be}=this.tokenizer(re,{padding:!0,truncation:!0}),{waveform:we}=await this.model.generate_speech(be,G,{vocoder:this.vocoder}),Se=this.processor.feature_extractor.config.sampling_rate;return new u.RawAudio(we.data,Se)}}class ee extends T{constructor(W){super(W)}async _call(W){const re=await d(W),G=await this.processor(re),be=await this.model(G),we=[];for(const Se of be.reconstruction){const Ce=Se.squeeze().clamp_(0,1).mul_(255).round_().to("uint8");we.push(c.RawImage.fromTensor(Ce))}return we.length>1?we:we[0]}}class _e extends T{constructor(W){super(W)}async _call(W){const re=await d(W),G=await this.processor(re),{predicted_depth:be}=await this.model(G),we=[];for(let Se=0;Se1?we:we[0]}}const le=Object.freeze({"text-classification":{tokenizer:s.AutoTokenizer,pipeline:k,model:o.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:s.AutoTokenizer,pipeline:g,model:o.AutoModelForTokenClassification,default:{model:"Xenova/bert-base-multilingual-cased-ner-hrl"},type:"text"},"question-answering":{tokenizer:s.AutoTokenizer,pipeline:w,model:o.AutoModelForQuestionAnswering,default:{model:"Xenova/distilbert-base-cased-distilled-squad"},type:"text"},"fill-mask":{tokenizer:s.AutoTokenizer,pipeline:S,model:o.AutoModelForMaskedLM,default:{model:"Xenova/bert-base-uncased"},type:"text"},summarization:{tokenizer:s.AutoTokenizer,pipeline:v,model:o.AutoModelForSeq2SeqLM,default:{model:"Xenova/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:s.AutoTokenizer,pipeline:M,model:o.AutoModelForSeq2SeqLM,default:{model:"Xenova/t5-small"},type:"text"},"text2text-generation":{tokenizer:s.AutoTokenizer,pipeline:E,model:o.AutoModelForSeq2SeqLM,default:{model:"Xenova/flan-t5-small"},type:"text"},"text-generation":{tokenizer:s.AutoTokenizer,pipeline:C,model:o.AutoModelForCausalLM,default:{model:"Xenova/gpt2"},type:"text"},"zero-shot-classification":{tokenizer:s.AutoTokenizer,pipeline:F,model:o.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-mnli"},type:"text"},"audio-classification":{pipeline:q,model:o.AutoModelForAudioClassification,processor:n.AutoProcessor,default:{model:"Xenova/wav2vec2-base-superb-ks"},type:"audio"},"zero-shot-audio-classification":{tokenizer:s.AutoTokenizer,pipeline:R,model:o.AutoModel,processor:n.AutoProcessor,default:{model:"Xenova/clap-htsat-unfused"},type:"multimodal"},"automatic-speech-recognition":{tokenizer:s.AutoTokenizer,pipeline:Z,model:[o.AutoModelForSpeechSeq2Seq,o.AutoModelForCTC],processor:n.AutoProcessor,default:{model:"Xenova/whisper-tiny.en"},type:"multimodal"},"text-to-audio":{tokenizer:s.AutoTokenizer,pipeline:U,model:[o.AutoModelForTextToWaveform,o.AutoModelForTextToSpectrogram],processor:[n.AutoProcessor,null],default:{model:"Xenova/speecht5_tts"},type:"text"},"image-to-text":{tokenizer:s.AutoTokenizer,pipeline:H,model:o.AutoModelForVision2Seq,processor:n.AutoProcessor,default:{model:"Xenova/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:J,model:o.AutoModelForImageClassification,processor:n.AutoProcessor,default:{model:"Xenova/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:Q,model:[o.AutoModelForImageSegmentation,o.AutoModelForSemanticSegmentation,o.AutoModelForUniversalSegmentation],processor:n.AutoProcessor,default:{model:"Xenova/detr-resnet-50-panoptic"},type:"multimodal"},"background-removal":{pipeline:se,model:[o.AutoModelForImageSegmentation,o.AutoModelForSemanticSegmentation,o.AutoModelForUniversalSegmentation],processor:n.AutoProcessor,default:{model:"Xenova/modnet"},type:"image"},"zero-shot-image-classification":{tokenizer:s.AutoTokenizer,pipeline:fe,model:o.AutoModel,processor:n.AutoProcessor,default:{model:"Xenova/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:ae,model:o.AutoModelForObjectDetection,processor:n.AutoProcessor,default:{model:"Xenova/detr-resnet-50"},type:"multimodal"},"zero-shot-object-detection":{tokenizer:s.AutoTokenizer,pipeline:V,model:o.AutoModelForZeroShotObjectDetection,processor:n.AutoProcessor,default:{model:"Xenova/owlvit-base-patch32"},type:"multimodal"},"document-question-answering":{tokenizer:s.AutoTokenizer,pipeline:A,model:o.AutoModelForDocumentQuestionAnswering,processor:n.AutoProcessor,default:{model:"Xenova/donut-base-finetuned-docvqa"},type:"multimodal"},"image-to-image":{pipeline:ee,model:o.AutoModelForImageToImage,processor:n.AutoProcessor,default:{model:"Xenova/swin2SR-classical-sr-x2-64"},type:"image"},"depth-estimation":{pipeline:_e,model:o.AutoModelForDepthEstimation,processor:n.AutoProcessor,default:{model:"Xenova/dpt-large"},type:"image"},"feature-extraction":{tokenizer:s.AutoTokenizer,pipeline:z,model:o.AutoModel,default:{model:"Xenova/all-MiniLM-L6-v2"},type:"text"},"image-feature-extraction":{processor:n.AutoProcessor,pipeline:K,model:[o.AutoModelForImageFeatureExtraction,o.AutoModel],default:{model:"Xenova/vit-base-patch16-224-in21k"},type:"image"}}),ye=Object.freeze({"sentiment-analysis":"text-classification",ner:"token-classification",asr:"automatic-speech-recognition","text-to-speech":"text-to-audio",embeddings:"feature-extraction"});async function ze(pe,W=null,{progress_callback:re=null,config:G=null,cache_dir:be=null,local_files_only:we=!1,revision:Se="main",device:Ce=null,dtype:$e=null,subfolder:Fe="onnx",use_external_data_format:Be=null,model_file_name:He=null,session_options:qe={}}={}){pe=ye[pe]??pe;const ke=le[pe.split("_",1)[0]];if(!ke)throw Error(`Unsupported pipeline: ${pe}. Must be one of [${Object.keys(le)}]`);W||(W=ke.default.model,console.log(`No model specified. Using default model: "${W}".`));const Ve={progress_callback:re,config:G,cache_dir:be,local_files_only:we,revision:Se,device:Ce,dtype:$e,subfolder:Fe,use_external_data_format:Be,model_file_name:He,session_options:qe},Ze=new Map([["tokenizer",ke.tokenizer],["model",ke.model],["processor",ke.processor]]),nt=await Ue(Ze,W,Ve);nt.task=pe,(0,a.dispatchCallback)(re,{status:"ready",task:pe,model:W});const lt=ke.pipeline;return new lt(nt)}async function Ue(pe,W,re){const G=Object.create(null),be=[];for(const[we,Se]of pe.entries()){if(!Se)continue;let Ce;Array.isArray(Se)?Ce=new Promise(async($e,Fe)=>{var He,qe;let Be;for(const ke of Se){if(ke===null){$e(null);return}try{$e(await ke.from_pretrained(W,re));return}catch(Ve){if((He=Ve.message)!=null&&He.includes("Unsupported model type"))Be=Ve;else if((qe=Ve.message)!=null&&qe.includes("Could not locate file"))Be=Ve;else{Fe(Ve);return}}}Fe(Be)}):Ce=Se.from_pretrained(W,re),G[we]=Ce,be.push(Ce)}await Promise.all(be);for(const[we,Se]of Object.entries(G))G[we]=await Se;return G}},"./src/tokenizers.js":(e,r,t)=>{t.r(r),t.d(r,{AlbertTokenizer:()=>Ft,AutoTokenizer:()=>Ds,BartTokenizer:()=>ks,BertTokenizer:()=>vt,BlenderbotSmallTokenizer:()=>Mn,BlenderbotTokenizer:()=>wn,BloomTokenizer:()=>As,CLIPTokenizer:()=>Ts,CamembertTokenizer:()=>ss,CodeGenTokenizer:()=>ls,CodeLlamaTokenizer:()=>Er,CohereTokenizer:()=>yn,ConvBertTokenizer:()=>wr,DebertaTokenizer:()=>rt,DebertaV2Tokenizer:()=>jt,DistilBertTokenizer:()=>Or,ElectraTokenizer:()=>ns,EsmTokenizer:()=>it,FalconTokenizer:()=>Ae,GPT2Tokenizer:()=>Vr,GPTNeoXTokenizer:()=>Je,GemmaTokenizer:()=>os,Grok1Tokenizer:()=>is,HerbertTokenizer:()=>Ht,LlamaTokenizer:()=>Fs,M2M100Tokenizer:()=>cr,MBart50Tokenizer:()=>vs,MBartTokenizer:()=>Qr,MPNetTokenizer:()=>Br,MarianTokenizer:()=>_n,MgpstrTokenizer:()=>vn,MobileBertTokenizer:()=>ht,NllbTokenizer:()=>as,NougatTokenizer:()=>Hs,PreTrainedTokenizer:()=>ve,Qwen2Tokenizer:()=>Nt,RoFormerTokenizer:()=>Jt,RobertaTokenizer:()=>Is,SiglipTokenizer:()=>fn,SpeechT5Tokenizer:()=>Os,SqueezeBertTokenizer:()=>ut,T5Tokenizer:()=>$s,TokenizerModel:()=>K,VitsTokenizer:()=>bn,Wav2Vec2CTCTokenizer:()=>gn,WhisperTokenizer:()=>hr,XLMRobertaTokenizer:()=>xs,XLMTokenizer:()=>ys,is_chinese_char:()=>S});var s=t("./src/utils/generic.js"),o=t("./src/utils/core.js"),n=t("./src/utils/hub.js"),i=t("./src/utils/maths.js"),a=t("./src/utils/tensor.js"),l=t("./src/utils/data-structures.js"),u=t("./node_modules/@huggingface/jinja/dist/index.js"),p=t("./src/models/whisper/common_whisper.js");async function c(de,$){const j=await Promise.all([(0,n.getModelJSON)(de,"tokenizer.json",!0,$),(0,n.getModelJSON)(de,"tokenizer_config.json",!0,$)]);return $.legacy!==null&&(j[1].legacy=$.legacy),j}function d(de,$){const j=[];let X=0;for(const ie of de.matchAll($)){const ce=ie[0];X0&&j.push(ce),X=ie.index+ce.length}return X=19968&&de<=40959||de>=13312&&de<=19903||de>=131072&&de<=173791||de>=173824&&de<=177983||de>=177984&&de<=178207||de>=178208&&de<=183983||de>=63744&&de<=64255||de>=194560&&de<=195103}function E(de,$,j){const X=[];let ie=0;for(;iethis.tokens_to_ids.get(j)??this.unk_token_id)}convert_ids_to_tokens($){return $.map(j=>this.vocab[j]??this.unk_token)}}class q extends K{constructor($){super($),this.tokens_to_ids=f($.vocab),this.unk_token_id=this.tokens_to_ids.get($.unk_token),this.unk_token=$.unk_token,this.max_input_chars_per_word=$.max_input_chars_per_word??100,this.vocab=new Array(this.tokens_to_ids.size);for(const[j,X]of this.tokens_to_ids)this.vocab[X]=j}encode($){const j=[];for(const X of $){const ie=[...X];if(ie.length>this.max_input_chars_per_word){j.push(this.unk_token);continue}let ce=!1,xe=0;const Re=[];for(;xe0&&(Ye=this.config.continuing_subword_prefix+Ye),this.tokens_to_ids.has(Ye)){We=Ye;break}--Qe}if(We===null){ce=!0;break}Re.push(We),xe=Qe}ce?j.push(this.unk_token):j.push(...Re)}return j}}class R extends K{constructor($,j){super($);const X=$.vocab.length;this.vocab=new Array(X),this.scores=new Array(X);for(let ie=0;ie[ie,ce])),this.bos_token=" ",this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=j.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,i.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new l.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes($){const j=$.chars,X=1;let ie=0;for(;ie{const de=[...Array.from({length:94},(ie,ce)=>ce+33),...Array.from({length:12},(ie,ce)=>ce+161),...Array.from({length:82},(ie,ce)=>ce+174)],$=de.slice();let j=0;for(let ie=0;ie<256;++ie)de.includes(ie)||(de.push(ie),$.push(256+j),j+=1);const X=$.map(ie=>String.fromCharCode(ie));return Object.fromEntries(de.map((ie,ce)=>[ie,X[ce]]))})(),H=(0,o.reverseDictionary)(Z);class J extends K{constructor($){super($),this.tokens_to_ids=f($.vocab),this.unk_token_id=this.tokens_to_ids.get($.unk_token),this.unk_token=$.unk_token,this.vocab=new Array(this.tokens_to_ids.size);for(const[X,ie]of this.tokens_to_ids)this.vocab[ie]=X;const j=Array.isArray($.merges[0]);this.merges=j?$.merges:$.merges.map(X=>X.split(" ",2)),this.bpe_ranks=new Map(this.merges.map((X,ie)=>[JSON.stringify(X),ie])),this.end_of_word_suffix=$.end_of_word_suffix,this.continuing_subword_suffix=$.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new l.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe($){if($.length===0)return[];const j=this.cache.get($);if(j!==void 0)return j;const X=Array.from($);this.end_of_word_suffix&&(X[X.length-1]+=this.end_of_word_suffix);let ie=[];if(X.length>1){const ce=new l.PriorityQueue((Qe,We)=>Qe.score`<0x${Re.toString(16).toUpperCase().padStart(2,"0")}>`);xe.every(Re=>this.tokens_to_ids.has(Re))?j.push(...xe):j.push(this.unk_token)}else j.push(this.unk_token)}return j}}class Q extends K{constructor($,j){super($),this.tokens_to_ids=f(j.target_lang?$.vocab[j.target_lang]:$.vocab),this.bos_token=j.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=j.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=j.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=j.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=new Array(this.tokens_to_ids.size);for(const[X,ie]of this.tokens_to_ids)this.vocab[ie]=X}encode($){return $}}class se extends s.Callable{constructor($){super(),this.config=$}static fromConfig($){if($===null)return null;switch($.type){case"BertNormalizer":return new pe($);case"Precompiled":return new Mt($);case"Sequence":return new Ue($);case"Replace":return new fe($);case"NFC":return new V($);case"NFD":return new A($);case"NFKC":return new U($);case"NFKD":return new ee($);case"Strip":return new _e($);case"StripAccents":return new le($);case"Lowercase":return new ye($);case"Prepend":return new ze($);default:throw new Error(`Unknown Normalizer type: ${$.type}`)}}normalize($){throw Error("normalize should be implemented in subclass.")}_call($){return this.normalize($)}}class fe extends se{normalize($){const j=_(this.config.pattern);return j===null?$:$.replaceAll(j,this.config.content)}}class ae extends se{constructor(){super(...arguments);Y(this,"form")}normalize(j){return j=j.normalize(this.form),j}}class V extends ae{constructor(){super(...arguments);Y(this,"form","NFC")}}class A extends ae{constructor(){super(...arguments);Y(this,"form","NFD")}}class U extends ae{constructor(){super(...arguments);Y(this,"form","NFKC")}}class ee extends ae{constructor(){super(...arguments);Y(this,"form","NFKD")}}class _e extends se{normalize($){return this.config.strip_left&&this.config.strip_right?$=$.trim():(this.config.strip_left&&($=$.trimStart()),this.config.strip_right&&($=$.trimEnd())),$}}class le extends se{normalize($){return $=g($),$}}class ye extends se{normalize($){return $=$.toLowerCase(),$}}class ze extends se{normalize($){return $=this.config.prepend+$,$}}class Ue extends se{constructor($){super($),this.normalizers=$.normalizers.map(j=>se.fromConfig(j))}normalize($){return this.normalizers.reduce((j,X)=>X.normalize(j),$)}}class pe extends se{_tokenize_chinese_chars($){const j=[];for(let X=0;X<$.length;++X){const ie=$[X],ce=ie.charCodeAt(0);S(ce)?(j.push(" "),j.push(ie),j.push(" ")):j.push(ie)}return j.join("")}stripAccents($){return $.normalize("NFD").replace(new RegExp("\\p{Mn}","gu"),"")}_is_control($){switch($){case" ":case` -`:case"\r":return!1;default:return new RegExp("^\\p{Cc}|\\p{Cf}|\\p{Co}|\\p{Cs}$","u").test($)}}_clean_text($){const j=[];for(const X of $){const ie=X.charCodeAt(0);ie===0||ie===65533||this._is_control(X)||(/^\s$/.test(X)?j.push(" "):j.push(X))}return j.join("")}normalize($){return this.config.clean_text&&($=this._clean_text($)),this.config.handle_chinese_chars&&($=this._tokenize_chinese_chars($)),this.config.lowercase?($=$.toLowerCase(),this.config.strip_accents!==!1&&($=this.stripAccents($))):this.config.strip_accents&&($=this.stripAccents($)),$}}class W extends s.Callable{static fromConfig($){if($===null)return null;switch($.type){case"BertPreTokenizer":return new re($);case"Sequence":return new rs($);case"Whitespace":return new D($);case"WhitespaceSplit":return new oe($);case"Metaspace":return new gr($);case"ByteLevel":return new G($);case"Split":return new be($);case"Punctuation":return new we($);case"Digits":return new Se($);case"Replace":return new B($);default:throw new Error(`Unknown PreTokenizer type: ${$.type}`)}}pre_tokenize_text($,j){throw Error("pre_tokenize_text should be implemented in subclass.")}pre_tokenize($,j){return(Array.isArray($)?$.map(X=>this.pre_tokenize_text(X,j)):this.pre_tokenize_text($,j)).flat()}_call($,j){return this.pre_tokenize($,j)}}class re extends W{constructor($){super(),this.pattern=new RegExp(`[^\\s${M}]+|[${M}]`,"gu")}pre_tokenize_text($,j){return $.trim().match(this.pattern)||[]}}class G extends W{constructor($){super(),this.config=$,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=new RegExp("'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+","gu"),this.byte_encoder=Z,this.text_encoder=new TextEncoder}pre_tokenize_text($,j){return this.add_prefix_space&&!$.startsWith(" ")&&($=" "+$),(this.use_regex?$.match(this.pattern)||[]:[$]).map(ie=>Array.from(this.text_encoder.encode(ie),ce=>this.byte_encoder[ce]).join(""))}}class be extends W{constructor($){super(),this.config=$,this.pattern=_(this.config.pattern,this.config.invert)}pre_tokenize_text($,j){var X;return this.pattern===null?[]:this.config.invert?$.match(this.pattern)||[]:((X=this.config.behavior)==null?void 0:X.toLowerCase())==="removed"?$.split(this.pattern).filter(ie=>ie):d($,this.pattern)}}class we extends W{constructor($){super(),this.config=$,this.pattern=new RegExp(`[^${M}]+|[${M}]+`,"gu")}pre_tokenize_text($,j){return $.match(this.pattern)||[]}}class Se extends W{constructor($){super(),this.config=$;const j=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=new RegExp(j,"gu")}pre_tokenize_text($,j){return $.match(this.pattern)||[]}}class Ce extends s.Callable{constructor($){super(),this.config=$}static fromConfig($){if($===null)return null;switch($.type){case"TemplateProcessing":return new Be($);case"ByteLevel":return new He($);case"RobertaProcessing":return new Fe($);case"BertProcessing":return new $e($);case"Sequence":return new qe($);default:throw new Error(`Unknown PostProcessor type: ${$.type}`)}}post_process($,...j){throw Error("post_process should be implemented in subclass.")}_call($,...j){return this.post_process($,...j)}}class $e extends Ce{constructor($){super($),this.cls=$.cls[0],this.sep=$.sep[0]}post_process($,j=null,{add_special_tokens:X=!0}={}){X&&($=(0,o.mergeArrays)([this.cls],$,[this.sep]));let ie=new Array($.length).fill(0);if(j!==null){const ce=X&&this instanceof Fe?[this.sep]:[],xe=X?[this.sep]:[];$=(0,o.mergeArrays)($,ce,j,xe),ie=(0,o.mergeArrays)(ie,new Array(j.length+ce.length+xe.length).fill(1))}return{tokens:$,token_type_ids:ie}}}class Fe extends $e{}class Be extends Ce{constructor($){super($),this.single=$.single,this.pair=$.pair}post_process($,j=null,{add_special_tokens:X=!0}={}){const ie=j===null?this.single:this.pair;let ce=[],xe=[];for(const Re of ie)"SpecialToken"in Re?X&&(ce.push(Re.SpecialToken.id),xe.push(Re.SpecialToken.type_id)):"Sequence"in Re&&(Re.Sequence.id==="A"?(ce=(0,o.mergeArrays)(ce,$),xe=(0,o.mergeArrays)(xe,new Array($.length).fill(Re.Sequence.type_id))):Re.Sequence.id==="B"&&(ce=(0,o.mergeArrays)(ce,j),xe=(0,o.mergeArrays)(xe,new Array(j.length).fill(Re.Sequence.type_id))));return{tokens:ce,token_type_ids:xe}}}class He extends Ce{post_process($,j=null){return j&&($=(0,o.mergeArrays)($,j)),{tokens:$}}}class qe extends Ce{constructor($){super($),this.processors=$.processors.map(j=>Ce.fromConfig(j))}post_process($,j=null,X={}){let ie;for(const ce of this.processors)if(ce instanceof He)$=ce.post_process($).tokens,j&&(j=ce.post_process(j).tokens);else{const xe=ce.post_process($,j,X);$=xe.tokens,ie=xe.token_type_ids}return{tokens:$,token_type_ids:ie}}}class ke extends s.Callable{constructor($){super(),this.config=$,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=$.trim_offsets}static fromConfig($){if($===null)return null;switch($.type){case"WordPiece":return new Ge($);case"Metaspace":return new ir($);case"ByteLevel":return new Ie($);case"Replace":return new Ve($);case"ByteFallback":return new Ze($);case"Fuse":return new nt($);case"Strip":return new lt($);case"Sequence":return new St($);case"CTC":return new pt($);case"BPEDecoder":return new Vt($);default:throw new Error(`Unknown Decoder type: ${$.type}`)}}_call($){return this.decode($)}decode($){return this.decode_chain($).join("")}decode_chain($){throw Error("`decode_chain` should be implemented in subclass.")}}class Ve extends ke{decode_chain($){const j=_(this.config.pattern);return j===null?$:$.map(X=>X.replaceAll(j,this.config.content))}}class Ze extends ke{constructor($){super($),this.text_decoder=new TextDecoder}decode_chain($){const j=[];let X=[];for(const ie of $){let ce=null;if(ie.length===6&&ie.startsWith("<0x")&&ie.endsWith(">")){const xe=parseInt(ie.slice(3,5),16);isNaN(xe)||(ce=xe)}if(ce!==null)X.push(ce);else{if(X.length>0){const xe=this.text_decoder.decode(Uint8Array.from(X));j.push(xe),X=[]}j.push(ie)}}if(X.length>0){const ie=this.text_decoder.decode(Uint8Array.from(X));j.push(ie),X=[]}return j}}class nt extends ke{decode_chain($){return[$.join("")]}}class lt extends ke{constructor($){super($),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain($){return $.map(j=>{let X=0;for(let ce=0;ce(X!==0&&(j.startsWith(this.config.prefix)?j=j.replace(this.config.prefix,""):j=" "+j),this.cleanup&&(j=k(j)),j))}}class Ie extends ke{constructor($){super($),this.byte_decoder=H,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string($){const j=$.join(""),X=new Uint8Array([...j].map(ce=>this.byte_decoder[ce]));return this.text_decoder.decode(X)}decode_chain($){const j=[];let X=[];for(const ie of $)this.added_tokens.find(ce=>ce.content===ie)!==void 0?(X.length>0&&(j.push(this.convert_tokens_to_string(X)),X=[]),j.push(ie)):X.push(ie);return X.length>0&&j.push(this.convert_tokens_to_string(X)),j}}class pt extends ke{constructor($){super($),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string($){if($.length===0)return"";const j=[$[0]];for(let ce=1;ce<$.length;++ce)$[ce]!==j.at(-1)&&j.push($[ce]);let ie=j.filter(ce=>ce!==this.pad_token).join("");return this.cleanup&&(ie=k(ie).replaceAll(this.word_delimiter_token," ").trim()),ie}decode_chain($){return[this.convert_tokens_to_string($)]}}class St extends ke{constructor($){super($),this.decoders=$.decoders.map(j=>ke.fromConfig(j))}decode_chain($){return this.decoders.reduce((j,X)=>X.decode_chain(j),$)}}class Vt extends ke{constructor($){super($),this.suffix=this.config.suffix}decode_chain($){return $.map((j,X)=>j.replaceAll(this.suffix,X===$.length-1?"":" "))}}class Rt extends ke{decode_chain($){let j="";for(let X=1;X<$.length;X+=2)j+=$[X];return[j]}}class gr extends W{constructor($){super(),this.addPrefixSpace=$.add_prefix_space,this.replacement=$.replacement,this.strRep=$.str_rep||this.replacement,this.prepend_scheme=$.prepend_scheme??"always"}pre_tokenize_text($,{section_index:j=void 0}={}){let X=$.replaceAll(" ",this.strRep);return this.addPrefixSpace&&!X.startsWith(this.replacement)&&(this.prepend_scheme==="always"||this.prepend_scheme==="first"&&j===0)&&(X=this.strRep+X),[X]}}class ir extends ke{constructor($){super($),this.addPrefixSpace=$.add_prefix_space,this.replacement=$.replacement}decode_chain($){const j=[];for(let X=0;X<$.length;++X){let ie=$[X].replaceAll(this.replacement," ");this.addPrefixSpace&&X==0&&ie.startsWith(" ")&&(ie=ie.substring(1)),j.push(ie)}return j}}class Mt extends se{constructor($){super($),this.charsmap=$.precompiled_charsmap}normalize($){return $=$.replace(/[\u0001-\u0008\u000B\u000E-\u001F\u007F\u008F\u009F]/gm,""),$=$.replace(/[\u0009\u000A\u000C\u000D\u00A0\u1680\u2000-\u200F\u2028\u2029\u202F\u205F\u2581\u3000\uFEFF\uFFFD]/gm," "),$.includes("~")?$=$.split("~").map(X=>X.normalize("NFKC")).join("~"):$=$.normalize("NFKC"),$}}class rs extends W{constructor($){super(),this.tokenizers=$.pretokenizers.map(j=>W.fromConfig(j))}pre_tokenize_text($,j){return this.tokenizers.reduce((X,ie)=>ie.pre_tokenize(X,j),[$])}}class D extends W{constructor($){super()}pre_tokenize_text($,j){return $.match(/\w+|[^\w\s]+/g)||[]}}class oe extends W{constructor($){super()}pre_tokenize_text($,j){return v($)}}class B extends W{constructor($){super(),this.config=$,this.pattern=_(this.config.pattern),this.content=this.config.content}pre_tokenize_text($,j){return this.pattern===null?[$]:[$.replaceAll(this.pattern,this.config.content)]}}const te=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];function me(de,$,j,X){for(const ie of Object.keys(de)){const ce=$-de[ie].length,xe=j(ie),Re=new Array(ce).fill(xe);de[ie]=X==="right"?(0,o.mergeArrays)(de[ie],Re):(0,o.mergeArrays)(Re,de[ie])}}function Oe(de,$){for(const j of Object.keys(de))de[j].length=$}class ve extends s.Callable{constructor(j,X){super();Y(this,"return_token_type_ids",!1);Y(this,"padding_side","right");this._tokenizer_config=X,this.normalizer=se.fromConfig(j.normalizer),this.pre_tokenizer=W.fromConfig(j.pre_tokenizer),this.model=K.fromConfig(j.model,X),this.post_processor=Ce.fromConfig(j.post_processor),this.decoder=ke.fromConfig(j.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(const ie of j.added_tokens){const ce=new z(ie);this.added_tokens.push(ce),this.model.tokens_to_ids.set(ce.content,ce.id),this.model.vocab[ce.id]=ce.content,ce.special&&(this.special_tokens.push(ce.content),this.all_special_ids.push(ce.id))}if(this.additional_special_tokens=X.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_splitter=new l.DictionarySplitter(this.added_tokens.map(ie=>ie.content)),this.added_tokens_map=new Map(this.added_tokens.map(ie=>[ie.content,ie])),this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken("bos_token"),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken("eos_token"),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=X.model_max_length,this.remove_space=X.remove_space,this.clean_up_tokenization_spaces=X.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=X.do_lowercase_and_remove_accent??!1,X.padding_side&&(this.padding_side=X.padding_side),this.legacy=!1,this.chat_template=X.chat_template??null,Array.isArray(this.chat_template)){const ie=Object.create(null);for(const{name:ce,template:xe}of this.chat_template){if(typeof ce!="string"||typeof xe!="string")throw new Error('Chat template must be a list of objects with "name" and "template" properties');ie[ce]=xe}this.chat_template=ie}this._compiled_template_cache=new Map}getToken(...j){for(const X of j){const ie=this._tokenizer_config[X];if(ie)if(typeof ie=="object"){if(ie.__type==="AddedToken")return ie.content;throw Error(`Unknown token: ${ie}`)}else return ie}return null}static async from_pretrained(j,{progress_callback:X=null,config:ie=null,cache_dir:ce=null,local_files_only:xe=!1,revision:Re="main",legacy:Qe=null}={}){const We=await c(j,{progress_callback:X,config:ie,cache_dir:ce,local_files_only:xe,revision:Re,legacy:Qe});return new this(...We)}_call(j,{text_pair:X=null,add_special_tokens:ie=!0,padding:ce=!1,truncation:xe=null,max_length:Re=null,return_tensor:Qe=!0,return_token_type_ids:We=null}={}){const Ye=Array.isArray(j);let _t;if(Ye){if(j.length===0)throw Error("text array must be non-empty");if(X!==null){if(Array.isArray(X)){if(j.length!==X.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");_t=j.map((At,Yt)=>this._encode_plus(At,{text_pair:X[Yt],add_special_tokens:ie,return_token_type_ids:We}))}else _t=j.map(At=>this._encode_plus(At,{add_special_tokens:ie,return_token_type_ids:We}))}else{if(j==null)throw Error("text may not be null or undefined");if(Array.isArray(X))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");_t=[this._encode_plus(j,{text_pair:X,add_special_tokens:ie,return_token_type_ids:We})]}if(Re===null?Re=this.model_max_length:xe===null&&(ce===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),Re=this.model_max_length):ce===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),xe=!0)),ce===!0&&(Re=Math.min((0,i.max)(_t.map(At=>At.input_ids.length))[0],Re??1/0)),Re=Math.min(Re,this.model_max_length??1/0),ce||xe)for(let At=0;At<_t.length;++At)_t[At].input_ids.length!==Re&&(_t[At].input_ids.length>Re?xe&&Oe(_t[At],Re):ce&&me(_t[At],Re,Yt=>Yt==="input_ids"?this.pad_token_id:0,this.padding_side));const Ot={};if(Qe){if(!(ce&&xe)&&_t.some(Yt=>{var Ut;for(const mr of Object.keys(Yt))if(Yt[mr].length!==((Ut=_t[0][mr])==null?void 0:Ut.length))return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");const At=[_t.length,_t[0].input_ids.length];for(const Yt of Object.keys(_t[0]))Ot[Yt]=new a.Tensor("int64",BigInt64Array.from(_t.flatMap(Ut=>Ut[Yt]).map(BigInt)),At)}else{for(const At of Object.keys(_t[0]))Ot[At]=_t.map(Yt=>Yt[At]);if(!Ye)for(const At of Object.keys(Ot))Ot[At]=Ot[At][0]}return Ot}_encode_text(j){if(j===null)return null;const X=this.added_tokens_splitter.split(j);for(let ce=0;ce0&&(X[ce-1]=X[ce-1].trimEnd()),xe.rstrip&&ce{if(ce.length===0)return[];if(this.added_tokens_map.has(ce))return[ce];if(this.remove_space===!0&&(ce=ce.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(ce=w(ce)),this.normalizer!==null&&(ce=this.normalizer(ce)),ce.length===0)return[];const Re=this.pre_tokenizer!==null?this.pre_tokenizer(ce,{section_index:xe}):[ce];return this.model(Re)})}_encode_plus(j,{text_pair:X=null,add_special_tokens:ie=!0,return_token_type_ids:ce=null}={}){const{tokens:xe,token_type_ids:Re}=this._tokenize_helper(j,{pair:X,add_special_tokens:ie}),Qe=this.model.convert_tokens_to_ids(xe),We={input_ids:Qe,attention_mask:new Array(Qe.length).fill(1)};return(ce??this.return_token_type_ids)&&Re&&(We.token_type_ids=Re),We}_tokenize_helper(j,{pair:X=null,add_special_tokens:ie=!1}={}){const ce=this._encode_text(j),xe=this._encode_text(X);return this.post_processor?this.post_processor(ce,xe,{add_special_tokens:ie}):{tokens:(0,o.mergeArrays)(ce??[],xe??[])}}tokenize(j,{pair:X=null,add_special_tokens:ie=!1}={}){return this._tokenize_helper(j,{pair:X,add_special_tokens:ie}).tokens}encode(j,{text_pair:X=null,add_special_tokens:ie=!0,return_token_type_ids:ce=null}={}){return this._encode_plus(j,{text_pair:X,add_special_tokens:ie,return_token_type_ids:ce}).input_ids}batch_decode(j,X={}){return j instanceof a.Tensor&&(j=j.tolist()),j.map(ie=>this.decode(ie,X))}decode(j,X={}){if(j instanceof a.Tensor&&(j=T(j)),!Array.isArray(j)||j.length===0||!(0,o.isIntegralNumber)(j[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(j,X)}decode_single(j,{skip_special_tokens:X=!1,clean_up_tokenization_spaces:ie=null}){let ce=this.model.convert_ids_to_tokens(j);X&&(ce=ce.filter(Re=>!this.special_tokens.includes(Re)));let xe=this.decoder?this.decoder(ce):ce.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(xe=xe.replaceAll(this.decoder.end_of_word_suffix," "),X&&(xe=xe.trim())),(ie??this.clean_up_tokenization_spaces)&&(xe=k(xe)),xe}get_chat_template({chat_template:j=null,tools:X=null}={}){if(this.chat_template&&typeof this.chat_template=="object"){const ie=this.chat_template;if(j!==null&&Object.hasOwn(ie,j))j=ie[j];else if(j===null)if(X!==null&&"tool_use"in ie)j=ie.tool_use;else if("default"in ie)j=ie.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(ie).sort()}.`)}else if(j===null)if(this.chat_template)j=this.chat_template;else throw Error("Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating");return j}apply_chat_template(j,{tools:X=null,documents:ie=null,chat_template:ce=null,add_generation_prompt:xe=!1,tokenize:Re=!0,padding:Qe=!1,truncation:We=!1,max_length:Ye=null,return_tensor:_t=!0,return_dict:Ot=!1,tokenizer_kwargs:At={},...Yt}={}){if(ce=this.get_chat_template({chat_template:ce,tools:X}),typeof ce!="string")throw Error(`chat_template must be a string, but got ${typeof ce}`);let Ut=this._compiled_template_cache.get(ce);Ut===void 0&&(Ut=new u.Template(ce),this._compiled_template_cache.set(ce,Ut));const mr=Object.create(null);for(const Pr of te){const Cr=this.getToken(Pr);Cr&&(mr[Pr]=Cr)}const Mr=Ut.render({messages:j,add_generation_prompt:xe,tools:X,documents:ie,...mr,...Yt});if(Re){const Pr=this._call(Mr,{add_special_tokens:!1,padding:Qe,truncation:We,max_length:Ye,return_tensor:_t,...At});return Ot?Pr:Pr.input_ids}return Mr}}class vt extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Ft extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class ht extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class ut extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class rt extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class jt extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Ht extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class wr extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Jt extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class Or extends ve{}class ss extends ve{}class ys extends ve{constructor(j,X){super(j,X);Y(this,"return_token_type_ids",!0);console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class ns extends ve{constructor(){super(...arguments);Y(this,"return_token_type_ids",!0)}}class $s extends ve{}class Vr extends ve{}class ks extends ve{}class Qr extends ve{constructor($,j){super($,j),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(X=>this.languageRegex.test(X)),this.lang_to_token=X=>X}_build_translation_inputs($,j,X){return ur(this,$,j,X)}}class vs extends Qr{}class Is extends ve{}class As extends ve{}const ar="▁";class Fs extends ve{constructor(j,X){super(j,X);Y(this,"padding_side","left");this.legacy=X.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new gr({replacement:ar,add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(j){if(j===null)return null;if(this.legacy||j.length===0)return super._encode_text(j);let X=super._encode_text(ar+j.replaceAll(ar," "));return X.length>1&&X[0]===ar&&this.special_tokens.includes(X[1])&&(X=X.slice(1)),X}}class Er extends ve{}class xs extends ve{}class Br extends ve{}class Ae extends ve{}class Je extends ve{}class it extends ve{}class Nt extends ve{}class os extends ve{}class is extends ve{}function ur(de,$,j,X){if(!("language_codes"in de)||!Array.isArray(de.language_codes))throw new Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in de)||!(de.languageRegex instanceof RegExp))throw new Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in de)||typeof de.lang_to_token!="function")throw new Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");const ie=X.src_lang,ce=X.tgt_lang;if(!de.language_codes.includes(ce))throw new Error(`Target language code "${ce}" is not valid. Must be one of: {${de.language_codes.join(", ")}}`);if(ie!==void 0){if(!de.language_codes.includes(ie))throw new Error(`Source language code "${ie}" is not valid. Must be one of: {${de.language_codes.join(", ")}}`);for(const xe of de.post_processor.config.single)if("SpecialToken"in xe&&de.languageRegex.test(xe.SpecialToken.id)){xe.SpecialToken.id=de.lang_to_token(ie);break}}return X.forced_bos_token_id=de.model.convert_tokens_to_ids([de.lang_to_token(ce)])[0],de._call($,j)}class as extends ve{constructor($,j){super($,j),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(X=>this.languageRegex.test(X)),this.lang_to_token=X=>X}_build_translation_inputs($,j,X){return ur(this,$,j,X)}}class cr extends ve{constructor($,j){super($,j),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(X=>this.languageRegex.test(X)).map(X=>X.slice(2,-2)),this.lang_to_token=X=>`__${X}__`}_build_translation_inputs($,j,X){return ur(this,$,j,X)}}class hr extends ve{get timestamp_begin(){return this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1}_decode_asr($,{return_timestamps:j=!1,return_language:X=!1,time_precision:ie=null,force_full_sequences:ce=!0}={}){if(ie===null)throw Error("Must specify time_precision");let xe=null;const Re=j==="word";function Qe(){return{language:xe,timestamp:[null,null],text:""}}const We=[];let Ye=Qe(),_t=0;const Ot=this.timestamp_begin,Yt=Ot+1500;let Ut=[],mr=[],Mr=!1,Pr=null;const Cr=new Set(this.all_special_ids);for(const Kt of $){const fr=Kt.tokens,Dr=Re?Kt.token_timestamps:null;let Xr=null,Jr=Ot;if("stride"in Kt){const[br,er,dr]=Kt.stride;if(_t-=er,Pr=br-dr,er&&(Jr=er/ie+Ot),dr)for(let pr=fr.length-1;pr>=0;--pr){const Ar=Number(fr[pr]);if(Ar>=Ot){if(Xr!==null&&(Ar-Ot)*ie=Ot&&er<=Yt){const dr=(er-Ot)*ie+_t,pr=(0,i.round)(dr,2);if(Xr!==null&&er>=Xr)Mr=!0;else if(Mr||Ut.length>0&&er0?(Ut.push(Ir),Re&&mr.push(Lr)):Ut.every(br=>br.length===0)&&(Ye=Qe(),Ut=[],Ir=[],mr=[],Lr=[])}if(Ut.length>0){if(ce&&j)throw new Error("Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.");const[Kt,fr]=this.findLongestCommonSequence(Ut,mr),Dr=this.decode(Kt);Ye.text=Dr,Re&&(Ye.words=this.collateWordTimestamps(Kt,fr,xe)),We.push(Ye)}let Zt=Object.create(null);const Es=We.map(Kt=>Kt.text).join("");if(j||X){for(let Kt=0;Kt0;let Re=xe?[]:null,Qe=xe?j[0]:null;for(let We=1;We<$.length;++We){const Ye=$[We];let _t=0,Ot=[ie,ie,0,0];const At=Ye.length;for(let Zt=1;Zter===Jr[dr]&&Qe[Es+dr]<=j[We][Dr+dr]).length:Ir=fr.filter((er,dr)=>er===Jr[dr]).length;const Lr=Zt/1e4,br=Ir/Zt+Lr;Ir>1&&br>_t&&(_t=br,Ot=[Es,Kt,Dr,Xr])}const[Yt,Ut,mr,Mr]=Ot,Pr=Math.floor((Ut+Yt)/2),Cr=Math.floor((Mr+mr)/2);ce.push(...X.slice(0,Pr)),X=Ye.slice(Cr),ie=X.length,xe&&(Re.push(...Qe.slice(0,Pr)),Qe=j[We].slice(Cr))}return ce.push(...X),xe?(Re.push(...Qe),[ce,Re]):[ce,[]]}collateWordTimestamps($,j,X){const[ie,ce,xe]=this.combineTokensIntoWords($,X),Re=[];for(let Qe=0;Qe=ie){const Re=((xe-ie)*X).toFixed(2);ce.push(`<|${Re}|>`),ce.push([])}else ce[ce.length-1].push(xe);return ce=ce.map(xe=>typeof xe=="string"?xe:super.decode(xe,j)),ce.join("")}splitTokensOnUnicode($){const j=this.decode($,{decode_with_timestamps:!0}),X="�",ie=[],ce=[],xe=[];let Re=[],Qe=[],We=0;for(let Ye=0;Ye<$.length;++Ye){const _t=$[Ye];Re.push(_t),Qe.push(Ye);const Ot=this.decode(Re,{decode_with_timestamps:!0});(!Ot.includes(X)||j[We+Ot.indexOf(X)]===X)&&(ie.push(Ot),ce.push(Re),xe.push(Qe),Re=[],Qe=[],We+=Ot.length)}return[ie,ce,xe]}splitTokensOnSpaces($){const[j,X,ie]=this.splitTokensOnUnicode($),ce=[],xe=[],Re=[],Qe=new RegExp(`^[${M}]$`,"gu");for(let We=0;We=this.model.tokens_to_ids.get("<|endoftext|>"),Yt=Ye.startsWith(" "),Ut=Ye.trim(),mr=Qe.test(Ut);if(At||Yt||mr||ce.length===0)ce.push(Ye),xe.push(_t),Re.push(Ot);else{const Mr=ce.length-1;ce[Mr]+=Ye,xe[Mr].push(..._t),Re[Mr].push(...Ot)}}return[ce,xe,Re]}mergePunctuations($,j,X,ie,ce){const xe=structuredClone($),Re=structuredClone(j),Qe=structuredClone(X);let We=xe.length-2,Ye=xe.length-1;for(;We>=0;)xe[We].startsWith(" ")&&ie.includes(xe[We].trim())?(xe[Ye]=xe[We]+xe[Ye],Re[Ye]=(0,o.mergeArrays)(Re[We],Re[Ye]),Qe[Ye]=(0,o.mergeArrays)(Qe[We],Qe[Ye]),xe[We]="",Re[We]=[],Qe[We]=[]):Ye=We,--We;for(We=0,Ye=1;Ye_t),Re.filter(_t=>_t.length>0),Qe.filter(_t=>_t.length>0)]}}class ls extends ve{}class Ts extends ve{}class fn extends ve{}class _n extends ve{constructor($,j){super($,j),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(X=>this.languageRegex.test(X)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text($){if($===null)return null;const[j,...X]=$.trim().split(this.languageRegex);if(X.length===0)return super._encode_text(j);if(X.length===2){const[ie,ce]=X;return this.supported_language_codes.includes(ie)||console.warn(`Unsupported language code "${ie}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,o.mergeArrays)([ie],super._encode_text(ce))}}}class gn extends ve{}class wn extends ve{}class Mn extends ve{}class Os extends ve{}class Hs extends ve{}class bn extends ve{constructor($,j){super($,j),this.decoder=new Rt({})}}class yn extends ve{}class vn extends ve{}class Ds{static async from_pretrained($,{progress_callback:j=null,config:X=null,cache_dir:ie=null,local_files_only:ce=!1,revision:xe="main",legacy:Re=null}={}){var Ot;const[Qe,We]=await c($,{progress_callback:j,config:X,cache_dir:ie,local_files_only:ce,revision:xe,legacy:Re}),Ye=((Ot=We.tokenizer_class)==null?void 0:Ot.replace(/Fast$/,""))??"PreTrainedTokenizer";let _t=this.TOKENIZER_CLASS_MAPPING[Ye];return _t||(console.warn(`Unknown tokenizer class "${Ye}", attempting to construct from base class.`),_t=ve),new _t(Qe,We)}}Y(Ds,"TOKENIZER_CLASS_MAPPING",{T5Tokenizer:$s,DistilBertTokenizer:Or,CamembertTokenizer:ss,DebertaTokenizer:rt,DebertaV2Tokenizer:jt,BertTokenizer:vt,HerbertTokenizer:Ht,ConvBertTokenizer:wr,RoFormerTokenizer:Jt,XLMTokenizer:ys,ElectraTokenizer:ns,MobileBertTokenizer:ht,SqueezeBertTokenizer:ut,AlbertTokenizer:Ft,GPT2Tokenizer:Vr,BartTokenizer:ks,MBartTokenizer:Qr,MBart50Tokenizer:vs,RobertaTokenizer:Is,WhisperTokenizer:hr,CodeGenTokenizer:ls,CLIPTokenizer:Ts,SiglipTokenizer:fn,MarianTokenizer:_n,BloomTokenizer:As,NllbTokenizer:as,M2M100Tokenizer:cr,LlamaTokenizer:Fs,CodeLlamaTokenizer:Er,XLMRobertaTokenizer:xs,MPNetTokenizer:Br,FalconTokenizer:Ae,GPTNeoXTokenizer:Je,EsmTokenizer:it,Wav2Vec2CTCTokenizer:gn,BlenderbotTokenizer:wn,BlenderbotSmallTokenizer:Mn,SpeechT5Tokenizer:Os,NougatTokenizer:Hs,VitsTokenizer:bn,Qwen2Tokenizer:Nt,GemmaTokenizer:os,Grok1Tokenizer:is,CohereTokenizer:yn,MgpstrTokenizer:vn,PreTrainedTokenizer:ve})},"./src/utils/audio.js":(e,r,t)=>{t.r(r),t.d(r,{RawAudio:()=>q,hamming:()=>d,hanning:()=>c,mel_filter_bank:()=>S,read_audio:()=>u,spectrogram:()=>C,window_function:()=>F});var s=t("./src/utils/hub.js"),o=t("./src/utils/maths.js"),n=t("./src/utils/core.js"),i=t("./src/env.js"),a=t("?7a2c"),l=t("./src/utils/tensor.js");async function u(R,Z){if(typeof AudioContext>"u")throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");const H=await(await(0,s.getFile)(R)).arrayBuffer(),J=new AudioContext({sampleRate:Z});typeof Z>"u"&&console.warn(`No sampling rate provided, using default of ${J.sampleRate}Hz.`);const Q=await J.decodeAudioData(H);let se;if(Q.numberOfChannels===2){const fe=Math.sqrt(2),ae=Q.getChannelData(0),V=Q.getChannelData(1);se=new Float32Array(ae.length);for(let A=0;A2595*Math.log10(1+R/700),kaldi:R=>1127*Math.log(1+R/700),slaney:(R,Z=1e3,H=15,J=27/Math.log(6.4))=>R>=Z?H+Math.log(R/Z)*J:3*R/200};function f(R,Z="htk"){const H=_[Z];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof R=="number"?H(R):R.map(J=>H(J))}const T={htk:R=>700*(10**(R/2595)-1),kaldi:R=>700*(Math.exp(R/1127)-1),slaney:(R,Z=1e3,H=15,J=Math.log(6.4)/27)=>R>=H?Z*Math.exp(J*(R-H)):200*R/3};function k(R,Z="htk"){const H=T[Z];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof R=="number"?H(R):R.map(J=>H(J))}function g(R,Z){const H=Float64Array.from({length:Z.length-1},(fe,ae)=>Z[ae+1]-Z[ae]),J=Array.from({length:R.length},()=>new Array(Z.length));for(let fe=0;fenew Array(R.length));for(let fe=0;feR+J*se)}function S(R,Z,H,J,Q,se=null,fe="htk",ae=!1){if(se!==null&&se!=="slaney")throw new Error('norm must be one of null or "slaney"');if(R<2)throw new Error(`Require num_frequency_bins: ${R} >= 2`);if(H>J)throw new Error(`Require min_frequency: ${H} <= max_frequency: ${J}`);const V=f(H,fe),A=f(J,fe),U=w(V,A,Z+2);let ee=k(U,fe),_e;if(ae){const ye=Q/((R-1)*2);_e=f(Float64Array.from({length:R},(ze,Ue)=>Ue*ye),fe),ee=U}else _e=w(0,Math.floor(Q/2),R);const le=g(_e,ee);if(se!==null&&se==="slaney")for(let ye=0;yeQ)throw Error(`frame_length (${H}) may not be larger than fft_length (${Q})`);if(be!==H)throw new Error(`Length of the window (${be}) must equal frame_length (${H})`);if(J<=0)throw new Error("hop_length must be greater than zero");if(se===null&&U!==null)throw new Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(fe){if(ae!=="reflect")throw new Error(`pad_mode="${ae}" not implemented yet.`);const nt=Math.floor((Q-1)/2)+1;R=E(R,nt,nt)}let we=Math.floor(1+Math.floor((R.length-H)/J));pe!==null&&wewe?re&&($e=W):$e=Ce=W);const Fe=new o.FFT(Q),Be=new Float64Array(Q),He=new Float64Array(Fe.outputBufferSize),qe=new Float32Array(Se*$e);for(let nt=0;nt=1;--Ie)Be[Ie]-=A*Be[Ie-1];Be[0]*=1-A}for(let Ie=0;IeMath.pow(ae,.85));break;default:throw new Error(`Unknown window type ${Z}.`)}if(H&&(fe=fe.subarray(0,R)),J===null)return fe;if(R>J)throw new Error(`Length of the window (${R}) may not be larger than frame_length (${J})`);return fe}function z(R,Z){let H=44;const J=new ArrayBuffer(H+R.length*4),Q=new DataView(J);K(Q,0,"RIFF"),Q.setUint32(4,36+R.length*4,!0),K(Q,8,"WAVE"),K(Q,12,"fmt "),Q.setUint32(16,16,!0),Q.setUint16(20,3,!0),Q.setUint16(22,1,!0),Q.setUint32(24,Z,!0),Q.setUint32(28,Z*4,!0),Q.setUint16(32,4,!0),Q.setUint16(34,32,!0),K(Q,36,"data"),Q.setUint32(40,R.length*4,!0);for(let se=0;se{let se=await Q.arrayBuffer();a.writeFileSync(J,Buffer.from(se))};else throw new Error("Unable to save because filesystem is disabled in this environment.");await H(Z,this.toBlob())}}},"./src/utils/constants.js":(e,r,t)=>{t.r(r),t.d(r,{CHAT_TEMPLATE_NAME:()=>l,CONFIG_NAME:()=>o,FEATURE_EXTRACTOR_NAME:()=>n,GENERATION_CONFIG_NAME:()=>u,GITHUB_ISSUE_URL:()=>s,IMAGE_PROCESSOR_NAME:()=>i,PROCESSOR_NAME:()=>a});const s="https://github.com/huggingface/transformers.js/issues/new/choose",o="config.json",n="preprocessor_config.json",i=n,a="processor_config.json",l="chat_template.json",u="generation_config.json"},"./src/utils/core.js":(e,r,t)=>{t.r(r),t.d(r,{calculateDimensions:()=>u,calculateReflectOffset:()=>_,count:()=>g,dispatchCallback:()=>s,escapeRegExp:()=>n,isIntegralNumber:()=>a,isNullishDimension:()=>l,isTypedArray:()=>i,len:()=>k,mergeArrays:()=>c,pick:()=>T,pop:()=>p,product:()=>d,reverseDictionary:()=>o,saveBlob:()=>f});function s(w,S){w&&w(S)}function o(w){return Object.fromEntries(Object.entries(w).map(([S,E])=>[E,S]))}function n(w){return w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i(w){var S,E,v;return((v=(E=(S=w==null?void 0:w.prototype)==null?void 0:S.__proto__)==null?void 0:E.constructor)==null?void 0:v.name)==="TypedArray"}function a(w){return Number.isInteger(w)||typeof w=="bigint"}function l(w){return w==null||w===-1}function u(w){const S=[];let E=w;for(;Array.isArray(E);)S.push(E.length),E=E[0];return S}function p(w,S,E=void 0){const v=w[S];if(v!==void 0)return delete w[S],v;if(E===void 0)throw Error(`Key ${S} does not exist in object.`);return E}function c(...w){return Array.prototype.concat.apply([],w)}function d(...w){return w.reduce((S,E)=>S.flatMap(v=>E.map(M=>[v,M])))}function _(w,S){return Math.abs((w+S)%(2*S)-S)}function f(w,S){const E=URL.createObjectURL(S),v=document.createElement("a");v.href=E,v.download=w,v.click(),v.remove(),URL.revokeObjectURL(E)}function T(w,S){return Object.assign({},...S.map(E=>{if(w[E]!==void 0)return{[E]:w[E]}}))}function k(w){let S=0;for(const E of w)++S;return S}function g(w,S){let E=0;for(const v of w)v===S&&++E;return E}},"./src/utils/data-structures.js":(e,r,t)=>{t.r(r),t.d(r,{CharTrie:()=>o,DictionarySplitter:()=>l,LRUCache:()=>u,PriorityQueue:()=>s,TokenLattice:()=>i});class s{constructor(c=(_,f)=>_>f,d=1/0){this._heap=[],this._comparator=c,this._maxSize=d}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...c){return this.extend(c)}extend(c){for(const d of c)if(this.size0&&this._swap(0,d),this._heap.pop(),this._siftDown(),c}replace(c){const d=this.peek();return this._heap[0]=c,this._siftDown(),d}_parent(c){return(c+1>>>1)-1}_left(c){return(c<<1)+1}_right(c){return c+1<<1}_greater(c,d){return this._comparator(this._heap[c],this._heap[d])}_swap(c,d){const _=this._heap[c];this._heap[c]=this._heap[d],this._heap[d]=_}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(c){for(;c>0&&this._greater(c,this._parent(c));)this._swap(c,this._parent(c)),c=this._parent(c)}_siftDown(){let c=0;for(;this._left(c)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);const f=new a(this.bosTokenId,0,0,0,0),T=new a(this.eosTokenId,1,this.len,0,0);this.nodes.push(f.clone()),this.nodes.push(T.clone()),this.beginNodes[this.len].push(T),this.endNodes[0].push(f)}insert(c,d,_,f){const T=this.nodes.length,k=new a(f,T,c,d,_);this.beginNodes[c].push(k),this.endNodes[c+d].push(k),this.nodes.push(k)}viterbi(){const c=this.len;let d=0;for(;d<=c;){if(this.beginNodes[d].length==0)return[];for(let g of this.beginNodes[d]){g.prev=null;let w=0,S=null;for(let E of this.endNodes[d]){const v=E.backtraceScore+g.score;(S===null||v>w)&&(S=E.clone(),w=v)}if(S!==null)g.prev=S,g.backtraceScore=w;else return[]}++d}const _=[],T=this.beginNodes[c][0].prev;if(T===null)return[];let k=T.clone();for(;k.prev!==null;)_.push(k.clone()),k=k.clone().prev.clone();return _.reverse(),_}piece(c){return this.chars.slice(c.pos,c.pos+c.length).join("")}tokens(){return this.viterbi().map(d=>this.piece(d))}tokenIds(){return this.viterbi().map(d=>d.tokenId)}}class a{constructor(c,d,_,f,T){this.tokenId=c,this.nodeId=d,this.pos=_,this.length=f,this.score=T,this.prev=null,this.backtraceScore=0}clone(){const c=new a(this.tokenId,this.nodeId,this.pos,this.length,this.score);return c.prev=this.prev,c.backtraceScore=this.backtraceScore,c}}class l{constructor(c){this.trie=this._buildTrie(c)}_buildTrie(c){var _;const d=Object.create(null);for(const f of c){let T=d;for(let k=0;kf&&d.push(c.slice(f,T)),d.push(g),T+=g.length,f=T):++T}return f<_&&d.push(c.slice(f)),d}}class u{constructor(c){this.capacity=c,this.cache=new Map}get(c){if(!this.cache.has(c))return;const d=this.cache.get(c);return this.cache.delete(c),this.cache.set(c,d),d}put(c,d){this.cache.has(c)&&this.cache.delete(c),this.cache.set(c,d),this.cache.size>this.capacity&&this.cache.delete(this.cache.keys().next().value)}clear(){this.cache.clear()}}},"./src/utils/devices.js":(e,r,t)=>{t.r(r),t.d(r,{DEVICE_TYPES:()=>s});const s=Object.freeze({auto:"auto",gpu:"gpu",cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:"webnn","webnn-npu":"webnn-npu","webnn-gpu":"webnn-gpu","webnn-cpu":"webnn-cpu"})},"./src/utils/dtypes.js":(e,r,t)=>{t.r(r),t.d(r,{DATA_TYPES:()=>i,DEFAULT_DEVICE_DTYPE_MAPPING:()=>a,DEFAULT_DTYPE_SUFFIX_MAPPING:()=>l,isWebGpuFp16Supported:()=>n});var s=t("./src/env.js"),o=t("./src/utils/devices.js");const n=function(){let u;return async function(){if(u===void 0)if(!s.apis.IS_WEBGPU_AVAILABLE)u=!1;else try{u=(await navigator.gpu.requestAdapter()).features.has("shader-f16")}catch{u=!1}return u}}(),i=Object.freeze({auto:"auto",fp32:"fp32",fp16:"fp16",q8:"q8",int8:"int8",uint8:"uint8",q4:"q4",bnb4:"bnb4",q4f16:"q4f16"}),a=Object.freeze({[o.DEVICE_TYPES.wasm]:i.q8}),l=Object.freeze({[i.fp32]:"",[i.fp16]:"_fp16",[i.int8]:"_int8",[i.uint8]:"_uint8",[i.q8]:"_quantized",[i.q4]:"_q4",[i.q4f16]:"_q4f16",[i.bnb4]:"_bnb4"})},"./src/utils/generic.js":(e,r,t)=>{t.r(r),t.d(r,{Callable:()=>s});const s=class{constructor(){let o=function(...n){return o._call(...n)};return Object.setPrototypeOf(o,new.target.prototype)}_call(...o){throw Error("Must implement _call method in subclass")}}},"./src/utils/hub.js":(e,r,t)=>{t.r(r),t.d(r,{MAX_EXTERNAL_DATA_CHUNKS:()=>a,getFile:()=>_,getModelFile:()=>w,getModelJSON:()=>S});var s=t("?7a2c"),o=t("?a42a"),n=t("./src/env.js"),i=t("./src/utils/core.js");const a=100,l={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"};class u{constructor(y){if(this.filePath=y,this.headers=new Headers,this.exists=s.existsSync(y),this.exists){this.status=200,this.statusText="OK";let C=s.statSync(y);this.headers.set("content-length",C.size.toString()),this.updateContentType();const F=s.createReadStream(y);this.body=new ReadableStream({start(z){F.on("data",K=>z.enqueue(K)),F.on("end",()=>z.close()),F.on("error",K=>z.error(K))},cancel(){F.destroy()}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){const y=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",l[y]??"application/octet-stream")}clone(){let y=new u(this.filePath);return y.exists=this.exists,y.status=this.status,y.statusText=this.statusText,y.headers=new Headers(this.headers),y}async arrayBuffer(){return(await s.promises.readFile(this.filePath)).buffer}async blob(){const y=await s.promises.readFile(this.filePath);return new Blob([y],{type:this.headers.get("content-type")})}async text(){return await s.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function p(M,y=null,C=null){let F;try{F=new URL(M)}catch{return!1}return!(y&&!y.includes(F.protocol)||C&&!C.includes(F.hostname))}const c=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function d(M){return!(!c.test(M)||M.includes("..")||M.includes("--")||M.endsWith(".git")||M.endsWith(".ipynb"))}async function _(M){var y;if(n.env.useFS&&!p(M,["http:","https:","blob:"]))return new u(M instanceof URL?M.protocol==="file:"?M.pathname:M.toString():M);if(typeof process<"u"&&((y=process==null?void 0:process.release)==null?void 0:y.name)==="node"){const C=!!(js!=null&&js.TESTING_REMOTELY),F=n.env.version,z=new Headers;if(z.set("User-Agent",`transformers.js/${F}; is_ci/${C};`),p(M,["http:","https:"],["huggingface.co","hf.co"])){const q=(js==null?void 0:js.HF_TOKEN)??(js==null?void 0:js.HF_ACCESS_TOKEN);q&&z.set("Authorization",`Bearer ${q}`)}return fetch(M,{headers:z})}else return fetch(M)}const f={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};function T(M,y,C){if(!C)return null;const F=f[M]??`Error (${M}) occurred while trying to load file`;throw Error(`${F}: "${y}".`)}class k{constructor(y){this.path=y}async match(y){let C=o.join(this.path,y),F=new u(C);if(F.exists)return F}async put(y,C,F=void 0){let z=o.join(this.path,y);try{const K=C.headers.get("Content-Length"),q=parseInt(K??"0");let R=0;await s.promises.mkdir(o.dirname(z),{recursive:!0});const Z=s.createWriteStream(z),H=C.body.getReader();for(;;){const{done:J,value:Q}=await H.read();if(J)break;await new Promise((fe,ae)=>{Z.write(Q,V=>{if(V){ae(V);return}fe()})}),R+=Q.length;const se=q?R/q*100:0;F==null||F({progress:se,loaded:R,total:q})}Z.close()}catch(K){try{await s.promises.unlink(z)}catch{}throw K}}}async function g(M,...y){for(let C of y)try{let F=await M.match(C);if(F)return F}catch{continue}}async function w(M,y,C=!0,F={},z=!1){if(!n.env.allowLocalModels){if(F.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!n.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}(0,i.dispatchCallback)(F.progress_callback,{status:"initiate",name:M,file:y});let K;if(!K&&n.env.useCustomCache){if(!n.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!n.env.customCache.match||!n.env.customCache.put)throw new Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");K=n.env.customCache}if(!K&&n.env.useBrowserCache){if(typeof caches>"u")throw Error("Browser cache is not available in this environment.");try{K=await caches.open("transformers-cache")}catch(ee){console.warn("An error occurred while opening the browser cache:",ee)}}if(!K&&n.env.useFSCache){if(!n.apis.IS_FS_AVAILABLE)throw Error("File System Cache is not available in this environment.");K=new k(F.cache_dir??n.env.cacheDir)}const q=F.revision??"main",R=v(M,y),Z=d(M),H=Z?v(n.env.localModelPath,R):R,J=v(n.env.remoteHost,n.env.remotePathTemplate.replaceAll("{model}",M).replaceAll("{revision}",encodeURIComponent(q)),y);let Q;const se=K instanceof k?q==="main"?R:v(M,q,y):J;let fe=!1,ae;K&&(ae=await g(K,H,se));const V=ae!==void 0;if(ae===void 0){if(n.env.allowLocalModels)if(p(R,["http:","https:"])){if(F.local_files_only)throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${R}.`);if(!n.env.allowRemoteModels)throw new Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${R}.`)}else try{ae=await _(H),Q=H}catch(_e){console.warn(`Unable to load from local path "${H}": "${_e}"`)}if(ae===void 0||ae.status===404){if(F.local_files_only||!n.env.allowRemoteModels){if(C)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${H}".`);return null}if(!Z)throw Error(`Local file missing at "${H}" and download aborted due to invalid model ID "${M}".`);if(ae=await _(J),ae.status!==200)return T(ae.status,J,C);Q=se}fe=K&&typeof Response<"u"&&ae instanceof Response&&ae.status===200}(0,i.dispatchCallback)(F.progress_callback,{status:"download",name:M,file:y});let A;if(!(n.apis.IS_NODE_ENV&&z)){let ee;F.progress_callback?V&&typeof navigator<"u"&&/firefox/i.test(navigator.userAgent)?(ee=new Uint8Array(await ae.arrayBuffer()),(0,i.dispatchCallback)(F.progress_callback,{status:"progress",name:M,file:y,progress:100,loaded:ee.length,total:ee.length})):ee=await E(ae,_e=>{(0,i.dispatchCallback)(F.progress_callback,{status:"progress",name:M,file:y,..._e})}):ee=new Uint8Array(await ae.arrayBuffer()),A=ee}if(fe&&Q&&await K.match(Q)===void 0&&(A?await K.put(Q,new Response(A,{headers:ae.headers})).catch(ee=>{console.warn(`Unable to add response to browser cache: ${ee}.`)}):await K.put(Q,ae,F.progress_callback)),(0,i.dispatchCallback)(F.progress_callback,{status:"done",name:M,file:y}),A){if(!n.apis.IS_NODE_ENV&&z)throw new Error("Cannot return path in a browser environment.");return A}if(ae instanceof u)return ae.filePath;const U=await(K==null?void 0:K.match(Q));if(U instanceof u)return U.filePath;if(U instanceof Response)return new Uint8Array(await U.arrayBuffer());if(typeof U=="string")return U;throw new Error("Unable to get model file path or buffer.")}async function S(M,y,C=!0,F={}){const z=await w(M,y,C,F,!1);if(z===null)return{};const q=new TextDecoder("utf-8").decode(z);return JSON.parse(q)}async function E(M,y){const C=M.headers.get("Content-Length");C===null&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let F=parseInt(C??"0"),z=new Uint8Array(F),K=0;const q=M.body.getReader();async function R(){const{done:Z,value:H}=await q.read();if(Z)return;const J=K+H.length;if(J>F){F=J;const se=new Uint8Array(F);se.set(z),z=se}z.set(H,K),K=J;const Q=K/F*100;return y({progress:Q,loaded:K,total:F}),R()}return await R(),z}function v(...M){return M=M.map((y,C)=>(C&&(y=y.replace(new RegExp("^/"),"")),C!==M.length-1&&(y=y.replace(new RegExp("/$"),"")),y)),M.join("/")}},"./src/utils/image.js":(e,r,t)=>{t.r(r),t.d(r,{RawImage:()=>f,load_image:()=>T});var s=t("./src/utils/core.js"),o=t("./src/utils/hub.js"),n=t("./src/env.js"),i=t("./src/utils/tensor.js"),a=t("?2b25");let l,u,p;const c=n.apis.IS_BROWSER_ENV||n.apis.IS_WEBWORKER_ENV;if(c)l=(k,g)=>{if(!self.OffscreenCanvas)throw new Error("OffscreenCanvas not supported by this browser.");return new self.OffscreenCanvas(k,g)},p=self.createImageBitmap,u=self.ImageData;else if(a)p=async k=>{const w=(await k.metadata()).channels,{data:S,info:E}=await k.rotate().raw().toBuffer({resolveWithObject:!0}),v=new f(new Uint8ClampedArray(S),E.width,E.height,E.channels);return w!==void 0&&w!==E.channels&&v.convert(w),v};else throw new Error("Unable to load image processing library.");const d={0:"nearest",1:"lanczos",2:"bilinear",3:"bicubic",4:"box",5:"hamming"},_=new Map([["png","image/png"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["gif","image/gif"]]);class f{constructor(g,w,S,E){this.data=g,this.width=w,this.height=S,this.channels=E}get size(){return[this.width,this.height]}static async read(g){if(g instanceof f)return g;if(typeof g=="string"||g instanceof URL)return await this.fromURL(g);if(g instanceof Blob)return await this.fromBlob(g);if(typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&g instanceof OffscreenCanvas)return this.fromCanvas(g);throw new Error(`Unsupported input type: ${typeof g}`)}static fromCanvas(g){if(!c)throw new Error("fromCanvas() is only supported in browser environments.");const S=g.getContext("2d").getImageData(0,0,g.width,g.height).data;return new f(S,g.width,g.height,4)}static async fromURL(g){const w=await(0,o.getFile)(g);if(w.status!==200)throw new Error(`Unable to read image from "${g}" (${w.status} ${w.statusText})`);const S=await w.blob();return this.fromBlob(S)}static async fromBlob(g){if(c){const w=await p(g),S=l(w.width,w.height).getContext("2d");return S.drawImage(w,0,0),new this(S.getImageData(0,0,w.width,w.height).data,w.width,w.height,4)}else{const w=a(await g.arrayBuffer());return await p(w)}}static fromTensor(g,w="CHW"){if(g.dims.length!==3)throw new Error(`Tensor should have 3 dimensions, but has ${g.dims.length} dimensions.`);if(w==="CHW")g=g.transpose(1,2,0);else if(w!=="HWC")throw new Error(`Unsupported channel format: ${w}`);if(!(g.data instanceof Uint8ClampedArray||g.data instanceof Uint8Array))throw new Error(`Unsupported tensor type: ${g.type}`);switch(g.dims[2]){case 1:case 2:case 3:case 4:return new f(g.data,g.dims[1],g.dims[0],g.dims[2]);default:throw new Error(`Unsupported number of channels: ${g.dims[2]}`)}}grayscale(){if(this.channels===1)return this;const g=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let w=0,S=0;w=0?C=S:z=-S,E>=0?F=E:K=-E,y.drawImage(M,C,F,g,w,z,K,g,w),new f(y.getImageData(0,0,g,w).data,g,w,4).convert(v)}else{let v=this.toSharp();if(S>=0&&E>=0)v=v.extract({left:Math.floor(S),top:Math.floor(E),width:g,height:w});else if(S<=0&&E<=0){const M=Math.floor(-E),y=Math.floor(-S);v=v.extend({top:M,left:y,right:g-this.width-y,bottom:w-this.height-M})}else{let M=[0,0],y=0;E<0?(M[0]=Math.floor(-E),M[1]=w-this.height-M[0]):y=Math.floor(E);let C=[0,0],F=0;S<0?(C[0]=Math.floor(-S),C[1]=g-this.width-C[0]):F=Math.floor(S),v=v.extend({top:M[0],bottom:M[1],left:C[0],right:C[1]}).extract({left:F,top:y,width:g,height:w})}return await p(v)}}async toBlob(g="image/png",w=1){if(!c)throw new Error("toBlob() is only supported in browser environments.");return await this.toCanvas().convertToBlob({type:g,quality:w})}toTensor(g="CHW"){let w=new i.Tensor("uint8",new Uint8Array(this.data),[this.height,this.width,this.channels]);if(g!=="HWC")if(g==="CHW")w=w.permute(2,0,1);else throw new Error(`Unsupported channel format: ${g}`);return w}toCanvas(){if(!c)throw new Error("toCanvas() is only supported in browser environments.");const g=this.clone().rgba(),w=l(g.width,g.height),S=new u(g.data,g.width,g.height);return w.getContext("2d").putImageData(S,0,0),w}split(){const{data:g,width:w,height:S,channels:E}=this,v=g.constructor,M=g.length/E,y=Array.from({length:E},()=>new v(M));for(let C=0;Cnew f(C,w,S,1))}_update(g,w,S,E=null){return this.data=g,this.width=w,this.height=S,E!==null&&(this.channels=E),this}clone(){return new f(this.data.slice(),this.width,this.height,this.channels)}convert(g){if(this.channels===g)return this;switch(g){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(g){if(c){if(n.apis.IS_WEBWORKER_ENV)throw new Error("Unable to save an image from a Web Worker.");const w=g.split(".").pop().toLowerCase(),S=_.get(w)??"image/png",E=await this.toBlob(S);(0,s.saveBlob)(g,E)}else{if(n.apis.IS_FS_AVAILABLE)return await this.toSharp().toFile(g);throw new Error("Unable to save the image because filesystem is disabled in this environment.")}}toSharp(){if(c)throw new Error("toSharp() is only supported in server-side environments.");return a(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}const T=f.read.bind(f)},"./src/utils/maths.js":(e,r,t)=>{t.r(r),t.d(r,{FFT:()=>T,bankers_round:()=>w,cos_sim:()=>l,dot:()=>a,dynamic_time_warping:()=>S,interpolate_data:()=>s,log_softmax:()=>i,magnitude:()=>u,max:()=>c,medianFilter:()=>k,min:()=>p,permute_data:()=>o,round:()=>g,softmax:()=>n});function s(E,[v,M,y],[C,F],z="bilinear",K=!1){const q=F/y,R=C/M,Z=new E.constructor(C*F*v),H=M*y,J=C*F;for(let Q=0;Q=0;--K)C[K]=q,y[K]=v[M[K]],q*=y[K];const F=M.map((K,q)=>C[M.indexOf(q)]),z=new E.constructor(E.length);for(let K=0;K=0;--R)q+=Z%v[R]*F[R],Z=Math.floor(Z/v[R]);z[q]=E[K]}return[z,y]}function n(E){const v=c(E)[0],M=E.map(F=>Math.exp(F-v)),y=M.reduce((F,z)=>F+z,0);return M.map(F=>F/y)}function i(E){const v=c(E)[0];let M=0;for(let F=0;FF-v-y)}function a(E,v){let M=0;for(let y=0;yv+M*M,0))}function p(E){if(E.length===0)throw Error("Array must not be empty");let v=E[0],M=0;for(let y=1;yv&&(v=E[y],M=y);return[v,M]}function d(E){return E>0&&(E&E-1)===0}class _{constructor(v){if(this.size=v|0,this.size<=1||!d(this.size))throw new Error("FFT size must be a power of two larger than 1");this._csize=v<<1,this.table=new Float64Array(this.size*2);for(let y=0;yy;y<<=1)++M;this._width=M%2===0?M-1:M,this._bitrev=new Int32Array(1<>>C&3)<>>1);for(let C=0;C>>1]=v[C];return y}toComplexArray(v,M){const y=M||this.createComplexArray();for(let C=0;C>>1],y[C+1]=0;return y}transform(v,M){if(v===M)throw new Error("Input and output buffers must be different");this._transform4(v,M,1)}realTransform(v,M){if(v===M)throw new Error("Input and output buffers must be different");this._realTransform4(v,M,1)}inverseTransform(v,M){if(v===M)throw new Error("Input and output buffers must be different");this._transform4(v,M,-1);for(let y=0;y>=2;z>=2;z>>=2){K=C/z<<1;const J=K>>>2;for(q=0;q>>1,z>>>1)}else for(q=0,R=0;q>>1,z>>>1,y)}const H=this.table;for(z>>=2;z>=2;z>>=2){K=C/z<<1;const Q=K>>>1,se=Q>>>1,fe=se>>>1;for(q=0;q>>1;for(let Q=2;Q>1;++Z){const H=(Z+1-v)**2/2,J=Math.sqrt(q**2+R**2)**H,Q=H*Math.atan2(R,q),se=2*Z;F[se]=J*Math.cos(Q),F[se+1]=J*Math.sin(Q),z[se]=F[se],z[se+1]=-F[se+1]}this._slicedChirpBuffer=F.subarray(M,y),this._f=new _(C>>1),this._f.transform(this._chirpBuffer,z)}_transform(v,M,y){const C=this._buffer1,F=this._buffer2,z=this._outBuffer1,K=this._outBuffer2,q=this._chirpBuffer,R=this._slicedChirpBuffer,Z=this._a;if(y)for(let H=0;H>1,se=M[Q];C[H]=se*R[H],C[J]=se*R[J]}else for(let H=0;H=E.length&&(q=2*(E.length-1)-q),y[z++]=E[q]}y.sort(),M[F]=y[C]}return M}function g(E,v){const M=Math.pow(10,v);return Math.round(E*M)/M}function w(E){const v=Math.round(E);return Math.abs(E)%1===.5?v%2===0?v:v-1:v}function S(E){const v=E.length,M=E[0].length,y=[v+1,M+1],C=Array.from({length:y[0]},()=>Array(y[1]).fill(1/0));C[0][0]=0;const F=Array.from({length:y[0]},()=>Array(y[1]).fill(-1));for(let Z=1;Z0||K>0;)switch(q.push(z-1),R.push(K-1),F[z][K]){case 0:--z,--K;break;case 1:--z;break;case 2:--K;break;default:throw new Error(`Internal error in dynamic time warping. Unexpected trace[${z}, ${K}]. Please file a bug report.`)}return q.reverse(),R.reverse(),[q,R]}},"./src/utils/tensor.js":(e,r,t)=>{t.r(r),t.d(r,{DataTypeMap:()=>i,Tensor:()=>a,cat:()=>M,full:()=>R,full_like:()=>Z,interpolate:()=>p,interpolate_4d:()=>c,layer_norm:()=>w,matmul:()=>d,mean:()=>z,mean_pooling:()=>g,ones:()=>H,ones_like:()=>J,permute:()=>u,quantize_embeddings:()=>ae,rand:()=>fe,rfft:()=>_,slice:()=>k,stack:()=>y,std_mean:()=>F,topk:()=>f,zeros:()=>Q,zeros_like:()=>se});var s=t("./src/utils/maths.js"),o=t("./src/backends/onnx.js"),n=t("./src/ops/registry.js");const i=Object.freeze({float32:Float32Array,float16:typeof Float16Array<"u"?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array});class a{constructor(...A){Y(this,"ort_tensor");return(0,o.isONNXTensor)(A[0])?this.ort_tensor=A[0]:this.ort_tensor=new o.Tensor(A[0],A[1],A[2]),new Proxy(this,{get:(U,ee)=>{if(typeof ee=="string"){let _e=Number(ee);if(Number.isInteger(_e))return U._getitem(_e)}return U[ee]},set:(U,ee,_e)=>U[ee]=_e})}get dims(){return this.ort_tensor.dims}set dims(A){this.ort_tensor.dims=A}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){const[A,...U]=this.dims;if(U.length>0){const ee=U.reduce((_e,le)=>_e*le);for(let _e=0;_e0){const _e=ee.reduce((le,ye)=>le*ye);return this._subarray(A,_e,ee)}else return new a(this.type,[this.data[A]],ee)}indexOf(A){const U=this.data;for(let ee=0;eeG)throw new Error(`Invalid slice: ${W}`);const be=[Math.max(re,0),Math.min(G,this.dims[pe])];ee.push(be),U.push(be[1]-be[0])}else throw new Error(`Invalid slice: ${W}`)}const _e=ee.map(([pe,W])=>W-pe),le=_e.reduce((pe,W)=>pe*W),ye=this.data,ze=new ye.constructor(le),Ue=this.stride();for(let pe=0;pe=0;--re){const be=_e[re];W+=(G%be+ee[re][0])*Ue[re],G=Math.floor(G/be)}ze[pe]=ye[W]}return new a(this.type,ze,U)}permute(...A){return u(this,A)}transpose(...A){return this.permute(...A)}sum(A=null,U=!1){return this.norm(1,A,U)}norm(A="fro",U=null,ee=!1){if(A==="fro")A=2;else if(typeof A=="string")throw Error(`Unsupported norm: ${A}`);const _e=this.data,le=(pe,W)=>pe+W**A;if(U===null){const pe=_e.reduce(le,0)**(1/A);return new a(this.type,[pe],[])}const[ye,ze,Ue]=C(le,this,U,ee);if(A!==1)for(let pe=0;pe=0;--Ue){const re=this.dims[Ue];if(Ue!==U){const G=pe%re;ze+=G*W,W*=this.dims[Ue]}pe=Math.floor(pe/re)}_e[ye]/=le[ze]}return this}normalize(A=2,U=1){return this.clone().normalize_(A,U)}stride(){return K(this.dims)}squeeze(A=null){return new a(this.type,this.data,S(this.dims,A))}squeeze_(A=null){return this.dims=S(this.dims,A),this}unsqueeze(A=null){return new a(this.type,this.data,E(this.dims,A))}unsqueeze_(A=null){return this.dims=E(this.dims,A),this}flatten_(A=0,U=-1){U=(U+this.dims.length)%this.dims.length;let ee=this.dims.slice(0,A),_e=this.dims.slice(A,U+1),le=this.dims.slice(U+1);return this.dims=[...ee,_e.reduce((ye,ze)=>ye*ze,1),...le],this}flatten(A=0,U=-1){return this.clone().flatten_(A,U)}view(...A){let U=-1;for(let _e=0;_eze!==U?le*ye:le,1);A[U]=ee.length/_e}return new a(this.type,ee,A)}neg_(){const A=this.data;for(let U=0;UA?1:0;return new a("bool",U,this.dims)}lt(A){const U=new Uint8Array(this.data.length),ee=this.data;for(let _e=0;_eMath.min(ye,ze),this,A,U,1/0);return new a(ee,_e,le)}max(A=null,U=!1){if(A===null){const ye=(0,s.max)(this.data)[0];return new a(this.type,[ye],[])}const[ee,_e,le]=C((ye,ze)=>Math.max(ye,ze),this,A,U,-1/0);return new a(ee,_e,le)}argmin(A=null,U=!1){if(A!==null)throw new Error("`dim !== null` not yet implemented.");const ee=(0,s.min)(this.data)[1];return new a("int64",[BigInt(ee)],[])}argmax(A=null,U=!1){if(A!==null)throw new Error("`dim !== null` not yet implemented.");const ee=(0,s.max)(this.data)[1];return new a("int64",[BigInt(ee)],[])}to(A){if(this.type===A)return this;if(!i.hasOwnProperty(A))throw new Error(`Unsupported type: ${A}`);let U;const ee=["int64","uint64"].includes(this.type),_e=["int64","uint64"].includes(A);return ee&&!_e?U=Number:!ee&&_e&&(U=BigInt),new a(A,i[A].from(this.data,U),this.dims)}}function l(V,A){const U=V.length,ee=A.reduce((le,ye)=>le*ye);if(U!==ee)throw Error(`cannot reshape array of size ${U} into shape (${A})`);let _e=V;for(let le=A.length-1;le>=0;le--)_e=_e.reduce((ye,ze)=>{let Ue=ye[ye.length-1];return Ue.lengthnew a("int64",V,[V.length]);async function k(V,A,U,ee,_e){return await(await n.TensorOpRegistry.slice)({x:V,s:T(A),e:T(U),a:T(ee),t:T(_e??new Array(ee.length).fill(1))})}function g(V,A){const U=V.data,ee=A.data,_e=[V.dims[0],V.dims[2]],le=new U.constructor(_e[0]*_e[1]),[ye,ze,Ue]=V.dims;let pe=0;for(let W=0;WU!==1):typeof A=="number"?V[A]===1&&V.splice(A,1):Array.isArray(A)&&(V=V.filter((U,ee)=>U!==1||!A.includes(ee))),V}function E(V,A){return A=v(A,V.length+1),V=V.slice(),V.splice(A,0,1),V}function v(V,A,U=null,ee=!0){if(V<-A||V>=A){if(ee)throw new Error(`IndexError: index ${V} is out of bounds for dimension${U===null?"":" "+U} with size ${A}`);return V<-A?0:A}return V<0&&(V=(V%A+A)%A),V}function M(V,A=0){A=v(A,V[0].dims.length);const U=V[0].dims.slice();U[A]=V.reduce((ye,ze)=>ye+ze.dims[A],0);const ee=U.reduce((ye,ze)=>ye*ze,1),_e=new V[0].data.constructor(ee),le=V[0].type;if(A===0){let ye=0;for(const ze of V){const Ue=ze.data;_e.set(Ue,ye),ye+=Ue.length}}else{let ye=0;for(let ze=0;ze=0;--G){const Se=pe[G];let Ce=be%Se;G===A&&(Ce+=ye),re+=Ce*we,we*=U[G],be=Math.floor(be/Se)}_e[re]=Ue[W]}ye+=pe[A]}}return new a(le,_e,U)}function y(V,A=0){return M(V.map(U=>U.unsqueeze(A)),A)}function C(V,A,U=null,ee=!1,_e=null){const le=A.data,ye=A.dims;U=v(U,ye.length);const ze=ye.slice();ze[U]=1;const Ue=new le.constructor(le.length/ye[U]);_e!==null&&Ue.fill(_e);for(let pe=0;pe=0;--re){const we=ye[re];if(re!==U){const Se=G%we;W+=Se*be,be*=ze[re]}G=Math.floor(G/we)}Ue[W]=V(Ue[W],le[pe],pe,W)}return ee||ze.splice(U,1),[A.type,Ue,ze]}function F(V,A=null,U=1,ee=!1){const _e=V.data,le=V.dims;if(A===null){const be=_e.reduce(($e,Fe)=>$e+Fe,0)/_e.length,we=Math.sqrt(_e.reduce(($e,Fe)=>$e+(Fe-be)**2,0)/(_e.length-U)),Se=new a(V.type,[be],[]);return[new a(V.type,[we],[]),Se]}A=v(A,le.length);const ye=z(V,A,ee),ze=ye.data,[Ue,pe,W]=C((G,be,we,Se)=>G+(be-ze[Se])**2,V,A,ee);for(let G=0;Gpe+W,0);return new a(V.type,[Ue/_e.length],[])}A=v(A,ee.length);const[le,ye,ze]=C((Ue,pe)=>Ue+pe,V,A,U);if(ee[A]!==1)for(let Ue=0;Ue=0;--U)A[U]=ee,ee*=V[U];return A}function q(V,A,U,ee){const _e=V.reduce((le,ye)=>le*ye,1);return new a(U,new ee(_e).fill(A),V)}function R(V,A){let U,ee;if(typeof A=="number")U="float32",ee=Float32Array;else if(typeof A=="bigint")U="int64",ee=BigInt64Array;else if(typeof A=="boolean")U="bool",ee=Uint8Array;else throw new Error(`Unsupported data type: ${typeof A}`);return q(V,A,U,ee)}function Z(V,A){return R(V.dims,A)}function H(V){return q(V,1n,"int64",BigInt64Array)}function J(V){return H(V.dims)}function Q(V){return q(V,0n,"int64",BigInt64Array)}function se(V){return Q(V.dims)}function fe(V){const A=V.reduce((U,ee)=>U*ee,1);return new a("float32",Float32Array.from({length:A},()=>Math.random()),V)}function ae(V,A){if(V.dims.length!==2)throw new Error("The tensor must have 2 dimensions");if(V.dims.at(-1)%8!==0)throw new Error("The last dimension of the tensor must be a multiple of 8");if(!["binary","ubinary"].includes(A))throw new Error("The precision must be either 'binary' or 'ubinary'");const U=A==="binary",ee=U?"int8":"uint8",_e=U?Int8Array:Uint8Array,le=V.data,ye=new _e(le.length/8);for(let ze=0;ze0?1:0,pe=Math.floor(ze/8),W=ze%8;ye[pe]|=Ue<<7-W,U&&W===0&&(ye[pe]-=128)}return new a(ee,ye,[V.dims[0],V.dims[1]/8])}},"./src/utils/video.js":(e,r,t)=>{t.r(r),t.d(r,{RawVideo:()=>i,RawVideoFrame:()=>n,load_video:()=>a});var s=t("./src/utils/image.js"),o=t("./src/env.js");class n{constructor(u,p){this.image=u,this.timestamp=p}}class i{constructor(u,p){u.length>0&&u[0]instanceof s.RawImage&&(u=u.map((c,d)=>new n(c,(d+1)/(u.length+1)*p))),this.frames=u,this.duration=p}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function a(l,{num_frames:u=null,fps:p=null}={}){if(!o.apis.IS_BROWSER_ENV)throw new Error("`load_video` is currently only supported in browser environments.");if(u==null&&p==null)throw new Error("Either num_frames or fps must be provided.");const c=[],d=document.createElement("video");if(d.crossOrigin="anonymous",d.muted=!0,typeof l=="string")d.src=l;else if(l instanceof Blob)d.src=URL.createObjectURL(l);else if(l instanceof HTMLVideoElement)d.src=l.src;else throw new Error("Invalid URL or video element provided.");if(await new Promise(S=>d.onloadedmetadata=S),d.seekable.start(0)===d.seekable.end(0)){const E=await(await fetch(d.src)).blob();d.src=URL.createObjectURL(E),await new Promise(v=>d.onloadedmetadata=v)}const _=d.duration;let f,T;u!=null?(f=u,T=u===1?0:_/(u-1)):(T=1/p,f=Math.floor(_/T));let k=[];for(let S=0;S{d.onseeked=y}),w.drawImage(d,0,0,g.width,g.height);const E=w.getImageData(0,0,g.width,g.height),v=new s.RawImage(E.data,g.width,g.height,4),M=new n(v,S);c.push(M)}return d.remove(),new i(c,_)}}},Ug={};function Bt(e){var r=Ug[e];if(r!==void 0)return r.exports;var t=Ug[e]={exports:{}};return Cx[e](t,t.exports,Bt),t.exports}(()=>{var e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,r;Bt.t=function(t,s){if(s&1&&(t=this(t)),s&8||typeof t=="object"&&t&&(s&4&&t.__esModule||s&16&&typeof t.then=="function"))return t;var o=Object.create(null);Bt.r(o);var n={};r=r||[null,e({}),e([]),e(e)];for(var i=s&2&&t;typeof i=="object"&&!~r.indexOf(i);i=e(i))Object.getOwnPropertyNames(i).forEach(a=>n[a]=()=>t[a]);return n.default=()=>t,Bt.d(o,n),o}})(),Bt.d=(e,r)=>{for(var t in r)Bt.o(r,t)&&!Bt.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},Bt.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),Bt.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var m={};(()=>{/*!*****************************!*\ - !*** ./src/transformers.js ***! - \*****************************/Bt.r(m),Bt.d(m,{ASTFeatureExtractor:()=>c.ASTFeatureExtractor,ASTForAudioClassification:()=>t.ASTForAudioClassification,ASTModel:()=>t.ASTModel,ASTPreTrainedModel:()=>t.ASTPreTrainedModel,AlbertForMaskedLM:()=>t.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>t.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>t.AlbertForSequenceClassification,AlbertModel:()=>t.AlbertModel,AlbertPreTrainedModel:()=>t.AlbertPreTrainedModel,AlbertTokenizer:()=>s.AlbertTokenizer,AudioClassificationPipeline:()=>r.AudioClassificationPipeline,AutoConfig:()=>o.AutoConfig,AutoFeatureExtractor:()=>d.AutoFeatureExtractor,AutoImageProcessor:()=>T.AutoImageProcessor,AutoModel:()=>t.AutoModel,AutoModelForAudioClassification:()=>t.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>t.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>t.AutoModelForAudioTextToText,AutoModelForCTC:()=>t.AutoModelForCTC,AutoModelForCausalLM:()=>t.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>t.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>t.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>t.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>t.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>t.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>t.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>t.AutoModelForImageTextToText,AutoModelForImageToImage:()=>t.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>t.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>t.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>t.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>t.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>t.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>t.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>t.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>t.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>t.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>t.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>t.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>t.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>t.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>t.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>t.AutoModelForVision2Seq,AutoModelForXVector:()=>t.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>t.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>w.AutoProcessor,AutoTokenizer:()=>s.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>r.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>r.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>t.BartForConditionalGeneration,BartForSequenceClassification:()=>t.BartForSequenceClassification,BartModel:()=>t.BartModel,BartPretrainedModel:()=>t.BartPretrainedModel,BartTokenizer:()=>s.BartTokenizer,BaseModelOutput:()=>t.BaseModelOutput,BaseStreamer:()=>S.BaseStreamer,BeitFeatureExtractor:()=>f.BeitFeatureExtractor,BeitForImageClassification:()=>t.BeitForImageClassification,BeitModel:()=>t.BeitModel,BeitPreTrainedModel:()=>t.BeitPreTrainedModel,BertForMaskedLM:()=>t.BertForMaskedLM,BertForQuestionAnswering:()=>t.BertForQuestionAnswering,BertForSequenceClassification:()=>t.BertForSequenceClassification,BertForTokenClassification:()=>t.BertForTokenClassification,BertModel:()=>t.BertModel,BertPreTrainedModel:()=>t.BertPreTrainedModel,BertTokenizer:()=>s.BertTokenizer,BitImageProcessor:()=>f.BitImageProcessor,BlenderbotForConditionalGeneration:()=>t.BlenderbotForConditionalGeneration,BlenderbotModel:()=>t.BlenderbotModel,BlenderbotPreTrainedModel:()=>t.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>t.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>t.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>t.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>s.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>s.BlenderbotTokenizer,BloomForCausalLM:()=>t.BloomForCausalLM,BloomModel:()=>t.BloomModel,BloomPreTrainedModel:()=>t.BloomPreTrainedModel,BloomTokenizer:()=>s.BloomTokenizer,CLIPFeatureExtractor:()=>f.CLIPFeatureExtractor,CLIPImageProcessor:()=>f.CLIPImageProcessor,CLIPModel:()=>t.CLIPModel,CLIPPreTrainedModel:()=>t.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>t.CLIPSegForImageSegmentation,CLIPSegModel:()=>t.CLIPSegModel,CLIPSegPreTrainedModel:()=>t.CLIPSegPreTrainedModel,CLIPTextModel:()=>t.CLIPTextModel,CLIPTextModelWithProjection:()=>t.CLIPTextModelWithProjection,CLIPTokenizer:()=>s.CLIPTokenizer,CLIPVisionModel:()=>t.CLIPVisionModel,CLIPVisionModelWithProjection:()=>t.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>t.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>t.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>t.CamembertForSequenceClassification,CamembertForTokenClassification:()=>t.CamembertForTokenClassification,CamembertModel:()=>t.CamembertModel,CamembertPreTrainedModel:()=>t.CamembertPreTrainedModel,CamembertTokenizer:()=>s.CamembertTokenizer,CausalLMOutput:()=>t.CausalLMOutput,CausalLMOutputWithPast:()=>t.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>f.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>t.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>t.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>t.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>c.ClapFeatureExtractor,ClapModel:()=>t.ClapModel,ClapPreTrainedModel:()=>t.ClapPreTrainedModel,ClapTextModelWithProjection:()=>t.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>v.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>t.CodeGenForCausalLM,CodeGenModel:()=>t.CodeGenModel,CodeGenPreTrainedModel:()=>t.CodeGenPreTrainedModel,CodeGenTokenizer:()=>s.CodeGenTokenizer,CodeLlamaTokenizer:()=>s.CodeLlamaTokenizer,CohereForCausalLM:()=>t.CohereForCausalLM,CohereModel:()=>t.CohereModel,CoherePreTrainedModel:()=>t.CoherePreTrainedModel,CohereTokenizer:()=>s.CohereTokenizer,ConvBertForMaskedLM:()=>t.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>t.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>t.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>t.ConvBertForTokenClassification,ConvBertModel:()=>t.ConvBertModel,ConvBertPreTrainedModel:()=>t.ConvBertPreTrainedModel,ConvBertTokenizer:()=>s.ConvBertTokenizer,ConvNextFeatureExtractor:()=>f.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>t.ConvNextForImageClassification,ConvNextImageProcessor:()=>f.ConvNextImageProcessor,ConvNextModel:()=>t.ConvNextModel,ConvNextPreTrainedModel:()=>t.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>t.ConvNextV2ForImageClassification,ConvNextV2Model:()=>t.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>t.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>t.DFineForObjectDetection,DFineModel:()=>t.DFineModel,DFinePreTrainedModel:()=>t.DFinePreTrainedModel,DPTFeatureExtractor:()=>f.DPTFeatureExtractor,DPTForDepthEstimation:()=>t.DPTForDepthEstimation,DPTImageProcessor:()=>f.DPTImageProcessor,DPTModel:()=>t.DPTModel,DPTPreTrainedModel:()=>t.DPTPreTrainedModel,DacDecoderModel:()=>t.DacDecoderModel,DacDecoderOutput:()=>t.DacDecoderOutput,DacEncoderModel:()=>t.DacEncoderModel,DacEncoderOutput:()=>t.DacEncoderOutput,DacFeatureExtractor:()=>c.DacFeatureExtractor,DacModel:()=>t.DacModel,DacPreTrainedModel:()=>t.DacPreTrainedModel,DataTypeMap:()=>l.DataTypeMap,DebertaForMaskedLM:()=>t.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>t.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>t.DebertaForSequenceClassification,DebertaForTokenClassification:()=>t.DebertaForTokenClassification,DebertaModel:()=>t.DebertaModel,DebertaPreTrainedModel:()=>t.DebertaPreTrainedModel,DebertaTokenizer:()=>s.DebertaTokenizer,DebertaV2ForMaskedLM:()=>t.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>t.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>t.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>t.DebertaV2ForTokenClassification,DebertaV2Model:()=>t.DebertaV2Model,DebertaV2PreTrainedModel:()=>t.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>s.DebertaV2Tokenizer,DecisionTransformerModel:()=>t.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>t.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>f.DeiTFeatureExtractor,DeiTForImageClassification:()=>t.DeiTForImageClassification,DeiTImageProcessor:()=>f.DeiTImageProcessor,DeiTModel:()=>t.DeiTModel,DeiTPreTrainedModel:()=>t.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>t.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>t.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>r.DepthEstimationPipeline,DepthProForDepthEstimation:()=>t.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>t.DepthProPreTrainedModel,DetrFeatureExtractor:()=>f.DetrFeatureExtractor,DetrForObjectDetection:()=>t.DetrForObjectDetection,DetrForSegmentation:()=>t.DetrForSegmentation,DetrImageProcessor:()=>f.DetrImageProcessor,DetrModel:()=>t.DetrModel,DetrObjectDetectionOutput:()=>t.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>t.DetrPreTrainedModel,DetrSegmentationOutput:()=>t.DetrSegmentationOutput,Dinov2ForImageClassification:()=>t.Dinov2ForImageClassification,Dinov2Model:()=>t.Dinov2Model,Dinov2PreTrainedModel:()=>t.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>t.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>t.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>t.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>t.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>t.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>t.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>t.DistilBertForTokenClassification,DistilBertModel:()=>t.DistilBertModel,DistilBertPreTrainedModel:()=>t.DistilBertPreTrainedModel,DistilBertTokenizer:()=>s.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>r.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>f.DonutFeatureExtractor,DonutImageProcessor:()=>f.DonutImageProcessor,DonutSwinModel:()=>t.DonutSwinModel,DonutSwinPreTrainedModel:()=>t.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>t.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>f.EfficientNetImageProcessor,EfficientNetModel:()=>t.EfficientNetModel,EfficientNetPreTrainedModel:()=>t.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>t.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>t.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>t.ElectraForSequenceClassification,ElectraForTokenClassification:()=>t.ElectraForTokenClassification,ElectraModel:()=>t.ElectraModel,ElectraPreTrainedModel:()=>t.ElectraPreTrainedModel,ElectraTokenizer:()=>s.ElectraTokenizer,EncodecFeatureExtractor:()=>c.EncodecFeatureExtractor,EosTokenCriteria:()=>E.EosTokenCriteria,EsmForMaskedLM:()=>t.EsmForMaskedLM,EsmForSequenceClassification:()=>t.EsmForSequenceClassification,EsmForTokenClassification:()=>t.EsmForTokenClassification,EsmModel:()=>t.EsmModel,EsmPreTrainedModel:()=>t.EsmPreTrainedModel,EsmTokenizer:()=>s.EsmTokenizer,ExaoneForCausalLM:()=>t.ExaoneForCausalLM,ExaoneModel:()=>t.ExaoneModel,ExaonePreTrainedModel:()=>t.ExaonePreTrainedModel,FFT:()=>u.FFT,FalconForCausalLM:()=>t.FalconForCausalLM,FalconModel:()=>t.FalconModel,FalconPreTrainedModel:()=>t.FalconPreTrainedModel,FalconTokenizer:()=>s.FalconTokenizer,FastViTForImageClassification:()=>t.FastViTForImageClassification,FastViTModel:()=>t.FastViTModel,FastViTPreTrainedModel:()=>t.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>r.FeatureExtractionPipeline,FeatureExtractor:()=>p.FeatureExtractor,FillMaskPipeline:()=>r.FillMaskPipeline,Florence2ForConditionalGeneration:()=>t.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>t.Florence2PreTrainedModel,Florence2Processor:()=>g.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>v.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>v.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>f.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>t.GLPNForDepthEstimation,GLPNModel:()=>t.GLPNModel,GLPNPreTrainedModel:()=>t.GLPNPreTrainedModel,GPT2LMHeadModel:()=>t.GPT2LMHeadModel,GPT2Model:()=>t.GPT2Model,GPT2PreTrainedModel:()=>t.GPT2PreTrainedModel,GPT2Tokenizer:()=>s.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>t.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>t.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>t.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>t.GPTJForCausalLM,GPTJModel:()=>t.GPTJModel,GPTJPreTrainedModel:()=>t.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>t.GPTNeoForCausalLM,GPTNeoModel:()=>t.GPTNeoModel,GPTNeoPreTrainedModel:()=>t.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>t.GPTNeoXForCausalLM,GPTNeoXModel:()=>t.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>t.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>s.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>t.Gemma2ForCausalLM,Gemma2Model:()=>t.Gemma2Model,Gemma2PreTrainedModel:()=>t.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>t.Gemma3ForCausalLM,Gemma3Model:()=>t.Gemma3Model,Gemma3PreTrainedModel:()=>t.Gemma3PreTrainedModel,GemmaForCausalLM:()=>t.GemmaForCausalLM,GemmaModel:()=>t.GemmaModel,GemmaPreTrainedModel:()=>t.GemmaPreTrainedModel,GemmaTokenizer:()=>s.GemmaTokenizer,GlmForCausalLM:()=>t.GlmForCausalLM,GlmModel:()=>t.GlmModel,GlmPreTrainedModel:()=>t.GlmPreTrainedModel,GraniteForCausalLM:()=>t.GraniteForCausalLM,GraniteModel:()=>t.GraniteModel,GranitePreTrainedModel:()=>t.GranitePreTrainedModel,Grok1Tokenizer:()=>s.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>t.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>f.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>t.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>g.GroundingDinoProcessor,GroupViTModel:()=>t.GroupViTModel,GroupViTPreTrainedModel:()=>t.GroupViTPreTrainedModel,HeliumForCausalLM:()=>t.HeliumForCausalLM,HeliumModel:()=>t.HeliumModel,HeliumPreTrainedModel:()=>t.HeliumPreTrainedModel,HerbertTokenizer:()=>s.HerbertTokenizer,HieraForImageClassification:()=>t.HieraForImageClassification,HieraModel:()=>t.HieraModel,HieraPreTrainedModel:()=>t.HieraPreTrainedModel,HubertForCTC:()=>t.HubertForCTC,HubertForSequenceClassification:()=>t.HubertForSequenceClassification,HubertModel:()=>t.HubertModel,HubertPreTrainedModel:()=>t.HubertPreTrainedModel,IJepaForImageClassification:()=>t.IJepaForImageClassification,IJepaModel:()=>t.IJepaModel,IJepaPreTrainedModel:()=>t.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>t.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>f.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>t.Idefics3PreTrainedModel,Idefics3Processor:()=>g.Idefics3Processor,ImageClassificationPipeline:()=>r.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>r.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>c.ImageFeatureExtractor,ImageMattingOutput:()=>t.ImageMattingOutput,ImageProcessor:()=>_.ImageProcessor,ImageSegmentationPipeline:()=>r.ImageSegmentationPipeline,ImageToImagePipeline:()=>r.ImageToImagePipeline,ImageToTextPipeline:()=>r.ImageToTextPipeline,InterruptableStoppingCriteria:()=>E.InterruptableStoppingCriteria,JAISLMHeadModel:()=>t.JAISLMHeadModel,JAISModel:()=>t.JAISModel,JAISPreTrainedModel:()=>t.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>f.JinaCLIPImageProcessor,JinaCLIPModel:()=>t.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>t.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>g.JinaCLIPProcessor,JinaCLIPTextModel:()=>t.JinaCLIPTextModel,JinaCLIPVisionModel:()=>t.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>t.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>t.LlamaForCausalLM,LlamaModel:()=>t.LlamaModel,LlamaPreTrainedModel:()=>t.LlamaPreTrainedModel,LlamaTokenizer:()=>s.LlamaTokenizer,LlavaForConditionalGeneration:()=>t.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>t.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>f.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>t.LlavaPreTrainedModel,LogitsProcessor:()=>v.LogitsProcessor,LogitsProcessorList:()=>v.LogitsProcessorList,LogitsWarper:()=>v.LogitsWarper,LongT5ForConditionalGeneration:()=>t.LongT5ForConditionalGeneration,LongT5Model:()=>t.LongT5Model,LongT5PreTrainedModel:()=>t.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>t.M2M100ForConditionalGeneration,M2M100Model:()=>t.M2M100Model,M2M100PreTrainedModel:()=>t.M2M100PreTrainedModel,M2M100Tokenizer:()=>s.M2M100Tokenizer,MBart50Tokenizer:()=>s.MBart50Tokenizer,MBartForCausalLM:()=>t.MBartForCausalLM,MBartForConditionalGeneration:()=>t.MBartForConditionalGeneration,MBartForSequenceClassification:()=>t.MBartForSequenceClassification,MBartModel:()=>t.MBartModel,MBartPreTrainedModel:()=>t.MBartPreTrainedModel,MBartTokenizer:()=>s.MBartTokenizer,MPNetForMaskedLM:()=>t.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>t.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>t.MPNetForSequenceClassification,MPNetForTokenClassification:()=>t.MPNetForTokenClassification,MPNetModel:()=>t.MPNetModel,MPNetPreTrainedModel:()=>t.MPNetPreTrainedModel,MPNetTokenizer:()=>s.MPNetTokenizer,MT5ForConditionalGeneration:()=>t.MT5ForConditionalGeneration,MT5Model:()=>t.MT5Model,MT5PreTrainedModel:()=>t.MT5PreTrainedModel,MarianMTModel:()=>t.MarianMTModel,MarianModel:()=>t.MarianModel,MarianPreTrainedModel:()=>t.MarianPreTrainedModel,MarianTokenizer:()=>s.MarianTokenizer,Mask2FormerImageProcessor:()=>f.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>f.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>t.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>f.MaskFormerImageProcessor,MaskFormerModel:()=>t.MaskFormerModel,MaskFormerPreTrainedModel:()=>t.MaskFormerPreTrainedModel,MaskedLMOutput:()=>t.MaskedLMOutput,MaxLengthCriteria:()=>E.MaxLengthCriteria,Metric3DForDepthEstimation:()=>t.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>t.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>t.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>t.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>t.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>t.MgpstrModelOutput,MgpstrPreTrainedModel:()=>t.MgpstrPreTrainedModel,MgpstrProcessor:()=>g.MgpstrProcessor,MgpstrTokenizer:()=>s.MgpstrTokenizer,MimiDecoderModel:()=>t.MimiDecoderModel,MimiDecoderOutput:()=>t.MimiDecoderOutput,MimiEncoderModel:()=>t.MimiEncoderModel,MimiEncoderOutput:()=>t.MimiEncoderOutput,MimiModel:()=>t.MimiModel,MimiPreTrainedModel:()=>t.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>v.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>v.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>t.MistralForCausalLM,MistralModel:()=>t.MistralModel,MistralPreTrainedModel:()=>t.MistralPreTrainedModel,MobileBertForMaskedLM:()=>t.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>t.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>t.MobileBertForSequenceClassification,MobileBertModel:()=>t.MobileBertModel,MobileBertPreTrainedModel:()=>t.MobileBertPreTrainedModel,MobileBertTokenizer:()=>s.MobileBertTokenizer,MobileLLMForCausalLM:()=>t.MobileLLMForCausalLM,MobileLLMModel:()=>t.MobileLLMModel,MobileLLMPreTrainedModel:()=>t.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>f.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>t.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>t.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>f.MobileNetV1ImageProcessor,MobileNetV1Model:()=>t.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>t.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>f.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>t.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>t.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>f.MobileNetV2ImageProcessor,MobileNetV2Model:()=>t.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>t.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>f.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>t.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>t.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>f.MobileNetV3ImageProcessor,MobileNetV3Model:()=>t.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>t.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>f.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>t.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>t.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>f.MobileNetV4ImageProcessor,MobileNetV4Model:()=>t.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>t.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>f.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>t.MobileViTForImageClassification,MobileViTImageProcessor:()=>f.MobileViTImageProcessor,MobileViTModel:()=>t.MobileViTModel,MobileViTPreTrainedModel:()=>t.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>t.MobileViTV2ForImageClassification,MobileViTV2Model:()=>t.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>t.MobileViTV2PreTrainedModel,ModelOutput:()=>t.ModelOutput,ModernBertForMaskedLM:()=>t.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>t.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>t.ModernBertForTokenClassification,ModernBertModel:()=>t.ModernBertModel,ModernBertPreTrainedModel:()=>t.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>t.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>c.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>t.MoonshineForConditionalGeneration,MoonshineModel:()=>t.MoonshineModel,MoonshinePreTrainedModel:()=>t.MoonshinePreTrainedModel,MoonshineProcessor:()=>g.MoonshineProcessor,MptForCausalLM:()=>t.MptForCausalLM,MptModel:()=>t.MptModel,MptPreTrainedModel:()=>t.MptPreTrainedModel,MultiModalityCausalLM:()=>t.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>t.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>t.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>t.MusicgenForConditionalGeneration,MusicgenModel:()=>t.MusicgenModel,MusicgenPreTrainedModel:()=>t.MusicgenPreTrainedModel,NllbTokenizer:()=>s.NllbTokenizer,NoBadWordsLogitsProcessor:()=>v.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>v.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>t.NomicBertModel,NomicBertPreTrainedModel:()=>t.NomicBertPreTrainedModel,NougatImageProcessor:()=>f.NougatImageProcessor,NougatTokenizer:()=>s.NougatTokenizer,OPTForCausalLM:()=>t.OPTForCausalLM,OPTModel:()=>t.OPTModel,OPTPreTrainedModel:()=>t.OPTPreTrainedModel,ObjectDetectionPipeline:()=>r.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>t.Olmo2ForCausalLM,Olmo2Model:()=>t.Olmo2Model,Olmo2PreTrainedModel:()=>t.Olmo2PreTrainedModel,OlmoForCausalLM:()=>t.OlmoForCausalLM,OlmoModel:()=>t.OlmoModel,OlmoPreTrainedModel:()=>t.OlmoPreTrainedModel,OpenELMForCausalLM:()=>t.OpenELMForCausalLM,OpenELMModel:()=>t.OpenELMModel,OpenELMPreTrainedModel:()=>t.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>f.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>t.OwlViTForObjectDetection,OwlViTImageProcessor:()=>f.OwlViTImageProcessor,OwlViTModel:()=>t.OwlViTModel,OwlViTPreTrainedModel:()=>t.OwlViTPreTrainedModel,OwlViTProcessor:()=>g.OwlViTProcessor,Owlv2ForObjectDetection:()=>t.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>f.Owlv2ImageProcessor,Owlv2Model:()=>t.Owlv2Model,Owlv2PreTrainedModel:()=>t.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>t.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>t.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>g.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>t.PatchTSMixerForPrediction,PatchTSMixerModel:()=>t.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>t.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>t.PatchTSTForPrediction,PatchTSTModel:()=>t.PatchTSTModel,PatchTSTPreTrainedModel:()=>t.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>t.Phi3ForCausalLM,Phi3Model:()=>t.Phi3Model,Phi3PreTrainedModel:()=>t.Phi3PreTrainedModel,Phi3VForCausalLM:()=>t.Phi3VForCausalLM,Phi3VImageProcessor:()=>f.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>t.Phi3VPreTrainedModel,Phi3VProcessor:()=>g.Phi3VProcessor,PhiForCausalLM:()=>t.PhiForCausalLM,PhiModel:()=>t.PhiModel,PhiPreTrainedModel:()=>t.PhiPreTrainedModel,Pipeline:()=>r.Pipeline,PreTrainedModel:()=>t.PreTrainedModel,PreTrainedTokenizer:()=>s.PreTrainedTokenizer,PretrainedConfig:()=>o.PretrainedConfig,PretrainedMixin:()=>t.PretrainedMixin,Processor:()=>k.Processor,PvtForImageClassification:()=>t.PvtForImageClassification,PvtImageProcessor:()=>f.PvtImageProcessor,PvtModel:()=>t.PvtModel,PvtPreTrainedModel:()=>t.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>c.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>t.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>t.PyAnnoteModel,PyAnnotePreTrainedModel:()=>t.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>g.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>t.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>r.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>t.Qwen2ForCausalLM,Qwen2Model:()=>t.Qwen2Model,Qwen2PreTrainedModel:()=>t.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>s.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>t.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>f.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>t.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>g.Qwen2VLProcessor,Qwen3ForCausalLM:()=>t.Qwen3ForCausalLM,Qwen3Model:()=>t.Qwen3Model,Qwen3PreTrainedModel:()=>t.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>t.RFDetrForObjectDetection,RFDetrModel:()=>t.RFDetrModel,RFDetrObjectDetectionOutput:()=>t.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>t.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>t.RTDetrForObjectDetection,RTDetrImageProcessor:()=>f.RTDetrImageProcessor,RTDetrModel:()=>t.RTDetrModel,RTDetrObjectDetectionOutput:()=>t.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>t.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>t.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>t.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>t.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>t.RTDetrV2PreTrainedModel,RawAudio:()=>n.RawAudio,RawImage:()=>i.RawImage,RawVideo:()=>a.RawVideo,RawVideoFrame:()=>a.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>v.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>t.ResNetForImageClassification,ResNetModel:()=>t.ResNetModel,ResNetPreTrainedModel:()=>t.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>t.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>t.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>t.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>t.RoFormerForTokenClassification,RoFormerModel:()=>t.RoFormerModel,RoFormerPreTrainedModel:()=>t.RoFormerPreTrainedModel,RoFormerTokenizer:()=>s.RoFormerTokenizer,RobertaForMaskedLM:()=>t.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>t.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>t.RobertaForSequenceClassification,RobertaForTokenClassification:()=>t.RobertaForTokenClassification,RobertaModel:()=>t.RobertaModel,RobertaPreTrainedModel:()=>t.RobertaPreTrainedModel,RobertaTokenizer:()=>s.RobertaTokenizer,SamImageProcessor:()=>f.SamImageProcessor,SamImageSegmentationOutput:()=>t.SamImageSegmentationOutput,SamModel:()=>t.SamModel,SamPreTrainedModel:()=>t.SamPreTrainedModel,SamProcessor:()=>g.SamProcessor,SapiensForDepthEstimation:()=>t.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>t.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>t.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>t.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>c.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>f.SegformerFeatureExtractor,SegformerForImageClassification:()=>t.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>t.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>f.SegformerImageProcessor,SegformerModel:()=>t.SegformerModel,SegformerPreTrainedModel:()=>t.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>t.Seq2SeqLMOutput,SequenceClassifierOutput:()=>t.SequenceClassifierOutput,SiglipImageProcessor:()=>f.SiglipImageProcessor,SiglipModel:()=>t.SiglipModel,SiglipPreTrainedModel:()=>t.SiglipPreTrainedModel,SiglipTextModel:()=>t.SiglipTextModel,SiglipTokenizer:()=>s.SiglipTokenizer,SiglipVisionModel:()=>t.SiglipVisionModel,SmolVLMForConditionalGeneration:()=>t.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>f.SmolVLMImageProcessor,SmolVLMProcessor:()=>g.SmolVLMProcessor,SnacDecoderModel:()=>t.SnacDecoderModel,SnacEncoderModel:()=>t.SnacEncoderModel,SnacFeatureExtractor:()=>c.SnacFeatureExtractor,SnacModel:()=>t.SnacModel,SnacPreTrainedModel:()=>t.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>c.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>t.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>t.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>t.SpeechT5HifiGan,SpeechT5Model:()=>t.SpeechT5Model,SpeechT5PreTrainedModel:()=>t.SpeechT5PreTrainedModel,SpeechT5Processor:()=>g.SpeechT5Processor,SpeechT5Tokenizer:()=>s.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>t.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>t.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>t.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>t.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>t.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>s.SqueezeBertTokenizer,StableLmForCausalLM:()=>t.StableLmForCausalLM,StableLmModel:()=>t.StableLmModel,StableLmPreTrainedModel:()=>t.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>t.Starcoder2ForCausalLM,Starcoder2Model:()=>t.Starcoder2Model,Starcoder2PreTrainedModel:()=>t.Starcoder2PreTrainedModel,StoppingCriteria:()=>E.StoppingCriteria,StoppingCriteriaList:()=>E.StoppingCriteriaList,StyleTextToSpeech2Model:()=>t.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>t.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>r.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>v.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>t.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>f.Swin2SRImageProcessor,Swin2SRModel:()=>t.Swin2SRModel,Swin2SRPreTrainedModel:()=>t.Swin2SRPreTrainedModel,SwinForImageClassification:()=>t.SwinForImageClassification,SwinForSemanticSegmentation:()=>t.SwinForSemanticSegmentation,SwinModel:()=>t.SwinModel,SwinPreTrainedModel:()=>t.SwinPreTrainedModel,T5ForConditionalGeneration:()=>t.T5ForConditionalGeneration,T5Model:()=>t.T5Model,T5PreTrainedModel:()=>t.T5PreTrainedModel,T5Tokenizer:()=>s.T5Tokenizer,TableTransformerForObjectDetection:()=>t.TableTransformerForObjectDetection,TableTransformerModel:()=>t.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>t.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>t.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>v.TemperatureLogitsWarper,Tensor:()=>l.Tensor,Text2TextGenerationPipeline:()=>r.Text2TextGenerationPipeline,TextClassificationPipeline:()=>r.TextClassificationPipeline,TextGenerationPipeline:()=>r.TextGenerationPipeline,TextStreamer:()=>S.TextStreamer,TextToAudioPipeline:()=>r.TextToAudioPipeline,TokenClassificationPipeline:()=>r.TokenClassificationPipeline,TokenClassifierOutput:()=>t.TokenClassifierOutput,TokenizerModel:()=>s.TokenizerModel,TopKLogitsWarper:()=>v.TopKLogitsWarper,TopPLogitsWarper:()=>v.TopPLogitsWarper,TrOCRForCausalLM:()=>t.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>t.TrOCRPreTrainedModel,TranslationPipeline:()=>r.TranslationPipeline,UltravoxModel:()=>t.UltravoxModel,UltravoxPreTrainedModel:()=>t.UltravoxPreTrainedModel,UltravoxProcessor:()=>g.UltravoxProcessor,UniSpeechForCTC:()=>t.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>t.UniSpeechForSequenceClassification,UniSpeechModel:()=>t.UniSpeechModel,UniSpeechPreTrainedModel:()=>t.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>t.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>t.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>t.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>t.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>t.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>g.VLChatProcessor,VLMImageProcessor:()=>f.VLMImageProcessor,ViTFeatureExtractor:()=>f.ViTFeatureExtractor,ViTForImageClassification:()=>t.ViTForImageClassification,ViTImageProcessor:()=>f.ViTImageProcessor,ViTMAEModel:()=>t.ViTMAEModel,ViTMAEPreTrainedModel:()=>t.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>t.ViTMSNForImageClassification,ViTMSNModel:()=>t.ViTMSNModel,ViTMSNPreTrainedModel:()=>t.ViTMSNPreTrainedModel,ViTModel:()=>t.ViTModel,ViTPreTrainedModel:()=>t.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>t.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>t.VitMatteForImageMatting,VitMatteImageProcessor:()=>f.VitMatteImageProcessor,VitMattePreTrainedModel:()=>t.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>t.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>f.VitPoseImageProcessor,VitPosePreTrainedModel:()=>t.VitPosePreTrainedModel,VitsModel:()=>t.VitsModel,VitsModelOutput:()=>t.VitsModelOutput,VitsPreTrainedModel:()=>t.VitsPreTrainedModel,VitsTokenizer:()=>s.VitsTokenizer,Wav2Vec2BertForCTC:()=>t.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>t.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>t.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>t.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>s.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>c.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>t.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>t.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>t.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>t.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>t.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>g.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>g.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>t.WavLMForAudioFrameClassification,WavLMForCTC:()=>t.WavLMForCTC,WavLMForSequenceClassification:()=>t.WavLMForSequenceClassification,WavLMForXVector:()=>t.WavLMForXVector,WavLMModel:()=>t.WavLMModel,WavLMPreTrainedModel:()=>t.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>c.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>t.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>t.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>c.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>t.WhisperForConditionalGeneration,WhisperModel:()=>t.WhisperModel,WhisperPreTrainedModel:()=>t.WhisperPreTrainedModel,WhisperProcessor:()=>g.WhisperProcessor,WhisperTextStreamer:()=>S.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>v.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>s.WhisperTokenizer,XLMForQuestionAnswering:()=>t.XLMForQuestionAnswering,XLMForSequenceClassification:()=>t.XLMForSequenceClassification,XLMForTokenClassification:()=>t.XLMForTokenClassification,XLMModel:()=>t.XLMModel,XLMPreTrainedModel:()=>t.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>t.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>t.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>t.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>t.XLMRobertaForTokenClassification,XLMRobertaModel:()=>t.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>t.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>s.XLMRobertaTokenizer,XLMTokenizer:()=>s.XLMTokenizer,XLMWithLMHeadModel:()=>t.XLMWithLMHeadModel,XVectorOutput:()=>t.XVectorOutput,YolosFeatureExtractor:()=>f.YolosFeatureExtractor,YolosForObjectDetection:()=>t.YolosForObjectDetection,YolosImageProcessor:()=>f.YolosImageProcessor,YolosModel:()=>t.YolosModel,YolosObjectDetectionOutput:()=>t.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>t.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>r.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>r.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>r.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>r.ZeroShotObjectDetectionPipeline,bankers_round:()=>u.bankers_round,cat:()=>l.cat,cos_sim:()=>u.cos_sim,dot:()=>u.dot,dynamic_time_warping:()=>u.dynamic_time_warping,env:()=>e.env,full:()=>l.full,full_like:()=>l.full_like,getKeyValueShapes:()=>o.getKeyValueShapes,hamming:()=>n.hamming,hanning:()=>n.hanning,interpolate:()=>l.interpolate,interpolate_4d:()=>l.interpolate_4d,interpolate_data:()=>u.interpolate_data,is_chinese_char:()=>s.is_chinese_char,layer_norm:()=>l.layer_norm,load_image:()=>i.load_image,load_video:()=>a.load_video,log_softmax:()=>u.log_softmax,magnitude:()=>u.magnitude,matmul:()=>l.matmul,max:()=>u.max,mean:()=>l.mean,mean_pooling:()=>l.mean_pooling,medianFilter:()=>u.medianFilter,mel_filter_bank:()=>n.mel_filter_bank,min:()=>u.min,ones:()=>l.ones,ones_like:()=>l.ones_like,permute:()=>l.permute,permute_data:()=>u.permute_data,pipeline:()=>r.pipeline,quantize_embeddings:()=>l.quantize_embeddings,rand:()=>l.rand,read_audio:()=>n.read_audio,rfft:()=>l.rfft,round:()=>u.round,slice:()=>l.slice,softmax:()=>u.softmax,spectrogram:()=>n.spectrogram,stack:()=>l.stack,std_mean:()=>l.std_mean,topk:()=>l.topk,window_function:()=>n.window_function,zeros:()=>l.zeros,zeros_like:()=>l.zeros_like});var e=Bt("./src/env.js"),r=Bt("./src/pipelines.js"),t=Bt("./src/models.js"),s=Bt("./src/tokenizers.js"),o=Bt("./src/configs.js"),n=Bt("./src/utils/audio.js"),i=Bt("./src/utils/image.js"),a=Bt("./src/utils/video.js"),l=Bt("./src/utils/tensor.js"),u=Bt("./src/utils/maths.js"),p=Bt("./src/base/feature_extraction_utils.js"),c=Bt("./src/models/feature_extractors.js"),d=Bt("./src/models/auto/feature_extraction_auto.js"),_=Bt("./src/base/image_processors_utils.js"),f=Bt("./src/models/image_processors.js"),T=Bt("./src/models/auto/image_processing_auto.js"),k=Bt("./src/base/processing_utils.js"),g=Bt("./src/models/processors.js"),w=Bt("./src/models/auto/processing_auto.js"),S=Bt("./src/generation/streamers.js"),E=Bt("./src/generation/stopping_criteria.js"),v=Bt("./src/generation/logits_process.js")})(),m.ASTFeatureExtractor,m.ASTForAudioClassification,m.ASTModel,m.ASTPreTrainedModel,m.AlbertForMaskedLM,m.AlbertForQuestionAnswering,m.AlbertForSequenceClassification,m.AlbertModel,m.AlbertPreTrainedModel,m.AlbertTokenizer,m.AudioClassificationPipeline,m.AutoConfig,m.AutoFeatureExtractor,m.AutoImageProcessor,m.AutoModel,m.AutoModelForAudioClassification,m.AutoModelForAudioFrameClassification,m.AutoModelForAudioTextToText,m.AutoModelForCTC,m.AutoModelForCausalLM,m.AutoModelForDepthEstimation,m.AutoModelForDocumentQuestionAnswering,m.AutoModelForImageClassification,m.AutoModelForImageFeatureExtraction,m.AutoModelForImageMatting,m.AutoModelForImageSegmentation,m.AutoModelForImageTextToText,m.AutoModelForImageToImage,m.AutoModelForMaskGeneration,m.AutoModelForMaskedLM,m.AutoModelForNormalEstimation,m.AutoModelForObjectDetection,m.AutoModelForPoseEstimation,m.AutoModelForQuestionAnswering,m.AutoModelForSemanticSegmentation,m.AutoModelForSeq2SeqLM,m.AutoModelForSequenceClassification,m.AutoModelForSpeechSeq2Seq,m.AutoModelForTextToSpectrogram,m.AutoModelForTextToWaveform,m.AutoModelForTokenClassification,m.AutoModelForUniversalSegmentation,m.AutoModelForVision2Seq,m.AutoModelForXVector,m.AutoModelForZeroShotObjectDetection;var Sx=m.AutoProcessor,$x=m.AutoTokenizer;m.AutomaticSpeechRecognitionPipeline,m.BackgroundRemovalPipeline,m.BartForConditionalGeneration,m.BartForSequenceClassification,m.BartModel,m.BartPretrainedModel,m.BartTokenizer,m.BaseModelOutput,m.BaseStreamer,m.BeitFeatureExtractor,m.BeitForImageClassification,m.BeitModel,m.BeitPreTrainedModel,m.BertForMaskedLM,m.BertForQuestionAnswering,m.BertForSequenceClassification,m.BertForTokenClassification,m.BertModel,m.BertPreTrainedModel,m.BertTokenizer,m.BitImageProcessor,m.BlenderbotForConditionalGeneration,m.BlenderbotModel,m.BlenderbotPreTrainedModel,m.BlenderbotSmallForConditionalGeneration,m.BlenderbotSmallModel,m.BlenderbotSmallPreTrainedModel,m.BlenderbotSmallTokenizer,m.BlenderbotTokenizer,m.BloomForCausalLM,m.BloomModel,m.BloomPreTrainedModel,m.BloomTokenizer,m.CLIPFeatureExtractor,m.CLIPImageProcessor,m.CLIPModel,m.CLIPPreTrainedModel,m.CLIPSegForImageSegmentation,m.CLIPSegModel,m.CLIPSegPreTrainedModel,m.CLIPTextModel,m.CLIPTextModelWithProjection,m.CLIPTokenizer,m.CLIPVisionModel,m.CLIPVisionModelWithProjection,m.CamembertForMaskedLM,m.CamembertForQuestionAnswering,m.CamembertForSequenceClassification,m.CamembertForTokenClassification,m.CamembertModel,m.CamembertPreTrainedModel,m.CamembertTokenizer,m.CausalLMOutput,m.CausalLMOutputWithPast,m.ChineseCLIPFeatureExtractor,m.ChineseCLIPModel,m.ChineseCLIPPreTrainedModel,m.ClapAudioModelWithProjection,m.ClapFeatureExtractor,m.ClapModel,m.ClapPreTrainedModel,m.ClapTextModelWithProjection,m.ClassifierFreeGuidanceLogitsProcessor,m.CodeGenForCausalLM,m.CodeGenModel,m.CodeGenPreTrainedModel,m.CodeGenTokenizer,m.CodeLlamaTokenizer,m.CohereForCausalLM,m.CohereModel,m.CoherePreTrainedModel,m.CohereTokenizer,m.ConvBertForMaskedLM,m.ConvBertForQuestionAnswering,m.ConvBertForSequenceClassification,m.ConvBertForTokenClassification,m.ConvBertModel,m.ConvBertPreTrainedModel,m.ConvBertTokenizer,m.ConvNextFeatureExtractor,m.ConvNextForImageClassification,m.ConvNextImageProcessor,m.ConvNextModel,m.ConvNextPreTrainedModel,m.ConvNextV2ForImageClassification,m.ConvNextV2Model,m.ConvNextV2PreTrainedModel,m.DFineForObjectDetection,m.DFineModel,m.DFinePreTrainedModel,m.DPTFeatureExtractor,m.DPTForDepthEstimation,m.DPTImageProcessor,m.DPTModel,m.DPTPreTrainedModel,m.DacDecoderModel,m.DacDecoderOutput,m.DacEncoderModel,m.DacEncoderOutput,m.DacFeatureExtractor,m.DacModel,m.DacPreTrainedModel,m.DataTypeMap,m.DebertaForMaskedLM,m.DebertaForQuestionAnswering,m.DebertaForSequenceClassification,m.DebertaForTokenClassification,m.DebertaModel,m.DebertaPreTrainedModel,m.DebertaTokenizer,m.DebertaV2ForMaskedLM,m.DebertaV2ForQuestionAnswering,m.DebertaV2ForSequenceClassification,m.DebertaV2ForTokenClassification,m.DebertaV2Model,m.DebertaV2PreTrainedModel,m.DebertaV2Tokenizer,m.DecisionTransformerModel,m.DecisionTransformerPreTrainedModel,m.DeiTFeatureExtractor,m.DeiTForImageClassification,m.DeiTImageProcessor,m.DeiTModel,m.DeiTPreTrainedModel,m.DepthAnythingForDepthEstimation,m.DepthAnythingPreTrainedModel,m.DepthEstimationPipeline,m.DepthProForDepthEstimation,m.DepthProPreTrainedModel,m.DetrFeatureExtractor,m.DetrForObjectDetection,m.DetrForSegmentation,m.DetrImageProcessor,m.DetrModel,m.DetrObjectDetectionOutput,m.DetrPreTrainedModel,m.DetrSegmentationOutput,m.Dinov2ForImageClassification,m.Dinov2Model,m.Dinov2PreTrainedModel,m.Dinov2WithRegistersForImageClassification,m.Dinov2WithRegistersModel,m.Dinov2WithRegistersPreTrainedModel,m.DistilBertForMaskedLM,m.DistilBertForQuestionAnswering,m.DistilBertForSequenceClassification,m.DistilBertForTokenClassification,m.DistilBertModel,m.DistilBertPreTrainedModel,m.DistilBertTokenizer,m.DocumentQuestionAnsweringPipeline,m.DonutFeatureExtractor,m.DonutImageProcessor,m.DonutSwinModel,m.DonutSwinPreTrainedModel,m.EfficientNetForImageClassification,m.EfficientNetImageProcessor,m.EfficientNetModel,m.EfficientNetPreTrainedModel,m.ElectraForMaskedLM,m.ElectraForQuestionAnswering,m.ElectraForSequenceClassification,m.ElectraForTokenClassification,m.ElectraModel,m.ElectraPreTrainedModel,m.ElectraTokenizer,m.EncodecFeatureExtractor,m.EosTokenCriteria,m.EsmForMaskedLM,m.EsmForSequenceClassification,m.EsmForTokenClassification,m.EsmModel,m.EsmPreTrainedModel,m.EsmTokenizer,m.ExaoneForCausalLM,m.ExaoneModel,m.ExaonePreTrainedModel,m.FFT,m.FalconForCausalLM,m.FalconModel,m.FalconPreTrainedModel,m.FalconTokenizer,m.FastViTForImageClassification,m.FastViTModel,m.FastViTPreTrainedModel,m.FeatureExtractionPipeline,m.FeatureExtractor,m.FillMaskPipeline,m.Florence2ForConditionalGeneration,m.Florence2PreTrainedModel,m.Florence2Processor,m.ForcedBOSTokenLogitsProcessor,m.ForcedEOSTokenLogitsProcessor,m.GLPNFeatureExtractor,m.GLPNForDepthEstimation,m.GLPNModel,m.GLPNPreTrainedModel,m.GPT2LMHeadModel,m.GPT2Model,m.GPT2PreTrainedModel,m.GPT2Tokenizer,m.GPTBigCodeForCausalLM,m.GPTBigCodeModel,m.GPTBigCodePreTrainedModel,m.GPTJForCausalLM,m.GPTJModel,m.GPTJPreTrainedModel,m.GPTNeoForCausalLM,m.GPTNeoModel,m.GPTNeoPreTrainedModel,m.GPTNeoXForCausalLM,m.GPTNeoXModel,m.GPTNeoXPreTrainedModel,m.GPTNeoXTokenizer,m.Gemma2ForCausalLM,m.Gemma2Model,m.Gemma2PreTrainedModel,m.Gemma3ForCausalLM,m.Gemma3Model,m.Gemma3PreTrainedModel,m.GemmaForCausalLM,m.GemmaModel,m.GemmaPreTrainedModel,m.GemmaTokenizer,m.GlmForCausalLM,m.GlmModel,m.GlmPreTrainedModel,m.GraniteForCausalLM,m.GraniteModel,m.GranitePreTrainedModel,m.Grok1Tokenizer,m.GroundingDinoForObjectDetection,m.GroundingDinoImageProcessor,m.GroundingDinoPreTrainedModel,m.GroundingDinoProcessor,m.GroupViTModel,m.GroupViTPreTrainedModel,m.HeliumForCausalLM,m.HeliumModel,m.HeliumPreTrainedModel,m.HerbertTokenizer,m.HieraForImageClassification,m.HieraModel,m.HieraPreTrainedModel,m.HubertForCTC,m.HubertForSequenceClassification,m.HubertModel,m.HubertPreTrainedModel,m.IJepaForImageClassification,m.IJepaModel,m.IJepaPreTrainedModel,m.Idefics3ForConditionalGeneration,m.Idefics3ImageProcessor,m.Idefics3PreTrainedModel,m.Idefics3Processor,m.ImageClassificationPipeline,m.ImageFeatureExtractionPipeline,m.ImageFeatureExtractor,m.ImageMattingOutput,m.ImageProcessor,m.ImageSegmentationPipeline,m.ImageToImagePipeline,m.ImageToTextPipeline,m.InterruptableStoppingCriteria,m.JAISLMHeadModel,m.JAISModel,m.JAISPreTrainedModel,m.JinaCLIPImageProcessor,m.JinaCLIPModel,m.JinaCLIPPreTrainedModel,m.JinaCLIPProcessor,m.JinaCLIPTextModel,m.JinaCLIPVisionModel,m.LiteWhisperForConditionalGeneration,m.LlamaForCausalLM,m.LlamaModel,m.LlamaPreTrainedModel,m.LlamaTokenizer,m.LlavaForConditionalGeneration,m.LlavaOnevisionForConditionalGeneration,m.LlavaOnevisionImageProcessor,m.LlavaPreTrainedModel,m.LogitsProcessor,m.LogitsProcessorList,m.LogitsWarper,m.LongT5ForConditionalGeneration,m.LongT5Model,m.LongT5PreTrainedModel,m.M2M100ForConditionalGeneration,m.M2M100Model,m.M2M100PreTrainedModel,m.M2M100Tokenizer,m.MBart50Tokenizer,m.MBartForCausalLM,m.MBartForConditionalGeneration,m.MBartForSequenceClassification,m.MBartModel,m.MBartPreTrainedModel,m.MBartTokenizer,m.MPNetForMaskedLM,m.MPNetForQuestionAnswering,m.MPNetForSequenceClassification,m.MPNetForTokenClassification,m.MPNetModel,m.MPNetPreTrainedModel,m.MPNetTokenizer,m.MT5ForConditionalGeneration,m.MT5Model,m.MT5PreTrainedModel,m.MarianMTModel,m.MarianModel,m.MarianPreTrainedModel,m.MarianTokenizer,m.Mask2FormerImageProcessor,m.MaskFormerFeatureExtractor,m.MaskFormerForInstanceSegmentation,m.MaskFormerImageProcessor,m.MaskFormerModel,m.MaskFormerPreTrainedModel,m.MaskedLMOutput,m.MaxLengthCriteria,m.Metric3DForDepthEstimation,m.Metric3DPreTrainedModel,m.Metric3Dv2ForDepthEstimation,m.Metric3Dv2PreTrainedModel,m.MgpstrForSceneTextRecognition,m.MgpstrModelOutput,m.MgpstrPreTrainedModel,m.MgpstrProcessor,m.MgpstrTokenizer,m.MimiDecoderModel,m.MimiDecoderOutput,m.MimiEncoderModel,m.MimiEncoderOutput,m.MimiModel,m.MimiPreTrainedModel,m.MinLengthLogitsProcessor,m.MinNewTokensLengthLogitsProcessor,m.MistralForCausalLM,m.MistralModel,m.MistralPreTrainedModel,m.MobileBertForMaskedLM,m.MobileBertForQuestionAnswering,m.MobileBertForSequenceClassification,m.MobileBertModel,m.MobileBertPreTrainedModel,m.MobileBertTokenizer,m.MobileLLMForCausalLM,m.MobileLLMModel,m.MobileLLMPreTrainedModel,m.MobileNetV1FeatureExtractor,m.MobileNetV1ForImageClassification,m.MobileNetV1ForSemanticSegmentation,m.MobileNetV1ImageProcessor,m.MobileNetV1Model,m.MobileNetV1PreTrainedModel,m.MobileNetV2FeatureExtractor,m.MobileNetV2ForImageClassification,m.MobileNetV2ForSemanticSegmentation,m.MobileNetV2ImageProcessor,m.MobileNetV2Model,m.MobileNetV2PreTrainedModel,m.MobileNetV3FeatureExtractor,m.MobileNetV3ForImageClassification,m.MobileNetV3ForSemanticSegmentation,m.MobileNetV3ImageProcessor,m.MobileNetV3Model,m.MobileNetV3PreTrainedModel,m.MobileNetV4FeatureExtractor,m.MobileNetV4ForImageClassification,m.MobileNetV4ForSemanticSegmentation,m.MobileNetV4ImageProcessor,m.MobileNetV4Model,m.MobileNetV4PreTrainedModel,m.MobileViTFeatureExtractor,m.MobileViTForImageClassification,m.MobileViTImageProcessor,m.MobileViTModel,m.MobileViTPreTrainedModel,m.MobileViTV2ForImageClassification,m.MobileViTV2Model,m.MobileViTV2PreTrainedModel,m.ModelOutput,m.ModernBertForMaskedLM,m.ModernBertForSequenceClassification,m.ModernBertForTokenClassification,m.ModernBertModel,m.ModernBertPreTrainedModel,m.Moondream1ForConditionalGeneration,m.MoonshineFeatureExtractor,m.MoonshineForConditionalGeneration,m.MoonshineModel,m.MoonshinePreTrainedModel,m.MoonshineProcessor,m.MptForCausalLM,m.MptModel,m.MptPreTrainedModel,m.MultiModalityCausalLM,m.MultiModalityPreTrainedModel,m.MusicgenForCausalLM,m.MusicgenForConditionalGeneration,m.MusicgenModel,m.MusicgenPreTrainedModel,m.NllbTokenizer,m.NoBadWordsLogitsProcessor,m.NoRepeatNGramLogitsProcessor,m.NomicBertModel,m.NomicBertPreTrainedModel,m.NougatImageProcessor,m.NougatTokenizer,m.OPTForCausalLM,m.OPTModel,m.OPTPreTrainedModel,m.ObjectDetectionPipeline,m.Olmo2ForCausalLM,m.Olmo2Model,m.Olmo2PreTrainedModel,m.OlmoForCausalLM,m.OlmoModel,m.OlmoPreTrainedModel,m.OpenELMForCausalLM,m.OpenELMModel,m.OpenELMPreTrainedModel,m.OwlViTFeatureExtractor,m.OwlViTForObjectDetection,m.OwlViTImageProcessor,m.OwlViTModel,m.OwlViTPreTrainedModel,m.OwlViTProcessor,m.Owlv2ForObjectDetection,m.Owlv2ImageProcessor,m.Owlv2Model,m.Owlv2PreTrainedModel,m.PaliGemmaForConditionalGeneration,m.PaliGemmaPreTrainedModel,m.PaliGemmaProcessor,m.PatchTSMixerForPrediction,m.PatchTSMixerModel,m.PatchTSMixerPreTrainedModel,m.PatchTSTForPrediction,m.PatchTSTModel,m.PatchTSTPreTrainedModel,m.Phi3ForCausalLM,m.Phi3Model,m.Phi3PreTrainedModel,m.Phi3VForCausalLM,m.Phi3VImageProcessor,m.Phi3VPreTrainedModel,m.Phi3VProcessor,m.PhiForCausalLM,m.PhiModel,m.PhiPreTrainedModel,m.Pipeline,m.PreTrainedModel,m.PreTrainedTokenizer,m.PretrainedConfig,m.PretrainedMixin,m.Processor,m.PvtForImageClassification,m.PvtImageProcessor,m.PvtModel,m.PvtPreTrainedModel,m.PyAnnoteFeatureExtractor,m.PyAnnoteForAudioFrameClassification,m.PyAnnoteModel,m.PyAnnotePreTrainedModel,m.PyAnnoteProcessor,m.QuestionAnsweringModelOutput,m.QuestionAnsweringPipeline,m.Qwen2ForCausalLM,m.Qwen2Model,m.Qwen2PreTrainedModel,m.Qwen2Tokenizer,m.Qwen2VLForConditionalGeneration,m.Qwen2VLImageProcessor,m.Qwen2VLPreTrainedModel,m.Qwen2VLProcessor,m.Qwen3ForCausalLM,m.Qwen3Model,m.Qwen3PreTrainedModel,m.RFDetrForObjectDetection,m.RFDetrModel,m.RFDetrObjectDetectionOutput,m.RFDetrPreTrainedModel,m.RTDetrForObjectDetection,m.RTDetrImageProcessor,m.RTDetrModel,m.RTDetrObjectDetectionOutput,m.RTDetrPreTrainedModel,m.RTDetrV2ForObjectDetection,m.RTDetrV2Model,m.RTDetrV2ObjectDetectionOutput,m.RTDetrV2PreTrainedModel,m.RawAudio,m.RawImage,m.RawVideo,m.RawVideoFrame,m.RepetitionPenaltyLogitsProcessor,m.ResNetForImageClassification,m.ResNetModel,m.ResNetPreTrainedModel,m.RoFormerForMaskedLM,m.RoFormerForQuestionAnswering,m.RoFormerForSequenceClassification,m.RoFormerForTokenClassification,m.RoFormerModel,m.RoFormerPreTrainedModel,m.RoFormerTokenizer,m.RobertaForMaskedLM,m.RobertaForQuestionAnswering,m.RobertaForSequenceClassification,m.RobertaForTokenClassification,m.RobertaModel,m.RobertaPreTrainedModel,m.RobertaTokenizer,m.SamImageProcessor,m.SamImageSegmentationOutput,m.SamModel,m.SamPreTrainedModel,m.SamProcessor,m.SapiensForDepthEstimation,m.SapiensForNormalEstimation,m.SapiensForSemanticSegmentation,m.SapiensPreTrainedModel,m.SeamlessM4TFeatureExtractor,m.SegformerFeatureExtractor,m.SegformerForImageClassification,m.SegformerForSemanticSegmentation,m.SegformerImageProcessor,m.SegformerModel,m.SegformerPreTrainedModel,m.Seq2SeqLMOutput,m.SequenceClassifierOutput,m.SiglipImageProcessor,m.SiglipModel,m.SiglipPreTrainedModel,m.SiglipTextModel,m.SiglipTokenizer,m.SiglipVisionModel,m.SmolVLMForConditionalGeneration,m.SmolVLMImageProcessor,m.SmolVLMProcessor,m.SnacDecoderModel,m.SnacEncoderModel,m.SnacFeatureExtractor,m.SnacModel,m.SnacPreTrainedModel,m.SpeechT5FeatureExtractor,m.SpeechT5ForSpeechToText,m.SpeechT5ForTextToSpeech,m.SpeechT5HifiGan,m.SpeechT5Model,m.SpeechT5PreTrainedModel,m.SpeechT5Processor,m.SpeechT5Tokenizer,m.SqueezeBertForMaskedLM,m.SqueezeBertForQuestionAnswering,m.SqueezeBertForSequenceClassification,m.SqueezeBertModel,m.SqueezeBertPreTrainedModel,m.SqueezeBertTokenizer,m.StableLmForCausalLM,m.StableLmModel,m.StableLmPreTrainedModel,m.Starcoder2ForCausalLM,m.Starcoder2Model,m.Starcoder2PreTrainedModel,m.StoppingCriteria,m.StoppingCriteriaList,m.StyleTextToSpeech2Model,m.StyleTextToSpeech2PreTrainedModel,m.SummarizationPipeline,m.SuppressTokensAtBeginLogitsProcessor,m.Swin2SRForImageSuperResolution,m.Swin2SRImageProcessor,m.Swin2SRModel,m.Swin2SRPreTrainedModel,m.SwinForImageClassification,m.SwinForSemanticSegmentation,m.SwinModel,m.SwinPreTrainedModel,m.T5ForConditionalGeneration,m.T5Model,m.T5PreTrainedModel,m.T5Tokenizer,m.TableTransformerForObjectDetection,m.TableTransformerModel,m.TableTransformerObjectDetectionOutput,m.TableTransformerPreTrainedModel,m.TemperatureLogitsWarper,m.Tensor,m.Text2TextGenerationPipeline,m.TextClassificationPipeline,m.TextGenerationPipeline;var kx=m.TextStreamer;m.TextToAudioPipeline,m.TokenClassificationPipeline,m.TokenClassifierOutput,m.TokenizerModel,m.TopKLogitsWarper,m.TopPLogitsWarper,m.TrOCRForCausalLM,m.TrOCRPreTrainedModel,m.TranslationPipeline,m.UltravoxModel,m.UltravoxPreTrainedModel,m.UltravoxProcessor,m.UniSpeechForCTC,m.UniSpeechForSequenceClassification,m.UniSpeechModel,m.UniSpeechPreTrainedModel,m.UniSpeechSatForAudioFrameClassification,m.UniSpeechSatForCTC,m.UniSpeechSatForSequenceClassification,m.UniSpeechSatModel,m.UniSpeechSatPreTrainedModel,m.VLChatProcessor,m.VLMImageProcessor,m.ViTFeatureExtractor,m.ViTForImageClassification,m.ViTImageProcessor,m.ViTMAEModel,m.ViTMAEPreTrainedModel,m.ViTMSNForImageClassification,m.ViTMSNModel,m.ViTMSNPreTrainedModel,m.ViTModel,m.ViTPreTrainedModel,m.VisionEncoderDecoderModel,m.VitMatteForImageMatting,m.VitMatteImageProcessor,m.VitMattePreTrainedModel,m.VitPoseForPoseEstimation,m.VitPoseImageProcessor,m.VitPosePreTrainedModel,m.VitsModel,m.VitsModelOutput,m.VitsPreTrainedModel,m.VitsTokenizer,m.Wav2Vec2BertForCTC,m.Wav2Vec2BertForSequenceClassification,m.Wav2Vec2BertModel,m.Wav2Vec2BertPreTrainedModel,m.Wav2Vec2CTCTokenizer,m.Wav2Vec2FeatureExtractor,m.Wav2Vec2ForAudioFrameClassification,m.Wav2Vec2ForCTC,m.Wav2Vec2ForSequenceClassification,m.Wav2Vec2Model,m.Wav2Vec2PreTrainedModel,m.Wav2Vec2Processor,m.Wav2Vec2ProcessorWithLM,m.WavLMForAudioFrameClassification,m.WavLMForCTC,m.WavLMForSequenceClassification,m.WavLMForXVector,m.WavLMModel,m.WavLMPreTrainedModel,m.WeSpeakerFeatureExtractor,m.WeSpeakerResNetModel,m.WeSpeakerResNetPreTrainedModel,m.WhisperFeatureExtractor;var Ix=m.WhisperForConditionalGeneration;m.WhisperModel,m.WhisperPreTrainedModel,m.WhisperProcessor,m.WhisperTextStreamer,m.WhisperTimeStampLogitsProcessor,m.WhisperTokenizer,m.XLMForQuestionAnswering,m.XLMForSequenceClassification,m.XLMForTokenClassification,m.XLMModel,m.XLMPreTrainedModel,m.XLMRobertaForMaskedLM,m.XLMRobertaForQuestionAnswering,m.XLMRobertaForSequenceClassification,m.XLMRobertaForTokenClassification,m.XLMRobertaModel,m.XLMRobertaPreTrainedModel,m.XLMRobertaTokenizer,m.XLMTokenizer,m.XLMWithLMHeadModel,m.XVectorOutput,m.YolosFeatureExtractor,m.YolosForObjectDetection,m.YolosImageProcessor,m.YolosModel,m.YolosObjectDetectionOutput,m.YolosPreTrainedModel,m.ZeroShotAudioClassificationPipeline,m.ZeroShotClassificationPipeline,m.ZeroShotImageClassificationPipeline,m.ZeroShotObjectDetectionPipeline,m.bankers_round,m.cat,m.cos_sim,m.dot,m.dynamic_time_warping,m.env;var Ax=m.full;m.full_like,m.getKeyValueShapes,m.hamming,m.hanning,m.interpolate,m.interpolate_4d,m.interpolate_data,m.is_chinese_char,m.layer_norm,m.load_image,m.load_video,m.log_softmax,m.magnitude,m.matmul,m.max,m.mean,m.mean_pooling,m.medianFilter,m.mel_filter_bank,m.min,m.ones,m.ones_like,m.permute,m.permute_data,m.pipeline,m.quantize_embeddings,m.rand,m.read_audio,m.rfft,m.round,m.slice,m.softmax,m.spectrogram,m.stack,m.std_mean,m.topk,m.window_function,m.zeros,m.zeros_like;const Fx=64;class Gn{static async getInstance(r){return this.model_id="onnx-community/whisper-large-v3-turbo",this.tokenizer??(this.tokenizer=$x.from_pretrained(this.model_id,{progress_callback:r})),this.processor??(this.processor=Sx.from_pretrained(this.model_id,{progress_callback:r})),this.model??(this.model=Ix.from_pretrained(this.model_id,{dtype:{encoder_model:"fp16",decoder_model_merged:"q4"},device:"webgpu",progress_callback:r})),Promise.all([this.tokenizer,this.processor,this.model])}}Y(Gn,"model_id",null),Y(Gn,"tokenizer"),Y(Gn,"processor"),Y(Gn,"model");async function Ox(e){const r=atob(e),t=new Uint8Array(r.length);for(let n=0;n{i??(i=performance.now());let f;a++>0&&(f=a/(performance.now()-i)*1e3),globalThis.postMessage({status:"update",output:_,tps:f,numTokens:a})},u=new kx(s,{skip_prompt:!0,decode_kwargs:{skip_special_tokens:!0},callback_function:l}),p=await o(t),c=await n.generate({...p,max_new_tokens:Fx,language:r,streamer:u}),d=s.batch_decode(c,{skip_special_tokens:!0});globalThis.postMessage({status:"complete",output:d}),du=!1}async function Lx(){globalThis.postMessage({status:"loading",data:"Loading model..."});const[e,r,t]=await Gn.getInstance(s=>{globalThis.postMessage(s)});globalThis.postMessage({status:"loading",data:"Compiling shaders and warming up model..."}),await t.generate({input_features:Ax([1,128,3e3],0),max_new_tokens:1}),globalThis.postMessage({status:"ready"})}globalThis.addEventListener("message",async e=>{const{type:r,data:t}=e.data;switch(r){case"load":Lx();break;case"generate":Dx(t);break}})})(); diff --git a/assets/xai-BPN2lmAh.js b/assets/xai-BPN2lmAh.js deleted file mode 100644 index 9dc5ab26851024d8850cec3e5dba89cc3d8fbfbb..0000000000000000000000000000000000000000 --- a/assets/xai-BPN2lmAh.js +++ /dev/null @@ -1 +0,0 @@ -import"./Select.vue_vue_type_style_index_0_lang-csKR1SR-.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js";import{d as x,$ as U,V as $,a0 as k,f as v,T as y,w as K,bf as h,o as w,bg as m,b as l,u as t}from"./index-D7HCX4VR.js";import"./three-vrm.module-DiGxQJqt.js";import"./emotions-DWNSb738.js";import"./mcp-DgU0tpf-.js";import{u as z}from"./providers-DepZj6_J.js";import{_ as M}from"./ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js";import{_ as P}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js";import{_ as R}from"./ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js";import{_ as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./index-CIqqlMPn.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js";import"./Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js";const a="xai",C=x({__name:"xai",setup(I){const{t:u}=U(),b=$(),d=z(),{providers:o}=k(d),n=v(()=>d.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return w(),h(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:m(()=>[l(t(S),null,{default:m(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(P),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/xai-BTOkQ787.js b/assets/xai-BTOkQ787.js new file mode 100644 index 0000000000000000000000000000000000000000..7f4a4a29a792c5a533853db6c859ac1aa0eec566 --- /dev/null +++ b/assets/xai-BTOkQ787.js @@ -0,0 +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-BtAisBe9.js";import"./import-url-browser-BvZvAmFy.js";import"./duckdb-mvp-C3i5IjU8.js";import"./index-CISmcbXk-s07e23Qe.js";import"./types-D50Xq0so.js";import{useProvidersStore as f}from"./stores-mOXXrrXB.js";import"./Button-BUWHo0FI.js";import"./src-bHDRqBSs.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-B-QNW1cA.js";import"./composables-DnqWi3UL.js";import"./queue-BZUURX31.js";import"./queues-U6a2FwNq.js";import"./dist-DQi82Mjd.js";import"./webgpu-Cnn5XZ2r.js";import{route_block_default as y}from"./route-block-DNPbw0zT.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-D3-l_To2.js b/assets/zod-Db63SLXj-D3-l_To2.js deleted file mode 100644 index 35e3358c61e7c24d4eed4d9bc097eece68ebb4c1..0000000000000000000000000000000000000000 --- a/assets/zod-Db63SLXj-D3-l_To2.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BNZmqEMM.js","assets/mcp-DgU0tpf-.js","assets/index-D7HCX4VR.js","assets/index-F7nexZWB.css"])))=>i.map(i=>d[i]); -import{cT as n}from"./index-D7HCX4VR.js";import{a as t}from"./mcp-DgU0tpf-.js";const i=async()=>{let r=e=>{throw new Error(`xsschema: Missing zod v4 dependencies "zod". see ${t}`)},s=e=>{throw new Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${t}`)};try{const{toJSONSchema:e}=await n(async()=>{const{toJSONSchema:o}=await import("./index-DrKad9cl.js");return{toJSONSchema:o}},[]);r=e}catch(e){e instanceof Error&&console.error(e.message)}try{const{zodToJsonSchema:e}=await n(async()=>{const{zodToJsonSchema:o}=await import("./index-BNZmqEMM.js");return{zodToJsonSchema:o}},__vite__mapDeps([0,1,2,3]));s=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>"_zod"in e?r(e):s(e)};export{i as getToJsonSchemaFn}; diff --git a/assets/zod-Db63SLXj-DlY3ZySI.js b/assets/zod-Db63SLXj-DlY3ZySI.js new file mode 100644 index 0000000000000000000000000000000000000000..87dbf3a17f82f22b12e8166b7d0fff6f59c595bf --- /dev/null +++ b/assets/zod-Db63SLXj-DlY3ZySI.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-BZ0D1sPT.js","assets/types-D50Xq0so.js"])))=>i.map(i=>d[i]); +import{__vitePreload as e}from"./index-BtAisBe9.js";import{missingDependenciesUrl as t}from"./index-CISmcbXk-s07e23Qe.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-BgPB2AlI.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-BZ0D1sPT.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 73fb0e643beb9831972ab0cff6db3d58b63edfe5..6c55fc29b802e8e31e77cbbd6575dfe9de57758b 100644 --- a/index.html +++ b/index.html @@ -23,8 +23,8 @@ src="/remote-assets/page-external-data/js/script.js" > - - + +
diff --git a/sw.js b/sw.js index 7a11d42db16bfce0a85910b1e96a2887ee35937d..feb285a7093ce83dd374d9261bca1a25f68182a8 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 u=s||("document"in self?document.currentScript.src:"")||location.href;if(e[u])return;let n={};const t=s=>l(s,u),a={module:{uri:u},exports:n,require:t};e[u]=Promise.all(r.map((s=>a[s]||t(s)))).then((s=>(i(...s),n)))}}define(["./workbox-3aa584b4"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-FmFgRqLi.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-BIHI7g3E.js",revision:null},{url:"assets/_...all_-CvLU7PxS.js",revision:null},{url:"assets/airi-card-xdAfH1PV.js",revision:null},{url:"assets/alibaba-cloud-model-studio-sMAGnqmb.js",revision:null},{url:"assets/anthropic-Cs21upu-.js",revision:null},{url:"assets/arktype-C-GObzDh-1xlRyYUo.js",revision:null},{url:"assets/audio-C9GHcVn0.js",revision:null},{url:"assets/background-remove-BaZ8ULC5.js",revision:null},{url:"assets/Basic.vue_vue_type_script_setup_true_lang-B5smKUwB.js",revision:null},{url:"assets/browser-CkchkNbv.js",revision:null},{url:"assets/Button.vue_vue_type_script_setup_true_lang-DHcNYKaP.js",revision:null},{url:"assets/CardCreate-BjhXcczV.js",revision:null},{url:"assets/CardCreate.vue_vue_type_script_setup_true_lang-cT8qsPWn.js",revision:null},{url:"assets/CardCreationDialog-BauWAkww.css",revision:null},{url:"assets/CardCreationDialog-BD9l8__M.js",revision:null},{url:"assets/CardDetailDialog-DmXwuvrn.js",revision:null},{url:"assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-C37wIVyz.js",revision:null},{url:"assets/CardListItem-MKbZr0FQ.js",revision:null},{url:"assets/CardListItem.vue_vue_type_script_setup_true_lang-B7Q5Wxio.js",revision:null},{url:"assets/chat-w4dxGa81.js",revision:null},{url:"assets/CheckBar.vue_vue_type_script_setup_true_lang-By8B4nPO.js",revision:null},{url:"assets/cloudflare-workers-ai-DaNcyxus.js",revision:null},{url:"assets/Collapsable.vue_vue_type_script_setup_true_lang-BgecN6qM.js",revision:null},{url:"assets/color-scheme-CSVp68xe.js",revision:null},{url:"assets/color-scheme-QyqrmPIG.css",revision:null},{url:"assets/ColorPalette.vue_vue_type_script_setup_true_lang-Dcu1mOYZ.js",revision:null},{url:"assets/consciousness-CXvMPML1.js",revision:null},{url:"assets/consciousness-CZ80YtY5.js",revision:null},{url:"assets/deepseek-BnTqc4-0.js",revision:null},{url:"assets/default-browser-BrgSDbLD.js",revision:null},{url:"assets/default-DlKZnvUP.js",revision:null},{url:"assets/default-node-CNYmsmAm.js",revision:null},{url:"assets/delays-C9dF-WFD.js",revision:null},{url:"assets/DeleteCardDialog-Z5bX7ffQ.js",revision:null},{url:"assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C4u0-iKE.js",revision:null},{url:"assets/developer-Cz9wfxb0.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-CaaD-olE.js",revision:null},{url:"assets/effect-WSjEuzC9-BvZw3OJz.js",revision:null},{url:"assets/elevenlabs-L8B8Z16V.js",revision:null},{url:"assets/emotions-CgTIAVzL.js",revision:null},{url:"assets/emotions-DWNSb738.js",revision:null},{url:"assets/featherless-ai-CDy5zWmD.js",revision:null},{url:"assets/FieldInput.vue_vue_type_script_setup_true_lang-npB69nXh.js",revision:null},{url:"assets/filter-message-CHaQD-n_.js",revision:null},{url:"assets/fireworks-ai-C_DF5qcs.js",revision:null},{url:"assets/general-Bv6Tg-7n.js",revision:null},{url:"assets/google-generative-ai-CH9TwHBd.js",revision:null},{url:"assets/HeaderLink-BKV8TZb8.js",revision:null},{url:"assets/HeaderLink-CUc90b_v.css",revision:null},{url:"assets/IconAnimation.vue_vue_type_script_setup_true_lang-z-t1ytxo.js",revision:null},{url:"assets/IconItem-DcwOFLGv.js",revision:null},{url:"assets/IconStatusItem-Df4oVjQ8.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/image-orS7rPI7.js",revision:null},{url:"assets/import-url-browser-CPN8ipMD.js",revision:null},{url:"assets/import-url-node-BfNoxhRr.js",revision:null},{url:"assets/index-1wQNw9gK.js",revision:null},{url:"assets/index-2U0R-op1.css",revision:null},{url:"assets/index-BiKOctgh.js",revision:null},{url:"assets/index-BNZmqEMM.js",revision:null},{url:"assets/index-c2ht1_hO.js",revision:null},{url:"assets/index-CIqqlMPn.js",revision:null},{url:"assets/index-Cp8iQ_hy.js",revision:null},{url:"assets/index-Cq3a4k9t.js",revision:null},{url:"assets/index-CShXCEpO.js",revision:null},{url:"assets/index-CXcjO-xi.js",revision:null},{url:"assets/index-Cynu-bMx.js",revision:null},{url:"assets/index-D7HCX4VR.js",revision:null},{url:"assets/index-Dfzu84H1.js",revision:null},{url:"assets/index-DiqE0jkQ.css",revision:null},{url:"assets/index-Dpfqqu9L.js",revision:null},{url:"assets/index-DrKad9cl.js",revision:null},{url:"assets/index-DTPoQwAL.js",revision:null},{url:"assets/index-F7nexZWB.css",revision:null},{url:"assets/index-ik2DcYm-.js",revision:null},{url:"assets/index-LHmcipjy.js",revision:null},{url:"assets/index-WGruJeDd.js",revision:null},{url:"assets/Input.vue_vue_type_script_setup_true_lang-BTDULx3d.js",revision:null},{url:"assets/InputFile.vue_vue_type_script_setup_true_lang-M88MYfAL.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/mcp-DgU0tpf-.js",revision:null},{url:"assets/memory-long-term-2LsRds_J.js",revision:null},{url:"assets/memory-short-term-DP6AuBns.js",revision:null},{url:"assets/messages-CaQqrW28.js",revision:null},{url:"assets/microsoft-speech-CVJCqFk5.js",revision:null},{url:"assets/mistral-ai-CliQVdqf.js",revision:null},{url:"assets/Model.vue_vue_type_script_setup_true_lang-CrmnRvJ7.js",revision:null},{url:"assets/moonshot-ai-CfBUn2N1.js",revision:null},{url:"assets/novita-ai-QK3ydSh2.js",revision:null},{url:"assets/ollama-3pZYfERA.js",revision:null},{url:"assets/openai-audio-speech-naD8VxqX.js",revision:null},{url:"assets/openai-audio-transcription-Chj7B5G_.js",revision:null},{url:"assets/openai-CplbulQn.js",revision:null},{url:"assets/openrouter-ai-C6wwTszU.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/player2-api-de5Xsdxw.js",revision:null},{url:"assets/polaroid-DoRrbv0D.js",revision:null},{url:"assets/ProviderAdvancedSettings.vue_vue_type_script_setup_true_lang-DyAoTyc1.js",revision:null},{url:"assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BKRXTEtv.js",revision:null},{url:"assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CY_3wYwt.js",revision:null},{url:"assets/ProviderBasicSettings.vue_vue_type_script_setup_true_lang-FDIyR7vt.js",revision:null},{url:"assets/providers-DepZj6_J.js",revision:null},{url:"assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8iT0FMz.js",revision:null},{url:"assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-BXTSNxW7.js",revision:null},{url:"assets/queue-31IhYt_K.js",revision:null},{url:"assets/queue-Cq0yk53b.js",revision:null},{url:"assets/queues-CIntookp.js",revision:null},{url:"assets/RadioCardSimple-B9zVtorf.js",revision:null},{url:"assets/route-block-B_A1xBdJ.js",revision:null},{url:"assets/Screen.vue_vue_type_script_setup_true_lang-CQ37H7oV.js",revision:null},{url:"assets/Select-DG6Ttq5U.css",revision:null},{url:"assets/Select.vue_vue_type_style_index_0_lang-csKR1SR-.js",revision:null},{url:"assets/settings-B26B-JaW.js",revision:null},{url:"assets/Skeleton-CcheZNZG.css",revision:null},{url:"assets/speech-CDwZYdOU.js",revision:null},{url:"assets/speech-D8cCufg2.js",revision:null},{url:"assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-Cn-PwtFl.js",revision:null},{url:"assets/Stage-BgJLNEtF.css",revision:null},{url:"assets/stage-Rs4XkZYw.js",revision:null},{url:"assets/Stage.vue_vue_type_style_index_0_scoped_af8294f5_lang-sO-yuYZL.js",revision:null},{url:"assets/sury-DmrZ3_Oj-f8xnWriW.js",revision:null},{url:"assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-B8ttvJp0.js",revision:null},{url:"assets/Textarea.vue_vue_type_script_setup_true_lang-l_0OEYvy.js",revision:null},{url:"assets/three-vrm.module-DiGxQJqt.js",revision:null},{url:"assets/together-ai-Cyv9-plj.js",revision:null},{url:"assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DI4_VHvP.js",revision:null},{url:"assets/useIconAnimation-1wS_J1WT.js",revision:null},{url:"assets/valibot-CQk-M5rL-DQQQnI60.js",revision:null},{url:"assets/vibrant-Dx4HQHCr.js",revision:null},{url:"assets/volcengine-Do3adewX.js",revision:null},{url:"assets/worker-BwSRVkNn.js",revision:null},{url:"assets/xai-BPN2lmAh.js",revision:null},{url:"assets/zod-Db63SLXj-D3-l_To2.js",revision:null},{url:"index.html",revision:"a30626b2d41b9ac01a7e8003ae583b39"},{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-CIQGHXr-.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-DJmQZR04.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-B_lOmKXZ.js",revision:null},{url:"assets/_...all_-BUlXblH9.js",revision:null},{url:"assets/airi-card-bXvDq1QK.js",revision:null},{url:"assets/alibaba-cloud-model-studio-Di5kaCjv.js",revision:null},{url:"assets/anthropic-DUmlJu_t.js",revision:null},{url:"assets/appearance-mPITRDqf.js",revision:null},{url:"assets/arktype-C-GObzDh-Dp9wQ2EO.js",revision:null},{url:"assets/audio-DwTx1Y8I.js",revision:null},{url:"assets/background-remove-CI-N-inF.js",revision:null},{url:"assets/Basic-BA5ubWIJ.js",revision:null},{url:"assets/browser-C4moGI0I.js",revision:null},{url:"assets/browser-CMSJHaBF.js",revision:null},{url:"assets/Button-BUWHo0FI.js",revision:null},{url:"assets/Button-D6PjaMaR.css",revision:null},{url:"assets/CardCreate-qkn1QwRd.js",revision:null},{url:"assets/CardCreate-s77DpRUP.js",revision:null},{url:"assets/CardCreationDialog-C00zclL1.js",revision:null},{url:"assets/CardCreationDialog-DbUZj3zx.js",revision:null},{url:"assets/CardCreationDialog-Ic9YpxxK.css",revision:null},{url:"assets/CardDetailDialog-BUqu9VuB.js",revision:null},{url:"assets/CardDetailDialog-CJ7VvCcd.js",revision:null},{url:"assets/CardListItem-Cwi08F8K.js",revision:null},{url:"assets/CardListItem-gxbvoHYe.js",revision:null},{url:"assets/chat-Cm78FyKU.js",revision:null},{url:"assets/CheckBar-B-SKUaUP.js",revision:null},{url:"assets/cloudflare-workers-ai-CUVYqqAF.js",revision:null},{url:"assets/color-scheme-CHJXy8qz.css",revision:null},{url:"assets/color-scheme-DHCqV_sd.js",revision:null},{url:"assets/ColorPalette-DaCdckPj.js",revision:null},{url:"assets/components-B-QNW1cA.js",revision:null},{url:"assets/components-CXqNLZbx.css",revision:null},{url:"assets/composables-DnqWi3UL.js",revision:null},{url:"assets/consciousness-BhjlN9bE.js",revision:null},{url:"assets/core-BgPB2AlI.js",revision:null},{url:"assets/deepseek-zvlAqj6K.js",revision:null},{url:"assets/default-browser-BsGi6f5u.js",revision:null},{url:"assets/default-node-TdRV4SdH.js",revision:null},{url:"assets/default-t1McW1fh.js",revision:null},{url:"assets/delays-Bn4Zuwfk.js",revision:null},{url:"assets/DeleteCardDialog-DA24n-jV.js",revision:null},{url:"assets/DeleteCardDialog-WqtMeAWd.js",revision:null},{url:"assets/developer-C6qOrZzG.js",revision:null},{url:"assets/dist-CONIs07P.js",revision:null},{url:"assets/dist-DQi82Mjd.js",revision:null},{url:"assets/dist-DzeHt4xm.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-BECQ6RtH.js",revision:null},{url:"assets/elevenlabs-BU89BpOX.js",revision:null},{url:"assets/emotions-ctaIpmZy.js",revision:null},{url:"assets/esm-BZ0D1sPT.js",revision:null},{url:"assets/featherless-ai-CHBNNQNM.js",revision:null},{url:"assets/filter-message-BjGEk5iK.js",revision:null},{url:"assets/fireworks-ai-BeQmtYw-.js",revision:null},{url:"assets/general-D5ryEaZ2.js",revision:null},{url:"assets/google-generative-ai-vTI86k1V.js",revision:null},{url:"assets/HeaderLink-CI1dOuDM.css",revision:null},{url:"assets/HeaderLink-zGlOe2Jb.js",revision:null},{url:"assets/IconAnimation-B5sfLFsA.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/image-D-LGEUbE.js",revision:null},{url:"assets/import-url-browser-BvZvAmFy.js",revision:null},{url:"assets/import-url-browser-QqZ6rd6v.js",revision:null},{url:"assets/import-url-node-DT7wRTjn.js",revision:null},{url:"assets/index-BtAisBe9.js",revision:null},{url:"assets/index-CISmcbXk-s07e23Qe.js",revision:null},{url:"assets/index-D4gBs-70.css",revision:null},{url:"assets/InputFile-B1bjga7G.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/memory-0dYqsS07.js",revision:null},{url:"assets/memory-long-term-C61DZWTO.js",revision:null},{url:"assets/memory-short-term-CzuHUda_.js",revision:null},{url:"assets/messages-DDZstpir.js",revision:null},{url:"assets/microsoft-speech-DsX1wfDy.js",revision:null},{url:"assets/mistral-ai-DsX_I4X6.js",revision:null},{url:"assets/models-BR8YPV_e.css",revision:null},{url:"assets/models-TOMYe-dc.js",revision:null},{url:"assets/modules-Brjd2BIv.js",revision:null},{url:"assets/moonshot-ai-BL1GQpdJ.js",revision:null},{url:"assets/novita-ai-hF2aUTGC.js",revision:null},{url:"assets/ollama-AxPkEHcT.js",revision:null},{url:"assets/openai-audio-speech-DLCLQ0xM.js",revision:null},{url:"assets/openai-audio-transcription-BO8z1O_F.js",revision:null},{url:"assets/openai-CtCB0lo5.js",revision:null},{url:"assets/openrouter-ai-Cf4Rx59R.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/pages-CzrQCDZR.js",revision:null},{url:"assets/pages-DPSvNNh_.css",revision:null},{url:"assets/player2-api-D6m6cKGN.js",revision:null},{url:"assets/polaroid-Ce3gxIqN.js",revision:null},{url:"assets/providers-C5vrVlHa.js",revision:null},{url:"assets/queue-BZUURX31.js",revision:null},{url:"assets/queue-DEVr27WI.js",revision:null},{url:"assets/queues-U6a2FwNq.js",revision:null},{url:"assets/route-block-DNPbw0zT.js",revision:null},{url:"assets/scene-Lh08I5GV.js",revision:null},{url:"assets/settings-BPFawjNr.js",revision:null},{url:"assets/settings-CGigMZFM.js",revision:null},{url:"assets/speech-DzfbHcH_.js",revision:null},{url:"assets/src-B8Pazang.css",revision:null},{url:"assets/src-bHDRqBSs.js",revision:null},{url:"assets/stage-PXC-MtyN.js",revision:null},{url:"assets/stores-mOXXrrXB.js",revision:null},{url:"assets/sury-DmrZ3_Oj-DN8QUD-4.js",revision:null},{url:"assets/Textarea-C0dnrt_L.js",revision:null},{url:"assets/together-ai-BvvRfg0N.js",revision:null},{url:"assets/types-D50Xq0so.js",revision:null},{url:"assets/useIconAnimation-C_Mu172C.js",revision:null},{url:"assets/valibot-CQk-M5rL-CJamdyqp.js",revision:null},{url:"assets/vibrant-DyoV7uOq.js",revision:null},{url:"assets/volcengine-QjDAu2Dw.js",revision:null},{url:"assets/webgpu-Cnn5XZ2r.js",revision:null},{url:"assets/worker-Bq31kV70.js",revision:null},{url:"assets/xai-BTOkQ787.js",revision:null},{url:"assets/zod-Db63SLXj-DlY3ZySI.js",revision:null},{url:"index.html",revision:"6d08796ee478dc62002d240b8672ad55"},{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\//]}))}));